]> _ Git - fluidbook-toolbox.git/commitdiff
wip #3530 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 30 Mar 2020 14:52:59 +0000 (16:52 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 30 Mar 2020 14:52:59 +0000 (16:52 +0200)
app/Models/Quiz.php

index bc0c344cfccc9551b666687a8780fd3a5c3cfeec..472e99fb9a060a9d56e7467075513c7edd76643f 100644 (file)
@@ -236,6 +236,30 @@ class Quiz extends CubistMagicAbstractModel
             $xq->addChild('correction', $question['explaination']);
         }
         file_put_contents($dest . '/data.xml', tidy_repair_string($xml->asXML(), ['input-xml' => 1, 'indent' => 1, 'wrap' => 0]));
+
+        if ($this->getAttribute('scorm')) {
+            $title = htmlspecialchars($this->getAttribute('title'));
+            file_put_contents($dest . '/imsmanifest.xml', '<?xml version="1.0" encoding="UTF-8"?>
+<manifest xmlns="http://www.imsproject.org/xsd/imscp_rootv1p1p2" xmlns:imsmd="http://www.imsglobal.org/xsd/imsmd_rootv1p2p1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:adlcp="http://www.adlnet.org/xsd/adlcp_rootv1p2" identifier="MANIFEST-90878C16-EB60-D648-94ED-9651972B5F42" xsi:schemaLocation="http://www.imsproject.org/xsd/imscp_rootv1p1p2 imscp_rootv1p1p2.xsd http://www.imsglobal.org/xsd/imsmd_rootv1p2p1 imsmd_rootv1p2p1.xsd http://www.adlnet.org/xsd/adlcp_rootv1p2 adlcp_rootv1p2.xsd">
+    <metadata>
+        <schema>ADL SCORM</schema>
+        <schemaversion>1.2</schemaversion>
+    </metadata>
+    <organizations default="hf">
+        <organization identifier="hf" structure="hierarchical">
+            <title>' . $title . '</title>
+            <item identifier="hfq" identifierref="hfq" isvisible="true">
+                <title>' . $title . '</title>
+            </item>
+        </organization>
+    </organizations>
+    <resources>
+        <resource type="webcontent" adlcp:scormtype="sco" identifier="hfq" href="index.html">
+            <file href="index.html"/>
+        </resource>
+    </resources>
+</manifest>');
+        }
     }
 
     public static function getMessages()