Feature/qa prepared questions #69

Merged
gnilebein merged 3 commits from feature/qa-prepared-questions into main 2026-11-12 22:37:00 +01:00
Showing only changes of commit 34d7e20567 - Show all commits
+3 -3
View File
@@ -214,8 +214,8 @@ $optionsError = $slide->getError('options_text');
<?php elseif ($slide->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));
// Offer the two required rows (more via "Antwort hinzufügen" with JS), plus one spare when editing.
$rowCount = min(\App\Model\Table\SlidesTable::MAX_QUIZ_OPTIONS, max(2, count($rows) + 1));
$rows = array_pad($rows, $rowCount, ['label' => '', 'correct' => false]);
?>
<fieldset class="quiz-options<?= $quizError ? ' error' : '' ?>" data-quiz-options
@@ -266,7 +266,7 @@ $optionsError = $slide->getError('options_text');
<?php elseif ($slide->isOrder()) :
$orderError = $slide->getError('order_options');
$max = \App\Model\Table\SlidesTable::MAX_ORDER_OPTIONS;
$rows = array_pad($orderOptions, min($max, max(4, count($orderOptions) + 1)), '');
$rows = array_pad($orderOptions, min($max, max(2, count($orderOptions) + 1)), '');
?>
<fieldset class="order-options<?= $orderError ? ' error' : '' ?>" data-order-options data-max="<?= $max ?>"
aria-describedby="order-options-hint<?= $orderError ? ' order-options-error' : '' ?>">