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

+27
View File
@@ -14,6 +14,7 @@ $this->assign('bodyClass', 'participant');
$voteUrl = ['_name' => 'participate:vote', 'code' => $poll->join_code];
$words = $state['words'] ?? null;
$quiz = $state['quiz'] ?? null;
$qa = $state['qa'] ?? null;
$countdown = function (?int $remaining): string {
if ($remaining === null) {
return '';
@@ -117,6 +118,32 @@ $countdown = function (?int $remaining): string {
<?php else : ?>
<p class="muted"><?= __('Das Quiz ist beendet – du hast keine Antwort abgegeben.') ?></p>
<?php endif; ?>
<?php elseif ($qa !== null) : ?>
<div class="qa" data-qa>
<?php if ($qa['stage'] === 'collect') : ?>
<?= $this->Form->create(null, ['url' => $voteUrl, 'class' => 'vote-form qa-form', 'data-qa-form' => true]) ?>
<?= $this->Form->hidden('slide_id', ['value' => $slide->id]) ?>
<label for="qa-question" class="qa-form__label"><?= __('Deine Frage') ?></label>
<textarea id="qa-question" name="question" rows="3" maxlength="500" required
aria-describedby="qa-hint" placeholder="<?= __('Was möchtest du wissen?') ?>"></textarea>
<p class="hint" id="qa-hint"><?= __('Anonym. Du kannst mehrere Fragen stellen. Schau unten, ob deine Frage schon gestellt wurde – dann unterstützt du sie einfach beim Abstimmen, das nach der Sammelphase beginnt.') ?></p>
<?= $this->Form->button(__('Frage einreichen'), ['class' => 'button button--primary button--block']) ?>
<?= $this->Form->end() ?>
<?php else : ?>
<?= $this->Form->hidden('slide_id', ['value' => $slide->id]) ?>
<p class="hint"><?= $qa['stage'] === 'vote'
? __n(
'Du hast eine Stimme: Gib sie mit „+“ der Frage, die dir am wichtigsten ist. Mit „−“ nimmst du sie zurück.',
'Du hast {0} Stimmen: Verteile sie mit „+“ auf die Fragen, die dir wichtig sind – gern auch mehrere auf eine Frage. Mit „−“ nimmst du eine zurück.',
$qa['maxUpvotes'],
$qa['maxUpvotes'],
)
: __('Die Fragen werden jetzt besprochen – die mit den meisten Stimmen zuerst.') ?></p>
<noscript><p class="muted"><?= __('Zum Abstimmen wird JavaScript benötigt.') ?></p></noscript>
<?php endif; ?>
<p class="qa-message" data-qa-message role="status" aria-live="polite"></p>
<div data-qa-list></div>
</div>
<?php elseif ($words !== null && $slide->is_voting_open) : ?>
<?= $this->Form->create(null, ['url' => $voteUrl, 'class' => 'vote-form word-form', 'data-word-form' => true]) ?>
<?= $this->Form->hidden('slide_id', ['value' => $slide->id]) ?>