Allow a comment without a rating on scales instead of "Keine Angabe"
With the comment field enabled, scales and star ratings accept a comment alone. It counts as taking part but not in the average or the distribution; the number is shown separately. The explicit skip button and its setting are removed again. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d6432911ed
commit
dbac9e93c7
14 files changed
+85
-105
No files matched your search
@@ -205,8 +205,8 @@ $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 if (!empty($r['commentOnly'])) : ?>
|
||||
· <span class="muted"><?= __('{0}× nur Kommentar (nicht im Durchschnitt)', (int)$r['commentOnly']) ?></span>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
<table>
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
* @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;
|
||||
@@ -242,7 +241,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() && !$skipped) :
|
||||
<?php if (VoteService::hasEditableText($slide) && $slide->isVotingOpen()) :
|
||||
$isOpen = $slide->type === 'open'; ?>
|
||||
<?php if ($ownText !== null) : ?>
|
||||
<p class="own-comment__label"><?= $isOpen ? __('Deine Antwort:') : __('Dein Kommentar:') ?></p>
|
||||
@@ -310,7 +309,7 @@ $countdown = function (?int $remaining): string {
|
||||
<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>
|
||||
<input type="radio" name="value" value="<?= $v ?>" <?= $slide->hasComments() ? '' : 'required' ?>>
|
||||
<span class="stars__icon" aria-hidden="true">★</span>
|
||||
<span class="sr-only"><?= __('{0} von {1} Sternen', $v, $maxValue) ?></span>
|
||||
</label>
|
||||
@@ -320,7 +319,7 @@ $countdown = function (?int $remaining): string {
|
||||
<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>
|
||||
<input type="radio" name="value" value="<?= $v ?>" <?= $slide->hasComments() ? '' : 'required' ?>>
|
||||
<span><?= $v ?></span>
|
||||
</label>
|
||||
<?php endfor; ?>
|
||||
@@ -332,6 +331,7 @@ $countdown = function (?int $remaining): string {
|
||||
</div>
|
||||
<?php if ($slide->hasComments()) : ?>
|
||||
<label class="scale-comment" for="scale-comment"><?= __('Kommentar (optional)') ?></label>
|
||||
<p class="hint"><?= __('Du kannst auch nur einen Kommentar abgeben, ohne zu bewerten.') ?></p>
|
||||
<textarea id="scale-comment" name="comment" rows="3" maxlength="500"
|
||||
placeholder="<?= __('Möchtest du deine Bewertung begründen?') ?>"></textarea>
|
||||
<?php endif; ?>
|
||||
@@ -343,12 +343,6 @@ $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) ?><?php if (!empty($scale['skipped'])) : ?> · <?= __('{0}× „Keine Angabe“', (int)$scale['skipped']) ?><?php endif; ?></p>
|
||||
<p class="muted"><?= __n('{0} Bewertung', '{0} Bewertungen', $count, $count) ?><?php if (!empty($scale['commentOnly'])) : ?> · <?= __('{0}× nur Kommentar', (int)$scale['commentOnly']) ?><?php endif; ?></p>
|
||||
<?php elseif ($isChoice) : ?>
|
||||
<p class="muted"><?= __n('{0} Kommentar, neueste zuerst', '{0} Kommentare, neueste zuerst', $count, $count) ?></p>
|
||||
<?php else : ?>
|
||||
@@ -86,7 +86,7 @@ $count = match (true) {
|
||||
$created = new DateTime($comment['created']); ?>
|
||||
<li>
|
||||
<?= h($comment['text']) ?>
|
||||
<time datetime="<?= h($comment['created']) ?>"><?= __('Bewertung') ?> <?= $this->element('rating', ['slide' => $slide, 'value' => (int)$comment['value']]) ?> · <?= h($created->i18nFormat('dd.MM.yyyy, HH:mm')) ?></time>
|
||||
<time datetime="<?= h($comment['created']) ?>"><?php if ($comment['value'] !== null) : ?><?= __('Bewertung') ?> <?= $this->element('rating', ['slide' => $slide, 'value' => (int)$comment['value']]) ?><?php else : ?><?= __('ohne Bewertung') ?><?php endif; ?> · <?= h($created->i18nFormat('dd.MM.yyyy, HH:mm')) ?></time>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
|
||||
@@ -195,12 +195,6 @@ $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'),
|
||||
@@ -214,7 +208,7 @@ $optionsError = $slide->getError('options_text');
|
||||
<p class="hint"><?= __('Die Auswertung in der Verwaltung und der PDF-Export enthalten immer beides.') ?></p>
|
||||
<?= $this->Form->control('settings.comments', [
|
||||
'type' => 'checkbox',
|
||||
'label' => __('Kommentarfeld anzeigen (Teilnehmende können ihre Bewertung optional begründen)'),
|
||||
'label' => __('Kommentarfeld anzeigen (Teilnehmende können ihre Bewertung optional begründen oder auch nur einen Kommentar ohne Bewertung abgeben)'),
|
||||
'checked' => (bool)$settings['comments'],
|
||||
]) ?>
|
||||
<p class="hint"><?= __('Die Kommentare laufen in der Präsentation nacheinander durch (nicht bei den Teilnehmenden), jeder so lange, wie man zum Lesen braucht: kurze etwa 5 Sekunden, lange bis zu 30 Sekunden. Das Tempo stellst du für die ganze Umfrage in den Einstellungen im Dashboard ein. Bei internem Feedback erst, wenn du die Ergebnisse einblendest.') ?></p>
|
||||
|
||||
Reference in new issue
Block a user