From 5983057ef3f28404b72e8bdb77e4c92ae20ae364 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 7 Nov 2023 18:07:29 +0100 Subject: [PATCH] wip #6412 @0:20 --- app/Models/QuizTheme.php | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/app/Models/QuizTheme.php b/app/Models/QuizTheme.php index c742d10de..6cea5da01 100644 --- a/app/Models/QuizTheme.php +++ b/app/Models/QuizTheme.php @@ -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() -- 2.39.5