Hide Q&A upvote counts until voting ends
CI / Deploy / test (push) Successful in 1m0s
CI / Deploy / deploy (push) Skipped

A live ranking on the stage swayed the vote. During the vote stage the
presenter now gets the questions in submission order without counts,
only the total of votes cast.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Opus 5.5 committed 2026-11-11 15:05:09 +01:00
1 parent 891e3cb174
commit 759e15390e
5 files changed
+21 -11

No files matched your search

+6 -2
View File
@@ -203,12 +203,16 @@ class QaTest extends TestCase
$this->assertVoteFails('Du hast diese Frage nicht unterstützt.', fn() => $this->vote($poll, $slide, 'p3', $c, 'remove'));
$this->vote($poll, $slide, 'p3', $a);
// While voting is open, the stage only gets the total: no ranking, no counts per question.
$results = (new ResultsService())->forSlide($slide);
$this->assertSame([[$b, 3], [$a, 1], [$c, 0]], array_map(fn($q) => [$q['id'], $q['votes']], $results['questions']));
$this->assertSame([$a, $b, $c], array_column($results['questions'], 'id'));
$this->assertArrayNotHasKey('votes', $results['questions'][0]);
$this->assertSame(4, $results['upvotes']);
$ranked = (new QaService())->rankedQuestions($slide);
$this->assertSame([[$b, 3], [$a, 1], [$c, 0]], array_map(fn($q) => [$q['id'], $q['votes']], $ranked));
$this->vote($poll, $slide, 'p3', $b, 'remove');
$this->assertSame(2, (new ResultsService())->forSlide($slide)['questions'][0]['votes'], 'remove withdraws only one upvote');
$this->assertSame(2, (new QaService())->rankedQuestions($slide)[0]['votes'], 'remove withdraws only one upvote');
$this->vote($poll, $slide, 'p3', $b);
// Voting view of participants: all questions, submission order, no counts.