]> _ Git - fluidbook-toolbox.git/commitdiff
wait #4370 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 24 Mar 2021 16:51:08 +0000 (17:51 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 24 Mar 2021 16:51:08 +0000 (17:51 +0100)
app/Models/Quiz.php
app/SubForms/Question.php

index 18c4e317148b77e2dd022c4512d3e3abc91af2c5..fa17ca03b175345d3b05d1dc31136d4e188b80eb 100644 (file)
@@ -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;
index 2f3ea0e8155b2e4992206402157e78963e2cae58..5dce61bac17a562a23213f408620fde19a566884 100644 (file)
@@ -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'),