Remove the "voting open" checkbox from the slide form
is_voting_open is presenter state (SlideControlService), so the form never takes it over anymore, for all slide types instead of only quiz and Q&A. New slides start open (quiz closed), as before. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
83c76d72ec
commit
bb2d1443cf
4 files changed
+9
-16
No files matched your search
@@ -37,7 +37,7 @@ class OrderSlideTest extends TestCase
|
||||
$this->assertResponseContains('name="order_options[]"');
|
||||
$this->assertResponseContains('data-order-options');
|
||||
|
||||
$data = ['type' => 'order', 'question' => 'Sortiere nach Größe', 'is_voting_open' => '1'];
|
||||
$data = ['type' => 'order', 'question' => 'Sortiere nach Größe', 'is_voting_open' => '0'];
|
||||
$this->post("/admin/$token/slides/add?type=order", $data + ['order_options' => ['Maus', '', '']]);
|
||||
$this->assertResponseOk();
|
||||
$this->assertResponseContains('Bitte gib mindestens zwei Einträge an.');
|
||||
@@ -49,7 +49,7 @@ class OrderSlideTest extends TestCase
|
||||
$this->assertRedirect(['_name' => 'admin', 'token' => $token]);
|
||||
$slide = $this->slidesTable()->find()->where(['poll_id' => $poll->id])->contain(['SlideOptions'])->firstOrFail();
|
||||
$this->assertSame(['Maus', 'Katze', 'Elefant'], array_map(fn($o) => $o->label, $slide->slide_options));
|
||||
$this->assertTrue($slide->is_voting_open);
|
||||
$this->assertTrue($slide->is_voting_open, 'the form cannot close voting, only the presenter can');
|
||||
$ids = array_map(fn($o) => $o->id, $slide->slide_options);
|
||||
|
||||
// Reordering in the editor keeps the options (ids), only the positions change.
|
||||
@@ -97,7 +97,7 @@ class OrderSlideTest extends TestCase
|
||||
{
|
||||
[$poll, $token] = $this->createPoll();
|
||||
$this->post("/admin/$token/slides/add?type=order", [
|
||||
'type' => 'order', 'question' => 'Was ist dir wichtig?', 'is_voting_open' => '1',
|
||||
'type' => 'order', 'question' => 'Was ist dir wichtig?',
|
||||
'settings' => ['ranking' => '1'], 'order_options' => ['Eins', 'Zwei', 'Drei'],
|
||||
]);
|
||||
$slide = $this->slidesTable()->find()->where(['poll_id' => $poll->id])->contain(['SlideOptions'])->firstOrFail();
|
||||
|
||||
Reference in new issue
Block a user