@liascript/exporter 2.6.41--0.17.2 → 2.6.42--0.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/indexeddb/{index.57fae40d.js → index.3f51c360.js} +1 -1
- package/dist/assets/indexeddb/{index.c00f6c31.js → index.4d795213.js} +1 -1
- package/dist/assets/indexeddb/index.html +1 -1
- package/dist/assets/{scorm2004/jszip.min.63142cc8.js → indexeddb/jszip.min.4fbcc13f.js} +1 -1
- package/dist/assets/pdf/{index.87cd0e1f.js → index.84d086a5.js} +1 -1
- package/dist/assets/pdf/{index.b568f8ce.js → index.8c99cc66.js} +1 -1
- package/dist/assets/pdf/index.html +1 -1
- package/dist/assets/pdf/{jszip.min.63142cc8.js → jszip.min.4fbcc13f.js} +1 -1
- package/dist/assets/pdf/{jszip.min.19c66d77.js → jszip.min.eaecf580.js} +1 -1
- package/dist/assets/scorm1.2/SCORM1.2.27c5f7f8.js +1 -0
- package/dist/assets/scorm1.2/SCORM1.2.de9d97b1.js +1 -0
- package/dist/assets/scorm1.2/{index.e41eeaf5.js → index.597f2c88.js} +1 -1
- package/dist/assets/scorm1.2/{index.2c8361f8.js → index.cd4381b9.js} +1 -1
- package/dist/assets/scorm1.2/index.html +1 -1
- package/dist/assets/scorm1.2/{jszip.min.19c66d77.js → jszip.min.eaecf580.js} +1 -1
- package/dist/assets/scorm2004/SCORM2004.5ccbe265.js +1 -0
- package/dist/assets/scorm2004/SCORM2004.aa25a014.js +1 -0
- package/dist/assets/scorm2004/{index.81e0d7d5.js → index.76d94255.js} +1 -1
- package/dist/assets/scorm2004/{index.92824222.js → index.c4688f3e.js} +1 -1
- package/dist/assets/scorm2004/index.html +1 -1
- package/dist/assets/{web/jszip.min.63142cc8.js → scorm2004/jszip.min.4fbcc13f.js} +1 -1
- package/dist/assets/web/{index.60ae0439.js → index.f2dd64a2.js} +1 -1
- package/dist/assets/web/index.html +1 -1
- package/dist/assets/{indexeddb/jszip.min.63142cc8.js → web/jszip.min.4fbcc13f.js} +1 -1
- package/dist/assets/xapi/{index.cbea2dcb.js → index.f463d20d.js} +1 -1
- package/dist/assets/xapi/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/scorm1.2/SCORM1.2.67efdb83.js +0 -1
- package/dist/assets/scorm1.2/SCORM1.2.6aeaad7b.js +0 -1
- package/dist/assets/scorm2004/SCORM2004.b05ecf91.js +0 -1
- package/dist/assets/scorm2004/SCORM2004.dc46cb61.js +0 -1
- /package/dist/assets/{xapi → indexeddb}/jszip.min.eaecf580.js +0 -0
- /package/dist/assets/{indexeddb → xapi}/jszip.min.19c66d77.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en"><head><title>Lia</title><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><script src="index.4fa9e2a8.js"></script><script defer type="module" src="index.dc0d877e.js"></script><script defer src="index.b5aed5b7.js" nomodule></script><script defer type="module" src="index.ee409f2b.js"></script><script defer src="index.30f11b3f.js" nomodule></script><script defer type="module" src="index.f4cd9dd4.js"></script><script defer src="index.149bb06e.js" nomodule></script><script defer type="module" src="index.
|
|
1
|
+
<!DOCTYPE html><html lang="en"><head><title>Lia</title><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><script src="index.4fa9e2a8.js"></script><script defer type="module" src="index.dc0d877e.js"></script><script defer src="index.b5aed5b7.js" nomodule></script><script defer type="module" src="index.ee409f2b.js"></script><script defer src="index.30f11b3f.js" nomodule></script><script defer type="module" src="index.f4cd9dd4.js"></script><script defer src="index.149bb06e.js" nomodule></script><script defer type="module" src="index.f463d20d.js"></script><script defer src="index.a011f589.js" nomodule></script><script defer type="module" src="index.f6de41ed.js"></script><script defer src="index.23406900.js" nomodule></script><script defer type="module" src="index.6afc6073.js"></script><script defer src="index.b519f15b.js" nomodule></script><script defer type="module" src="index.7c52bb8e.js"></script><script defer src="index.4cdd4627.js" nomodule></script><script defer type="module" src="index.1df2912f.js"></script><script defer src="index.02e1e0e7.js" nomodule></script><script defer type="module" src="index.dbe3fe41.js"></script><script defer src="index.1edbdfd2.js" nomodule></script><link rel="icon shortcut" sizes="192x192" href="up_/up_/assets/logo_192.png"><meta name="mobile-web-app-capable" content="yes"><meta name="application-name" content="Lia"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"><meta name="apple-mobile-web-app-title" content="LiaScript"><meta name="msapplication-TileImage" content="up_/up_/assets/logo_192.png"><meta name="msapplication-TileColor" content="#0071c5"><meta name="msapplication-tap-highlight" content="no"><meta name="theme-color" content="#000000"><meta name="description" content="LiaScript is a service for running free and interactive online courses, build with its own Markup-language. So check out the following course ;-)"><link rel="apple-touch-icon" href="logo.8a716d9b.png"><link rel="icon" href="logo.8a716d9b.png" type="image/png"><script>window.xAPIConfig={endpoint:"",auth:"",actor:{objectType:"Agent",name:"Anonymous",mbox:"mailto:anonymous@example.com"},courseId:"",courseTitle:"",debug:!1};</script><style>.lds-dual-ring{width:150px;height:150px;display:inline-block}.lds-dual-ring:after{content:" ";width:128px;height:128px;border:5px solid #000;border-color:#000 transparent;border-radius:50%;margin:1px;-moz-animation:1.2s linear infinite lds-dual-ring;animation:1.2s linear infinite lds-dual-ring;display:block}@-moz-keyframes lds-dual-ring{0%{-moz-transform:rotate(0);transform:rotate(0)}to{-moz-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes lds-dual-ring{0%{-moz-transform:rotate(0);transform:rotate(0)}to{-moz-transform:rotate(360deg);transform:rotate(360deg)}}</style><link rel="stylesheet" href="index.0700a78d.css"></head><body> <noscript> This page requires JavaScript to be enabled! </noscript> <div id="IE-message" hidden> <h1>LiaScript - Problem</h1> <p> Hello! Welcome to LiaScript. This site is not fully supported in Internet Explorer 11 (and earlier) versions. </p> <p> As an alternative, you can use either of the options below to browse the site: </p> <ol> <li> Use Firefox browser. Here is the <a href="http://www.mozilla.org/en-US/firefox/new/">download link.</a> </li> <li> Use Google Chrome browser. Here is the <a href="https://support.google.com/chrome/answer/95346?hl=en">download link.</a> </li> </ol> <p>Thanks.</p> </div> </body></html>
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function t(t,e,i,s){Object.defineProperty(t,e,{get:i,set:s,enumerable:!0,configurable:!0})}var e=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).parcelRequire55a5;e.register("1FNwj",(function(i,s){t(i.exports,"Connector",(function(){return a}));var n=e("jXXgq"),o=e("ayIBF"),r=e("5aa3i"),c=e("fVQ47");class a extends n.Connector{init(){if(this.scorm){let t=this.scorm.LMSGetValue("cmi.core.lesson_mode")||"unknown";this.active="normal"===t||"unknown"===t,u('Running in "'+t+'" mode, results will'+(this.active?" ":" NOT ")+"be stored!"),l("open location ..."),this.location=r.jsonParse(this.scorm.LMSGetValue("cmi.core.lesson_location")),l("... ",this.location||0),null===this.location&&this.slide(0);let e=0;0===this.countObjectives()&&this.active?(l("seeding values ..."),e=this.initFirst("quiz",e),e=this.initFirst("survey",e),e=this.initFirst("task",e),l("... done")):(l("restoring values ..."),e=this.initSecond("quiz",e),e=this.initSecond("survey",e),e=this.initSecond("task",e),l("... done")),window.SCORE=0,this.score()}}initFirst(t,e){for(let i=0;i<this.db[t].length;i++){this.id[t].push([]);for(let s=0;s<this.db[t][i].length;s++)this.setObjective(e,this.db[t][i][s]),this.id[t][i].push(e),e++}return e}initSecond(t,e){for(let i=0;i<this.db[t].length;i++){this.id[t].push([]);for(let s=0;s<this.db[t][i].length;s++){let n=this.getObjective(e);n&&(this.db[t][i][s]=n),this.id[t][i].push(e),e++}}return e}score(){var t;if(!this.active||!this.score)return;let e=0,i=0,s=0,n=0;for(let t=0;t<this.db.quiz.length;t++)for(let o=0;o<this.db.quiz[t].length;o++)switch(n=this.db.quiz[t][o].score,e+=n,this.db.quiz[t][o].solved){case 1:i+=n;case-1:s+=n}const o=0===i?0:i/e;this.write("cmi.core.score.min","0"),this.write("cmi.core.score.max","100"),this.write("cmi.core.score.raw",function(t){const e=t.toFixed(4),[i,s]=e.toString().split(".");return`${i}.${s.padEnd(10,"0")}`}(100*o));let c=r.jsonParse((null===(t=this.scorm)||void 0===t?void 0:t.LMSGetValue("cmi.student_data.mastery_score"))||"null");null==c?this.write("cmi.core.lesson_status","not attempted"):o>=c/100?this.write("cmi.core.lesson_status","passed"):s+i===e?this.write("cmi.core.lesson_status","failed"):this.write("cmi.core.lesson_status","incomplete"),window.SCORE=o}open(t,e,i){if(null!==this.location){const t=this.location;setTimeout((function(){window.LIA.goto(t)}),500)}}slide(t){this.location=t,this.scorm&&this.active&&(this.scorm.LMSSetValue("cmi.core.lesson_location",JSON.stringify(t)),this.scorm.LMSCommit(""))}countObjectives(){return this.scorm?parseInt(this.scorm.LMSGetValue("cmi.objectives._count"))||0:null}initSettings(t,e=!1){return o.Settings.init(t,!1,this.setSettings)}setSettings(t){this.write("cmi.suspend_data",JSON.stringify(t))}getSettings(){let t="";try{var e;t=(null===(e=this.scorm)||void 0===e?void 0:e.LMSGetValue("cmi.suspend_data"))||null}catch(t){u("cannot read settings from cmi.suspend_data")}let i=null;if("string"==typeof t){try{i=JSON.parse(t)}catch(t){u("getSettings =>",t)}i||(i=o.Settings.data),window.innerWidth<=768&&(i.table_of_contents=!1)}return i}write(t,e){if(this.scorm){this.escape&&(e=e.replace(/"/g,'\\"'));try{this.scorm.LMSSetValue(t,e),this.scorm.LMSCommit("")}catch(i){if(u("Failed to write =>",t,e),u("Message:",i.message),void 0===this.escape){e=e.replace(/"/g,'\\"');try{this.scorm.LMSSetValue(t,e),this.scorm.LMSCommit(""),this.escape=!0}catch(t){this.escape=!1}}}}else u("could not write",t,e)}getObjective(t){let e;try{if(this.scorm&&(e=this.scorm.LMSGetValue(`cmi.objectives.${t}.id`),e))return r.decodeJSON(e)}catch(i){u("getObjective =>",i,`cmi.objectives.${t}.id`,e)}return null}setObjective(t,e){const i=r.encodeJSON(e);i.length>255&&u(`cmi.objectives.${t}.id`,"Content exceeds 256Bytes!"),this.write(`cmi.objectives.${t}.id`,i)}load(t){switch(t.table){case"quiz":case"survey":case"task":return l("loading ",t.table,t.id,this.db[t.table][t.id]),this.db[t.table][t.id]}}store(t){if(this.active)switch(u("store",t),t.table){case"quiz":this.storeHelper(t),this.score();break;case"survey":case"task":this.storeHelper(t)}}storeHelper(t){for(let e=0;e<this.db[t.table][t.id].length;e++)r.neq(t.data[e],this.db[t.table][t.id][e])&&(this.setObjective(this.id[t.table][t.id][e],t.data[e]),this.db[t.table][t.id][e]=t.data[e],"quiz"==t.table&&this.updateQuiz(this.id[t.table][t.id][e],t.data[e]))}updateQuiz(t,e){if(this.active)switch(e.solved){case 0:e.trial>0&&this.write(`cmi.objectives.${t}.status`,"failed");break;case 1:this.write(`cmi.objectives.${t}.status`,"completed");break;case-1:this.write(`cmi.objectives.${t}.status`,"incomplete")}}constructor(){var t;if(super(),this.active=!1,this.db={quiz:[],survey:[],task:[]},this.id={quiz:[],survey:[],task:[]},console.warn("Hello, this is LiaScript from within a SCORM 1.2 package. You should definitely try out the SCORM 2004 exporter, since this one cannot be used to store states or any kind of progress. The only thing that is stores, is currently the user location...\n\nIF YOU ARE AN ELABORATE AND EXPERIENCED SCORM DEVELOPER?\n========================================================\n\nAnd you want to help us, to extend this service, please contact us via LiaScript@web.de\n\nHave fun ;-)"),window.API||window.top&&window.top.API?this.scorm=window.API||(null===(t=window.top)||void 0===t?void 0:t.API):this.scorm=(0,c.getAPI)(),this.scorm){l("successfully opened API"),l("LMSInitialize",this.scorm.LMSInitialize("")),l("loading quizzes ...");try{this.db.quiz=window.config_.quiz||[[]],l(" ... done")}catch(t){u("... failed",t)}l("loading surveys ...");try{this.db.survey=window.config_.survey||[[]],l(" ... done")}catch(t){u("... failed",t)}l("loading tasks ...");try{this.db.task=window.config_.task||[[]],l(" ... done")}catch(t){u("... failed",t)}this.init()}}}function l(...t){console.log("SCORM1.2: ",...t)}function u(...t){console.log("SCORM1.2: ",...t)}})),e.register("jXXgq",(function(i,s){t(i.exports,"Connector",(function(){return r}));var n=e("3MPaZ"),o=e("ayIBF");class r{hasIndex(){return!1}storage(){return new n.LiaStorage}initSettings(t,e=!1){return o.Settings.init(t,e,this.setSettings)}setSettings(t){o.Settings.update(t)}getSettings(){let t="";try{t=localStorage.getItem(o.Settings.PORT)}catch(t){console.warn("cannot write to localStorage")}let e=null;if("string"==typeof t){try{e=JSON.parse(t)}catch(t){console.warn("getSettings =>",t)}e||(e=o.Settings.data),window.innerWidth<=768&&(e.table_of_contents=!1)}return e}open(t,e,i){}load(t){}store(t){}update(t,e){}slide(t){}getIndex(){}deleteFromIndex(t){}async storeToIndex(t){}restoreFromIndex(t,e){}reset(t,e){this.initSettings(null,!0)}async getFromIndex(t){return null}async addMisc(t,e,i,s){console.log("addMisc not implemented")}async getMisc(t,e,i){console.log("getMisc not implemented")}constructor(){}}})),e.register("3MPaZ",(function(e,i){t(e.exports,"LiaStorage",(function(){return s}));class s{getItems(t=[]){"string"==typeof t&&(t=[t]);let e={};for(let i=0;i<t.length;i++){let s=localStorage.getItem(t[i]);e[t[i]]=s?JSON.parse(s):s}return e}setItems(t){this._setLocal(t)}_setLocal(t){if("object"==typeof t)for(const[e,i]of Object.entries(t))localStorage.setItem(e,JSON.stringify(i))}constructor(){}}})),e.register("5aa3i",(function(e,i){t(e.exports,"encodeJSON",(function(){return r})),t(e.exports,"decodeJSON",(function(){return c})),t(e.exports,"jsonParse",(function(){return a})),t(e.exports,"neq",(function(){return l}));const s={SingleChoice:"sc",MultipleChoice:"mc",Text:"tx",Select:"st",Matrix:"mx",Generic:"gn",error_msg:"err"},n=Object.entries(s).reduce(((t,[e,i])=>(t[i]=e,t)),{});function o(t,e){if("object"!=typeof t||null===t)return t;if(Array.isArray(t))return t.map((t=>o(t,e)));const i={};for(const[s,n]of Object.entries(t))i[e[s]||s]=o(n,e);return i}function r(t){return JSON.stringify(o(t,s))}function c(t){return o(JSON.parse(t),n)}function a(t){try{return JSON.parse(t)}catch(t){}return null}function l(t,e){return JSON.stringify(t)!=JSON.stringify(e)}})),e.register("fVQ47",(function(e,i){t(e.exports,"getAPI",(function(){return o}));var s=0;function n(t){for(;null==t.API&&null!=t.parent&&t.parent!=t;){if(++s>7)return alert("Error finding API -- too deeply nested."),null;t=t.parent}return t.API}function o(){var t=n(window);return null==t&&null!=window.opener&&void 0!==window.opener&&(t=n(window.opener)),null==t&&alert("Unable to find the SCORM1.2 API adapter"),t}}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(){function t(t,e,n,i){Object.defineProperty(t,e,{get:n,set:i,enumerable:!0,configurable:!0})}var e=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).parcelRequire55a5;e.register("58dpJ",(function(n,i){t(n.exports,"Connector",(function(){return v}));var r=e("9Klpk"),o=e("3bWnf"),s=e("kb0qF"),a=e("5ENmm"),c=e("6Wo7Q"),u=e("bWNdT"),l=e("knzCS"),d=e("cRTHJ"),f=e("jxbaN"),h=e("jjBAR"),v=function(t){"use strict";(0,s.default)(n,t);var e=(0,u.default)(n);function n(){var t,i;if((0,r.default)(this,n),(t=e.call(this)).active=!1,t.db={quiz:[],survey:[],task:[]},t.id={quiz:[],survey:[],task:[]},console.warn("Hello, this is LiaScript from within a SCORM 1.2 package. You should definitely try out the SCORM 2004 exporter, since this one cannot be used to store states or any kind of progress. The only thing that is stores, is currently the user location...\n\nIF YOU ARE AN ELABORATE AND EXPERIENCED SCORM DEVELOPER?\n========================================================\n\nAnd you want to help us, to extend this service, please contact us via LiaScript@web.de\n\nHave fun ;-)"),window.API||window.top&&window.top.API?t.scorm=window.API||(null===(i=window.top)||void 0===i?void 0:i.API):t.scorm=(0,h.getAPI)(),t.scorm){g("successfully opened API"),g("LMSInitialize",t.scorm.LMSInitialize("")),g("loading quizzes ...");try{t.db.quiz=window.config_.quiz||[[]],g(" ... done")}catch(t){y("... failed",t)}g("loading surveys ...");try{t.db.survey=window.config_.survey||[[]],g(" ... done")}catch(t){y("... failed",t)}g("loading tasks ...");try{t.db.task=window.config_.task||[[]],g(" ... done")}catch(t){y("... failed",t)}t.init()}return t}return(0,o.default)(n,[{key:"init",value:function(){if(this.scorm){var t=this.scorm.LMSGetValue("cmi.core.lesson_mode")||"unknown";this.active="normal"===t||"unknown"===t,y('Running in "'+t+'" mode, results will'+(this.active?" ":" NOT ")+"be stored!"),g("open location ..."),this.location=f.jsonParse(this.scorm.LMSGetValue("cmi.core.lesson_location")),g("... ",this.location||0),null===this.location&&this.slide(0);var e=0;0===this.countObjectives()&&this.active?(g("seeding values ..."),e=this.initFirst("quiz",e),e=this.initFirst("survey",e),e=this.initFirst("task",e),g("... done")):(g("restoring values ..."),e=this.initSecond("quiz",e),e=this.initSecond("survey",e),e=this.initSecond("task",e),g("... done")),window.SCORE=0,this.score()}}},{key:"initFirst",value:function(t,e){for(var n=0;n<this.db[t].length;n++){this.id[t].push([]);for(var i=0;i<this.db[t][n].length;i++)this.setObjective(e,this.db[t][n][i]),this.id[t][n].push(e),e++}return e}},{key:"initSecond",value:function(t,e){for(var n=0;n<this.db[t].length;n++){this.id[t].push([]);for(var i=0;i<this.db[t][n].length;i++){var r=this.getObjective(e);r&&(this.db[t][n][i]=r),this.id[t][n].push(e),e++}}return e}},{key:"score",value:function(){var t;if(this.active&&this.score){for(var e=0,n=0,i=0,r=0,o=0;o<this.db.quiz.length;o++)for(var s=0;s<this.db.quiz[o].length;s++)switch(e+=r=this.db.quiz[o][s].score,this.db.quiz[o][s].solved){case 1:n+=r;case-1:i+=r}var c,u,l,d,h=0===n?0:n/e;this.write("cmi.core.score.min","0"),this.write("cmi.core.score.max","100"),this.write("cmi.core.score.raw",(c=(100*h).toFixed(4),u=(0,a.default)(c.toString().split("."),2),l=u[0],d=u[1],"".concat(l,".").concat(d.padEnd(10,"0"))));var v=f.jsonParse((null===(t=this.scorm)||void 0===t?void 0:t.LMSGetValue("cmi.student_data.mastery_score"))||"null");null==v?this.write("cmi.core.lesson_status","not attempted"):h>=v/100?this.write("cmi.core.lesson_status","passed"):i+n===e?this.write("cmi.core.lesson_status","failed"):this.write("cmi.core.lesson_status","incomplete"),window.SCORE=h}}},{key:"open",value:function(t,e,n){if(null!==this.location){var i=this.location;setTimeout((function(){window.LIA.goto(i)}),500)}}},{key:"slide",value:function(t){this.location=t,this.scorm&&this.active&&(this.scorm.LMSSetValue("cmi.core.lesson_location",JSON.stringify(t)),this.scorm.LMSCommit(""))}},{key:"countObjectives",value:function(){return this.scorm?parseInt(this.scorm.LMSGetValue("cmi.objectives._count"))||0:null}},{key:"initSettings",value:function(t){return d.Settings.init(t,!1,this.setSettings)}},{key:"setSettings",value:function(t){this.write("cmi.suspend_data",JSON.stringify(t))}},{key:"getSettings",value:function(){var t="";try{var e;t=(null===(e=this.scorm)||void 0===e?void 0:e.LMSGetValue("cmi.suspend_data"))||null}catch(t){y("cannot read settings from cmi.suspend_data")}var n=null;if("string"==typeof t){try{n=JSON.parse(t)}catch(t){y("getSettings =>",t)}n||(n=d.Settings.data),window.innerWidth<=768&&(n.table_of_contents=!1)}return n}},{key:"write",value:function(t,e){if(this.scorm){this.escape&&(e=e.replace(/"/g,'\\"'));try{this.scorm.LMSSetValue(t,e),this.scorm.LMSCommit("")}catch(n){if(y("Failed to write =>",t,e),y("Message:",n.message),void 0===this.escape){e=e.replace(/"/g,'\\"');try{this.scorm.LMSSetValue(t,e),this.scorm.LMSCommit(""),this.escape=!0}catch(t){this.escape=!1}}}}else y("could not write",t,e)}},{key:"getObjective",value:function(t){var e;try{if(this.scorm&&(e=this.scorm.LMSGetValue("cmi.objectives.".concat(t,".id"))))return f.decodeJSON(e)}catch(n){y("getObjective =>",n,"cmi.objectives.".concat(t,".id"),e)}return null}},{key:"setObjective",value:function(t,e){var n=f.encodeJSON(e);n.length>255&&y("cmi.objectives.".concat(t,".id"),"Content exceeds 256Bytes!"),this.write("cmi.objectives.".concat(t,".id"),n)}},{key:"load",value:function(t){switch(t.table){case"quiz":case"survey":case"task":return g("loading ",t.table,t.id,this.db[t.table][t.id]),this.db[t.table][t.id]}}},{key:"store",value:function(t){if(this.active)switch(y("store",t),t.table){case"quiz":this.storeHelper(t),this.score();break;case"survey":case"task":this.storeHelper(t)}}},{key:"storeHelper",value:function(t){for(var e=0;e<this.db[t.table][t.id].length;e++)f.neq(t.data[e],this.db[t.table][t.id][e])&&(this.setObjective(this.id[t.table][t.id][e],t.data[e]),this.db[t.table][t.id][e]=t.data[e],"quiz"==t.table&&this.updateQuiz(this.id[t.table][t.id][e],t.data[e]))}},{key:"updateQuiz",value:function(t,e){if(this.active)switch(e.solved){case 0:e.trial>0&&this.write("cmi.objectives.".concat(t,".status"),"failed");break;case 1:this.write("cmi.objectives.".concat(t,".status"),"completed");break;case-1:this.write("cmi.objectives.".concat(t,".status"),"incomplete")}}}]),n}(l.Connector);function g(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var i;(i=console).log.apply(i,["SCORM1.2: "].concat((0,c.default)(e)))}function y(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var i;(i=console).log.apply(i,["SCORM1.2: "].concat((0,c.default)(e)))}})),e.register("knzCS",(function(n,i){t(n.exports,"Connector",(function(){return l}));var r=e("hnmIs"),o=e("9Klpk"),s=e("3bWnf"),a=e("32Euv"),c=e("87lFe"),u=e("cRTHJ"),l=function(){"use strict";function t(){(0,o.default)(this,t)}return(0,s.default)(t,[{key:"hasIndex",value:function(){return!1}},{key:"storage",value:function(){return new c.LiaStorage}},{key:"initSettings",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return u.Settings.init(t,e,this.setSettings)}},{key:"setSettings",value:function(t){u.Settings.update(t)}},{key:"getSettings",value:function(){var t="";try{t=localStorage.getItem(u.Settings.PORT)}catch(t){console.warn("cannot write to localStorage")}var e=null;if("string"==typeof t){try{e=JSON.parse(t)}catch(t){console.warn("getSettings =>",t)}e||(e=u.Settings.data),window.innerWidth<=768&&(e.table_of_contents=!1)}return e}},{key:"open",value:function(t,e,n){}},{key:"load",value:function(t){}},{key:"store",value:function(t){}},{key:"update",value:function(t,e){}},{key:"slide",value:function(t){}},{key:"getIndex",value:function(){}},{key:"deleteFromIndex",value:function(t){}},{key:"storeToIndex",value:function(t){return(0,r.default)((function(){return(0,a.__generator)(this,(function(t){return[2]}))}))()}},{key:"restoreFromIndex",value:function(t,e){}},{key:"reset",value:function(t,e){this.initSettings(null,!0)}},{key:"getFromIndex",value:function(t){return(0,r.default)((function(){return(0,a.__generator)(this,(function(t){return[2,null]}))}))()}},{key:"addMisc",value:function(t,e,n,i){return(0,r.default)((function(){return(0,a.__generator)(this,(function(t){return console.log("addMisc not implemented"),[2]}))}))()}},{key:"getMisc",value:function(t,e,n){return(0,r.default)((function(){return(0,a.__generator)(this,(function(t){return console.log("getMisc not implemented"),[2]}))}))()}}]),t}()})),e.register("87lFe",(function(n,i){t(n.exports,"LiaStorage",(function(){return a}));var r=e("9Klpk"),o=e("3bWnf"),s=e("5ENmm"),a=function(){"use strict";function t(){(0,r.default)(this,t)}return(0,o.default)(t,[{key:"getItems",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];"string"==typeof t&&(t=[t]);for(var e={},n=0;n<t.length;n++){var i=localStorage.getItem(t[n]);e[t[n]]=i?JSON.parse(i):i}return e}},{key:"setItems",value:function(t){this._setLocal(t)}},{key:"_setLocal",value:function(t){var e=!0,n=!1,i=void 0;if("object"==typeof t)try{for(var r,o=Object.entries(t)[Symbol.iterator]();!(e=(r=o.next()).done);e=!0){var a=(0,s.default)(r.value,2),c=a[0],u=a[1];localStorage.setItem(c,JSON.stringify(u))}}catch(t){n=!0,i=t}finally{try{e||null==o.return||o.return()}finally{if(n)throw i}}}}]),t}()})),e.register("jxbaN",(function(n,i){t(n.exports,"encodeJSON",(function(){return c})),t(n.exports,"decodeJSON",(function(){return u})),t(n.exports,"jsonParse",(function(){return l})),t(n.exports,"neq",(function(){return d}));var r=e("5ENmm"),o={SingleChoice:"sc",MultipleChoice:"mc",Text:"tx",Select:"st",Matrix:"mx",Generic:"gn",error_msg:"err"},s=Object.entries(o).reduce((function(t,e){var n=(0,r.default)(e,2),i=n[0];return t[n[1]]=i,t}),{});function a(t,e){if("object"!=typeof t||null===t)return t;if(Array.isArray(t))return t.map((function(t){return a(t,e)}));var n={},i=!0,o=!1,s=void 0;try{for(var c,u=Object.entries(t)[Symbol.iterator]();!(i=(c=u.next()).done);i=!0){var l=(0,r.default)(c.value,2),d=l[0],f=l[1];n[e[d]||d]=a(f,e)}}catch(t){o=!0,s=t}finally{try{i||null==u.return||u.return()}finally{if(o)throw s}}return n}function c(t){return JSON.stringify(a(t,o))}function u(t){return a(JSON.parse(t),s)}function l(t){try{return JSON.parse(t)}catch(t){}return null}function d(t,e){return JSON.stringify(t)!=JSON.stringify(e)}})),e.register("jjBAR",(function(e,n){t(e.exports,"getAPI",(function(){return o}));var i=0;function r(t){for(;null==t.API&&null!=t.parent&&t.parent!=t;){if(++i>7)return alert("Error finding API -- too deeply nested."),null;t=t.parent}return t.API}function o(){var t=r(window);return null==t&&null!=window.opener&&void 0!==window.opener&&(t=r(window.opener)),null==t&&alert("Unable to find the SCORM1.2 API adapter"),t}}))}();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function t(t,i,e,s){Object.defineProperty(t,i,{get:e,set:s,enumerable:!0,configurable:!0})}var i=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).parcelRequire55a5;i.register("1jVc2",(function(e,s){t(e.exports,"Connector",(function(){return a}));var n=i("2Xs1f"),r=i("jXXgq"),o=i("ayIBF"),c=i("5aa3i");class a extends r.Connector{scanForAPI(t){let i=0;try{for(;null==t.API_1484_11&&null!=t.parent&&t.parent!=t;){if(i++,i>500)return null;t=t.parent}return t.API_1484_11}catch(t){h("scanForAPI =>",null==t?void 0:t.message)}return null}getAPI(t){let i=null;return null!=t.parent&&t.parent!=t&&(i=this.scanForAPI(t.parent)),null==i&&null!=t.opener&&(i=this.scanForAPI(t.opener)),i}initSettings(t,i=!1){return o.Settings.init(t,!1,this.setSettings)}getSettings(){let t="";try{var i;t=(null===(i=this.scorm)||void 0===i?void 0:i.GetValue("cmi.suspend_data"))||null}catch(t){h("cannot read settings from cmi.suspend_data")}let e=null;if("string"==typeof t&&""!==t)try{e=JSON.parse(t)}catch(t){h("getSettings =>",t)}return e||(e=o.Settings.data),window.innerWidth<=768&&(e.table_of_contents=!1),e}isoDuration(t){const i=t/1e3;return`PT${Math.floor(i/3600)}H${Math.floor(i%3600/60)}M${(i%60).toFixed(2)}S`}commit(){if(this.scorm&&this.inited&&"false"===this.scorm.Commit("")){const t=this.scorm.GetLastError();h("Commit error",t,this.scorm.GetErrorString(t),this.scorm.GetDiagnostic(t))}}write(t,i){if(this.scorm&&this.active){if(l("write: ",t,i),"false"===this.scorm.SetValue(t,i)){h("error occurred for",t,i);const e=this.scorm.GetLastError();h("GetLastError:",e),e?(h("GetErrorString:",this.scorm.GetErrorString(e)),h("GetDiagnostic:",this.scorm.GetDiagnostic(e))):h("GetDiagnostic:",this.scorm.GetDiagnostic(""))}this.commit()}}init(){if(!this.scorm)return;const t=this.scorm.Initialize("");if(this.inited="true"===t,l("Initialize",t),!this.inited)return void h("Initialize failed");this.startMs=Date.now();const i=this.scorm.GetValue("cmi.mode")||"",e=this.scorm.GetValue("cmi.credit")||"";this.active="normal"===i&&"credit"===e,h(`Running in "${i}" mode, credit=${e}. Results will ${this.active?"":"NOT "}be stored!`),this.active&&(this.scaled_passing_score=c.jsonParse(this.scorm.GetValue("cmi.scaled_passing_score")),this.scaled_passing_score||(this.scaled_passing_score=window.MASTERY_SCORE||null),this.scorm.GetValue("cmi.completion_status")||this.write("cmi.completion_status","incomplete"),l("cmi.entry =",this.scorm.GetValue("cmi.entry")),this.location=c.jsonParse(this.scorm.GetValue("cmi.location")),l("open location ...",this.location)),null!==this.location&&void 0!==this.location||this.slide(0);const s=this.countInteractions();if(this.active&&0===s){let t=0;t=this.initFirst("quiz",t),t=this.initFirst("survey",t),t=this.initFirst("task",t)}else{let t=0;t=this.initSecond("quiz",t),t=this.initSecond("survey",t),t=this.initSecond("task",t)}window.SCORE=0,this.score(),this.commitTimer=window.setInterval((()=>this.commit()),45e3),window.addEventListener("pagehide",(()=>this.finish(!0))),document.addEventListener("visibilitychange",(()=>{"hidden"===document.visibilityState&&this.commit()}))}finish(t){if(!this.scorm||!this.inited)return;const i=this.isoDuration(Date.now()-this.startMs);this.scorm.SetValue("cmi.session_time",i),this.scorm.SetValue("cmi.exit",t?"suspend":""),this.commit();const e=this.scorm.Terminate("");this.inited=!1,this.commitTimer&&(clearInterval(this.commitTimer),this.commitTimer=null),h("Terminate:",e)}initFirst(t,i){for(let e=0;e<this.db[t].length;e++){this.id[t].push([]);for(let s=0;s<this.db[t][e].length;s++)this.setInteraction(i,`${t}:${e}-${s}`),this.id[t][e].push(i),i++}return i}countInteractions(){if(!this.scorm)return 0;const t=this.scorm.GetValue("cmi.interactions._count"),i=parseInt(t||"0",10);return Number.isFinite(i)?i:0}initSecond(t,i){for(let e=0;e<this.db[t].length;e++){this.id[t].push([]);for(let s=0;s<this.db[t][e].length;s++){const n=this.getInteraction(i);n&&(this.db[t][e][s]=n),this.id[t][e].push(i),i++}}return i}open(t,i,e){if(null!==this.location&&void 0!==this.location){const t=this.location;setTimeout((function(){window.LIA.goto(t)}),500)}}load(t){switch(t.table){case"quiz":case"survey":case"task":return l("loading ",t.table,t.id,this.db[t.table][t.id]),this.db[t.table][t.id]}}store(t){switch(t.table){case"quiz":this.storeHelper(t),this.score();break;case"survey":case"task":this.storeHelper(t)}}storeHelper(t){for(let i=0;i<this.db[t.table][t.id].length;i++)c.neq(t.data[i],this.db[t.table][t.id][i])&&(this.updateInteraction(this.id[t.table][t.id][i],t.data[i]),this.db[t.table][t.id][i]=t.data[i],"quiz"===t.table&&this.updateQuiz(this.id[t.table][t.id][i],t.data[i]))}score(){let t=0,i=0,e=0;for(let s=0;s<this.db.quiz.length;s++)for(let n=0;n<this.db.quiz[s].length;n++)switch(e=this.db.quiz[s][n].score,this.db.quiz[s][n].solved){case 1:t+=e;break;case-1:i+=e}const s=0===this.totalCount?0:t/this.totalCount,n=0===this.totalCount?0:(t+i)/this.totalCount;window.SCORE=s,l("SCORE updated =>",s,"progress =>",n),this.scorm&&this.active&&(this.write("cmi.score.min","0"),this.write("cmi.score.max",JSON.stringify(this.totalCount)),this.write("cmi.score.scaled",JSON.stringify(s)),this.write("cmi.score.raw",JSON.stringify(t)),this.write("cmi.progress_measure",JSON.stringify(n)),null!=this.scaled_passing_score?s>=this.scaled_passing_score?(this.write("cmi.success_status","passed"),this.write("cmi.completion_status","completed")):i+t===this.totalCount&&this.totalCount>0?(this.write("cmi.success_status","failed"),this.write("cmi.completion_status","completed")):(this.write("cmi.success_status","unknown"),this.write("cmi.completion_status","incomplete")):(this.write("cmi.success_status","unknown"),i+t===this.totalCount&&this.totalCount>0?this.write("cmi.completion_status","completed"):this.write("cmi.completion_status","incomplete")))}slide(t){this.location=t,this.write("cmi.location",JSON.stringify(t))}setInteraction(t,i){this.write(`cmi.interactions.${t}.id`,i),this.write(`cmi.interactions.${t}.type`,"long-fill-in")}updateQuiz(t,i){if(this.active)switch(i.solved){case 0:i.trial>0&&this.write(`cmi.interactions.${t}.result`,"incorrect");break;case 1:this.write(`cmi.interactions.${t}.result`,"correct");break;case-1:this.write(`cmi.interactions.${t}.result`,"neutral")}}updateInteraction(t,i){var e;if(this.write(`cmi.interactions.${t}.learner_response`,c.encodeJSON(i)),i.score&&this.write(`cmi.interactions.${t}.weighting`,JSON.stringify(i.score)),!(null===(e=this.scorm)||void 0===e?void 0:e.GetValue(`cmi.interactions.${t}.timestamp`))){var s=new Date,n=new Date(s.getTime()-6e4*s.getTimezoneOffset()).toISOString().slice(0,-5);this.write(`cmi.interactions.${t}.timestamp`,n)}const r=this.isoDuration(Date.now()-this.startMs);this.write(`cmi.interactions.${t}.latency`,r)}getInteraction(t){try{if(this.scorm){const i=this.scorm.GetValue(`cmi.interactions.${t}.learner_response`);if(""!==i)return c.decodeJSON(i)}}catch(t){h("getInteraction => ",t)}return null}constructor(){super(),(0,n.default)(this,"inited",!1),(0,n.default)(this,"startMs",0),(0,n.default)(this,"commitTimer",null),(0,n.default)(this,"totalCount",0),(0,n.default)(this,"setSettings",(t=>{this.active&&this.scorm?this.write("cmi.suspend_data",JSON.stringify(t)):h('cannot write to "cmi.suspend_data"')})),this.active=!1,this.scaled_passing_score=null,this.db={quiz:[],survey:[],task:[]},this.id={quiz:[],survey:[],task:[]};const t=this.getAPI(window);if(t){l("successfully opened API"),this.scorm=t,l("loading quizzes ...");try{this.db.quiz=window.config_.quiz||[[]],l(" ... done");for(let t=0;t<this.db.quiz.length;t++)for(let i=0;i<this.db.quiz[t].length;i++)this.totalCount+=this.db.quiz[t][i].score}catch(t){h("... failed",t)}l("loading surveys ...");try{this.db.survey=window.config_.survey||[[]],l(" ... done")}catch(t){h("... failed",t)}l("loading tasks ...");try{this.db.task=window.config_.task||[[]],l(" ... done")}catch(t){h("... failed",t)}this.init()}else h("Could not find API")}}function l(...t){console.log("SCORM2004: ",...t)}function h(...t){console.log("SCORM2004: ",...t)}})),i.register("jXXgq",(function(e,s){t(e.exports,"Connector",(function(){return o}));var n=i("3MPaZ"),r=i("ayIBF");class o{hasIndex(){return!1}storage(){return new n.LiaStorage}initSettings(t,i=!1){return r.Settings.init(t,i,this.setSettings)}setSettings(t){r.Settings.update(t)}getSettings(){let t="";try{t=localStorage.getItem(r.Settings.PORT)}catch(t){console.warn("cannot write to localStorage")}let i=null;if("string"==typeof t){try{i=JSON.parse(t)}catch(t){console.warn("getSettings =>",t)}i||(i=r.Settings.data),window.innerWidth<=768&&(i.table_of_contents=!1)}return i}open(t,i,e){}load(t){}store(t){}update(t,i){}slide(t){}getIndex(){}deleteFromIndex(t){}async storeToIndex(t){}restoreFromIndex(t,i){}reset(t,i){this.initSettings(null,!0)}async getFromIndex(t){return null}async addMisc(t,i,e,s){console.log("addMisc not implemented")}async getMisc(t,i,e){console.log("getMisc not implemented")}constructor(){}}})),i.register("3MPaZ",(function(i,e){t(i.exports,"LiaStorage",(function(){return s}));class s{getItems(t=[]){"string"==typeof t&&(t=[t]);let i={};for(let e=0;e<t.length;e++){let s=localStorage.getItem(t[e]);i[t[e]]=s?JSON.parse(s):s}return i}setItems(t){this._setLocal(t)}_setLocal(t){if("object"==typeof t)for(const[i,e]of Object.entries(t))localStorage.setItem(i,JSON.stringify(e))}constructor(){}}})),i.register("5aa3i",(function(i,e){t(i.exports,"encodeJSON",(function(){return o})),t(i.exports,"decodeJSON",(function(){return c})),t(i.exports,"jsonParse",(function(){return a})),t(i.exports,"neq",(function(){return l}));const s={SingleChoice:"sc",MultipleChoice:"mc",Text:"tx",Select:"st",Matrix:"mx",Generic:"gn",error_msg:"err"},n=Object.entries(s).reduce(((t,[i,e])=>(t[e]=i,t)),{});function r(t,i){if("object"!=typeof t||null===t)return t;if(Array.isArray(t))return t.map((t=>r(t,i)));const e={};for(const[s,n]of Object.entries(t))e[i[s]||s]=r(n,i);return e}function o(t){return JSON.stringify(r(t,s))}function c(t){return r(JSON.parse(t),n)}function a(t){try{return JSON.parse(t)}catch(t){}return null}function l(t,i){return JSON.stringify(t)!=JSON.stringify(i)}}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(){function t(t,e,i,n){Object.defineProperty(t,e,{get:i,set:n,enumerable:!0,configurable:!0})}var e=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).parcelRequire55a5;e.register("8MvA8",(function(i,n){t(i.exports,"Connector",(function(){return m}));var r=e("f1evb"),s=e("9Klpk"),o=e("3bWnf"),a=e("eT7f3"),c=e("kb0qF"),u=e("6Wo7Q"),l=e("bWNdT"),f=e("knzCS"),d=e("cRTHJ"),h=e("jxbaN"),m=function(t){"use strict";(0,c.default)(i,t);var e=(0,l.default)(i);function i(){var t;(0,s.default)(this,i),t=e.call(this),(0,a.default)((0,r.default)(t),"inited",!1),(0,a.default)((0,r.default)(t),"startMs",0),(0,a.default)((0,r.default)(t),"commitTimer",null),(0,a.default)((0,r.default)(t),"totalCount",0),(0,a.default)((0,r.default)(t),"setSettings",(function(e){t.active&&t.scorm?t.write("cmi.suspend_data",JSON.stringify(e)):g('cannot write to "cmi.suspend_data"')})),t.active=!1,t.scaled_passing_score=null,t.db={quiz:[],survey:[],task:[]},t.id={quiz:[],survey:[],task:[]};var n=t.getAPI(window);if(n){v("successfully opened API"),t.scorm=n,v("loading quizzes ...");try{t.db.quiz=window.config_.quiz||[[]],v(" ... done");for(var o=0;o<t.db.quiz.length;o++)for(var c=0;c<t.db.quiz[o].length;c++)t.totalCount+=t.db.quiz[o][c].score}catch(t){g("... failed",t)}v("loading surveys ...");try{t.db.survey=window.config_.survey||[[]],v(" ... done")}catch(t){g("... failed",t)}v("loading tasks ...");try{t.db.task=window.config_.task||[[]],v(" ... done")}catch(t){g("... failed",t)}t.init()}else g("Could not find API");return t}return(0,o.default)(i,[{key:"scanForAPI",value:function(t){var e=0;try{for(;null==t.API_1484_11&&null!=t.parent&&t.parent!=t;){if(++e>500)return null;t=t.parent}return t.API_1484_11}catch(t){g("scanForAPI =>",null==t?void 0:t.message)}return null}},{key:"getAPI",value:function(t){var e=null;return null!=t.parent&&t.parent!=t&&(e=this.scanForAPI(t.parent)),null==e&&null!=t.opener&&(e=this.scanForAPI(t.opener)),e}},{key:"initSettings",value:function(t){return d.Settings.init(t,!1,this.setSettings)}},{key:"getSettings",value:function(){var t="";try{var e;t=(null===(e=this.scorm)||void 0===e?void 0:e.GetValue("cmi.suspend_data"))||null}catch(t){g("cannot read settings from cmi.suspend_data")}var i=null;if("string"==typeof t&&""!==t)try{i=JSON.parse(t)}catch(t){g("getSettings =>",t)}return i||(i=d.Settings.data),window.innerWidth<=768&&(i.table_of_contents=!1),i}},{key:"isoDuration",value:function(t){var e=t/1e3,i=Math.floor(e/3600),n=Math.floor(e%3600/60),r=(e%60).toFixed(2);return"PT".concat(i,"H").concat(n,"M").concat(r,"S")}},{key:"commit",value:function(){if(this.scorm&&this.inited&&"false"===this.scorm.Commit("")){var t=this.scorm.GetLastError();g("Commit error",t,this.scorm.GetErrorString(t),this.scorm.GetDiagnostic(t))}}},{key:"write",value:function(t,e){if(this.scorm&&this.active){if(v("write: ",t,e),"false"===this.scorm.SetValue(t,e)){g("error occurred for",t,e);var i=this.scorm.GetLastError();g("GetLastError:",i),i?(g("GetErrorString:",this.scorm.GetErrorString(i)),g("GetDiagnostic:",this.scorm.GetDiagnostic(i))):g("GetDiagnostic:",this.scorm.GetDiagnostic(""))}this.commit()}}},{key:"init",value:function(){var t=this;if(this.scorm){var e=this.scorm.Initialize("");if(this.inited="true"===e,v("Initialize",e),this.inited){this.startMs=Date.now();var i=this.scorm.GetValue("cmi.mode")||"",n=this.scorm.GetValue("cmi.credit")||"";if(this.active="normal"===i&&"credit"===n,g('Running in "'.concat(i,'" mode, credit=').concat(n,". Results will ").concat(this.active?"":"NOT ","be stored!")),this.active)this.scaled_passing_score=h.jsonParse(this.scorm.GetValue("cmi.scaled_passing_score")),this.scaled_passing_score||(this.scaled_passing_score=window.MASTERY_SCORE||null),this.scorm.GetValue("cmi.completion_status")||this.write("cmi.completion_status","incomplete"),v("cmi.entry =",this.scorm.GetValue("cmi.entry")),this.location=h.jsonParse(this.scorm.GetValue("cmi.location")),v("open location ...",this.location);null!==this.location&&void 0!==this.location||this.slide(0);var r=this.countInteractions();if(this.active&&0===r){var s=0;s=this.initFirst("quiz",s),s=this.initFirst("survey",s),s=this.initFirst("task",s)}else{var o=0;o=this.initSecond("quiz",o),o=this.initSecond("survey",o),o=this.initSecond("task",o)}window.SCORE=0,this.score(),this.commitTimer=window.setInterval((function(){return t.commit()}),45e3),window.addEventListener("pagehide",(function(){return t.finish(!0)})),document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&t.commit()}))}else g("Initialize failed")}}},{key:"finish",value:function(t){if(this.scorm&&this.inited){var e=this.isoDuration(Date.now()-this.startMs);this.scorm.SetValue("cmi.session_time",e),this.scorm.SetValue("cmi.exit",t?"suspend":""),this.commit();var i=this.scorm.Terminate("");this.inited=!1,this.commitTimer&&(clearInterval(this.commitTimer),this.commitTimer=null),g("Terminate:",i)}}},{key:"initFirst",value:function(t,e){for(var i=0;i<this.db[t].length;i++){this.id[t].push([]);for(var n=0;n<this.db[t][i].length;n++)this.setInteraction(e,"".concat(t,":").concat(i,"-").concat(n)),this.id[t][i].push(e),e++}return e}},{key:"countInteractions",value:function(){if(!this.scorm)return 0;var t=this.scorm.GetValue("cmi.interactions._count"),e=parseInt(t||"0",10);return Number.isFinite(e)?e:0}},{key:"initSecond",value:function(t,e){for(var i=0;i<this.db[t].length;i++){this.id[t].push([]);for(var n=0;n<this.db[t][i].length;n++){var r=this.getInteraction(e);r&&(this.db[t][i][n]=r),this.id[t][i].push(e),e++}}return e}},{key:"open",value:function(t,e,i){if(null!==this.location&&void 0!==this.location){var n=this.location;setTimeout((function(){window.LIA.goto(n)}),500)}}},{key:"load",value:function(t){switch(t.table){case"quiz":case"survey":case"task":return v("loading ",t.table,t.id,this.db[t.table][t.id]),this.db[t.table][t.id]}}},{key:"store",value:function(t){switch(t.table){case"quiz":this.storeHelper(t),this.score();break;case"survey":case"task":this.storeHelper(t)}}},{key:"storeHelper",value:function(t){for(var e=0;e<this.db[t.table][t.id].length;e++)h.neq(t.data[e],this.db[t.table][t.id][e])&&(this.updateInteraction(this.id[t.table][t.id][e],t.data[e]),this.db[t.table][t.id][e]=t.data[e],"quiz"===t.table&&this.updateQuiz(this.id[t.table][t.id][e],t.data[e]))}},{key:"score",value:function(){for(var t=0,e=0,i=0,n=0;n<this.db.quiz.length;n++)for(var r=0;r<this.db.quiz[n].length;r++)switch(i=this.db.quiz[n][r].score,this.db.quiz[n][r].solved){case 1:t+=i;break;case-1:e+=i}var s=0===this.totalCount?0:t/this.totalCount,o=0===this.totalCount?0:(t+e)/this.totalCount;window.SCORE=s,v("SCORE updated =>",s,"progress =>",o),this.scorm&&this.active&&(this.write("cmi.score.min","0"),this.write("cmi.score.max",JSON.stringify(this.totalCount)),this.write("cmi.score.scaled",JSON.stringify(s)),this.write("cmi.score.raw",JSON.stringify(t)),this.write("cmi.progress_measure",JSON.stringify(o)),null!=this.scaled_passing_score?s>=this.scaled_passing_score?(this.write("cmi.success_status","passed"),this.write("cmi.completion_status","completed")):e+t===this.totalCount&&this.totalCount>0?(this.write("cmi.success_status","failed"),this.write("cmi.completion_status","completed")):(this.write("cmi.success_status","unknown"),this.write("cmi.completion_status","incomplete")):(this.write("cmi.success_status","unknown"),e+t===this.totalCount&&this.totalCount>0?this.write("cmi.completion_status","completed"):this.write("cmi.completion_status","incomplete")))}},{key:"slide",value:function(t){this.location=t,this.write("cmi.location",JSON.stringify(t))}},{key:"setInteraction",value:function(t,e){this.write("cmi.interactions.".concat(t,".id"),e),this.write("cmi.interactions.".concat(t,".type"),"long-fill-in")}},{key:"updateQuiz",value:function(t,e){if(this.active)switch(e.solved){case 0:e.trial>0&&this.write("cmi.interactions.".concat(t,".result"),"incorrect");break;case 1:this.write("cmi.interactions.".concat(t,".result"),"correct");break;case-1:this.write("cmi.interactions.".concat(t,".result"),"neutral")}}},{key:"updateInteraction",value:function(t,e){var i;if(this.write("cmi.interactions.".concat(t,".learner_response"),h.encodeJSON(e)),e.score&&this.write("cmi.interactions.".concat(t,".weighting"),JSON.stringify(e.score)),!(null===(i=this.scorm)||void 0===i?void 0:i.GetValue("cmi.interactions.".concat(t,".timestamp")))){var n=new Date,r=new Date(n.getTime()-6e4*n.getTimezoneOffset()).toISOString().slice(0,-5);this.write("cmi.interactions.".concat(t,".timestamp"),r)}var s=this.isoDuration(Date.now()-this.startMs);this.write("cmi.interactions.".concat(t,".latency"),s)}},{key:"getInteraction",value:function(t){try{if(this.scorm){var e=this.scorm.GetValue("cmi.interactions.".concat(t,".learner_response"));if(""!==e)return h.decodeJSON(e)}}catch(t){g("getInteraction => ",t)}return null}}]),i}(f.Connector);function v(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];var n;(n=console).log.apply(n,["SCORM2004: "].concat((0,u.default)(e)))}function g(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];var n;(n=console).log.apply(n,["SCORM2004: "].concat((0,u.default)(e)))}})),e.register("knzCS",(function(i,n){t(i.exports,"Connector",(function(){return l}));var r=e("hnmIs"),s=e("9Klpk"),o=e("3bWnf"),a=e("32Euv"),c=e("87lFe"),u=e("cRTHJ"),l=function(){"use strict";function t(){(0,s.default)(this,t)}return(0,o.default)(t,[{key:"hasIndex",value:function(){return!1}},{key:"storage",value:function(){return new c.LiaStorage}},{key:"initSettings",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return u.Settings.init(t,e,this.setSettings)}},{key:"setSettings",value:function(t){u.Settings.update(t)}},{key:"getSettings",value:function(){var t="";try{t=localStorage.getItem(u.Settings.PORT)}catch(t){console.warn("cannot write to localStorage")}var e=null;if("string"==typeof t){try{e=JSON.parse(t)}catch(t){console.warn("getSettings =>",t)}e||(e=u.Settings.data),window.innerWidth<=768&&(e.table_of_contents=!1)}return e}},{key:"open",value:function(t,e,i){}},{key:"load",value:function(t){}},{key:"store",value:function(t){}},{key:"update",value:function(t,e){}},{key:"slide",value:function(t){}},{key:"getIndex",value:function(){}},{key:"deleteFromIndex",value:function(t){}},{key:"storeToIndex",value:function(t){return(0,r.default)((function(){return(0,a.__generator)(this,(function(t){return[2]}))}))()}},{key:"restoreFromIndex",value:function(t,e){}},{key:"reset",value:function(t,e){this.initSettings(null,!0)}},{key:"getFromIndex",value:function(t){return(0,r.default)((function(){return(0,a.__generator)(this,(function(t){return[2,null]}))}))()}},{key:"addMisc",value:function(t,e,i,n){return(0,r.default)((function(){return(0,a.__generator)(this,(function(t){return console.log("addMisc not implemented"),[2]}))}))()}},{key:"getMisc",value:function(t,e,i){return(0,r.default)((function(){return(0,a.__generator)(this,(function(t){return console.log("getMisc not implemented"),[2]}))}))()}}]),t}()})),e.register("87lFe",(function(i,n){t(i.exports,"LiaStorage",(function(){return a}));var r=e("9Klpk"),s=e("3bWnf"),o=e("5ENmm"),a=function(){"use strict";function t(){(0,r.default)(this,t)}return(0,s.default)(t,[{key:"getItems",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];"string"==typeof t&&(t=[t]);for(var e={},i=0;i<t.length;i++){var n=localStorage.getItem(t[i]);e[t[i]]=n?JSON.parse(n):n}return e}},{key:"setItems",value:function(t){this._setLocal(t)}},{key:"_setLocal",value:function(t){var e=!0,i=!1,n=void 0;if("object"==typeof t)try{for(var r,s=Object.entries(t)[Symbol.iterator]();!(e=(r=s.next()).done);e=!0){var a=(0,o.default)(r.value,2),c=a[0],u=a[1];localStorage.setItem(c,JSON.stringify(u))}}catch(t){i=!0,n=t}finally{try{e||null==s.return||s.return()}finally{if(i)throw n}}}}]),t}()})),e.register("jxbaN",(function(i,n){t(i.exports,"encodeJSON",(function(){return c})),t(i.exports,"decodeJSON",(function(){return u})),t(i.exports,"jsonParse",(function(){return l})),t(i.exports,"neq",(function(){return f}));var r=e("5ENmm"),s={SingleChoice:"sc",MultipleChoice:"mc",Text:"tx",Select:"st",Matrix:"mx",Generic:"gn",error_msg:"err"},o=Object.entries(s).reduce((function(t,e){var i=(0,r.default)(e,2),n=i[0];return t[i[1]]=n,t}),{});function a(t,e){if("object"!=typeof t||null===t)return t;if(Array.isArray(t))return t.map((function(t){return a(t,e)}));var i={},n=!0,s=!1,o=void 0;try{for(var c,u=Object.entries(t)[Symbol.iterator]();!(n=(c=u.next()).done);n=!0){var l=(0,r.default)(c.value,2),f=l[0],d=l[1];i[e[f]||f]=a(d,e)}}catch(t){s=!0,o=t}finally{try{n||null==u.return||u.return()}finally{if(s)throw o}}return i}function c(t){return JSON.stringify(a(t,s))}function u(t){return a(JSON.parse(t),o)}function l(t){try{return JSON.parse(t)}catch(t){}return null}function f(t,e){return JSON.stringify(t)!=JSON.stringify(e)}}))}();
|
|
File without changes
|
|
File without changes
|