Let scale slides hide the average or the distribution on stage

The average is now the headline of a scale result and the distribution a
compact detail below it. Two new settings (show_average, show_distribution)
hide either part in the presentation; evaluation and PDF stay complete.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Opus 5.5 committed 2026-11-11 13:29:35 +01:00
1 parent 239599e6a3
commit bf16ac0d3b
8 files changed
+183 -15

No files matched your search

+4
View File
@@ -21,6 +21,8 @@ use Cake\ORM\Locator\LocatorAwareTrait;
* 'min', 'max', 'minLabel', 'maxLabel', 'private' (bool), 'stars' (bool: star rating, min = 1);
* 'comments' => [['id', 'text', 'value' (int|null)]] oldest first (only with the comment field, else [];
* 'value' is null unless the setting comment_ratings is on;
* 'showAverage', 'showDistribution' (bool): parts shown in the presentation (settings
* show_average/show_distribution, the data is always complete);
* presentation only: participants never get results of scale slides, see PollStateService);
* open/scale with 'private' (anonymous/internal feedback): contents are included for the
* presenter/embed, which start with the results hidden and may show them on demand;
@@ -335,6 +337,8 @@ class ResultsService
return $this->scaleResults($slide) + [
'private' => $slide->isPrivate(),
'comments' => $comments,
'showAverage' => (bool)$slide->setting('show_average'),
'showDistribution' => (bool)$slide->setting('show_distribution'),
];
}