From b38090cd03cd153453d317da002c962d116c47d2 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 24 Mar 2021 17:51:08 +0100 Subject: [PATCH] wait #4370 @1 --- app/Models/Quiz.php | 3 +++ app/SubForms/Question.php | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Models/Quiz.php b/app/Models/Quiz.php index 18c4e3171..fa17ca03b 100644 --- a/app/Models/Quiz.php +++ b/app/Models/Quiz.php @@ -311,6 +311,9 @@ class Quiz extends CubistMagicAbstractModel // Fix boolean $booleans = ['multiple' => false, 'required' => true, 'count_for_score' => true]; foreach ($d['questions'] as $qn => $q) { + if (!isset($q['type']) || null === $q['type'] || !$q['type']) { + $d['questions'][$qn]['type'] = 'multiple'; + } foreach ($booleans as $b => $default) { if (!isset($d['questions'][$qn][$b])) { $d['questions'][$qn][$b] = $default; diff --git a/app/SubForms/Question.php b/app/SubForms/Question.php index 2f3ea0e81..5dce61bac 100644 --- a/app/SubForms/Question.php +++ b/app/SubForms/Question.php @@ -35,8 +35,9 @@ class Question extends SubForm 'text' => __('Texte'), 'textarea' => __('Texte long'), 'email' => __('E-mail'), - 'country'=>__('Pays'), - ]]); + 'country' => __('Pays'), + ] + ]); $this->addField(['name' => 'count_for_score', 'label' => __('Comptabiliser dans le score'), -- 2.39.5