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
@@ -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; ?>
|
||||
|
||||
Reference in new issue
Block a user