]> _ Git - fluidbook-toolbox.git/commitdiff
wip #5041 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 11 Feb 2022 17:59:16 +0000 (18:59 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 11 Feb 2022 17:59:16 +0000 (18:59 +0100)
.idea/workspace.xml
app/Models/ELearningPackage.php
app/SubForms/ElearningPackageContent.php

index 0303fd33eed4152d475a696722b71bbb615c5045..e099db0836375174589c67d04dc3481a9e8b0fd1 100644 (file)
     <select />
   </component>
   <component name="ChangeListManager">
-    <list default="true" id="5d2ecd5e-a05a-4f96-a195-fa6372618165" name="Default Changelist" comment="wip #5041 @1.5">
+    <list default="true" id="5d2ecd5e-a05a-4f96-a195-fa6372618165" name="Default Changelist" comment="wip #5041 @0.5">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/app/Models/ELearningMedia.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/ELearningMedia.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/app/Models/ELearningPackage.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/ELearningPackage.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/app/SubForms/ElearningPackageContent.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/SubForms/ElearningPackageContent.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/resources/elearningpackage/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/resources/elearningpackage/index.html" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/resources/elearningpackage/js/app.js" beforeDir="false" afterPath="$PROJECT_DIR$/resources/elearningpackage/js/app.js" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
       <workItem from="1644394645639" duration="13635000" />
       <workItem from="1644425348765" duration="2270000" />
       <workItem from="1644508187200" duration="10853000" />
-      <workItem from="1644582031422" duration="6403000" />
-    </task>
-    <task id="LOCAL-00193" summary="wait #3753 @0.5">
-      <created>1636097330320</created>
-      <option name="number" value="00193" />
-      <option name="presentableId" value="LOCAL-00193" />
-      <option name="project" value="LOCAL" />
-      <updated>1636097330320</updated>
+      <workItem from="1644582031422" duration="8009000" />
     </task>
     <task id="LOCAL-00194" summary="wait #3753 @0.5">
       <created>1636109781730</created>
       <option name="project" value="LOCAL" />
       <updated>1644599546287</updated>
     </task>
-    <option name="localTasksCounter" value="242" />
+    <task id="LOCAL-00242" summary="wip #5041 @0.5">
+      <created>1644600735992</created>
+      <option name="number" value="00242" />
+      <option name="presentableId" value="LOCAL-00242" />
+      <option name="project" value="LOCAL" />
+      <updated>1644600735992</updated>
+    </task>
+    <option name="localTasksCounter" value="243" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
     <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
     <option name="CHECK_NEW_TODO" value="false" />
     <option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
-    <MESSAGE value="wip #4895 @1" />
     <MESSAGE value="wait #4891 @2" />
     <MESSAGE value="wait #4928 @2" />
     <MESSAGE value="wait #4928 @0.25" />
     <MESSAGE value="wip #5041" />
     <MESSAGE value="wip #5041 @1" />
     <MESSAGE value="wip #5041 @1.5" />
-    <option name="LAST_COMMIT_MESSAGE" value="wip #5041 @1.5" />
+    <MESSAGE value="wip #5041 @0.5" />
+    <option name="LAST_COMMIT_MESSAGE" value="wip #5041 @0.5" />
   </component>
   <component name="XSLT-Support.FileAssociations.UIState">
     <expand />
index dff831fb9a4c108316f36c2b011505f9422b58d9..1d5183a034ba3a2f40d6f6a992dc7e79d42ebd2b 100644 (file)
@@ -71,7 +71,7 @@ class ELearningPackage extends ToolboxModel
         $vdir->copyDirectory(resource_path('elearningpackage/dist/css'), 'css');
         $vdir->copyDirectory(resource_path('elearningpackage/dist/js'), 'js');
         $vdir->copyDirectory(resource_path('elearningpackage/dist/fonts'), 'fonts');
-        $vdir->copyDirectory(resource_path('pdfjs'), 'pdfjs');
+        $vdir->copyDirectory(resource_path('pdfjs'), 'js/libs/pdfjs');
         $vdir->copy(resource_path('elearningpackage/index.html'), 'index.html');
         $vdir->sync(true);
     }
@@ -86,7 +86,7 @@ class ELearningPackage extends ToolboxModel
     {
         $basePath = 'packages/' . $id . '/';
 
-        $res = ['id' => $id, 'title' => trim($c['content_title']), 'type' => $c['content_type'], 'scorm' => true, 'mandatory' => $c['mandatory'], 'path' => $basePath . 'index.html'];
+        $res = ['id' => $id, 'title' => trim($c['content_title']), 'type' => $c['content_type'], 'scorm' => !$c['complete_when_opened'], 'mandatory' => $c['mandatory'], 'path' => $basePath . 'index.html'];
         if ($res['type'] === 'QZ' && $res['mandatory']) {
             $res['lock'] = range(0, $id - 1);
         }
@@ -107,6 +107,8 @@ class ELearningPackage extends ToolboxModel
                 break;
             case 'IN':
                 $moduleTitle = $this->_compilePDF($c['infographic_file'], $vdir, $basePath);
+                $res['path'] = $basePath . '/infographic.pdf';
+                $res['scorm'] = false;
                 break;
             case 'FC':
             default:
@@ -174,7 +176,7 @@ class ELearningPackage extends ToolboxModel
             return null;
         }
         $file = $f->getPath();
-        $title= ELearningMedia::compileFromFile($file, $tmp, '', $organization, 'MEDIA_' . $media_file);
+        $title = ELearningMedia::compileFromFile($file, $tmp, '', $organization, 'MEDIA_' . $media_file);
         $vdir->copyDirectory($tmp, $basePath);
         return $title;
     }
@@ -210,8 +212,8 @@ class ELearningPackage extends ToolboxModel
         $tmp = Files::tmpdir();
         $vdir->addTemp($tmp);
 
-        $f=$this->getMediaByCollection($collection)->first();
-        if(null===$f){
+        $f = $this->getMediaByCollection($collection)->first();
+        if (null === $f) {
             return null;
         }
         $spf = new \SplFileInfo($f->getPath());
index a3db0b1a52ad04485f09a8ceb7b4fc872ee6473c..1e00ac013f53fcfdeecb57054c99a97350d04edb 100644 (file)
@@ -45,9 +45,10 @@ class ElearningPackageContent extends SubForm
 
         $this->addField('infographic_file', Files::class, __('Charger une infographie'), ['when' => ['content_type' => ['IN']], 'acceptedFiles' => ['application/pdf']]);
 
-        $this->addField('content_file', Files::class, __('Charger un contenu'), ['when' => ['content_type' => ['FC']], 'acceptedFiles' => ['application/zip']]);
+        $this->addField('content_file', Files::class, __('Charger un contenu'), ['when' => ['content_type' => ['FC']], 'acceptedFiles' => ['.zip']]);
 
         $this->addField('mandatory', Checkbox::class, __('Obligatoire'), ['default' => true]);
+        $this->addField('complete_when_opened', Checkbox::class, __('Marquer comme terminé dès l\'ouverture'), ['hint' => __('Pour les contenus non-SCORM ou les contenus SCORM qui ne marquent pas les contenu comme terminé')]);
         $this->addField('content_title', Text::class, __('Titre'), ['hint' => __('Laisser vide pour utiliser le titre par défaut')]);
     }
 }