@learnpack/learnpack 5.0.335 → 5.0.339
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/bin/run +17 -17
- package/lib/commands/init.js +41 -41
- package/lib/commands/serve.js +589 -126
- package/lib/creatorDist/assets/index-BhqDgBS9.js +8448 -78631
- package/lib/creatorDist/assets/index-CjddKHB_.css +1 -1688
- package/lib/managers/config/exercise.js +2 -14
- package/lib/managers/readmeHistoryService.js +3 -1
- package/lib/managers/server/routes.js +2 -1
- package/lib/utils/configBuilder.js +2 -1
- package/lib/utils/creatorUtilities.js +14 -14
- package/lib/utils/exerciseFileOrder.d.ts +20 -0
- package/lib/utils/exerciseFileOrder.js +49 -0
- package/lib/utils/export/epub.js +26 -26
- package/lib/utils/readmeSanitizer.d.ts +8 -0
- package/lib/utils/readmeSanitizer.js +13 -0
- package/lib/utils/templates/epub/epub.css +146 -146
- package/lib/utils/templates/scorm/config/api.js +175 -175
- package/package.json +1 -1
- package/src/commands/init.ts +655 -655
- package/src/commands/publish.ts +670 -670
- package/src/commands/serve.ts +5853 -5216
- package/src/creator/eslint.config.js +28 -28
- package/src/creator/src/index.css +227 -227
- package/src/creator/src/utils/lib.ts +471 -471
- package/src/creatorDist/assets/index-BhqDgBS9.js +8448 -78631
- package/src/creatorDist/assets/index-CjddKHB_.css +1 -1688
- package/src/managers/config/exercise.ts +3 -15
- package/src/managers/readmeHistoryService.ts +3 -1
- package/src/managers/server/routes.ts +15 -6
- package/src/managers/session.ts +184 -184
- package/src/ui/_app/app.css +1 -1
- package/src/ui/_app/app.js +1950 -1878
- package/src/ui/app.tar.gz +0 -0
- package/src/utils/api.ts +675 -675
- package/src/utils/configBuilder.ts +102 -100
- package/src/utils/creatorUtilities.ts +536 -536
- package/src/utils/errors.ts +108 -108
- package/src/utils/exerciseFileOrder.ts +50 -0
- package/src/utils/export/epub.ts +553 -553
- package/src/utils/export/index.ts +4 -4
- package/src/utils/export/scorm.ts +121 -121
- package/src/utils/export/shared.ts +61 -61
- package/src/utils/export/types.ts +25 -25
- package/src/utils/export/zip.ts +55 -55
- package/src/utils/readmeSanitizer.ts +10 -0
- package/src/utils/rigoActions.ts +642 -642
- package/src/utils/templates/epub/epub.css +146 -146
- package/src/utils/templates/scorm/config/api.js +175 -175
|
@@ -1,175 +1,175 @@
|
|
|
1
|
-
var findAPITries = 0;
|
|
2
|
-
|
|
3
|
-
function findAPI(win) {
|
|
4
|
-
while (win.API == null && win.parent != null && win.parent != win) {
|
|
5
|
-
findAPITries++;
|
|
6
|
-
|
|
7
|
-
if (findAPITries > 7) {
|
|
8
|
-
alert("Error finding API -- too deeply nested.");
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
win = win.parent;
|
|
13
|
-
}
|
|
14
|
-
return win.API;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function getAPI() {
|
|
18
|
-
var theAPI = findAPI(window);
|
|
19
|
-
|
|
20
|
-
if (
|
|
21
|
-
theAPI == null &&
|
|
22
|
-
window.opener != null &&
|
|
23
|
-
typeof window.opener != "undefined"
|
|
24
|
-
) {
|
|
25
|
-
theAPI = findAPI(window.opener);
|
|
26
|
-
}
|
|
27
|
-
if (theAPI == null) {
|
|
28
|
-
alert("Unable to find an API adapter");
|
|
29
|
-
}
|
|
30
|
-
return theAPI;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
var SCORM_TRUE = "true";
|
|
34
|
-
var SCORM_FALSE = "false";
|
|
35
|
-
var SCORM_NO_ERROR = "0";
|
|
36
|
-
|
|
37
|
-
var finishCalled = false;
|
|
38
|
-
|
|
39
|
-
var initialized = false;
|
|
40
|
-
|
|
41
|
-
var API = null;
|
|
42
|
-
|
|
43
|
-
function ScormProcessInitialize() {
|
|
44
|
-
var result;
|
|
45
|
-
|
|
46
|
-
API = getAPI();
|
|
47
|
-
|
|
48
|
-
if (API == null) {
|
|
49
|
-
alert(
|
|
50
|
-
"ERROR - Could not establish a connection with the LMS.\n\nYour results may not be recorded."
|
|
51
|
-
);
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
result = API.LMSInitialize("");
|
|
56
|
-
|
|
57
|
-
if (result == SCORM_FALSE) {
|
|
58
|
-
var errorNumber = API.LMSGetLastError();
|
|
59
|
-
var errorString = API.LMSGetErrorString(errorNumber);
|
|
60
|
-
var diagnostic = API.LMSGetDiagnostic(errorNumber);
|
|
61
|
-
|
|
62
|
-
var errorDescription =
|
|
63
|
-
"Number: " +
|
|
64
|
-
errorNumber +
|
|
65
|
-
"\nDescription: " +
|
|
66
|
-
errorString +
|
|
67
|
-
"\nDiagnostic: " +
|
|
68
|
-
diagnostic;
|
|
69
|
-
|
|
70
|
-
alert(
|
|
71
|
-
"Error - Could not initialize communication with the LMS.\n\nYour results may not be recorded.\n\n" +
|
|
72
|
-
errorDescription
|
|
73
|
-
);
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
initialized = true;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function ScormProcessFinish() {
|
|
81
|
-
var result;
|
|
82
|
-
|
|
83
|
-
if (initialized == false || finishCalled == true) {
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
result = API.LMSFinish("");
|
|
88
|
-
|
|
89
|
-
finishCalled = true;
|
|
90
|
-
|
|
91
|
-
if (result == SCORM_FALSE) {
|
|
92
|
-
var errorNumber = API.LMSGetLastError();
|
|
93
|
-
var errorString = API.LMSGetErrorString(errorNumber);
|
|
94
|
-
var diagnostic = API.LMSGetDiagnostic(errorNumber);
|
|
95
|
-
|
|
96
|
-
var errorDescription =
|
|
97
|
-
"Number: " +
|
|
98
|
-
errorNumber +
|
|
99
|
-
"\nDescription: " +
|
|
100
|
-
errorString +
|
|
101
|
-
"\nDiagnostic: " +
|
|
102
|
-
diagnostic;
|
|
103
|
-
|
|
104
|
-
alert(
|
|
105
|
-
"Error - Could not terminate communication with the LMS.\n\nYour results may not be recorded.\n\n" +
|
|
106
|
-
errorDescription
|
|
107
|
-
);
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
function ScormProcessGetValue(element) {
|
|
113
|
-
var result;
|
|
114
|
-
|
|
115
|
-
if (initialized == false || finishCalled == true) {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
result = API.LMSGetValue(element);
|
|
120
|
-
|
|
121
|
-
if (result == "") {
|
|
122
|
-
var errorNumber = API.LMSGetLastError();
|
|
123
|
-
|
|
124
|
-
if (errorNumber != SCORM_NO_ERROR) {
|
|
125
|
-
var errorString = API.LMSGetErrorString(errorNumber);
|
|
126
|
-
var diagnostic = API.LMSGetDiagnostic(errorNumber);
|
|
127
|
-
|
|
128
|
-
var errorDescription =
|
|
129
|
-
"Number: " +
|
|
130
|
-
errorNumber +
|
|
131
|
-
"\nDescription: " +
|
|
132
|
-
errorString +
|
|
133
|
-
"\nDiagnostic: " +
|
|
134
|
-
diagnostic;
|
|
135
|
-
|
|
136
|
-
alert(
|
|
137
|
-
"Error - Could not retrieve a value from the LMS.\n\n" +
|
|
138
|
-
errorDescription
|
|
139
|
-
);
|
|
140
|
-
return "";
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
return result;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
function ScormProcessSetValue(element, value) {
|
|
148
|
-
var result;
|
|
149
|
-
|
|
150
|
-
if (initialized == false || finishCalled == true) {
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
result = API.LMSSetValue(element, value);
|
|
155
|
-
|
|
156
|
-
if (result == SCORM_FALSE) {
|
|
157
|
-
var errorNumber = API.LMSGetLastError();
|
|
158
|
-
var errorString = API.LMSGetErrorString(errorNumber);
|
|
159
|
-
var diagnostic = API.LMSGetDiagnostic(errorNumber);
|
|
160
|
-
|
|
161
|
-
var errorDescription =
|
|
162
|
-
"Number: " +
|
|
163
|
-
errorNumber +
|
|
164
|
-
"\nDescription: " +
|
|
165
|
-
errorString +
|
|
166
|
-
"\nDiagnostic: " +
|
|
167
|
-
diagnostic;
|
|
168
|
-
|
|
169
|
-
alert(
|
|
170
|
-
"Error - Could not store a value in the LMS.\n\nYour results may not be recorded.\n\n" +
|
|
171
|
-
errorDescription
|
|
172
|
-
);
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
1
|
+
var findAPITries = 0;
|
|
2
|
+
|
|
3
|
+
function findAPI(win) {
|
|
4
|
+
while (win.API == null && win.parent != null && win.parent != win) {
|
|
5
|
+
findAPITries++;
|
|
6
|
+
|
|
7
|
+
if (findAPITries > 7) {
|
|
8
|
+
alert("Error finding API -- too deeply nested.");
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
win = win.parent;
|
|
13
|
+
}
|
|
14
|
+
return win.API;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function getAPI() {
|
|
18
|
+
var theAPI = findAPI(window);
|
|
19
|
+
|
|
20
|
+
if (
|
|
21
|
+
theAPI == null &&
|
|
22
|
+
window.opener != null &&
|
|
23
|
+
typeof window.opener != "undefined"
|
|
24
|
+
) {
|
|
25
|
+
theAPI = findAPI(window.opener);
|
|
26
|
+
}
|
|
27
|
+
if (theAPI == null) {
|
|
28
|
+
alert("Unable to find an API adapter");
|
|
29
|
+
}
|
|
30
|
+
return theAPI;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
var SCORM_TRUE = "true";
|
|
34
|
+
var SCORM_FALSE = "false";
|
|
35
|
+
var SCORM_NO_ERROR = "0";
|
|
36
|
+
|
|
37
|
+
var finishCalled = false;
|
|
38
|
+
|
|
39
|
+
var initialized = false;
|
|
40
|
+
|
|
41
|
+
var API = null;
|
|
42
|
+
|
|
43
|
+
function ScormProcessInitialize() {
|
|
44
|
+
var result;
|
|
45
|
+
|
|
46
|
+
API = getAPI();
|
|
47
|
+
|
|
48
|
+
if (API == null) {
|
|
49
|
+
alert(
|
|
50
|
+
"ERROR - Could not establish a connection with the LMS.\n\nYour results may not be recorded."
|
|
51
|
+
);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
result = API.LMSInitialize("");
|
|
56
|
+
|
|
57
|
+
if (result == SCORM_FALSE) {
|
|
58
|
+
var errorNumber = API.LMSGetLastError();
|
|
59
|
+
var errorString = API.LMSGetErrorString(errorNumber);
|
|
60
|
+
var diagnostic = API.LMSGetDiagnostic(errorNumber);
|
|
61
|
+
|
|
62
|
+
var errorDescription =
|
|
63
|
+
"Number: " +
|
|
64
|
+
errorNumber +
|
|
65
|
+
"\nDescription: " +
|
|
66
|
+
errorString +
|
|
67
|
+
"\nDiagnostic: " +
|
|
68
|
+
diagnostic;
|
|
69
|
+
|
|
70
|
+
alert(
|
|
71
|
+
"Error - Could not initialize communication with the LMS.\n\nYour results may not be recorded.\n\n" +
|
|
72
|
+
errorDescription
|
|
73
|
+
);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
initialized = true;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function ScormProcessFinish() {
|
|
81
|
+
var result;
|
|
82
|
+
|
|
83
|
+
if (initialized == false || finishCalled == true) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
result = API.LMSFinish("");
|
|
88
|
+
|
|
89
|
+
finishCalled = true;
|
|
90
|
+
|
|
91
|
+
if (result == SCORM_FALSE) {
|
|
92
|
+
var errorNumber = API.LMSGetLastError();
|
|
93
|
+
var errorString = API.LMSGetErrorString(errorNumber);
|
|
94
|
+
var diagnostic = API.LMSGetDiagnostic(errorNumber);
|
|
95
|
+
|
|
96
|
+
var errorDescription =
|
|
97
|
+
"Number: " +
|
|
98
|
+
errorNumber +
|
|
99
|
+
"\nDescription: " +
|
|
100
|
+
errorString +
|
|
101
|
+
"\nDiagnostic: " +
|
|
102
|
+
diagnostic;
|
|
103
|
+
|
|
104
|
+
alert(
|
|
105
|
+
"Error - Could not terminate communication with the LMS.\n\nYour results may not be recorded.\n\n" +
|
|
106
|
+
errorDescription
|
|
107
|
+
);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function ScormProcessGetValue(element) {
|
|
113
|
+
var result;
|
|
114
|
+
|
|
115
|
+
if (initialized == false || finishCalled == true) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
result = API.LMSGetValue(element);
|
|
120
|
+
|
|
121
|
+
if (result == "") {
|
|
122
|
+
var errorNumber = API.LMSGetLastError();
|
|
123
|
+
|
|
124
|
+
if (errorNumber != SCORM_NO_ERROR) {
|
|
125
|
+
var errorString = API.LMSGetErrorString(errorNumber);
|
|
126
|
+
var diagnostic = API.LMSGetDiagnostic(errorNumber);
|
|
127
|
+
|
|
128
|
+
var errorDescription =
|
|
129
|
+
"Number: " +
|
|
130
|
+
errorNumber +
|
|
131
|
+
"\nDescription: " +
|
|
132
|
+
errorString +
|
|
133
|
+
"\nDiagnostic: " +
|
|
134
|
+
diagnostic;
|
|
135
|
+
|
|
136
|
+
alert(
|
|
137
|
+
"Error - Could not retrieve a value from the LMS.\n\n" +
|
|
138
|
+
errorDescription
|
|
139
|
+
);
|
|
140
|
+
return "";
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return result;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function ScormProcessSetValue(element, value) {
|
|
148
|
+
var result;
|
|
149
|
+
|
|
150
|
+
if (initialized == false || finishCalled == true) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
result = API.LMSSetValue(element, value);
|
|
155
|
+
|
|
156
|
+
if (result == SCORM_FALSE) {
|
|
157
|
+
var errorNumber = API.LMSGetLastError();
|
|
158
|
+
var errorString = API.LMSGetErrorString(errorNumber);
|
|
159
|
+
var diagnostic = API.LMSGetDiagnostic(errorNumber);
|
|
160
|
+
|
|
161
|
+
var errorDescription =
|
|
162
|
+
"Number: " +
|
|
163
|
+
errorNumber +
|
|
164
|
+
"\nDescription: " +
|
|
165
|
+
errorString +
|
|
166
|
+
"\nDiagnostic: " +
|
|
167
|
+
diagnostic;
|
|
168
|
+
|
|
169
|
+
alert(
|
|
170
|
+
"Error - Could not store a value in the LMS.\n\nYour results may not be recorded.\n\n" +
|
|
171
|
+
errorDescription
|
|
172
|
+
);
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@learnpack/learnpack",
|
|
3
3
|
"description": "Seamlessly build, sell and/or take interactive & auto-graded tutorials, start learning now or build a new tutorial to your audience.",
|
|
4
|
-
"version": "5.0.
|
|
4
|
+
"version": "5.0.339",
|
|
5
5
|
"author": "Alejandro Sanchez @alesanchezr",
|
|
6
6
|
"contributors": [
|
|
7
7
|
{
|