]> _ Git - fluidbook-toolbox.git/commitdiff
wip #3924 @3
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 7 Oct 2020 18:05:59 +0000 (20:05 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 7 Oct 2020 18:05:59 +0000 (20:05 +0200)
app/Models/Company.php
app/Models/Quiz.php
app/SubForms/Question.php
composer.json
resources/views/vendor/backpack/base/inc/sidebar_content.blade.php

index b2d07b0f7ac8baed60cbb3155dd686689e8a7945..8402220f6bbcc7985a704d73fd66d44abf13c641 100644 (file)
@@ -1,4 +1,7 @@
 <?php
-class Company extends \Cubedesigners\UserDatabase\Company{
-    protected $_syncDbSchema=false;
+
+namespace App\Models;
+class Company extends \Cubedesigners\UserDatabase\Company
+{
+    protected $_syncDbSchema = false;
 }
index 84008206c26f61f83811a0121fe4dad2e8d72970..627d1697698567b7e393c0abe38f3378fd1c88b0 100644 (file)
@@ -132,6 +132,12 @@ class Quiz extends CubistMagicAbstractModel
             'hint' => 'Over this score (out of 100), the quiz is passed. Set 0 to disable',
             'tab' => 'Settings']);
 
+        $this->addField(['name'=>'instantReview',
+            'label'=>'Enable instant review',
+            'hint'=>'Let the user see if he had a correct or wrong answer, just after his answer',
+            'type'=>'Checkbox',
+            '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',
index 9b7625ee5127f5e2a3b71123bbe0fff6bd2bd7d4..815ee738d18e22ab7d2403b906b25f44ad28d75c 100644 (file)
@@ -13,7 +13,15 @@ class Question extends SubForm
 
         $this->addField(['name' => 'question',
             'type' => 'Text',
-            'label' => 'Question']);
+            'label' => 'Question label']);
+
+        $this->addField(['name' => 'type',
+            'type' => 'SelectFromArray',
+            'label' => 'Type',
+            'options' => ['multiple' => 'Multiple choice question',
+                'text' => 'Text',
+                'textarea' => 'Long text',
+                'email' => 'E-mail']]);
 
         $this->addField(['name' => 'explaination',
             'type' => 'Textarea',
@@ -22,7 +30,9 @@ class Question extends SubForm
 
         $this->addField(['name' => 'multiple',
             'type' => 'Checkbox',
-            'label' => 'Multiple answers']);
+            'label' => 'Multiple answers',
+            'when' => ['type' => 'multiple']
+        ]);
 
         $this->addField([
             'name' => 'answers',
@@ -30,17 +40,7 @@ class Question extends SubForm
             'bunch' => 'App\SubForms\Answer',
             'add_label' => 'New answer',
             'label' => 'Answers',
+            'when' => ['type' => 'multiple']
         ]);
-
-
-//        $this->addField([
-//            'name' => 'questions',
-//            'type' => 'BunchOfFieldsMultiple',
-//            'bunch' => 'App\SubForms\Answer',
-//            'label' => 'Questions',
-//            'add_label' => 'Add question',
-//            'tab' => 'Questions / Answers',
-//        ]);
-
     }
 }
index 5f2d55965daf27ea052199d3299a62736682871d..4f24d4cbd5b2e8cbd1b72aba9e2dd6284d914a1d 100644 (file)
         "league/csv": "^9.6"
     },
     "require-dev": {
-        "facade/ignition": "^2.0",
+        "facade/ignition": "^2.3",
         "fzaninotto/faker": "^1.9.1",
         "mockery/mockery": "^1.4",
         "nunomaduro/collision": "^4.2",
         "phpunit/phpunit": "^8.5",
-        "barryvdh/laravel-ide-helper": "^2.7",
+        "barryvdh/laravel-ide-helper": "^2.8",
         "filp/whoops": "^2.7",
         "laravel/tinker": "^2.4"
     },
index 0305d3f0c106011eaf1902e8feccb00fa40b0504..7b4cd8e06412acd5209eaa3badbe6fe3e3285b3f 100644 (file)
@@ -1,6 +1,7 @@
 <!-- This file is used to store sidebar items, starting with Backpack\Base 0.9.0 -->
 <li class="nav-item"><a class="nav-link" href="{{ backpack_url('dashboard') }}"><i
-            class="nav-icon la"><img src="/images/icons/icon-fluidbook.svg" /></i>{{ trans('backpack::base.dashboard') }}</a></li>
+            class="nav-icon la"><img src="/images/icons/icon-fluidbook.svg"/></i>{{ trans('backpack::base.dashboard') }}
+    </a></li>
 
 @canany(['toolbox:quiz','toolbox:quiz:translate'])
     <li class='nav-item nav-dropdown open'><a class='nav-link nav-dropdown-toggle' href='#'><i
             @endcan
         </ul>
     </li>
+@endcanany
+
+@can('fluidbook:admin')
+<li class='nav-item nav-dropdown open'><a class='nav-link nav-dropdown-toggle' href='#'><i
+            class='nav-icon la la-tools'></i>Fluidbook</a>
+    <ul class='nav-dropdown-items'>
+        <li class="nav-item"><a class="nav-link" href="{{ backpack_url('signatures') }}"><i
+                    class="la la-signature nav-icon"></i> Signatures</a></li>
+    </ul>
+</li>
 @endcan
 
+
 @can('toolbox:maintenance')
     <li class='nav-item nav-dropdown'><a class='nav-link nav-dropdown-toggle' href='#'><i
                 class='nav-icon la la-cogs'></i>Maintenance</a>