@learnpack/learnpack 5.0.297 → 5.0.300

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 (79) hide show
  1. package/README.md +409 -409
  2. package/lib/commands/audit.js +15 -15
  3. package/lib/commands/breakToken.js +19 -19
  4. package/lib/commands/clean.js +3 -3
  5. package/lib/commands/logout.js +3 -3
  6. package/lib/commands/serve.js +32 -11
  7. package/lib/creatorDist/assets/{index-D25zkBaN.js → index-DoYRptnk.js} +11875 -11992
  8. package/lib/creatorDist/index.html +1 -1
  9. package/lib/managers/config/index.js +77 -77
  10. package/lib/utils/creatorUtilities.js +14 -14
  11. package/lib/utils/templates/isolated/exercises/01-hello-world/README.es.md +26 -26
  12. package/lib/utils/templates/isolated/exercises/01-hello-world/README.md +26 -26
  13. package/lib/utils/templates/scorm/adlcp_rootv1p2.xsd +110 -110
  14. package/lib/utils/templates/scorm/config/index.html +209 -209
  15. package/lib/utils/templates/scorm/ims_xml.xsd +1 -1
  16. package/lib/utils/templates/scorm/imscp_rootv1p1p2.xsd +345 -345
  17. package/lib/utils/templates/scorm/imsmanifest.xml +38 -38
  18. package/lib/utils/templates/scorm/imsmd_rootv1p2p1.xsd +573 -573
  19. package/package.json +1 -1
  20. package/src/commands/audit.ts +487 -487
  21. package/src/commands/breakToken.ts +67 -67
  22. package/src/commands/clean.ts +30 -30
  23. package/src/commands/logout.ts +38 -38
  24. package/src/commands/serve.ts +49 -26
  25. package/src/commands/start.ts +333 -333
  26. package/src/commands/translate.ts +123 -123
  27. package/src/creator/README.md +54 -54
  28. package/src/creator/package-lock.json +6621 -6621
  29. package/src/creator/package.json +55 -55
  30. package/src/creator/src/App.tsx +569 -569
  31. package/src/creator/src/components/FileUploader.tsx +302 -302
  32. package/src/creator/src/components/Icon.tsx +18 -18
  33. package/src/creator/src/components/LessonItem.tsx +152 -152
  34. package/src/creator/src/components/Login.tsx +259 -259
  35. package/src/creator/src/components/syllabus/ContentIndex.tsx +323 -323
  36. package/src/creator/src/components/syllabus/SyllabusEditor.tsx +337 -337
  37. package/src/creator/src/i18n.ts +28 -28
  38. package/src/creator/src/locales/en.json +127 -127
  39. package/src/creator/src/locales/es.json +127 -127
  40. package/src/creator/src/utils/configTypes.ts +122 -122
  41. package/src/creator/src/utils/constants.ts +13 -13
  42. package/src/creator/src/utils/creatorUtils.ts +46 -46
  43. package/src/creator/src/utils/eventBus.ts +2 -2
  44. package/src/creator/src/utils/socket.ts +61 -61
  45. package/src/creator/src/utils/store.ts +222 -222
  46. package/src/creator/src/vite-env.d.ts +1 -1
  47. package/src/creator/vite.config.ts +13 -13
  48. package/src/creatorDist/assets/{index-D25zkBaN.js → index-DoYRptnk.js} +11875 -11992
  49. package/src/creatorDist/index.html +1 -1
  50. package/src/managers/config/defaults.ts +49 -49
  51. package/src/managers/config/exercise.ts +364 -364
  52. package/src/managers/config/index.ts +775 -775
  53. package/src/managers/file.ts +236 -236
  54. package/src/managers/server/routes.ts +554 -554
  55. package/src/managers/telemetry.ts +188 -188
  56. package/src/models/action.ts +13 -13
  57. package/src/models/config-manager.ts +28 -28
  58. package/src/models/config.ts +106 -106
  59. package/src/models/exercise-obj.ts +30 -30
  60. package/src/models/session.ts +39 -39
  61. package/src/models/socket.ts +61 -61
  62. package/src/models/status.ts +16 -16
  63. package/src/utils/BaseCommand.ts +56 -56
  64. package/src/utils/audit.ts +392 -392
  65. package/src/utils/checkNotInstalled.ts +267 -267
  66. package/src/utils/convertCreds.js +34 -34
  67. package/src/utils/creatorUtilities.ts +504 -504
  68. package/src/utils/export/README.md +178 -178
  69. package/src/utils/incrementVersion.js +74 -74
  70. package/src/utils/misc.ts +58 -58
  71. package/src/utils/sidebarGenerator.ts +195 -195
  72. package/src/utils/templates/isolated/exercises/01-hello-world/README.es.md +26 -26
  73. package/src/utils/templates/isolated/exercises/01-hello-world/README.md +26 -26
  74. package/src/utils/templates/scorm/adlcp_rootv1p2.xsd +110 -110
  75. package/src/utils/templates/scorm/config/index.html +209 -209
  76. package/src/utils/templates/scorm/ims_xml.xsd +1 -1
  77. package/src/utils/templates/scorm/imscp_rootv1p1p2.xsd +345 -345
  78. package/src/utils/templates/scorm/imsmanifest.xml +38 -38
  79. package/src/utils/templates/scorm/imsmd_rootv1p2p1.xsd +573 -573
