Files
Plenario/templates/element/rating.php
gnilebeinandClaude Opus 5.5 c1f9be2eef Add a star rating style to scale slides
Scales can now be shown as stars (1 to n) instead of numbered steps:
participants tap stars, the stage shows the average as partly filled
stars and the distribution as bars from most to fewest stars, and the
evaluation page and PDF export print ratings as stars.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 12:46:33 +01:00

15 lines
484 B
PHP

<?php
/**
* A scale rating: the number, or stars with a text alternative for screen readers.
*
* @var \App\View\AppView $this
* @var \App\Model\Entity\Slide $slide Scale slide
* @var int $value Rating
*/
if (!$slide->isStarRating()) {
echo (int)$value;
return;
}
?><span class="rating-stars" aria-hidden="true"><?= h($slide->ratingText((int)$value)) ?></span><span class="sr-only"><?= __('{0} von {1} Sternen', (int)$value, (int)$slide->setting('scale_max')) ?></span>