From: Vincent Vanwaelscappel Date: Wed, 26 Feb 2020 18:47:31 +0000 (+0100) Subject: wip #3438 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=eebe1325d08f2eb3f07d8962ab9b790e38357e89;p=QuizFactory.git wip #3438 @0.5 --- diff --git a/app/Models/Quiz.php b/app/Models/Quiz.php new file mode 100644 index 0000000..1dc196e --- /dev/null +++ b/app/Models/Quiz.php @@ -0,0 +1,68 @@ + 'quiz', + 'singular' => 'quiz', + 'plural' => 'quizzes']; + + public function setFields() + { + parent::setFields(); + + $this->addField(['name' => 'title', + 'label' => 'Quiz title', + 'type' => 'Text', + 'column' => true, + 'tab' => 'Settings']); + + $this->addField(['name' => 'scorm', + 'label' => 'SCORM enabled', + 'type' => 'Checkbox', + 'column' => true, + 'tab' => 'Settings']); + + $this->addField(['name' => 'review', + 'label' => 'Enable answer review', + 'hint' => 'Let the user review his answers and the correct ones at the end of the quiz', + 'type' => 'Checkbox', + 'tab' => 'Settings']); + + $this->addField(['name' => 'locale', + 'label' => 'Quiz language', + 'type' => 'Locale', + 'column' => true, + 'tab' => 'Texts and translations']); + + $colors = [ + 'mainColor' => ['label' => 'Main color', 'hint' => 'Buttons and rollovers color'], + 'overlay' => ['label' => 'Overlay', 'hint' => 'Overlay set on the banner'], + 'okColor' => ['label' => 'OK color', 'hint' => 'Color of the ok badge (usually green)'], + 'nokColor' => ['label' => 'NOK color', 'hint' => 'Color of the not ok badge (usually red)'], + 'reviewBackground' => ['label' => 'Review panel background color'], + ]; + + $default = ['tab' => 'Theme', 'type' => 'Color']; + foreach ($colors as $name => $color) { + $f = array_merge($default, $color, ['name' => $name]); + $this->addField($f); + } + + $images = [ + 'logo' => 'Logo', + 'banner' => 'Banner', + ]; + $default = ['tab' => 'Theme', 'type' => 'Images', 'maxFiles' => 1]; + foreach ($images as $name => $label) { + $f = array_merge($default, ['name' => $name, 'label' => $label]); + $this->addField($f); + } + } +} diff --git a/resources/views/vendor/backpack/base/inc/sidebar_content.blade.php b/resources/views/vendor/backpack/base/inc/sidebar_content.blade.php index d3c343a..72b37a8 100644 --- a/resources/views/vendor/backpack/base/inc/sidebar_content.blade.php +++ b/resources/views/vendor/backpack/base/inc/sidebar_content.blade.php @@ -1,6 +1,9 @@ + +