From: Vincent Vanwaelscappel Date: Tue, 14 Dec 2021 11:20:52 +0000 (+0100) Subject: wip #4907 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=9c6823c474f57c0ed335e56271b640021f9b7b4a;p=hf-scorm-package.git wip #4907 @0.25 --- diff --git a/data.js b/data.js index 4d9e431..5a5b57d 100644 --- 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 diff --git a/js/scormpackage.js b/js/scormpackage.js index 549f365..86515d8 100644 --- a/js/scormpackage.js +++ b/js/scormpackage.js @@ -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) {