]> _ Git - fluidbook-toolbox.git/commitdiff
wip #6412 @0:20
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 7 Nov 2023 17:07:29 +0000 (18:07 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 7 Nov 2023 17:07:29 +0000 (18:07 +0100)
app/Models/QuizTheme.php

index c742d10dee084dc9946f779cdfdaa784e4b71b51..6cea5da01bae468a855312f95bc3dabed00478db 100644 (file)
@@ -61,6 +61,7 @@ class QuizTheme extends ToolboxModel
         $this->_intro();
         $this->_standardQuestions();
         $this->_draganddropQuestions();
+        $this->_matchQuestions();
         $this->_outro();
     }
 
@@ -111,24 +112,29 @@ class QuizTheme extends ToolboxModel
         $this->addField('introImageMobile', FluidbookThemeImage::class, __('Mobile'), ['hint' => __('Taille recommandée : :size', ['size' => self::MOBILE_SIZE]), 'when' => ['introCustom' => 1]]);
     }
 
-    protected function _standardQuestions()
+    protected function _question($name, $title)
     {
-        $this->addField('sectionStandard', FormSection::class, __('Questions standards'));
-        $this->addField('standardColor', Color::class, __('Couleur et transparence du bloc'), ['hint' => __('Par défaut, la couleur neutre du thème'), 'allows_empty' => true]);
+        $this->addField('sectionQuestion' . $name, FormSection::class, $title);
+        $this->addField($name . 'Color', Color::class, __('Couleur et transparence du bloc'), ['hint' => __('Par défaut, la couleur neutre du thème'), 'allows_empty' => true]);
         $this->addField('', FormSeparator::class, '');
-        $this->addField('standardCustom', Checkbox::class, __('Définir une forme personnalisée'));
-        $this->addField('standardImage', FluidbookThemeImage::class, __('Desktop'), ['hint' => __('Taille recommandée : :size', ['size' => self::DESKTOP_SIZE]), 'when' => ['standardCustom' => 1]]);
-        $this->addField('standardImageMobile', FluidbookThemeImage::class, __('Mobile'), ['hint' => __('Taille recommandée : :size', ['size' => self::MOBILE_SIZE]), 'when' => ['standardCustom' => 1]]);
+        $this->addField($name . 'Custom', Checkbox::class, __('Définir une forme personnalisée'));
+        $this->addField($name . 'Image', FluidbookThemeImage::class, __('Desktop'), ['hint' => __('Taille recommandée : :size', ['size' => self::DESKTOP_SIZE]), 'when' => [$name . 'Custom' => 1]]);
+        $this->addField($name . 'ImageMobile', FluidbookThemeImage::class, __('Mobile'), ['hint' => __('Taille recommandée : :size', ['size' => self::MOBILE_SIZE]), 'when' => [$name . 'Custom' => 1]]);
+    }
+
+    protected function _standardQuestions()
+    {
+        $this->_question('standard', __('Questions standards'));
     }
 
     protected function _draganddropQuestions()
     {
-        $this->addField('sectionDraganddrop', FormSection::class, __('Questions "drag & drop"'));
-        $this->addField('draganddropColor', Color::class, __('Couleur et transparence des zones'), ['hint' => __('Par défaut, la couleur neutre du thème'), 'allows_empty' => true]);
-        $this->addField('', FormSeparator::class, '');
-        $this->addField('draganddropCustom', Checkbox::class, __('Définir une forme personnalisée'));
-        $this->addField('draganddropImage', FluidbookThemeImage::class, __('Desktop'), ['hint' => __('Taille recommandée : :size', ['size' => self::DESKTOP_SIZE]), 'when' => ['draganddropCustom' => 1]]);
-        $this->addField('draganddropImageMobile', FluidbookThemeImage::class, __('Mobile'), ['hint' => __('Taille recommandée : :size', ['size' => self::MOBILE_SIZE]), 'when' => ['draganddropCustom' => 1]]);
+        $this->_question('draganddrop', __('Questions "drag & drop"'));
+    }
+
+    protected function _matchQuestions()
+    {
+        $this->_question('match', __('Questions "faire correspondre les propositions"'));
     }
 
     protected function _outro()