Add Q&A slide type
CI / Deploy / test (push) Successful in 48s
CI / Deploy / deploy (push) Skipped

Participants submit questions, upvote them and the presenter discusses
them one by one, most upvoted first.

- Stages collect -> vote -> discuss, switched manually by the presenter
  (V key or stepper, going back is possible)
- Configurable upvote budget per participant, freely distributable
  (several upvotes on one question are allowed), votes can be withdrawn
- Participants see all questions while collecting to avoid duplicates;
  no counts before the discussion
- While discussing, next/prev step through the questions before
  moving to the next slide
- Migration: slides.stage, slides.focus_response_id, responses.parent_id

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Opus 5.5 committed 2026-11-07 16:09:46 +01:00
1 parent ea944b080f
commit f0c6687100
21 files changed
+1327 -27

No files matched your search

+8 -2
View File
@@ -5,6 +5,7 @@ namespace App\Controller;
use App\Model\Entity\Slide;
use App\Model\Table\SlidesTable;
use App\Service\QaService;
use App\Service\YouTubeService;
use Cake\Http\Exception\NotFoundException;
use Cake\Http\Response;
@@ -43,6 +44,8 @@ class SlidesController extends AdminAppController
$slide->poll_id = $this->poll->id;
// A quiz is started by the presenter (that also starts its timer).
$slide->is_voting_open = $type !== Slide::TYPE_QUIZ;
// Q&A starts by collecting questions.
$slide->stage = $type === Slide::TYPE_QA ? Slide::QA_COLLECT : null;
$optionsText = $type === Slide::TYPE_CHOICE ? "\n" : '';
$quizOptions = [];
@@ -147,6 +150,9 @@ class SlidesController extends AdminAppController
$slide->voting_ends_at = null;
$this->Slides->saveOrFail($slide);
}
if ($slide->isQa()) {
(new QaService())->reset($slide);
}
$this->Flash->success(__('Antworten der Folie „{0}“ wurden gelöscht.', $slide->question));
return $this->redirect($this->adminUrl());
@@ -205,8 +211,8 @@ class SlidesController extends AdminAppController
// The type of an existing slide cannot change (would invalidate responses).
$data['type'] = $slide->type;
$fields = ['type', 'question', 'description', 'settings', 'is_voting_open'];
if ($slide->isQuiz()) {
// Quiz voting is controlled by the presenter only.
if ($slide->isQuiz() || $slide->isQa()) {
// Quiz and Q&A voting is controlled by the presenter only.
$fields = array_values(array_diff($fields, ['is_voting_open']));
}
$youtube = $slide->isYouTube() ? $this->prepareYouTube($data) : ['errors' => [], 'warning' => null];