scorm-again 2.4.1 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -23
- package/dist/aicc.js +676 -493
- package/dist/aicc.js.map +1 -1
- package/dist/aicc.min.js +1 -1
- package/dist/aicc.min.js.map +1 -1
- package/dist/esm/aicc.js +692 -496
- package/dist/esm/aicc.js.map +1 -1
- package/dist/esm/aicc.min.js +1 -1
- package/dist/esm/aicc.min.js.map +1 -1
- package/dist/esm/scorm-again.js +1151 -743
- package/dist/esm/scorm-again.js.map +1 -1
- package/dist/esm/scorm-again.min.js +1 -1
- package/dist/esm/scorm-again.min.js.map +1 -1
- package/dist/esm/scorm12.js +534 -401
- package/dist/esm/scorm12.js.map +1 -1
- package/dist/esm/scorm12.min.js +1 -1
- package/dist/esm/scorm12.min.js.map +1 -1
- package/dist/esm/scorm2004.js +712 -465
- package/dist/esm/scorm2004.js.map +1 -1
- package/dist/esm/scorm2004.min.js +1 -1
- package/dist/esm/scorm2004.min.js.map +1 -1
- package/dist/scorm-again.js +1127 -731
- package/dist/scorm-again.js.map +1 -1
- package/dist/scorm-again.min.js +1 -1
- package/dist/scorm-again.min.js.map +1 -1
- package/dist/scorm12.js +521 -400
- package/dist/scorm12.js.map +1 -1
- package/dist/scorm12.min.js +1 -1
- package/dist/scorm12.min.js.map +1 -1
- package/dist/scorm2004.js +698 -464
- package/dist/scorm2004.js.map +1 -1
- package/dist/scorm2004.min.js +1 -1
- package/dist/scorm2004.min.js.map +1 -1
- package/package.json +15 -15
- package/src/AICC.ts +3 -0
- package/src/BaseAPI.ts +60 -95
- package/src/Scorm12API.ts +14 -14
- package/src/Scorm2004API.ts +107 -37
- package/src/cmi/aicc/attempts.ts +22 -12
- package/src/cmi/aicc/cmi.ts +2 -2
- package/src/cmi/aicc/core.ts +44 -26
- package/src/cmi/aicc/evaluation.ts +31 -12
- package/src/cmi/aicc/paths.ts +29 -15
- package/src/cmi/aicc/student_data.ts +14 -5
- package/src/cmi/aicc/student_demographics.ts +31 -24
- package/src/cmi/aicc/student_preferences.ts +11 -11
- package/src/cmi/aicc/tries.ts +24 -14
- package/src/cmi/aicc/validation.ts +3 -4
- package/src/cmi/common/array.ts +17 -5
- package/src/cmi/common/base_cmi.ts +3 -1
- package/src/cmi/common/score.ts +16 -13
- package/src/cmi/scorm12/cmi.ts +25 -10
- package/src/cmi/scorm12/interactions.ts +62 -28
- package/src/cmi/scorm12/nav.ts +13 -5
- package/src/cmi/scorm12/objectives.ts +28 -18
- package/src/cmi/scorm12/student_data.ts +15 -8
- package/src/cmi/scorm12/student_preference.ts +20 -13
- package/src/cmi/scorm12/validation.ts +7 -7
- package/src/cmi/scorm2004/adl.ts +141 -25
- package/src/cmi/scorm2004/cmi.ts +50 -55
- package/src/cmi/scorm2004/comments.ts +21 -20
- package/src/cmi/scorm2004/interactions.ts +73 -32
- package/src/cmi/scorm2004/learner_preference.ts +20 -13
- package/src/cmi/scorm2004/objectives.ts +41 -16
- package/src/cmi/scorm2004/score.ts +22 -11
- package/src/cmi/scorm2004/validation.ts +4 -4
- package/src/constants/api_constants.ts +8 -29
- package/src/constants/default_settings.ts +26 -12
- package/src/constants/enums.ts +9 -0
- package/src/constants/error_codes.ts +5 -12
- package/src/constants/regex.ts +5 -11
- package/src/constants/response_constants.ts +1 -2
- package/src/exceptions/aicc_exceptions.ts +29 -0
- package/src/exceptions/scorm12_exceptions.ts +29 -0
- package/src/exceptions/scorm2004_exceptions.ts +29 -0
- package/src/exceptions.ts +1 -86
- package/src/types/api_types.ts +29 -5
- package/test/AICC.spec.ts +114 -43
- package/test/Scorm12API.spec.ts +37 -39
- package/test/Scorm2004API.spec.ts +165 -80
- package/test/cmi/aicc_cmi.spec.ts +6 -9
- package/test/cmi/scorm12_cmi.spec.ts +8 -8
- package/test/cmi/scorm2004_cmi.spec.ts +8 -9
- package/test/exceptions.spec.ts +11 -9
- package/test/types/api_types.spec.ts +40 -47
- package/test/utilities.spec.ts +1 -4
- package/webpack.config.js +4 -0
package/dist/esm/aicc.js
CHANGED
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
/***/ 429:
|
|
4
4
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5
5
|
|
|
6
|
+
// ESM COMPAT FLAG
|
|
7
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6
8
|
|
|
7
9
|
// EXPORTS
|
|
8
10
|
__webpack_require__.d(__webpack_exports__, {
|
|
9
|
-
|
|
11
|
+
"default": function() { return /* binding */ src_BaseAPI; }
|
|
10
12
|
});
|
|
11
13
|
|
|
12
14
|
// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs
|
|
@@ -15,15 +17,16 @@ var tslib_es6 = __webpack_require__(635);
|
|
|
15
17
|
var array = __webpack_require__(589);
|
|
16
18
|
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
17
19
|
var exceptions = __webpack_require__(784);
|
|
18
|
-
// EXTERNAL MODULE: ./src/constants/error_codes.ts
|
|
19
|
-
var error_codes = __webpack_require__(797);
|
|
20
20
|
// EXTERNAL MODULE: ./src/constants/api_constants.ts
|
|
21
21
|
var api_constants = __webpack_require__(340);
|
|
22
22
|
// EXTERNAL MODULE: ./src/utilities.ts
|
|
23
23
|
var utilities = __webpack_require__(864);
|
|
24
|
+
// EXTERNAL MODULE: ./src/constants/enums.ts
|
|
25
|
+
var enums = __webpack_require__(56);
|
|
24
26
|
;// ./src/constants/default_settings.ts
|
|
25
27
|
|
|
26
28
|
|
|
29
|
+
|
|
27
30
|
var DefaultSettings = {
|
|
28
31
|
autocommit: false,
|
|
29
32
|
autocommitSeconds: 10,
|
|
@@ -33,7 +36,7 @@ var DefaultSettings = {
|
|
|
33
36
|
dataCommitFormat: "json",
|
|
34
37
|
commitRequestDataType: "application/json;charset=UTF-8",
|
|
35
38
|
autoProgress: false,
|
|
36
|
-
logLevel:
|
|
39
|
+
logLevel: enums.LogLevelEnum.ERROR,
|
|
37
40
|
selfReportSessionTime: false,
|
|
38
41
|
alwaysSendTotalTime: false,
|
|
39
42
|
renderCommonCommitFields: false,
|
|
@@ -42,9 +45,9 @@ var DefaultSettings = {
|
|
|
42
45
|
xhrWithCredentials: false,
|
|
43
46
|
fetchMode: "cors",
|
|
44
47
|
responseHandler: function (response) {
|
|
45
|
-
return (0,tslib_es6
|
|
48
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
46
49
|
var responseText, httpResult;
|
|
47
|
-
return (0,tslib_es6
|
|
50
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
48
51
|
switch (_a.label) {
|
|
49
52
|
case 0:
|
|
50
53
|
if (!(typeof response !== "undefined")) return [3, 2];
|
|
@@ -59,13 +62,13 @@ var DefaultSettings = {
|
|
|
59
62
|
!{}.hasOwnProperty.call(httpResult, "result")) {
|
|
60
63
|
if (response.status === 200) {
|
|
61
64
|
return [2, {
|
|
62
|
-
result: api_constants
|
|
65
|
+
result: api_constants.global_constants.SCORM_TRUE,
|
|
63
66
|
errorCode: 0,
|
|
64
67
|
}];
|
|
65
68
|
}
|
|
66
69
|
else {
|
|
67
70
|
return [2, {
|
|
68
|
-
result: api_constants
|
|
71
|
+
result: api_constants.global_constants.SCORM_FALSE,
|
|
69
72
|
errorCode: 101,
|
|
70
73
|
}];
|
|
71
74
|
}
|
|
@@ -75,14 +78,14 @@ var DefaultSettings = {
|
|
|
75
78
|
result: httpResult.result,
|
|
76
79
|
errorCode: httpResult.errorCode
|
|
77
80
|
? httpResult.errorCode
|
|
78
|
-
: httpResult.result === api_constants
|
|
81
|
+
: httpResult.result === api_constants.global_constants.SCORM_TRUE
|
|
79
82
|
? 0
|
|
80
83
|
: 101,
|
|
81
84
|
}];
|
|
82
85
|
}
|
|
83
86
|
_a.label = 2;
|
|
84
87
|
case 2: return [2, {
|
|
85
|
-
result: api_constants
|
|
88
|
+
result: api_constants.global_constants.SCORM_FALSE,
|
|
86
89
|
errorCode: 101,
|
|
87
90
|
}];
|
|
88
91
|
}
|
|
@@ -94,16 +97,28 @@ var DefaultSettings = {
|
|
|
94
97
|
},
|
|
95
98
|
onLogMessage: function (messageLevel, logMessage) {
|
|
96
99
|
switch (messageLevel) {
|
|
97
|
-
case
|
|
100
|
+
case "4":
|
|
101
|
+
case 4:
|
|
102
|
+
case "ERROR":
|
|
103
|
+
case enums.LogLevelEnum.ERROR:
|
|
98
104
|
console.error(logMessage);
|
|
99
105
|
break;
|
|
100
|
-
case
|
|
106
|
+
case "3":
|
|
107
|
+
case 3:
|
|
108
|
+
case "WARN":
|
|
109
|
+
case enums.LogLevelEnum.WARN:
|
|
101
110
|
console.warn(logMessage);
|
|
102
111
|
break;
|
|
103
|
-
case
|
|
112
|
+
case "2":
|
|
113
|
+
case 2:
|
|
114
|
+
case "INFO":
|
|
115
|
+
case enums.LogLevelEnum.INFO:
|
|
104
116
|
console.info(logMessage);
|
|
105
117
|
break;
|
|
106
|
-
case
|
|
118
|
+
case "1":
|
|
119
|
+
case 1:
|
|
120
|
+
case "DEBUG":
|
|
121
|
+
case enums.LogLevelEnum.DEBUG:
|
|
107
122
|
if (console.debug) {
|
|
108
123
|
console.debug(logMessage);
|
|
109
124
|
}
|
|
@@ -115,6 +130,7 @@ var DefaultSettings = {
|
|
|
115
130
|
},
|
|
116
131
|
scoItemIds: [],
|
|
117
132
|
scoItemIdValidator: false,
|
|
133
|
+
globalObjectiveIds: [],
|
|
118
134
|
};
|
|
119
135
|
|
|
120
136
|
;// ./src/helpers/scheduled_commit.ts
|
|
@@ -135,7 +151,7 @@ var ScheduledCommit = (function () {
|
|
|
135
151
|
ScheduledCommit.prototype.wrapper = function () {
|
|
136
152
|
var _this = this;
|
|
137
153
|
if (!this._cancelled) {
|
|
138
|
-
(function () { return (0,tslib_es6
|
|
154
|
+
(function () { return (0,tslib_es6.__awaiter)(_this, void 0, void 0, function () { return (0,tslib_es6.__generator)(this, function (_a) {
|
|
139
155
|
switch (_a.label) {
|
|
140
156
|
case 0: return [4, this._API.commit(this._callback)];
|
|
141
157
|
case 1: return [2, _a.sent()];
|
|
@@ -163,7 +179,7 @@ var BaseAPI = (function () {
|
|
|
163
179
|
if (_newTarget === BaseAPI) {
|
|
164
180
|
throw new TypeError("Cannot construct BaseAPI instances directly");
|
|
165
181
|
}
|
|
166
|
-
this.currentState = api_constants
|
|
182
|
+
this.currentState = api_constants.global_constants.STATE_NOT_INITIALIZED;
|
|
167
183
|
this.lastErrorCode = "0";
|
|
168
184
|
this.listenerArray = [];
|
|
169
185
|
this._error_codes = error_codes;
|
|
@@ -172,15 +188,21 @@ var BaseAPI = (function () {
|
|
|
172
188
|
}
|
|
173
189
|
this.apiLogLevel = this.settings.logLevel;
|
|
174
190
|
this.selfReportSessionTime = this.settings.selfReportSessionTime;
|
|
191
|
+
if (this.apiLogLevel === undefined) {
|
|
192
|
+
this.apiLogLevel = enums.LogLevelEnum.NONE;
|
|
193
|
+
}
|
|
175
194
|
}
|
|
176
195
|
BaseAPI.prototype.commonReset = function (settings) {
|
|
177
|
-
this.
|
|
178
|
-
this.
|
|
196
|
+
this.apiLog("reset", "Called", enums.LogLevelEnum.INFO);
|
|
197
|
+
this.settings = (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, this.settings), settings);
|
|
198
|
+
this.clearScheduledCommit();
|
|
199
|
+
this.currentState = api_constants.global_constants.STATE_NOT_INITIALIZED;
|
|
179
200
|
this.lastErrorCode = "0";
|
|
180
201
|
this.listenerArray = [];
|
|
202
|
+
this.startingData = undefined;
|
|
181
203
|
};
|
|
182
204
|
BaseAPI.prototype.initialize = function (callbackName, initializeMessage, terminationMessage) {
|
|
183
|
-
var returnValue = api_constants
|
|
205
|
+
var returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
184
206
|
if (this.isInitialized()) {
|
|
185
207
|
this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);
|
|
186
208
|
}
|
|
@@ -191,17 +213,17 @@ var BaseAPI = (function () {
|
|
|
191
213
|
if (this.selfReportSessionTime) {
|
|
192
214
|
this.cmi.setStartTime();
|
|
193
215
|
}
|
|
194
|
-
this.currentState = api_constants
|
|
216
|
+
this.currentState = api_constants.global_constants.STATE_INITIALIZED;
|
|
195
217
|
this.lastErrorCode = "0";
|
|
196
|
-
returnValue = api_constants
|
|
218
|
+
returnValue = api_constants.global_constants.SCORM_TRUE;
|
|
197
219
|
this.processListeners(callbackName);
|
|
198
220
|
}
|
|
199
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
221
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
200
222
|
this.clearSCORMError(returnValue);
|
|
201
223
|
return returnValue;
|
|
202
224
|
};
|
|
203
225
|
BaseAPI.prototype.apiLog = function (functionName, logMessage, messageLevel, CMIElement) {
|
|
204
|
-
logMessage = (0,utilities
|
|
226
|
+
logMessage = (0,utilities.formatMessage)(functionName, logMessage, CMIElement);
|
|
205
227
|
if (messageLevel >= this.apiLogLevel) {
|
|
206
228
|
this.settings.onLogMessage(messageLevel, logMessage);
|
|
207
229
|
}
|
|
@@ -218,20 +240,20 @@ var BaseAPI = (function () {
|
|
|
218
240
|
return this._settings;
|
|
219
241
|
},
|
|
220
242
|
set: function (settings) {
|
|
221
|
-
this._settings = (0,tslib_es6
|
|
243
|
+
this._settings = (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, this._settings), settings);
|
|
222
244
|
},
|
|
223
245
|
enumerable: false,
|
|
224
246
|
configurable: true
|
|
225
247
|
});
|
|
226
248
|
BaseAPI.prototype.terminate = function (callbackName, checkTerminated) {
|
|
227
|
-
return (0,tslib_es6
|
|
249
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
228
250
|
var returnValue, result;
|
|
229
|
-
return (0,tslib_es6
|
|
251
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
230
252
|
switch (_a.label) {
|
|
231
253
|
case 0:
|
|
232
|
-
returnValue = api_constants
|
|
254
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
233
255
|
if (!this.checkState(checkTerminated, this._error_codes.TERMINATION_BEFORE_INIT, this._error_codes.MULTIPLE_TERMINATION)) return [3, 2];
|
|
234
|
-
this.currentState = api_constants
|
|
256
|
+
this.currentState = api_constants.global_constants.STATE_TERMINATED;
|
|
235
257
|
return [4, this.storeData(true)];
|
|
236
258
|
case 1:
|
|
237
259
|
result = _a.sent();
|
|
@@ -241,14 +263,14 @@ var BaseAPI = (function () {
|
|
|
241
263
|
returnValue =
|
|
242
264
|
typeof result !== "undefined" && result.result
|
|
243
265
|
? result.result
|
|
244
|
-
: api_constants
|
|
266
|
+
: api_constants.global_constants.SCORM_FALSE;
|
|
245
267
|
if (checkTerminated)
|
|
246
268
|
this.lastErrorCode = "0";
|
|
247
|
-
returnValue = api_constants
|
|
269
|
+
returnValue = api_constants.global_constants.SCORM_TRUE;
|
|
248
270
|
this.processListeners(callbackName);
|
|
249
271
|
_a.label = 2;
|
|
250
272
|
case 2:
|
|
251
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
273
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
252
274
|
this.clearSCORMError(returnValue);
|
|
253
275
|
return [2, returnValue];
|
|
254
276
|
}
|
|
@@ -268,7 +290,7 @@ var BaseAPI = (function () {
|
|
|
268
290
|
}
|
|
269
291
|
this.processListeners(callbackName, CMIElement);
|
|
270
292
|
}
|
|
271
|
-
this.apiLog(callbackName, ": returned: " + returnValue,
|
|
293
|
+
this.apiLog(callbackName, ": returned: " + returnValue, enums.LogLevelEnum.INFO, CMIElement);
|
|
272
294
|
if (returnValue === undefined) {
|
|
273
295
|
return "";
|
|
274
296
|
}
|
|
@@ -279,7 +301,7 @@ var BaseAPI = (function () {
|
|
|
279
301
|
if (value !== undefined) {
|
|
280
302
|
value = String(value);
|
|
281
303
|
}
|
|
282
|
-
var returnValue = api_constants
|
|
304
|
+
var returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
283
305
|
if (this.checkState(checkTerminated, this._error_codes.STORE_BEFORE_INIT, this._error_codes.STORE_AFTER_TERM)) {
|
|
284
306
|
if (checkTerminated)
|
|
285
307
|
this.lastErrorCode = "0";
|
|
@@ -292,27 +314,26 @@ var BaseAPI = (function () {
|
|
|
292
314
|
this.processListeners(callbackName, CMIElement, value);
|
|
293
315
|
}
|
|
294
316
|
if (returnValue === undefined) {
|
|
295
|
-
returnValue = api_constants
|
|
317
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
296
318
|
}
|
|
297
319
|
if (String(this.lastErrorCode) === "0") {
|
|
298
320
|
if (this.settings.autocommit) {
|
|
299
321
|
this.scheduleCommit(this.settings.autocommitSeconds * 1000, commitCallback);
|
|
300
322
|
}
|
|
301
323
|
}
|
|
302
|
-
this.apiLog(callbackName, ": " + value + ": result: " + returnValue,
|
|
324
|
+
this.apiLog(callbackName, ": " + value + ": result: " + returnValue, enums.LogLevelEnum.INFO, CMIElement);
|
|
303
325
|
this.clearSCORMError(returnValue);
|
|
304
326
|
return returnValue;
|
|
305
327
|
};
|
|
306
328
|
BaseAPI.prototype.commit = function (callbackName_1) {
|
|
307
|
-
return (0,tslib_es6
|
|
329
|
+
return (0,tslib_es6.__awaiter)(this, arguments, void 0, function (callbackName, checkTerminated) {
|
|
308
330
|
var returnValue, result;
|
|
309
331
|
if (checkTerminated === void 0) { checkTerminated = false; }
|
|
310
|
-
return (0,tslib_es6
|
|
332
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
311
333
|
switch (_a.label) {
|
|
312
334
|
case 0:
|
|
313
|
-
console.log("commit");
|
|
314
335
|
this.clearScheduledCommit();
|
|
315
|
-
returnValue = api_constants
|
|
336
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
316
337
|
if (!this.checkState(checkTerminated, this._error_codes.COMMIT_BEFORE_INIT, this._error_codes.COMMIT_AFTER_TERM)) return [3, 2];
|
|
317
338
|
return [4, this.storeData(false)];
|
|
318
339
|
case 1:
|
|
@@ -323,14 +344,14 @@ var BaseAPI = (function () {
|
|
|
323
344
|
returnValue =
|
|
324
345
|
typeof result !== "undefined" && result.result
|
|
325
346
|
? result.result
|
|
326
|
-
: api_constants
|
|
327
|
-
this.apiLog(callbackName, " Result: " + returnValue,
|
|
347
|
+
: api_constants.global_constants.SCORM_FALSE;
|
|
348
|
+
this.apiLog(callbackName, " Result: " + returnValue, enums.LogLevelEnum.DEBUG, "HttpRequest");
|
|
328
349
|
if (checkTerminated)
|
|
329
350
|
this.lastErrorCode = "0";
|
|
330
351
|
this.processListeners(callbackName);
|
|
331
352
|
_a.label = 2;
|
|
332
353
|
case 2:
|
|
333
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
354
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
334
355
|
this.clearSCORMError(returnValue);
|
|
335
356
|
return [2, returnValue];
|
|
336
357
|
}
|
|
@@ -340,7 +361,7 @@ var BaseAPI = (function () {
|
|
|
340
361
|
BaseAPI.prototype.getLastError = function (callbackName) {
|
|
341
362
|
var returnValue = String(this.lastErrorCode);
|
|
342
363
|
this.processListeners(callbackName);
|
|
343
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
364
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
344
365
|
return returnValue;
|
|
345
366
|
};
|
|
346
367
|
BaseAPI.prototype.getErrorString = function (callbackName, CMIErrorCode) {
|
|
@@ -349,7 +370,7 @@ var BaseAPI = (function () {
|
|
|
349
370
|
returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);
|
|
350
371
|
this.processListeners(callbackName);
|
|
351
372
|
}
|
|
352
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
373
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
353
374
|
return returnValue;
|
|
354
375
|
};
|
|
355
376
|
BaseAPI.prototype.getDiagnostic = function (callbackName, CMIErrorCode) {
|
|
@@ -358,7 +379,7 @@ var BaseAPI = (function () {
|
|
|
358
379
|
returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);
|
|
359
380
|
this.processListeners(callbackName);
|
|
360
381
|
}
|
|
361
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
382
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
362
383
|
return returnValue;
|
|
363
384
|
};
|
|
364
385
|
BaseAPI.prototype.checkState = function (checkTerminated, beforeInitError, afterTermError) {
|
|
@@ -384,11 +405,11 @@ var BaseAPI = (function () {
|
|
|
384
405
|
};
|
|
385
406
|
BaseAPI.prototype._commonSetCMIValue = function (methodName, scorm2004, CMIElement, value) {
|
|
386
407
|
if (!CMIElement || CMIElement === "") {
|
|
387
|
-
return api_constants
|
|
408
|
+
return api_constants.global_constants.SCORM_FALSE;
|
|
388
409
|
}
|
|
389
410
|
var structure = CMIElement.split(".");
|
|
390
411
|
var refObject = this;
|
|
391
|
-
var returnValue = api_constants
|
|
412
|
+
var returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
392
413
|
var foundFirstIndex = false;
|
|
393
414
|
var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element.");
|
|
394
415
|
var invalidErrorCode = scorm2004
|
|
@@ -402,20 +423,20 @@ var BaseAPI = (function () {
|
|
|
402
423
|
this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);
|
|
403
424
|
}
|
|
404
425
|
else {
|
|
405
|
-
refObject = (0,tslib_es6
|
|
426
|
+
refObject = (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, refObject), { attribute: value });
|
|
406
427
|
}
|
|
407
428
|
}
|
|
408
429
|
else if (!this._checkObjectHasProperty(refObject, attribute)) {
|
|
409
430
|
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
410
431
|
}
|
|
411
432
|
else {
|
|
412
|
-
if ((0,utilities
|
|
433
|
+
if ((0,utilities.stringMatches)(CMIElement, "\\.correct_responses\\.\\d+") &&
|
|
413
434
|
this.isInitialized()) {
|
|
414
435
|
this.validateCorrectResponse(CMIElement, value);
|
|
415
436
|
}
|
|
416
437
|
if (!scorm2004 || this.lastErrorCode === "0") {
|
|
417
438
|
refObject[attribute] = value;
|
|
418
|
-
returnValue = api_constants
|
|
439
|
+
returnValue = api_constants.global_constants.SCORM_TRUE;
|
|
419
440
|
}
|
|
420
441
|
}
|
|
421
442
|
}
|
|
@@ -425,7 +446,7 @@ var BaseAPI = (function () {
|
|
|
425
446
|
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
426
447
|
break;
|
|
427
448
|
}
|
|
428
|
-
if (refObject instanceof array
|
|
449
|
+
if (refObject instanceof array.CMIArray) {
|
|
429
450
|
var index = parseInt(structure[idx + 1], 10);
|
|
430
451
|
if (!isNaN(index)) {
|
|
431
452
|
var item = refObject.childArray[index];
|
|
@@ -451,8 +472,8 @@ var BaseAPI = (function () {
|
|
|
451
472
|
}
|
|
452
473
|
}
|
|
453
474
|
}
|
|
454
|
-
if (returnValue === api_constants
|
|
455
|
-
this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value),
|
|
475
|
+
if (returnValue === api_constants.global_constants.SCORM_FALSE) {
|
|
476
|
+
this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value), enums.LogLevelEnum.WARN);
|
|
456
477
|
}
|
|
457
478
|
return returnValue;
|
|
458
479
|
};
|
|
@@ -494,7 +515,7 @@ var BaseAPI = (function () {
|
|
|
494
515
|
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
495
516
|
break;
|
|
496
517
|
}
|
|
497
|
-
if (refObject instanceof array
|
|
518
|
+
if (refObject instanceof array.CMIArray) {
|
|
498
519
|
var index = parseInt(structure[idx + 1], 10);
|
|
499
520
|
if (!isNaN(index)) {
|
|
500
521
|
var item = refObject.childArray[index];
|
|
@@ -512,10 +533,10 @@ var BaseAPI = (function () {
|
|
|
512
533
|
if (refObject === null || refObject === undefined) {
|
|
513
534
|
if (!scorm2004) {
|
|
514
535
|
if (attribute === "_children") {
|
|
515
|
-
this.throwSCORMError(
|
|
536
|
+
this.throwSCORMError(this._error_codes.CHILDREN_ERROR);
|
|
516
537
|
}
|
|
517
538
|
else if (attribute === "_count") {
|
|
518
|
-
this.throwSCORMError(
|
|
539
|
+
this.throwSCORMError(this._error_codes.COUNT_ERROR);
|
|
519
540
|
}
|
|
520
541
|
}
|
|
521
542
|
}
|
|
@@ -524,13 +545,13 @@ var BaseAPI = (function () {
|
|
|
524
545
|
}
|
|
525
546
|
};
|
|
526
547
|
BaseAPI.prototype.isInitialized = function () {
|
|
527
|
-
return this.currentState === api_constants
|
|
548
|
+
return this.currentState === api_constants.global_constants.STATE_INITIALIZED;
|
|
528
549
|
};
|
|
529
550
|
BaseAPI.prototype.isNotInitialized = function () {
|
|
530
|
-
return this.currentState === api_constants
|
|
551
|
+
return this.currentState === api_constants.global_constants.STATE_NOT_INITIALIZED;
|
|
531
552
|
};
|
|
532
553
|
BaseAPI.prototype.isTerminated = function () {
|
|
533
|
-
return this.currentState === api_constants
|
|
554
|
+
return this.currentState === api_constants.global_constants.STATE_TERMINATED;
|
|
534
555
|
};
|
|
535
556
|
BaseAPI.prototype.on = function (listenerName, callback) {
|
|
536
557
|
if (!callback)
|
|
@@ -550,7 +571,7 @@ var BaseAPI = (function () {
|
|
|
550
571
|
CMIElement: CMIElement,
|
|
551
572
|
callback: callback,
|
|
552
573
|
});
|
|
553
|
-
this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length),
|
|
574
|
+
this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), enums.LogLevelEnum.INFO, functionName);
|
|
554
575
|
}
|
|
555
576
|
};
|
|
556
577
|
BaseAPI.prototype.off = function (listenerName, callback) {
|
|
@@ -573,7 +594,7 @@ var BaseAPI = (function () {
|
|
|
573
594
|
});
|
|
574
595
|
if (removeIndex !== -1) {
|
|
575
596
|
this_1.listenerArray.splice(removeIndex, 1);
|
|
576
|
-
this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length),
|
|
597
|
+
this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), enums.LogLevelEnum.INFO, functionName);
|
|
577
598
|
}
|
|
578
599
|
};
|
|
579
600
|
var this_1 = this;
|
|
@@ -606,7 +627,7 @@ var BaseAPI = (function () {
|
|
|
606
627
|
}
|
|
607
628
|
};
|
|
608
629
|
BaseAPI.prototype.processListeners = function (functionName, CMIElement, value) {
|
|
609
|
-
this.apiLog(functionName, value,
|
|
630
|
+
this.apiLog(functionName, value, enums.LogLevelEnum.INFO, CMIElement);
|
|
610
631
|
for (var i = 0; i < this.listenerArray.length; i++) {
|
|
611
632
|
var listener = this.listenerArray[i];
|
|
612
633
|
var functionsMatch = listener.functionName === functionName;
|
|
@@ -622,7 +643,7 @@ var BaseAPI = (function () {
|
|
|
622
643
|
CMIElementsMatch = listener.CMIElement === CMIElement;
|
|
623
644
|
}
|
|
624
645
|
if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {
|
|
625
|
-
this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName),
|
|
646
|
+
this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), enums.LogLevelEnum.INFO, CMIElement);
|
|
626
647
|
listener.callback(CMIElement, value);
|
|
627
648
|
}
|
|
628
649
|
}
|
|
@@ -631,11 +652,11 @@ var BaseAPI = (function () {
|
|
|
631
652
|
if (!message) {
|
|
632
653
|
message = this.getLmsErrorMessageDetails(errorNumber);
|
|
633
654
|
}
|
|
634
|
-
this.apiLog("throwSCORMError", errorNumber + ": " + message,
|
|
655
|
+
this.apiLog("throwSCORMError", errorNumber + ": " + message, enums.LogLevelEnum.ERROR);
|
|
635
656
|
this.lastErrorCode = String(errorNumber);
|
|
636
657
|
};
|
|
637
658
|
BaseAPI.prototype.clearSCORMError = function (success) {
|
|
638
|
-
if (success !== undefined && success !== api_constants
|
|
659
|
+
if (success !== undefined && success !== api_constants.global_constants.SCORM_FALSE) {
|
|
639
660
|
this.lastErrorCode = "0";
|
|
640
661
|
}
|
|
641
662
|
};
|
|
@@ -701,7 +722,7 @@ var BaseAPI = (function () {
|
|
|
701
722
|
result.forEach(function (element) {
|
|
702
723
|
obj = {};
|
|
703
724
|
obj[element[0]] = element[1];
|
|
704
|
-
_this.loadFromJSON((0,utilities
|
|
725
|
+
_this.loadFromJSON((0,utilities.unflatten)(obj), CMIElement);
|
|
705
726
|
});
|
|
706
727
|
};
|
|
707
728
|
BaseAPI.prototype.loadFromJSON = function (json, CMIElement) {
|
|
@@ -741,21 +762,21 @@ var BaseAPI = (function () {
|
|
|
741
762
|
return JSON.parse(this.renderCMIToJSONString());
|
|
742
763
|
};
|
|
743
764
|
BaseAPI.prototype.processHttpRequest = function (url_1, params_1) {
|
|
744
|
-
return (0,tslib_es6
|
|
765
|
+
return (0,tslib_es6.__awaiter)(this, arguments, void 0, function (url, params, immediate) {
|
|
745
766
|
var api, genericError, process;
|
|
746
767
|
var _this = this;
|
|
747
768
|
if (immediate === void 0) { immediate = false; }
|
|
748
|
-
return (0,tslib_es6
|
|
769
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
749
770
|
switch (_a.label) {
|
|
750
771
|
case 0:
|
|
751
772
|
api = this;
|
|
752
773
|
genericError = {
|
|
753
|
-
result: api_constants
|
|
774
|
+
result: api_constants.global_constants.SCORM_FALSE,
|
|
754
775
|
errorCode: this.error_codes.GENERAL,
|
|
755
776
|
};
|
|
756
777
|
if (immediate) {
|
|
757
|
-
this.performFetch(url, params).then(function (response) { return (0,tslib_es6
|
|
758
|
-
return (0,tslib_es6
|
|
778
|
+
this.performFetch(url, params).then(function (response) { return (0,tslib_es6.__awaiter)(_this, void 0, void 0, function () {
|
|
779
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
759
780
|
switch (_a.label) {
|
|
760
781
|
case 0: return [4, this.transformResponse(response)];
|
|
761
782
|
case 1:
|
|
@@ -765,13 +786,13 @@ var BaseAPI = (function () {
|
|
|
765
786
|
});
|
|
766
787
|
}); });
|
|
767
788
|
return [2, {
|
|
768
|
-
result: api_constants
|
|
789
|
+
result: api_constants.global_constants.SCORM_TRUE,
|
|
769
790
|
errorCode: 0,
|
|
770
791
|
}];
|
|
771
792
|
}
|
|
772
|
-
process = function (url, params, settings) { return (0,tslib_es6
|
|
793
|
+
process = function (url, params, settings) { return (0,tslib_es6.__awaiter)(_this, void 0, void 0, function () {
|
|
773
794
|
var response, e_1;
|
|
774
|
-
return (0,tslib_es6
|
|
795
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
775
796
|
switch (_a.label) {
|
|
776
797
|
case 0:
|
|
777
798
|
_a.trys.push([0, 2, , 3]);
|
|
@@ -782,7 +803,7 @@ var BaseAPI = (function () {
|
|
|
782
803
|
return [2, this.transformResponse(response)];
|
|
783
804
|
case 2:
|
|
784
805
|
e_1 = _a.sent();
|
|
785
|
-
this.apiLog("processHttpRequest", e_1,
|
|
806
|
+
this.apiLog("processHttpRequest", e_1, enums.LogLevelEnum.ERROR);
|
|
786
807
|
api.processListeners("CommitError");
|
|
787
808
|
return [2, genericError];
|
|
788
809
|
case 3: return [2];
|
|
@@ -798,14 +819,14 @@ var BaseAPI = (function () {
|
|
|
798
819
|
BaseAPI.prototype.scheduleCommit = function (when, callback) {
|
|
799
820
|
if (!this._timeout) {
|
|
800
821
|
this._timeout = new ScheduledCommit(this, when, callback);
|
|
801
|
-
this.apiLog("scheduleCommit", "scheduled",
|
|
822
|
+
this.apiLog("scheduleCommit", "scheduled", enums.LogLevelEnum.DEBUG, "");
|
|
802
823
|
}
|
|
803
824
|
};
|
|
804
825
|
BaseAPI.prototype.clearScheduledCommit = function () {
|
|
805
826
|
if (this._timeout) {
|
|
806
827
|
this._timeout.cancel();
|
|
807
828
|
this._timeout = undefined;
|
|
808
|
-
this.apiLog("clearScheduledCommit", "cleared",
|
|
829
|
+
this.apiLog("clearScheduledCommit", "cleared", enums.LogLevelEnum.DEBUG, "");
|
|
809
830
|
}
|
|
810
831
|
};
|
|
811
832
|
BaseAPI.prototype._checkObjectHasProperty = function (refObject, attribute) {
|
|
@@ -814,9 +835,9 @@ var BaseAPI = (function () {
|
|
|
814
835
|
attribute in refObject);
|
|
815
836
|
};
|
|
816
837
|
BaseAPI.prototype.handleValueAccessException = function (e, returnValue) {
|
|
817
|
-
if (e instanceof exceptions
|
|
838
|
+
if (e instanceof exceptions.ValidationError) {
|
|
818
839
|
this.lastErrorCode = String(e.errorCode);
|
|
819
|
-
returnValue = api_constants
|
|
840
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
820
841
|
}
|
|
821
842
|
else {
|
|
822
843
|
if (e instanceof Error && e.message) {
|
|
@@ -834,20 +855,20 @@ var BaseAPI = (function () {
|
|
|
834
855
|
var commitObject = this.settings.renderCommonCommitFields
|
|
835
856
|
? this.renderCommitObject(shouldTerminateCommit)
|
|
836
857
|
: this.renderCommitCMI(shouldTerminateCommit);
|
|
837
|
-
if (
|
|
858
|
+
if ([enums.LogLevelEnum.DEBUG, "1", 1, "DEBUG"].includes(this.apiLogLevel)) {
|
|
838
859
|
console.debug("Commit (terminated: " + (terminateCommit ? "yes" : "no") + "): ");
|
|
839
860
|
console.debug(commitObject);
|
|
840
861
|
}
|
|
841
862
|
return commitObject;
|
|
842
863
|
};
|
|
843
864
|
BaseAPI.prototype.performFetch = function (url, params) {
|
|
844
|
-
return (0,tslib_es6
|
|
845
|
-
return (0,tslib_es6
|
|
865
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
866
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
846
867
|
return [2, fetch(url, {
|
|
847
868
|
method: "POST",
|
|
848
869
|
mode: this.settings.fetchMode,
|
|
849
870
|
body: params instanceof Array ? params.join("&") : JSON.stringify(params),
|
|
850
|
-
headers: (0,tslib_es6
|
|
871
|
+
headers: (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, this.settings.xhrHeaders), { "Content-Type": this.settings.commitRequestDataType }),
|
|
851
872
|
credentials: this.settings.xhrWithCredentials ? "include" : undefined,
|
|
852
873
|
keepalive: true,
|
|
853
874
|
})];
|
|
@@ -855,9 +876,9 @@ var BaseAPI = (function () {
|
|
|
855
876
|
});
|
|
856
877
|
};
|
|
857
878
|
BaseAPI.prototype.transformResponse = function (response) {
|
|
858
|
-
return (0,tslib_es6
|
|
879
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
859
880
|
var result, _a;
|
|
860
|
-
return (0,tslib_es6
|
|
881
|
+
return (0,tslib_es6.__generator)(this, function (_c) {
|
|
861
882
|
switch (_c.label) {
|
|
862
883
|
case 0:
|
|
863
884
|
if (!(typeof this.settings.responseHandler === "function")) return [3, 2];
|
|
@@ -873,8 +894,7 @@ var BaseAPI = (function () {
|
|
|
873
894
|
result = _a;
|
|
874
895
|
if (response.status >= 200 &&
|
|
875
896
|
response.status <= 299 &&
|
|
876
|
-
(result.result === true ||
|
|
877
|
-
result.result === api_constants/* default */.A.global.SCORM_TRUE)) {
|
|
897
|
+
(result.result === true || result.result === api_constants.global_constants.SCORM_TRUE)) {
|
|
878
898
|
this.processListeners("CommitSuccess");
|
|
879
899
|
}
|
|
880
900
|
else {
|
|
@@ -895,8 +915,9 @@ var BaseAPI = (function () {
|
|
|
895
915
|
/***/ 941:
|
|
896
916
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
897
917
|
|
|
918
|
+
__webpack_require__.r(__webpack_exports__);
|
|
898
919
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
899
|
-
/* harmony export */
|
|
920
|
+
/* harmony export */ Scorm12Impl: function() { return /* binding */ Scorm12Impl; }
|
|
900
921
|
/* harmony export */ });
|
|
901
922
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(635);
|
|
902
923
|
/* harmony import */ var _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(989);
|
|
@@ -906,9 +927,9 @@ var BaseAPI = (function () {
|
|
|
906
927
|
/* harmony import */ var _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(176);
|
|
907
928
|
/* harmony import */ var _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(833);
|
|
908
929
|
/* harmony import */ var _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(331);
|
|
909
|
-
/* harmony import */ var
|
|
910
|
-
/* harmony import */ var
|
|
911
|
-
/* harmony import */ var
|
|
930
|
+
/* harmony import */ var _constants_enums__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(56);
|
|
931
|
+
/* harmony import */ var _BaseAPI__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(429);
|
|
932
|
+
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(417);
|
|
912
933
|
|
|
913
934
|
|
|
914
935
|
|
|
@@ -922,7 +943,7 @@ var BaseAPI = (function () {
|
|
|
922
943
|
|
|
923
944
|
|
|
924
945
|
var Scorm12Impl = (function (_super) {
|
|
925
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
946
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_10__.__extends)(Scorm12Impl, _super);
|
|
926
947
|
function Scorm12Impl(settings) {
|
|
927
948
|
var _this = this;
|
|
928
949
|
if (settings) {
|
|
@@ -930,10 +951,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
930
951
|
settings.mastery_override = false;
|
|
931
952
|
}
|
|
932
953
|
}
|
|
933
|
-
_this = _super.call(this, _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__
|
|
954
|
+
_this = _super.call(this, _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors, settings) || this;
|
|
934
955
|
_this.statusSetByModule = false;
|
|
935
|
-
_this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
936
|
-
_this.nav = new _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__
|
|
956
|
+
_this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__.CMI();
|
|
957
|
+
_this.nav = new _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__.NAV();
|
|
937
958
|
_this.LMSInitialize = _this.lmsInitialize;
|
|
938
959
|
_this.LMSFinish = _this.lmsFinish;
|
|
939
960
|
_this.LMSGetValue = _this.lmsGetValue;
|
|
@@ -945,9 +966,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
945
966
|
return _this;
|
|
946
967
|
}
|
|
947
968
|
Scorm12Impl.prototype.reset = function (settings) {
|
|
969
|
+
var _a, _b;
|
|
948
970
|
this.commonReset(settings);
|
|
949
|
-
this.cmi
|
|
950
|
-
this.nav
|
|
971
|
+
(_a = this.cmi) === null || _a === void 0 ? void 0 : _a.reset();
|
|
972
|
+
(_b = this.nav) === null || _b === void 0 ? void 0 : _b.reset();
|
|
951
973
|
};
|
|
952
974
|
Scorm12Impl.prototype.lmsInitialize = function () {
|
|
953
975
|
this.cmi.initialize();
|
|
@@ -961,8 +983,8 @@ var Scorm12Impl = (function (_super) {
|
|
|
961
983
|
};
|
|
962
984
|
Scorm12Impl.prototype.lmsFinish = function () {
|
|
963
985
|
var _this = this;
|
|
964
|
-
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
965
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
986
|
+
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(_this, void 0, void 0, function () {
|
|
987
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_a) {
|
|
966
988
|
switch (_a.label) {
|
|
967
989
|
case 0: return [4, this.internalFinish()];
|
|
968
990
|
case 1:
|
|
@@ -971,17 +993,17 @@ var Scorm12Impl = (function (_super) {
|
|
|
971
993
|
}
|
|
972
994
|
});
|
|
973
995
|
}); })();
|
|
974
|
-
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
996
|
+
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE;
|
|
975
997
|
};
|
|
976
998
|
Scorm12Impl.prototype.internalFinish = function () {
|
|
977
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
999
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(this, void 0, void 0, function () {
|
|
978
1000
|
var result;
|
|
979
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1001
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_a) {
|
|
980
1002
|
switch (_a.label) {
|
|
981
1003
|
case 0: return [4, this.terminate("LMSFinish", true)];
|
|
982
1004
|
case 1:
|
|
983
1005
|
result = _a.sent();
|
|
984
|
-
if (result === _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
1006
|
+
if (result === _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE) {
|
|
985
1007
|
if (this.nav.event !== "") {
|
|
986
1008
|
if (this.nav.event === "continue") {
|
|
987
1009
|
this.processListeners("SequenceNext");
|
|
@@ -1014,8 +1036,8 @@ var Scorm12Impl = (function (_super) {
|
|
|
1014
1036
|
this.scheduleCommit(500, "LMSCommit");
|
|
1015
1037
|
}
|
|
1016
1038
|
else {
|
|
1017
|
-
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1018
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1039
|
+
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(_this, void 0, void 0, function () {
|
|
1040
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_a) {
|
|
1019
1041
|
switch (_a.label) {
|
|
1020
1042
|
case 0: return [4, this.commit("LMSCommit", false)];
|
|
1021
1043
|
case 1:
|
|
@@ -1025,7 +1047,7 @@ var Scorm12Impl = (function (_super) {
|
|
|
1025
1047
|
});
|
|
1026
1048
|
}); })();
|
|
1027
1049
|
}
|
|
1028
|
-
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
1050
|
+
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE;
|
|
1029
1051
|
};
|
|
1030
1052
|
Scorm12Impl.prototype.lmsGetLastError = function () {
|
|
1031
1053
|
return this.getLastError("LMSGetLastError");
|
|
@@ -1043,20 +1065,20 @@ var Scorm12Impl = (function (_super) {
|
|
|
1043
1065
|
return this._commonGetCMIValue("getCMIValue", false, CMIElement);
|
|
1044
1066
|
};
|
|
1045
1067
|
Scorm12Impl.prototype.getChildElement = function (CMIElement, _value, foundFirstIndex) {
|
|
1046
|
-
if ((0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
1047
|
-
return new _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__
|
|
1068
|
+
if ((0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.objectives\\.\\d+")) {
|
|
1069
|
+
return new _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__.CMIObjectivesObject();
|
|
1048
1070
|
}
|
|
1049
1071
|
else if (foundFirstIndex &&
|
|
1050
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
1051
|
-
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__
|
|
1072
|
+
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) {
|
|
1073
|
+
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__.CMIInteractionsCorrectResponsesObject();
|
|
1052
1074
|
}
|
|
1053
1075
|
else if (foundFirstIndex &&
|
|
1054
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
1055
|
-
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__
|
|
1076
|
+
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) {
|
|
1077
|
+
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__.CMIInteractionsObjectivesObject();
|
|
1056
1078
|
}
|
|
1057
1079
|
else if (!foundFirstIndex &&
|
|
1058
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
1059
|
-
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__
|
|
1080
|
+
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+")) {
|
|
1081
|
+
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__.CMIInteractionsObject();
|
|
1060
1082
|
}
|
|
1061
1083
|
return null;
|
|
1062
1084
|
};
|
|
@@ -1066,11 +1088,11 @@ var Scorm12Impl = (function (_super) {
|
|
|
1066
1088
|
var basicMessage = "No Error";
|
|
1067
1089
|
var detailMessage = "No Error";
|
|
1068
1090
|
errorNumber = String(errorNumber);
|
|
1069
|
-
if (_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
1091
|
+
if (_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber]) {
|
|
1070
1092
|
basicMessage =
|
|
1071
|
-
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
1093
|
+
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber].basicMessage;
|
|
1072
1094
|
detailMessage =
|
|
1073
|
-
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
1095
|
+
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber].detailMessage;
|
|
1074
1096
|
}
|
|
1075
1097
|
return detail ? detailMessage : basicMessage;
|
|
1076
1098
|
};
|
|
@@ -1083,10 +1105,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
1083
1105
|
cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();
|
|
1084
1106
|
}
|
|
1085
1107
|
var result = [];
|
|
1086
|
-
var flattened = _utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
1108
|
+
var flattened = _utilities__WEBPACK_IMPORTED_MODULE_1__.flatten(cmiExport);
|
|
1087
1109
|
switch (this.settings.dataCommitFormat) {
|
|
1088
1110
|
case "flattened":
|
|
1089
|
-
return _utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
1111
|
+
return _utilities__WEBPACK_IMPORTED_MODULE_1__.flatten(cmiExport);
|
|
1090
1112
|
case "params":
|
|
1091
1113
|
for (var item in flattened) {
|
|
1092
1114
|
if ({}.hasOwnProperty.call(flattened, item)) {
|
|
@@ -1102,20 +1124,20 @@ var Scorm12Impl = (function (_super) {
|
|
|
1102
1124
|
Scorm12Impl.prototype.renderCommitObject = function (terminateCommit) {
|
|
1103
1125
|
var cmiExport = this.renderCommitCMI(terminateCommit);
|
|
1104
1126
|
var totalTimeHHMMSS = this.cmi.getCurrentTotalTime();
|
|
1105
|
-
var totalTimeSeconds = _utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
1127
|
+
var totalTimeSeconds = _utilities__WEBPACK_IMPORTED_MODULE_1__.getTimeAsSeconds(totalTimeHHMMSS, _constants_regex__WEBPACK_IMPORTED_MODULE_9__.scorm12_regex.CMITimespan);
|
|
1106
1128
|
var lessonStatus = this.cmi.core.lesson_status;
|
|
1107
|
-
var completionStatus =
|
|
1108
|
-
var successStatus =
|
|
1129
|
+
var completionStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.unknown;
|
|
1130
|
+
var successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.unknown;
|
|
1109
1131
|
if (lessonStatus) {
|
|
1110
1132
|
completionStatus =
|
|
1111
1133
|
lessonStatus === "completed" || lessonStatus === "passed"
|
|
1112
|
-
?
|
|
1113
|
-
:
|
|
1134
|
+
? _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.completed
|
|
1135
|
+
: _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.incomplete;
|
|
1114
1136
|
if (lessonStatus === "passed") {
|
|
1115
|
-
successStatus =
|
|
1137
|
+
successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.passed;
|
|
1116
1138
|
}
|
|
1117
1139
|
else if (lessonStatus === "failed") {
|
|
1118
|
-
successStatus =
|
|
1140
|
+
successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.failed;
|
|
1119
1141
|
}
|
|
1120
1142
|
}
|
|
1121
1143
|
var score = this.cmi.core.score;
|
|
@@ -1144,10 +1166,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
1144
1166
|
return commitObject;
|
|
1145
1167
|
};
|
|
1146
1168
|
Scorm12Impl.prototype.storeData = function (terminateCommit) {
|
|
1147
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1169
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(this, void 0, void 0, function () {
|
|
1148
1170
|
var originalStatus, commitObject;
|
|
1149
1171
|
var _a, _b, _c;
|
|
1150
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1172
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_d) {
|
|
1151
1173
|
switch (_d.label) {
|
|
1152
1174
|
case 0:
|
|
1153
1175
|
if (terminateCommit) {
|
|
@@ -1182,7 +1204,7 @@ var Scorm12Impl = (function (_super) {
|
|
|
1182
1204
|
return [4, this.processHttpRequest(this.settings.lmsCommitUrl, commitObject, terminateCommit)];
|
|
1183
1205
|
case 1: return [2, _d.sent()];
|
|
1184
1206
|
case 2: return [2, {
|
|
1185
|
-
result: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
1207
|
+
result: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE,
|
|
1186
1208
|
errorCode: 0,
|
|
1187
1209
|
}];
|
|
1188
1210
|
}
|
|
@@ -1190,7 +1212,7 @@ var Scorm12Impl = (function (_super) {
|
|
|
1190
1212
|
});
|
|
1191
1213
|
};
|
|
1192
1214
|
return Scorm12Impl;
|
|
1193
|
-
}(
|
|
1215
|
+
}(_BaseAPI__WEBPACK_IMPORTED_MODULE_8__["default"]));
|
|
1194
1216
|
|
|
1195
1217
|
|
|
1196
1218
|
|
|
@@ -1199,29 +1221,40 @@ var Scorm12Impl = (function (_super) {
|
|
|
1199
1221
|
/***/ 589:
|
|
1200
1222
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1201
1223
|
|
|
1224
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1202
1225
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1203
|
-
/* harmony export */
|
|
1226
|
+
/* harmony export */ CMIArray: function() { return /* binding */ CMIArray; }
|
|
1204
1227
|
/* harmony export */ });
|
|
1205
|
-
/* unused harmony export scorm12_error_codes */
|
|
1206
1228
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635);
|
|
1207
1229
|
/* harmony import */ var _base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
1208
|
-
/* harmony import */ var
|
|
1209
|
-
/* harmony import */ var
|
|
1230
|
+
/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(784);
|
|
1231
|
+
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(797);
|
|
1210
1232
|
|
|
1211
1233
|
|
|
1212
1234
|
|
|
1213
1235
|
|
|
1214
|
-
var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12;
|
|
1215
1236
|
var CMIArray = (function (_super) {
|
|
1216
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_3__
|
|
1237
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_3__.__extends)(CMIArray, _super);
|
|
1217
1238
|
function CMIArray(params) {
|
|
1218
1239
|
var _this = _super.call(this) || this;
|
|
1219
1240
|
_this.__children = params.children;
|
|
1220
|
-
_this._errorCode = params.errorCode ||
|
|
1221
|
-
_this._errorClass = params.errorClass ||
|
|
1241
|
+
_this._errorCode = params.errorCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.GENERAL;
|
|
1242
|
+
_this._errorClass = params.errorClass || _exceptions__WEBPACK_IMPORTED_MODULE_1__.BaseScormValidationError;
|
|
1222
1243
|
_this.childArray = [];
|
|
1223
1244
|
return _this;
|
|
1224
1245
|
}
|
|
1246
|
+
CMIArray.prototype.reset = function (wipe) {
|
|
1247
|
+
if (wipe === void 0) { wipe = false; }
|
|
1248
|
+
this._initialized = false;
|
|
1249
|
+
if (wipe) {
|
|
1250
|
+
this.childArray = [];
|
|
1251
|
+
}
|
|
1252
|
+
else {
|
|
1253
|
+
for (var i = 0; i < this.childArray.length; i++) {
|
|
1254
|
+
this.childArray[i].reset();
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
};
|
|
1225
1258
|
Object.defineProperty(CMIArray.prototype, "_children", {
|
|
1226
1259
|
get: function () {
|
|
1227
1260
|
return this.__children;
|
|
@@ -1252,7 +1285,7 @@ var CMIArray = (function (_super) {
|
|
|
1252
1285
|
return result;
|
|
1253
1286
|
};
|
|
1254
1287
|
return CMIArray;
|
|
1255
|
-
}(_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
1288
|
+
}(_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
1256
1289
|
|
|
1257
1290
|
|
|
1258
1291
|
|
|
@@ -1261,9 +1294,10 @@ var CMIArray = (function (_super) {
|
|
|
1261
1294
|
/***/ 319:
|
|
1262
1295
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1263
1296
|
|
|
1297
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1264
1298
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1265
|
-
/* harmony export */
|
|
1266
|
-
/* harmony export */
|
|
1299
|
+
/* harmony export */ BaseCMI: function() { return /* binding */ BaseCMI; },
|
|
1300
|
+
/* harmony export */ BaseRootCMI: function() { return /* binding */ BaseRootCMI; }
|
|
1267
1301
|
/* harmony export */ });
|
|
1268
1302
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
1269
1303
|
|
|
@@ -1296,7 +1330,7 @@ var BaseCMI = (function () {
|
|
|
1296
1330
|
}());
|
|
1297
1331
|
|
|
1298
1332
|
var BaseRootCMI = (function (_super) {
|
|
1299
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_0__
|
|
1333
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(BaseRootCMI, _super);
|
|
1300
1334
|
function BaseRootCMI() {
|
|
1301
1335
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
1302
1336
|
}
|
|
@@ -1310,10 +1344,10 @@ var BaseRootCMI = (function (_super) {
|
|
|
1310
1344
|
/***/ 434:
|
|
1311
1345
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1312
1346
|
|
|
1347
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1313
1348
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1314
|
-
/* harmony export */
|
|
1349
|
+
/* harmony export */ CMIScore: function() { return /* binding */ CMIScore; }
|
|
1315
1350
|
/* harmony export */ });
|
|
1316
|
-
/* unused harmony export scorm12_error_codes */
|
|
1317
1351
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635);
|
|
1318
1352
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340);
|
|
1319
1353
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(417);
|
|
@@ -1326,30 +1360,30 @@ var BaseRootCMI = (function (_super) {
|
|
|
1326
1360
|
|
|
1327
1361
|
|
|
1328
1362
|
|
|
1329
|
-
var scorm12_constants = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12;
|
|
1330
|
-
var scorm12_regex = _constants_regex__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12;
|
|
1331
|
-
var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12;
|
|
1332
1363
|
var CMIScore = (function (_super) {
|
|
1333
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_4__
|
|
1364
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_4__.__extends)(CMIScore, _super);
|
|
1334
1365
|
function CMIScore(params) {
|
|
1335
1366
|
var _this = _super.call(this) || this;
|
|
1336
1367
|
_this._raw = "";
|
|
1337
1368
|
_this._min = "";
|
|
1338
|
-
_this.__children = params.score_children || scorm12_constants.score_children;
|
|
1369
|
+
_this.__children = params.score_children || _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__.scorm12_constants.score_children;
|
|
1339
1370
|
_this.__score_range = !params.score_range
|
|
1340
1371
|
? false
|
|
1341
|
-
: scorm12_regex.score_range;
|
|
1372
|
+
: _constants_regex__WEBPACK_IMPORTED_MODULE_1__.scorm12_regex.score_range;
|
|
1342
1373
|
_this._max = params.max || params.max === "" ? params.max : "100";
|
|
1343
1374
|
_this.__invalid_error_code =
|
|
1344
|
-
params.invalidErrorCode ||
|
|
1375
|
+
params.invalidErrorCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.INVALID_SET_VALUE;
|
|
1345
1376
|
_this.__invalid_type_code =
|
|
1346
|
-
params.invalidTypeCode ||
|
|
1377
|
+
params.invalidTypeCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.TYPE_MISMATCH;
|
|
1347
1378
|
_this.__invalid_range_code =
|
|
1348
|
-
params.invalidRangeCode ||
|
|
1349
|
-
_this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;
|
|
1379
|
+
params.invalidRangeCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.VALUE_OUT_OF_RANGE;
|
|
1380
|
+
_this.__decimal_regex = params.decimalRegex || _constants_regex__WEBPACK_IMPORTED_MODULE_1__.scorm12_regex.CMIDecimal;
|
|
1350
1381
|
_this.__error_class = params.errorClass;
|
|
1351
1382
|
return _this;
|
|
1352
1383
|
}
|
|
1384
|
+
CMIScore.prototype.reset = function () {
|
|
1385
|
+
this._initialized = false;
|
|
1386
|
+
};
|
|
1353
1387
|
Object.defineProperty(CMIScore.prototype, "_children", {
|
|
1354
1388
|
get: function () {
|
|
1355
1389
|
return this.__children;
|
|
@@ -1365,9 +1399,9 @@ var CMIScore = (function (_super) {
|
|
|
1365
1399
|
return this._raw;
|
|
1366
1400
|
},
|
|
1367
1401
|
set: function (raw) {
|
|
1368
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1402
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidFormat)(raw, this.__decimal_regex, this.__invalid_type_code, this.__error_class) &&
|
|
1369
1403
|
(!this.__score_range ||
|
|
1370
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1404
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidRange)(raw, this.__score_range, this.__invalid_range_code, this.__error_class))) {
|
|
1371
1405
|
this._raw = raw;
|
|
1372
1406
|
}
|
|
1373
1407
|
},
|
|
@@ -1379,9 +1413,9 @@ var CMIScore = (function (_super) {
|
|
|
1379
1413
|
return this._min;
|
|
1380
1414
|
},
|
|
1381
1415
|
set: function (min) {
|
|
1382
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1416
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidFormat)(min, this.__decimal_regex, this.__invalid_type_code, this.__error_class) &&
|
|
1383
1417
|
(!this.__score_range ||
|
|
1384
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1418
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidRange)(min, this.__score_range, this.__invalid_range_code, this.__error_class))) {
|
|
1385
1419
|
this._min = min;
|
|
1386
1420
|
}
|
|
1387
1421
|
},
|
|
@@ -1393,9 +1427,9 @@ var CMIScore = (function (_super) {
|
|
|
1393
1427
|
return this._max;
|
|
1394
1428
|
},
|
|
1395
1429
|
set: function (max) {
|
|
1396
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1430
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidFormat)(max, this.__decimal_regex, this.__invalid_type_code, this.__error_class) &&
|
|
1397
1431
|
(!this.__score_range ||
|
|
1398
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1432
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidRange)(max, this.__score_range, this.__invalid_range_code, this.__error_class))) {
|
|
1399
1433
|
this._max = max;
|
|
1400
1434
|
}
|
|
1401
1435
|
},
|
|
@@ -1413,7 +1447,7 @@ var CMIScore = (function (_super) {
|
|
|
1413
1447
|
return result;
|
|
1414
1448
|
};
|
|
1415
1449
|
return CMIScore;
|
|
1416
|
-
}(_base_cmi__WEBPACK_IMPORTED_MODULE_2__
|
|
1450
|
+
}(_base_cmi__WEBPACK_IMPORTED_MODULE_2__.BaseCMI));
|
|
1417
1451
|
|
|
1418
1452
|
|
|
1419
1453
|
|
|
@@ -1422,9 +1456,10 @@ var CMIScore = (function (_super) {
|
|
|
1422
1456
|
/***/ 449:
|
|
1423
1457
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1424
1458
|
|
|
1459
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1425
1460
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1426
|
-
/* harmony export */
|
|
1427
|
-
/* harmony export */
|
|
1461
|
+
/* harmony export */ checkValidFormat: function() { return /* binding */ checkValidFormat; },
|
|
1462
|
+
/* harmony export */ checkValidRange: function() { return /* binding */ checkValidRange; }
|
|
1428
1463
|
/* harmony export */ });
|
|
1429
1464
|
function checkValidFormat(value, regexPattern, errorCode, errorClass, allowEmptyString) {
|
|
1430
1465
|
if (typeof value !== "string") {
|
|
@@ -1462,10 +1497,12 @@ function checkValidRange(value, rangePattern, errorCode, errorClass) {
|
|
|
1462
1497
|
/***/ 989:
|
|
1463
1498
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1464
1499
|
|
|
1500
|
+
// ESM COMPAT FLAG
|
|
1501
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1465
1502
|
|
|
1466
1503
|
// EXPORTS
|
|
1467
1504
|
__webpack_require__.d(__webpack_exports__, {
|
|
1468
|
-
|
|
1505
|
+
CMI: function() { return /* binding */ CMI; }
|
|
1469
1506
|
});
|
|
1470
1507
|
|
|
1471
1508
|
// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs
|
|
@@ -1476,8 +1513,8 @@ var api_constants = __webpack_require__(340);
|
|
|
1476
1513
|
var error_codes = __webpack_require__(797);
|
|
1477
1514
|
// EXTERNAL MODULE: ./src/constants/regex.ts
|
|
1478
1515
|
var regex = __webpack_require__(417);
|
|
1479
|
-
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
1480
|
-
var
|
|
1516
|
+
// EXTERNAL MODULE: ./src/exceptions/scorm12_exceptions.ts
|
|
1517
|
+
var scorm12_exceptions = __webpack_require__(179);
|
|
1481
1518
|
// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts
|
|
1482
1519
|
var base_cmi = __webpack_require__(319);
|
|
1483
1520
|
// EXTERNAL MODULE: ./src/cmi/scorm12/validation.ts
|
|
@@ -1497,10 +1534,10 @@ var utilities = __webpack_require__(864);
|
|
|
1497
1534
|
|
|
1498
1535
|
|
|
1499
1536
|
var CMICore = (function (_super) {
|
|
1500
|
-
(0,tslib_es6
|
|
1537
|
+
(0,tslib_es6.__extends)(CMICore, _super);
|
|
1501
1538
|
function CMICore() {
|
|
1502
1539
|
var _this = _super.call(this) || this;
|
|
1503
|
-
_this.__children = api_constants
|
|
1540
|
+
_this.__children = api_constants.scorm12_constants.core_children;
|
|
1504
1541
|
_this._student_id = "";
|
|
1505
1542
|
_this._student_name = "";
|
|
1506
1543
|
_this._lesson_location = "";
|
|
@@ -1512,13 +1549,13 @@ var CMICore = (function (_super) {
|
|
|
1512
1549
|
_this._exit = "";
|
|
1513
1550
|
_this._session_time = "00:00:00";
|
|
1514
1551
|
_this._suspend_data = "";
|
|
1515
|
-
_this.score = new score
|
|
1516
|
-
score_children: api_constants
|
|
1517
|
-
score_range: regex
|
|
1518
|
-
invalidErrorCode: error_codes
|
|
1519
|
-
invalidTypeCode: error_codes
|
|
1520
|
-
invalidRangeCode: error_codes
|
|
1521
|
-
errorClass:
|
|
1552
|
+
_this.score = new score.CMIScore({
|
|
1553
|
+
score_children: api_constants.scorm12_constants.score_children,
|
|
1554
|
+
score_range: regex.scorm12_regex.score_range,
|
|
1555
|
+
invalidErrorCode: error_codes.scorm12_errors.INVALID_SET_VALUE,
|
|
1556
|
+
invalidTypeCode: error_codes.scorm12_errors.TYPE_MISMATCH,
|
|
1557
|
+
invalidRangeCode: error_codes.scorm12_errors.VALUE_OUT_OF_RANGE,
|
|
1558
|
+
errorClass: scorm12_exceptions.Scorm12ValidationError,
|
|
1522
1559
|
});
|
|
1523
1560
|
return _this;
|
|
1524
1561
|
}
|
|
@@ -1527,12 +1564,20 @@ var CMICore = (function (_super) {
|
|
|
1527
1564
|
_super.prototype.initialize.call(this);
|
|
1528
1565
|
(_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
1529
1566
|
};
|
|
1567
|
+
CMICore.prototype.reset = function () {
|
|
1568
|
+
var _a;
|
|
1569
|
+
this._initialized = false;
|
|
1570
|
+
this._exit = "";
|
|
1571
|
+
this._entry = "";
|
|
1572
|
+
this._session_time = "00:00:00";
|
|
1573
|
+
(_a = this.score) === null || _a === void 0 ? void 0 : _a.reset();
|
|
1574
|
+
};
|
|
1530
1575
|
Object.defineProperty(CMICore.prototype, "_children", {
|
|
1531
1576
|
get: function () {
|
|
1532
1577
|
return this.__children;
|
|
1533
1578
|
},
|
|
1534
1579
|
set: function (_children) {
|
|
1535
|
-
throw new
|
|
1580
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
1536
1581
|
},
|
|
1537
1582
|
enumerable: false,
|
|
1538
1583
|
configurable: true
|
|
@@ -1543,7 +1588,7 @@ var CMICore = (function (_super) {
|
|
|
1543
1588
|
},
|
|
1544
1589
|
set: function (student_id) {
|
|
1545
1590
|
if (this.initialized) {
|
|
1546
|
-
throw new
|
|
1591
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1547
1592
|
}
|
|
1548
1593
|
else {
|
|
1549
1594
|
this._student_id = student_id;
|
|
@@ -1558,7 +1603,7 @@ var CMICore = (function (_super) {
|
|
|
1558
1603
|
},
|
|
1559
1604
|
set: function (student_name) {
|
|
1560
1605
|
if (this.initialized) {
|
|
1561
|
-
throw new
|
|
1606
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1562
1607
|
}
|
|
1563
1608
|
else {
|
|
1564
1609
|
this._student_name = student_name;
|
|
@@ -1572,7 +1617,7 @@ var CMICore = (function (_super) {
|
|
|
1572
1617
|
return this._lesson_location;
|
|
1573
1618
|
},
|
|
1574
1619
|
set: function (lesson_location) {
|
|
1575
|
-
if ((0,validation
|
|
1620
|
+
if ((0,validation.check12ValidFormat)(lesson_location, regex.scorm12_regex.CMIString256, true)) {
|
|
1576
1621
|
this._lesson_location = lesson_location;
|
|
1577
1622
|
}
|
|
1578
1623
|
},
|
|
@@ -1585,7 +1630,7 @@ var CMICore = (function (_super) {
|
|
|
1585
1630
|
},
|
|
1586
1631
|
set: function (credit) {
|
|
1587
1632
|
if (this.initialized) {
|
|
1588
|
-
throw new
|
|
1633
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1589
1634
|
}
|
|
1590
1635
|
else {
|
|
1591
1636
|
this._credit = credit;
|
|
@@ -1600,12 +1645,12 @@ var CMICore = (function (_super) {
|
|
|
1600
1645
|
},
|
|
1601
1646
|
set: function (lesson_status) {
|
|
1602
1647
|
if (this.initialized) {
|
|
1603
|
-
if ((0,validation
|
|
1648
|
+
if ((0,validation.check12ValidFormat)(lesson_status, regex.scorm12_regex.CMIStatus)) {
|
|
1604
1649
|
this._lesson_status = lesson_status;
|
|
1605
1650
|
}
|
|
1606
1651
|
}
|
|
1607
1652
|
else {
|
|
1608
|
-
if ((0,validation
|
|
1653
|
+
if ((0,validation.check12ValidFormat)(lesson_status, regex.scorm12_regex.CMIStatus2)) {
|
|
1609
1654
|
this._lesson_status = lesson_status;
|
|
1610
1655
|
}
|
|
1611
1656
|
}
|
|
@@ -1619,7 +1664,7 @@ var CMICore = (function (_super) {
|
|
|
1619
1664
|
},
|
|
1620
1665
|
set: function (entry) {
|
|
1621
1666
|
if (this.initialized) {
|
|
1622
|
-
throw new
|
|
1667
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1623
1668
|
}
|
|
1624
1669
|
else {
|
|
1625
1670
|
this._entry = entry;
|
|
@@ -1634,7 +1679,7 @@ var CMICore = (function (_super) {
|
|
|
1634
1679
|
},
|
|
1635
1680
|
set: function (total_time) {
|
|
1636
1681
|
if (this.initialized) {
|
|
1637
|
-
throw new
|
|
1682
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1638
1683
|
}
|
|
1639
1684
|
else {
|
|
1640
1685
|
this._total_time = total_time;
|
|
@@ -1649,7 +1694,7 @@ var CMICore = (function (_super) {
|
|
|
1649
1694
|
},
|
|
1650
1695
|
set: function (lesson_mode) {
|
|
1651
1696
|
if (this.initialized) {
|
|
1652
|
-
throw new
|
|
1697
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1653
1698
|
}
|
|
1654
1699
|
else {
|
|
1655
1700
|
this._lesson_mode = lesson_mode;
|
|
@@ -1661,12 +1706,12 @@ var CMICore = (function (_super) {
|
|
|
1661
1706
|
Object.defineProperty(CMICore.prototype, "exit", {
|
|
1662
1707
|
get: function () {
|
|
1663
1708
|
if (!this.jsonString) {
|
|
1664
|
-
throw new
|
|
1709
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1665
1710
|
}
|
|
1666
1711
|
return this._exit;
|
|
1667
1712
|
},
|
|
1668
1713
|
set: function (exit) {
|
|
1669
|
-
if ((0,validation
|
|
1714
|
+
if ((0,validation.check12ValidFormat)(exit, regex.scorm12_regex.CMIExit, true)) {
|
|
1670
1715
|
this._exit = exit;
|
|
1671
1716
|
}
|
|
1672
1717
|
},
|
|
@@ -1676,12 +1721,12 @@ var CMICore = (function (_super) {
|
|
|
1676
1721
|
Object.defineProperty(CMICore.prototype, "session_time", {
|
|
1677
1722
|
get: function () {
|
|
1678
1723
|
if (!this.jsonString) {
|
|
1679
|
-
throw new
|
|
1724
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1680
1725
|
}
|
|
1681
1726
|
return this._session_time;
|
|
1682
1727
|
},
|
|
1683
1728
|
set: function (session_time) {
|
|
1684
|
-
if ((0,validation
|
|
1729
|
+
if ((0,validation.check12ValidFormat)(session_time, regex.scorm12_regex.CMITimespan)) {
|
|
1685
1730
|
this._session_time = session_time;
|
|
1686
1731
|
}
|
|
1687
1732
|
},
|
|
@@ -1693,7 +1738,7 @@ var CMICore = (function (_super) {
|
|
|
1693
1738
|
return this._suspend_data;
|
|
1694
1739
|
},
|
|
1695
1740
|
set: function (suspend_data) {
|
|
1696
|
-
if ((0,validation
|
|
1741
|
+
if ((0,validation.check12ValidFormat)(suspend_data, regex.scorm12_regex.CMIString4096, true)) {
|
|
1697
1742
|
this._suspend_data = suspend_data;
|
|
1698
1743
|
}
|
|
1699
1744
|
},
|
|
@@ -1705,9 +1750,9 @@ var CMICore = (function (_super) {
|
|
|
1705
1750
|
var startTime = start_time;
|
|
1706
1751
|
if (typeof startTime !== "undefined" && startTime !== null) {
|
|
1707
1752
|
var seconds = new Date().getTime() - startTime;
|
|
1708
|
-
sessionTime = utilities
|
|
1753
|
+
sessionTime = utilities.getSecondsAsHHMMSS(seconds / 1000);
|
|
1709
1754
|
}
|
|
1710
|
-
return utilities
|
|
1755
|
+
return utilities.addHHMMSSTimeStrings(this._total_time, sessionTime, new RegExp(regex.scorm12_regex.CMITimespan));
|
|
1711
1756
|
};
|
|
1712
1757
|
CMICore.prototype.toJSON = function () {
|
|
1713
1758
|
this.jsonString = true;
|
|
@@ -1727,7 +1772,7 @@ var CMICore = (function (_super) {
|
|
|
1727
1772
|
return result;
|
|
1728
1773
|
};
|
|
1729
1774
|
return CMICore;
|
|
1730
|
-
}(base_cmi
|
|
1775
|
+
}(base_cmi.BaseCMI));
|
|
1731
1776
|
|
|
1732
1777
|
|
|
1733
1778
|
// EXTERNAL MODULE: ./src/cmi/scorm12/objectives.ts
|
|
@@ -1752,7 +1797,7 @@ var interactions = __webpack_require__(833);
|
|
|
1752
1797
|
|
|
1753
1798
|
|
|
1754
1799
|
var CMI = (function (_super) {
|
|
1755
|
-
(0,tslib_es6
|
|
1800
|
+
(0,tslib_es6.__extends)(CMI, _super);
|
|
1756
1801
|
function CMI(cmi_children, student_data, initialized) {
|
|
1757
1802
|
var _this = _super.call(this) || this;
|
|
1758
1803
|
_this.__children = "";
|
|
@@ -1764,14 +1809,25 @@ var CMI = (function (_super) {
|
|
|
1764
1809
|
_this.initialize();
|
|
1765
1810
|
_this.__children = cmi_children
|
|
1766
1811
|
? cmi_children
|
|
1767
|
-
: api_constants
|
|
1812
|
+
: api_constants.scorm12_constants.cmi_children;
|
|
1768
1813
|
_this.core = new CMICore();
|
|
1769
|
-
_this.objectives = new objectives
|
|
1770
|
-
_this.student_data = student_data ? student_data : new scorm12_student_data
|
|
1771
|
-
_this.student_preference = new student_preference
|
|
1772
|
-
_this.interactions = new interactions
|
|
1814
|
+
_this.objectives = new objectives.CMIObjectives();
|
|
1815
|
+
_this.student_data = student_data ? student_data : new scorm12_student_data.CMIStudentData();
|
|
1816
|
+
_this.student_preference = new student_preference.CMIStudentPreference();
|
|
1817
|
+
_this.interactions = new interactions.CMIInteractions();
|
|
1773
1818
|
return _this;
|
|
1774
1819
|
}
|
|
1820
|
+
CMI.prototype.reset = function () {
|
|
1821
|
+
var _a, _b, _c;
|
|
1822
|
+
this._initialized = false;
|
|
1823
|
+
this._launch_data = "";
|
|
1824
|
+
this._comments = "";
|
|
1825
|
+
(_a = this.core) === null || _a === void 0 ? void 0 : _a.reset();
|
|
1826
|
+
this.objectives = new objectives.CMIObjectives();
|
|
1827
|
+
this.interactions = new interactions.CMIInteractions();
|
|
1828
|
+
(_b = this.student_data) === null || _b === void 0 ? void 0 : _b.reset();
|
|
1829
|
+
(_c = this.student_preference) === null || _c === void 0 ? void 0 : _c.reset();
|
|
1830
|
+
};
|
|
1775
1831
|
CMI.prototype.initialize = function () {
|
|
1776
1832
|
var _a, _b, _c, _d, _e;
|
|
1777
1833
|
_super.prototype.initialize.call(this);
|
|
@@ -1802,7 +1858,7 @@ var CMI = (function (_super) {
|
|
|
1802
1858
|
return this.__version;
|
|
1803
1859
|
},
|
|
1804
1860
|
set: function (_version) {
|
|
1805
|
-
throw new
|
|
1861
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
1806
1862
|
},
|
|
1807
1863
|
enumerable: false,
|
|
1808
1864
|
configurable: true
|
|
@@ -1812,7 +1868,7 @@ var CMI = (function (_super) {
|
|
|
1812
1868
|
return this.__children;
|
|
1813
1869
|
},
|
|
1814
1870
|
set: function (_children) {
|
|
1815
|
-
throw new
|
|
1871
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
1816
1872
|
},
|
|
1817
1873
|
enumerable: false,
|
|
1818
1874
|
configurable: true
|
|
@@ -1836,7 +1892,7 @@ var CMI = (function (_super) {
|
|
|
1836
1892
|
},
|
|
1837
1893
|
set: function (launch_data) {
|
|
1838
1894
|
if (this.initialized) {
|
|
1839
|
-
throw new
|
|
1895
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1840
1896
|
}
|
|
1841
1897
|
else {
|
|
1842
1898
|
this._launch_data = launch_data;
|
|
@@ -1850,7 +1906,7 @@ var CMI = (function (_super) {
|
|
|
1850
1906
|
return this._comments;
|
|
1851
1907
|
},
|
|
1852
1908
|
set: function (comments) {
|
|
1853
|
-
if ((0,validation
|
|
1909
|
+
if ((0,validation.check12ValidFormat)(comments, regex.scorm12_regex.CMIString4096, true)) {
|
|
1854
1910
|
this._comments = comments;
|
|
1855
1911
|
}
|
|
1856
1912
|
},
|
|
@@ -1863,7 +1919,7 @@ var CMI = (function (_super) {
|
|
|
1863
1919
|
},
|
|
1864
1920
|
set: function (comments_from_lms) {
|
|
1865
1921
|
if (this.initialized) {
|
|
1866
|
-
throw new
|
|
1922
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1867
1923
|
}
|
|
1868
1924
|
else {
|
|
1869
1925
|
this._comments_from_lms = comments_from_lms;
|
|
@@ -1876,7 +1932,7 @@ var CMI = (function (_super) {
|
|
|
1876
1932
|
return this.core.getCurrentTotalTime(this.start_time);
|
|
1877
1933
|
};
|
|
1878
1934
|
return CMI;
|
|
1879
|
-
}(base_cmi
|
|
1935
|
+
}(base_cmi.BaseRootCMI));
|
|
1880
1936
|
|
|
1881
1937
|
|
|
1882
1938
|
|
|
@@ -1885,17 +1941,18 @@ var CMI = (function (_super) {
|
|
|
1885
1941
|
/***/ 833:
|
|
1886
1942
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1887
1943
|
|
|
1944
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1888
1945
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1889
|
-
/* harmony export */
|
|
1890
|
-
/* harmony export */
|
|
1891
|
-
/* harmony export */
|
|
1892
|
-
/* harmony export */
|
|
1946
|
+
/* harmony export */ CMIInteractions: function() { return /* binding */ CMIInteractions; },
|
|
1947
|
+
/* harmony export */ CMIInteractionsCorrectResponsesObject: function() { return /* binding */ CMIInteractionsCorrectResponsesObject; },
|
|
1948
|
+
/* harmony export */ CMIInteractionsObject: function() { return /* binding */ CMIInteractionsObject; },
|
|
1949
|
+
/* harmony export */ CMIInteractionsObjectivesObject: function() { return /* binding */ CMIInteractionsObjectivesObject; }
|
|
1893
1950
|
/* harmony export */ });
|
|
1894
1951
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(635);
|
|
1895
1952
|
/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(589);
|
|
1896
1953
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
1897
1954
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(797);
|
|
1898
|
-
/* harmony import */ var
|
|
1955
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(179);
|
|
1899
1956
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(319);
|
|
1900
1957
|
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(915);
|
|
1901
1958
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(417);
|
|
@@ -1908,19 +1965,19 @@ var CMI = (function (_super) {
|
|
|
1908
1965
|
|
|
1909
1966
|
|
|
1910
1967
|
var CMIInteractions = (function (_super) {
|
|
1911
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
1968
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractions, _super);
|
|
1912
1969
|
function CMIInteractions() {
|
|
1913
1970
|
return _super.call(this, {
|
|
1914
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
1915
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__
|
|
1916
|
-
errorClass:
|
|
1971
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.interactions_children,
|
|
1972
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.INVALID_SET_VALUE,
|
|
1973
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError,
|
|
1917
1974
|
}) || this;
|
|
1918
1975
|
}
|
|
1919
1976
|
return CMIInteractions;
|
|
1920
|
-
}(_common_array__WEBPACK_IMPORTED_MODULE_0__
|
|
1977
|
+
}(_common_array__WEBPACK_IMPORTED_MODULE_0__.CMIArray));
|
|
1921
1978
|
|
|
1922
1979
|
var CMIInteractionsObject = (function (_super) {
|
|
1923
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
1980
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsObject, _super);
|
|
1924
1981
|
function CMIInteractionsObject() {
|
|
1925
1982
|
var _this = _super.call(this) || this;
|
|
1926
1983
|
_this._id = "";
|
|
@@ -1930,15 +1987,15 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1930
1987
|
_this._student_response = "";
|
|
1931
1988
|
_this._result = "";
|
|
1932
1989
|
_this._latency = "";
|
|
1933
|
-
_this.objectives = new _common_array__WEBPACK_IMPORTED_MODULE_0__
|
|
1934
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__
|
|
1935
|
-
errorClass:
|
|
1936
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
1990
|
+
_this.objectives = new _common_array__WEBPACK_IMPORTED_MODULE_0__.CMIArray({
|
|
1991
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.INVALID_SET_VALUE,
|
|
1992
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError,
|
|
1993
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.objectives_children,
|
|
1937
1994
|
});
|
|
1938
|
-
_this.correct_responses = new _common_array__WEBPACK_IMPORTED_MODULE_0__
|
|
1939
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__
|
|
1940
|
-
errorClass:
|
|
1941
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
1995
|
+
_this.correct_responses = new _common_array__WEBPACK_IMPORTED_MODULE_0__.CMIArray({
|
|
1996
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.INVALID_SET_VALUE,
|
|
1997
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError,
|
|
1998
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.correct_responses_children,
|
|
1942
1999
|
});
|
|
1943
2000
|
return _this;
|
|
1944
2001
|
}
|
|
@@ -1948,15 +2005,28 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1948
2005
|
(_a = this.objectives) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
1949
2006
|
(_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.initialize();
|
|
1950
2007
|
};
|
|
2008
|
+
CMIInteractionsObject.prototype.reset = function () {
|
|
2009
|
+
var _a, _b;
|
|
2010
|
+
this._initialized = false;
|
|
2011
|
+
this._id = "";
|
|
2012
|
+
this._time = "";
|
|
2013
|
+
this._type = "";
|
|
2014
|
+
this._weighting = "";
|
|
2015
|
+
this._student_response = "";
|
|
2016
|
+
this._result = "";
|
|
2017
|
+
this._latency = "";
|
|
2018
|
+
(_a = this.objectives) === null || _a === void 0 ? void 0 : _a.reset();
|
|
2019
|
+
(_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.reset();
|
|
2020
|
+
};
|
|
1951
2021
|
Object.defineProperty(CMIInteractionsObject.prototype, "id", {
|
|
1952
2022
|
get: function () {
|
|
1953
2023
|
if (!this.jsonString) {
|
|
1954
|
-
throw new
|
|
2024
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1955
2025
|
}
|
|
1956
2026
|
return this._id;
|
|
1957
2027
|
},
|
|
1958
2028
|
set: function (id) {
|
|
1959
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
2029
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIIdentifier)) {
|
|
1960
2030
|
this._id = id;
|
|
1961
2031
|
}
|
|
1962
2032
|
},
|
|
@@ -1966,12 +2036,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1966
2036
|
Object.defineProperty(CMIInteractionsObject.prototype, "time", {
|
|
1967
2037
|
get: function () {
|
|
1968
2038
|
if (!this.jsonString) {
|
|
1969
|
-
throw new
|
|
2039
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1970
2040
|
}
|
|
1971
2041
|
return this._time;
|
|
1972
2042
|
},
|
|
1973
2043
|
set: function (time) {
|
|
1974
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
2044
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(time, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMITime)) {
|
|
1975
2045
|
this._time = time;
|
|
1976
2046
|
}
|
|
1977
2047
|
},
|
|
@@ -1981,12 +2051,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1981
2051
|
Object.defineProperty(CMIInteractionsObject.prototype, "type", {
|
|
1982
2052
|
get: function () {
|
|
1983
2053
|
if (!this.jsonString) {
|
|
1984
|
-
throw new
|
|
2054
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1985
2055
|
}
|
|
1986
2056
|
return this._type;
|
|
1987
2057
|
},
|
|
1988
2058
|
set: function (type) {
|
|
1989
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
2059
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(type, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIType)) {
|
|
1990
2060
|
this._type = type;
|
|
1991
2061
|
}
|
|
1992
2062
|
},
|
|
@@ -1996,13 +2066,13 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1996
2066
|
Object.defineProperty(CMIInteractionsObject.prototype, "weighting", {
|
|
1997
2067
|
get: function () {
|
|
1998
2068
|
if (!this.jsonString) {
|
|
1999
|
-
throw new
|
|
2069
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
2000
2070
|
}
|
|
2001
2071
|
return this._weighting;
|
|
2002
2072
|
},
|
|
2003
2073
|
set: function (weighting) {
|
|
2004
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
2005
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
2074
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIDecimal) &&
|
|
2075
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidRange)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.weighting_range)) {
|
|
2006
2076
|
this._weighting = weighting;
|
|
2007
2077
|
}
|
|
2008
2078
|
},
|
|
@@ -2012,12 +2082,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2012
2082
|
Object.defineProperty(CMIInteractionsObject.prototype, "student_response", {
|
|
2013
2083
|
get: function () {
|
|
2014
2084
|
if (!this.jsonString) {
|
|
2015
|
-
throw new
|
|
2085
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
2016
2086
|
}
|
|
2017
2087
|
return this._student_response;
|
|
2018
2088
|
},
|
|
2019
2089
|
set: function (student_response) {
|
|
2020
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
2090
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(student_response, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIFeedback, true)) {
|
|
2021
2091
|
this._student_response = student_response;
|
|
2022
2092
|
}
|
|
2023
2093
|
},
|
|
@@ -2027,12 +2097,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2027
2097
|
Object.defineProperty(CMIInteractionsObject.prototype, "result", {
|
|
2028
2098
|
get: function () {
|
|
2029
2099
|
if (!this.jsonString) {
|
|
2030
|
-
throw new
|
|
2100
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
2031
2101
|
}
|
|
2032
2102
|
return this._result;
|
|
2033
2103
|
},
|
|
2034
2104
|
set: function (result) {
|
|
2035
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
2105
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(result, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIResult)) {
|
|
2036
2106
|
this._result = result;
|
|
2037
2107
|
}
|
|
2038
2108
|
},
|
|
@@ -2042,12 +2112,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2042
2112
|
Object.defineProperty(CMIInteractionsObject.prototype, "latency", {
|
|
2043
2113
|
get: function () {
|
|
2044
2114
|
if (!this.jsonString) {
|
|
2045
|
-
throw new
|
|
2115
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
2046
2116
|
}
|
|
2047
2117
|
return this._latency;
|
|
2048
2118
|
},
|
|
2049
2119
|
set: function (latency) {
|
|
2050
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
2120
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(latency, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMITimespan)) {
|
|
2051
2121
|
this._latency = latency;
|
|
2052
2122
|
}
|
|
2053
2123
|
},
|
|
@@ -2071,21 +2141,25 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2071
2141
|
return result;
|
|
2072
2142
|
};
|
|
2073
2143
|
return CMIInteractionsObject;
|
|
2074
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
2144
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
2075
2145
|
|
|
2076
2146
|
var CMIInteractionsObjectivesObject = (function (_super) {
|
|
2077
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
2147
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsObjectivesObject, _super);
|
|
2078
2148
|
function CMIInteractionsObjectivesObject() {
|
|
2079
2149
|
var _this = _super.call(this) || this;
|
|
2080
2150
|
_this._id = "";
|
|
2081
2151
|
return _this;
|
|
2082
2152
|
}
|
|
2153
|
+
CMIInteractionsObjectivesObject.prototype.reset = function () {
|
|
2154
|
+
this._initialized = false;
|
|
2155
|
+
this._id = "";
|
|
2156
|
+
};
|
|
2083
2157
|
Object.defineProperty(CMIInteractionsObjectivesObject.prototype, "id", {
|
|
2084
2158
|
get: function () {
|
|
2085
2159
|
return this._id;
|
|
2086
2160
|
},
|
|
2087
2161
|
set: function (id) {
|
|
2088
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
2162
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIIdentifier)) {
|
|
2089
2163
|
this._id = id;
|
|
2090
2164
|
}
|
|
2091
2165
|
},
|
|
@@ -2101,24 +2175,28 @@ var CMIInteractionsObjectivesObject = (function (_super) {
|
|
|
2101
2175
|
return result;
|
|
2102
2176
|
};
|
|
2103
2177
|
return CMIInteractionsObjectivesObject;
|
|
2104
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
2178
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
2105
2179
|
|
|
2106
2180
|
var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
2107
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
2181
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsCorrectResponsesObject, _super);
|
|
2108
2182
|
function CMIInteractionsCorrectResponsesObject() {
|
|
2109
2183
|
var _this = _super.call(this) || this;
|
|
2110
2184
|
_this._pattern = "";
|
|
2111
2185
|
return _this;
|
|
2112
2186
|
}
|
|
2187
|
+
CMIInteractionsCorrectResponsesObject.prototype.reset = function () {
|
|
2188
|
+
this._initialized = false;
|
|
2189
|
+
this._pattern = "";
|
|
2190
|
+
};
|
|
2113
2191
|
Object.defineProperty(CMIInteractionsCorrectResponsesObject.prototype, "pattern", {
|
|
2114
2192
|
get: function () {
|
|
2115
2193
|
if (!this.jsonString) {
|
|
2116
|
-
throw new
|
|
2194
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
2117
2195
|
}
|
|
2118
2196
|
return this._pattern;
|
|
2119
2197
|
},
|
|
2120
2198
|
set: function (pattern) {
|
|
2121
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
2199
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(pattern, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIFeedback, true)) {
|
|
2122
2200
|
this._pattern = pattern;
|
|
2123
2201
|
}
|
|
2124
2202
|
},
|
|
@@ -2134,7 +2212,7 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
2134
2212
|
return result;
|
|
2135
2213
|
};
|
|
2136
2214
|
return CMIInteractionsCorrectResponsesObject;
|
|
2137
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
2215
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
2138
2216
|
|
|
2139
2217
|
|
|
2140
2218
|
|
|
@@ -2143,8 +2221,9 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
2143
2221
|
/***/ 331:
|
|
2144
2222
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2145
2223
|
|
|
2224
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2146
2225
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2147
|
-
/* harmony export */
|
|
2226
|
+
/* harmony export */ NAV: function() { return /* binding */ NAV; }
|
|
2148
2227
|
/* harmony export */ });
|
|
2149
2228
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635);
|
|
2150
2229
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
@@ -2155,18 +2234,22 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
2155
2234
|
|
|
2156
2235
|
|
|
2157
2236
|
var NAV = (function (_super) {
|
|
2158
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_3__
|
|
2237
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_3__.__extends)(NAV, _super);
|
|
2159
2238
|
function NAV() {
|
|
2160
2239
|
var _this = _super.call(this) || this;
|
|
2161
2240
|
_this._event = "";
|
|
2162
2241
|
return _this;
|
|
2163
2242
|
}
|
|
2243
|
+
NAV.prototype.reset = function () {
|
|
2244
|
+
this._event = "";
|
|
2245
|
+
this._initialized = false;
|
|
2246
|
+
};
|
|
2164
2247
|
Object.defineProperty(NAV.prototype, "event", {
|
|
2165
2248
|
get: function () {
|
|
2166
2249
|
return this._event;
|
|
2167
2250
|
},
|
|
2168
2251
|
set: function (event) {
|
|
2169
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_1__
|
|
2252
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_1__.check12ValidFormat)(event, _constants_regex__WEBPACK_IMPORTED_MODULE_2__.scorm12_regex.NAVEvent)) {
|
|
2170
2253
|
this._event = event;
|
|
2171
2254
|
}
|
|
2172
2255
|
},
|
|
@@ -2182,7 +2265,7 @@ var NAV = (function (_super) {
|
|
|
2182
2265
|
return result;
|
|
2183
2266
|
};
|
|
2184
2267
|
return NAV;
|
|
2185
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
2268
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
2186
2269
|
|
|
2187
2270
|
|
|
2188
2271
|
|
|
@@ -2191,9 +2274,10 @@ var NAV = (function (_super) {
|
|
|
2191
2274
|
/***/ 176:
|
|
2192
2275
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2193
2276
|
|
|
2277
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2194
2278
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2195
|
-
/* harmony export */
|
|
2196
|
-
/* harmony export */
|
|
2279
|
+
/* harmony export */ CMIObjectives: function() { return /* binding */ CMIObjectives; },
|
|
2280
|
+
/* harmony export */ CMIObjectivesObject: function() { return /* binding */ CMIObjectivesObject; }
|
|
2197
2281
|
/* harmony export */ });
|
|
2198
2282
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(635);
|
|
2199
2283
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
@@ -2201,7 +2285,7 @@ var NAV = (function (_super) {
|
|
|
2201
2285
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(340);
|
|
2202
2286
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(417);
|
|
2203
2287
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(797);
|
|
2204
|
-
/* harmony import */ var
|
|
2288
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(179);
|
|
2205
2289
|
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(915);
|
|
2206
2290
|
/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(589);
|
|
2207
2291
|
|
|
@@ -2214,39 +2298,46 @@ var NAV = (function (_super) {
|
|
|
2214
2298
|
|
|
2215
2299
|
|
|
2216
2300
|
var CMIObjectives = (function (_super) {
|
|
2217
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_8__
|
|
2301
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_8__.__extends)(CMIObjectives, _super);
|
|
2218
2302
|
function CMIObjectives() {
|
|
2219
2303
|
return _super.call(this, {
|
|
2220
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2221
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
2222
|
-
errorClass:
|
|
2304
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.objectives_children,
|
|
2305
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.INVALID_SET_VALUE,
|
|
2306
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_5__.Scorm12ValidationError,
|
|
2223
2307
|
}) || this;
|
|
2224
2308
|
}
|
|
2225
2309
|
return CMIObjectives;
|
|
2226
|
-
}(_common_array__WEBPACK_IMPORTED_MODULE_7__
|
|
2310
|
+
}(_common_array__WEBPACK_IMPORTED_MODULE_7__.CMIArray));
|
|
2227
2311
|
|
|
2228
2312
|
var CMIObjectivesObject = (function (_super) {
|
|
2229
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_8__
|
|
2313
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_8__.__extends)(CMIObjectivesObject, _super);
|
|
2230
2314
|
function CMIObjectivesObject() {
|
|
2231
2315
|
var _this = _super.call(this) || this;
|
|
2232
2316
|
_this._id = "";
|
|
2233
2317
|
_this._status = "";
|
|
2234
|
-
_this.score = new _common_score__WEBPACK_IMPORTED_MODULE_1__
|
|
2235
|
-
score_children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2236
|
-
score_range: _constants_regex__WEBPACK_IMPORTED_MODULE_3__
|
|
2237
|
-
invalidErrorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
2238
|
-
invalidTypeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
2239
|
-
invalidRangeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
2240
|
-
errorClass:
|
|
2318
|
+
_this.score = new _common_score__WEBPACK_IMPORTED_MODULE_1__.CMIScore({
|
|
2319
|
+
score_children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.score_children,
|
|
2320
|
+
score_range: _constants_regex__WEBPACK_IMPORTED_MODULE_3__.scorm12_regex.score_range,
|
|
2321
|
+
invalidErrorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.INVALID_SET_VALUE,
|
|
2322
|
+
invalidTypeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.TYPE_MISMATCH,
|
|
2323
|
+
invalidRangeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.VALUE_OUT_OF_RANGE,
|
|
2324
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_5__.Scorm12ValidationError,
|
|
2241
2325
|
});
|
|
2242
2326
|
return _this;
|
|
2243
2327
|
}
|
|
2328
|
+
CMIObjectivesObject.prototype.reset = function () {
|
|
2329
|
+
var _a;
|
|
2330
|
+
this._initialized = false;
|
|
2331
|
+
this._id = "";
|
|
2332
|
+
this._status = "";
|
|
2333
|
+
(_a = this.score) === null || _a === void 0 ? void 0 : _a.reset();
|
|
2334
|
+
};
|
|
2244
2335
|
Object.defineProperty(CMIObjectivesObject.prototype, "id", {
|
|
2245
2336
|
get: function () {
|
|
2246
2337
|
return this._id;
|
|
2247
2338
|
},
|
|
2248
2339
|
set: function (id) {
|
|
2249
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__
|
|
2340
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__.check12ValidFormat)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_3__.scorm12_regex.CMIIdentifier)) {
|
|
2250
2341
|
this._id = id;
|
|
2251
2342
|
}
|
|
2252
2343
|
},
|
|
@@ -2258,7 +2349,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2258
2349
|
return this._status;
|
|
2259
2350
|
},
|
|
2260
2351
|
set: function (status) {
|
|
2261
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__
|
|
2352
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__.check12ValidFormat)(status, _constants_regex__WEBPACK_IMPORTED_MODULE_3__.scorm12_regex.CMIStatus2)) {
|
|
2262
2353
|
this._status = status;
|
|
2263
2354
|
}
|
|
2264
2355
|
},
|
|
@@ -2276,7 +2367,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2276
2367
|
return result;
|
|
2277
2368
|
};
|
|
2278
2369
|
return CMIObjectivesObject;
|
|
2279
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
2370
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
2280
2371
|
|
|
2281
2372
|
|
|
2282
2373
|
|
|
@@ -2285,13 +2376,14 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2285
2376
|
/***/ 532:
|
|
2286
2377
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2287
2378
|
|
|
2379
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2288
2380
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2289
|
-
/* harmony export */
|
|
2381
|
+
/* harmony export */ CMIStudentData: function() { return /* binding */ CMIStudentData; }
|
|
2290
2382
|
/* harmony export */ });
|
|
2291
2383
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635);
|
|
2292
2384
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
2293
2385
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
2294
|
-
/* harmony import */ var
|
|
2386
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(179);
|
|
2295
2387
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797);
|
|
2296
2388
|
|
|
2297
2389
|
|
|
@@ -2299,7 +2391,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2299
2391
|
|
|
2300
2392
|
|
|
2301
2393
|
var CMIStudentData = (function (_super) {
|
|
2302
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_4__
|
|
2394
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_4__.__extends)(CMIStudentData, _super);
|
|
2303
2395
|
function CMIStudentData(student_data_children) {
|
|
2304
2396
|
var _this = _super.call(this) || this;
|
|
2305
2397
|
_this._mastery_score = "";
|
|
@@ -2307,15 +2399,18 @@ var CMIStudentData = (function (_super) {
|
|
|
2307
2399
|
_this._time_limit_action = "";
|
|
2308
2400
|
_this.__children = student_data_children
|
|
2309
2401
|
? student_data_children
|
|
2310
|
-
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
2402
|
+
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.student_data_children;
|
|
2311
2403
|
return _this;
|
|
2312
2404
|
}
|
|
2405
|
+
CMIStudentData.prototype.reset = function () {
|
|
2406
|
+
this._initialized = false;
|
|
2407
|
+
};
|
|
2313
2408
|
Object.defineProperty(CMIStudentData.prototype, "_children", {
|
|
2314
2409
|
get: function () {
|
|
2315
2410
|
return this.__children;
|
|
2316
2411
|
},
|
|
2317
2412
|
set: function (_children) {
|
|
2318
|
-
throw new
|
|
2413
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.INVALID_SET_VALUE);
|
|
2319
2414
|
},
|
|
2320
2415
|
enumerable: false,
|
|
2321
2416
|
configurable: true
|
|
@@ -2326,7 +2421,7 @@ var CMIStudentData = (function (_super) {
|
|
|
2326
2421
|
},
|
|
2327
2422
|
set: function (mastery_score) {
|
|
2328
2423
|
if (this.initialized) {
|
|
2329
|
-
throw new
|
|
2424
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.READ_ONLY_ELEMENT);
|
|
2330
2425
|
}
|
|
2331
2426
|
else {
|
|
2332
2427
|
this._mastery_score = mastery_score;
|
|
@@ -2341,7 +2436,7 @@ var CMIStudentData = (function (_super) {
|
|
|
2341
2436
|
},
|
|
2342
2437
|
set: function (max_time_allowed) {
|
|
2343
2438
|
if (this.initialized) {
|
|
2344
|
-
throw new
|
|
2439
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.READ_ONLY_ELEMENT);
|
|
2345
2440
|
}
|
|
2346
2441
|
else {
|
|
2347
2442
|
this._max_time_allowed = max_time_allowed;
|
|
@@ -2356,7 +2451,7 @@ var CMIStudentData = (function (_super) {
|
|
|
2356
2451
|
},
|
|
2357
2452
|
set: function (time_limit_action) {
|
|
2358
2453
|
if (this.initialized) {
|
|
2359
|
-
throw new
|
|
2454
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.READ_ONLY_ELEMENT);
|
|
2360
2455
|
}
|
|
2361
2456
|
else {
|
|
2362
2457
|
this._time_limit_action = time_limit_action;
|
|
@@ -2376,7 +2471,7 @@ var CMIStudentData = (function (_super) {
|
|
|
2376
2471
|
return result;
|
|
2377
2472
|
};
|
|
2378
2473
|
return CMIStudentData;
|
|
2379
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
2474
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
2380
2475
|
|
|
2381
2476
|
|
|
2382
2477
|
|
|
@@ -2385,16 +2480,17 @@ var CMIStudentData = (function (_super) {
|
|
|
2385
2480
|
/***/ 181:
|
|
2386
2481
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2387
2482
|
|
|
2483
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2388
2484
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2389
|
-
/* harmony export */
|
|
2485
|
+
/* harmony export */ CMIStudentPreference: function() { return /* binding */ CMIStudentPreference; }
|
|
2390
2486
|
/* harmony export */ });
|
|
2391
2487
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(635);
|
|
2392
2488
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
2393
2489
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
2394
|
-
/* harmony import */ var
|
|
2395
|
-
/* harmony import */ var
|
|
2396
|
-
/* harmony import */ var
|
|
2397
|
-
/* harmony import */ var
|
|
2490
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(179);
|
|
2491
|
+
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(915);
|
|
2492
|
+
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(417);
|
|
2493
|
+
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(797);
|
|
2398
2494
|
|
|
2399
2495
|
|
|
2400
2496
|
|
|
@@ -2403,7 +2499,7 @@ var CMIStudentData = (function (_super) {
|
|
|
2403
2499
|
|
|
2404
2500
|
|
|
2405
2501
|
var CMIStudentPreference = (function (_super) {
|
|
2406
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_6__
|
|
2502
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_6__.__extends)(CMIStudentPreference, _super);
|
|
2407
2503
|
function CMIStudentPreference(student_preference_children) {
|
|
2408
2504
|
var _this = _super.call(this) || this;
|
|
2409
2505
|
_this._audio = "";
|
|
@@ -2412,15 +2508,18 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2412
2508
|
_this._text = "";
|
|
2413
2509
|
_this.__children = student_preference_children
|
|
2414
2510
|
? student_preference_children
|
|
2415
|
-
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
2511
|
+
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.student_preference_children;
|
|
2416
2512
|
return _this;
|
|
2417
2513
|
}
|
|
2514
|
+
CMIStudentPreference.prototype.reset = function () {
|
|
2515
|
+
this._initialized = false;
|
|
2516
|
+
};
|
|
2418
2517
|
Object.defineProperty(CMIStudentPreference.prototype, "_children", {
|
|
2419
2518
|
get: function () {
|
|
2420
2519
|
return this.__children;
|
|
2421
2520
|
},
|
|
2422
2521
|
set: function (_children) {
|
|
2423
|
-
throw new
|
|
2522
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_5__.scorm12_errors.INVALID_SET_VALUE);
|
|
2424
2523
|
},
|
|
2425
2524
|
enumerable: false,
|
|
2426
2525
|
configurable: true
|
|
@@ -2430,8 +2529,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2430
2529
|
return this._audio;
|
|
2431
2530
|
},
|
|
2432
2531
|
set: function (audio) {
|
|
2433
|
-
if ((0,
|
|
2434
|
-
(0,
|
|
2532
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMISInteger) &&
|
|
2533
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidRange)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.audio_range)) {
|
|
2435
2534
|
this._audio = audio;
|
|
2436
2535
|
}
|
|
2437
2536
|
},
|
|
@@ -2443,7 +2542,7 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2443
2542
|
return this._language;
|
|
2444
2543
|
},
|
|
2445
2544
|
set: function (language) {
|
|
2446
|
-
if ((0,
|
|
2545
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(language, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMIString256)) {
|
|
2447
2546
|
this._language = language;
|
|
2448
2547
|
}
|
|
2449
2548
|
},
|
|
@@ -2455,8 +2554,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2455
2554
|
return this._speed;
|
|
2456
2555
|
},
|
|
2457
2556
|
set: function (speed) {
|
|
2458
|
-
if ((0,
|
|
2459
|
-
(0,
|
|
2557
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMISInteger) &&
|
|
2558
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidRange)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.speed_range)) {
|
|
2460
2559
|
this._speed = speed;
|
|
2461
2560
|
}
|
|
2462
2561
|
},
|
|
@@ -2468,8 +2567,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2468
2567
|
return this._text;
|
|
2469
2568
|
},
|
|
2470
2569
|
set: function (text) {
|
|
2471
|
-
if ((0,
|
|
2472
|
-
(0,
|
|
2570
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMISInteger) &&
|
|
2571
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidRange)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.text_range)) {
|
|
2473
2572
|
this._text = text;
|
|
2474
2573
|
}
|
|
2475
2574
|
},
|
|
@@ -2488,7 +2587,7 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2488
2587
|
return result;
|
|
2489
2588
|
};
|
|
2490
2589
|
return CMIStudentPreference;
|
|
2491
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
2590
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
2492
2591
|
|
|
2493
2592
|
|
|
2494
2593
|
|
|
@@ -2497,24 +2596,25 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2497
2596
|
/***/ 915:
|
|
2498
2597
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2499
2598
|
|
|
2599
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2500
2600
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2501
|
-
/* harmony export */
|
|
2502
|
-
/* harmony export */
|
|
2601
|
+
/* harmony export */ check12ValidFormat: function() { return /* binding */ check12ValidFormat; },
|
|
2602
|
+
/* harmony export */ check12ValidRange: function() { return /* binding */ check12ValidRange; }
|
|
2503
2603
|
/* harmony export */ });
|
|
2504
2604
|
/* harmony import */ var _common_validation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(449);
|
|
2505
2605
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(797);
|
|
2506
|
-
/* harmony import */ var
|
|
2606
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(179);
|
|
2507
2607
|
|
|
2508
2608
|
|
|
2509
2609
|
|
|
2510
2610
|
function check12ValidFormat(value, regexPattern, allowEmptyString) {
|
|
2511
|
-
return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__
|
|
2611
|
+
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);
|
|
2512
2612
|
}
|
|
2513
2613
|
function check12ValidRange(value, rangePattern, allowEmptyString) {
|
|
2514
2614
|
if (!allowEmptyString && value === "") {
|
|
2515
|
-
throw new
|
|
2615
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_1__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_0__.scorm12_errors.VALUE_OUT_OF_RANGE);
|
|
2516
2616
|
}
|
|
2517
|
-
return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__
|
|
2617
|
+
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);
|
|
2518
2618
|
}
|
|
2519
2619
|
|
|
2520
2620
|
|
|
@@ -2523,21 +2623,23 @@ function check12ValidRange(value, rangePattern, allowEmptyString) {
|
|
|
2523
2623
|
/***/ 340:
|
|
2524
2624
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2525
2625
|
|
|
2626
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2627
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2628
|
+
/* harmony export */ aicc_constants: function() { return /* binding */ aicc_constants; },
|
|
2629
|
+
/* harmony export */ global_constants: function() { return /* binding */ global_constants; },
|
|
2630
|
+
/* harmony export */ scorm12_constants: function() { return /* binding */ scorm12_constants; },
|
|
2631
|
+
/* harmony export */ scorm2004_constants: function() { return /* binding */ scorm2004_constants; }
|
|
2632
|
+
/* harmony export */ });
|
|
2526
2633
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
2527
2634
|
|
|
2528
|
-
var
|
|
2635
|
+
var global_constants = {
|
|
2529
2636
|
SCORM_TRUE: "true",
|
|
2530
2637
|
SCORM_FALSE: "false",
|
|
2531
2638
|
STATE_NOT_INITIALIZED: 0,
|
|
2532
2639
|
STATE_INITIALIZED: 1,
|
|
2533
2640
|
STATE_TERMINATED: 2,
|
|
2534
|
-
LOG_LEVEL_DEBUG: 1,
|
|
2535
|
-
LOG_LEVEL_INFO: 2,
|
|
2536
|
-
LOG_LEVEL_WARNING: 3,
|
|
2537
|
-
LOG_LEVEL_ERROR: 4,
|
|
2538
|
-
LOG_LEVEL_NONE: 5,
|
|
2539
2641
|
};
|
|
2540
|
-
var
|
|
2642
|
+
var scorm12_constants = {
|
|
2541
2643
|
cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",
|
|
2542
2644
|
core_children: "student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",
|
|
2543
2645
|
score_children: "raw,min,max",
|
|
@@ -2598,7 +2700,7 @@ var scorm12 = {
|
|
|
2598
2700
|
},
|
|
2599
2701
|
},
|
|
2600
2702
|
};
|
|
2601
|
-
var
|
|
2703
|
+
var aicc_constants = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, scorm12_constants), {
|
|
2602
2704
|
cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",
|
|
2603
2705
|
student_preference_children: "audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",
|
|
2604
2706
|
student_data_children: "attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",
|
|
@@ -2607,7 +2709,7 @@ var aicc = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__W
|
|
|
2607
2709
|
attempt_records_children: "score,lesson_status",
|
|
2608
2710
|
paths_children: "location_id,date,time,status,why_left,time_in_element",
|
|
2609
2711
|
});
|
|
2610
|
-
var
|
|
2712
|
+
var scorm2004_constants = {
|
|
2611
2713
|
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",
|
|
2612
2714
|
comments_children: "comment,timestamp,location",
|
|
2613
2715
|
score_children: "max,raw,scaled,min",
|
|
@@ -2616,6 +2718,7 @@ var scorm2004 = {
|
|
|
2616
2718
|
student_data_children: "mastery_score,max_time_allowed,time_limit_action",
|
|
2617
2719
|
student_preference_children: "audio_level,audio_captioning,delivery_speed,language",
|
|
2618
2720
|
interactions_children: "id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",
|
|
2721
|
+
adl_data_children: "id,store",
|
|
2619
2722
|
error_descriptions: {
|
|
2620
2723
|
"0": {
|
|
2621
2724
|
basicMessage: "No Error",
|
|
@@ -2723,13 +2826,6 @@ var scorm2004 = {
|
|
|
2723
2826
|
},
|
|
2724
2827
|
},
|
|
2725
2828
|
};
|
|
2726
|
-
var APIConstants = {
|
|
2727
|
-
global: global,
|
|
2728
|
-
scorm12: scorm12,
|
|
2729
|
-
aicc: aicc,
|
|
2730
|
-
scorm2004: scorm2004,
|
|
2731
|
-
};
|
|
2732
|
-
/* harmony default export */ __webpack_exports__.A = (APIConstants);
|
|
2733
2829
|
|
|
2734
2830
|
|
|
2735
2831
|
/***/ }),
|
|
@@ -2737,11 +2833,13 @@ var APIConstants = {
|
|
|
2737
2833
|
/***/ 56:
|
|
2738
2834
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2739
2835
|
|
|
2836
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2740
2837
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2741
|
-
/* harmony export */
|
|
2742
|
-
/* harmony export */
|
|
2838
|
+
/* harmony export */ CompletionStatus: function() { return /* binding */ CompletionStatus; },
|
|
2839
|
+
/* harmony export */ LogLevelEnum: function() { return /* binding */ LogLevelEnum; },
|
|
2840
|
+
/* harmony export */ NAVBoolean: function() { return /* binding */ NAVBoolean; },
|
|
2841
|
+
/* harmony export */ SuccessStatus: function() { return /* binding */ SuccessStatus; }
|
|
2743
2842
|
/* harmony export */ });
|
|
2744
|
-
/* unused harmony export NAVBoolean */
|
|
2745
2843
|
var NAVBoolean;
|
|
2746
2844
|
(function (NAVBoolean) {
|
|
2747
2845
|
NAVBoolean["unknown"] = "unknown";
|
|
@@ -2760,6 +2858,15 @@ var CompletionStatus;
|
|
|
2760
2858
|
CompletionStatus["incomplete"] = "incomplete";
|
|
2761
2859
|
CompletionStatus["unknown"] = "unknown";
|
|
2762
2860
|
})(CompletionStatus || (CompletionStatus = {}));
|
|
2861
|
+
var LogLevelEnum;
|
|
2862
|
+
(function (LogLevelEnum) {
|
|
2863
|
+
LogLevelEnum[LogLevelEnum["_"] = 0] = "_";
|
|
2864
|
+
LogLevelEnum[LogLevelEnum["DEBUG"] = 1] = "DEBUG";
|
|
2865
|
+
LogLevelEnum[LogLevelEnum["INFO"] = 2] = "INFO";
|
|
2866
|
+
LogLevelEnum[LogLevelEnum["WARN"] = 3] = "WARN";
|
|
2867
|
+
LogLevelEnum[LogLevelEnum["ERROR"] = 4] = "ERROR";
|
|
2868
|
+
LogLevelEnum[LogLevelEnum["NONE"] = 5] = "NONE";
|
|
2869
|
+
})(LogLevelEnum || (LogLevelEnum = {}));
|
|
2763
2870
|
|
|
2764
2871
|
|
|
2765
2872
|
/***/ }),
|
|
@@ -2767,9 +2874,15 @@ var CompletionStatus;
|
|
|
2767
2874
|
/***/ 797:
|
|
2768
2875
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2769
2876
|
|
|
2877
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2878
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2879
|
+
/* harmony export */ global_errors: function() { return /* binding */ global_errors; },
|
|
2880
|
+
/* harmony export */ scorm12_errors: function() { return /* binding */ scorm12_errors; },
|
|
2881
|
+
/* harmony export */ scorm2004_errors: function() { return /* binding */ scorm2004_errors; }
|
|
2882
|
+
/* harmony export */ });
|
|
2770
2883
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
2771
2884
|
|
|
2772
|
-
var
|
|
2885
|
+
var global_errors = {
|
|
2773
2886
|
GENERAL: 101,
|
|
2774
2887
|
INITIALIZATION_FAILED: 101,
|
|
2775
2888
|
INITIALIZED: 101,
|
|
@@ -2799,13 +2912,8 @@ var global = {
|
|
|
2799
2912
|
VALUE_OUT_OF_RANGE: 101,
|
|
2800
2913
|
DEPENDENCY_NOT_ESTABLISHED: 101,
|
|
2801
2914
|
};
|
|
2802
|
-
var
|
|
2803
|
-
var
|
|
2804
|
-
var ErrorCodes = {
|
|
2805
|
-
scorm12: scorm12,
|
|
2806
|
-
scorm2004: scorm2004,
|
|
2807
|
-
};
|
|
2808
|
-
/* harmony default export */ __webpack_exports__.A = (ErrorCodes);
|
|
2915
|
+
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 });
|
|
2916
|
+
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 });
|
|
2809
2917
|
|
|
2810
2918
|
|
|
2811
2919
|
/***/ }),
|
|
@@ -2813,9 +2921,15 @@ var ErrorCodes = {
|
|
|
2813
2921
|
/***/ 417:
|
|
2814
2922
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2815
2923
|
|
|
2924
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2925
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2926
|
+
/* harmony export */ aicc_regex: function() { return /* binding */ aicc_regex; },
|
|
2927
|
+
/* harmony export */ scorm12_regex: function() { return /* binding */ scorm12_regex; },
|
|
2928
|
+
/* harmony export */ scorm2004_regex: function() { return /* binding */ scorm2004_regex; }
|
|
2929
|
+
/* harmony export */ });
|
|
2816
2930
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
2817
2931
|
|
|
2818
|
-
var
|
|
2932
|
+
var scorm12_regex = {
|
|
2819
2933
|
CMIString256: "^.{0,255}$",
|
|
2820
2934
|
CMIString4096: "^.{0,4096}$",
|
|
2821
2935
|
CMITime: "^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",
|
|
@@ -2838,10 +2952,10 @@ var scorm12 = {
|
|
|
2838
2952
|
weighting_range: "-100#100",
|
|
2839
2953
|
text_range: "-1#1",
|
|
2840
2954
|
};
|
|
2841
|
-
var
|
|
2955
|
+
var aicc_regex = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, scorm12_regex), {
|
|
2842
2956
|
CMIIdentifier: "^\\w{1,255}$",
|
|
2843
2957
|
});
|
|
2844
|
-
var
|
|
2958
|
+
var scorm2004_regex = {
|
|
2845
2959
|
CMIString200: "^[\\u0000-\\uFFFF]{0,200}$",
|
|
2846
2960
|
CMIString250: "^[\\u0000-\\uFFFF]{0,250}$",
|
|
2847
2961
|
CMIString1000: "^[\\u0000-\\uFFFF]{0,1000}$",
|
|
@@ -2868,7 +2982,7 @@ var scorm2004 = {
|
|
|
2868
2982
|
CMIExit: "^(time-out|suspend|logout|normal)$",
|
|
2869
2983
|
CMIType: "^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",
|
|
2870
2984
|
CMIResult: "^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",
|
|
2871
|
-
NAVEvent: "^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target
|
|
2985
|
+
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)$",
|
|
2872
2986
|
NAVBoolean: "^(unknown|true|false$)",
|
|
2873
2987
|
NAVTarget: "^{target=\\S{0,}[a-zA-Z0-9-_]+}$",
|
|
2874
2988
|
scaled_range: "-1#1",
|
|
@@ -2877,12 +2991,6 @@ var scorm2004 = {
|
|
|
2877
2991
|
text_range: "-1#1",
|
|
2878
2992
|
progress_range: "0#1",
|
|
2879
2993
|
};
|
|
2880
|
-
var Regex = {
|
|
2881
|
-
aicc: aicc,
|
|
2882
|
-
scorm12: scorm12,
|
|
2883
|
-
scorm2004: scorm2004,
|
|
2884
|
-
};
|
|
2885
|
-
/* harmony default export */ __webpack_exports__.A = (Regex);
|
|
2886
2994
|
|
|
2887
2995
|
|
|
2888
2996
|
/***/ }),
|
|
@@ -2890,22 +2998,15 @@ var Regex = {
|
|
|
2890
2998
|
/***/ 784:
|
|
2891
2999
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2892
3000
|
|
|
3001
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2893
3002
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2894
|
-
/* harmony export */
|
|
2895
|
-
/* harmony export */
|
|
2896
|
-
/* harmony export */ tQ: function() { return /* binding */ Scorm12ValidationError; },
|
|
2897
|
-
/* harmony export */ yI: function() { return /* binding */ ValidationError; }
|
|
3003
|
+
/* harmony export */ BaseScormValidationError: function() { return /* binding */ BaseScormValidationError; },
|
|
3004
|
+
/* harmony export */ ValidationError: function() { return /* binding */ ValidationError; }
|
|
2898
3005
|
/* harmony export */ });
|
|
2899
|
-
/*
|
|
2900
|
-
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(635);
|
|
2901
|
-
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340);
|
|
2902
|
-
|
|
3006
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
2903
3007
|
|
|
2904
|
-
var scorm12_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.error_descriptions;
|
|
2905
|
-
var aicc_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.aicc.error_descriptions;
|
|
2906
|
-
var scorm2004_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm2004.error_descriptions;
|
|
2907
3008
|
var BaseScormValidationError = (function (_super) {
|
|
2908
|
-
(0,
|
|
3009
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(BaseScormValidationError, _super);
|
|
2909
3010
|
function BaseScormValidationError(errorCode) {
|
|
2910
3011
|
var _this = _super.call(this, errorCode.toString()) || this;
|
|
2911
3012
|
_this._errorCode = errorCode;
|
|
@@ -2919,18 +3020,15 @@ var BaseScormValidationError = (function (_super) {
|
|
|
2919
3020
|
enumerable: false,
|
|
2920
3021
|
configurable: true
|
|
2921
3022
|
});
|
|
2922
|
-
BaseScormValidationError.prototype.setMessage = function (message) {
|
|
2923
|
-
this.message = message;
|
|
2924
|
-
};
|
|
2925
3023
|
return BaseScormValidationError;
|
|
2926
3024
|
}(Error));
|
|
2927
3025
|
|
|
2928
3026
|
var ValidationError = (function (_super) {
|
|
2929
|
-
(0,
|
|
3027
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(ValidationError, _super);
|
|
2930
3028
|
function ValidationError(errorCode, errorMessage, detailedMessage) {
|
|
2931
3029
|
var _this = _super.call(this, errorCode) || this;
|
|
2932
3030
|
_this._detailedMessage = "";
|
|
2933
|
-
_this.
|
|
3031
|
+
_this.message = errorMessage;
|
|
2934
3032
|
_this._errorMessage = errorMessage;
|
|
2935
3033
|
if (detailedMessage) {
|
|
2936
3034
|
_this._detailedMessage = detailedMessage;
|
|
@@ -2954,8 +3052,26 @@ var ValidationError = (function (_super) {
|
|
|
2954
3052
|
return ValidationError;
|
|
2955
3053
|
}(BaseScormValidationError));
|
|
2956
3054
|
|
|
3055
|
+
|
|
3056
|
+
|
|
3057
|
+
/***/ }),
|
|
3058
|
+
|
|
3059
|
+
/***/ 179:
|
|
3060
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
3061
|
+
|
|
3062
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3063
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3064
|
+
/* harmony export */ Scorm12ValidationError: function() { return /* binding */ Scorm12ValidationError; }
|
|
3065
|
+
/* harmony export */ });
|
|
3066
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(635);
|
|
3067
|
+
/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(784);
|
|
3068
|
+
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
3069
|
+
|
|
3070
|
+
|
|
3071
|
+
|
|
3072
|
+
var scorm12_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.error_descriptions;
|
|
2957
3073
|
var Scorm12ValidationError = (function (_super) {
|
|
2958
|
-
(0,
|
|
3074
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_2__.__extends)(Scorm12ValidationError, _super);
|
|
2959
3075
|
function Scorm12ValidationError(errorCode) {
|
|
2960
3076
|
var _this = this;
|
|
2961
3077
|
if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {
|
|
@@ -2967,37 +3083,7 @@ var Scorm12ValidationError = (function (_super) {
|
|
|
2967
3083
|
return _this;
|
|
2968
3084
|
}
|
|
2969
3085
|
return Scorm12ValidationError;
|
|
2970
|
-
}(ValidationError));
|
|
2971
|
-
|
|
2972
|
-
var AICCValidationError = (function (_super) {
|
|
2973
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(AICCValidationError, _super);
|
|
2974
|
-
function AICCValidationError(errorCode) {
|
|
2975
|
-
var _this = this;
|
|
2976
|
-
if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {
|
|
2977
|
-
_this = _super.call(this, errorCode, aicc_errors[String(errorCode)].basicMessage, aicc_errors[String(errorCode)].detailMessage) || this;
|
|
2978
|
-
}
|
|
2979
|
-
else {
|
|
2980
|
-
_this = _super.call(this, 101, aicc_errors["101"].basicMessage, aicc_errors["101"].detailMessage) || this;
|
|
2981
|
-
}
|
|
2982
|
-
return _this;
|
|
2983
|
-
}
|
|
2984
|
-
return AICCValidationError;
|
|
2985
|
-
}(ValidationError));
|
|
2986
|
-
|
|
2987
|
-
var Scorm2004ValidationError = (function (_super) {
|
|
2988
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(Scorm2004ValidationError, _super);
|
|
2989
|
-
function Scorm2004ValidationError(errorCode) {
|
|
2990
|
-
var _this = this;
|
|
2991
|
-
if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {
|
|
2992
|
-
_this = _super.call(this, errorCode, scorm2004_errors[String(errorCode)].basicMessage, scorm2004_errors[String(errorCode)].detailMessage) || this;
|
|
2993
|
-
}
|
|
2994
|
-
else {
|
|
2995
|
-
_this = _super.call(this, 101, scorm2004_errors["101"].basicMessage, scorm2004_errors["101"].detailMessage) || this;
|
|
2996
|
-
}
|
|
2997
|
-
return _this;
|
|
2998
|
-
}
|
|
2999
|
-
return Scorm2004ValidationError;
|
|
3000
|
-
}(ValidationError));
|
|
3086
|
+
}(_exceptions__WEBPACK_IMPORTED_MODULE_0__.ValidationError));
|
|
3001
3087
|
|
|
3002
3088
|
|
|
3003
3089
|
|
|
@@ -3006,16 +3092,24 @@ var Scorm2004ValidationError = (function (_super) {
|
|
|
3006
3092
|
/***/ 864:
|
|
3007
3093
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
3008
3094
|
|
|
3095
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3009
3096
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3010
|
-
/* harmony export */
|
|
3011
|
-
/* harmony export */
|
|
3012
|
-
/* harmony export */
|
|
3013
|
-
/* harmony export */
|
|
3014
|
-
/* harmony export */
|
|
3015
|
-
/* harmony export */
|
|
3016
|
-
/* harmony export */
|
|
3097
|
+
/* harmony export */ SECONDS_PER_DAY: function() { return /* binding */ SECONDS_PER_DAY; },
|
|
3098
|
+
/* harmony export */ SECONDS_PER_HOUR: function() { return /* binding */ SECONDS_PER_HOUR; },
|
|
3099
|
+
/* harmony export */ SECONDS_PER_MINUTE: function() { return /* binding */ SECONDS_PER_MINUTE; },
|
|
3100
|
+
/* harmony export */ SECONDS_PER_SECOND: function() { return /* binding */ SECONDS_PER_SECOND; },
|
|
3101
|
+
/* harmony export */ addHHMMSSTimeStrings: function() { return /* binding */ addHHMMSSTimeStrings; },
|
|
3102
|
+
/* harmony export */ addTwoDurations: function() { return /* binding */ addTwoDurations; },
|
|
3103
|
+
/* harmony export */ countDecimals: function() { return /* binding */ countDecimals; },
|
|
3104
|
+
/* harmony export */ flatten: function() { return /* binding */ flatten; },
|
|
3105
|
+
/* harmony export */ formatMessage: function() { return /* binding */ formatMessage; },
|
|
3106
|
+
/* harmony export */ getDurationAsSeconds: function() { return /* binding */ getDurationAsSeconds; },
|
|
3107
|
+
/* harmony export */ getSecondsAsHHMMSS: function() { return /* binding */ getSecondsAsHHMMSS; },
|
|
3108
|
+
/* harmony export */ getSecondsAsISODuration: function() { return /* binding */ getSecondsAsISODuration; },
|
|
3109
|
+
/* harmony export */ getTimeAsSeconds: function() { return /* binding */ getTimeAsSeconds; },
|
|
3110
|
+
/* harmony export */ stringMatches: function() { return /* binding */ stringMatches; },
|
|
3111
|
+
/* harmony export */ unflatten: function() { return /* binding */ unflatten; }
|
|
3017
3112
|
/* harmony export */ });
|
|
3018
|
-
/* unused harmony exports SECONDS_PER_SECOND, SECONDS_PER_MINUTE, SECONDS_PER_HOUR, SECONDS_PER_DAY, getSecondsAsISODuration, getDurationAsSeconds, addTwoDurations, countDecimals */
|
|
3019
3113
|
var SECONDS_PER_SECOND = 1.0;
|
|
3020
3114
|
var SECONDS_PER_MINUTE = 60;
|
|
3021
3115
|
var SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;
|
|
@@ -3207,13 +3301,40 @@ function stringMatches(str, tester) {
|
|
|
3207
3301
|
/***/ 635:
|
|
3208
3302
|
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
3209
3303
|
|
|
3304
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3210
3305
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3211
|
-
/* harmony export */
|
|
3212
|
-
/* harmony export */
|
|
3213
|
-
/* harmony export */
|
|
3214
|
-
/* harmony export */
|
|
3306
|
+
/* harmony export */ __addDisposableResource: function() { return /* binding */ __addDisposableResource; },
|
|
3307
|
+
/* harmony export */ __assign: function() { return /* binding */ __assign; },
|
|
3308
|
+
/* harmony export */ __asyncDelegator: function() { return /* binding */ __asyncDelegator; },
|
|
3309
|
+
/* harmony export */ __asyncGenerator: function() { return /* binding */ __asyncGenerator; },
|
|
3310
|
+
/* harmony export */ __asyncValues: function() { return /* binding */ __asyncValues; },
|
|
3311
|
+
/* harmony export */ __await: function() { return /* binding */ __await; },
|
|
3312
|
+
/* harmony export */ __awaiter: function() { return /* binding */ __awaiter; },
|
|
3313
|
+
/* harmony export */ __classPrivateFieldGet: function() { return /* binding */ __classPrivateFieldGet; },
|
|
3314
|
+
/* harmony export */ __classPrivateFieldIn: function() { return /* binding */ __classPrivateFieldIn; },
|
|
3315
|
+
/* harmony export */ __classPrivateFieldSet: function() { return /* binding */ __classPrivateFieldSet; },
|
|
3316
|
+
/* harmony export */ __createBinding: function() { return /* binding */ __createBinding; },
|
|
3317
|
+
/* harmony export */ __decorate: function() { return /* binding */ __decorate; },
|
|
3318
|
+
/* harmony export */ __disposeResources: function() { return /* binding */ __disposeResources; },
|
|
3319
|
+
/* harmony export */ __esDecorate: function() { return /* binding */ __esDecorate; },
|
|
3320
|
+
/* harmony export */ __exportStar: function() { return /* binding */ __exportStar; },
|
|
3321
|
+
/* harmony export */ __extends: function() { return /* binding */ __extends; },
|
|
3322
|
+
/* harmony export */ __generator: function() { return /* binding */ __generator; },
|
|
3323
|
+
/* harmony export */ __importDefault: function() { return /* binding */ __importDefault; },
|
|
3324
|
+
/* harmony export */ __importStar: function() { return /* binding */ __importStar; },
|
|
3325
|
+
/* harmony export */ __makeTemplateObject: function() { return /* binding */ __makeTemplateObject; },
|
|
3326
|
+
/* harmony export */ __metadata: function() { return /* binding */ __metadata; },
|
|
3327
|
+
/* harmony export */ __param: function() { return /* binding */ __param; },
|
|
3328
|
+
/* harmony export */ __propKey: function() { return /* binding */ __propKey; },
|
|
3329
|
+
/* harmony export */ __read: function() { return /* binding */ __read; },
|
|
3330
|
+
/* harmony export */ __rest: function() { return /* binding */ __rest; },
|
|
3331
|
+
/* harmony export */ __runInitializers: function() { return /* binding */ __runInitializers; },
|
|
3332
|
+
/* harmony export */ __setFunctionName: function() { return /* binding */ __setFunctionName; },
|
|
3333
|
+
/* harmony export */ __spread: function() { return /* binding */ __spread; },
|
|
3334
|
+
/* harmony export */ __spreadArray: function() { return /* binding */ __spreadArray; },
|
|
3335
|
+
/* harmony export */ __spreadArrays: function() { return /* binding */ __spreadArrays; },
|
|
3336
|
+
/* harmony export */ __values: function() { return /* binding */ __values; }
|
|
3215
3337
|
/* harmony export */ });
|
|
3216
|
-
/* 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 */
|
|
3217
3338
|
/******************************************************************************
|
|
3218
3339
|
Copyright (c) Microsoft Corporation.
|
|
3219
3340
|
|
|
@@ -3563,7 +3684,7 @@ function __disposeResources(env) {
|
|
|
3563
3684
|
return next();
|
|
3564
3685
|
}
|
|
3565
3686
|
|
|
3566
|
-
/*
|
|
3687
|
+
/* harmony default export */ __webpack_exports__["default"] = ({
|
|
3567
3688
|
__extends,
|
|
3568
3689
|
__assign,
|
|
3569
3690
|
__rest,
|
|
@@ -3640,12 +3761,25 @@ function __disposeResources(env) {
|
|
|
3640
3761
|
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
|
|
3641
3762
|
/******/ }();
|
|
3642
3763
|
/******/
|
|
3764
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
3765
|
+
/******/ !function() {
|
|
3766
|
+
/******/ // define __esModule on exports
|
|
3767
|
+
/******/ __webpack_require__.r = function(exports) {
|
|
3768
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
3769
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
3770
|
+
/******/ }
|
|
3771
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
3772
|
+
/******/ };
|
|
3773
|
+
/******/ }();
|
|
3774
|
+
/******/
|
|
3643
3775
|
/************************************************************************/
|
|
3644
3776
|
var __webpack_exports__ = {};
|
|
3777
|
+
// ESM COMPAT FLAG
|
|
3778
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3645
3779
|
|
|
3646
3780
|
// EXPORTS
|
|
3647
3781
|
__webpack_require__.d(__webpack_exports__, {
|
|
3648
|
-
|
|
3782
|
+
AICCImpl: function() { return /* binding */ AICCImpl; }
|
|
3649
3783
|
});
|
|
3650
3784
|
|
|
3651
3785
|
// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs
|
|
@@ -3660,6 +3794,27 @@ var api_constants = __webpack_require__(340);
|
|
|
3660
3794
|
var array = __webpack_require__(589);
|
|
3661
3795
|
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
3662
3796
|
var exceptions = __webpack_require__(784);
|
|
3797
|
+
;// ./src/exceptions/aicc_exceptions.ts
|
|
3798
|
+
|
|
3799
|
+
|
|
3800
|
+
|
|
3801
|
+
var aicc_errors = api_constants.aicc_constants.error_descriptions;
|
|
3802
|
+
var AICCValidationError = (function (_super) {
|
|
3803
|
+
(0,tslib_es6.__extends)(AICCValidationError, _super);
|
|
3804
|
+
function AICCValidationError(errorCode) {
|
|
3805
|
+
var _this = this;
|
|
3806
|
+
if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {
|
|
3807
|
+
_this = _super.call(this, errorCode, aicc_errors[String(errorCode)].basicMessage, aicc_errors[String(errorCode)].detailMessage) || this;
|
|
3808
|
+
}
|
|
3809
|
+
else {
|
|
3810
|
+
_this = _super.call(this, 101, aicc_errors["101"].basicMessage, aicc_errors["101"].detailMessage) || this;
|
|
3811
|
+
}
|
|
3812
|
+
return _this;
|
|
3813
|
+
}
|
|
3814
|
+
return AICCValidationError;
|
|
3815
|
+
}(exceptions.ValidationError));
|
|
3816
|
+
|
|
3817
|
+
|
|
3663
3818
|
// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts
|
|
3664
3819
|
var base_cmi = __webpack_require__(319);
|
|
3665
3820
|
// EXTERNAL MODULE: ./src/constants/error_codes.ts
|
|
@@ -3670,9 +3825,8 @@ var validation = __webpack_require__(449);
|
|
|
3670
3825
|
|
|
3671
3826
|
|
|
3672
3827
|
|
|
3673
|
-
var aicc_error_codes = error_codes/* default */.A.scorm12;
|
|
3674
3828
|
function checkAICCValidFormat(value, regexPattern, allowEmptyString) {
|
|
3675
|
-
return (0,validation
|
|
3829
|
+
return (0,validation.checkValidFormat)(value, regexPattern, error_codes.scorm12_errors.TYPE_MISMATCH, AICCValidationError, allowEmptyString);
|
|
3676
3830
|
}
|
|
3677
3831
|
|
|
3678
3832
|
// EXTERNAL MODULE: ./src/constants/regex.ts
|
|
@@ -3687,7 +3841,7 @@ var regex = __webpack_require__(417);
|
|
|
3687
3841
|
|
|
3688
3842
|
|
|
3689
3843
|
var CMIEvaluation = (function (_super) {
|
|
3690
|
-
(0,tslib_es6
|
|
3844
|
+
(0,tslib_es6.__extends)(CMIEvaluation, _super);
|
|
3691
3845
|
function CMIEvaluation() {
|
|
3692
3846
|
var _this = _super.call(this) || this;
|
|
3693
3847
|
_this.comments = new CMIEvaluationComments();
|
|
@@ -3698,6 +3852,11 @@ var CMIEvaluation = (function (_super) {
|
|
|
3698
3852
|
_super.prototype.initialize.call(this);
|
|
3699
3853
|
(_a = this.comments) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
3700
3854
|
};
|
|
3855
|
+
CMIEvaluation.prototype.reset = function () {
|
|
3856
|
+
var _a;
|
|
3857
|
+
this._initialized = false;
|
|
3858
|
+
(_a = this.comments) === null || _a === void 0 ? void 0 : _a.reset();
|
|
3859
|
+
};
|
|
3701
3860
|
CMIEvaluation.prototype.toJSON = function () {
|
|
3702
3861
|
this.jsonString = true;
|
|
3703
3862
|
var result = {
|
|
@@ -3707,21 +3866,21 @@ var CMIEvaluation = (function (_super) {
|
|
|
3707
3866
|
return result;
|
|
3708
3867
|
};
|
|
3709
3868
|
return CMIEvaluation;
|
|
3710
|
-
}(base_cmi
|
|
3869
|
+
}(base_cmi.BaseCMI));
|
|
3711
3870
|
|
|
3712
3871
|
var CMIEvaluationComments = (function (_super) {
|
|
3713
|
-
(0,tslib_es6
|
|
3872
|
+
(0,tslib_es6.__extends)(CMIEvaluationComments, _super);
|
|
3714
3873
|
function CMIEvaluationComments() {
|
|
3715
3874
|
return _super.call(this, {
|
|
3716
|
-
children: api_constants
|
|
3717
|
-
errorCode: error_codes
|
|
3718
|
-
errorClass:
|
|
3875
|
+
children: api_constants.aicc_constants.comments_children,
|
|
3876
|
+
errorCode: error_codes.scorm12_errors.INVALID_SET_VALUE,
|
|
3877
|
+
errorClass: AICCValidationError,
|
|
3719
3878
|
}) || this;
|
|
3720
3879
|
}
|
|
3721
3880
|
return CMIEvaluationComments;
|
|
3722
|
-
}(array
|
|
3881
|
+
}(array.CMIArray));
|
|
3723
3882
|
var CMIEvaluationCommentsObject = (function (_super) {
|
|
3724
|
-
(0,tslib_es6
|
|
3883
|
+
(0,tslib_es6.__extends)(CMIEvaluationCommentsObject, _super);
|
|
3725
3884
|
function CMIEvaluationCommentsObject() {
|
|
3726
3885
|
var _this = _super.call(this) || this;
|
|
3727
3886
|
_this._content = "";
|
|
@@ -3729,12 +3888,18 @@ var CMIEvaluationCommentsObject = (function (_super) {
|
|
|
3729
3888
|
_this._time = "";
|
|
3730
3889
|
return _this;
|
|
3731
3890
|
}
|
|
3891
|
+
CMIEvaluationCommentsObject.prototype.reset = function () {
|
|
3892
|
+
this._initialized = false;
|
|
3893
|
+
this._content = "";
|
|
3894
|
+
this._location = "";
|
|
3895
|
+
this._time = "";
|
|
3896
|
+
};
|
|
3732
3897
|
Object.defineProperty(CMIEvaluationCommentsObject.prototype, "content", {
|
|
3733
3898
|
get: function () {
|
|
3734
3899
|
return this._content;
|
|
3735
3900
|
},
|
|
3736
3901
|
set: function (content) {
|
|
3737
|
-
if (checkAICCValidFormat(content, regex
|
|
3902
|
+
if (checkAICCValidFormat(content, regex.aicc_regex.CMIString256)) {
|
|
3738
3903
|
this._content = content;
|
|
3739
3904
|
}
|
|
3740
3905
|
},
|
|
@@ -3746,7 +3911,7 @@ var CMIEvaluationCommentsObject = (function (_super) {
|
|
|
3746
3911
|
return this._location;
|
|
3747
3912
|
},
|
|
3748
3913
|
set: function (location) {
|
|
3749
|
-
if (checkAICCValidFormat(location, regex
|
|
3914
|
+
if (checkAICCValidFormat(location, regex.aicc_regex.CMIString256)) {
|
|
3750
3915
|
this._location = location;
|
|
3751
3916
|
}
|
|
3752
3917
|
},
|
|
@@ -3758,7 +3923,7 @@ var CMIEvaluationCommentsObject = (function (_super) {
|
|
|
3758
3923
|
return this._time;
|
|
3759
3924
|
},
|
|
3760
3925
|
set: function (time) {
|
|
3761
|
-
if (checkAICCValidFormat(time, regex
|
|
3926
|
+
if (checkAICCValidFormat(time, regex.aicc_regex.CMITime)) {
|
|
3762
3927
|
this._time = time;
|
|
3763
3928
|
}
|
|
3764
3929
|
},
|
|
@@ -3776,7 +3941,7 @@ var CMIEvaluationCommentsObject = (function (_super) {
|
|
|
3776
3941
|
return result;
|
|
3777
3942
|
};
|
|
3778
3943
|
return CMIEvaluationCommentsObject;
|
|
3779
|
-
}(base_cmi
|
|
3944
|
+
}(base_cmi.BaseCMI));
|
|
3780
3945
|
|
|
3781
3946
|
|
|
3782
3947
|
// EXTERNAL MODULE: ./src/cmi/scorm12/student_preference.ts
|
|
@@ -3791,17 +3956,17 @@ var student_preference = __webpack_require__(181);
|
|
|
3791
3956
|
|
|
3792
3957
|
|
|
3793
3958
|
var AICCStudentPreferences = (function (_super) {
|
|
3794
|
-
(0,tslib_es6
|
|
3959
|
+
(0,tslib_es6.__extends)(AICCStudentPreferences, _super);
|
|
3795
3960
|
function AICCStudentPreferences() {
|
|
3796
|
-
var _this = _super.call(this, api_constants
|
|
3961
|
+
var _this = _super.call(this, api_constants.aicc_constants.student_preference_children) || this;
|
|
3797
3962
|
_this._lesson_type = "";
|
|
3798
3963
|
_this._text_color = "";
|
|
3799
3964
|
_this._text_location = "";
|
|
3800
3965
|
_this._text_size = "";
|
|
3801
3966
|
_this._video = "";
|
|
3802
|
-
_this.windows = new array
|
|
3803
|
-
errorCode: error_codes
|
|
3804
|
-
errorClass:
|
|
3967
|
+
_this.windows = new array.CMIArray({
|
|
3968
|
+
errorCode: error_codes.scorm12_errors.INVALID_SET_VALUE,
|
|
3969
|
+
errorClass: AICCValidationError,
|
|
3805
3970
|
children: "",
|
|
3806
3971
|
});
|
|
3807
3972
|
return _this;
|
|
@@ -3816,7 +3981,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
3816
3981
|
return this._lesson_type;
|
|
3817
3982
|
},
|
|
3818
3983
|
set: function (lesson_type) {
|
|
3819
|
-
if (checkAICCValidFormat(lesson_type, regex
|
|
3984
|
+
if (checkAICCValidFormat(lesson_type, regex.aicc_regex.CMIString256)) {
|
|
3820
3985
|
this._lesson_type = lesson_type;
|
|
3821
3986
|
}
|
|
3822
3987
|
},
|
|
@@ -3828,7 +3993,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
3828
3993
|
return this._text_color;
|
|
3829
3994
|
},
|
|
3830
3995
|
set: function (text_color) {
|
|
3831
|
-
if (checkAICCValidFormat(text_color, regex
|
|
3996
|
+
if (checkAICCValidFormat(text_color, regex.aicc_regex.CMIString256)) {
|
|
3832
3997
|
this._text_color = text_color;
|
|
3833
3998
|
}
|
|
3834
3999
|
},
|
|
@@ -3840,7 +4005,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
3840
4005
|
return this._text_location;
|
|
3841
4006
|
},
|
|
3842
4007
|
set: function (text_location) {
|
|
3843
|
-
if (checkAICCValidFormat(text_location, regex
|
|
4008
|
+
if (checkAICCValidFormat(text_location, regex.aicc_regex.CMIString256)) {
|
|
3844
4009
|
this._text_location = text_location;
|
|
3845
4010
|
}
|
|
3846
4011
|
},
|
|
@@ -3852,7 +4017,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
3852
4017
|
return this._text_size;
|
|
3853
4018
|
},
|
|
3854
4019
|
set: function (text_size) {
|
|
3855
|
-
if (checkAICCValidFormat(text_size, regex
|
|
4020
|
+
if (checkAICCValidFormat(text_size, regex.aicc_regex.CMIString256)) {
|
|
3856
4021
|
this._text_size = text_size;
|
|
3857
4022
|
}
|
|
3858
4023
|
},
|
|
@@ -3864,7 +4029,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
3864
4029
|
return this._video;
|
|
3865
4030
|
},
|
|
3866
4031
|
set: function (video) {
|
|
3867
|
-
if (checkAICCValidFormat(video, regex
|
|
4032
|
+
if (checkAICCValidFormat(video, regex.aicc_regex.CMIString256)) {
|
|
3868
4033
|
this._video = video;
|
|
3869
4034
|
}
|
|
3870
4035
|
},
|
|
@@ -3889,7 +4054,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
3889
4054
|
return result;
|
|
3890
4055
|
};
|
|
3891
4056
|
return AICCStudentPreferences;
|
|
3892
|
-
}(student_preference
|
|
4057
|
+
}(student_preference.CMIStudentPreference));
|
|
3893
4058
|
|
|
3894
4059
|
|
|
3895
4060
|
;// ./src/cmi/aicc/student_demographics.ts
|
|
@@ -3899,10 +4064,10 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
3899
4064
|
|
|
3900
4065
|
|
|
3901
4066
|
var CMIStudentDemographics = (function (_super) {
|
|
3902
|
-
(0,tslib_es6
|
|
4067
|
+
(0,tslib_es6.__extends)(CMIStudentDemographics, _super);
|
|
3903
4068
|
function CMIStudentDemographics() {
|
|
3904
4069
|
var _this = _super.call(this) || this;
|
|
3905
|
-
_this.__children = api_constants
|
|
4070
|
+
_this.__children = api_constants.aicc_constants.student_demographics_children;
|
|
3906
4071
|
_this._city = "";
|
|
3907
4072
|
_this._class = "";
|
|
3908
4073
|
_this._company = "";
|
|
@@ -3918,6 +4083,9 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
3918
4083
|
_this._years_experience = "";
|
|
3919
4084
|
return _this;
|
|
3920
4085
|
}
|
|
4086
|
+
CMIStudentDemographics.prototype.reset = function () {
|
|
4087
|
+
this._initialized = false;
|
|
4088
|
+
};
|
|
3921
4089
|
Object.defineProperty(CMIStudentDemographics.prototype, "_children", {
|
|
3922
4090
|
get: function () {
|
|
3923
4091
|
return this.__children;
|
|
@@ -3931,7 +4099,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
3931
4099
|
},
|
|
3932
4100
|
set: function (city) {
|
|
3933
4101
|
if (this.initialized) {
|
|
3934
|
-
throw new
|
|
4102
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
3935
4103
|
}
|
|
3936
4104
|
else {
|
|
3937
4105
|
this._city = city;
|
|
@@ -3946,7 +4114,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
3946
4114
|
},
|
|
3947
4115
|
set: function (clazz) {
|
|
3948
4116
|
if (this.initialized) {
|
|
3949
|
-
throw new
|
|
4117
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
3950
4118
|
}
|
|
3951
4119
|
else {
|
|
3952
4120
|
this._class = clazz;
|
|
@@ -3961,7 +4129,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
3961
4129
|
},
|
|
3962
4130
|
set: function (company) {
|
|
3963
4131
|
if (this.initialized) {
|
|
3964
|
-
throw new
|
|
4132
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
3965
4133
|
}
|
|
3966
4134
|
else {
|
|
3967
4135
|
this._company = company;
|
|
@@ -3976,7 +4144,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
3976
4144
|
},
|
|
3977
4145
|
set: function (country) {
|
|
3978
4146
|
if (this.initialized) {
|
|
3979
|
-
throw new
|
|
4147
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
3980
4148
|
}
|
|
3981
4149
|
else {
|
|
3982
4150
|
this._country = country;
|
|
@@ -3991,7 +4159,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
3991
4159
|
},
|
|
3992
4160
|
set: function (experience) {
|
|
3993
4161
|
if (this.initialized) {
|
|
3994
|
-
throw new
|
|
4162
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
3995
4163
|
}
|
|
3996
4164
|
else {
|
|
3997
4165
|
this._experience = experience;
|
|
@@ -4006,7 +4174,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
4006
4174
|
},
|
|
4007
4175
|
set: function (familiar_name) {
|
|
4008
4176
|
if (this.initialized) {
|
|
4009
|
-
throw new
|
|
4177
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4010
4178
|
}
|
|
4011
4179
|
else {
|
|
4012
4180
|
this._familiar_name = familiar_name;
|
|
@@ -4021,7 +4189,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
4021
4189
|
},
|
|
4022
4190
|
set: function (instructor_name) {
|
|
4023
4191
|
if (this.initialized) {
|
|
4024
|
-
throw new
|
|
4192
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4025
4193
|
}
|
|
4026
4194
|
else {
|
|
4027
4195
|
this._instructor_name = instructor_name;
|
|
@@ -4036,7 +4204,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
4036
4204
|
},
|
|
4037
4205
|
set: function (title) {
|
|
4038
4206
|
if (this.initialized) {
|
|
4039
|
-
throw new
|
|
4207
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4040
4208
|
}
|
|
4041
4209
|
else {
|
|
4042
4210
|
this._title = title;
|
|
@@ -4051,7 +4219,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
4051
4219
|
},
|
|
4052
4220
|
set: function (native_language) {
|
|
4053
4221
|
if (this.initialized) {
|
|
4054
|
-
throw new
|
|
4222
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4055
4223
|
}
|
|
4056
4224
|
else {
|
|
4057
4225
|
this._native_language = native_language;
|
|
@@ -4066,7 +4234,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
4066
4234
|
},
|
|
4067
4235
|
set: function (state) {
|
|
4068
4236
|
if (this.initialized) {
|
|
4069
|
-
throw new
|
|
4237
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4070
4238
|
}
|
|
4071
4239
|
else {
|
|
4072
4240
|
this._state = state;
|
|
@@ -4081,7 +4249,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
4081
4249
|
},
|
|
4082
4250
|
set: function (street_address) {
|
|
4083
4251
|
if (this.initialized) {
|
|
4084
|
-
throw new
|
|
4252
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4085
4253
|
}
|
|
4086
4254
|
else {
|
|
4087
4255
|
this._street_address = street_address;
|
|
@@ -4096,7 +4264,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
4096
4264
|
},
|
|
4097
4265
|
set: function (telephone) {
|
|
4098
4266
|
if (this.initialized) {
|
|
4099
|
-
throw new
|
|
4267
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4100
4268
|
}
|
|
4101
4269
|
else {
|
|
4102
4270
|
this._telephone = telephone;
|
|
@@ -4111,7 +4279,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
4111
4279
|
},
|
|
4112
4280
|
set: function (years_experience) {
|
|
4113
4281
|
if (this.initialized) {
|
|
4114
|
-
throw new
|
|
4282
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4115
4283
|
}
|
|
4116
4284
|
else {
|
|
4117
4285
|
this._years_experience = years_experience;
|
|
@@ -4141,7 +4309,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
4141
4309
|
return result;
|
|
4142
4310
|
};
|
|
4143
4311
|
return CMIStudentDemographics;
|
|
4144
|
-
}(base_cmi
|
|
4312
|
+
}(base_cmi.BaseCMI));
|
|
4145
4313
|
|
|
4146
4314
|
|
|
4147
4315
|
// EXTERNAL MODULE: ./src/cmi/common/score.ts
|
|
@@ -4157,28 +4325,28 @@ var score = __webpack_require__(434);
|
|
|
4157
4325
|
|
|
4158
4326
|
|
|
4159
4327
|
var CMITries = (function (_super) {
|
|
4160
|
-
(0,tslib_es6
|
|
4328
|
+
(0,tslib_es6.__extends)(CMITries, _super);
|
|
4161
4329
|
function CMITries() {
|
|
4162
4330
|
return _super.call(this, {
|
|
4163
|
-
children: api_constants
|
|
4331
|
+
children: api_constants.aicc_constants.tries_children,
|
|
4164
4332
|
}) || this;
|
|
4165
4333
|
}
|
|
4166
4334
|
return CMITries;
|
|
4167
|
-
}(array
|
|
4335
|
+
}(array.CMIArray));
|
|
4168
4336
|
|
|
4169
4337
|
var CMITriesObject = (function (_super) {
|
|
4170
|
-
(0,tslib_es6
|
|
4338
|
+
(0,tslib_es6.__extends)(CMITriesObject, _super);
|
|
4171
4339
|
function CMITriesObject() {
|
|
4172
4340
|
var _this = _super.call(this) || this;
|
|
4173
4341
|
_this._status = "";
|
|
4174
4342
|
_this._time = "";
|
|
4175
|
-
_this.score = new score
|
|
4176
|
-
score_children: api_constants
|
|
4177
|
-
score_range: regex
|
|
4178
|
-
invalidErrorCode: error_codes
|
|
4179
|
-
invalidTypeCode: error_codes
|
|
4180
|
-
invalidRangeCode: error_codes
|
|
4181
|
-
errorClass:
|
|
4343
|
+
_this.score = new score.CMIScore({
|
|
4344
|
+
score_children: api_constants.aicc_constants.score_children,
|
|
4345
|
+
score_range: regex.aicc_regex.score_range,
|
|
4346
|
+
invalidErrorCode: error_codes.scorm12_errors.INVALID_SET_VALUE,
|
|
4347
|
+
invalidTypeCode: error_codes.scorm12_errors.TYPE_MISMATCH,
|
|
4348
|
+
invalidRangeCode: error_codes.scorm12_errors.VALUE_OUT_OF_RANGE,
|
|
4349
|
+
errorClass: AICCValidationError,
|
|
4182
4350
|
});
|
|
4183
4351
|
return _this;
|
|
4184
4352
|
}
|
|
@@ -4187,12 +4355,19 @@ var CMITriesObject = (function (_super) {
|
|
|
4187
4355
|
_super.prototype.initialize.call(this);
|
|
4188
4356
|
(_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
4189
4357
|
};
|
|
4358
|
+
CMITriesObject.prototype.reset = function () {
|
|
4359
|
+
var _a;
|
|
4360
|
+
this._initialized = false;
|
|
4361
|
+
this._status = "";
|
|
4362
|
+
this._time = "";
|
|
4363
|
+
(_a = this.score) === null || _a === void 0 ? void 0 : _a.reset();
|
|
4364
|
+
};
|
|
4190
4365
|
Object.defineProperty(CMITriesObject.prototype, "status", {
|
|
4191
4366
|
get: function () {
|
|
4192
4367
|
return this._status;
|
|
4193
4368
|
},
|
|
4194
4369
|
set: function (status) {
|
|
4195
|
-
if (checkAICCValidFormat(status, regex
|
|
4370
|
+
if (checkAICCValidFormat(status, regex.aicc_regex.CMIStatus2)) {
|
|
4196
4371
|
this._status = status;
|
|
4197
4372
|
}
|
|
4198
4373
|
},
|
|
@@ -4204,7 +4379,7 @@ var CMITriesObject = (function (_super) {
|
|
|
4204
4379
|
return this._time;
|
|
4205
4380
|
},
|
|
4206
4381
|
set: function (time) {
|
|
4207
|
-
if (checkAICCValidFormat(time, regex
|
|
4382
|
+
if (checkAICCValidFormat(time, regex.aicc_regex.CMITime)) {
|
|
4208
4383
|
this._time = time;
|
|
4209
4384
|
}
|
|
4210
4385
|
},
|
|
@@ -4222,7 +4397,7 @@ var CMITriesObject = (function (_super) {
|
|
|
4222
4397
|
return result;
|
|
4223
4398
|
};
|
|
4224
4399
|
return CMITriesObject;
|
|
4225
|
-
}(base_cmi
|
|
4400
|
+
}(base_cmi.BaseCMI));
|
|
4226
4401
|
|
|
4227
4402
|
|
|
4228
4403
|
// EXTERNAL MODULE: ./src/cmi/scorm12/student_data.ts
|
|
@@ -4238,41 +4413,47 @@ var student_data = __webpack_require__(532);
|
|
|
4238
4413
|
|
|
4239
4414
|
|
|
4240
4415
|
var CMIAttemptRecords = (function (_super) {
|
|
4241
|
-
(0,tslib_es6
|
|
4416
|
+
(0,tslib_es6.__extends)(CMIAttemptRecords, _super);
|
|
4242
4417
|
function CMIAttemptRecords() {
|
|
4243
4418
|
return _super.call(this, {
|
|
4244
|
-
children: api_constants
|
|
4419
|
+
children: api_constants.aicc_constants.attempt_records_children,
|
|
4245
4420
|
}) || this;
|
|
4246
4421
|
}
|
|
4247
4422
|
return CMIAttemptRecords;
|
|
4248
|
-
}(array
|
|
4423
|
+
}(array.CMIArray));
|
|
4249
4424
|
|
|
4250
4425
|
var CMIAttemptRecordsObject = (function (_super) {
|
|
4251
|
-
(0,tslib_es6
|
|
4426
|
+
(0,tslib_es6.__extends)(CMIAttemptRecordsObject, _super);
|
|
4252
4427
|
function CMIAttemptRecordsObject() {
|
|
4253
4428
|
var _this = _super.call(this) || this;
|
|
4254
4429
|
_this._lesson_status = "";
|
|
4255
|
-
_this.score = new score
|
|
4256
|
-
score_children: api_constants
|
|
4257
|
-
score_range: regex
|
|
4258
|
-
invalidErrorCode: error_codes
|
|
4259
|
-
invalidTypeCode: error_codes
|
|
4260
|
-
invalidRangeCode: error_codes
|
|
4261
|
-
errorClass:
|
|
4430
|
+
_this.score = new score.CMIScore({
|
|
4431
|
+
score_children: api_constants.aicc_constants.score_children,
|
|
4432
|
+
score_range: regex.aicc_regex.score_range,
|
|
4433
|
+
invalidErrorCode: error_codes.scorm12_errors.INVALID_SET_VALUE,
|
|
4434
|
+
invalidTypeCode: error_codes.scorm12_errors.TYPE_MISMATCH,
|
|
4435
|
+
invalidRangeCode: error_codes.scorm12_errors.VALUE_OUT_OF_RANGE,
|
|
4436
|
+
errorClass: AICCValidationError,
|
|
4262
4437
|
});
|
|
4263
4438
|
return _this;
|
|
4264
4439
|
}
|
|
4265
4440
|
CMIAttemptRecordsObject.prototype.initialize = function () {
|
|
4266
4441
|
var _a;
|
|
4267
4442
|
_super.prototype.initialize.call(this);
|
|
4443
|
+
this._lesson_status = "";
|
|
4268
4444
|
(_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
4269
4445
|
};
|
|
4446
|
+
CMIAttemptRecordsObject.prototype.reset = function () {
|
|
4447
|
+
var _a;
|
|
4448
|
+
this._initialized = false;
|
|
4449
|
+
(_a = this.score) === null || _a === void 0 ? void 0 : _a.reset();
|
|
4450
|
+
};
|
|
4270
4451
|
Object.defineProperty(CMIAttemptRecordsObject.prototype, "lesson_status", {
|
|
4271
4452
|
get: function () {
|
|
4272
4453
|
return this._lesson_status;
|
|
4273
4454
|
},
|
|
4274
4455
|
set: function (lesson_status) {
|
|
4275
|
-
if (checkAICCValidFormat(lesson_status, regex
|
|
4456
|
+
if (checkAICCValidFormat(lesson_status, regex.aicc_regex.CMIStatus2)) {
|
|
4276
4457
|
this._lesson_status = lesson_status;
|
|
4277
4458
|
}
|
|
4278
4459
|
},
|
|
@@ -4289,7 +4470,7 @@ var CMIAttemptRecordsObject = (function (_super) {
|
|
|
4289
4470
|
return result;
|
|
4290
4471
|
};
|
|
4291
4472
|
return CMIAttemptRecordsObject;
|
|
4292
|
-
}(base_cmi
|
|
4473
|
+
}(base_cmi.BaseCMI));
|
|
4293
4474
|
|
|
4294
4475
|
|
|
4295
4476
|
;// ./src/cmi/aicc/student_data.ts
|
|
@@ -4301,9 +4482,9 @@ var CMIAttemptRecordsObject = (function (_super) {
|
|
|
4301
4482
|
|
|
4302
4483
|
|
|
4303
4484
|
var AICCCMIStudentData = (function (_super) {
|
|
4304
|
-
(0,tslib_es6
|
|
4485
|
+
(0,tslib_es6.__extends)(AICCCMIStudentData, _super);
|
|
4305
4486
|
function AICCCMIStudentData() {
|
|
4306
|
-
var _this = _super.call(this, api_constants
|
|
4487
|
+
var _this = _super.call(this, api_constants.aicc_constants.student_data_children) || this;
|
|
4307
4488
|
_this._tries_during_lesson = "";
|
|
4308
4489
|
_this.tries = new CMITries();
|
|
4309
4490
|
_this.attempt_records = new CMIAttemptRecords();
|
|
@@ -4315,13 +4496,19 @@ var AICCCMIStudentData = (function (_super) {
|
|
|
4315
4496
|
(_a = this.tries) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
4316
4497
|
(_b = this.attempt_records) === null || _b === void 0 ? void 0 : _b.initialize();
|
|
4317
4498
|
};
|
|
4499
|
+
AICCCMIStudentData.prototype.reset = function () {
|
|
4500
|
+
var _a, _b;
|
|
4501
|
+
this._initialized = false;
|
|
4502
|
+
(_a = this.tries) === null || _a === void 0 ? void 0 : _a.reset(true);
|
|
4503
|
+
(_b = this.attempt_records) === null || _b === void 0 ? void 0 : _b.reset(true);
|
|
4504
|
+
};
|
|
4318
4505
|
Object.defineProperty(AICCCMIStudentData.prototype, "tries_during_lesson", {
|
|
4319
4506
|
get: function () {
|
|
4320
4507
|
return this._tries_during_lesson;
|
|
4321
4508
|
},
|
|
4322
4509
|
set: function (tries_during_lesson) {
|
|
4323
4510
|
if (this.initialized) {
|
|
4324
|
-
throw new
|
|
4511
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4325
4512
|
}
|
|
4326
4513
|
else {
|
|
4327
4514
|
this._tries_during_lesson = tries_during_lesson;
|
|
@@ -4343,7 +4530,7 @@ var AICCCMIStudentData = (function (_super) {
|
|
|
4343
4530
|
return result;
|
|
4344
4531
|
};
|
|
4345
4532
|
return AICCCMIStudentData;
|
|
4346
|
-
}(student_data
|
|
4533
|
+
}(student_data.CMIStudentData));
|
|
4347
4534
|
|
|
4348
4535
|
|
|
4349
4536
|
;// ./src/cmi/aicc/paths.ts
|
|
@@ -4354,17 +4541,17 @@ var AICCCMIStudentData = (function (_super) {
|
|
|
4354
4541
|
|
|
4355
4542
|
|
|
4356
4543
|
var CMIPaths = (function (_super) {
|
|
4357
|
-
(0,tslib_es6
|
|
4544
|
+
(0,tslib_es6.__extends)(CMIPaths, _super);
|
|
4358
4545
|
function CMIPaths() {
|
|
4359
4546
|
return _super.call(this, {
|
|
4360
|
-
children: api_constants
|
|
4547
|
+
children: api_constants.aicc_constants.paths_children,
|
|
4361
4548
|
}) || this;
|
|
4362
4549
|
}
|
|
4363
4550
|
return CMIPaths;
|
|
4364
|
-
}(array
|
|
4551
|
+
}(array.CMIArray));
|
|
4365
4552
|
|
|
4366
4553
|
var CMIPathsObject = (function (_super) {
|
|
4367
|
-
(0,tslib_es6
|
|
4554
|
+
(0,tslib_es6.__extends)(CMIPathsObject, _super);
|
|
4368
4555
|
function CMIPathsObject() {
|
|
4369
4556
|
var _this = _super.call(this) || this;
|
|
4370
4557
|
_this._location_id = "";
|
|
@@ -4375,12 +4562,21 @@ var CMIPathsObject = (function (_super) {
|
|
|
4375
4562
|
_this._time_in_element = "";
|
|
4376
4563
|
return _this;
|
|
4377
4564
|
}
|
|
4565
|
+
CMIPathsObject.prototype.reset = function () {
|
|
4566
|
+
this._initialized = false;
|
|
4567
|
+
this._location_id = "";
|
|
4568
|
+
this._date = "";
|
|
4569
|
+
this._time = "";
|
|
4570
|
+
this._status = "";
|
|
4571
|
+
this._why_left = "";
|
|
4572
|
+
this._time_in_element = "";
|
|
4573
|
+
};
|
|
4378
4574
|
Object.defineProperty(CMIPathsObject.prototype, "location_id", {
|
|
4379
4575
|
get: function () {
|
|
4380
4576
|
return this._location_id;
|
|
4381
4577
|
},
|
|
4382
4578
|
set: function (location_id) {
|
|
4383
|
-
if (checkAICCValidFormat(location_id, regex
|
|
4579
|
+
if (checkAICCValidFormat(location_id, regex.aicc_regex.CMIString256)) {
|
|
4384
4580
|
this._location_id = location_id;
|
|
4385
4581
|
}
|
|
4386
4582
|
},
|
|
@@ -4392,7 +4588,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
4392
4588
|
return this._date;
|
|
4393
4589
|
},
|
|
4394
4590
|
set: function (date) {
|
|
4395
|
-
if (checkAICCValidFormat(date, regex
|
|
4591
|
+
if (checkAICCValidFormat(date, regex.aicc_regex.CMIString256)) {
|
|
4396
4592
|
this._date = date;
|
|
4397
4593
|
}
|
|
4398
4594
|
},
|
|
@@ -4404,7 +4600,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
4404
4600
|
return this._time;
|
|
4405
4601
|
},
|
|
4406
4602
|
set: function (time) {
|
|
4407
|
-
if (checkAICCValidFormat(time, regex
|
|
4603
|
+
if (checkAICCValidFormat(time, regex.aicc_regex.CMITime)) {
|
|
4408
4604
|
this._time = time;
|
|
4409
4605
|
}
|
|
4410
4606
|
},
|
|
@@ -4416,7 +4612,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
4416
4612
|
return this._status;
|
|
4417
4613
|
},
|
|
4418
4614
|
set: function (status) {
|
|
4419
|
-
if (checkAICCValidFormat(status, regex
|
|
4615
|
+
if (checkAICCValidFormat(status, regex.aicc_regex.CMIStatus2)) {
|
|
4420
4616
|
this._status = status;
|
|
4421
4617
|
}
|
|
4422
4618
|
},
|
|
@@ -4428,7 +4624,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
4428
4624
|
return this._why_left;
|
|
4429
4625
|
},
|
|
4430
4626
|
set: function (why_left) {
|
|
4431
|
-
if (checkAICCValidFormat(why_left, regex
|
|
4627
|
+
if (checkAICCValidFormat(why_left, regex.aicc_regex.CMIString256)) {
|
|
4432
4628
|
this._why_left = why_left;
|
|
4433
4629
|
}
|
|
4434
4630
|
},
|
|
@@ -4440,7 +4636,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
4440
4636
|
return this._time_in_element;
|
|
4441
4637
|
},
|
|
4442
4638
|
set: function (time_in_element) {
|
|
4443
|
-
if (checkAICCValidFormat(time_in_element, regex
|
|
4639
|
+
if (checkAICCValidFormat(time_in_element, regex.aicc_regex.CMITime)) {
|
|
4444
4640
|
this._time_in_element = time_in_element;
|
|
4445
4641
|
}
|
|
4446
4642
|
},
|
|
@@ -4461,7 +4657,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
4461
4657
|
return result;
|
|
4462
4658
|
};
|
|
4463
4659
|
return CMIPathsObject;
|
|
4464
|
-
}(base_cmi
|
|
4660
|
+
}(base_cmi.BaseCMI));
|
|
4465
4661
|
|
|
4466
4662
|
|
|
4467
4663
|
;// ./src/cmi/aicc/cmi.ts
|
|
@@ -4474,10 +4670,10 @@ var CMIPathsObject = (function (_super) {
|
|
|
4474
4670
|
|
|
4475
4671
|
|
|
4476
4672
|
var CMI = (function (_super) {
|
|
4477
|
-
(0,tslib_es6
|
|
4673
|
+
(0,tslib_es6.__extends)(CMI, _super);
|
|
4478
4674
|
function CMI(initialized) {
|
|
4479
4675
|
if (initialized === void 0) { initialized = false; }
|
|
4480
|
-
var _this = _super.call(this, api_constants
|
|
4676
|
+
var _this = _super.call(this, api_constants.aicc_constants.cmi_children) || this;
|
|
4481
4677
|
if (initialized)
|
|
4482
4678
|
_this.initialize();
|
|
4483
4679
|
_this.student_preference = new AICCStudentPreferences();
|
|
@@ -4516,7 +4712,7 @@ var CMI = (function (_super) {
|
|
|
4516
4712
|
return result;
|
|
4517
4713
|
};
|
|
4518
4714
|
return CMI;
|
|
4519
|
-
}(cmi
|
|
4715
|
+
}(cmi.CMI));
|
|
4520
4716
|
|
|
4521
4717
|
|
|
4522
4718
|
// EXTERNAL MODULE: ./src/cmi/scorm12/nav.ts
|
|
@@ -4534,26 +4730,26 @@ var utilities = __webpack_require__(864);
|
|
|
4534
4730
|
|
|
4535
4731
|
|
|
4536
4732
|
var AICCImpl = (function (_super) {
|
|
4537
|
-
(0,tslib_es6
|
|
4733
|
+
(0,tslib_es6.__extends)(AICCImpl, _super);
|
|
4538
4734
|
function AICCImpl(settings) {
|
|
4539
4735
|
var _this = _super.call(this, settings) || this;
|
|
4540
4736
|
_this.cmi = new CMI();
|
|
4541
|
-
_this.nav = new nav
|
|
4737
|
+
_this.nav = new nav.NAV();
|
|
4542
4738
|
return _this;
|
|
4543
4739
|
}
|
|
4544
4740
|
AICCImpl.prototype.getChildElement = function (CMIElement, value, foundFirstIndex) {
|
|
4545
4741
|
var newChild = _super.prototype.getChildElement.call(this, CMIElement, value, foundFirstIndex);
|
|
4546
4742
|
if (!newChild) {
|
|
4547
|
-
if ((0,utilities
|
|
4743
|
+
if ((0,utilities.stringMatches)(CMIElement, "cmi\\.evaluation\\.comments\\.\\d+")) {
|
|
4548
4744
|
newChild = new CMIEvaluationCommentsObject();
|
|
4549
4745
|
}
|
|
4550
|
-
else if ((0,utilities
|
|
4746
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.student_data\\.tries\\.\\d+")) {
|
|
4551
4747
|
newChild = new CMITriesObject();
|
|
4552
4748
|
}
|
|
4553
|
-
else if ((0,utilities
|
|
4749
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.student_data\\.attempt_records\\.\\d+")) {
|
|
4554
4750
|
newChild = new CMIAttemptRecordsObject();
|
|
4555
4751
|
}
|
|
4556
|
-
else if ((0,utilities
|
|
4752
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.paths\\.\\d+")) {
|
|
4557
4753
|
newChild = new CMIPathsObject();
|
|
4558
4754
|
}
|
|
4559
4755
|
}
|
|
@@ -4564,10 +4760,10 @@ var AICCImpl = (function (_super) {
|
|
|
4564
4760
|
this.nav = newAPI.nav;
|
|
4565
4761
|
};
|
|
4566
4762
|
return AICCImpl;
|
|
4567
|
-
}(Scorm12API
|
|
4763
|
+
}(Scorm12API.Scorm12Impl));
|
|
4568
4764
|
|
|
4569
4765
|
|
|
4570
|
-
var __webpack_exports__AICCImpl = __webpack_exports__.
|
|
4766
|
+
var __webpack_exports__AICCImpl = __webpack_exports__.AICCImpl;
|
|
4571
4767
|
export { __webpack_exports__AICCImpl as AICCImpl };
|
|
4572
4768
|
|
|
4573
4769
|
//# sourceMappingURL=aicc.js.map
|