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>
15 lines
484 B
PHP
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>
|