Step through quizzes with next on a clicker
Next on a quiz starts it, then ends it, and only then moves to the next slide. Prev always goes to the previous slide and never touches the quiz. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3c66597696
commit
e4622b439e
3 files changed
+109
-1
No files matched your search
@@ -196,7 +196,8 @@ 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). While paused, next/prev resume
|
||||
* first (like builds in presentation software); on a quiz, next starts it and then ends it
|
||||
* before moving on, prev always goes to the previous slide. While paused, next/prev resume
|
||||
* the slide that was live before.
|
||||
*
|
||||
* Answers with the new state as JSON for XHR requests, otherwise redirects back.
|
||||
@@ -220,6 +221,15 @@ 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') {
|
||||
$phase = $current->quizPhase();
|
||||
if ($phase !== Slide::QUIZ_FINISHED) {
|
||||
(new SlideControlService())->apply($current, $phase === Slide::QUIZ_READY ? 'open' : 'close');
|
||||
$action = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
switch ($action) {
|
||||
case 'none':
|
||||
|
||||
Reference in new issue
Block a user