Hide Q&A upvote counts until voting ends
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:
1 parent
891e3cb174
commit
759e15390e
5 files changed
+21
-11
No files matched your search
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user