@@ -1,210 +1,210 @@
1
- <!DOCTYPE html
2
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml">
4
-
5
- <head>
6
- <meta charset="UTF-8">
7
- <title>{{title}}</title>
8
- <script src="api.js" type="text/javascript"></script>
9
- <script type="text/javascript">
10
-
11
-
12
- var currentPage = null;
13
- var startTimeStamp = null;
14
- var processedUnload = false;
15
- var reachedEnd = false;
16
- var language = 'es';
17
-
18
- function doStart() {
19
- startTimeStamp = new Date();
20
-
21
- ScormProcessInitialize();
22
-
23
- var completionStatus = ScormProcessGetValue('cmi.core.lesson_status');
24
- if (completionStatus == 'not attempted') {
25
- ScormProcessSetValue('cmi.core.lesson_status', 'incomplete');
26
- }
27
-
28
- var bookmark = ScormProcessGetValue('cmi.core.lesson_location');
29
-
30
- if (bookmark == '') {
31
- currentPage = 0;
32
- } else {
33
- if (
34
- confirm(
35
- 'Would you like to resume from where you previously left off?'
36
- )
37
- ) {
38
- currentPage = parseInt(bookmark, 10);
39
- } else {
40
- currentPage = 0;
41
- }
42
- }
43
-
44
- goToPage();
45
- }
46
-
47
- function goToPage() {
48
- ScormProcessSetValue('cmi.core.lesson_location', currentPage);
49
- }
50
-
51
- function doUnload(pressedExit) {
52
- if (processedUnload == true) {
53
- return;
54
- }
55
-
56
- processedUnload = true;
57
-
58
- var endTimeStamp = new Date();
59
- var totalMilliseconds =
60
- endTimeStamp.getTime() - startTimeStamp.getTime();
61
- var scormTime = ConvertMilliSecondsToSCORMTime(
62
- totalMilliseconds,
63
- false
64
- );
65
-
66
- ScormProcessSetValue('cmi.core.session_time', scormTime);
67
-
68
- if (pressedExit == false && reachedEnd == false) {
69
- ScormProcessSetValue('cmi.core.exit', 'suspend');
70
- }
71
-
72
- ScormProcessFinish();
73
- }
74
-
75
- function doPrevious() {
76
- if (currentPage > 0) {
77
- currentPage--;
78
- }
79
- goToPage();
80
- }
81
-
82
- function doNext() {
83
- if (currentPage < pageArray.length - 1) {
84
- currentPage++;
85
- }
86
- goToPage();
87
- }
88
-
89
- function doExit() {
90
- if (
91
- reachedEnd == false &&
92
- confirm('Would you like to save your progress to resume later?')
93
- ) {
94
- ScormProcessSetValue('cmi.core.exit', 'suspend');
95
- } else {
96
- ScormProcessSetValue('cmi.core.exit', '');
97
- }
98
-
99
- doUnload(true);
100
- }
101
-
102
- function ConvertMilliSecondsToSCORMTime(
103
- intTotalMilliseconds,
104
- blnIncludeFraction
105
- ) {
106
- var intHours;
107
- var intintMinutes;
108
- var intSeconds;
109
- var intMilliseconds;
110
- var intHundredths;
111
- var strCMITimeSpan;
112
-
113
- if (blnIncludeFraction == null || blnIncludeFraction == undefined) {
114
- blnIncludeFraction = true;
115
- }
116
-
117
- intMilliseconds = intTotalMilliseconds % 1000;
118
-
119
- intSeconds = ((intTotalMilliseconds - intMilliseconds) / 1000) % 60;
120
-
121
- intMinutes =
122
- ((intTotalMilliseconds - intMilliseconds - intSeconds * 1000) /
123
- 60000) %
124
- 60;
125
-
126
- intHours =
127
- (intTotalMilliseconds -
128
- intMilliseconds -
129
- intSeconds * 1000 -
130
- intMinutes * 60000) /
131
- 3600000;
132
-
133
- if (intHours == 10000) {
134
- intHours = 9999;
135
-
136
- intMinutes = (intTotalMilliseconds - intHours * 3600000) / 60000;
137
- if (intMinutes == 100) {
138
- intMinutes = 99;
139
- }
140
- intMinutes = Math.floor(intMinutes);
141
-
142
- intSeconds =
143
- (intTotalMilliseconds - intHours * 3600000 - intMinutes * 60000) /
144
- 1000;
145
- if (intSeconds == 100) {
146
- intSeconds = 99;
147
- }
148
- intSeconds = Math.floor(intSeconds);
149
-
150
- intMilliseconds =
151
- intTotalMilliseconds -
152
- intHours * 3600000 -
153
- intMinutes * 60000 -
154
- intSeconds * 1000;
155
- }
156
-
157
- intHundredths = Math.floor(intMilliseconds / 10);
158
-
159
- strCMITimeSpan =
160
- ZeroPad(intHours, 4) +
161
- ':' +
162
- ZeroPad(intMinutes, 2) +
163
- ':' +
164
- ZeroPad(intSeconds, 2);
165
-
166
- if (blnIncludeFraction) {
167
- strCMITimeSpan += '.' + intHundredths;
168
- }
169
-
170
- if (intHours > 9999) {
171
- strCMITimeSpan = '9999:99:99';
172
-
173
- if (blnIncludeFraction) {
174
- strCMITimeSpan += '.99';
175
- }
176
- }
177
-
178
- return strCMITimeSpan;
179
- }
180
-
181
- function ZeroPad(intNum, intNumDigits) {
182
- var strTemp;
183
- var intLen;
184
- var i;
185
-
186
- strTemp = new String(intNum);
187
- intLen = strTemp.length;
188
-
189
- if (intLen > intNumDigits) {
190
- strTemp = strTemp.substr(0, intNumDigits);
191
- } else {
192
- for (i = intLen; i < intNumDigits; i++) {
193
- strTemp = '0' + strTemp;
194
- }
195
- }
196
- return strTemp;
197
- }
198
-
199
-
200
- </script>
201
- <link rel="stylesheet" href="app.css">
202
- </head>
203
-
204
- <body onload="doStart();" onbeforeunload="doUnload(false);" onunload="doUnload();">
205
- <div id="root"></div>
206
- </body>
207
-
208
- <script type="module" src="app.js"></script>
209
-
1
+ <!DOCTYPE html
2
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml">
4
+
5
+ <head>
6
+ <meta charset="UTF-8">
7
+ <title>{{title}}</title>
8
+ <script src="api.js" type="text/javascript"></script>
9
+ <script type="text/javascript">
10
+
11
+
12
+ var currentPage = null;
13
+ var startTimeStamp = null;
14
+ var processedUnload = false;
15
+ var reachedEnd = false;
16
+ var language = 'es';
17
+
18
+ function doStart() {
19
+ startTimeStamp = new Date();
20
+
21
+ ScormProcessInitialize();
22
+
23
+ var completionStatus = ScormProcessGetValue('cmi.core.lesson_status');
24
+ if (completionStatus == 'not attempted') {
25
+ ScormProcessSetValue('cmi.core.lesson_status', 'incomplete');
26
+ }
27
+
28
+ var bookmark = ScormProcessGetValue('cmi.core.lesson_location');
29
+
30
+ if (bookmark == '') {
31
+ currentPage = 0;
32
+ } else {
33
+ if (
34
+ confirm(
35
+ 'Would you like to resume from where you previously left off?'
36
+ )
37
+ ) {
38
+ currentPage = parseInt(bookmark, 10);
39
+ } else {
40
+ currentPage = 0;
41
+ }
42
+ }
43
+
44
+ goToPage();
45
+ }
46
+
47
+ function goToPage() {
48
+ ScormProcessSetValue('cmi.core.lesson_location', currentPage);
49
+ }
50
+
51
+ function doUnload(pressedExit) {
52
+ if (processedUnload == true) {
53
+ return;
54
+ }
55
+
56
+ processedUnload = true;
57
+
58
+ var endTimeStamp = new Date();
59
+ var totalMilliseconds =
60
+ endTimeStamp.getTime() - startTimeStamp.getTime();
61
+ var scormTime = ConvertMilliSecondsToSCORMTime(
62
+ totalMilliseconds,
63
+ false
64
+ );
65
+
66
+ ScormProcessSetValue('cmi.core.session_time', scormTime);
67
+
68
+ if (pressedExit == false && reachedEnd == false) {
69
+ ScormProcessSetValue('cmi.core.exit', 'suspend');
70
+ }
71
+
72
+ ScormProcessFinish();
73
+ }
74
+
75
+ function doPrevious() {
76
+ if (currentPage > 0) {
77
+ currentPage--;
78
+ }
79
+ goToPage();
80
+ }
81
+
82
+ function doNext() {
83
+ if (currentPage < pageArray.length - 1) {
84
+ currentPage++;
85
+ }
86
+ goToPage();
87
+ }
88
+
89
+ function doExit() {
90
+ if (
91
+ reachedEnd == false &&
92
+ confirm('Would you like to save your progress to resume later?')
93
+ ) {
94
+ ScormProcessSetValue('cmi.core.exit', 'suspend');
95
+ } else {
96
+ ScormProcessSetValue('cmi.core.exit', '');
97
+ }
98
+
99
+ doUnload(true);
100
+ }
101
+
102
+ function ConvertMilliSecondsToSCORMTime(
103
+ intTotalMilliseconds,
104
+ blnIncludeFraction
105
+ ) {
106
+ var intHours;
107
+ var intintMinutes;
108
+ var intSeconds;
109
+ var intMilliseconds;
110
+ var intHundredths;
111
+ var strCMITimeSpan;
112
+
113
+ if (blnIncludeFraction == null || blnIncludeFraction == undefined) {
114
+ blnIncludeFraction = true;
115
+ }
116
+
117
+ intMilliseconds = intTotalMilliseconds % 1000;
118
+
119
+ intSeconds = ((intTotalMilliseconds - intMilliseconds) / 1000) % 60;
120
+
121
+ intMinutes =
122
+ ((intTotalMilliseconds - intMilliseconds - intSeconds * 1000) /
123
+ 60000) %
124
+ 60;
125
+
126
+ intHours =
127
+ (intTotalMilliseconds -
128
+ intMilliseconds -
129
+ intSeconds * 1000 -
130
+ intMinutes * 60000) /
131
+ 3600000;
132
+
133
+ if (intHours == 10000) {
134
+ intHours = 9999;
135
+
136
+ intMinutes = (intTotalMilliseconds - intHours * 3600000) / 60000;
137
+ if (intMinutes == 100) {
138
+ intMinutes = 99;
139
+ }
140
+ intMinutes = Math.floor(intMinutes);
141
+
142
+ intSeconds =
143
+ (intTotalMilliseconds - intHours * 3600000 - intMinutes * 60000) /
144
+ 1000;
145
+ if (intSeconds == 100) {
146
+ intSeconds = 99;
147
+ }
148
+ intSeconds = Math.floor(intSeconds);
149
+
150
+ intMilliseconds =
151
+ intTotalMilliseconds -
152
+ intHours * 3600000 -
153
+ intMinutes * 60000 -
154
+ intSeconds * 1000;
155
+ }
156
+
157
+ intHundredths = Math.floor(intMilliseconds / 10);
158
+
159
+ strCMITimeSpan =
160
+ ZeroPad(intHours, 4) +
161
+ ':' +
162
+ ZeroPad(intMinutes, 2) +
163
+ ':' +
164
+ ZeroPad(intSeconds, 2);
165
+
166
+ if (blnIncludeFraction) {
167
+ strCMITimeSpan += '.' + intHundredths;
168
+ }
169
+
170
+ if (intHours > 9999) {
171
+ strCMITimeSpan = '9999:99:99';
172
+
173
+ if (blnIncludeFraction) {
174
+ strCMITimeSpan += '.99';
175
+ }
176
+ }
177
+
178
+ return strCMITimeSpan;
179
+ }
180
+
181
+ function ZeroPad(intNum, intNumDigits) {
182
+ var strTemp;
183
+ var intLen;
184
+ var i;
185
+
186
+ strTemp = new String(intNum);
187
+ intLen = strTemp.length;
188
+
189
+ if (intLen > intNumDigits) {
190
+ strTemp = strTemp.substr(0, intNumDigits);
191
+ } else {
192
+ for (i = intLen; i < intNumDigits; i++) {
193
+ strTemp = '0' + strTemp;
194
+ }
195
+ }
196
+ return strTemp;
197
+ }
198
+
199
+
200
+ </script>
201
+ <link rel="stylesheet" href="app.css">
202
+ </head>
203
+
204
+ <body onload="doStart();" onbeforeunload="doUnload(false);" onunload="doUnload();">
205
+ <div id="root"></div>
206
+ </body>
207
+
208
+ <script type="module" src="app.js"></script>
209
+
210
210
  </html>
