Add "Keine Angabe" to scales and an "Enthaltung" shortcut for choice slides
Scales and star ratings get an optional "Keine Angabe" answer (setting allow_skip). It counts as taking part but stays out of the average and the distribution; the number is shown separately on stage, in the evaluation and in the PDF. The choice form gets a button that appends an "Enthaltung" option. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1b48ce7852
commit
d6432911ed
14 files changed
+195
-11
No files matched your search
@@ -205,6 +205,9 @@ $bar = function (float $percent, bool $ok = false): string {
|
||||
<span class="muted"><?= !empty($r['stars'])
|
||||
? __('von {0} Sternen', (int)$r['max'])
|
||||
: __('auf einer Skala von {0} bis {1}', (int)$r['min'], (int)$r['max']) ?></span>
|
||||
<?php if (!empty($r['skipped'])) : ?>
|
||||
· <span class="muted"><?= __('{0}× „Keine Angabe“ (nicht im Durchschnitt)', (int)$r['skipped']) ?></span>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
<table>
|
||||
<thead><tr><th><?= !empty($r['stars']) ? __('Sterne') : __('Wert') ?></th><th class="num"><?= __('Anzahl') ?></th><th class="num"><?= __('Anteil') ?></th><th></th></tr></thead>
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
* @var array<string, mixed> $state
|
||||
* @var string $participantHash Seed for the shuffled items of ordering slides
|
||||
* @var string|null $ownText Own open answer or scale comment (editable while voting is open)
|
||||
* @var bool $skipped Whether the participant answered the scale with "Keine Angabe"
|
||||
* @var int $pollIntervalMs
|
||||
*/
|
||||
use App\Service\VoteService;
|
||||
@@ -241,7 +242,7 @@ $countdown = function (?int $remaining): string {
|
||||
</div>
|
||||
<?php elseif ($state['hasResponded']) : ?>
|
||||
<p class="done">✓ <?= __('Deine Antwort ist angekommen.') ?></p>
|
||||
<?php if (VoteService::hasEditableText($slide) && $slide->isVotingOpen()) :
|
||||
<?php if (VoteService::hasEditableText($slide) && $slide->isVotingOpen() && !$skipped) :
|
||||
$isOpen = $slide->type === 'open'; ?>
|
||||
<?php if ($ownText !== null) : ?>
|
||||
<p class="own-comment__label"><?= $isOpen ? __('Deine Antwort:') : __('Dein Kommentar:') ?></p>
|
||||
@@ -342,6 +343,12 @@ $countdown = function (?int $remaining): string {
|
||||
<?php endif; ?>
|
||||
|
||||
<?= $this->Form->button(__('Absenden'), ['class' => 'button button--primary button--block']) ?>
|
||||
<?php if ($slide->type === 'scale' && $slide->setting('allow_skip')) : ?>
|
||||
<?= $this->Form->button(__('Keine Angabe'), [
|
||||
'name' => 'skip', 'value' => '1', 'formnovalidate' => true,
|
||||
'class' => 'button button--block button--skip',
|
||||
]) ?>
|
||||
<?php endif; ?>
|
||||
<?= $this->Form->end() ?>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -31,7 +31,7 @@ $count = match (true) {
|
||||
</p>
|
||||
<h1 id="modal-title"><?= h($slide->question) ?></h1>
|
||||
<?php if ($scale !== null) : ?>
|
||||
<p class="muted"><?= __n('{0} Bewertung', '{0} Bewertungen', $count, $count) ?></p>
|
||||
<p class="muted"><?= __n('{0} Bewertung', '{0} Bewertungen', $count, $count) ?><?php if (!empty($scale['skipped'])) : ?> · <?= __('{0}× „Keine Angabe“', (int)$scale['skipped']) ?><?php endif; ?></p>
|
||||
<?php elseif ($isChoice) : ?>
|
||||
<p class="muted"><?= __n('{0} Kommentar, neueste zuerst', '{0} Kommentare, neueste zuerst', $count, $count) ?></p>
|
||||
<?php else : ?>
|
||||
|
||||
@@ -122,6 +122,10 @@ $optionsError = $slide->getError('options_text');
|
||||
<div class="input textarea<?= $optionsError ? ' error' : '' ?>">
|
||||
<label for="options-text"><?= __('Antwortoptionen (eine pro Zeile, max. 20)') ?></label>
|
||||
<textarea id="options-text" name="options_text" rows="6" required><?= h($optionsText) ?></textarea>
|
||||
<?php // Shortcut for formal votes; needs JavaScript, so it stays hidden without it. ?>
|
||||
<button type="button" class="button button--small button--ghost" hidden
|
||||
data-add-option="<?= h(__('Enthaltung')) ?>" data-add-option-target="options-text"
|
||||
data-add-option-max="20">+ <?= __('Option „Enthaltung“ hinzufügen') ?></button>
|
||||
<?php if ($optionsError) : ?>
|
||||
<div class="error-message"><?= h(implode(' ', (array)$optionsError)) ?></div>
|
||||
<?php endif; ?>
|
||||
@@ -191,6 +195,12 @@ $optionsError = $slide->getError('options_text');
|
||||
'placeholder' => __('z. B. sehr'), 'value' => $settings['max_label'],
|
||||
]) ?>
|
||||
</div>
|
||||
<?= $this->Form->control('settings.allow_skip', [
|
||||
'type' => 'checkbox',
|
||||
'label' => __('„Keine Angabe“ erlauben (Teilnehmende können die Frage überspringen)'),
|
||||
'checked' => (bool)$settings['allow_skip'],
|
||||
]) ?>
|
||||
<p class="hint"><?= __('Wer „Keine Angabe“ wählt, zählt als Teilnehmer/in, geht aber nicht in Durchschnitt und Verteilung ein. Die Zahl steht separat dabei.') ?></p>
|
||||
<?= $this->Form->control('settings.scale_view', [
|
||||
'type' => 'select',
|
||||
'label' => __('In der Präsentation zeigen'),
|
||||
|
||||
Reference in new issue
Block a user