Files
Plenario/templates/Slides/answers.php
T
gnilebeinandClaude Opus 5.5 367ff8548d
CI / Deploy / test (push) Successful in 1m4s
CI / Deploy / deploy (push) Skipped
Add anonymous feedback option for open questions
Open questions can be marked private: the presenter screen and embeds
only show the number of answers, participants never see results, and
the texts are readable on a new admin answers page and in the CSV.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 16:28:47 +01:00

45 lines
1.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* All answers of an open question – the only place where anonymous feedback
* (private open questions) can be read, besides the CSV export.
*
* @var \App\View\AppView $this
* @var \App\Model\Entity\Poll $poll
* @var string $adminToken
* @var \App\Model\Entity\Slide $slide
* @var list<array{text: string, created: string}> $answers
*/
use Cake\I18n\DateTime;
$this->assign('title', $slide->question);
$this->assign('noindex', '1');
$count = count($answers);
?>
<p><a href="<?= $this->Url->build(['_name' => 'admin', 'token' => $adminToken]) ?>">← <?= __('Zurück zur Verwaltung') ?></a></p>
<section class="card">
<p class="eyebrow">
<?= h($slide->typeLabel()) ?>
<?php if ($slide->isPrivate()) : ?>· 🔒 <?= __('Anonymes Feedback') ?><?php endif; ?>
</p>
<h1><?= h($slide->question) ?></h1>
<p class="muted"><?= __n('{0} Antwort, neueste zuerst', '{0} Antworten, neueste zuerst', $count, $count) ?></p>
<?php if ($slide->isPrivate()) : ?>
<p class="hint"><?= __('Diese Antworten werden weder in der Präsentation noch den Teilnehmenden angezeigt.') ?></p>
<?php endif; ?>
<?php if ($answers === []) : ?>
<p class="empty"><?= __('Noch keine Antworten.') ?></p>
<?php else : ?>
<ol class="answers-page" reversed>
<?php foreach ($answers as $answer) :
$created = new DateTime($answer['created']); ?>
<li>
<?= h($answer['text']) ?>
<time datetime="<?= h($answer['created']) ?>"><?= h($created->i18nFormat('dd.MM.yyyy, HH:mm')) ?></time>
</li>
<?php endforeach; ?>
</ol>
<?php endif; ?>
</section>