Make Q&A upvote budget a share of the questions
CI / Deploy / test (push) Successful in 58s
CI / Deploy / deploy (push) Skipped

The fixed number of votes per person does not fit varying question
counts. The budget is now `upvote_share` percent of the questions
(rounded up, at least one), so it grows with the number of questions.
A migration converts existing Q&A slides (no voting stays off, others
get 25 %).

On the stage the voting step no longer lists the questions but points
participants to their devices.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Sonnet 5.5 committed 2026-11-11 23:53:32 +01:00
1 parent 3762b880cb
commit 575fb8649d
14 files changed
+171 -76

No files matched your search

+4 -2
View File
@@ -173,9 +173,11 @@ class SlidesTable extends Table
}
break;
case Slide::TYPE_QA:
$max = (int)($input['max_upvotes'] ?? $settings['max_upvotes']);
$share = (int)($input['upvote_share'] ?? $settings['upvote_share']);
// 0 = no upvotes (no voting stage)
$settings['max_upvotes'] = max(0, min(Slide::QA_MAX_UPVOTES, $max));
$settings['upvote_share'] = $share === 0 || in_array($share, Slide::QA_UPVOTE_SHARES, true)
? $share
: Slide::DEFAULT_SETTINGS[Slide::TYPE_QA]['upvote_share'];
$perQuestion = (int)($input['max_upvotes_per_question'] ?? $settings['max_upvotes_per_question']);
// 0 = no limit per question
$settings['max_upvotes_per_question'] = max(0, min(Slide::QA_MAX_UPVOTES, $perQuestion));