Keep results off participant devices
Results belong on the stage. Participants only get results where they interact with them (word cloud with upvotes) and, once resolved, the solution of quiz and ordering slides with their own verdict, without counts or distribution. Removes the per-poll setting show_results_to_participants (column stays unused). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ecb8f9d31c
commit
cfb445123e
14 files changed
+86
-59
No files matched your search
@@ -76,7 +76,7 @@ class ParticipateControllerTest extends TestCase
|
||||
$this->assertSame(0, TableRegistry::getTableLocator()->get('Responses')->find()->count());
|
||||
}
|
||||
|
||||
public function testStateHidesResultsUntilAnswered(): void
|
||||
public function testStateNeverContainsResults(): void
|
||||
{
|
||||
[$poll] = $this->createPoll();
|
||||
$slide = $this->createSlide($poll, Slide::TYPE_SCALE);
|
||||
@@ -96,14 +96,18 @@ class ParticipateControllerTest extends TestCase
|
||||
$this->get("/p/{$poll->join_code}/state");
|
||||
$state = json_decode((string)$this->_response->getBody(), true);
|
||||
$this->assertTrue($state['hasResponded']);
|
||||
$this->assertEqualsWithDelta(4.0, $state['results']['average'], 0.001);
|
||||
// Results are for the stage only, not even after answering or closing.
|
||||
$this->assertNull($state['results']);
|
||||
|
||||
$this->slidesTable()->updateAll(['is_voting_open' => false], ['id' => $slide->id]);
|
||||
$this->cookie('plenario_pid', self::PID);
|
||||
$this->get("/p/{$poll->join_code}/state");
|
||||
$this->assertNull(json_decode((string)$this->_response->getBody(), true)['results']);
|
||||
}
|
||||
|
||||
public function testWordcloudAjaxVoteReturnsStateWithUpvoteCloud(): void
|
||||
{
|
||||
[$poll] = $this->createPoll();
|
||||
$poll->show_results_to_participants = false;
|
||||
$this->pollsTable()->saveOrFail($poll);
|
||||
$slide = $this->createSlide($poll, Slide::TYPE_WORDCLOUD, ['settings' => ['allow_upvotes' => true]]);
|
||||
$this->goLive($poll, $slide);
|
||||
|
||||
@@ -114,7 +118,7 @@ class ParticipateControllerTest extends TestCase
|
||||
$body = json_decode((string)$this->_response->getBody(), true);
|
||||
$this->assertTrue($body['ok']);
|
||||
$this->assertSame(['kaffee'], $body['state']['words']['mine']);
|
||||
// Cloud is visible despite show_results_to_participants=false, because upvotes are on.
|
||||
// The cloud reaches the device because participants upvote in it.
|
||||
$this->assertSame('Kaffee', $body['state']['results']['words'][0]['text']);
|
||||
|
||||
$this->cookie('plenario_pid', self::PID);
|
||||
|
||||
Reference in new issue
Block a user