scorm-again 2.5.0 → 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/dist/aicc.js +648 -485
- 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 +664 -488
- 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 +1111 -729
- 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 +506 -393
- 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 +672 -451
- 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 +1087 -717
- 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 +493 -392
- 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 +658 -450
- 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 +14 -14
- package/src/AICC.ts +3 -0
- package/src/BaseAPI.ts +33 -30
- package/src/Scorm12API.ts +14 -14
- package/src/Scorm2004API.ts +99 -33
- 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 -19
- package/src/constants/default_settings.ts +6 -5
- package/src/constants/error_codes.ts +5 -12
- package/src/constants/regex.ts +4 -10
- 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 +0 -81
- package/src/types/api_types.ts +3 -2
- 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 +3 -3
- package/test/utilities.spec.ts +1 -4
- package/webpack.config.js +4 -0
package/dist/aicc.js
CHANGED
|
@@ -5,10 +5,12 @@
|
|
|
5
5
|
/***/ 429:
|
|
6
6
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
7
7
|
|
|
8
|
+
// ESM COMPAT FLAG
|
|
9
|
+
__webpack_require__.r(__webpack_exports__);
|
|
8
10
|
|
|
9
11
|
// EXPORTS
|
|
10
12
|
__webpack_require__.d(__webpack_exports__, {
|
|
11
|
-
|
|
13
|
+
"default": function() { return /* binding */ src_BaseAPI; }
|
|
12
14
|
});
|
|
13
15
|
|
|
14
16
|
// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs
|
|
@@ -17,8 +19,6 @@ var tslib_es6 = __webpack_require__(635);
|
|
|
17
19
|
var array = __webpack_require__(589);
|
|
18
20
|
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
19
21
|
var exceptions = __webpack_require__(784);
|
|
20
|
-
// EXTERNAL MODULE: ./src/constants/error_codes.ts
|
|
21
|
-
var error_codes = __webpack_require__(797);
|
|
22
22
|
// EXTERNAL MODULE: ./src/constants/api_constants.ts
|
|
23
23
|
var api_constants = __webpack_require__(340);
|
|
24
24
|
// EXTERNAL MODULE: ./src/utilities.ts
|
|
@@ -38,7 +38,7 @@ var DefaultSettings = {
|
|
|
38
38
|
dataCommitFormat: "json",
|
|
39
39
|
commitRequestDataType: "application/json;charset=UTF-8",
|
|
40
40
|
autoProgress: false,
|
|
41
|
-
logLevel: enums
|
|
41
|
+
logLevel: enums.LogLevelEnum.ERROR,
|
|
42
42
|
selfReportSessionTime: false,
|
|
43
43
|
alwaysSendTotalTime: false,
|
|
44
44
|
renderCommonCommitFields: false,
|
|
@@ -47,9 +47,9 @@ var DefaultSettings = {
|
|
|
47
47
|
xhrWithCredentials: false,
|
|
48
48
|
fetchMode: "cors",
|
|
49
49
|
responseHandler: function (response) {
|
|
50
|
-
return (0,tslib_es6
|
|
50
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
51
51
|
var responseText, httpResult;
|
|
52
|
-
return (0,tslib_es6
|
|
52
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
53
53
|
switch (_a.label) {
|
|
54
54
|
case 0:
|
|
55
55
|
if (!(typeof response !== "undefined")) return [3, 2];
|
|
@@ -64,13 +64,13 @@ var DefaultSettings = {
|
|
|
64
64
|
!{}.hasOwnProperty.call(httpResult, "result")) {
|
|
65
65
|
if (response.status === 200) {
|
|
66
66
|
return [2, {
|
|
67
|
-
result: api_constants
|
|
67
|
+
result: api_constants.global_constants.SCORM_TRUE,
|
|
68
68
|
errorCode: 0,
|
|
69
69
|
}];
|
|
70
70
|
}
|
|
71
71
|
else {
|
|
72
72
|
return [2, {
|
|
73
|
-
result: api_constants
|
|
73
|
+
result: api_constants.global_constants.SCORM_FALSE,
|
|
74
74
|
errorCode: 101,
|
|
75
75
|
}];
|
|
76
76
|
}
|
|
@@ -80,14 +80,14 @@ var DefaultSettings = {
|
|
|
80
80
|
result: httpResult.result,
|
|
81
81
|
errorCode: httpResult.errorCode
|
|
82
82
|
? httpResult.errorCode
|
|
83
|
-
: httpResult.result === api_constants
|
|
83
|
+
: httpResult.result === api_constants.global_constants.SCORM_TRUE
|
|
84
84
|
? 0
|
|
85
85
|
: 101,
|
|
86
86
|
}];
|
|
87
87
|
}
|
|
88
88
|
_a.label = 2;
|
|
89
89
|
case 2: return [2, {
|
|
90
|
-
result: api_constants
|
|
90
|
+
result: api_constants.global_constants.SCORM_FALSE,
|
|
91
91
|
errorCode: 101,
|
|
92
92
|
}];
|
|
93
93
|
}
|
|
@@ -102,25 +102,25 @@ var DefaultSettings = {
|
|
|
102
102
|
case "4":
|
|
103
103
|
case 4:
|
|
104
104
|
case "ERROR":
|
|
105
|
-
case enums
|
|
105
|
+
case enums.LogLevelEnum.ERROR:
|
|
106
106
|
console.error(logMessage);
|
|
107
107
|
break;
|
|
108
108
|
case "3":
|
|
109
109
|
case 3:
|
|
110
110
|
case "WARN":
|
|
111
|
-
case enums
|
|
111
|
+
case enums.LogLevelEnum.WARN:
|
|
112
112
|
console.warn(logMessage);
|
|
113
113
|
break;
|
|
114
114
|
case "2":
|
|
115
115
|
case 2:
|
|
116
116
|
case "INFO":
|
|
117
|
-
case enums
|
|
117
|
+
case enums.LogLevelEnum.INFO:
|
|
118
118
|
console.info(logMessage);
|
|
119
119
|
break;
|
|
120
120
|
case "1":
|
|
121
121
|
case 1:
|
|
122
122
|
case "DEBUG":
|
|
123
|
-
case enums
|
|
123
|
+
case enums.LogLevelEnum.DEBUG:
|
|
124
124
|
if (console.debug) {
|
|
125
125
|
console.debug(logMessage);
|
|
126
126
|
}
|
|
@@ -132,6 +132,7 @@ var DefaultSettings = {
|
|
|
132
132
|
},
|
|
133
133
|
scoItemIds: [],
|
|
134
134
|
scoItemIdValidator: false,
|
|
135
|
+
globalObjectiveIds: [],
|
|
135
136
|
};
|
|
136
137
|
|
|
137
138
|
;// ./src/helpers/scheduled_commit.ts
|
|
@@ -152,7 +153,7 @@ var ScheduledCommit = (function () {
|
|
|
152
153
|
ScheduledCommit.prototype.wrapper = function () {
|
|
153
154
|
var _this = this;
|
|
154
155
|
if (!this._cancelled) {
|
|
155
|
-
(function () { return (0,tslib_es6
|
|
156
|
+
(function () { return (0,tslib_es6.__awaiter)(_this, void 0, void 0, function () { return (0,tslib_es6.__generator)(this, function (_a) {
|
|
156
157
|
switch (_a.label) {
|
|
157
158
|
case 0: return [4, this._API.commit(this._callback)];
|
|
158
159
|
case 1: return [2, _a.sent()];
|
|
@@ -173,7 +174,6 @@ var ScheduledCommit = (function () {
|
|
|
173
174
|
|
|
174
175
|
|
|
175
176
|
|
|
176
|
-
|
|
177
177
|
var BaseAPI = (function () {
|
|
178
178
|
function BaseAPI(error_codes, settings) {
|
|
179
179
|
var _newTarget = this.constructor;
|
|
@@ -181,7 +181,7 @@ var BaseAPI = (function () {
|
|
|
181
181
|
if (_newTarget === BaseAPI) {
|
|
182
182
|
throw new TypeError("Cannot construct BaseAPI instances directly");
|
|
183
183
|
}
|
|
184
|
-
this.currentState = api_constants
|
|
184
|
+
this.currentState = api_constants.global_constants.STATE_NOT_INITIALIZED;
|
|
185
185
|
this.lastErrorCode = "0";
|
|
186
186
|
this.listenerArray = [];
|
|
187
187
|
this._error_codes = error_codes;
|
|
@@ -191,17 +191,20 @@ var BaseAPI = (function () {
|
|
|
191
191
|
this.apiLogLevel = this.settings.logLevel;
|
|
192
192
|
this.selfReportSessionTime = this.settings.selfReportSessionTime;
|
|
193
193
|
if (this.apiLogLevel === undefined) {
|
|
194
|
-
this.apiLogLevel = enums
|
|
194
|
+
this.apiLogLevel = enums.LogLevelEnum.NONE;
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
BaseAPI.prototype.commonReset = function (settings) {
|
|
198
|
-
this.
|
|
199
|
-
this.
|
|
198
|
+
this.apiLog("reset", "Called", enums.LogLevelEnum.INFO);
|
|
199
|
+
this.settings = (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, this.settings), settings);
|
|
200
|
+
this.clearScheduledCommit();
|
|
201
|
+
this.currentState = api_constants.global_constants.STATE_NOT_INITIALIZED;
|
|
200
202
|
this.lastErrorCode = "0";
|
|
201
203
|
this.listenerArray = [];
|
|
204
|
+
this.startingData = undefined;
|
|
202
205
|
};
|
|
203
206
|
BaseAPI.prototype.initialize = function (callbackName, initializeMessage, terminationMessage) {
|
|
204
|
-
var returnValue = api_constants
|
|
207
|
+
var returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
205
208
|
if (this.isInitialized()) {
|
|
206
209
|
this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);
|
|
207
210
|
}
|
|
@@ -212,17 +215,17 @@ var BaseAPI = (function () {
|
|
|
212
215
|
if (this.selfReportSessionTime) {
|
|
213
216
|
this.cmi.setStartTime();
|
|
214
217
|
}
|
|
215
|
-
this.currentState = api_constants
|
|
218
|
+
this.currentState = api_constants.global_constants.STATE_INITIALIZED;
|
|
216
219
|
this.lastErrorCode = "0";
|
|
217
|
-
returnValue = api_constants
|
|
220
|
+
returnValue = api_constants.global_constants.SCORM_TRUE;
|
|
218
221
|
this.processListeners(callbackName);
|
|
219
222
|
}
|
|
220
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
223
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
221
224
|
this.clearSCORMError(returnValue);
|
|
222
225
|
return returnValue;
|
|
223
226
|
};
|
|
224
227
|
BaseAPI.prototype.apiLog = function (functionName, logMessage, messageLevel, CMIElement) {
|
|
225
|
-
logMessage = (0,utilities
|
|
228
|
+
logMessage = (0,utilities.formatMessage)(functionName, logMessage, CMIElement);
|
|
226
229
|
if (messageLevel >= this.apiLogLevel) {
|
|
227
230
|
this.settings.onLogMessage(messageLevel, logMessage);
|
|
228
231
|
}
|
|
@@ -239,20 +242,20 @@ var BaseAPI = (function () {
|
|
|
239
242
|
return this._settings;
|
|
240
243
|
},
|
|
241
244
|
set: function (settings) {
|
|
242
|
-
this._settings = (0,tslib_es6
|
|
245
|
+
this._settings = (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, this._settings), settings);
|
|
243
246
|
},
|
|
244
247
|
enumerable: false,
|
|
245
248
|
configurable: true
|
|
246
249
|
});
|
|
247
250
|
BaseAPI.prototype.terminate = function (callbackName, checkTerminated) {
|
|
248
|
-
return (0,tslib_es6
|
|
251
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
249
252
|
var returnValue, result;
|
|
250
|
-
return (0,tslib_es6
|
|
253
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
251
254
|
switch (_a.label) {
|
|
252
255
|
case 0:
|
|
253
|
-
returnValue = api_constants
|
|
256
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
254
257
|
if (!this.checkState(checkTerminated, this._error_codes.TERMINATION_BEFORE_INIT, this._error_codes.MULTIPLE_TERMINATION)) return [3, 2];
|
|
255
|
-
this.currentState = api_constants
|
|
258
|
+
this.currentState = api_constants.global_constants.STATE_TERMINATED;
|
|
256
259
|
return [4, this.storeData(true)];
|
|
257
260
|
case 1:
|
|
258
261
|
result = _a.sent();
|
|
@@ -262,14 +265,14 @@ var BaseAPI = (function () {
|
|
|
262
265
|
returnValue =
|
|
263
266
|
typeof result !== "undefined" && result.result
|
|
264
267
|
? result.result
|
|
265
|
-
: api_constants
|
|
268
|
+
: api_constants.global_constants.SCORM_FALSE;
|
|
266
269
|
if (checkTerminated)
|
|
267
270
|
this.lastErrorCode = "0";
|
|
268
|
-
returnValue = api_constants
|
|
271
|
+
returnValue = api_constants.global_constants.SCORM_TRUE;
|
|
269
272
|
this.processListeners(callbackName);
|
|
270
273
|
_a.label = 2;
|
|
271
274
|
case 2:
|
|
272
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
275
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
273
276
|
this.clearSCORMError(returnValue);
|
|
274
277
|
return [2, returnValue];
|
|
275
278
|
}
|
|
@@ -289,7 +292,7 @@ var BaseAPI = (function () {
|
|
|
289
292
|
}
|
|
290
293
|
this.processListeners(callbackName, CMIElement);
|
|
291
294
|
}
|
|
292
|
-
this.apiLog(callbackName, ": returned: " + returnValue, enums
|
|
295
|
+
this.apiLog(callbackName, ": returned: " + returnValue, enums.LogLevelEnum.INFO, CMIElement);
|
|
293
296
|
if (returnValue === undefined) {
|
|
294
297
|
return "";
|
|
295
298
|
}
|
|
@@ -300,7 +303,7 @@ var BaseAPI = (function () {
|
|
|
300
303
|
if (value !== undefined) {
|
|
301
304
|
value = String(value);
|
|
302
305
|
}
|
|
303
|
-
var returnValue = api_constants
|
|
306
|
+
var returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
304
307
|
if (this.checkState(checkTerminated, this._error_codes.STORE_BEFORE_INIT, this._error_codes.STORE_AFTER_TERM)) {
|
|
305
308
|
if (checkTerminated)
|
|
306
309
|
this.lastErrorCode = "0";
|
|
@@ -313,26 +316,26 @@ var BaseAPI = (function () {
|
|
|
313
316
|
this.processListeners(callbackName, CMIElement, value);
|
|
314
317
|
}
|
|
315
318
|
if (returnValue === undefined) {
|
|
316
|
-
returnValue = api_constants
|
|
319
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
317
320
|
}
|
|
318
321
|
if (String(this.lastErrorCode) === "0") {
|
|
319
322
|
if (this.settings.autocommit) {
|
|
320
323
|
this.scheduleCommit(this.settings.autocommitSeconds * 1000, commitCallback);
|
|
321
324
|
}
|
|
322
325
|
}
|
|
323
|
-
this.apiLog(callbackName, ": " + value + ": result: " + returnValue, enums
|
|
326
|
+
this.apiLog(callbackName, ": " + value + ": result: " + returnValue, enums.LogLevelEnum.INFO, CMIElement);
|
|
324
327
|
this.clearSCORMError(returnValue);
|
|
325
328
|
return returnValue;
|
|
326
329
|
};
|
|
327
330
|
BaseAPI.prototype.commit = function (callbackName_1) {
|
|
328
|
-
return (0,tslib_es6
|
|
331
|
+
return (0,tslib_es6.__awaiter)(this, arguments, void 0, function (callbackName, checkTerminated) {
|
|
329
332
|
var returnValue, result;
|
|
330
333
|
if (checkTerminated === void 0) { checkTerminated = false; }
|
|
331
|
-
return (0,tslib_es6
|
|
334
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
332
335
|
switch (_a.label) {
|
|
333
336
|
case 0:
|
|
334
337
|
this.clearScheduledCommit();
|
|
335
|
-
returnValue = api_constants
|
|
338
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
336
339
|
if (!this.checkState(checkTerminated, this._error_codes.COMMIT_BEFORE_INIT, this._error_codes.COMMIT_AFTER_TERM)) return [3, 2];
|
|
337
340
|
return [4, this.storeData(false)];
|
|
338
341
|
case 1:
|
|
@@ -343,14 +346,14 @@ var BaseAPI = (function () {
|
|
|
343
346
|
returnValue =
|
|
344
347
|
typeof result !== "undefined" && result.result
|
|
345
348
|
? result.result
|
|
346
|
-
: api_constants
|
|
347
|
-
this.apiLog(callbackName, " Result: " + returnValue, enums
|
|
349
|
+
: api_constants.global_constants.SCORM_FALSE;
|
|
350
|
+
this.apiLog(callbackName, " Result: " + returnValue, enums.LogLevelEnum.DEBUG, "HttpRequest");
|
|
348
351
|
if (checkTerminated)
|
|
349
352
|
this.lastErrorCode = "0";
|
|
350
353
|
this.processListeners(callbackName);
|
|
351
354
|
_a.label = 2;
|
|
352
355
|
case 2:
|
|
353
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
356
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
354
357
|
this.clearSCORMError(returnValue);
|
|
355
358
|
return [2, returnValue];
|
|
356
359
|
}
|
|
@@ -360,7 +363,7 @@ var BaseAPI = (function () {
|
|
|
360
363
|
BaseAPI.prototype.getLastError = function (callbackName) {
|
|
361
364
|
var returnValue = String(this.lastErrorCode);
|
|
362
365
|
this.processListeners(callbackName);
|
|
363
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
366
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
364
367
|
return returnValue;
|
|
365
368
|
};
|
|
366
369
|
BaseAPI.prototype.getErrorString = function (callbackName, CMIErrorCode) {
|
|
@@ -369,7 +372,7 @@ var BaseAPI = (function () {
|
|
|
369
372
|
returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);
|
|
370
373
|
this.processListeners(callbackName);
|
|
371
374
|
}
|
|
372
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
375
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
373
376
|
return returnValue;
|
|
374
377
|
};
|
|
375
378
|
BaseAPI.prototype.getDiagnostic = function (callbackName, CMIErrorCode) {
|
|
@@ -378,7 +381,7 @@ var BaseAPI = (function () {
|
|
|
378
381
|
returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);
|
|
379
382
|
this.processListeners(callbackName);
|
|
380
383
|
}
|
|
381
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
384
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
382
385
|
return returnValue;
|
|
383
386
|
};
|
|
384
387
|
BaseAPI.prototype.checkState = function (checkTerminated, beforeInitError, afterTermError) {
|
|
@@ -404,11 +407,11 @@ var BaseAPI = (function () {
|
|
|
404
407
|
};
|
|
405
408
|
BaseAPI.prototype._commonSetCMIValue = function (methodName, scorm2004, CMIElement, value) {
|
|
406
409
|
if (!CMIElement || CMIElement === "") {
|
|
407
|
-
return api_constants
|
|
410
|
+
return api_constants.global_constants.SCORM_FALSE;
|
|
408
411
|
}
|
|
409
412
|
var structure = CMIElement.split(".");
|
|
410
413
|
var refObject = this;
|
|
411
|
-
var returnValue = api_constants
|
|
414
|
+
var returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
412
415
|
var foundFirstIndex = false;
|
|
413
416
|
var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element.");
|
|
414
417
|
var invalidErrorCode = scorm2004
|
|
@@ -422,20 +425,20 @@ var BaseAPI = (function () {
|
|
|
422
425
|
this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);
|
|
423
426
|
}
|
|
424
427
|
else {
|
|
425
|
-
refObject = (0,tslib_es6
|
|
428
|
+
refObject = (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, refObject), { attribute: value });
|
|
426
429
|
}
|
|
427
430
|
}
|
|
428
431
|
else if (!this._checkObjectHasProperty(refObject, attribute)) {
|
|
429
432
|
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
430
433
|
}
|
|
431
434
|
else {
|
|
432
|
-
if ((0,utilities
|
|
435
|
+
if ((0,utilities.stringMatches)(CMIElement, "\\.correct_responses\\.\\d+") &&
|
|
433
436
|
this.isInitialized()) {
|
|
434
437
|
this.validateCorrectResponse(CMIElement, value);
|
|
435
438
|
}
|
|
436
439
|
if (!scorm2004 || this.lastErrorCode === "0") {
|
|
437
440
|
refObject[attribute] = value;
|
|
438
|
-
returnValue = api_constants
|
|
441
|
+
returnValue = api_constants.global_constants.SCORM_TRUE;
|
|
439
442
|
}
|
|
440
443
|
}
|
|
441
444
|
}
|
|
@@ -445,7 +448,7 @@ var BaseAPI = (function () {
|
|
|
445
448
|
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
446
449
|
break;
|
|
447
450
|
}
|
|
448
|
-
if (refObject instanceof array
|
|
451
|
+
if (refObject instanceof array.CMIArray) {
|
|
449
452
|
var index = parseInt(structure[idx + 1], 10);
|
|
450
453
|
if (!isNaN(index)) {
|
|
451
454
|
var item = refObject.childArray[index];
|
|
@@ -471,8 +474,8 @@ var BaseAPI = (function () {
|
|
|
471
474
|
}
|
|
472
475
|
}
|
|
473
476
|
}
|
|
474
|
-
if (returnValue === api_constants
|
|
475
|
-
this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value), enums
|
|
477
|
+
if (returnValue === api_constants.global_constants.SCORM_FALSE) {
|
|
478
|
+
this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value), enums.LogLevelEnum.WARN);
|
|
476
479
|
}
|
|
477
480
|
return returnValue;
|
|
478
481
|
};
|
|
@@ -514,7 +517,7 @@ var BaseAPI = (function () {
|
|
|
514
517
|
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
515
518
|
break;
|
|
516
519
|
}
|
|
517
|
-
if (refObject instanceof array
|
|
520
|
+
if (refObject instanceof array.CMIArray) {
|
|
518
521
|
var index = parseInt(structure[idx + 1], 10);
|
|
519
522
|
if (!isNaN(index)) {
|
|
520
523
|
var item = refObject.childArray[index];
|
|
@@ -532,10 +535,10 @@ var BaseAPI = (function () {
|
|
|
532
535
|
if (refObject === null || refObject === undefined) {
|
|
533
536
|
if (!scorm2004) {
|
|
534
537
|
if (attribute === "_children") {
|
|
535
|
-
this.throwSCORMError(
|
|
538
|
+
this.throwSCORMError(this._error_codes.CHILDREN_ERROR);
|
|
536
539
|
}
|
|
537
540
|
else if (attribute === "_count") {
|
|
538
|
-
this.throwSCORMError(
|
|
541
|
+
this.throwSCORMError(this._error_codes.COUNT_ERROR);
|
|
539
542
|
}
|
|
540
543
|
}
|
|
541
544
|
}
|
|
@@ -544,13 +547,13 @@ var BaseAPI = (function () {
|
|
|
544
547
|
}
|
|
545
548
|
};
|
|
546
549
|
BaseAPI.prototype.isInitialized = function () {
|
|
547
|
-
return this.currentState === api_constants
|
|
550
|
+
return this.currentState === api_constants.global_constants.STATE_INITIALIZED;
|
|
548
551
|
};
|
|
549
552
|
BaseAPI.prototype.isNotInitialized = function () {
|
|
550
|
-
return this.currentState === api_constants
|
|
553
|
+
return this.currentState === api_constants.global_constants.STATE_NOT_INITIALIZED;
|
|
551
554
|
};
|
|
552
555
|
BaseAPI.prototype.isTerminated = function () {
|
|
553
|
-
return this.currentState === api_constants
|
|
556
|
+
return this.currentState === api_constants.global_constants.STATE_TERMINATED;
|
|
554
557
|
};
|
|
555
558
|
BaseAPI.prototype.on = function (listenerName, callback) {
|
|
556
559
|
if (!callback)
|
|
@@ -570,7 +573,7 @@ var BaseAPI = (function () {
|
|
|
570
573
|
CMIElement: CMIElement,
|
|
571
574
|
callback: callback,
|
|
572
575
|
});
|
|
573
|
-
this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), enums
|
|
576
|
+
this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), enums.LogLevelEnum.INFO, functionName);
|
|
574
577
|
}
|
|
575
578
|
};
|
|
576
579
|
BaseAPI.prototype.off = function (listenerName, callback) {
|
|
@@ -593,7 +596,7 @@ var BaseAPI = (function () {
|
|
|
593
596
|
});
|
|
594
597
|
if (removeIndex !== -1) {
|
|
595
598
|
this_1.listenerArray.splice(removeIndex, 1);
|
|
596
|
-
this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), enums
|
|
599
|
+
this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), enums.LogLevelEnum.INFO, functionName);
|
|
597
600
|
}
|
|
598
601
|
};
|
|
599
602
|
var this_1 = this;
|
|
@@ -626,7 +629,7 @@ var BaseAPI = (function () {
|
|
|
626
629
|
}
|
|
627
630
|
};
|
|
628
631
|
BaseAPI.prototype.processListeners = function (functionName, CMIElement, value) {
|
|
629
|
-
this.apiLog(functionName, value, enums
|
|
632
|
+
this.apiLog(functionName, value, enums.LogLevelEnum.INFO, CMIElement);
|
|
630
633
|
for (var i = 0; i < this.listenerArray.length; i++) {
|
|
631
634
|
var listener = this.listenerArray[i];
|
|
632
635
|
var functionsMatch = listener.functionName === functionName;
|
|
@@ -642,7 +645,7 @@ var BaseAPI = (function () {
|
|
|
642
645
|
CMIElementsMatch = listener.CMIElement === CMIElement;
|
|
643
646
|
}
|
|
644
647
|
if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {
|
|
645
|
-
this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), enums
|
|
648
|
+
this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), enums.LogLevelEnum.INFO, CMIElement);
|
|
646
649
|
listener.callback(CMIElement, value);
|
|
647
650
|
}
|
|
648
651
|
}
|
|
@@ -651,11 +654,11 @@ var BaseAPI = (function () {
|
|
|
651
654
|
if (!message) {
|
|
652
655
|
message = this.getLmsErrorMessageDetails(errorNumber);
|
|
653
656
|
}
|
|
654
|
-
this.apiLog("throwSCORMError", errorNumber + ": " + message, enums
|
|
657
|
+
this.apiLog("throwSCORMError", errorNumber + ": " + message, enums.LogLevelEnum.ERROR);
|
|
655
658
|
this.lastErrorCode = String(errorNumber);
|
|
656
659
|
};
|
|
657
660
|
BaseAPI.prototype.clearSCORMError = function (success) {
|
|
658
|
-
if (success !== undefined && success !== api_constants
|
|
661
|
+
if (success !== undefined && success !== api_constants.global_constants.SCORM_FALSE) {
|
|
659
662
|
this.lastErrorCode = "0";
|
|
660
663
|
}
|
|
661
664
|
};
|
|
@@ -721,7 +724,7 @@ var BaseAPI = (function () {
|
|
|
721
724
|
result.forEach(function (element) {
|
|
722
725
|
obj = {};
|
|
723
726
|
obj[element[0]] = element[1];
|
|
724
|
-
_this.loadFromJSON((0,utilities
|
|
727
|
+
_this.loadFromJSON((0,utilities.unflatten)(obj), CMIElement);
|
|
725
728
|
});
|
|
726
729
|
};
|
|
727
730
|
BaseAPI.prototype.loadFromJSON = function (json, CMIElement) {
|
|
@@ -761,21 +764,21 @@ var BaseAPI = (function () {
|
|
|
761
764
|
return JSON.parse(this.renderCMIToJSONString());
|
|
762
765
|
};
|
|
763
766
|
BaseAPI.prototype.processHttpRequest = function (url_1, params_1) {
|
|
764
|
-
return (0,tslib_es6
|
|
767
|
+
return (0,tslib_es6.__awaiter)(this, arguments, void 0, function (url, params, immediate) {
|
|
765
768
|
var api, genericError, process;
|
|
766
769
|
var _this = this;
|
|
767
770
|
if (immediate === void 0) { immediate = false; }
|
|
768
|
-
return (0,tslib_es6
|
|
771
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
769
772
|
switch (_a.label) {
|
|
770
773
|
case 0:
|
|
771
774
|
api = this;
|
|
772
775
|
genericError = {
|
|
773
|
-
result: api_constants
|
|
776
|
+
result: api_constants.global_constants.SCORM_FALSE,
|
|
774
777
|
errorCode: this.error_codes.GENERAL,
|
|
775
778
|
};
|
|
776
779
|
if (immediate) {
|
|
777
|
-
this.performFetch(url, params).then(function (response) { return (0,tslib_es6
|
|
778
|
-
return (0,tslib_es6
|
|
780
|
+
this.performFetch(url, params).then(function (response) { return (0,tslib_es6.__awaiter)(_this, void 0, void 0, function () {
|
|
781
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
779
782
|
switch (_a.label) {
|
|
780
783
|
case 0: return [4, this.transformResponse(response)];
|
|
781
784
|
case 1:
|
|
@@ -785,13 +788,13 @@ var BaseAPI = (function () {
|
|
|
785
788
|
});
|
|
786
789
|
}); });
|
|
787
790
|
return [2, {
|
|
788
|
-
result: api_constants
|
|
791
|
+
result: api_constants.global_constants.SCORM_TRUE,
|
|
789
792
|
errorCode: 0,
|
|
790
793
|
}];
|
|
791
794
|
}
|
|
792
|
-
process = function (url, params, settings) { return (0,tslib_es6
|
|
795
|
+
process = function (url, params, settings) { return (0,tslib_es6.__awaiter)(_this, void 0, void 0, function () {
|
|
793
796
|
var response, e_1;
|
|
794
|
-
return (0,tslib_es6
|
|
797
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
795
798
|
switch (_a.label) {
|
|
796
799
|
case 0:
|
|
797
800
|
_a.trys.push([0, 2, , 3]);
|
|
@@ -802,7 +805,7 @@ var BaseAPI = (function () {
|
|
|
802
805
|
return [2, this.transformResponse(response)];
|
|
803
806
|
case 2:
|
|
804
807
|
e_1 = _a.sent();
|
|
805
|
-
this.apiLog("processHttpRequest", e_1, enums
|
|
808
|
+
this.apiLog("processHttpRequest", e_1, enums.LogLevelEnum.ERROR);
|
|
806
809
|
api.processListeners("CommitError");
|
|
807
810
|
return [2, genericError];
|
|
808
811
|
case 3: return [2];
|
|
@@ -818,14 +821,14 @@ var BaseAPI = (function () {
|
|
|
818
821
|
BaseAPI.prototype.scheduleCommit = function (when, callback) {
|
|
819
822
|
if (!this._timeout) {
|
|
820
823
|
this._timeout = new ScheduledCommit(this, when, callback);
|
|
821
|
-
this.apiLog("scheduleCommit", "scheduled", enums
|
|
824
|
+
this.apiLog("scheduleCommit", "scheduled", enums.LogLevelEnum.DEBUG, "");
|
|
822
825
|
}
|
|
823
826
|
};
|
|
824
827
|
BaseAPI.prototype.clearScheduledCommit = function () {
|
|
825
828
|
if (this._timeout) {
|
|
826
829
|
this._timeout.cancel();
|
|
827
830
|
this._timeout = undefined;
|
|
828
|
-
this.apiLog("clearScheduledCommit", "cleared", enums
|
|
831
|
+
this.apiLog("clearScheduledCommit", "cleared", enums.LogLevelEnum.DEBUG, "");
|
|
829
832
|
}
|
|
830
833
|
};
|
|
831
834
|
BaseAPI.prototype._checkObjectHasProperty = function (refObject, attribute) {
|
|
@@ -834,9 +837,9 @@ var BaseAPI = (function () {
|
|
|
834
837
|
attribute in refObject);
|
|
835
838
|
};
|
|
836
839
|
BaseAPI.prototype.handleValueAccessException = function (e, returnValue) {
|
|
837
|
-
if (e instanceof exceptions
|
|
840
|
+
if (e instanceof exceptions.ValidationError) {
|
|
838
841
|
this.lastErrorCode = String(e.errorCode);
|
|
839
|
-
returnValue = api_constants
|
|
842
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
840
843
|
}
|
|
841
844
|
else {
|
|
842
845
|
if (e instanceof Error && e.message) {
|
|
@@ -854,20 +857,20 @@ var BaseAPI = (function () {
|
|
|
854
857
|
var commitObject = this.settings.renderCommonCommitFields
|
|
855
858
|
? this.renderCommitObject(shouldTerminateCommit)
|
|
856
859
|
: this.renderCommitCMI(shouldTerminateCommit);
|
|
857
|
-
if ([enums
|
|
860
|
+
if ([enums.LogLevelEnum.DEBUG, "1", 1, "DEBUG"].includes(this.apiLogLevel)) {
|
|
858
861
|
console.debug("Commit (terminated: " + (terminateCommit ? "yes" : "no") + "): ");
|
|
859
862
|
console.debug(commitObject);
|
|
860
863
|
}
|
|
861
864
|
return commitObject;
|
|
862
865
|
};
|
|
863
866
|
BaseAPI.prototype.performFetch = function (url, params) {
|
|
864
|
-
return (0,tslib_es6
|
|
865
|
-
return (0,tslib_es6
|
|
867
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
868
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
866
869
|
return [2, fetch(url, {
|
|
867
870
|
method: "POST",
|
|
868
871
|
mode: this.settings.fetchMode,
|
|
869
872
|
body: params instanceof Array ? params.join("&") : JSON.stringify(params),
|
|
870
|
-
headers: (0,tslib_es6
|
|
873
|
+
headers: (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, this.settings.xhrHeaders), { "Content-Type": this.settings.commitRequestDataType }),
|
|
871
874
|
credentials: this.settings.xhrWithCredentials ? "include" : undefined,
|
|
872
875
|
keepalive: true,
|
|
873
876
|
})];
|
|
@@ -875,9 +878,9 @@ var BaseAPI = (function () {
|
|
|
875
878
|
});
|
|
876
879
|
};
|
|
877
880
|
BaseAPI.prototype.transformResponse = function (response) {
|
|
878
|
-
return (0,tslib_es6
|
|
881
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
879
882
|
var result, _a;
|
|
880
|
-
return (0,tslib_es6
|
|
883
|
+
return (0,tslib_es6.__generator)(this, function (_c) {
|
|
881
884
|
switch (_c.label) {
|
|
882
885
|
case 0:
|
|
883
886
|
if (!(typeof this.settings.responseHandler === "function")) return [3, 2];
|
|
@@ -893,8 +896,7 @@ var BaseAPI = (function () {
|
|
|
893
896
|
result = _a;
|
|
894
897
|
if (response.status >= 200 &&
|
|
895
898
|
response.status <= 299 &&
|
|
896
|
-
(result.result === true ||
|
|
897
|
-
result.result === api_constants/* default */.A.global.SCORM_TRUE)) {
|
|
899
|
+
(result.result === true || result.result === api_constants.global_constants.SCORM_TRUE)) {
|
|
898
900
|
this.processListeners("CommitSuccess");
|
|
899
901
|
}
|
|
900
902
|
else {
|
|
@@ -915,6 +917,7 @@ var BaseAPI = (function () {
|
|
|
915
917
|
/***/ 941:
|
|
916
918
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
917
919
|
|
|
920
|
+
__webpack_require__.r(__webpack_exports__);
|
|
918
921
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
919
922
|
/* harmony export */ Scorm12Impl: function() { return /* binding */ Scorm12Impl; }
|
|
920
923
|
/* harmony export */ });
|
|
@@ -926,9 +929,9 @@ var BaseAPI = (function () {
|
|
|
926
929
|
/* harmony import */ var _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(176);
|
|
927
930
|
/* harmony import */ var _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(833);
|
|
928
931
|
/* harmony import */ var _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(331);
|
|
929
|
-
/* harmony import */ var
|
|
930
|
-
/* harmony import */ var
|
|
931
|
-
/* harmony import */ var
|
|
932
|
+
/* harmony import */ var _constants_enums__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(56);
|
|
933
|
+
/* harmony import */ var _BaseAPI__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(429);
|
|
934
|
+
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(417);
|
|
932
935
|
|
|
933
936
|
|
|
934
937
|
|
|
@@ -942,7 +945,7 @@ var BaseAPI = (function () {
|
|
|
942
945
|
|
|
943
946
|
|
|
944
947
|
var Scorm12Impl = (function (_super) {
|
|
945
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
948
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_10__.__extends)(Scorm12Impl, _super);
|
|
946
949
|
function Scorm12Impl(settings) {
|
|
947
950
|
var _this = this;
|
|
948
951
|
if (settings) {
|
|
@@ -950,10 +953,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
950
953
|
settings.mastery_override = false;
|
|
951
954
|
}
|
|
952
955
|
}
|
|
953
|
-
_this = _super.call(this, _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__
|
|
956
|
+
_this = _super.call(this, _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors, settings) || this;
|
|
954
957
|
_this.statusSetByModule = false;
|
|
955
|
-
_this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
956
|
-
_this.nav = new _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__
|
|
958
|
+
_this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__.CMI();
|
|
959
|
+
_this.nav = new _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__.NAV();
|
|
957
960
|
_this.LMSInitialize = _this.lmsInitialize;
|
|
958
961
|
_this.LMSFinish = _this.lmsFinish;
|
|
959
962
|
_this.LMSGetValue = _this.lmsGetValue;
|
|
@@ -965,9 +968,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
965
968
|
return _this;
|
|
966
969
|
}
|
|
967
970
|
Scorm12Impl.prototype.reset = function (settings) {
|
|
971
|
+
var _a, _b;
|
|
968
972
|
this.commonReset(settings);
|
|
969
|
-
this.cmi
|
|
970
|
-
this.nav
|
|
973
|
+
(_a = this.cmi) === null || _a === void 0 ? void 0 : _a.reset();
|
|
974
|
+
(_b = this.nav) === null || _b === void 0 ? void 0 : _b.reset();
|
|
971
975
|
};
|
|
972
976
|
Scorm12Impl.prototype.lmsInitialize = function () {
|
|
973
977
|
this.cmi.initialize();
|
|
@@ -981,8 +985,8 @@ var Scorm12Impl = (function (_super) {
|
|
|
981
985
|
};
|
|
982
986
|
Scorm12Impl.prototype.lmsFinish = function () {
|
|
983
987
|
var _this = this;
|
|
984
|
-
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
985
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
988
|
+
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(_this, void 0, void 0, function () {
|
|
989
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_a) {
|
|
986
990
|
switch (_a.label) {
|
|
987
991
|
case 0: return [4, this.internalFinish()];
|
|
988
992
|
case 1:
|
|
@@ -991,17 +995,17 @@ var Scorm12Impl = (function (_super) {
|
|
|
991
995
|
}
|
|
992
996
|
});
|
|
993
997
|
}); })();
|
|
994
|
-
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
998
|
+
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE;
|
|
995
999
|
};
|
|
996
1000
|
Scorm12Impl.prototype.internalFinish = function () {
|
|
997
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1001
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(this, void 0, void 0, function () {
|
|
998
1002
|
var result;
|
|
999
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1003
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_a) {
|
|
1000
1004
|
switch (_a.label) {
|
|
1001
1005
|
case 0: return [4, this.terminate("LMSFinish", true)];
|
|
1002
1006
|
case 1:
|
|
1003
1007
|
result = _a.sent();
|
|
1004
|
-
if (result === _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
1008
|
+
if (result === _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE) {
|
|
1005
1009
|
if (this.nav.event !== "") {
|
|
1006
1010
|
if (this.nav.event === "continue") {
|
|
1007
1011
|
this.processListeners("SequenceNext");
|
|
@@ -1034,8 +1038,8 @@ var Scorm12Impl = (function (_super) {
|
|
|
1034
1038
|
this.scheduleCommit(500, "LMSCommit");
|
|
1035
1039
|
}
|
|
1036
1040
|
else {
|
|
1037
|
-
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1038
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1041
|
+
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(_this, void 0, void 0, function () {
|
|
1042
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_a) {
|
|
1039
1043
|
switch (_a.label) {
|
|
1040
1044
|
case 0: return [4, this.commit("LMSCommit", false)];
|
|
1041
1045
|
case 1:
|
|
@@ -1045,7 +1049,7 @@ var Scorm12Impl = (function (_super) {
|
|
|
1045
1049
|
});
|
|
1046
1050
|
}); })();
|
|
1047
1051
|
}
|
|
1048
|
-
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
1052
|
+
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE;
|
|
1049
1053
|
};
|
|
1050
1054
|
Scorm12Impl.prototype.lmsGetLastError = function () {
|
|
1051
1055
|
return this.getLastError("LMSGetLastError");
|
|
@@ -1063,20 +1067,20 @@ var Scorm12Impl = (function (_super) {
|
|
|
1063
1067
|
return this._commonGetCMIValue("getCMIValue", false, CMIElement);
|
|
1064
1068
|
};
|
|
1065
1069
|
Scorm12Impl.prototype.getChildElement = function (CMIElement, _value, foundFirstIndex) {
|
|
1066
|
-
if ((0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
1067
|
-
return new _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__
|
|
1070
|
+
if ((0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.objectives\\.\\d+")) {
|
|
1071
|
+
return new _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__.CMIObjectivesObject();
|
|
1068
1072
|
}
|
|
1069
1073
|
else if (foundFirstIndex &&
|
|
1070
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
1071
|
-
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__
|
|
1074
|
+
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) {
|
|
1075
|
+
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__.CMIInteractionsCorrectResponsesObject();
|
|
1072
1076
|
}
|
|
1073
1077
|
else if (foundFirstIndex &&
|
|
1074
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
1075
|
-
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__
|
|
1078
|
+
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) {
|
|
1079
|
+
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__.CMIInteractionsObjectivesObject();
|
|
1076
1080
|
}
|
|
1077
1081
|
else if (!foundFirstIndex &&
|
|
1078
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
1079
|
-
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__
|
|
1082
|
+
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+")) {
|
|
1083
|
+
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__.CMIInteractionsObject();
|
|
1080
1084
|
}
|
|
1081
1085
|
return null;
|
|
1082
1086
|
};
|
|
@@ -1086,11 +1090,11 @@ var Scorm12Impl = (function (_super) {
|
|
|
1086
1090
|
var basicMessage = "No Error";
|
|
1087
1091
|
var detailMessage = "No Error";
|
|
1088
1092
|
errorNumber = String(errorNumber);
|
|
1089
|
-
if (_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
1093
|
+
if (_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber]) {
|
|
1090
1094
|
basicMessage =
|
|
1091
|
-
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
1095
|
+
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber].basicMessage;
|
|
1092
1096
|
detailMessage =
|
|
1093
|
-
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
1097
|
+
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber].detailMessage;
|
|
1094
1098
|
}
|
|
1095
1099
|
return detail ? detailMessage : basicMessage;
|
|
1096
1100
|
};
|
|
@@ -1103,10 +1107,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
1103
1107
|
cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();
|
|
1104
1108
|
}
|
|
1105
1109
|
var result = [];
|
|
1106
|
-
var flattened = _utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
1110
|
+
var flattened = _utilities__WEBPACK_IMPORTED_MODULE_1__.flatten(cmiExport);
|
|
1107
1111
|
switch (this.settings.dataCommitFormat) {
|
|
1108
1112
|
case "flattened":
|
|
1109
|
-
return _utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
1113
|
+
return _utilities__WEBPACK_IMPORTED_MODULE_1__.flatten(cmiExport);
|
|
1110
1114
|
case "params":
|
|
1111
1115
|
for (var item in flattened) {
|
|
1112
1116
|
if ({}.hasOwnProperty.call(flattened, item)) {
|
|
@@ -1122,20 +1126,20 @@ var Scorm12Impl = (function (_super) {
|
|
|
1122
1126
|
Scorm12Impl.prototype.renderCommitObject = function (terminateCommit) {
|
|
1123
1127
|
var cmiExport = this.renderCommitCMI(terminateCommit);
|
|
1124
1128
|
var totalTimeHHMMSS = this.cmi.getCurrentTotalTime();
|
|
1125
|
-
var totalTimeSeconds = _utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
1129
|
+
var totalTimeSeconds = _utilities__WEBPACK_IMPORTED_MODULE_1__.getTimeAsSeconds(totalTimeHHMMSS, _constants_regex__WEBPACK_IMPORTED_MODULE_9__.scorm12_regex.CMITimespan);
|
|
1126
1130
|
var lessonStatus = this.cmi.core.lesson_status;
|
|
1127
|
-
var completionStatus =
|
|
1128
|
-
var successStatus =
|
|
1131
|
+
var completionStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.unknown;
|
|
1132
|
+
var successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.unknown;
|
|
1129
1133
|
if (lessonStatus) {
|
|
1130
1134
|
completionStatus =
|
|
1131
1135
|
lessonStatus === "completed" || lessonStatus === "passed"
|
|
1132
|
-
?
|
|
1133
|
-
:
|
|
1136
|
+
? _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.completed
|
|
1137
|
+
: _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.incomplete;
|
|
1134
1138
|
if (lessonStatus === "passed") {
|
|
1135
|
-
successStatus =
|
|
1139
|
+
successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.passed;
|
|
1136
1140
|
}
|
|
1137
1141
|
else if (lessonStatus === "failed") {
|
|
1138
|
-
successStatus =
|
|
1142
|
+
successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.failed;
|
|
1139
1143
|
}
|
|
1140
1144
|
}
|
|
1141
1145
|
var score = this.cmi.core.score;
|
|
@@ -1164,10 +1168,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
1164
1168
|
return commitObject;
|
|
1165
1169
|
};
|
|
1166
1170
|
Scorm12Impl.prototype.storeData = function (terminateCommit) {
|
|
1167
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1171
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(this, void 0, void 0, function () {
|
|
1168
1172
|
var originalStatus, commitObject;
|
|
1169
1173
|
var _a, _b, _c;
|
|
1170
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1174
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_d) {
|
|
1171
1175
|
switch (_d.label) {
|
|
1172
1176
|
case 0:
|
|
1173
1177
|
if (terminateCommit) {
|
|
@@ -1202,7 +1206,7 @@ var Scorm12Impl = (function (_super) {
|
|
|
1202
1206
|
return [4, this.processHttpRequest(this.settings.lmsCommitUrl, commitObject, terminateCommit)];
|
|
1203
1207
|
case 1: return [2, _d.sent()];
|
|
1204
1208
|
case 2: return [2, {
|
|
1205
|
-
result: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
1209
|
+
result: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE,
|
|
1206
1210
|
errorCode: 0,
|
|
1207
1211
|
}];
|
|
1208
1212
|
}
|
|
@@ -1210,7 +1214,7 @@ var Scorm12Impl = (function (_super) {
|
|
|
1210
1214
|
});
|
|
1211
1215
|
};
|
|
1212
1216
|
return Scorm12Impl;
|
|
1213
|
-
}(
|
|
1217
|
+
}(_BaseAPI__WEBPACK_IMPORTED_MODULE_8__["default"]));
|
|
1214
1218
|
|
|
1215
1219
|
|
|
1216
1220
|
|
|
@@ -1219,29 +1223,40 @@ var Scorm12Impl = (function (_super) {
|
|
|
1219
1223
|
/***/ 589:
|
|
1220
1224
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1221
1225
|
|
|
1226
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1222
1227
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1223
|
-
/* harmony export */
|
|
1228
|
+
/* harmony export */ CMIArray: function() { return /* binding */ CMIArray; }
|
|
1224
1229
|
/* harmony export */ });
|
|
1225
|
-
/* unused harmony export scorm12_error_codes */
|
|
1226
1230
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635);
|
|
1227
1231
|
/* harmony import */ var _base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
1228
|
-
/* harmony import */ var
|
|
1229
|
-
/* harmony import */ var
|
|
1232
|
+
/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(784);
|
|
1233
|
+
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(797);
|
|
1230
1234
|
|
|
1231
1235
|
|
|
1232
1236
|
|
|
1233
1237
|
|
|
1234
|
-
var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12;
|
|
1235
1238
|
var CMIArray = (function (_super) {
|
|
1236
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_3__
|
|
1239
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_3__.__extends)(CMIArray, _super);
|
|
1237
1240
|
function CMIArray(params) {
|
|
1238
1241
|
var _this = _super.call(this) || this;
|
|
1239
1242
|
_this.__children = params.children;
|
|
1240
|
-
_this._errorCode = params.errorCode ||
|
|
1241
|
-
_this._errorClass = params.errorClass ||
|
|
1243
|
+
_this._errorCode = params.errorCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.GENERAL;
|
|
1244
|
+
_this._errorClass = params.errorClass || _exceptions__WEBPACK_IMPORTED_MODULE_1__.BaseScormValidationError;
|
|
1242
1245
|
_this.childArray = [];
|
|
1243
1246
|
return _this;
|
|
1244
1247
|
}
|
|
1248
|
+
CMIArray.prototype.reset = function (wipe) {
|
|
1249
|
+
if (wipe === void 0) { wipe = false; }
|
|
1250
|
+
this._initialized = false;
|
|
1251
|
+
if (wipe) {
|
|
1252
|
+
this.childArray = [];
|
|
1253
|
+
}
|
|
1254
|
+
else {
|
|
1255
|
+
for (var i = 0; i < this.childArray.length; i++) {
|
|
1256
|
+
this.childArray[i].reset();
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
};
|
|
1245
1260
|
Object.defineProperty(CMIArray.prototype, "_children", {
|
|
1246
1261
|
get: function () {
|
|
1247
1262
|
return this.__children;
|
|
@@ -1272,7 +1287,7 @@ var CMIArray = (function (_super) {
|
|
|
1272
1287
|
return result;
|
|
1273
1288
|
};
|
|
1274
1289
|
return CMIArray;
|
|
1275
|
-
}(_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
1290
|
+
}(_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
1276
1291
|
|
|
1277
1292
|
|
|
1278
1293
|
|
|
@@ -1281,9 +1296,10 @@ var CMIArray = (function (_super) {
|
|
|
1281
1296
|
/***/ 319:
|
|
1282
1297
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1283
1298
|
|
|
1299
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1284
1300
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1285
|
-
/* harmony export */
|
|
1286
|
-
/* harmony export */
|
|
1301
|
+
/* harmony export */ BaseCMI: function() { return /* binding */ BaseCMI; },
|
|
1302
|
+
/* harmony export */ BaseRootCMI: function() { return /* binding */ BaseRootCMI; }
|
|
1287
1303
|
/* harmony export */ });
|
|
1288
1304
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
1289
1305
|
|
|
@@ -1316,7 +1332,7 @@ var BaseCMI = (function () {
|
|
|
1316
1332
|
}());
|
|
1317
1333
|
|
|
1318
1334
|
var BaseRootCMI = (function (_super) {
|
|
1319
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_0__
|
|
1335
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(BaseRootCMI, _super);
|
|
1320
1336
|
function BaseRootCMI() {
|
|
1321
1337
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
1322
1338
|
}
|
|
@@ -1330,10 +1346,10 @@ var BaseRootCMI = (function (_super) {
|
|
|
1330
1346
|
/***/ 434:
|
|
1331
1347
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1332
1348
|
|
|
1349
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1333
1350
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1334
|
-
/* harmony export */
|
|
1351
|
+
/* harmony export */ CMIScore: function() { return /* binding */ CMIScore; }
|
|
1335
1352
|
/* harmony export */ });
|
|
1336
|
-
/* unused harmony export scorm12_error_codes */
|
|
1337
1353
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635);
|
|
1338
1354
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340);
|
|
1339
1355
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(417);
|
|
@@ -1346,30 +1362,30 @@ var BaseRootCMI = (function (_super) {
|
|
|
1346
1362
|
|
|
1347
1363
|
|
|
1348
1364
|
|
|
1349
|
-
var scorm12_constants = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12;
|
|
1350
|
-
var scorm12_regex = _constants_regex__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12;
|
|
1351
|
-
var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12;
|
|
1352
1365
|
var CMIScore = (function (_super) {
|
|
1353
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_4__
|
|
1366
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_4__.__extends)(CMIScore, _super);
|
|
1354
1367
|
function CMIScore(params) {
|
|
1355
1368
|
var _this = _super.call(this) || this;
|
|
1356
1369
|
_this._raw = "";
|
|
1357
1370
|
_this._min = "";
|
|
1358
|
-
_this.__children = params.score_children || scorm12_constants.score_children;
|
|
1371
|
+
_this.__children = params.score_children || _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__.scorm12_constants.score_children;
|
|
1359
1372
|
_this.__score_range = !params.score_range
|
|
1360
1373
|
? false
|
|
1361
|
-
: scorm12_regex.score_range;
|
|
1374
|
+
: _constants_regex__WEBPACK_IMPORTED_MODULE_1__.scorm12_regex.score_range;
|
|
1362
1375
|
_this._max = params.max || params.max === "" ? params.max : "100";
|
|
1363
1376
|
_this.__invalid_error_code =
|
|
1364
|
-
params.invalidErrorCode ||
|
|
1377
|
+
params.invalidErrorCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.INVALID_SET_VALUE;
|
|
1365
1378
|
_this.__invalid_type_code =
|
|
1366
|
-
params.invalidTypeCode ||
|
|
1379
|
+
params.invalidTypeCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.TYPE_MISMATCH;
|
|
1367
1380
|
_this.__invalid_range_code =
|
|
1368
|
-
params.invalidRangeCode ||
|
|
1369
|
-
_this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;
|
|
1381
|
+
params.invalidRangeCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.VALUE_OUT_OF_RANGE;
|
|
1382
|
+
_this.__decimal_regex = params.decimalRegex || _constants_regex__WEBPACK_IMPORTED_MODULE_1__.scorm12_regex.CMIDecimal;
|
|
1370
1383
|
_this.__error_class = params.errorClass;
|
|
1371
1384
|
return _this;
|
|
1372
1385
|
}
|
|
1386
|
+
CMIScore.prototype.reset = function () {
|
|
1387
|
+
this._initialized = false;
|
|
1388
|
+
};
|
|
1373
1389
|
Object.defineProperty(CMIScore.prototype, "_children", {
|
|
1374
1390
|
get: function () {
|
|
1375
1391
|
return this.__children;
|
|
@@ -1385,9 +1401,9 @@ var CMIScore = (function (_super) {
|
|
|
1385
1401
|
return this._raw;
|
|
1386
1402
|
},
|
|
1387
1403
|
set: function (raw) {
|
|
1388
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1404
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidFormat)(raw, this.__decimal_regex, this.__invalid_type_code, this.__error_class) &&
|
|
1389
1405
|
(!this.__score_range ||
|
|
1390
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1406
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidRange)(raw, this.__score_range, this.__invalid_range_code, this.__error_class))) {
|
|
1391
1407
|
this._raw = raw;
|
|
1392
1408
|
}
|
|
1393
1409
|
},
|
|
@@ -1399,9 +1415,9 @@ var CMIScore = (function (_super) {
|
|
|
1399
1415
|
return this._min;
|
|
1400
1416
|
},
|
|
1401
1417
|
set: function (min) {
|
|
1402
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1418
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidFormat)(min, this.__decimal_regex, this.__invalid_type_code, this.__error_class) &&
|
|
1403
1419
|
(!this.__score_range ||
|
|
1404
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1420
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidRange)(min, this.__score_range, this.__invalid_range_code, this.__error_class))) {
|
|
1405
1421
|
this._min = min;
|
|
1406
1422
|
}
|
|
1407
1423
|
},
|
|
@@ -1413,9 +1429,9 @@ var CMIScore = (function (_super) {
|
|
|
1413
1429
|
return this._max;
|
|
1414
1430
|
},
|
|
1415
1431
|
set: function (max) {
|
|
1416
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1432
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidFormat)(max, this.__decimal_regex, this.__invalid_type_code, this.__error_class) &&
|
|
1417
1433
|
(!this.__score_range ||
|
|
1418
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1434
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidRange)(max, this.__score_range, this.__invalid_range_code, this.__error_class))) {
|
|
1419
1435
|
this._max = max;
|
|
1420
1436
|
}
|
|
1421
1437
|
},
|
|
@@ -1433,7 +1449,7 @@ var CMIScore = (function (_super) {
|
|
|
1433
1449
|
return result;
|
|
1434
1450
|
};
|
|
1435
1451
|
return CMIScore;
|
|
1436
|
-
}(_base_cmi__WEBPACK_IMPORTED_MODULE_2__
|
|
1452
|
+
}(_base_cmi__WEBPACK_IMPORTED_MODULE_2__.BaseCMI));
|
|
1437
1453
|
|
|
1438
1454
|
|
|
1439
1455
|
|
|
@@ -1442,9 +1458,10 @@ var CMIScore = (function (_super) {
|
|
|
1442
1458
|
/***/ 449:
|
|
1443
1459
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1444
1460
|
|
|
1461
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1445
1462
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1446
|
-
/* harmony export */
|
|
1447
|
-
/* harmony export */
|
|
1463
|
+
/* harmony export */ checkValidFormat: function() { return /* binding */ checkValidFormat; },
|
|
1464
|
+
/* harmony export */ checkValidRange: function() { return /* binding */ checkValidRange; }
|
|
1448
1465
|
/* harmony export */ });
|
|
1449
1466
|
function checkValidFormat(value, regexPattern, errorCode, errorClass, allowEmptyString) {
|
|
1450
1467
|
if (typeof value !== "string") {
|
|
@@ -1482,10 +1499,12 @@ function checkValidRange(value, rangePattern, errorCode, errorClass) {
|
|
|
1482
1499
|
/***/ 989:
|
|
1483
1500
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1484
1501
|
|
|
1502
|
+
// ESM COMPAT FLAG
|
|
1503
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1485
1504
|
|
|
1486
1505
|
// EXPORTS
|
|
1487
1506
|
__webpack_require__.d(__webpack_exports__, {
|
|
1488
|
-
|
|
1507
|
+
CMI: function() { return /* binding */ CMI; }
|
|
1489
1508
|
});
|
|
1490
1509
|
|
|
1491
1510
|
// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs
|
|
@@ -1496,8 +1515,8 @@ var api_constants = __webpack_require__(340);
|
|
|
1496
1515
|
var error_codes = __webpack_require__(797);
|
|
1497
1516
|
// EXTERNAL MODULE: ./src/constants/regex.ts
|
|
1498
1517
|
var regex = __webpack_require__(417);
|
|
1499
|
-
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
1500
|
-
var
|
|
1518
|
+
// EXTERNAL MODULE: ./src/exceptions/scorm12_exceptions.ts
|
|
1519
|
+
var scorm12_exceptions = __webpack_require__(179);
|
|
1501
1520
|
// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts
|
|
1502
1521
|
var base_cmi = __webpack_require__(319);
|
|
1503
1522
|
// EXTERNAL MODULE: ./src/cmi/scorm12/validation.ts
|
|
@@ -1517,10 +1536,10 @@ var utilities = __webpack_require__(864);
|
|
|
1517
1536
|
|
|
1518
1537
|
|
|
1519
1538
|
var CMICore = (function (_super) {
|
|
1520
|
-
(0,tslib_es6
|
|
1539
|
+
(0,tslib_es6.__extends)(CMICore, _super);
|
|
1521
1540
|
function CMICore() {
|
|
1522
1541
|
var _this = _super.call(this) || this;
|
|
1523
|
-
_this.__children = api_constants
|
|
1542
|
+
_this.__children = api_constants.scorm12_constants.core_children;
|
|
1524
1543
|
_this._student_id = "";
|
|
1525
1544
|
_this._student_name = "";
|
|
1526
1545
|
_this._lesson_location = "";
|
|
@@ -1532,13 +1551,13 @@ var CMICore = (function (_super) {
|
|
|
1532
1551
|
_this._exit = "";
|
|
1533
1552
|
_this._session_time = "00:00:00";
|
|
1534
1553
|
_this._suspend_data = "";
|
|
1535
|
-
_this.score = new score
|
|
1536
|
-
score_children: api_constants
|
|
1537
|
-
score_range: regex
|
|
1538
|
-
invalidErrorCode: error_codes
|
|
1539
|
-
invalidTypeCode: error_codes
|
|
1540
|
-
invalidRangeCode: error_codes
|
|
1541
|
-
errorClass:
|
|
1554
|
+
_this.score = new score.CMIScore({
|
|
1555
|
+
score_children: api_constants.scorm12_constants.score_children,
|
|
1556
|
+
score_range: regex.scorm12_regex.score_range,
|
|
1557
|
+
invalidErrorCode: error_codes.scorm12_errors.INVALID_SET_VALUE,
|
|
1558
|
+
invalidTypeCode: error_codes.scorm12_errors.TYPE_MISMATCH,
|
|
1559
|
+
invalidRangeCode: error_codes.scorm12_errors.VALUE_OUT_OF_RANGE,
|
|
1560
|
+
errorClass: scorm12_exceptions.Scorm12ValidationError,
|
|
1542
1561
|
});
|
|
1543
1562
|
return _this;
|
|
1544
1563
|
}
|
|
@@ -1547,12 +1566,20 @@ var CMICore = (function (_super) {
|
|
|
1547
1566
|
_super.prototype.initialize.call(this);
|
|
1548
1567
|
(_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
1549
1568
|
};
|
|
1569
|
+
CMICore.prototype.reset = function () {
|
|
1570
|
+
var _a;
|
|
1571
|
+
this._initialized = false;
|
|
1572
|
+
this._exit = "";
|
|
1573
|
+
this._entry = "";
|
|
1574
|
+
this._session_time = "00:00:00";
|
|
1575
|
+
(_a = this.score) === null || _a === void 0 ? void 0 : _a.reset();
|
|
1576
|
+
};
|
|
1550
1577
|
Object.defineProperty(CMICore.prototype, "_children", {
|
|
1551
1578
|
get: function () {
|
|
1552
1579
|
return this.__children;
|
|
1553
1580
|
},
|
|
1554
1581
|
set: function (_children) {
|
|
1555
|
-
throw new
|
|
1582
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
1556
1583
|
},
|
|
1557
1584
|
enumerable: false,
|
|
1558
1585
|
configurable: true
|
|
@@ -1563,7 +1590,7 @@ var CMICore = (function (_super) {
|
|
|
1563
1590
|
},
|
|
1564
1591
|
set: function (student_id) {
|
|
1565
1592
|
if (this.initialized) {
|
|
1566
|
-
throw new
|
|
1593
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1567
1594
|
}
|
|
1568
1595
|
else {
|
|
1569
1596
|
this._student_id = student_id;
|
|
@@ -1578,7 +1605,7 @@ var CMICore = (function (_super) {
|
|
|
1578
1605
|
},
|
|
1579
1606
|
set: function (student_name) {
|
|
1580
1607
|
if (this.initialized) {
|
|
1581
|
-
throw new
|
|
1608
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1582
1609
|
}
|
|
1583
1610
|
else {
|
|
1584
1611
|
this._student_name = student_name;
|
|
@@ -1592,7 +1619,7 @@ var CMICore = (function (_super) {
|
|
|
1592
1619
|
return this._lesson_location;
|
|
1593
1620
|
},
|
|
1594
1621
|
set: function (lesson_location) {
|
|
1595
|
-
if ((0,validation
|
|
1622
|
+
if ((0,validation.check12ValidFormat)(lesson_location, regex.scorm12_regex.CMIString256, true)) {
|
|
1596
1623
|
this._lesson_location = lesson_location;
|
|
1597
1624
|
}
|
|
1598
1625
|
},
|
|
@@ -1605,7 +1632,7 @@ var CMICore = (function (_super) {
|
|
|
1605
1632
|
},
|
|
1606
1633
|
set: function (credit) {
|
|
1607
1634
|
if (this.initialized) {
|
|
1608
|
-
throw new
|
|
1635
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1609
1636
|
}
|
|
1610
1637
|
else {
|
|
1611
1638
|
this._credit = credit;
|
|
@@ -1620,12 +1647,12 @@ var CMICore = (function (_super) {
|
|
|
1620
1647
|
},
|
|
1621
1648
|
set: function (lesson_status) {
|
|
1622
1649
|
if (this.initialized) {
|
|
1623
|
-
if ((0,validation
|
|
1650
|
+
if ((0,validation.check12ValidFormat)(lesson_status, regex.scorm12_regex.CMIStatus)) {
|
|
1624
1651
|
this._lesson_status = lesson_status;
|
|
1625
1652
|
}
|
|
1626
1653
|
}
|
|
1627
1654
|
else {
|
|
1628
|
-
if ((0,validation
|
|
1655
|
+
if ((0,validation.check12ValidFormat)(lesson_status, regex.scorm12_regex.CMIStatus2)) {
|
|
1629
1656
|
this._lesson_status = lesson_status;
|
|
1630
1657
|
}
|
|
1631
1658
|
}
|
|
@@ -1639,7 +1666,7 @@ var CMICore = (function (_super) {
|
|
|
1639
1666
|
},
|
|
1640
1667
|
set: function (entry) {
|
|
1641
1668
|
if (this.initialized) {
|
|
1642
|
-
throw new
|
|
1669
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1643
1670
|
}
|
|
1644
1671
|
else {
|
|
1645
1672
|
this._entry = entry;
|
|
@@ -1654,7 +1681,7 @@ var CMICore = (function (_super) {
|
|
|
1654
1681
|
},
|
|
1655
1682
|
set: function (total_time) {
|
|
1656
1683
|
if (this.initialized) {
|
|
1657
|
-
throw new
|
|
1684
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1658
1685
|
}
|
|
1659
1686
|
else {
|
|
1660
1687
|
this._total_time = total_time;
|
|
@@ -1669,7 +1696,7 @@ var CMICore = (function (_super) {
|
|
|
1669
1696
|
},
|
|
1670
1697
|
set: function (lesson_mode) {
|
|
1671
1698
|
if (this.initialized) {
|
|
1672
|
-
throw new
|
|
1699
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1673
1700
|
}
|
|
1674
1701
|
else {
|
|
1675
1702
|
this._lesson_mode = lesson_mode;
|
|
@@ -1681,12 +1708,12 @@ var CMICore = (function (_super) {
|
|
|
1681
1708
|
Object.defineProperty(CMICore.prototype, "exit", {
|
|
1682
1709
|
get: function () {
|
|
1683
1710
|
if (!this.jsonString) {
|
|
1684
|
-
throw new
|
|
1711
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1685
1712
|
}
|
|
1686
1713
|
return this._exit;
|
|
1687
1714
|
},
|
|
1688
1715
|
set: function (exit) {
|
|
1689
|
-
if ((0,validation
|
|
1716
|
+
if ((0,validation.check12ValidFormat)(exit, regex.scorm12_regex.CMIExit, true)) {
|
|
1690
1717
|
this._exit = exit;
|
|
1691
1718
|
}
|
|
1692
1719
|
},
|
|
@@ -1696,12 +1723,12 @@ var CMICore = (function (_super) {
|
|
|
1696
1723
|
Object.defineProperty(CMICore.prototype, "session_time", {
|
|
1697
1724
|
get: function () {
|
|
1698
1725
|
if (!this.jsonString) {
|
|
1699
|
-
throw new
|
|
1726
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1700
1727
|
}
|
|
1701
1728
|
return this._session_time;
|
|
1702
1729
|
},
|
|
1703
1730
|
set: function (session_time) {
|
|
1704
|
-
if ((0,validation
|
|
1731
|
+
if ((0,validation.check12ValidFormat)(session_time, regex.scorm12_regex.CMITimespan)) {
|
|
1705
1732
|
this._session_time = session_time;
|
|
1706
1733
|
}
|
|
1707
1734
|
},
|
|
@@ -1713,7 +1740,7 @@ var CMICore = (function (_super) {
|
|
|
1713
1740
|
return this._suspend_data;
|
|
1714
1741
|
},
|
|
1715
1742
|
set: function (suspend_data) {
|
|
1716
|
-
if ((0,validation
|
|
1743
|
+
if ((0,validation.check12ValidFormat)(suspend_data, regex.scorm12_regex.CMIString4096, true)) {
|
|
1717
1744
|
this._suspend_data = suspend_data;
|
|
1718
1745
|
}
|
|
1719
1746
|
},
|
|
@@ -1725,9 +1752,9 @@ var CMICore = (function (_super) {
|
|
|
1725
1752
|
var startTime = start_time;
|
|
1726
1753
|
if (typeof startTime !== "undefined" && startTime !== null) {
|
|
1727
1754
|
var seconds = new Date().getTime() - startTime;
|
|
1728
|
-
sessionTime = utilities
|
|
1755
|
+
sessionTime = utilities.getSecondsAsHHMMSS(seconds / 1000);
|
|
1729
1756
|
}
|
|
1730
|
-
return utilities
|
|
1757
|
+
return utilities.addHHMMSSTimeStrings(this._total_time, sessionTime, new RegExp(regex.scorm12_regex.CMITimespan));
|
|
1731
1758
|
};
|
|
1732
1759
|
CMICore.prototype.toJSON = function () {
|
|
1733
1760
|
this.jsonString = true;
|
|
@@ -1747,7 +1774,7 @@ var CMICore = (function (_super) {
|
|
|
1747
1774
|
return result;
|
|
1748
1775
|
};
|
|
1749
1776
|
return CMICore;
|
|
1750
|
-
}(base_cmi
|
|
1777
|
+
}(base_cmi.BaseCMI));
|
|
1751
1778
|
|
|
1752
1779
|
|
|
1753
1780
|
// EXTERNAL MODULE: ./src/cmi/scorm12/objectives.ts
|
|
@@ -1772,7 +1799,7 @@ var interactions = __webpack_require__(833);
|
|
|
1772
1799
|
|
|
1773
1800
|
|
|
1774
1801
|
var CMI = (function (_super) {
|
|
1775
|
-
(0,tslib_es6
|
|
1802
|
+
(0,tslib_es6.__extends)(CMI, _super);
|
|
1776
1803
|
function CMI(cmi_children, student_data, initialized) {
|
|
1777
1804
|
var _this = _super.call(this) || this;
|
|
1778
1805
|
_this.__children = "";
|
|
@@ -1784,14 +1811,25 @@ var CMI = (function (_super) {
|
|
|
1784
1811
|
_this.initialize();
|
|
1785
1812
|
_this.__children = cmi_children
|
|
1786
1813
|
? cmi_children
|
|
1787
|
-
: api_constants
|
|
1814
|
+
: api_constants.scorm12_constants.cmi_children;
|
|
1788
1815
|
_this.core = new CMICore();
|
|
1789
|
-
_this.objectives = new objectives
|
|
1790
|
-
_this.student_data = student_data ? student_data : new scorm12_student_data
|
|
1791
|
-
_this.student_preference = new student_preference
|
|
1792
|
-
_this.interactions = new interactions
|
|
1816
|
+
_this.objectives = new objectives.CMIObjectives();
|
|
1817
|
+
_this.student_data = student_data ? student_data : new scorm12_student_data.CMIStudentData();
|
|
1818
|
+
_this.student_preference = new student_preference.CMIStudentPreference();
|
|
1819
|
+
_this.interactions = new interactions.CMIInteractions();
|
|
1793
1820
|
return _this;
|
|
1794
1821
|
}
|
|
1822
|
+
CMI.prototype.reset = function () {
|
|
1823
|
+
var _a, _b, _c;
|
|
1824
|
+
this._initialized = false;
|
|
1825
|
+
this._launch_data = "";
|
|
1826
|
+
this._comments = "";
|
|
1827
|
+
(_a = this.core) === null || _a === void 0 ? void 0 : _a.reset();
|
|
1828
|
+
this.objectives = new objectives.CMIObjectives();
|
|
1829
|
+
this.interactions = new interactions.CMIInteractions();
|
|
1830
|
+
(_b = this.student_data) === null || _b === void 0 ? void 0 : _b.reset();
|
|
1831
|
+
(_c = this.student_preference) === null || _c === void 0 ? void 0 : _c.reset();
|
|
1832
|
+
};
|
|
1795
1833
|
CMI.prototype.initialize = function () {
|
|
1796
1834
|
var _a, _b, _c, _d, _e;
|
|
1797
1835
|
_super.prototype.initialize.call(this);
|
|
@@ -1822,7 +1860,7 @@ var CMI = (function (_super) {
|
|
|
1822
1860
|
return this.__version;
|
|
1823
1861
|
},
|
|
1824
1862
|
set: function (_version) {
|
|
1825
|
-
throw new
|
|
1863
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
1826
1864
|
},
|
|
1827
1865
|
enumerable: false,
|
|
1828
1866
|
configurable: true
|
|
@@ -1832,7 +1870,7 @@ var CMI = (function (_super) {
|
|
|
1832
1870
|
return this.__children;
|
|
1833
1871
|
},
|
|
1834
1872
|
set: function (_children) {
|
|
1835
|
-
throw new
|
|
1873
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
1836
1874
|
},
|
|
1837
1875
|
enumerable: false,
|
|
1838
1876
|
configurable: true
|
|
@@ -1856,7 +1894,7 @@ var CMI = (function (_super) {
|
|
|
1856
1894
|
},
|
|
1857
1895
|
set: function (launch_data) {
|
|
1858
1896
|
if (this.initialized) {
|
|
1859
|
-
throw new
|
|
1897
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1860
1898
|
}
|
|
1861
1899
|
else {
|
|
1862
1900
|
this._launch_data = launch_data;
|
|
@@ -1870,7 +1908,7 @@ var CMI = (function (_super) {
|
|
|
1870
1908
|
return this._comments;
|
|
1871
1909
|
},
|
|
1872
1910
|
set: function (comments) {
|
|
1873
|
-
if ((0,validation
|
|
1911
|
+
if ((0,validation.check12ValidFormat)(comments, regex.scorm12_regex.CMIString4096, true)) {
|
|
1874
1912
|
this._comments = comments;
|
|
1875
1913
|
}
|
|
1876
1914
|
},
|
|
@@ -1883,7 +1921,7 @@ var CMI = (function (_super) {
|
|
|
1883
1921
|
},
|
|
1884
1922
|
set: function (comments_from_lms) {
|
|
1885
1923
|
if (this.initialized) {
|
|
1886
|
-
throw new
|
|
1924
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1887
1925
|
}
|
|
1888
1926
|
else {
|
|
1889
1927
|
this._comments_from_lms = comments_from_lms;
|
|
@@ -1896,7 +1934,7 @@ var CMI = (function (_super) {
|
|
|
1896
1934
|
return this.core.getCurrentTotalTime(this.start_time);
|
|
1897
1935
|
};
|
|
1898
1936
|
return CMI;
|
|
1899
|
-
}(base_cmi
|
|
1937
|
+
}(base_cmi.BaseRootCMI));
|
|
1900
1938
|
|
|
1901
1939
|
|
|
1902
1940
|
|
|
@@ -1905,17 +1943,18 @@ var CMI = (function (_super) {
|
|
|
1905
1943
|
/***/ 833:
|
|
1906
1944
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1907
1945
|
|
|
1946
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1908
1947
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1909
|
-
/* harmony export */
|
|
1910
|
-
/* harmony export */
|
|
1911
|
-
/* harmony export */
|
|
1912
|
-
/* harmony export */
|
|
1948
|
+
/* harmony export */ CMIInteractions: function() { return /* binding */ CMIInteractions; },
|
|
1949
|
+
/* harmony export */ CMIInteractionsCorrectResponsesObject: function() { return /* binding */ CMIInteractionsCorrectResponsesObject; },
|
|
1950
|
+
/* harmony export */ CMIInteractionsObject: function() { return /* binding */ CMIInteractionsObject; },
|
|
1951
|
+
/* harmony export */ CMIInteractionsObjectivesObject: function() { return /* binding */ CMIInteractionsObjectivesObject; }
|
|
1913
1952
|
/* harmony export */ });
|
|
1914
1953
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(635);
|
|
1915
1954
|
/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(589);
|
|
1916
1955
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
1917
1956
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(797);
|
|
1918
|
-
/* harmony import */ var
|
|
1957
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(179);
|
|
1919
1958
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(319);
|
|
1920
1959
|
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(915);
|
|
1921
1960
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(417);
|
|
@@ -1928,19 +1967,19 @@ var CMI = (function (_super) {
|
|
|
1928
1967
|
|
|
1929
1968
|
|
|
1930
1969
|
var CMIInteractions = (function (_super) {
|
|
1931
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
1970
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractions, _super);
|
|
1932
1971
|
function CMIInteractions() {
|
|
1933
1972
|
return _super.call(this, {
|
|
1934
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
1935
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__
|
|
1936
|
-
errorClass:
|
|
1973
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.interactions_children,
|
|
1974
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.INVALID_SET_VALUE,
|
|
1975
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError,
|
|
1937
1976
|
}) || this;
|
|
1938
1977
|
}
|
|
1939
1978
|
return CMIInteractions;
|
|
1940
|
-
}(_common_array__WEBPACK_IMPORTED_MODULE_0__
|
|
1979
|
+
}(_common_array__WEBPACK_IMPORTED_MODULE_0__.CMIArray));
|
|
1941
1980
|
|
|
1942
1981
|
var CMIInteractionsObject = (function (_super) {
|
|
1943
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
1982
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsObject, _super);
|
|
1944
1983
|
function CMIInteractionsObject() {
|
|
1945
1984
|
var _this = _super.call(this) || this;
|
|
1946
1985
|
_this._id = "";
|
|
@@ -1950,15 +1989,15 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1950
1989
|
_this._student_response = "";
|
|
1951
1990
|
_this._result = "";
|
|
1952
1991
|
_this._latency = "";
|
|
1953
|
-
_this.objectives = new _common_array__WEBPACK_IMPORTED_MODULE_0__
|
|
1954
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__
|
|
1955
|
-
errorClass:
|
|
1956
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
1992
|
+
_this.objectives = new _common_array__WEBPACK_IMPORTED_MODULE_0__.CMIArray({
|
|
1993
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.INVALID_SET_VALUE,
|
|
1994
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError,
|
|
1995
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.objectives_children,
|
|
1957
1996
|
});
|
|
1958
|
-
_this.correct_responses = new _common_array__WEBPACK_IMPORTED_MODULE_0__
|
|
1959
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__
|
|
1960
|
-
errorClass:
|
|
1961
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
1997
|
+
_this.correct_responses = new _common_array__WEBPACK_IMPORTED_MODULE_0__.CMIArray({
|
|
1998
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.INVALID_SET_VALUE,
|
|
1999
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError,
|
|
2000
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.correct_responses_children,
|
|
1962
2001
|
});
|
|
1963
2002
|
return _this;
|
|
1964
2003
|
}
|
|
@@ -1968,15 +2007,28 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1968
2007
|
(_a = this.objectives) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
1969
2008
|
(_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.initialize();
|
|
1970
2009
|
};
|
|
2010
|
+
CMIInteractionsObject.prototype.reset = function () {
|
|
2011
|
+
var _a, _b;
|
|
2012
|
+
this._initialized = false;
|
|
2013
|
+
this._id = "";
|
|
2014
|
+
this._time = "";
|
|
2015
|
+
this._type = "";
|
|
2016
|
+
this._weighting = "";
|
|
2017
|
+
this._student_response = "";
|
|
2018
|
+
this._result = "";
|
|
2019
|
+
this._latency = "";
|
|
2020
|
+
(_a = this.objectives) === null || _a === void 0 ? void 0 : _a.reset();
|
|
2021
|
+
(_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.reset();
|
|
2022
|
+
};
|
|
1971
2023
|
Object.defineProperty(CMIInteractionsObject.prototype, "id", {
|
|
1972
2024
|
get: function () {
|
|
1973
2025
|
if (!this.jsonString) {
|
|
1974
|
-
throw new
|
|
2026
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1975
2027
|
}
|
|
1976
2028
|
return this._id;
|
|
1977
2029
|
},
|
|
1978
2030
|
set: function (id) {
|
|
1979
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
2031
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIIdentifier)) {
|
|
1980
2032
|
this._id = id;
|
|
1981
2033
|
}
|
|
1982
2034
|
},
|
|
@@ -1986,12 +2038,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1986
2038
|
Object.defineProperty(CMIInteractionsObject.prototype, "time", {
|
|
1987
2039
|
get: function () {
|
|
1988
2040
|
if (!this.jsonString) {
|
|
1989
|
-
throw new
|
|
2041
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1990
2042
|
}
|
|
1991
2043
|
return this._time;
|
|
1992
2044
|
},
|
|
1993
2045
|
set: function (time) {
|
|
1994
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
2046
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(time, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMITime)) {
|
|
1995
2047
|
this._time = time;
|
|
1996
2048
|
}
|
|
1997
2049
|
},
|
|
@@ -2001,12 +2053,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2001
2053
|
Object.defineProperty(CMIInteractionsObject.prototype, "type", {
|
|
2002
2054
|
get: function () {
|
|
2003
2055
|
if (!this.jsonString) {
|
|
2004
|
-
throw new
|
|
2056
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
2005
2057
|
}
|
|
2006
2058
|
return this._type;
|
|
2007
2059
|
},
|
|
2008
2060
|
set: function (type) {
|
|
2009
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
2061
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(type, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIType)) {
|
|
2010
2062
|
this._type = type;
|
|
2011
2063
|
}
|
|
2012
2064
|
},
|
|
@@ -2016,13 +2068,13 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2016
2068
|
Object.defineProperty(CMIInteractionsObject.prototype, "weighting", {
|
|
2017
2069
|
get: function () {
|
|
2018
2070
|
if (!this.jsonString) {
|
|
2019
|
-
throw new
|
|
2071
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
2020
2072
|
}
|
|
2021
2073
|
return this._weighting;
|
|
2022
2074
|
},
|
|
2023
2075
|
set: function (weighting) {
|
|
2024
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
2025
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
2076
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIDecimal) &&
|
|
2077
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidRange)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.weighting_range)) {
|
|
2026
2078
|
this._weighting = weighting;
|
|
2027
2079
|
}
|
|
2028
2080
|
},
|
|
@@ -2032,12 +2084,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2032
2084
|
Object.defineProperty(CMIInteractionsObject.prototype, "student_response", {
|
|
2033
2085
|
get: function () {
|
|
2034
2086
|
if (!this.jsonString) {
|
|
2035
|
-
throw new
|
|
2087
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
2036
2088
|
}
|
|
2037
2089
|
return this._student_response;
|
|
2038
2090
|
},
|
|
2039
2091
|
set: function (student_response) {
|
|
2040
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
2092
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(student_response, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIFeedback, true)) {
|
|
2041
2093
|
this._student_response = student_response;
|
|
2042
2094
|
}
|
|
2043
2095
|
},
|
|
@@ -2047,12 +2099,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2047
2099
|
Object.defineProperty(CMIInteractionsObject.prototype, "result", {
|
|
2048
2100
|
get: function () {
|
|
2049
2101
|
if (!this.jsonString) {
|
|
2050
|
-
throw new
|
|
2102
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
2051
2103
|
}
|
|
2052
2104
|
return this._result;
|
|
2053
2105
|
},
|
|
2054
2106
|
set: function (result) {
|
|
2055
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
2107
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(result, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIResult)) {
|
|
2056
2108
|
this._result = result;
|
|
2057
2109
|
}
|
|
2058
2110
|
},
|
|
@@ -2062,12 +2114,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2062
2114
|
Object.defineProperty(CMIInteractionsObject.prototype, "latency", {
|
|
2063
2115
|
get: function () {
|
|
2064
2116
|
if (!this.jsonString) {
|
|
2065
|
-
throw new
|
|
2117
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
2066
2118
|
}
|
|
2067
2119
|
return this._latency;
|
|
2068
2120
|
},
|
|
2069
2121
|
set: function (latency) {
|
|
2070
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
2122
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(latency, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMITimespan)) {
|
|
2071
2123
|
this._latency = latency;
|
|
2072
2124
|
}
|
|
2073
2125
|
},
|
|
@@ -2091,21 +2143,25 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2091
2143
|
return result;
|
|
2092
2144
|
};
|
|
2093
2145
|
return CMIInteractionsObject;
|
|
2094
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
2146
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
2095
2147
|
|
|
2096
2148
|
var CMIInteractionsObjectivesObject = (function (_super) {
|
|
2097
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
2149
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsObjectivesObject, _super);
|
|
2098
2150
|
function CMIInteractionsObjectivesObject() {
|
|
2099
2151
|
var _this = _super.call(this) || this;
|
|
2100
2152
|
_this._id = "";
|
|
2101
2153
|
return _this;
|
|
2102
2154
|
}
|
|
2155
|
+
CMIInteractionsObjectivesObject.prototype.reset = function () {
|
|
2156
|
+
this._initialized = false;
|
|
2157
|
+
this._id = "";
|
|
2158
|
+
};
|
|
2103
2159
|
Object.defineProperty(CMIInteractionsObjectivesObject.prototype, "id", {
|
|
2104
2160
|
get: function () {
|
|
2105
2161
|
return this._id;
|
|
2106
2162
|
},
|
|
2107
2163
|
set: function (id) {
|
|
2108
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
2164
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIIdentifier)) {
|
|
2109
2165
|
this._id = id;
|
|
2110
2166
|
}
|
|
2111
2167
|
},
|
|
@@ -2121,24 +2177,28 @@ var CMIInteractionsObjectivesObject = (function (_super) {
|
|
|
2121
2177
|
return result;
|
|
2122
2178
|
};
|
|
2123
2179
|
return CMIInteractionsObjectivesObject;
|
|
2124
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
2180
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
2125
2181
|
|
|
2126
2182
|
var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
2127
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
2183
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsCorrectResponsesObject, _super);
|
|
2128
2184
|
function CMIInteractionsCorrectResponsesObject() {
|
|
2129
2185
|
var _this = _super.call(this) || this;
|
|
2130
2186
|
_this._pattern = "";
|
|
2131
2187
|
return _this;
|
|
2132
2188
|
}
|
|
2189
|
+
CMIInteractionsCorrectResponsesObject.prototype.reset = function () {
|
|
2190
|
+
this._initialized = false;
|
|
2191
|
+
this._pattern = "";
|
|
2192
|
+
};
|
|
2133
2193
|
Object.defineProperty(CMIInteractionsCorrectResponsesObject.prototype, "pattern", {
|
|
2134
2194
|
get: function () {
|
|
2135
2195
|
if (!this.jsonString) {
|
|
2136
|
-
throw new
|
|
2196
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
2137
2197
|
}
|
|
2138
2198
|
return this._pattern;
|
|
2139
2199
|
},
|
|
2140
2200
|
set: function (pattern) {
|
|
2141
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
2201
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(pattern, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIFeedback, true)) {
|
|
2142
2202
|
this._pattern = pattern;
|
|
2143
2203
|
}
|
|
2144
2204
|
},
|
|
@@ -2154,7 +2214,7 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
2154
2214
|
return result;
|
|
2155
2215
|
};
|
|
2156
2216
|
return CMIInteractionsCorrectResponsesObject;
|
|
2157
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
2217
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
2158
2218
|
|
|
2159
2219
|
|
|
2160
2220
|
|
|
@@ -2163,8 +2223,9 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
2163
2223
|
/***/ 331:
|
|
2164
2224
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2165
2225
|
|
|
2226
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2166
2227
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2167
|
-
/* harmony export */
|
|
2228
|
+
/* harmony export */ NAV: function() { return /* binding */ NAV; }
|
|
2168
2229
|
/* harmony export */ });
|
|
2169
2230
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635);
|
|
2170
2231
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
@@ -2175,18 +2236,22 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
2175
2236
|
|
|
2176
2237
|
|
|
2177
2238
|
var NAV = (function (_super) {
|
|
2178
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_3__
|
|
2239
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_3__.__extends)(NAV, _super);
|
|
2179
2240
|
function NAV() {
|
|
2180
2241
|
var _this = _super.call(this) || this;
|
|
2181
2242
|
_this._event = "";
|
|
2182
2243
|
return _this;
|
|
2183
2244
|
}
|
|
2245
|
+
NAV.prototype.reset = function () {
|
|
2246
|
+
this._event = "";
|
|
2247
|
+
this._initialized = false;
|
|
2248
|
+
};
|
|
2184
2249
|
Object.defineProperty(NAV.prototype, "event", {
|
|
2185
2250
|
get: function () {
|
|
2186
2251
|
return this._event;
|
|
2187
2252
|
},
|
|
2188
2253
|
set: function (event) {
|
|
2189
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_1__
|
|
2254
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_1__.check12ValidFormat)(event, _constants_regex__WEBPACK_IMPORTED_MODULE_2__.scorm12_regex.NAVEvent)) {
|
|
2190
2255
|
this._event = event;
|
|
2191
2256
|
}
|
|
2192
2257
|
},
|
|
@@ -2202,7 +2267,7 @@ var NAV = (function (_super) {
|
|
|
2202
2267
|
return result;
|
|
2203
2268
|
};
|
|
2204
2269
|
return NAV;
|
|
2205
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
2270
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
2206
2271
|
|
|
2207
2272
|
|
|
2208
2273
|
|
|
@@ -2211,9 +2276,10 @@ var NAV = (function (_super) {
|
|
|
2211
2276
|
/***/ 176:
|
|
2212
2277
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2213
2278
|
|
|
2279
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2214
2280
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2215
|
-
/* harmony export */
|
|
2216
|
-
/* harmony export */
|
|
2281
|
+
/* harmony export */ CMIObjectives: function() { return /* binding */ CMIObjectives; },
|
|
2282
|
+
/* harmony export */ CMIObjectivesObject: function() { return /* binding */ CMIObjectivesObject; }
|
|
2217
2283
|
/* harmony export */ });
|
|
2218
2284
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(635);
|
|
2219
2285
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
@@ -2221,7 +2287,7 @@ var NAV = (function (_super) {
|
|
|
2221
2287
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(340);
|
|
2222
2288
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(417);
|
|
2223
2289
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(797);
|
|
2224
|
-
/* harmony import */ var
|
|
2290
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(179);
|
|
2225
2291
|
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(915);
|
|
2226
2292
|
/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(589);
|
|
2227
2293
|
|
|
@@ -2234,39 +2300,46 @@ var NAV = (function (_super) {
|
|
|
2234
2300
|
|
|
2235
2301
|
|
|
2236
2302
|
var CMIObjectives = (function (_super) {
|
|
2237
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_8__
|
|
2303
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_8__.__extends)(CMIObjectives, _super);
|
|
2238
2304
|
function CMIObjectives() {
|
|
2239
2305
|
return _super.call(this, {
|
|
2240
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2241
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
2242
|
-
errorClass:
|
|
2306
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.objectives_children,
|
|
2307
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.INVALID_SET_VALUE,
|
|
2308
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_5__.Scorm12ValidationError,
|
|
2243
2309
|
}) || this;
|
|
2244
2310
|
}
|
|
2245
2311
|
return CMIObjectives;
|
|
2246
|
-
}(_common_array__WEBPACK_IMPORTED_MODULE_7__
|
|
2312
|
+
}(_common_array__WEBPACK_IMPORTED_MODULE_7__.CMIArray));
|
|
2247
2313
|
|
|
2248
2314
|
var CMIObjectivesObject = (function (_super) {
|
|
2249
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_8__
|
|
2315
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_8__.__extends)(CMIObjectivesObject, _super);
|
|
2250
2316
|
function CMIObjectivesObject() {
|
|
2251
2317
|
var _this = _super.call(this) || this;
|
|
2252
2318
|
_this._id = "";
|
|
2253
2319
|
_this._status = "";
|
|
2254
|
-
_this.score = new _common_score__WEBPACK_IMPORTED_MODULE_1__
|
|
2255
|
-
score_children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2256
|
-
score_range: _constants_regex__WEBPACK_IMPORTED_MODULE_3__
|
|
2257
|
-
invalidErrorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
2258
|
-
invalidTypeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
2259
|
-
invalidRangeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
2260
|
-
errorClass:
|
|
2320
|
+
_this.score = new _common_score__WEBPACK_IMPORTED_MODULE_1__.CMIScore({
|
|
2321
|
+
score_children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.score_children,
|
|
2322
|
+
score_range: _constants_regex__WEBPACK_IMPORTED_MODULE_3__.scorm12_regex.score_range,
|
|
2323
|
+
invalidErrorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.INVALID_SET_VALUE,
|
|
2324
|
+
invalidTypeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.TYPE_MISMATCH,
|
|
2325
|
+
invalidRangeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.VALUE_OUT_OF_RANGE,
|
|
2326
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_5__.Scorm12ValidationError,
|
|
2261
2327
|
});
|
|
2262
2328
|
return _this;
|
|
2263
2329
|
}
|
|
2330
|
+
CMIObjectivesObject.prototype.reset = function () {
|
|
2331
|
+
var _a;
|
|
2332
|
+
this._initialized = false;
|
|
2333
|
+
this._id = "";
|
|
2334
|
+
this._status = "";
|
|
2335
|
+
(_a = this.score) === null || _a === void 0 ? void 0 : _a.reset();
|
|
2336
|
+
};
|
|
2264
2337
|
Object.defineProperty(CMIObjectivesObject.prototype, "id", {
|
|
2265
2338
|
get: function () {
|
|
2266
2339
|
return this._id;
|
|
2267
2340
|
},
|
|
2268
2341
|
set: function (id) {
|
|
2269
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__
|
|
2342
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__.check12ValidFormat)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_3__.scorm12_regex.CMIIdentifier)) {
|
|
2270
2343
|
this._id = id;
|
|
2271
2344
|
}
|
|
2272
2345
|
},
|
|
@@ -2278,7 +2351,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2278
2351
|
return this._status;
|
|
2279
2352
|
},
|
|
2280
2353
|
set: function (status) {
|
|
2281
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__
|
|
2354
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__.check12ValidFormat)(status, _constants_regex__WEBPACK_IMPORTED_MODULE_3__.scorm12_regex.CMIStatus2)) {
|
|
2282
2355
|
this._status = status;
|
|
2283
2356
|
}
|
|
2284
2357
|
},
|
|
@@ -2296,7 +2369,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2296
2369
|
return result;
|
|
2297
2370
|
};
|
|
2298
2371
|
return CMIObjectivesObject;
|
|
2299
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
2372
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
2300
2373
|
|
|
2301
2374
|
|
|
2302
2375
|
|
|
@@ -2305,13 +2378,14 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2305
2378
|
/***/ 532:
|
|
2306
2379
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2307
2380
|
|
|
2381
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2308
2382
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2309
|
-
/* harmony export */
|
|
2383
|
+
/* harmony export */ CMIStudentData: function() { return /* binding */ CMIStudentData; }
|
|
2310
2384
|
/* harmony export */ });
|
|
2311
2385
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635);
|
|
2312
2386
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
2313
2387
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
2314
|
-
/* harmony import */ var
|
|
2388
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(179);
|
|
2315
2389
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797);
|
|
2316
2390
|
|
|
2317
2391
|
|
|
@@ -2319,7 +2393,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2319
2393
|
|
|
2320
2394
|
|
|
2321
2395
|
var CMIStudentData = (function (_super) {
|
|
2322
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_4__
|
|
2396
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_4__.__extends)(CMIStudentData, _super);
|
|
2323
2397
|
function CMIStudentData(student_data_children) {
|
|
2324
2398
|
var _this = _super.call(this) || this;
|
|
2325
2399
|
_this._mastery_score = "";
|
|
@@ -2327,15 +2401,18 @@ var CMIStudentData = (function (_super) {
|
|
|
2327
2401
|
_this._time_limit_action = "";
|
|
2328
2402
|
_this.__children = student_data_children
|
|
2329
2403
|
? student_data_children
|
|
2330
|
-
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
2404
|
+
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.student_data_children;
|
|
2331
2405
|
return _this;
|
|
2332
2406
|
}
|
|
2407
|
+
CMIStudentData.prototype.reset = function () {
|
|
2408
|
+
this._initialized = false;
|
|
2409
|
+
};
|
|
2333
2410
|
Object.defineProperty(CMIStudentData.prototype, "_children", {
|
|
2334
2411
|
get: function () {
|
|
2335
2412
|
return this.__children;
|
|
2336
2413
|
},
|
|
2337
2414
|
set: function (_children) {
|
|
2338
|
-
throw new
|
|
2415
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.INVALID_SET_VALUE);
|
|
2339
2416
|
},
|
|
2340
2417
|
enumerable: false,
|
|
2341
2418
|
configurable: true
|
|
@@ -2346,7 +2423,7 @@ var CMIStudentData = (function (_super) {
|
|
|
2346
2423
|
},
|
|
2347
2424
|
set: function (mastery_score) {
|
|
2348
2425
|
if (this.initialized) {
|
|
2349
|
-
throw new
|
|
2426
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.READ_ONLY_ELEMENT);
|
|
2350
2427
|
}
|
|
2351
2428
|
else {
|
|
2352
2429
|
this._mastery_score = mastery_score;
|
|
@@ -2361,7 +2438,7 @@ var CMIStudentData = (function (_super) {
|
|
|
2361
2438
|
},
|
|
2362
2439
|
set: function (max_time_allowed) {
|
|
2363
2440
|
if (this.initialized) {
|
|
2364
|
-
throw new
|
|
2441
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.READ_ONLY_ELEMENT);
|
|
2365
2442
|
}
|
|
2366
2443
|
else {
|
|
2367
2444
|
this._max_time_allowed = max_time_allowed;
|
|
@@ -2376,7 +2453,7 @@ var CMIStudentData = (function (_super) {
|
|
|
2376
2453
|
},
|
|
2377
2454
|
set: function (time_limit_action) {
|
|
2378
2455
|
if (this.initialized) {
|
|
2379
|
-
throw new
|
|
2456
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.READ_ONLY_ELEMENT);
|
|
2380
2457
|
}
|
|
2381
2458
|
else {
|
|
2382
2459
|
this._time_limit_action = time_limit_action;
|
|
@@ -2396,7 +2473,7 @@ var CMIStudentData = (function (_super) {
|
|
|
2396
2473
|
return result;
|
|
2397
2474
|
};
|
|
2398
2475
|
return CMIStudentData;
|
|
2399
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
2476
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
2400
2477
|
|
|
2401
2478
|
|
|
2402
2479
|
|
|
@@ -2405,16 +2482,17 @@ var CMIStudentData = (function (_super) {
|
|
|
2405
2482
|
/***/ 181:
|
|
2406
2483
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2407
2484
|
|
|
2485
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2408
2486
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2409
|
-
/* harmony export */
|
|
2487
|
+
/* harmony export */ CMIStudentPreference: function() { return /* binding */ CMIStudentPreference; }
|
|
2410
2488
|
/* harmony export */ });
|
|
2411
2489
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(635);
|
|
2412
2490
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
2413
2491
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
2414
|
-
/* harmony import */ var
|
|
2415
|
-
/* harmony import */ var
|
|
2416
|
-
/* harmony import */ var
|
|
2417
|
-
/* harmony import */ var
|
|
2492
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(179);
|
|
2493
|
+
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(915);
|
|
2494
|
+
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(417);
|
|
2495
|
+
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(797);
|
|
2418
2496
|
|
|
2419
2497
|
|
|
2420
2498
|
|
|
@@ -2423,7 +2501,7 @@ var CMIStudentData = (function (_super) {
|
|
|
2423
2501
|
|
|
2424
2502
|
|
|
2425
2503
|
var CMIStudentPreference = (function (_super) {
|
|
2426
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_6__
|
|
2504
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_6__.__extends)(CMIStudentPreference, _super);
|
|
2427
2505
|
function CMIStudentPreference(student_preference_children) {
|
|
2428
2506
|
var _this = _super.call(this) || this;
|
|
2429
2507
|
_this._audio = "";
|
|
@@ -2432,15 +2510,18 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2432
2510
|
_this._text = "";
|
|
2433
2511
|
_this.__children = student_preference_children
|
|
2434
2512
|
? student_preference_children
|
|
2435
|
-
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
2513
|
+
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.student_preference_children;
|
|
2436
2514
|
return _this;
|
|
2437
2515
|
}
|
|
2516
|
+
CMIStudentPreference.prototype.reset = function () {
|
|
2517
|
+
this._initialized = false;
|
|
2518
|
+
};
|
|
2438
2519
|
Object.defineProperty(CMIStudentPreference.prototype, "_children", {
|
|
2439
2520
|
get: function () {
|
|
2440
2521
|
return this.__children;
|
|
2441
2522
|
},
|
|
2442
2523
|
set: function (_children) {
|
|
2443
|
-
throw new
|
|
2524
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_5__.scorm12_errors.INVALID_SET_VALUE);
|
|
2444
2525
|
},
|
|
2445
2526
|
enumerable: false,
|
|
2446
2527
|
configurable: true
|
|
@@ -2450,8 +2531,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2450
2531
|
return this._audio;
|
|
2451
2532
|
},
|
|
2452
2533
|
set: function (audio) {
|
|
2453
|
-
if ((0,
|
|
2454
|
-
(0,
|
|
2534
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMISInteger) &&
|
|
2535
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidRange)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.audio_range)) {
|
|
2455
2536
|
this._audio = audio;
|
|
2456
2537
|
}
|
|
2457
2538
|
},
|
|
@@ -2463,7 +2544,7 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2463
2544
|
return this._language;
|
|
2464
2545
|
},
|
|
2465
2546
|
set: function (language) {
|
|
2466
|
-
if ((0,
|
|
2547
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(language, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMIString256)) {
|
|
2467
2548
|
this._language = language;
|
|
2468
2549
|
}
|
|
2469
2550
|
},
|
|
@@ -2475,8 +2556,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2475
2556
|
return this._speed;
|
|
2476
2557
|
},
|
|
2477
2558
|
set: function (speed) {
|
|
2478
|
-
if ((0,
|
|
2479
|
-
(0,
|
|
2559
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMISInteger) &&
|
|
2560
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidRange)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.speed_range)) {
|
|
2480
2561
|
this._speed = speed;
|
|
2481
2562
|
}
|
|
2482
2563
|
},
|
|
@@ -2488,8 +2569,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2488
2569
|
return this._text;
|
|
2489
2570
|
},
|
|
2490
2571
|
set: function (text) {
|
|
2491
|
-
if ((0,
|
|
2492
|
-
(0,
|
|
2572
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMISInteger) &&
|
|
2573
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidRange)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.text_range)) {
|
|
2493
2574
|
this._text = text;
|
|
2494
2575
|
}
|
|
2495
2576
|
},
|
|
@@ -2508,7 +2589,7 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2508
2589
|
return result;
|
|
2509
2590
|
};
|
|
2510
2591
|
return CMIStudentPreference;
|
|
2511
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
2592
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
2512
2593
|
|
|
2513
2594
|
|
|
2514
2595
|
|
|
@@ -2517,24 +2598,25 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2517
2598
|
/***/ 915:
|
|
2518
2599
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2519
2600
|
|
|
2601
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2520
2602
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2521
|
-
/* harmony export */
|
|
2522
|
-
/* harmony export */
|
|
2603
|
+
/* harmony export */ check12ValidFormat: function() { return /* binding */ check12ValidFormat; },
|
|
2604
|
+
/* harmony export */ check12ValidRange: function() { return /* binding */ check12ValidRange; }
|
|
2523
2605
|
/* harmony export */ });
|
|
2524
2606
|
/* harmony import */ var _common_validation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(449);
|
|
2525
2607
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(797);
|
|
2526
|
-
/* harmony import */ var
|
|
2608
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(179);
|
|
2527
2609
|
|
|
2528
2610
|
|
|
2529
2611
|
|
|
2530
2612
|
function check12ValidFormat(value, regexPattern, allowEmptyString) {
|
|
2531
|
-
return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__
|
|
2613
|
+
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);
|
|
2532
2614
|
}
|
|
2533
2615
|
function check12ValidRange(value, rangePattern, allowEmptyString) {
|
|
2534
2616
|
if (!allowEmptyString && value === "") {
|
|
2535
|
-
throw new
|
|
2617
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_1__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_0__.scorm12_errors.VALUE_OUT_OF_RANGE);
|
|
2536
2618
|
}
|
|
2537
|
-
return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__
|
|
2619
|
+
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);
|
|
2538
2620
|
}
|
|
2539
2621
|
|
|
2540
2622
|
|
|
@@ -2543,16 +2625,23 @@ function check12ValidRange(value, rangePattern, allowEmptyString) {
|
|
|
2543
2625
|
/***/ 340:
|
|
2544
2626
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2545
2627
|
|
|
2628
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2629
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2630
|
+
/* harmony export */ aicc_constants: function() { return /* binding */ aicc_constants; },
|
|
2631
|
+
/* harmony export */ global_constants: function() { return /* binding */ global_constants; },
|
|
2632
|
+
/* harmony export */ scorm12_constants: function() { return /* binding */ scorm12_constants; },
|
|
2633
|
+
/* harmony export */ scorm2004_constants: function() { return /* binding */ scorm2004_constants; }
|
|
2634
|
+
/* harmony export */ });
|
|
2546
2635
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
2547
2636
|
|
|
2548
|
-
var
|
|
2637
|
+
var global_constants = {
|
|
2549
2638
|
SCORM_TRUE: "true",
|
|
2550
2639
|
SCORM_FALSE: "false",
|
|
2551
2640
|
STATE_NOT_INITIALIZED: 0,
|
|
2552
2641
|
STATE_INITIALIZED: 1,
|
|
2553
2642
|
STATE_TERMINATED: 2,
|
|
2554
2643
|
};
|
|
2555
|
-
var
|
|
2644
|
+
var scorm12_constants = {
|
|
2556
2645
|
cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",
|
|
2557
2646
|
core_children: "student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",
|
|
2558
2647
|
score_children: "raw,min,max",
|
|
@@ -2613,7 +2702,7 @@ var scorm12 = {
|
|
|
2613
2702
|
},
|
|
2614
2703
|
},
|
|
2615
2704
|
};
|
|
2616
|
-
var
|
|
2705
|
+
var aicc_constants = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, scorm12_constants), {
|
|
2617
2706
|
cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",
|
|
2618
2707
|
student_preference_children: "audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",
|
|
2619
2708
|
student_data_children: "attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",
|
|
@@ -2622,7 +2711,7 @@ var aicc = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__W
|
|
|
2622
2711
|
attempt_records_children: "score,lesson_status",
|
|
2623
2712
|
paths_children: "location_id,date,time,status,why_left,time_in_element",
|
|
2624
2713
|
});
|
|
2625
|
-
var
|
|
2714
|
+
var scorm2004_constants = {
|
|
2626
2715
|
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",
|
|
2627
2716
|
comments_children: "comment,timestamp,location",
|
|
2628
2717
|
score_children: "max,raw,scaled,min",
|
|
@@ -2631,6 +2720,7 @@ var scorm2004 = {
|
|
|
2631
2720
|
student_data_children: "mastery_score,max_time_allowed,time_limit_action",
|
|
2632
2721
|
student_preference_children: "audio_level,audio_captioning,delivery_speed,language",
|
|
2633
2722
|
interactions_children: "id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",
|
|
2723
|
+
adl_data_children: "id,store",
|
|
2634
2724
|
error_descriptions: {
|
|
2635
2725
|
"0": {
|
|
2636
2726
|
basicMessage: "No Error",
|
|
@@ -2738,13 +2828,6 @@ var scorm2004 = {
|
|
|
2738
2828
|
},
|
|
2739
2829
|
},
|
|
2740
2830
|
};
|
|
2741
|
-
var APIConstants = {
|
|
2742
|
-
global: global,
|
|
2743
|
-
scorm12: scorm12,
|
|
2744
|
-
aicc: aicc,
|
|
2745
|
-
scorm2004: scorm2004,
|
|
2746
|
-
};
|
|
2747
|
-
/* harmony default export */ __webpack_exports__.A = (APIConstants);
|
|
2748
2831
|
|
|
2749
2832
|
|
|
2750
2833
|
/***/ }),
|
|
@@ -2752,12 +2835,13 @@ var APIConstants = {
|
|
|
2752
2835
|
/***/ 56:
|
|
2753
2836
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2754
2837
|
|
|
2838
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2755
2839
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2756
|
-
/* harmony export */
|
|
2757
|
-
/* harmony export */
|
|
2758
|
-
/* harmony export */
|
|
2840
|
+
/* harmony export */ CompletionStatus: function() { return /* binding */ CompletionStatus; },
|
|
2841
|
+
/* harmony export */ LogLevelEnum: function() { return /* binding */ LogLevelEnum; },
|
|
2842
|
+
/* harmony export */ NAVBoolean: function() { return /* binding */ NAVBoolean; },
|
|
2843
|
+
/* harmony export */ SuccessStatus: function() { return /* binding */ SuccessStatus; }
|
|
2759
2844
|
/* harmony export */ });
|
|
2760
|
-
/* unused harmony export NAVBoolean */
|
|
2761
2845
|
var NAVBoolean;
|
|
2762
2846
|
(function (NAVBoolean) {
|
|
2763
2847
|
NAVBoolean["unknown"] = "unknown";
|
|
@@ -2792,9 +2876,15 @@ var LogLevelEnum;
|
|
|
2792
2876
|
/***/ 797:
|
|
2793
2877
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2794
2878
|
|
|
2879
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2880
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2881
|
+
/* harmony export */ global_errors: function() { return /* binding */ global_errors; },
|
|
2882
|
+
/* harmony export */ scorm12_errors: function() { return /* binding */ scorm12_errors; },
|
|
2883
|
+
/* harmony export */ scorm2004_errors: function() { return /* binding */ scorm2004_errors; }
|
|
2884
|
+
/* harmony export */ });
|
|
2795
2885
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
2796
2886
|
|
|
2797
|
-
var
|
|
2887
|
+
var global_errors = {
|
|
2798
2888
|
GENERAL: 101,
|
|
2799
2889
|
INITIALIZATION_FAILED: 101,
|
|
2800
2890
|
INITIALIZED: 101,
|
|
@@ -2824,13 +2914,8 @@ var global = {
|
|
|
2824
2914
|
VALUE_OUT_OF_RANGE: 101,
|
|
2825
2915
|
DEPENDENCY_NOT_ESTABLISHED: 101,
|
|
2826
2916
|
};
|
|
2827
|
-
var
|
|
2828
|
-
var
|
|
2829
|
-
var ErrorCodes = {
|
|
2830
|
-
scorm12: scorm12,
|
|
2831
|
-
scorm2004: scorm2004,
|
|
2832
|
-
};
|
|
2833
|
-
/* harmony default export */ __webpack_exports__.A = (ErrorCodes);
|
|
2917
|
+
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 });
|
|
2918
|
+
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 });
|
|
2834
2919
|
|
|
2835
2920
|
|
|
2836
2921
|
/***/ }),
|
|
@@ -2838,9 +2923,15 @@ var ErrorCodes = {
|
|
|
2838
2923
|
/***/ 417:
|
|
2839
2924
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2840
2925
|
|
|
2926
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2927
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2928
|
+
/* harmony export */ aicc_regex: function() { return /* binding */ aicc_regex; },
|
|
2929
|
+
/* harmony export */ scorm12_regex: function() { return /* binding */ scorm12_regex; },
|
|
2930
|
+
/* harmony export */ scorm2004_regex: function() { return /* binding */ scorm2004_regex; }
|
|
2931
|
+
/* harmony export */ });
|
|
2841
2932
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
2842
2933
|
|
|
2843
|
-
var
|
|
2934
|
+
var scorm12_regex = {
|
|
2844
2935
|
CMIString256: "^.{0,255}$",
|
|
2845
2936
|
CMIString4096: "^.{0,4096}$",
|
|
2846
2937
|
CMITime: "^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",
|
|
@@ -2863,10 +2954,10 @@ var scorm12 = {
|
|
|
2863
2954
|
weighting_range: "-100#100",
|
|
2864
2955
|
text_range: "-1#1",
|
|
2865
2956
|
};
|
|
2866
|
-
var
|
|
2957
|
+
var aicc_regex = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, scorm12_regex), {
|
|
2867
2958
|
CMIIdentifier: "^\\w{1,255}$",
|
|
2868
2959
|
});
|
|
2869
|
-
var
|
|
2960
|
+
var scorm2004_regex = {
|
|
2870
2961
|
CMIString200: "^[\\u0000-\\uFFFF]{0,200}$",
|
|
2871
2962
|
CMIString250: "^[\\u0000-\\uFFFF]{0,250}$",
|
|
2872
2963
|
CMIString1000: "^[\\u0000-\\uFFFF]{0,1000}$",
|
|
@@ -2902,12 +2993,6 @@ var scorm2004 = {
|
|
|
2902
2993
|
text_range: "-1#1",
|
|
2903
2994
|
progress_range: "0#1",
|
|
2904
2995
|
};
|
|
2905
|
-
var Regex = {
|
|
2906
|
-
aicc: aicc,
|
|
2907
|
-
scorm12: scorm12,
|
|
2908
|
-
scorm2004: scorm2004,
|
|
2909
|
-
};
|
|
2910
|
-
/* harmony default export */ __webpack_exports__.A = (Regex);
|
|
2911
2996
|
|
|
2912
2997
|
|
|
2913
2998
|
/***/ }),
|
|
@@ -2915,22 +3000,15 @@ var Regex = {
|
|
|
2915
3000
|
/***/ 784:
|
|
2916
3001
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2917
3002
|
|
|
3003
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2918
3004
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2919
|
-
/* harmony export */
|
|
2920
|
-
/* harmony export */
|
|
2921
|
-
/* harmony export */ tQ: function() { return /* binding */ Scorm12ValidationError; },
|
|
2922
|
-
/* harmony export */ yI: function() { return /* binding */ ValidationError; }
|
|
3005
|
+
/* harmony export */ BaseScormValidationError: function() { return /* binding */ BaseScormValidationError; },
|
|
3006
|
+
/* harmony export */ ValidationError: function() { return /* binding */ ValidationError; }
|
|
2923
3007
|
/* harmony export */ });
|
|
2924
|
-
/*
|
|
2925
|
-
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(635);
|
|
2926
|
-
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340);
|
|
2927
|
-
|
|
3008
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
2928
3009
|
|
|
2929
|
-
var scorm12_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.error_descriptions;
|
|
2930
|
-
var aicc_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.aicc.error_descriptions;
|
|
2931
|
-
var scorm2004_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm2004.error_descriptions;
|
|
2932
3010
|
var BaseScormValidationError = (function (_super) {
|
|
2933
|
-
(0,
|
|
3011
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(BaseScormValidationError, _super);
|
|
2934
3012
|
function BaseScormValidationError(errorCode) {
|
|
2935
3013
|
var _this = _super.call(this, errorCode.toString()) || this;
|
|
2936
3014
|
_this._errorCode = errorCode;
|
|
@@ -2948,7 +3026,7 @@ var BaseScormValidationError = (function (_super) {
|
|
|
2948
3026
|
}(Error));
|
|
2949
3027
|
|
|
2950
3028
|
var ValidationError = (function (_super) {
|
|
2951
|
-
(0,
|
|
3029
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(ValidationError, _super);
|
|
2952
3030
|
function ValidationError(errorCode, errorMessage, detailedMessage) {
|
|
2953
3031
|
var _this = _super.call(this, errorCode) || this;
|
|
2954
3032
|
_this._detailedMessage = "";
|
|
@@ -2976,8 +3054,26 @@ var ValidationError = (function (_super) {
|
|
|
2976
3054
|
return ValidationError;
|
|
2977
3055
|
}(BaseScormValidationError));
|
|
2978
3056
|
|
|
3057
|
+
|
|
3058
|
+
|
|
3059
|
+
/***/ }),
|
|
3060
|
+
|
|
3061
|
+
/***/ 179:
|
|
3062
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
3063
|
+
|
|
3064
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3065
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3066
|
+
/* harmony export */ Scorm12ValidationError: function() { return /* binding */ Scorm12ValidationError; }
|
|
3067
|
+
/* harmony export */ });
|
|
3068
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(635);
|
|
3069
|
+
/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(784);
|
|
3070
|
+
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
3071
|
+
|
|
3072
|
+
|
|
3073
|
+
|
|
3074
|
+
var scorm12_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.error_descriptions;
|
|
2979
3075
|
var Scorm12ValidationError = (function (_super) {
|
|
2980
|
-
(0,
|
|
3076
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_2__.__extends)(Scorm12ValidationError, _super);
|
|
2981
3077
|
function Scorm12ValidationError(errorCode) {
|
|
2982
3078
|
var _this = this;
|
|
2983
3079
|
if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {
|
|
@@ -2989,37 +3085,7 @@ var Scorm12ValidationError = (function (_super) {
|
|
|
2989
3085
|
return _this;
|
|
2990
3086
|
}
|
|
2991
3087
|
return Scorm12ValidationError;
|
|
2992
|
-
}(ValidationError));
|
|
2993
|
-
|
|
2994
|
-
var AICCValidationError = (function (_super) {
|
|
2995
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(AICCValidationError, _super);
|
|
2996
|
-
function AICCValidationError(errorCode) {
|
|
2997
|
-
var _this = this;
|
|
2998
|
-
if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {
|
|
2999
|
-
_this = _super.call(this, errorCode, aicc_errors[String(errorCode)].basicMessage, aicc_errors[String(errorCode)].detailMessage) || this;
|
|
3000
|
-
}
|
|
3001
|
-
else {
|
|
3002
|
-
_this = _super.call(this, 101, aicc_errors["101"].basicMessage, aicc_errors["101"].detailMessage) || this;
|
|
3003
|
-
}
|
|
3004
|
-
return _this;
|
|
3005
|
-
}
|
|
3006
|
-
return AICCValidationError;
|
|
3007
|
-
}(ValidationError));
|
|
3008
|
-
|
|
3009
|
-
var Scorm2004ValidationError = (function (_super) {
|
|
3010
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(Scorm2004ValidationError, _super);
|
|
3011
|
-
function Scorm2004ValidationError(errorCode) {
|
|
3012
|
-
var _this = this;
|
|
3013
|
-
if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {
|
|
3014
|
-
_this = _super.call(this, errorCode, scorm2004_errors[String(errorCode)].basicMessage, scorm2004_errors[String(errorCode)].detailMessage) || this;
|
|
3015
|
-
}
|
|
3016
|
-
else {
|
|
3017
|
-
_this = _super.call(this, 101, scorm2004_errors["101"].basicMessage, scorm2004_errors["101"].detailMessage) || this;
|
|
3018
|
-
}
|
|
3019
|
-
return _this;
|
|
3020
|
-
}
|
|
3021
|
-
return Scorm2004ValidationError;
|
|
3022
|
-
}(ValidationError));
|
|
3088
|
+
}(_exceptions__WEBPACK_IMPORTED_MODULE_0__.ValidationError));
|
|
3023
3089
|
|
|
3024
3090
|
|
|
3025
3091
|
|
|
@@ -3028,16 +3094,24 @@ var Scorm2004ValidationError = (function (_super) {
|
|
|
3028
3094
|
/***/ 864:
|
|
3029
3095
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
3030
3096
|
|
|
3097
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3031
3098
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3032
|
-
/* harmony export */
|
|
3033
|
-
/* harmony export */
|
|
3034
|
-
/* harmony export */
|
|
3035
|
-
/* harmony export */
|
|
3036
|
-
/* harmony export */
|
|
3037
|
-
/* harmony export */
|
|
3038
|
-
/* harmony export */
|
|
3099
|
+
/* harmony export */ SECONDS_PER_DAY: function() { return /* binding */ SECONDS_PER_DAY; },
|
|
3100
|
+
/* harmony export */ SECONDS_PER_HOUR: function() { return /* binding */ SECONDS_PER_HOUR; },
|
|
3101
|
+
/* harmony export */ SECONDS_PER_MINUTE: function() { return /* binding */ SECONDS_PER_MINUTE; },
|
|
3102
|
+
/* harmony export */ SECONDS_PER_SECOND: function() { return /* binding */ SECONDS_PER_SECOND; },
|
|
3103
|
+
/* harmony export */ addHHMMSSTimeStrings: function() { return /* binding */ addHHMMSSTimeStrings; },
|
|
3104
|
+
/* harmony export */ addTwoDurations: function() { return /* binding */ addTwoDurations; },
|
|
3105
|
+
/* harmony export */ countDecimals: function() { return /* binding */ countDecimals; },
|
|
3106
|
+
/* harmony export */ flatten: function() { return /* binding */ flatten; },
|
|
3107
|
+
/* harmony export */ formatMessage: function() { return /* binding */ formatMessage; },
|
|
3108
|
+
/* harmony export */ getDurationAsSeconds: function() { return /* binding */ getDurationAsSeconds; },
|
|
3109
|
+
/* harmony export */ getSecondsAsHHMMSS: function() { return /* binding */ getSecondsAsHHMMSS; },
|
|
3110
|
+
/* harmony export */ getSecondsAsISODuration: function() { return /* binding */ getSecondsAsISODuration; },
|
|
3111
|
+
/* harmony export */ getTimeAsSeconds: function() { return /* binding */ getTimeAsSeconds; },
|
|
3112
|
+
/* harmony export */ stringMatches: function() { return /* binding */ stringMatches; },
|
|
3113
|
+
/* harmony export */ unflatten: function() { return /* binding */ unflatten; }
|
|
3039
3114
|
/* harmony export */ });
|
|
3040
|
-
/* unused harmony exports SECONDS_PER_SECOND, SECONDS_PER_MINUTE, SECONDS_PER_HOUR, SECONDS_PER_DAY, getSecondsAsISODuration, getDurationAsSeconds, addTwoDurations, countDecimals */
|
|
3041
3115
|
var SECONDS_PER_SECOND = 1.0;
|
|
3042
3116
|
var SECONDS_PER_MINUTE = 60;
|
|
3043
3117
|
var SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;
|
|
@@ -3229,13 +3303,40 @@ function stringMatches(str, tester) {
|
|
|
3229
3303
|
/***/ 635:
|
|
3230
3304
|
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
3231
3305
|
|
|
3306
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3232
3307
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3233
|
-
/* harmony export */
|
|
3234
|
-
/* harmony export */
|
|
3235
|
-
/* harmony export */
|
|
3236
|
-
/* harmony export */
|
|
3308
|
+
/* harmony export */ __addDisposableResource: function() { return /* binding */ __addDisposableResource; },
|
|
3309
|
+
/* harmony export */ __assign: function() { return /* binding */ __assign; },
|
|
3310
|
+
/* harmony export */ __asyncDelegator: function() { return /* binding */ __asyncDelegator; },
|
|
3311
|
+
/* harmony export */ __asyncGenerator: function() { return /* binding */ __asyncGenerator; },
|
|
3312
|
+
/* harmony export */ __asyncValues: function() { return /* binding */ __asyncValues; },
|
|
3313
|
+
/* harmony export */ __await: function() { return /* binding */ __await; },
|
|
3314
|
+
/* harmony export */ __awaiter: function() { return /* binding */ __awaiter; },
|
|
3315
|
+
/* harmony export */ __classPrivateFieldGet: function() { return /* binding */ __classPrivateFieldGet; },
|
|
3316
|
+
/* harmony export */ __classPrivateFieldIn: function() { return /* binding */ __classPrivateFieldIn; },
|
|
3317
|
+
/* harmony export */ __classPrivateFieldSet: function() { return /* binding */ __classPrivateFieldSet; },
|
|
3318
|
+
/* harmony export */ __createBinding: function() { return /* binding */ __createBinding; },
|
|
3319
|
+
/* harmony export */ __decorate: function() { return /* binding */ __decorate; },
|
|
3320
|
+
/* harmony export */ __disposeResources: function() { return /* binding */ __disposeResources; },
|
|
3321
|
+
/* harmony export */ __esDecorate: function() { return /* binding */ __esDecorate; },
|
|
3322
|
+
/* harmony export */ __exportStar: function() { return /* binding */ __exportStar; },
|
|
3323
|
+
/* harmony export */ __extends: function() { return /* binding */ __extends; },
|
|
3324
|
+
/* harmony export */ __generator: function() { return /* binding */ __generator; },
|
|
3325
|
+
/* harmony export */ __importDefault: function() { return /* binding */ __importDefault; },
|
|
3326
|
+
/* harmony export */ __importStar: function() { return /* binding */ __importStar; },
|
|
3327
|
+
/* harmony export */ __makeTemplateObject: function() { return /* binding */ __makeTemplateObject; },
|
|
3328
|
+
/* harmony export */ __metadata: function() { return /* binding */ __metadata; },
|
|
3329
|
+
/* harmony export */ __param: function() { return /* binding */ __param; },
|
|
3330
|
+
/* harmony export */ __propKey: function() { return /* binding */ __propKey; },
|
|
3331
|
+
/* harmony export */ __read: function() { return /* binding */ __read; },
|
|
3332
|
+
/* harmony export */ __rest: function() { return /* binding */ __rest; },
|
|
3333
|
+
/* harmony export */ __runInitializers: function() { return /* binding */ __runInitializers; },
|
|
3334
|
+
/* harmony export */ __setFunctionName: function() { return /* binding */ __setFunctionName; },
|
|
3335
|
+
/* harmony export */ __spread: function() { return /* binding */ __spread; },
|
|
3336
|
+
/* harmony export */ __spreadArray: function() { return /* binding */ __spreadArray; },
|
|
3337
|
+
/* harmony export */ __spreadArrays: function() { return /* binding */ __spreadArrays; },
|
|
3338
|
+
/* harmony export */ __values: function() { return /* binding */ __values; }
|
|
3237
3339
|
/* harmony export */ });
|
|
3238
|
-
/* 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 */
|
|
3239
3340
|
/******************************************************************************
|
|
3240
3341
|
Copyright (c) Microsoft Corporation.
|
|
3241
3342
|
|
|
@@ -3585,7 +3686,7 @@ function __disposeResources(env) {
|
|
|
3585
3686
|
return next();
|
|
3586
3687
|
}
|
|
3587
3688
|
|
|
3588
|
-
/*
|
|
3689
|
+
/* harmony default export */ __webpack_exports__["default"] = ({
|
|
3589
3690
|
__extends,
|
|
3590
3691
|
__assign,
|
|
3591
3692
|
__rest,
|
|
@@ -3695,6 +3796,27 @@ var api_constants = __webpack_require__(340);
|
|
|
3695
3796
|
var array = __webpack_require__(589);
|
|
3696
3797
|
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
3697
3798
|
var exceptions = __webpack_require__(784);
|
|
3799
|
+
;// ./src/exceptions/aicc_exceptions.ts
|
|
3800
|
+
|
|
3801
|
+
|
|
3802
|
+
|
|
3803
|
+
var aicc_errors = api_constants.aicc_constants.error_descriptions;
|
|
3804
|
+
var AICCValidationError = (function (_super) {
|
|
3805
|
+
(0,tslib_es6.__extends)(AICCValidationError, _super);
|
|
3806
|
+
function AICCValidationError(errorCode) {
|
|
3807
|
+
var _this = this;
|
|
3808
|
+
if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {
|
|
3809
|
+
_this = _super.call(this, errorCode, aicc_errors[String(errorCode)].basicMessage, aicc_errors[String(errorCode)].detailMessage) || this;
|
|
3810
|
+
}
|
|
3811
|
+
else {
|
|
3812
|
+
_this = _super.call(this, 101, aicc_errors["101"].basicMessage, aicc_errors["101"].detailMessage) || this;
|
|
3813
|
+
}
|
|
3814
|
+
return _this;
|
|
3815
|
+
}
|
|
3816
|
+
return AICCValidationError;
|
|
3817
|
+
}(exceptions.ValidationError));
|
|
3818
|
+
|
|
3819
|
+
|
|
3698
3820
|
// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts
|
|
3699
3821
|
var base_cmi = __webpack_require__(319);
|
|
3700
3822
|
// EXTERNAL MODULE: ./src/constants/error_codes.ts
|
|
@@ -3705,9 +3827,8 @@ var validation = __webpack_require__(449);
|
|
|
3705
3827
|
|
|
3706
3828
|
|
|
3707
3829
|
|
|
3708
|
-
var aicc_error_codes = error_codes/* default */.A.scorm12;
|
|
3709
3830
|
function checkAICCValidFormat(value, regexPattern, allowEmptyString) {
|
|
3710
|
-
return (0,validation
|
|
3831
|
+
return (0,validation.checkValidFormat)(value, regexPattern, error_codes.scorm12_errors.TYPE_MISMATCH, AICCValidationError, allowEmptyString);
|
|
3711
3832
|
}
|
|
3712
3833
|
|
|
3713
3834
|
// EXTERNAL MODULE: ./src/constants/regex.ts
|
|
@@ -3722,7 +3843,7 @@ var regex = __webpack_require__(417);
|
|
|
3722
3843
|
|
|
3723
3844
|
|
|
3724
3845
|
var CMIEvaluation = (function (_super) {
|
|
3725
|
-
(0,tslib_es6
|
|
3846
|
+
(0,tslib_es6.__extends)(CMIEvaluation, _super);
|
|
3726
3847
|
function CMIEvaluation() {
|
|
3727
3848
|
var _this = _super.call(this) || this;
|
|
3728
3849
|
_this.comments = new CMIEvaluationComments();
|
|
@@ -3733,6 +3854,11 @@ var CMIEvaluation = (function (_super) {
|
|
|
3733
3854
|
_super.prototype.initialize.call(this);
|
|
3734
3855
|
(_a = this.comments) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
3735
3856
|
};
|
|
3857
|
+
CMIEvaluation.prototype.reset = function () {
|
|
3858
|
+
var _a;
|
|
3859
|
+
this._initialized = false;
|
|
3860
|
+
(_a = this.comments) === null || _a === void 0 ? void 0 : _a.reset();
|
|
3861
|
+
};
|
|
3736
3862
|
CMIEvaluation.prototype.toJSON = function () {
|
|
3737
3863
|
this.jsonString = true;
|
|
3738
3864
|
var result = {
|
|
@@ -3742,21 +3868,21 @@ var CMIEvaluation = (function (_super) {
|
|
|
3742
3868
|
return result;
|
|
3743
3869
|
};
|
|
3744
3870
|
return CMIEvaluation;
|
|
3745
|
-
}(base_cmi
|
|
3871
|
+
}(base_cmi.BaseCMI));
|
|
3746
3872
|
|
|
3747
3873
|
var CMIEvaluationComments = (function (_super) {
|
|
3748
|
-
(0,tslib_es6
|
|
3874
|
+
(0,tslib_es6.__extends)(CMIEvaluationComments, _super);
|
|
3749
3875
|
function CMIEvaluationComments() {
|
|
3750
3876
|
return _super.call(this, {
|
|
3751
|
-
children: api_constants
|
|
3752
|
-
errorCode: error_codes
|
|
3753
|
-
errorClass:
|
|
3877
|
+
children: api_constants.aicc_constants.comments_children,
|
|
3878
|
+
errorCode: error_codes.scorm12_errors.INVALID_SET_VALUE,
|
|
3879
|
+
errorClass: AICCValidationError,
|
|
3754
3880
|
}) || this;
|
|
3755
3881
|
}
|
|
3756
3882
|
return CMIEvaluationComments;
|
|
3757
|
-
}(array
|
|
3883
|
+
}(array.CMIArray));
|
|
3758
3884
|
var CMIEvaluationCommentsObject = (function (_super) {
|
|
3759
|
-
(0,tslib_es6
|
|
3885
|
+
(0,tslib_es6.__extends)(CMIEvaluationCommentsObject, _super);
|
|
3760
3886
|
function CMIEvaluationCommentsObject() {
|
|
3761
3887
|
var _this = _super.call(this) || this;
|
|
3762
3888
|
_this._content = "";
|
|
@@ -3764,12 +3890,18 @@ var CMIEvaluationCommentsObject = (function (_super) {
|
|
|
3764
3890
|
_this._time = "";
|
|
3765
3891
|
return _this;
|
|
3766
3892
|
}
|
|
3893
|
+
CMIEvaluationCommentsObject.prototype.reset = function () {
|
|
3894
|
+
this._initialized = false;
|
|
3895
|
+
this._content = "";
|
|
3896
|
+
this._location = "";
|
|
3897
|
+
this._time = "";
|
|
3898
|
+
};
|
|
3767
3899
|
Object.defineProperty(CMIEvaluationCommentsObject.prototype, "content", {
|
|
3768
3900
|
get: function () {
|
|
3769
3901
|
return this._content;
|
|
3770
3902
|
},
|
|
3771
3903
|
set: function (content) {
|
|
3772
|
-
if (checkAICCValidFormat(content, regex
|
|
3904
|
+
if (checkAICCValidFormat(content, regex.aicc_regex.CMIString256)) {
|
|
3773
3905
|
this._content = content;
|
|
3774
3906
|
}
|
|
3775
3907
|
},
|
|
@@ -3781,7 +3913,7 @@ var CMIEvaluationCommentsObject = (function (_super) {
|
|
|
3781
3913
|
return this._location;
|
|
3782
3914
|
},
|
|
3783
3915
|
set: function (location) {
|
|
3784
|
-
if (checkAICCValidFormat(location, regex
|
|
3916
|
+
if (checkAICCValidFormat(location, regex.aicc_regex.CMIString256)) {
|
|
3785
3917
|
this._location = location;
|
|
3786
3918
|
}
|
|
3787
3919
|
},
|
|
@@ -3793,7 +3925,7 @@ var CMIEvaluationCommentsObject = (function (_super) {
|
|
|
3793
3925
|
return this._time;
|
|
3794
3926
|
},
|
|
3795
3927
|
set: function (time) {
|
|
3796
|
-
if (checkAICCValidFormat(time, regex
|
|
3928
|
+
if (checkAICCValidFormat(time, regex.aicc_regex.CMITime)) {
|
|
3797
3929
|
this._time = time;
|
|
3798
3930
|
}
|
|
3799
3931
|
},
|
|
@@ -3811,7 +3943,7 @@ var CMIEvaluationCommentsObject = (function (_super) {
|
|
|
3811
3943
|
return result;
|
|
3812
3944
|
};
|
|
3813
3945
|
return CMIEvaluationCommentsObject;
|
|
3814
|
-
}(base_cmi
|
|
3946
|
+
}(base_cmi.BaseCMI));
|
|
3815
3947
|
|
|
3816
3948
|
|
|
3817
3949
|
// EXTERNAL MODULE: ./src/cmi/scorm12/student_preference.ts
|
|
@@ -3826,17 +3958,17 @@ var student_preference = __webpack_require__(181);
|
|
|
3826
3958
|
|
|
3827
3959
|
|
|
3828
3960
|
var AICCStudentPreferences = (function (_super) {
|
|
3829
|
-
(0,tslib_es6
|
|
3961
|
+
(0,tslib_es6.__extends)(AICCStudentPreferences, _super);
|
|
3830
3962
|
function AICCStudentPreferences() {
|
|
3831
|
-
var _this = _super.call(this, api_constants
|
|
3963
|
+
var _this = _super.call(this, api_constants.aicc_constants.student_preference_children) || this;
|
|
3832
3964
|
_this._lesson_type = "";
|
|
3833
3965
|
_this._text_color = "";
|
|
3834
3966
|
_this._text_location = "";
|
|
3835
3967
|
_this._text_size = "";
|
|
3836
3968
|
_this._video = "";
|
|
3837
|
-
_this.windows = new array
|
|
3838
|
-
errorCode: error_codes
|
|
3839
|
-
errorClass:
|
|
3969
|
+
_this.windows = new array.CMIArray({
|
|
3970
|
+
errorCode: error_codes.scorm12_errors.INVALID_SET_VALUE,
|
|
3971
|
+
errorClass: AICCValidationError,
|
|
3840
3972
|
children: "",
|
|
3841
3973
|
});
|
|
3842
3974
|
return _this;
|
|
@@ -3851,7 +3983,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
3851
3983
|
return this._lesson_type;
|
|
3852
3984
|
},
|
|
3853
3985
|
set: function (lesson_type) {
|
|
3854
|
-
if (checkAICCValidFormat(lesson_type, regex
|
|
3986
|
+
if (checkAICCValidFormat(lesson_type, regex.aicc_regex.CMIString256)) {
|
|
3855
3987
|
this._lesson_type = lesson_type;
|
|
3856
3988
|
}
|
|
3857
3989
|
},
|
|
@@ -3863,7 +3995,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
3863
3995
|
return this._text_color;
|
|
3864
3996
|
},
|
|
3865
3997
|
set: function (text_color) {
|
|
3866
|
-
if (checkAICCValidFormat(text_color, regex
|
|
3998
|
+
if (checkAICCValidFormat(text_color, regex.aicc_regex.CMIString256)) {
|
|
3867
3999
|
this._text_color = text_color;
|
|
3868
4000
|
}
|
|
3869
4001
|
},
|
|
@@ -3875,7 +4007,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
3875
4007
|
return this._text_location;
|
|
3876
4008
|
},
|
|
3877
4009
|
set: function (text_location) {
|
|
3878
|
-
if (checkAICCValidFormat(text_location, regex
|
|
4010
|
+
if (checkAICCValidFormat(text_location, regex.aicc_regex.CMIString256)) {
|
|
3879
4011
|
this._text_location = text_location;
|
|
3880
4012
|
}
|
|
3881
4013
|
},
|
|
@@ -3887,7 +4019,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
3887
4019
|
return this._text_size;
|
|
3888
4020
|
},
|
|
3889
4021
|
set: function (text_size) {
|
|
3890
|
-
if (checkAICCValidFormat(text_size, regex
|
|
4022
|
+
if (checkAICCValidFormat(text_size, regex.aicc_regex.CMIString256)) {
|
|
3891
4023
|
this._text_size = text_size;
|
|
3892
4024
|
}
|
|
3893
4025
|
},
|
|
@@ -3899,7 +4031,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
3899
4031
|
return this._video;
|
|
3900
4032
|
},
|
|
3901
4033
|
set: function (video) {
|
|
3902
|
-
if (checkAICCValidFormat(video, regex
|
|
4034
|
+
if (checkAICCValidFormat(video, regex.aicc_regex.CMIString256)) {
|
|
3903
4035
|
this._video = video;
|
|
3904
4036
|
}
|
|
3905
4037
|
},
|
|
@@ -3924,7 +4056,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
3924
4056
|
return result;
|
|
3925
4057
|
};
|
|
3926
4058
|
return AICCStudentPreferences;
|
|
3927
|
-
}(student_preference
|
|
4059
|
+
}(student_preference.CMIStudentPreference));
|
|
3928
4060
|
|
|
3929
4061
|
|
|
3930
4062
|
;// ./src/cmi/aicc/student_demographics.ts
|
|
@@ -3934,10 +4066,10 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
3934
4066
|
|
|
3935
4067
|
|
|
3936
4068
|
var CMIStudentDemographics = (function (_super) {
|
|
3937
|
-
(0,tslib_es6
|
|
4069
|
+
(0,tslib_es6.__extends)(CMIStudentDemographics, _super);
|
|
3938
4070
|
function CMIStudentDemographics() {
|
|
3939
4071
|
var _this = _super.call(this) || this;
|
|
3940
|
-
_this.__children = api_constants
|
|
4072
|
+
_this.__children = api_constants.aicc_constants.student_demographics_children;
|
|
3941
4073
|
_this._city = "";
|
|
3942
4074
|
_this._class = "";
|
|
3943
4075
|
_this._company = "";
|
|
@@ -3953,6 +4085,9 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
3953
4085
|
_this._years_experience = "";
|
|
3954
4086
|
return _this;
|
|
3955
4087
|
}
|
|
4088
|
+
CMIStudentDemographics.prototype.reset = function () {
|
|
4089
|
+
this._initialized = false;
|
|
4090
|
+
};
|
|
3956
4091
|
Object.defineProperty(CMIStudentDemographics.prototype, "_children", {
|
|
3957
4092
|
get: function () {
|
|
3958
4093
|
return this.__children;
|
|
@@ -3966,7 +4101,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
3966
4101
|
},
|
|
3967
4102
|
set: function (city) {
|
|
3968
4103
|
if (this.initialized) {
|
|
3969
|
-
throw new
|
|
4104
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
3970
4105
|
}
|
|
3971
4106
|
else {
|
|
3972
4107
|
this._city = city;
|
|
@@ -3981,7 +4116,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
3981
4116
|
},
|
|
3982
4117
|
set: function (clazz) {
|
|
3983
4118
|
if (this.initialized) {
|
|
3984
|
-
throw new
|
|
4119
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
3985
4120
|
}
|
|
3986
4121
|
else {
|
|
3987
4122
|
this._class = clazz;
|
|
@@ -3996,7 +4131,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
3996
4131
|
},
|
|
3997
4132
|
set: function (company) {
|
|
3998
4133
|
if (this.initialized) {
|
|
3999
|
-
throw new
|
|
4134
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4000
4135
|
}
|
|
4001
4136
|
else {
|
|
4002
4137
|
this._company = company;
|
|
@@ -4011,7 +4146,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
4011
4146
|
},
|
|
4012
4147
|
set: function (country) {
|
|
4013
4148
|
if (this.initialized) {
|
|
4014
|
-
throw new
|
|
4149
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4015
4150
|
}
|
|
4016
4151
|
else {
|
|
4017
4152
|
this._country = country;
|
|
@@ -4026,7 +4161,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
4026
4161
|
},
|
|
4027
4162
|
set: function (experience) {
|
|
4028
4163
|
if (this.initialized) {
|
|
4029
|
-
throw new
|
|
4164
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4030
4165
|
}
|
|
4031
4166
|
else {
|
|
4032
4167
|
this._experience = experience;
|
|
@@ -4041,7 +4176,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
4041
4176
|
},
|
|
4042
4177
|
set: function (familiar_name) {
|
|
4043
4178
|
if (this.initialized) {
|
|
4044
|
-
throw new
|
|
4179
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4045
4180
|
}
|
|
4046
4181
|
else {
|
|
4047
4182
|
this._familiar_name = familiar_name;
|
|
@@ -4056,7 +4191,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
4056
4191
|
},
|
|
4057
4192
|
set: function (instructor_name) {
|
|
4058
4193
|
if (this.initialized) {
|
|
4059
|
-
throw new
|
|
4194
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4060
4195
|
}
|
|
4061
4196
|
else {
|
|
4062
4197
|
this._instructor_name = instructor_name;
|
|
@@ -4071,7 +4206,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
4071
4206
|
},
|
|
4072
4207
|
set: function (title) {
|
|
4073
4208
|
if (this.initialized) {
|
|
4074
|
-
throw new
|
|
4209
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4075
4210
|
}
|
|
4076
4211
|
else {
|
|
4077
4212
|
this._title = title;
|
|
@@ -4086,7 +4221,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
4086
4221
|
},
|
|
4087
4222
|
set: function (native_language) {
|
|
4088
4223
|
if (this.initialized) {
|
|
4089
|
-
throw new
|
|
4224
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4090
4225
|
}
|
|
4091
4226
|
else {
|
|
4092
4227
|
this._native_language = native_language;
|
|
@@ -4101,7 +4236,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
4101
4236
|
},
|
|
4102
4237
|
set: function (state) {
|
|
4103
4238
|
if (this.initialized) {
|
|
4104
|
-
throw new
|
|
4239
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4105
4240
|
}
|
|
4106
4241
|
else {
|
|
4107
4242
|
this._state = state;
|
|
@@ -4116,7 +4251,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
4116
4251
|
},
|
|
4117
4252
|
set: function (street_address) {
|
|
4118
4253
|
if (this.initialized) {
|
|
4119
|
-
throw new
|
|
4254
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4120
4255
|
}
|
|
4121
4256
|
else {
|
|
4122
4257
|
this._street_address = street_address;
|
|
@@ -4131,7 +4266,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
4131
4266
|
},
|
|
4132
4267
|
set: function (telephone) {
|
|
4133
4268
|
if (this.initialized) {
|
|
4134
|
-
throw new
|
|
4269
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4135
4270
|
}
|
|
4136
4271
|
else {
|
|
4137
4272
|
this._telephone = telephone;
|
|
@@ -4146,7 +4281,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
4146
4281
|
},
|
|
4147
4282
|
set: function (years_experience) {
|
|
4148
4283
|
if (this.initialized) {
|
|
4149
|
-
throw new
|
|
4284
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4150
4285
|
}
|
|
4151
4286
|
else {
|
|
4152
4287
|
this._years_experience = years_experience;
|
|
@@ -4176,7 +4311,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
4176
4311
|
return result;
|
|
4177
4312
|
};
|
|
4178
4313
|
return CMIStudentDemographics;
|
|
4179
|
-
}(base_cmi
|
|
4314
|
+
}(base_cmi.BaseCMI));
|
|
4180
4315
|
|
|
4181
4316
|
|
|
4182
4317
|
// EXTERNAL MODULE: ./src/cmi/common/score.ts
|
|
@@ -4192,28 +4327,28 @@ var score = __webpack_require__(434);
|
|
|
4192
4327
|
|
|
4193
4328
|
|
|
4194
4329
|
var CMITries = (function (_super) {
|
|
4195
|
-
(0,tslib_es6
|
|
4330
|
+
(0,tslib_es6.__extends)(CMITries, _super);
|
|
4196
4331
|
function CMITries() {
|
|
4197
4332
|
return _super.call(this, {
|
|
4198
|
-
children: api_constants
|
|
4333
|
+
children: api_constants.aicc_constants.tries_children,
|
|
4199
4334
|
}) || this;
|
|
4200
4335
|
}
|
|
4201
4336
|
return CMITries;
|
|
4202
|
-
}(array
|
|
4337
|
+
}(array.CMIArray));
|
|
4203
4338
|
|
|
4204
4339
|
var CMITriesObject = (function (_super) {
|
|
4205
|
-
(0,tslib_es6
|
|
4340
|
+
(0,tslib_es6.__extends)(CMITriesObject, _super);
|
|
4206
4341
|
function CMITriesObject() {
|
|
4207
4342
|
var _this = _super.call(this) || this;
|
|
4208
4343
|
_this._status = "";
|
|
4209
4344
|
_this._time = "";
|
|
4210
|
-
_this.score = new score
|
|
4211
|
-
score_children: api_constants
|
|
4212
|
-
score_range: regex
|
|
4213
|
-
invalidErrorCode: error_codes
|
|
4214
|
-
invalidTypeCode: error_codes
|
|
4215
|
-
invalidRangeCode: error_codes
|
|
4216
|
-
errorClass:
|
|
4345
|
+
_this.score = new score.CMIScore({
|
|
4346
|
+
score_children: api_constants.aicc_constants.score_children,
|
|
4347
|
+
score_range: regex.aicc_regex.score_range,
|
|
4348
|
+
invalidErrorCode: error_codes.scorm12_errors.INVALID_SET_VALUE,
|
|
4349
|
+
invalidTypeCode: error_codes.scorm12_errors.TYPE_MISMATCH,
|
|
4350
|
+
invalidRangeCode: error_codes.scorm12_errors.VALUE_OUT_OF_RANGE,
|
|
4351
|
+
errorClass: AICCValidationError,
|
|
4217
4352
|
});
|
|
4218
4353
|
return _this;
|
|
4219
4354
|
}
|
|
@@ -4222,12 +4357,19 @@ var CMITriesObject = (function (_super) {
|
|
|
4222
4357
|
_super.prototype.initialize.call(this);
|
|
4223
4358
|
(_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
4224
4359
|
};
|
|
4360
|
+
CMITriesObject.prototype.reset = function () {
|
|
4361
|
+
var _a;
|
|
4362
|
+
this._initialized = false;
|
|
4363
|
+
this._status = "";
|
|
4364
|
+
this._time = "";
|
|
4365
|
+
(_a = this.score) === null || _a === void 0 ? void 0 : _a.reset();
|
|
4366
|
+
};
|
|
4225
4367
|
Object.defineProperty(CMITriesObject.prototype, "status", {
|
|
4226
4368
|
get: function () {
|
|
4227
4369
|
return this._status;
|
|
4228
4370
|
},
|
|
4229
4371
|
set: function (status) {
|
|
4230
|
-
if (checkAICCValidFormat(status, regex
|
|
4372
|
+
if (checkAICCValidFormat(status, regex.aicc_regex.CMIStatus2)) {
|
|
4231
4373
|
this._status = status;
|
|
4232
4374
|
}
|
|
4233
4375
|
},
|
|
@@ -4239,7 +4381,7 @@ var CMITriesObject = (function (_super) {
|
|
|
4239
4381
|
return this._time;
|
|
4240
4382
|
},
|
|
4241
4383
|
set: function (time) {
|
|
4242
|
-
if (checkAICCValidFormat(time, regex
|
|
4384
|
+
if (checkAICCValidFormat(time, regex.aicc_regex.CMITime)) {
|
|
4243
4385
|
this._time = time;
|
|
4244
4386
|
}
|
|
4245
4387
|
},
|
|
@@ -4257,7 +4399,7 @@ var CMITriesObject = (function (_super) {
|
|
|
4257
4399
|
return result;
|
|
4258
4400
|
};
|
|
4259
4401
|
return CMITriesObject;
|
|
4260
|
-
}(base_cmi
|
|
4402
|
+
}(base_cmi.BaseCMI));
|
|
4261
4403
|
|
|
4262
4404
|
|
|
4263
4405
|
// EXTERNAL MODULE: ./src/cmi/scorm12/student_data.ts
|
|
@@ -4273,41 +4415,47 @@ var student_data = __webpack_require__(532);
|
|
|
4273
4415
|
|
|
4274
4416
|
|
|
4275
4417
|
var CMIAttemptRecords = (function (_super) {
|
|
4276
|
-
(0,tslib_es6
|
|
4418
|
+
(0,tslib_es6.__extends)(CMIAttemptRecords, _super);
|
|
4277
4419
|
function CMIAttemptRecords() {
|
|
4278
4420
|
return _super.call(this, {
|
|
4279
|
-
children: api_constants
|
|
4421
|
+
children: api_constants.aicc_constants.attempt_records_children,
|
|
4280
4422
|
}) || this;
|
|
4281
4423
|
}
|
|
4282
4424
|
return CMIAttemptRecords;
|
|
4283
|
-
}(array
|
|
4425
|
+
}(array.CMIArray));
|
|
4284
4426
|
|
|
4285
4427
|
var CMIAttemptRecordsObject = (function (_super) {
|
|
4286
|
-
(0,tslib_es6
|
|
4428
|
+
(0,tslib_es6.__extends)(CMIAttemptRecordsObject, _super);
|
|
4287
4429
|
function CMIAttemptRecordsObject() {
|
|
4288
4430
|
var _this = _super.call(this) || this;
|
|
4289
4431
|
_this._lesson_status = "";
|
|
4290
|
-
_this.score = new score
|
|
4291
|
-
score_children: api_constants
|
|
4292
|
-
score_range: regex
|
|
4293
|
-
invalidErrorCode: error_codes
|
|
4294
|
-
invalidTypeCode: error_codes
|
|
4295
|
-
invalidRangeCode: error_codes
|
|
4296
|
-
errorClass:
|
|
4432
|
+
_this.score = new score.CMIScore({
|
|
4433
|
+
score_children: api_constants.aicc_constants.score_children,
|
|
4434
|
+
score_range: regex.aicc_regex.score_range,
|
|
4435
|
+
invalidErrorCode: error_codes.scorm12_errors.INVALID_SET_VALUE,
|
|
4436
|
+
invalidTypeCode: error_codes.scorm12_errors.TYPE_MISMATCH,
|
|
4437
|
+
invalidRangeCode: error_codes.scorm12_errors.VALUE_OUT_OF_RANGE,
|
|
4438
|
+
errorClass: AICCValidationError,
|
|
4297
4439
|
});
|
|
4298
4440
|
return _this;
|
|
4299
4441
|
}
|
|
4300
4442
|
CMIAttemptRecordsObject.prototype.initialize = function () {
|
|
4301
4443
|
var _a;
|
|
4302
4444
|
_super.prototype.initialize.call(this);
|
|
4445
|
+
this._lesson_status = "";
|
|
4303
4446
|
(_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
4304
4447
|
};
|
|
4448
|
+
CMIAttemptRecordsObject.prototype.reset = function () {
|
|
4449
|
+
var _a;
|
|
4450
|
+
this._initialized = false;
|
|
4451
|
+
(_a = this.score) === null || _a === void 0 ? void 0 : _a.reset();
|
|
4452
|
+
};
|
|
4305
4453
|
Object.defineProperty(CMIAttemptRecordsObject.prototype, "lesson_status", {
|
|
4306
4454
|
get: function () {
|
|
4307
4455
|
return this._lesson_status;
|
|
4308
4456
|
},
|
|
4309
4457
|
set: function (lesson_status) {
|
|
4310
|
-
if (checkAICCValidFormat(lesson_status, regex
|
|
4458
|
+
if (checkAICCValidFormat(lesson_status, regex.aicc_regex.CMIStatus2)) {
|
|
4311
4459
|
this._lesson_status = lesson_status;
|
|
4312
4460
|
}
|
|
4313
4461
|
},
|
|
@@ -4324,7 +4472,7 @@ var CMIAttemptRecordsObject = (function (_super) {
|
|
|
4324
4472
|
return result;
|
|
4325
4473
|
};
|
|
4326
4474
|
return CMIAttemptRecordsObject;
|
|
4327
|
-
}(base_cmi
|
|
4475
|
+
}(base_cmi.BaseCMI));
|
|
4328
4476
|
|
|
4329
4477
|
|
|
4330
4478
|
;// ./src/cmi/aicc/student_data.ts
|
|
@@ -4336,9 +4484,9 @@ var CMIAttemptRecordsObject = (function (_super) {
|
|
|
4336
4484
|
|
|
4337
4485
|
|
|
4338
4486
|
var AICCCMIStudentData = (function (_super) {
|
|
4339
|
-
(0,tslib_es6
|
|
4487
|
+
(0,tslib_es6.__extends)(AICCCMIStudentData, _super);
|
|
4340
4488
|
function AICCCMIStudentData() {
|
|
4341
|
-
var _this = _super.call(this, api_constants
|
|
4489
|
+
var _this = _super.call(this, api_constants.aicc_constants.student_data_children) || this;
|
|
4342
4490
|
_this._tries_during_lesson = "";
|
|
4343
4491
|
_this.tries = new CMITries();
|
|
4344
4492
|
_this.attempt_records = new CMIAttemptRecords();
|
|
@@ -4350,13 +4498,19 @@ var AICCCMIStudentData = (function (_super) {
|
|
|
4350
4498
|
(_a = this.tries) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
4351
4499
|
(_b = this.attempt_records) === null || _b === void 0 ? void 0 : _b.initialize();
|
|
4352
4500
|
};
|
|
4501
|
+
AICCCMIStudentData.prototype.reset = function () {
|
|
4502
|
+
var _a, _b;
|
|
4503
|
+
this._initialized = false;
|
|
4504
|
+
(_a = this.tries) === null || _a === void 0 ? void 0 : _a.reset(true);
|
|
4505
|
+
(_b = this.attempt_records) === null || _b === void 0 ? void 0 : _b.reset(true);
|
|
4506
|
+
};
|
|
4353
4507
|
Object.defineProperty(AICCCMIStudentData.prototype, "tries_during_lesson", {
|
|
4354
4508
|
get: function () {
|
|
4355
4509
|
return this._tries_during_lesson;
|
|
4356
4510
|
},
|
|
4357
4511
|
set: function (tries_during_lesson) {
|
|
4358
4512
|
if (this.initialized) {
|
|
4359
|
-
throw new
|
|
4513
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4360
4514
|
}
|
|
4361
4515
|
else {
|
|
4362
4516
|
this._tries_during_lesson = tries_during_lesson;
|
|
@@ -4378,7 +4532,7 @@ var AICCCMIStudentData = (function (_super) {
|
|
|
4378
4532
|
return result;
|
|
4379
4533
|
};
|
|
4380
4534
|
return AICCCMIStudentData;
|
|
4381
|
-
}(student_data
|
|
4535
|
+
}(student_data.CMIStudentData));
|
|
4382
4536
|
|
|
4383
4537
|
|
|
4384
4538
|
;// ./src/cmi/aicc/paths.ts
|
|
@@ -4389,17 +4543,17 @@ var AICCCMIStudentData = (function (_super) {
|
|
|
4389
4543
|
|
|
4390
4544
|
|
|
4391
4545
|
var CMIPaths = (function (_super) {
|
|
4392
|
-
(0,tslib_es6
|
|
4546
|
+
(0,tslib_es6.__extends)(CMIPaths, _super);
|
|
4393
4547
|
function CMIPaths() {
|
|
4394
4548
|
return _super.call(this, {
|
|
4395
|
-
children: api_constants
|
|
4549
|
+
children: api_constants.aicc_constants.paths_children,
|
|
4396
4550
|
}) || this;
|
|
4397
4551
|
}
|
|
4398
4552
|
return CMIPaths;
|
|
4399
|
-
}(array
|
|
4553
|
+
}(array.CMIArray));
|
|
4400
4554
|
|
|
4401
4555
|
var CMIPathsObject = (function (_super) {
|
|
4402
|
-
(0,tslib_es6
|
|
4556
|
+
(0,tslib_es6.__extends)(CMIPathsObject, _super);
|
|
4403
4557
|
function CMIPathsObject() {
|
|
4404
4558
|
var _this = _super.call(this) || this;
|
|
4405
4559
|
_this._location_id = "";
|
|
@@ -4410,12 +4564,21 @@ var CMIPathsObject = (function (_super) {
|
|
|
4410
4564
|
_this._time_in_element = "";
|
|
4411
4565
|
return _this;
|
|
4412
4566
|
}
|
|
4567
|
+
CMIPathsObject.prototype.reset = function () {
|
|
4568
|
+
this._initialized = false;
|
|
4569
|
+
this._location_id = "";
|
|
4570
|
+
this._date = "";
|
|
4571
|
+
this._time = "";
|
|
4572
|
+
this._status = "";
|
|
4573
|
+
this._why_left = "";
|
|
4574
|
+
this._time_in_element = "";
|
|
4575
|
+
};
|
|
4413
4576
|
Object.defineProperty(CMIPathsObject.prototype, "location_id", {
|
|
4414
4577
|
get: function () {
|
|
4415
4578
|
return this._location_id;
|
|
4416
4579
|
},
|
|
4417
4580
|
set: function (location_id) {
|
|
4418
|
-
if (checkAICCValidFormat(location_id, regex
|
|
4581
|
+
if (checkAICCValidFormat(location_id, regex.aicc_regex.CMIString256)) {
|
|
4419
4582
|
this._location_id = location_id;
|
|
4420
4583
|
}
|
|
4421
4584
|
},
|
|
@@ -4427,7 +4590,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
4427
4590
|
return this._date;
|
|
4428
4591
|
},
|
|
4429
4592
|
set: function (date) {
|
|
4430
|
-
if (checkAICCValidFormat(date, regex
|
|
4593
|
+
if (checkAICCValidFormat(date, regex.aicc_regex.CMIString256)) {
|
|
4431
4594
|
this._date = date;
|
|
4432
4595
|
}
|
|
4433
4596
|
},
|
|
@@ -4439,7 +4602,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
4439
4602
|
return this._time;
|
|
4440
4603
|
},
|
|
4441
4604
|
set: function (time) {
|
|
4442
|
-
if (checkAICCValidFormat(time, regex
|
|
4605
|
+
if (checkAICCValidFormat(time, regex.aicc_regex.CMITime)) {
|
|
4443
4606
|
this._time = time;
|
|
4444
4607
|
}
|
|
4445
4608
|
},
|
|
@@ -4451,7 +4614,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
4451
4614
|
return this._status;
|
|
4452
4615
|
},
|
|
4453
4616
|
set: function (status) {
|
|
4454
|
-
if (checkAICCValidFormat(status, regex
|
|
4617
|
+
if (checkAICCValidFormat(status, regex.aicc_regex.CMIStatus2)) {
|
|
4455
4618
|
this._status = status;
|
|
4456
4619
|
}
|
|
4457
4620
|
},
|
|
@@ -4463,7 +4626,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
4463
4626
|
return this._why_left;
|
|
4464
4627
|
},
|
|
4465
4628
|
set: function (why_left) {
|
|
4466
|
-
if (checkAICCValidFormat(why_left, regex
|
|
4629
|
+
if (checkAICCValidFormat(why_left, regex.aicc_regex.CMIString256)) {
|
|
4467
4630
|
this._why_left = why_left;
|
|
4468
4631
|
}
|
|
4469
4632
|
},
|
|
@@ -4475,7 +4638,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
4475
4638
|
return this._time_in_element;
|
|
4476
4639
|
},
|
|
4477
4640
|
set: function (time_in_element) {
|
|
4478
|
-
if (checkAICCValidFormat(time_in_element, regex
|
|
4641
|
+
if (checkAICCValidFormat(time_in_element, regex.aicc_regex.CMITime)) {
|
|
4479
4642
|
this._time_in_element = time_in_element;
|
|
4480
4643
|
}
|
|
4481
4644
|
},
|
|
@@ -4496,7 +4659,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
4496
4659
|
return result;
|
|
4497
4660
|
};
|
|
4498
4661
|
return CMIPathsObject;
|
|
4499
|
-
}(base_cmi
|
|
4662
|
+
}(base_cmi.BaseCMI));
|
|
4500
4663
|
|
|
4501
4664
|
|
|
4502
4665
|
;// ./src/cmi/aicc/cmi.ts
|
|
@@ -4509,10 +4672,10 @@ var CMIPathsObject = (function (_super) {
|
|
|
4509
4672
|
|
|
4510
4673
|
|
|
4511
4674
|
var CMI = (function (_super) {
|
|
4512
|
-
(0,tslib_es6
|
|
4675
|
+
(0,tslib_es6.__extends)(CMI, _super);
|
|
4513
4676
|
function CMI(initialized) {
|
|
4514
4677
|
if (initialized === void 0) { initialized = false; }
|
|
4515
|
-
var _this = _super.call(this, api_constants
|
|
4678
|
+
var _this = _super.call(this, api_constants.aicc_constants.cmi_children) || this;
|
|
4516
4679
|
if (initialized)
|
|
4517
4680
|
_this.initialize();
|
|
4518
4681
|
_this.student_preference = new AICCStudentPreferences();
|
|
@@ -4551,7 +4714,7 @@ var CMI = (function (_super) {
|
|
|
4551
4714
|
return result;
|
|
4552
4715
|
};
|
|
4553
4716
|
return CMI;
|
|
4554
|
-
}(cmi
|
|
4717
|
+
}(cmi.CMI));
|
|
4555
4718
|
|
|
4556
4719
|
|
|
4557
4720
|
// EXTERNAL MODULE: ./src/cmi/scorm12/nav.ts
|
|
@@ -4569,26 +4732,26 @@ var utilities = __webpack_require__(864);
|
|
|
4569
4732
|
|
|
4570
4733
|
|
|
4571
4734
|
var AICCImpl = (function (_super) {
|
|
4572
|
-
(0,tslib_es6
|
|
4735
|
+
(0,tslib_es6.__extends)(AICCImpl, _super);
|
|
4573
4736
|
function AICCImpl(settings) {
|
|
4574
4737
|
var _this = _super.call(this, settings) || this;
|
|
4575
4738
|
_this.cmi = new CMI();
|
|
4576
|
-
_this.nav = new nav
|
|
4739
|
+
_this.nav = new nav.NAV();
|
|
4577
4740
|
return _this;
|
|
4578
4741
|
}
|
|
4579
4742
|
AICCImpl.prototype.getChildElement = function (CMIElement, value, foundFirstIndex) {
|
|
4580
4743
|
var newChild = _super.prototype.getChildElement.call(this, CMIElement, value, foundFirstIndex);
|
|
4581
4744
|
if (!newChild) {
|
|
4582
|
-
if ((0,utilities
|
|
4745
|
+
if ((0,utilities.stringMatches)(CMIElement, "cmi\\.evaluation\\.comments\\.\\d+")) {
|
|
4583
4746
|
newChild = new CMIEvaluationCommentsObject();
|
|
4584
4747
|
}
|
|
4585
|
-
else if ((0,utilities
|
|
4748
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.student_data\\.tries\\.\\d+")) {
|
|
4586
4749
|
newChild = new CMITriesObject();
|
|
4587
4750
|
}
|
|
4588
|
-
else if ((0,utilities
|
|
4751
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.student_data\\.attempt_records\\.\\d+")) {
|
|
4589
4752
|
newChild = new CMIAttemptRecordsObject();
|
|
4590
4753
|
}
|
|
4591
|
-
else if ((0,utilities
|
|
4754
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.paths\\.\\d+")) {
|
|
4592
4755
|
newChild = new CMIPathsObject();
|
|
4593
4756
|
}
|
|
4594
4757
|
}
|
|
@@ -4603,7 +4766,7 @@ var AICCImpl = (function (_super) {
|
|
|
4603
4766
|
|
|
4604
4767
|
|
|
4605
4768
|
var __webpack_export_target__ = this;
|
|
4606
|
-
for(var
|
|
4769
|
+
for(var __webpack_i__ in __webpack_exports__) __webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
4607
4770
|
if(__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, "__esModule", { value: true });
|
|
4608
4771
|
/******/ })()
|
|
4609
4772
|
;
|