scorm-again 2.5.0 → 2.6.1
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 +657 -489
- 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 +670 -489
- 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 +1113 -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 +512 -394
- 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 +678 -452
- 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 +1100 -728
- 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 +500 -394
- 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 +665 -452
- package/dist/scorm2004.js.map +1 -1
- package/dist/scorm2004.min.js +1 -1
- package/dist/scorm2004.min.js.map +1 -1
- package/dist_test.html +208 -0
- package/package.json +14 -14
- package/src/AICC.ts +6 -3
- package/src/BaseAPI.ts +43 -37
- package/src/Scorm12API.ts +17 -23
- package/src/Scorm2004API.ts +99 -42
- package/src/ScormAgain.ts +3 -7
- 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 +60 -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 +5 -1
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,11 +722,16 @@ 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) {
|
|
726
729
|
if (CMIElement === void 0) { CMIElement = ""; }
|
|
730
|
+
if ((!CMIElement || CMIElement === "") &&
|
|
731
|
+
!Object.hasOwnProperty.call(json, "cmi") &&
|
|
732
|
+
!Object.hasOwnProperty.call(json, "adl")) {
|
|
733
|
+
CMIElement = "cmi";
|
|
734
|
+
}
|
|
727
735
|
if (!this.isNotInitialized()) {
|
|
728
736
|
console.error("loadFromJSON can only be called before the call to lmsInitialize.");
|
|
729
737
|
return;
|
|
@@ -759,21 +767,21 @@ var BaseAPI = (function () {
|
|
|
759
767
|
return JSON.parse(this.renderCMIToJSONString());
|
|
760
768
|
};
|
|
761
769
|
BaseAPI.prototype.processHttpRequest = function (url_1, params_1) {
|
|
762
|
-
return (0,tslib_es6
|
|
770
|
+
return (0,tslib_es6.__awaiter)(this, arguments, void 0, function (url, params, immediate) {
|
|
763
771
|
var api, genericError, process;
|
|
764
772
|
var _this = this;
|
|
765
773
|
if (immediate === void 0) { immediate = false; }
|
|
766
|
-
return (0,tslib_es6
|
|
774
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
767
775
|
switch (_a.label) {
|
|
768
776
|
case 0:
|
|
769
777
|
api = this;
|
|
770
778
|
genericError = {
|
|
771
|
-
result: api_constants
|
|
779
|
+
result: api_constants.global_constants.SCORM_FALSE,
|
|
772
780
|
errorCode: this.error_codes.GENERAL,
|
|
773
781
|
};
|
|
774
782
|
if (immediate) {
|
|
775
|
-
this.performFetch(url, params).then(function (response) { return (0,tslib_es6
|
|
776
|
-
return (0,tslib_es6
|
|
783
|
+
this.performFetch(url, params).then(function (response) { return (0,tslib_es6.__awaiter)(_this, void 0, void 0, function () {
|
|
784
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
777
785
|
switch (_a.label) {
|
|
778
786
|
case 0: return [4, this.transformResponse(response)];
|
|
779
787
|
case 1:
|
|
@@ -783,13 +791,13 @@ var BaseAPI = (function () {
|
|
|
783
791
|
});
|
|
784
792
|
}); });
|
|
785
793
|
return [2, {
|
|
786
|
-
result: api_constants
|
|
794
|
+
result: api_constants.global_constants.SCORM_TRUE,
|
|
787
795
|
errorCode: 0,
|
|
788
796
|
}];
|
|
789
797
|
}
|
|
790
|
-
process = function (url, params, settings) { return (0,tslib_es6
|
|
798
|
+
process = function (url, params, settings) { return (0,tslib_es6.__awaiter)(_this, void 0, void 0, function () {
|
|
791
799
|
var response, e_1;
|
|
792
|
-
return (0,tslib_es6
|
|
800
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
793
801
|
switch (_a.label) {
|
|
794
802
|
case 0:
|
|
795
803
|
_a.trys.push([0, 2, , 3]);
|
|
@@ -800,7 +808,7 @@ var BaseAPI = (function () {
|
|
|
800
808
|
return [2, this.transformResponse(response)];
|
|
801
809
|
case 2:
|
|
802
810
|
e_1 = _a.sent();
|
|
803
|
-
this.apiLog("processHttpRequest", e_1, enums
|
|
811
|
+
this.apiLog("processHttpRequest", e_1, enums.LogLevelEnum.ERROR);
|
|
804
812
|
api.processListeners("CommitError");
|
|
805
813
|
return [2, genericError];
|
|
806
814
|
case 3: return [2];
|
|
@@ -816,14 +824,14 @@ var BaseAPI = (function () {
|
|
|
816
824
|
BaseAPI.prototype.scheduleCommit = function (when, callback) {
|
|
817
825
|
if (!this._timeout) {
|
|
818
826
|
this._timeout = new ScheduledCommit(this, when, callback);
|
|
819
|
-
this.apiLog("scheduleCommit", "scheduled", enums
|
|
827
|
+
this.apiLog("scheduleCommit", "scheduled", enums.LogLevelEnum.DEBUG, "");
|
|
820
828
|
}
|
|
821
829
|
};
|
|
822
830
|
BaseAPI.prototype.clearScheduledCommit = function () {
|
|
823
831
|
if (this._timeout) {
|
|
824
832
|
this._timeout.cancel();
|
|
825
833
|
this._timeout = undefined;
|
|
826
|
-
this.apiLog("clearScheduledCommit", "cleared", enums
|
|
834
|
+
this.apiLog("clearScheduledCommit", "cleared", enums.LogLevelEnum.DEBUG, "");
|
|
827
835
|
}
|
|
828
836
|
};
|
|
829
837
|
BaseAPI.prototype._checkObjectHasProperty = function (refObject, attribute) {
|
|
@@ -832,9 +840,9 @@ var BaseAPI = (function () {
|
|
|
832
840
|
attribute in refObject);
|
|
833
841
|
};
|
|
834
842
|
BaseAPI.prototype.handleValueAccessException = function (e, returnValue) {
|
|
835
|
-
if (e instanceof exceptions
|
|
843
|
+
if (e instanceof exceptions.ValidationError) {
|
|
836
844
|
this.lastErrorCode = String(e.errorCode);
|
|
837
|
-
returnValue = api_constants
|
|
845
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
838
846
|
}
|
|
839
847
|
else {
|
|
840
848
|
if (e instanceof Error && e.message) {
|
|
@@ -852,20 +860,20 @@ var BaseAPI = (function () {
|
|
|
852
860
|
var commitObject = this.settings.renderCommonCommitFields
|
|
853
861
|
? this.renderCommitObject(shouldTerminateCommit)
|
|
854
862
|
: this.renderCommitCMI(shouldTerminateCommit);
|
|
855
|
-
if ([enums
|
|
863
|
+
if ([enums.LogLevelEnum.DEBUG, "1", 1, "DEBUG"].includes(this.apiLogLevel)) {
|
|
856
864
|
console.debug("Commit (terminated: " + (terminateCommit ? "yes" : "no") + "): ");
|
|
857
865
|
console.debug(commitObject);
|
|
858
866
|
}
|
|
859
867
|
return commitObject;
|
|
860
868
|
};
|
|
861
869
|
BaseAPI.prototype.performFetch = function (url, params) {
|
|
862
|
-
return (0,tslib_es6
|
|
863
|
-
return (0,tslib_es6
|
|
870
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
871
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
864
872
|
return [2, fetch(url, {
|
|
865
873
|
method: "POST",
|
|
866
874
|
mode: this.settings.fetchMode,
|
|
867
875
|
body: params instanceof Array ? params.join("&") : JSON.stringify(params),
|
|
868
|
-
headers: (0,tslib_es6
|
|
876
|
+
headers: (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, this.settings.xhrHeaders), { "Content-Type": this.settings.commitRequestDataType }),
|
|
869
877
|
credentials: this.settings.xhrWithCredentials ? "include" : undefined,
|
|
870
878
|
keepalive: true,
|
|
871
879
|
})];
|
|
@@ -873,9 +881,9 @@ var BaseAPI = (function () {
|
|
|
873
881
|
});
|
|
874
882
|
};
|
|
875
883
|
BaseAPI.prototype.transformResponse = function (response) {
|
|
876
|
-
return (0,tslib_es6
|
|
884
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
877
885
|
var result, _a;
|
|
878
|
-
return (0,tslib_es6
|
|
886
|
+
return (0,tslib_es6.__generator)(this, function (_c) {
|
|
879
887
|
switch (_c.label) {
|
|
880
888
|
case 0:
|
|
881
889
|
if (!(typeof this.settings.responseHandler === "function")) return [3, 2];
|
|
@@ -891,8 +899,7 @@ var BaseAPI = (function () {
|
|
|
891
899
|
result = _a;
|
|
892
900
|
if (response.status >= 200 &&
|
|
893
901
|
response.status <= 299 &&
|
|
894
|
-
(result.result === true ||
|
|
895
|
-
result.result === api_constants/* default */.A.global.SCORM_TRUE)) {
|
|
902
|
+
(result.result === true || result.result === api_constants.global_constants.SCORM_TRUE)) {
|
|
896
903
|
this.processListeners("CommitSuccess");
|
|
897
904
|
}
|
|
898
905
|
else {
|
|
@@ -913,29 +920,40 @@ var BaseAPI = (function () {
|
|
|
913
920
|
/***/ 589:
|
|
914
921
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
915
922
|
|
|
923
|
+
__webpack_require__.r(__webpack_exports__);
|
|
916
924
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
917
|
-
/* harmony export */
|
|
925
|
+
/* harmony export */ CMIArray: function() { return /* binding */ CMIArray; }
|
|
918
926
|
/* harmony export */ });
|
|
919
|
-
/* unused harmony export scorm12_error_codes */
|
|
920
927
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635);
|
|
921
928
|
/* harmony import */ var _base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
922
|
-
/* harmony import */ var
|
|
923
|
-
/* harmony import */ var
|
|
929
|
+
/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(784);
|
|
930
|
+
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(797);
|
|
924
931
|
|
|
925
932
|
|
|
926
933
|
|
|
927
934
|
|
|
928
|
-
var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12;
|
|
929
935
|
var CMIArray = (function (_super) {
|
|
930
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_3__
|
|
936
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_3__.__extends)(CMIArray, _super);
|
|
931
937
|
function CMIArray(params) {
|
|
932
938
|
var _this = _super.call(this) || this;
|
|
933
939
|
_this.__children = params.children;
|
|
934
|
-
_this._errorCode = params.errorCode ||
|
|
935
|
-
_this._errorClass = params.errorClass ||
|
|
940
|
+
_this._errorCode = params.errorCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.GENERAL;
|
|
941
|
+
_this._errorClass = params.errorClass || _exceptions__WEBPACK_IMPORTED_MODULE_1__.BaseScormValidationError;
|
|
936
942
|
_this.childArray = [];
|
|
937
943
|
return _this;
|
|
938
944
|
}
|
|
945
|
+
CMIArray.prototype.reset = function (wipe) {
|
|
946
|
+
if (wipe === void 0) { wipe = false; }
|
|
947
|
+
this._initialized = false;
|
|
948
|
+
if (wipe) {
|
|
949
|
+
this.childArray = [];
|
|
950
|
+
}
|
|
951
|
+
else {
|
|
952
|
+
for (var i = 0; i < this.childArray.length; i++) {
|
|
953
|
+
this.childArray[i].reset();
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
};
|
|
939
957
|
Object.defineProperty(CMIArray.prototype, "_children", {
|
|
940
958
|
get: function () {
|
|
941
959
|
return this.__children;
|
|
@@ -966,7 +984,7 @@ var CMIArray = (function (_super) {
|
|
|
966
984
|
return result;
|
|
967
985
|
};
|
|
968
986
|
return CMIArray;
|
|
969
|
-
}(_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
987
|
+
}(_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
970
988
|
|
|
971
989
|
|
|
972
990
|
|
|
@@ -975,9 +993,10 @@ var CMIArray = (function (_super) {
|
|
|
975
993
|
/***/ 319:
|
|
976
994
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
977
995
|
|
|
996
|
+
__webpack_require__.r(__webpack_exports__);
|
|
978
997
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
979
|
-
/* harmony export */
|
|
980
|
-
/* harmony export */
|
|
998
|
+
/* harmony export */ BaseCMI: function() { return /* binding */ BaseCMI; },
|
|
999
|
+
/* harmony export */ BaseRootCMI: function() { return /* binding */ BaseRootCMI; }
|
|
981
1000
|
/* harmony export */ });
|
|
982
1001
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
983
1002
|
|
|
@@ -1010,7 +1029,7 @@ var BaseCMI = (function () {
|
|
|
1010
1029
|
}());
|
|
1011
1030
|
|
|
1012
1031
|
var BaseRootCMI = (function (_super) {
|
|
1013
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_0__
|
|
1032
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(BaseRootCMI, _super);
|
|
1014
1033
|
function BaseRootCMI() {
|
|
1015
1034
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
1016
1035
|
}
|
|
@@ -1024,10 +1043,10 @@ var BaseRootCMI = (function (_super) {
|
|
|
1024
1043
|
/***/ 434:
|
|
1025
1044
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1026
1045
|
|
|
1046
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1027
1047
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1028
|
-
/* harmony export */
|
|
1048
|
+
/* harmony export */ CMIScore: function() { return /* binding */ CMIScore; }
|
|
1029
1049
|
/* harmony export */ });
|
|
1030
|
-
/* unused harmony export scorm12_error_codes */
|
|
1031
1050
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635);
|
|
1032
1051
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340);
|
|
1033
1052
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(417);
|
|
@@ -1040,30 +1059,30 @@ var BaseRootCMI = (function (_super) {
|
|
|
1040
1059
|
|
|
1041
1060
|
|
|
1042
1061
|
|
|
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
1062
|
var CMIScore = (function (_super) {
|
|
1047
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_4__
|
|
1063
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_4__.__extends)(CMIScore, _super);
|
|
1048
1064
|
function CMIScore(params) {
|
|
1049
1065
|
var _this = _super.call(this) || this;
|
|
1050
1066
|
_this._raw = "";
|
|
1051
1067
|
_this._min = "";
|
|
1052
|
-
_this.__children = params.score_children || scorm12_constants.score_children;
|
|
1068
|
+
_this.__children = params.score_children || _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__.scorm12_constants.score_children;
|
|
1053
1069
|
_this.__score_range = !params.score_range
|
|
1054
1070
|
? false
|
|
1055
|
-
: scorm12_regex.score_range;
|
|
1071
|
+
: _constants_regex__WEBPACK_IMPORTED_MODULE_1__.scorm12_regex.score_range;
|
|
1056
1072
|
_this._max = params.max || params.max === "" ? params.max : "100";
|
|
1057
1073
|
_this.__invalid_error_code =
|
|
1058
|
-
params.invalidErrorCode ||
|
|
1074
|
+
params.invalidErrorCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.INVALID_SET_VALUE;
|
|
1059
1075
|
_this.__invalid_type_code =
|
|
1060
|
-
params.invalidTypeCode ||
|
|
1076
|
+
params.invalidTypeCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.TYPE_MISMATCH;
|
|
1061
1077
|
_this.__invalid_range_code =
|
|
1062
|
-
params.invalidRangeCode ||
|
|
1063
|
-
_this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;
|
|
1078
|
+
params.invalidRangeCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.VALUE_OUT_OF_RANGE;
|
|
1079
|
+
_this.__decimal_regex = params.decimalRegex || _constants_regex__WEBPACK_IMPORTED_MODULE_1__.scorm12_regex.CMIDecimal;
|
|
1064
1080
|
_this.__error_class = params.errorClass;
|
|
1065
1081
|
return _this;
|
|
1066
1082
|
}
|
|
1083
|
+
CMIScore.prototype.reset = function () {
|
|
1084
|
+
this._initialized = false;
|
|
1085
|
+
};
|
|
1067
1086
|
Object.defineProperty(CMIScore.prototype, "_children", {
|
|
1068
1087
|
get: function () {
|
|
1069
1088
|
return this.__children;
|
|
@@ -1079,9 +1098,9 @@ var CMIScore = (function (_super) {
|
|
|
1079
1098
|
return this._raw;
|
|
1080
1099
|
},
|
|
1081
1100
|
set: function (raw) {
|
|
1082
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1101
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidFormat)(raw, this.__decimal_regex, this.__invalid_type_code, this.__error_class) &&
|
|
1083
1102
|
(!this.__score_range ||
|
|
1084
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1103
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidRange)(raw, this.__score_range, this.__invalid_range_code, this.__error_class))) {
|
|
1085
1104
|
this._raw = raw;
|
|
1086
1105
|
}
|
|
1087
1106
|
},
|
|
@@ -1093,9 +1112,9 @@ var CMIScore = (function (_super) {
|
|
|
1093
1112
|
return this._min;
|
|
1094
1113
|
},
|
|
1095
1114
|
set: function (min) {
|
|
1096
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1115
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidFormat)(min, this.__decimal_regex, this.__invalid_type_code, this.__error_class) &&
|
|
1097
1116
|
(!this.__score_range ||
|
|
1098
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1117
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidRange)(min, this.__score_range, this.__invalid_range_code, this.__error_class))) {
|
|
1099
1118
|
this._min = min;
|
|
1100
1119
|
}
|
|
1101
1120
|
},
|
|
@@ -1107,9 +1126,9 @@ var CMIScore = (function (_super) {
|
|
|
1107
1126
|
return this._max;
|
|
1108
1127
|
},
|
|
1109
1128
|
set: function (max) {
|
|
1110
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1129
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidFormat)(max, this.__decimal_regex, this.__invalid_type_code, this.__error_class) &&
|
|
1111
1130
|
(!this.__score_range ||
|
|
1112
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1131
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidRange)(max, this.__score_range, this.__invalid_range_code, this.__error_class))) {
|
|
1113
1132
|
this._max = max;
|
|
1114
1133
|
}
|
|
1115
1134
|
},
|
|
@@ -1127,7 +1146,7 @@ var CMIScore = (function (_super) {
|
|
|
1127
1146
|
return result;
|
|
1128
1147
|
};
|
|
1129
1148
|
return CMIScore;
|
|
1130
|
-
}(_base_cmi__WEBPACK_IMPORTED_MODULE_2__
|
|
1149
|
+
}(_base_cmi__WEBPACK_IMPORTED_MODULE_2__.BaseCMI));
|
|
1131
1150
|
|
|
1132
1151
|
|
|
1133
1152
|
|
|
@@ -1136,9 +1155,10 @@ var CMIScore = (function (_super) {
|
|
|
1136
1155
|
/***/ 449:
|
|
1137
1156
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1138
1157
|
|
|
1158
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1139
1159
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1140
|
-
/* harmony export */
|
|
1141
|
-
/* harmony export */
|
|
1160
|
+
/* harmony export */ checkValidFormat: function() { return /* binding */ checkValidFormat; },
|
|
1161
|
+
/* harmony export */ checkValidRange: function() { return /* binding */ checkValidRange; }
|
|
1142
1162
|
/* harmony export */ });
|
|
1143
1163
|
function checkValidFormat(value, regexPattern, errorCode, errorClass, allowEmptyString) {
|
|
1144
1164
|
if (typeof value !== "string") {
|
|
@@ -1176,10 +1196,12 @@ function checkValidRange(value, rangePattern, errorCode, errorClass) {
|
|
|
1176
1196
|
/***/ 989:
|
|
1177
1197
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1178
1198
|
|
|
1199
|
+
// ESM COMPAT FLAG
|
|
1200
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1179
1201
|
|
|
1180
1202
|
// EXPORTS
|
|
1181
1203
|
__webpack_require__.d(__webpack_exports__, {
|
|
1182
|
-
|
|
1204
|
+
CMI: function() { return /* binding */ CMI; }
|
|
1183
1205
|
});
|
|
1184
1206
|
|
|
1185
1207
|
// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs
|
|
@@ -1190,8 +1212,8 @@ var api_constants = __webpack_require__(340);
|
|
|
1190
1212
|
var error_codes = __webpack_require__(797);
|
|
1191
1213
|
// EXTERNAL MODULE: ./src/constants/regex.ts
|
|
1192
1214
|
var regex = __webpack_require__(417);
|
|
1193
|
-
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
1194
|
-
var
|
|
1215
|
+
// EXTERNAL MODULE: ./src/exceptions/scorm12_exceptions.ts
|
|
1216
|
+
var scorm12_exceptions = __webpack_require__(179);
|
|
1195
1217
|
// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts
|
|
1196
1218
|
var base_cmi = __webpack_require__(319);
|
|
1197
1219
|
// EXTERNAL MODULE: ./src/cmi/scorm12/validation.ts
|
|
@@ -1211,10 +1233,10 @@ var utilities = __webpack_require__(864);
|
|
|
1211
1233
|
|
|
1212
1234
|
|
|
1213
1235
|
var CMICore = (function (_super) {
|
|
1214
|
-
(0,tslib_es6
|
|
1236
|
+
(0,tslib_es6.__extends)(CMICore, _super);
|
|
1215
1237
|
function CMICore() {
|
|
1216
1238
|
var _this = _super.call(this) || this;
|
|
1217
|
-
_this.__children = api_constants
|
|
1239
|
+
_this.__children = api_constants.scorm12_constants.core_children;
|
|
1218
1240
|
_this._student_id = "";
|
|
1219
1241
|
_this._student_name = "";
|
|
1220
1242
|
_this._lesson_location = "";
|
|
@@ -1226,13 +1248,13 @@ var CMICore = (function (_super) {
|
|
|
1226
1248
|
_this._exit = "";
|
|
1227
1249
|
_this._session_time = "00:00:00";
|
|
1228
1250
|
_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:
|
|
1251
|
+
_this.score = new score.CMIScore({
|
|
1252
|
+
score_children: api_constants.scorm12_constants.score_children,
|
|
1253
|
+
score_range: regex.scorm12_regex.score_range,
|
|
1254
|
+
invalidErrorCode: error_codes.scorm12_errors.INVALID_SET_VALUE,
|
|
1255
|
+
invalidTypeCode: error_codes.scorm12_errors.TYPE_MISMATCH,
|
|
1256
|
+
invalidRangeCode: error_codes.scorm12_errors.VALUE_OUT_OF_RANGE,
|
|
1257
|
+
errorClass: scorm12_exceptions.Scorm12ValidationError,
|
|
1236
1258
|
});
|
|
1237
1259
|
return _this;
|
|
1238
1260
|
}
|
|
@@ -1241,12 +1263,20 @@ var CMICore = (function (_super) {
|
|
|
1241
1263
|
_super.prototype.initialize.call(this);
|
|
1242
1264
|
(_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
1243
1265
|
};
|
|
1266
|
+
CMICore.prototype.reset = function () {
|
|
1267
|
+
var _a;
|
|
1268
|
+
this._initialized = false;
|
|
1269
|
+
this._exit = "";
|
|
1270
|
+
this._entry = "";
|
|
1271
|
+
this._session_time = "00:00:00";
|
|
1272
|
+
(_a = this.score) === null || _a === void 0 ? void 0 : _a.reset();
|
|
1273
|
+
};
|
|
1244
1274
|
Object.defineProperty(CMICore.prototype, "_children", {
|
|
1245
1275
|
get: function () {
|
|
1246
1276
|
return this.__children;
|
|
1247
1277
|
},
|
|
1248
1278
|
set: function (_children) {
|
|
1249
|
-
throw new
|
|
1279
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
1250
1280
|
},
|
|
1251
1281
|
enumerable: false,
|
|
1252
1282
|
configurable: true
|
|
@@ -1257,7 +1287,7 @@ var CMICore = (function (_super) {
|
|
|
1257
1287
|
},
|
|
1258
1288
|
set: function (student_id) {
|
|
1259
1289
|
if (this.initialized) {
|
|
1260
|
-
throw new
|
|
1290
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1261
1291
|
}
|
|
1262
1292
|
else {
|
|
1263
1293
|
this._student_id = student_id;
|
|
@@ -1272,7 +1302,7 @@ var CMICore = (function (_super) {
|
|
|
1272
1302
|
},
|
|
1273
1303
|
set: function (student_name) {
|
|
1274
1304
|
if (this.initialized) {
|
|
1275
|
-
throw new
|
|
1305
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1276
1306
|
}
|
|
1277
1307
|
else {
|
|
1278
1308
|
this._student_name = student_name;
|
|
@@ -1286,7 +1316,7 @@ var CMICore = (function (_super) {
|
|
|
1286
1316
|
return this._lesson_location;
|
|
1287
1317
|
},
|
|
1288
1318
|
set: function (lesson_location) {
|
|
1289
|
-
if ((0,validation
|
|
1319
|
+
if ((0,validation.check12ValidFormat)(lesson_location, regex.scorm12_regex.CMIString256, true)) {
|
|
1290
1320
|
this._lesson_location = lesson_location;
|
|
1291
1321
|
}
|
|
1292
1322
|
},
|
|
@@ -1299,7 +1329,7 @@ var CMICore = (function (_super) {
|
|
|
1299
1329
|
},
|
|
1300
1330
|
set: function (credit) {
|
|
1301
1331
|
if (this.initialized) {
|
|
1302
|
-
throw new
|
|
1332
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1303
1333
|
}
|
|
1304
1334
|
else {
|
|
1305
1335
|
this._credit = credit;
|
|
@@ -1314,12 +1344,12 @@ var CMICore = (function (_super) {
|
|
|
1314
1344
|
},
|
|
1315
1345
|
set: function (lesson_status) {
|
|
1316
1346
|
if (this.initialized) {
|
|
1317
|
-
if ((0,validation
|
|
1347
|
+
if ((0,validation.check12ValidFormat)(lesson_status, regex.scorm12_regex.CMIStatus)) {
|
|
1318
1348
|
this._lesson_status = lesson_status;
|
|
1319
1349
|
}
|
|
1320
1350
|
}
|
|
1321
1351
|
else {
|
|
1322
|
-
if ((0,validation
|
|
1352
|
+
if ((0,validation.check12ValidFormat)(lesson_status, regex.scorm12_regex.CMIStatus2)) {
|
|
1323
1353
|
this._lesson_status = lesson_status;
|
|
1324
1354
|
}
|
|
1325
1355
|
}
|
|
@@ -1333,7 +1363,7 @@ var CMICore = (function (_super) {
|
|
|
1333
1363
|
},
|
|
1334
1364
|
set: function (entry) {
|
|
1335
1365
|
if (this.initialized) {
|
|
1336
|
-
throw new
|
|
1366
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1337
1367
|
}
|
|
1338
1368
|
else {
|
|
1339
1369
|
this._entry = entry;
|
|
@@ -1348,7 +1378,7 @@ var CMICore = (function (_super) {
|
|
|
1348
1378
|
},
|
|
1349
1379
|
set: function (total_time) {
|
|
1350
1380
|
if (this.initialized) {
|
|
1351
|
-
throw new
|
|
1381
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1352
1382
|
}
|
|
1353
1383
|
else {
|
|
1354
1384
|
this._total_time = total_time;
|
|
@@ -1363,7 +1393,7 @@ var CMICore = (function (_super) {
|
|
|
1363
1393
|
},
|
|
1364
1394
|
set: function (lesson_mode) {
|
|
1365
1395
|
if (this.initialized) {
|
|
1366
|
-
throw new
|
|
1396
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1367
1397
|
}
|
|
1368
1398
|
else {
|
|
1369
1399
|
this._lesson_mode = lesson_mode;
|
|
@@ -1375,12 +1405,12 @@ var CMICore = (function (_super) {
|
|
|
1375
1405
|
Object.defineProperty(CMICore.prototype, "exit", {
|
|
1376
1406
|
get: function () {
|
|
1377
1407
|
if (!this.jsonString) {
|
|
1378
|
-
throw new
|
|
1408
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1379
1409
|
}
|
|
1380
1410
|
return this._exit;
|
|
1381
1411
|
},
|
|
1382
1412
|
set: function (exit) {
|
|
1383
|
-
if ((0,validation
|
|
1413
|
+
if ((0,validation.check12ValidFormat)(exit, regex.scorm12_regex.CMIExit, true)) {
|
|
1384
1414
|
this._exit = exit;
|
|
1385
1415
|
}
|
|
1386
1416
|
},
|
|
@@ -1390,12 +1420,12 @@ var CMICore = (function (_super) {
|
|
|
1390
1420
|
Object.defineProperty(CMICore.prototype, "session_time", {
|
|
1391
1421
|
get: function () {
|
|
1392
1422
|
if (!this.jsonString) {
|
|
1393
|
-
throw new
|
|
1423
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1394
1424
|
}
|
|
1395
1425
|
return this._session_time;
|
|
1396
1426
|
},
|
|
1397
1427
|
set: function (session_time) {
|
|
1398
|
-
if ((0,validation
|
|
1428
|
+
if ((0,validation.check12ValidFormat)(session_time, regex.scorm12_regex.CMITimespan)) {
|
|
1399
1429
|
this._session_time = session_time;
|
|
1400
1430
|
}
|
|
1401
1431
|
},
|
|
@@ -1407,7 +1437,7 @@ var CMICore = (function (_super) {
|
|
|
1407
1437
|
return this._suspend_data;
|
|
1408
1438
|
},
|
|
1409
1439
|
set: function (suspend_data) {
|
|
1410
|
-
if ((0,validation
|
|
1440
|
+
if ((0,validation.check12ValidFormat)(suspend_data, regex.scorm12_regex.CMIString4096, true)) {
|
|
1411
1441
|
this._suspend_data = suspend_data;
|
|
1412
1442
|
}
|
|
1413
1443
|
},
|
|
@@ -1419,9 +1449,9 @@ var CMICore = (function (_super) {
|
|
|
1419
1449
|
var startTime = start_time;
|
|
1420
1450
|
if (typeof startTime !== "undefined" && startTime !== null) {
|
|
1421
1451
|
var seconds = new Date().getTime() - startTime;
|
|
1422
|
-
sessionTime = utilities
|
|
1452
|
+
sessionTime = utilities.getSecondsAsHHMMSS(seconds / 1000);
|
|
1423
1453
|
}
|
|
1424
|
-
return utilities
|
|
1454
|
+
return utilities.addHHMMSSTimeStrings(this._total_time, sessionTime, new RegExp(regex.scorm12_regex.CMITimespan));
|
|
1425
1455
|
};
|
|
1426
1456
|
CMICore.prototype.toJSON = function () {
|
|
1427
1457
|
this.jsonString = true;
|
|
@@ -1441,7 +1471,7 @@ var CMICore = (function (_super) {
|
|
|
1441
1471
|
return result;
|
|
1442
1472
|
};
|
|
1443
1473
|
return CMICore;
|
|
1444
|
-
}(base_cmi
|
|
1474
|
+
}(base_cmi.BaseCMI));
|
|
1445
1475
|
|
|
1446
1476
|
|
|
1447
1477
|
// EXTERNAL MODULE: ./src/cmi/scorm12/objectives.ts
|
|
@@ -1466,7 +1496,7 @@ var interactions = __webpack_require__(833);
|
|
|
1466
1496
|
|
|
1467
1497
|
|
|
1468
1498
|
var CMI = (function (_super) {
|
|
1469
|
-
(0,tslib_es6
|
|
1499
|
+
(0,tslib_es6.__extends)(CMI, _super);
|
|
1470
1500
|
function CMI(cmi_children, student_data, initialized) {
|
|
1471
1501
|
var _this = _super.call(this) || this;
|
|
1472
1502
|
_this.__children = "";
|
|
@@ -1478,14 +1508,25 @@ var CMI = (function (_super) {
|
|
|
1478
1508
|
_this.initialize();
|
|
1479
1509
|
_this.__children = cmi_children
|
|
1480
1510
|
? cmi_children
|
|
1481
|
-
: api_constants
|
|
1511
|
+
: api_constants.scorm12_constants.cmi_children;
|
|
1482
1512
|
_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
|
|
1513
|
+
_this.objectives = new objectives.CMIObjectives();
|
|
1514
|
+
_this.student_data = student_data ? student_data : new scorm12_student_data.CMIStudentData();
|
|
1515
|
+
_this.student_preference = new student_preference.CMIStudentPreference();
|
|
1516
|
+
_this.interactions = new interactions.CMIInteractions();
|
|
1487
1517
|
return _this;
|
|
1488
1518
|
}
|
|
1519
|
+
CMI.prototype.reset = function () {
|
|
1520
|
+
var _a, _b, _c;
|
|
1521
|
+
this._initialized = false;
|
|
1522
|
+
this._launch_data = "";
|
|
1523
|
+
this._comments = "";
|
|
1524
|
+
(_a = this.core) === null || _a === void 0 ? void 0 : _a.reset();
|
|
1525
|
+
this.objectives = new objectives.CMIObjectives();
|
|
1526
|
+
this.interactions = new interactions.CMIInteractions();
|
|
1527
|
+
(_b = this.student_data) === null || _b === void 0 ? void 0 : _b.reset();
|
|
1528
|
+
(_c = this.student_preference) === null || _c === void 0 ? void 0 : _c.reset();
|
|
1529
|
+
};
|
|
1489
1530
|
CMI.prototype.initialize = function () {
|
|
1490
1531
|
var _a, _b, _c, _d, _e;
|
|
1491
1532
|
_super.prototype.initialize.call(this);
|
|
@@ -1516,7 +1557,7 @@ var CMI = (function (_super) {
|
|
|
1516
1557
|
return this.__version;
|
|
1517
1558
|
},
|
|
1518
1559
|
set: function (_version) {
|
|
1519
|
-
throw new
|
|
1560
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
1520
1561
|
},
|
|
1521
1562
|
enumerable: false,
|
|
1522
1563
|
configurable: true
|
|
@@ -1526,7 +1567,7 @@ var CMI = (function (_super) {
|
|
|
1526
1567
|
return this.__children;
|
|
1527
1568
|
},
|
|
1528
1569
|
set: function (_children) {
|
|
1529
|
-
throw new
|
|
1570
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
1530
1571
|
},
|
|
1531
1572
|
enumerable: false,
|
|
1532
1573
|
configurable: true
|
|
@@ -1550,7 +1591,7 @@ var CMI = (function (_super) {
|
|
|
1550
1591
|
},
|
|
1551
1592
|
set: function (launch_data) {
|
|
1552
1593
|
if (this.initialized) {
|
|
1553
|
-
throw new
|
|
1594
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1554
1595
|
}
|
|
1555
1596
|
else {
|
|
1556
1597
|
this._launch_data = launch_data;
|
|
@@ -1564,7 +1605,7 @@ var CMI = (function (_super) {
|
|
|
1564
1605
|
return this._comments;
|
|
1565
1606
|
},
|
|
1566
1607
|
set: function (comments) {
|
|
1567
|
-
if ((0,validation
|
|
1608
|
+
if ((0,validation.check12ValidFormat)(comments, regex.scorm12_regex.CMIString4096, true)) {
|
|
1568
1609
|
this._comments = comments;
|
|
1569
1610
|
}
|
|
1570
1611
|
},
|
|
@@ -1577,7 +1618,7 @@ var CMI = (function (_super) {
|
|
|
1577
1618
|
},
|
|
1578
1619
|
set: function (comments_from_lms) {
|
|
1579
1620
|
if (this.initialized) {
|
|
1580
|
-
throw new
|
|
1621
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
1581
1622
|
}
|
|
1582
1623
|
else {
|
|
1583
1624
|
this._comments_from_lms = comments_from_lms;
|
|
@@ -1590,7 +1631,7 @@ var CMI = (function (_super) {
|
|
|
1590
1631
|
return this.core.getCurrentTotalTime(this.start_time);
|
|
1591
1632
|
};
|
|
1592
1633
|
return CMI;
|
|
1593
|
-
}(base_cmi
|
|
1634
|
+
}(base_cmi.BaseRootCMI));
|
|
1594
1635
|
|
|
1595
1636
|
|
|
1596
1637
|
|
|
@@ -1599,17 +1640,18 @@ var CMI = (function (_super) {
|
|
|
1599
1640
|
/***/ 833:
|
|
1600
1641
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1601
1642
|
|
|
1643
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1602
1644
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1603
|
-
/* harmony export */
|
|
1604
|
-
/* harmony export */
|
|
1605
|
-
/* harmony export */
|
|
1606
|
-
/* harmony export */
|
|
1645
|
+
/* harmony export */ CMIInteractions: function() { return /* binding */ CMIInteractions; },
|
|
1646
|
+
/* harmony export */ CMIInteractionsCorrectResponsesObject: function() { return /* binding */ CMIInteractionsCorrectResponsesObject; },
|
|
1647
|
+
/* harmony export */ CMIInteractionsObject: function() { return /* binding */ CMIInteractionsObject; },
|
|
1648
|
+
/* harmony export */ CMIInteractionsObjectivesObject: function() { return /* binding */ CMIInteractionsObjectivesObject; }
|
|
1607
1649
|
/* harmony export */ });
|
|
1608
1650
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(635);
|
|
1609
1651
|
/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(589);
|
|
1610
1652
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
1611
1653
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(797);
|
|
1612
|
-
/* harmony import */ var
|
|
1654
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(179);
|
|
1613
1655
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(319);
|
|
1614
1656
|
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(915);
|
|
1615
1657
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(417);
|
|
@@ -1622,19 +1664,19 @@ var CMI = (function (_super) {
|
|
|
1622
1664
|
|
|
1623
1665
|
|
|
1624
1666
|
var CMIInteractions = (function (_super) {
|
|
1625
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
1667
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractions, _super);
|
|
1626
1668
|
function CMIInteractions() {
|
|
1627
1669
|
return _super.call(this, {
|
|
1628
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
1629
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__
|
|
1630
|
-
errorClass:
|
|
1670
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.interactions_children,
|
|
1671
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.INVALID_SET_VALUE,
|
|
1672
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError,
|
|
1631
1673
|
}) || this;
|
|
1632
1674
|
}
|
|
1633
1675
|
return CMIInteractions;
|
|
1634
|
-
}(_common_array__WEBPACK_IMPORTED_MODULE_0__
|
|
1676
|
+
}(_common_array__WEBPACK_IMPORTED_MODULE_0__.CMIArray));
|
|
1635
1677
|
|
|
1636
1678
|
var CMIInteractionsObject = (function (_super) {
|
|
1637
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
1679
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsObject, _super);
|
|
1638
1680
|
function CMIInteractionsObject() {
|
|
1639
1681
|
var _this = _super.call(this) || this;
|
|
1640
1682
|
_this._id = "";
|
|
@@ -1644,15 +1686,15 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1644
1686
|
_this._student_response = "";
|
|
1645
1687
|
_this._result = "";
|
|
1646
1688
|
_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__
|
|
1689
|
+
_this.objectives = 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.objectives_children,
|
|
1651
1693
|
});
|
|
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__
|
|
1694
|
+
_this.correct_responses = new _common_array__WEBPACK_IMPORTED_MODULE_0__.CMIArray({
|
|
1695
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.INVALID_SET_VALUE,
|
|
1696
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError,
|
|
1697
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.correct_responses_children,
|
|
1656
1698
|
});
|
|
1657
1699
|
return _this;
|
|
1658
1700
|
}
|
|
@@ -1662,15 +1704,28 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1662
1704
|
(_a = this.objectives) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
1663
1705
|
(_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.initialize();
|
|
1664
1706
|
};
|
|
1707
|
+
CMIInteractionsObject.prototype.reset = function () {
|
|
1708
|
+
var _a, _b;
|
|
1709
|
+
this._initialized = false;
|
|
1710
|
+
this._id = "";
|
|
1711
|
+
this._time = "";
|
|
1712
|
+
this._type = "";
|
|
1713
|
+
this._weighting = "";
|
|
1714
|
+
this._student_response = "";
|
|
1715
|
+
this._result = "";
|
|
1716
|
+
this._latency = "";
|
|
1717
|
+
(_a = this.objectives) === null || _a === void 0 ? void 0 : _a.reset();
|
|
1718
|
+
(_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.reset();
|
|
1719
|
+
};
|
|
1665
1720
|
Object.defineProperty(CMIInteractionsObject.prototype, "id", {
|
|
1666
1721
|
get: function () {
|
|
1667
1722
|
if (!this.jsonString) {
|
|
1668
|
-
throw new
|
|
1723
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1669
1724
|
}
|
|
1670
1725
|
return this._id;
|
|
1671
1726
|
},
|
|
1672
1727
|
set: function (id) {
|
|
1673
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1728
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIIdentifier)) {
|
|
1674
1729
|
this._id = id;
|
|
1675
1730
|
}
|
|
1676
1731
|
},
|
|
@@ -1680,12 +1735,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1680
1735
|
Object.defineProperty(CMIInteractionsObject.prototype, "time", {
|
|
1681
1736
|
get: function () {
|
|
1682
1737
|
if (!this.jsonString) {
|
|
1683
|
-
throw new
|
|
1738
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1684
1739
|
}
|
|
1685
1740
|
return this._time;
|
|
1686
1741
|
},
|
|
1687
1742
|
set: function (time) {
|
|
1688
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1743
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(time, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMITime)) {
|
|
1689
1744
|
this._time = time;
|
|
1690
1745
|
}
|
|
1691
1746
|
},
|
|
@@ -1695,12 +1750,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1695
1750
|
Object.defineProperty(CMIInteractionsObject.prototype, "type", {
|
|
1696
1751
|
get: function () {
|
|
1697
1752
|
if (!this.jsonString) {
|
|
1698
|
-
throw new
|
|
1753
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1699
1754
|
}
|
|
1700
1755
|
return this._type;
|
|
1701
1756
|
},
|
|
1702
1757
|
set: function (type) {
|
|
1703
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1758
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(type, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIType)) {
|
|
1704
1759
|
this._type = type;
|
|
1705
1760
|
}
|
|
1706
1761
|
},
|
|
@@ -1710,13 +1765,13 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1710
1765
|
Object.defineProperty(CMIInteractionsObject.prototype, "weighting", {
|
|
1711
1766
|
get: function () {
|
|
1712
1767
|
if (!this.jsonString) {
|
|
1713
|
-
throw new
|
|
1768
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1714
1769
|
}
|
|
1715
1770
|
return this._weighting;
|
|
1716
1771
|
},
|
|
1717
1772
|
set: function (weighting) {
|
|
1718
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1719
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1773
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIDecimal) &&
|
|
1774
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidRange)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.weighting_range)) {
|
|
1720
1775
|
this._weighting = weighting;
|
|
1721
1776
|
}
|
|
1722
1777
|
},
|
|
@@ -1726,12 +1781,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1726
1781
|
Object.defineProperty(CMIInteractionsObject.prototype, "student_response", {
|
|
1727
1782
|
get: function () {
|
|
1728
1783
|
if (!this.jsonString) {
|
|
1729
|
-
throw new
|
|
1784
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1730
1785
|
}
|
|
1731
1786
|
return this._student_response;
|
|
1732
1787
|
},
|
|
1733
1788
|
set: function (student_response) {
|
|
1734
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1789
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(student_response, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIFeedback, true)) {
|
|
1735
1790
|
this._student_response = student_response;
|
|
1736
1791
|
}
|
|
1737
1792
|
},
|
|
@@ -1741,12 +1796,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1741
1796
|
Object.defineProperty(CMIInteractionsObject.prototype, "result", {
|
|
1742
1797
|
get: function () {
|
|
1743
1798
|
if (!this.jsonString) {
|
|
1744
|
-
throw new
|
|
1799
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1745
1800
|
}
|
|
1746
1801
|
return this._result;
|
|
1747
1802
|
},
|
|
1748
1803
|
set: function (result) {
|
|
1749
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1804
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(result, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIResult)) {
|
|
1750
1805
|
this._result = result;
|
|
1751
1806
|
}
|
|
1752
1807
|
},
|
|
@@ -1756,12 +1811,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1756
1811
|
Object.defineProperty(CMIInteractionsObject.prototype, "latency", {
|
|
1757
1812
|
get: function () {
|
|
1758
1813
|
if (!this.jsonString) {
|
|
1759
|
-
throw new
|
|
1814
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1760
1815
|
}
|
|
1761
1816
|
return this._latency;
|
|
1762
1817
|
},
|
|
1763
1818
|
set: function (latency) {
|
|
1764
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1819
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(latency, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMITimespan)) {
|
|
1765
1820
|
this._latency = latency;
|
|
1766
1821
|
}
|
|
1767
1822
|
},
|
|
@@ -1785,21 +1840,25 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
1785
1840
|
return result;
|
|
1786
1841
|
};
|
|
1787
1842
|
return CMIInteractionsObject;
|
|
1788
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
1843
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
1789
1844
|
|
|
1790
1845
|
var CMIInteractionsObjectivesObject = (function (_super) {
|
|
1791
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
1846
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsObjectivesObject, _super);
|
|
1792
1847
|
function CMIInteractionsObjectivesObject() {
|
|
1793
1848
|
var _this = _super.call(this) || this;
|
|
1794
1849
|
_this._id = "";
|
|
1795
1850
|
return _this;
|
|
1796
1851
|
}
|
|
1852
|
+
CMIInteractionsObjectivesObject.prototype.reset = function () {
|
|
1853
|
+
this._initialized = false;
|
|
1854
|
+
this._id = "";
|
|
1855
|
+
};
|
|
1797
1856
|
Object.defineProperty(CMIInteractionsObjectivesObject.prototype, "id", {
|
|
1798
1857
|
get: function () {
|
|
1799
1858
|
return this._id;
|
|
1800
1859
|
},
|
|
1801
1860
|
set: function (id) {
|
|
1802
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1861
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIIdentifier)) {
|
|
1803
1862
|
this._id = id;
|
|
1804
1863
|
}
|
|
1805
1864
|
},
|
|
@@ -1815,24 +1874,28 @@ var CMIInteractionsObjectivesObject = (function (_super) {
|
|
|
1815
1874
|
return result;
|
|
1816
1875
|
};
|
|
1817
1876
|
return CMIInteractionsObjectivesObject;
|
|
1818
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
1877
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
1819
1878
|
|
|
1820
1879
|
var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
1821
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
1880
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsCorrectResponsesObject, _super);
|
|
1822
1881
|
function CMIInteractionsCorrectResponsesObject() {
|
|
1823
1882
|
var _this = _super.call(this) || this;
|
|
1824
1883
|
_this._pattern = "";
|
|
1825
1884
|
return _this;
|
|
1826
1885
|
}
|
|
1886
|
+
CMIInteractionsCorrectResponsesObject.prototype.reset = function () {
|
|
1887
|
+
this._initialized = false;
|
|
1888
|
+
this._pattern = "";
|
|
1889
|
+
};
|
|
1827
1890
|
Object.defineProperty(CMIInteractionsCorrectResponsesObject.prototype, "pattern", {
|
|
1828
1891
|
get: function () {
|
|
1829
1892
|
if (!this.jsonString) {
|
|
1830
|
-
throw new
|
|
1893
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
1831
1894
|
}
|
|
1832
1895
|
return this._pattern;
|
|
1833
1896
|
},
|
|
1834
1897
|
set: function (pattern) {
|
|
1835
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
1898
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(pattern, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIFeedback, true)) {
|
|
1836
1899
|
this._pattern = pattern;
|
|
1837
1900
|
}
|
|
1838
1901
|
},
|
|
@@ -1848,7 +1911,7 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
1848
1911
|
return result;
|
|
1849
1912
|
};
|
|
1850
1913
|
return CMIInteractionsCorrectResponsesObject;
|
|
1851
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
1914
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
1852
1915
|
|
|
1853
1916
|
|
|
1854
1917
|
|
|
@@ -1857,8 +1920,9 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
1857
1920
|
/***/ 331:
|
|
1858
1921
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1859
1922
|
|
|
1923
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1860
1924
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1861
|
-
/* harmony export */
|
|
1925
|
+
/* harmony export */ NAV: function() { return /* binding */ NAV; }
|
|
1862
1926
|
/* harmony export */ });
|
|
1863
1927
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635);
|
|
1864
1928
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
@@ -1869,18 +1933,22 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
1869
1933
|
|
|
1870
1934
|
|
|
1871
1935
|
var NAV = (function (_super) {
|
|
1872
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_3__
|
|
1936
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_3__.__extends)(NAV, _super);
|
|
1873
1937
|
function NAV() {
|
|
1874
1938
|
var _this = _super.call(this) || this;
|
|
1875
1939
|
_this._event = "";
|
|
1876
1940
|
return _this;
|
|
1877
1941
|
}
|
|
1942
|
+
NAV.prototype.reset = function () {
|
|
1943
|
+
this._event = "";
|
|
1944
|
+
this._initialized = false;
|
|
1945
|
+
};
|
|
1878
1946
|
Object.defineProperty(NAV.prototype, "event", {
|
|
1879
1947
|
get: function () {
|
|
1880
1948
|
return this._event;
|
|
1881
1949
|
},
|
|
1882
1950
|
set: function (event) {
|
|
1883
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_1__
|
|
1951
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_1__.check12ValidFormat)(event, _constants_regex__WEBPACK_IMPORTED_MODULE_2__.scorm12_regex.NAVEvent)) {
|
|
1884
1952
|
this._event = event;
|
|
1885
1953
|
}
|
|
1886
1954
|
},
|
|
@@ -1896,7 +1964,7 @@ var NAV = (function (_super) {
|
|
|
1896
1964
|
return result;
|
|
1897
1965
|
};
|
|
1898
1966
|
return NAV;
|
|
1899
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
1967
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
1900
1968
|
|
|
1901
1969
|
|
|
1902
1970
|
|
|
@@ -1905,9 +1973,10 @@ var NAV = (function (_super) {
|
|
|
1905
1973
|
/***/ 176:
|
|
1906
1974
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1907
1975
|
|
|
1976
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1908
1977
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1909
|
-
/* harmony export */
|
|
1910
|
-
/* harmony export */
|
|
1978
|
+
/* harmony export */ CMIObjectives: function() { return /* binding */ CMIObjectives; },
|
|
1979
|
+
/* harmony export */ CMIObjectivesObject: function() { return /* binding */ CMIObjectivesObject; }
|
|
1911
1980
|
/* harmony export */ });
|
|
1912
1981
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(635);
|
|
1913
1982
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
@@ -1915,7 +1984,7 @@ var NAV = (function (_super) {
|
|
|
1915
1984
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(340);
|
|
1916
1985
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(417);
|
|
1917
1986
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(797);
|
|
1918
|
-
/* harmony import */ var
|
|
1987
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(179);
|
|
1919
1988
|
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(915);
|
|
1920
1989
|
/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(589);
|
|
1921
1990
|
|
|
@@ -1928,39 +1997,46 @@ var NAV = (function (_super) {
|
|
|
1928
1997
|
|
|
1929
1998
|
|
|
1930
1999
|
var CMIObjectives = (function (_super) {
|
|
1931
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_8__
|
|
2000
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_8__.__extends)(CMIObjectives, _super);
|
|
1932
2001
|
function CMIObjectives() {
|
|
1933
2002
|
return _super.call(this, {
|
|
1934
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
1935
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
1936
|
-
errorClass:
|
|
2003
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.objectives_children,
|
|
2004
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.INVALID_SET_VALUE,
|
|
2005
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_5__.Scorm12ValidationError,
|
|
1937
2006
|
}) || this;
|
|
1938
2007
|
}
|
|
1939
2008
|
return CMIObjectives;
|
|
1940
|
-
}(_common_array__WEBPACK_IMPORTED_MODULE_7__
|
|
2009
|
+
}(_common_array__WEBPACK_IMPORTED_MODULE_7__.CMIArray));
|
|
1941
2010
|
|
|
1942
2011
|
var CMIObjectivesObject = (function (_super) {
|
|
1943
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_8__
|
|
2012
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_8__.__extends)(CMIObjectivesObject, _super);
|
|
1944
2013
|
function CMIObjectivesObject() {
|
|
1945
2014
|
var _this = _super.call(this) || this;
|
|
1946
2015
|
_this._id = "";
|
|
1947
2016
|
_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:
|
|
2017
|
+
_this.score = new _common_score__WEBPACK_IMPORTED_MODULE_1__.CMIScore({
|
|
2018
|
+
score_children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.score_children,
|
|
2019
|
+
score_range: _constants_regex__WEBPACK_IMPORTED_MODULE_3__.scorm12_regex.score_range,
|
|
2020
|
+
invalidErrorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.INVALID_SET_VALUE,
|
|
2021
|
+
invalidTypeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.TYPE_MISMATCH,
|
|
2022
|
+
invalidRangeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.VALUE_OUT_OF_RANGE,
|
|
2023
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_5__.Scorm12ValidationError,
|
|
1955
2024
|
});
|
|
1956
2025
|
return _this;
|
|
1957
2026
|
}
|
|
2027
|
+
CMIObjectivesObject.prototype.reset = function () {
|
|
2028
|
+
var _a;
|
|
2029
|
+
this._initialized = false;
|
|
2030
|
+
this._id = "";
|
|
2031
|
+
this._status = "";
|
|
2032
|
+
(_a = this.score) === null || _a === void 0 ? void 0 : _a.reset();
|
|
2033
|
+
};
|
|
1958
2034
|
Object.defineProperty(CMIObjectivesObject.prototype, "id", {
|
|
1959
2035
|
get: function () {
|
|
1960
2036
|
return this._id;
|
|
1961
2037
|
},
|
|
1962
2038
|
set: function (id) {
|
|
1963
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__
|
|
2039
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__.check12ValidFormat)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_3__.scorm12_regex.CMIIdentifier)) {
|
|
1964
2040
|
this._id = id;
|
|
1965
2041
|
}
|
|
1966
2042
|
},
|
|
@@ -1972,7 +2048,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
1972
2048
|
return this._status;
|
|
1973
2049
|
},
|
|
1974
2050
|
set: function (status) {
|
|
1975
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__
|
|
2051
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__.check12ValidFormat)(status, _constants_regex__WEBPACK_IMPORTED_MODULE_3__.scorm12_regex.CMIStatus2)) {
|
|
1976
2052
|
this._status = status;
|
|
1977
2053
|
}
|
|
1978
2054
|
},
|
|
@@ -1990,7 +2066,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
1990
2066
|
return result;
|
|
1991
2067
|
};
|
|
1992
2068
|
return CMIObjectivesObject;
|
|
1993
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
2069
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
1994
2070
|
|
|
1995
2071
|
|
|
1996
2072
|
|
|
@@ -1999,13 +2075,14 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
1999
2075
|
/***/ 532:
|
|
2000
2076
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2001
2077
|
|
|
2078
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2002
2079
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2003
|
-
/* harmony export */
|
|
2080
|
+
/* harmony export */ CMIStudentData: function() { return /* binding */ CMIStudentData; }
|
|
2004
2081
|
/* harmony export */ });
|
|
2005
2082
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635);
|
|
2006
2083
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
2007
2084
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
2008
|
-
/* harmony import */ var
|
|
2085
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(179);
|
|
2009
2086
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797);
|
|
2010
2087
|
|
|
2011
2088
|
|
|
@@ -2013,7 +2090,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2013
2090
|
|
|
2014
2091
|
|
|
2015
2092
|
var CMIStudentData = (function (_super) {
|
|
2016
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_4__
|
|
2093
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_4__.__extends)(CMIStudentData, _super);
|
|
2017
2094
|
function CMIStudentData(student_data_children) {
|
|
2018
2095
|
var _this = _super.call(this) || this;
|
|
2019
2096
|
_this._mastery_score = "";
|
|
@@ -2021,15 +2098,18 @@ var CMIStudentData = (function (_super) {
|
|
|
2021
2098
|
_this._time_limit_action = "";
|
|
2022
2099
|
_this.__children = student_data_children
|
|
2023
2100
|
? student_data_children
|
|
2024
|
-
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
2101
|
+
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.student_data_children;
|
|
2025
2102
|
return _this;
|
|
2026
2103
|
}
|
|
2104
|
+
CMIStudentData.prototype.reset = function () {
|
|
2105
|
+
this._initialized = false;
|
|
2106
|
+
};
|
|
2027
2107
|
Object.defineProperty(CMIStudentData.prototype, "_children", {
|
|
2028
2108
|
get: function () {
|
|
2029
2109
|
return this.__children;
|
|
2030
2110
|
},
|
|
2031
2111
|
set: function (_children) {
|
|
2032
|
-
throw new
|
|
2112
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.INVALID_SET_VALUE);
|
|
2033
2113
|
},
|
|
2034
2114
|
enumerable: false,
|
|
2035
2115
|
configurable: true
|
|
@@ -2040,7 +2120,7 @@ var CMIStudentData = (function (_super) {
|
|
|
2040
2120
|
},
|
|
2041
2121
|
set: function (mastery_score) {
|
|
2042
2122
|
if (this.initialized) {
|
|
2043
|
-
throw new
|
|
2123
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.READ_ONLY_ELEMENT);
|
|
2044
2124
|
}
|
|
2045
2125
|
else {
|
|
2046
2126
|
this._mastery_score = mastery_score;
|
|
@@ -2055,7 +2135,7 @@ var CMIStudentData = (function (_super) {
|
|
|
2055
2135
|
},
|
|
2056
2136
|
set: function (max_time_allowed) {
|
|
2057
2137
|
if (this.initialized) {
|
|
2058
|
-
throw new
|
|
2138
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.READ_ONLY_ELEMENT);
|
|
2059
2139
|
}
|
|
2060
2140
|
else {
|
|
2061
2141
|
this._max_time_allowed = max_time_allowed;
|
|
@@ -2070,7 +2150,7 @@ var CMIStudentData = (function (_super) {
|
|
|
2070
2150
|
},
|
|
2071
2151
|
set: function (time_limit_action) {
|
|
2072
2152
|
if (this.initialized) {
|
|
2073
|
-
throw new
|
|
2153
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.READ_ONLY_ELEMENT);
|
|
2074
2154
|
}
|
|
2075
2155
|
else {
|
|
2076
2156
|
this._time_limit_action = time_limit_action;
|
|
@@ -2090,7 +2170,7 @@ var CMIStudentData = (function (_super) {
|
|
|
2090
2170
|
return result;
|
|
2091
2171
|
};
|
|
2092
2172
|
return CMIStudentData;
|
|
2093
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
2173
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
2094
2174
|
|
|
2095
2175
|
|
|
2096
2176
|
|
|
@@ -2099,16 +2179,17 @@ var CMIStudentData = (function (_super) {
|
|
|
2099
2179
|
/***/ 181:
|
|
2100
2180
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2101
2181
|
|
|
2182
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2102
2183
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2103
|
-
/* harmony export */
|
|
2184
|
+
/* harmony export */ CMIStudentPreference: function() { return /* binding */ CMIStudentPreference; }
|
|
2104
2185
|
/* harmony export */ });
|
|
2105
2186
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(635);
|
|
2106
2187
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
2107
2188
|
/* 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
|
|
2189
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(179);
|
|
2190
|
+
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(915);
|
|
2191
|
+
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(417);
|
|
2192
|
+
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(797);
|
|
2112
2193
|
|
|
2113
2194
|
|
|
2114
2195
|
|
|
@@ -2117,7 +2198,7 @@ var CMIStudentData = (function (_super) {
|
|
|
2117
2198
|
|
|
2118
2199
|
|
|
2119
2200
|
var CMIStudentPreference = (function (_super) {
|
|
2120
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_6__
|
|
2201
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_6__.__extends)(CMIStudentPreference, _super);
|
|
2121
2202
|
function CMIStudentPreference(student_preference_children) {
|
|
2122
2203
|
var _this = _super.call(this) || this;
|
|
2123
2204
|
_this._audio = "";
|
|
@@ -2126,15 +2207,18 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2126
2207
|
_this._text = "";
|
|
2127
2208
|
_this.__children = student_preference_children
|
|
2128
2209
|
? student_preference_children
|
|
2129
|
-
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
2210
|
+
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.student_preference_children;
|
|
2130
2211
|
return _this;
|
|
2131
2212
|
}
|
|
2213
|
+
CMIStudentPreference.prototype.reset = function () {
|
|
2214
|
+
this._initialized = false;
|
|
2215
|
+
};
|
|
2132
2216
|
Object.defineProperty(CMIStudentPreference.prototype, "_children", {
|
|
2133
2217
|
get: function () {
|
|
2134
2218
|
return this.__children;
|
|
2135
2219
|
},
|
|
2136
2220
|
set: function (_children) {
|
|
2137
|
-
throw new
|
|
2221
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_5__.scorm12_errors.INVALID_SET_VALUE);
|
|
2138
2222
|
},
|
|
2139
2223
|
enumerable: false,
|
|
2140
2224
|
configurable: true
|
|
@@ -2144,8 +2228,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2144
2228
|
return this._audio;
|
|
2145
2229
|
},
|
|
2146
2230
|
set: function (audio) {
|
|
2147
|
-
if ((0,
|
|
2148
|
-
(0,
|
|
2231
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMISInteger) &&
|
|
2232
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidRange)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.audio_range)) {
|
|
2149
2233
|
this._audio = audio;
|
|
2150
2234
|
}
|
|
2151
2235
|
},
|
|
@@ -2157,7 +2241,7 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2157
2241
|
return this._language;
|
|
2158
2242
|
},
|
|
2159
2243
|
set: function (language) {
|
|
2160
|
-
if ((0,
|
|
2244
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(language, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMIString256)) {
|
|
2161
2245
|
this._language = language;
|
|
2162
2246
|
}
|
|
2163
2247
|
},
|
|
@@ -2169,8 +2253,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2169
2253
|
return this._speed;
|
|
2170
2254
|
},
|
|
2171
2255
|
set: function (speed) {
|
|
2172
|
-
if ((0,
|
|
2173
|
-
(0,
|
|
2256
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMISInteger) &&
|
|
2257
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidRange)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.speed_range)) {
|
|
2174
2258
|
this._speed = speed;
|
|
2175
2259
|
}
|
|
2176
2260
|
},
|
|
@@ -2182,8 +2266,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2182
2266
|
return this._text;
|
|
2183
2267
|
},
|
|
2184
2268
|
set: function (text) {
|
|
2185
|
-
if ((0,
|
|
2186
|
-
(0,
|
|
2269
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMISInteger) &&
|
|
2270
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidRange)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.text_range)) {
|
|
2187
2271
|
this._text = text;
|
|
2188
2272
|
}
|
|
2189
2273
|
},
|
|
@@ -2202,7 +2286,7 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2202
2286
|
return result;
|
|
2203
2287
|
};
|
|
2204
2288
|
return CMIStudentPreference;
|
|
2205
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
2289
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
2206
2290
|
|
|
2207
2291
|
|
|
2208
2292
|
|
|
@@ -2211,24 +2295,25 @@ var CMIStudentPreference = (function (_super) {
|
|
|
2211
2295
|
/***/ 915:
|
|
2212
2296
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2213
2297
|
|
|
2298
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2214
2299
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2215
|
-
/* harmony export */
|
|
2216
|
-
/* harmony export */
|
|
2300
|
+
/* harmony export */ check12ValidFormat: function() { return /* binding */ check12ValidFormat; },
|
|
2301
|
+
/* harmony export */ check12ValidRange: function() { return /* binding */ check12ValidRange; }
|
|
2217
2302
|
/* harmony export */ });
|
|
2218
2303
|
/* harmony import */ var _common_validation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(449);
|
|
2219
2304
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(797);
|
|
2220
|
-
/* harmony import */ var
|
|
2305
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(179);
|
|
2221
2306
|
|
|
2222
2307
|
|
|
2223
2308
|
|
|
2224
2309
|
function check12ValidFormat(value, regexPattern, allowEmptyString) {
|
|
2225
|
-
return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__
|
|
2310
|
+
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
2311
|
}
|
|
2227
2312
|
function check12ValidRange(value, rangePattern, allowEmptyString) {
|
|
2228
2313
|
if (!allowEmptyString && value === "") {
|
|
2229
|
-
throw new
|
|
2314
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_1__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_0__.scorm12_errors.VALUE_OUT_OF_RANGE);
|
|
2230
2315
|
}
|
|
2231
|
-
return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__
|
|
2316
|
+
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
2317
|
}
|
|
2233
2318
|
|
|
2234
2319
|
|
|
@@ -2237,16 +2322,23 @@ function check12ValidRange(value, rangePattern, allowEmptyString) {
|
|
|
2237
2322
|
/***/ 340:
|
|
2238
2323
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2239
2324
|
|
|
2325
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2326
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2327
|
+
/* harmony export */ aicc_constants: function() { return /* binding */ aicc_constants; },
|
|
2328
|
+
/* harmony export */ global_constants: function() { return /* binding */ global_constants; },
|
|
2329
|
+
/* harmony export */ scorm12_constants: function() { return /* binding */ scorm12_constants; },
|
|
2330
|
+
/* harmony export */ scorm2004_constants: function() { return /* binding */ scorm2004_constants; }
|
|
2331
|
+
/* harmony export */ });
|
|
2240
2332
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
2241
2333
|
|
|
2242
|
-
var
|
|
2334
|
+
var global_constants = {
|
|
2243
2335
|
SCORM_TRUE: "true",
|
|
2244
2336
|
SCORM_FALSE: "false",
|
|
2245
2337
|
STATE_NOT_INITIALIZED: 0,
|
|
2246
2338
|
STATE_INITIALIZED: 1,
|
|
2247
2339
|
STATE_TERMINATED: 2,
|
|
2248
2340
|
};
|
|
2249
|
-
var
|
|
2341
|
+
var scorm12_constants = {
|
|
2250
2342
|
cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",
|
|
2251
2343
|
core_children: "student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",
|
|
2252
2344
|
score_children: "raw,min,max",
|
|
@@ -2307,7 +2399,7 @@ var scorm12 = {
|
|
|
2307
2399
|
},
|
|
2308
2400
|
},
|
|
2309
2401
|
};
|
|
2310
|
-
var
|
|
2402
|
+
var aicc_constants = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, scorm12_constants), {
|
|
2311
2403
|
cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",
|
|
2312
2404
|
student_preference_children: "audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",
|
|
2313
2405
|
student_data_children: "attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",
|
|
@@ -2316,7 +2408,7 @@ var aicc = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__W
|
|
|
2316
2408
|
attempt_records_children: "score,lesson_status",
|
|
2317
2409
|
paths_children: "location_id,date,time,status,why_left,time_in_element",
|
|
2318
2410
|
});
|
|
2319
|
-
var
|
|
2411
|
+
var scorm2004_constants = {
|
|
2320
2412
|
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
2413
|
comments_children: "comment,timestamp,location",
|
|
2322
2414
|
score_children: "max,raw,scaled,min",
|
|
@@ -2325,6 +2417,7 @@ var scorm2004 = {
|
|
|
2325
2417
|
student_data_children: "mastery_score,max_time_allowed,time_limit_action",
|
|
2326
2418
|
student_preference_children: "audio_level,audio_captioning,delivery_speed,language",
|
|
2327
2419
|
interactions_children: "id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",
|
|
2420
|
+
adl_data_children: "id,store",
|
|
2328
2421
|
error_descriptions: {
|
|
2329
2422
|
"0": {
|
|
2330
2423
|
basicMessage: "No Error",
|
|
@@ -2432,13 +2525,6 @@ var scorm2004 = {
|
|
|
2432
2525
|
},
|
|
2433
2526
|
},
|
|
2434
2527
|
};
|
|
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
2528
|
|
|
2443
2529
|
|
|
2444
2530
|
/***/ }),
|
|
@@ -2446,12 +2532,13 @@ var APIConstants = {
|
|
|
2446
2532
|
/***/ 56:
|
|
2447
2533
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2448
2534
|
|
|
2535
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2449
2536
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2450
|
-
/* harmony export */
|
|
2451
|
-
/* harmony export */
|
|
2452
|
-
/* harmony export */
|
|
2537
|
+
/* harmony export */ CompletionStatus: function() { return /* binding */ CompletionStatus; },
|
|
2538
|
+
/* harmony export */ LogLevelEnum: function() { return /* binding */ LogLevelEnum; },
|
|
2539
|
+
/* harmony export */ NAVBoolean: function() { return /* binding */ NAVBoolean; },
|
|
2540
|
+
/* harmony export */ SuccessStatus: function() { return /* binding */ SuccessStatus; }
|
|
2453
2541
|
/* harmony export */ });
|
|
2454
|
-
/* unused harmony export NAVBoolean */
|
|
2455
2542
|
var NAVBoolean;
|
|
2456
2543
|
(function (NAVBoolean) {
|
|
2457
2544
|
NAVBoolean["unknown"] = "unknown";
|
|
@@ -2486,9 +2573,15 @@ var LogLevelEnum;
|
|
|
2486
2573
|
/***/ 797:
|
|
2487
2574
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2488
2575
|
|
|
2576
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2577
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2578
|
+
/* harmony export */ global_errors: function() { return /* binding */ global_errors; },
|
|
2579
|
+
/* harmony export */ scorm12_errors: function() { return /* binding */ scorm12_errors; },
|
|
2580
|
+
/* harmony export */ scorm2004_errors: function() { return /* binding */ scorm2004_errors; }
|
|
2581
|
+
/* harmony export */ });
|
|
2489
2582
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
2490
2583
|
|
|
2491
|
-
var
|
|
2584
|
+
var global_errors = {
|
|
2492
2585
|
GENERAL: 101,
|
|
2493
2586
|
INITIALIZATION_FAILED: 101,
|
|
2494
2587
|
INITIALIZED: 101,
|
|
@@ -2518,13 +2611,8 @@ var global = {
|
|
|
2518
2611
|
VALUE_OUT_OF_RANGE: 101,
|
|
2519
2612
|
DEPENDENCY_NOT_ESTABLISHED: 101,
|
|
2520
2613
|
};
|
|
2521
|
-
var
|
|
2522
|
-
var
|
|
2523
|
-
var ErrorCodes = {
|
|
2524
|
-
scorm12: scorm12,
|
|
2525
|
-
scorm2004: scorm2004,
|
|
2526
|
-
};
|
|
2527
|
-
/* harmony default export */ __webpack_exports__.A = (ErrorCodes);
|
|
2614
|
+
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 });
|
|
2615
|
+
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
2616
|
|
|
2529
2617
|
|
|
2530
2618
|
/***/ }),
|
|
@@ -2532,9 +2620,15 @@ var ErrorCodes = {
|
|
|
2532
2620
|
/***/ 417:
|
|
2533
2621
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2534
2622
|
|
|
2623
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2624
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2625
|
+
/* harmony export */ aicc_regex: function() { return /* binding */ aicc_regex; },
|
|
2626
|
+
/* harmony export */ scorm12_regex: function() { return /* binding */ scorm12_regex; },
|
|
2627
|
+
/* harmony export */ scorm2004_regex: function() { return /* binding */ scorm2004_regex; }
|
|
2628
|
+
/* harmony export */ });
|
|
2535
2629
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
2536
2630
|
|
|
2537
|
-
var
|
|
2631
|
+
var scorm12_regex = {
|
|
2538
2632
|
CMIString256: "^.{0,255}$",
|
|
2539
2633
|
CMIString4096: "^.{0,4096}$",
|
|
2540
2634
|
CMITime: "^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",
|
|
@@ -2557,10 +2651,10 @@ var scorm12 = {
|
|
|
2557
2651
|
weighting_range: "-100#100",
|
|
2558
2652
|
text_range: "-1#1",
|
|
2559
2653
|
};
|
|
2560
|
-
var
|
|
2654
|
+
var aicc_regex = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, scorm12_regex), {
|
|
2561
2655
|
CMIIdentifier: "^\\w{1,255}$",
|
|
2562
2656
|
});
|
|
2563
|
-
var
|
|
2657
|
+
var scorm2004_regex = {
|
|
2564
2658
|
CMIString200: "^[\\u0000-\\uFFFF]{0,200}$",
|
|
2565
2659
|
CMIString250: "^[\\u0000-\\uFFFF]{0,250}$",
|
|
2566
2660
|
CMIString1000: "^[\\u0000-\\uFFFF]{0,1000}$",
|
|
@@ -2596,12 +2690,6 @@ var scorm2004 = {
|
|
|
2596
2690
|
text_range: "-1#1",
|
|
2597
2691
|
progress_range: "0#1",
|
|
2598
2692
|
};
|
|
2599
|
-
var Regex = {
|
|
2600
|
-
aicc: aicc,
|
|
2601
|
-
scorm12: scorm12,
|
|
2602
|
-
scorm2004: scorm2004,
|
|
2603
|
-
};
|
|
2604
|
-
/* harmony default export */ __webpack_exports__.A = (Regex);
|
|
2605
2693
|
|
|
2606
2694
|
|
|
2607
2695
|
/***/ }),
|
|
@@ -2609,21 +2697,15 @@ var Regex = {
|
|
|
2609
2697
|
/***/ 784:
|
|
2610
2698
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2611
2699
|
|
|
2700
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2612
2701
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2613
|
-
/* harmony export */
|
|
2614
|
-
/* harmony export */
|
|
2615
|
-
/* harmony export */ yI: function() { return /* binding */ ValidationError; }
|
|
2702
|
+
/* harmony export */ BaseScormValidationError: function() { return /* binding */ BaseScormValidationError; },
|
|
2703
|
+
/* harmony export */ ValidationError: function() { return /* binding */ ValidationError; }
|
|
2616
2704
|
/* 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
|
-
|
|
2705
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
2621
2706
|
|
|
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
2707
|
var BaseScormValidationError = (function (_super) {
|
|
2626
|
-
(0,
|
|
2708
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(BaseScormValidationError, _super);
|
|
2627
2709
|
function BaseScormValidationError(errorCode) {
|
|
2628
2710
|
var _this = _super.call(this, errorCode.toString()) || this;
|
|
2629
2711
|
_this._errorCode = errorCode;
|
|
@@ -2641,7 +2723,7 @@ var BaseScormValidationError = (function (_super) {
|
|
|
2641
2723
|
}(Error));
|
|
2642
2724
|
|
|
2643
2725
|
var ValidationError = (function (_super) {
|
|
2644
|
-
(0,
|
|
2726
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(ValidationError, _super);
|
|
2645
2727
|
function ValidationError(errorCode, errorMessage, detailedMessage) {
|
|
2646
2728
|
var _this = _super.call(this, errorCode) || this;
|
|
2647
2729
|
_this._detailedMessage = "";
|
|
@@ -2669,8 +2751,26 @@ var ValidationError = (function (_super) {
|
|
|
2669
2751
|
return ValidationError;
|
|
2670
2752
|
}(BaseScormValidationError));
|
|
2671
2753
|
|
|
2754
|
+
|
|
2755
|
+
|
|
2756
|
+
/***/ }),
|
|
2757
|
+
|
|
2758
|
+
/***/ 179:
|
|
2759
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2760
|
+
|
|
2761
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2762
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2763
|
+
/* harmony export */ Scorm12ValidationError: function() { return /* binding */ Scorm12ValidationError; }
|
|
2764
|
+
/* harmony export */ });
|
|
2765
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(635);
|
|
2766
|
+
/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(784);
|
|
2767
|
+
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
2768
|
+
|
|
2769
|
+
|
|
2770
|
+
|
|
2771
|
+
var scorm12_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.error_descriptions;
|
|
2672
2772
|
var Scorm12ValidationError = (function (_super) {
|
|
2673
|
-
(0,
|
|
2773
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_2__.__extends)(Scorm12ValidationError, _super);
|
|
2674
2774
|
function Scorm12ValidationError(errorCode) {
|
|
2675
2775
|
var _this = this;
|
|
2676
2776
|
if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {
|
|
@@ -2682,37 +2782,7 @@ var Scorm12ValidationError = (function (_super) {
|
|
|
2682
2782
|
return _this;
|
|
2683
2783
|
}
|
|
2684
2784
|
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));
|
|
2785
|
+
}(_exceptions__WEBPACK_IMPORTED_MODULE_0__.ValidationError));
|
|
2716
2786
|
|
|
2717
2787
|
|
|
2718
2788
|
|
|
@@ -2721,16 +2791,24 @@ var Scorm2004ValidationError = (function (_super) {
|
|
|
2721
2791
|
/***/ 864:
|
|
2722
2792
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2723
2793
|
|
|
2794
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2724
2795
|
/* 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 */
|
|
2796
|
+
/* harmony export */ SECONDS_PER_DAY: function() { return /* binding */ SECONDS_PER_DAY; },
|
|
2797
|
+
/* harmony export */ SECONDS_PER_HOUR: function() { return /* binding */ SECONDS_PER_HOUR; },
|
|
2798
|
+
/* harmony export */ SECONDS_PER_MINUTE: function() { return /* binding */ SECONDS_PER_MINUTE; },
|
|
2799
|
+
/* harmony export */ SECONDS_PER_SECOND: function() { return /* binding */ SECONDS_PER_SECOND; },
|
|
2800
|
+
/* harmony export */ addHHMMSSTimeStrings: function() { return /* binding */ addHHMMSSTimeStrings; },
|
|
2801
|
+
/* harmony export */ addTwoDurations: function() { return /* binding */ addTwoDurations; },
|
|
2802
|
+
/* harmony export */ countDecimals: function() { return /* binding */ countDecimals; },
|
|
2803
|
+
/* harmony export */ flatten: function() { return /* binding */ flatten; },
|
|
2804
|
+
/* harmony export */ formatMessage: function() { return /* binding */ formatMessage; },
|
|
2805
|
+
/* harmony export */ getDurationAsSeconds: function() { return /* binding */ getDurationAsSeconds; },
|
|
2806
|
+
/* harmony export */ getSecondsAsHHMMSS: function() { return /* binding */ getSecondsAsHHMMSS; },
|
|
2807
|
+
/* harmony export */ getSecondsAsISODuration: function() { return /* binding */ getSecondsAsISODuration; },
|
|
2808
|
+
/* harmony export */ getTimeAsSeconds: function() { return /* binding */ getTimeAsSeconds; },
|
|
2809
|
+
/* harmony export */ stringMatches: function() { return /* binding */ stringMatches; },
|
|
2810
|
+
/* harmony export */ unflatten: function() { return /* binding */ unflatten; }
|
|
2732
2811
|
/* harmony export */ });
|
|
2733
|
-
/* unused harmony exports SECONDS_PER_SECOND, SECONDS_PER_MINUTE, SECONDS_PER_HOUR, SECONDS_PER_DAY, getSecondsAsISODuration, getDurationAsSeconds, addTwoDurations, countDecimals */
|
|
2734
2812
|
var SECONDS_PER_SECOND = 1.0;
|
|
2735
2813
|
var SECONDS_PER_MINUTE = 60;
|
|
2736
2814
|
var SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;
|
|
@@ -2922,13 +3000,40 @@ function stringMatches(str, tester) {
|
|
|
2922
3000
|
/***/ 635:
|
|
2923
3001
|
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
2924
3002
|
|
|
3003
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2925
3004
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2926
|
-
/* harmony export */
|
|
2927
|
-
/* harmony export */
|
|
2928
|
-
/* harmony export */
|
|
2929
|
-
/* harmony export */
|
|
3005
|
+
/* harmony export */ __addDisposableResource: function() { return /* binding */ __addDisposableResource; },
|
|
3006
|
+
/* harmony export */ __assign: function() { return /* binding */ __assign; },
|
|
3007
|
+
/* harmony export */ __asyncDelegator: function() { return /* binding */ __asyncDelegator; },
|
|
3008
|
+
/* harmony export */ __asyncGenerator: function() { return /* binding */ __asyncGenerator; },
|
|
3009
|
+
/* harmony export */ __asyncValues: function() { return /* binding */ __asyncValues; },
|
|
3010
|
+
/* harmony export */ __await: function() { return /* binding */ __await; },
|
|
3011
|
+
/* harmony export */ __awaiter: function() { return /* binding */ __awaiter; },
|
|
3012
|
+
/* harmony export */ __classPrivateFieldGet: function() { return /* binding */ __classPrivateFieldGet; },
|
|
3013
|
+
/* harmony export */ __classPrivateFieldIn: function() { return /* binding */ __classPrivateFieldIn; },
|
|
3014
|
+
/* harmony export */ __classPrivateFieldSet: function() { return /* binding */ __classPrivateFieldSet; },
|
|
3015
|
+
/* harmony export */ __createBinding: function() { return /* binding */ __createBinding; },
|
|
3016
|
+
/* harmony export */ __decorate: function() { return /* binding */ __decorate; },
|
|
3017
|
+
/* harmony export */ __disposeResources: function() { return /* binding */ __disposeResources; },
|
|
3018
|
+
/* harmony export */ __esDecorate: function() { return /* binding */ __esDecorate; },
|
|
3019
|
+
/* harmony export */ __exportStar: function() { return /* binding */ __exportStar; },
|
|
3020
|
+
/* harmony export */ __extends: function() { return /* binding */ __extends; },
|
|
3021
|
+
/* harmony export */ __generator: function() { return /* binding */ __generator; },
|
|
3022
|
+
/* harmony export */ __importDefault: function() { return /* binding */ __importDefault; },
|
|
3023
|
+
/* harmony export */ __importStar: function() { return /* binding */ __importStar; },
|
|
3024
|
+
/* harmony export */ __makeTemplateObject: function() { return /* binding */ __makeTemplateObject; },
|
|
3025
|
+
/* harmony export */ __metadata: function() { return /* binding */ __metadata; },
|
|
3026
|
+
/* harmony export */ __param: function() { return /* binding */ __param; },
|
|
3027
|
+
/* harmony export */ __propKey: function() { return /* binding */ __propKey; },
|
|
3028
|
+
/* harmony export */ __read: function() { return /* binding */ __read; },
|
|
3029
|
+
/* harmony export */ __rest: function() { return /* binding */ __rest; },
|
|
3030
|
+
/* harmony export */ __runInitializers: function() { return /* binding */ __runInitializers; },
|
|
3031
|
+
/* harmony export */ __setFunctionName: function() { return /* binding */ __setFunctionName; },
|
|
3032
|
+
/* harmony export */ __spread: function() { return /* binding */ __spread; },
|
|
3033
|
+
/* harmony export */ __spreadArray: function() { return /* binding */ __spreadArray; },
|
|
3034
|
+
/* harmony export */ __spreadArrays: function() { return /* binding */ __spreadArrays; },
|
|
3035
|
+
/* harmony export */ __values: function() { return /* binding */ __values; }
|
|
2930
3036
|
/* 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
3037
|
/******************************************************************************
|
|
2933
3038
|
Copyright (c) Microsoft Corporation.
|
|
2934
3039
|
|
|
@@ -3278,7 +3383,7 @@ function __disposeResources(env) {
|
|
|
3278
3383
|
return next();
|
|
3279
3384
|
}
|
|
3280
3385
|
|
|
3281
|
-
/*
|
|
3386
|
+
/* harmony default export */ __webpack_exports__["default"] = ({
|
|
3282
3387
|
__extends,
|
|
3283
3388
|
__assign,
|
|
3284
3389
|
__rest,
|
|
@@ -3355,10 +3460,22 @@ function __disposeResources(env) {
|
|
|
3355
3460
|
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
|
|
3356
3461
|
/******/ }();
|
|
3357
3462
|
/******/
|
|
3463
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
3464
|
+
/******/ !function() {
|
|
3465
|
+
/******/ // define __esModule on exports
|
|
3466
|
+
/******/ __webpack_require__.r = function(exports) {
|
|
3467
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
3468
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
3469
|
+
/******/ }
|
|
3470
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
3471
|
+
/******/ };
|
|
3472
|
+
/******/ }();
|
|
3473
|
+
/******/
|
|
3358
3474
|
/************************************************************************/
|
|
3359
3475
|
var __webpack_exports__ = {};
|
|
3476
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3360
3477
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3361
|
-
/* harmony export */
|
|
3478
|
+
/* harmony export */ Scorm12API: function() { return /* binding */ Scorm12Impl; }
|
|
3362
3479
|
/* harmony export */ });
|
|
3363
3480
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(635);
|
|
3364
3481
|
/* harmony import */ var _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(989);
|
|
@@ -3368,9 +3485,9 @@ var __webpack_exports__ = {};
|
|
|
3368
3485
|
/* harmony import */ var _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(176);
|
|
3369
3486
|
/* harmony import */ var _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(833);
|
|
3370
3487
|
/* 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
|
|
3488
|
+
/* harmony import */ var _constants_enums__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(56);
|
|
3489
|
+
/* harmony import */ var _BaseAPI__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(429);
|
|
3490
|
+
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(417);
|
|
3374
3491
|
|
|
3375
3492
|
|
|
3376
3493
|
|
|
@@ -3384,7 +3501,7 @@ var __webpack_exports__ = {};
|
|
|
3384
3501
|
|
|
3385
3502
|
|
|
3386
3503
|
var Scorm12Impl = (function (_super) {
|
|
3387
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
3504
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_10__.__extends)(Scorm12Impl, _super);
|
|
3388
3505
|
function Scorm12Impl(settings) {
|
|
3389
3506
|
var _this = this;
|
|
3390
3507
|
if (settings) {
|
|
@@ -3392,10 +3509,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
3392
3509
|
settings.mastery_override = false;
|
|
3393
3510
|
}
|
|
3394
3511
|
}
|
|
3395
|
-
_this = _super.call(this, _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__
|
|
3512
|
+
_this = _super.call(this, _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors, settings) || this;
|
|
3396
3513
|
_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__
|
|
3514
|
+
_this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__.CMI();
|
|
3515
|
+
_this.nav = new _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__.NAV();
|
|
3399
3516
|
_this.LMSInitialize = _this.lmsInitialize;
|
|
3400
3517
|
_this.LMSFinish = _this.lmsFinish;
|
|
3401
3518
|
_this.LMSGetValue = _this.lmsGetValue;
|
|
@@ -3407,9 +3524,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
3407
3524
|
return _this;
|
|
3408
3525
|
}
|
|
3409
3526
|
Scorm12Impl.prototype.reset = function (settings) {
|
|
3527
|
+
var _a, _b;
|
|
3410
3528
|
this.commonReset(settings);
|
|
3411
|
-
this.cmi
|
|
3412
|
-
this.nav
|
|
3529
|
+
(_a = this.cmi) === null || _a === void 0 ? void 0 : _a.reset();
|
|
3530
|
+
(_b = this.nav) === null || _b === void 0 ? void 0 : _b.reset();
|
|
3413
3531
|
};
|
|
3414
3532
|
Scorm12Impl.prototype.lmsInitialize = function () {
|
|
3415
3533
|
this.cmi.initialize();
|
|
@@ -3423,8 +3541,8 @@ var Scorm12Impl = (function (_super) {
|
|
|
3423
3541
|
};
|
|
3424
3542
|
Scorm12Impl.prototype.lmsFinish = function () {
|
|
3425
3543
|
var _this = this;
|
|
3426
|
-
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
3427
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
3544
|
+
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(_this, void 0, void 0, function () {
|
|
3545
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_a) {
|
|
3428
3546
|
switch (_a.label) {
|
|
3429
3547
|
case 0: return [4, this.internalFinish()];
|
|
3430
3548
|
case 1:
|
|
@@ -3433,17 +3551,17 @@ var Scorm12Impl = (function (_super) {
|
|
|
3433
3551
|
}
|
|
3434
3552
|
});
|
|
3435
3553
|
}); })();
|
|
3436
|
-
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
3554
|
+
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE;
|
|
3437
3555
|
};
|
|
3438
3556
|
Scorm12Impl.prototype.internalFinish = function () {
|
|
3439
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
3557
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(this, void 0, void 0, function () {
|
|
3440
3558
|
var result;
|
|
3441
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
3559
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_a) {
|
|
3442
3560
|
switch (_a.label) {
|
|
3443
3561
|
case 0: return [4, this.terminate("LMSFinish", true)];
|
|
3444
3562
|
case 1:
|
|
3445
3563
|
result = _a.sent();
|
|
3446
|
-
if (result === _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
3564
|
+
if (result === _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE) {
|
|
3447
3565
|
if (this.nav.event !== "") {
|
|
3448
3566
|
if (this.nav.event === "continue") {
|
|
3449
3567
|
this.processListeners("SequenceNext");
|
|
@@ -3476,8 +3594,8 @@ var Scorm12Impl = (function (_super) {
|
|
|
3476
3594
|
this.scheduleCommit(500, "LMSCommit");
|
|
3477
3595
|
}
|
|
3478
3596
|
else {
|
|
3479
|
-
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
3480
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
3597
|
+
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(_this, void 0, void 0, function () {
|
|
3598
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_a) {
|
|
3481
3599
|
switch (_a.label) {
|
|
3482
3600
|
case 0: return [4, this.commit("LMSCommit", false)];
|
|
3483
3601
|
case 1:
|
|
@@ -3487,7 +3605,7 @@ var Scorm12Impl = (function (_super) {
|
|
|
3487
3605
|
});
|
|
3488
3606
|
}); })();
|
|
3489
3607
|
}
|
|
3490
|
-
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
3608
|
+
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE;
|
|
3491
3609
|
};
|
|
3492
3610
|
Scorm12Impl.prototype.lmsGetLastError = function () {
|
|
3493
3611
|
return this.getLastError("LMSGetLastError");
|
|
@@ -3505,20 +3623,20 @@ var Scorm12Impl = (function (_super) {
|
|
|
3505
3623
|
return this._commonGetCMIValue("getCMIValue", false, CMIElement);
|
|
3506
3624
|
};
|
|
3507
3625
|
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__
|
|
3626
|
+
if ((0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.objectives\\.\\d+")) {
|
|
3627
|
+
return new _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__.CMIObjectivesObject();
|
|
3510
3628
|
}
|
|
3511
3629
|
else if (foundFirstIndex &&
|
|
3512
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
3513
|
-
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__
|
|
3630
|
+
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) {
|
|
3631
|
+
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__.CMIInteractionsCorrectResponsesObject();
|
|
3514
3632
|
}
|
|
3515
3633
|
else if (foundFirstIndex &&
|
|
3516
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
3517
|
-
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__
|
|
3634
|
+
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) {
|
|
3635
|
+
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__.CMIInteractionsObjectivesObject();
|
|
3518
3636
|
}
|
|
3519
3637
|
else if (!foundFirstIndex &&
|
|
3520
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
3521
|
-
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__
|
|
3638
|
+
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+")) {
|
|
3639
|
+
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__.CMIInteractionsObject();
|
|
3522
3640
|
}
|
|
3523
3641
|
return null;
|
|
3524
3642
|
};
|
|
@@ -3528,11 +3646,11 @@ var Scorm12Impl = (function (_super) {
|
|
|
3528
3646
|
var basicMessage = "No Error";
|
|
3529
3647
|
var detailMessage = "No Error";
|
|
3530
3648
|
errorNumber = String(errorNumber);
|
|
3531
|
-
if (_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
3649
|
+
if (_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber]) {
|
|
3532
3650
|
basicMessage =
|
|
3533
|
-
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
3651
|
+
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber].basicMessage;
|
|
3534
3652
|
detailMessage =
|
|
3535
|
-
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
3653
|
+
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber].detailMessage;
|
|
3536
3654
|
}
|
|
3537
3655
|
return detail ? detailMessage : basicMessage;
|
|
3538
3656
|
};
|
|
@@ -3545,10 +3663,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
3545
3663
|
cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();
|
|
3546
3664
|
}
|
|
3547
3665
|
var result = [];
|
|
3548
|
-
var flattened = _utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
3666
|
+
var flattened = _utilities__WEBPACK_IMPORTED_MODULE_1__.flatten(cmiExport);
|
|
3549
3667
|
switch (this.settings.dataCommitFormat) {
|
|
3550
3668
|
case "flattened":
|
|
3551
|
-
return _utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
3669
|
+
return _utilities__WEBPACK_IMPORTED_MODULE_1__.flatten(cmiExport);
|
|
3552
3670
|
case "params":
|
|
3553
3671
|
for (var item in flattened) {
|
|
3554
3672
|
if ({}.hasOwnProperty.call(flattened, item)) {
|
|
@@ -3564,20 +3682,20 @@ var Scorm12Impl = (function (_super) {
|
|
|
3564
3682
|
Scorm12Impl.prototype.renderCommitObject = function (terminateCommit) {
|
|
3565
3683
|
var cmiExport = this.renderCommitCMI(terminateCommit);
|
|
3566
3684
|
var totalTimeHHMMSS = this.cmi.getCurrentTotalTime();
|
|
3567
|
-
var totalTimeSeconds = _utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
3685
|
+
var totalTimeSeconds = _utilities__WEBPACK_IMPORTED_MODULE_1__.getTimeAsSeconds(totalTimeHHMMSS, _constants_regex__WEBPACK_IMPORTED_MODULE_9__.scorm12_regex.CMITimespan);
|
|
3568
3686
|
var lessonStatus = this.cmi.core.lesson_status;
|
|
3569
|
-
var completionStatus =
|
|
3570
|
-
var successStatus =
|
|
3687
|
+
var completionStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.unknown;
|
|
3688
|
+
var successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.unknown;
|
|
3571
3689
|
if (lessonStatus) {
|
|
3572
3690
|
completionStatus =
|
|
3573
3691
|
lessonStatus === "completed" || lessonStatus === "passed"
|
|
3574
|
-
?
|
|
3575
|
-
:
|
|
3692
|
+
? _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.completed
|
|
3693
|
+
: _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.incomplete;
|
|
3576
3694
|
if (lessonStatus === "passed") {
|
|
3577
|
-
successStatus =
|
|
3695
|
+
successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.passed;
|
|
3578
3696
|
}
|
|
3579
3697
|
else if (lessonStatus === "failed") {
|
|
3580
|
-
successStatus =
|
|
3698
|
+
successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.failed;
|
|
3581
3699
|
}
|
|
3582
3700
|
}
|
|
3583
3701
|
var score = this.cmi.core.score;
|
|
@@ -3606,10 +3724,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
3606
3724
|
return commitObject;
|
|
3607
3725
|
};
|
|
3608
3726
|
Scorm12Impl.prototype.storeData = function (terminateCommit) {
|
|
3609
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
3727
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(this, void 0, void 0, function () {
|
|
3610
3728
|
var originalStatus, commitObject;
|
|
3611
3729
|
var _a, _b, _c;
|
|
3612
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
3730
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_d) {
|
|
3613
3731
|
switch (_d.label) {
|
|
3614
3732
|
case 0:
|
|
3615
3733
|
if (terminateCommit) {
|
|
@@ -3644,7 +3762,7 @@ var Scorm12Impl = (function (_super) {
|
|
|
3644
3762
|
return [4, this.processHttpRequest(this.settings.lmsCommitUrl, commitObject, terminateCommit)];
|
|
3645
3763
|
case 1: return [2, _d.sent()];
|
|
3646
3764
|
case 2: return [2, {
|
|
3647
|
-
result: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
3765
|
+
result: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE,
|
|
3648
3766
|
errorCode: 0,
|
|
3649
3767
|
}];
|
|
3650
3768
|
}
|
|
@@ -3652,10 +3770,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
3652
3770
|
});
|
|
3653
3771
|
};
|
|
3654
3772
|
return Scorm12Impl;
|
|
3655
|
-
}(
|
|
3773
|
+
}(_BaseAPI__WEBPACK_IMPORTED_MODULE_8__["default"]));
|
|
3656
3774
|
|
|
3657
3775
|
|
|
3658
|
-
var
|
|
3659
|
-
export {
|
|
3776
|
+
var __webpack_exports__Scorm12API = __webpack_exports__.Scorm12API;
|
|
3777
|
+
export { __webpack_exports__Scorm12API as Scorm12API };
|
|
3660
3778
|
|
|
3661
3779
|
//# sourceMappingURL=scorm12.js.map
|