Allow Q&A rounds without upvotes and limit upvotes per question
- 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:
1 parent
3e44ded107
commit
bc86ec2db6
16 files changed
+235
-38
No files matched your search
@@ -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'],
|
||||
|
||||
Reference in new issue
Block a user