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