@liascript/exporter 2.5.7--0.10.30 → 2.6.0--0.10.30

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.
Files changed (32) hide show
  1. package/README.md +165 -3
  2. package/dist/assets/scorm1.2/SCORM1.2.0da8e8ee.js +1 -0
  3. package/dist/assets/scorm1.2/SCORM1.2.e32438b5.js +1 -0
  4. package/dist/assets/scorm1.2/index.3f87aa11.js +1 -0
  5. package/dist/assets/scorm1.2/index.4a92e335.js +1 -0
  6. package/dist/assets/scorm1.2/index.607bde0c.js +1 -0
  7. package/dist/assets/scorm1.2/index.c71d23fb.js +1 -0
  8. package/dist/assets/scorm1.2/index.html +1 -1
  9. package/dist/assets/scorm2004/SCORM2004.0f5b6db9.js +1 -0
  10. package/dist/assets/scorm2004/SCORM2004.d623c532.js +1 -0
  11. package/dist/assets/scorm2004/index.250ec73b.js +1 -0
  12. package/dist/assets/scorm2004/index.2ed9b743.js +1 -0
  13. package/dist/assets/scorm2004/index.3f87aa11.js +1 -0
  14. package/dist/assets/scorm2004/index.c71d23fb.js +1 -0
  15. package/dist/assets/scorm2004/index.html +1 -1
  16. package/dist/index.js +1 -1
  17. package/package.json +3 -1
  18. package/src/export/helper.ts +24 -1
  19. package/src/export/rdf.ts +227 -0
  20. package/src/index.ts +27 -3
  21. package/dist/assets/scorm1.2/SCORM1.2.24fa74ce.js +0 -1
  22. package/dist/assets/scorm1.2/SCORM1.2.a747c359.js +0 -1
  23. package/dist/assets/scorm1.2/index.2cc4646a.js +0 -1
  24. package/dist/assets/scorm1.2/index.37afd3c6.js +0 -1
  25. package/dist/assets/scorm1.2/index.4890a134.js +0 -1
  26. package/dist/assets/scorm1.2/index.f7bddd51.js +0 -1
  27. package/dist/assets/scorm2004/SCORM2004.1d75baac.js +0 -1
  28. package/dist/assets/scorm2004/SCORM2004.ed1a5e57.js +0 -1
  29. package/dist/assets/scorm2004/index.4890a134.js +0 -1
  30. package/dist/assets/scorm2004/index.7f715788.js +0 -1
  31. package/dist/assets/scorm2004/index.9afd38f6.js +0 -1
  32. package/dist/assets/scorm2004/index.f7bddd51.js +0 -1
