scorm-again 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/aicc.js +3161 -2799
- 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 +4569 -0
- package/dist/esm/aicc.js.map +1 -0
- package/dist/esm/aicc.min.js +2 -0
- package/dist/esm/aicc.min.js.map +1 -0
- package/dist/esm/scorm-again.js +6955 -0
- package/dist/esm/scorm-again.js.map +1 -0
- package/dist/esm/scorm-again.min.js +2 -0
- package/dist/esm/scorm-again.min.js.map +1 -0
- package/dist/esm/scorm12.js +3637 -0
- package/dist/esm/scorm12.js.map +1 -0
- package/dist/esm/scorm12.min.js +2 -0
- package/dist/esm/scorm12.min.js.map +1 -0
- package/dist/esm/scorm2004.js +4631 -0
- package/dist/esm/scorm2004.js.map +1 -0
- package/dist/esm/scorm2004.min.js +2 -0
- package/dist/esm/scorm2004.min.js.map +1 -0
- package/dist/scorm-again.js +4498 -4082
- 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 +3074 -2756
- 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 +2430 -2221
- package/dist/scorm2004.js.map +1 -1
- package/dist/scorm2004.min.js +1 -1
- package/dist/scorm2004.min.js.map +1 -1
- package/index.d.ts +69 -4
- package/package.json +11 -8
- package/src/AICC.ts +6 -4
- package/src/BaseAPI.ts +38 -21
- package/src/Scorm12API.ts +24 -29
- package/src/Scorm2004API.ts +13 -18
- package/src/ScormAgain.ts +9 -0
- package/src/constants/default_settings.ts +1 -0
- package/src/types/api_types.ts +1 -0
- package/test/AICC.spec.ts +2 -2
- package/test/Scorm12API.spec.ts +73 -2
- package/test/Scorm2004API.spec.ts +18 -18
- package/webpack.config.js +38 -15
- package/src/exports/aicc.js +0 -3
- package/src/exports/scorm-again.js +0 -7
- package/src/exports/scorm12.js +0 -3
- package/src/exports/scorm2004.js +0 -3
- package/src/utilities/debounce.ts +0 -31
- package/test/utilities/debounce.spec.ts +0 -56
package/dist/esm/aicc.js
ADDED
|
@@ -0,0 +1,4569 @@
|
|
|
1
|
+
/******/ var __webpack_modules__ = ({
|
|
2
|
+
|
|
3
|
+
/***/ 429:
|
|
4
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
// EXPORTS
|
|
8
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
9
|
+
A: function() { return /* binding */ src_BaseAPI; }
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs
|
|
13
|
+
var tslib_es6 = __webpack_require__(635);
|
|
14
|
+
// EXTERNAL MODULE: ./src/cmi/common/array.ts
|
|
15
|
+
var array = __webpack_require__(589);
|
|
16
|
+
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
17
|
+
var exceptions = __webpack_require__(784);
|
|
18
|
+
// EXTERNAL MODULE: ./src/constants/error_codes.ts
|
|
19
|
+
var error_codes = __webpack_require__(797);
|
|
20
|
+
// EXTERNAL MODULE: ./src/constants/api_constants.ts
|
|
21
|
+
var api_constants = __webpack_require__(340);
|
|
22
|
+
// EXTERNAL MODULE: ./src/utilities.ts
|
|
23
|
+
var utilities = __webpack_require__(864);
|
|
24
|
+
;// ./src/constants/default_settings.ts
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
var DefaultSettings = {
|
|
28
|
+
autocommit: false,
|
|
29
|
+
autocommitSeconds: 10,
|
|
30
|
+
asyncCommit: false,
|
|
31
|
+
sendFullCommit: true,
|
|
32
|
+
lmsCommitUrl: false,
|
|
33
|
+
dataCommitFormat: "json",
|
|
34
|
+
commitRequestDataType: "application/json;charset=UTF-8",
|
|
35
|
+
autoProgress: false,
|
|
36
|
+
logLevel: api_constants/* default */.A.global.LOG_LEVEL_ERROR,
|
|
37
|
+
selfReportSessionTime: false,
|
|
38
|
+
alwaysSendTotalTime: false,
|
|
39
|
+
renderCommonCommitFields: false,
|
|
40
|
+
strict_errors: true,
|
|
41
|
+
xhrHeaders: {},
|
|
42
|
+
xhrWithCredentials: false,
|
|
43
|
+
fetchMode: "cors",
|
|
44
|
+
responseHandler: function (response) {
|
|
45
|
+
return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () {
|
|
46
|
+
var httpResult, _a, _b;
|
|
47
|
+
return (0,tslib_es6/* __generator */.YH)(this, function (_c) {
|
|
48
|
+
switch (_c.label) {
|
|
49
|
+
case 0:
|
|
50
|
+
if (!(typeof response !== "undefined")) return [3, 2];
|
|
51
|
+
_b = (_a = JSON).parse;
|
|
52
|
+
return [4, response.text()];
|
|
53
|
+
case 1:
|
|
54
|
+
httpResult = _b.apply(_a, [_c.sent()]);
|
|
55
|
+
if (httpResult === null ||
|
|
56
|
+
!{}.hasOwnProperty.call(httpResult, "result")) {
|
|
57
|
+
if (response.status === 200) {
|
|
58
|
+
return [2, {
|
|
59
|
+
result: api_constants/* default */.A.global.SCORM_TRUE,
|
|
60
|
+
errorCode: 0,
|
|
61
|
+
}];
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
return [2, {
|
|
65
|
+
result: api_constants/* default */.A.global.SCORM_FALSE,
|
|
66
|
+
errorCode: 101,
|
|
67
|
+
}];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
return [2, {
|
|
72
|
+
result: httpResult.result,
|
|
73
|
+
errorCode: httpResult.errorCode
|
|
74
|
+
? httpResult.errorCode
|
|
75
|
+
: httpResult.result === api_constants/* default */.A.global.SCORM_TRUE
|
|
76
|
+
? 0
|
|
77
|
+
: 101,
|
|
78
|
+
}];
|
|
79
|
+
}
|
|
80
|
+
_c.label = 2;
|
|
81
|
+
case 2: return [2, {
|
|
82
|
+
result: api_constants/* default */.A.global.SCORM_FALSE,
|
|
83
|
+
errorCode: 101,
|
|
84
|
+
}];
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
requestHandler: function (commitObject) {
|
|
90
|
+
return commitObject;
|
|
91
|
+
},
|
|
92
|
+
onLogMessage: function (messageLevel, logMessage) {
|
|
93
|
+
switch (messageLevel) {
|
|
94
|
+
case api_constants/* default */.A.global.LOG_LEVEL_ERROR:
|
|
95
|
+
console.error(logMessage);
|
|
96
|
+
break;
|
|
97
|
+
case api_constants/* default */.A.global.LOG_LEVEL_WARNING:
|
|
98
|
+
console.warn(logMessage);
|
|
99
|
+
break;
|
|
100
|
+
case api_constants/* default */.A.global.LOG_LEVEL_INFO:
|
|
101
|
+
console.info(logMessage);
|
|
102
|
+
break;
|
|
103
|
+
case api_constants/* default */.A.global.LOG_LEVEL_DEBUG:
|
|
104
|
+
if (console.debug) {
|
|
105
|
+
console.debug(logMessage);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
console.log(logMessage);
|
|
109
|
+
}
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
scoItemIds: [],
|
|
114
|
+
scoItemIdValidator: false,
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
;// ./src/helpers/scheduled_commit.ts
|
|
118
|
+
|
|
119
|
+
var ScheduledCommit = (function () {
|
|
120
|
+
function ScheduledCommit(API, when, callback) {
|
|
121
|
+
this._cancelled = false;
|
|
122
|
+
this._API = API;
|
|
123
|
+
this._timeout = setTimeout(this.wrapper.bind(this), when);
|
|
124
|
+
this._callback = callback;
|
|
125
|
+
}
|
|
126
|
+
ScheduledCommit.prototype.cancel = function () {
|
|
127
|
+
this._cancelled = true;
|
|
128
|
+
if (this._timeout) {
|
|
129
|
+
clearTimeout(this._timeout);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
ScheduledCommit.prototype.wrapper = function () {
|
|
133
|
+
var _this = this;
|
|
134
|
+
if (!this._cancelled) {
|
|
135
|
+
(function () { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { return (0,tslib_es6/* __generator */.YH)(this, function (_a) {
|
|
136
|
+
switch (_a.label) {
|
|
137
|
+
case 0: return [4, this._API.commit(this._callback)];
|
|
138
|
+
case 1: return [2, _a.sent()];
|
|
139
|
+
}
|
|
140
|
+
}); }); })();
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
return ScheduledCommit;
|
|
144
|
+
}());
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
;// ./src/BaseAPI.ts
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
var BaseAPI = (function () {
|
|
157
|
+
function BaseAPI(error_codes, settings) {
|
|
158
|
+
var _newTarget = this.constructor;
|
|
159
|
+
this._settings = DefaultSettings;
|
|
160
|
+
if (_newTarget === BaseAPI) {
|
|
161
|
+
throw new TypeError("Cannot construct BaseAPI instances directly");
|
|
162
|
+
}
|
|
163
|
+
this.currentState = api_constants/* default */.A.global.STATE_NOT_INITIALIZED;
|
|
164
|
+
this.lastErrorCode = "0";
|
|
165
|
+
this.listenerArray = [];
|
|
166
|
+
this._error_codes = error_codes;
|
|
167
|
+
if (settings) {
|
|
168
|
+
this.settings = settings;
|
|
169
|
+
}
|
|
170
|
+
this.apiLogLevel = this.settings.logLevel;
|
|
171
|
+
this.selfReportSessionTime = this.settings.selfReportSessionTime;
|
|
172
|
+
}
|
|
173
|
+
BaseAPI.prototype.commonReset = function (settings) {
|
|
174
|
+
this.settings = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, this.settings), settings);
|
|
175
|
+
this.currentState = api_constants/* default */.A.global.STATE_NOT_INITIALIZED;
|
|
176
|
+
this.lastErrorCode = "0";
|
|
177
|
+
this.listenerArray = [];
|
|
178
|
+
};
|
|
179
|
+
BaseAPI.prototype.initialize = function (callbackName, initializeMessage, terminationMessage) {
|
|
180
|
+
var returnValue = api_constants/* default */.A.global.SCORM_FALSE;
|
|
181
|
+
if (this.isInitialized()) {
|
|
182
|
+
this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);
|
|
183
|
+
}
|
|
184
|
+
else if (this.isTerminated()) {
|
|
185
|
+
this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage);
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
if (this.selfReportSessionTime) {
|
|
189
|
+
this.cmi.setStartTime();
|
|
190
|
+
}
|
|
191
|
+
this.currentState = api_constants/* default */.A.global.STATE_INITIALIZED;
|
|
192
|
+
this.lastErrorCode = "0";
|
|
193
|
+
returnValue = api_constants/* default */.A.global.SCORM_TRUE;
|
|
194
|
+
this.processListeners(callbackName);
|
|
195
|
+
}
|
|
196
|
+
this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO);
|
|
197
|
+
this.clearSCORMError(returnValue);
|
|
198
|
+
return returnValue;
|
|
199
|
+
};
|
|
200
|
+
BaseAPI.prototype.apiLog = function (functionName, logMessage, messageLevel, CMIElement) {
|
|
201
|
+
logMessage = (0,utilities/* formatMessage */.hw)(functionName, logMessage, CMIElement);
|
|
202
|
+
if (messageLevel >= this.apiLogLevel) {
|
|
203
|
+
this.settings.onLogMessage(messageLevel, logMessage);
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
Object.defineProperty(BaseAPI.prototype, "error_codes", {
|
|
207
|
+
get: function () {
|
|
208
|
+
return this._error_codes;
|
|
209
|
+
},
|
|
210
|
+
enumerable: false,
|
|
211
|
+
configurable: true
|
|
212
|
+
});
|
|
213
|
+
Object.defineProperty(BaseAPI.prototype, "settings", {
|
|
214
|
+
get: function () {
|
|
215
|
+
return this._settings;
|
|
216
|
+
},
|
|
217
|
+
set: function (settings) {
|
|
218
|
+
this._settings = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, this._settings), settings);
|
|
219
|
+
},
|
|
220
|
+
enumerable: false,
|
|
221
|
+
configurable: true
|
|
222
|
+
});
|
|
223
|
+
BaseAPI.prototype.terminate = function (callbackName, checkTerminated) {
|
|
224
|
+
return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () {
|
|
225
|
+
var returnValue, result;
|
|
226
|
+
return (0,tslib_es6/* __generator */.YH)(this, function (_a) {
|
|
227
|
+
switch (_a.label) {
|
|
228
|
+
case 0:
|
|
229
|
+
returnValue = api_constants/* default */.A.global.SCORM_FALSE;
|
|
230
|
+
if (!this.checkState(checkTerminated, this._error_codes.TERMINATION_BEFORE_INIT, this._error_codes.MULTIPLE_TERMINATION)) return [3, 2];
|
|
231
|
+
this.currentState = api_constants/* default */.A.global.STATE_TERMINATED;
|
|
232
|
+
return [4, this.storeData(true)];
|
|
233
|
+
case 1:
|
|
234
|
+
result = _a.sent();
|
|
235
|
+
if (typeof result.errorCode !== "undefined" && result.errorCode > 0) {
|
|
236
|
+
this.throwSCORMError(result.errorCode);
|
|
237
|
+
}
|
|
238
|
+
returnValue =
|
|
239
|
+
typeof result !== "undefined" && result.result
|
|
240
|
+
? result.result
|
|
241
|
+
: api_constants/* default */.A.global.SCORM_FALSE;
|
|
242
|
+
if (checkTerminated)
|
|
243
|
+
this.lastErrorCode = "0";
|
|
244
|
+
returnValue = api_constants/* default */.A.global.SCORM_TRUE;
|
|
245
|
+
this.processListeners(callbackName);
|
|
246
|
+
_a.label = 2;
|
|
247
|
+
case 2:
|
|
248
|
+
this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO);
|
|
249
|
+
this.clearSCORMError(returnValue);
|
|
250
|
+
return [2, returnValue];
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
});
|
|
254
|
+
};
|
|
255
|
+
BaseAPI.prototype.getValue = function (callbackName, checkTerminated, CMIElement) {
|
|
256
|
+
var returnValue = "";
|
|
257
|
+
if (this.checkState(checkTerminated, this._error_codes.RETRIEVE_BEFORE_INIT, this._error_codes.RETRIEVE_AFTER_TERM)) {
|
|
258
|
+
if (checkTerminated)
|
|
259
|
+
this.lastErrorCode = "0";
|
|
260
|
+
try {
|
|
261
|
+
returnValue = this.getCMIValue(CMIElement);
|
|
262
|
+
}
|
|
263
|
+
catch (e) {
|
|
264
|
+
returnValue = this.handleValueAccessException(e, returnValue);
|
|
265
|
+
}
|
|
266
|
+
this.processListeners(callbackName, CMIElement);
|
|
267
|
+
}
|
|
268
|
+
this.apiLog(callbackName, ": returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement);
|
|
269
|
+
if (returnValue === undefined) {
|
|
270
|
+
return "";
|
|
271
|
+
}
|
|
272
|
+
this.clearSCORMError(returnValue);
|
|
273
|
+
return returnValue;
|
|
274
|
+
};
|
|
275
|
+
BaseAPI.prototype.setValue = function (callbackName, commitCallback, checkTerminated, CMIElement, value) {
|
|
276
|
+
if (value !== undefined) {
|
|
277
|
+
value = String(value);
|
|
278
|
+
}
|
|
279
|
+
var returnValue = api_constants/* default */.A.global.SCORM_FALSE;
|
|
280
|
+
if (this.checkState(checkTerminated, this._error_codes.STORE_BEFORE_INIT, this._error_codes.STORE_AFTER_TERM)) {
|
|
281
|
+
if (checkTerminated)
|
|
282
|
+
this.lastErrorCode = "0";
|
|
283
|
+
try {
|
|
284
|
+
returnValue = this.setCMIValue(CMIElement, value);
|
|
285
|
+
}
|
|
286
|
+
catch (e) {
|
|
287
|
+
this.handleValueAccessException(e, returnValue);
|
|
288
|
+
}
|
|
289
|
+
this.processListeners(callbackName, CMIElement, value);
|
|
290
|
+
}
|
|
291
|
+
if (returnValue === undefined) {
|
|
292
|
+
returnValue = api_constants/* default */.A.global.SCORM_FALSE;
|
|
293
|
+
}
|
|
294
|
+
if (String(this.lastErrorCode) === "0") {
|
|
295
|
+
if (this.settings.autocommit) {
|
|
296
|
+
this.scheduleCommit(this.settings.autocommitSeconds * 1000, commitCallback);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
this.apiLog(callbackName, ": " + value + ": result: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement);
|
|
300
|
+
this.clearSCORMError(returnValue);
|
|
301
|
+
return returnValue;
|
|
302
|
+
};
|
|
303
|
+
BaseAPI.prototype.commit = function (callbackName_1) {
|
|
304
|
+
return (0,tslib_es6/* __awaiter */.sH)(this, arguments, void 0, function (callbackName, checkTerminated) {
|
|
305
|
+
var returnValue, result;
|
|
306
|
+
if (checkTerminated === void 0) { checkTerminated = false; }
|
|
307
|
+
return (0,tslib_es6/* __generator */.YH)(this, function (_a) {
|
|
308
|
+
switch (_a.label) {
|
|
309
|
+
case 0:
|
|
310
|
+
console.log("commit");
|
|
311
|
+
this.clearScheduledCommit();
|
|
312
|
+
returnValue = api_constants/* default */.A.global.SCORM_FALSE;
|
|
313
|
+
if (!this.checkState(checkTerminated, this._error_codes.COMMIT_BEFORE_INIT, this._error_codes.COMMIT_AFTER_TERM)) return [3, 2];
|
|
314
|
+
return [4, this.storeData(false)];
|
|
315
|
+
case 1:
|
|
316
|
+
result = _a.sent();
|
|
317
|
+
if (result.errorCode && result.errorCode > 0) {
|
|
318
|
+
this.throwSCORMError(result.errorCode);
|
|
319
|
+
}
|
|
320
|
+
returnValue =
|
|
321
|
+
typeof result !== "undefined" && result.result
|
|
322
|
+
? result.result
|
|
323
|
+
: api_constants/* default */.A.global.SCORM_FALSE;
|
|
324
|
+
this.apiLog(callbackName, " Result: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_DEBUG, "HttpRequest");
|
|
325
|
+
if (checkTerminated)
|
|
326
|
+
this.lastErrorCode = "0";
|
|
327
|
+
this.processListeners(callbackName);
|
|
328
|
+
_a.label = 2;
|
|
329
|
+
case 2:
|
|
330
|
+
this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO);
|
|
331
|
+
this.clearSCORMError(returnValue);
|
|
332
|
+
return [2, returnValue];
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
});
|
|
336
|
+
};
|
|
337
|
+
BaseAPI.prototype.getLastError = function (callbackName) {
|
|
338
|
+
var returnValue = String(this.lastErrorCode);
|
|
339
|
+
this.processListeners(callbackName);
|
|
340
|
+
this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO);
|
|
341
|
+
return returnValue;
|
|
342
|
+
};
|
|
343
|
+
BaseAPI.prototype.getErrorString = function (callbackName, CMIErrorCode) {
|
|
344
|
+
var returnValue = "";
|
|
345
|
+
if (CMIErrorCode !== null && CMIErrorCode !== "") {
|
|
346
|
+
returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);
|
|
347
|
+
this.processListeners(callbackName);
|
|
348
|
+
}
|
|
349
|
+
this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO);
|
|
350
|
+
return returnValue;
|
|
351
|
+
};
|
|
352
|
+
BaseAPI.prototype.getDiagnostic = function (callbackName, CMIErrorCode) {
|
|
353
|
+
var returnValue = "";
|
|
354
|
+
if (CMIErrorCode !== null && CMIErrorCode !== "") {
|
|
355
|
+
returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);
|
|
356
|
+
this.processListeners(callbackName);
|
|
357
|
+
}
|
|
358
|
+
this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO);
|
|
359
|
+
return returnValue;
|
|
360
|
+
};
|
|
361
|
+
BaseAPI.prototype.checkState = function (checkTerminated, beforeInitError, afterTermError) {
|
|
362
|
+
if (this.isNotInitialized()) {
|
|
363
|
+
this.throwSCORMError(beforeInitError);
|
|
364
|
+
return false;
|
|
365
|
+
}
|
|
366
|
+
else if (checkTerminated && this.isTerminated()) {
|
|
367
|
+
this.throwSCORMError(afterTermError);
|
|
368
|
+
return false;
|
|
369
|
+
}
|
|
370
|
+
return true;
|
|
371
|
+
};
|
|
372
|
+
BaseAPI.prototype.getLmsErrorMessageDetails = function (_errorNumber, _detail) {
|
|
373
|
+
if (_detail === void 0) { _detail = false; }
|
|
374
|
+
throw new Error("The getLmsErrorMessageDetails method has not been implemented");
|
|
375
|
+
};
|
|
376
|
+
BaseAPI.prototype.getCMIValue = function (_CMIElement) {
|
|
377
|
+
throw new Error("The getCMIValue method has not been implemented");
|
|
378
|
+
};
|
|
379
|
+
BaseAPI.prototype.setCMIValue = function (_CMIElement, _value) {
|
|
380
|
+
throw new Error("The setCMIValue method has not been implemented");
|
|
381
|
+
};
|
|
382
|
+
BaseAPI.prototype._commonSetCMIValue = function (methodName, scorm2004, CMIElement, value) {
|
|
383
|
+
if (!CMIElement || CMIElement === "") {
|
|
384
|
+
return api_constants/* default */.A.global.SCORM_FALSE;
|
|
385
|
+
}
|
|
386
|
+
var structure = CMIElement.split(".");
|
|
387
|
+
var refObject = this;
|
|
388
|
+
var returnValue = api_constants/* default */.A.global.SCORM_FALSE;
|
|
389
|
+
var foundFirstIndex = false;
|
|
390
|
+
var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element.");
|
|
391
|
+
var invalidErrorCode = scorm2004
|
|
392
|
+
? this._error_codes.UNDEFINED_DATA_MODEL
|
|
393
|
+
: this._error_codes.GENERAL;
|
|
394
|
+
for (var idx = 0; idx < structure.length; idx++) {
|
|
395
|
+
var attribute = structure[idx];
|
|
396
|
+
if (idx === structure.length - 1) {
|
|
397
|
+
if (scorm2004 && attribute.substring(0, 8) === "{target=") {
|
|
398
|
+
if (this.isInitialized()) {
|
|
399
|
+
this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);
|
|
400
|
+
}
|
|
401
|
+
else {
|
|
402
|
+
refObject = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, refObject), { attribute: value });
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
else if (!this._checkObjectHasProperty(refObject, attribute)) {
|
|
406
|
+
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
407
|
+
}
|
|
408
|
+
else {
|
|
409
|
+
if ((0,utilities/* stringMatches */.J6)(CMIElement, "\\.correct_responses\\.\\d+") &&
|
|
410
|
+
this.isInitialized()) {
|
|
411
|
+
this.validateCorrectResponse(CMIElement, value);
|
|
412
|
+
}
|
|
413
|
+
if (!scorm2004 || this.lastErrorCode === "0") {
|
|
414
|
+
refObject[attribute] = value;
|
|
415
|
+
returnValue = api_constants/* default */.A.global.SCORM_TRUE;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
else {
|
|
420
|
+
refObject = refObject[attribute];
|
|
421
|
+
if (!refObject) {
|
|
422
|
+
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
423
|
+
break;
|
|
424
|
+
}
|
|
425
|
+
if (refObject instanceof array/* CMIArray */.B) {
|
|
426
|
+
var index = parseInt(structure[idx + 1], 10);
|
|
427
|
+
if (!isNaN(index)) {
|
|
428
|
+
var item = refObject.childArray[index];
|
|
429
|
+
if (item) {
|
|
430
|
+
refObject = item;
|
|
431
|
+
foundFirstIndex = true;
|
|
432
|
+
}
|
|
433
|
+
else {
|
|
434
|
+
var newChild = this.getChildElement(CMIElement, value, foundFirstIndex);
|
|
435
|
+
foundFirstIndex = true;
|
|
436
|
+
if (!newChild) {
|
|
437
|
+
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
438
|
+
}
|
|
439
|
+
else {
|
|
440
|
+
if (refObject.initialized)
|
|
441
|
+
newChild.initialize();
|
|
442
|
+
refObject.childArray.push(newChild);
|
|
443
|
+
refObject = newChild;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
idx++;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
if (returnValue === api_constants/* default */.A.global.SCORM_FALSE) {
|
|
452
|
+
this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value), api_constants/* default */.A.global.LOG_LEVEL_WARNING);
|
|
453
|
+
}
|
|
454
|
+
return returnValue;
|
|
455
|
+
};
|
|
456
|
+
BaseAPI.prototype._commonGetCMIValue = function (methodName, scorm2004, CMIElement) {
|
|
457
|
+
if (!CMIElement || CMIElement === "") {
|
|
458
|
+
return "";
|
|
459
|
+
}
|
|
460
|
+
var structure = CMIElement.split(".");
|
|
461
|
+
var refObject = this;
|
|
462
|
+
var attribute = null;
|
|
463
|
+
var uninitializedErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") has not been initialized.");
|
|
464
|
+
var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element.");
|
|
465
|
+
var invalidErrorCode = scorm2004
|
|
466
|
+
? this._error_codes.UNDEFINED_DATA_MODEL
|
|
467
|
+
: this._error_codes.GENERAL;
|
|
468
|
+
for (var idx = 0; idx < structure.length; idx++) {
|
|
469
|
+
attribute = structure[idx];
|
|
470
|
+
if (!scorm2004) {
|
|
471
|
+
if (idx === structure.length - 1) {
|
|
472
|
+
if (!this._checkObjectHasProperty(refObject, attribute)) {
|
|
473
|
+
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
else {
|
|
479
|
+
if (String(attribute).substring(0, 8) === "{target=" &&
|
|
480
|
+
typeof refObject._isTargetValid == "function") {
|
|
481
|
+
var target = String(attribute).substring(8, String(attribute).length - 9);
|
|
482
|
+
return refObject._isTargetValid(target);
|
|
483
|
+
}
|
|
484
|
+
else if (!this._checkObjectHasProperty(refObject, attribute)) {
|
|
485
|
+
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
refObject = refObject[attribute];
|
|
490
|
+
if (refObject === undefined) {
|
|
491
|
+
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
492
|
+
break;
|
|
493
|
+
}
|
|
494
|
+
if (refObject instanceof array/* CMIArray */.B) {
|
|
495
|
+
var index = parseInt(structure[idx + 1], 10);
|
|
496
|
+
if (!isNaN(index)) {
|
|
497
|
+
var item = refObject.childArray[index];
|
|
498
|
+
if (item) {
|
|
499
|
+
refObject = item;
|
|
500
|
+
}
|
|
501
|
+
else {
|
|
502
|
+
this.throwSCORMError(this._error_codes.VALUE_NOT_INITIALIZED, uninitializedErrorMessage);
|
|
503
|
+
break;
|
|
504
|
+
}
|
|
505
|
+
idx++;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
if (refObject === null || refObject === undefined) {
|
|
510
|
+
if (!scorm2004) {
|
|
511
|
+
if (attribute === "_children") {
|
|
512
|
+
this.throwSCORMError(error_codes/* default */.A.scorm12.CHILDREN_ERROR);
|
|
513
|
+
}
|
|
514
|
+
else if (attribute === "_count") {
|
|
515
|
+
this.throwSCORMError(error_codes/* default */.A.scorm12.COUNT_ERROR);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
else {
|
|
520
|
+
return refObject;
|
|
521
|
+
}
|
|
522
|
+
};
|
|
523
|
+
BaseAPI.prototype.isInitialized = function () {
|
|
524
|
+
return this.currentState === api_constants/* default */.A.global.STATE_INITIALIZED;
|
|
525
|
+
};
|
|
526
|
+
BaseAPI.prototype.isNotInitialized = function () {
|
|
527
|
+
return this.currentState === api_constants/* default */.A.global.STATE_NOT_INITIALIZED;
|
|
528
|
+
};
|
|
529
|
+
BaseAPI.prototype.isTerminated = function () {
|
|
530
|
+
return this.currentState === api_constants/* default */.A.global.STATE_TERMINATED;
|
|
531
|
+
};
|
|
532
|
+
BaseAPI.prototype.on = function (listenerName, callback) {
|
|
533
|
+
if (!callback)
|
|
534
|
+
return;
|
|
535
|
+
var listenerFunctions = listenerName.split(" ");
|
|
536
|
+
for (var i = 0; i < listenerFunctions.length; i++) {
|
|
537
|
+
var listenerSplit = listenerFunctions[i].split(".");
|
|
538
|
+
if (listenerSplit.length === 0)
|
|
539
|
+
return;
|
|
540
|
+
var functionName = listenerSplit[0];
|
|
541
|
+
var CMIElement = null;
|
|
542
|
+
if (listenerSplit.length > 1) {
|
|
543
|
+
CMIElement = listenerName.replace(functionName + ".", "");
|
|
544
|
+
}
|
|
545
|
+
this.listenerArray.push({
|
|
546
|
+
functionName: functionName,
|
|
547
|
+
CMIElement: CMIElement,
|
|
548
|
+
callback: callback,
|
|
549
|
+
});
|
|
550
|
+
this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), api_constants/* default */.A.global.LOG_LEVEL_INFO, functionName);
|
|
551
|
+
}
|
|
552
|
+
};
|
|
553
|
+
BaseAPI.prototype.off = function (listenerName, callback) {
|
|
554
|
+
if (!callback)
|
|
555
|
+
return;
|
|
556
|
+
var listenerFunctions = listenerName.split(" ");
|
|
557
|
+
var _loop_1 = function (i) {
|
|
558
|
+
var listenerSplit = listenerFunctions[i].split(".");
|
|
559
|
+
if (listenerSplit.length === 0)
|
|
560
|
+
return { value: void 0 };
|
|
561
|
+
var functionName = listenerSplit[0];
|
|
562
|
+
var CMIElement = null;
|
|
563
|
+
if (listenerSplit.length > 1) {
|
|
564
|
+
CMIElement = listenerName.replace(functionName + ".", "");
|
|
565
|
+
}
|
|
566
|
+
var removeIndex = this_1.listenerArray.findIndex(function (obj) {
|
|
567
|
+
return obj.functionName === functionName &&
|
|
568
|
+
obj.CMIElement === CMIElement &&
|
|
569
|
+
obj.callback === callback;
|
|
570
|
+
});
|
|
571
|
+
if (removeIndex !== -1) {
|
|
572
|
+
this_1.listenerArray.splice(removeIndex, 1);
|
|
573
|
+
this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), api_constants/* default */.A.global.LOG_LEVEL_INFO, functionName);
|
|
574
|
+
}
|
|
575
|
+
};
|
|
576
|
+
var this_1 = this;
|
|
577
|
+
for (var i = 0; i < listenerFunctions.length; i++) {
|
|
578
|
+
var state_1 = _loop_1(i);
|
|
579
|
+
if (typeof state_1 === "object")
|
|
580
|
+
return state_1.value;
|
|
581
|
+
}
|
|
582
|
+
};
|
|
583
|
+
BaseAPI.prototype.clear = function (listenerName) {
|
|
584
|
+
var listenerFunctions = listenerName.split(" ");
|
|
585
|
+
var _loop_2 = function (i) {
|
|
586
|
+
var listenerSplit = listenerFunctions[i].split(".");
|
|
587
|
+
if (listenerSplit.length === 0)
|
|
588
|
+
return { value: void 0 };
|
|
589
|
+
var functionName = listenerSplit[0];
|
|
590
|
+
var CMIElement = null;
|
|
591
|
+
if (listenerSplit.length > 1) {
|
|
592
|
+
CMIElement = listenerName.replace(functionName + ".", "");
|
|
593
|
+
}
|
|
594
|
+
this_2.listenerArray = this_2.listenerArray.filter(function (obj) {
|
|
595
|
+
return obj.functionName !== functionName && obj.CMIElement !== CMIElement;
|
|
596
|
+
});
|
|
597
|
+
};
|
|
598
|
+
var this_2 = this;
|
|
599
|
+
for (var i = 0; i < listenerFunctions.length; i++) {
|
|
600
|
+
var state_2 = _loop_2(i);
|
|
601
|
+
if (typeof state_2 === "object")
|
|
602
|
+
return state_2.value;
|
|
603
|
+
}
|
|
604
|
+
};
|
|
605
|
+
BaseAPI.prototype.processListeners = function (functionName, CMIElement, value) {
|
|
606
|
+
this.apiLog(functionName, value, api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement);
|
|
607
|
+
for (var i = 0; i < this.listenerArray.length; i++) {
|
|
608
|
+
var listener = this.listenerArray[i];
|
|
609
|
+
var functionsMatch = listener.functionName === functionName;
|
|
610
|
+
var listenerHasCMIElement = !!listener.CMIElement;
|
|
611
|
+
var CMIElementsMatch = false;
|
|
612
|
+
if (CMIElement &&
|
|
613
|
+
listener.CMIElement &&
|
|
614
|
+
listener.CMIElement.substring(listener.CMIElement.length - 1) === "*") {
|
|
615
|
+
CMIElementsMatch =
|
|
616
|
+
CMIElement.indexOf(listener.CMIElement.substring(0, listener.CMIElement.length - 1)) === 0;
|
|
617
|
+
}
|
|
618
|
+
else {
|
|
619
|
+
CMIElementsMatch = listener.CMIElement === CMIElement;
|
|
620
|
+
}
|
|
621
|
+
if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {
|
|
622
|
+
this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement);
|
|
623
|
+
listener.callback(CMIElement, value);
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
};
|
|
627
|
+
BaseAPI.prototype.throwSCORMError = function (errorNumber, message) {
|
|
628
|
+
if (!message) {
|
|
629
|
+
message = this.getLmsErrorMessageDetails(errorNumber);
|
|
630
|
+
}
|
|
631
|
+
this.apiLog("throwSCORMError", errorNumber + ": " + message, api_constants/* default */.A.global.LOG_LEVEL_ERROR);
|
|
632
|
+
this.lastErrorCode = String(errorNumber);
|
|
633
|
+
};
|
|
634
|
+
BaseAPI.prototype.clearSCORMError = function (success) {
|
|
635
|
+
if (success !== undefined && success !== api_constants/* default */.A.global.SCORM_FALSE) {
|
|
636
|
+
this.lastErrorCode = "0";
|
|
637
|
+
}
|
|
638
|
+
};
|
|
639
|
+
BaseAPI.prototype.loadFromFlattenedJSON = function (json, CMIElement) {
|
|
640
|
+
var _this = this;
|
|
641
|
+
if (!CMIElement) {
|
|
642
|
+
CMIElement = "";
|
|
643
|
+
}
|
|
644
|
+
if (!this.isNotInitialized()) {
|
|
645
|
+
console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize.");
|
|
646
|
+
return;
|
|
647
|
+
}
|
|
648
|
+
function testPattern(a, c, a_pattern) {
|
|
649
|
+
var a_match = a.match(a_pattern);
|
|
650
|
+
var c_match;
|
|
651
|
+
if (a_match !== null && (c_match = c.match(a_pattern)) !== null) {
|
|
652
|
+
var a_num = Number(a_match[2]);
|
|
653
|
+
var c_num = Number(c_match[2]);
|
|
654
|
+
if (a_num === c_num) {
|
|
655
|
+
if (a_match[3] === "id") {
|
|
656
|
+
return -1;
|
|
657
|
+
}
|
|
658
|
+
else if (a_match[3] === "type") {
|
|
659
|
+
if (c_match[3] === "id") {
|
|
660
|
+
return 1;
|
|
661
|
+
}
|
|
662
|
+
else {
|
|
663
|
+
return -1;
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
else {
|
|
667
|
+
return 1;
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
return a_num - c_num;
|
|
671
|
+
}
|
|
672
|
+
return null;
|
|
673
|
+
}
|
|
674
|
+
var int_pattern = /^(cmi\.interactions\.)(\d+)\.(.*)$/;
|
|
675
|
+
var obj_pattern = /^(cmi\.objectives\.)(\d+)\.(.*)$/;
|
|
676
|
+
var result = Object.keys(json).map(function (key) {
|
|
677
|
+
return [String(key), json[key]];
|
|
678
|
+
});
|
|
679
|
+
result.sort(function (_a, _c) {
|
|
680
|
+
var a = _a[0], _b = _a[1];
|
|
681
|
+
var c = _c[0], _d = _c[1];
|
|
682
|
+
var test;
|
|
683
|
+
if ((test = testPattern(a, c, int_pattern)) !== null) {
|
|
684
|
+
return test;
|
|
685
|
+
}
|
|
686
|
+
if ((test = testPattern(a, c, obj_pattern)) !== null) {
|
|
687
|
+
return test;
|
|
688
|
+
}
|
|
689
|
+
if (a < c) {
|
|
690
|
+
return -1;
|
|
691
|
+
}
|
|
692
|
+
if (a > c) {
|
|
693
|
+
return 1;
|
|
694
|
+
}
|
|
695
|
+
return 0;
|
|
696
|
+
});
|
|
697
|
+
var obj;
|
|
698
|
+
result.forEach(function (element) {
|
|
699
|
+
obj = {};
|
|
700
|
+
obj[element[0]] = element[1];
|
|
701
|
+
_this.loadFromJSON((0,utilities/* unflatten */.sB)(obj), CMIElement);
|
|
702
|
+
});
|
|
703
|
+
};
|
|
704
|
+
BaseAPI.prototype.loadFromJSON = function (json, CMIElement) {
|
|
705
|
+
if (!this.isNotInitialized()) {
|
|
706
|
+
console.error("loadFromJSON can only be called before the call to lmsInitialize.");
|
|
707
|
+
return;
|
|
708
|
+
}
|
|
709
|
+
CMIElement = CMIElement !== undefined ? CMIElement : "cmi";
|
|
710
|
+
this.startingData = json;
|
|
711
|
+
for (var key in json) {
|
|
712
|
+
if ({}.hasOwnProperty.call(json, key) && json[key]) {
|
|
713
|
+
var currentCMIElement = (CMIElement ? CMIElement + "." : "") + key;
|
|
714
|
+
var value = json[key];
|
|
715
|
+
if (value["childArray"]) {
|
|
716
|
+
for (var i = 0; i < value["childArray"].length; i++) {
|
|
717
|
+
this.loadFromJSON(value["childArray"][i], currentCMIElement + "." + i);
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
else if (value.constructor === Object) {
|
|
721
|
+
this.loadFromJSON(value, currentCMIElement);
|
|
722
|
+
}
|
|
723
|
+
else {
|
|
724
|
+
this.setCMIValue(currentCMIElement, value);
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
};
|
|
729
|
+
BaseAPI.prototype.renderCMIToJSONString = function () {
|
|
730
|
+
var cmi = this.cmi;
|
|
731
|
+
if (this.settings.sendFullCommit) {
|
|
732
|
+
return JSON.stringify({ cmi: cmi });
|
|
733
|
+
}
|
|
734
|
+
return JSON.stringify({ cmi: cmi }, function (k, v) { return (v === undefined ? null : v); }, 2);
|
|
735
|
+
};
|
|
736
|
+
BaseAPI.prototype.renderCMIToJSONObject = function () {
|
|
737
|
+
return JSON.parse(this.renderCMIToJSONString());
|
|
738
|
+
};
|
|
739
|
+
BaseAPI.prototype.processHttpRequest = function (url_1, params_1) {
|
|
740
|
+
return (0,tslib_es6/* __awaiter */.sH)(this, arguments, void 0, function (url, params, immediate) {
|
|
741
|
+
var api, genericError, process;
|
|
742
|
+
var _this = this;
|
|
743
|
+
if (immediate === void 0) { immediate = false; }
|
|
744
|
+
return (0,tslib_es6/* __generator */.YH)(this, function (_a) {
|
|
745
|
+
switch (_a.label) {
|
|
746
|
+
case 0:
|
|
747
|
+
api = this;
|
|
748
|
+
genericError = {
|
|
749
|
+
result: api_constants/* default */.A.global.SCORM_FALSE,
|
|
750
|
+
errorCode: this.error_codes.GENERAL,
|
|
751
|
+
};
|
|
752
|
+
if (immediate) {
|
|
753
|
+
this.performFetch(url, params).then(function (response) { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () {
|
|
754
|
+
return (0,tslib_es6/* __generator */.YH)(this, function (_a) {
|
|
755
|
+
switch (_a.label) {
|
|
756
|
+
case 0: return [4, this.transformResponse(response)];
|
|
757
|
+
case 1:
|
|
758
|
+
_a.sent();
|
|
759
|
+
return [2];
|
|
760
|
+
}
|
|
761
|
+
});
|
|
762
|
+
}); });
|
|
763
|
+
return [2, {
|
|
764
|
+
result: api_constants/* default */.A.global.SCORM_TRUE,
|
|
765
|
+
errorCode: 0,
|
|
766
|
+
}];
|
|
767
|
+
}
|
|
768
|
+
process = function (url, params, settings) { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () {
|
|
769
|
+
var response, e_1;
|
|
770
|
+
return (0,tslib_es6/* __generator */.YH)(this, function (_a) {
|
|
771
|
+
switch (_a.label) {
|
|
772
|
+
case 0:
|
|
773
|
+
_a.trys.push([0, 2, , 3]);
|
|
774
|
+
params = settings.requestHandler(params);
|
|
775
|
+
return [4, this.performFetch(url, params)];
|
|
776
|
+
case 1:
|
|
777
|
+
response = _a.sent();
|
|
778
|
+
return [2, this.transformResponse(response)];
|
|
779
|
+
case 2:
|
|
780
|
+
e_1 = _a.sent();
|
|
781
|
+
this.apiLog("processHttpRequest", e_1, api_constants/* default */.A.global.LOG_LEVEL_ERROR);
|
|
782
|
+
api.processListeners("CommitError");
|
|
783
|
+
return [2, genericError];
|
|
784
|
+
case 3: return [2];
|
|
785
|
+
}
|
|
786
|
+
});
|
|
787
|
+
}); };
|
|
788
|
+
return [4, process(url, params, this.settings)];
|
|
789
|
+
case 1: return [2, _a.sent()];
|
|
790
|
+
}
|
|
791
|
+
});
|
|
792
|
+
});
|
|
793
|
+
};
|
|
794
|
+
BaseAPI.prototype.scheduleCommit = function (when, callback) {
|
|
795
|
+
if (!this._timeout) {
|
|
796
|
+
this._timeout = new ScheduledCommit(this, when, callback);
|
|
797
|
+
this.apiLog("scheduleCommit", "scheduled", api_constants/* default */.A.global.LOG_LEVEL_DEBUG, "");
|
|
798
|
+
}
|
|
799
|
+
};
|
|
800
|
+
BaseAPI.prototype.clearScheduledCommit = function () {
|
|
801
|
+
if (this._timeout) {
|
|
802
|
+
this._timeout.cancel();
|
|
803
|
+
this._timeout = undefined;
|
|
804
|
+
this.apiLog("clearScheduledCommit", "cleared", api_constants/* default */.A.global.LOG_LEVEL_DEBUG, "");
|
|
805
|
+
}
|
|
806
|
+
};
|
|
807
|
+
BaseAPI.prototype._checkObjectHasProperty = function (refObject, attribute) {
|
|
808
|
+
return (Object.hasOwnProperty.call(refObject, attribute) ||
|
|
809
|
+
Object.getOwnPropertyDescriptor(Object.getPrototypeOf(refObject), attribute) != null ||
|
|
810
|
+
attribute in refObject);
|
|
811
|
+
};
|
|
812
|
+
BaseAPI.prototype.handleValueAccessException = function (e, returnValue) {
|
|
813
|
+
if (e instanceof exceptions/* ValidationError */.yI) {
|
|
814
|
+
this.lastErrorCode = String(e.errorCode);
|
|
815
|
+
returnValue = api_constants/* default */.A.global.SCORM_FALSE;
|
|
816
|
+
}
|
|
817
|
+
else {
|
|
818
|
+
if (e instanceof Error && e.message) {
|
|
819
|
+
console.error(e.message);
|
|
820
|
+
}
|
|
821
|
+
else {
|
|
822
|
+
console.error(e);
|
|
823
|
+
}
|
|
824
|
+
this.throwSCORMError(this._error_codes.GENERAL);
|
|
825
|
+
}
|
|
826
|
+
return returnValue;
|
|
827
|
+
};
|
|
828
|
+
BaseAPI.prototype.getCommitObject = function (terminateCommit) {
|
|
829
|
+
var shouldTerminateCommit = terminateCommit || this.settings.alwaysSendTotalTime;
|
|
830
|
+
var commitObject = this.settings.renderCommonCommitFields
|
|
831
|
+
? this.renderCommitObject(shouldTerminateCommit)
|
|
832
|
+
: this.renderCommitCMI(shouldTerminateCommit);
|
|
833
|
+
if (this.apiLogLevel === api_constants/* default */.A.global.LOG_LEVEL_DEBUG) {
|
|
834
|
+
console.debug("Commit (terminated: " + (terminateCommit ? "yes" : "no") + "): ");
|
|
835
|
+
console.debug(commitObject);
|
|
836
|
+
}
|
|
837
|
+
return commitObject;
|
|
838
|
+
};
|
|
839
|
+
BaseAPI.prototype.performFetch = function (url, params) {
|
|
840
|
+
return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () {
|
|
841
|
+
return (0,tslib_es6/* __generator */.YH)(this, function (_a) {
|
|
842
|
+
return [2, fetch(url, {
|
|
843
|
+
method: "POST",
|
|
844
|
+
mode: this.settings.fetchMode,
|
|
845
|
+
body: params instanceof Array ? params.join("&") : JSON.stringify(params),
|
|
846
|
+
headers: (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, this.settings.xhrHeaders), { "Content-Type": this.settings.commitRequestDataType }),
|
|
847
|
+
credentials: this.settings.xhrWithCredentials ? "include" : undefined,
|
|
848
|
+
keepalive: true,
|
|
849
|
+
})];
|
|
850
|
+
});
|
|
851
|
+
});
|
|
852
|
+
};
|
|
853
|
+
BaseAPI.prototype.transformResponse = function (response) {
|
|
854
|
+
return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () {
|
|
855
|
+
var result, _a;
|
|
856
|
+
return (0,tslib_es6/* __generator */.YH)(this, function (_c) {
|
|
857
|
+
switch (_c.label) {
|
|
858
|
+
case 0:
|
|
859
|
+
if (!(typeof this.settings.responseHandler === "function")) return [3, 2];
|
|
860
|
+
return [4, this.settings.responseHandler(response)];
|
|
861
|
+
case 1:
|
|
862
|
+
_a = _c.sent();
|
|
863
|
+
return [3, 4];
|
|
864
|
+
case 2: return [4, response.json()];
|
|
865
|
+
case 3:
|
|
866
|
+
_a = _c.sent();
|
|
867
|
+
_c.label = 4;
|
|
868
|
+
case 4:
|
|
869
|
+
result = _a;
|
|
870
|
+
if (response.status >= 200 &&
|
|
871
|
+
response.status <= 299 &&
|
|
872
|
+
(result.result === true ||
|
|
873
|
+
result.result === api_constants/* default */.A.global.SCORM_TRUE)) {
|
|
874
|
+
this.processListeners("CommitSuccess");
|
|
875
|
+
}
|
|
876
|
+
else {
|
|
877
|
+
this.processListeners("CommitError");
|
|
878
|
+
}
|
|
879
|
+
return [2, result];
|
|
880
|
+
}
|
|
881
|
+
});
|
|
882
|
+
});
|
|
883
|
+
};
|
|
884
|
+
return BaseAPI;
|
|
885
|
+
}());
|
|
886
|
+
/* harmony default export */ var src_BaseAPI = (BaseAPI);
|
|
887
|
+
|
|
888
|
+
|
|
889
|
+
/***/ }),
|
|
890
|
+
|
|
891
|
+
/***/ 941:
|
|
892
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
893
|
+
|
|
894
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
895
|
+
/* harmony export */ C: function() { return /* binding */ Scorm12Impl; }
|
|
896
|
+
/* harmony export */ });
|
|
897
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(635);
|
|
898
|
+
/* harmony import */ var _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(989);
|
|
899
|
+
/* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(864);
|
|
900
|
+
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(340);
|
|
901
|
+
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797);
|
|
902
|
+
/* harmony import */ var _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(176);
|
|
903
|
+
/* harmony import */ var _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(833);
|
|
904
|
+
/* harmony import */ var _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(331);
|
|
905
|
+
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(417);
|
|
906
|
+
/* harmony import */ var _constants_enums__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(56);
|
|
907
|
+
/* harmony import */ var _BaseAPI__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(429);
|
|
908
|
+
|
|
909
|
+
|
|
910
|
+
|
|
911
|
+
|
|
912
|
+
|
|
913
|
+
|
|
914
|
+
|
|
915
|
+
|
|
916
|
+
|
|
917
|
+
|
|
918
|
+
|
|
919
|
+
|
|
920
|
+
var Scorm12Impl = (function (_super) {
|
|
921
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__extends */ .C6)(Scorm12Impl, _super);
|
|
922
|
+
function Scorm12Impl(settings) {
|
|
923
|
+
var _this = this;
|
|
924
|
+
if (settings) {
|
|
925
|
+
if (settings.mastery_override === undefined) {
|
|
926
|
+
settings.mastery_override = false;
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
_this = _super.call(this, _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12, settings) || this;
|
|
930
|
+
_this.statusSetByModule = false;
|
|
931
|
+
_this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__/* .CMI */ .Y();
|
|
932
|
+
_this.nav = new _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__/* .NAV */ .A();
|
|
933
|
+
_this.LMSInitialize = _this.lmsInitialize;
|
|
934
|
+
_this.LMSFinish = _this.lmsFinish;
|
|
935
|
+
_this.LMSGetValue = _this.lmsGetValue;
|
|
936
|
+
_this.LMSSetValue = _this.lmsSetValue;
|
|
937
|
+
_this.LMSCommit = _this.lmsCommit;
|
|
938
|
+
_this.LMSGetLastError = _this.lmsGetLastError;
|
|
939
|
+
_this.LMSGetErrorString = _this.lmsGetErrorString;
|
|
940
|
+
_this.LMSGetDiagnostic = _this.lmsGetDiagnostic;
|
|
941
|
+
return _this;
|
|
942
|
+
}
|
|
943
|
+
Scorm12Impl.prototype.reset = function (settings) {
|
|
944
|
+
this.commonReset(settings);
|
|
945
|
+
this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__/* .CMI */ .Y();
|
|
946
|
+
this.nav = new _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__/* .NAV */ .A();
|
|
947
|
+
};
|
|
948
|
+
Scorm12Impl.prototype.lmsInitialize = function () {
|
|
949
|
+
this.cmi.initialize();
|
|
950
|
+
if (this.cmi.core.lesson_status) {
|
|
951
|
+
this.statusSetByModule = true;
|
|
952
|
+
}
|
|
953
|
+
else {
|
|
954
|
+
this.cmi.core.lesson_status = "not attempted";
|
|
955
|
+
}
|
|
956
|
+
return this.initialize("LMSInitialize", "LMS was already initialized!", "LMS is already finished!");
|
|
957
|
+
};
|
|
958
|
+
Scorm12Impl.prototype.lmsFinish = function () {
|
|
959
|
+
var _this = this;
|
|
960
|
+
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__awaiter */ .sH)(_this, void 0, void 0, function () {
|
|
961
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__generator */ .YH)(this, function (_a) {
|
|
962
|
+
switch (_a.label) {
|
|
963
|
+
case 0: return [4, this.internalFinish()];
|
|
964
|
+
case 1:
|
|
965
|
+
_a.sent();
|
|
966
|
+
return [2];
|
|
967
|
+
}
|
|
968
|
+
});
|
|
969
|
+
}); })();
|
|
970
|
+
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.global.SCORM_TRUE;
|
|
971
|
+
};
|
|
972
|
+
Scorm12Impl.prototype.internalFinish = function () {
|
|
973
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__awaiter */ .sH)(this, void 0, void 0, function () {
|
|
974
|
+
var result;
|
|
975
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__generator */ .YH)(this, function (_a) {
|
|
976
|
+
switch (_a.label) {
|
|
977
|
+
case 0: return [4, this.terminate("LMSFinish", true)];
|
|
978
|
+
case 1:
|
|
979
|
+
result = _a.sent();
|
|
980
|
+
if (result === _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.global.SCORM_TRUE) {
|
|
981
|
+
if (this.nav.event !== "") {
|
|
982
|
+
if (this.nav.event === "continue") {
|
|
983
|
+
this.processListeners("SequenceNext");
|
|
984
|
+
}
|
|
985
|
+
else {
|
|
986
|
+
this.processListeners("SequencePrevious");
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
else if (this.settings.autoProgress) {
|
|
990
|
+
this.processListeners("SequenceNext");
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
return [2, result];
|
|
994
|
+
}
|
|
995
|
+
});
|
|
996
|
+
});
|
|
997
|
+
};
|
|
998
|
+
Scorm12Impl.prototype.lmsGetValue = function (CMIElement) {
|
|
999
|
+
return this.getValue("LMSGetValue", false, CMIElement);
|
|
1000
|
+
};
|
|
1001
|
+
Scorm12Impl.prototype.lmsSetValue = function (CMIElement, value) {
|
|
1002
|
+
if (CMIElement === "cmi.core.lesson_status") {
|
|
1003
|
+
this.statusSetByModule = true;
|
|
1004
|
+
}
|
|
1005
|
+
return this.setValue("LMSSetValue", "LMSCommit", false, CMIElement, value);
|
|
1006
|
+
};
|
|
1007
|
+
Scorm12Impl.prototype.lmsCommit = function () {
|
|
1008
|
+
var _this = this;
|
|
1009
|
+
if (this.settings.asyncCommit) {
|
|
1010
|
+
this.scheduleCommit(500, "LMSCommit");
|
|
1011
|
+
}
|
|
1012
|
+
else {
|
|
1013
|
+
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__awaiter */ .sH)(_this, void 0, void 0, function () {
|
|
1014
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__generator */ .YH)(this, function (_a) {
|
|
1015
|
+
switch (_a.label) {
|
|
1016
|
+
case 0: return [4, this.commit("LMSCommit", false)];
|
|
1017
|
+
case 1:
|
|
1018
|
+
_a.sent();
|
|
1019
|
+
return [2];
|
|
1020
|
+
}
|
|
1021
|
+
});
|
|
1022
|
+
}); })();
|
|
1023
|
+
}
|
|
1024
|
+
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.global.SCORM_TRUE;
|
|
1025
|
+
};
|
|
1026
|
+
Scorm12Impl.prototype.lmsGetLastError = function () {
|
|
1027
|
+
return this.getLastError("LMSGetLastError");
|
|
1028
|
+
};
|
|
1029
|
+
Scorm12Impl.prototype.lmsGetErrorString = function (CMIErrorCode) {
|
|
1030
|
+
return this.getErrorString("LMSGetErrorString", CMIErrorCode);
|
|
1031
|
+
};
|
|
1032
|
+
Scorm12Impl.prototype.lmsGetDiagnostic = function (CMIErrorCode) {
|
|
1033
|
+
return this.getDiagnostic("LMSGetDiagnostic", CMIErrorCode);
|
|
1034
|
+
};
|
|
1035
|
+
Scorm12Impl.prototype.setCMIValue = function (CMIElement, value) {
|
|
1036
|
+
return this._commonSetCMIValue("LMSSetValue", false, CMIElement, value);
|
|
1037
|
+
};
|
|
1038
|
+
Scorm12Impl.prototype.getCMIValue = function (CMIElement) {
|
|
1039
|
+
return this._commonGetCMIValue("getCMIValue", false, CMIElement);
|
|
1040
|
+
};
|
|
1041
|
+
Scorm12Impl.prototype.getChildElement = function (CMIElement, _value, foundFirstIndex) {
|
|
1042
|
+
if ((0,_utilities__WEBPACK_IMPORTED_MODULE_1__/* .stringMatches */ .J6)(CMIElement, "cmi\\.objectives\\.\\d+")) {
|
|
1043
|
+
return new _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__/* .CMIObjectivesObject */ .N();
|
|
1044
|
+
}
|
|
1045
|
+
else if (foundFirstIndex &&
|
|
1046
|
+
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__/* .stringMatches */ .J6)(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) {
|
|
1047
|
+
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__/* .CMIInteractionsCorrectResponsesObject */ .cb();
|
|
1048
|
+
}
|
|
1049
|
+
else if (foundFirstIndex &&
|
|
1050
|
+
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__/* .stringMatches */ .J6)(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) {
|
|
1051
|
+
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__/* .CMIInteractionsObjectivesObject */ .Oh();
|
|
1052
|
+
}
|
|
1053
|
+
else if (!foundFirstIndex &&
|
|
1054
|
+
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__/* .stringMatches */ .J6)(CMIElement, "cmi\\.interactions\\.\\d+")) {
|
|
1055
|
+
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__/* .CMIInteractionsObject */ .WP();
|
|
1056
|
+
}
|
|
1057
|
+
return null;
|
|
1058
|
+
};
|
|
1059
|
+
Scorm12Impl.prototype.validateCorrectResponse = function (_CMIElement, _value) {
|
|
1060
|
+
};
|
|
1061
|
+
Scorm12Impl.prototype.getLmsErrorMessageDetails = function (errorNumber, detail) {
|
|
1062
|
+
var basicMessage = "No Error";
|
|
1063
|
+
var detailMessage = "No Error";
|
|
1064
|
+
errorNumber = String(errorNumber);
|
|
1065
|
+
if (_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.error_descriptions[errorNumber]) {
|
|
1066
|
+
basicMessage =
|
|
1067
|
+
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.error_descriptions[errorNumber].basicMessage;
|
|
1068
|
+
detailMessage =
|
|
1069
|
+
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.error_descriptions[errorNumber].detailMessage;
|
|
1070
|
+
}
|
|
1071
|
+
return detail ? detailMessage : basicMessage;
|
|
1072
|
+
};
|
|
1073
|
+
Scorm12Impl.prototype.replaceWithAnotherScormAPI = function (newAPI) {
|
|
1074
|
+
this.cmi = newAPI.cmi;
|
|
1075
|
+
};
|
|
1076
|
+
Scorm12Impl.prototype.renderCommitCMI = function (terminateCommit) {
|
|
1077
|
+
var cmiExport = this.renderCMIToJSONObject();
|
|
1078
|
+
if (terminateCommit) {
|
|
1079
|
+
cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();
|
|
1080
|
+
}
|
|
1081
|
+
var result = [];
|
|
1082
|
+
var flattened = _utilities__WEBPACK_IMPORTED_MODULE_1__/* .flatten */ .Bq(cmiExport);
|
|
1083
|
+
switch (this.settings.dataCommitFormat) {
|
|
1084
|
+
case "flattened":
|
|
1085
|
+
return _utilities__WEBPACK_IMPORTED_MODULE_1__/* .flatten */ .Bq(cmiExport);
|
|
1086
|
+
case "params":
|
|
1087
|
+
for (var item in flattened) {
|
|
1088
|
+
if ({}.hasOwnProperty.call(flattened, item)) {
|
|
1089
|
+
result.push("".concat(item, "=").concat(flattened[item]));
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
return result;
|
|
1093
|
+
case "json":
|
|
1094
|
+
default:
|
|
1095
|
+
return cmiExport;
|
|
1096
|
+
}
|
|
1097
|
+
};
|
|
1098
|
+
Scorm12Impl.prototype.renderCommitObject = function (terminateCommit) {
|
|
1099
|
+
var cmiExport = this.renderCommitCMI(terminateCommit);
|
|
1100
|
+
var totalTimeHHMMSS = this.cmi.getCurrentTotalTime();
|
|
1101
|
+
var totalTimeSeconds = _utilities__WEBPACK_IMPORTED_MODULE_1__/* .getTimeAsSeconds */ .f4(totalTimeHHMMSS, _constants_regex__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A.scorm12.CMITimespan);
|
|
1102
|
+
var lessonStatus = this.cmi.core.lesson_status;
|
|
1103
|
+
var completionStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_8__/* .CompletionStatus */ .lC.unknown;
|
|
1104
|
+
var successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_8__/* .SuccessStatus */ .YE.unknown;
|
|
1105
|
+
if (lessonStatus) {
|
|
1106
|
+
completionStatus =
|
|
1107
|
+
lessonStatus === "completed" || lessonStatus === "passed"
|
|
1108
|
+
? _constants_enums__WEBPACK_IMPORTED_MODULE_8__/* .CompletionStatus */ .lC.completed
|
|
1109
|
+
: _constants_enums__WEBPACK_IMPORTED_MODULE_8__/* .CompletionStatus */ .lC.incomplete;
|
|
1110
|
+
if (lessonStatus === "passed") {
|
|
1111
|
+
successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_8__/* .SuccessStatus */ .YE.passed;
|
|
1112
|
+
}
|
|
1113
|
+
else if (lessonStatus === "failed") {
|
|
1114
|
+
successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_8__/* .SuccessStatus */ .YE.failed;
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
var score = this.cmi.core.score;
|
|
1118
|
+
var scoreObject = null;
|
|
1119
|
+
if (score) {
|
|
1120
|
+
scoreObject = {};
|
|
1121
|
+
if (!Number.isNaN(Number.parseFloat(score.raw))) {
|
|
1122
|
+
scoreObject.raw = Number.parseFloat(score.raw);
|
|
1123
|
+
}
|
|
1124
|
+
if (!Number.isNaN(Number.parseFloat(score.min))) {
|
|
1125
|
+
scoreObject.min = Number.parseFloat(score.min);
|
|
1126
|
+
}
|
|
1127
|
+
if (!Number.isNaN(Number.parseFloat(score.max))) {
|
|
1128
|
+
scoreObject.max = Number.parseFloat(score.max);
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
var commitObject = {
|
|
1132
|
+
successStatus: successStatus,
|
|
1133
|
+
completionStatus: completionStatus,
|
|
1134
|
+
runtimeData: cmiExport,
|
|
1135
|
+
totalTimeSeconds: totalTimeSeconds,
|
|
1136
|
+
};
|
|
1137
|
+
if (scoreObject) {
|
|
1138
|
+
commitObject.score = scoreObject;
|
|
1139
|
+
}
|
|
1140
|
+
return commitObject;
|
|
1141
|
+
};
|
|
1142
|
+
Scorm12Impl.prototype.storeData = function (terminateCommit) {
|
|
1143
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__awaiter */ .sH)(this, void 0, void 0, function () {
|
|
1144
|
+
var originalStatus, commitObject;
|
|
1145
|
+
var _a, _b, _c;
|
|
1146
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__generator */ .YH)(this, function (_d) {
|
|
1147
|
+
switch (_d.label) {
|
|
1148
|
+
case 0:
|
|
1149
|
+
if (terminateCommit) {
|
|
1150
|
+
originalStatus = this.cmi.core.lesson_status;
|
|
1151
|
+
if (!this.cmi.core.lesson_status ||
|
|
1152
|
+
(!this.statusSetByModule &&
|
|
1153
|
+
this.cmi.core.lesson_status === "not attempted")) {
|
|
1154
|
+
this.cmi.core.lesson_status = "completed";
|
|
1155
|
+
}
|
|
1156
|
+
if (this.cmi.core.lesson_mode === "normal") {
|
|
1157
|
+
if (this.cmi.core.credit === "credit") {
|
|
1158
|
+
if (this.settings.mastery_override &&
|
|
1159
|
+
this.cmi.student_data.mastery_score !== "" &&
|
|
1160
|
+
this.cmi.core.score.raw !== "") {
|
|
1161
|
+
this.cmi.core.lesson_status =
|
|
1162
|
+
parseFloat(this.cmi.core.score.raw) >=
|
|
1163
|
+
parseFloat(this.cmi.student_data.mastery_score)
|
|
1164
|
+
? "passed"
|
|
1165
|
+
: "failed";
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
else if (this.cmi.core.lesson_mode === "browse") {
|
|
1170
|
+
if ((((_c = (_b = (_a = this.startingData) === null || _a === void 0 ? void 0 : _a.cmi) === null || _b === void 0 ? void 0 : _b.core) === null || _c === void 0 ? void 0 : _c.lesson_status) || "") === "" &&
|
|
1171
|
+
originalStatus === "not attempted") {
|
|
1172
|
+
this.cmi.core.lesson_status = "browsed";
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
commitObject = this.getCommitObject(terminateCommit);
|
|
1177
|
+
if (!(typeof this.settings.lmsCommitUrl === "string")) return [3, 2];
|
|
1178
|
+
return [4, this.processHttpRequest(this.settings.lmsCommitUrl, commitObject, terminateCommit)];
|
|
1179
|
+
case 1: return [2, _d.sent()];
|
|
1180
|
+
case 2: return [2, {
|
|
1181
|
+
result: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.global.SCORM_TRUE,
|
|
1182
|
+
errorCode: 0,
|
|
1183
|
+
}];
|
|
1184
|
+
}
|
|
1185
|
+
});
|
|
1186
|
+
});
|
|
1187
|
+
};
|
|
1188
|
+
return Scorm12Impl;
|
|
1189
|
+
}(_BaseAPI__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A));
|
|
1190
|
+
|
|
1191
|
+
|
|
1192
|
+
|
|
1193
|
+
/***/ }),
|
|
1194
|
+
|
|
1195
|
+
/***/ 589:
|
|
1196
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1197
|
+
|
|
1198
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1199
|
+
/* harmony export */ B: function() { return /* binding */ CMIArray; }
|
|
1200
|
+
/* harmony export */ });
|
|
1201
|
+
/* unused harmony export scorm12_error_codes */
|
|
1202
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635);
|
|
1203
|
+
/* harmony import */ var _base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
1204
|
+
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(797);
|
|
1205
|
+
/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(784);
|
|
1206
|
+
|
|
1207
|
+
|
|
1208
|
+
|
|
1209
|
+
|
|
1210
|
+
var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12;
|
|
1211
|
+
var CMIArray = (function (_super) {
|
|
1212
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__extends */ .C6)(CMIArray, _super);
|
|
1213
|
+
function CMIArray(params) {
|
|
1214
|
+
var _this = _super.call(this) || this;
|
|
1215
|
+
_this.__children = params.children;
|
|
1216
|
+
_this._errorCode = params.errorCode || scorm12_error_codes.GENERAL;
|
|
1217
|
+
_this._errorClass = params.errorClass || _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .BaseScormValidationError */ .$h;
|
|
1218
|
+
_this.childArray = [];
|
|
1219
|
+
return _this;
|
|
1220
|
+
}
|
|
1221
|
+
Object.defineProperty(CMIArray.prototype, "_children", {
|
|
1222
|
+
get: function () {
|
|
1223
|
+
return this.__children;
|
|
1224
|
+
},
|
|
1225
|
+
set: function (_children) {
|
|
1226
|
+
throw new this._errorClass(this._errorCode);
|
|
1227
|
+
},
|
|
1228
|
+
enumerable: false,
|
|
1229
|
+
configurable: true
|
|
1230
|
+
});
|
|
1231
|
+
Object.defineProperty(CMIArray.prototype, "_count", {
|
|
1232
|
+
get: function () {
|
|
1233
|
+
return this.childArray.length;
|
|
1234
|
+
},
|
|
1235
|
+
set: function (_count) {
|
|
1236
|
+
throw new this._errorClass(this._errorCode);
|
|
1237
|
+
},
|
|
1238
|
+
enumerable: false,
|
|
1239
|
+
configurable: true
|
|
1240
|
+
});
|
|
1241
|
+
CMIArray.prototype.toJSON = function () {
|
|
1242
|
+
this.jsonString = true;
|
|
1243
|
+
var result = {};
|
|
1244
|
+
for (var i = 0; i < this.childArray.length; i++) {
|
|
1245
|
+
result[i + ""] = this.childArray[i];
|
|
1246
|
+
}
|
|
1247
|
+
delete this.jsonString;
|
|
1248
|
+
return result;
|
|
1249
|
+
};
|
|
1250
|
+
return CMIArray;
|
|
1251
|
+
}(_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J));
|
|
1252
|
+
|
|
1253
|
+
|
|
1254
|
+
|
|
1255
|
+
/***/ }),
|
|
1256
|
+
|
|
1257
|
+
/***/ 319:
|
|
1258
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1259
|
+
|
|
1260
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1261
|
+
/* harmony export */ J: function() { return /* binding */ BaseCMI; },
|
|
1262
|
+
/* harmony export */ r: function() { return /* binding */ BaseRootCMI; }
|
|
1263
|
+
/* harmony export */ });
|
|
1264
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
1265
|
+
|
|
1266
|
+
var BaseCMI = (function () {
|
|
1267
|
+
function BaseCMI() {
|
|
1268
|
+
this.jsonString = false;
|
|
1269
|
+
this._initialized = false;
|
|
1270
|
+
}
|
|
1271
|
+
Object.defineProperty(BaseCMI.prototype, "initialized", {
|
|
1272
|
+
get: function () {
|
|
1273
|
+
return this._initialized;
|
|
1274
|
+
},
|
|
1275
|
+
enumerable: false,
|
|
1276
|
+
configurable: true
|
|
1277
|
+
});
|
|
1278
|
+
Object.defineProperty(BaseCMI.prototype, "start_time", {
|
|
1279
|
+
get: function () {
|
|
1280
|
+
return this._start_time;
|
|
1281
|
+
},
|
|
1282
|
+
enumerable: false,
|
|
1283
|
+
configurable: true
|
|
1284
|
+
});
|
|
1285
|
+
BaseCMI.prototype.initialize = function () {
|
|
1286
|
+
this._initialized = true;
|
|
1287
|
+
};
|
|
1288
|
+
BaseCMI.prototype.setStartTime = function () {
|
|
1289
|
+
this._start_time = new Date().getTime();
|
|
1290
|
+
};
|
|
1291
|
+
return BaseCMI;
|
|
1292
|
+
}());
|
|
1293
|
+
|
|
1294
|
+
var BaseRootCMI = (function (_super) {
|
|
1295
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__extends */ .C6)(BaseRootCMI, _super);
|
|
1296
|
+
function BaseRootCMI() {
|
|
1297
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1298
|
+
}
|
|
1299
|
+
return BaseRootCMI;
|
|
1300
|
+
}(BaseCMI));
|
|
1301
|
+
|
|
1302
|
+
|
|
1303
|
+
|
|
1304
|
+
/***/ }),
|
|
1305
|
+
|
|
1306
|
+
/***/ 434:
|
|
1307
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1308
|
+
|
|
1309
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1310
|
+
/* harmony export */ _: function() { return /* binding */ CMIScore; }
|
|
1311
|
+
/* harmony export */ });
|
|
1312
|
+
/* unused harmony export scorm12_error_codes */
|
|
1313
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635);
|
|
1314
|
+
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340);
|
|
1315
|
+
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(417);
|
|
1316
|
+
/* harmony import */ var _base_cmi__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(319);
|
|
1317
|
+
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(449);
|
|
1318
|
+
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797);
|
|
1319
|
+
|
|
1320
|
+
|
|
1321
|
+
|
|
1322
|
+
|
|
1323
|
+
|
|
1324
|
+
|
|
1325
|
+
var scorm12_constants = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12;
|
|
1326
|
+
var scorm12_regex = _constants_regex__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12;
|
|
1327
|
+
var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12;
|
|
1328
|
+
var CMIScore = (function (_super) {
|
|
1329
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__extends */ .C6)(CMIScore, _super);
|
|
1330
|
+
function CMIScore(params) {
|
|
1331
|
+
var _this = _super.call(this) || this;
|
|
1332
|
+
_this._raw = "";
|
|
1333
|
+
_this._min = "";
|
|
1334
|
+
_this.__children = params.score_children || scorm12_constants.score_children;
|
|
1335
|
+
_this.__score_range = !params.score_range
|
|
1336
|
+
? false
|
|
1337
|
+
: scorm12_regex.score_range;
|
|
1338
|
+
_this._max = params.max || params.max === "" ? params.max : "100";
|
|
1339
|
+
_this.__invalid_error_code =
|
|
1340
|
+
params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE;
|
|
1341
|
+
_this.__invalid_type_code =
|
|
1342
|
+
params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH;
|
|
1343
|
+
_this.__invalid_range_code =
|
|
1344
|
+
params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE;
|
|
1345
|
+
_this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;
|
|
1346
|
+
_this.__error_class = params.errorClass;
|
|
1347
|
+
return _this;
|
|
1348
|
+
}
|
|
1349
|
+
Object.defineProperty(CMIScore.prototype, "_children", {
|
|
1350
|
+
get: function () {
|
|
1351
|
+
return this.__children;
|
|
1352
|
+
},
|
|
1353
|
+
set: function (_children) {
|
|
1354
|
+
throw new this.__error_class(this.__invalid_error_code);
|
|
1355
|
+
},
|
|
1356
|
+
enumerable: false,
|
|
1357
|
+
configurable: true
|
|
1358
|
+
});
|
|
1359
|
+
Object.defineProperty(CMIScore.prototype, "raw", {
|
|
1360
|
+
get: function () {
|
|
1361
|
+
return this._raw;
|
|
1362
|
+
},
|
|
1363
|
+
set: function (raw) {
|
|
1364
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidFormat */ .q)(raw, this.__decimal_regex, this.__invalid_type_code, this.__error_class) &&
|
|
1365
|
+
(!this.__score_range ||
|
|
1366
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidRange */ .W)(raw, this.__score_range, this.__invalid_range_code, this.__error_class))) {
|
|
1367
|
+
this._raw = raw;
|
|
1368
|
+
}
|
|
1369
|
+
},
|
|
1370
|
+
enumerable: false,
|
|
1371
|
+
configurable: true
|
|
1372
|
+
});
|
|
1373
|
+
Object.defineProperty(CMIScore.prototype, "min", {
|
|
1374
|
+
get: function () {
|
|
1375
|
+
return this._min;
|
|
1376
|
+
},
|
|
1377
|
+
set: function (min) {
|
|
1378
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidFormat */ .q)(min, this.__decimal_regex, this.__invalid_type_code, this.__error_class) &&
|
|
1379
|
+
(!this.__score_range ||
|
|
1380
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidRange */ .W)(min, this.__score_range, this.__invalid_range_code, this.__error_class))) {
|
|
1381
|
+
this._min = min;
|
|
1382
|
+
}
|
|
1383
|
+
},
|
|
1384
|
+
enumerable: false,
|
|
1385
|
+
configurable: true
|
|
1386
|
+
});
|
|
1387
|
+
Object.defineProperty(CMIScore.prototype, "max", {
|
|
1388
|
+
get: function () {
|
|
1389
|
+
return this._max;
|
|
1390
|
+
},
|
|
1391
|
+
set: function (max) {
|
|
1392
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidFormat */ .q)(max, this.__decimal_regex, this.__invalid_type_code, this.__error_class) &&
|
|
1393
|
+
(!this.__score_range ||
|
|
1394
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidRange */ .W)(max, this.__score_range, this.__invalid_range_code, this.__error_class))) {
|
|
1395
|
+
this._max = max;
|
|
1396
|
+
}
|
|
1397
|
+
},
|
|
1398
|
+
enumerable: false,
|
|
1399
|
+
configurable: true
|
|
1400
|
+
});
|
|
1401
|
+
CMIScore.prototype.toJSON = function () {
|
|
1402
|
+
this.jsonString = true;
|
|
1403
|
+
var result = {
|
|
1404
|
+
raw: this.raw,
|
|
1405
|
+
min: this.min,
|
|
1406
|
+
max: this.max,
|
|
1407
|
+
};
|
|
1408
|
+
delete this.jsonString;
|
|
1409
|
+
return result;
|
|
1410
|
+
};
|
|
1411
|
+
return CMIScore;
|
|
1412
|
+
}(_base_cmi__WEBPACK_IMPORTED_MODULE_2__/* .BaseCMI */ .J));
|
|
1413
|
+
|
|
1414
|
+
|
|
1415
|
+
|
|
1416
|
+
/***/ }),
|
|
1417
|
+
|
|
1418
|
+
/***/ 449:
|
|
1419
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1420
|
+
|
|
1421
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1422
|
+
/* harmony export */ W: function() { return /* binding */ checkValidRange; },
|
|
1423
|
+
/* harmony export */ q: function() { return /* binding */ checkValidFormat; }
|
|
1424
|
+
/* harmony export */ });
|
|
1425
|
+
function checkValidFormat(value, regexPattern, errorCode, errorClass, allowEmptyString) {
|
|
1426
|
+
if (typeof value !== "string") {
|
|
1427
|
+
return false;
|
|
1428
|
+
}
|
|
1429
|
+
var formatRegex = new RegExp(regexPattern);
|
|
1430
|
+
var matches = value.match(formatRegex);
|
|
1431
|
+
if (allowEmptyString && value === "") {
|
|
1432
|
+
return true;
|
|
1433
|
+
}
|
|
1434
|
+
if (value === undefined || !matches || matches[0] === "") {
|
|
1435
|
+
throw new errorClass(errorCode);
|
|
1436
|
+
}
|
|
1437
|
+
return true;
|
|
1438
|
+
}
|
|
1439
|
+
function checkValidRange(value, rangePattern, errorCode, errorClass) {
|
|
1440
|
+
var ranges = rangePattern.split("#");
|
|
1441
|
+
value = value * 1.0;
|
|
1442
|
+
if (value >= ranges[0]) {
|
|
1443
|
+
if (ranges[1] === "*" || value <= ranges[1]) {
|
|
1444
|
+
return true;
|
|
1445
|
+
}
|
|
1446
|
+
else {
|
|
1447
|
+
throw new errorClass(errorCode);
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
else {
|
|
1451
|
+
throw new errorClass(errorCode);
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
|
|
1456
|
+
/***/ }),
|
|
1457
|
+
|
|
1458
|
+
/***/ 989:
|
|
1459
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1460
|
+
|
|
1461
|
+
|
|
1462
|
+
// EXPORTS
|
|
1463
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
1464
|
+
Y: function() { return /* binding */ CMI; }
|
|
1465
|
+
});
|
|
1466
|
+
|
|
1467
|
+
// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs
|
|
1468
|
+
var tslib_es6 = __webpack_require__(635);
|
|
1469
|
+
// EXTERNAL MODULE: ./src/constants/api_constants.ts
|
|
1470
|
+
var api_constants = __webpack_require__(340);
|
|
1471
|
+
// EXTERNAL MODULE: ./src/constants/error_codes.ts
|
|
1472
|
+
var error_codes = __webpack_require__(797);
|
|
1473
|
+
// EXTERNAL MODULE: ./src/constants/regex.ts
|
|
1474
|
+
var regex = __webpack_require__(417);
|
|
1475
|
+
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
1476
|
+
var exceptions = __webpack_require__(784);
|
|
1477
|
+
// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts
|
|
1478
|
+
var base_cmi = __webpack_require__(319);
|
|
1479
|
+
// EXTERNAL MODULE: ./src/cmi/scorm12/validation.ts
|
|
1480
|
+
var validation = __webpack_require__(915);
|
|
1481
|
+
// EXTERNAL MODULE: ./src/cmi/common/score.ts
|
|
1482
|
+
var score = __webpack_require__(434);
|
|
1483
|
+
// EXTERNAL MODULE: ./src/utilities.ts
|
|
1484
|
+
var utilities = __webpack_require__(864);
|
|
1485
|
+
;// ./src/cmi/aicc/core.ts
|
|
1486
|
+
|
|
1487
|
+
|
|
1488
|
+
|
|
1489
|
+
|
|
1490
|
+
|
|
1491
|
+
|
|
1492
|
+
|
|
1493
|
+
|
|
1494
|
+
|
|
1495
|
+
var CMICore = (function (_super) {
|
|
1496
|
+
(0,tslib_es6/* __extends */.C6)(CMICore, _super);
|
|
1497
|
+
function CMICore() {
|
|
1498
|
+
var _this = _super.call(this) || this;
|
|
1499
|
+
_this.__children = api_constants/* default */.A.scorm12.core_children;
|
|
1500
|
+
_this._student_id = "";
|
|
1501
|
+
_this._student_name = "";
|
|
1502
|
+
_this._lesson_location = "";
|
|
1503
|
+
_this._credit = "";
|
|
1504
|
+
_this._lesson_status = "not attempted";
|
|
1505
|
+
_this._entry = "";
|
|
1506
|
+
_this._total_time = "";
|
|
1507
|
+
_this._lesson_mode = "normal";
|
|
1508
|
+
_this._exit = "";
|
|
1509
|
+
_this._session_time = "00:00:00";
|
|
1510
|
+
_this._suspend_data = "";
|
|
1511
|
+
_this.score = new score/* CMIScore */._({
|
|
1512
|
+
score_children: api_constants/* default */.A.scorm12.score_children,
|
|
1513
|
+
score_range: regex/* default */.A.scorm12.score_range,
|
|
1514
|
+
invalidErrorCode: error_codes/* default */.A.scorm12.INVALID_SET_VALUE,
|
|
1515
|
+
invalidTypeCode: error_codes/* default */.A.scorm12.TYPE_MISMATCH,
|
|
1516
|
+
invalidRangeCode: error_codes/* default */.A.scorm12.VALUE_OUT_OF_RANGE,
|
|
1517
|
+
errorClass: exceptions/* Scorm12ValidationError */.tQ,
|
|
1518
|
+
});
|
|
1519
|
+
return _this;
|
|
1520
|
+
}
|
|
1521
|
+
CMICore.prototype.initialize = function () {
|
|
1522
|
+
var _a;
|
|
1523
|
+
_super.prototype.initialize.call(this);
|
|
1524
|
+
(_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
1525
|
+
};
|
|
1526
|
+
Object.defineProperty(CMICore.prototype, "_children", {
|
|
1527
|
+
get: function () {
|
|
1528
|
+
return this.__children;
|
|
1529
|
+
},
|
|
1530
|
+
set: function (_children) {
|
|
1531
|
+
throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.INVALID_SET_VALUE);
|
|
1532
|
+
},
|
|
1533
|
+
enumerable: false,
|
|
1534
|
+
configurable: true
|
|
1535
|
+
});
|
|
1536
|
+
Object.defineProperty(CMICore.prototype, "student_id", {
|
|
1537
|
+
get: function () {
|
|
1538
|
+
return this._student_id;
|
|
1539
|
+
},
|
|
1540
|
+
set: function (student_id) {
|
|
1541
|
+
if (this.initialized) {
|
|
1542
|
+
throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT);
|
|
1543
|
+
}
|
|
1544
|
+
else {
|
|
1545
|
+
this._student_id = student_id;
|
|
1546
|
+
}
|
|
1547
|
+
},
|
|
1548
|
+
enumerable: false,
|
|
1549
|
+
configurable: true
|
|
1550
|
+
});
|
|
1551
|
+
Object.defineProperty(CMICore.prototype, "student_name", {
|
|
1552
|
+
get: function () {
|
|
1553
|
+
return this._student_name;
|
|
1554
|
+
},
|
|
1555
|
+
set: function (student_name) {
|
|
1556
|
+
if (this.initialized) {
|
|
1557
|
+
throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT);
|
|
1558
|
+
}
|
|
1559
|
+
else {
|
|
1560
|
+
this._student_name = student_name;
|
|
1561
|
+
}
|
|
1562
|
+
},
|
|
1563
|
+
enumerable: false,
|
|
1564
|
+
configurable: true
|
|
1565
|
+
});
|
|
1566
|
+
Object.defineProperty(CMICore.prototype, "lesson_location", {
|
|
1567
|
+
get: function () {
|
|
1568
|
+
return this._lesson_location;
|
|
1569
|
+
},
|
|
1570
|
+
set: function (lesson_location) {
|
|
1571
|
+
if ((0,validation/* check12ValidFormat */.p)(lesson_location, regex/* default */.A.scorm12.CMIString256, true)) {
|
|
1572
|
+
this._lesson_location = lesson_location;
|
|
1573
|
+
}
|
|
1574
|
+
},
|
|
1575
|
+
enumerable: false,
|
|
1576
|
+
configurable: true
|
|
1577
|
+
});
|
|
1578
|
+
Object.defineProperty(CMICore.prototype, "credit", {
|
|
1579
|
+
get: function () {
|
|
1580
|
+
return this._credit;
|
|
1581
|
+
},
|
|
1582
|
+
set: function (credit) {
|
|
1583
|
+
if (this.initialized) {
|
|
1584
|
+
throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT);
|
|
1585
|
+
}
|
|
1586
|
+
else {
|
|
1587
|
+
this._credit = credit;
|
|
1588
|
+
}
|
|
1589
|
+
},
|
|
1590
|
+
enumerable: false,
|
|
1591
|
+
configurable: true
|
|
1592
|
+
});
|
|
1593
|
+
Object.defineProperty(CMICore.prototype, "lesson_status", {
|
|
1594
|
+
get: function () {
|
|
1595
|
+
return this._lesson_status;
|
|
1596
|
+
},
|
|
1597
|
+
set: function (lesson_status) {
|
|
1598
|
+
if (this.initialized) {
|
|
1599
|
+
if ((0,validation/* check12ValidFormat */.p)(lesson_status, regex/* default */.A.scorm12.CMIStatus)) {
|
|
1600
|
+
this._lesson_status = lesson_status;
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
else {
|
|
1604
|
+
if ((0,validation/* check12ValidFormat */.p)(lesson_status, regex/* default */.A.scorm12.CMIStatus2)) {
|
|
1605
|
+
this._lesson_status = lesson_status;
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
},
|
|
1609
|
+
enumerable: false,
|
|
1610
|
+
configurable: true
|
|
1611
|
+
});
|
|
1612
|
+
Object.defineProperty(CMICore.prototype, "entry", {
|
|
1613
|
+
get: function () {
|
|
1614
|
+
return this._entry;
|
|
1615
|
+
},
|
|
1616
|
+
set: function (entry) {
|
|
1617
|
+
if (this.initialized) {
|
|
1618
|
+
throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT);
|
|
1619
|
+
}
|
|
1620
|
+
else {
|
|
1621
|
+
this._entry = entry;
|
|
1622
|
+
}
|
|
1623
|
+
},
|
|
1624
|
+
enumerable: false,
|
|
1625
|
+
configurable: true
|
|
1626
|
+
});
|
|
1627
|
+
Object.defineProperty(CMICore.prototype, "total_time", {
|
|
1628
|
+
get: function () {
|
|
1629
|
+
return this._total_time;
|
|
1630
|
+
},
|
|
1631
|
+
set: function (total_time) {
|
|
1632
|
+
if (this.initialized) {
|
|
1633
|
+
throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT);
|
|
1634
|
+
}
|
|
1635
|
+
else {
|
|
1636
|
+
this._total_time = total_time;
|
|
1637
|
+
}
|
|
1638
|
+
},
|
|
1639
|
+
enumerable: false,
|
|
1640
|
+
configurable: true
|
|
1641
|
+
});
|
|
1642
|
+
Object.defineProperty(CMICore.prototype, "lesson_mode", {
|
|
1643
|
+
get: function () {
|
|
1644
|
+
return this._lesson_mode;
|
|
1645
|
+
},
|
|
1646
|
+
set: function (lesson_mode) {
|
|
1647
|
+
if (this.initialized) {
|
|
1648
|
+
throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT);
|
|
1649
|
+
}
|
|
1650
|
+
else {
|
|
1651
|
+
this._lesson_mode = lesson_mode;
|
|
1652
|
+
}
|
|
1653
|
+
},
|
|
1654
|
+
enumerable: false,
|
|
1655
|
+
configurable: true
|
|
1656
|
+
});
|
|
1657
|
+
Object.defineProperty(CMICore.prototype, "exit", {
|
|
1658
|
+
get: function () {
|
|
1659
|
+
if (!this.jsonString) {
|
|
1660
|
+
throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.WRITE_ONLY_ELEMENT);
|
|
1661
|
+
}
|
|
1662
|
+
return this._exit;
|
|
1663
|
+
},
|
|
1664
|
+
set: function (exit) {
|
|
1665
|
+
if ((0,validation/* check12ValidFormat */.p)(exit, regex/* default */.A.scorm12.CMIExit, true)) {
|
|
1666
|
+
this._exit = exit;
|
|
1667
|
+
}
|
|
1668
|
+
},
|
|
1669
|
+
enumerable: false,
|
|
1670
|
+
configurable: true
|
|
1671
|
+
});
|
|
1672
|
+
Object.defineProperty(CMICore.prototype, "session_time", {
|
|
1673
|
+
get: function () {
|
|
1674
|
+
if (!this.jsonString) {
|
|
1675
|
+
throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.WRITE_ONLY_ELEMENT);
|
|
1676
|
+
}
|
|
1677
|
+
return this._session_time;
|
|
1678
|
+
},
|
|
1679
|
+
set: function (session_time) {
|
|
1680
|
+
if ((0,validation/* check12ValidFormat */.p)(session_time, regex/* default */.A.scorm12.CMITimespan)) {
|
|
1681
|
+
this._session_time = session_time;
|
|
1682
|
+
}
|
|
1683
|
+
},
|
|
1684
|
+
enumerable: false,
|
|
1685
|
+
configurable: true
|
|
1686
|
+
});
|
|
1687
|
+
Object.defineProperty(CMICore.prototype, "suspend_data", {
|
|
1688
|
+
get: function () {
|
|
1689
|
+
return this._suspend_data;
|
|
1690
|
+
},
|
|
1691
|
+
set: function (suspend_data) {
|
|
1692
|
+
if ((0,validation/* check12ValidFormat */.p)(suspend_data, regex/* default */.A.scorm12.CMIString4096, true)) {
|
|
1693
|
+
this._suspend_data = suspend_data;
|
|
1694
|
+
}
|
|
1695
|
+
},
|
|
1696
|
+
enumerable: false,
|
|
1697
|
+
configurable: true
|
|
1698
|
+
});
|
|
1699
|
+
CMICore.prototype.getCurrentTotalTime = function (start_time) {
|
|
1700
|
+
var sessionTime = this._session_time;
|
|
1701
|
+
var startTime = start_time;
|
|
1702
|
+
if (typeof startTime !== "undefined" && startTime !== null) {
|
|
1703
|
+
var seconds = new Date().getTime() - startTime;
|
|
1704
|
+
sessionTime = utilities/* getSecondsAsHHMMSS */.UZ(seconds / 1000);
|
|
1705
|
+
}
|
|
1706
|
+
return utilities/* addHHMMSSTimeStrings */.HT(this._total_time, sessionTime, new RegExp(regex/* default */.A.scorm12.CMITimespan));
|
|
1707
|
+
};
|
|
1708
|
+
CMICore.prototype.toJSON = function () {
|
|
1709
|
+
this.jsonString = true;
|
|
1710
|
+
var result = {
|
|
1711
|
+
student_id: this.student_id,
|
|
1712
|
+
student_name: this.student_name,
|
|
1713
|
+
lesson_location: this.lesson_location,
|
|
1714
|
+
credit: this.credit,
|
|
1715
|
+
lesson_status: this.lesson_status,
|
|
1716
|
+
entry: this.entry,
|
|
1717
|
+
lesson_mode: this.lesson_mode,
|
|
1718
|
+
exit: this.exit,
|
|
1719
|
+
session_time: this.session_time,
|
|
1720
|
+
score: this.score,
|
|
1721
|
+
};
|
|
1722
|
+
delete this.jsonString;
|
|
1723
|
+
return result;
|
|
1724
|
+
};
|
|
1725
|
+
return CMICore;
|
|
1726
|
+
}(base_cmi/* BaseCMI */.J));
|
|
1727
|
+
|
|
1728
|
+
|
|
1729
|
+
// EXTERNAL MODULE: ./src/cmi/scorm12/objectives.ts
|
|
1730
|
+
var objectives = __webpack_require__(176);
|
|
1731
|
+
// EXTERNAL MODULE: ./src/cmi/scorm12/student_data.ts
|
|
1732
|
+
var scorm12_student_data = __webpack_require__(532);
|
|
1733
|
+
// EXTERNAL MODULE: ./src/cmi/scorm12/student_preference.ts
|
|
1734
|
+
var student_preference = __webpack_require__(181);
|
|
1735
|
+
// EXTERNAL MODULE: ./src/cmi/scorm12/interactions.ts
|
|
1736
|
+
var interactions = __webpack_require__(833);
|
|
1737
|
+
;// ./src/cmi/scorm12/cmi.ts
|
|
1738
|
+
|
|
1739
|
+
|
|
1740
|
+
|
|
1741
|
+
|
|
1742
|
+
|
|
1743
|
+
|
|
1744
|
+
|
|
1745
|
+
|
|
1746
|
+
|
|
1747
|
+
|
|
1748
|
+
|
|
1749
|
+
|
|
1750
|
+
var CMI = (function (_super) {
|
|
1751
|
+
(0,tslib_es6/* __extends */.C6)(CMI, _super);
|
|
1752
|
+
function CMI(cmi_children, student_data, initialized) {
|
|
1753
|
+
var _this = _super.call(this) || this;
|
|
1754
|
+
_this.__children = "";
|
|
1755
|
+
_this.__version = "3.4";
|
|
1756
|
+
_this._launch_data = "";
|
|
1757
|
+
_this._comments = "";
|
|
1758
|
+
_this._comments_from_lms = "";
|
|
1759
|
+
if (initialized)
|
|
1760
|
+
_this.initialize();
|
|
1761
|
+
_this.__children = cmi_children
|
|
1762
|
+
? cmi_children
|
|
1763
|
+
: api_constants/* default */.A.scorm12.cmi_children;
|
|
1764
|
+
_this.core = new CMICore();
|
|
1765
|
+
_this.objectives = new objectives/* CMIObjectives */.C();
|
|
1766
|
+
_this.student_data = student_data ? student_data : new scorm12_student_data/* CMIStudentData */.X();
|
|
1767
|
+
_this.student_preference = new student_preference/* CMIStudentPreference */.G();
|
|
1768
|
+
_this.interactions = new interactions/* CMIInteractions */.Xb();
|
|
1769
|
+
return _this;
|
|
1770
|
+
}
|
|
1771
|
+
CMI.prototype.initialize = function () {
|
|
1772
|
+
var _a, _b, _c, _d, _e;
|
|
1773
|
+
_super.prototype.initialize.call(this);
|
|
1774
|
+
(_a = this.core) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
1775
|
+
(_b = this.objectives) === null || _b === void 0 ? void 0 : _b.initialize();
|
|
1776
|
+
(_c = this.student_data) === null || _c === void 0 ? void 0 : _c.initialize();
|
|
1777
|
+
(_d = this.student_preference) === null || _d === void 0 ? void 0 : _d.initialize();
|
|
1778
|
+
(_e = this.interactions) === null || _e === void 0 ? void 0 : _e.initialize();
|
|
1779
|
+
};
|
|
1780
|
+
CMI.prototype.toJSON = function () {
|
|
1781
|
+
this.jsonString = true;
|
|
1782
|
+
var result = {
|
|
1783
|
+
suspend_data: this.suspend_data,
|
|
1784
|
+
launch_data: this.launch_data,
|
|
1785
|
+
comments: this.comments,
|
|
1786
|
+
comments_from_lms: this.comments_from_lms,
|
|
1787
|
+
core: this.core,
|
|
1788
|
+
objectives: this.objectives,
|
|
1789
|
+
student_data: this.student_data,
|
|
1790
|
+
student_preference: this.student_preference,
|
|
1791
|
+
interactions: this.interactions,
|
|
1792
|
+
};
|
|
1793
|
+
delete this.jsonString;
|
|
1794
|
+
return result;
|
|
1795
|
+
};
|
|
1796
|
+
Object.defineProperty(CMI.prototype, "_version", {
|
|
1797
|
+
get: function () {
|
|
1798
|
+
return this.__version;
|
|
1799
|
+
},
|
|
1800
|
+
set: function (_version) {
|
|
1801
|
+
throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.INVALID_SET_VALUE);
|
|
1802
|
+
},
|
|
1803
|
+
enumerable: false,
|
|
1804
|
+
configurable: true
|
|
1805
|
+
});
|
|
1806
|
+
Object.defineProperty(CMI.prototype, "_children", {
|
|
1807
|
+
get: function () {
|
|
1808
|
+
return this.__children;
|
|
1809
|
+
},
|
|
1810
|
+
set: function (_children) {
|
|
1811
|
+
throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.INVALID_SET_VALUE);
|
|
1812
|
+
},
|
|
1813
|
+
enumerable: false,
|
|
1814
|
+
configurable: true
|
|
1815
|
+
});
|
|
1816
|
+
Object.defineProperty(CMI.prototype, "suspend_data", {
|
|
1817
|
+
get: function () {
|
|
1818
|
+
var _a;
|
|
1819
|
+
return (_a = this.core) === null || _a === void 0 ? void 0 : _a.suspend_data;
|
|
1820
|
+
},
|
|
1821
|
+
set: function (suspend_data) {
|
|
1822
|
+
if (this.core) {
|
|
1823
|
+
this.core.suspend_data = suspend_data;
|
|
1824
|
+
}
|
|
1825
|
+
},
|
|
1826
|
+
enumerable: false,
|
|
1827
|
+
configurable: true
|
|
1828
|
+
});
|
|
1829
|
+
Object.defineProperty(CMI.prototype, "launch_data", {
|
|
1830
|
+
get: function () {
|
|
1831
|
+
return this._launch_data;
|
|
1832
|
+
},
|
|
1833
|
+
set: function (launch_data) {
|
|
1834
|
+
if (this.initialized) {
|
|
1835
|
+
throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT);
|
|
1836
|
+
}
|
|
1837
|
+
else {
|
|
1838
|
+
this._launch_data = launch_data;
|
|
1839
|
+
}
|
|
1840
|
+
},
|
|
1841
|
+
enumerable: false,
|
|
1842
|
+
configurable: true
|
|
1843
|
+
});
|
|
1844
|
+
Object.defineProperty(CMI.prototype, "comments", {
|
|
1845
|
+
get: function () {
|
|
1846
|
+
return this._comments;
|
|
1847
|
+
},
|
|
1848
|
+
set: function (comments) {
|
|
1849
|
+
if ((0,validation/* check12ValidFormat */.p)(comments, regex/* default */.A.scorm12.CMIString4096, true)) {
|
|
1850
|
+
this._comments = comments;
|
|
1851
|
+
}
|
|
1852
|
+
},
|
|
1853
|
+
enumerable: false,
|
|
1854
|
+
configurable: true
|
|
1855
|
+
});
|
|
1856
|
+
Object.defineProperty(CMI.prototype, "comments_from_lms", {
|
|
1857
|
+
get: function () {
|
|
1858
|
+
return this._comments_from_lms;
|
|
1859
|
+
},
|
|
1860
|
+
set: function (comments_from_lms) {
|
|
1861
|
+
if (this.initialized) {
|
|
1862
|
+
throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT);
|
|
1863
|
+
}
|
|
1864
|
+
else {
|
|
1865
|
+
this._comments_from_lms = comments_from_lms;
|
|
1866
|
+
}
|
|
1867
|
+
},
|
|
1868
|
+
enumerable: false,
|
|
1869
|
+
configurable: true
|
|
1870
|
+
});
|
|
1871
|
+
CMI.prototype.getCurrentTotalTime = function () {
|
|
1872
|
+
return this.core.getCurrentTotalTime(this.start_time);
|
|
1873
|
+
};
|
|
1874
|
+
return CMI;
|
|
1875
|
+
}(base_cmi/* BaseRootCMI */.r));
|
|
1876
|
+
|
|
1877
|
+
|
|
1878
|
+
|
|
1879
|
+
/***/ }),
|
|
1880
|
+
|
|
1881
|
+
/***/ 833:
|
|
1882
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1883
|
+
|
|
1884
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1885
|
+
/* harmony export */ Oh: function() { return /* binding */ CMIInteractionsObjectivesObject; },
|
|
1886
|
+
/* harmony export */ WP: function() { return /* binding */ CMIInteractionsObject; },
|
|
1887
|
+
/* harmony export */ Xb: function() { return /* binding */ CMIInteractions; },
|
|
1888
|
+
/* harmony export */ cb: function() { return /* binding */ CMIInteractionsCorrectResponsesObject; }
|
|
1889
|
+
/* harmony export */ });
|
|
1890
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(635);
|
|
1891
|
+
/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(589);
|
|
1892
|
+
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
1893
|
+
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(797);
|
|
1894
|
+
/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(784);
|
|
1895
|
+
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(319);
|
|
1896
|
+
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(915);
|
|
1897
|
+
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(417);
|
|
1898
|
+
|
|
1899
|
+
|
|
1900
|
+
|
|
1901
|
+
|
|
1902
|
+
|
|
1903
|
+
|
|
1904
|
+
|
|
1905
|
+
|
|
1906
|
+
var CMIInteractions = (function (_super) {
|
|
1907
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(CMIInteractions, _super);
|
|
1908
|
+
function CMIInteractions() {
|
|
1909
|
+
return _super.call(this, {
|
|
1910
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.interactions_children,
|
|
1911
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE,
|
|
1912
|
+
errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ,
|
|
1913
|
+
}) || this;
|
|
1914
|
+
}
|
|
1915
|
+
return CMIInteractions;
|
|
1916
|
+
}(_common_array__WEBPACK_IMPORTED_MODULE_0__/* .CMIArray */ .B));
|
|
1917
|
+
|
|
1918
|
+
var CMIInteractionsObject = (function (_super) {
|
|
1919
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(CMIInteractionsObject, _super);
|
|
1920
|
+
function CMIInteractionsObject() {
|
|
1921
|
+
var _this = _super.call(this) || this;
|
|
1922
|
+
_this._id = "";
|
|
1923
|
+
_this._time = "";
|
|
1924
|
+
_this._type = "";
|
|
1925
|
+
_this._weighting = "";
|
|
1926
|
+
_this._student_response = "";
|
|
1927
|
+
_this._result = "";
|
|
1928
|
+
_this._latency = "";
|
|
1929
|
+
_this.objectives = new _common_array__WEBPACK_IMPORTED_MODULE_0__/* .CMIArray */ .B({
|
|
1930
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE,
|
|
1931
|
+
errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ,
|
|
1932
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.objectives_children,
|
|
1933
|
+
});
|
|
1934
|
+
_this.correct_responses = new _common_array__WEBPACK_IMPORTED_MODULE_0__/* .CMIArray */ .B({
|
|
1935
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE,
|
|
1936
|
+
errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ,
|
|
1937
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.correct_responses_children,
|
|
1938
|
+
});
|
|
1939
|
+
return _this;
|
|
1940
|
+
}
|
|
1941
|
+
CMIInteractionsObject.prototype.initialize = function () {
|
|
1942
|
+
var _a, _b;
|
|
1943
|
+
_super.prototype.initialize.call(this);
|
|
1944
|
+
(_a = this.objectives) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
1945
|
+
(_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.initialize();
|
|
1946
|
+
};
|
|
1947
|
+
Object.defineProperty(CMIInteractionsObject.prototype, "id", {
|
|
1948
|
+
get: function () {
|
|
1949
|
+
if (!this.jsonString) {
|
|
1950
|
+
throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT);
|
|
1951
|
+
}
|
|
1952
|
+
return this._id;
|
|
1953
|
+
},
|
|
1954
|
+
set: function (id) {
|
|
1955
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIIdentifier)) {
|
|
1956
|
+
this._id = id;
|
|
1957
|
+
}
|
|
1958
|
+
},
|
|
1959
|
+
enumerable: false,
|
|
1960
|
+
configurable: true
|
|
1961
|
+
});
|
|
1962
|
+
Object.defineProperty(CMIInteractionsObject.prototype, "time", {
|
|
1963
|
+
get: function () {
|
|
1964
|
+
if (!this.jsonString) {
|
|
1965
|
+
throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT);
|
|
1966
|
+
}
|
|
1967
|
+
return this._time;
|
|
1968
|
+
},
|
|
1969
|
+
set: function (time) {
|
|
1970
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(time, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMITime)) {
|
|
1971
|
+
this._time = time;
|
|
1972
|
+
}
|
|
1973
|
+
},
|
|
1974
|
+
enumerable: false,
|
|
1975
|
+
configurable: true
|
|
1976
|
+
});
|
|
1977
|
+
Object.defineProperty(CMIInteractionsObject.prototype, "type", {
|
|
1978
|
+
get: function () {
|
|
1979
|
+
if (!this.jsonString) {
|
|
1980
|
+
throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT);
|
|
1981
|
+
}
|
|
1982
|
+
return this._type;
|
|
1983
|
+
},
|
|
1984
|
+
set: function (type) {
|
|
1985
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(type, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIType)) {
|
|
1986
|
+
this._type = type;
|
|
1987
|
+
}
|
|
1988
|
+
},
|
|
1989
|
+
enumerable: false,
|
|
1990
|
+
configurable: true
|
|
1991
|
+
});
|
|
1992
|
+
Object.defineProperty(CMIInteractionsObject.prototype, "weighting", {
|
|
1993
|
+
get: function () {
|
|
1994
|
+
if (!this.jsonString) {
|
|
1995
|
+
throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT);
|
|
1996
|
+
}
|
|
1997
|
+
return this._weighting;
|
|
1998
|
+
},
|
|
1999
|
+
set: function (weighting) {
|
|
2000
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIDecimal) &&
|
|
2001
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidRange */ .h)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.weighting_range)) {
|
|
2002
|
+
this._weighting = weighting;
|
|
2003
|
+
}
|
|
2004
|
+
},
|
|
2005
|
+
enumerable: false,
|
|
2006
|
+
configurable: true
|
|
2007
|
+
});
|
|
2008
|
+
Object.defineProperty(CMIInteractionsObject.prototype, "student_response", {
|
|
2009
|
+
get: function () {
|
|
2010
|
+
if (!this.jsonString) {
|
|
2011
|
+
throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT);
|
|
2012
|
+
}
|
|
2013
|
+
return this._student_response;
|
|
2014
|
+
},
|
|
2015
|
+
set: function (student_response) {
|
|
2016
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(student_response, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIFeedback, true)) {
|
|
2017
|
+
this._student_response = student_response;
|
|
2018
|
+
}
|
|
2019
|
+
},
|
|
2020
|
+
enumerable: false,
|
|
2021
|
+
configurable: true
|
|
2022
|
+
});
|
|
2023
|
+
Object.defineProperty(CMIInteractionsObject.prototype, "result", {
|
|
2024
|
+
get: function () {
|
|
2025
|
+
if (!this.jsonString) {
|
|
2026
|
+
throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT);
|
|
2027
|
+
}
|
|
2028
|
+
return this._result;
|
|
2029
|
+
},
|
|
2030
|
+
set: function (result) {
|
|
2031
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(result, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIResult)) {
|
|
2032
|
+
this._result = result;
|
|
2033
|
+
}
|
|
2034
|
+
},
|
|
2035
|
+
enumerable: false,
|
|
2036
|
+
configurable: true
|
|
2037
|
+
});
|
|
2038
|
+
Object.defineProperty(CMIInteractionsObject.prototype, "latency", {
|
|
2039
|
+
get: function () {
|
|
2040
|
+
if (!this.jsonString) {
|
|
2041
|
+
throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT);
|
|
2042
|
+
}
|
|
2043
|
+
return this._latency;
|
|
2044
|
+
},
|
|
2045
|
+
set: function (latency) {
|
|
2046
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(latency, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMITimespan)) {
|
|
2047
|
+
this._latency = latency;
|
|
2048
|
+
}
|
|
2049
|
+
},
|
|
2050
|
+
enumerable: false,
|
|
2051
|
+
configurable: true
|
|
2052
|
+
});
|
|
2053
|
+
CMIInteractionsObject.prototype.toJSON = function () {
|
|
2054
|
+
this.jsonString = true;
|
|
2055
|
+
var result = {
|
|
2056
|
+
id: this.id,
|
|
2057
|
+
time: this.time,
|
|
2058
|
+
type: this.type,
|
|
2059
|
+
weighting: this.weighting,
|
|
2060
|
+
student_response: this.student_response,
|
|
2061
|
+
result: this.result,
|
|
2062
|
+
latency: this.latency,
|
|
2063
|
+
objectives: this.objectives,
|
|
2064
|
+
correct_responses: this.correct_responses,
|
|
2065
|
+
};
|
|
2066
|
+
delete this.jsonString;
|
|
2067
|
+
return result;
|
|
2068
|
+
};
|
|
2069
|
+
return CMIInteractionsObject;
|
|
2070
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__/* .BaseCMI */ .J));
|
|
2071
|
+
|
|
2072
|
+
var CMIInteractionsObjectivesObject = (function (_super) {
|
|
2073
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(CMIInteractionsObjectivesObject, _super);
|
|
2074
|
+
function CMIInteractionsObjectivesObject() {
|
|
2075
|
+
var _this = _super.call(this) || this;
|
|
2076
|
+
_this._id = "";
|
|
2077
|
+
return _this;
|
|
2078
|
+
}
|
|
2079
|
+
Object.defineProperty(CMIInteractionsObjectivesObject.prototype, "id", {
|
|
2080
|
+
get: function () {
|
|
2081
|
+
return this._id;
|
|
2082
|
+
},
|
|
2083
|
+
set: function (id) {
|
|
2084
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIIdentifier)) {
|
|
2085
|
+
this._id = id;
|
|
2086
|
+
}
|
|
2087
|
+
},
|
|
2088
|
+
enumerable: false,
|
|
2089
|
+
configurable: true
|
|
2090
|
+
});
|
|
2091
|
+
CMIInteractionsObjectivesObject.prototype.toJSON = function () {
|
|
2092
|
+
this.jsonString = true;
|
|
2093
|
+
var result = {
|
|
2094
|
+
id: this.id,
|
|
2095
|
+
};
|
|
2096
|
+
delete this.jsonString;
|
|
2097
|
+
return result;
|
|
2098
|
+
};
|
|
2099
|
+
return CMIInteractionsObjectivesObject;
|
|
2100
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__/* .BaseCMI */ .J));
|
|
2101
|
+
|
|
2102
|
+
var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
2103
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(CMIInteractionsCorrectResponsesObject, _super);
|
|
2104
|
+
function CMIInteractionsCorrectResponsesObject() {
|
|
2105
|
+
var _this = _super.call(this) || this;
|
|
2106
|
+
_this._pattern = "";
|
|
2107
|
+
return _this;
|
|
2108
|
+
}
|
|
2109
|
+
Object.defineProperty(CMIInteractionsCorrectResponsesObject.prototype, "pattern", {
|
|
2110
|
+
get: function () {
|
|
2111
|
+
if (!this.jsonString) {
|
|
2112
|
+
throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT);
|
|
2113
|
+
}
|
|
2114
|
+
return this._pattern;
|
|
2115
|
+
},
|
|
2116
|
+
set: function (pattern) {
|
|
2117
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(pattern, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIFeedback, true)) {
|
|
2118
|
+
this._pattern = pattern;
|
|
2119
|
+
}
|
|
2120
|
+
},
|
|
2121
|
+
enumerable: false,
|
|
2122
|
+
configurable: true
|
|
2123
|
+
});
|
|
2124
|
+
CMIInteractionsCorrectResponsesObject.prototype.toJSON = function () {
|
|
2125
|
+
this.jsonString = true;
|
|
2126
|
+
var result = {
|
|
2127
|
+
pattern: this._pattern,
|
|
2128
|
+
};
|
|
2129
|
+
delete this.jsonString;
|
|
2130
|
+
return result;
|
|
2131
|
+
};
|
|
2132
|
+
return CMIInteractionsCorrectResponsesObject;
|
|
2133
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__/* .BaseCMI */ .J));
|
|
2134
|
+
|
|
2135
|
+
|
|
2136
|
+
|
|
2137
|
+
/***/ }),
|
|
2138
|
+
|
|
2139
|
+
/***/ 331:
|
|
2140
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2141
|
+
|
|
2142
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2143
|
+
/* harmony export */ A: function() { return /* binding */ NAV; }
|
|
2144
|
+
/* harmony export */ });
|
|
2145
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635);
|
|
2146
|
+
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
2147
|
+
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(915);
|
|
2148
|
+
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(417);
|
|
2149
|
+
|
|
2150
|
+
|
|
2151
|
+
|
|
2152
|
+
|
|
2153
|
+
var NAV = (function (_super) {
|
|
2154
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__extends */ .C6)(NAV, _super);
|
|
2155
|
+
function NAV() {
|
|
2156
|
+
var _this = _super.call(this) || this;
|
|
2157
|
+
_this._event = "";
|
|
2158
|
+
return _this;
|
|
2159
|
+
}
|
|
2160
|
+
Object.defineProperty(NAV.prototype, "event", {
|
|
2161
|
+
get: function () {
|
|
2162
|
+
return this._event;
|
|
2163
|
+
},
|
|
2164
|
+
set: function (event) {
|
|
2165
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_1__/* .check12ValidFormat */ .p)(event, _constants_regex__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.NAVEvent)) {
|
|
2166
|
+
this._event = event;
|
|
2167
|
+
}
|
|
2168
|
+
},
|
|
2169
|
+
enumerable: false,
|
|
2170
|
+
configurable: true
|
|
2171
|
+
});
|
|
2172
|
+
NAV.prototype.toJSON = function () {
|
|
2173
|
+
this.jsonString = true;
|
|
2174
|
+
var result = {
|
|
2175
|
+
event: this.event,
|
|
2176
|
+
};
|
|
2177
|
+
delete this.jsonString;
|
|
2178
|
+
return result;
|
|
2179
|
+
};
|
|
2180
|
+
return NAV;
|
|
2181
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J));
|
|
2182
|
+
|
|
2183
|
+
|
|
2184
|
+
|
|
2185
|
+
/***/ }),
|
|
2186
|
+
|
|
2187
|
+
/***/ 176:
|
|
2188
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2189
|
+
|
|
2190
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2191
|
+
/* harmony export */ C: function() { return /* binding */ CMIObjectives; },
|
|
2192
|
+
/* harmony export */ N: function() { return /* binding */ CMIObjectivesObject; }
|
|
2193
|
+
/* harmony export */ });
|
|
2194
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(635);
|
|
2195
|
+
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
2196
|
+
/* harmony import */ var _common_score__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(434);
|
|
2197
|
+
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(340);
|
|
2198
|
+
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(417);
|
|
2199
|
+
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(797);
|
|
2200
|
+
/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(784);
|
|
2201
|
+
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(915);
|
|
2202
|
+
/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(589);
|
|
2203
|
+
|
|
2204
|
+
|
|
2205
|
+
|
|
2206
|
+
|
|
2207
|
+
|
|
2208
|
+
|
|
2209
|
+
|
|
2210
|
+
|
|
2211
|
+
|
|
2212
|
+
var CMIObjectives = (function (_super) {
|
|
2213
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__extends */ .C6)(CMIObjectives, _super);
|
|
2214
|
+
function CMIObjectives() {
|
|
2215
|
+
return _super.call(this, {
|
|
2216
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.objectives_children,
|
|
2217
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE,
|
|
2218
|
+
errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_5__/* .Scorm12ValidationError */ .tQ,
|
|
2219
|
+
}) || this;
|
|
2220
|
+
}
|
|
2221
|
+
return CMIObjectives;
|
|
2222
|
+
}(_common_array__WEBPACK_IMPORTED_MODULE_7__/* .CMIArray */ .B));
|
|
2223
|
+
|
|
2224
|
+
var CMIObjectivesObject = (function (_super) {
|
|
2225
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__extends */ .C6)(CMIObjectivesObject, _super);
|
|
2226
|
+
function CMIObjectivesObject() {
|
|
2227
|
+
var _this = _super.call(this) || this;
|
|
2228
|
+
_this._id = "";
|
|
2229
|
+
_this._status = "";
|
|
2230
|
+
_this.score = new _common_score__WEBPACK_IMPORTED_MODULE_1__/* .CMIScore */ ._({
|
|
2231
|
+
score_children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.score_children,
|
|
2232
|
+
score_range: _constants_regex__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.score_range,
|
|
2233
|
+
invalidErrorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE,
|
|
2234
|
+
invalidTypeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12.TYPE_MISMATCH,
|
|
2235
|
+
invalidRangeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12.VALUE_OUT_OF_RANGE,
|
|
2236
|
+
errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_5__/* .Scorm12ValidationError */ .tQ,
|
|
2237
|
+
});
|
|
2238
|
+
return _this;
|
|
2239
|
+
}
|
|
2240
|
+
Object.defineProperty(CMIObjectivesObject.prototype, "id", {
|
|
2241
|
+
get: function () {
|
|
2242
|
+
return this._id;
|
|
2243
|
+
},
|
|
2244
|
+
set: function (id) {
|
|
2245
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__/* .check12ValidFormat */ .p)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.CMIIdentifier)) {
|
|
2246
|
+
this._id = id;
|
|
2247
|
+
}
|
|
2248
|
+
},
|
|
2249
|
+
enumerable: false,
|
|
2250
|
+
configurable: true
|
|
2251
|
+
});
|
|
2252
|
+
Object.defineProperty(CMIObjectivesObject.prototype, "status", {
|
|
2253
|
+
get: function () {
|
|
2254
|
+
return this._status;
|
|
2255
|
+
},
|
|
2256
|
+
set: function (status) {
|
|
2257
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__/* .check12ValidFormat */ .p)(status, _constants_regex__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.CMIStatus2)) {
|
|
2258
|
+
this._status = status;
|
|
2259
|
+
}
|
|
2260
|
+
},
|
|
2261
|
+
enumerable: false,
|
|
2262
|
+
configurable: true
|
|
2263
|
+
});
|
|
2264
|
+
CMIObjectivesObject.prototype.toJSON = function () {
|
|
2265
|
+
this.jsonString = true;
|
|
2266
|
+
var result = {
|
|
2267
|
+
id: this.id,
|
|
2268
|
+
status: this.status,
|
|
2269
|
+
score: this.score,
|
|
2270
|
+
};
|
|
2271
|
+
delete this.jsonString;
|
|
2272
|
+
return result;
|
|
2273
|
+
};
|
|
2274
|
+
return CMIObjectivesObject;
|
|
2275
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J));
|
|
2276
|
+
|
|
2277
|
+
|
|
2278
|
+
|
|
2279
|
+
/***/ }),
|
|
2280
|
+
|
|
2281
|
+
/***/ 532:
|
|
2282
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2283
|
+
|
|
2284
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2285
|
+
/* harmony export */ X: function() { return /* binding */ CMIStudentData; }
|
|
2286
|
+
/* harmony export */ });
|
|
2287
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635);
|
|
2288
|
+
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
2289
|
+
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
2290
|
+
/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(784);
|
|
2291
|
+
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797);
|
|
2292
|
+
|
|
2293
|
+
|
|
2294
|
+
|
|
2295
|
+
|
|
2296
|
+
|
|
2297
|
+
var CMIStudentData = (function (_super) {
|
|
2298
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__extends */ .C6)(CMIStudentData, _super);
|
|
2299
|
+
function CMIStudentData(student_data_children) {
|
|
2300
|
+
var _this = _super.call(this) || this;
|
|
2301
|
+
_this._mastery_score = "";
|
|
2302
|
+
_this._max_time_allowed = "";
|
|
2303
|
+
_this._time_limit_action = "";
|
|
2304
|
+
_this.__children = student_data_children
|
|
2305
|
+
? student_data_children
|
|
2306
|
+
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.student_data_children;
|
|
2307
|
+
return _this;
|
|
2308
|
+
}
|
|
2309
|
+
Object.defineProperty(CMIStudentData.prototype, "_children", {
|
|
2310
|
+
get: function () {
|
|
2311
|
+
return this.__children;
|
|
2312
|
+
},
|
|
2313
|
+
set: function (_children) {
|
|
2314
|
+
throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE);
|
|
2315
|
+
},
|
|
2316
|
+
enumerable: false,
|
|
2317
|
+
configurable: true
|
|
2318
|
+
});
|
|
2319
|
+
Object.defineProperty(CMIStudentData.prototype, "mastery_score", {
|
|
2320
|
+
get: function () {
|
|
2321
|
+
return this._mastery_score;
|
|
2322
|
+
},
|
|
2323
|
+
set: function (mastery_score) {
|
|
2324
|
+
if (this.initialized) {
|
|
2325
|
+
throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.READ_ONLY_ELEMENT);
|
|
2326
|
+
}
|
|
2327
|
+
else {
|
|
2328
|
+
this._mastery_score = mastery_score;
|
|
2329
|
+
}
|
|
2330
|
+
},
|
|
2331
|
+
enumerable: false,
|
|
2332
|
+
configurable: true
|
|
2333
|
+
});
|
|
2334
|
+
Object.defineProperty(CMIStudentData.prototype, "max_time_allowed", {
|
|
2335
|
+
get: function () {
|
|
2336
|
+
return this._max_time_allowed;
|
|
2337
|
+
},
|
|
2338
|
+
set: function (max_time_allowed) {
|
|
2339
|
+
if (this.initialized) {
|
|
2340
|
+
throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.READ_ONLY_ELEMENT);
|
|
2341
|
+
}
|
|
2342
|
+
else {
|
|
2343
|
+
this._max_time_allowed = max_time_allowed;
|
|
2344
|
+
}
|
|
2345
|
+
},
|
|
2346
|
+
enumerable: false,
|
|
2347
|
+
configurable: true
|
|
2348
|
+
});
|
|
2349
|
+
Object.defineProperty(CMIStudentData.prototype, "time_limit_action", {
|
|
2350
|
+
get: function () {
|
|
2351
|
+
return this._time_limit_action;
|
|
2352
|
+
},
|
|
2353
|
+
set: function (time_limit_action) {
|
|
2354
|
+
if (this.initialized) {
|
|
2355
|
+
throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.READ_ONLY_ELEMENT);
|
|
2356
|
+
}
|
|
2357
|
+
else {
|
|
2358
|
+
this._time_limit_action = time_limit_action;
|
|
2359
|
+
}
|
|
2360
|
+
},
|
|
2361
|
+
enumerable: false,
|
|
2362
|
+
configurable: true
|
|
2363
|
+
});
|
|
2364
|
+
CMIStudentData.prototype.toJSON = function () {
|
|
2365
|
+
this.jsonString = true;
|
|
2366
|
+
var result = {
|
|
2367
|
+
mastery_score: this.mastery_score,
|
|
2368
|
+
max_time_allowed: this.max_time_allowed,
|
|
2369
|
+
time_limit_action: this.time_limit_action,
|
|
2370
|
+
};
|
|
2371
|
+
delete this.jsonString;
|
|
2372
|
+
return result;
|
|
2373
|
+
};
|
|
2374
|
+
return CMIStudentData;
|
|
2375
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J));
|
|
2376
|
+
|
|
2377
|
+
|
|
2378
|
+
|
|
2379
|
+
/***/ }),
|
|
2380
|
+
|
|
2381
|
+
/***/ 181:
|
|
2382
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2383
|
+
|
|
2384
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2385
|
+
/* harmony export */ G: function() { return /* binding */ CMIStudentPreference; }
|
|
2386
|
+
/* harmony export */ });
|
|
2387
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(635);
|
|
2388
|
+
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
2389
|
+
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
2390
|
+
/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(784);
|
|
2391
|
+
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797);
|
|
2392
|
+
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(915);
|
|
2393
|
+
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(417);
|
|
2394
|
+
|
|
2395
|
+
|
|
2396
|
+
|
|
2397
|
+
|
|
2398
|
+
|
|
2399
|
+
|
|
2400
|
+
|
|
2401
|
+
var CMIStudentPreference = (function (_super) {
|
|
2402
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__extends */ .C6)(CMIStudentPreference, _super);
|
|
2403
|
+
function CMIStudentPreference(student_preference_children) {
|
|
2404
|
+
var _this = _super.call(this) || this;
|
|
2405
|
+
_this._audio = "";
|
|
2406
|
+
_this._language = "";
|
|
2407
|
+
_this._speed = "";
|
|
2408
|
+
_this._text = "";
|
|
2409
|
+
_this.__children = student_preference_children
|
|
2410
|
+
? student_preference_children
|
|
2411
|
+
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.student_preference_children;
|
|
2412
|
+
return _this;
|
|
2413
|
+
}
|
|
2414
|
+
Object.defineProperty(CMIStudentPreference.prototype, "_children", {
|
|
2415
|
+
get: function () {
|
|
2416
|
+
return this.__children;
|
|
2417
|
+
},
|
|
2418
|
+
set: function (_children) {
|
|
2419
|
+
throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE);
|
|
2420
|
+
},
|
|
2421
|
+
enumerable: false,
|
|
2422
|
+
configurable: true
|
|
2423
|
+
});
|
|
2424
|
+
Object.defineProperty(CMIStudentPreference.prototype, "audio", {
|
|
2425
|
+
get: function () {
|
|
2426
|
+
return this._audio;
|
|
2427
|
+
},
|
|
2428
|
+
set: function (audio) {
|
|
2429
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidFormat */ .p)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.CMISInteger) &&
|
|
2430
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidRange */ .h)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.audio_range)) {
|
|
2431
|
+
this._audio = audio;
|
|
2432
|
+
}
|
|
2433
|
+
},
|
|
2434
|
+
enumerable: false,
|
|
2435
|
+
configurable: true
|
|
2436
|
+
});
|
|
2437
|
+
Object.defineProperty(CMIStudentPreference.prototype, "language", {
|
|
2438
|
+
get: function () {
|
|
2439
|
+
return this._language;
|
|
2440
|
+
},
|
|
2441
|
+
set: function (language) {
|
|
2442
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidFormat */ .p)(language, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.CMIString256)) {
|
|
2443
|
+
this._language = language;
|
|
2444
|
+
}
|
|
2445
|
+
},
|
|
2446
|
+
enumerable: false,
|
|
2447
|
+
configurable: true
|
|
2448
|
+
});
|
|
2449
|
+
Object.defineProperty(CMIStudentPreference.prototype, "speed", {
|
|
2450
|
+
get: function () {
|
|
2451
|
+
return this._speed;
|
|
2452
|
+
},
|
|
2453
|
+
set: function (speed) {
|
|
2454
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidFormat */ .p)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.CMISInteger) &&
|
|
2455
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidRange */ .h)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.speed_range)) {
|
|
2456
|
+
this._speed = speed;
|
|
2457
|
+
}
|
|
2458
|
+
},
|
|
2459
|
+
enumerable: false,
|
|
2460
|
+
configurable: true
|
|
2461
|
+
});
|
|
2462
|
+
Object.defineProperty(CMIStudentPreference.prototype, "text", {
|
|
2463
|
+
get: function () {
|
|
2464
|
+
return this._text;
|
|
2465
|
+
},
|
|
2466
|
+
set: function (text) {
|
|
2467
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidFormat */ .p)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.CMISInteger) &&
|
|
2468
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidRange */ .h)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.text_range)) {
|
|
2469
|
+
this._text = text;
|
|
2470
|
+
}
|
|
2471
|
+
},
|
|
2472
|
+
enumerable: false,
|
|
2473
|
+
configurable: true
|
|
2474
|
+
});
|
|
2475
|
+
CMIStudentPreference.prototype.toJSON = function () {
|
|
2476
|
+
this.jsonString = true;
|
|
2477
|
+
var result = {
|
|
2478
|
+
audio: this.audio,
|
|
2479
|
+
language: this.language,
|
|
2480
|
+
speed: this.speed,
|
|
2481
|
+
text: this.text,
|
|
2482
|
+
};
|
|
2483
|
+
delete this.jsonString;
|
|
2484
|
+
return result;
|
|
2485
|
+
};
|
|
2486
|
+
return CMIStudentPreference;
|
|
2487
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J));
|
|
2488
|
+
|
|
2489
|
+
|
|
2490
|
+
|
|
2491
|
+
/***/ }),
|
|
2492
|
+
|
|
2493
|
+
/***/ 915:
|
|
2494
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2495
|
+
|
|
2496
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2497
|
+
/* harmony export */ h: function() { return /* binding */ check12ValidRange; },
|
|
2498
|
+
/* harmony export */ p: function() { return /* binding */ check12ValidFormat; }
|
|
2499
|
+
/* harmony export */ });
|
|
2500
|
+
/* harmony import */ var _common_validation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(449);
|
|
2501
|
+
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(797);
|
|
2502
|
+
/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(784);
|
|
2503
|
+
|
|
2504
|
+
|
|
2505
|
+
|
|
2506
|
+
function check12ValidFormat(value, regexPattern, allowEmptyString) {
|
|
2507
|
+
return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__/* .checkValidFormat */ .q)(value, regexPattern, _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.TYPE_MISMATCH, _exceptions__WEBPACK_IMPORTED_MODULE_1__/* .Scorm12ValidationError */ .tQ, allowEmptyString);
|
|
2508
|
+
}
|
|
2509
|
+
function check12ValidRange(value, rangePattern, allowEmptyString) {
|
|
2510
|
+
if (!allowEmptyString && value === "") {
|
|
2511
|
+
throw new _exceptions__WEBPACK_IMPORTED_MODULE_1__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.VALUE_OUT_OF_RANGE);
|
|
2512
|
+
}
|
|
2513
|
+
return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__/* .checkValidRange */ .W)(value, rangePattern, _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.VALUE_OUT_OF_RANGE, _exceptions__WEBPACK_IMPORTED_MODULE_1__/* .Scorm12ValidationError */ .tQ);
|
|
2514
|
+
}
|
|
2515
|
+
|
|
2516
|
+
|
|
2517
|
+
/***/ }),
|
|
2518
|
+
|
|
2519
|
+
/***/ 340:
|
|
2520
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2521
|
+
|
|
2522
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
2523
|
+
|
|
2524
|
+
var global = {
|
|
2525
|
+
SCORM_TRUE: "true",
|
|
2526
|
+
SCORM_FALSE: "false",
|
|
2527
|
+
STATE_NOT_INITIALIZED: 0,
|
|
2528
|
+
STATE_INITIALIZED: 1,
|
|
2529
|
+
STATE_TERMINATED: 2,
|
|
2530
|
+
LOG_LEVEL_DEBUG: 1,
|
|
2531
|
+
LOG_LEVEL_INFO: 2,
|
|
2532
|
+
LOG_LEVEL_WARNING: 3,
|
|
2533
|
+
LOG_LEVEL_ERROR: 4,
|
|
2534
|
+
LOG_LEVEL_NONE: 5,
|
|
2535
|
+
};
|
|
2536
|
+
var scorm12 = {
|
|
2537
|
+
cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",
|
|
2538
|
+
core_children: "student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",
|
|
2539
|
+
score_children: "raw,min,max",
|
|
2540
|
+
comments_children: "content,location,time",
|
|
2541
|
+
objectives_children: "id,score,status",
|
|
2542
|
+
correct_responses_children: "pattern",
|
|
2543
|
+
student_data_children: "mastery_score,max_time_allowed,time_limit_action",
|
|
2544
|
+
student_preference_children: "audio,language,speed,text",
|
|
2545
|
+
interactions_children: "id,objectives,time,type,correct_responses,weighting,student_response,result,latency",
|
|
2546
|
+
error_descriptions: {
|
|
2547
|
+
"101": {
|
|
2548
|
+
basicMessage: "General Exception",
|
|
2549
|
+
detailMessage: "No specific error code exists to describe the error. Use LMSGetDiagnostic for more information",
|
|
2550
|
+
},
|
|
2551
|
+
"201": {
|
|
2552
|
+
basicMessage: "Invalid argument error",
|
|
2553
|
+
detailMessage: "Indicates that an argument represents an invalid data model element or is otherwise incorrect.",
|
|
2554
|
+
},
|
|
2555
|
+
"202": {
|
|
2556
|
+
basicMessage: "Element cannot have children",
|
|
2557
|
+
detailMessage: 'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.',
|
|
2558
|
+
},
|
|
2559
|
+
"203": {
|
|
2560
|
+
basicMessage: "Element not an array - cannot have count",
|
|
2561
|
+
detailMessage: 'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.',
|
|
2562
|
+
},
|
|
2563
|
+
"301": {
|
|
2564
|
+
basicMessage: "Not initialized",
|
|
2565
|
+
detailMessage: "Indicates that an API call was made before the call to lmsInitialize.",
|
|
2566
|
+
},
|
|
2567
|
+
"401": {
|
|
2568
|
+
basicMessage: "Not implemented error",
|
|
2569
|
+
detailMessage: "The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.",
|
|
2570
|
+
},
|
|
2571
|
+
"402": {
|
|
2572
|
+
basicMessage: "Invalid set value, element is a keyword",
|
|
2573
|
+
detailMessage: 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").',
|
|
2574
|
+
},
|
|
2575
|
+
"403": {
|
|
2576
|
+
basicMessage: "Element is read only",
|
|
2577
|
+
detailMessage: "LMSSetValue was called with a data model element that can only be read.",
|
|
2578
|
+
},
|
|
2579
|
+
"404": {
|
|
2580
|
+
basicMessage: "Element is write only",
|
|
2581
|
+
detailMessage: "LMSGetValue was called on a data model element that can only be written to.",
|
|
2582
|
+
},
|
|
2583
|
+
"405": {
|
|
2584
|
+
basicMessage: "Incorrect Data Type",
|
|
2585
|
+
detailMessage: "LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.",
|
|
2586
|
+
},
|
|
2587
|
+
"407": {
|
|
2588
|
+
basicMessage: "Element Value Out Of Range",
|
|
2589
|
+
detailMessage: "The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.",
|
|
2590
|
+
},
|
|
2591
|
+
"408": {
|
|
2592
|
+
basicMessage: "Data Model Dependency Not Established",
|
|
2593
|
+
detailMessage: "Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.",
|
|
2594
|
+
},
|
|
2595
|
+
},
|
|
2596
|
+
};
|
|
2597
|
+
var aicc = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, scorm12), {
|
|
2598
|
+
cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",
|
|
2599
|
+
student_preference_children: "audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",
|
|
2600
|
+
student_data_children: "attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",
|
|
2601
|
+
student_demographics_children: "city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience",
|
|
2602
|
+
tries_children: "time,status,score",
|
|
2603
|
+
attempt_records_children: "score,lesson_status",
|
|
2604
|
+
paths_children: "location_id,date,time,status,why_left,time_in_element",
|
|
2605
|
+
});
|
|
2606
|
+
var scorm2004 = {
|
|
2607
|
+
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",
|
|
2608
|
+
comments_children: "comment,timestamp,location",
|
|
2609
|
+
score_children: "max,raw,scaled,min",
|
|
2610
|
+
objectives_children: "progress_measure,completion_status,success_status,description,score,id",
|
|
2611
|
+
correct_responses_children: "pattern",
|
|
2612
|
+
student_data_children: "mastery_score,max_time_allowed,time_limit_action",
|
|
2613
|
+
student_preference_children: "audio_level,audio_captioning,delivery_speed,language",
|
|
2614
|
+
interactions_children: "id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",
|
|
2615
|
+
error_descriptions: {
|
|
2616
|
+
"0": {
|
|
2617
|
+
basicMessage: "No Error",
|
|
2618
|
+
detailMessage: "No error occurred, the previous API call was successful.",
|
|
2619
|
+
},
|
|
2620
|
+
"101": {
|
|
2621
|
+
basicMessage: "General Exception",
|
|
2622
|
+
detailMessage: "No specific error code exists to describe the error. Use GetDiagnostic for more information.",
|
|
2623
|
+
},
|
|
2624
|
+
"102": {
|
|
2625
|
+
basicMessage: "General Initialization Failure",
|
|
2626
|
+
detailMessage: "Call to Initialize failed for an unknown reason.",
|
|
2627
|
+
},
|
|
2628
|
+
"103": {
|
|
2629
|
+
basicMessage: "Already Initialized",
|
|
2630
|
+
detailMessage: "Call to Initialize failed because Initialize was already called.",
|
|
2631
|
+
},
|
|
2632
|
+
"104": {
|
|
2633
|
+
basicMessage: "Content Instance Terminated",
|
|
2634
|
+
detailMessage: "Call to Initialize failed because Terminate was already called.",
|
|
2635
|
+
},
|
|
2636
|
+
"111": {
|
|
2637
|
+
basicMessage: "General Termination Failure",
|
|
2638
|
+
detailMessage: "Call to Terminate failed for an unknown reason.",
|
|
2639
|
+
},
|
|
2640
|
+
"112": {
|
|
2641
|
+
basicMessage: "Termination Before Initialization",
|
|
2642
|
+
detailMessage: "Call to Terminate failed because it was made before the call to Initialize.",
|
|
2643
|
+
},
|
|
2644
|
+
"113": {
|
|
2645
|
+
basicMessage: "Termination After Termination",
|
|
2646
|
+
detailMessage: "Call to Terminate failed because Terminate was already called.",
|
|
2647
|
+
},
|
|
2648
|
+
"122": {
|
|
2649
|
+
basicMessage: "Retrieve Data Before Initialization",
|
|
2650
|
+
detailMessage: "Call to GetValue failed because it was made before the call to Initialize.",
|
|
2651
|
+
},
|
|
2652
|
+
"123": {
|
|
2653
|
+
basicMessage: "Retrieve Data After Termination",
|
|
2654
|
+
detailMessage: "Call to GetValue failed because it was made after the call to Terminate.",
|
|
2655
|
+
},
|
|
2656
|
+
"132": {
|
|
2657
|
+
basicMessage: "Store Data Before Initialization",
|
|
2658
|
+
detailMessage: "Call to SetValue failed because it was made before the call to Initialize.",
|
|
2659
|
+
},
|
|
2660
|
+
"133": {
|
|
2661
|
+
basicMessage: "Store Data After Termination",
|
|
2662
|
+
detailMessage: "Call to SetValue failed because it was made after the call to Terminate.",
|
|
2663
|
+
},
|
|
2664
|
+
"142": {
|
|
2665
|
+
basicMessage: "Commit Before Initialization",
|
|
2666
|
+
detailMessage: "Call to Commit failed because it was made before the call to Initialize.",
|
|
2667
|
+
},
|
|
2668
|
+
"143": {
|
|
2669
|
+
basicMessage: "Commit After Termination",
|
|
2670
|
+
detailMessage: "Call to Commit failed because it was made after the call to Terminate.",
|
|
2671
|
+
},
|
|
2672
|
+
"201": {
|
|
2673
|
+
basicMessage: "General Argument Error",
|
|
2674
|
+
detailMessage: "An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.",
|
|
2675
|
+
},
|
|
2676
|
+
"301": {
|
|
2677
|
+
basicMessage: "General Get Failure",
|
|
2678
|
+
detailMessage: "Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.",
|
|
2679
|
+
},
|
|
2680
|
+
"351": {
|
|
2681
|
+
basicMessage: "General Set Failure",
|
|
2682
|
+
detailMessage: "Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.",
|
|
2683
|
+
},
|
|
2684
|
+
"391": {
|
|
2685
|
+
basicMessage: "General Commit Failure",
|
|
2686
|
+
detailMessage: "Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.",
|
|
2687
|
+
},
|
|
2688
|
+
"401": {
|
|
2689
|
+
basicMessage: "Undefined Data Model Element",
|
|
2690
|
+
detailMessage: "The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.",
|
|
2691
|
+
},
|
|
2692
|
+
"402": {
|
|
2693
|
+
basicMessage: "Unimplemented Data Model Element",
|
|
2694
|
+
detailMessage: "The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.",
|
|
2695
|
+
},
|
|
2696
|
+
"403": {
|
|
2697
|
+
basicMessage: "Data Model Element Value Not Initialized",
|
|
2698
|
+
detailMessage: "Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.",
|
|
2699
|
+
},
|
|
2700
|
+
"404": {
|
|
2701
|
+
basicMessage: "Data Model Element Is Read Only",
|
|
2702
|
+
detailMessage: "SetValue was called with a data model element that can only be read.",
|
|
2703
|
+
},
|
|
2704
|
+
"405": {
|
|
2705
|
+
basicMessage: "Data Model Element Is Write Only",
|
|
2706
|
+
detailMessage: "GetValue was called on a data model element that can only be written to.",
|
|
2707
|
+
},
|
|
2708
|
+
"406": {
|
|
2709
|
+
basicMessage: "Data Model Element Type Mismatch",
|
|
2710
|
+
detailMessage: "SetValue was called with a value that is not consistent with the data format of the supplied data model element.",
|
|
2711
|
+
},
|
|
2712
|
+
"407": {
|
|
2713
|
+
basicMessage: "Data Model Element Value Out Of Range",
|
|
2714
|
+
detailMessage: "The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.",
|
|
2715
|
+
},
|
|
2716
|
+
"408": {
|
|
2717
|
+
basicMessage: "Data Model Dependency Not Established",
|
|
2718
|
+
detailMessage: "Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.",
|
|
2719
|
+
},
|
|
2720
|
+
},
|
|
2721
|
+
};
|
|
2722
|
+
var APIConstants = {
|
|
2723
|
+
global: global,
|
|
2724
|
+
scorm12: scorm12,
|
|
2725
|
+
aicc: aicc,
|
|
2726
|
+
scorm2004: scorm2004,
|
|
2727
|
+
};
|
|
2728
|
+
/* harmony default export */ __webpack_exports__.A = (APIConstants);
|
|
2729
|
+
|
|
2730
|
+
|
|
2731
|
+
/***/ }),
|
|
2732
|
+
|
|
2733
|
+
/***/ 56:
|
|
2734
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2735
|
+
|
|
2736
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2737
|
+
/* harmony export */ YE: function() { return /* binding */ SuccessStatus; },
|
|
2738
|
+
/* harmony export */ lC: function() { return /* binding */ CompletionStatus; }
|
|
2739
|
+
/* harmony export */ });
|
|
2740
|
+
/* unused harmony export NAVBoolean */
|
|
2741
|
+
var NAVBoolean;
|
|
2742
|
+
(function (NAVBoolean) {
|
|
2743
|
+
NAVBoolean["unknown"] = "unknown";
|
|
2744
|
+
NAVBoolean["true"] = "true";
|
|
2745
|
+
NAVBoolean["false"] = "false";
|
|
2746
|
+
})(NAVBoolean || (NAVBoolean = {}));
|
|
2747
|
+
var SuccessStatus;
|
|
2748
|
+
(function (SuccessStatus) {
|
|
2749
|
+
SuccessStatus["passed"] = "passed";
|
|
2750
|
+
SuccessStatus["failed"] = "failed";
|
|
2751
|
+
SuccessStatus["unknown"] = "unknown";
|
|
2752
|
+
})(SuccessStatus || (SuccessStatus = {}));
|
|
2753
|
+
var CompletionStatus;
|
|
2754
|
+
(function (CompletionStatus) {
|
|
2755
|
+
CompletionStatus["completed"] = "completed";
|
|
2756
|
+
CompletionStatus["incomplete"] = "incomplete";
|
|
2757
|
+
CompletionStatus["unknown"] = "unknown";
|
|
2758
|
+
})(CompletionStatus || (CompletionStatus = {}));
|
|
2759
|
+
|
|
2760
|
+
|
|
2761
|
+
/***/ }),
|
|
2762
|
+
|
|
2763
|
+
/***/ 797:
|
|
2764
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2765
|
+
|
|
2766
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
2767
|
+
|
|
2768
|
+
var global = {
|
|
2769
|
+
GENERAL: 101,
|
|
2770
|
+
INITIALIZATION_FAILED: 101,
|
|
2771
|
+
INITIALIZED: 101,
|
|
2772
|
+
TERMINATED: 101,
|
|
2773
|
+
TERMINATION_FAILURE: 101,
|
|
2774
|
+
TERMINATION_BEFORE_INIT: 101,
|
|
2775
|
+
MULTIPLE_TERMINATION: 101,
|
|
2776
|
+
RETRIEVE_BEFORE_INIT: 101,
|
|
2777
|
+
RETRIEVE_AFTER_TERM: 101,
|
|
2778
|
+
STORE_BEFORE_INIT: 101,
|
|
2779
|
+
STORE_AFTER_TERM: 101,
|
|
2780
|
+
COMMIT_BEFORE_INIT: 101,
|
|
2781
|
+
COMMIT_AFTER_TERM: 101,
|
|
2782
|
+
ARGUMENT_ERROR: 101,
|
|
2783
|
+
CHILDREN_ERROR: 101,
|
|
2784
|
+
COUNT_ERROR: 101,
|
|
2785
|
+
GENERAL_GET_FAILURE: 101,
|
|
2786
|
+
GENERAL_SET_FAILURE: 101,
|
|
2787
|
+
GENERAL_COMMIT_FAILURE: 101,
|
|
2788
|
+
UNDEFINED_DATA_MODEL: 101,
|
|
2789
|
+
UNIMPLEMENTED_ELEMENT: 101,
|
|
2790
|
+
VALUE_NOT_INITIALIZED: 101,
|
|
2791
|
+
INVALID_SET_VALUE: 101,
|
|
2792
|
+
READ_ONLY_ELEMENT: 101,
|
|
2793
|
+
WRITE_ONLY_ELEMENT: 101,
|
|
2794
|
+
TYPE_MISMATCH: 101,
|
|
2795
|
+
VALUE_OUT_OF_RANGE: 101,
|
|
2796
|
+
DEPENDENCY_NOT_ESTABLISHED: 101,
|
|
2797
|
+
};
|
|
2798
|
+
var scorm12 = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, global), { 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 });
|
|
2799
|
+
var scorm2004 = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, global), { 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 });
|
|
2800
|
+
var ErrorCodes = {
|
|
2801
|
+
scorm12: scorm12,
|
|
2802
|
+
scorm2004: scorm2004,
|
|
2803
|
+
};
|
|
2804
|
+
/* harmony default export */ __webpack_exports__.A = (ErrorCodes);
|
|
2805
|
+
|
|
2806
|
+
|
|
2807
|
+
/***/ }),
|
|
2808
|
+
|
|
2809
|
+
/***/ 417:
|
|
2810
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2811
|
+
|
|
2812
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
2813
|
+
|
|
2814
|
+
var scorm12 = {
|
|
2815
|
+
CMIString256: "^.{0,255}$",
|
|
2816
|
+
CMIString4096: "^.{0,4096}$",
|
|
2817
|
+
CMITime: "^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",
|
|
2818
|
+
CMITimespan: "^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$",
|
|
2819
|
+
CMIInteger: "^\\d+$",
|
|
2820
|
+
CMISInteger: "^-?([0-9]+)$",
|
|
2821
|
+
CMIDecimal: "^-?([0-9]{0,3})(.[0-9]*)?$",
|
|
2822
|
+
CMIIdentifier: "^[\\u0021-\\u007E\\s]{0,255}$",
|
|
2823
|
+
CMIFeedback: "^.{0,255}$",
|
|
2824
|
+
CMIIndex: "[._](\\d+).",
|
|
2825
|
+
CMIStatus: "^(passed|completed|failed|incomplete|browsed)$",
|
|
2826
|
+
CMIStatus2: "^(passed|completed|failed|incomplete|browsed|not attempted)$",
|
|
2827
|
+
CMIExit: "^(time-out|suspend|logout|)$",
|
|
2828
|
+
CMIType: "^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$",
|
|
2829
|
+
CMIResult: "^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$",
|
|
2830
|
+
NAVEvent: "^(previous|continue)$",
|
|
2831
|
+
score_range: "0#100",
|
|
2832
|
+
audio_range: "-1#100",
|
|
2833
|
+
speed_range: "-100#100",
|
|
2834
|
+
weighting_range: "-100#100",
|
|
2835
|
+
text_range: "-1#1",
|
|
2836
|
+
};
|
|
2837
|
+
var aicc = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, scorm12), {
|
|
2838
|
+
CMIIdentifier: "^\\w{1,255}$",
|
|
2839
|
+
});
|
|
2840
|
+
var scorm2004 = {
|
|
2841
|
+
CMIString200: "^[\\u0000-\\uFFFF]{0,200}$",
|
|
2842
|
+
CMIString250: "^[\\u0000-\\uFFFF]{0,250}$",
|
|
2843
|
+
CMIString1000: "^[\\u0000-\\uFFFF]{0,1000}$",
|
|
2844
|
+
CMIString4000: "^[\\u0000-\\uFFFF]{0,4000}$",
|
|
2845
|
+
CMIString64000: "^[\\u0000-\\uFFFF]{0,64000}$",
|
|
2846
|
+
CMILang: "^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",
|
|
2847
|
+
CMILangString250: "^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$",
|
|
2848
|
+
CMILangcr: "^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",
|
|
2849
|
+
CMILangString250cr: "^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$",
|
|
2850
|
+
CMILangString4000: "^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$",
|
|
2851
|
+
CMITime: "^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$",
|
|
2852
|
+
CMITimespan: "^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$",
|
|
2853
|
+
CMIInteger: "^\\d+$",
|
|
2854
|
+
CMISInteger: "^-?([0-9]+)$",
|
|
2855
|
+
CMIDecimal: "^-?([0-9]{1,5})(\\.[0-9]{1,18})?$",
|
|
2856
|
+
CMIIdentifier: "^\\S{1,250}[a-zA-Z0-9]$",
|
|
2857
|
+
CMIShortIdentifier: "^[\\w\\.\\-\\_]{1,250}$",
|
|
2858
|
+
CMILongIdentifier: "^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$",
|
|
2859
|
+
CMIFeedback: "^.*$",
|
|
2860
|
+
CMIIndex: "[._](\\d+).",
|
|
2861
|
+
CMIIndexStore: ".N(\\d+).",
|
|
2862
|
+
CMICStatus: "^(completed|incomplete|not attempted|unknown)$",
|
|
2863
|
+
CMISStatus: "^(passed|failed|unknown)$",
|
|
2864
|
+
CMIExit: "^(time-out|suspend|logout|normal)$",
|
|
2865
|
+
CMIType: "^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",
|
|
2866
|
+
CMIResult: "^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",
|
|
2867
|
+
NAVEvent: "^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$",
|
|
2868
|
+
NAVBoolean: "^(unknown|true|false$)",
|
|
2869
|
+
NAVTarget: "^{target=\\S{0,}[a-zA-Z0-9-_]+}$",
|
|
2870
|
+
scaled_range: "-1#1",
|
|
2871
|
+
audio_range: "0#*",
|
|
2872
|
+
speed_range: "0#*",
|
|
2873
|
+
text_range: "-1#1",
|
|
2874
|
+
progress_range: "0#1",
|
|
2875
|
+
};
|
|
2876
|
+
var Regex = {
|
|
2877
|
+
aicc: aicc,
|
|
2878
|
+
scorm12: scorm12,
|
|
2879
|
+
scorm2004: scorm2004,
|
|
2880
|
+
};
|
|
2881
|
+
/* harmony default export */ __webpack_exports__.A = (Regex);
|
|
2882
|
+
|
|
2883
|
+
|
|
2884
|
+
/***/ }),
|
|
2885
|
+
|
|
2886
|
+
/***/ 784:
|
|
2887
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2888
|
+
|
|
2889
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2890
|
+
/* harmony export */ $h: function() { return /* binding */ BaseScormValidationError; },
|
|
2891
|
+
/* harmony export */ gv: function() { return /* binding */ AICCValidationError; },
|
|
2892
|
+
/* harmony export */ tQ: function() { return /* binding */ Scorm12ValidationError; },
|
|
2893
|
+
/* harmony export */ yI: function() { return /* binding */ ValidationError; }
|
|
2894
|
+
/* harmony export */ });
|
|
2895
|
+
/* unused harmony export Scorm2004ValidationError */
|
|
2896
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(635);
|
|
2897
|
+
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340);
|
|
2898
|
+
|
|
2899
|
+
|
|
2900
|
+
var scorm12_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.error_descriptions;
|
|
2901
|
+
var aicc_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.aicc.error_descriptions;
|
|
2902
|
+
var scorm2004_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm2004.error_descriptions;
|
|
2903
|
+
var BaseScormValidationError = (function (_super) {
|
|
2904
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(BaseScormValidationError, _super);
|
|
2905
|
+
function BaseScormValidationError(errorCode) {
|
|
2906
|
+
var _this = _super.call(this, errorCode.toString()) || this;
|
|
2907
|
+
_this._errorCode = errorCode;
|
|
2908
|
+
_this.name = "ScormValidationError";
|
|
2909
|
+
return _this;
|
|
2910
|
+
}
|
|
2911
|
+
Object.defineProperty(BaseScormValidationError.prototype, "errorCode", {
|
|
2912
|
+
get: function () {
|
|
2913
|
+
return this._errorCode;
|
|
2914
|
+
},
|
|
2915
|
+
enumerable: false,
|
|
2916
|
+
configurable: true
|
|
2917
|
+
});
|
|
2918
|
+
BaseScormValidationError.prototype.setMessage = function (message) {
|
|
2919
|
+
this.message = message;
|
|
2920
|
+
};
|
|
2921
|
+
return BaseScormValidationError;
|
|
2922
|
+
}(Error));
|
|
2923
|
+
|
|
2924
|
+
var ValidationError = (function (_super) {
|
|
2925
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(ValidationError, _super);
|
|
2926
|
+
function ValidationError(errorCode, errorMessage, detailedMessage) {
|
|
2927
|
+
var _this = _super.call(this, errorCode) || this;
|
|
2928
|
+
_this._detailedMessage = "";
|
|
2929
|
+
_this.setMessage(errorMessage);
|
|
2930
|
+
_this._errorMessage = errorMessage;
|
|
2931
|
+
if (detailedMessage) {
|
|
2932
|
+
_this._detailedMessage = detailedMessage;
|
|
2933
|
+
}
|
|
2934
|
+
return _this;
|
|
2935
|
+
}
|
|
2936
|
+
Object.defineProperty(ValidationError.prototype, "errorMessage", {
|
|
2937
|
+
get: function () {
|
|
2938
|
+
return this._errorMessage;
|
|
2939
|
+
},
|
|
2940
|
+
enumerable: false,
|
|
2941
|
+
configurable: true
|
|
2942
|
+
});
|
|
2943
|
+
Object.defineProperty(ValidationError.prototype, "detailedMessage", {
|
|
2944
|
+
get: function () {
|
|
2945
|
+
return this._detailedMessage;
|
|
2946
|
+
},
|
|
2947
|
+
enumerable: false,
|
|
2948
|
+
configurable: true
|
|
2949
|
+
});
|
|
2950
|
+
return ValidationError;
|
|
2951
|
+
}(BaseScormValidationError));
|
|
2952
|
+
|
|
2953
|
+
var Scorm12ValidationError = (function (_super) {
|
|
2954
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(Scorm12ValidationError, _super);
|
|
2955
|
+
function Scorm12ValidationError(errorCode) {
|
|
2956
|
+
var _this = this;
|
|
2957
|
+
if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {
|
|
2958
|
+
_this = _super.call(this, errorCode, scorm12_errors[String(errorCode)].basicMessage, scorm12_errors[String(errorCode)].detailMessage) || this;
|
|
2959
|
+
}
|
|
2960
|
+
else {
|
|
2961
|
+
_this = _super.call(this, 101, scorm12_errors["101"].basicMessage, scorm12_errors["101"].detailMessage) || this;
|
|
2962
|
+
}
|
|
2963
|
+
return _this;
|
|
2964
|
+
}
|
|
2965
|
+
return Scorm12ValidationError;
|
|
2966
|
+
}(ValidationError));
|
|
2967
|
+
|
|
2968
|
+
var AICCValidationError = (function (_super) {
|
|
2969
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(AICCValidationError, _super);
|
|
2970
|
+
function AICCValidationError(errorCode) {
|
|
2971
|
+
var _this = this;
|
|
2972
|
+
if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {
|
|
2973
|
+
_this = _super.call(this, errorCode, aicc_errors[String(errorCode)].basicMessage, aicc_errors[String(errorCode)].detailMessage) || this;
|
|
2974
|
+
}
|
|
2975
|
+
else {
|
|
2976
|
+
_this = _super.call(this, 101, aicc_errors["101"].basicMessage, aicc_errors["101"].detailMessage) || this;
|
|
2977
|
+
}
|
|
2978
|
+
return _this;
|
|
2979
|
+
}
|
|
2980
|
+
return AICCValidationError;
|
|
2981
|
+
}(ValidationError));
|
|
2982
|
+
|
|
2983
|
+
var Scorm2004ValidationError = (function (_super) {
|
|
2984
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(Scorm2004ValidationError, _super);
|
|
2985
|
+
function Scorm2004ValidationError(errorCode) {
|
|
2986
|
+
var _this = this;
|
|
2987
|
+
if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {
|
|
2988
|
+
_this = _super.call(this, errorCode, scorm2004_errors[String(errorCode)].basicMessage, scorm2004_errors[String(errorCode)].detailMessage) || this;
|
|
2989
|
+
}
|
|
2990
|
+
else {
|
|
2991
|
+
_this = _super.call(this, 101, scorm2004_errors["101"].basicMessage, scorm2004_errors["101"].detailMessage) || this;
|
|
2992
|
+
}
|
|
2993
|
+
return _this;
|
|
2994
|
+
}
|
|
2995
|
+
return Scorm2004ValidationError;
|
|
2996
|
+
}(ValidationError));
|
|
2997
|
+
|
|
2998
|
+
|
|
2999
|
+
|
|
3000
|
+
/***/ }),
|
|
3001
|
+
|
|
3002
|
+
/***/ 864:
|
|
3003
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
3004
|
+
|
|
3005
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3006
|
+
/* harmony export */ Bq: function() { return /* binding */ flatten; },
|
|
3007
|
+
/* harmony export */ HT: function() { return /* binding */ addHHMMSSTimeStrings; },
|
|
3008
|
+
/* harmony export */ J6: function() { return /* binding */ stringMatches; },
|
|
3009
|
+
/* harmony export */ UZ: function() { return /* binding */ getSecondsAsHHMMSS; },
|
|
3010
|
+
/* harmony export */ f4: function() { return /* binding */ getTimeAsSeconds; },
|
|
3011
|
+
/* harmony export */ hw: function() { return /* binding */ formatMessage; },
|
|
3012
|
+
/* harmony export */ sB: function() { return /* binding */ unflatten; }
|
|
3013
|
+
/* harmony export */ });
|
|
3014
|
+
/* unused harmony exports SECONDS_PER_SECOND, SECONDS_PER_MINUTE, SECONDS_PER_HOUR, SECONDS_PER_DAY, getSecondsAsISODuration, getDurationAsSeconds, addTwoDurations, countDecimals */
|
|
3015
|
+
var SECONDS_PER_SECOND = 1.0;
|
|
3016
|
+
var SECONDS_PER_MINUTE = 60;
|
|
3017
|
+
var SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;
|
|
3018
|
+
var SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;
|
|
3019
|
+
var designations = {
|
|
3020
|
+
D: SECONDS_PER_DAY,
|
|
3021
|
+
H: SECONDS_PER_HOUR,
|
|
3022
|
+
M: SECONDS_PER_MINUTE,
|
|
3023
|
+
S: SECONDS_PER_SECOND,
|
|
3024
|
+
};
|
|
3025
|
+
function getSecondsAsHHMMSS(totalSeconds) {
|
|
3026
|
+
if (!totalSeconds || totalSeconds <= 0) {
|
|
3027
|
+
return "00:00:00";
|
|
3028
|
+
}
|
|
3029
|
+
var hours = Math.floor(totalSeconds / SECONDS_PER_HOUR);
|
|
3030
|
+
var dateObj = new Date(totalSeconds * 1000);
|
|
3031
|
+
var minutes = dateObj.getUTCMinutes();
|
|
3032
|
+
var seconds = dateObj.getSeconds();
|
|
3033
|
+
var ms = totalSeconds % 1.0;
|
|
3034
|
+
var msStr = "";
|
|
3035
|
+
if (countDecimals(ms) > 0) {
|
|
3036
|
+
if (countDecimals(ms) > 2) {
|
|
3037
|
+
msStr = ms.toFixed(2);
|
|
3038
|
+
}
|
|
3039
|
+
else {
|
|
3040
|
+
msStr = String(ms);
|
|
3041
|
+
}
|
|
3042
|
+
msStr = "." + msStr.split(".")[1];
|
|
3043
|
+
}
|
|
3044
|
+
return ((hours + ":" + minutes + ":" + seconds).replace(/\b\d\b/g, "0$&") + msStr);
|
|
3045
|
+
}
|
|
3046
|
+
function getSecondsAsISODuration(seconds) {
|
|
3047
|
+
if (!seconds || seconds <= 0) {
|
|
3048
|
+
return "PT0S";
|
|
3049
|
+
}
|
|
3050
|
+
var duration = "P";
|
|
3051
|
+
var remainder = seconds;
|
|
3052
|
+
for (var designationsKey in designations) {
|
|
3053
|
+
var current_seconds = designations[designationsKey];
|
|
3054
|
+
var value = Math.floor(remainder / current_seconds);
|
|
3055
|
+
remainder = remainder % current_seconds;
|
|
3056
|
+
if (countDecimals(remainder) > 2) {
|
|
3057
|
+
remainder = Number(Number(remainder).toFixed(2));
|
|
3058
|
+
}
|
|
3059
|
+
if (designationsKey === "S" && remainder > 0) {
|
|
3060
|
+
value += remainder;
|
|
3061
|
+
}
|
|
3062
|
+
if (value) {
|
|
3063
|
+
if ((duration.indexOf("D") > 0 ||
|
|
3064
|
+
designationsKey === "H" ||
|
|
3065
|
+
designationsKey === "M" ||
|
|
3066
|
+
designationsKey === "S") &&
|
|
3067
|
+
duration.indexOf("T") === -1) {
|
|
3068
|
+
duration += "T";
|
|
3069
|
+
}
|
|
3070
|
+
duration += "".concat(value).concat(designationsKey);
|
|
3071
|
+
}
|
|
3072
|
+
}
|
|
3073
|
+
return duration;
|
|
3074
|
+
}
|
|
3075
|
+
function getTimeAsSeconds(timeString, timeRegex) {
|
|
3076
|
+
if (typeof timeString === "number" || typeof timeString === "boolean") {
|
|
3077
|
+
timeString = String(timeString);
|
|
3078
|
+
}
|
|
3079
|
+
if (typeof timeRegex === "string") {
|
|
3080
|
+
timeRegex = new RegExp(timeRegex);
|
|
3081
|
+
}
|
|
3082
|
+
if (!timeString || !timeString.match(timeRegex)) {
|
|
3083
|
+
return 0;
|
|
3084
|
+
}
|
|
3085
|
+
var parts = timeString.split(":");
|
|
3086
|
+
var hours = Number(parts[0]);
|
|
3087
|
+
var minutes = Number(parts[1]);
|
|
3088
|
+
var seconds = Number(parts[2]);
|
|
3089
|
+
return hours * 3600 + minutes * 60 + seconds;
|
|
3090
|
+
}
|
|
3091
|
+
function getDurationAsSeconds(duration, durationRegex) {
|
|
3092
|
+
if (typeof durationRegex === "string") {
|
|
3093
|
+
durationRegex = new RegExp(durationRegex);
|
|
3094
|
+
}
|
|
3095
|
+
if (!duration || !duration.match(durationRegex)) {
|
|
3096
|
+
return 0;
|
|
3097
|
+
}
|
|
3098
|
+
var _a = new RegExp(durationRegex).exec(duration) || [], years = _a[1], _ = _a[2], days = _a[4], hours = _a[5], minutes = _a[6], seconds = _a[7];
|
|
3099
|
+
var result = 0.0;
|
|
3100
|
+
result += Number(seconds) || 0.0;
|
|
3101
|
+
result += Number(minutes) * 60.0 || 0.0;
|
|
3102
|
+
result += Number(hours) * 3600.0 || 0.0;
|
|
3103
|
+
result += Number(days) * (60 * 60 * 24.0) || 0.0;
|
|
3104
|
+
result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0;
|
|
3105
|
+
return result;
|
|
3106
|
+
}
|
|
3107
|
+
function addTwoDurations(first, second, durationRegex) {
|
|
3108
|
+
var regex = typeof durationRegex === "string"
|
|
3109
|
+
? new RegExp(durationRegex)
|
|
3110
|
+
: durationRegex;
|
|
3111
|
+
return getSecondsAsISODuration(getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex));
|
|
3112
|
+
}
|
|
3113
|
+
function addHHMMSSTimeStrings(first, second, timeRegex) {
|
|
3114
|
+
if (typeof timeRegex === "string") {
|
|
3115
|
+
timeRegex = new RegExp(timeRegex);
|
|
3116
|
+
}
|
|
3117
|
+
return getSecondsAsHHMMSS(getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex));
|
|
3118
|
+
}
|
|
3119
|
+
function flatten(data) {
|
|
3120
|
+
var result = {};
|
|
3121
|
+
function recurse(cur, prop) {
|
|
3122
|
+
if (Object(cur) !== cur) {
|
|
3123
|
+
result[prop] = cur;
|
|
3124
|
+
}
|
|
3125
|
+
else if (Array.isArray(cur)) {
|
|
3126
|
+
for (var i = 0, l = cur.length; i < l; i++) {
|
|
3127
|
+
recurse(cur[i], prop + "[" + i + "]");
|
|
3128
|
+
if (l === 0)
|
|
3129
|
+
result[prop] = [];
|
|
3130
|
+
}
|
|
3131
|
+
}
|
|
3132
|
+
else {
|
|
3133
|
+
var isEmpty = true;
|
|
3134
|
+
for (var p in cur) {
|
|
3135
|
+
if ({}.hasOwnProperty.call(cur, p)) {
|
|
3136
|
+
isEmpty = false;
|
|
3137
|
+
recurse(cur[p], prop ? prop + "." + p : p);
|
|
3138
|
+
}
|
|
3139
|
+
}
|
|
3140
|
+
if (isEmpty && prop)
|
|
3141
|
+
result[prop] = {};
|
|
3142
|
+
}
|
|
3143
|
+
}
|
|
3144
|
+
recurse(data, "");
|
|
3145
|
+
return result;
|
|
3146
|
+
}
|
|
3147
|
+
function unflatten(data) {
|
|
3148
|
+
"use strict";
|
|
3149
|
+
if (Object(data) !== data || Array.isArray(data))
|
|
3150
|
+
return data;
|
|
3151
|
+
var regex = /\.?([^.[\]]+)|\[(\d+)]/g;
|
|
3152
|
+
var result = {};
|
|
3153
|
+
for (var p in data) {
|
|
3154
|
+
if ({}.hasOwnProperty.call(data, p)) {
|
|
3155
|
+
var cur = result;
|
|
3156
|
+
var prop = "";
|
|
3157
|
+
var m = regex.exec(p);
|
|
3158
|
+
while (m) {
|
|
3159
|
+
cur = cur[prop] || (cur[prop] = m[2] ? [] : {});
|
|
3160
|
+
prop = m[2] || m[1];
|
|
3161
|
+
m = regex.exec(p);
|
|
3162
|
+
}
|
|
3163
|
+
cur[prop] = data[p];
|
|
3164
|
+
}
|
|
3165
|
+
}
|
|
3166
|
+
return result[""] || result;
|
|
3167
|
+
}
|
|
3168
|
+
function countDecimals(num) {
|
|
3169
|
+
if (Math.floor(num) === num || String(num).indexOf(".") < 0)
|
|
3170
|
+
return 0;
|
|
3171
|
+
var parts = num.toString().split(".")[1];
|
|
3172
|
+
return parts.length || 0;
|
|
3173
|
+
}
|
|
3174
|
+
function formatMessage(functionName, message, CMIElement) {
|
|
3175
|
+
var baseLength = 20;
|
|
3176
|
+
var messageString = "";
|
|
3177
|
+
messageString += functionName;
|
|
3178
|
+
var fillChars = baseLength - messageString.length;
|
|
3179
|
+
for (var i = 0; i < fillChars; i++) {
|
|
3180
|
+
messageString += " ";
|
|
3181
|
+
}
|
|
3182
|
+
messageString += ": ";
|
|
3183
|
+
if (CMIElement) {
|
|
3184
|
+
var CMIElementBaseLength = 70;
|
|
3185
|
+
messageString += CMIElement;
|
|
3186
|
+
fillChars = CMIElementBaseLength - messageString.length;
|
|
3187
|
+
for (var j = 0; j < fillChars; j++) {
|
|
3188
|
+
messageString += " ";
|
|
3189
|
+
}
|
|
3190
|
+
}
|
|
3191
|
+
if (message) {
|
|
3192
|
+
messageString += message;
|
|
3193
|
+
}
|
|
3194
|
+
return messageString;
|
|
3195
|
+
}
|
|
3196
|
+
function stringMatches(str, tester) {
|
|
3197
|
+
return (str === null || str === void 0 ? void 0 : str.match(tester)) !== null;
|
|
3198
|
+
}
|
|
3199
|
+
|
|
3200
|
+
|
|
3201
|
+
/***/ }),
|
|
3202
|
+
|
|
3203
|
+
/***/ 635:
|
|
3204
|
+
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
3205
|
+
|
|
3206
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3207
|
+
/* harmony export */ C6: function() { return /* binding */ __extends; },
|
|
3208
|
+
/* harmony export */ Cl: function() { return /* binding */ __assign; },
|
|
3209
|
+
/* harmony export */ YH: function() { return /* binding */ __generator; },
|
|
3210
|
+
/* harmony export */ sH: function() { return /* binding */ __awaiter; }
|
|
3211
|
+
/* harmony export */ });
|
|
3212
|
+
/* 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 */
|
|
3213
|
+
/******************************************************************************
|
|
3214
|
+
Copyright (c) Microsoft Corporation.
|
|
3215
|
+
|
|
3216
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
3217
|
+
purpose with or without fee is hereby granted.
|
|
3218
|
+
|
|
3219
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
3220
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
3221
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
3222
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
3223
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
3224
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
3225
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
3226
|
+
***************************************************************************** */
|
|
3227
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
3228
|
+
|
|
3229
|
+
var extendStatics = function(d, b) {
|
|
3230
|
+
extendStatics = Object.setPrototypeOf ||
|
|
3231
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
3232
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
3233
|
+
return extendStatics(d, b);
|
|
3234
|
+
};
|
|
3235
|
+
|
|
3236
|
+
function __extends(d, b) {
|
|
3237
|
+
if (typeof b !== "function" && b !== null)
|
|
3238
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
3239
|
+
extendStatics(d, b);
|
|
3240
|
+
function __() { this.constructor = d; }
|
|
3241
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
3242
|
+
}
|
|
3243
|
+
|
|
3244
|
+
var __assign = function() {
|
|
3245
|
+
__assign = Object.assign || function __assign(t) {
|
|
3246
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
3247
|
+
s = arguments[i];
|
|
3248
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
3249
|
+
}
|
|
3250
|
+
return t;
|
|
3251
|
+
}
|
|
3252
|
+
return __assign.apply(this, arguments);
|
|
3253
|
+
}
|
|
3254
|
+
|
|
3255
|
+
function __rest(s, e) {
|
|
3256
|
+
var t = {};
|
|
3257
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3258
|
+
t[p] = s[p];
|
|
3259
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
3260
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
3261
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
3262
|
+
t[p[i]] = s[p[i]];
|
|
3263
|
+
}
|
|
3264
|
+
return t;
|
|
3265
|
+
}
|
|
3266
|
+
|
|
3267
|
+
function __decorate(decorators, target, key, desc) {
|
|
3268
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3269
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
3270
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3271
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3272
|
+
}
|
|
3273
|
+
|
|
3274
|
+
function __param(paramIndex, decorator) {
|
|
3275
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
3276
|
+
}
|
|
3277
|
+
|
|
3278
|
+
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
3279
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3280
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
3281
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
3282
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
3283
|
+
var _, done = false;
|
|
3284
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
3285
|
+
var context = {};
|
|
3286
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
3287
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
3288
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
3289
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
3290
|
+
if (kind === "accessor") {
|
|
3291
|
+
if (result === void 0) continue;
|
|
3292
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
3293
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
3294
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
3295
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
3296
|
+
}
|
|
3297
|
+
else if (_ = accept(result)) {
|
|
3298
|
+
if (kind === "field") initializers.unshift(_);
|
|
3299
|
+
else descriptor[key] = _;
|
|
3300
|
+
}
|
|
3301
|
+
}
|
|
3302
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
3303
|
+
done = true;
|
|
3304
|
+
};
|
|
3305
|
+
|
|
3306
|
+
function __runInitializers(thisArg, initializers, value) {
|
|
3307
|
+
var useValue = arguments.length > 2;
|
|
3308
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
3309
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
3310
|
+
}
|
|
3311
|
+
return useValue ? value : void 0;
|
|
3312
|
+
};
|
|
3313
|
+
|
|
3314
|
+
function __propKey(x) {
|
|
3315
|
+
return typeof x === "symbol" ? x : "".concat(x);
|
|
3316
|
+
};
|
|
3317
|
+
|
|
3318
|
+
function __setFunctionName(f, name, prefix) {
|
|
3319
|
+
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
3320
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
3321
|
+
};
|
|
3322
|
+
|
|
3323
|
+
function __metadata(metadataKey, metadataValue) {
|
|
3324
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
3325
|
+
}
|
|
3326
|
+
|
|
3327
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
3328
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3329
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
3330
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
3331
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
3332
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
3333
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
3334
|
+
});
|
|
3335
|
+
}
|
|
3336
|
+
|
|
3337
|
+
function __generator(thisArg, body) {
|
|
3338
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
3339
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
3340
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
3341
|
+
function step(op) {
|
|
3342
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
3343
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
3344
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
3345
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
3346
|
+
switch (op[0]) {
|
|
3347
|
+
case 0: case 1: t = op; break;
|
|
3348
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
3349
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
3350
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
3351
|
+
default:
|
|
3352
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
3353
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
3354
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
3355
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
3356
|
+
if (t[2]) _.ops.pop();
|
|
3357
|
+
_.trys.pop(); continue;
|
|
3358
|
+
}
|
|
3359
|
+
op = body.call(thisArg, _);
|
|
3360
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
3361
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
3362
|
+
}
|
|
3363
|
+
}
|
|
3364
|
+
|
|
3365
|
+
var __createBinding = Object.create ? (function(o, m, k, k2) {
|
|
3366
|
+
if (k2 === undefined) k2 = k;
|
|
3367
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3368
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
3369
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
3370
|
+
}
|
|
3371
|
+
Object.defineProperty(o, k2, desc);
|
|
3372
|
+
}) : (function(o, m, k, k2) {
|
|
3373
|
+
if (k2 === undefined) k2 = k;
|
|
3374
|
+
o[k2] = m[k];
|
|
3375
|
+
});
|
|
3376
|
+
|
|
3377
|
+
function __exportStar(m, o) {
|
|
3378
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
|
|
3379
|
+
}
|
|
3380
|
+
|
|
3381
|
+
function __values(o) {
|
|
3382
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
3383
|
+
if (m) return m.call(o);
|
|
3384
|
+
if (o && typeof o.length === "number") return {
|
|
3385
|
+
next: function () {
|
|
3386
|
+
if (o && i >= o.length) o = void 0;
|
|
3387
|
+
return { value: o && o[i++], done: !o };
|
|
3388
|
+
}
|
|
3389
|
+
};
|
|
3390
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
3391
|
+
}
|
|
3392
|
+
|
|
3393
|
+
function __read(o, n) {
|
|
3394
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
3395
|
+
if (!m) return o;
|
|
3396
|
+
var i = m.call(o), r, ar = [], e;
|
|
3397
|
+
try {
|
|
3398
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
3399
|
+
}
|
|
3400
|
+
catch (error) { e = { error: error }; }
|
|
3401
|
+
finally {
|
|
3402
|
+
try {
|
|
3403
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
3404
|
+
}
|
|
3405
|
+
finally { if (e) throw e.error; }
|
|
3406
|
+
}
|
|
3407
|
+
return ar;
|
|
3408
|
+
}
|
|
3409
|
+
|
|
3410
|
+
/** @deprecated */
|
|
3411
|
+
function __spread() {
|
|
3412
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
3413
|
+
ar = ar.concat(__read(arguments[i]));
|
|
3414
|
+
return ar;
|
|
3415
|
+
}
|
|
3416
|
+
|
|
3417
|
+
/** @deprecated */
|
|
3418
|
+
function __spreadArrays() {
|
|
3419
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
3420
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
3421
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
3422
|
+
r[k] = a[j];
|
|
3423
|
+
return r;
|
|
3424
|
+
}
|
|
3425
|
+
|
|
3426
|
+
function __spreadArray(to, from, pack) {
|
|
3427
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3428
|
+
if (ar || !(i in from)) {
|
|
3429
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
3430
|
+
ar[i] = from[i];
|
|
3431
|
+
}
|
|
3432
|
+
}
|
|
3433
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
3434
|
+
}
|
|
3435
|
+
|
|
3436
|
+
function __await(v) {
|
|
3437
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
3438
|
+
}
|
|
3439
|
+
|
|
3440
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
3441
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
3442
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
3443
|
+
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
3444
|
+
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
|
|
3445
|
+
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
|
|
3446
|
+
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
3447
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
3448
|
+
function fulfill(value) { resume("next", value); }
|
|
3449
|
+
function reject(value) { resume("throw", value); }
|
|
3450
|
+
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
3451
|
+
}
|
|
3452
|
+
|
|
3453
|
+
function __asyncDelegator(o) {
|
|
3454
|
+
var i, p;
|
|
3455
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
3456
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
|
|
3457
|
+
}
|
|
3458
|
+
|
|
3459
|
+
function __asyncValues(o) {
|
|
3460
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
3461
|
+
var m = o[Symbol.asyncIterator], i;
|
|
3462
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
3463
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
3464
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
3465
|
+
}
|
|
3466
|
+
|
|
3467
|
+
function __makeTemplateObject(cooked, raw) {
|
|
3468
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3469
|
+
return cooked;
|
|
3470
|
+
};
|
|
3471
|
+
|
|
3472
|
+
var __setModuleDefault = Object.create ? (function(o, v) {
|
|
3473
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
3474
|
+
}) : function(o, v) {
|
|
3475
|
+
o["default"] = v;
|
|
3476
|
+
};
|
|
3477
|
+
|
|
3478
|
+
function __importStar(mod) {
|
|
3479
|
+
if (mod && mod.__esModule) return mod;
|
|
3480
|
+
var result = {};
|
|
3481
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
3482
|
+
__setModuleDefault(result, mod);
|
|
3483
|
+
return result;
|
|
3484
|
+
}
|
|
3485
|
+
|
|
3486
|
+
function __importDefault(mod) {
|
|
3487
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
3488
|
+
}
|
|
3489
|
+
|
|
3490
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
3491
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3492
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
3493
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
3494
|
+
}
|
|
3495
|
+
|
|
3496
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
3497
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3498
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
3499
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
3500
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
3501
|
+
}
|
|
3502
|
+
|
|
3503
|
+
function __classPrivateFieldIn(state, receiver) {
|
|
3504
|
+
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
|
|
3505
|
+
return typeof state === "function" ? receiver === state : state.has(receiver);
|
|
3506
|
+
}
|
|
3507
|
+
|
|
3508
|
+
function __addDisposableResource(env, value, async) {
|
|
3509
|
+
if (value !== null && value !== void 0) {
|
|
3510
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
3511
|
+
var dispose, inner;
|
|
3512
|
+
if (async) {
|
|
3513
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
3514
|
+
dispose = value[Symbol.asyncDispose];
|
|
3515
|
+
}
|
|
3516
|
+
if (dispose === void 0) {
|
|
3517
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
3518
|
+
dispose = value[Symbol.dispose];
|
|
3519
|
+
if (async) inner = dispose;
|
|
3520
|
+
}
|
|
3521
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
3522
|
+
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
3523
|
+
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
3524
|
+
}
|
|
3525
|
+
else if (async) {
|
|
3526
|
+
env.stack.push({ async: true });
|
|
3527
|
+
}
|
|
3528
|
+
return value;
|
|
3529
|
+
}
|
|
3530
|
+
|
|
3531
|
+
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
3532
|
+
var e = new Error(message);
|
|
3533
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
3534
|
+
};
|
|
3535
|
+
|
|
3536
|
+
function __disposeResources(env) {
|
|
3537
|
+
function fail(e) {
|
|
3538
|
+
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
3539
|
+
env.hasError = true;
|
|
3540
|
+
}
|
|
3541
|
+
var r, s = 0;
|
|
3542
|
+
function next() {
|
|
3543
|
+
while (r = env.stack.pop()) {
|
|
3544
|
+
try {
|
|
3545
|
+
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
3546
|
+
if (r.dispose) {
|
|
3547
|
+
var result = r.dispose.call(r.value);
|
|
3548
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
3549
|
+
}
|
|
3550
|
+
else s |= 1;
|
|
3551
|
+
}
|
|
3552
|
+
catch (e) {
|
|
3553
|
+
fail(e);
|
|
3554
|
+
}
|
|
3555
|
+
}
|
|
3556
|
+
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
3557
|
+
if (env.hasError) throw env.error;
|
|
3558
|
+
}
|
|
3559
|
+
return next();
|
|
3560
|
+
}
|
|
3561
|
+
|
|
3562
|
+
/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ({
|
|
3563
|
+
__extends,
|
|
3564
|
+
__assign,
|
|
3565
|
+
__rest,
|
|
3566
|
+
__decorate,
|
|
3567
|
+
__param,
|
|
3568
|
+
__metadata,
|
|
3569
|
+
__awaiter,
|
|
3570
|
+
__generator,
|
|
3571
|
+
__createBinding,
|
|
3572
|
+
__exportStar,
|
|
3573
|
+
__values,
|
|
3574
|
+
__read,
|
|
3575
|
+
__spread,
|
|
3576
|
+
__spreadArrays,
|
|
3577
|
+
__spreadArray,
|
|
3578
|
+
__await,
|
|
3579
|
+
__asyncGenerator,
|
|
3580
|
+
__asyncDelegator,
|
|
3581
|
+
__asyncValues,
|
|
3582
|
+
__makeTemplateObject,
|
|
3583
|
+
__importStar,
|
|
3584
|
+
__importDefault,
|
|
3585
|
+
__classPrivateFieldGet,
|
|
3586
|
+
__classPrivateFieldSet,
|
|
3587
|
+
__classPrivateFieldIn,
|
|
3588
|
+
__addDisposableResource,
|
|
3589
|
+
__disposeResources,
|
|
3590
|
+
});
|
|
3591
|
+
|
|
3592
|
+
|
|
3593
|
+
/***/ })
|
|
3594
|
+
|
|
3595
|
+
/******/ });
|
|
3596
|
+
/************************************************************************/
|
|
3597
|
+
/******/ // The module cache
|
|
3598
|
+
/******/ var __webpack_module_cache__ = {};
|
|
3599
|
+
/******/
|
|
3600
|
+
/******/ // The require function
|
|
3601
|
+
/******/ function __webpack_require__(moduleId) {
|
|
3602
|
+
/******/ // Check if module is in cache
|
|
3603
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
3604
|
+
/******/ if (cachedModule !== undefined) {
|
|
3605
|
+
/******/ return cachedModule.exports;
|
|
3606
|
+
/******/ }
|
|
3607
|
+
/******/ // Create a new module (and put it into the cache)
|
|
3608
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
3609
|
+
/******/ // no module.id needed
|
|
3610
|
+
/******/ // no module.loaded needed
|
|
3611
|
+
/******/ exports: {}
|
|
3612
|
+
/******/ };
|
|
3613
|
+
/******/
|
|
3614
|
+
/******/ // Execute the module function
|
|
3615
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
3616
|
+
/******/
|
|
3617
|
+
/******/ // Return the exports of the module
|
|
3618
|
+
/******/ return module.exports;
|
|
3619
|
+
/******/ }
|
|
3620
|
+
/******/
|
|
3621
|
+
/************************************************************************/
|
|
3622
|
+
/******/ /* webpack/runtime/define property getters */
|
|
3623
|
+
/******/ !function() {
|
|
3624
|
+
/******/ // define getter functions for harmony exports
|
|
3625
|
+
/******/ __webpack_require__.d = function(exports, definition) {
|
|
3626
|
+
/******/ for(var key in definition) {
|
|
3627
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
3628
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
3629
|
+
/******/ }
|
|
3630
|
+
/******/ }
|
|
3631
|
+
/******/ };
|
|
3632
|
+
/******/ }();
|
|
3633
|
+
/******/
|
|
3634
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
3635
|
+
/******/ !function() {
|
|
3636
|
+
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
|
|
3637
|
+
/******/ }();
|
|
3638
|
+
/******/
|
|
3639
|
+
/************************************************************************/
|
|
3640
|
+
var __webpack_exports__ = {};
|
|
3641
|
+
|
|
3642
|
+
// EXPORTS
|
|
3643
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
3644
|
+
X: function() { return /* binding */ AICCImpl; }
|
|
3645
|
+
});
|
|
3646
|
+
|
|
3647
|
+
// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs
|
|
3648
|
+
var tslib_es6 = __webpack_require__(635);
|
|
3649
|
+
// EXTERNAL MODULE: ./src/Scorm12API.ts
|
|
3650
|
+
var Scorm12API = __webpack_require__(941);
|
|
3651
|
+
// EXTERNAL MODULE: ./src/cmi/scorm12/cmi.ts + 1 modules
|
|
3652
|
+
var cmi = __webpack_require__(989);
|
|
3653
|
+
// EXTERNAL MODULE: ./src/constants/api_constants.ts
|
|
3654
|
+
var api_constants = __webpack_require__(340);
|
|
3655
|
+
// EXTERNAL MODULE: ./src/cmi/common/array.ts
|
|
3656
|
+
var array = __webpack_require__(589);
|
|
3657
|
+
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
3658
|
+
var exceptions = __webpack_require__(784);
|
|
3659
|
+
// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts
|
|
3660
|
+
var base_cmi = __webpack_require__(319);
|
|
3661
|
+
// EXTERNAL MODULE: ./src/constants/error_codes.ts
|
|
3662
|
+
var error_codes = __webpack_require__(797);
|
|
3663
|
+
// EXTERNAL MODULE: ./src/cmi/common/validation.ts
|
|
3664
|
+
var validation = __webpack_require__(449);
|
|
3665
|
+
;// ./src/cmi/aicc/validation.ts
|
|
3666
|
+
|
|
3667
|
+
|
|
3668
|
+
|
|
3669
|
+
var aicc_error_codes = error_codes/* default */.A.scorm12;
|
|
3670
|
+
function checkAICCValidFormat(value, regexPattern, allowEmptyString) {
|
|
3671
|
+
return (0,validation/* checkValidFormat */.q)(value, regexPattern, aicc_error_codes.TYPE_MISMATCH, exceptions/* AICCValidationError */.gv, allowEmptyString);
|
|
3672
|
+
}
|
|
3673
|
+
|
|
3674
|
+
// EXTERNAL MODULE: ./src/constants/regex.ts
|
|
3675
|
+
var regex = __webpack_require__(417);
|
|
3676
|
+
;// ./src/cmi/aicc/evaluation.ts
|
|
3677
|
+
|
|
3678
|
+
|
|
3679
|
+
|
|
3680
|
+
|
|
3681
|
+
|
|
3682
|
+
|
|
3683
|
+
|
|
3684
|
+
|
|
3685
|
+
var CMIEvaluation = (function (_super) {
|
|
3686
|
+
(0,tslib_es6/* __extends */.C6)(CMIEvaluation, _super);
|
|
3687
|
+
function CMIEvaluation() {
|
|
3688
|
+
var _this = _super.call(this) || this;
|
|
3689
|
+
_this.comments = new CMIEvaluationComments();
|
|
3690
|
+
return _this;
|
|
3691
|
+
}
|
|
3692
|
+
CMIEvaluation.prototype.initialize = function () {
|
|
3693
|
+
var _a;
|
|
3694
|
+
_super.prototype.initialize.call(this);
|
|
3695
|
+
(_a = this.comments) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
3696
|
+
};
|
|
3697
|
+
CMIEvaluation.prototype.toJSON = function () {
|
|
3698
|
+
this.jsonString = true;
|
|
3699
|
+
var result = {
|
|
3700
|
+
comments: this.comments,
|
|
3701
|
+
};
|
|
3702
|
+
delete this.jsonString;
|
|
3703
|
+
return result;
|
|
3704
|
+
};
|
|
3705
|
+
return CMIEvaluation;
|
|
3706
|
+
}(base_cmi/* BaseCMI */.J));
|
|
3707
|
+
|
|
3708
|
+
var CMIEvaluationComments = (function (_super) {
|
|
3709
|
+
(0,tslib_es6/* __extends */.C6)(CMIEvaluationComments, _super);
|
|
3710
|
+
function CMIEvaluationComments() {
|
|
3711
|
+
return _super.call(this, {
|
|
3712
|
+
children: api_constants/* default */.A.aicc.comments_children,
|
|
3713
|
+
errorCode: error_codes/* default */.A.scorm12.INVALID_SET_VALUE,
|
|
3714
|
+
errorClass: exceptions/* AICCValidationError */.gv,
|
|
3715
|
+
}) || this;
|
|
3716
|
+
}
|
|
3717
|
+
return CMIEvaluationComments;
|
|
3718
|
+
}(array/* CMIArray */.B));
|
|
3719
|
+
var CMIEvaluationCommentsObject = (function (_super) {
|
|
3720
|
+
(0,tslib_es6/* __extends */.C6)(CMIEvaluationCommentsObject, _super);
|
|
3721
|
+
function CMIEvaluationCommentsObject() {
|
|
3722
|
+
var _this = _super.call(this) || this;
|
|
3723
|
+
_this._content = "";
|
|
3724
|
+
_this._location = "";
|
|
3725
|
+
_this._time = "";
|
|
3726
|
+
return _this;
|
|
3727
|
+
}
|
|
3728
|
+
Object.defineProperty(CMIEvaluationCommentsObject.prototype, "content", {
|
|
3729
|
+
get: function () {
|
|
3730
|
+
return this._content;
|
|
3731
|
+
},
|
|
3732
|
+
set: function (content) {
|
|
3733
|
+
if (checkAICCValidFormat(content, regex/* default */.A.aicc.CMIString256)) {
|
|
3734
|
+
this._content = content;
|
|
3735
|
+
}
|
|
3736
|
+
},
|
|
3737
|
+
enumerable: false,
|
|
3738
|
+
configurable: true
|
|
3739
|
+
});
|
|
3740
|
+
Object.defineProperty(CMIEvaluationCommentsObject.prototype, "location", {
|
|
3741
|
+
get: function () {
|
|
3742
|
+
return this._location;
|
|
3743
|
+
},
|
|
3744
|
+
set: function (location) {
|
|
3745
|
+
if (checkAICCValidFormat(location, regex/* default */.A.aicc.CMIString256)) {
|
|
3746
|
+
this._location = location;
|
|
3747
|
+
}
|
|
3748
|
+
},
|
|
3749
|
+
enumerable: false,
|
|
3750
|
+
configurable: true
|
|
3751
|
+
});
|
|
3752
|
+
Object.defineProperty(CMIEvaluationCommentsObject.prototype, "time", {
|
|
3753
|
+
get: function () {
|
|
3754
|
+
return this._time;
|
|
3755
|
+
},
|
|
3756
|
+
set: function (time) {
|
|
3757
|
+
if (checkAICCValidFormat(time, regex/* default */.A.aicc.CMITime)) {
|
|
3758
|
+
this._time = time;
|
|
3759
|
+
}
|
|
3760
|
+
},
|
|
3761
|
+
enumerable: false,
|
|
3762
|
+
configurable: true
|
|
3763
|
+
});
|
|
3764
|
+
CMIEvaluationCommentsObject.prototype.toJSON = function () {
|
|
3765
|
+
this.jsonString = true;
|
|
3766
|
+
var result = {
|
|
3767
|
+
content: this.content,
|
|
3768
|
+
location: this.location,
|
|
3769
|
+
time: this.time,
|
|
3770
|
+
};
|
|
3771
|
+
delete this.jsonString;
|
|
3772
|
+
return result;
|
|
3773
|
+
};
|
|
3774
|
+
return CMIEvaluationCommentsObject;
|
|
3775
|
+
}(base_cmi/* BaseCMI */.J));
|
|
3776
|
+
|
|
3777
|
+
|
|
3778
|
+
// EXTERNAL MODULE: ./src/cmi/scorm12/student_preference.ts
|
|
3779
|
+
var student_preference = __webpack_require__(181);
|
|
3780
|
+
;// ./src/cmi/aicc/student_preferences.ts
|
|
3781
|
+
|
|
3782
|
+
|
|
3783
|
+
|
|
3784
|
+
|
|
3785
|
+
|
|
3786
|
+
|
|
3787
|
+
|
|
3788
|
+
|
|
3789
|
+
var AICCStudentPreferences = (function (_super) {
|
|
3790
|
+
(0,tslib_es6/* __extends */.C6)(AICCStudentPreferences, _super);
|
|
3791
|
+
function AICCStudentPreferences() {
|
|
3792
|
+
var _this = _super.call(this, api_constants/* default */.A.aicc.student_preference_children) || this;
|
|
3793
|
+
_this._lesson_type = "";
|
|
3794
|
+
_this._text_color = "";
|
|
3795
|
+
_this._text_location = "";
|
|
3796
|
+
_this._text_size = "";
|
|
3797
|
+
_this._video = "";
|
|
3798
|
+
_this.windows = new array/* CMIArray */.B({
|
|
3799
|
+
errorCode: error_codes/* default */.A.scorm12.INVALID_SET_VALUE,
|
|
3800
|
+
errorClass: exceptions/* AICCValidationError */.gv,
|
|
3801
|
+
children: "",
|
|
3802
|
+
});
|
|
3803
|
+
return _this;
|
|
3804
|
+
}
|
|
3805
|
+
AICCStudentPreferences.prototype.initialize = function () {
|
|
3806
|
+
var _a;
|
|
3807
|
+
_super.prototype.initialize.call(this);
|
|
3808
|
+
(_a = this.windows) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
3809
|
+
};
|
|
3810
|
+
Object.defineProperty(AICCStudentPreferences.prototype, "lesson_type", {
|
|
3811
|
+
get: function () {
|
|
3812
|
+
return this._lesson_type;
|
|
3813
|
+
},
|
|
3814
|
+
set: function (lesson_type) {
|
|
3815
|
+
if (checkAICCValidFormat(lesson_type, regex/* default */.A.aicc.CMIString256)) {
|
|
3816
|
+
this._lesson_type = lesson_type;
|
|
3817
|
+
}
|
|
3818
|
+
},
|
|
3819
|
+
enumerable: false,
|
|
3820
|
+
configurable: true
|
|
3821
|
+
});
|
|
3822
|
+
Object.defineProperty(AICCStudentPreferences.prototype, "text_color", {
|
|
3823
|
+
get: function () {
|
|
3824
|
+
return this._text_color;
|
|
3825
|
+
},
|
|
3826
|
+
set: function (text_color) {
|
|
3827
|
+
if (checkAICCValidFormat(text_color, regex/* default */.A.aicc.CMIString256)) {
|
|
3828
|
+
this._text_color = text_color;
|
|
3829
|
+
}
|
|
3830
|
+
},
|
|
3831
|
+
enumerable: false,
|
|
3832
|
+
configurable: true
|
|
3833
|
+
});
|
|
3834
|
+
Object.defineProperty(AICCStudentPreferences.prototype, "text_location", {
|
|
3835
|
+
get: function () {
|
|
3836
|
+
return this._text_location;
|
|
3837
|
+
},
|
|
3838
|
+
set: function (text_location) {
|
|
3839
|
+
if (checkAICCValidFormat(text_location, regex/* default */.A.aicc.CMIString256)) {
|
|
3840
|
+
this._text_location = text_location;
|
|
3841
|
+
}
|
|
3842
|
+
},
|
|
3843
|
+
enumerable: false,
|
|
3844
|
+
configurable: true
|
|
3845
|
+
});
|
|
3846
|
+
Object.defineProperty(AICCStudentPreferences.prototype, "text_size", {
|
|
3847
|
+
get: function () {
|
|
3848
|
+
return this._text_size;
|
|
3849
|
+
},
|
|
3850
|
+
set: function (text_size) {
|
|
3851
|
+
if (checkAICCValidFormat(text_size, regex/* default */.A.aicc.CMIString256)) {
|
|
3852
|
+
this._text_size = text_size;
|
|
3853
|
+
}
|
|
3854
|
+
},
|
|
3855
|
+
enumerable: false,
|
|
3856
|
+
configurable: true
|
|
3857
|
+
});
|
|
3858
|
+
Object.defineProperty(AICCStudentPreferences.prototype, "video", {
|
|
3859
|
+
get: function () {
|
|
3860
|
+
return this._video;
|
|
3861
|
+
},
|
|
3862
|
+
set: function (video) {
|
|
3863
|
+
if (checkAICCValidFormat(video, regex/* default */.A.aicc.CMIString256)) {
|
|
3864
|
+
this._video = video;
|
|
3865
|
+
}
|
|
3866
|
+
},
|
|
3867
|
+
enumerable: false,
|
|
3868
|
+
configurable: true
|
|
3869
|
+
});
|
|
3870
|
+
AICCStudentPreferences.prototype.toJSON = function () {
|
|
3871
|
+
this.jsonString = true;
|
|
3872
|
+
var result = {
|
|
3873
|
+
audio: this.audio,
|
|
3874
|
+
language: this.language,
|
|
3875
|
+
lesson_type: this.lesson_type,
|
|
3876
|
+
speed: this.speed,
|
|
3877
|
+
text: this.text,
|
|
3878
|
+
text_color: this.text_color,
|
|
3879
|
+
text_location: this.text_location,
|
|
3880
|
+
text_size: this.text_size,
|
|
3881
|
+
video: this.video,
|
|
3882
|
+
windows: this.windows,
|
|
3883
|
+
};
|
|
3884
|
+
delete this.jsonString;
|
|
3885
|
+
return result;
|
|
3886
|
+
};
|
|
3887
|
+
return AICCStudentPreferences;
|
|
3888
|
+
}(student_preference/* CMIStudentPreference */.G));
|
|
3889
|
+
|
|
3890
|
+
|
|
3891
|
+
;// ./src/cmi/aicc/student_demographics.ts
|
|
3892
|
+
|
|
3893
|
+
|
|
3894
|
+
|
|
3895
|
+
|
|
3896
|
+
|
|
3897
|
+
var CMIStudentDemographics = (function (_super) {
|
|
3898
|
+
(0,tslib_es6/* __extends */.C6)(CMIStudentDemographics, _super);
|
|
3899
|
+
function CMIStudentDemographics() {
|
|
3900
|
+
var _this = _super.call(this) || this;
|
|
3901
|
+
_this.__children = api_constants/* default */.A.aicc.student_demographics_children;
|
|
3902
|
+
_this._city = "";
|
|
3903
|
+
_this._class = "";
|
|
3904
|
+
_this._company = "";
|
|
3905
|
+
_this._country = "";
|
|
3906
|
+
_this._experience = "";
|
|
3907
|
+
_this._familiar_name = "";
|
|
3908
|
+
_this._instructor_name = "";
|
|
3909
|
+
_this._title = "";
|
|
3910
|
+
_this._native_language = "";
|
|
3911
|
+
_this._state = "";
|
|
3912
|
+
_this._street_address = "";
|
|
3913
|
+
_this._telephone = "";
|
|
3914
|
+
_this._years_experience = "";
|
|
3915
|
+
return _this;
|
|
3916
|
+
}
|
|
3917
|
+
Object.defineProperty(CMIStudentDemographics.prototype, "_children", {
|
|
3918
|
+
get: function () {
|
|
3919
|
+
return this.__children;
|
|
3920
|
+
},
|
|
3921
|
+
enumerable: false,
|
|
3922
|
+
configurable: true
|
|
3923
|
+
});
|
|
3924
|
+
Object.defineProperty(CMIStudentDemographics.prototype, "city", {
|
|
3925
|
+
get: function () {
|
|
3926
|
+
return this._city;
|
|
3927
|
+
},
|
|
3928
|
+
set: function (city) {
|
|
3929
|
+
if (this.initialized) {
|
|
3930
|
+
throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT);
|
|
3931
|
+
}
|
|
3932
|
+
else {
|
|
3933
|
+
this._city = city;
|
|
3934
|
+
}
|
|
3935
|
+
},
|
|
3936
|
+
enumerable: false,
|
|
3937
|
+
configurable: true
|
|
3938
|
+
});
|
|
3939
|
+
Object.defineProperty(CMIStudentDemographics.prototype, "class", {
|
|
3940
|
+
get: function () {
|
|
3941
|
+
return this._class;
|
|
3942
|
+
},
|
|
3943
|
+
set: function (clazz) {
|
|
3944
|
+
if (this.initialized) {
|
|
3945
|
+
throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT);
|
|
3946
|
+
}
|
|
3947
|
+
else {
|
|
3948
|
+
this._class = clazz;
|
|
3949
|
+
}
|
|
3950
|
+
},
|
|
3951
|
+
enumerable: false,
|
|
3952
|
+
configurable: true
|
|
3953
|
+
});
|
|
3954
|
+
Object.defineProperty(CMIStudentDemographics.prototype, "company", {
|
|
3955
|
+
get: function () {
|
|
3956
|
+
return this._company;
|
|
3957
|
+
},
|
|
3958
|
+
set: function (company) {
|
|
3959
|
+
if (this.initialized) {
|
|
3960
|
+
throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT);
|
|
3961
|
+
}
|
|
3962
|
+
else {
|
|
3963
|
+
this._company = company;
|
|
3964
|
+
}
|
|
3965
|
+
},
|
|
3966
|
+
enumerable: false,
|
|
3967
|
+
configurable: true
|
|
3968
|
+
});
|
|
3969
|
+
Object.defineProperty(CMIStudentDemographics.prototype, "country", {
|
|
3970
|
+
get: function () {
|
|
3971
|
+
return this._country;
|
|
3972
|
+
},
|
|
3973
|
+
set: function (country) {
|
|
3974
|
+
if (this.initialized) {
|
|
3975
|
+
throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT);
|
|
3976
|
+
}
|
|
3977
|
+
else {
|
|
3978
|
+
this._country = country;
|
|
3979
|
+
}
|
|
3980
|
+
},
|
|
3981
|
+
enumerable: false,
|
|
3982
|
+
configurable: true
|
|
3983
|
+
});
|
|
3984
|
+
Object.defineProperty(CMIStudentDemographics.prototype, "experience", {
|
|
3985
|
+
get: function () {
|
|
3986
|
+
return this._experience;
|
|
3987
|
+
},
|
|
3988
|
+
set: function (experience) {
|
|
3989
|
+
if (this.initialized) {
|
|
3990
|
+
throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT);
|
|
3991
|
+
}
|
|
3992
|
+
else {
|
|
3993
|
+
this._experience = experience;
|
|
3994
|
+
}
|
|
3995
|
+
},
|
|
3996
|
+
enumerable: false,
|
|
3997
|
+
configurable: true
|
|
3998
|
+
});
|
|
3999
|
+
Object.defineProperty(CMIStudentDemographics.prototype, "familiar_name", {
|
|
4000
|
+
get: function () {
|
|
4001
|
+
return this._familiar_name;
|
|
4002
|
+
},
|
|
4003
|
+
set: function (familiar_name) {
|
|
4004
|
+
if (this.initialized) {
|
|
4005
|
+
throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT);
|
|
4006
|
+
}
|
|
4007
|
+
else {
|
|
4008
|
+
this._familiar_name = familiar_name;
|
|
4009
|
+
}
|
|
4010
|
+
},
|
|
4011
|
+
enumerable: false,
|
|
4012
|
+
configurable: true
|
|
4013
|
+
});
|
|
4014
|
+
Object.defineProperty(CMIStudentDemographics.prototype, "instructor_name", {
|
|
4015
|
+
get: function () {
|
|
4016
|
+
return this._instructor_name;
|
|
4017
|
+
},
|
|
4018
|
+
set: function (instructor_name) {
|
|
4019
|
+
if (this.initialized) {
|
|
4020
|
+
throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT);
|
|
4021
|
+
}
|
|
4022
|
+
else {
|
|
4023
|
+
this._instructor_name = instructor_name;
|
|
4024
|
+
}
|
|
4025
|
+
},
|
|
4026
|
+
enumerable: false,
|
|
4027
|
+
configurable: true
|
|
4028
|
+
});
|
|
4029
|
+
Object.defineProperty(CMIStudentDemographics.prototype, "title", {
|
|
4030
|
+
get: function () {
|
|
4031
|
+
return this._title;
|
|
4032
|
+
},
|
|
4033
|
+
set: function (title) {
|
|
4034
|
+
if (this.initialized) {
|
|
4035
|
+
throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT);
|
|
4036
|
+
}
|
|
4037
|
+
else {
|
|
4038
|
+
this._title = title;
|
|
4039
|
+
}
|
|
4040
|
+
},
|
|
4041
|
+
enumerable: false,
|
|
4042
|
+
configurable: true
|
|
4043
|
+
});
|
|
4044
|
+
Object.defineProperty(CMIStudentDemographics.prototype, "native_language", {
|
|
4045
|
+
get: function () {
|
|
4046
|
+
return this._native_language;
|
|
4047
|
+
},
|
|
4048
|
+
set: function (native_language) {
|
|
4049
|
+
if (this.initialized) {
|
|
4050
|
+
throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT);
|
|
4051
|
+
}
|
|
4052
|
+
else {
|
|
4053
|
+
this._native_language = native_language;
|
|
4054
|
+
}
|
|
4055
|
+
},
|
|
4056
|
+
enumerable: false,
|
|
4057
|
+
configurable: true
|
|
4058
|
+
});
|
|
4059
|
+
Object.defineProperty(CMIStudentDemographics.prototype, "state", {
|
|
4060
|
+
get: function () {
|
|
4061
|
+
return this._state;
|
|
4062
|
+
},
|
|
4063
|
+
set: function (state) {
|
|
4064
|
+
if (this.initialized) {
|
|
4065
|
+
throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT);
|
|
4066
|
+
}
|
|
4067
|
+
else {
|
|
4068
|
+
this._state = state;
|
|
4069
|
+
}
|
|
4070
|
+
},
|
|
4071
|
+
enumerable: false,
|
|
4072
|
+
configurable: true
|
|
4073
|
+
});
|
|
4074
|
+
Object.defineProperty(CMIStudentDemographics.prototype, "street_address", {
|
|
4075
|
+
get: function () {
|
|
4076
|
+
return this._street_address;
|
|
4077
|
+
},
|
|
4078
|
+
set: function (street_address) {
|
|
4079
|
+
if (this.initialized) {
|
|
4080
|
+
throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT);
|
|
4081
|
+
}
|
|
4082
|
+
else {
|
|
4083
|
+
this._street_address = street_address;
|
|
4084
|
+
}
|
|
4085
|
+
},
|
|
4086
|
+
enumerable: false,
|
|
4087
|
+
configurable: true
|
|
4088
|
+
});
|
|
4089
|
+
Object.defineProperty(CMIStudentDemographics.prototype, "telephone", {
|
|
4090
|
+
get: function () {
|
|
4091
|
+
return this._telephone;
|
|
4092
|
+
},
|
|
4093
|
+
set: function (telephone) {
|
|
4094
|
+
if (this.initialized) {
|
|
4095
|
+
throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT);
|
|
4096
|
+
}
|
|
4097
|
+
else {
|
|
4098
|
+
this._telephone = telephone;
|
|
4099
|
+
}
|
|
4100
|
+
},
|
|
4101
|
+
enumerable: false,
|
|
4102
|
+
configurable: true
|
|
4103
|
+
});
|
|
4104
|
+
Object.defineProperty(CMIStudentDemographics.prototype, "years_experience", {
|
|
4105
|
+
get: function () {
|
|
4106
|
+
return this._years_experience;
|
|
4107
|
+
},
|
|
4108
|
+
set: function (years_experience) {
|
|
4109
|
+
if (this.initialized) {
|
|
4110
|
+
throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT);
|
|
4111
|
+
}
|
|
4112
|
+
else {
|
|
4113
|
+
this._years_experience = years_experience;
|
|
4114
|
+
}
|
|
4115
|
+
},
|
|
4116
|
+
enumerable: false,
|
|
4117
|
+
configurable: true
|
|
4118
|
+
});
|
|
4119
|
+
CMIStudentDemographics.prototype.toJSON = function () {
|
|
4120
|
+
this.jsonString = true;
|
|
4121
|
+
var result = {
|
|
4122
|
+
city: this.city,
|
|
4123
|
+
class: this.class,
|
|
4124
|
+
company: this.company,
|
|
4125
|
+
country: this.country,
|
|
4126
|
+
experience: this.experience,
|
|
4127
|
+
familiar_name: this.familiar_name,
|
|
4128
|
+
instructor_name: this.instructor_name,
|
|
4129
|
+
title: this.title,
|
|
4130
|
+
native_language: this.native_language,
|
|
4131
|
+
state: this.state,
|
|
4132
|
+
street_address: this.street_address,
|
|
4133
|
+
telephone: this.telephone,
|
|
4134
|
+
years_experience: this.years_experience,
|
|
4135
|
+
};
|
|
4136
|
+
delete this.jsonString;
|
|
4137
|
+
return result;
|
|
4138
|
+
};
|
|
4139
|
+
return CMIStudentDemographics;
|
|
4140
|
+
}(base_cmi/* BaseCMI */.J));
|
|
4141
|
+
|
|
4142
|
+
|
|
4143
|
+
// EXTERNAL MODULE: ./src/cmi/common/score.ts
|
|
4144
|
+
var score = __webpack_require__(434);
|
|
4145
|
+
;// ./src/cmi/aicc/tries.ts
|
|
4146
|
+
|
|
4147
|
+
|
|
4148
|
+
|
|
4149
|
+
|
|
4150
|
+
|
|
4151
|
+
|
|
4152
|
+
|
|
4153
|
+
|
|
4154
|
+
|
|
4155
|
+
var CMITries = (function (_super) {
|
|
4156
|
+
(0,tslib_es6/* __extends */.C6)(CMITries, _super);
|
|
4157
|
+
function CMITries() {
|
|
4158
|
+
return _super.call(this, {
|
|
4159
|
+
children: api_constants/* default */.A.aicc.tries_children,
|
|
4160
|
+
}) || this;
|
|
4161
|
+
}
|
|
4162
|
+
return CMITries;
|
|
4163
|
+
}(array/* CMIArray */.B));
|
|
4164
|
+
|
|
4165
|
+
var CMITriesObject = (function (_super) {
|
|
4166
|
+
(0,tslib_es6/* __extends */.C6)(CMITriesObject, _super);
|
|
4167
|
+
function CMITriesObject() {
|
|
4168
|
+
var _this = _super.call(this) || this;
|
|
4169
|
+
_this._status = "";
|
|
4170
|
+
_this._time = "";
|
|
4171
|
+
_this.score = new score/* CMIScore */._({
|
|
4172
|
+
score_children: api_constants/* default */.A.aicc.score_children,
|
|
4173
|
+
score_range: regex/* default */.A.aicc.score_range,
|
|
4174
|
+
invalidErrorCode: error_codes/* default */.A.scorm12.INVALID_SET_VALUE,
|
|
4175
|
+
invalidTypeCode: error_codes/* default */.A.scorm12.TYPE_MISMATCH,
|
|
4176
|
+
invalidRangeCode: error_codes/* default */.A.scorm12.VALUE_OUT_OF_RANGE,
|
|
4177
|
+
errorClass: exceptions/* AICCValidationError */.gv,
|
|
4178
|
+
});
|
|
4179
|
+
return _this;
|
|
4180
|
+
}
|
|
4181
|
+
CMITriesObject.prototype.initialize = function () {
|
|
4182
|
+
var _a;
|
|
4183
|
+
_super.prototype.initialize.call(this);
|
|
4184
|
+
(_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
4185
|
+
};
|
|
4186
|
+
Object.defineProperty(CMITriesObject.prototype, "status", {
|
|
4187
|
+
get: function () {
|
|
4188
|
+
return this._status;
|
|
4189
|
+
},
|
|
4190
|
+
set: function (status) {
|
|
4191
|
+
if (checkAICCValidFormat(status, regex/* default */.A.aicc.CMIStatus2)) {
|
|
4192
|
+
this._status = status;
|
|
4193
|
+
}
|
|
4194
|
+
},
|
|
4195
|
+
enumerable: false,
|
|
4196
|
+
configurable: true
|
|
4197
|
+
});
|
|
4198
|
+
Object.defineProperty(CMITriesObject.prototype, "time", {
|
|
4199
|
+
get: function () {
|
|
4200
|
+
return this._time;
|
|
4201
|
+
},
|
|
4202
|
+
set: function (time) {
|
|
4203
|
+
if (checkAICCValidFormat(time, regex/* default */.A.aicc.CMITime)) {
|
|
4204
|
+
this._time = time;
|
|
4205
|
+
}
|
|
4206
|
+
},
|
|
4207
|
+
enumerable: false,
|
|
4208
|
+
configurable: true
|
|
4209
|
+
});
|
|
4210
|
+
CMITriesObject.prototype.toJSON = function () {
|
|
4211
|
+
this.jsonString = true;
|
|
4212
|
+
var result = {
|
|
4213
|
+
status: this.status,
|
|
4214
|
+
time: this.time,
|
|
4215
|
+
score: this.score,
|
|
4216
|
+
};
|
|
4217
|
+
delete this.jsonString;
|
|
4218
|
+
return result;
|
|
4219
|
+
};
|
|
4220
|
+
return CMITriesObject;
|
|
4221
|
+
}(base_cmi/* BaseCMI */.J));
|
|
4222
|
+
|
|
4223
|
+
|
|
4224
|
+
// EXTERNAL MODULE: ./src/cmi/scorm12/student_data.ts
|
|
4225
|
+
var student_data = __webpack_require__(532);
|
|
4226
|
+
;// ./src/cmi/aicc/attempts.ts
|
|
4227
|
+
|
|
4228
|
+
|
|
4229
|
+
|
|
4230
|
+
|
|
4231
|
+
|
|
4232
|
+
|
|
4233
|
+
|
|
4234
|
+
|
|
4235
|
+
|
|
4236
|
+
var CMIAttemptRecords = (function (_super) {
|
|
4237
|
+
(0,tslib_es6/* __extends */.C6)(CMIAttemptRecords, _super);
|
|
4238
|
+
function CMIAttemptRecords() {
|
|
4239
|
+
return _super.call(this, {
|
|
4240
|
+
children: api_constants/* default */.A.aicc.attempt_records_children,
|
|
4241
|
+
}) || this;
|
|
4242
|
+
}
|
|
4243
|
+
return CMIAttemptRecords;
|
|
4244
|
+
}(array/* CMIArray */.B));
|
|
4245
|
+
|
|
4246
|
+
var CMIAttemptRecordsObject = (function (_super) {
|
|
4247
|
+
(0,tslib_es6/* __extends */.C6)(CMIAttemptRecordsObject, _super);
|
|
4248
|
+
function CMIAttemptRecordsObject() {
|
|
4249
|
+
var _this = _super.call(this) || this;
|
|
4250
|
+
_this._lesson_status = "";
|
|
4251
|
+
_this.score = new score/* CMIScore */._({
|
|
4252
|
+
score_children: api_constants/* default */.A.aicc.score_children,
|
|
4253
|
+
score_range: regex/* default */.A.aicc.score_range,
|
|
4254
|
+
invalidErrorCode: error_codes/* default */.A.scorm12.INVALID_SET_VALUE,
|
|
4255
|
+
invalidTypeCode: error_codes/* default */.A.scorm12.TYPE_MISMATCH,
|
|
4256
|
+
invalidRangeCode: error_codes/* default */.A.scorm12.VALUE_OUT_OF_RANGE,
|
|
4257
|
+
errorClass: exceptions/* AICCValidationError */.gv,
|
|
4258
|
+
});
|
|
4259
|
+
return _this;
|
|
4260
|
+
}
|
|
4261
|
+
CMIAttemptRecordsObject.prototype.initialize = function () {
|
|
4262
|
+
var _a;
|
|
4263
|
+
_super.prototype.initialize.call(this);
|
|
4264
|
+
(_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
4265
|
+
};
|
|
4266
|
+
Object.defineProperty(CMIAttemptRecordsObject.prototype, "lesson_status", {
|
|
4267
|
+
get: function () {
|
|
4268
|
+
return this._lesson_status;
|
|
4269
|
+
},
|
|
4270
|
+
set: function (lesson_status) {
|
|
4271
|
+
if (checkAICCValidFormat(lesson_status, regex/* default */.A.aicc.CMIStatus2)) {
|
|
4272
|
+
this._lesson_status = lesson_status;
|
|
4273
|
+
}
|
|
4274
|
+
},
|
|
4275
|
+
enumerable: false,
|
|
4276
|
+
configurable: true
|
|
4277
|
+
});
|
|
4278
|
+
CMIAttemptRecordsObject.prototype.toJSON = function () {
|
|
4279
|
+
this.jsonString = true;
|
|
4280
|
+
var result = {
|
|
4281
|
+
lesson_status: this.lesson_status,
|
|
4282
|
+
score: this.score,
|
|
4283
|
+
};
|
|
4284
|
+
delete this.jsonString;
|
|
4285
|
+
return result;
|
|
4286
|
+
};
|
|
4287
|
+
return CMIAttemptRecordsObject;
|
|
4288
|
+
}(base_cmi/* BaseCMI */.J));
|
|
4289
|
+
|
|
4290
|
+
|
|
4291
|
+
;// ./src/cmi/aicc/student_data.ts
|
|
4292
|
+
|
|
4293
|
+
|
|
4294
|
+
|
|
4295
|
+
|
|
4296
|
+
|
|
4297
|
+
|
|
4298
|
+
|
|
4299
|
+
var AICCCMIStudentData = (function (_super) {
|
|
4300
|
+
(0,tslib_es6/* __extends */.C6)(AICCCMIStudentData, _super);
|
|
4301
|
+
function AICCCMIStudentData() {
|
|
4302
|
+
var _this = _super.call(this, api_constants/* default */.A.aicc.student_data_children) || this;
|
|
4303
|
+
_this._tries_during_lesson = "";
|
|
4304
|
+
_this.tries = new CMITries();
|
|
4305
|
+
_this.attempt_records = new CMIAttemptRecords();
|
|
4306
|
+
return _this;
|
|
4307
|
+
}
|
|
4308
|
+
AICCCMIStudentData.prototype.initialize = function () {
|
|
4309
|
+
var _a, _b;
|
|
4310
|
+
_super.prototype.initialize.call(this);
|
|
4311
|
+
(_a = this.tries) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
4312
|
+
(_b = this.attempt_records) === null || _b === void 0 ? void 0 : _b.initialize();
|
|
4313
|
+
};
|
|
4314
|
+
Object.defineProperty(AICCCMIStudentData.prototype, "tries_during_lesson", {
|
|
4315
|
+
get: function () {
|
|
4316
|
+
return this._tries_during_lesson;
|
|
4317
|
+
},
|
|
4318
|
+
set: function (tries_during_lesson) {
|
|
4319
|
+
if (this.initialized) {
|
|
4320
|
+
throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT);
|
|
4321
|
+
}
|
|
4322
|
+
else {
|
|
4323
|
+
this._tries_during_lesson = tries_during_lesson;
|
|
4324
|
+
}
|
|
4325
|
+
},
|
|
4326
|
+
enumerable: false,
|
|
4327
|
+
configurable: true
|
|
4328
|
+
});
|
|
4329
|
+
AICCCMIStudentData.prototype.toJSON = function () {
|
|
4330
|
+
this.jsonString = true;
|
|
4331
|
+
var result = {
|
|
4332
|
+
mastery_score: this.mastery_score,
|
|
4333
|
+
max_time_allowed: this.max_time_allowed,
|
|
4334
|
+
time_limit_action: this.time_limit_action,
|
|
4335
|
+
tries: this.tries,
|
|
4336
|
+
attempt_records: this.attempt_records,
|
|
4337
|
+
};
|
|
4338
|
+
delete this.jsonString;
|
|
4339
|
+
return result;
|
|
4340
|
+
};
|
|
4341
|
+
return AICCCMIStudentData;
|
|
4342
|
+
}(student_data/* CMIStudentData */.X));
|
|
4343
|
+
|
|
4344
|
+
|
|
4345
|
+
;// ./src/cmi/aicc/paths.ts
|
|
4346
|
+
|
|
4347
|
+
|
|
4348
|
+
|
|
4349
|
+
|
|
4350
|
+
|
|
4351
|
+
|
|
4352
|
+
var CMIPaths = (function (_super) {
|
|
4353
|
+
(0,tslib_es6/* __extends */.C6)(CMIPaths, _super);
|
|
4354
|
+
function CMIPaths() {
|
|
4355
|
+
return _super.call(this, {
|
|
4356
|
+
children: api_constants/* default */.A.aicc.paths_children,
|
|
4357
|
+
}) || this;
|
|
4358
|
+
}
|
|
4359
|
+
return CMIPaths;
|
|
4360
|
+
}(array/* CMIArray */.B));
|
|
4361
|
+
|
|
4362
|
+
var CMIPathsObject = (function (_super) {
|
|
4363
|
+
(0,tslib_es6/* __extends */.C6)(CMIPathsObject, _super);
|
|
4364
|
+
function CMIPathsObject() {
|
|
4365
|
+
var _this = _super.call(this) || this;
|
|
4366
|
+
_this._location_id = "";
|
|
4367
|
+
_this._date = "";
|
|
4368
|
+
_this._time = "";
|
|
4369
|
+
_this._status = "";
|
|
4370
|
+
_this._why_left = "";
|
|
4371
|
+
_this._time_in_element = "";
|
|
4372
|
+
return _this;
|
|
4373
|
+
}
|
|
4374
|
+
Object.defineProperty(CMIPathsObject.prototype, "location_id", {
|
|
4375
|
+
get: function () {
|
|
4376
|
+
return this._location_id;
|
|
4377
|
+
},
|
|
4378
|
+
set: function (location_id) {
|
|
4379
|
+
if (checkAICCValidFormat(location_id, regex/* default */.A.aicc.CMIString256)) {
|
|
4380
|
+
this._location_id = location_id;
|
|
4381
|
+
}
|
|
4382
|
+
},
|
|
4383
|
+
enumerable: false,
|
|
4384
|
+
configurable: true
|
|
4385
|
+
});
|
|
4386
|
+
Object.defineProperty(CMIPathsObject.prototype, "date", {
|
|
4387
|
+
get: function () {
|
|
4388
|
+
return this._date;
|
|
4389
|
+
},
|
|
4390
|
+
set: function (date) {
|
|
4391
|
+
if (checkAICCValidFormat(date, regex/* default */.A.aicc.CMIString256)) {
|
|
4392
|
+
this._date = date;
|
|
4393
|
+
}
|
|
4394
|
+
},
|
|
4395
|
+
enumerable: false,
|
|
4396
|
+
configurable: true
|
|
4397
|
+
});
|
|
4398
|
+
Object.defineProperty(CMIPathsObject.prototype, "time", {
|
|
4399
|
+
get: function () {
|
|
4400
|
+
return this._time;
|
|
4401
|
+
},
|
|
4402
|
+
set: function (time) {
|
|
4403
|
+
if (checkAICCValidFormat(time, regex/* default */.A.aicc.CMITime)) {
|
|
4404
|
+
this._time = time;
|
|
4405
|
+
}
|
|
4406
|
+
},
|
|
4407
|
+
enumerable: false,
|
|
4408
|
+
configurable: true
|
|
4409
|
+
});
|
|
4410
|
+
Object.defineProperty(CMIPathsObject.prototype, "status", {
|
|
4411
|
+
get: function () {
|
|
4412
|
+
return this._status;
|
|
4413
|
+
},
|
|
4414
|
+
set: function (status) {
|
|
4415
|
+
if (checkAICCValidFormat(status, regex/* default */.A.aicc.CMIStatus2)) {
|
|
4416
|
+
this._status = status;
|
|
4417
|
+
}
|
|
4418
|
+
},
|
|
4419
|
+
enumerable: false,
|
|
4420
|
+
configurable: true
|
|
4421
|
+
});
|
|
4422
|
+
Object.defineProperty(CMIPathsObject.prototype, "why_left", {
|
|
4423
|
+
get: function () {
|
|
4424
|
+
return this._why_left;
|
|
4425
|
+
},
|
|
4426
|
+
set: function (why_left) {
|
|
4427
|
+
if (checkAICCValidFormat(why_left, regex/* default */.A.aicc.CMIString256)) {
|
|
4428
|
+
this._why_left = why_left;
|
|
4429
|
+
}
|
|
4430
|
+
},
|
|
4431
|
+
enumerable: false,
|
|
4432
|
+
configurable: true
|
|
4433
|
+
});
|
|
4434
|
+
Object.defineProperty(CMIPathsObject.prototype, "time_in_element", {
|
|
4435
|
+
get: function () {
|
|
4436
|
+
return this._time_in_element;
|
|
4437
|
+
},
|
|
4438
|
+
set: function (time_in_element) {
|
|
4439
|
+
if (checkAICCValidFormat(time_in_element, regex/* default */.A.aicc.CMITime)) {
|
|
4440
|
+
this._time_in_element = time_in_element;
|
|
4441
|
+
}
|
|
4442
|
+
},
|
|
4443
|
+
enumerable: false,
|
|
4444
|
+
configurable: true
|
|
4445
|
+
});
|
|
4446
|
+
CMIPathsObject.prototype.toJSON = function () {
|
|
4447
|
+
this.jsonString = true;
|
|
4448
|
+
var result = {
|
|
4449
|
+
location_id: this.location_id,
|
|
4450
|
+
date: this.date,
|
|
4451
|
+
time: this.time,
|
|
4452
|
+
status: this.status,
|
|
4453
|
+
why_left: this.why_left,
|
|
4454
|
+
time_in_element: this.time_in_element,
|
|
4455
|
+
};
|
|
4456
|
+
delete this.jsonString;
|
|
4457
|
+
return result;
|
|
4458
|
+
};
|
|
4459
|
+
return CMIPathsObject;
|
|
4460
|
+
}(base_cmi/* BaseCMI */.J));
|
|
4461
|
+
|
|
4462
|
+
|
|
4463
|
+
;// ./src/cmi/aicc/cmi.ts
|
|
4464
|
+
|
|
4465
|
+
|
|
4466
|
+
|
|
4467
|
+
|
|
4468
|
+
|
|
4469
|
+
|
|
4470
|
+
|
|
4471
|
+
|
|
4472
|
+
var CMI = (function (_super) {
|
|
4473
|
+
(0,tslib_es6/* __extends */.C6)(CMI, _super);
|
|
4474
|
+
function CMI(initialized) {
|
|
4475
|
+
if (initialized === void 0) { initialized = false; }
|
|
4476
|
+
var _this = _super.call(this, api_constants/* default */.A.aicc.cmi_children) || this;
|
|
4477
|
+
if (initialized)
|
|
4478
|
+
_this.initialize();
|
|
4479
|
+
_this.student_preference = new AICCStudentPreferences();
|
|
4480
|
+
_this.student_data = new AICCCMIStudentData();
|
|
4481
|
+
_this.student_demographics = new CMIStudentDemographics();
|
|
4482
|
+
_this.evaluation = new CMIEvaluation();
|
|
4483
|
+
_this.paths = new CMIPaths();
|
|
4484
|
+
return _this;
|
|
4485
|
+
}
|
|
4486
|
+
CMI.prototype.initialize = function () {
|
|
4487
|
+
var _a, _b, _c, _d, _e;
|
|
4488
|
+
_super.prototype.initialize.call(this);
|
|
4489
|
+
(_a = this.student_preference) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
4490
|
+
(_b = this.student_data) === null || _b === void 0 ? void 0 : _b.initialize();
|
|
4491
|
+
(_c = this.student_demographics) === null || _c === void 0 ? void 0 : _c.initialize();
|
|
4492
|
+
(_d = this.evaluation) === null || _d === void 0 ? void 0 : _d.initialize();
|
|
4493
|
+
(_e = this.paths) === null || _e === void 0 ? void 0 : _e.initialize();
|
|
4494
|
+
};
|
|
4495
|
+
CMI.prototype.toJSON = function () {
|
|
4496
|
+
this.jsonString = true;
|
|
4497
|
+
var result = {
|
|
4498
|
+
suspend_data: this.suspend_data,
|
|
4499
|
+
launch_data: this.launch_data,
|
|
4500
|
+
comments: this.comments,
|
|
4501
|
+
comments_from_lms: this.comments_from_lms,
|
|
4502
|
+
core: this.core,
|
|
4503
|
+
objectives: this.objectives,
|
|
4504
|
+
student_data: this.student_data,
|
|
4505
|
+
student_preference: this.student_preference,
|
|
4506
|
+
student_demographics: this.student_demographics,
|
|
4507
|
+
interactions: this.interactions,
|
|
4508
|
+
evaluation: this.evaluation,
|
|
4509
|
+
paths: this.paths,
|
|
4510
|
+
};
|
|
4511
|
+
delete this.jsonString;
|
|
4512
|
+
return result;
|
|
4513
|
+
};
|
|
4514
|
+
return CMI;
|
|
4515
|
+
}(cmi/* CMI */.Y));
|
|
4516
|
+
|
|
4517
|
+
|
|
4518
|
+
// EXTERNAL MODULE: ./src/cmi/scorm12/nav.ts
|
|
4519
|
+
var nav = __webpack_require__(331);
|
|
4520
|
+
// EXTERNAL MODULE: ./src/utilities.ts
|
|
4521
|
+
var utilities = __webpack_require__(864);
|
|
4522
|
+
;// ./src/AICC.ts
|
|
4523
|
+
|
|
4524
|
+
|
|
4525
|
+
|
|
4526
|
+
|
|
4527
|
+
|
|
4528
|
+
|
|
4529
|
+
|
|
4530
|
+
|
|
4531
|
+
|
|
4532
|
+
var AICCImpl = (function (_super) {
|
|
4533
|
+
(0,tslib_es6/* __extends */.C6)(AICCImpl, _super);
|
|
4534
|
+
function AICCImpl(settings) {
|
|
4535
|
+
var _this = _super.call(this, settings) || this;
|
|
4536
|
+
_this.cmi = new CMI();
|
|
4537
|
+
_this.nav = new nav/* NAV */.A();
|
|
4538
|
+
return _this;
|
|
4539
|
+
}
|
|
4540
|
+
AICCImpl.prototype.getChildElement = function (CMIElement, value, foundFirstIndex) {
|
|
4541
|
+
var newChild = _super.prototype.getChildElement.call(this, CMIElement, value, foundFirstIndex);
|
|
4542
|
+
if (!newChild) {
|
|
4543
|
+
if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.evaluation\\.comments\\.\\d+")) {
|
|
4544
|
+
newChild = new CMIEvaluationCommentsObject();
|
|
4545
|
+
}
|
|
4546
|
+
else if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.student_data\\.tries\\.\\d+")) {
|
|
4547
|
+
newChild = new CMITriesObject();
|
|
4548
|
+
}
|
|
4549
|
+
else if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.student_data\\.attempt_records\\.\\d+")) {
|
|
4550
|
+
newChild = new CMIAttemptRecordsObject();
|
|
4551
|
+
}
|
|
4552
|
+
else if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.paths\\.\\d+")) {
|
|
4553
|
+
newChild = new CMIPathsObject();
|
|
4554
|
+
}
|
|
4555
|
+
}
|
|
4556
|
+
return newChild;
|
|
4557
|
+
};
|
|
4558
|
+
AICCImpl.prototype.replaceWithAnotherScormAPI = function (newAPI) {
|
|
4559
|
+
this.cmi = newAPI.cmi;
|
|
4560
|
+
this.nav = newAPI.nav;
|
|
4561
|
+
};
|
|
4562
|
+
return AICCImpl;
|
|
4563
|
+
}(Scorm12API/* Scorm12Impl */.C));
|
|
4564
|
+
|
|
4565
|
+
|
|
4566
|
+
var __webpack_exports__AICCImpl = __webpack_exports__.X;
|
|
4567
|
+
export { __webpack_exports__AICCImpl as AICCImpl };
|
|
4568
|
+
|
|
4569
|
+
//# sourceMappingURL=aicc.js.map
|