@liascript/exporter 2.6.24--0.12.7 → 2.6.25--0.12.9
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/capacitor/README.md +96 -0
- package/dist/assets/capacitor/icon.ico +0 -0
- package/dist/assets/capacitor/index.1f2d3561.js +1 -0
- package/dist/assets/capacitor/index.256a9a8b.js +2 -0
- package/dist/assets/capacitor/index.4d190144.js +3 -0
- package/dist/assets/capacitor/index.c9633b0d.css +1 -0
- package/dist/assets/capacitor/index.ecc30419.js +1 -0
- package/dist/assets/capacitor/index.html +1 -1
- package/dist/assets/capacitor/logo.8a716d9b.png +0 -0
- package/dist/assets/capacitor/up_/up_/assets/logo_192.png +0 -0
- package/dist/assets/indexeddb/README.md +96 -0
- package/dist/assets/indexeddb/icon.ico +0 -0
- package/dist/assets/indexeddb/index.1ddbfc23.js +1 -0
- package/dist/assets/indexeddb/index.1f2d3561.js +1 -0
- package/dist/assets/indexeddb/index.e7902adc.js +1 -0
- package/dist/assets/indexeddb/index.ecc30419.js +1 -0
- package/dist/assets/indexeddb/index.html +1 -1
- package/dist/assets/indexeddb/logo.8a716d9b.png +0 -0
- package/dist/assets/indexeddb/up_/up_/assets/logo_192.png +0 -0
- package/dist/assets/pdf/README.md +96 -0
- package/dist/assets/pdf/icon.ico +0 -0
- package/dist/assets/pdf/index.71a9d3b9.js +1 -0
- package/dist/assets/pdf/index.8faa4674.js +1 -0
- package/dist/assets/pdf/index.9566d085.css +1 -0
- package/dist/assets/pdf/index.eb967896.js +1 -0
- package/dist/assets/pdf/index.f4d8d322.js +1 -0
- package/dist/assets/pdf/index.html +1 -1
- package/dist/assets/pdf/logo.8a716d9b.png +0 -0
- package/dist/assets/pdf/up_/up_/assets/logo_192.png +0 -0
- package/dist/assets/scorm1.2/README.md +96 -0
- package/dist/assets/scorm1.2/SCORM1.2.2a7e738e.js +1 -0
- package/dist/assets/scorm1.2/SCORM1.2.e5ca1774.js +1 -0
- package/dist/assets/scorm1.2/icon.ico +0 -0
- package/dist/assets/scorm1.2/index.1f2d3561.js +1 -0
- package/dist/assets/scorm1.2/index.72f9d9a7.js +1 -0
- package/dist/assets/scorm1.2/index.a661cf32.js +1 -0
- package/dist/assets/scorm1.2/index.ecc30419.js +1 -0
- package/dist/assets/scorm1.2/index.html +1 -1
- package/dist/assets/scorm1.2/logo.8a716d9b.png +0 -0
- package/dist/assets/scorm1.2/up_/up_/assets/logo_192.png +0 -0
- package/dist/assets/scorm2004/README.md +96 -0
- package/dist/assets/scorm2004/SCORM2004.179dcec4.js +1 -0
- package/dist/assets/scorm2004/SCORM2004.5ef9c9d1.js +1 -0
- package/dist/assets/scorm2004/icon.ico +0 -0
- package/dist/assets/scorm2004/index.1f2d3561.js +1 -0
- package/dist/assets/scorm2004/index.488241cf.js +1 -0
- package/dist/assets/scorm2004/index.48d976af.js +1 -0
- package/dist/assets/scorm2004/index.ecc30419.js +1 -0
- package/dist/assets/scorm2004/index.html +1 -1
- package/dist/assets/scorm2004/logo.8a716d9b.png +0 -0
- package/dist/assets/scorm2004/up_/up_/assets/logo_192.png +0 -0
- package/dist/assets/web/README.md +96 -0
- package/dist/assets/web/icon.ico +0 -0
- package/dist/assets/web/index.1f2d3561.js +1 -0
- package/dist/assets/web/index.987795d4.js +1 -0
- package/dist/assets/web/index.b238d410.js +1 -0
- package/dist/assets/web/index.ecc30419.js +1 -0
- package/dist/assets/web/index.html +1 -1
- package/dist/assets/web/logo.8a716d9b.png +0 -0
- package/dist/assets/web/up_/up_/assets/logo_192.png +0 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/dist/assets/capacitor/index.3acab45f.js +0 -3
- package/dist/assets/capacitor/index.86672fec.js +0 -1
- package/dist/assets/capacitor/index.a18d48a6.js +0 -2
- package/dist/assets/capacitor/index.cc4ff0d6.js +0 -1
- package/dist/assets/capacitor/index.da70a27a.css +0 -1
- package/dist/assets/capacitor/logo.abbc2cae.png +0 -0
- package/dist/assets/indexeddb/index.31ac4ee7.js +0 -1
- package/dist/assets/indexeddb/index.86672fec.js +0 -1
- package/dist/assets/indexeddb/index.a542d943.js +0 -1
- package/dist/assets/indexeddb/index.cc4ff0d6.js +0 -1
- package/dist/assets/indexeddb/logo.abbc2cae.png +0 -0
- package/dist/assets/pdf/index.0551e377.js +0 -1
- package/dist/assets/pdf/index.4f5ae007.js +0 -1
- package/dist/assets/pdf/index.511f6e9f.css +0 -1
- package/dist/assets/pdf/index.952364cb.js +0 -1
- package/dist/assets/pdf/index.c9cc4b94.js +0 -1
- package/dist/assets/pdf/logo.abbc2cae.png +0 -0
- package/dist/assets/scorm1.2/SCORM1.2.0348930f.js +0 -1
- package/dist/assets/scorm1.2/SCORM1.2.6e9e9073.js +0 -1
- package/dist/assets/scorm1.2/index.558d2061.js +0 -1
- package/dist/assets/scorm1.2/index.86672fec.js +0 -1
- package/dist/assets/scorm1.2/index.8f515306.js +0 -1
- package/dist/assets/scorm1.2/index.cc4ff0d6.js +0 -1
- package/dist/assets/scorm1.2/logo.abbc2cae.png +0 -0
- package/dist/assets/scorm2004/SCORM2004.5cd65d22.js +0 -1
- package/dist/assets/scorm2004/SCORM2004.805b67df.js +0 -1
- package/dist/assets/scorm2004/index.317ae766.js +0 -1
- package/dist/assets/scorm2004/index.86672fec.js +0 -1
- package/dist/assets/scorm2004/index.cc4ff0d6.js +0 -1
- package/dist/assets/scorm2004/index.e442974e.js +0 -1
- package/dist/assets/scorm2004/logo.abbc2cae.png +0 -0
- package/dist/assets/web/index.86672fec.js +0 -1
- package/dist/assets/web/index.c76a1bc0.js +0 -1
- package/dist/assets/web/index.cc4ff0d6.js +0 -1
- package/dist/assets/web/index.fc731bbd.js +0 -1
- package/dist/assets/web/logo.abbc2cae.png +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 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 defer type="module" src="index.8faa4674.js"></script><script defer src="index.eb967896.js" nomodule></script><script defer type="module" src="index.b47e83d8.js"></script><script defer src="index.05f38d1e.js" nomodule></script><script defer type="module" src="index.8ef64c13.js"></script><script defer src="index.7c2099c2.js" nomodule></script><script defer type="module" src="index.f4d8d322.js"></script><script defer src="index.71a9d3b9.js" nomodule></script><script defer type="module" src="index.23de9d32.js"></script><script defer src="index.a4ec7be7.js" nomodule></script><script defer type="module" src="index.ad714f5b.js"></script><script defer src="index.ff894342.js" nomodule></script><script defer type="module" src="index.21867102.js"></script><script defer src="index.965a9dd8.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.95b0d75c.js"></script><script defer src="index.8e9af83f.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"><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;-webkit-animation:1.2s linear infinite lds-dual-ring;animation:1.2s linear infinite lds-dual-ring;display:block}@-webkit-keyframes lds-dual-ring{0%{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes lds-dual-ring{0%{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg)}}</style><link rel="stylesheet" href="index.9566d085.css"></head><body> <noscript> This page requires JavaScript to be enabled! </noscript> </body></html>
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
author: André Dietrich
|
|
3
|
+
|
|
4
|
+
email: LiaScript@web.de
|
|
5
|
+
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
|
|
8
|
+
language: en
|
|
9
|
+
|
|
10
|
+
-->
|
|
11
|
+
|
|
12
|
+
# Demo-LiaScript
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
<div style="width:100%;height:0;padding-bottom:56%;position:relative;"><iframe src="https://giphy.com/embed/StoU2izFCH9OhkHcpi" width="100%" height="100%" style="position:absolute" frameBorder="0" class="giphy-embed" allowFullScreen></iframe></div><p><a href="https://giphy.com/gifs/stellifymedia-itv-quiz-wwtbam-StoU2izFCH9OhkHcpi">via GIPHY</a></p>
|
|
16
|
+
|
|
17
|
+
### A Textquiz
|
|
18
|
+
|
|
19
|
+
What did the **fish** say when he hit a **concrete wall**?
|
|
20
|
+
|
|
21
|
+
[[dam]]
|
|
22
|
+
|
|
23
|
+
What did the **fish** say when he hit a **concrete wall**?
|
|
24
|
+
|
|
25
|
+
[[dam]]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Multiple Choice
|
|
29
|
+
|
|
30
|
+
Just add as many points as you wish:
|
|
31
|
+
|
|
32
|
+
[[X]] Only the **X** marks the correct point.
|
|
33
|
+
[[ ]] Empty ones are wrong.
|
|
34
|
+
[[X]] ...
|
|
35
|
+
|
|
36
|
+
### Single Choice
|
|
37
|
+
|
|
38
|
+
Just add as many points as you wish:
|
|
39
|
+
|
|
40
|
+
[( )] ...
|
|
41
|
+
[(X)] <-- Only the **X** is allowed.
|
|
42
|
+
[( )] ...
|
|
43
|
+
|
|
44
|
+
### Gap-Text
|
|
45
|
+
|
|
46
|
+
{{|>}}
|
|
47
|
+
The film that I saw [[(that)|those|these|then]] night wasn’t very good.
|
|
48
|
+
It was all [[ about ]] a man [[ who ]] built a
|
|
49
|
+
time machine so he [[ could ]] travel back in time.
|
|
50
|
+
It took him ages and ages [[ to ]] build the machine.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
``` ascii
|
|
55
|
+
.----------. .----------.
|
|
56
|
+
| ⭐ | | ⭐ ⭐ |
|
|
57
|
+
| ⭐ | | ⭐ ⭐ ⭐ |
|
|
58
|
+
'----------' '----------'
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
[[ 2 ]] + [[ 5 ]] = [[ 7 ]]
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
## Code
|
|
66
|
+
|
|
67
|
+
You can make your code executable and define projects:
|
|
68
|
+
|
|
69
|
+
``` js -EvalScript.js
|
|
70
|
+
let who = data.first_name + " " + data.last_name;
|
|
71
|
+
|
|
72
|
+
if(data.online) {
|
|
73
|
+
who + " is online"; }
|
|
74
|
+
else {
|
|
75
|
+
who + " is NOT online"; }
|
|
76
|
+
```
|
|
77
|
+
``` json +Data.json
|
|
78
|
+
{
|
|
79
|
+
"first_name" : "Sammy",
|
|
80
|
+
"last_name" : "Shark",
|
|
81
|
+
"online" : true
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
<script>
|
|
85
|
+
// insert the JSON dataset into the local variable data
|
|
86
|
+
let data = @input(1);
|
|
87
|
+
|
|
88
|
+
// eval the script that uses this dataset
|
|
89
|
+
eval(`@input(0)`);
|
|
90
|
+
</script>
|
|
91
|
+
|
|
92
|
+
## More
|
|
93
|
+
|
|
94
|
+
Find out what you can even do more with quizzes:
|
|
95
|
+
|
|
96
|
+
https://liascript.github.io/course/?https://raw.githubusercontent.com/liaScript/docs/master/README.md
|
|
@@ -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("1FNwj",(function(i,s){t(i.exports,"Connector",(function(){return c}));var n=e("jXXgq"),o=e("ayIBF"),r=e("5aa3i");class c extends n.Connector{init(){if(this.scorm){let t=this.scorm.LMSGetValue("cmi.core.lesson_mode")||"unknown";this.active="normal"===t||"unknown"===t,l('Running in "'+t+'" mode, results will'+(this.active?" ":" NOT ")+"be stored!"),a("open location ..."),this.location=r.jsonParse(this.scorm.LMSGetValue("cmi.core.lesson_location")),a("... ",this.location||0),null===this.location&&this.slide(0);let e=0;0===this.countObjectives()&&this.active?(a("seeding values ..."),e=this.initFirst("quiz",e),e=this.initFirst("survey",e),e=this.initFirst("task",e),a("... done")):(a("restoring values ..."),e=this.initSecond("quiz",e),e=this.initSecond("survey",e),e=this.initSecond("task",e),a("... 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){l("cannot read settings from cmi.suspend_data")}let i=null;if("string"==typeof t){try{i=JSON.parse(t)}catch(t){l("getSettings =>",t)}i||(i=o.Settings.data),window.innerWidth<=768&&(i.table_of_contents=!1)}return i}write(t,e){this.scorm?(this.scorm.LMSSetValue(t,e),this.scorm.LMSCommit("")):l("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){l("getObjective =>",i,`cmi.objectives.${t}.id`,e)}return null}setObjective(t,e){const i=r.encodeJSON(e);i.length>255&&l(`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 a("loading ",t.table,t.id,this.db[t.table][t.id]),this.db[t.table][t.id]}}store(t){if(this.active)switch(l("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(){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.top&&window.top.API){a("successfully opened API"),this.scorm=window.top.API,a("LMSInitialize",this.scorm.LMSInitialize("")),a("loading quizzes ...");try{this.db.quiz=window.config_.quiz||[[]],a(" ... done")}catch(t){l("... failed",t)}a("loading surveys ...");try{this.db.survey=window.config_.survey||[[]],a(" ... done")}catch(t){l("... failed",t)}a("loading tasks ...");try{this.db.task=window.config_.task||[[]],a(" ... done")}catch(t){l("... failed",t)}this.init()}}}function a(...t){console.log("SCORM1.2: ",...t)}function l(...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){try{localStorage.setItem(o.Settings.PORT,JSON.stringify(t))}catch(t){console.warn("cannot write to localStorage")}}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){}storeToIndex(t){}restoreFromIndex(t,e){}reset(t,e){this.initSettings(null,!0)}async getFromIndex(t){return null}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)}}));
|
|
@@ -0,0 +1 @@
|
|
|
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("58dpJ",(function(i,n){t(i.exports,"Connector",(function(){return h}));var o=e("9Klpk"),r=e("3bWnf"),s=e("kb0qF"),a=e("5ENmm"),c=e("6Wo7Q"),u=e("bWNdT"),l=e("knzCS"),d=e("cRTHJ"),f=e("jxbaN"),h=function(t){"use strict";(0,s.default)(i,t);var e=(0,u.default)(i);function i(){var t;if((0,o.default)(this,i),(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.top&&window.top.API){v("successfully opened API"),t.scorm=window.top.API,v("LMSInitialize",t.scorm.LMSInitialize("")),v("loading quizzes ...");try{t.db.quiz=window.config_.quiz||[[]],v(" ... done")}catch(t){y("... failed",t)}v("loading surveys ...");try{t.db.survey=window.config_.survey||[[]],v(" ... done")}catch(t){y("... failed",t)}v("loading tasks ...");try{t.db.task=window.config_.task||[[]],v(" ... done")}catch(t){y("... failed",t)}t.init()}return t}return(0,r.default)(i,[{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!"),v("open location ..."),this.location=f.jsonParse(this.scorm.LMSGetValue("cmi.core.lesson_location")),v("... ",this.location||0),null===this.location&&this.slide(0);var e=0;0===this.countObjectives()&&this.active?(v("seeding values ..."),e=this.initFirst("quiz",e),e=this.initFirst("survey",e),e=this.initFirst("task",e),v("... done")):(v("restoring values ..."),e=this.initSecond("quiz",e),e=this.initSecond("survey",e),e=this.initSecond("task",e),v("... done")),window.SCORE=0,this.score()}}},{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.setObjective(e,this.db[t][i][n]),this.id[t][i].push(e),e++}return e}},{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 o=this.getObjective(e);o&&(this.db[t][i][n]=o),this.id[t][i].push(e),e++}}return e}},{key:"score",value:function(){var t;if(this.active&&this.score){for(var e=0,i=0,n=0,o=0,r=0;r<this.db.quiz.length;r++)for(var s=0;s<this.db.quiz[r].length;s++)switch(e+=o=this.db.quiz[r][s].score,this.db.quiz[r][s].solved){case 1:i+=o;case-1:n+=o}var c,u,l,d,h=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",(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"):n+i===e?this.write("cmi.core.lesson_status","failed"):this.write("cmi.core.lesson_status","incomplete"),window.SCORE=h}}},{key:"open",value:function(t,e,i){if(null!==this.location){var n=this.location;setTimeout((function(){window.LIA.goto(n)}),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 i=null;if("string"==typeof t){try{i=JSON.parse(t)}catch(t){y("getSettings =>",t)}i||(i=d.Settings.data),window.innerWidth<=768&&(i.table_of_contents=!1)}return i}},{key:"write",value:function(t,e){this.scorm?(this.scorm.LMSSetValue(t,e),this.scorm.LMSCommit("")):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(i){y("getObjective =>",i,"cmi.objectives.".concat(t,".id"),e)}return null}},{key:"setObjective",value:function(t,e){var i=f.encodeJSON(e);i.length>255&&y("cmi.objectives.".concat(t,".id"),"Content exceeds 256Bytes!"),this.write("cmi.objectives.".concat(t,".id"),i)}},{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){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")}}}]),i}(l.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,["SCORM1.2: "].concat((0,c.default)(e)))}function y(){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,["SCORM1.2: "].concat((0,c.default)(e)))}})),e.register("knzCS",(function(i,n){t(i.exports,"Connector",(function(){return l}));var o=e("hnmIs"),r=e("9Klpk"),s=e("3bWnf"),a=e("32Euv"),c=e("87lFe"),u=e("cRTHJ"),l=function(){"use strict";function t(){(0,r.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){try{localStorage.setItem(u.Settings.PORT,JSON.stringify(t))}catch(t){console.warn("cannot write to localStorage")}}},{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){}},{key:"restoreFromIndex",value:function(t,e){}},{key:"reset",value:function(t,e){this.initSettings(null,!0)}},{key:"getFromIndex",value:function(t){return(0,o.default)((function(){return(0,a.__generator)(this,(function(t){return[2,null]}))}))()}}]),t}()})),e.register("87lFe",(function(i,n){t(i.exports,"LiaStorage",(function(){return a}));var o=e("9Klpk"),r=e("3bWnf"),s=e("5ENmm"),a=function(){"use strict";function t(){(0,o.default)(this,t)}return(0,r.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 o,r=Object.entries(t)[Symbol.iterator]();!(e=(o=r.next()).done);e=!0){var a=(0,s.default)(o.value,2),c=a[0],u=a[1];localStorage.setItem(c,JSON.stringify(u))}}catch(t){i=!0,n=t}finally{try{e||null==r.return||r.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 d}));var o=e("5ENmm"),r={SingleChoice:"sc",MultipleChoice:"mc",Text:"tx",Select:"st",Matrix:"mx",Generic:"gn",error_msg:"err"},s=Object.entries(r).reduce((function(t,e){var i=(0,o.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,r=!1,s=void 0;try{for(var c,u=Object.entries(t)[Symbol.iterator]();!(n=(c=u.next()).done);n=!0){var l=(0,o.default)(c.value,2),d=l[0],f=l[1];i[e[d]||d]=a(f,e)}}catch(t){r=!0,s=t}finally{try{n||null==u.return||u.return()}finally{if(r)throw s}}return i}function c(t){return JSON.stringify(a(t,r))}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)}}))}();
|
|
Binary file
|