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