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
@@ -148,14 +148,25 @@ $optionsError = $slide->getError('options_text');
|
||||
'checked' => (bool)$settings['allow_downvotes'],
|
||||
]) ?>
|
||||
<?php elseif ($slide->type === 'scale') : ?>
|
||||
<?php $stars = $settings['style'] === \App\Model\Entity\Slide::SCALE_STARS; ?>
|
||||
<fieldset class="scale-style" data-scale-style>
|
||||
<legend><?= __('Darstellung') ?></legend>
|
||||
<?= $this->Form->radio('settings.style', [
|
||||
['value' => \App\Model\Entity\Slide::SCALE_NUMBERS, 'text' => __('Zahlen (z. B. 1 bis 10)')],
|
||||
['value' => \App\Model\Entity\Slide::SCALE_STARS, 'text' => __('Sterne (wie bei einer Produktbewertung)')],
|
||||
], ['value' => $settings['style']]) ?>
|
||||
</fieldset>
|
||||
<div class="grid grid--2 grid--tight">
|
||||
<?= $this->Form->control('settings.scale_min', [
|
||||
'type' => 'select', 'options' => [0 => '0', 1 => '1'],
|
||||
'label' => __('Von'), 'value' => $settings['scale_min'],
|
||||
'templateVars' => ['attrs' => $stars ? ' hidden' : ''],
|
||||
'templates' => ['inputContainer' => '<div class="input {{type}}{{required}}" data-scale-min{{attrs}}>{{content}}</div>'],
|
||||
]) ?>
|
||||
<?= $this->Form->control('settings.scale_max', [
|
||||
'type' => 'select', 'options' => array_combine(range(2, 10), range(2, 10)),
|
||||
'label' => __('Bis'), 'value' => $settings['scale_max'],
|
||||
'label' => $stars ? __('Anzahl Sterne') : __('Bis'), 'value' => $settings['scale_max'],
|
||||
'data-label-numbers' => __('Bis'), 'data-label-stars' => __('Anzahl Sterne'),
|
||||
]) ?>
|
||||
<?= $this->Form->control('settings.min_label', [
|
||||
'label' => __('Beschriftung links (optional)'), 'maxlength' => 60,
|
||||
|
||||
Reference in new issue
Block a user