]> _ Git - fluidbook-toolbox.git/commitdiff
wip #6195 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 16 Aug 2023 12:15:46 +0000 (14:15 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 16 Aug 2023 12:15:46 +0000 (14:15 +0200)
app/Console/Commands/QuizPullSources.php [new file with mode: 0644]
app/Fields/QuizDevelopmentVersion.php
app/Models/Quiz.php

diff --git a/app/Console/Commands/QuizPullSources.php b/app/Console/Commands/QuizPullSources.php
new file mode 100644 (file)
index 0000000..0cd7d8d
--- /dev/null
@@ -0,0 +1,22 @@
+<?php
+
+namespace App\Console\Commands;
+
+use App\Models\Traits\QuizBranches;
+use Cubist\Backpack\Console\Commands\CubistCommand;
+use Cubist\Util\PHP;
+
+class QuizPullSources extends CubistCommand
+{
+    protected $signature = 'quiz:player:updatesources';
+    protected $description = 'Update quiz player sources from git repos';
+
+    use QuizBranches;
+
+    public function handle()
+    {
+        PHP::neverStop(true);
+        $this->updateAllBranches();
+    }
+
+}
index a4396357175fbcb3269162070e905b70f2f4d96b..0e8c03f4c22deeede245aeae67e7d84a7408d66c 100644 (file)
@@ -2,12 +2,15 @@
 
 namespace App\Fields;
 
+use App\Models\Traits\QuizBranches;
 use Cubist\Backpack\Magic\Fields\SelectFromArray;
 
 class QuizDevelopmentVersion extends SelectFromArray
 {
     protected static $__options = null;
 
+    use QuizBranches;
+
     /**
      * @throws \JsonException
      */
index 041ffd86bc8b454ab29e2860933c97d4e29623f1..57c4aee65753cb83baafa34e76ddfb7edfc9c52b 100644 (file)
@@ -3,6 +3,7 @@
 namespace App\Models;
 
 use App\Elearning\QuizCompiler;
+use App\Fields\QuizDevelopmentVersion;
 use App\Fields\SCORMVersion;
 use App\Http\Controllers\Admin\Operations\ChangeownerOperation;
 use App\Http\Controllers\Admin\Operations\Quiz\DownloadOperation;
@@ -43,7 +44,7 @@ class Quiz extends ToolboxModel
 
     public $registerMediaConversionsUsingModelInstance = false;
 
-    protected $_operations = [PreviewOperation::class, DownloadOperation::class, LogOperation::class, ReportOperation::class,  ChangeownerOperation::class];
+    protected $_operations = [PreviewOperation::class, DownloadOperation::class, LogOperation::class, ReportOperation::class, ChangeownerOperation::class];
 
     use SCORMVersionTrait;
 
@@ -116,6 +117,7 @@ class Quiz extends ToolboxModel
 
         $this->addColumnDateFields();
         $this->addOwnerField();
+        $this->addField('dev_version', QuizDevelopmentVersion::class, __('Canal de mise à jour'), ['default' => 'stable', 'databaseDefault' => 'stable']);
 
         $this->addField('section_settings', FormSuperSection::class, __('Paramètres'));