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

+5 -1
View File
@@ -36,7 +36,9 @@ use Cake\ORM\Locator\LocatorAwareTrait;
* order with 'position' (1-based), 'placed' (participants who put the item at its position),
* 'percent', plus 'correctCount' (participants with the completely correct order).
* Neither the correct order nor counts are part of the result before it is revealed.
* - qa: 'stage' (collect|vote|discuss), 'maxUpvotes', 'upvotes' (total),
* - qa: 'stage' (collect|vote|discuss), 'stages' (available stages in order, no 'vote' without upvotes),
* 'maxUpvotes' (per participant, 0 = no upvotes), 'maxPerQuestion' (per participant and question),
* 'upvotes' (total),
* 'questions' => [['id', 'text', 'votes']] most upvoted first (ties: oldest first),
* 'focusId' (question being discussed|null), 'focusIndex' (0-based position in questions|null).
* Presenter only – participants get their own view, see PollStateService::qaState().
@@ -221,7 +223,9 @@ class ResultsService
return [
'stage' => $slide->qaStage(),
'stages' => $slide->qaStages(),
'maxUpvotes' => (int)$slide->setting('max_upvotes'),
'maxPerQuestion' => $slide->qaUpvotesPerQuestion(),
'upvotes' => array_sum(array_column($questions, 'votes')),
'questions' => $questions,
'focusId' => $focusIndex === null ? null : $slide->focus_response_id,