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>
This commit is contained in:
1 parent
04cbc5bcd3
commit
fd8da4c16c
18 files changed
+999
-43
No files matched your search
@@ -32,7 +32,7 @@ trait PlenarioTestTrait
|
||||
* @param \App\Model\Entity\Poll $poll Poll
|
||||
* @param string $type Slide type
|
||||
* @param array<string, mixed> $data Extra slide data
|
||||
* @param list<string> $options Option labels (choice)
|
||||
* @param list<string> $options Option labels (choice, quiz: the first one is correct)
|
||||
* @return \App\Model\Entity\Slide Slide incl. slide_options
|
||||
*/
|
||||
protected function createSlide(Poll $poll, string $type = Slide::TYPE_CHOICE, array $data = [], array $options = ['Ja', 'Nein']): Slide
|
||||
@@ -49,6 +49,10 @@ trait PlenarioTestTrait
|
||||
if ($type === Slide::TYPE_CHOICE) {
|
||||
$slides->syncOptions($slide, $options);
|
||||
}
|
||||
if ($type === Slide::TYPE_QUIZ) {
|
||||
// First option is the correct one.
|
||||
$slides->syncOptions($slide, $options, [$options[0]]);
|
||||
}
|
||||
|
||||
return $slides->get($slide->id, contain: ['SlideOptions']);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user