Add Q&A slide type
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:
1 parent
ea944b080f
commit
f0c6687100
21 files changed
+1327
-27
No files matched your search
@@ -79,6 +79,12 @@ $url = fn(string $name, array $params = []) => ['_name' => $name, 'token' => $ad
|
||||
'running' => __('Quiz läuft'),
|
||||
'finished' => __('Quiz beendet'),
|
||||
][$slide->quizPhase()]) ?></span>
|
||||
<?php elseif ($slide->isQa()) : ?>
|
||||
<span class="muted">· <?= h([
|
||||
'collect' => __('Fragen sammeln'),
|
||||
'vote' => __('Abstimmung läuft'),
|
||||
'discuss' => __('Fragen werden besprochen'),
|
||||
][$slide->qaStage()]) ?> · <?= __n('max. {0} Upvote pro Person', 'max. {0} Upvotes pro Person', (int)$slide->setting('max_upvotes'), (int)$slide->setting('max_upvotes')) ?></span>
|
||||
<?php elseif (!$slide->is_voting_open) : ?><span class="muted">· <?= __('Abstimmung geschlossen') ?></span><?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* (Plenario.presenter) from /admin/{token}/state.
|
||||
*
|
||||
* Keyboard: ←/→ slides, V voting on/off, H hide results, F fullscreen, Q QR code.
|
||||
* Q&A slides: V switches to the next stage; while discussing ←/→ step through the questions first.
|
||||
*
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\Poll $poll
|
||||
|
||||
@@ -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]) ?>
|
||||
|
||||
@@ -93,12 +93,17 @@ $optionsError = $slide->getError('options_text');
|
||||
'label' => match ($slide->type) {
|
||||
'content' => __('Überschrift'),
|
||||
'youtube' => __('Titel'),
|
||||
'qa' => __('Überschrift'),
|
||||
default => __('Frage'),
|
||||
},
|
||||
'maxlength' => 500,
|
||||
'required' => !$slide->isYouTube(),
|
||||
'autofocus' => $isNew && !$slide->isYouTube(),
|
||||
'placeholder' => $slide->isYouTube() ? __('Leer lassen, um den Titel des Videos zu übernehmen') : null,
|
||||
'placeholder' => match (true) {
|
||||
$slide->isYouTube() => __('Leer lassen, um den Titel des Videos zu übernehmen'),
|
||||
$slide->isQa() => __('z. B. Eure Fragen an den Vorstand'),
|
||||
default => null,
|
||||
},
|
||||
'data-youtube-title' => $slide->isYouTube() ? '' : null,
|
||||
]) ?>
|
||||
<?= $this->Form->control('description', [
|
||||
@@ -205,9 +210,24 @@ $optionsError = $slide->getError('options_text');
|
||||
'value' => $settings['time_limit'],
|
||||
]) ?>
|
||||
<p class="hint"><?= __('Das Quiz startet erst, wenn du es in der Präsentation startest. Du kannst es jederzeit vorzeitig beenden.') ?></p>
|
||||
<?php elseif ($slide->type === 'qa') :
|
||||
$upvoteOptions = [];
|
||||
foreach (range(1, \App\Model\Entity\Slide::QA_MAX_UPVOTES) as $n) {
|
||||
$upvoteOptions[$n] = __n('{0} Stimme', '{0} Stimmen', $n, $n);
|
||||
}
|
||||
?>
|
||||
<?= $this->Form->control('settings.max_upvotes', [
|
||||
'type' => 'select',
|
||||
'options' => $upvoteOptions,
|
||||
'label' => __('Upvotes (Stimmen) pro Person'),
|
||||
'value' => $settings['max_upvotes'],
|
||||
'aria-describedby' => 'qa-upvotes-hint',
|
||||
]) ?>
|
||||
<p class="hint" id="qa-upvotes-hint"><?= __('So viele Stimmen hat jede Person beim Abstimmen. Sie lassen sich frei auf Fragen anderer verteilen – mehrere auf eine Frage geben ihr mehr Gewicht.') ?></p>
|
||||
<p class="hint"><?= __('Ablauf in der Präsentation: 1. Fragen sammeln, 2. abstimmen, 3. besprechen – die Frage mit den meisten Upvotes zuerst. Du schaltest die Schritte selbst weiter.') ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($slide->isInteractive() && !$slide->isQuiz()) : ?>
|
||||
<?php if ($slide->isInteractive() && !$slide->isQuiz() && !$slide->isQa()) : ?>
|
||||
<?= $this->Form->control('is_voting_open', [
|
||||
'type' => 'checkbox',
|
||||
'label' => __('Abstimmung geöffnet'),
|
||||
|
||||
Reference in new issue
Block a user