Allow Q&A rounds without upvotes and limit upvotes per question
CI / Deploy / test (push) Successful in 57s
CI / Deploy / deploy (push) Skipped

- max_upvotes = 0 disables upvoting: the voting stage is skipped
  (collect -> discuss), questions are discussed in submission order
- new setting max_upvotes_per_question caps a participant's upvotes
  on a single question (0 = no limit besides max_upvotes)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Opus 5.5 committed 2026-11-09 08:36:02 +01:00
1 parent 3e44ded107
commit bc86ec2db6
16 files changed
+235 -38

No files matched your search

+3 -2
View File
@@ -211,14 +211,15 @@ $bar = function (float $percent, bool $ok = false): string {
<?php if ($r['questions'] === []) : ?>
<p class="empty"><?= __('Keine Fragen eingereicht.') ?></p>
<?php else : ?>
<?php $withUpvotes = $r['maxUpvotes'] > 0; ?>
<table>
<thead><tr><th class="num">#</th><th><?= __('Frage') ?></th><th class="num"><?= __('Upvotes') ?></th></tr></thead>
<thead><tr><th class="num">#</th><th><?= __('Frage') ?></th><?php if ($withUpvotes) : ?><th class="num"><?= __('Upvotes') ?></th><?php endif; ?></tr></thead>
<tbody>
<?php foreach ($r['questions'] as $i => $question) : ?>
<tr>
<td class="num"><?= $i + 1 ?>.</td>
<td><?= nl2br(h($question['text'])) ?></td>
<td class="num"><?= (int)$question['votes'] ?></td>
<?php if ($withUpvotes) : ?><td class="num"><?= (int)$question['votes'] ?></td><?php endif; ?>
</tr>
<?php endforeach; ?>
</tbody>
+5 -1
View File
@@ -96,7 +96,11 @@ $hasInternal = array_filter($slides, fn($slide) => $slide->isInteractive() && $s
'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')) ?><?= $slide->setting('allow_self_upvote') ? ' · ' . __('auch für eigene Fragen') : '' ?></span>
][$slide->qaStage()]) ?> · <?php if (!$slide->hasQaUpvotes()) : ?><?= __('ohne Upvotes') ?><?php else :
$maxUpvotes = (int)$slide->setting('max_upvotes');
$perQuestion = $slide->qaUpvotesPerQuestion(); ?>
<?= __n('max. {0} Upvote pro Person', 'max. {0} Upvotes pro Person', $maxUpvotes, $maxUpvotes) ?><?= $perQuestion < $maxUpvotes ? ' · ' . __n('{0} pro Frage', '{0} pro Frage', $perQuestion, $perQuestion) : '' ?><?= $slide->setting('allow_self_upvote') ? ' · ' . __('auch für eigene Fragen') : '' ?>
<?php endif; ?></span>
<?php elseif ($slide->isOrder() && !$slide->is_voting_open) : ?>
<span class="muted">· <?= __('Abstimmung geschlossen, aufgelöst') ?></span>
<?php elseif (!$slide->is_voting_open) : ?><span class="muted">· <?= __('Abstimmung geschlossen') ?></span><?php endif; ?>