Show scale comments only in the presentation
Participants still see distribution and average (if enabled), but the comments are emptied in their state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9b879ca177
commit
d6166bd9d9
5 files changed
+42
-12
No files matched your search
@@ -187,7 +187,7 @@ class PollStateService
|
||||
$slide?->modified?->toUnixString() ?? 0,
|
||||
]),
|
||||
'slide' => $showResults ? $this->slidePayload($slide) : null,
|
||||
'results' => $showResults ? $this->results->forSlide($slide) : null,
|
||||
'results' => $showResults ? $this->participantResults($slide) : null,
|
||||
'words' => $words,
|
||||
'quiz' => $quiz,
|
||||
'qa' => $qa,
|
||||
@@ -195,6 +195,22 @@ class PollStateService
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Results as participants see them: scale comments are for the presentation only.
|
||||
*
|
||||
* @param \App\Model\Entity\Slide $slide Current slide
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
protected function participantResults(Slide $slide): array
|
||||
{
|
||||
$results = $this->results->forSlide($slide);
|
||||
if (isset($results['comments'])) {
|
||||
$results['comments'] = [];
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ordering progress of one participant. Own answer and correctness only once
|
||||
* revealed (voting closed); before that the state must not hint at the solution.
|
||||
|
||||
@@ -20,7 +20,8 @@ use Cake\ORM\Locator\LocatorAwareTrait;
|
||||
* private (anonymous feedback): 'answers' is always empty, texts only via answers()
|
||||
* - scale: 'buckets' => [['value', 'count', 'percent']], 'average' => float|null,
|
||||
* 'min', 'max', 'minLabel', 'maxLabel', 'private' (bool);
|
||||
* 'comments' => [['id', 'text', 'value']] oldest first (only with the comment field, else []);
|
||||
* 'comments' => [['id', 'text', 'value']] oldest first (only with the comment field, else [];
|
||||
* presentation only, emptied for participants in PollStateService);
|
||||
* private (internal feedback): 'buckets' and 'comments' are always empty and 'average' null,
|
||||
* ratings and comments only via scaleResults() / comments()
|
||||
* - quiz: 'phase' (ready|running|finished), 'timeLimit' (s, 0 = manual), 'remaining' (s|null),
|
||||
|
||||
Reference in new issue
Block a user