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>
This commit is contained in:
1 parent
1ee870d67c
commit
c1f9be2eef
14 files changed
+400
-31
No files matched your search
@@ -280,15 +280,28 @@ $countdown = function (?int $remaining): string {
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php elseif ($slide->type === 'scale') : ?>
|
||||
<div class="scale"<?= $slide->isPrivate() ? ' aria-describedby="private-hint"' : '' ?>>
|
||||
<?php for ($v = (int)$slide->setting('scale_min'); $v <= (int)$slide->setting('scale_max'); $v++) : ?>
|
||||
<label class="scale__step">
|
||||
<input type="radio" name="value" value="<?= $v ?>" required>
|
||||
<span><?= $v ?></span>
|
||||
</label>
|
||||
<?php endfor; ?>
|
||||
</div>
|
||||
<?php elseif ($slide->type === 'scale') :
|
||||
$maxValue = (int)$slide->setting('scale_max'); ?>
|
||||
<?php if ($slide->isStarRating()) : ?>
|
||||
<div class="stars<?= $maxValue > 6 ? ' stars--many' : '' ?>" role="radiogroup" aria-label="<?= __('Bewertung in Sternen') ?>"<?= $slide->isPrivate() ? ' aria-describedby="private-hint"' : '' ?>>
|
||||
<?php for ($v = 1; $v <= $maxValue; $v++) : ?>
|
||||
<label class="stars__star">
|
||||
<input type="radio" name="value" value="<?= $v ?>" required>
|
||||
<span class="stars__icon" aria-hidden="true">★</span>
|
||||
<span class="sr-only"><?= __('{0} von {1} Sternen', $v, $maxValue) ?></span>
|
||||
</label>
|
||||
<?php endfor; ?>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div class="scale"<?= $slide->isPrivate() ? ' aria-describedby="private-hint"' : '' ?>>
|
||||
<?php for ($v = (int)$slide->setting('scale_min'); $v <= $maxValue; $v++) : ?>
|
||||
<label class="scale__step">
|
||||
<input type="radio" name="value" value="<?= $v ?>" required>
|
||||
<span><?= $v ?></span>
|
||||
</label>
|
||||
<?php endfor; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="scale__labels">
|
||||
<span><?= h((string)$slide->setting('min_label')) ?></span>
|
||||
<span><?= h((string)$slide->setting('max_label')) ?></span>
|
||||
|
||||
Reference in new issue
Block a user