Files
Plenario/config/Migrations/20261107130000_AddQuizToSlides.php
gnilebeinandClaude Opus 5.5 fd8da4c16c
CI / Deploy / test (push) Successful in 41s
CI / Deploy / deploy (push) Skipped
Add quiz slide type
Quiz slides have predefined answers with one or more marked as correct.
The presenter starts the quiz, which then runs until its optional time
limit expires or the presenter ends it. Counts and correct answers are
only revealed once the quiz is finished; participants then see whether
their answer was right.

- migration: slide_options.is_correct, slides.voting_started_at/voting_ends_at
- Slide::isVotingOpen() includes the quiz deadline, expired quizzes are
  closed lazily when the state is read
- presenter countdown, quiz tiles and reveal with correct-answer summary
- CSV export marks quiz answers as right/wrong

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 14:39:21 +01:00

30 lines
1005 B
PHP

<?php
declare(strict_types=1);
use Migrations\BaseMigration;
/**
* Quiz slides: correct answer options and a timed voting window.
*
* slide_options.is_correct - marks the correct option(s) of a quiz
* slides.voting_started_at - when the presenter started the quiz (null = not started yet)
* slides.voting_ends_at - deadline of a timed quiz (null = closed manually by the presenter)
*/
class AddQuizToSlides extends BaseMigration
{
/**
* @return void
*/
public function change(): void
{
$this->table('slide_options')
->addColumn('is_correct', 'boolean', ['null' => false, 'default' => false, 'after' => 'label'])
->update();
$this->table('slides')
->addColumn('voting_started_at', 'datetime', ['null' => true, 'default' => null, 'after' => 'is_voting_open'])
->addColumn('voting_ends_at', 'datetime', ['null' => true, 'default' => null, 'after' => 'voting_started_at'])
->update();
}
}