@@ -1 +1 @@
1
- <?xml version="1.0" encoding="UTF-8"?><!-- filename=ims_xml.xsd --><xsd:schema xmlns="http://www.w3.org/XML/1998/namespace" targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <!-- 2001-02-22 edited by Thomas Wason IMS Global Learning Consortium, Inc. --> <xsd:annotation> <xsd:documentation>In namespace-aware XML processors, the &quot;xml&quot; prefix is bound to the namespace name http://www.w3.org/XML/1998/namespace.</xsd:documentation> <xsd:documentation>Do not reference this file in XML instances</xsd:documentation> <xsd:documentation>Schawn Thropp: Changed the uriReference type to string type</xsd:documentation> </xsd:annotation> <xsd:attribute name="lang" type="xsd:language"> <xsd:annotation> <xsd:documentation>Refers to universal XML 1.0 lang attribute</xsd:documentation> </xsd:annotation> </xsd:attribute> <xsd:attribute name="base" type="xsd:string"> <xsd:annotation> <xsd:documentation>Refers to XML Base: http://www.w3.org/TR/xmlbase</xsd:documentation> </xsd:annotation> </xsd:attribute> <xsd:attribute name="link" type="xsd:string"/></xsd:schema>
1
+ <?xml version="1.0" encoding="UTF-8"?><!-- filename=ims_xml.xsd --><xsd:schema xmlns="http://www.w3.org/XML/1998/namespace" targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <!-- 2001-02-22 edited by Thomas Wason IMS Global Learning Consortium, Inc. --> <xsd:annotation> <xsd:documentation>In namespace-aware XML processors, the &quot;xml&quot; prefix is bound to the namespace name http://www.w3.org/XML/1998/namespace.</xsd:documentation> <xsd:documentation>Do not reference this file in XML instances</xsd:documentation> <xsd:documentation>Schawn Thropp: Changed the uriReference type to string type</xsd:documentation> </xsd:annotation> <xsd:attribute name="lang" type="xsd:language"> <xsd:annotation> <xsd:documentation>Refers to universal XML 1.0 lang attribute</xsd:documentation> </xsd:annotation> </xsd:attribute> <xsd:attribute name="base" type="xsd:string"> <xsd:annotation> <xsd:documentation>Refers to XML Base: http://www.w3.org/TR/xmlbase</xsd:documentation> </xsd:annotation> </xsd:attribute> <xsd:attribute name="link" type="xsd:string"/></xsd:schema>