Add an optional countdown to every slide that collects answers
Choice, word cloud, open question, scale and ordering slides get a time
limit like the quiz. With a limit the slide waits ("ready") showing only
the question; next starts the countdown, the next one ends it, the third
moves on. Stage results and the ordering solution are withheld until the
countdown has started. The countdown music plays during any countdown.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
722e845cff
commit
27771e7470
19 files changed
+480
-34
No files matched your search
@@ -323,7 +323,7 @@ class AdminController extends AdminAppController
|
||||
* SlideControlService (open, close, toggle, stage, question).
|
||||
*
|
||||
* On a Q&A slide that is being discussed, next/prev step through the questions
|
||||
* first (like builds in presentation software); on a quiz, next starts it and then ends it
|
||||
* first (like builds in presentation software); on a slide with a countdown (quiz, or any slide with a time limit), next starts it and then ends it
|
||||
* before moving on, on an open ordering slide next closes it (reveals the solution),
|
||||
* prev always goes to the previous slide. While paused, next/prev resume
|
||||
* the slide that was live before.
|
||||
@@ -349,9 +349,10 @@ class AdminController extends AdminAppController
|
||||
) {
|
||||
$action = 'none';
|
||||
}
|
||||
// Forward on a quiz is a build step too: start it, then end it, only then the next slide.
|
||||
// Back never touches the quiz, so a clicker can page through the slides afterwards.
|
||||
if ($current !== null && $current->isQuiz() && $action === 'next') {
|
||||
// Forward on a slide with a countdown (every quiz, any other slide with a time limit) is a build step too:
|
||||
// start it, then end it, only then the next slide.
|
||||
// Back never touches it, so a clicker can page through the slides afterwards.
|
||||
if ($current !== null && $current->usesPhases() && $action === 'next') {
|
||||
$phase = $current->quizPhase();
|
||||
if ($phase !== Slide::QUIZ_FINISHED) {
|
||||
(new SlideControlService())->apply($current, $phase === Slide::QUIZ_READY ? 'open' : 'close');
|
||||
@@ -359,7 +360,7 @@ class AdminController extends AdminAppController
|
||||
}
|
||||
}
|
||||
|
||||
// Same for an ordering slide: forward first closes the voting (reveals the solution).
|
||||
// An ordering slide without countdown: forward first closes the voting (reveals the solution).
|
||||
if ($current !== null && $current->isOrder() && $action === 'next' && $current->isVotingOpen()) {
|
||||
(new SlideControlService())->apply($current, 'close');
|
||||
$action = 'none';
|
||||
|
||||
@@ -302,7 +302,13 @@ class SlidesController extends AdminAppController
|
||||
// is_voting_open is presenter state (SlideControlService), never editable via the form.
|
||||
$fields = ['type', 'question', 'description', 'settings'];
|
||||
$youtube = $slide->isYouTube() ? $this->prepareYouTube($data) : ['errors' => [], 'warning' => null];
|
||||
// A slide that has not been presented yet starts again after the (possibly changed) time limit is known:
|
||||
// with a countdown it waits for the presenter, without it is open.
|
||||
$fresh = $slide->isNew() || $slide->isFresh();
|
||||
$this->Slides->patchEntity($slide, $data, ['fields' => $fields, 'associated' => []]);
|
||||
if ($fresh) {
|
||||
$slide->startFresh();
|
||||
}
|
||||
foreach ($youtube['errors'] as $field => $message) {
|
||||
$slide->setError($field, $message);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user