$quizOptions
* @var bool|null $hasResponses
*/
use App\Service\YouTubeService;
$isNew = $slide->isNew();
$settings = $slide->getSettings();
$this->assign('title', $isNew ? __('Neue Folie') : __('Folie bearbeiten'));
$this->assign('noindex', '1');
$formUrl = $isNew
? ['_name' => 'slides:add', 'token' => $adminToken, '?' => ['type' => $slide->type]]
: ['_name' => 'slides:edit', 'token' => $adminToken, 'id' => $slide->id];
$optionsError = $slide->getError('options_text');
?>
← = __('Zurück zu „{0}“', h($poll->title)) ?>
= h($slide->typeLabel()) ?>
= $isNew ? __('Neue Folie') : __('Folie bearbeiten') ?>
= $this->Form->create($slide, ['url' => $formUrl]) ?>
= $this->Form->hidden('type') ?>
isYouTube()) :
$urlError = $slide->getError('youtube_url');
$startError = $slide->getError('youtube_start');
$linkStart = YouTubeService::parseUrl((string)$settings['url'])['start'] ?? null;
// Leave the field empty when the start comes from the link, so a changed link wins.
$startValue = $this->getRequest()->is(['post', 'put', 'patch'])
? (string)$this->getRequest()->getData('settings.start', '')
: ((int)$settings['start'] > 0 && (int)$settings['start'] !== $linkStart ? YouTubeService::formatTime((int)$settings['start']) : '');
$previewUrl = $settings['video_id'] !== '' && !$urlError
? YouTubeService::embedUrl((string)$settings['video_id'], (int)$settings['start'])
: null;
?>
= __('YouTube-Link') ?>
value="= h((string)$settings['url']) ?>"
placeholder="https://www.youtube.com/watch?v=dQw4w9WgXcQ"
aria-describedby="youtube-url-hint youtube-status= $urlError ? ' youtube-url-error' : '' ?>"
= $urlError ? 'aria-invalid="true"' : '' ?> data-youtube-url>
= __('Link prüfen') ?>
= __('Links von youtube.com, youtu.be und Shorts funktionieren. Beim Speichern wird geprüft, ob das Video existiert und eingebettet werden darf.') ?>
= h(implode(' ', (array)$urlError)) ?>
>
= __('Start bei (Minute:Sekunde, optional)') ?>
data-youtube-start>
= $linkStart !== null
? __('Leer lassen, um beim Zeitpunkt aus dem Link ({0}) zu starten.', YouTubeService::formatTime($linkStart))
: __('Z. B. 1:30 oder nur die Minute (2). Leer lassen, um am Anfang bzw. beim Zeitpunkt aus dem Link (…&t=90s) zu starten.') ?>
= h(implode(' ', (array)$startError)) ?>
= $this->Form->control('settings.autoplay', [
'type' => 'checkbox',
'label' => __('Automatisch abspielen, sobald die Folie in der Präsentation erscheint'),
'checked' => (bool)$settings['autoplay'],
]) ?>
= __('Manche Browser spielen Videos mit Ton erst automatisch ab, nachdem du in der Präsentation einmal geklickt oder eine Taste gedrückt hast.') ?>
= $this->Form->control('question', [
'label' => match ($slide->type) {
'content' => __('Überschrift'),
'youtube' => __('Titel'),
default => __('Frage'),
},
'maxlength' => 500,
'required' => !$slide->isYouTube(),
'autofocus' => $isNew && !$slide->isYouTube(),
'placeholder' => $slide->isYouTube() ? __('Leer lassen, um den Titel des Videos zu übernehmen') : null,
'data-youtube-title' => $slide->isYouTube() ? '' : null,
]) ?>
= $this->Form->control('description', [
'type' => 'textarea',
'rows' => $slide->type === 'content' ? 6 : 2,
'label' => $slide->type === 'content' ? __('Text') : __('Beschreibung (optional)'),
]) ?>
type === 'choice') : ?>
= __('Antwortoptionen (eine pro Zeile, max. 20)') ?>
= h(implode(' ', (array)$optionsError)) ?>
= __('Achtung: Entfernte oder umbenannte Optionen verlieren ihre bisherigen Stimmen.') ?>
= $this->Form->control('settings.multiple', [
'type' => 'checkbox',
'label' => __('Mehrfachauswahl erlauben'),
'checked' => (bool)$settings['multiple'],
]) ?>
type === 'wordcloud') : ?>
= $this->Form->control('settings.allow_upvotes', [
'type' => 'checkbox',
'label' => __('Upvotes erlauben (Teilnehmende sehen die Wortwolke live und können Begriffe per Klick unterstützen)'),
'checked' => (bool)$settings['allow_upvotes'],
]) ?>
= $this->Form->control('settings.allow_downvotes', [
'type' => 'checkbox',
'label' => __('Downvotes erlauben (nur zusammen mit Upvotes: Teilnehmende können Begriffe anderer ablehnen)'),
'checked' => (bool)$settings['allow_downvotes'],
]) ?>
type === 'scale') : ?>
= $this->Form->control('settings.scale_min', [
'type' => 'select', 'options' => [0 => '0', 1 => '1'],
'label' => __('Von'), 'value' => $settings['scale_min'],
]) ?>
= $this->Form->control('settings.scale_max', [
'type' => 'select', 'options' => array_combine(range(2, 10), range(2, 10)),
'label' => __('Bis'), 'value' => $settings['scale_max'],
]) ?>
= $this->Form->control('settings.min_label', [
'label' => __('Beschriftung links (optional)'), 'maxlength' => 60,
'placeholder' => __('z. B. gar nicht'), 'value' => $settings['min_label'],
]) ?>
= $this->Form->control('settings.max_label', [
'label' => __('Beschriftung rechts (optional)'), 'maxlength' => 60,
'placeholder' => __('z. B. sehr'), 'value' => $settings['max_label'],
]) ?>
type === 'quiz') :
$quizError = $slide->getError('quiz_options');
$rows = $quizOptions;
// Always offer a few empty rows (more via "Antwort hinzufügen" with JS).
$rowCount = min(\App\Model\Table\SlidesTable::MAX_QUIZ_OPTIONS, max(4, count($rows) + 1));
$rows = array_pad($rows, $rowCount, ['label' => '', 'correct' => false]);
?>
>
= __('Antworten') ?>
= __('Mindestens zwei Antworten, maximal {0}. Hake die richtige(n) an – Teilnehmende sehen erst nach dem Ende, was richtig war.', \App\Model\Table\SlidesTable::MAX_QUIZ_OPTIONS) ?>
$row) : ?>
= __('Antwort {0}', $i + 1) ?>
>
>
= __('richtig') ?>
+ = __('Antwort hinzufügen') ?>
= h(implode(' ', (array)$quizError)) ?>
= __('Achtung: Entfernte oder umbenannte Antworten verlieren ihre bisherigen Stimmen.') ?>
__('Kein Zeitlimit – ich beende das Quiz selbst'),
$seconds < 60 => __('{0} Sekunden', $seconds),
$seconds % 60 === 0 => __n('{0} Minute', '{0} Minuten', intdiv($seconds, 60), intdiv($seconds, 60)),
default => __('{0} Minuten', number_format($seconds / 60, 1, ',', '')),
};
}
?>
= $this->Form->control('settings.time_limit', [
'type' => 'select',
'options' => $limits,
'label' => __('Zeitlimit'),
'value' => $settings['time_limit'],
]) ?>
= __('Das Quiz startet erst, wenn du es in der Präsentation startest. Du kannst es jederzeit vorzeitig beenden.') ?>
isInteractive() && !$slide->isQuiz()) : ?>
= $this->Form->control('is_voting_open', [
'type' => 'checkbox',
'label' => __('Abstimmung geöffnet'),
'checked' => $isNew ? true : $slide->is_voting_open,
]) ?>
= $this->Form->end() ?>