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 -1
View File
@@ -280,10 +280,11 @@ class PollStateService
* - discuss: all questions ranked with upvotes, `focusId` = question being discussed
* `upvoted` = own upvotes per question id (several per question are allowed),
* `allowSelfUpvote` = own questions may be upvoted too (setting `allow_self_upvote`).
* `maxUpvotes` = 0: no voting stage; `maxPerQuestion` = own upvotes allowed per question.
*
* @param \App\Model\Entity\Slide $slide Q&A slide
* @param string $participantHash Participant hash
* @return array{stage: string, maxUpvotes: int, votesLeft: int, allowSelfUpvote: bool, mine: list<int>, upvoted: array<int, int>,
* @return array{stage: string, maxUpvotes: int, maxPerQuestion: int, votesLeft: int, allowSelfUpvote: bool, mine: list<int>, upvoted: array<int, int>,
* questions: list<array{id: int, text: string, votes?: int}>, focusId: int|null}
*/
public function qaState(Slide $slide, string $participantHash): array
@@ -305,6 +306,7 @@ class PollStateService
return [
'stage' => $stage,
'maxUpvotes' => $max,
'maxPerQuestion' => $slide->qaUpvotesPerQuestion(),
'votesLeft' => max(0, $max - count($own['upvotes'])),
'allowSelfUpvote' => (bool)$slide->setting('allow_self_upvote'),
'mine' => $own['questions'],