@@ -0,0 +1 @@
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("ajKoV",(function(i,s){t(i.exports,"Connector",(()=>l));var n=e("e32Bb"),r=e("XOp0e");const o={SingleChoice:"sc",MultipleChoice:"mc",Text:"tx",Select:"st",Matrix:"mx",Generic:"gn",error_msg:"err"},c=Object.entries(o).reduce(((t,[e,i])=>(t[i]=e,t)),{});function a(t,e){if("object"!=typeof t||null===t)return t;if(Array.isArray(t))return t.map((t=>a(t,e)));const i={};for(const[s,n]of Object.entries(t)){i[e[s]||s]=a(n,e)}return i}class l extends n.Connector{initSettings(t,e=!1){return r.Settings.init(t,!1,this.setSettings)}setSettings(t){this.active&&this.scorm?this.write("cmi.suspend_data",JSON.stringify(t)):console.warn('cannot write to "cmi.suspend_data"')}getSettings(){let t="";try{var e;t=(null===(e=this.scorm)||void 0===e?void 0:e.GetValue("cmi.suspend_data"))||null}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}init(){if(this.scorm){h("Initialize ",this.scorm.Initialize(""));let t=this.scorm.GetValue("cmi.mode");if(this.active="normal"===t,console.warn("SCORM2004: Running in",t,"mode, results will ",this.active?"":"NOT","be stored!"),this.scaled_passing_score=JSON.parse(this.scorm.GetValue("cmi.scaled_passing_score")),h("open location ..."),this.location=function(t){try{return JSON.parse(t)}catch(t){}return null}(this.scorm.GetValue("cmi.location")),h("... ",this.location),null===this.location){this.slide(0);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()}}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.setInteraction(e,`${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.getInteraction(e);n&&(this.db[t][i][s]=n),this.id[t][i].push(e),e++}}return e}open(t,e,i){null!==this.location&&window.LIA.goto(this.location)}load(t){if(this.active)switch(t.table){case"quiz":case"survey":case"task":return h("loading ",t.table,t.id,this.db.task[t.id]),this.db[t.table][t.id]}}store(t){if(this.active)switch(t.table){case"quiz":this.storeHelper(t),this.score();break;case"survey":case"task":this.storeHelper(t)}}storeHelper(t){for(let s=0;s<this.db[t.table][t.id].length;s++)e=t.data[s],i=this.db[t.table][t.id][s],JSON.stringify(e)!=JSON.stringify(i)&&(this.updateInteraction(this.id[t.table][t.id][s],t.data[s]),this.db[t.table][t.id][s]=t.data[s],"quiz"==t.table&&this.updateQuiz(this.id[t.table][t.id][s],t.data[s]));var e,i}score(){if(!this.active||!this.scaled_passing_score)return;let t=0,e=0,i=0,s=0;for(let n=0;n<this.db.quiz.length;n++)for(let r=0;r<this.db.quiz[n].length;r++)switch(s=this.db.quiz[n][r].score,t+=s,this.db.quiz[n][r].solved){case 1:e+=s;case-1:i+=s}const n=0===e?0:e/t;this.write("cmi.score.min","0"),this.write("cmi.score.max",JSON.stringify(t)),this.write("cmi.score.scaled",JSON.stringify(n)),this.write("cmi.score.raw",JSON.stringify(e)),n>=this.scaled_passing_score?(this.write("cmi.success_status","passed"),this.write("cmi.completion_status","completed")):i+e===t&&(this.write("cmi.success_status","failed"),this.write("cmi.completion_status","completed")),window.SCORE=n}write(t,e){if(this.scorm){if(h("write: ",t,e),"false"===this.scorm.SetValue(t,e)){console.warn("error occurred for",t,e);let i=this.scorm.GetLastError();console.warn("GetLastError:",i),i?(console.warn("GetErrorString:",this.scorm.GetErrorString(i)),console.warn("GetDiagnostic:",this.scorm.GetDiagnostic(i))):console.warn("GetDiagnostic:",this.scorm.GetDiagnostic(""))}this.scorm.Commit("")}}slide(t){this.location=t,this.write("cmi.location",JSON.stringify(t))}setInteraction(t,e){this.write(`cmi.interactions.${t}.id`,e),this.write(`cmi.interactions.${t}.type`,"long-fill-in")}updateQuiz(t,e){if(this.active)switch(e.solved){case 0:e.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,e){var i;this.write(`cmi.interactions.${t}.learner_response`,(i=e,JSON.stringify(a(i,o))))}getInteraction(t){if(!this.active)return null;try{if(this.scorm)return e=this.scorm.GetValue(`cmi.interactions.${t}.learner_response`),a(JSON.parse(e),c)}catch(t){console.warn("SCORM2004: getInteraction => ",t)}var e;return null}constructor(){var t;if(super(),this.active=!1,this.scaled_passing_score=null,this.db={quiz:[],survey:[],task:[]},this.id={quiz:[],survey:[],task:[]},window.API_1484_11||(null===(t=window.top)||void 0===t?void 0:t.API_1484_11)){var e;h("successfully opened API"),this.scorm=window.API_1484_11||(null===(e=window.top)||void 0===e?void 0:e.API_1484_11),h("loading quizzes ...");try{this.db.quiz=window.config_.quiz||[[]],h(" ... done")}catch(t){d("... failed",t)}h("loading surveys ...");try{this.db.survey=window.config_.survey||[[]],h(" ... done")}catch(t){d("... failed",t)}h("loading tasks ...");try{this.db.task=window.config_.task||[[]],h(" ... done")}catch(t){d("... failed",t)}this.init()}else console.warn("SCORM2004: Could not find API")}}function h(...t){console.log("SCORM2004: ",...t)}function d(...t){console.log("SCORM2004: ",...t)}})),e.register("e32Bb",(function(i,s){t(i.exports,"Connector",(()=>o));var n=e("4ssuu"),r=e("XOp0e");class o{hasIndex(){return!1}storage(){return new n.LiaStorage}initSettings(t,e=!1){return r.Settings.init(t,e,this.setSettings)}setSettings(t){try{localStorage.setItem(r.Settings.PORT,JSON.stringify(t))}catch(t){console.warn("cannot write to localStorage")}}getSettings(){let t="";try{t=localStorage.getItem(r.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=r.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){}storeToIndex(t){}restoreFromIndex(t,e){}reset(t,e){this.initSettings(null,!0)}async getFromIndex(t){return null}constructor(){}}})),e.register("4ssuu",(function(e,i){t(e.exports,"LiaStorage",(()=>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(){}}}));