scorm-again 2.4.1 → 2.6.0
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/README.md +23 -23
- package/dist/aicc.js +676 -493
- package/dist/aicc.js.map +1 -1
- package/dist/aicc.min.js +1 -1
- package/dist/aicc.min.js.map +1 -1
- package/dist/esm/aicc.js +692 -496
- package/dist/esm/aicc.js.map +1 -1
- package/dist/esm/aicc.min.js +1 -1
- package/dist/esm/aicc.min.js.map +1 -1
- package/dist/esm/scorm-again.js +1151 -743
- package/dist/esm/scorm-again.js.map +1 -1
- package/dist/esm/scorm-again.min.js +1 -1
- package/dist/esm/scorm-again.min.js.map +1 -1
- package/dist/esm/scorm12.js +534 -401
- package/dist/esm/scorm12.js.map +1 -1
- package/dist/esm/scorm12.min.js +1 -1
- package/dist/esm/scorm12.min.js.map +1 -1
- package/dist/esm/scorm2004.js +712 -465
- package/dist/esm/scorm2004.js.map +1 -1
- package/dist/esm/scorm2004.min.js +1 -1
- package/dist/esm/scorm2004.min.js.map +1 -1
- package/dist/scorm-again.js +1127 -731
- package/dist/scorm-again.js.map +1 -1
- package/dist/scorm-again.min.js +1 -1
- package/dist/scorm-again.min.js.map +1 -1
- package/dist/scorm12.js +521 -400
- package/dist/scorm12.js.map +1 -1
- package/dist/scorm12.min.js +1 -1
- package/dist/scorm12.min.js.map +1 -1
- package/dist/scorm2004.js +698 -464
- package/dist/scorm2004.js.map +1 -1
- package/dist/scorm2004.min.js +1 -1
- package/dist/scorm2004.min.js.map +1 -1
- package/package.json +15 -15
- package/src/AICC.ts +3 -0
- package/src/BaseAPI.ts +60 -95
- package/src/Scorm12API.ts +14 -14
- package/src/Scorm2004API.ts +107 -37
- package/src/cmi/aicc/attempts.ts +22 -12
- package/src/cmi/aicc/cmi.ts +2 -2
- package/src/cmi/aicc/core.ts +44 -26
- package/src/cmi/aicc/evaluation.ts +31 -12
- package/src/cmi/aicc/paths.ts +29 -15
- package/src/cmi/aicc/student_data.ts +14 -5
- package/src/cmi/aicc/student_demographics.ts +31 -24
- package/src/cmi/aicc/student_preferences.ts +11 -11
- package/src/cmi/aicc/tries.ts +24 -14
- package/src/cmi/aicc/validation.ts +3 -4
- package/src/cmi/common/array.ts +17 -5
- package/src/cmi/common/base_cmi.ts +3 -1
- package/src/cmi/common/score.ts +16 -13
- package/src/cmi/scorm12/cmi.ts +25 -10
- package/src/cmi/scorm12/interactions.ts +62 -28
- package/src/cmi/scorm12/nav.ts +13 -5
- package/src/cmi/scorm12/objectives.ts +28 -18
- package/src/cmi/scorm12/student_data.ts +15 -8
- package/src/cmi/scorm12/student_preference.ts +20 -13
- package/src/cmi/scorm12/validation.ts +7 -7
- package/src/cmi/scorm2004/adl.ts +141 -25
- package/src/cmi/scorm2004/cmi.ts +50 -55
- package/src/cmi/scorm2004/comments.ts +21 -20
- package/src/cmi/scorm2004/interactions.ts +73 -32
- package/src/cmi/scorm2004/learner_preference.ts +20 -13
- package/src/cmi/scorm2004/objectives.ts +41 -16
- package/src/cmi/scorm2004/score.ts +22 -11
- package/src/cmi/scorm2004/validation.ts +4 -4
- package/src/constants/api_constants.ts +8 -29
- package/src/constants/default_settings.ts +26 -12
- package/src/constants/enums.ts +9 -0
- package/src/constants/error_codes.ts +5 -12
- package/src/constants/regex.ts +5 -11
- package/src/constants/response_constants.ts +1 -2
- package/src/exceptions/aicc_exceptions.ts +29 -0
- package/src/exceptions/scorm12_exceptions.ts +29 -0
- package/src/exceptions/scorm2004_exceptions.ts +29 -0
- package/src/exceptions.ts +1 -86
- package/src/types/api_types.ts +29 -5
- package/test/AICC.spec.ts +114 -43
- package/test/Scorm12API.spec.ts +37 -39
- package/test/Scorm2004API.spec.ts +165 -80
- package/test/cmi/aicc_cmi.spec.ts +6 -9
- package/test/cmi/scorm12_cmi.spec.ts +8 -8
- package/test/cmi/scorm2004_cmi.spec.ts +8 -9
- package/test/exceptions.spec.ts +11 -9
- package/test/types/api_types.spec.ts +40 -47
- package/test/utilities.spec.ts +1 -4
- package/webpack.config.js +4 -0
package/dist/esm/scorm12.js
CHANGED
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
/***/ 429:
|
|
4
4
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5
5
|
|
|
6
|
+
// ESM COMPAT FLAG
|
|
7
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6
8
|
|
|
7
9
|
// EXPORTS
|
|
8
10
|
__webpack_require__.d(__webpack_exports__, {
|
|
9
|
-
|
|
11
|
+
"default": function() { return /* binding */ src_BaseAPI; }
|
|
10
12
|
});
|
|
11
13
|
|
|
12
14
|
// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs
|
|
@@ -15,15 +17,16 @@ var tslib_es6 = __webpack_require__(635);
|
|
|
15
17
|
var array = __webpack_require__(589);
|
|
16
18
|
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
17
19
|
var exceptions = __webpack_require__(784);
|
|
18
|
-
// EXTERNAL MODULE: ./src/constants/error_codes.ts
|
|
19
|
-
var error_codes = __webpack_require__(797);
|
|
20
20
|
// EXTERNAL MODULE: ./src/constants/api_constants.ts
|
|
21
21
|
var api_constants = __webpack_require__(340);
|
|
22
22
|
// EXTERNAL MODULE: ./src/utilities.ts
|
|
23
23
|
var utilities = __webpack_require__(864);
|
|
24
|
+
// EXTERNAL MODULE: ./src/constants/enums.ts
|
|
25
|
+
var enums = __webpack_require__(56);
|
|
24
26
|
;// ./src/constants/default_settings.ts
|
|
25
27
|
|
|
26
28
|
|
|
29
|
+
|
|
27
30
|
var DefaultSettings = {
|
|
28
31
|
autocommit: false,
|
|
29
32
|
autocommitSeconds: 10,
|
|
@@ -33,7 +36,7 @@ var DefaultSettings = {
|
|
|
33
36
|
dataCommitFormat: "json",
|
|
34
37
|
commitRequestDataType: "application/json;charset=UTF-8",
|
|
35
38
|
autoProgress: false,
|
|
36
|
-
logLevel:
|
|
39
|
+
logLevel: enums.LogLevelEnum.ERROR,
|
|
37
40
|
selfReportSessionTime: false,
|
|
38
41
|
alwaysSendTotalTime: false,
|
|
39
42
|
renderCommonCommitFields: false,
|
|
@@ -42,9 +45,9 @@ var DefaultSettings = {
|
|
|
42
45
|
xhrWithCredentials: false,
|
|
43
46
|
fetchMode: "cors",
|
|
44
47
|
responseHandler: function (response) {
|
|
45
|
-
return (0,tslib_es6
|
|
48
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
46
49
|
var responseText, httpResult;
|
|
47
|
-
return (0,tslib_es6
|
|
50
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
48
51
|
switch (_a.label) {
|
|
49
52
|
case 0:
|
|
50
53
|
if (!(typeof response !== "undefined")) return [3, 2];
|
|
@@ -59,13 +62,13 @@ var DefaultSettings = {
|
|
|
59
62
|
!{}.hasOwnProperty.call(httpResult, "result")) {
|
|
60
63
|
if (response.status === 200) {
|
|
61
64
|
return [2, {
|
|
62
|
-
result: api_constants
|
|
65
|
+
result: api_constants.global_constants.SCORM_TRUE,
|
|
63
66
|
errorCode: 0,
|
|
64
67
|
}];
|
|
65
68
|
}
|
|
66
69
|
else {
|
|
67
70
|
return [2, {
|
|
68
|
-
result: api_constants
|
|
71
|
+
result: api_constants.global_constants.SCORM_FALSE,
|
|
69
72
|
errorCode: 101,
|
|
70
73
|
}];
|
|
71
74
|
}
|
|
@@ -75,14 +78,14 @@ var DefaultSettings = {
|
|
|
75
78
|
result: httpResult.result,
|
|
76
79
|
errorCode: httpResult.errorCode
|
|
77
80
|
? httpResult.errorCode
|
|
78
|
-
: httpResult.result === api_constants
|
|
81
|
+
: httpResult.result === api_constants.global_constants.SCORM_TRUE
|
|
79
82
|
? 0
|
|
80
83
|
: 101,
|
|
81
84
|
}];
|
|
82
85
|
}
|
|
83
86
|
_a.label = 2;
|
|
84
87
|
case 2: return [2, {
|
|
85
|
-
result: api_constants
|
|
88
|
+
result: api_constants.global_constants.SCORM_FALSE,
|
|
86
89
|
errorCode: 101,
|
|
87
90
|
}];
|
|
88
91
|
}
|
|
@@ -94,16 +97,28 @@ var DefaultSettings = {
|
|
|
94
97
|
},
|
|
95
98
|
onLogMessage: function (messageLevel, logMessage) {
|
|
96
99
|
switch (messageLevel) {
|
|
97
|
-
case
|
|
100
|
+
case "4":
|
|
101
|
+
case 4:
|
|
102
|
+
case "ERROR":
|
|
103
|
+
case enums.LogLevelEnum.ERROR:
|
|
98
104
|
console.error(logMessage);
|
|
99
105
|
break;
|
|
100
|
-
case
|
|
106
|
+
case "3":
|
|
107
|
+
case 3:
|
|
108
|
+
case "WARN":
|
|
109
|
+
case enums.LogLevelEnum.WARN:
|
|
101
110
|
console.warn(logMessage);
|
|
102
111
|
break;
|
|
103
|
-
case
|
|
112
|
+
case "2":
|
|
113
|
+
case 2:
|
|
114
|
+
case "INFO":
|
|
115
|
+
case enums.LogLevelEnum.INFO:
|
|
104
116
|
console.info(logMessage);
|
|
105
117
|
break;
|
|
106
|
-
case
|
|
118
|
+
case "1":
|
|
119
|
+
case 1:
|
|
120
|
+
case "DEBUG":
|
|
121
|
+
case enums.LogLevelEnum.DEBUG:
|
|
107
122
|
if (console.debug) {
|
|
108
123
|
console.debug(logMessage);
|
|
109
124
|
}
|
|
@@ -115,6 +130,7 @@ var DefaultSettings = {
|
|
|
115
130
|
},
|
|
116
131
|
scoItemIds: [],
|
|
117
132
|
scoItemIdValidator: false,
|
|
133
|
+
globalObjectiveIds: [],
|
|
118
134
|
};
|
|
119
135
|
|
|
120
136
|
;// ./src/helpers/scheduled_commit.ts
|
|
@@ -135,7 +151,7 @@ var ScheduledCommit = (function () {
|
|
|
135
151
|
ScheduledCommit.prototype.wrapper = function () {
|
|
136
152
|
var _this = this;
|
|
137
153
|
if (!this._cancelled) {
|
|
138
|
-
(function () { return (0,tslib_es6
|
|
154
|
+
(function () { return (0,tslib_es6.__awaiter)(_this, void 0, void 0, function () { return (0,tslib_es6.__generator)(this, function (_a) {
|
|
139
155
|
switch (_a.label) {
|
|
140
156
|
case 0: return [4, this._API.commit(this._callback)];
|
|
141
157
|
case 1: return [2, _a.sent()];
|
|
@@ -163,7 +179,7 @@ var BaseAPI = (function () {
|
|
|
163
179
|
if (_newTarget === BaseAPI) {
|
|
164
180
|
throw new TypeError("Cannot construct BaseAPI instances directly");
|
|
165
181
|
}
|
|
166
|
-
this.currentState = api_constants
|
|
182
|
+
this.currentState = api_constants.global_constants.STATE_NOT_INITIALIZED;
|
|
167
183
|
this.lastErrorCode = "0";
|
|
168
184
|
this.listenerArray = [];
|
|
169
185
|
this._error_codes = error_codes;
|
|
@@ -172,15 +188,21 @@ var BaseAPI = (function () {
|
|
|
172
188
|
}
|
|
173
189
|
this.apiLogLevel = this.settings.logLevel;
|
|
174
190
|
this.selfReportSessionTime = this.settings.selfReportSessionTime;
|
|
191
|
+
if (this.apiLogLevel === undefined) {
|
|
192
|
+
this.apiLogLevel = enums.LogLevelEnum.NONE;
|
|
193
|
+
}
|
|
175
194
|
}
|
|
176
195
|
BaseAPI.prototype.commonReset = function (settings) {
|
|
177
|
-
this.
|
|
178
|
-
this.
|
|
196
|
+
this.apiLog("reset", "Called", enums.LogLevelEnum.INFO);
|
|
197
|
+
this.settings = (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, this.settings), settings);
|
|
198
|
+
this.clearScheduledCommit();
|
|
199
|
+
this.currentState = api_constants.global_constants.STATE_NOT_INITIALIZED;
|
|
179
200
|
this.lastErrorCode = "0";
|
|
180
201
|
this.listenerArray = [];
|
|
202
|
+
this.startingData = undefined;
|
|
181
203
|
};
|
|
182
204
|
BaseAPI.prototype.initialize = function (callbackName, initializeMessage, terminationMessage) {
|
|
183
|
-
var returnValue = api_constants
|
|
205
|
+
var returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
184
206
|
if (this.isInitialized()) {
|
|
185
207
|
this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);
|
|
186
208
|
}
|
|
@@ -191,17 +213,17 @@ var BaseAPI = (function () {
|
|
|
191
213
|
if (this.selfReportSessionTime) {
|
|
192
214
|
this.cmi.setStartTime();
|
|
193
215
|
}
|
|
194
|
-
this.currentState = api_constants
|
|
216
|
+
this.currentState = api_constants.global_constants.STATE_INITIALIZED;
|
|
195
217
|
this.lastErrorCode = "0";
|
|
196
|
-
returnValue = api_constants
|
|
218
|
+
returnValue = api_constants.global_constants.SCORM_TRUE;
|
|
197
219
|
this.processListeners(callbackName);
|
|
198
220
|
}
|
|
199
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
221
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
200
222
|
this.clearSCORMError(returnValue);
|
|
201
223
|
return returnValue;
|
|
202
224
|
};
|
|
203
225
|
BaseAPI.prototype.apiLog = function (functionName, logMessage, messageLevel, CMIElement) {
|
|
204
|
-
logMessage = (0,utilities
|
|
226
|
+
logMessage = (0,utilities.formatMessage)(functionName, logMessage, CMIElement);
|
|
205
227
|
if (messageLevel >= this.apiLogLevel) {
|
|
206
228
|
this.settings.onLogMessage(messageLevel, logMessage);
|
|
207
229
|
}
|
|
@@ -218,20 +240,20 @@ var BaseAPI = (function () {
|
|
|
218
240
|
return this._settings;
|
|
219
241
|
},
|
|
220
242
|
set: function (settings) {
|
|
221
|
-
this._settings = (0,tslib_es6
|
|
243
|
+
this._settings = (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, this._settings), settings);
|
|
222
244
|
},
|
|
223
245
|
enumerable: false,
|
|
224
246
|
configurable: true
|
|
225
247
|
});
|
|
226
248
|
BaseAPI.prototype.terminate = function (callbackName, checkTerminated) {
|
|
227
|
-
return (0,tslib_es6
|
|
249
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
228
250
|
var returnValue, result;
|
|
229
|
-
return (0,tslib_es6
|
|
251
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
230
252
|
switch (_a.label) {
|
|
231
253
|
case 0:
|
|
232
|
-
returnValue = api_constants
|
|
254
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
233
255
|
if (!this.checkState(checkTerminated, this._error_codes.TERMINATION_BEFORE_INIT, this._error_codes.MULTIPLE_TERMINATION)) return [3, 2];
|
|
234
|
-
this.currentState = api_constants
|
|
256
|
+
this.currentState = api_constants.global_constants.STATE_TERMINATED;
|
|
235
257
|
return [4, this.storeData(true)];
|
|
236
258
|
case 1:
|
|
237
259
|
result = _a.sent();
|
|
@@ -241,14 +263,14 @@ var BaseAPI = (function () {
|
|
|
241
263
|
returnValue =
|
|
242
264
|
typeof result !== "undefined" && result.result
|
|
243
265
|
? result.result
|
|
244
|
-
: api_constants
|
|
266
|
+
: api_constants.global_constants.SCORM_FALSE;
|
|
245
267
|
if (checkTerminated)
|
|
246
268
|
this.lastErrorCode = "0";
|
|
247
|
-
returnValue = api_constants
|
|
269
|
+
returnValue = api_constants.global_constants.SCORM_TRUE;
|
|
248
270
|
this.processListeners(callbackName);
|
|
249
271
|
_a.label = 2;
|
|
250
272
|
case 2:
|
|
251
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
273
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
252
274
|
this.clearSCORMError(returnValue);
|
|
253
275
|
return [2, returnValue];
|
|
254
276
|
}
|
|
@@ -268,7 +290,7 @@ var BaseAPI = (function () {
|
|
|
268
290
|
}
|
|
269
291
|
this.processListeners(callbackName, CMIElement);
|
|
270
292
|
}
|
|
271
|
-
this.apiLog(callbackName, ": returned: " + returnValue,
|
|
293
|
+
this.apiLog(callbackName, ": returned: " + returnValue, enums.LogLevelEnum.INFO, CMIElement);
|
|
272
294
|
if (returnValue === undefined) {
|
|
273
295
|
return "";
|
|
274
296
|
}
|
|
@@ -279,7 +301,7 @@ var BaseAPI = (function () {
|
|
|
279
301
|
if (value !== undefined) {
|
|
280
302
|
value = String(value);
|
|
281
303
|
}
|
|
282
|
-
var returnValue = api_constants
|
|
304
|
+
var returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
283
305
|
if (this.checkState(checkTerminated, this._error_codes.STORE_BEFORE_INIT, this._error_codes.STORE_AFTER_TERM)) {
|
|
284
306
|
if (checkTerminated)
|
|
285
307
|
this.lastErrorCode = "0";
|
|
@@ -292,27 +314,26 @@ var BaseAPI = (function () {
|
|
|
292
314
|
this.processListeners(callbackName, CMIElement, value);
|
|
293
315
|
}
|
|
294
316
|
if (returnValue === undefined) {
|
|
295
|
-
returnValue = api_constants
|
|
317
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
296
318
|
}
|
|
297
319
|
if (String(this.lastErrorCode) === "0") {
|
|
298
320
|
if (this.settings.autocommit) {
|
|
299
321
|
this.scheduleCommit(this.settings.autocommitSeconds * 1000, commitCallback);
|
|
300
322
|
}
|
|
301
323
|
}
|
|
302
|
-
this.apiLog(callbackName, ": " + value + ": result: " + returnValue,
|
|
324
|
+
this.apiLog(callbackName, ": " + value + ": result: " + returnValue, enums.LogLevelEnum.INFO, CMIElement);
|
|
303
325
|
this.clearSCORMError(returnValue);
|
|
304
326
|
return returnValue;
|
|
305
327
|
};
|
|
306
328
|
BaseAPI.prototype.commit = function (callbackName_1) {
|
|
307
|
-
return (0,tslib_es6
|
|
329
|
+
return (0,tslib_es6.__awaiter)(this, arguments, void 0, function (callbackName, checkTerminated) {
|
|
308
330
|
var returnValue, result;
|
|
309
331
|
if (checkTerminated === void 0) { checkTerminated = false; }
|
|
310
|
-
return (0,tslib_es6
|
|
332
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
311
333
|
switch (_a.label) {
|
|
312
334
|
case 0:
|
|
313
|
-
console.log("commit");
|
|
314
335
|
this.clearScheduledCommit();
|
|
315
|
-
returnValue = api_constants
|
|
336
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
316
337
|
if (!this.checkState(checkTerminated, this._error_codes.COMMIT_BEFORE_INIT, this._error_codes.COMMIT_AFTER_TERM)) return [3, 2];
|
|
317
338
|
return [4, this.storeData(false)];
|
|
318
339
|
case 1:
|
|
@@ -323,14 +344,14 @@ var BaseAPI = (function () {
|
|
|
323
344
|
returnValue =
|
|
324
345
|
typeof result !== "undefined" && result.result
|
|
325
346
|
? result.result
|
|
326
|
-
: api_constants
|
|
327
|
-
this.apiLog(callbackName, " Result: " + returnValue,
|
|
347
|
+
: api_constants.global_constants.SCORM_FALSE;
|
|
348
|
+
this.apiLog(callbackName, " Result: " + returnValue, enums.LogLevelEnum.DEBUG, "HttpRequest");
|
|
328
349
|
if (checkTerminated)
|
|
329
350
|
this.lastErrorCode = "0";
|
|
330
351
|
this.processListeners(callbackName);
|
|
331
352
|
_a.label = 2;
|
|
332
353
|
case 2:
|
|
333
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
354
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
334
355
|
this.clearSCORMError(returnValue);
|
|
335
356
|
return [2, returnValue];
|
|
336
357
|
}
|
|
@@ -340,7 +361,7 @@ var BaseAPI = (function () {
|
|
|
340
361
|
BaseAPI.prototype.getLastError = function (callbackName) {
|
|
341
362
|
var returnValue = String(this.lastErrorCode);
|
|
342
363
|
this.processListeners(callbackName);
|
|
343
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
364
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
344
365
|
return returnValue;
|
|
345
366
|
};
|
|
346
367
|
BaseAPI.prototype.getErrorString = function (callbackName, CMIErrorCode) {
|
|
@@ -349,7 +370,7 @@ var BaseAPI = (function () {
|
|
|
349
370
|
returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);
|
|
350
371
|
this.processListeners(callbackName);
|
|
351
372
|
}
|
|
352
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
373
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
353
374
|
return returnValue;
|
|
354
375
|
};
|
|
355
376
|
BaseAPI.prototype.getDiagnostic = function (callbackName, CMIErrorCode) {
|
|
@@ -358,7 +379,7 @@ var BaseAPI = (function () {
|
|
|
358
379
|
returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);
|
|
359
380
|
this.processListeners(callbackName);
|
|
360
381
|
}
|
|
361
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
382
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
362
383
|
return returnValue;
|
|
363
384
|
};
|
|
364
385
|
BaseAPI.prototype.checkState = function (checkTerminated, beforeInitError, afterTermError) {
|
|
@@ -384,11 +405,11 @@ var BaseAPI = (function () {
|
|
|
384
405
|
};
|
|
385
406
|
BaseAPI.prototype._commonSetCMIValue = function (methodName, scorm2004, CMIElement, value) {
|
|
386
407
|
if (!CMIElement || CMIElement === "") {
|
|
387
|
-
return api_constants
|
|
408
|
+
return api_constants.global_constants.SCORM_FALSE;
|
|
388
409
|
}
|
|
389
410
|
var structure = CMIElement.split(".");
|
|
390
411
|
var refObject = this;
|
|
391
|
-
var returnValue = api_constants
|
|
412
|
+
var returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
392
413
|
var foundFirstIndex = false;
|
|
393
414
|
var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element.");
|
|
394
415
|
var invalidErrorCode = scorm2004
|
|
@@ -402,20 +423,20 @@ var BaseAPI = (function () {
|
|
|
402
423
|
this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);
|
|
403
424
|
}
|
|
404
425
|
else {
|
|
405
|
-
refObject = (0,tslib_es6
|
|
426
|
+
refObject = (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, refObject), { attribute: value });
|
|
406
427
|
}
|
|
407
428
|
}
|
|
408
429
|
else if (!this._checkObjectHasProperty(refObject, attribute)) {
|
|
409
430
|
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
410
431
|
}
|
|
411
432
|
else {
|
|
412
|
-
if ((0,utilities
|
|
433
|
+
if ((0,utilities.stringMatches)(CMIElement, "\\.correct_responses\\.\\d+") &&
|
|
413
434
|
this.isInitialized()) {
|
|
414
435
|
this.validateCorrectResponse(CMIElement, value);
|
|
415
436
|
}
|
|
416
437
|
if (!scorm2004 || this.lastErrorCode === "0") {
|
|
417
438
|
refObject[attribute] = value;
|
|
418
|
-
returnValue = api_constants
|
|
439
|
+
returnValue = api_constants.global_constants.SCORM_TRUE;
|
|
419
440
|
}
|
|
420
441
|
}
|
|
421
442
|
}
|
|
@@ -425,7 +446,7 @@ var BaseAPI = (function () {
|
|
|
425
446
|
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
426
447
|
break;
|
|
427
448
|
}
|
|
428
|
-
if (refObject instanceof array
|
|
449
|
+
if (refObject instanceof array.CMIArray) {
|
|
429
450
|
var index = parseInt(structure[idx + 1], 10);
|
|
430
451
|
if (!isNaN(index)) {
|
|
431
452
|
var item = refObject.childArray[index];
|
|
@@ -451,8 +472,8 @@ var BaseAPI = (function () {
|
|
|
451
472
|
}
|
|
452
473
|
}
|
|
453
474
|
}
|
|
454
|
-
if (returnValue === api_constants
|
|
455
|
-
this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value),
|
|
475
|
+
if (returnValue === api_constants.global_constants.SCORM_FALSE) {
|
|
476
|
+
this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value), enums.LogLevelEnum.WARN);
|
|
456
477
|
}
|
|
457
478
|
return returnValue;
|
|
458
479
|
};
|
|
@@ -494,7 +515,7 @@ var BaseAPI = (function () {
|
|
|
494
515
|
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
495
516
|
break;
|
|
496
517
|
}
|
|
497
|
-
if (refObject instanceof array
|
|
518
|
+
if (refObject instanceof array.CMIArray) {
|
|
498
519
|
var index = parseInt(structure[idx + 1], 10);
|
|
499
520
|
if (!isNaN(index)) {
|
|
500
521
|
var item = refObject.childArray[index];
|
|
@@ -512,10 +533,10 @@ var BaseAPI = (function () {
|
|
|
512
533
|
if (refObject === null || refObject === undefined) {
|
|
513
534
|
if (!scorm2004) {
|
|
514
535
|
if (attribute === "_children") {
|
|
515
|
-
this.throwSCORMError(
|
|
536
|
+
this.throwSCORMError(this._error_codes.CHILDREN_ERROR);
|
|
516
537
|
}
|
|
517
538
|
else if (attribute === "_count") {
|
|
518
|
-
this.throwSCORMError(
|
|
539
|
+
this.throwSCORMError(this._error_codes.COUNT_ERROR);
|
|
519
540
|
}
|
|
520
541
|
}
|
|
521
542
|
}
|
|
@@ -524,13 +545,13 @@ var BaseAPI = (function () {
|
|
|
524
545
|
}
|
|
525
546
|
};
|
|
526
547
|
BaseAPI.prototype.isInitialized = function () {
|
|
527
|
-
return this.currentState === api_constants
|
|
548
|
+
return this.currentState === api_constants.global_constants.STATE_INITIALIZED;
|
|
528
549
|
};
|
|
529
550
|
BaseAPI.prototype.isNotInitialized = function () {
|
|
530
|
-
return this.currentState === api_constants
|
|
551
|
+
return this.currentState === api_constants.global_constants.STATE_NOT_INITIALIZED;
|
|
531
552
|
};
|
|
532
553
|
BaseAPI.prototype.isTerminated = function () {
|
|
533
|
-
return this.currentState === api_constants
|
|
554
|
+
return this.currentState === api_constants.global_constants.STATE_TERMINATED;
|
|
534
555
|
};
|
|
535
556
|
BaseAPI.prototype.on = function (listenerName, callback) {
|
|
536
557
|
if (!callback)
|
|
@@ -550,7 +571,7 @@ var BaseAPI = (function () {
|
|
|
550
571
|
CMIElement: CMIElement,
|
|
551
572
|
callback: callback,
|
|
552
573
|
});
|
|
553
|
-
this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length),
|
|
574
|
+
this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), enums.LogLevelEnum.INFO, functionName);
|
|
554
575
|
}
|
|
555
576
|
};
|
|
556
577
|
BaseAPI.prototype.off = function (listenerName, callback) {
|
|
@@ -573,7 +594,7 @@ var BaseAPI = (function () {
|
|
|
573
594
|
});
|
|
574
595
|
if (removeIndex !== -1) {
|
|
575
596
|
this_1.listenerArray.splice(removeIndex, 1);
|
|
576
|
-
this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length),
|
|
597
|
+
this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), enums.LogLevelEnum.INFO, functionName);
|
|
577
598
|
}
|
|
578
599
|
};
|
|
579
600
|
var this_1 = this;
|
|
@@ -606,7 +627,7 @@ var BaseAPI = (function () {
|
|
|
606
627
|
}
|
|
607
628
|
};
|
|
608
629
|
BaseAPI.prototype.processListeners = function (functionName, CMIElement, value) {
|
|
609
|
-
this.apiLog(functionName, value,
|
|
630
|
+
this.apiLog(functionName, value, enums.LogLevelEnum.INFO, CMIElement);
|
|
610
631
|
for (var i = 0; i < this.listenerArray.length; i++) {
|
|
611
632
|
var listener = this.listenerArray[i];
|
|
612
633
|
var functionsMatch = listener.functionName === functionName;
|
|
@@ -622,7 +643,7 @@ var BaseAPI = (function () {
|
|
|
622
643
|
CMIElementsMatch = listener.CMIElement === CMIElement;
|
|
623
644
|
}
|
|
624
645
|
if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {
|
|
625
|
-
this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName),
|
|
646
|
+
this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), enums.LogLevelEnum.INFO, CMIElement);
|
|
626
647
|
listener.callback(CMIElement, value);
|
|
627
648
|
}
|
|
628
649
|
}
|
|
@@ -631,11 +652,11 @@ var BaseAPI = (function () {
|
|
|
631
652
|
if (!message) {
|
|
632
653
|
message = this.getLmsErrorMessageDetails(errorNumber);
|
|
633
654
|
}
|
|
634
|
-
this.apiLog("throwSCORMError", errorNumber + ": " + message,
|
|
655
|
+
this.apiLog("throwSCORMError", errorNumber + ": " + message, enums.LogLevelEnum.ERROR);
|
|
635
656
|
this.lastErrorCode = String(errorNumber);
|
|
636
657
|
};
|
|
637
658
|
BaseAPI.prototype.clearSCORMError = function (success) {
|
|
638
|
-
if (success !== undefined && success !== api_constants
|
|
659
|
+
if (success !== undefined && success !== api_constants.global_constants.SCORM_FALSE) {
|
|
639
660
|
this.lastErrorCode = "0";
|
|
640
661
|
}
|
|
641
662
|
};
|
|
@@ -701,7 +722,7 @@ var BaseAPI = (function () {
|
|
|
701
722
|
result.forEach(function (element) {
|
|
702
723
|
obj = {};
|
|
703
724
|
obj[element[0]] = element[1];
|
|
704
|
-
_this.loadFromJSON((0,utilities
|
|
725
|
+
_this.loadFromJSON((0,utilities.unflatten)(obj), CMIElement);
|
|
705
726
|
});
|
|
706
727
|
};
|
|
707
728
|
BaseAPI.prototype.loadFromJSON = function (json, CMIElement) {
|
|
@@ -741,21 +762,21 @@ var BaseAPI = (function () {
|
|
|
741
762
|
return JSON.parse(this.renderCMIToJSONString());
|
|
742
763
|
};
|
|
743
764
|
BaseAPI.prototype.processHttpRequest = function (url_1, params_1) {
|
|
744
|
-
return (0,tslib_es6
|
|
765
|
+
return (0,tslib_es6.__awaiter)(this, arguments, void 0, function (url, params, immediate) {
|
|
745
766
|
var api, genericError, process;
|
|
746
767
|
var _this = this;
|
|
747
768
|
if (immediate === void 0) { immediate = false; }
|
|
748
|
-
return (0,tslib_es6
|
|
769
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
749
770
|
switch (_a.label) {
|
|
750
771
|
case 0:
|
|
751
772
|
api = this;
|
|
752
773
|
genericError = {
|
|
753
|
-
result: api_constants
|
|
774
|
+
result: api_constants.global_constants.SCORM_FALSE,
|
|
754
775
|
errorCode: this.error_codes.GENERAL,
|
|
755
776
|
};
|
|
756
777
|
if (immediate) {
|
|
757
|
-
this.performFetch(url, params).then(function (response) { return (0,tslib_es6
|
|
758
|
-
return (0,tslib_es6
|
|
778
|
+
this.performFetch(url, params).then(function (response) { return (0,tslib_es6.__awaiter)(_this, void 0, void 0, function () {
|
|
779
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
759
780
|
switch (_a.label) {
|
|
760
781
|
case 0: return [4, this.transformResponse(response)];
|
|
761
782
|
case 1:
|
|
@@ -765,13 +786,13 @@ var BaseAPI = (function () {
|
|
|
765
786
|
});
|
|
766
787
|
}); });
|
|
767
788
|
return [2, {
|
|
768
|
-
result: api_constants
|
|
789
|
+
result: api_constants.global_constants.SCORM_TRUE,
|
|
769
790
|
errorCode: 0,
|
|
770
791
|
}];
|
|
771
792
|
}
|
|
772
|
-
process = function (url, params, settings) { return (0,tslib_es6
|
|
793
|
+
process = function (url, params, settings) { return (0,tslib_es6.__awaiter)(_this, void 0, void 0, function () {
|
|
773
794
|
var response, e_1;
|
|
774
|
-
return (0,tslib_es6
|
|
795
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
775
796
|
switch (_a.label) {
|
|
776
797
|
case 0:
|
|
777
798
|
_a.trys.push([0, 2, , 3]);
|
|
@@ -782,7 +803,7 @@ var BaseAPI = (function () {
|
|
|
782
803
|
return [2, this.transformResponse(response)];
|
|
783
804
|
case 2:
|
|
784
805
|
e_1 = _a.sent();
|
|
785
|
-
this.apiLog("processHttpRequest", e_1,
|
|
806
|
+
this.apiLog("processHttpRequest", e_1, enums.LogLevelEnum.ERROR);
|
|
786
807
|
api.processListeners("CommitError");
|
|
787
808
|
return [2, genericError];
|
|
788
809
|
case 3: return [2];
|
|
@@ -798,14 +819,14 @@ var BaseAPI = (function () {
|
|
|
798
819
|
BaseAPI.prototype.scheduleCommit = function (when, callback) {
|
|
799
820
|
if (!this._timeout) {
|
|
800
821
|
this._timeout = new ScheduledCommit(this, when, callback);
|
|
801
|
-
this.apiLog("scheduleCommit", "scheduled",
|
|
822
|
+
this.apiLog("scheduleCommit", "scheduled", enums.LogLevelEnum.DEBUG, "");
|
|
802
823
|
}
|
|
803
824
|
};
|
|
804
825
|
BaseAPI.prototype.clearScheduledCommit = function () {
|
|
805
826
|
if (this._timeout) {
|
|
806
827
|
this._timeout.cancel();
|
|
807
828
|
this._timeout = undefined;
|
|
808
|
-
this.apiLog("clearScheduledCommit", "cleared",
|
|
829
|
+
this.apiLog("clearScheduledCommit", "cleared", enums.LogLevelEnum.DEBUG, "");
|
|
809
830
|
}
|
|
810
831
|
};
|
|
811
832
|
BaseAPI.prototype._checkObjectHasProperty = function (refObject, attribute) {
|
|
@@ -814,9 +835,9 @@ var BaseAPI = (function () {
|
|
|
814
835
|
attribute in refObject);
|
|
815
836
|
};
|
|
816
837
|
BaseAPI.prototype.handleValueAccessException = function (e, returnValue) {
|
|
817
|
-
if (e instanceof exceptions
|
|
838
|
+
if (e instanceof exceptions.ValidationError) {
|
|
818
839
|
this.lastErrorCode = String(e.errorCode);
|
|
819
|
-
returnValue = api_constants
|
|
840
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
820
841
|
}
|
|
821
842
|
else {
|
|
822
843
|
if (e instanceof Error && e.message) {
|
|
@@ -834,20 +855,20 @@ var BaseAPI = (function () {
|
|
|
834
855
|
var commitObject = this.settings.renderCommonCommitFields
|
|
835
856
|
? this.renderCommitObject(shouldTerminateCommit)
|
|
836
857
|
: this.renderCommitCMI(shouldTerminateCommit);
|
|
837
|
-
if (
|
|
858
|
+
if ([enums.LogLevelEnum.DEBUG, "1", 1, "DEBUG"].includes(this.apiLogLevel)) {
|
|
838
859
|
console.debug("Commit (terminated: " + (terminateCommit ? "yes" : "no") + "): ");
|
|
839
860
|
console.debug(commitObject);
|
|
840
861
|
}
|
|
841
862
|
return commitObject;
|
|
842
863
|
};
|
|
843
864
|
BaseAPI.prototype.performFetch = function (url, params) {
|
|
844
|
-
return (0,tslib_es6
|
|
845
|
-
return (0,tslib_es6
|
|
865
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
866
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
846
867
|
return [2, fetch(url, {
|
|
847
868
|
method: "POST",
|
|
848
869
|
mode: this.settings.fetchMode,
|
|
849
870
|
body: params instanceof Array ? params.join("&") : JSON.stringify(params),
|
|
850
|
-
headers: (0,tslib_es6
|
|
871
|
+
headers: (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, this.settings.xhrHeaders), { "Content-Type": this.settings.commitRequestDataType }),
|
|
851
872
|
credentials: this.settings.xhrWithCredentials ? "include" : undefined,
|
|
852
873
|
keepalive: true,
|
|
853
874
|
})];
|
|
@@ -855,9 +876,9 @@ var BaseAPI = (function () {
|
|
|
855
876
|
});
|
|
856
877
|
};
|
|
857
878
|
BaseAPI.prototype.transformResponse = function (response) {
|
|
858
|
-
return (0,tslib_es6
|
|
879
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
859
880
|
var result, _a;
|
|
860
|
-
return (0,tslib_es6
|
|
881
|
+
return (0,tslib_es6.__generator)(this, function (_c) {
|
|
861
882
|
switch (_c.label) {
|
|
862
883
|
case 0:
|
|
863
884
|
if (!(typeof this.settings.responseHandler === "function")) return [3, 2];
|
|
@@ -873,8 +894,7 @@ var BaseAPI = (function () {
|
|
|
873
894
|
result = _a;
|
|
874
895
|
if (response.status >= 200 &&
|
|
875
896
|
response.status <= 299 &&
|
|
876
|
-
(result.result === true ||
|
|
877
|
-
result.result === api_constants/* default */.A.global.SCORM_TRUE)) {
|
|
897
|
+
(result.result === true || result.result === api_constants.global_constants.SCORM_TRUE)) {
|
|
878
898
|
this.processListeners("CommitSuccess");
|
|
879
899
|
}
|
|
880
900
|
else {
|
|
@@ -895,29 +915,40 @@ var BaseAPI = (function () {
|
|
|
895
915
|
/***/ 589:
|
|
896
916
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
897
917
|
|
|
918
|
+
__webpack_require__.r(__webpack_exports__);
|
|
898
919
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
899
|
-
/* harmony export */
|
|
920
|
+
/* harmony export */ CMIArray: function() { return /* binding */ CMIArray; }
|
|
900
921
|
/* harmony export */ });
|
|
901
|
-
/* unused harmony export scorm12_error_codes */
|
|
902
922
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635);
|
|
903
923
|
/* harmony import */ var _base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
904
|
-
/* harmony import */ var
|
|
905
|
-
/* harmony import */ var
|
|
924
|
+
/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(784);
|
|
925
|
+
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(797);
|
|
906
926
|
|
|
907
927
|
|
|
908
928
|
|
|
909
929
|
|
|
910
|
-
var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12;
|
|
911
930
|
var CMIArray = (function (_super) {
|
|
912
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_3__
|
|
931
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_3__.__extends)(CMIArray, _super);
|
|
913
932
|
function CMIArray(params) {
|
|
914
933
|
var _this = _super.call(this) || this;
|
|
915
934
|
_this.__children = params.children;
|
|
916
|
-
_this._errorCode = params.errorCode ||
|
|
917
|
-
_this._errorClass = params.errorClass ||
|
|
935
|
+
_this._errorCode = params.errorCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.GENERAL;
|
|
936
|
+
_this._errorClass = params.errorClass || _exceptions__WEBPACK_IMPORTED_MODULE_1__.BaseScormValidationError;
|
|
918
937
|
_this.childArray = [];
|
|
919
938
|
return _this;
|
|
920
939
|
}
|
|
940
|
+
CMIArray.prototype.reset = function (wipe) {
|
|
941
|
+
if (wipe === void 0) { wipe = false; }
|
|
942
|
+
this._initialized = false;
|
|
943
|
+
if (wipe) {
|
|
944
|
+
this.childArray = [];
|
|
945
|
+
}
|
|
946
|
+
else {
|
|
947
|
+
for (var i = 0; i < this.childArray.length; i++) {
|
|
948
|
+
this.childArray[i].reset();
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
};
|
|
921
952
|
Object.defineProperty(CMIArray.prototype, "_children", {
|
|
922
953
|
get: function () {
|
|
923
954
|
return this.__children;
|
|
@@ -948,7 +979,7 @@ var CMIArray = (function (_super) {
|
|
|
948
979
|
return result;
|
|
949
980
|
};
|
|
950
981
|
return CMIArray;
|
|
951
|
-
}(_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
982
|
+
}(_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
952
983
|
|
|
953
984
|
|
|
954
985
|
|
|
@@ -957,9 +988,10 @@ var CMIArray = (function (_super) {
|
|
|
957
988
|
/***/ 319:
|
|
958
989
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
959
990
|
|
|
991
|
+
__webpack_require__.r(__webpack_exports__);
|
|
960
992
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
961
|
-
/* harmony export */
|
|
962
|
-
/* harmony export */
|
|
993
|
+
/* harmony export */ BaseCMI: function() { return /* binding */ BaseCMI; },
|
|
994
|
+
/* harmony export */ BaseRootCMI: function() { return /* binding */ BaseRootCMI; }
|
|
963
995
|
/* harmony export */ });
|
|
964
996
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
965
997
|
|
|
@@ -992,7 +1024,7 @@ var BaseCMI = (function () {
|
|
|
992
1024
|
}());
|
|
993
1025
|
|
|
994
1026
|
var BaseRootCMI = (function (_super) {
|
|
995
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_0__
|
|
1027
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(BaseRootCMI, _super);
|
|
996
1028
|
function BaseRootCMI() {
|
|
997
1029
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
998
1030
|
}
|
|
@@ -1006,10 +1038,10 @@ var BaseRootCMI = (function (_super) {
|
|
|
1006
1038
|
/***/ 434:
|
|
1007
1039
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1008
1040
|
|
|
1041
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1009
1042
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1010
|
-
/* harmony export */
|
|
1043
|
+
/* harmony export */ CMIScore: function() { return /* binding */ CMIScore; }
|
|
1011
1044
|
/* harmony export */ });
|
|
1012
|
-
/* unused harmony export scorm12_error_codes */
|
|
1013
1045
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635);
|
|
1014
1046
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340);
|
|
1015
1047
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(417);
|
|
@@ -1022,30 +1054,30 @@ var BaseRootCMI = (function (_super) {
|
|
|
1022
1054
|
|
|
1023
1055
|
|
|
1024
1056
|
|
|
1025
|
-
var scorm12_constants = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12;
|
|
1026
|
-
var scorm12_regex = _constants_regex__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12;
|
|
1027
|
-
var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12;
|
|
1028
1057
|
var CMIScore = (function (_super) {
|
|
1029
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_4__
|
|
1058
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_4__.__extends)(CMIScore, _super);
|
|
1030
1059
|
function CMIScore(params) {
|
|
1031
1060
|
var _this = _super.call(this) || this;
|
|
1032
1061
|
_this._raw = "";
|
|
1033
1062
|
_this._min = "";
|
|
1034
|
-
_this.__children = params.score_children || scorm12_constants.score_children;
|
|
1063
|
+
_this.__children = params.score_children || _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__.scorm12_constants.score_children;
|
|
1035
1064
|
_this.__score_range = !params.score_range
|
|
1036
1065
|
? false
|
|
1037
|
-
: scorm12_regex.score_range;
|
|
1066
|
+
: _constants_regex__WEBPACK_IMPORTED_MODULE_1__.scorm12_regex.score_range;
|
|
1038
1067
|
_this._max = params.max || params.max === "" ? params.max : "100";
|
|
1039
1068
|
_this.__invalid_error_code =
|
|
1040
|
-
params.invalidErrorCode ||
|
|
1069
|
+
params.invalidErrorCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.INVALID_SET_VALUE;
|
|
1041
1070
|
_this.__invalid_type_code =
|
|
1042
|
-
params.invalidTypeCode ||
|
|
1071
|
+
params.invalidTypeCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.TYPE_MISMATCH;
|
|
1043
1072
|
_this.__invalid_range_code =
|
|
1044
|
-
params.invalidRangeCode ||
|
|
1045
|
-
_this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;
|
|
1073
|
+
params.invalidRangeCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.VALUE_OUT_OF_RANGE;
|
|
1074
|
+
_this.__decimal_regex = params.decimalRegex || _constants_regex__WEBPACK_IMPORTED_MODULE_1__.scorm12_regex.CMIDecimal;
|
|
1046
1075
|
_this.__error_class = params.errorClass;
|
|
1047
1076
|
return _this;
|
|
1048
1077
|
}
|
|
1078
|
+
CMIScore.prototype.reset = function () {
|
|
1079
|
+
this._initialized = false;
|
|
1080
|
+
};
|
|
1049
1081
|
Object.defineProperty(CMIScore.prototype, "_children", {
|
|
1050
1082
|
get: function () {
|
|
1051
1083
|
return this.__children;
|
|
@@ -1061,9 +1093,9 @@ var CMIScore = (function (_super) {
|
|
|
1061
1093
|
return this._raw;
|
|
1062
1094
|
},
|
|
1063
1095
|
set: function (raw) {
|
|
1064
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1096
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidFormat)(raw, this.__decimal_regex, this.__invalid_type_code, this.__error_class) &&
|
|
1065
1097
|
(!this.__score_range ||
|
|
1066
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1098
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidRange)(raw, this.__score_range, this.__invalid_range_code, this.__error_class))) {
|
|
1067
1099
|
this._raw = raw;
|
|
1068
1100
|
}
|
|
1069
1101
|
},
|
|
@@ -1075,9 +1107,9 @@ var CMIScore = (function (_super) {
|
|
|
1075
1107
|
return this._min;
|
|
1076
1108
|
},
|
|
1077
1109
|
set: function (min) {
|
|
1078
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1110
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidFormat)(min, this.__decimal_regex, this.__invalid_type_code, this.__error_class) &&
|
|
1079
1111
|
(!this.__score_range ||
|
|
1080
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1112
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidRange)(min, this.__score_range, this.__invalid_range_code, this.__error_class))) {
|
|
1081
1113
|
this._min = min;
|
|
1082
1114
|
}
|
|
1083
1115
|
},
|
|
@@ -1089,9 +1121,9 @@ var CMIScore = (function (_super) {
|
|
|
1089
1121
|
return this._max;
|
|
1090
1122
|
},
|
|
1091
1123
|
set: function (max) {
|
|
1092
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1124
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidFormat)(max, this.__decimal_regex, this.__invalid_type_code, this.__error_class) &&
|
|
1093
1125
|
(!this.__score_range ||
|
|
1094
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1126
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidRange)(max, this.__score_range, this.__invalid_range_code, this.__error_class))) {
|
|
1095
1127
|
this._max = max;
|
|
1096
1128
|
}
|
|
1097
1129
|
},
|
|
@@ -1109,7 +1141,7 @@ var CMIScore = (function (_super) {
|
|
|
1109
1141
|
return result;
|
|
1110
1142
|
};
|
|
1111
1143
|
return CMIScore;
|
|
1112
|
-
}(_base_cmi__WEBPACK_IMPORTED_MODULE_2__
|
|
1144
|
+
}(_base_cmi__WEBPACK_IMPORTED_MODULE_2__.BaseCMI));
|
|
1113
1145
|
|
|
1114
1146
|
|
|
1115
1147
|
|
|
@@ -1118,9 +1150,10 @@ var CMIScore = (function (_super) {
|
|
|
1118
1150
|
/***/ 449:
|
|
1119
1151
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1120
1152
|
|
|
1153
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1121
1154
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1122
|
-
/* harmony export */
|
|
1123
|
-
/* harmony export */
|
|
1155
|
+
/* harmony export */ checkValidFormat: function() { return /* binding */ checkValidFormat; },
|
|
1156
|
+
/* harmony export */ checkValidRange: function() { return /* binding */ checkValidRange; }
|
|
1124
1157
|
/* harmony export */ });
|
|
1125
1158
|
function checkValidFormat(value, regexPattern, errorCode, errorClass, allowEmptyString) {
|
|
1126
1159
|
if (typeof value !== "string") {
|
|
@@ -1158,10 +1191,12 @@ function checkValidRange(value, rangePattern, errorCode, errorClass) {
|
|
|
1158
1191
|
/***/ 989:
|
|
1159
1192
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1160
1193
|
|
|
1194
|
+
// ESM COMPAT FLAG
|
|
1195
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1161
1196
|
|
|
1162
1197
|
// EXPORTS
|
|
1163
1198
|
__webpack_require__.d(__webpack_exports__, {
|
|
1164
|
-
|
|
1199
|
+
CMI: function() { return /* binding */ CMI; }
|
|
1165
1200
|
});
|
|
1166
1201
|
|
|
1167
1202
|
// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs
|
|
@@ -1172,8 +1207,8 @@ var api_constants = __webpack_require__(340);
|
|
|
1172
1207
|
var error_codes = __webpack_require__(797);
|
|
1173
1208
|
// EXTERNAL MODULE: ./src/constants/regex.ts
|
|
1174
1209
|
var regex = __webpack_require__(417);
|
|
1175
|
-
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
1176
|
-
var
|
|
1210
|
+
// EXTERNAL MODULE: ./src/exceptions/scorm12_exceptions.ts
|
|
1211
|
+
var scorm12_exceptions = __webpack_require__(179);
|
|
1177
1212
|
// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts
|
|
1178
1213
|
var base_cmi = __webpack_require__(319);
|
|
1179
1214
|
// EXTERNAL MODULE: ./src/cmi/scorm12/validation.ts
|
|
@@ -1193,10 +1228,10 @@ var utilities = __webpack_require__(864);
|
|
|
1193
1228
|
|
|
1194
1229
|
|
|
1195
1230
|
var CMICore = (function (_super) {
|
|
1196
|
-
(0,tslib_es6
|
|
1231
|
+
(0,tslib_es6.__extends)(CMICore, _super);
|
|
1197
1232
|
function CMICore() {
|
|
1198
1233
|
var _this = _super.call(this) || this;
|
|
1199
|
-
_this.__children = api_constants
|
|
1234
|
+
_this.__children = api_constants.scorm12_constants.core_children;
|
|
1200
1235
|
_this._student_id = "";
|
|
1201
1236
|
_this._student_name = "";
|
|
1202
1237
|
_this._lesson_location = "";
|
|
@@ -1208,13 +1243,13 @@ var CMICore = (function (_super) {
|
|
|
1208
1243
|
_this._exit = "";
|
|
1209
1244
|
_this._session_time = "00:00:00";
|
|
1210
1245
|
_this._suspend_data = "";
|
|
1211
|
-
_this.score = new score
|
|
1212
|
-
score_children: api_constants
|
|
1213
|
-
score_range: regex
|
|
1214
|
-
invalidErrorCode: error_codes
|
|
1215
|
-
invalidTypeCode: error_codes
|
|
1216
|
-
invalidRangeCode: error_codes
|
|
1217
|
-
errorClass:
|
|
1246
|
+
_this.score = new score.CMIScore({
|
|
1247
|
+
score_children: api_constants.scorm12_constants.score_children,
|
|
1248
|
+
score_range: regex.scorm12_regex.score_range,
|
|
1249
|
+
invalidErrorCode: error_codes.scorm12_errors.INVALID_SET_VALUE,
|
|
1250
|
+
invalidTypeCode: error_codes.scorm12_errors.TYPE_MISMATCH,
|
|
1251
|
+
invalidRangeCode: error_codes.scorm12_errors.VALUE_OUT_OF_RANGE,
|
|
1252
|
+
errorClass: scorm12_exceptions.Scorm12ValidationError,
|
|
1218
1253
|
});
|
|
1219
1254
|
return _this;
|
|
1220
1255
|
}
|
|
@@ -1223,12 +1258,20 @@ var CMICore = (function (_super) {
|
|
|
1223
1258
|
_super.prototype.initialize.call(this);
|
|
1224
1259
|
(_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
1225
1260
|
};
|
|
1261
|
+
CMICore.prototype.reset = function () {
|
|
1262
|
+
var _a;
|
|
1263
|
+
this._initialized = false;
|
|
1264
|
+
this._exit = "";
|
|
1265
|
+
this._entry = "";
|
|
1266
|
+
this._session_time = "00:00:00";
|
|
1267
|
+
(_a = this.score) === null || _a === void 0 ? void 0 : _a.reset();
|
|
1268
|
+
};
|
|
1226
1269
|
Object.defineProperty(CMICore.prototype, "_children", {
|
|
1227
1270
|
get: function () {
|
|
1228
1271
|
return this.__children;
|
|
1229
1272
|
},
|
|
1230
1273
|
set: function (_children) {
|
|
1231
|
-
throw new
|
|
1274
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
1232
1275
|
},
|
|
1233
1276
|
enumerable: false,
|
|
1234
1277
|
configurable: true
|
|
@@ -1239,7 +1282,7 @@ var CMICore = (function (_super) {
|
|
|
1239
1282
|
},
|
|
1240
1283
|
set: function (student_id) {
|
|
1241
1284
|
if (this.initialized) {
|
|
1242
|
-
throw new
|
|
1285
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1243
1286
|
}
|
|
1244
1287
|
else {
|
|
1245
1288
|
this._student_id = student_id;
|
|
@@ -1254,7 +1297,7 @@ var CMICore = (function (_super) {
|
|
|
1254
1297
|
},
|
|
1255
1298
|
set: function (student_name) {
|
|
1256
1299
|
if (this.initialized) {
|
|
1257
|
-
throw new
|
|
1300
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1258
1301
|
}
|
|
1259
1302
|
else {
|
|
1260
1303
|
this._student_name = student_name;
|
|
@@ -1268,7 +1311,7 @@ var CMICore = (function (_super) {
|
|
|
1268
1311
|
return this._lesson_location;
|
|
1269
1312
|
},
|
|
1270
1313
|
set: function (lesson_location) {
|
|
1271
|
-
if ((0,validation
|
|
1314
|
+
if ((0,validation.check12ValidFormat)(lesson_location, regex.scorm12_regex.CMIString256, true)) {
|
|
1272
1315
|
this._lesson_location = lesson_location;
|
|
1273
1316
|
}
|
|
1274
1317
|
},
|
|
@@ -1281,7 +1324,7 @@ var CMICore = (function (_super) {
|
|
|
1281
1324
|
},
|
|
1282
1325
|
set: function (credit) {
|
|
1283
1326
|
if (this.initialized) {
|
|
1284
|
-
throw new
|
|
1327
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1285
1328
|
}
|
|
1286
1329
|
else {
|
|
1287
1330
|
this._credit = credit;
|
|
@@ -1296,12 +1339,12 @@ var CMICore = (function (_super) {
|
|
|
1296
1339
|
},
|
|
1297
1340
|
set: function (lesson_status) {
|
|
1298
1341
|
if (this.initialized) {
|
|
1299
|
-
if ((0,validation
|
|
1342
|
+
if ((0,validation.check12ValidFormat)(lesson_status, regex.scorm12_regex.CMIStatus)) {
|
|
1300
1343
|
this._lesson_status = lesson_status;
|
|
1301
1344
|
}
|
|
1302
1345
|
}
|
|
1303
1346
|
else {
|
|
1304
|
-
if ((0,validation
|
|
1347
|
+
if ((0,validation.check12ValidFormat)(lesson_status, regex.scorm12_regex.CMIStatus2)) {
|
|
1305
1348
|
this._lesson_status = lesson_status;
|
|
1306
1349
|
}
|
|
1307
1350
|
}
|
|
@@ -1315,7 +1358,7 @@ var CMICore = (function (_super) {
|
|
|
1315
1358
|
},
|
|
1316
1359
|
set: function (entry) {
|
|
1317
1360
|
if (this.initialized) {
|
|
1318
|
-
throw new
|
|
1361
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1319
1362
|
}
|
|
1320
1363
|
else {
|
|
1321
1364
|
this._entry = entry;
|
|
@@ -1330,7 +1373,7 @@ var CMICore = (function (_super) {
|
|
|
1330
1373
|
},
|
|
1331
1374
|
set: function (total_time) {
|
|
1332
1375
|
if (this.initialized) {
|
|
1333
|
-
throw new
|
|
1376
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1334
1377
|
}
|
|
1335
1378
|
else {
|
|
1336
1379
|
this._total_time = total_time;
|
|
@@ -1345,7 +1388,7 @@ var CMICore = (function (_super) {
|
|
|
1345
1388
|
},
|
|
1346
1389
|
set: function (lesson_mode) {
|
|
1347
1390
|
if (this.initialized) {
|
|
1348
|
-
throw new
|
|
1391
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1349
1392
|
}
|
|
1350
1393
|
else {
|
|
1351
1394
|
this._lesson_mode = lesson_mode;
|
|
@@ -1357,12 +1400,12 @@ var CMICore = (function (_super) {
|
|
|
1357
1400
|
Object.defineProperty(CMICore.prototype, "exit", {
|
|
1358
1401
|
get: function () {
|
|
1359
1402
|
if (!this.jsonString) {
|
|
1360
|
-
throw new
|
|
1403
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1361
1404
|
}
|
|
1362
1405
|
return this._exit;
|
|
1363
1406
|
},
|
|
1364
1407
|
set: function (exit) {
|
|
1365
|
-
if ((0,validation
|
|
1408
|
+
if ((0,validation.check12ValidFormat)(exit, regex.scorm12_regex.CMIExit, true)) {
|
|
1366
1409
|
this._exit = exit;
|
|
1367
1410
|
}
|
|
1368
1411
|
},
|
|
@@ -1372,12 +1415,12 @@ var CMICore = (function (_super) {
|
|
|
1372
1415
|
Object.defineProperty(CMICore.prototype, "session_time", {
|
|
1373
1416
|
get: function () {
|
|
1374
1417
|
if (!this.jsonString) {
|
|
1375
|
-
throw new
|
|
1418
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1376
1419
|
}
|
|
1377
1420
|
return this._session_time;
|
|
1378
1421
|
},
|
|
1379
1422
|
set: function (session_time) {
|
|
1380
|
-
if ((0,validation
|
|
1423
|
+
if ((0,validation.check12ValidFormat)(session_time, regex.scorm12_regex.CMITimespan)) {
|
|
1381
1424
|
this._session_time = session_time;
|
|
1382
1425
|
}
|
|
1383
1426
|
},
|
|
@@ -1389,7 +1432,7 @@ var CMICore = (function (_super) {
|
|
|
1389
1432
|
return this._suspend_data;
|
|
1390
1433
|
},
|
|
1391
1434
|
set: function (suspend_data) {
|
|
1392
|
-
if ((0,validation
|
|
1435
|
+
if ((0,validation.check12ValidFormat)(suspend_data, regex.scorm12_regex.CMIString4096, true)) {
|
|
1393
1436
|
this._suspend_data = suspend_data;
|
|
1394
1437
|
}
|
|
1395
1438
|
},
|
|
@@ -1401,9 +1444,9 @@ var CMICore = (function (_super) {
|
|
|
1401
1444
|
var startTime = start_time;
|
|
1402
1445
|
if (typeof startTime !== "undefined" && startTime !== null) {
|
|
1403
1446
|
var seconds = new Date().getTime() - startTime;
|
|
1404
|
-
sessionTime = utilities
|
|
1447
|
+
sessionTime = utilities.getSecondsAsHHMMSS(seconds / 1000);
|
|
1405
1448
|
}
|
|
1406
|
-
return utilities
|
|
1449
|
+
return utilities.addHHMMSSTimeStrings(this._total_time, sessionTime, new RegExp(regex.scorm12_regex.CMITimespan));
|
|
1407
1450
|
};
|
|
1408
1451
|
CMICore.prototype.toJSON = function () {
|
|
1409
1452
|
this.jsonString = true;
|
|
@@ -1423,7 +1466,7 @@ var CMICore = (function (_super) {
|
|
|
1423
1466
|
return result;
|
|
1424
1467
|
};
|
|
1425
1468
|
return CMICore;
|
|
1426
|
-
}(base_cmi
|
|
1469
|
+
}(base_cmi.BaseCMI));
|
|
1427
1470
|
|
|
1428
1471
|
|
|
1429
1472
|
// EXTERNAL MODULE: ./src/cmi/scorm12/objectives.ts
|
|
@@ -1448,7 +1491,7 @@ var interactions = __webpack_require__(833);
|
|
|
1448
1491
|
|
|
1449
1492
|
|
|
1450
1493
|
var CMI = (function (_super) {
|
|
1451
|
-
(0,tslib_es6
|
|
1494
|
+
(0,tslib_es6.__extends)(CMI, _super);
|
|
1452
1495
|
function CMI(cmi_children, student_data, initialized) {
|
|
1453
1496
|
var _this = _super.call(this) || this;
|
|
1454
1497
|
_this.__children = "";
|
|
@@ -1460,14 +1503,25 @@ var CMI = (function (_super) {
|
|
|
1460
1503
|
_this.initialize();
|
|
1461
1504
|
_this.__children = cmi_children
|
|
1462
1505
|
? cmi_children
|
|
1463
|
-
: api_constants
|
|
1506
|
+
: api_constants.scorm12_constants.cmi_children;
|
|
1464
1507
|
_this.core = new CMICore();
|
|
1465
|
-
_this.objectives = new objectives
|
|
1466
|
-
_this.student_data = student_data ? student_data : new scorm12_student_data
|
|
1467
|
-
_this.student_preference = new student_preference
|
|
1468
|
-
_this.interactions = new interactions
|
|
1508
|
+
_this.objectives = new objectives.CMIObjectives();
|
|
1509
|
+
_this.student_data = student_data ? student_data : new scorm12_student_data.CMIStudentData();
|
|
1510
|
+
_this.student_preference = new student_preference.CMIStudentPreference();
|
|
1511
|
+
_this.interactions = new interactions.CMIInteractions();
|
|
1469
1512
|
return _this;
|
|
1470
1513
|
}
|
|
1514
|
+
CMI.prototype.reset = function () {
|
|
1515
|
+
var _a, _b, _c;
|
|
1516
|
+
this._initialized = false;
|
|
1517
|
+
this._launch_data = "";
|
|
1518
|
+
this._comments = "";
|
|
1519
|
+
(_a = this.core) === null || _a === void 0 ? void 0 : _a.reset();
|
|
1520
|
+
this.objectives = new objectives.CMIObjectives();
|
|
1521
|
+
this.interactions = new interactions.CMIInteractions();
|
|
1522
|
+
(_b = this.student_data) === null || _b === void 0 ? void 0 : _b.reset();
|
|
1523
|
+
(_c = this.student_preference) === null || _c === void 0 ? void 0 : _c.reset();
|
|
1524
|
+
};
|
|
1471
1525
|
CMI.prototype.initialize = function () {
|
|
1472
1526
|
var _a, _b, _c, _d, _e;
|
|
1473
1527
|
_super.prototype.initialize.call(this);
|
|
@@ -1498,7 +1552,7 @@ var CMI = (function (_super) {
|
|
|
1498
1552
|
return this.__version;
|
|
1499
1553
|
},
|
|
1500
1554
|
set: function (_version) {
|
|
1501
|
-
throw new
|
|
1555
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
1502
1556
|
},
|
|
1503
1557
|
enumerable: false,
|
|
1504
1558
|
configurable: true
|
|
@@ -1508,7 +1562,7 @@ var CMI = (function (_super) {
|
|
|
1508
1562
|
return this.__children;
|
|
1509
1563
|
},
|
|
1510
1564
|
set: function (_children) {
|
|
1511
|
-
throw new
|
|
1565
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
1512
1566
|
},
|
|
1513
1567
|
enumerable: false,
|
|
1514
1568
|
configurable: true
|
|
@@ -1532,7 +1586,7 @@ var CMI = (function (_super) {
|
|
|
1532
1586
|
},
|
|
1533
1587
|
set: function (launch_data) {
|
|
1534
1588
|
if (this.initialized) {
|
|
1535
|
-
throw new
|
|
1589
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1536
1590
|
}
|
|
1537
1591
|
else {
|
|
1538
1592
|
this._launch_data = launch_data;
|
|
@@ -1546,7 +1600,7 @@ var CMI = (function (_super) {
|
|
|
1546
1600
|
return this._comments;
|
|
1547
1601
|
},
|
|
1548
1602
|
set: function (comments) {
|
|
1549
|
-
if ((0,validation
|
|
1603
|
+
if ((0,validation.check12ValidFormat)(comments, regex.scorm12_regex.CMIString4096, true)) {
|
|
1550
1604
|
this._comments = comments;
|
|
1551
1605
|
}
|
|
1552
1606
|
},
|
|
@@ -1559,7 +1613,7 @@ var CMI = (function (_super) {
|
|
|
1559
1613
|
},
|
|
1560
1614
|
set: function (comments_from_lms) {
|
|
1561
1615
|
if (this.initialized) {
|
|
1562
|
-
throw new
|
|
1616
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1563
1617
|
}
|
|
1564
1618
|
else {
|
|
1565
1619
|
this._comments_from_lms = comments_from_lms;
|
|
@@ -1572,7 +1626,7 @@ var CMI = (function (_super) {
|
|
|
1572
1626
|
return this.core.getCurrentTotalTime(this.start_time);
|
|
1573
1627
|
};
|
|
1574
1628
|
return CMI;
|
|
1575
|
-
}(base_cmi
|
|
1629
|
+
}(base_cmi.BaseRootCMI));
|
|
1576
1630
|
|
|
1577
1631
|
|
|
1578
1632
|
|
|
@@ -1581,17 +1635,18 @@ var CMI = (function (_super) {
|
|
|
1581
1635
|
/***/ 833:
|
|
1582
1636
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1583
1637
|
|
|
1638
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1584
1639
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1585
|
-
/* harmony export */
|
|
1586
|
-
/* harmony export */
|
|
1587
|
-
/* harmony export */
|
|
1588
|
-
/* harmony export */
|
|
1640
|
+
/* harmony export */ CMIInteractions: function() { return /* binding */ CMIInteractions; },
|
|
1641
|
+
/* harmony export */ CMIInteractionsCorrectResponsesObject: function() { return /* binding */ CMIInteractionsCorrectResponsesObject; },
|
|
1642
|
+
/* harmony export */ CMIInteractionsObject: function() { return /* binding */ CMIInteractionsObject; },
|
|
1643
|
+
/* harmony export */ CMIInteractionsObjectivesObject: function() { return /* binding */ CMIInteractionsObjectivesObject; }
|
|
1589
1644
|
/* harmony export */ });
|
|
1590
1645
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(635);
|
|
1591
1646
|
/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(589);
|
|
1592
1647
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
1593
1648
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(797);
|
|
1594
|
-
/* harmony import */ var
|
|
1649
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(179);
|
|
1595
1650
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(319);
|
|
1596
1651
|
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(915);
|
|
1597
1652
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(417);
|
|
@@ -1604,19 +1659,19 @@ var CMI = (function (_super) {
|
|
|
1604
1659
|
|
|
1605
1660
|
|
|
1606
1661
|
var CMIInteractions = (function (_super) {
|
|
1607
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
1662
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractions, _super);
|
|
1608
1663
|
function CMIInteractions() {
|
|
1609
1664
|
return _super.call(this, {
|
|
1610
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
1611
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__
|
|
1612
|
-
errorClass:
|
|
1665
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.interactions_children,
|
|
1666
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.INVALID_SET_VALUE,
|
|
1667
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError,
|
|
1613
1668
|
}) || this;
|
|
1614
1669
|
}
|
|
1615
1670
|
return CMIInteractions;
|
|
1616
|
-
}(_common_array__WEBPACK_IMPORTED_MODULE_0__
|
|
1671
|
+
}(_common_array__WEBPACK_IMPORTED_MODULE_0__.CMIArray));
|
|
1617
1672
|
|
|
1618
1673
|
var CMIInteractionsObject = (function (_super) {
|
|
1619
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
1674
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsObject, _super);
|
|
1620
1675
|
function CMIInteractionsObject() {
|
|
1621
1676
|
var _this = _super.call(this) || this;
|
|
1622
1677
|
_this._id = "";
|
|
@@ -1626,15 +1681,15 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1626
1681
|
_this._student_response = "";
|
|
1627
1682
|
_this._result = "";
|
|
1628
1683
|
_this._latency = "";
|
|
1629
|
-
_this.objectives = new _common_array__WEBPACK_IMPORTED_MODULE_0__
|
|
1630
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__
|
|
1631
|
-
errorClass:
|
|
1632
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
1684
|
+
_this.objectives = new _common_array__WEBPACK_IMPORTED_MODULE_0__.CMIArray({
|
|
1685
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.INVALID_SET_VALUE,
|
|
1686
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError,
|
|
1687
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.objectives_children,
|
|
1633
1688
|
});
|
|
1634
|
-
_this.correct_responses = new _common_array__WEBPACK_IMPORTED_MODULE_0__
|
|
1635
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__
|
|
1636
|
-
errorClass:
|
|
1637
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
1689
|
+
_this.correct_responses = new _common_array__WEBPACK_IMPORTED_MODULE_0__.CMIArray({
|
|
1690
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.INVALID_SET_VALUE,
|
|
1691
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError,
|
|
1692
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.correct_responses_children,
|
|
1638
1693
|
});
|
|
1639
1694
|
return _this;
|
|
1640
1695
|
}
|
|
@@ -1644,15 +1699,28 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1644
1699
|
(_a = this.objectives) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
1645
1700
|
(_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.initialize();
|
|
1646
1701
|
};
|
|
1702
|
+
CMIInteractionsObject.prototype.reset = function () {
|
|
1703
|
+
var _a, _b;
|
|
1704
|
+
this._initialized = false;
|
|
1705
|
+
this._id = "";
|
|
1706
|
+
this._time = "";
|
|
1707
|
+
this._type = "";
|
|
1708
|
+
this._weighting = "";
|
|
1709
|
+
this._student_response = "";
|
|
1710
|
+
this._result = "";
|
|
1711
|
+
this._latency = "";
|
|
1712
|
+
(_a = this.objectives) === null || _a === void 0 ? void 0 : _a.reset();
|
|
1713
|
+
(_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.reset();
|
|
1714
|
+
};
|
|
1647
1715
|
Object.defineProperty(CMIInteractionsObject.prototype, "id", {
|
|
1648
1716
|
get: function () {
|
|
1649
1717
|
if (!this.jsonString) {
|
|
1650
|
-
throw new
|
|
1718
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1651
1719
|
}
|
|
1652
1720
|
return this._id;
|
|
1653
1721
|
},
|
|
1654
1722
|
set: function (id) {
|
|
1655
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1723
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIIdentifier)) {
|
|
1656
1724
|
this._id = id;
|
|
1657
1725
|
}
|
|
1658
1726
|
},
|
|
@@ -1662,12 +1730,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1662
1730
|
Object.defineProperty(CMIInteractionsObject.prototype, "time", {
|
|
1663
1731
|
get: function () {
|
|
1664
1732
|
if (!this.jsonString) {
|
|
1665
|
-
throw new
|
|
1733
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1666
1734
|
}
|
|
1667
1735
|
return this._time;
|
|
1668
1736
|
},
|
|
1669
1737
|
set: function (time) {
|
|
1670
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1738
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(time, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMITime)) {
|
|
1671
1739
|
this._time = time;
|
|
1672
1740
|
}
|
|
1673
1741
|
},
|
|
@@ -1677,12 +1745,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1677
1745
|
Object.defineProperty(CMIInteractionsObject.prototype, "type", {
|
|
1678
1746
|
get: function () {
|
|
1679
1747
|
if (!this.jsonString) {
|
|
1680
|
-
throw new
|
|
1748
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1681
1749
|
}
|
|
1682
1750
|
return this._type;
|
|
1683
1751
|
},
|
|
1684
1752
|
set: function (type) {
|
|
1685
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1753
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(type, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIType)) {
|
|
1686
1754
|
this._type = type;
|
|
1687
1755
|
}
|
|
1688
1756
|
},
|
|
@@ -1692,13 +1760,13 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1692
1760
|
Object.defineProperty(CMIInteractionsObject.prototype, "weighting", {
|
|
1693
1761
|
get: function () {
|
|
1694
1762
|
if (!this.jsonString) {
|
|
1695
|
-
throw new
|
|
1763
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1696
1764
|
}
|
|
1697
1765
|
return this._weighting;
|
|
1698
1766
|
},
|
|
1699
1767
|
set: function (weighting) {
|
|
1700
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1701
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1768
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIDecimal) &&
|
|
1769
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidRange)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.weighting_range)) {
|
|
1702
1770
|
this._weighting = weighting;
|
|
1703
1771
|
}
|
|
1704
1772
|
},
|
|
@@ -1708,12 +1776,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1708
1776
|
Object.defineProperty(CMIInteractionsObject.prototype, "student_response", {
|
|
1709
1777
|
get: function () {
|
|
1710
1778
|
if (!this.jsonString) {
|
|
1711
|
-
throw new
|
|
1779
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1712
1780
|
}
|
|
1713
1781
|
return this._student_response;
|
|
1714
1782
|
},
|
|
1715
1783
|
set: function (student_response) {
|
|
1716
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1784
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(student_response, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIFeedback, true)) {
|
|
1717
1785
|
this._student_response = student_response;
|
|
1718
1786
|
}
|
|
1719
1787
|
},
|
|
@@ -1723,12 +1791,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1723
1791
|
Object.defineProperty(CMIInteractionsObject.prototype, "result", {
|
|
1724
1792
|
get: function () {
|
|
1725
1793
|
if (!this.jsonString) {
|
|
1726
|
-
throw new
|
|
1794
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1727
1795
|
}
|
|
1728
1796
|
return this._result;
|
|
1729
1797
|
},
|
|
1730
1798
|
set: function (result) {
|
|
1731
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1799
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(result, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIResult)) {
|
|
1732
1800
|
this._result = result;
|
|
1733
1801
|
}
|
|
1734
1802
|
},
|
|
@@ -1738,12 +1806,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1738
1806
|
Object.defineProperty(CMIInteractionsObject.prototype, "latency", {
|
|
1739
1807
|
get: function () {
|
|
1740
1808
|
if (!this.jsonString) {
|
|
1741
|
-
throw new
|
|
1809
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1742
1810
|
}
|
|
1743
1811
|
return this._latency;
|
|
1744
1812
|
},
|
|
1745
1813
|
set: function (latency) {
|
|
1746
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1814
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(latency, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMITimespan)) {
|
|
1747
1815
|
this._latency = latency;
|
|
1748
1816
|
}
|
|
1749
1817
|
},
|
|
@@ -1767,21 +1835,25 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1767
1835
|
return result;
|
|
1768
1836
|
};
|
|
1769
1837
|
return CMIInteractionsObject;
|
|
1770
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
1838
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
1771
1839
|
|
|
1772
1840
|
var CMIInteractionsObjectivesObject = (function (_super) {
|
|
1773
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
1841
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsObjectivesObject, _super);
|
|
1774
1842
|
function CMIInteractionsObjectivesObject() {
|
|
1775
1843
|
var _this = _super.call(this) || this;
|
|
1776
1844
|
_this._id = "";
|
|
1777
1845
|
return _this;
|
|
1778
1846
|
}
|
|
1847
|
+
CMIInteractionsObjectivesObject.prototype.reset = function () {
|
|
1848
|
+
this._initialized = false;
|
|
1849
|
+
this._id = "";
|
|
1850
|
+
};
|
|
1779
1851
|
Object.defineProperty(CMIInteractionsObjectivesObject.prototype, "id", {
|
|
1780
1852
|
get: function () {
|
|
1781
1853
|
return this._id;
|
|
1782
1854
|
},
|
|
1783
1855
|
set: function (id) {
|
|
1784
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1856
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIIdentifier)) {
|
|
1785
1857
|
this._id = id;
|
|
1786
1858
|
}
|
|
1787
1859
|
},
|
|
@@ -1797,24 +1869,28 @@ var CMIInteractionsObjectivesObject = (function (_super) {
|
|
|
1797
1869
|
return result;
|
|
1798
1870
|
};
|
|
1799
1871
|
return CMIInteractionsObjectivesObject;
|
|
1800
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
1872
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
1801
1873
|
|
|
1802
1874
|
var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
1803
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
1875
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsCorrectResponsesObject, _super);
|
|
1804
1876
|
function CMIInteractionsCorrectResponsesObject() {
|
|
1805
1877
|
var _this = _super.call(this) || this;
|
|
1806
1878
|
_this._pattern = "";
|
|
1807
1879
|
return _this;
|
|
1808
1880
|
}
|
|
1881
|
+
CMIInteractionsCorrectResponsesObject.prototype.reset = function () {
|
|
1882
|
+
this._initialized = false;
|
|
1883
|
+
this._pattern = "";
|
|
1884
|
+
};
|
|
1809
1885
|
Object.defineProperty(CMIInteractionsCorrectResponsesObject.prototype, "pattern", {
|
|
1810
1886
|
get: function () {
|
|
1811
1887
|
if (!this.jsonString) {
|
|
1812
|
-
throw new
|
|
1888
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1813
1889
|
}
|
|
1814
1890
|
return this._pattern;
|
|
1815
1891
|
},
|
|
1816
1892
|
set: function (pattern) {
|
|
1817
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1893
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(pattern, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIFeedback, true)) {
|
|
1818
1894
|
this._pattern = pattern;
|
|
1819
1895
|
}
|
|
1820
1896
|
},
|
|
@@ -1830,7 +1906,7 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
1830
1906
|
return result;
|
|
1831
1907
|
};
|
|
1832
1908
|
return CMIInteractionsCorrectResponsesObject;
|
|
1833
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
1909
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
1834
1910
|
|
|
1835
1911
|
|
|
1836
1912
|
|
|
@@ -1839,8 +1915,9 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
1839
1915
|
/***/ 331:
|
|
1840
1916
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1841
1917
|
|
|
1918
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1842
1919
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1843
|
-
/* harmony export */
|
|
1920
|
+
/* harmony export */ NAV: function() { return /* binding */ NAV; }
|
|
1844
1921
|
/* harmony export */ });
|
|
1845
1922
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635);
|
|
1846
1923
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
@@ -1851,18 +1928,22 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
1851
1928
|
|
|
1852
1929
|
|
|
1853
1930
|
var NAV = (function (_super) {
|
|
1854
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_3__
|
|
1931
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_3__.__extends)(NAV, _super);
|
|
1855
1932
|
function NAV() {
|
|
1856
1933
|
var _this = _super.call(this) || this;
|
|
1857
1934
|
_this._event = "";
|
|
1858
1935
|
return _this;
|
|
1859
1936
|
}
|
|
1937
|
+
NAV.prototype.reset = function () {
|
|
1938
|
+
this._event = "";
|
|
1939
|
+
this._initialized = false;
|
|
1940
|
+
};
|
|
1860
1941
|
Object.defineProperty(NAV.prototype, "event", {
|
|
1861
1942
|
get: function () {
|
|
1862
1943
|
return this._event;
|
|
1863
1944
|
},
|
|
1864
1945
|
set: function (event) {
|
|
1865
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_1__
|
|
1946
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_1__.check12ValidFormat)(event, _constants_regex__WEBPACK_IMPORTED_MODULE_2__.scorm12_regex.NAVEvent)) {
|
|
1866
1947
|
this._event = event;
|
|
1867
1948
|
}
|
|
1868
1949
|
},
|
|
@@ -1878,7 +1959,7 @@ var NAV = (function (_super) {
|
|
|
1878
1959
|
return result;
|
|
1879
1960
|
};
|
|
1880
1961
|
return NAV;
|
|
1881
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
1962
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
1882
1963
|
|
|
1883
1964
|
|
|
1884
1965
|
|
|
@@ -1887,9 +1968,10 @@ var NAV = (function (_super) {
|
|
|
1887
1968
|
/***/ 176:
|
|
1888
1969
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1889
1970
|
|
|
1971
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1890
1972
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1891
|
-
/* harmony export */
|
|
1892
|
-
/* harmony export */
|
|
1973
|
+
/* harmony export */ CMIObjectives: function() { return /* binding */ CMIObjectives; },
|
|
1974
|
+
/* harmony export */ CMIObjectivesObject: function() { return /* binding */ CMIObjectivesObject; }
|
|
1893
1975
|
/* harmony export */ });
|
|
1894
1976
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(635);
|
|
1895
1977
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
@@ -1897,7 +1979,7 @@ var NAV = (function (_super) {
|
|
|
1897
1979
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(340);
|
|
1898
1980
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(417);
|
|
1899
1981
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(797);
|
|
1900
|
-
/* harmony import */ var
|
|
1982
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(179);
|
|
1901
1983
|
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(915);
|
|
1902
1984
|
/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(589);
|
|
1903
1985
|
|
|
@@ -1910,39 +1992,46 @@ var NAV = (function (_super) {
|
|
|
1910
1992
|
|
|
1911
1993
|
|
|
1912
1994
|
var CMIObjectives = (function (_super) {
|
|
1913
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_8__
|
|
1995
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_8__.__extends)(CMIObjectives, _super);
|
|
1914
1996
|
function CMIObjectives() {
|
|
1915
1997
|
return _super.call(this, {
|
|
1916
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
1917
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
1918
|
-
errorClass:
|
|
1998
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.objectives_children,
|
|
1999
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.INVALID_SET_VALUE,
|
|
2000
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_5__.Scorm12ValidationError,
|
|
1919
2001
|
}) || this;
|
|
1920
2002
|
}
|
|
1921
2003
|
return CMIObjectives;
|
|
1922
|
-
}(_common_array__WEBPACK_IMPORTED_MODULE_7__
|
|
2004
|
+
}(_common_array__WEBPACK_IMPORTED_MODULE_7__.CMIArray));
|
|
1923
2005
|
|
|
1924
2006
|
var CMIObjectivesObject = (function (_super) {
|
|
1925
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_8__
|
|
2007
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_8__.__extends)(CMIObjectivesObject, _super);
|
|
1926
2008
|
function CMIObjectivesObject() {
|
|
1927
2009
|
var _this = _super.call(this) || this;
|
|
1928
2010
|
_this._id = "";
|
|
1929
2011
|
_this._status = "";
|
|
1930
|
-
_this.score = new _common_score__WEBPACK_IMPORTED_MODULE_1__
|
|
1931
|
-
score_children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
1932
|
-
score_range: _constants_regex__WEBPACK_IMPORTED_MODULE_3__
|
|
1933
|
-
invalidErrorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
1934
|
-
invalidTypeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
1935
|
-
invalidRangeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
1936
|
-
errorClass:
|
|
2012
|
+
_this.score = new _common_score__WEBPACK_IMPORTED_MODULE_1__.CMIScore({
|
|
2013
|
+
score_children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.score_children,
|
|
2014
|
+
score_range: _constants_regex__WEBPACK_IMPORTED_MODULE_3__.scorm12_regex.score_range,
|
|
2015
|
+
invalidErrorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.INVALID_SET_VALUE,
|
|
2016
|
+
invalidTypeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.TYPE_MISMATCH,
|
|
2017
|
+
invalidRangeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.VALUE_OUT_OF_RANGE,
|
|
2018
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_5__.Scorm12ValidationError,
|
|
1937
2019
|
});
|
|
1938
2020
|
return _this;
|
|
1939
2021
|
}
|
|
2022
|
+
CMIObjectivesObject.prototype.reset = function () {
|
|
2023
|
+
var _a;
|
|
2024
|
+
this._initialized = false;
|
|
2025
|
+
this._id = "";
|
|
2026
|
+
this._status = "";
|
|
2027
|
+
(_a = this.score) === null || _a === void 0 ? void 0 : _a.reset();
|
|
2028
|
+
};
|
|
1940
2029
|
Object.defineProperty(CMIObjectivesObject.prototype, "id", {
|
|
1941
2030
|
get: function () {
|
|
1942
2031
|
return this._id;
|
|
1943
2032
|
},
|
|
1944
2033
|
set: function (id) {
|
|
1945
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__
|
|
2034
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__.check12ValidFormat)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_3__.scorm12_regex.CMIIdentifier)) {
|
|
1946
2035
|
this._id = id;
|
|
1947
2036
|
}
|
|
1948
2037
|
},
|
|
@@ -1954,7 +2043,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
1954
2043
|
return this._status;
|
|
1955
2044
|
},
|
|
1956
2045
|
set: function (status) {
|
|
1957
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__
|
|
2046
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__.check12ValidFormat)(status, _constants_regex__WEBPACK_IMPORTED_MODULE_3__.scorm12_regex.CMIStatus2)) {
|
|
1958
2047
|
this._status = status;
|
|
1959
2048
|
}
|
|
1960
2049
|
},
|
|
@@ -1972,7 +2061,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
1972
2061
|
return result;
|
|
1973
2062
|
};
|
|
1974
2063
|
return CMIObjectivesObject;
|
|
1975
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
2064
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
1976
2065
|
|
|
1977
2066
|
|
|
1978
2067
|
|
|
@@ -1981,13 +2070,14 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
1981
2070
|
/***/ 532:
|
|
1982
2071
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1983
2072
|
|
|
2073
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1984
2074
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1985
|
-
/* harmony export */
|
|
2075
|
+
/* harmony export */ CMIStudentData: function() { return /* binding */ CMIStudentData; }
|
|
1986
2076
|
/* harmony export */ });
|
|
1987
2077
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635);
|
|
1988
2078
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
1989
2079
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
1990
|
-
/* harmony import */ var
|
|
2080
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(179);
|
|
1991
2081
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797);
|
|
1992
2082
|
|
|
1993
2083
|
|
|
@@ -1995,7 +2085,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
1995
2085
|
|
|
1996
2086
|
|
|
1997
2087
|
var CMIStudentData = (function (_super) {
|
|
1998
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_4__
|
|
2088
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_4__.__extends)(CMIStudentData, _super);
|
|
1999
2089
|
function CMIStudentData(student_data_children) {
|
|
2000
2090
|
var _this = _super.call(this) || this;
|
|
2001
2091
|
_this._mastery_score = "";
|
|
@@ -2003,15 +2093,18 @@ var CMIStudentData = (function (_super) {
|
|
|
2003
2093
|
_this._time_limit_action = "";
|
|
2004
2094
|
_this.__children = student_data_children
|
|
2005
2095
|
? student_data_children
|
|
2006
|
-
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
2096
|
+
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.student_data_children;
|
|
2007
2097
|
return _this;
|
|
2008
2098
|
}
|
|
2099
|
+
CMIStudentData.prototype.reset = function () {
|
|
2100
|
+
this._initialized = false;
|
|
2101
|
+
};
|
|
2009
2102
|
Object.defineProperty(CMIStudentData.prototype, "_children", {
|
|
2010
2103
|
get: function () {
|
|
2011
2104
|
return this.__children;
|
|
2012
2105
|
},
|
|
2013
2106
|
set: function (_children) {
|
|
2014
|
-
throw new
|
|
2107
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.INVALID_SET_VALUE);
|
|
2015
2108
|
},
|
|
2016
2109
|
enumerable: false,
|
|
2017
2110
|
configurable: true
|
|
@@ -2022,7 +2115,7 @@ var CMIStudentData = (function (_super) {
|
|
|
2022
2115
|
},
|
|
2023
2116
|
set: function (mastery_score) {
|
|
2024
2117
|
if (this.initialized) {
|
|
2025
|
-
throw new
|
|
2118
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.READ_ONLY_ELEMENT);
|
|
2026
2119
|
}
|
|
2027
2120
|
else {
|
|
2028
2121
|
this._mastery_score = mastery_score;
|
|
@@ -2037,7 +2130,7 @@ var CMIStudentData = (function (_super) {
|
|
|
2037
2130
|
},
|
|
2038
2131
|
set: function (max_time_allowed) {
|
|
2039
2132
|
if (this.initialized) {
|
|
2040
|
-
throw new
|
|
2133
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.READ_ONLY_ELEMENT);
|
|
2041
2134
|
}
|
|
2042
2135
|
else {
|
|
2043
2136
|
this._max_time_allowed = max_time_allowed;
|
|
@@ -2052,7 +2145,7 @@ var CMIStudentData = (function (_super) {
|
|
|
2052
2145
|
},
|
|
2053
2146
|
set: function (time_limit_action) {
|
|
2054
2147
|
if (this.initialized) {
|
|
2055
|
-
throw new
|
|
2148
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.READ_ONLY_ELEMENT);
|
|
2056
2149
|
}
|
|
2057
2150
|
else {
|
|
2058
2151
|
this._time_limit_action = time_limit_action;
|
|
@@ -2072,7 +2165,7 @@ var CMIStudentData = (function (_super) {
|
|
|
2072
2165
|
return result;
|
|
2073
2166
|
};
|
|
2074
2167
|
return CMIStudentData;
|
|
2075
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
2168
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
2076
2169
|
|
|
2077
2170
|
|
|
2078
2171
|
|
|
@@ -2081,16 +2174,17 @@ var CMIStudentData = (function (_super) {
|
|
|
2081
2174
|
/***/ 181:
|
|
2082
2175
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2083
2176
|
|
|
2177
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2084
2178
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2085
|
-
/* harmony export */
|
|
2179
|
+
/* harmony export */ CMIStudentPreference: function() { return /* binding */ CMIStudentPreference; }
|
|
2086
2180
|
/* harmony export */ });
|
|
2087
2181
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(635);
|
|
2088
2182
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
2089
2183
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
2090
|
-
/* harmony import */ var
|
|
2091
|
-
/* harmony import */ var
|
|
2092
|
-
/* harmony import */ var
|
|
2093
|
-
/* harmony import */ var
|
|
2184
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(179);
|
|
2185
|
+
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(915);
|
|
2186
|
+
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(417);
|
|
2187
|
+
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(797);
|
|
2094
2188
|
|
|
2095
2189
|
|
|
2096
2190
|
|
|
@@ -2099,7 +2193,7 @@ var CMIStudentData = (function (_super) {
|
|
|
2099
2193
|
|
|
2100
2194
|
|
|
2101
2195
|
var CMIStudentPreference = (function (_super) {
|
|
2102
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_6__
|
|
2196
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_6__.__extends)(CMIStudentPreference, _super);
|
|
2103
2197
|
function CMIStudentPreference(student_preference_children) {
|
|
2104
2198
|
var _this = _super.call(this) || this;
|
|
2105
2199
|
_this._audio = "";
|
|
@@ -2108,15 +2202,18 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2108
2202
|
_this._text = "";
|
|
2109
2203
|
_this.__children = student_preference_children
|
|
2110
2204
|
? student_preference_children
|
|
2111
|
-
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
2205
|
+
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.student_preference_children;
|
|
2112
2206
|
return _this;
|
|
2113
2207
|
}
|
|
2208
|
+
CMIStudentPreference.prototype.reset = function () {
|
|
2209
|
+
this._initialized = false;
|
|
2210
|
+
};
|
|
2114
2211
|
Object.defineProperty(CMIStudentPreference.prototype, "_children", {
|
|
2115
2212
|
get: function () {
|
|
2116
2213
|
return this.__children;
|
|
2117
2214
|
},
|
|
2118
2215
|
set: function (_children) {
|
|
2119
|
-
throw new
|
|
2216
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_5__.scorm12_errors.INVALID_SET_VALUE);
|
|
2120
2217
|
},
|
|
2121
2218
|
enumerable: false,
|
|
2122
2219
|
configurable: true
|
|
@@ -2126,8 +2223,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2126
2223
|
return this._audio;
|
|
2127
2224
|
},
|
|
2128
2225
|
set: function (audio) {
|
|
2129
|
-
if ((0,
|
|
2130
|
-
(0,
|
|
2226
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMISInteger) &&
|
|
2227
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidRange)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.audio_range)) {
|
|
2131
2228
|
this._audio = audio;
|
|
2132
2229
|
}
|
|
2133
2230
|
},
|
|
@@ -2139,7 +2236,7 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2139
2236
|
return this._language;
|
|
2140
2237
|
},
|
|
2141
2238
|
set: function (language) {
|
|
2142
|
-
if ((0,
|
|
2239
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(language, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMIString256)) {
|
|
2143
2240
|
this._language = language;
|
|
2144
2241
|
}
|
|
2145
2242
|
},
|
|
@@ -2151,8 +2248,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2151
2248
|
return this._speed;
|
|
2152
2249
|
},
|
|
2153
2250
|
set: function (speed) {
|
|
2154
|
-
if ((0,
|
|
2155
|
-
(0,
|
|
2251
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMISInteger) &&
|
|
2252
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidRange)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.speed_range)) {
|
|
2156
2253
|
this._speed = speed;
|
|
2157
2254
|
}
|
|
2158
2255
|
},
|
|
@@ -2164,8 +2261,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2164
2261
|
return this._text;
|
|
2165
2262
|
},
|
|
2166
2263
|
set: function (text) {
|
|
2167
|
-
if ((0,
|
|
2168
|
-
(0,
|
|
2264
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMISInteger) &&
|
|
2265
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidRange)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.text_range)) {
|
|
2169
2266
|
this._text = text;
|
|
2170
2267
|
}
|
|
2171
2268
|
},
|
|
@@ -2184,7 +2281,7 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2184
2281
|
return result;
|
|
2185
2282
|
};
|
|
2186
2283
|
return CMIStudentPreference;
|
|
2187
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
2284
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
2188
2285
|
|
|
2189
2286
|
|
|
2190
2287
|
|
|
@@ -2193,24 +2290,25 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2193
2290
|
/***/ 915:
|
|
2194
2291
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2195
2292
|
|
|
2293
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2196
2294
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2197
|
-
/* harmony export */
|
|
2198
|
-
/* harmony export */
|
|
2295
|
+
/* harmony export */ check12ValidFormat: function() { return /* binding */ check12ValidFormat; },
|
|
2296
|
+
/* harmony export */ check12ValidRange: function() { return /* binding */ check12ValidRange; }
|
|
2199
2297
|
/* harmony export */ });
|
|
2200
2298
|
/* harmony import */ var _common_validation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(449);
|
|
2201
2299
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(797);
|
|
2202
|
-
/* harmony import */ var
|
|
2300
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(179);
|
|
2203
2301
|
|
|
2204
2302
|
|
|
2205
2303
|
|
|
2206
2304
|
function check12ValidFormat(value, regexPattern, allowEmptyString) {
|
|
2207
|
-
return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__
|
|
2305
|
+
return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__.checkValidFormat)(value, regexPattern, _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__.scorm12_errors.TYPE_MISMATCH, _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_1__.Scorm12ValidationError, allowEmptyString);
|
|
2208
2306
|
}
|
|
2209
2307
|
function check12ValidRange(value, rangePattern, allowEmptyString) {
|
|
2210
2308
|
if (!allowEmptyString && value === "") {
|
|
2211
|
-
throw new
|
|
2309
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_1__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_0__.scorm12_errors.VALUE_OUT_OF_RANGE);
|
|
2212
2310
|
}
|
|
2213
|
-
return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__
|
|
2311
|
+
return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__.checkValidRange)(value, rangePattern, _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__.scorm12_errors.VALUE_OUT_OF_RANGE, _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_1__.Scorm12ValidationError);
|
|
2214
2312
|
}
|
|
2215
2313
|
|
|
2216
2314
|
|
|
@@ -2219,21 +2317,23 @@ function check12ValidRange(value, rangePattern, allowEmptyString) {
|
|
|
2219
2317
|
/***/ 340:
|
|
2220
2318
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2221
2319
|
|
|
2320
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2321
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2322
|
+
/* harmony export */ aicc_constants: function() { return /* binding */ aicc_constants; },
|
|
2323
|
+
/* harmony export */ global_constants: function() { return /* binding */ global_constants; },
|
|
2324
|
+
/* harmony export */ scorm12_constants: function() { return /* binding */ scorm12_constants; },
|
|
2325
|
+
/* harmony export */ scorm2004_constants: function() { return /* binding */ scorm2004_constants; }
|
|
2326
|
+
/* harmony export */ });
|
|
2222
2327
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
2223
2328
|
|
|
2224
|
-
var
|
|
2329
|
+
var global_constants = {
|
|
2225
2330
|
SCORM_TRUE: "true",
|
|
2226
2331
|
SCORM_FALSE: "false",
|
|
2227
2332
|
STATE_NOT_INITIALIZED: 0,
|
|
2228
2333
|
STATE_INITIALIZED: 1,
|
|
2229
2334
|
STATE_TERMINATED: 2,
|
|
2230
|
-
LOG_LEVEL_DEBUG: 1,
|
|
2231
|
-
LOG_LEVEL_INFO: 2,
|
|
2232
|
-
LOG_LEVEL_WARNING: 3,
|
|
2233
|
-
LOG_LEVEL_ERROR: 4,
|
|
2234
|
-
LOG_LEVEL_NONE: 5,
|
|
2235
2335
|
};
|
|
2236
|
-
var
|
|
2336
|
+
var scorm12_constants = {
|
|
2237
2337
|
cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",
|
|
2238
2338
|
core_children: "student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",
|
|
2239
2339
|
score_children: "raw,min,max",
|
|
@@ -2294,7 +2394,7 @@ var scorm12 = {
|
|
|
2294
2394
|
},
|
|
2295
2395
|
},
|
|
2296
2396
|
};
|
|
2297
|
-
var
|
|
2397
|
+
var aicc_constants = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, scorm12_constants), {
|
|
2298
2398
|
cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",
|
|
2299
2399
|
student_preference_children: "audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",
|
|
2300
2400
|
student_data_children: "attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",
|
|
@@ -2303,7 +2403,7 @@ var aicc = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__W
|
|
|
2303
2403
|
attempt_records_children: "score,lesson_status",
|
|
2304
2404
|
paths_children: "location_id,date,time,status,why_left,time_in_element",
|
|
2305
2405
|
});
|
|
2306
|
-
var
|
|
2406
|
+
var scorm2004_constants = {
|
|
2307
2407
|
cmi_children: "_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time",
|
|
2308
2408
|
comments_children: "comment,timestamp,location",
|
|
2309
2409
|
score_children: "max,raw,scaled,min",
|
|
@@ -2312,6 +2412,7 @@ var scorm2004 = {
|
|
|
2312
2412
|
student_data_children: "mastery_score,max_time_allowed,time_limit_action",
|
|
2313
2413
|
student_preference_children: "audio_level,audio_captioning,delivery_speed,language",
|
|
2314
2414
|
interactions_children: "id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",
|
|
2415
|
+
adl_data_children: "id,store",
|
|
2315
2416
|
error_descriptions: {
|
|
2316
2417
|
"0": {
|
|
2317
2418
|
basicMessage: "No Error",
|
|
@@ -2419,13 +2520,6 @@ var scorm2004 = {
|
|
|
2419
2520
|
},
|
|
2420
2521
|
},
|
|
2421
2522
|
};
|
|
2422
|
-
var APIConstants = {
|
|
2423
|
-
global: global,
|
|
2424
|
-
scorm12: scorm12,
|
|
2425
|
-
aicc: aicc,
|
|
2426
|
-
scorm2004: scorm2004,
|
|
2427
|
-
};
|
|
2428
|
-
/* harmony default export */ __webpack_exports__.A = (APIConstants);
|
|
2429
2523
|
|
|
2430
2524
|
|
|
2431
2525
|
/***/ }),
|
|
@@ -2433,11 +2527,13 @@ var APIConstants = {
|
|
|
2433
2527
|
/***/ 56:
|
|
2434
2528
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2435
2529
|
|
|
2530
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2436
2531
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2437
|
-
/* harmony export */
|
|
2438
|
-
/* harmony export */
|
|
2532
|
+
/* harmony export */ CompletionStatus: function() { return /* binding */ CompletionStatus; },
|
|
2533
|
+
/* harmony export */ LogLevelEnum: function() { return /* binding */ LogLevelEnum; },
|
|
2534
|
+
/* harmony export */ NAVBoolean: function() { return /* binding */ NAVBoolean; },
|
|
2535
|
+
/* harmony export */ SuccessStatus: function() { return /* binding */ SuccessStatus; }
|
|
2439
2536
|
/* harmony export */ });
|
|
2440
|
-
/* unused harmony export NAVBoolean */
|
|
2441
2537
|
var NAVBoolean;
|
|
2442
2538
|
(function (NAVBoolean) {
|
|
2443
2539
|
NAVBoolean["unknown"] = "unknown";
|
|
@@ -2456,6 +2552,15 @@ var CompletionStatus;
|
|
|
2456
2552
|
CompletionStatus["incomplete"] = "incomplete";
|
|
2457
2553
|
CompletionStatus["unknown"] = "unknown";
|
|
2458
2554
|
})(CompletionStatus || (CompletionStatus = {}));
|
|
2555
|
+
var LogLevelEnum;
|
|
2556
|
+
(function (LogLevelEnum) {
|
|
2557
|
+
LogLevelEnum[LogLevelEnum["_"] = 0] = "_";
|
|
2558
|
+
LogLevelEnum[LogLevelEnum["DEBUG"] = 1] = "DEBUG";
|
|
2559
|
+
LogLevelEnum[LogLevelEnum["INFO"] = 2] = "INFO";
|
|
2560
|
+
LogLevelEnum[LogLevelEnum["WARN"] = 3] = "WARN";
|
|
2561
|
+
LogLevelEnum[LogLevelEnum["ERROR"] = 4] = "ERROR";
|
|
2562
|
+
LogLevelEnum[LogLevelEnum["NONE"] = 5] = "NONE";
|
|
2563
|
+
})(LogLevelEnum || (LogLevelEnum = {}));
|
|
2459
2564
|
|
|
2460
2565
|
|
|
2461
2566
|
/***/ }),
|
|
@@ -2463,9 +2568,15 @@ var CompletionStatus;
|
|
|
2463
2568
|
/***/ 797:
|
|
2464
2569
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2465
2570
|
|
|
2571
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2572
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2573
|
+
/* harmony export */ global_errors: function() { return /* binding */ global_errors; },
|
|
2574
|
+
/* harmony export */ scorm12_errors: function() { return /* binding */ scorm12_errors; },
|
|
2575
|
+
/* harmony export */ scorm2004_errors: function() { return /* binding */ scorm2004_errors; }
|
|
2576
|
+
/* harmony export */ });
|
|
2466
2577
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
2467
2578
|
|
|
2468
|
-
var
|
|
2579
|
+
var global_errors = {
|
|
2469
2580
|
GENERAL: 101,
|
|
2470
2581
|
INITIALIZATION_FAILED: 101,
|
|
2471
2582
|
INITIALIZED: 101,
|
|
@@ -2495,13 +2606,8 @@ var global = {
|
|
|
2495
2606
|
VALUE_OUT_OF_RANGE: 101,
|
|
2496
2607
|
DEPENDENCY_NOT_ESTABLISHED: 101,
|
|
2497
2608
|
};
|
|
2498
|
-
var
|
|
2499
|
-
var
|
|
2500
|
-
var ErrorCodes = {
|
|
2501
|
-
scorm12: scorm12,
|
|
2502
|
-
scorm2004: scorm2004,
|
|
2503
|
-
};
|
|
2504
|
-
/* harmony default export */ __webpack_exports__.A = (ErrorCodes);
|
|
2609
|
+
var scorm12_errors = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, global_errors), { RETRIEVE_BEFORE_INIT: 301, STORE_BEFORE_INIT: 301, COMMIT_BEFORE_INIT: 301, ARGUMENT_ERROR: 201, CHILDREN_ERROR: 202, COUNT_ERROR: 203, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 401, VALUE_NOT_INITIALIZED: 301, INVALID_SET_VALUE: 402, READ_ONLY_ELEMENT: 403, WRITE_ONLY_ELEMENT: 404, TYPE_MISMATCH: 405, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 });
|
|
2610
|
+
var scorm2004_errors = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, global_errors), { INITIALIZATION_FAILED: 102, INITIALIZED: 103, TERMINATED: 104, TERMINATION_FAILURE: 111, TERMINATION_BEFORE_INIT: 112, MULTIPLE_TERMINATIONS: 113, RETRIEVE_BEFORE_INIT: 122, RETRIEVE_AFTER_TERM: 123, STORE_BEFORE_INIT: 132, STORE_AFTER_TERM: 133, COMMIT_BEFORE_INIT: 142, COMMIT_AFTER_TERM: 143, ARGUMENT_ERROR: 201, GENERAL_GET_FAILURE: 301, GENERAL_SET_FAILURE: 351, GENERAL_COMMIT_FAILURE: 391, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 402, VALUE_NOT_INITIALIZED: 403, READ_ONLY_ELEMENT: 404, WRITE_ONLY_ELEMENT: 405, TYPE_MISMATCH: 406, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 });
|
|
2505
2611
|
|
|
2506
2612
|
|
|
2507
2613
|
/***/ }),
|
|
@@ -2509,9 +2615,15 @@ var ErrorCodes = {
|
|
|
2509
2615
|
/***/ 417:
|
|
2510
2616
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2511
2617
|
|
|
2618
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2619
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2620
|
+
/* harmony export */ aicc_regex: function() { return /* binding */ aicc_regex; },
|
|
2621
|
+
/* harmony export */ scorm12_regex: function() { return /* binding */ scorm12_regex; },
|
|
2622
|
+
/* harmony export */ scorm2004_regex: function() { return /* binding */ scorm2004_regex; }
|
|
2623
|
+
/* harmony export */ });
|
|
2512
2624
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
2513
2625
|
|
|
2514
|
-
var
|
|
2626
|
+
var scorm12_regex = {
|
|
2515
2627
|
CMIString256: "^.{0,255}$",
|
|
2516
2628
|
CMIString4096: "^.{0,4096}$",
|
|
2517
2629
|
CMITime: "^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",
|
|
@@ -2534,10 +2646,10 @@ var scorm12 = {
|
|
|
2534
2646
|
weighting_range: "-100#100",
|
|
2535
2647
|
text_range: "-1#1",
|
|
2536
2648
|
};
|
|
2537
|
-
var
|
|
2649
|
+
var aicc_regex = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, scorm12_regex), {
|
|
2538
2650
|
CMIIdentifier: "^\\w{1,255}$",
|
|
2539
2651
|
});
|
|
2540
|
-
var
|
|
2652
|
+
var scorm2004_regex = {
|
|
2541
2653
|
CMIString200: "^[\\u0000-\\uFFFF]{0,200}$",
|
|
2542
2654
|
CMIString250: "^[\\u0000-\\uFFFF]{0,250}$",
|
|
2543
2655
|
CMIString1000: "^[\\u0000-\\uFFFF]{0,1000}$",
|
|
@@ -2564,7 +2676,7 @@ var scorm2004 = {
|
|
|
2564
2676
|
CMIExit: "^(time-out|suspend|logout|normal)$",
|
|
2565
2677
|
CMIType: "^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",
|
|
2566
2678
|
CMIResult: "^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",
|
|
2567
|
-
NAVEvent: "^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target
|
|
2679
|
+
NAVEvent: "^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=(?<choice_target>\\S{0,}[a-zA-Z0-9-_]+)})?choice|(\\{target=(?<jump_target>\\S{0,}[a-zA-Z0-9-_]+)})?jump)$",
|
|
2568
2680
|
NAVBoolean: "^(unknown|true|false$)",
|
|
2569
2681
|
NAVTarget: "^{target=\\S{0,}[a-zA-Z0-9-_]+}$",
|
|
2570
2682
|
scaled_range: "-1#1",
|
|
@@ -2573,12 +2685,6 @@ var scorm2004 = {
|
|
|
2573
2685
|
text_range: "-1#1",
|
|
2574
2686
|
progress_range: "0#1",
|
|
2575
2687
|
};
|
|
2576
|
-
var Regex = {
|
|
2577
|
-
aicc: aicc,
|
|
2578
|
-
scorm12: scorm12,
|
|
2579
|
-
scorm2004: scorm2004,
|
|
2580
|
-
};
|
|
2581
|
-
/* harmony default export */ __webpack_exports__.A = (Regex);
|
|
2582
2688
|
|
|
2583
2689
|
|
|
2584
2690
|
/***/ }),
|
|
@@ -2586,21 +2692,15 @@ var Regex = {
|
|
|
2586
2692
|
/***/ 784:
|
|
2587
2693
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2588
2694
|
|
|
2695
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2589
2696
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2590
|
-
/* harmony export */
|
|
2591
|
-
/* harmony export */
|
|
2592
|
-
/* harmony export */ yI: function() { return /* binding */ ValidationError; }
|
|
2697
|
+
/* harmony export */ BaseScormValidationError: function() { return /* binding */ BaseScormValidationError; },
|
|
2698
|
+
/* harmony export */ ValidationError: function() { return /* binding */ ValidationError; }
|
|
2593
2699
|
/* harmony export */ });
|
|
2594
|
-
/*
|
|
2595
|
-
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(635);
|
|
2596
|
-
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340);
|
|
2597
|
-
|
|
2700
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
2598
2701
|
|
|
2599
|
-
var scorm12_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.error_descriptions;
|
|
2600
|
-
var aicc_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.aicc.error_descriptions;
|
|
2601
|
-
var scorm2004_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm2004.error_descriptions;
|
|
2602
2702
|
var BaseScormValidationError = (function (_super) {
|
|
2603
|
-
(0,
|
|
2703
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(BaseScormValidationError, _super);
|
|
2604
2704
|
function BaseScormValidationError(errorCode) {
|
|
2605
2705
|
var _this = _super.call(this, errorCode.toString()) || this;
|
|
2606
2706
|
_this._errorCode = errorCode;
|
|
@@ -2614,18 +2714,15 @@ var BaseScormValidationError = (function (_super) {
|
|
|
2614
2714
|
enumerable: false,
|
|
2615
2715
|
configurable: true
|
|
2616
2716
|
});
|
|
2617
|
-
BaseScormValidationError.prototype.setMessage = function (message) {
|
|
2618
|
-
this.message = message;
|
|
2619
|
-
};
|
|
2620
2717
|
return BaseScormValidationError;
|
|
2621
2718
|
}(Error));
|
|
2622
2719
|
|
|
2623
2720
|
var ValidationError = (function (_super) {
|
|
2624
|
-
(0,
|
|
2721
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(ValidationError, _super);
|
|
2625
2722
|
function ValidationError(errorCode, errorMessage, detailedMessage) {
|
|
2626
2723
|
var _this = _super.call(this, errorCode) || this;
|
|
2627
2724
|
_this._detailedMessage = "";
|
|
2628
|
-
_this.
|
|
2725
|
+
_this.message = errorMessage;
|
|
2629
2726
|
_this._errorMessage = errorMessage;
|
|
2630
2727
|
if (detailedMessage) {
|
|
2631
2728
|
_this._detailedMessage = detailedMessage;
|
|
@@ -2649,8 +2746,26 @@ var ValidationError = (function (_super) {
|
|
|
2649
2746
|
return ValidationError;
|
|
2650
2747
|
}(BaseScormValidationError));
|
|
2651
2748
|
|
|
2749
|
+
|
|
2750
|
+
|
|
2751
|
+
/***/ }),
|
|
2752
|
+
|
|
2753
|
+
/***/ 179:
|
|
2754
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2755
|
+
|
|
2756
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2757
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2758
|
+
/* harmony export */ Scorm12ValidationError: function() { return /* binding */ Scorm12ValidationError; }
|
|
2759
|
+
/* harmony export */ });
|
|
2760
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(635);
|
|
2761
|
+
/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(784);
|
|
2762
|
+
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
2763
|
+
|
|
2764
|
+
|
|
2765
|
+
|
|
2766
|
+
var scorm12_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.error_descriptions;
|
|
2652
2767
|
var Scorm12ValidationError = (function (_super) {
|
|
2653
|
-
(0,
|
|
2768
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_2__.__extends)(Scorm12ValidationError, _super);
|
|
2654
2769
|
function Scorm12ValidationError(errorCode) {
|
|
2655
2770
|
var _this = this;
|
|
2656
2771
|
if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {
|
|
@@ -2662,37 +2777,7 @@ var Scorm12ValidationError = (function (_super) {
|
|
|
2662
2777
|
return _this;
|
|
2663
2778
|
}
|
|
2664
2779
|
return Scorm12ValidationError;
|
|
2665
|
-
}(ValidationError));
|
|
2666
|
-
|
|
2667
|
-
var AICCValidationError = (function (_super) {
|
|
2668
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(AICCValidationError, _super);
|
|
2669
|
-
function AICCValidationError(errorCode) {
|
|
2670
|
-
var _this = this;
|
|
2671
|
-
if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {
|
|
2672
|
-
_this = _super.call(this, errorCode, aicc_errors[String(errorCode)].basicMessage, aicc_errors[String(errorCode)].detailMessage) || this;
|
|
2673
|
-
}
|
|
2674
|
-
else {
|
|
2675
|
-
_this = _super.call(this, 101, aicc_errors["101"].basicMessage, aicc_errors["101"].detailMessage) || this;
|
|
2676
|
-
}
|
|
2677
|
-
return _this;
|
|
2678
|
-
}
|
|
2679
|
-
return AICCValidationError;
|
|
2680
|
-
}(ValidationError));
|
|
2681
|
-
|
|
2682
|
-
var Scorm2004ValidationError = (function (_super) {
|
|
2683
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(Scorm2004ValidationError, _super);
|
|
2684
|
-
function Scorm2004ValidationError(errorCode) {
|
|
2685
|
-
var _this = this;
|
|
2686
|
-
if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {
|
|
2687
|
-
_this = _super.call(this, errorCode, scorm2004_errors[String(errorCode)].basicMessage, scorm2004_errors[String(errorCode)].detailMessage) || this;
|
|
2688
|
-
}
|
|
2689
|
-
else {
|
|
2690
|
-
_this = _super.call(this, 101, scorm2004_errors["101"].basicMessage, scorm2004_errors["101"].detailMessage) || this;
|
|
2691
|
-
}
|
|
2692
|
-
return _this;
|
|
2693
|
-
}
|
|
2694
|
-
return Scorm2004ValidationError;
|
|
2695
|
-
}(ValidationError));
|
|
2780
|
+
}(_exceptions__WEBPACK_IMPORTED_MODULE_0__.ValidationError));
|
|
2696
2781
|
|
|
2697
2782
|
|
|
2698
2783
|
|
|
@@ -2701,16 +2786,24 @@ var Scorm2004ValidationError = (function (_super) {
|
|
|
2701
2786
|
/***/ 864:
|
|
2702
2787
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2703
2788
|
|
|
2789
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2704
2790
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2705
|
-
/* harmony export */
|
|
2706
|
-
/* harmony export */
|
|
2707
|
-
/* harmony export */
|
|
2708
|
-
/* harmony export */
|
|
2709
|
-
/* harmony export */
|
|
2710
|
-
/* harmony export */
|
|
2711
|
-
/* harmony export */
|
|
2791
|
+
/* harmony export */ SECONDS_PER_DAY: function() { return /* binding */ SECONDS_PER_DAY; },
|
|
2792
|
+
/* harmony export */ SECONDS_PER_HOUR: function() { return /* binding */ SECONDS_PER_HOUR; },
|
|
2793
|
+
/* harmony export */ SECONDS_PER_MINUTE: function() { return /* binding */ SECONDS_PER_MINUTE; },
|
|
2794
|
+
/* harmony export */ SECONDS_PER_SECOND: function() { return /* binding */ SECONDS_PER_SECOND; },
|
|
2795
|
+
/* harmony export */ addHHMMSSTimeStrings: function() { return /* binding */ addHHMMSSTimeStrings; },
|
|
2796
|
+
/* harmony export */ addTwoDurations: function() { return /* binding */ addTwoDurations; },
|
|
2797
|
+
/* harmony export */ countDecimals: function() { return /* binding */ countDecimals; },
|
|
2798
|
+
/* harmony export */ flatten: function() { return /* binding */ flatten; },
|
|
2799
|
+
/* harmony export */ formatMessage: function() { return /* binding */ formatMessage; },
|
|
2800
|
+
/* harmony export */ getDurationAsSeconds: function() { return /* binding */ getDurationAsSeconds; },
|
|
2801
|
+
/* harmony export */ getSecondsAsHHMMSS: function() { return /* binding */ getSecondsAsHHMMSS; },
|
|
2802
|
+
/* harmony export */ getSecondsAsISODuration: function() { return /* binding */ getSecondsAsISODuration; },
|
|
2803
|
+
/* harmony export */ getTimeAsSeconds: function() { return /* binding */ getTimeAsSeconds; },
|
|
2804
|
+
/* harmony export */ stringMatches: function() { return /* binding */ stringMatches; },
|
|
2805
|
+
/* harmony export */ unflatten: function() { return /* binding */ unflatten; }
|
|
2712
2806
|
/* harmony export */ });
|
|
2713
|
-
/* unused harmony exports SECONDS_PER_SECOND, SECONDS_PER_MINUTE, SECONDS_PER_HOUR, SECONDS_PER_DAY, getSecondsAsISODuration, getDurationAsSeconds, addTwoDurations, countDecimals */
|
|
2714
2807
|
var SECONDS_PER_SECOND = 1.0;
|
|
2715
2808
|
var SECONDS_PER_MINUTE = 60;
|
|
2716
2809
|
var SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;
|
|
@@ -2902,13 +2995,40 @@ function stringMatches(str, tester) {
|
|
|
2902
2995
|
/***/ 635:
|
|
2903
2996
|
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
2904
2997
|
|
|
2998
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2905
2999
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2906
|
-
/* harmony export */
|
|
2907
|
-
/* harmony export */
|
|
2908
|
-
/* harmony export */
|
|
2909
|
-
/* harmony export */
|
|
3000
|
+
/* harmony export */ __addDisposableResource: function() { return /* binding */ __addDisposableResource; },
|
|
3001
|
+
/* harmony export */ __assign: function() { return /* binding */ __assign; },
|
|
3002
|
+
/* harmony export */ __asyncDelegator: function() { return /* binding */ __asyncDelegator; },
|
|
3003
|
+
/* harmony export */ __asyncGenerator: function() { return /* binding */ __asyncGenerator; },
|
|
3004
|
+
/* harmony export */ __asyncValues: function() { return /* binding */ __asyncValues; },
|
|
3005
|
+
/* harmony export */ __await: function() { return /* binding */ __await; },
|
|
3006
|
+
/* harmony export */ __awaiter: function() { return /* binding */ __awaiter; },
|
|
3007
|
+
/* harmony export */ __classPrivateFieldGet: function() { return /* binding */ __classPrivateFieldGet; },
|
|
3008
|
+
/* harmony export */ __classPrivateFieldIn: function() { return /* binding */ __classPrivateFieldIn; },
|
|
3009
|
+
/* harmony export */ __classPrivateFieldSet: function() { return /* binding */ __classPrivateFieldSet; },
|
|
3010
|
+
/* harmony export */ __createBinding: function() { return /* binding */ __createBinding; },
|
|
3011
|
+
/* harmony export */ __decorate: function() { return /* binding */ __decorate; },
|
|
3012
|
+
/* harmony export */ __disposeResources: function() { return /* binding */ __disposeResources; },
|
|
3013
|
+
/* harmony export */ __esDecorate: function() { return /* binding */ __esDecorate; },
|
|
3014
|
+
/* harmony export */ __exportStar: function() { return /* binding */ __exportStar; },
|
|
3015
|
+
/* harmony export */ __extends: function() { return /* binding */ __extends; },
|
|
3016
|
+
/* harmony export */ __generator: function() { return /* binding */ __generator; },
|
|
3017
|
+
/* harmony export */ __importDefault: function() { return /* binding */ __importDefault; },
|
|
3018
|
+
/* harmony export */ __importStar: function() { return /* binding */ __importStar; },
|
|
3019
|
+
/* harmony export */ __makeTemplateObject: function() { return /* binding */ __makeTemplateObject; },
|
|
3020
|
+
/* harmony export */ __metadata: function() { return /* binding */ __metadata; },
|
|
3021
|
+
/* harmony export */ __param: function() { return /* binding */ __param; },
|
|
3022
|
+
/* harmony export */ __propKey: function() { return /* binding */ __propKey; },
|
|
3023
|
+
/* harmony export */ __read: function() { return /* binding */ __read; },
|
|
3024
|
+
/* harmony export */ __rest: function() { return /* binding */ __rest; },
|
|
3025
|
+
/* harmony export */ __runInitializers: function() { return /* binding */ __runInitializers; },
|
|
3026
|
+
/* harmony export */ __setFunctionName: function() { return /* binding */ __setFunctionName; },
|
|
3027
|
+
/* harmony export */ __spread: function() { return /* binding */ __spread; },
|
|
3028
|
+
/* harmony export */ __spreadArray: function() { return /* binding */ __spreadArray; },
|
|
3029
|
+
/* harmony export */ __spreadArrays: function() { return /* binding */ __spreadArrays; },
|
|
3030
|
+
/* harmony export */ __values: function() { return /* binding */ __values; }
|
|
2910
3031
|
/* harmony export */ });
|
|
2911
|
-
/* unused harmony exports __rest, __decorate, __param, __esDecorate, __runInitializers, __propKey, __setFunctionName, __metadata, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn, __addDisposableResource, __disposeResources */
|
|
2912
3032
|
/******************************************************************************
|
|
2913
3033
|
Copyright (c) Microsoft Corporation.
|
|
2914
3034
|
|
|
@@ -3258,7 +3378,7 @@ function __disposeResources(env) {
|
|
|
3258
3378
|
return next();
|
|
3259
3379
|
}
|
|
3260
3380
|
|
|
3261
|
-
/*
|
|
3381
|
+
/* harmony default export */ __webpack_exports__["default"] = ({
|
|
3262
3382
|
__extends,
|
|
3263
3383
|
__assign,
|
|
3264
3384
|
__rest,
|
|
@@ -3335,10 +3455,22 @@ function __disposeResources(env) {
|
|
|
3335
3455
|
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
|
|
3336
3456
|
/******/ }();
|
|
3337
3457
|
/******/
|
|
3458
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
3459
|
+
/******/ !function() {
|
|
3460
|
+
/******/ // define __esModule on exports
|
|
3461
|
+
/******/ __webpack_require__.r = function(exports) {
|
|
3462
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
3463
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
3464
|
+
/******/ }
|
|
3465
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
3466
|
+
/******/ };
|
|
3467
|
+
/******/ }();
|
|
3468
|
+
/******/
|
|
3338
3469
|
/************************************************************************/
|
|
3339
3470
|
var __webpack_exports__ = {};
|
|
3471
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3340
3472
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3341
|
-
/* harmony export */
|
|
3473
|
+
/* harmony export */ Scorm12Impl: function() { return /* binding */ Scorm12Impl; }
|
|
3342
3474
|
/* harmony export */ });
|
|
3343
3475
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(635);
|
|
3344
3476
|
/* harmony import */ var _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(989);
|
|
@@ -3348,9 +3480,9 @@ var __webpack_exports__ = {};
|
|
|
3348
3480
|
/* harmony import */ var _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(176);
|
|
3349
3481
|
/* harmony import */ var _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(833);
|
|
3350
3482
|
/* harmony import */ var _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(331);
|
|
3351
|
-
/* harmony import */ var
|
|
3352
|
-
/* harmony import */ var
|
|
3353
|
-
/* harmony import */ var
|
|
3483
|
+
/* harmony import */ var _constants_enums__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(56);
|
|
3484
|
+
/* harmony import */ var _BaseAPI__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(429);
|
|
3485
|
+
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(417);
|
|
3354
3486
|
|
|
3355
3487
|
|
|
3356
3488
|
|
|
@@ -3364,7 +3496,7 @@ var __webpack_exports__ = {};
|
|
|
3364
3496
|
|
|
3365
3497
|
|
|
3366
3498
|
var Scorm12Impl = (function (_super) {
|
|
3367
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
3499
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_10__.__extends)(Scorm12Impl, _super);
|
|
3368
3500
|
function Scorm12Impl(settings) {
|
|
3369
3501
|
var _this = this;
|
|
3370
3502
|
if (settings) {
|
|
@@ -3372,10 +3504,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
3372
3504
|
settings.mastery_override = false;
|
|
3373
3505
|
}
|
|
3374
3506
|
}
|
|
3375
|
-
_this = _super.call(this, _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__
|
|
3507
|
+
_this = _super.call(this, _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors, settings) || this;
|
|
3376
3508
|
_this.statusSetByModule = false;
|
|
3377
|
-
_this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
3378
|
-
_this.nav = new _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__
|
|
3509
|
+
_this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__.CMI();
|
|
3510
|
+
_this.nav = new _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__.NAV();
|
|
3379
3511
|
_this.LMSInitialize = _this.lmsInitialize;
|
|
3380
3512
|
_this.LMSFinish = _this.lmsFinish;
|
|
3381
3513
|
_this.LMSGetValue = _this.lmsGetValue;
|
|
@@ -3387,9 +3519,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
3387
3519
|
return _this;
|
|
3388
3520
|
}
|
|
3389
3521
|
Scorm12Impl.prototype.reset = function (settings) {
|
|
3522
|
+
var _a, _b;
|
|
3390
3523
|
this.commonReset(settings);
|
|
3391
|
-
this.cmi
|
|
3392
|
-
this.nav
|
|
3524
|
+
(_a = this.cmi) === null || _a === void 0 ? void 0 : _a.reset();
|
|
3525
|
+
(_b = this.nav) === null || _b === void 0 ? void 0 : _b.reset();
|
|
3393
3526
|
};
|
|
3394
3527
|
Scorm12Impl.prototype.lmsInitialize = function () {
|
|
3395
3528
|
this.cmi.initialize();
|
|
@@ -3403,8 +3536,8 @@ var Scorm12Impl = (function (_super) {
|
|
|
3403
3536
|
};
|
|
3404
3537
|
Scorm12Impl.prototype.lmsFinish = function () {
|
|
3405
3538
|
var _this = this;
|
|
3406
|
-
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
3407
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
3539
|
+
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(_this, void 0, void 0, function () {
|
|
3540
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_a) {
|
|
3408
3541
|
switch (_a.label) {
|
|
3409
3542
|
case 0: return [4, this.internalFinish()];
|
|
3410
3543
|
case 1:
|
|
@@ -3413,17 +3546,17 @@ var Scorm12Impl = (function (_super) {
|
|
|
3413
3546
|
}
|
|
3414
3547
|
});
|
|
3415
3548
|
}); })();
|
|
3416
|
-
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
3549
|
+
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE;
|
|
3417
3550
|
};
|
|
3418
3551
|
Scorm12Impl.prototype.internalFinish = function () {
|
|
3419
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
3552
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(this, void 0, void 0, function () {
|
|
3420
3553
|
var result;
|
|
3421
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
3554
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_a) {
|
|
3422
3555
|
switch (_a.label) {
|
|
3423
3556
|
case 0: return [4, this.terminate("LMSFinish", true)];
|
|
3424
3557
|
case 1:
|
|
3425
3558
|
result = _a.sent();
|
|
3426
|
-
if (result === _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
3559
|
+
if (result === _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE) {
|
|
3427
3560
|
if (this.nav.event !== "") {
|
|
3428
3561
|
if (this.nav.event === "continue") {
|
|
3429
3562
|
this.processListeners("SequenceNext");
|
|
@@ -3456,8 +3589,8 @@ var Scorm12Impl = (function (_super) {
|
|
|
3456
3589
|
this.scheduleCommit(500, "LMSCommit");
|
|
3457
3590
|
}
|
|
3458
3591
|
else {
|
|
3459
|
-
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
3460
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
3592
|
+
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(_this, void 0, void 0, function () {
|
|
3593
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_a) {
|
|
3461
3594
|
switch (_a.label) {
|
|
3462
3595
|
case 0: return [4, this.commit("LMSCommit", false)];
|
|
3463
3596
|
case 1:
|
|
@@ -3467,7 +3600,7 @@ var Scorm12Impl = (function (_super) {
|
|
|
3467
3600
|
});
|
|
3468
3601
|
}); })();
|
|
3469
3602
|
}
|
|
3470
|
-
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
3603
|
+
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE;
|
|
3471
3604
|
};
|
|
3472
3605
|
Scorm12Impl.prototype.lmsGetLastError = function () {
|
|
3473
3606
|
return this.getLastError("LMSGetLastError");
|
|
@@ -3485,20 +3618,20 @@ var Scorm12Impl = (function (_super) {
|
|
|
3485
3618
|
return this._commonGetCMIValue("getCMIValue", false, CMIElement);
|
|
3486
3619
|
};
|
|
3487
3620
|
Scorm12Impl.prototype.getChildElement = function (CMIElement, _value, foundFirstIndex) {
|
|
3488
|
-
if ((0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
3489
|
-
return new _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__
|
|
3621
|
+
if ((0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.objectives\\.\\d+")) {
|
|
3622
|
+
return new _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__.CMIObjectivesObject();
|
|
3490
3623
|
}
|
|
3491
3624
|
else if (foundFirstIndex &&
|
|
3492
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
3493
|
-
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__
|
|
3625
|
+
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) {
|
|
3626
|
+
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__.CMIInteractionsCorrectResponsesObject();
|
|
3494
3627
|
}
|
|
3495
3628
|
else if (foundFirstIndex &&
|
|
3496
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
3497
|
-
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__
|
|
3629
|
+
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) {
|
|
3630
|
+
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__.CMIInteractionsObjectivesObject();
|
|
3498
3631
|
}
|
|
3499
3632
|
else if (!foundFirstIndex &&
|
|
3500
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
3501
|
-
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__
|
|
3633
|
+
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+")) {
|
|
3634
|
+
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__.CMIInteractionsObject();
|
|
3502
3635
|
}
|
|
3503
3636
|
return null;
|
|
3504
3637
|
};
|
|
@@ -3508,11 +3641,11 @@ var Scorm12Impl = (function (_super) {
|
|
|
3508
3641
|
var basicMessage = "No Error";
|
|
3509
3642
|
var detailMessage = "No Error";
|
|
3510
3643
|
errorNumber = String(errorNumber);
|
|
3511
|
-
if (_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
3644
|
+
if (_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber]) {
|
|
3512
3645
|
basicMessage =
|
|
3513
|
-
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
3646
|
+
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber].basicMessage;
|
|
3514
3647
|
detailMessage =
|
|
3515
|
-
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
3648
|
+
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber].detailMessage;
|
|
3516
3649
|
}
|
|
3517
3650
|
return detail ? detailMessage : basicMessage;
|
|
3518
3651
|
};
|
|
@@ -3525,10 +3658,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
3525
3658
|
cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();
|
|
3526
3659
|
}
|
|
3527
3660
|
var result = [];
|
|
3528
|
-
var flattened = _utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
3661
|
+
var flattened = _utilities__WEBPACK_IMPORTED_MODULE_1__.flatten(cmiExport);
|
|
3529
3662
|
switch (this.settings.dataCommitFormat) {
|
|
3530
3663
|
case "flattened":
|
|
3531
|
-
return _utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
3664
|
+
return _utilities__WEBPACK_IMPORTED_MODULE_1__.flatten(cmiExport);
|
|
3532
3665
|
case "params":
|
|
3533
3666
|
for (var item in flattened) {
|
|
3534
3667
|
if ({}.hasOwnProperty.call(flattened, item)) {
|
|
@@ -3544,20 +3677,20 @@ var Scorm12Impl = (function (_super) {
|
|
|
3544
3677
|
Scorm12Impl.prototype.renderCommitObject = function (terminateCommit) {
|
|
3545
3678
|
var cmiExport = this.renderCommitCMI(terminateCommit);
|
|
3546
3679
|
var totalTimeHHMMSS = this.cmi.getCurrentTotalTime();
|
|
3547
|
-
var totalTimeSeconds = _utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
3680
|
+
var totalTimeSeconds = _utilities__WEBPACK_IMPORTED_MODULE_1__.getTimeAsSeconds(totalTimeHHMMSS, _constants_regex__WEBPACK_IMPORTED_MODULE_9__.scorm12_regex.CMITimespan);
|
|
3548
3681
|
var lessonStatus = this.cmi.core.lesson_status;
|
|
3549
|
-
var completionStatus =
|
|
3550
|
-
var successStatus =
|
|
3682
|
+
var completionStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.unknown;
|
|
3683
|
+
var successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.unknown;
|
|
3551
3684
|
if (lessonStatus) {
|
|
3552
3685
|
completionStatus =
|
|
3553
3686
|
lessonStatus === "completed" || lessonStatus === "passed"
|
|
3554
|
-
?
|
|
3555
|
-
:
|
|
3687
|
+
? _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.completed
|
|
3688
|
+
: _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.incomplete;
|
|
3556
3689
|
if (lessonStatus === "passed") {
|
|
3557
|
-
successStatus =
|
|
3690
|
+
successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.passed;
|
|
3558
3691
|
}
|
|
3559
3692
|
else if (lessonStatus === "failed") {
|
|
3560
|
-
successStatus =
|
|
3693
|
+
successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.failed;
|
|
3561
3694
|
}
|
|
3562
3695
|
}
|
|
3563
3696
|
var score = this.cmi.core.score;
|
|
@@ -3586,10 +3719,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
3586
3719
|
return commitObject;
|
|
3587
3720
|
};
|
|
3588
3721
|
Scorm12Impl.prototype.storeData = function (terminateCommit) {
|
|
3589
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
3722
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(this, void 0, void 0, function () {
|
|
3590
3723
|
var originalStatus, commitObject;
|
|
3591
3724
|
var _a, _b, _c;
|
|
3592
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
3725
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_d) {
|
|
3593
3726
|
switch (_d.label) {
|
|
3594
3727
|
case 0:
|
|
3595
3728
|
if (terminateCommit) {
|
|
@@ -3624,7 +3757,7 @@ var Scorm12Impl = (function (_super) {
|
|
|
3624
3757
|
return [4, this.processHttpRequest(this.settings.lmsCommitUrl, commitObject, terminateCommit)];
|
|
3625
3758
|
case 1: return [2, _d.sent()];
|
|
3626
3759
|
case 2: return [2, {
|
|
3627
|
-
result: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
3760
|
+
result: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE,
|
|
3628
3761
|
errorCode: 0,
|
|
3629
3762
|
}];
|
|
3630
3763
|
}
|
|
@@ -3632,10 +3765,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
3632
3765
|
});
|
|
3633
3766
|
};
|
|
3634
3767
|
return Scorm12Impl;
|
|
3635
|
-
}(
|
|
3768
|
+
}(_BaseAPI__WEBPACK_IMPORTED_MODULE_8__["default"]));
|
|
3636
3769
|
|
|
3637
3770
|
|
|
3638
|
-
var __webpack_exports__Scorm12Impl = __webpack_exports__.
|
|
3771
|
+
var __webpack_exports__Scorm12Impl = __webpack_exports__.Scorm12Impl;
|
|
3639
3772
|
export { __webpack_exports__Scorm12Impl as Scorm12Impl };
|
|
3640
3773
|
|
|
3641
3774
|
//# sourceMappingURL=scorm12.js.map
|