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