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/esm/scorm12.js
CHANGED
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
/***/ 429:
|
|
4
4
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5
5
|
|
|
6
|
+
// ESM COMPAT FLAG
|
|
7
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6
8
|
|
|
7
9
|
// EXPORTS
|
|
8
10
|
__webpack_require__.d(__webpack_exports__, {
|
|
9
|
-
|
|
11
|
+
"default": function() { return /* binding */ src_BaseAPI; }
|
|
10
12
|
});
|
|
11
13
|
|
|
12
14
|
// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs
|
|
@@ -15,8 +17,6 @@ var tslib_es6 = __webpack_require__(635);
|
|
|
15
17
|
var array = __webpack_require__(589);
|
|
16
18
|
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
17
19
|
var exceptions = __webpack_require__(784);
|
|
18
|
-
// EXTERNAL MODULE: ./src/constants/error_codes.ts
|
|
19
|
-
var error_codes = __webpack_require__(797);
|
|
20
20
|
// EXTERNAL MODULE: ./src/constants/api_constants.ts
|
|
21
21
|
var api_constants = __webpack_require__(340);
|
|
22
22
|
// EXTERNAL MODULE: ./src/utilities.ts
|
|
@@ -36,7 +36,7 @@ var DefaultSettings = {
|
|
|
36
36
|
dataCommitFormat: "json",
|
|
37
37
|
commitRequestDataType: "application/json;charset=UTF-8",
|
|
38
38
|
autoProgress: false,
|
|
39
|
-
logLevel: enums
|
|
39
|
+
logLevel: enums.LogLevelEnum.ERROR,
|
|
40
40
|
selfReportSessionTime: false,
|
|
41
41
|
alwaysSendTotalTime: false,
|
|
42
42
|
renderCommonCommitFields: false,
|
|
@@ -45,9 +45,9 @@ var DefaultSettings = {
|
|
|
45
45
|
xhrWithCredentials: false,
|
|
46
46
|
fetchMode: "cors",
|
|
47
47
|
responseHandler: function (response) {
|
|
48
|
-
return (0,tslib_es6
|
|
48
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
49
49
|
var responseText, httpResult;
|
|
50
|
-
return (0,tslib_es6
|
|
50
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
51
51
|
switch (_a.label) {
|
|
52
52
|
case 0:
|
|
53
53
|
if (!(typeof response !== "undefined")) return [3, 2];
|
|
@@ -62,13 +62,13 @@ var DefaultSettings = {
|
|
|
62
62
|
!{}.hasOwnProperty.call(httpResult, "result")) {
|
|
63
63
|
if (response.status === 200) {
|
|
64
64
|
return [2, {
|
|
65
|
-
result: api_constants
|
|
65
|
+
result: api_constants.global_constants.SCORM_TRUE,
|
|
66
66
|
errorCode: 0,
|
|
67
67
|
}];
|
|
68
68
|
}
|
|
69
69
|
else {
|
|
70
70
|
return [2, {
|
|
71
|
-
result: api_constants
|
|
71
|
+
result: api_constants.global_constants.SCORM_FALSE,
|
|
72
72
|
errorCode: 101,
|
|
73
73
|
}];
|
|
74
74
|
}
|
|
@@ -78,14 +78,14 @@ var DefaultSettings = {
|
|
|
78
78
|
result: httpResult.result,
|
|
79
79
|
errorCode: httpResult.errorCode
|
|
80
80
|
? httpResult.errorCode
|
|
81
|
-
: httpResult.result === api_constants
|
|
81
|
+
: httpResult.result === api_constants.global_constants.SCORM_TRUE
|
|
82
82
|
? 0
|
|
83
83
|
: 101,
|
|
84
84
|
}];
|
|
85
85
|
}
|
|
86
86
|
_a.label = 2;
|
|
87
87
|
case 2: return [2, {
|
|
88
|
-
result: api_constants
|
|
88
|
+
result: api_constants.global_constants.SCORM_FALSE,
|
|
89
89
|
errorCode: 101,
|
|
90
90
|
}];
|
|
91
91
|
}
|
|
@@ -100,25 +100,25 @@ var DefaultSettings = {
|
|
|
100
100
|
case "4":
|
|
101
101
|
case 4:
|
|
102
102
|
case "ERROR":
|
|
103
|
-
case enums
|
|
103
|
+
case enums.LogLevelEnum.ERROR:
|
|
104
104
|
console.error(logMessage);
|
|
105
105
|
break;
|
|
106
106
|
case "3":
|
|
107
107
|
case 3:
|
|
108
108
|
case "WARN":
|
|
109
|
-
case enums
|
|
109
|
+
case enums.LogLevelEnum.WARN:
|
|
110
110
|
console.warn(logMessage);
|
|
111
111
|
break;
|
|
112
112
|
case "2":
|
|
113
113
|
case 2:
|
|
114
114
|
case "INFO":
|
|
115
|
-
case enums
|
|
115
|
+
case enums.LogLevelEnum.INFO:
|
|
116
116
|
console.info(logMessage);
|
|
117
117
|
break;
|
|
118
118
|
case "1":
|
|
119
119
|
case 1:
|
|
120
120
|
case "DEBUG":
|
|
121
|
-
case enums
|
|
121
|
+
case enums.LogLevelEnum.DEBUG:
|
|
122
122
|
if (console.debug) {
|
|
123
123
|
console.debug(logMessage);
|
|
124
124
|
}
|
|
@@ -130,6 +130,7 @@ var DefaultSettings = {
|
|
|
130
130
|
},
|
|
131
131
|
scoItemIds: [],
|
|
132
132
|
scoItemIdValidator: false,
|
|
133
|
+
globalObjectiveIds: [],
|
|
133
134
|
};
|
|
134
135
|
|
|
135
136
|
;// ./src/helpers/scheduled_commit.ts
|
|
@@ -150,7 +151,7 @@ var ScheduledCommit = (function () {
|
|
|
150
151
|
ScheduledCommit.prototype.wrapper = function () {
|
|
151
152
|
var _this = this;
|
|
152
153
|
if (!this._cancelled) {
|
|
153
|
-
(function () { return (0,tslib_es6
|
|
154
|
+
(function () { return (0,tslib_es6.__awaiter)(_this, void 0, void 0, function () { return (0,tslib_es6.__generator)(this, function (_a) {
|
|
154
155
|
switch (_a.label) {
|
|
155
156
|
case 0: return [4, this._API.commit(this._callback)];
|
|
156
157
|
case 1: return [2, _a.sent()];
|
|
@@ -171,7 +172,6 @@ var ScheduledCommit = (function () {
|
|
|
171
172
|
|
|
172
173
|
|
|
173
174
|
|
|
174
|
-
|
|
175
175
|
var BaseAPI = (function () {
|
|
176
176
|
function BaseAPI(error_codes, settings) {
|
|
177
177
|
var _newTarget = this.constructor;
|
|
@@ -179,7 +179,7 @@ var BaseAPI = (function () {
|
|
|
179
179
|
if (_newTarget === BaseAPI) {
|
|
180
180
|
throw new TypeError("Cannot construct BaseAPI instances directly");
|
|
181
181
|
}
|
|
182
|
-
this.currentState = api_constants
|
|
182
|
+
this.currentState = api_constants.global_constants.STATE_NOT_INITIALIZED;
|
|
183
183
|
this.lastErrorCode = "0";
|
|
184
184
|
this.listenerArray = [];
|
|
185
185
|
this._error_codes = error_codes;
|
|
@@ -189,17 +189,20 @@ var BaseAPI = (function () {
|
|
|
189
189
|
this.apiLogLevel = this.settings.logLevel;
|
|
190
190
|
this.selfReportSessionTime = this.settings.selfReportSessionTime;
|
|
191
191
|
if (this.apiLogLevel === undefined) {
|
|
192
|
-
this.apiLogLevel = enums
|
|
192
|
+
this.apiLogLevel = enums.LogLevelEnum.NONE;
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
BaseAPI.prototype.commonReset = function (settings) {
|
|
196
|
-
this.
|
|
197
|
-
this.
|
|
196
|
+
this.apiLog("reset", "Called", enums.LogLevelEnum.INFO);
|
|
197
|
+
this.settings = (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, this.settings), settings);
|
|
198
|
+
this.clearScheduledCommit();
|
|
199
|
+
this.currentState = api_constants.global_constants.STATE_NOT_INITIALIZED;
|
|
198
200
|
this.lastErrorCode = "0";
|
|
199
201
|
this.listenerArray = [];
|
|
202
|
+
this.startingData = undefined;
|
|
200
203
|
};
|
|
201
204
|
BaseAPI.prototype.initialize = function (callbackName, initializeMessage, terminationMessage) {
|
|
202
|
-
var returnValue = api_constants
|
|
205
|
+
var returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
203
206
|
if (this.isInitialized()) {
|
|
204
207
|
this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);
|
|
205
208
|
}
|
|
@@ -210,17 +213,17 @@ var BaseAPI = (function () {
|
|
|
210
213
|
if (this.selfReportSessionTime) {
|
|
211
214
|
this.cmi.setStartTime();
|
|
212
215
|
}
|
|
213
|
-
this.currentState = api_constants
|
|
216
|
+
this.currentState = api_constants.global_constants.STATE_INITIALIZED;
|
|
214
217
|
this.lastErrorCode = "0";
|
|
215
|
-
returnValue = api_constants
|
|
218
|
+
returnValue = api_constants.global_constants.SCORM_TRUE;
|
|
216
219
|
this.processListeners(callbackName);
|
|
217
220
|
}
|
|
218
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
221
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
219
222
|
this.clearSCORMError(returnValue);
|
|
220
223
|
return returnValue;
|
|
221
224
|
};
|
|
222
225
|
BaseAPI.prototype.apiLog = function (functionName, logMessage, messageLevel, CMIElement) {
|
|
223
|
-
logMessage = (0,utilities
|
|
226
|
+
logMessage = (0,utilities.formatMessage)(functionName, logMessage, CMIElement);
|
|
224
227
|
if (messageLevel >= this.apiLogLevel) {
|
|
225
228
|
this.settings.onLogMessage(messageLevel, logMessage);
|
|
226
229
|
}
|
|
@@ -237,20 +240,20 @@ var BaseAPI = (function () {
|
|
|
237
240
|
return this._settings;
|
|
238
241
|
},
|
|
239
242
|
set: function (settings) {
|
|
240
|
-
this._settings = (0,tslib_es6
|
|
243
|
+
this._settings = (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, this._settings), settings);
|
|
241
244
|
},
|
|
242
245
|
enumerable: false,
|
|
243
246
|
configurable: true
|
|
244
247
|
});
|
|
245
248
|
BaseAPI.prototype.terminate = function (callbackName, checkTerminated) {
|
|
246
|
-
return (0,tslib_es6
|
|
249
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
247
250
|
var returnValue, result;
|
|
248
|
-
return (0,tslib_es6
|
|
251
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
249
252
|
switch (_a.label) {
|
|
250
253
|
case 0:
|
|
251
|
-
returnValue = api_constants
|
|
254
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
252
255
|
if (!this.checkState(checkTerminated, this._error_codes.TERMINATION_BEFORE_INIT, this._error_codes.MULTIPLE_TERMINATION)) return [3, 2];
|
|
253
|
-
this.currentState = api_constants
|
|
256
|
+
this.currentState = api_constants.global_constants.STATE_TERMINATED;
|
|
254
257
|
return [4, this.storeData(true)];
|
|
255
258
|
case 1:
|
|
256
259
|
result = _a.sent();
|
|
@@ -260,14 +263,14 @@ var BaseAPI = (function () {
|
|
|
260
263
|
returnValue =
|
|
261
264
|
typeof result !== "undefined" && result.result
|
|
262
265
|
? result.result
|
|
263
|
-
: api_constants
|
|
266
|
+
: api_constants.global_constants.SCORM_FALSE;
|
|
264
267
|
if (checkTerminated)
|
|
265
268
|
this.lastErrorCode = "0";
|
|
266
|
-
returnValue = api_constants
|
|
269
|
+
returnValue = api_constants.global_constants.SCORM_TRUE;
|
|
267
270
|
this.processListeners(callbackName);
|
|
268
271
|
_a.label = 2;
|
|
269
272
|
case 2:
|
|
270
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
273
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
271
274
|
this.clearSCORMError(returnValue);
|
|
272
275
|
return [2, returnValue];
|
|
273
276
|
}
|
|
@@ -287,7 +290,7 @@ var BaseAPI = (function () {
|
|
|
287
290
|
}
|
|
288
291
|
this.processListeners(callbackName, CMIElement);
|
|
289
292
|
}
|
|
290
|
-
this.apiLog(callbackName, ": returned: " + returnValue, enums
|
|
293
|
+
this.apiLog(callbackName, ": returned: " + returnValue, enums.LogLevelEnum.INFO, CMIElement);
|
|
291
294
|
if (returnValue === undefined) {
|
|
292
295
|
return "";
|
|
293
296
|
}
|
|
@@ -298,7 +301,7 @@ var BaseAPI = (function () {
|
|
|
298
301
|
if (value !== undefined) {
|
|
299
302
|
value = String(value);
|
|
300
303
|
}
|
|
301
|
-
var returnValue = api_constants
|
|
304
|
+
var returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
302
305
|
if (this.checkState(checkTerminated, this._error_codes.STORE_BEFORE_INIT, this._error_codes.STORE_AFTER_TERM)) {
|
|
303
306
|
if (checkTerminated)
|
|
304
307
|
this.lastErrorCode = "0";
|
|
@@ -311,26 +314,26 @@ var BaseAPI = (function () {
|
|
|
311
314
|
this.processListeners(callbackName, CMIElement, value);
|
|
312
315
|
}
|
|
313
316
|
if (returnValue === undefined) {
|
|
314
|
-
returnValue = api_constants
|
|
317
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
315
318
|
}
|
|
316
319
|
if (String(this.lastErrorCode) === "0") {
|
|
317
320
|
if (this.settings.autocommit) {
|
|
318
321
|
this.scheduleCommit(this.settings.autocommitSeconds * 1000, commitCallback);
|
|
319
322
|
}
|
|
320
323
|
}
|
|
321
|
-
this.apiLog(callbackName, ": " + value + ": result: " + returnValue, enums
|
|
324
|
+
this.apiLog(callbackName, ": " + value + ": result: " + returnValue, enums.LogLevelEnum.INFO, CMIElement);
|
|
322
325
|
this.clearSCORMError(returnValue);
|
|
323
326
|
return returnValue;
|
|
324
327
|
};
|
|
325
328
|
BaseAPI.prototype.commit = function (callbackName_1) {
|
|
326
|
-
return (0,tslib_es6
|
|
329
|
+
return (0,tslib_es6.__awaiter)(this, arguments, void 0, function (callbackName, checkTerminated) {
|
|
327
330
|
var returnValue, result;
|
|
328
331
|
if (checkTerminated === void 0) { checkTerminated = false; }
|
|
329
|
-
return (0,tslib_es6
|
|
332
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
330
333
|
switch (_a.label) {
|
|
331
334
|
case 0:
|
|
332
335
|
this.clearScheduledCommit();
|
|
333
|
-
returnValue = api_constants
|
|
336
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
334
337
|
if (!this.checkState(checkTerminated, this._error_codes.COMMIT_BEFORE_INIT, this._error_codes.COMMIT_AFTER_TERM)) return [3, 2];
|
|
335
338
|
return [4, this.storeData(false)];
|
|
336
339
|
case 1:
|
|
@@ -341,14 +344,14 @@ var BaseAPI = (function () {
|
|
|
341
344
|
returnValue =
|
|
342
345
|
typeof result !== "undefined" && result.result
|
|
343
346
|
? result.result
|
|
344
|
-
: api_constants
|
|
345
|
-
this.apiLog(callbackName, " Result: " + returnValue, enums
|
|
347
|
+
: api_constants.global_constants.SCORM_FALSE;
|
|
348
|
+
this.apiLog(callbackName, " Result: " + returnValue, enums.LogLevelEnum.DEBUG, "HttpRequest");
|
|
346
349
|
if (checkTerminated)
|
|
347
350
|
this.lastErrorCode = "0";
|
|
348
351
|
this.processListeners(callbackName);
|
|
349
352
|
_a.label = 2;
|
|
350
353
|
case 2:
|
|
351
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
354
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
352
355
|
this.clearSCORMError(returnValue);
|
|
353
356
|
return [2, returnValue];
|
|
354
357
|
}
|
|
@@ -358,7 +361,7 @@ var BaseAPI = (function () {
|
|
|
358
361
|
BaseAPI.prototype.getLastError = function (callbackName) {
|
|
359
362
|
var returnValue = String(this.lastErrorCode);
|
|
360
363
|
this.processListeners(callbackName);
|
|
361
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
364
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
362
365
|
return returnValue;
|
|
363
366
|
};
|
|
364
367
|
BaseAPI.prototype.getErrorString = function (callbackName, CMIErrorCode) {
|
|
@@ -367,7 +370,7 @@ var BaseAPI = (function () {
|
|
|
367
370
|
returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);
|
|
368
371
|
this.processListeners(callbackName);
|
|
369
372
|
}
|
|
370
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
373
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
371
374
|
return returnValue;
|
|
372
375
|
};
|
|
373
376
|
BaseAPI.prototype.getDiagnostic = function (callbackName, CMIErrorCode) {
|
|
@@ -376,7 +379,7 @@ var BaseAPI = (function () {
|
|
|
376
379
|
returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);
|
|
377
380
|
this.processListeners(callbackName);
|
|
378
381
|
}
|
|
379
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
382
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
380
383
|
return returnValue;
|
|
381
384
|
};
|
|
382
385
|
BaseAPI.prototype.checkState = function (checkTerminated, beforeInitError, afterTermError) {
|
|
@@ -402,11 +405,11 @@ var BaseAPI = (function () {
|
|
|
402
405
|
};
|
|
403
406
|
BaseAPI.prototype._commonSetCMIValue = function (methodName, scorm2004, CMIElement, value) {
|
|
404
407
|
if (!CMIElement || CMIElement === "") {
|
|
405
|
-
return api_constants
|
|
408
|
+
return api_constants.global_constants.SCORM_FALSE;
|
|
406
409
|
}
|
|
407
410
|
var structure = CMIElement.split(".");
|
|
408
411
|
var refObject = this;
|
|
409
|
-
var returnValue = api_constants
|
|
412
|
+
var returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
410
413
|
var foundFirstIndex = false;
|
|
411
414
|
var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element.");
|
|
412
415
|
var invalidErrorCode = scorm2004
|
|
@@ -420,20 +423,20 @@ var BaseAPI = (function () {
|
|
|
420
423
|
this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);
|
|
421
424
|
}
|
|
422
425
|
else {
|
|
423
|
-
refObject = (0,tslib_es6
|
|
426
|
+
refObject = (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, refObject), { attribute: value });
|
|
424
427
|
}
|
|
425
428
|
}
|
|
426
429
|
else if (!this._checkObjectHasProperty(refObject, attribute)) {
|
|
427
430
|
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
428
431
|
}
|
|
429
432
|
else {
|
|
430
|
-
if ((0,utilities
|
|
433
|
+
if ((0,utilities.stringMatches)(CMIElement, "\\.correct_responses\\.\\d+") &&
|
|
431
434
|
this.isInitialized()) {
|
|
432
435
|
this.validateCorrectResponse(CMIElement, value);
|
|
433
436
|
}
|
|
434
437
|
if (!scorm2004 || this.lastErrorCode === "0") {
|
|
435
438
|
refObject[attribute] = value;
|
|
436
|
-
returnValue = api_constants
|
|
439
|
+
returnValue = api_constants.global_constants.SCORM_TRUE;
|
|
437
440
|
}
|
|
438
441
|
}
|
|
439
442
|
}
|
|
@@ -443,7 +446,7 @@ var BaseAPI = (function () {
|
|
|
443
446
|
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
444
447
|
break;
|
|
445
448
|
}
|
|
446
|
-
if (refObject instanceof array
|
|
449
|
+
if (refObject instanceof array.CMIArray) {
|
|
447
450
|
var index = parseInt(structure[idx + 1], 10);
|
|
448
451
|
if (!isNaN(index)) {
|
|
449
452
|
var item = refObject.childArray[index];
|
|
@@ -469,8 +472,8 @@ var BaseAPI = (function () {
|
|
|
469
472
|
}
|
|
470
473
|
}
|
|
471
474
|
}
|
|
472
|
-
if (returnValue === api_constants
|
|
473
|
-
this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value), enums
|
|
475
|
+
if (returnValue === api_constants.global_constants.SCORM_FALSE) {
|
|
476
|
+
this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value), enums.LogLevelEnum.WARN);
|
|
474
477
|
}
|
|
475
478
|
return returnValue;
|
|
476
479
|
};
|
|
@@ -512,7 +515,7 @@ var BaseAPI = (function () {
|
|
|
512
515
|
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
513
516
|
break;
|
|
514
517
|
}
|
|
515
|
-
if (refObject instanceof array
|
|
518
|
+
if (refObject instanceof array.CMIArray) {
|
|
516
519
|
var index = parseInt(structure[idx + 1], 10);
|
|
517
520
|
if (!isNaN(index)) {
|
|
518
521
|
var item = refObject.childArray[index];
|
|
@@ -530,10 +533,10 @@ var BaseAPI = (function () {
|
|
|
530
533
|
if (refObject === null || refObject === undefined) {
|
|
531
534
|
if (!scorm2004) {
|
|
532
535
|
if (attribute === "_children") {
|
|
533
|
-
this.throwSCORMError(
|
|
536
|
+
this.throwSCORMError(this._error_codes.CHILDREN_ERROR);
|
|
534
537
|
}
|
|
535
538
|
else if (attribute === "_count") {
|
|
536
|
-
this.throwSCORMError(
|
|
539
|
+
this.throwSCORMError(this._error_codes.COUNT_ERROR);
|
|
537
540
|
}
|
|
538
541
|
}
|
|
539
542
|
}
|
|
@@ -542,13 +545,13 @@ var BaseAPI = (function () {
|
|
|
542
545
|
}
|
|
543
546
|
};
|
|
544
547
|
BaseAPI.prototype.isInitialized = function () {
|
|
545
|
-
return this.currentState === api_constants
|
|
548
|
+
return this.currentState === api_constants.global_constants.STATE_INITIALIZED;
|
|
546
549
|
};
|
|
547
550
|
BaseAPI.prototype.isNotInitialized = function () {
|
|
548
|
-
return this.currentState === api_constants
|
|
551
|
+
return this.currentState === api_constants.global_constants.STATE_NOT_INITIALIZED;
|
|
549
552
|
};
|
|
550
553
|
BaseAPI.prototype.isTerminated = function () {
|
|
551
|
-
return this.currentState === api_constants
|
|
554
|
+
return this.currentState === api_constants.global_constants.STATE_TERMINATED;
|
|
552
555
|
};
|
|
553
556
|
BaseAPI.prototype.on = function (listenerName, callback) {
|
|
554
557
|
if (!callback)
|
|
@@ -568,7 +571,7 @@ var BaseAPI = (function () {
|
|
|
568
571
|
CMIElement: CMIElement,
|
|
569
572
|
callback: callback,
|
|
570
573
|
});
|
|
571
|
-
this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), enums
|
|
574
|
+
this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), enums.LogLevelEnum.INFO, functionName);
|
|
572
575
|
}
|
|
573
576
|
};
|
|
574
577
|
BaseAPI.prototype.off = function (listenerName, callback) {
|
|
@@ -591,7 +594,7 @@ var BaseAPI = (function () {
|
|
|
591
594
|
});
|
|
592
595
|
if (removeIndex !== -1) {
|
|
593
596
|
this_1.listenerArray.splice(removeIndex, 1);
|
|
594
|
-
this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), enums
|
|
597
|
+
this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), enums.LogLevelEnum.INFO, functionName);
|
|
595
598
|
}
|
|
596
599
|
};
|
|
597
600
|
var this_1 = this;
|
|
@@ -624,7 +627,7 @@ var BaseAPI = (function () {
|
|
|
624
627
|
}
|
|
625
628
|
};
|
|
626
629
|
BaseAPI.prototype.processListeners = function (functionName, CMIElement, value) {
|
|
627
|
-
this.apiLog(functionName, value, enums
|
|
630
|
+
this.apiLog(functionName, value, enums.LogLevelEnum.INFO, CMIElement);
|
|
628
631
|
for (var i = 0; i < this.listenerArray.length; i++) {
|
|
629
632
|
var listener = this.listenerArray[i];
|
|
630
633
|
var functionsMatch = listener.functionName === functionName;
|
|
@@ -640,7 +643,7 @@ var BaseAPI = (function () {
|
|
|
640
643
|
CMIElementsMatch = listener.CMIElement === CMIElement;
|
|
641
644
|
}
|
|
642
645
|
if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {
|
|
643
|
-
this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), enums
|
|
646
|
+
this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), enums.LogLevelEnum.INFO, CMIElement);
|
|
644
647
|
listener.callback(CMIElement, value);
|
|
645
648
|
}
|
|
646
649
|
}
|
|
@@ -649,11 +652,11 @@ var BaseAPI = (function () {
|
|
|
649
652
|
if (!message) {
|
|
650
653
|
message = this.getLmsErrorMessageDetails(errorNumber);
|
|
651
654
|
}
|
|
652
|
-
this.apiLog("throwSCORMError", errorNumber + ": " + message, enums
|
|
655
|
+
this.apiLog("throwSCORMError", errorNumber + ": " + message, enums.LogLevelEnum.ERROR);
|
|
653
656
|
this.lastErrorCode = String(errorNumber);
|
|
654
657
|
};
|
|
655
658
|
BaseAPI.prototype.clearSCORMError = function (success) {
|
|
656
|
-
if (success !== undefined && success !== api_constants
|
|
659
|
+
if (success !== undefined && success !== api_constants.global_constants.SCORM_FALSE) {
|
|
657
660
|
this.lastErrorCode = "0";
|
|
658
661
|
}
|
|
659
662
|
};
|
|
@@ -719,7 +722,7 @@ var BaseAPI = (function () {
|
|
|
719
722
|
result.forEach(function (element) {
|
|
720
723
|
obj = {};
|
|
721
724
|
obj[element[0]] = element[1];
|
|
722
|
-
_this.loadFromJSON((0,utilities
|
|
725
|
+
_this.loadFromJSON((0,utilities.unflatten)(obj), CMIElement);
|
|
723
726
|
});
|
|
724
727
|
};
|
|
725
728
|
BaseAPI.prototype.loadFromJSON = function (json, CMIElement) {
|
|
@@ -759,21 +762,21 @@ var BaseAPI = (function () {
|
|
|
759
762
|
return JSON.parse(this.renderCMIToJSONString());
|
|
760
763
|
};
|
|
761
764
|
BaseAPI.prototype.processHttpRequest = function (url_1, params_1) {
|
|
762
|
-
return (0,tslib_es6
|
|
765
|
+
return (0,tslib_es6.__awaiter)(this, arguments, void 0, function (url, params, immediate) {
|
|
763
766
|
var api, genericError, process;
|
|
764
767
|
var _this = this;
|
|
765
768
|
if (immediate === void 0) { immediate = false; }
|
|
766
|
-
return (0,tslib_es6
|
|
769
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
767
770
|
switch (_a.label) {
|
|
768
771
|
case 0:
|
|
769
772
|
api = this;
|
|
770
773
|
genericError = {
|
|
771
|
-
result: api_constants
|
|
774
|
+
result: api_constants.global_constants.SCORM_FALSE,
|
|
772
775
|
errorCode: this.error_codes.GENERAL,
|
|
773
776
|
};
|
|
774
777
|
if (immediate) {
|
|
775
|
-
this.performFetch(url, params).then(function (response) { return (0,tslib_es6
|
|
776
|
-
return (0,tslib_es6
|
|
778
|
+
this.performFetch(url, params).then(function (response) { return (0,tslib_es6.__awaiter)(_this, void 0, void 0, function () {
|
|
779
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
777
780
|
switch (_a.label) {
|
|
778
781
|
case 0: return [4, this.transformResponse(response)];
|
|
779
782
|
case 1:
|
|
@@ -783,13 +786,13 @@ var BaseAPI = (function () {
|
|
|
783
786
|
});
|
|
784
787
|
}); });
|
|
785
788
|
return [2, {
|
|
786
|
-
result: api_constants
|
|
789
|
+
result: api_constants.global_constants.SCORM_TRUE,
|
|
787
790
|
errorCode: 0,
|
|
788
791
|
}];
|
|
789
792
|
}
|
|
790
|
-
process = function (url, params, settings) { return (0,tslib_es6
|
|
793
|
+
process = function (url, params, settings) { return (0,tslib_es6.__awaiter)(_this, void 0, void 0, function () {
|
|
791
794
|
var response, e_1;
|
|
792
|
-
return (0,tslib_es6
|
|
795
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
793
796
|
switch (_a.label) {
|
|
794
797
|
case 0:
|
|
795
798
|
_a.trys.push([0, 2, , 3]);
|
|
@@ -800,7 +803,7 @@ var BaseAPI = (function () {
|
|
|
800
803
|
return [2, this.transformResponse(response)];
|
|
801
804
|
case 2:
|
|
802
805
|
e_1 = _a.sent();
|
|
803
|
-
this.apiLog("processHttpRequest", e_1, enums
|
|
806
|
+
this.apiLog("processHttpRequest", e_1, enums.LogLevelEnum.ERROR);
|
|
804
807
|
api.processListeners("CommitError");
|
|
805
808
|
return [2, genericError];
|
|
806
809
|
case 3: return [2];
|
|
@@ -816,14 +819,14 @@ var BaseAPI = (function () {
|
|
|
816
819
|
BaseAPI.prototype.scheduleCommit = function (when, callback) {
|
|
817
820
|
if (!this._timeout) {
|
|
818
821
|
this._timeout = new ScheduledCommit(this, when, callback);
|
|
819
|
-
this.apiLog("scheduleCommit", "scheduled", enums
|
|
822
|
+
this.apiLog("scheduleCommit", "scheduled", enums.LogLevelEnum.DEBUG, "");
|
|
820
823
|
}
|
|
821
824
|
};
|
|
822
825
|
BaseAPI.prototype.clearScheduledCommit = function () {
|
|
823
826
|
if (this._timeout) {
|
|
824
827
|
this._timeout.cancel();
|
|
825
828
|
this._timeout = undefined;
|
|
826
|
-
this.apiLog("clearScheduledCommit", "cleared", enums
|
|
829
|
+
this.apiLog("clearScheduledCommit", "cleared", enums.LogLevelEnum.DEBUG, "");
|
|
827
830
|
}
|
|
828
831
|
};
|
|
829
832
|
BaseAPI.prototype._checkObjectHasProperty = function (refObject, attribute) {
|
|
@@ -832,9 +835,9 @@ var BaseAPI = (function () {
|
|
|
832
835
|
attribute in refObject);
|
|
833
836
|
};
|
|
834
837
|
BaseAPI.prototype.handleValueAccessException = function (e, returnValue) {
|
|
835
|
-
if (e instanceof exceptions
|
|
838
|
+
if (e instanceof exceptions.ValidationError) {
|
|
836
839
|
this.lastErrorCode = String(e.errorCode);
|
|
837
|
-
returnValue = api_constants
|
|
840
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
838
841
|
}
|
|
839
842
|
else {
|
|
840
843
|
if (e instanceof Error && e.message) {
|
|
@@ -852,20 +855,20 @@ var BaseAPI = (function () {
|
|
|
852
855
|
var commitObject = this.settings.renderCommonCommitFields
|
|
853
856
|
? this.renderCommitObject(shouldTerminateCommit)
|
|
854
857
|
: this.renderCommitCMI(shouldTerminateCommit);
|
|
855
|
-
if ([enums
|
|
858
|
+
if ([enums.LogLevelEnum.DEBUG, "1", 1, "DEBUG"].includes(this.apiLogLevel)) {
|
|
856
859
|
console.debug("Commit (terminated: " + (terminateCommit ? "yes" : "no") + "): ");
|
|
857
860
|
console.debug(commitObject);
|
|
858
861
|
}
|
|
859
862
|
return commitObject;
|
|
860
863
|
};
|
|
861
864
|
BaseAPI.prototype.performFetch = function (url, params) {
|
|
862
|
-
return (0,tslib_es6
|
|
863
|
-
return (0,tslib_es6
|
|
865
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
866
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
864
867
|
return [2, fetch(url, {
|
|
865
868
|
method: "POST",
|
|
866
869
|
mode: this.settings.fetchMode,
|
|
867
870
|
body: params instanceof Array ? params.join("&") : JSON.stringify(params),
|
|
868
|
-
headers: (0,tslib_es6
|
|
871
|
+
headers: (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, this.settings.xhrHeaders), { "Content-Type": this.settings.commitRequestDataType }),
|
|
869
872
|
credentials: this.settings.xhrWithCredentials ? "include" : undefined,
|
|
870
873
|
keepalive: true,
|
|
871
874
|
})];
|
|
@@ -873,9 +876,9 @@ var BaseAPI = (function () {
|
|
|
873
876
|
});
|
|
874
877
|
};
|
|
875
878
|
BaseAPI.prototype.transformResponse = function (response) {
|
|
876
|
-
return (0,tslib_es6
|
|
879
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
877
880
|
var result, _a;
|
|
878
|
-
return (0,tslib_es6
|
|
881
|
+
return (0,tslib_es6.__generator)(this, function (_c) {
|
|
879
882
|
switch (_c.label) {
|
|
880
883
|
case 0:
|
|
881
884
|
if (!(typeof this.settings.responseHandler === "function")) return [3, 2];
|
|
@@ -891,8 +894,7 @@ var BaseAPI = (function () {
|
|
|
891
894
|
result = _a;
|
|
892
895
|
if (response.status >= 200 &&
|
|
893
896
|
response.status <= 299 &&
|
|
894
|
-
(result.result === true ||
|
|
895
|
-
result.result === api_constants/* default */.A.global.SCORM_TRUE)) {
|
|
897
|
+
(result.result === true || result.result === api_constants.global_constants.SCORM_TRUE)) {
|
|
896
898
|
this.processListeners("CommitSuccess");
|
|
897
899
|
}
|
|
898
900
|
else {
|
|
@@ -913,29 +915,40 @@ var BaseAPI = (function () {
|
|
|
913
915
|
/***/ 589:
|
|
914
916
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
915
917
|
|
|
918
|
+
__webpack_require__.r(__webpack_exports__);
|
|
916
919
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
917
|
-
/* harmony export */
|
|
920
|
+
/* harmony export */ CMIArray: function() { return /* binding */ CMIArray; }
|
|
918
921
|
/* harmony export */ });
|
|
919
|
-
/* unused harmony export scorm12_error_codes */
|
|
920
922
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635);
|
|
921
923
|
/* harmony import */ var _base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
922
|
-
/* harmony import */ var
|
|
923
|
-
/* harmony import */ var
|
|
924
|
+
/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(784);
|
|
925
|
+
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(797);
|
|
924
926
|
|
|
925
927
|
|
|
926
928
|
|
|
927
929
|
|
|
928
|
-
var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12;
|
|
929
930
|
var CMIArray = (function (_super) {
|
|
930
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_3__
|
|
931
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_3__.__extends)(CMIArray, _super);
|
|
931
932
|
function CMIArray(params) {
|
|
932
933
|
var _this = _super.call(this) || this;
|
|
933
934
|
_this.__children = params.children;
|
|
934
|
-
_this._errorCode = params.errorCode ||
|
|
935
|
-
_this._errorClass = params.errorClass ||
|
|
935
|
+
_this._errorCode = params.errorCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.GENERAL;
|
|
936
|
+
_this._errorClass = params.errorClass || _exceptions__WEBPACK_IMPORTED_MODULE_1__.BaseScormValidationError;
|
|
936
937
|
_this.childArray = [];
|
|
937
938
|
return _this;
|
|
938
939
|
}
|
|
940
|
+
CMIArray.prototype.reset = function (wipe) {
|
|
941
|
+
if (wipe === void 0) { wipe = false; }
|
|
942
|
+
this._initialized = false;
|
|
943
|
+
if (wipe) {
|
|
944
|
+
this.childArray = [];
|
|
945
|
+
}
|
|
946
|
+
else {
|
|
947
|
+
for (var i = 0; i < this.childArray.length; i++) {
|
|
948
|
+
this.childArray[i].reset();
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
};
|
|
939
952
|
Object.defineProperty(CMIArray.prototype, "_children", {
|
|
940
953
|
get: function () {
|
|
941
954
|
return this.__children;
|
|
@@ -966,7 +979,7 @@ var CMIArray = (function (_super) {
|
|
|
966
979
|
return result;
|
|
967
980
|
};
|
|
968
981
|
return CMIArray;
|
|
969
|
-
}(_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
982
|
+
}(_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
970
983
|
|
|
971
984
|
|
|
972
985
|
|
|
@@ -975,9 +988,10 @@ var CMIArray = (function (_super) {
|
|
|
975
988
|
/***/ 319:
|
|
976
989
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
977
990
|
|
|
991
|
+
__webpack_require__.r(__webpack_exports__);
|
|
978
992
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
979
|
-
/* harmony export */
|
|
980
|
-
/* harmony export */
|
|
993
|
+
/* harmony export */ BaseCMI: function() { return /* binding */ BaseCMI; },
|
|
994
|
+
/* harmony export */ BaseRootCMI: function() { return /* binding */ BaseRootCMI; }
|
|
981
995
|
/* harmony export */ });
|
|
982
996
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
983
997
|
|
|
@@ -1010,7 +1024,7 @@ var BaseCMI = (function () {
|
|
|
1010
1024
|
}());
|
|
1011
1025
|
|
|
1012
1026
|
var BaseRootCMI = (function (_super) {
|
|
1013
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_0__
|
|
1027
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(BaseRootCMI, _super);
|
|
1014
1028
|
function BaseRootCMI() {
|
|
1015
1029
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
1016
1030
|
}
|
|
@@ -1024,10 +1038,10 @@ var BaseRootCMI = (function (_super) {
|
|
|
1024
1038
|
/***/ 434:
|
|
1025
1039
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1026
1040
|
|
|
1041
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1027
1042
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1028
|
-
/* harmony export */
|
|
1043
|
+
/* harmony export */ CMIScore: function() { return /* binding */ CMIScore; }
|
|
1029
1044
|
/* harmony export */ });
|
|
1030
|
-
/* unused harmony export scorm12_error_codes */
|
|
1031
1045
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635);
|
|
1032
1046
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340);
|
|
1033
1047
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(417);
|
|
@@ -1040,30 +1054,30 @@ var BaseRootCMI = (function (_super) {
|
|
|
1040
1054
|
|
|
1041
1055
|
|
|
1042
1056
|
|
|
1043
|
-
var scorm12_constants = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12;
|
|
1044
|
-
var scorm12_regex = _constants_regex__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12;
|
|
1045
|
-
var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12;
|
|
1046
1057
|
var CMIScore = (function (_super) {
|
|
1047
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_4__
|
|
1058
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_4__.__extends)(CMIScore, _super);
|
|
1048
1059
|
function CMIScore(params) {
|
|
1049
1060
|
var _this = _super.call(this) || this;
|
|
1050
1061
|
_this._raw = "";
|
|
1051
1062
|
_this._min = "";
|
|
1052
|
-
_this.__children = params.score_children || scorm12_constants.score_children;
|
|
1063
|
+
_this.__children = params.score_children || _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__.scorm12_constants.score_children;
|
|
1053
1064
|
_this.__score_range = !params.score_range
|
|
1054
1065
|
? false
|
|
1055
|
-
: scorm12_regex.score_range;
|
|
1066
|
+
: _constants_regex__WEBPACK_IMPORTED_MODULE_1__.scorm12_regex.score_range;
|
|
1056
1067
|
_this._max = params.max || params.max === "" ? params.max : "100";
|
|
1057
1068
|
_this.__invalid_error_code =
|
|
1058
|
-
params.invalidErrorCode ||
|
|
1069
|
+
params.invalidErrorCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.INVALID_SET_VALUE;
|
|
1059
1070
|
_this.__invalid_type_code =
|
|
1060
|
-
params.invalidTypeCode ||
|
|
1071
|
+
params.invalidTypeCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.TYPE_MISMATCH;
|
|
1061
1072
|
_this.__invalid_range_code =
|
|
1062
|
-
params.invalidRangeCode ||
|
|
1063
|
-
_this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;
|
|
1073
|
+
params.invalidRangeCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.VALUE_OUT_OF_RANGE;
|
|
1074
|
+
_this.__decimal_regex = params.decimalRegex || _constants_regex__WEBPACK_IMPORTED_MODULE_1__.scorm12_regex.CMIDecimal;
|
|
1064
1075
|
_this.__error_class = params.errorClass;
|
|
1065
1076
|
return _this;
|
|
1066
1077
|
}
|
|
1078
|
+
CMIScore.prototype.reset = function () {
|
|
1079
|
+
this._initialized = false;
|
|
1080
|
+
};
|
|
1067
1081
|
Object.defineProperty(CMIScore.prototype, "_children", {
|
|
1068
1082
|
get: function () {
|
|
1069
1083
|
return this.__children;
|
|
@@ -1079,9 +1093,9 @@ var CMIScore = (function (_super) {
|
|
|
1079
1093
|
return this._raw;
|
|
1080
1094
|
},
|
|
1081
1095
|
set: function (raw) {
|
|
1082
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1096
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidFormat)(raw, this.__decimal_regex, this.__invalid_type_code, this.__error_class) &&
|
|
1083
1097
|
(!this.__score_range ||
|
|
1084
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1098
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidRange)(raw, this.__score_range, this.__invalid_range_code, this.__error_class))) {
|
|
1085
1099
|
this._raw = raw;
|
|
1086
1100
|
}
|
|
1087
1101
|
},
|
|
@@ -1093,9 +1107,9 @@ var CMIScore = (function (_super) {
|
|
|
1093
1107
|
return this._min;
|
|
1094
1108
|
},
|
|
1095
1109
|
set: function (min) {
|
|
1096
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1110
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidFormat)(min, this.__decimal_regex, this.__invalid_type_code, this.__error_class) &&
|
|
1097
1111
|
(!this.__score_range ||
|
|
1098
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1112
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidRange)(min, this.__score_range, this.__invalid_range_code, this.__error_class))) {
|
|
1099
1113
|
this._min = min;
|
|
1100
1114
|
}
|
|
1101
1115
|
},
|
|
@@ -1107,9 +1121,9 @@ var CMIScore = (function (_super) {
|
|
|
1107
1121
|
return this._max;
|
|
1108
1122
|
},
|
|
1109
1123
|
set: function (max) {
|
|
1110
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1124
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidFormat)(max, this.__decimal_regex, this.__invalid_type_code, this.__error_class) &&
|
|
1111
1125
|
(!this.__score_range ||
|
|
1112
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1126
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidRange)(max, this.__score_range, this.__invalid_range_code, this.__error_class))) {
|
|
1113
1127
|
this._max = max;
|
|
1114
1128
|
}
|
|
1115
1129
|
},
|
|
@@ -1127,7 +1141,7 @@ var CMIScore = (function (_super) {
|
|
|
1127
1141
|
return result;
|
|
1128
1142
|
};
|
|
1129
1143
|
return CMIScore;
|
|
1130
|
-
}(_base_cmi__WEBPACK_IMPORTED_MODULE_2__
|
|
1144
|
+
}(_base_cmi__WEBPACK_IMPORTED_MODULE_2__.BaseCMI));
|
|
1131
1145
|
|
|
1132
1146
|
|
|
1133
1147
|
|
|
@@ -1136,9 +1150,10 @@ var CMIScore = (function (_super) {
|
|
|
1136
1150
|
/***/ 449:
|
|
1137
1151
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1138
1152
|
|
|
1153
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1139
1154
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1140
|
-
/* harmony export */
|
|
1141
|
-
/* harmony export */
|
|
1155
|
+
/* harmony export */ checkValidFormat: function() { return /* binding */ checkValidFormat; },
|
|
1156
|
+
/* harmony export */ checkValidRange: function() { return /* binding */ checkValidRange; }
|
|
1142
1157
|
/* harmony export */ });
|
|
1143
1158
|
function checkValidFormat(value, regexPattern, errorCode, errorClass, allowEmptyString) {
|
|
1144
1159
|
if (typeof value !== "string") {
|
|
@@ -1176,10 +1191,12 @@ function checkValidRange(value, rangePattern, errorCode, errorClass) {
|
|
|
1176
1191
|
/***/ 989:
|
|
1177
1192
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1178
1193
|
|
|
1194
|
+
// ESM COMPAT FLAG
|
|
1195
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1179
1196
|
|
|
1180
1197
|
// EXPORTS
|
|
1181
1198
|
__webpack_require__.d(__webpack_exports__, {
|
|
1182
|
-
|
|
1199
|
+
CMI: function() { return /* binding */ CMI; }
|
|
1183
1200
|
});
|
|
1184
1201
|
|
|
1185
1202
|
// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs
|
|
@@ -1190,8 +1207,8 @@ var api_constants = __webpack_require__(340);
|
|
|
1190
1207
|
var error_codes = __webpack_require__(797);
|
|
1191
1208
|
// EXTERNAL MODULE: ./src/constants/regex.ts
|
|
1192
1209
|
var regex = __webpack_require__(417);
|
|
1193
|
-
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
1194
|
-
var
|
|
1210
|
+
// EXTERNAL MODULE: ./src/exceptions/scorm12_exceptions.ts
|
|
1211
|
+
var scorm12_exceptions = __webpack_require__(179);
|
|
1195
1212
|
// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts
|
|
1196
1213
|
var base_cmi = __webpack_require__(319);
|
|
1197
1214
|
// EXTERNAL MODULE: ./src/cmi/scorm12/validation.ts
|
|
@@ -1211,10 +1228,10 @@ var utilities = __webpack_require__(864);
|
|
|
1211
1228
|
|
|
1212
1229
|
|
|
1213
1230
|
var CMICore = (function (_super) {
|
|
1214
|
-
(0,tslib_es6
|
|
1231
|
+
(0,tslib_es6.__extends)(CMICore, _super);
|
|
1215
1232
|
function CMICore() {
|
|
1216
1233
|
var _this = _super.call(this) || this;
|
|
1217
|
-
_this.__children = api_constants
|
|
1234
|
+
_this.__children = api_constants.scorm12_constants.core_children;
|
|
1218
1235
|
_this._student_id = "";
|
|
1219
1236
|
_this._student_name = "";
|
|
1220
1237
|
_this._lesson_location = "";
|
|
@@ -1226,13 +1243,13 @@ var CMICore = (function (_super) {
|
|
|
1226
1243
|
_this._exit = "";
|
|
1227
1244
|
_this._session_time = "00:00:00";
|
|
1228
1245
|
_this._suspend_data = "";
|
|
1229
|
-
_this.score = new score
|
|
1230
|
-
score_children: api_constants
|
|
1231
|
-
score_range: regex
|
|
1232
|
-
invalidErrorCode: error_codes
|
|
1233
|
-
invalidTypeCode: error_codes
|
|
1234
|
-
invalidRangeCode: error_codes
|
|
1235
|
-
errorClass:
|
|
1246
|
+
_this.score = new score.CMIScore({
|
|
1247
|
+
score_children: api_constants.scorm12_constants.score_children,
|
|
1248
|
+
score_range: regex.scorm12_regex.score_range,
|
|
1249
|
+
invalidErrorCode: error_codes.scorm12_errors.INVALID_SET_VALUE,
|
|
1250
|
+
invalidTypeCode: error_codes.scorm12_errors.TYPE_MISMATCH,
|
|
1251
|
+
invalidRangeCode: error_codes.scorm12_errors.VALUE_OUT_OF_RANGE,
|
|
1252
|
+
errorClass: scorm12_exceptions.Scorm12ValidationError,
|
|
1236
1253
|
});
|
|
1237
1254
|
return _this;
|
|
1238
1255
|
}
|
|
@@ -1241,12 +1258,20 @@ var CMICore = (function (_super) {
|
|
|
1241
1258
|
_super.prototype.initialize.call(this);
|
|
1242
1259
|
(_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
1243
1260
|
};
|
|
1261
|
+
CMICore.prototype.reset = function () {
|
|
1262
|
+
var _a;
|
|
1263
|
+
this._initialized = false;
|
|
1264
|
+
this._exit = "";
|
|
1265
|
+
this._entry = "";
|
|
1266
|
+
this._session_time = "00:00:00";
|
|
1267
|
+
(_a = this.score) === null || _a === void 0 ? void 0 : _a.reset();
|
|
1268
|
+
};
|
|
1244
1269
|
Object.defineProperty(CMICore.prototype, "_children", {
|
|
1245
1270
|
get: function () {
|
|
1246
1271
|
return this.__children;
|
|
1247
1272
|
},
|
|
1248
1273
|
set: function (_children) {
|
|
1249
|
-
throw new
|
|
1274
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
1250
1275
|
},
|
|
1251
1276
|
enumerable: false,
|
|
1252
1277
|
configurable: true
|
|
@@ -1257,7 +1282,7 @@ var CMICore = (function (_super) {
|
|
|
1257
1282
|
},
|
|
1258
1283
|
set: function (student_id) {
|
|
1259
1284
|
if (this.initialized) {
|
|
1260
|
-
throw new
|
|
1285
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1261
1286
|
}
|
|
1262
1287
|
else {
|
|
1263
1288
|
this._student_id = student_id;
|
|
@@ -1272,7 +1297,7 @@ var CMICore = (function (_super) {
|
|
|
1272
1297
|
},
|
|
1273
1298
|
set: function (student_name) {
|
|
1274
1299
|
if (this.initialized) {
|
|
1275
|
-
throw new
|
|
1300
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1276
1301
|
}
|
|
1277
1302
|
else {
|
|
1278
1303
|
this._student_name = student_name;
|
|
@@ -1286,7 +1311,7 @@ var CMICore = (function (_super) {
|
|
|
1286
1311
|
return this._lesson_location;
|
|
1287
1312
|
},
|
|
1288
1313
|
set: function (lesson_location) {
|
|
1289
|
-
if ((0,validation
|
|
1314
|
+
if ((0,validation.check12ValidFormat)(lesson_location, regex.scorm12_regex.CMIString256, true)) {
|
|
1290
1315
|
this._lesson_location = lesson_location;
|
|
1291
1316
|
}
|
|
1292
1317
|
},
|
|
@@ -1299,7 +1324,7 @@ var CMICore = (function (_super) {
|
|
|
1299
1324
|
},
|
|
1300
1325
|
set: function (credit) {
|
|
1301
1326
|
if (this.initialized) {
|
|
1302
|
-
throw new
|
|
1327
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1303
1328
|
}
|
|
1304
1329
|
else {
|
|
1305
1330
|
this._credit = credit;
|
|
@@ -1314,12 +1339,12 @@ var CMICore = (function (_super) {
|
|
|
1314
1339
|
},
|
|
1315
1340
|
set: function (lesson_status) {
|
|
1316
1341
|
if (this.initialized) {
|
|
1317
|
-
if ((0,validation
|
|
1342
|
+
if ((0,validation.check12ValidFormat)(lesson_status, regex.scorm12_regex.CMIStatus)) {
|
|
1318
1343
|
this._lesson_status = lesson_status;
|
|
1319
1344
|
}
|
|
1320
1345
|
}
|
|
1321
1346
|
else {
|
|
1322
|
-
if ((0,validation
|
|
1347
|
+
if ((0,validation.check12ValidFormat)(lesson_status, regex.scorm12_regex.CMIStatus2)) {
|
|
1323
1348
|
this._lesson_status = lesson_status;
|
|
1324
1349
|
}
|
|
1325
1350
|
}
|
|
@@ -1333,7 +1358,7 @@ var CMICore = (function (_super) {
|
|
|
1333
1358
|
},
|
|
1334
1359
|
set: function (entry) {
|
|
1335
1360
|
if (this.initialized) {
|
|
1336
|
-
throw new
|
|
1361
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1337
1362
|
}
|
|
1338
1363
|
else {
|
|
1339
1364
|
this._entry = entry;
|
|
@@ -1348,7 +1373,7 @@ var CMICore = (function (_super) {
|
|
|
1348
1373
|
},
|
|
1349
1374
|
set: function (total_time) {
|
|
1350
1375
|
if (this.initialized) {
|
|
1351
|
-
throw new
|
|
1376
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1352
1377
|
}
|
|
1353
1378
|
else {
|
|
1354
1379
|
this._total_time = total_time;
|
|
@@ -1363,7 +1388,7 @@ var CMICore = (function (_super) {
|
|
|
1363
1388
|
},
|
|
1364
1389
|
set: function (lesson_mode) {
|
|
1365
1390
|
if (this.initialized) {
|
|
1366
|
-
throw new
|
|
1391
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1367
1392
|
}
|
|
1368
1393
|
else {
|
|
1369
1394
|
this._lesson_mode = lesson_mode;
|
|
@@ -1375,12 +1400,12 @@ var CMICore = (function (_super) {
|
|
|
1375
1400
|
Object.defineProperty(CMICore.prototype, "exit", {
|
|
1376
1401
|
get: function () {
|
|
1377
1402
|
if (!this.jsonString) {
|
|
1378
|
-
throw new
|
|
1403
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1379
1404
|
}
|
|
1380
1405
|
return this._exit;
|
|
1381
1406
|
},
|
|
1382
1407
|
set: function (exit) {
|
|
1383
|
-
if ((0,validation
|
|
1408
|
+
if ((0,validation.check12ValidFormat)(exit, regex.scorm12_regex.CMIExit, true)) {
|
|
1384
1409
|
this._exit = exit;
|
|
1385
1410
|
}
|
|
1386
1411
|
},
|
|
@@ -1390,12 +1415,12 @@ var CMICore = (function (_super) {
|
|
|
1390
1415
|
Object.defineProperty(CMICore.prototype, "session_time", {
|
|
1391
1416
|
get: function () {
|
|
1392
1417
|
if (!this.jsonString) {
|
|
1393
|
-
throw new
|
|
1418
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1394
1419
|
}
|
|
1395
1420
|
return this._session_time;
|
|
1396
1421
|
},
|
|
1397
1422
|
set: function (session_time) {
|
|
1398
|
-
if ((0,validation
|
|
1423
|
+
if ((0,validation.check12ValidFormat)(session_time, regex.scorm12_regex.CMITimespan)) {
|
|
1399
1424
|
this._session_time = session_time;
|
|
1400
1425
|
}
|
|
1401
1426
|
},
|
|
@@ -1407,7 +1432,7 @@ var CMICore = (function (_super) {
|
|
|
1407
1432
|
return this._suspend_data;
|
|
1408
1433
|
},
|
|
1409
1434
|
set: function (suspend_data) {
|
|
1410
|
-
if ((0,validation
|
|
1435
|
+
if ((0,validation.check12ValidFormat)(suspend_data, regex.scorm12_regex.CMIString4096, true)) {
|
|
1411
1436
|
this._suspend_data = suspend_data;
|
|
1412
1437
|
}
|
|
1413
1438
|
},
|
|
@@ -1419,9 +1444,9 @@ var CMICore = (function (_super) {
|
|
|
1419
1444
|
var startTime = start_time;
|
|
1420
1445
|
if (typeof startTime !== "undefined" && startTime !== null) {
|
|
1421
1446
|
var seconds = new Date().getTime() - startTime;
|
|
1422
|
-
sessionTime = utilities
|
|
1447
|
+
sessionTime = utilities.getSecondsAsHHMMSS(seconds / 1000);
|
|
1423
1448
|
}
|
|
1424
|
-
return utilities
|
|
1449
|
+
return utilities.addHHMMSSTimeStrings(this._total_time, sessionTime, new RegExp(regex.scorm12_regex.CMITimespan));
|
|
1425
1450
|
};
|
|
1426
1451
|
CMICore.prototype.toJSON = function () {
|
|
1427
1452
|
this.jsonString = true;
|
|
@@ -1441,7 +1466,7 @@ var CMICore = (function (_super) {
|
|
|
1441
1466
|
return result;
|
|
1442
1467
|
};
|
|
1443
1468
|
return CMICore;
|
|
1444
|
-
}(base_cmi
|
|
1469
|
+
}(base_cmi.BaseCMI));
|
|
1445
1470
|
|
|
1446
1471
|
|
|
1447
1472
|
// EXTERNAL MODULE: ./src/cmi/scorm12/objectives.ts
|
|
@@ -1466,7 +1491,7 @@ var interactions = __webpack_require__(833);
|
|
|
1466
1491
|
|
|
1467
1492
|
|
|
1468
1493
|
var CMI = (function (_super) {
|
|
1469
|
-
(0,tslib_es6
|
|
1494
|
+
(0,tslib_es6.__extends)(CMI, _super);
|
|
1470
1495
|
function CMI(cmi_children, student_data, initialized) {
|
|
1471
1496
|
var _this = _super.call(this) || this;
|
|
1472
1497
|
_this.__children = "";
|
|
@@ -1478,14 +1503,25 @@ var CMI = (function (_super) {
|
|
|
1478
1503
|
_this.initialize();
|
|
1479
1504
|
_this.__children = cmi_children
|
|
1480
1505
|
? cmi_children
|
|
1481
|
-
: api_constants
|
|
1506
|
+
: api_constants.scorm12_constants.cmi_children;
|
|
1482
1507
|
_this.core = new CMICore();
|
|
1483
|
-
_this.objectives = new objectives
|
|
1484
|
-
_this.student_data = student_data ? student_data : new scorm12_student_data
|
|
1485
|
-
_this.student_preference = new student_preference
|
|
1486
|
-
_this.interactions = new interactions
|
|
1508
|
+
_this.objectives = new objectives.CMIObjectives();
|
|
1509
|
+
_this.student_data = student_data ? student_data : new scorm12_student_data.CMIStudentData();
|
|
1510
|
+
_this.student_preference = new student_preference.CMIStudentPreference();
|
|
1511
|
+
_this.interactions = new interactions.CMIInteractions();
|
|
1487
1512
|
return _this;
|
|
1488
1513
|
}
|
|
1514
|
+
CMI.prototype.reset = function () {
|
|
1515
|
+
var _a, _b, _c;
|
|
1516
|
+
this._initialized = false;
|
|
1517
|
+
this._launch_data = "";
|
|
1518
|
+
this._comments = "";
|
|
1519
|
+
(_a = this.core) === null || _a === void 0 ? void 0 : _a.reset();
|
|
1520
|
+
this.objectives = new objectives.CMIObjectives();
|
|
1521
|
+
this.interactions = new interactions.CMIInteractions();
|
|
1522
|
+
(_b = this.student_data) === null || _b === void 0 ? void 0 : _b.reset();
|
|
1523
|
+
(_c = this.student_preference) === null || _c === void 0 ? void 0 : _c.reset();
|
|
1524
|
+
};
|
|
1489
1525
|
CMI.prototype.initialize = function () {
|
|
1490
1526
|
var _a, _b, _c, _d, _e;
|
|
1491
1527
|
_super.prototype.initialize.call(this);
|
|
@@ -1516,7 +1552,7 @@ var CMI = (function (_super) {
|
|
|
1516
1552
|
return this.__version;
|
|
1517
1553
|
},
|
|
1518
1554
|
set: function (_version) {
|
|
1519
|
-
throw new
|
|
1555
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
1520
1556
|
},
|
|
1521
1557
|
enumerable: false,
|
|
1522
1558
|
configurable: true
|
|
@@ -1526,7 +1562,7 @@ var CMI = (function (_super) {
|
|
|
1526
1562
|
return this.__children;
|
|
1527
1563
|
},
|
|
1528
1564
|
set: function (_children) {
|
|
1529
|
-
throw new
|
|
1565
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
1530
1566
|
},
|
|
1531
1567
|
enumerable: false,
|
|
1532
1568
|
configurable: true
|
|
@@ -1550,7 +1586,7 @@ var CMI = (function (_super) {
|
|
|
1550
1586
|
},
|
|
1551
1587
|
set: function (launch_data) {
|
|
1552
1588
|
if (this.initialized) {
|
|
1553
|
-
throw new
|
|
1589
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1554
1590
|
}
|
|
1555
1591
|
else {
|
|
1556
1592
|
this._launch_data = launch_data;
|
|
@@ -1564,7 +1600,7 @@ var CMI = (function (_super) {
|
|
|
1564
1600
|
return this._comments;
|
|
1565
1601
|
},
|
|
1566
1602
|
set: function (comments) {
|
|
1567
|
-
if ((0,validation
|
|
1603
|
+
if ((0,validation.check12ValidFormat)(comments, regex.scorm12_regex.CMIString4096, true)) {
|
|
1568
1604
|
this._comments = comments;
|
|
1569
1605
|
}
|
|
1570
1606
|
},
|
|
@@ -1577,7 +1613,7 @@ var CMI = (function (_super) {
|
|
|
1577
1613
|
},
|
|
1578
1614
|
set: function (comments_from_lms) {
|
|
1579
1615
|
if (this.initialized) {
|
|
1580
|
-
throw new
|
|
1616
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1581
1617
|
}
|
|
1582
1618
|
else {
|
|
1583
1619
|
this._comments_from_lms = comments_from_lms;
|
|
@@ -1590,7 +1626,7 @@ var CMI = (function (_super) {
|
|
|
1590
1626
|
return this.core.getCurrentTotalTime(this.start_time);
|
|
1591
1627
|
};
|
|
1592
1628
|
return CMI;
|
|
1593
|
-
}(base_cmi
|
|
1629
|
+
}(base_cmi.BaseRootCMI));
|
|
1594
1630
|
|
|
1595
1631
|
|
|
1596
1632
|
|
|
@@ -1599,17 +1635,18 @@ var CMI = (function (_super) {
|
|
|
1599
1635
|
/***/ 833:
|
|
1600
1636
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1601
1637
|
|
|
1638
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1602
1639
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1603
|
-
/* harmony export */
|
|
1604
|
-
/* harmony export */
|
|
1605
|
-
/* harmony export */
|
|
1606
|
-
/* harmony export */
|
|
1640
|
+
/* harmony export */ CMIInteractions: function() { return /* binding */ CMIInteractions; },
|
|
1641
|
+
/* harmony export */ CMIInteractionsCorrectResponsesObject: function() { return /* binding */ CMIInteractionsCorrectResponsesObject; },
|
|
1642
|
+
/* harmony export */ CMIInteractionsObject: function() { return /* binding */ CMIInteractionsObject; },
|
|
1643
|
+
/* harmony export */ CMIInteractionsObjectivesObject: function() { return /* binding */ CMIInteractionsObjectivesObject; }
|
|
1607
1644
|
/* harmony export */ });
|
|
1608
1645
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(635);
|
|
1609
1646
|
/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(589);
|
|
1610
1647
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
1611
1648
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(797);
|
|
1612
|
-
/* harmony import */ var
|
|
1649
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(179);
|
|
1613
1650
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(319);
|
|
1614
1651
|
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(915);
|
|
1615
1652
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(417);
|
|
@@ -1622,19 +1659,19 @@ var CMI = (function (_super) {
|
|
|
1622
1659
|
|
|
1623
1660
|
|
|
1624
1661
|
var CMIInteractions = (function (_super) {
|
|
1625
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
1662
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractions, _super);
|
|
1626
1663
|
function CMIInteractions() {
|
|
1627
1664
|
return _super.call(this, {
|
|
1628
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
1629
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__
|
|
1630
|
-
errorClass:
|
|
1665
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.interactions_children,
|
|
1666
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.INVALID_SET_VALUE,
|
|
1667
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError,
|
|
1631
1668
|
}) || this;
|
|
1632
1669
|
}
|
|
1633
1670
|
return CMIInteractions;
|
|
1634
|
-
}(_common_array__WEBPACK_IMPORTED_MODULE_0__
|
|
1671
|
+
}(_common_array__WEBPACK_IMPORTED_MODULE_0__.CMIArray));
|
|
1635
1672
|
|
|
1636
1673
|
var CMIInteractionsObject = (function (_super) {
|
|
1637
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
1674
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsObject, _super);
|
|
1638
1675
|
function CMIInteractionsObject() {
|
|
1639
1676
|
var _this = _super.call(this) || this;
|
|
1640
1677
|
_this._id = "";
|
|
@@ -1644,15 +1681,15 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1644
1681
|
_this._student_response = "";
|
|
1645
1682
|
_this._result = "";
|
|
1646
1683
|
_this._latency = "";
|
|
1647
|
-
_this.objectives = new _common_array__WEBPACK_IMPORTED_MODULE_0__
|
|
1648
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__
|
|
1649
|
-
errorClass:
|
|
1650
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
1684
|
+
_this.objectives = new _common_array__WEBPACK_IMPORTED_MODULE_0__.CMIArray({
|
|
1685
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.INVALID_SET_VALUE,
|
|
1686
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError,
|
|
1687
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.objectives_children,
|
|
1651
1688
|
});
|
|
1652
|
-
_this.correct_responses = new _common_array__WEBPACK_IMPORTED_MODULE_0__
|
|
1653
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__
|
|
1654
|
-
errorClass:
|
|
1655
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
1689
|
+
_this.correct_responses = new _common_array__WEBPACK_IMPORTED_MODULE_0__.CMIArray({
|
|
1690
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.INVALID_SET_VALUE,
|
|
1691
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError,
|
|
1692
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.correct_responses_children,
|
|
1656
1693
|
});
|
|
1657
1694
|
return _this;
|
|
1658
1695
|
}
|
|
@@ -1662,15 +1699,28 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1662
1699
|
(_a = this.objectives) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
1663
1700
|
(_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.initialize();
|
|
1664
1701
|
};
|
|
1702
|
+
CMIInteractionsObject.prototype.reset = function () {
|
|
1703
|
+
var _a, _b;
|
|
1704
|
+
this._initialized = false;
|
|
1705
|
+
this._id = "";
|
|
1706
|
+
this._time = "";
|
|
1707
|
+
this._type = "";
|
|
1708
|
+
this._weighting = "";
|
|
1709
|
+
this._student_response = "";
|
|
1710
|
+
this._result = "";
|
|
1711
|
+
this._latency = "";
|
|
1712
|
+
(_a = this.objectives) === null || _a === void 0 ? void 0 : _a.reset();
|
|
1713
|
+
(_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.reset();
|
|
1714
|
+
};
|
|
1665
1715
|
Object.defineProperty(CMIInteractionsObject.prototype, "id", {
|
|
1666
1716
|
get: function () {
|
|
1667
1717
|
if (!this.jsonString) {
|
|
1668
|
-
throw new
|
|
1718
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1669
1719
|
}
|
|
1670
1720
|
return this._id;
|
|
1671
1721
|
},
|
|
1672
1722
|
set: function (id) {
|
|
1673
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1723
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIIdentifier)) {
|
|
1674
1724
|
this._id = id;
|
|
1675
1725
|
}
|
|
1676
1726
|
},
|
|
@@ -1680,12 +1730,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1680
1730
|
Object.defineProperty(CMIInteractionsObject.prototype, "time", {
|
|
1681
1731
|
get: function () {
|
|
1682
1732
|
if (!this.jsonString) {
|
|
1683
|
-
throw new
|
|
1733
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1684
1734
|
}
|
|
1685
1735
|
return this._time;
|
|
1686
1736
|
},
|
|
1687
1737
|
set: function (time) {
|
|
1688
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1738
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(time, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMITime)) {
|
|
1689
1739
|
this._time = time;
|
|
1690
1740
|
}
|
|
1691
1741
|
},
|
|
@@ -1695,12 +1745,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1695
1745
|
Object.defineProperty(CMIInteractionsObject.prototype, "type", {
|
|
1696
1746
|
get: function () {
|
|
1697
1747
|
if (!this.jsonString) {
|
|
1698
|
-
throw new
|
|
1748
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1699
1749
|
}
|
|
1700
1750
|
return this._type;
|
|
1701
1751
|
},
|
|
1702
1752
|
set: function (type) {
|
|
1703
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1753
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(type, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIType)) {
|
|
1704
1754
|
this._type = type;
|
|
1705
1755
|
}
|
|
1706
1756
|
},
|
|
@@ -1710,13 +1760,13 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1710
1760
|
Object.defineProperty(CMIInteractionsObject.prototype, "weighting", {
|
|
1711
1761
|
get: function () {
|
|
1712
1762
|
if (!this.jsonString) {
|
|
1713
|
-
throw new
|
|
1763
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1714
1764
|
}
|
|
1715
1765
|
return this._weighting;
|
|
1716
1766
|
},
|
|
1717
1767
|
set: function (weighting) {
|
|
1718
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1719
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1768
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIDecimal) &&
|
|
1769
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidRange)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.weighting_range)) {
|
|
1720
1770
|
this._weighting = weighting;
|
|
1721
1771
|
}
|
|
1722
1772
|
},
|
|
@@ -1726,12 +1776,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1726
1776
|
Object.defineProperty(CMIInteractionsObject.prototype, "student_response", {
|
|
1727
1777
|
get: function () {
|
|
1728
1778
|
if (!this.jsonString) {
|
|
1729
|
-
throw new
|
|
1779
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1730
1780
|
}
|
|
1731
1781
|
return this._student_response;
|
|
1732
1782
|
},
|
|
1733
1783
|
set: function (student_response) {
|
|
1734
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1784
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(student_response, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIFeedback, true)) {
|
|
1735
1785
|
this._student_response = student_response;
|
|
1736
1786
|
}
|
|
1737
1787
|
},
|
|
@@ -1741,12 +1791,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1741
1791
|
Object.defineProperty(CMIInteractionsObject.prototype, "result", {
|
|
1742
1792
|
get: function () {
|
|
1743
1793
|
if (!this.jsonString) {
|
|
1744
|
-
throw new
|
|
1794
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1745
1795
|
}
|
|
1746
1796
|
return this._result;
|
|
1747
1797
|
},
|
|
1748
1798
|
set: function (result) {
|
|
1749
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1799
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(result, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIResult)) {
|
|
1750
1800
|
this._result = result;
|
|
1751
1801
|
}
|
|
1752
1802
|
},
|
|
@@ -1756,12 +1806,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1756
1806
|
Object.defineProperty(CMIInteractionsObject.prototype, "latency", {
|
|
1757
1807
|
get: function () {
|
|
1758
1808
|
if (!this.jsonString) {
|
|
1759
|
-
throw new
|
|
1809
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1760
1810
|
}
|
|
1761
1811
|
return this._latency;
|
|
1762
1812
|
},
|
|
1763
1813
|
set: function (latency) {
|
|
1764
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1814
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(latency, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMITimespan)) {
|
|
1765
1815
|
this._latency = latency;
|
|
1766
1816
|
}
|
|
1767
1817
|
},
|
|
@@ -1785,21 +1835,25 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1785
1835
|
return result;
|
|
1786
1836
|
};
|
|
1787
1837
|
return CMIInteractionsObject;
|
|
1788
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
1838
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
1789
1839
|
|
|
1790
1840
|
var CMIInteractionsObjectivesObject = (function (_super) {
|
|
1791
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
1841
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsObjectivesObject, _super);
|
|
1792
1842
|
function CMIInteractionsObjectivesObject() {
|
|
1793
1843
|
var _this = _super.call(this) || this;
|
|
1794
1844
|
_this._id = "";
|
|
1795
1845
|
return _this;
|
|
1796
1846
|
}
|
|
1847
|
+
CMIInteractionsObjectivesObject.prototype.reset = function () {
|
|
1848
|
+
this._initialized = false;
|
|
1849
|
+
this._id = "";
|
|
1850
|
+
};
|
|
1797
1851
|
Object.defineProperty(CMIInteractionsObjectivesObject.prototype, "id", {
|
|
1798
1852
|
get: function () {
|
|
1799
1853
|
return this._id;
|
|
1800
1854
|
},
|
|
1801
1855
|
set: function (id) {
|
|
1802
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1856
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIIdentifier)) {
|
|
1803
1857
|
this._id = id;
|
|
1804
1858
|
}
|
|
1805
1859
|
},
|
|
@@ -1815,24 +1869,28 @@ var CMIInteractionsObjectivesObject = (function (_super) {
|
|
|
1815
1869
|
return result;
|
|
1816
1870
|
};
|
|
1817
1871
|
return CMIInteractionsObjectivesObject;
|
|
1818
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
1872
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
1819
1873
|
|
|
1820
1874
|
var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
1821
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
1875
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsCorrectResponsesObject, _super);
|
|
1822
1876
|
function CMIInteractionsCorrectResponsesObject() {
|
|
1823
1877
|
var _this = _super.call(this) || this;
|
|
1824
1878
|
_this._pattern = "";
|
|
1825
1879
|
return _this;
|
|
1826
1880
|
}
|
|
1881
|
+
CMIInteractionsCorrectResponsesObject.prototype.reset = function () {
|
|
1882
|
+
this._initialized = false;
|
|
1883
|
+
this._pattern = "";
|
|
1884
|
+
};
|
|
1827
1885
|
Object.defineProperty(CMIInteractionsCorrectResponsesObject.prototype, "pattern", {
|
|
1828
1886
|
get: function () {
|
|
1829
1887
|
if (!this.jsonString) {
|
|
1830
|
-
throw new
|
|
1888
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1831
1889
|
}
|
|
1832
1890
|
return this._pattern;
|
|
1833
1891
|
},
|
|
1834
1892
|
set: function (pattern) {
|
|
1835
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1893
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(pattern, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIFeedback, true)) {
|
|
1836
1894
|
this._pattern = pattern;
|
|
1837
1895
|
}
|
|
1838
1896
|
},
|
|
@@ -1848,7 +1906,7 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
1848
1906
|
return result;
|
|
1849
1907
|
};
|
|
1850
1908
|
return CMIInteractionsCorrectResponsesObject;
|
|
1851
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
1909
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
1852
1910
|
|
|
1853
1911
|
|
|
1854
1912
|
|
|
@@ -1857,8 +1915,9 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
1857
1915
|
/***/ 331:
|
|
1858
1916
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1859
1917
|
|
|
1918
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1860
1919
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1861
|
-
/* harmony export */
|
|
1920
|
+
/* harmony export */ NAV: function() { return /* binding */ NAV; }
|
|
1862
1921
|
/* harmony export */ });
|
|
1863
1922
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635);
|
|
1864
1923
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
@@ -1869,18 +1928,22 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
1869
1928
|
|
|
1870
1929
|
|
|
1871
1930
|
var NAV = (function (_super) {
|
|
1872
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_3__
|
|
1931
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_3__.__extends)(NAV, _super);
|
|
1873
1932
|
function NAV() {
|
|
1874
1933
|
var _this = _super.call(this) || this;
|
|
1875
1934
|
_this._event = "";
|
|
1876
1935
|
return _this;
|
|
1877
1936
|
}
|
|
1937
|
+
NAV.prototype.reset = function () {
|
|
1938
|
+
this._event = "";
|
|
1939
|
+
this._initialized = false;
|
|
1940
|
+
};
|
|
1878
1941
|
Object.defineProperty(NAV.prototype, "event", {
|
|
1879
1942
|
get: function () {
|
|
1880
1943
|
return this._event;
|
|
1881
1944
|
},
|
|
1882
1945
|
set: function (event) {
|
|
1883
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_1__
|
|
1946
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_1__.check12ValidFormat)(event, _constants_regex__WEBPACK_IMPORTED_MODULE_2__.scorm12_regex.NAVEvent)) {
|
|
1884
1947
|
this._event = event;
|
|
1885
1948
|
}
|
|
1886
1949
|
},
|
|
@@ -1896,7 +1959,7 @@ var NAV = (function (_super) {
|
|
|
1896
1959
|
return result;
|
|
1897
1960
|
};
|
|
1898
1961
|
return NAV;
|
|
1899
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
1962
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
1900
1963
|
|
|
1901
1964
|
|
|
1902
1965
|
|
|
@@ -1905,9 +1968,10 @@ var NAV = (function (_super) {
|
|
|
1905
1968
|
/***/ 176:
|
|
1906
1969
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1907
1970
|
|
|
1971
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1908
1972
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1909
|
-
/* harmony export */
|
|
1910
|
-
/* harmony export */
|
|
1973
|
+
/* harmony export */ CMIObjectives: function() { return /* binding */ CMIObjectives; },
|
|
1974
|
+
/* harmony export */ CMIObjectivesObject: function() { return /* binding */ CMIObjectivesObject; }
|
|
1911
1975
|
/* harmony export */ });
|
|
1912
1976
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(635);
|
|
1913
1977
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
@@ -1915,7 +1979,7 @@ var NAV = (function (_super) {
|
|
|
1915
1979
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(340);
|
|
1916
1980
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(417);
|
|
1917
1981
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(797);
|
|
1918
|
-
/* harmony import */ var
|
|
1982
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(179);
|
|
1919
1983
|
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(915);
|
|
1920
1984
|
/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(589);
|
|
1921
1985
|
|
|
@@ -1928,39 +1992,46 @@ var NAV = (function (_super) {
|
|
|
1928
1992
|
|
|
1929
1993
|
|
|
1930
1994
|
var CMIObjectives = (function (_super) {
|
|
1931
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_8__
|
|
1995
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_8__.__extends)(CMIObjectives, _super);
|
|
1932
1996
|
function CMIObjectives() {
|
|
1933
1997
|
return _super.call(this, {
|
|
1934
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
1935
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
1936
|
-
errorClass:
|
|
1998
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.objectives_children,
|
|
1999
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.INVALID_SET_VALUE,
|
|
2000
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_5__.Scorm12ValidationError,
|
|
1937
2001
|
}) || this;
|
|
1938
2002
|
}
|
|
1939
2003
|
return CMIObjectives;
|
|
1940
|
-
}(_common_array__WEBPACK_IMPORTED_MODULE_7__
|
|
2004
|
+
}(_common_array__WEBPACK_IMPORTED_MODULE_7__.CMIArray));
|
|
1941
2005
|
|
|
1942
2006
|
var CMIObjectivesObject = (function (_super) {
|
|
1943
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_8__
|
|
2007
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_8__.__extends)(CMIObjectivesObject, _super);
|
|
1944
2008
|
function CMIObjectivesObject() {
|
|
1945
2009
|
var _this = _super.call(this) || this;
|
|
1946
2010
|
_this._id = "";
|
|
1947
2011
|
_this._status = "";
|
|
1948
|
-
_this.score = new _common_score__WEBPACK_IMPORTED_MODULE_1__
|
|
1949
|
-
score_children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
1950
|
-
score_range: _constants_regex__WEBPACK_IMPORTED_MODULE_3__
|
|
1951
|
-
invalidErrorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
1952
|
-
invalidTypeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
1953
|
-
invalidRangeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
1954
|
-
errorClass:
|
|
2012
|
+
_this.score = new _common_score__WEBPACK_IMPORTED_MODULE_1__.CMIScore({
|
|
2013
|
+
score_children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.score_children,
|
|
2014
|
+
score_range: _constants_regex__WEBPACK_IMPORTED_MODULE_3__.scorm12_regex.score_range,
|
|
2015
|
+
invalidErrorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.INVALID_SET_VALUE,
|
|
2016
|
+
invalidTypeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.TYPE_MISMATCH,
|
|
2017
|
+
invalidRangeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.VALUE_OUT_OF_RANGE,
|
|
2018
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_5__.Scorm12ValidationError,
|
|
1955
2019
|
});
|
|
1956
2020
|
return _this;
|
|
1957
2021
|
}
|
|
2022
|
+
CMIObjectivesObject.prototype.reset = function () {
|
|
2023
|
+
var _a;
|
|
2024
|
+
this._initialized = false;
|
|
2025
|
+
this._id = "";
|
|
2026
|
+
this._status = "";
|
|
2027
|
+
(_a = this.score) === null || _a === void 0 ? void 0 : _a.reset();
|
|
2028
|
+
};
|
|
1958
2029
|
Object.defineProperty(CMIObjectivesObject.prototype, "id", {
|
|
1959
2030
|
get: function () {
|
|
1960
2031
|
return this._id;
|
|
1961
2032
|
},
|
|
1962
2033
|
set: function (id) {
|
|
1963
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__
|
|
2034
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__.check12ValidFormat)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_3__.scorm12_regex.CMIIdentifier)) {
|
|
1964
2035
|
this._id = id;
|
|
1965
2036
|
}
|
|
1966
2037
|
},
|
|
@@ -1972,7 +2043,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
1972
2043
|
return this._status;
|
|
1973
2044
|
},
|
|
1974
2045
|
set: function (status) {
|
|
1975
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__
|
|
2046
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__.check12ValidFormat)(status, _constants_regex__WEBPACK_IMPORTED_MODULE_3__.scorm12_regex.CMIStatus2)) {
|
|
1976
2047
|
this._status = status;
|
|
1977
2048
|
}
|
|
1978
2049
|
},
|
|
@@ -1990,7 +2061,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
1990
2061
|
return result;
|
|
1991
2062
|
};
|
|
1992
2063
|
return CMIObjectivesObject;
|
|
1993
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
2064
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
1994
2065
|
|
|
1995
2066
|
|
|
1996
2067
|
|
|
@@ -1999,13 +2070,14 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
1999
2070
|
/***/ 532:
|
|
2000
2071
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2001
2072
|
|
|
2073
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2002
2074
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2003
|
-
/* harmony export */
|
|
2075
|
+
/* harmony export */ CMIStudentData: function() { return /* binding */ CMIStudentData; }
|
|
2004
2076
|
/* harmony export */ });
|
|
2005
2077
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635);
|
|
2006
2078
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
2007
2079
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
2008
|
-
/* harmony import */ var
|
|
2080
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(179);
|
|
2009
2081
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797);
|
|
2010
2082
|
|
|
2011
2083
|
|
|
@@ -2013,7 +2085,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2013
2085
|
|
|
2014
2086
|
|
|
2015
2087
|
var CMIStudentData = (function (_super) {
|
|
2016
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_4__
|
|
2088
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_4__.__extends)(CMIStudentData, _super);
|
|
2017
2089
|
function CMIStudentData(student_data_children) {
|
|
2018
2090
|
var _this = _super.call(this) || this;
|
|
2019
2091
|
_this._mastery_score = "";
|
|
@@ -2021,15 +2093,18 @@ var CMIStudentData = (function (_super) {
|
|
|
2021
2093
|
_this._time_limit_action = "";
|
|
2022
2094
|
_this.__children = student_data_children
|
|
2023
2095
|
? student_data_children
|
|
2024
|
-
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
2096
|
+
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.student_data_children;
|
|
2025
2097
|
return _this;
|
|
2026
2098
|
}
|
|
2099
|
+
CMIStudentData.prototype.reset = function () {
|
|
2100
|
+
this._initialized = false;
|
|
2101
|
+
};
|
|
2027
2102
|
Object.defineProperty(CMIStudentData.prototype, "_children", {
|
|
2028
2103
|
get: function () {
|
|
2029
2104
|
return this.__children;
|
|
2030
2105
|
},
|
|
2031
2106
|
set: function (_children) {
|
|
2032
|
-
throw new
|
|
2107
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.INVALID_SET_VALUE);
|
|
2033
2108
|
},
|
|
2034
2109
|
enumerable: false,
|
|
2035
2110
|
configurable: true
|
|
@@ -2040,7 +2115,7 @@ var CMIStudentData = (function (_super) {
|
|
|
2040
2115
|
},
|
|
2041
2116
|
set: function (mastery_score) {
|
|
2042
2117
|
if (this.initialized) {
|
|
2043
|
-
throw new
|
|
2118
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.READ_ONLY_ELEMENT);
|
|
2044
2119
|
}
|
|
2045
2120
|
else {
|
|
2046
2121
|
this._mastery_score = mastery_score;
|
|
@@ -2055,7 +2130,7 @@ var CMIStudentData = (function (_super) {
|
|
|
2055
2130
|
},
|
|
2056
2131
|
set: function (max_time_allowed) {
|
|
2057
2132
|
if (this.initialized) {
|
|
2058
|
-
throw new
|
|
2133
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.READ_ONLY_ELEMENT);
|
|
2059
2134
|
}
|
|
2060
2135
|
else {
|
|
2061
2136
|
this._max_time_allowed = max_time_allowed;
|
|
@@ -2070,7 +2145,7 @@ var CMIStudentData = (function (_super) {
|
|
|
2070
2145
|
},
|
|
2071
2146
|
set: function (time_limit_action) {
|
|
2072
2147
|
if (this.initialized) {
|
|
2073
|
-
throw new
|
|
2148
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.READ_ONLY_ELEMENT);
|
|
2074
2149
|
}
|
|
2075
2150
|
else {
|
|
2076
2151
|
this._time_limit_action = time_limit_action;
|
|
@@ -2090,7 +2165,7 @@ var CMIStudentData = (function (_super) {
|
|
|
2090
2165
|
return result;
|
|
2091
2166
|
};
|
|
2092
2167
|
return CMIStudentData;
|
|
2093
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
2168
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
2094
2169
|
|
|
2095
2170
|
|
|
2096
2171
|
|
|
@@ -2099,16 +2174,17 @@ var CMIStudentData = (function (_super) {
|
|
|
2099
2174
|
/***/ 181:
|
|
2100
2175
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2101
2176
|
|
|
2177
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2102
2178
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2103
|
-
/* harmony export */
|
|
2179
|
+
/* harmony export */ CMIStudentPreference: function() { return /* binding */ CMIStudentPreference; }
|
|
2104
2180
|
/* harmony export */ });
|
|
2105
2181
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(635);
|
|
2106
2182
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
2107
2183
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
2108
|
-
/* harmony import */ var
|
|
2109
|
-
/* harmony import */ var
|
|
2110
|
-
/* harmony import */ var
|
|
2111
|
-
/* harmony import */ var
|
|
2184
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(179);
|
|
2185
|
+
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(915);
|
|
2186
|
+
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(417);
|
|
2187
|
+
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(797);
|
|
2112
2188
|
|
|
2113
2189
|
|
|
2114
2190
|
|
|
@@ -2117,7 +2193,7 @@ var CMIStudentData = (function (_super) {
|
|
|
2117
2193
|
|
|
2118
2194
|
|
|
2119
2195
|
var CMIStudentPreference = (function (_super) {
|
|
2120
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_6__
|
|
2196
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_6__.__extends)(CMIStudentPreference, _super);
|
|
2121
2197
|
function CMIStudentPreference(student_preference_children) {
|
|
2122
2198
|
var _this = _super.call(this) || this;
|
|
2123
2199
|
_this._audio = "";
|
|
@@ -2126,15 +2202,18 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2126
2202
|
_this._text = "";
|
|
2127
2203
|
_this.__children = student_preference_children
|
|
2128
2204
|
? student_preference_children
|
|
2129
|
-
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
2205
|
+
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.student_preference_children;
|
|
2130
2206
|
return _this;
|
|
2131
2207
|
}
|
|
2208
|
+
CMIStudentPreference.prototype.reset = function () {
|
|
2209
|
+
this._initialized = false;
|
|
2210
|
+
};
|
|
2132
2211
|
Object.defineProperty(CMIStudentPreference.prototype, "_children", {
|
|
2133
2212
|
get: function () {
|
|
2134
2213
|
return this.__children;
|
|
2135
2214
|
},
|
|
2136
2215
|
set: function (_children) {
|
|
2137
|
-
throw new
|
|
2216
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_5__.scorm12_errors.INVALID_SET_VALUE);
|
|
2138
2217
|
},
|
|
2139
2218
|
enumerable: false,
|
|
2140
2219
|
configurable: true
|
|
@@ -2144,8 +2223,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2144
2223
|
return this._audio;
|
|
2145
2224
|
},
|
|
2146
2225
|
set: function (audio) {
|
|
2147
|
-
if ((0,
|
|
2148
|
-
(0,
|
|
2226
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMISInteger) &&
|
|
2227
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidRange)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.audio_range)) {
|
|
2149
2228
|
this._audio = audio;
|
|
2150
2229
|
}
|
|
2151
2230
|
},
|
|
@@ -2157,7 +2236,7 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2157
2236
|
return this._language;
|
|
2158
2237
|
},
|
|
2159
2238
|
set: function (language) {
|
|
2160
|
-
if ((0,
|
|
2239
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(language, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMIString256)) {
|
|
2161
2240
|
this._language = language;
|
|
2162
2241
|
}
|
|
2163
2242
|
},
|
|
@@ -2169,8 +2248,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2169
2248
|
return this._speed;
|
|
2170
2249
|
},
|
|
2171
2250
|
set: function (speed) {
|
|
2172
|
-
if ((0,
|
|
2173
|
-
(0,
|
|
2251
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMISInteger) &&
|
|
2252
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidRange)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.speed_range)) {
|
|
2174
2253
|
this._speed = speed;
|
|
2175
2254
|
}
|
|
2176
2255
|
},
|
|
@@ -2182,8 +2261,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2182
2261
|
return this._text;
|
|
2183
2262
|
},
|
|
2184
2263
|
set: function (text) {
|
|
2185
|
-
if ((0,
|
|
2186
|
-
(0,
|
|
2264
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMISInteger) &&
|
|
2265
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidRange)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.text_range)) {
|
|
2187
2266
|
this._text = text;
|
|
2188
2267
|
}
|
|
2189
2268
|
},
|
|
@@ -2202,7 +2281,7 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2202
2281
|
return result;
|
|
2203
2282
|
};
|
|
2204
2283
|
return CMIStudentPreference;
|
|
2205
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
2284
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
2206
2285
|
|
|
2207
2286
|
|
|
2208
2287
|
|
|
@@ -2211,24 +2290,25 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2211
2290
|
/***/ 915:
|
|
2212
2291
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2213
2292
|
|
|
2293
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2214
2294
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2215
|
-
/* harmony export */
|
|
2216
|
-
/* harmony export */
|
|
2295
|
+
/* harmony export */ check12ValidFormat: function() { return /* binding */ check12ValidFormat; },
|
|
2296
|
+
/* harmony export */ check12ValidRange: function() { return /* binding */ check12ValidRange; }
|
|
2217
2297
|
/* harmony export */ });
|
|
2218
2298
|
/* harmony import */ var _common_validation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(449);
|
|
2219
2299
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(797);
|
|
2220
|
-
/* harmony import */ var
|
|
2300
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(179);
|
|
2221
2301
|
|
|
2222
2302
|
|
|
2223
2303
|
|
|
2224
2304
|
function check12ValidFormat(value, regexPattern, allowEmptyString) {
|
|
2225
|
-
return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__
|
|
2305
|
+
return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__.checkValidFormat)(value, regexPattern, _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__.scorm12_errors.TYPE_MISMATCH, _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_1__.Scorm12ValidationError, allowEmptyString);
|
|
2226
2306
|
}
|
|
2227
2307
|
function check12ValidRange(value, rangePattern, allowEmptyString) {
|
|
2228
2308
|
if (!allowEmptyString && value === "") {
|
|
2229
|
-
throw new
|
|
2309
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_1__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_0__.scorm12_errors.VALUE_OUT_OF_RANGE);
|
|
2230
2310
|
}
|
|
2231
|
-
return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__
|
|
2311
|
+
return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__.checkValidRange)(value, rangePattern, _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__.scorm12_errors.VALUE_OUT_OF_RANGE, _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_1__.Scorm12ValidationError);
|
|
2232
2312
|
}
|
|
2233
2313
|
|
|
2234
2314
|
|
|
@@ -2237,16 +2317,23 @@ function check12ValidRange(value, rangePattern, allowEmptyString) {
|
|
|
2237
2317
|
/***/ 340:
|
|
2238
2318
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2239
2319
|
|
|
2320
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2321
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2322
|
+
/* harmony export */ aicc_constants: function() { return /* binding */ aicc_constants; },
|
|
2323
|
+
/* harmony export */ global_constants: function() { return /* binding */ global_constants; },
|
|
2324
|
+
/* harmony export */ scorm12_constants: function() { return /* binding */ scorm12_constants; },
|
|
2325
|
+
/* harmony export */ scorm2004_constants: function() { return /* binding */ scorm2004_constants; }
|
|
2326
|
+
/* harmony export */ });
|
|
2240
2327
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
2241
2328
|
|
|
2242
|
-
var
|
|
2329
|
+
var global_constants = {
|
|
2243
2330
|
SCORM_TRUE: "true",
|
|
2244
2331
|
SCORM_FALSE: "false",
|
|
2245
2332
|
STATE_NOT_INITIALIZED: 0,
|
|
2246
2333
|
STATE_INITIALIZED: 1,
|
|
2247
2334
|
STATE_TERMINATED: 2,
|
|
2248
2335
|
};
|
|
2249
|
-
var
|
|
2336
|
+
var scorm12_constants = {
|
|
2250
2337
|
cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",
|
|
2251
2338
|
core_children: "student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",
|
|
2252
2339
|
score_children: "raw,min,max",
|
|
@@ -2307,7 +2394,7 @@ var scorm12 = {
|
|
|
2307
2394
|
},
|
|
2308
2395
|
},
|
|
2309
2396
|
};
|
|
2310
|
-
var
|
|
2397
|
+
var aicc_constants = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, scorm12_constants), {
|
|
2311
2398
|
cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",
|
|
2312
2399
|
student_preference_children: "audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",
|
|
2313
2400
|
student_data_children: "attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",
|
|
@@ -2316,7 +2403,7 @@ var aicc = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__W
|
|
|
2316
2403
|
attempt_records_children: "score,lesson_status",
|
|
2317
2404
|
paths_children: "location_id,date,time,status,why_left,time_in_element",
|
|
2318
2405
|
});
|
|
2319
|
-
var
|
|
2406
|
+
var scorm2004_constants = {
|
|
2320
2407
|
cmi_children: "_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time",
|
|
2321
2408
|
comments_children: "comment,timestamp,location",
|
|
2322
2409
|
score_children: "max,raw,scaled,min",
|
|
@@ -2325,6 +2412,7 @@ var scorm2004 = {
|
|
|
2325
2412
|
student_data_children: "mastery_score,max_time_allowed,time_limit_action",
|
|
2326
2413
|
student_preference_children: "audio_level,audio_captioning,delivery_speed,language",
|
|
2327
2414
|
interactions_children: "id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",
|
|
2415
|
+
adl_data_children: "id,store",
|
|
2328
2416
|
error_descriptions: {
|
|
2329
2417
|
"0": {
|
|
2330
2418
|
basicMessage: "No Error",
|
|
@@ -2432,13 +2520,6 @@ var scorm2004 = {
|
|
|
2432
2520
|
},
|
|
2433
2521
|
},
|
|
2434
2522
|
};
|
|
2435
|
-
var APIConstants = {
|
|
2436
|
-
global: global,
|
|
2437
|
-
scorm12: scorm12,
|
|
2438
|
-
aicc: aicc,
|
|
2439
|
-
scorm2004: scorm2004,
|
|
2440
|
-
};
|
|
2441
|
-
/* harmony default export */ __webpack_exports__.A = (APIConstants);
|
|
2442
2523
|
|
|
2443
2524
|
|
|
2444
2525
|
/***/ }),
|
|
@@ -2446,12 +2527,13 @@ var APIConstants = {
|
|
|
2446
2527
|
/***/ 56:
|
|
2447
2528
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2448
2529
|
|
|
2530
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2449
2531
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2450
|
-
/* harmony export */
|
|
2451
|
-
/* harmony export */
|
|
2452
|
-
/* harmony export */
|
|
2532
|
+
/* harmony export */ CompletionStatus: function() { return /* binding */ CompletionStatus; },
|
|
2533
|
+
/* harmony export */ LogLevelEnum: function() { return /* binding */ LogLevelEnum; },
|
|
2534
|
+
/* harmony export */ NAVBoolean: function() { return /* binding */ NAVBoolean; },
|
|
2535
|
+
/* harmony export */ SuccessStatus: function() { return /* binding */ SuccessStatus; }
|
|
2453
2536
|
/* harmony export */ });
|
|
2454
|
-
/* unused harmony export NAVBoolean */
|
|
2455
2537
|
var NAVBoolean;
|
|
2456
2538
|
(function (NAVBoolean) {
|
|
2457
2539
|
NAVBoolean["unknown"] = "unknown";
|
|
@@ -2486,9 +2568,15 @@ var LogLevelEnum;
|
|
|
2486
2568
|
/***/ 797:
|
|
2487
2569
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2488
2570
|
|
|
2571
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2572
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2573
|
+
/* harmony export */ global_errors: function() { return /* binding */ global_errors; },
|
|
2574
|
+
/* harmony export */ scorm12_errors: function() { return /* binding */ scorm12_errors; },
|
|
2575
|
+
/* harmony export */ scorm2004_errors: function() { return /* binding */ scorm2004_errors; }
|
|
2576
|
+
/* harmony export */ });
|
|
2489
2577
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
2490
2578
|
|
|
2491
|
-
var
|
|
2579
|
+
var global_errors = {
|
|
2492
2580
|
GENERAL: 101,
|
|
2493
2581
|
INITIALIZATION_FAILED: 101,
|
|
2494
2582
|
INITIALIZED: 101,
|
|
@@ -2518,13 +2606,8 @@ var global = {
|
|
|
2518
2606
|
VALUE_OUT_OF_RANGE: 101,
|
|
2519
2607
|
DEPENDENCY_NOT_ESTABLISHED: 101,
|
|
2520
2608
|
};
|
|
2521
|
-
var
|
|
2522
|
-
var
|
|
2523
|
-
var ErrorCodes = {
|
|
2524
|
-
scorm12: scorm12,
|
|
2525
|
-
scorm2004: scorm2004,
|
|
2526
|
-
};
|
|
2527
|
-
/* harmony default export */ __webpack_exports__.A = (ErrorCodes);
|
|
2609
|
+
var scorm12_errors = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, global_errors), { RETRIEVE_BEFORE_INIT: 301, STORE_BEFORE_INIT: 301, COMMIT_BEFORE_INIT: 301, ARGUMENT_ERROR: 201, CHILDREN_ERROR: 202, COUNT_ERROR: 203, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 401, VALUE_NOT_INITIALIZED: 301, INVALID_SET_VALUE: 402, READ_ONLY_ELEMENT: 403, WRITE_ONLY_ELEMENT: 404, TYPE_MISMATCH: 405, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 });
|
|
2610
|
+
var scorm2004_errors = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, global_errors), { INITIALIZATION_FAILED: 102, INITIALIZED: 103, TERMINATED: 104, TERMINATION_FAILURE: 111, TERMINATION_BEFORE_INIT: 112, MULTIPLE_TERMINATIONS: 113, RETRIEVE_BEFORE_INIT: 122, RETRIEVE_AFTER_TERM: 123, STORE_BEFORE_INIT: 132, STORE_AFTER_TERM: 133, COMMIT_BEFORE_INIT: 142, COMMIT_AFTER_TERM: 143, ARGUMENT_ERROR: 201, GENERAL_GET_FAILURE: 301, GENERAL_SET_FAILURE: 351, GENERAL_COMMIT_FAILURE: 391, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 402, VALUE_NOT_INITIALIZED: 403, READ_ONLY_ELEMENT: 404, WRITE_ONLY_ELEMENT: 405, TYPE_MISMATCH: 406, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 });
|
|
2528
2611
|
|
|
2529
2612
|
|
|
2530
2613
|
/***/ }),
|
|
@@ -2532,9 +2615,15 @@ var ErrorCodes = {
|
|
|
2532
2615
|
/***/ 417:
|
|
2533
2616
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2534
2617
|
|
|
2618
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2619
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2620
|
+
/* harmony export */ aicc_regex: function() { return /* binding */ aicc_regex; },
|
|
2621
|
+
/* harmony export */ scorm12_regex: function() { return /* binding */ scorm12_regex; },
|
|
2622
|
+
/* harmony export */ scorm2004_regex: function() { return /* binding */ scorm2004_regex; }
|
|
2623
|
+
/* harmony export */ });
|
|
2535
2624
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
2536
2625
|
|
|
2537
|
-
var
|
|
2626
|
+
var scorm12_regex = {
|
|
2538
2627
|
CMIString256: "^.{0,255}$",
|
|
2539
2628
|
CMIString4096: "^.{0,4096}$",
|
|
2540
2629
|
CMITime: "^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",
|
|
@@ -2557,10 +2646,10 @@ var scorm12 = {
|
|
|
2557
2646
|
weighting_range: "-100#100",
|
|
2558
2647
|
text_range: "-1#1",
|
|
2559
2648
|
};
|
|
2560
|
-
var
|
|
2649
|
+
var aicc_regex = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, scorm12_regex), {
|
|
2561
2650
|
CMIIdentifier: "^\\w{1,255}$",
|
|
2562
2651
|
});
|
|
2563
|
-
var
|
|
2652
|
+
var scorm2004_regex = {
|
|
2564
2653
|
CMIString200: "^[\\u0000-\\uFFFF]{0,200}$",
|
|
2565
2654
|
CMIString250: "^[\\u0000-\\uFFFF]{0,250}$",
|
|
2566
2655
|
CMIString1000: "^[\\u0000-\\uFFFF]{0,1000}$",
|
|
@@ -2596,12 +2685,6 @@ var scorm2004 = {
|
|
|
2596
2685
|
text_range: "-1#1",
|
|
2597
2686
|
progress_range: "0#1",
|
|
2598
2687
|
};
|
|
2599
|
-
var Regex = {
|
|
2600
|
-
aicc: aicc,
|
|
2601
|
-
scorm12: scorm12,
|
|
2602
|
-
scorm2004: scorm2004,
|
|
2603
|
-
};
|
|
2604
|
-
/* harmony default export */ __webpack_exports__.A = (Regex);
|
|
2605
2688
|
|
|
2606
2689
|
|
|
2607
2690
|
/***/ }),
|
|
@@ -2609,21 +2692,15 @@ var Regex = {
|
|
|
2609
2692
|
/***/ 784:
|
|
2610
2693
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2611
2694
|
|
|
2695
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2612
2696
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2613
|
-
/* harmony export */
|
|
2614
|
-
/* harmony export */
|
|
2615
|
-
/* harmony export */ yI: function() { return /* binding */ ValidationError; }
|
|
2697
|
+
/* harmony export */ BaseScormValidationError: function() { return /* binding */ BaseScormValidationError; },
|
|
2698
|
+
/* harmony export */ ValidationError: function() { return /* binding */ ValidationError; }
|
|
2616
2699
|
/* harmony export */ });
|
|
2617
|
-
/*
|
|
2618
|
-
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(635);
|
|
2619
|
-
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340);
|
|
2620
|
-
|
|
2700
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
2621
2701
|
|
|
2622
|
-
var scorm12_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.error_descriptions;
|
|
2623
|
-
var aicc_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.aicc.error_descriptions;
|
|
2624
|
-
var scorm2004_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm2004.error_descriptions;
|
|
2625
2702
|
var BaseScormValidationError = (function (_super) {
|
|
2626
|
-
(0,
|
|
2703
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(BaseScormValidationError, _super);
|
|
2627
2704
|
function BaseScormValidationError(errorCode) {
|
|
2628
2705
|
var _this = _super.call(this, errorCode.toString()) || this;
|
|
2629
2706
|
_this._errorCode = errorCode;
|
|
@@ -2641,7 +2718,7 @@ var BaseScormValidationError = (function (_super) {
|
|
|
2641
2718
|
}(Error));
|
|
2642
2719
|
|
|
2643
2720
|
var ValidationError = (function (_super) {
|
|
2644
|
-
(0,
|
|
2721
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(ValidationError, _super);
|
|
2645
2722
|
function ValidationError(errorCode, errorMessage, detailedMessage) {
|
|
2646
2723
|
var _this = _super.call(this, errorCode) || this;
|
|
2647
2724
|
_this._detailedMessage = "";
|
|
@@ -2669,8 +2746,26 @@ var ValidationError = (function (_super) {
|
|
|
2669
2746
|
return ValidationError;
|
|
2670
2747
|
}(BaseScormValidationError));
|
|
2671
2748
|
|
|
2749
|
+
|
|
2750
|
+
|
|
2751
|
+
/***/ }),
|
|
2752
|
+
|
|
2753
|
+
/***/ 179:
|
|
2754
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2755
|
+
|
|
2756
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2757
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2758
|
+
/* harmony export */ Scorm12ValidationError: function() { return /* binding */ Scorm12ValidationError; }
|
|
2759
|
+
/* harmony export */ });
|
|
2760
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(635);
|
|
2761
|
+
/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(784);
|
|
2762
|
+
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
2763
|
+
|
|
2764
|
+
|
|
2765
|
+
|
|
2766
|
+
var scorm12_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.error_descriptions;
|
|
2672
2767
|
var Scorm12ValidationError = (function (_super) {
|
|
2673
|
-
(0,
|
|
2768
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_2__.__extends)(Scorm12ValidationError, _super);
|
|
2674
2769
|
function Scorm12ValidationError(errorCode) {
|
|
2675
2770
|
var _this = this;
|
|
2676
2771
|
if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {
|
|
@@ -2682,37 +2777,7 @@ var Scorm12ValidationError = (function (_super) {
|
|
|
2682
2777
|
return _this;
|
|
2683
2778
|
}
|
|
2684
2779
|
return Scorm12ValidationError;
|
|
2685
|
-
}(ValidationError));
|
|
2686
|
-
|
|
2687
|
-
var AICCValidationError = (function (_super) {
|
|
2688
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(AICCValidationError, _super);
|
|
2689
|
-
function AICCValidationError(errorCode) {
|
|
2690
|
-
var _this = this;
|
|
2691
|
-
if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {
|
|
2692
|
-
_this = _super.call(this, errorCode, aicc_errors[String(errorCode)].basicMessage, aicc_errors[String(errorCode)].detailMessage) || this;
|
|
2693
|
-
}
|
|
2694
|
-
else {
|
|
2695
|
-
_this = _super.call(this, 101, aicc_errors["101"].basicMessage, aicc_errors["101"].detailMessage) || this;
|
|
2696
|
-
}
|
|
2697
|
-
return _this;
|
|
2698
|
-
}
|
|
2699
|
-
return AICCValidationError;
|
|
2700
|
-
}(ValidationError));
|
|
2701
|
-
|
|
2702
|
-
var Scorm2004ValidationError = (function (_super) {
|
|
2703
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(Scorm2004ValidationError, _super);
|
|
2704
|
-
function Scorm2004ValidationError(errorCode) {
|
|
2705
|
-
var _this = this;
|
|
2706
|
-
if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {
|
|
2707
|
-
_this = _super.call(this, errorCode, scorm2004_errors[String(errorCode)].basicMessage, scorm2004_errors[String(errorCode)].detailMessage) || this;
|
|
2708
|
-
}
|
|
2709
|
-
else {
|
|
2710
|
-
_this = _super.call(this, 101, scorm2004_errors["101"].basicMessage, scorm2004_errors["101"].detailMessage) || this;
|
|
2711
|
-
}
|
|
2712
|
-
return _this;
|
|
2713
|
-
}
|
|
2714
|
-
return Scorm2004ValidationError;
|
|
2715
|
-
}(ValidationError));
|
|
2780
|
+
}(_exceptions__WEBPACK_IMPORTED_MODULE_0__.ValidationError));
|
|
2716
2781
|
|
|
2717
2782
|
|
|
2718
2783
|
|
|
@@ -2721,16 +2786,24 @@ var Scorm2004ValidationError = (function (_super) {
|
|
|
2721
2786
|
/***/ 864:
|
|
2722
2787
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2723
2788
|
|
|
2789
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2724
2790
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2725
|
-
/* harmony export */
|
|
2726
|
-
/* harmony export */
|
|
2727
|
-
/* harmony export */
|
|
2728
|
-
/* harmony export */
|
|
2729
|
-
/* harmony export */
|
|
2730
|
-
/* harmony export */
|
|
2731
|
-
/* harmony export */
|
|
2791
|
+
/* harmony export */ SECONDS_PER_DAY: function() { return /* binding */ SECONDS_PER_DAY; },
|
|
2792
|
+
/* harmony export */ SECONDS_PER_HOUR: function() { return /* binding */ SECONDS_PER_HOUR; },
|
|
2793
|
+
/* harmony export */ SECONDS_PER_MINUTE: function() { return /* binding */ SECONDS_PER_MINUTE; },
|
|
2794
|
+
/* harmony export */ SECONDS_PER_SECOND: function() { return /* binding */ SECONDS_PER_SECOND; },
|
|
2795
|
+
/* harmony export */ addHHMMSSTimeStrings: function() { return /* binding */ addHHMMSSTimeStrings; },
|
|
2796
|
+
/* harmony export */ addTwoDurations: function() { return /* binding */ addTwoDurations; },
|
|
2797
|
+
/* harmony export */ countDecimals: function() { return /* binding */ countDecimals; },
|
|
2798
|
+
/* harmony export */ flatten: function() { return /* binding */ flatten; },
|
|
2799
|
+
/* harmony export */ formatMessage: function() { return /* binding */ formatMessage; },
|
|
2800
|
+
/* harmony export */ getDurationAsSeconds: function() { return /* binding */ getDurationAsSeconds; },
|
|
2801
|
+
/* harmony export */ getSecondsAsHHMMSS: function() { return /* binding */ getSecondsAsHHMMSS; },
|
|
2802
|
+
/* harmony export */ getSecondsAsISODuration: function() { return /* binding */ getSecondsAsISODuration; },
|
|
2803
|
+
/* harmony export */ getTimeAsSeconds: function() { return /* binding */ getTimeAsSeconds; },
|
|
2804
|
+
/* harmony export */ stringMatches: function() { return /* binding */ stringMatches; },
|
|
2805
|
+
/* harmony export */ unflatten: function() { return /* binding */ unflatten; }
|
|
2732
2806
|
/* harmony export */ });
|
|
2733
|
-
/* unused harmony exports SECONDS_PER_SECOND, SECONDS_PER_MINUTE, SECONDS_PER_HOUR, SECONDS_PER_DAY, getSecondsAsISODuration, getDurationAsSeconds, addTwoDurations, countDecimals */
|
|
2734
2807
|
var SECONDS_PER_SECOND = 1.0;
|
|
2735
2808
|
var SECONDS_PER_MINUTE = 60;
|
|
2736
2809
|
var SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;
|
|
@@ -2922,13 +2995,40 @@ function stringMatches(str, tester) {
|
|
|
2922
2995
|
/***/ 635:
|
|
2923
2996
|
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
2924
2997
|
|
|
2998
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2925
2999
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2926
|
-
/* harmony export */
|
|
2927
|
-
/* harmony export */
|
|
2928
|
-
/* harmony export */
|
|
2929
|
-
/* harmony export */
|
|
3000
|
+
/* harmony export */ __addDisposableResource: function() { return /* binding */ __addDisposableResource; },
|
|
3001
|
+
/* harmony export */ __assign: function() { return /* binding */ __assign; },
|
|
3002
|
+
/* harmony export */ __asyncDelegator: function() { return /* binding */ __asyncDelegator; },
|
|
3003
|
+
/* harmony export */ __asyncGenerator: function() { return /* binding */ __asyncGenerator; },
|
|
3004
|
+
/* harmony export */ __asyncValues: function() { return /* binding */ __asyncValues; },
|
|
3005
|
+
/* harmony export */ __await: function() { return /* binding */ __await; },
|
|
3006
|
+
/* harmony export */ __awaiter: function() { return /* binding */ __awaiter; },
|
|
3007
|
+
/* harmony export */ __classPrivateFieldGet: function() { return /* binding */ __classPrivateFieldGet; },
|
|
3008
|
+
/* harmony export */ __classPrivateFieldIn: function() { return /* binding */ __classPrivateFieldIn; },
|
|
3009
|
+
/* harmony export */ __classPrivateFieldSet: function() { return /* binding */ __classPrivateFieldSet; },
|
|
3010
|
+
/* harmony export */ __createBinding: function() { return /* binding */ __createBinding; },
|
|
3011
|
+
/* harmony export */ __decorate: function() { return /* binding */ __decorate; },
|
|
3012
|
+
/* harmony export */ __disposeResources: function() { return /* binding */ __disposeResources; },
|
|
3013
|
+
/* harmony export */ __esDecorate: function() { return /* binding */ __esDecorate; },
|
|
3014
|
+
/* harmony export */ __exportStar: function() { return /* binding */ __exportStar; },
|
|
3015
|
+
/* harmony export */ __extends: function() { return /* binding */ __extends; },
|
|
3016
|
+
/* harmony export */ __generator: function() { return /* binding */ __generator; },
|
|
3017
|
+
/* harmony export */ __importDefault: function() { return /* binding */ __importDefault; },
|
|
3018
|
+
/* harmony export */ __importStar: function() { return /* binding */ __importStar; },
|
|
3019
|
+
/* harmony export */ __makeTemplateObject: function() { return /* binding */ __makeTemplateObject; },
|
|
3020
|
+
/* harmony export */ __metadata: function() { return /* binding */ __metadata; },
|
|
3021
|
+
/* harmony export */ __param: function() { return /* binding */ __param; },
|
|
3022
|
+
/* harmony export */ __propKey: function() { return /* binding */ __propKey; },
|
|
3023
|
+
/* harmony export */ __read: function() { return /* binding */ __read; },
|
|
3024
|
+
/* harmony export */ __rest: function() { return /* binding */ __rest; },
|
|
3025
|
+
/* harmony export */ __runInitializers: function() { return /* binding */ __runInitializers; },
|
|
3026
|
+
/* harmony export */ __setFunctionName: function() { return /* binding */ __setFunctionName; },
|
|
3027
|
+
/* harmony export */ __spread: function() { return /* binding */ __spread; },
|
|
3028
|
+
/* harmony export */ __spreadArray: function() { return /* binding */ __spreadArray; },
|
|
3029
|
+
/* harmony export */ __spreadArrays: function() { return /* binding */ __spreadArrays; },
|
|
3030
|
+
/* harmony export */ __values: function() { return /* binding */ __values; }
|
|
2930
3031
|
/* harmony export */ });
|
|
2931
|
-
/* 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 */
|
|
2932
3032
|
/******************************************************************************
|
|
2933
3033
|
Copyright (c) Microsoft Corporation.
|
|
2934
3034
|
|
|
@@ -3278,7 +3378,7 @@ function __disposeResources(env) {
|
|
|
3278
3378
|
return next();
|
|
3279
3379
|
}
|
|
3280
3380
|
|
|
3281
|
-
/*
|
|
3381
|
+
/* harmony default export */ __webpack_exports__["default"] = ({
|
|
3282
3382
|
__extends,
|
|
3283
3383
|
__assign,
|
|
3284
3384
|
__rest,
|
|
@@ -3355,10 +3455,22 @@ function __disposeResources(env) {
|
|
|
3355
3455
|
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
|
|
3356
3456
|
/******/ }();
|
|
3357
3457
|
/******/
|
|
3458
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
3459
|
+
/******/ !function() {
|
|
3460
|
+
/******/ // define __esModule on exports
|
|
3461
|
+
/******/ __webpack_require__.r = function(exports) {
|
|
3462
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
3463
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
3464
|
+
/******/ }
|
|
3465
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
3466
|
+
/******/ };
|
|
3467
|
+
/******/ }();
|
|
3468
|
+
/******/
|
|
3358
3469
|
/************************************************************************/
|
|
3359
3470
|
var __webpack_exports__ = {};
|
|
3471
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3360
3472
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3361
|
-
/* harmony export */
|
|
3473
|
+
/* harmony export */ Scorm12Impl: function() { return /* binding */ Scorm12Impl; }
|
|
3362
3474
|
/* harmony export */ });
|
|
3363
3475
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(635);
|
|
3364
3476
|
/* harmony import */ var _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(989);
|
|
@@ -3368,9 +3480,9 @@ var __webpack_exports__ = {};
|
|
|
3368
3480
|
/* harmony import */ var _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(176);
|
|
3369
3481
|
/* harmony import */ var _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(833);
|
|
3370
3482
|
/* harmony import */ var _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(331);
|
|
3371
|
-
/* harmony import */ var
|
|
3372
|
-
/* harmony import */ var
|
|
3373
|
-
/* harmony import */ var
|
|
3483
|
+
/* harmony import */ var _constants_enums__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(56);
|
|
3484
|
+
/* harmony import */ var _BaseAPI__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(429);
|
|
3485
|
+
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(417);
|
|
3374
3486
|
|
|
3375
3487
|
|
|
3376
3488
|
|
|
@@ -3384,7 +3496,7 @@ var __webpack_exports__ = {};
|
|
|
3384
3496
|
|
|
3385
3497
|
|
|
3386
3498
|
var Scorm12Impl = (function (_super) {
|
|
3387
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
3499
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_10__.__extends)(Scorm12Impl, _super);
|
|
3388
3500
|
function Scorm12Impl(settings) {
|
|
3389
3501
|
var _this = this;
|
|
3390
3502
|
if (settings) {
|
|
@@ -3392,10 +3504,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
3392
3504
|
settings.mastery_override = false;
|
|
3393
3505
|
}
|
|
3394
3506
|
}
|
|
3395
|
-
_this = _super.call(this, _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__
|
|
3507
|
+
_this = _super.call(this, _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors, settings) || this;
|
|
3396
3508
|
_this.statusSetByModule = false;
|
|
3397
|
-
_this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
3398
|
-
_this.nav = new _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__
|
|
3509
|
+
_this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__.CMI();
|
|
3510
|
+
_this.nav = new _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__.NAV();
|
|
3399
3511
|
_this.LMSInitialize = _this.lmsInitialize;
|
|
3400
3512
|
_this.LMSFinish = _this.lmsFinish;
|
|
3401
3513
|
_this.LMSGetValue = _this.lmsGetValue;
|
|
@@ -3407,9 +3519,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
3407
3519
|
return _this;
|
|
3408
3520
|
}
|
|
3409
3521
|
Scorm12Impl.prototype.reset = function (settings) {
|
|
3522
|
+
var _a, _b;
|
|
3410
3523
|
this.commonReset(settings);
|
|
3411
|
-
this.cmi
|
|
3412
|
-
this.nav
|
|
3524
|
+
(_a = this.cmi) === null || _a === void 0 ? void 0 : _a.reset();
|
|
3525
|
+
(_b = this.nav) === null || _b === void 0 ? void 0 : _b.reset();
|
|
3413
3526
|
};
|
|
3414
3527
|
Scorm12Impl.prototype.lmsInitialize = function () {
|
|
3415
3528
|
this.cmi.initialize();
|
|
@@ -3423,8 +3536,8 @@ var Scorm12Impl = (function (_super) {
|
|
|
3423
3536
|
};
|
|
3424
3537
|
Scorm12Impl.prototype.lmsFinish = function () {
|
|
3425
3538
|
var _this = this;
|
|
3426
|
-
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
3427
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
3539
|
+
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(_this, void 0, void 0, function () {
|
|
3540
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_a) {
|
|
3428
3541
|
switch (_a.label) {
|
|
3429
3542
|
case 0: return [4, this.internalFinish()];
|
|
3430
3543
|
case 1:
|
|
@@ -3433,17 +3546,17 @@ var Scorm12Impl = (function (_super) {
|
|
|
3433
3546
|
}
|
|
3434
3547
|
});
|
|
3435
3548
|
}); })();
|
|
3436
|
-
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
3549
|
+
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE;
|
|
3437
3550
|
};
|
|
3438
3551
|
Scorm12Impl.prototype.internalFinish = function () {
|
|
3439
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
3552
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(this, void 0, void 0, function () {
|
|
3440
3553
|
var result;
|
|
3441
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
3554
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_a) {
|
|
3442
3555
|
switch (_a.label) {
|
|
3443
3556
|
case 0: return [4, this.terminate("LMSFinish", true)];
|
|
3444
3557
|
case 1:
|
|
3445
3558
|
result = _a.sent();
|
|
3446
|
-
if (result === _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
3559
|
+
if (result === _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE) {
|
|
3447
3560
|
if (this.nav.event !== "") {
|
|
3448
3561
|
if (this.nav.event === "continue") {
|
|
3449
3562
|
this.processListeners("SequenceNext");
|
|
@@ -3476,8 +3589,8 @@ var Scorm12Impl = (function (_super) {
|
|
|
3476
3589
|
this.scheduleCommit(500, "LMSCommit");
|
|
3477
3590
|
}
|
|
3478
3591
|
else {
|
|
3479
|
-
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
3480
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
3592
|
+
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(_this, void 0, void 0, function () {
|
|
3593
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_a) {
|
|
3481
3594
|
switch (_a.label) {
|
|
3482
3595
|
case 0: return [4, this.commit("LMSCommit", false)];
|
|
3483
3596
|
case 1:
|
|
@@ -3487,7 +3600,7 @@ var Scorm12Impl = (function (_super) {
|
|
|
3487
3600
|
});
|
|
3488
3601
|
}); })();
|
|
3489
3602
|
}
|
|
3490
|
-
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
3603
|
+
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE;
|
|
3491
3604
|
};
|
|
3492
3605
|
Scorm12Impl.prototype.lmsGetLastError = function () {
|
|
3493
3606
|
return this.getLastError("LMSGetLastError");
|
|
@@ -3505,20 +3618,20 @@ var Scorm12Impl = (function (_super) {
|
|
|
3505
3618
|
return this._commonGetCMIValue("getCMIValue", false, CMIElement);
|
|
3506
3619
|
};
|
|
3507
3620
|
Scorm12Impl.prototype.getChildElement = function (CMIElement, _value, foundFirstIndex) {
|
|
3508
|
-
if ((0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
3509
|
-
return new _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__
|
|
3621
|
+
if ((0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.objectives\\.\\d+")) {
|
|
3622
|
+
return new _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__.CMIObjectivesObject();
|
|
3510
3623
|
}
|
|
3511
3624
|
else if (foundFirstIndex &&
|
|
3512
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
3513
|
-
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__
|
|
3625
|
+
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) {
|
|
3626
|
+
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__.CMIInteractionsCorrectResponsesObject();
|
|
3514
3627
|
}
|
|
3515
3628
|
else if (foundFirstIndex &&
|
|
3516
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
3517
|
-
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__
|
|
3629
|
+
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) {
|
|
3630
|
+
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__.CMIInteractionsObjectivesObject();
|
|
3518
3631
|
}
|
|
3519
3632
|
else if (!foundFirstIndex &&
|
|
3520
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
3521
|
-
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__
|
|
3633
|
+
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+")) {
|
|
3634
|
+
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__.CMIInteractionsObject();
|
|
3522
3635
|
}
|
|
3523
3636
|
return null;
|
|
3524
3637
|
};
|
|
@@ -3528,11 +3641,11 @@ var Scorm12Impl = (function (_super) {
|
|
|
3528
3641
|
var basicMessage = "No Error";
|
|
3529
3642
|
var detailMessage = "No Error";
|
|
3530
3643
|
errorNumber = String(errorNumber);
|
|
3531
|
-
if (_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
3644
|
+
if (_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber]) {
|
|
3532
3645
|
basicMessage =
|
|
3533
|
-
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
3646
|
+
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber].basicMessage;
|
|
3534
3647
|
detailMessage =
|
|
3535
|
-
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
3648
|
+
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber].detailMessage;
|
|
3536
3649
|
}
|
|
3537
3650
|
return detail ? detailMessage : basicMessage;
|
|
3538
3651
|
};
|
|
@@ -3545,10 +3658,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
3545
3658
|
cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();
|
|
3546
3659
|
}
|
|
3547
3660
|
var result = [];
|
|
3548
|
-
var flattened = _utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
3661
|
+
var flattened = _utilities__WEBPACK_IMPORTED_MODULE_1__.flatten(cmiExport);
|
|
3549
3662
|
switch (this.settings.dataCommitFormat) {
|
|
3550
3663
|
case "flattened":
|
|
3551
|
-
return _utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
3664
|
+
return _utilities__WEBPACK_IMPORTED_MODULE_1__.flatten(cmiExport);
|
|
3552
3665
|
case "params":
|
|
3553
3666
|
for (var item in flattened) {
|
|
3554
3667
|
if ({}.hasOwnProperty.call(flattened, item)) {
|
|
@@ -3564,20 +3677,20 @@ var Scorm12Impl = (function (_super) {
|
|
|
3564
3677
|
Scorm12Impl.prototype.renderCommitObject = function (terminateCommit) {
|
|
3565
3678
|
var cmiExport = this.renderCommitCMI(terminateCommit);
|
|
3566
3679
|
var totalTimeHHMMSS = this.cmi.getCurrentTotalTime();
|
|
3567
|
-
var totalTimeSeconds = _utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
3680
|
+
var totalTimeSeconds = _utilities__WEBPACK_IMPORTED_MODULE_1__.getTimeAsSeconds(totalTimeHHMMSS, _constants_regex__WEBPACK_IMPORTED_MODULE_9__.scorm12_regex.CMITimespan);
|
|
3568
3681
|
var lessonStatus = this.cmi.core.lesson_status;
|
|
3569
|
-
var completionStatus =
|
|
3570
|
-
var successStatus =
|
|
3682
|
+
var completionStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.unknown;
|
|
3683
|
+
var successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.unknown;
|
|
3571
3684
|
if (lessonStatus) {
|
|
3572
3685
|
completionStatus =
|
|
3573
3686
|
lessonStatus === "completed" || lessonStatus === "passed"
|
|
3574
|
-
?
|
|
3575
|
-
:
|
|
3687
|
+
? _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.completed
|
|
3688
|
+
: _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.incomplete;
|
|
3576
3689
|
if (lessonStatus === "passed") {
|
|
3577
|
-
successStatus =
|
|
3690
|
+
successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.passed;
|
|
3578
3691
|
}
|
|
3579
3692
|
else if (lessonStatus === "failed") {
|
|
3580
|
-
successStatus =
|
|
3693
|
+
successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.failed;
|
|
3581
3694
|
}
|
|
3582
3695
|
}
|
|
3583
3696
|
var score = this.cmi.core.score;
|
|
@@ -3606,10 +3719,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
3606
3719
|
return commitObject;
|
|
3607
3720
|
};
|
|
3608
3721
|
Scorm12Impl.prototype.storeData = function (terminateCommit) {
|
|
3609
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
3722
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(this, void 0, void 0, function () {
|
|
3610
3723
|
var originalStatus, commitObject;
|
|
3611
3724
|
var _a, _b, _c;
|
|
3612
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
3725
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_d) {
|
|
3613
3726
|
switch (_d.label) {
|
|
3614
3727
|
case 0:
|
|
3615
3728
|
if (terminateCommit) {
|
|
@@ -3644,7 +3757,7 @@ var Scorm12Impl = (function (_super) {
|
|
|
3644
3757
|
return [4, this.processHttpRequest(this.settings.lmsCommitUrl, commitObject, terminateCommit)];
|
|
3645
3758
|
case 1: return [2, _d.sent()];
|
|
3646
3759
|
case 2: return [2, {
|
|
3647
|
-
result: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
3760
|
+
result: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE,
|
|
3648
3761
|
errorCode: 0,
|
|
3649
3762
|
}];
|
|
3650
3763
|
}
|
|
@@ -3652,10 +3765,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
3652
3765
|
});
|
|
3653
3766
|
};
|
|
3654
3767
|
return Scorm12Impl;
|
|
3655
|
-
}(
|
|
3768
|
+
}(_BaseAPI__WEBPACK_IMPORTED_MODULE_8__["default"]));
|
|
3656
3769
|
|
|
3657
3770
|
|
|
3658
|
-
var __webpack_exports__Scorm12Impl = __webpack_exports__.
|
|
3771
|
+
var __webpack_exports__Scorm12Impl = __webpack_exports__.Scorm12Impl;
|
|
3659
3772
|
export { __webpack_exports__Scorm12Impl as Scorm12Impl };
|
|
3660
3773
|
|
|
3661
3774
|
//# sourceMappingURL=scorm12.js.map
|