Reset every slide to the state of a new slide
CI / Deploy / PHP 8.4 (push) Successful in 1m4s
CI / Deploy / PHP 8.5 (push) Successful in 1m7s
CI / Deploy / test (push) Successful in 1s
CI / Deploy / deploy (push) Skipped

Resetting answers now reopens closed slides (and hides the solution of
ordering slides) instead of only restarting quiz and Q&A slides.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Sonnet 5.5 committed 2026-11-13 10:19:17 +01:00
1 parent e4622b439e
commit 0eb054ed29
3 files changed
+12 -19

No files matched your search

+4 -3
View File
@@ -52,9 +52,10 @@ class PollResetTest extends TestCase
$quiz->setVotingOpen(true);
$quiz->is_voting_open = false;
$order->is_voting_open = false;
$choice->is_voting_open = false;
$qa->stage = Slide::QA_DISCUSS;
$qa->is_voting_open = false;
$this->slidesTable()->saveManyOrFail([$quiz, $order, $qa]);
$this->slidesTable()->saveManyOrFail([$quiz, $order, $qa, $choice]);
$poll->showSlide($qa->id);
$poll->pause();
$this->pollsTable()->saveOrFail($poll);
@@ -75,10 +76,10 @@ class PollResetTest extends TestCase
$slides = $this->slidesTable();
$this->assertSame(Slide::QUIZ_READY, $slides->get($quiz->id)->quizPhase());
$this->assertNull($slides->get($quiz->id)->voting_started_at);
$this->assertFalse($slides->get($order->id)->is_voting_open, 'open/closed is kept');
$this->assertTrue($slides->get($order->id)->is_voting_open, 'ordering is open again, solution hidden');
$this->assertSame(Slide::QA_COLLECT, $slides->get($qa->id)->qaStage());
$this->assertTrue($slides->get($qa->id)->is_voting_open);
$this->assertTrue($slides->get($choice->id)->is_voting_open);
$this->assertTrue($slides->get($choice->id)->is_voting_open, 'closed slides are open again');
// Idempotent: a second reset changes nothing and does not fail.
$this->post("/admin/$token/reset");