Add optional comment field to multiple choice slides
Participants can justify their choice; the comment is stored once in the first response row, rotates on the stage like scale comments and is listed in the admin area and the PDF export. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
28bfd535f4
commit
61718ed7c6
14 files changed
+330
-29
No files matched your search
@@ -103,6 +103,18 @@ $bar = function (float $percent, bool $ok = false): string {
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php if ($slide->hasComments()) : ?>
|
||||
<h3><?= __n('{0} Kommentar', '{0} Kommentare', count($r['comments']), count($r['comments'])) ?></h3>
|
||||
<?php if ($r['comments'] === []) : ?>
|
||||
<p class="empty"><?= __('Keine Kommentare.') ?></p>
|
||||
<?php else : ?>
|
||||
<ol class="list">
|
||||
<?php foreach ($r['comments'] as $comment) : ?>
|
||||
<li><?= nl2br(h($comment['text'])) ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php elseif ($slide->type === 'quiz') : ?>
|
||||
<?php if (!$r['revealed']) : ?>
|
||||
|
||||
@@ -143,7 +143,11 @@ $hasInternal = array_filter($slides, fn($slide) => !$slide->is_hidden && $slide-
|
||||
]) ?>
|
||||
<?php endif; ?>
|
||||
<?php if (($slide->type === 'open' || $slide->isPrivate() || $slide->hasComments()) && $count > 0) :
|
||||
$answersLabel = $slide->type === 'scale' ? __('Auswertung') : __('Antworten'); ?>
|
||||
$answersLabel = match ($slide->type) {
|
||||
'scale' => __('Auswertung'),
|
||||
'choice' => __('Kommentare'),
|
||||
default => __('Antworten'),
|
||||
}; ?>
|
||||
<a class="button button--small button--icon" href="<?= $this->Url->build($url('slides:answers', ['id' => $slide->id])) ?>"
|
||||
title="<?= h($answersLabel) ?>" aria-label="<?= h(__('{0} der Folie „{1}“ ansehen', $answersLabel, $slide->question)) ?>">📊</a>
|
||||
<?php endif; ?>
|
||||
|
||||
Reference in new issue
Block a user