]> _ Git - hf-scorm-package.git/commitdiff
wip #4907 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 14 Dec 2021 11:20:52 +0000 (12:20 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 14 Dec 2021 11:20:52 +0000 (12:20 +0100)
data.js
js/scormpackage.js

diff --git a/data.js b/data.js
index 4d9e431c673f121729b0125f6613ed9fcec35d81..5a5b57db5abf753b7c997e4e01893187b7cab0bf 100644 (file)
--- a/data.js
+++ b/data.js
@@ -6,28 +6,32 @@ const DATA = {
             "title": "Title of the module",
             "type": "IN",
             "path": "packages/IN/HF_IN_PositiveCulture_v1_UK EN_outlined.pdf",
-            "mandatory": true
+            "mandatory": true,
+            "scorm": false,
         },
         {
             "id": 1,
             "title": "Title of the module",
             "type": "AN",
             "path": "packages/AN/HF_AN_038_Building a positive culture_UK EN.mp4",
-            "mandatory": true
+            "mandatory": true,
+            "scorm": false,
         },
         {
             "id": 2,
             "title": "Title of the module",
             "type": "VI",
             "path": "packages/Ti5/TI5_100_Positive-Culture_UK EN.mp4",
-            "mandatory": true
+            "mandatory": true,
+            "scorm": false,
         },
         {
             "id": 3,
             "title": "Title of the module",
             "type": "FB",
             "path": "packages/FB/index.html",
-            "mandatory": true
+            "mandatory": true,
+            "scorm": true,
         },
         {
             "id": 4,
@@ -40,7 +44,8 @@ const DATA = {
                 1,
                 2,
                 3
-            ]
+            ],
+            "scorm": true,
         }
     ]
 };
\ No newline at end of file
index 549f3654aa72613288db63a8b75bec2b5c7e1fe8..86515d8b3960312941e56b9f09c8243a3ea02c3e 100644 (file)
@@ -1,3 +1,5 @@
+var status = {};
+
 (function (global) {
     $(function () {
         initEvents();
@@ -41,6 +43,23 @@ function openSubSCO(id) {
     $("#scobar #scoicon").html(getSpriteIcon('icon-' + module.type));
     $("#scobar .close").html(getSpriteIcon('interface-close'));
     $("#sco").attr('src', path);
+
+    if (!module.scorm) {
+        setModuleState(module.id, 'completed', 'passed', 100);
+    }
+}
+
+function setModuleState(id, completion_status, success_status, score, location) {
+    if (location === undefined) {
+        location = {};
+    }
+    var s = {completion_status: completion_status, success_status: success_status, score: score, location: location};
+    status[id] = s;
+    saveStatus();
+}
+
+function saveStatus() {
+
 }
 
 function getModuleData(id) {