Allow a comment without a rating on scales instead of "Keine Angabe"
CI / Deploy / PHP 8.5 (push) Successful in 1m13s
CI / Deploy / PHP 8.4 (push) Successful in 1m18s
CI / Deploy / test (push) Successful in 1s
CI / Deploy / deploy (push) Skipped

With the comment field enabled, scales and star ratings accept a
comment alone. It counts as taking part but not in the average or the
distribution; the number is shown separately. The explicit skip button
and its setting are removed again.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Sonnet 5.5 committed 2026-11-21 12:58:01 +01:00
1 parent d6432911ed
commit dbac9e93c7
14 files changed
+85 -105

No files matched your search

@@ -239,29 +239,22 @@ class ParticipateControllerTest extends TestCase
$this->assertFalse(TableRegistry::getTableLocator()->get('Responses')->exists(['text_value' => 'Hack']));
}
public function testScaleSkipButtonOnlyWithSetting(): void
public function testScaleCommentOnlyWithoutRating(): void
{
[$poll] = $this->createPoll();
$slide = $this->createSlide($poll, Slide::TYPE_SCALE);
$slide = $this->createSlide($poll, Slide::TYPE_SCALE, ['settings' => ['comments' => true]]);
$this->goLive($poll, $slide);
$this->cookie('plenario_pid', self::PID);
$this->get('/p/' . $poll->join_code);
$this->assertResponseNotContains('Keine Angabe');
$slide = $this->createSlide($poll, Slide::TYPE_SCALE, ['settings' => ['allow_skip' => true, 'comments' => true]]);
$this->goLive($poll, $slide);
$this->cookie('plenario_pid', self::PID);
$this->get('/p/' . $poll->join_code);
$this->assertResponseContains('name="skip"');
$this->assertResponseContains('auch nur einen Kommentar');
$this->assertResponseNotContains('required>');
$this->cookie('plenario_pid', self::PID);
$this->post("/p/{$poll->join_code}/vote", ['slide_id' => $slide->id, 'skip' => '1']);
$this->post("/p/{$poll->join_code}/vote", ['slide_id' => $slide->id, 'comment' => 'Keine Meinung dazu']);
$this->assertFlashMessage('Danke für deine Antwort!');
// No rating, so no comment to add afterwards.
$this->cookie('plenario_pid', self::PID);
$this->get('/p/' . $poll->join_code);
$this->assertResponseContains('Deine Antwort ist angekommen.');
$this->assertResponseNotContains('Kommentar hinzufügen');
$this->assertResponseContains('Keine Meinung dazu');
}
}