scorm-again 2.4.1 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -23
- package/dist/aicc.js +676 -493
- 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 +692 -496
- package/dist/esm/aicc.js.map +1 -1
- package/dist/esm/aicc.min.js +1 -1
- package/dist/esm/aicc.min.js.map +1 -1
- package/dist/esm/scorm-again.js +1151 -743
- package/dist/esm/scorm-again.js.map +1 -1
- package/dist/esm/scorm-again.min.js +1 -1
- package/dist/esm/scorm-again.min.js.map +1 -1
- package/dist/esm/scorm12.js +534 -401
- package/dist/esm/scorm12.js.map +1 -1
- package/dist/esm/scorm12.min.js +1 -1
- package/dist/esm/scorm12.min.js.map +1 -1
- package/dist/esm/scorm2004.js +712 -465
- package/dist/esm/scorm2004.js.map +1 -1
- package/dist/esm/scorm2004.min.js +1 -1
- package/dist/esm/scorm2004.min.js.map +1 -1
- package/dist/scorm-again.js +1127 -731
- 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 +521 -400
- 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 +698 -464
- package/dist/scorm2004.js.map +1 -1
- package/dist/scorm2004.min.js +1 -1
- package/dist/scorm2004.min.js.map +1 -1
- package/package.json +15 -15
- package/src/AICC.ts +3 -0
- package/src/BaseAPI.ts +60 -95
- package/src/Scorm12API.ts +14 -14
- package/src/Scorm2004API.ts +107 -37
- package/src/cmi/aicc/attempts.ts +22 -12
- package/src/cmi/aicc/cmi.ts +2 -2
- package/src/cmi/aicc/core.ts +44 -26
- package/src/cmi/aicc/evaluation.ts +31 -12
- package/src/cmi/aicc/paths.ts +29 -15
- package/src/cmi/aicc/student_data.ts +14 -5
- package/src/cmi/aicc/student_demographics.ts +31 -24
- package/src/cmi/aicc/student_preferences.ts +11 -11
- package/src/cmi/aicc/tries.ts +24 -14
- package/src/cmi/aicc/validation.ts +3 -4
- package/src/cmi/common/array.ts +17 -5
- package/src/cmi/common/base_cmi.ts +3 -1
- package/src/cmi/common/score.ts +16 -13
- package/src/cmi/scorm12/cmi.ts +25 -10
- package/src/cmi/scorm12/interactions.ts +62 -28
- package/src/cmi/scorm12/nav.ts +13 -5
- package/src/cmi/scorm12/objectives.ts +28 -18
- package/src/cmi/scorm12/student_data.ts +15 -8
- package/src/cmi/scorm12/student_preference.ts +20 -13
- package/src/cmi/scorm12/validation.ts +7 -7
- package/src/cmi/scorm2004/adl.ts +141 -25
- package/src/cmi/scorm2004/cmi.ts +50 -55
- package/src/cmi/scorm2004/comments.ts +21 -20
- package/src/cmi/scorm2004/interactions.ts +73 -32
- package/src/cmi/scorm2004/learner_preference.ts +20 -13
- package/src/cmi/scorm2004/objectives.ts +41 -16
- package/src/cmi/scorm2004/score.ts +22 -11
- package/src/cmi/scorm2004/validation.ts +4 -4
- package/src/constants/api_constants.ts +8 -29
- package/src/constants/default_settings.ts +26 -12
- package/src/constants/enums.ts +9 -0
- package/src/constants/error_codes.ts +5 -12
- package/src/constants/regex.ts +5 -11
- package/src/constants/response_constants.ts +1 -2
- package/src/exceptions/aicc_exceptions.ts +29 -0
- package/src/exceptions/scorm12_exceptions.ts +29 -0
- package/src/exceptions/scorm2004_exceptions.ts +29 -0
- package/src/exceptions.ts +1 -86
- package/src/types/api_types.ts +29 -5
- package/test/AICC.spec.ts +114 -43
- package/test/Scorm12API.spec.ts +37 -39
- package/test/Scorm2004API.spec.ts +165 -80
- package/test/cmi/aicc_cmi.spec.ts +6 -9
- package/test/cmi/scorm12_cmi.spec.ts +8 -8
- package/test/cmi/scorm2004_cmi.spec.ts +8 -9
- package/test/exceptions.spec.ts +11 -9
- package/test/types/api_types.spec.ts +40 -47
- package/test/utilities.spec.ts +1 -4
- package/webpack.config.js +4 -0
package/dist/scorm-again.js
CHANGED
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
/******/ "use strict";
|
|
3
3
|
/******/ var __webpack_modules__ = ({
|
|
4
4
|
|
|
5
|
-
/***/
|
|
5
|
+
/***/ 916:
|
|
6
6
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
7
7
|
|
|
8
|
+
// ESM COMPAT FLAG
|
|
9
|
+
__webpack_require__.r(__webpack_exports__);
|
|
8
10
|
|
|
9
11
|
// EXPORTS
|
|
10
12
|
__webpack_require__.d(__webpack_exports__, {
|
|
@@ -23,6 +25,27 @@ var api_constants = __webpack_require__(340);
|
|
|
23
25
|
var array = __webpack_require__(589);
|
|
24
26
|
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
25
27
|
var exceptions = __webpack_require__(784);
|
|
28
|
+
;// ./src/exceptions/aicc_exceptions.ts
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
var aicc_errors = api_constants.aicc_constants.error_descriptions;
|
|
33
|
+
var AICCValidationError = (function (_super) {
|
|
34
|
+
(0,tslib_es6.__extends)(AICCValidationError, _super);
|
|
35
|
+
function AICCValidationError(errorCode) {
|
|
36
|
+
var _this = this;
|
|
37
|
+
if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {
|
|
38
|
+
_this = _super.call(this, errorCode, aicc_errors[String(errorCode)].basicMessage, aicc_errors[String(errorCode)].detailMessage) || this;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
_this = _super.call(this, 101, aicc_errors["101"].basicMessage, aicc_errors["101"].detailMessage) || this;
|
|
42
|
+
}
|
|
43
|
+
return _this;
|
|
44
|
+
}
|
|
45
|
+
return AICCValidationError;
|
|
46
|
+
}(exceptions.ValidationError));
|
|
47
|
+
|
|
48
|
+
|
|
26
49
|
// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts
|
|
27
50
|
var base_cmi = __webpack_require__(319);
|
|
28
51
|
// EXTERNAL MODULE: ./src/constants/error_codes.ts
|
|
@@ -33,9 +56,8 @@ var validation = __webpack_require__(449);
|
|
|
33
56
|
|
|
34
57
|
|
|
35
58
|
|
|
36
|
-
var aicc_error_codes = error_codes/* default */.A.scorm12;
|
|
37
59
|
function checkAICCValidFormat(value, regexPattern, allowEmptyString) {
|
|
38
|
-
return (0,validation
|
|
60
|
+
return (0,validation.checkValidFormat)(value, regexPattern, error_codes.scorm12_errors.TYPE_MISMATCH, AICCValidationError, allowEmptyString);
|
|
39
61
|
}
|
|
40
62
|
|
|
41
63
|
// EXTERNAL MODULE: ./src/constants/regex.ts
|
|
@@ -50,7 +72,7 @@ var regex = __webpack_require__(417);
|
|
|
50
72
|
|
|
51
73
|
|
|
52
74
|
var CMIEvaluation = (function (_super) {
|
|
53
|
-
(0,tslib_es6
|
|
75
|
+
(0,tslib_es6.__extends)(CMIEvaluation, _super);
|
|
54
76
|
function CMIEvaluation() {
|
|
55
77
|
var _this = _super.call(this) || this;
|
|
56
78
|
_this.comments = new CMIEvaluationComments();
|
|
@@ -61,6 +83,11 @@ var CMIEvaluation = (function (_super) {
|
|
|
61
83
|
_super.prototype.initialize.call(this);
|
|
62
84
|
(_a = this.comments) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
63
85
|
};
|
|
86
|
+
CMIEvaluation.prototype.reset = function () {
|
|
87
|
+
var _a;
|
|
88
|
+
this._initialized = false;
|
|
89
|
+
(_a = this.comments) === null || _a === void 0 ? void 0 : _a.reset();
|
|
90
|
+
};
|
|
64
91
|
CMIEvaluation.prototype.toJSON = function () {
|
|
65
92
|
this.jsonString = true;
|
|
66
93
|
var result = {
|
|
@@ -70,21 +97,21 @@ var CMIEvaluation = (function (_super) {
|
|
|
70
97
|
return result;
|
|
71
98
|
};
|
|
72
99
|
return CMIEvaluation;
|
|
73
|
-
}(base_cmi
|
|
100
|
+
}(base_cmi.BaseCMI));
|
|
74
101
|
|
|
75
102
|
var CMIEvaluationComments = (function (_super) {
|
|
76
|
-
(0,tslib_es6
|
|
103
|
+
(0,tslib_es6.__extends)(CMIEvaluationComments, _super);
|
|
77
104
|
function CMIEvaluationComments() {
|
|
78
105
|
return _super.call(this, {
|
|
79
|
-
children: api_constants
|
|
80
|
-
errorCode: error_codes
|
|
81
|
-
errorClass:
|
|
106
|
+
children: api_constants.aicc_constants.comments_children,
|
|
107
|
+
errorCode: error_codes.scorm12_errors.INVALID_SET_VALUE,
|
|
108
|
+
errorClass: AICCValidationError,
|
|
82
109
|
}) || this;
|
|
83
110
|
}
|
|
84
111
|
return CMIEvaluationComments;
|
|
85
|
-
}(array
|
|
112
|
+
}(array.CMIArray));
|
|
86
113
|
var CMIEvaluationCommentsObject = (function (_super) {
|
|
87
|
-
(0,tslib_es6
|
|
114
|
+
(0,tslib_es6.__extends)(CMIEvaluationCommentsObject, _super);
|
|
88
115
|
function CMIEvaluationCommentsObject() {
|
|
89
116
|
var _this = _super.call(this) || this;
|
|
90
117
|
_this._content = "";
|
|
@@ -92,12 +119,18 @@ var CMIEvaluationCommentsObject = (function (_super) {
|
|
|
92
119
|
_this._time = "";
|
|
93
120
|
return _this;
|
|
94
121
|
}
|
|
122
|
+
CMIEvaluationCommentsObject.prototype.reset = function () {
|
|
123
|
+
this._initialized = false;
|
|
124
|
+
this._content = "";
|
|
125
|
+
this._location = "";
|
|
126
|
+
this._time = "";
|
|
127
|
+
};
|
|
95
128
|
Object.defineProperty(CMIEvaluationCommentsObject.prototype, "content", {
|
|
96
129
|
get: function () {
|
|
97
130
|
return this._content;
|
|
98
131
|
},
|
|
99
132
|
set: function (content) {
|
|
100
|
-
if (checkAICCValidFormat(content, regex
|
|
133
|
+
if (checkAICCValidFormat(content, regex.aicc_regex.CMIString256)) {
|
|
101
134
|
this._content = content;
|
|
102
135
|
}
|
|
103
136
|
},
|
|
@@ -109,7 +142,7 @@ var CMIEvaluationCommentsObject = (function (_super) {
|
|
|
109
142
|
return this._location;
|
|
110
143
|
},
|
|
111
144
|
set: function (location) {
|
|
112
|
-
if (checkAICCValidFormat(location, regex
|
|
145
|
+
if (checkAICCValidFormat(location, regex.aicc_regex.CMIString256)) {
|
|
113
146
|
this._location = location;
|
|
114
147
|
}
|
|
115
148
|
},
|
|
@@ -121,7 +154,7 @@ var CMIEvaluationCommentsObject = (function (_super) {
|
|
|
121
154
|
return this._time;
|
|
122
155
|
},
|
|
123
156
|
set: function (time) {
|
|
124
|
-
if (checkAICCValidFormat(time, regex
|
|
157
|
+
if (checkAICCValidFormat(time, regex.aicc_regex.CMITime)) {
|
|
125
158
|
this._time = time;
|
|
126
159
|
}
|
|
127
160
|
},
|
|
@@ -139,7 +172,7 @@ var CMIEvaluationCommentsObject = (function (_super) {
|
|
|
139
172
|
return result;
|
|
140
173
|
};
|
|
141
174
|
return CMIEvaluationCommentsObject;
|
|
142
|
-
}(base_cmi
|
|
175
|
+
}(base_cmi.BaseCMI));
|
|
143
176
|
|
|
144
177
|
|
|
145
178
|
// EXTERNAL MODULE: ./src/cmi/scorm12/student_preference.ts
|
|
@@ -154,17 +187,17 @@ var student_preference = __webpack_require__(181);
|
|
|
154
187
|
|
|
155
188
|
|
|
156
189
|
var AICCStudentPreferences = (function (_super) {
|
|
157
|
-
(0,tslib_es6
|
|
190
|
+
(0,tslib_es6.__extends)(AICCStudentPreferences, _super);
|
|
158
191
|
function AICCStudentPreferences() {
|
|
159
|
-
var _this = _super.call(this, api_constants
|
|
192
|
+
var _this = _super.call(this, api_constants.aicc_constants.student_preference_children) || this;
|
|
160
193
|
_this._lesson_type = "";
|
|
161
194
|
_this._text_color = "";
|
|
162
195
|
_this._text_location = "";
|
|
163
196
|
_this._text_size = "";
|
|
164
197
|
_this._video = "";
|
|
165
|
-
_this.windows = new array
|
|
166
|
-
errorCode: error_codes
|
|
167
|
-
errorClass:
|
|
198
|
+
_this.windows = new array.CMIArray({
|
|
199
|
+
errorCode: error_codes.scorm12_errors.INVALID_SET_VALUE,
|
|
200
|
+
errorClass: AICCValidationError,
|
|
168
201
|
children: "",
|
|
169
202
|
});
|
|
170
203
|
return _this;
|
|
@@ -179,7 +212,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
179
212
|
return this._lesson_type;
|
|
180
213
|
},
|
|
181
214
|
set: function (lesson_type) {
|
|
182
|
-
if (checkAICCValidFormat(lesson_type, regex
|
|
215
|
+
if (checkAICCValidFormat(lesson_type, regex.aicc_regex.CMIString256)) {
|
|
183
216
|
this._lesson_type = lesson_type;
|
|
184
217
|
}
|
|
185
218
|
},
|
|
@@ -191,7 +224,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
191
224
|
return this._text_color;
|
|
192
225
|
},
|
|
193
226
|
set: function (text_color) {
|
|
194
|
-
if (checkAICCValidFormat(text_color, regex
|
|
227
|
+
if (checkAICCValidFormat(text_color, regex.aicc_regex.CMIString256)) {
|
|
195
228
|
this._text_color = text_color;
|
|
196
229
|
}
|
|
197
230
|
},
|
|
@@ -203,7 +236,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
203
236
|
return this._text_location;
|
|
204
237
|
},
|
|
205
238
|
set: function (text_location) {
|
|
206
|
-
if (checkAICCValidFormat(text_location, regex
|
|
239
|
+
if (checkAICCValidFormat(text_location, regex.aicc_regex.CMIString256)) {
|
|
207
240
|
this._text_location = text_location;
|
|
208
241
|
}
|
|
209
242
|
},
|
|
@@ -215,7 +248,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
215
248
|
return this._text_size;
|
|
216
249
|
},
|
|
217
250
|
set: function (text_size) {
|
|
218
|
-
if (checkAICCValidFormat(text_size, regex
|
|
251
|
+
if (checkAICCValidFormat(text_size, regex.aicc_regex.CMIString256)) {
|
|
219
252
|
this._text_size = text_size;
|
|
220
253
|
}
|
|
221
254
|
},
|
|
@@ -227,7 +260,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
227
260
|
return this._video;
|
|
228
261
|
},
|
|
229
262
|
set: function (video) {
|
|
230
|
-
if (checkAICCValidFormat(video, regex
|
|
263
|
+
if (checkAICCValidFormat(video, regex.aicc_regex.CMIString256)) {
|
|
231
264
|
this._video = video;
|
|
232
265
|
}
|
|
233
266
|
},
|
|
@@ -252,7 +285,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
252
285
|
return result;
|
|
253
286
|
};
|
|
254
287
|
return AICCStudentPreferences;
|
|
255
|
-
}(student_preference
|
|
288
|
+
}(student_preference.CMIStudentPreference));
|
|
256
289
|
|
|
257
290
|
|
|
258
291
|
;// ./src/cmi/aicc/student_demographics.ts
|
|
@@ -262,10 +295,10 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
262
295
|
|
|
263
296
|
|
|
264
297
|
var CMIStudentDemographics = (function (_super) {
|
|
265
|
-
(0,tslib_es6
|
|
298
|
+
(0,tslib_es6.__extends)(CMIStudentDemographics, _super);
|
|
266
299
|
function CMIStudentDemographics() {
|
|
267
300
|
var _this = _super.call(this) || this;
|
|
268
|
-
_this.__children = api_constants
|
|
301
|
+
_this.__children = api_constants.aicc_constants.student_demographics_children;
|
|
269
302
|
_this._city = "";
|
|
270
303
|
_this._class = "";
|
|
271
304
|
_this._company = "";
|
|
@@ -281,6 +314,9 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
281
314
|
_this._years_experience = "";
|
|
282
315
|
return _this;
|
|
283
316
|
}
|
|
317
|
+
CMIStudentDemographics.prototype.reset = function () {
|
|
318
|
+
this._initialized = false;
|
|
319
|
+
};
|
|
284
320
|
Object.defineProperty(CMIStudentDemographics.prototype, "_children", {
|
|
285
321
|
get: function () {
|
|
286
322
|
return this.__children;
|
|
@@ -294,7 +330,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
294
330
|
},
|
|
295
331
|
set: function (city) {
|
|
296
332
|
if (this.initialized) {
|
|
297
|
-
throw new
|
|
333
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
298
334
|
}
|
|
299
335
|
else {
|
|
300
336
|
this._city = city;
|
|
@@ -309,7 +345,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
309
345
|
},
|
|
310
346
|
set: function (clazz) {
|
|
311
347
|
if (this.initialized) {
|
|
312
|
-
throw new
|
|
348
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
313
349
|
}
|
|
314
350
|
else {
|
|
315
351
|
this._class = clazz;
|
|
@@ -324,7 +360,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
324
360
|
},
|
|
325
361
|
set: function (company) {
|
|
326
362
|
if (this.initialized) {
|
|
327
|
-
throw new
|
|
363
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
328
364
|
}
|
|
329
365
|
else {
|
|
330
366
|
this._company = company;
|
|
@@ -339,7 +375,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
339
375
|
},
|
|
340
376
|
set: function (country) {
|
|
341
377
|
if (this.initialized) {
|
|
342
|
-
throw new
|
|
378
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
343
379
|
}
|
|
344
380
|
else {
|
|
345
381
|
this._country = country;
|
|
@@ -354,7 +390,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
354
390
|
},
|
|
355
391
|
set: function (experience) {
|
|
356
392
|
if (this.initialized) {
|
|
357
|
-
throw new
|
|
393
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
358
394
|
}
|
|
359
395
|
else {
|
|
360
396
|
this._experience = experience;
|
|
@@ -369,7 +405,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
369
405
|
},
|
|
370
406
|
set: function (familiar_name) {
|
|
371
407
|
if (this.initialized) {
|
|
372
|
-
throw new
|
|
408
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
373
409
|
}
|
|
374
410
|
else {
|
|
375
411
|
this._familiar_name = familiar_name;
|
|
@@ -384,7 +420,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
384
420
|
},
|
|
385
421
|
set: function (instructor_name) {
|
|
386
422
|
if (this.initialized) {
|
|
387
|
-
throw new
|
|
423
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
388
424
|
}
|
|
389
425
|
else {
|
|
390
426
|
this._instructor_name = instructor_name;
|
|
@@ -399,7 +435,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
399
435
|
},
|
|
400
436
|
set: function (title) {
|
|
401
437
|
if (this.initialized) {
|
|
402
|
-
throw new
|
|
438
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
403
439
|
}
|
|
404
440
|
else {
|
|
405
441
|
this._title = title;
|
|
@@ -414,7 +450,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
414
450
|
},
|
|
415
451
|
set: function (native_language) {
|
|
416
452
|
if (this.initialized) {
|
|
417
|
-
throw new
|
|
453
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
418
454
|
}
|
|
419
455
|
else {
|
|
420
456
|
this._native_language = native_language;
|
|
@@ -429,7 +465,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
429
465
|
},
|
|
430
466
|
set: function (state) {
|
|
431
467
|
if (this.initialized) {
|
|
432
|
-
throw new
|
|
468
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
433
469
|
}
|
|
434
470
|
else {
|
|
435
471
|
this._state = state;
|
|
@@ -444,7 +480,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
444
480
|
},
|
|
445
481
|
set: function (street_address) {
|
|
446
482
|
if (this.initialized) {
|
|
447
|
-
throw new
|
|
483
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
448
484
|
}
|
|
449
485
|
else {
|
|
450
486
|
this._street_address = street_address;
|
|
@@ -459,7 +495,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
459
495
|
},
|
|
460
496
|
set: function (telephone) {
|
|
461
497
|
if (this.initialized) {
|
|
462
|
-
throw new
|
|
498
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
463
499
|
}
|
|
464
500
|
else {
|
|
465
501
|
this._telephone = telephone;
|
|
@@ -474,7 +510,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
474
510
|
},
|
|
475
511
|
set: function (years_experience) {
|
|
476
512
|
if (this.initialized) {
|
|
477
|
-
throw new
|
|
513
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
478
514
|
}
|
|
479
515
|
else {
|
|
480
516
|
this._years_experience = years_experience;
|
|
@@ -504,7 +540,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
504
540
|
return result;
|
|
505
541
|
};
|
|
506
542
|
return CMIStudentDemographics;
|
|
507
|
-
}(base_cmi
|
|
543
|
+
}(base_cmi.BaseCMI));
|
|
508
544
|
|
|
509
545
|
|
|
510
546
|
// EXTERNAL MODULE: ./src/cmi/common/score.ts
|
|
@@ -520,28 +556,28 @@ var score = __webpack_require__(434);
|
|
|
520
556
|
|
|
521
557
|
|
|
522
558
|
var CMITries = (function (_super) {
|
|
523
|
-
(0,tslib_es6
|
|
559
|
+
(0,tslib_es6.__extends)(CMITries, _super);
|
|
524
560
|
function CMITries() {
|
|
525
561
|
return _super.call(this, {
|
|
526
|
-
children: api_constants
|
|
562
|
+
children: api_constants.aicc_constants.tries_children,
|
|
527
563
|
}) || this;
|
|
528
564
|
}
|
|
529
565
|
return CMITries;
|
|
530
|
-
}(array
|
|
566
|
+
}(array.CMIArray));
|
|
531
567
|
|
|
532
568
|
var CMITriesObject = (function (_super) {
|
|
533
|
-
(0,tslib_es6
|
|
569
|
+
(0,tslib_es6.__extends)(CMITriesObject, _super);
|
|
534
570
|
function CMITriesObject() {
|
|
535
571
|
var _this = _super.call(this) || this;
|
|
536
572
|
_this._status = "";
|
|
537
573
|
_this._time = "";
|
|
538
|
-
_this.score = new score
|
|
539
|
-
score_children: api_constants
|
|
540
|
-
score_range: regex
|
|
541
|
-
invalidErrorCode: error_codes
|
|
542
|
-
invalidTypeCode: error_codes
|
|
543
|
-
invalidRangeCode: error_codes
|
|
544
|
-
errorClass:
|
|
574
|
+
_this.score = new score.CMIScore({
|
|
575
|
+
score_children: api_constants.aicc_constants.score_children,
|
|
576
|
+
score_range: regex.aicc_regex.score_range,
|
|
577
|
+
invalidErrorCode: error_codes.scorm12_errors.INVALID_SET_VALUE,
|
|
578
|
+
invalidTypeCode: error_codes.scorm12_errors.TYPE_MISMATCH,
|
|
579
|
+
invalidRangeCode: error_codes.scorm12_errors.VALUE_OUT_OF_RANGE,
|
|
580
|
+
errorClass: AICCValidationError,
|
|
545
581
|
});
|
|
546
582
|
return _this;
|
|
547
583
|
}
|
|
@@ -550,12 +586,19 @@ var CMITriesObject = (function (_super) {
|
|
|
550
586
|
_super.prototype.initialize.call(this);
|
|
551
587
|
(_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
552
588
|
};
|
|
589
|
+
CMITriesObject.prototype.reset = function () {
|
|
590
|
+
var _a;
|
|
591
|
+
this._initialized = false;
|
|
592
|
+
this._status = "";
|
|
593
|
+
this._time = "";
|
|
594
|
+
(_a = this.score) === null || _a === void 0 ? void 0 : _a.reset();
|
|
595
|
+
};
|
|
553
596
|
Object.defineProperty(CMITriesObject.prototype, "status", {
|
|
554
597
|
get: function () {
|
|
555
598
|
return this._status;
|
|
556
599
|
},
|
|
557
600
|
set: function (status) {
|
|
558
|
-
if (checkAICCValidFormat(status, regex
|
|
601
|
+
if (checkAICCValidFormat(status, regex.aicc_regex.CMIStatus2)) {
|
|
559
602
|
this._status = status;
|
|
560
603
|
}
|
|
561
604
|
},
|
|
@@ -567,7 +610,7 @@ var CMITriesObject = (function (_super) {
|
|
|
567
610
|
return this._time;
|
|
568
611
|
},
|
|
569
612
|
set: function (time) {
|
|
570
|
-
if (checkAICCValidFormat(time, regex
|
|
613
|
+
if (checkAICCValidFormat(time, regex.aicc_regex.CMITime)) {
|
|
571
614
|
this._time = time;
|
|
572
615
|
}
|
|
573
616
|
},
|
|
@@ -585,7 +628,7 @@ var CMITriesObject = (function (_super) {
|
|
|
585
628
|
return result;
|
|
586
629
|
};
|
|
587
630
|
return CMITriesObject;
|
|
588
|
-
}(base_cmi
|
|
631
|
+
}(base_cmi.BaseCMI));
|
|
589
632
|
|
|
590
633
|
|
|
591
634
|
// EXTERNAL MODULE: ./src/cmi/scorm12/student_data.ts
|
|
@@ -601,41 +644,47 @@ var student_data = __webpack_require__(532);
|
|
|
601
644
|
|
|
602
645
|
|
|
603
646
|
var CMIAttemptRecords = (function (_super) {
|
|
604
|
-
(0,tslib_es6
|
|
647
|
+
(0,tslib_es6.__extends)(CMIAttemptRecords, _super);
|
|
605
648
|
function CMIAttemptRecords() {
|
|
606
649
|
return _super.call(this, {
|
|
607
|
-
children: api_constants
|
|
650
|
+
children: api_constants.aicc_constants.attempt_records_children,
|
|
608
651
|
}) || this;
|
|
609
652
|
}
|
|
610
653
|
return CMIAttemptRecords;
|
|
611
|
-
}(array
|
|
654
|
+
}(array.CMIArray));
|
|
612
655
|
|
|
613
656
|
var CMIAttemptRecordsObject = (function (_super) {
|
|
614
|
-
(0,tslib_es6
|
|
657
|
+
(0,tslib_es6.__extends)(CMIAttemptRecordsObject, _super);
|
|
615
658
|
function CMIAttemptRecordsObject() {
|
|
616
659
|
var _this = _super.call(this) || this;
|
|
617
660
|
_this._lesson_status = "";
|
|
618
|
-
_this.score = new score
|
|
619
|
-
score_children: api_constants
|
|
620
|
-
score_range: regex
|
|
621
|
-
invalidErrorCode: error_codes
|
|
622
|
-
invalidTypeCode: error_codes
|
|
623
|
-
invalidRangeCode: error_codes
|
|
624
|
-
errorClass:
|
|
661
|
+
_this.score = new score.CMIScore({
|
|
662
|
+
score_children: api_constants.aicc_constants.score_children,
|
|
663
|
+
score_range: regex.aicc_regex.score_range,
|
|
664
|
+
invalidErrorCode: error_codes.scorm12_errors.INVALID_SET_VALUE,
|
|
665
|
+
invalidTypeCode: error_codes.scorm12_errors.TYPE_MISMATCH,
|
|
666
|
+
invalidRangeCode: error_codes.scorm12_errors.VALUE_OUT_OF_RANGE,
|
|
667
|
+
errorClass: AICCValidationError,
|
|
625
668
|
});
|
|
626
669
|
return _this;
|
|
627
670
|
}
|
|
628
671
|
CMIAttemptRecordsObject.prototype.initialize = function () {
|
|
629
672
|
var _a;
|
|
630
673
|
_super.prototype.initialize.call(this);
|
|
674
|
+
this._lesson_status = "";
|
|
631
675
|
(_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
632
676
|
};
|
|
677
|
+
CMIAttemptRecordsObject.prototype.reset = function () {
|
|
678
|
+
var _a;
|
|
679
|
+
this._initialized = false;
|
|
680
|
+
(_a = this.score) === null || _a === void 0 ? void 0 : _a.reset();
|
|
681
|
+
};
|
|
633
682
|
Object.defineProperty(CMIAttemptRecordsObject.prototype, "lesson_status", {
|
|
634
683
|
get: function () {
|
|
635
684
|
return this._lesson_status;
|
|
636
685
|
},
|
|
637
686
|
set: function (lesson_status) {
|
|
638
|
-
if (checkAICCValidFormat(lesson_status, regex
|
|
687
|
+
if (checkAICCValidFormat(lesson_status, regex.aicc_regex.CMIStatus2)) {
|
|
639
688
|
this._lesson_status = lesson_status;
|
|
640
689
|
}
|
|
641
690
|
},
|
|
@@ -652,7 +701,7 @@ var CMIAttemptRecordsObject = (function (_super) {
|
|
|
652
701
|
return result;
|
|
653
702
|
};
|
|
654
703
|
return CMIAttemptRecordsObject;
|
|
655
|
-
}(base_cmi
|
|
704
|
+
}(base_cmi.BaseCMI));
|
|
656
705
|
|
|
657
706
|
|
|
658
707
|
;// ./src/cmi/aicc/student_data.ts
|
|
@@ -664,9 +713,9 @@ var CMIAttemptRecordsObject = (function (_super) {
|
|
|
664
713
|
|
|
665
714
|
|
|
666
715
|
var AICCCMIStudentData = (function (_super) {
|
|
667
|
-
(0,tslib_es6
|
|
716
|
+
(0,tslib_es6.__extends)(AICCCMIStudentData, _super);
|
|
668
717
|
function AICCCMIStudentData() {
|
|
669
|
-
var _this = _super.call(this, api_constants
|
|
718
|
+
var _this = _super.call(this, api_constants.aicc_constants.student_data_children) || this;
|
|
670
719
|
_this._tries_during_lesson = "";
|
|
671
720
|
_this.tries = new CMITries();
|
|
672
721
|
_this.attempt_records = new CMIAttemptRecords();
|
|
@@ -678,13 +727,19 @@ var AICCCMIStudentData = (function (_super) {
|
|
|
678
727
|
(_a = this.tries) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
679
728
|
(_b = this.attempt_records) === null || _b === void 0 ? void 0 : _b.initialize();
|
|
680
729
|
};
|
|
730
|
+
AICCCMIStudentData.prototype.reset = function () {
|
|
731
|
+
var _a, _b;
|
|
732
|
+
this._initialized = false;
|
|
733
|
+
(_a = this.tries) === null || _a === void 0 ? void 0 : _a.reset(true);
|
|
734
|
+
(_b = this.attempt_records) === null || _b === void 0 ? void 0 : _b.reset(true);
|
|
735
|
+
};
|
|
681
736
|
Object.defineProperty(AICCCMIStudentData.prototype, "tries_during_lesson", {
|
|
682
737
|
get: function () {
|
|
683
738
|
return this._tries_during_lesson;
|
|
684
739
|
},
|
|
685
740
|
set: function (tries_during_lesson) {
|
|
686
741
|
if (this.initialized) {
|
|
687
|
-
throw new
|
|
742
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
688
743
|
}
|
|
689
744
|
else {
|
|
690
745
|
this._tries_during_lesson = tries_during_lesson;
|
|
@@ -706,7 +761,7 @@ var AICCCMIStudentData = (function (_super) {
|
|
|
706
761
|
return result;
|
|
707
762
|
};
|
|
708
763
|
return AICCCMIStudentData;
|
|
709
|
-
}(student_data
|
|
764
|
+
}(student_data.CMIStudentData));
|
|
710
765
|
|
|
711
766
|
|
|
712
767
|
;// ./src/cmi/aicc/paths.ts
|
|
@@ -717,17 +772,17 @@ var AICCCMIStudentData = (function (_super) {
|
|
|
717
772
|
|
|
718
773
|
|
|
719
774
|
var CMIPaths = (function (_super) {
|
|
720
|
-
(0,tslib_es6
|
|
775
|
+
(0,tslib_es6.__extends)(CMIPaths, _super);
|
|
721
776
|
function CMIPaths() {
|
|
722
777
|
return _super.call(this, {
|
|
723
|
-
children: api_constants
|
|
778
|
+
children: api_constants.aicc_constants.paths_children,
|
|
724
779
|
}) || this;
|
|
725
780
|
}
|
|
726
781
|
return CMIPaths;
|
|
727
|
-
}(array
|
|
782
|
+
}(array.CMIArray));
|
|
728
783
|
|
|
729
784
|
var CMIPathsObject = (function (_super) {
|
|
730
|
-
(0,tslib_es6
|
|
785
|
+
(0,tslib_es6.__extends)(CMIPathsObject, _super);
|
|
731
786
|
function CMIPathsObject() {
|
|
732
787
|
var _this = _super.call(this) || this;
|
|
733
788
|
_this._location_id = "";
|
|
@@ -738,12 +793,21 @@ var CMIPathsObject = (function (_super) {
|
|
|
738
793
|
_this._time_in_element = "";
|
|
739
794
|
return _this;
|
|
740
795
|
}
|
|
796
|
+
CMIPathsObject.prototype.reset = function () {
|
|
797
|
+
this._initialized = false;
|
|
798
|
+
this._location_id = "";
|
|
799
|
+
this._date = "";
|
|
800
|
+
this._time = "";
|
|
801
|
+
this._status = "";
|
|
802
|
+
this._why_left = "";
|
|
803
|
+
this._time_in_element = "";
|
|
804
|
+
};
|
|
741
805
|
Object.defineProperty(CMIPathsObject.prototype, "location_id", {
|
|
742
806
|
get: function () {
|
|
743
807
|
return this._location_id;
|
|
744
808
|
},
|
|
745
809
|
set: function (location_id) {
|
|
746
|
-
if (checkAICCValidFormat(location_id, regex
|
|
810
|
+
if (checkAICCValidFormat(location_id, regex.aicc_regex.CMIString256)) {
|
|
747
811
|
this._location_id = location_id;
|
|
748
812
|
}
|
|
749
813
|
},
|
|
@@ -755,7 +819,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
755
819
|
return this._date;
|
|
756
820
|
},
|
|
757
821
|
set: function (date) {
|
|
758
|
-
if (checkAICCValidFormat(date, regex
|
|
822
|
+
if (checkAICCValidFormat(date, regex.aicc_regex.CMIString256)) {
|
|
759
823
|
this._date = date;
|
|
760
824
|
}
|
|
761
825
|
},
|
|
@@ -767,7 +831,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
767
831
|
return this._time;
|
|
768
832
|
},
|
|
769
833
|
set: function (time) {
|
|
770
|
-
if (checkAICCValidFormat(time, regex
|
|
834
|
+
if (checkAICCValidFormat(time, regex.aicc_regex.CMITime)) {
|
|
771
835
|
this._time = time;
|
|
772
836
|
}
|
|
773
837
|
},
|
|
@@ -779,7 +843,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
779
843
|
return this._status;
|
|
780
844
|
},
|
|
781
845
|
set: function (status) {
|
|
782
|
-
if (checkAICCValidFormat(status, regex
|
|
846
|
+
if (checkAICCValidFormat(status, regex.aicc_regex.CMIStatus2)) {
|
|
783
847
|
this._status = status;
|
|
784
848
|
}
|
|
785
849
|
},
|
|
@@ -791,7 +855,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
791
855
|
return this._why_left;
|
|
792
856
|
},
|
|
793
857
|
set: function (why_left) {
|
|
794
|
-
if (checkAICCValidFormat(why_left, regex
|
|
858
|
+
if (checkAICCValidFormat(why_left, regex.aicc_regex.CMIString256)) {
|
|
795
859
|
this._why_left = why_left;
|
|
796
860
|
}
|
|
797
861
|
},
|
|
@@ -803,7 +867,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
803
867
|
return this._time_in_element;
|
|
804
868
|
},
|
|
805
869
|
set: function (time_in_element) {
|
|
806
|
-
if (checkAICCValidFormat(time_in_element, regex
|
|
870
|
+
if (checkAICCValidFormat(time_in_element, regex.aicc_regex.CMITime)) {
|
|
807
871
|
this._time_in_element = time_in_element;
|
|
808
872
|
}
|
|
809
873
|
},
|
|
@@ -824,7 +888,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
824
888
|
return result;
|
|
825
889
|
};
|
|
826
890
|
return CMIPathsObject;
|
|
827
|
-
}(base_cmi
|
|
891
|
+
}(base_cmi.BaseCMI));
|
|
828
892
|
|
|
829
893
|
|
|
830
894
|
;// ./src/cmi/aicc/cmi.ts
|
|
@@ -837,10 +901,10 @@ var CMIPathsObject = (function (_super) {
|
|
|
837
901
|
|
|
838
902
|
|
|
839
903
|
var CMI = (function (_super) {
|
|
840
|
-
(0,tslib_es6
|
|
904
|
+
(0,tslib_es6.__extends)(CMI, _super);
|
|
841
905
|
function CMI(initialized) {
|
|
842
906
|
if (initialized === void 0) { initialized = false; }
|
|
843
|
-
var _this = _super.call(this, api_constants
|
|
907
|
+
var _this = _super.call(this, api_constants.aicc_constants.cmi_children) || this;
|
|
844
908
|
if (initialized)
|
|
845
909
|
_this.initialize();
|
|
846
910
|
_this.student_preference = new AICCStudentPreferences();
|
|
@@ -879,7 +943,7 @@ var CMI = (function (_super) {
|
|
|
879
943
|
return result;
|
|
880
944
|
};
|
|
881
945
|
return CMI;
|
|
882
|
-
}(cmi
|
|
946
|
+
}(cmi.CMI));
|
|
883
947
|
|
|
884
948
|
|
|
885
949
|
// EXTERNAL MODULE: ./src/cmi/scorm12/nav.ts
|
|
@@ -897,26 +961,26 @@ var utilities = __webpack_require__(864);
|
|
|
897
961
|
|
|
898
962
|
|
|
899
963
|
var AICCImpl = (function (_super) {
|
|
900
|
-
(0,tslib_es6
|
|
964
|
+
(0,tslib_es6.__extends)(AICCImpl, _super);
|
|
901
965
|
function AICCImpl(settings) {
|
|
902
966
|
var _this = _super.call(this, settings) || this;
|
|
903
967
|
_this.cmi = new CMI();
|
|
904
|
-
_this.nav = new nav
|
|
968
|
+
_this.nav = new nav.NAV();
|
|
905
969
|
return _this;
|
|
906
970
|
}
|
|
907
971
|
AICCImpl.prototype.getChildElement = function (CMIElement, value, foundFirstIndex) {
|
|
908
972
|
var newChild = _super.prototype.getChildElement.call(this, CMIElement, value, foundFirstIndex);
|
|
909
973
|
if (!newChild) {
|
|
910
|
-
if ((0,utilities
|
|
974
|
+
if ((0,utilities.stringMatches)(CMIElement, "cmi\\.evaluation\\.comments\\.\\d+")) {
|
|
911
975
|
newChild = new CMIEvaluationCommentsObject();
|
|
912
976
|
}
|
|
913
|
-
else if ((0,utilities
|
|
977
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.student_data\\.tries\\.\\d+")) {
|
|
914
978
|
newChild = new CMITriesObject();
|
|
915
979
|
}
|
|
916
|
-
else if ((0,utilities
|
|
980
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.student_data\\.attempt_records\\.\\d+")) {
|
|
917
981
|
newChild = new CMIAttemptRecordsObject();
|
|
918
982
|
}
|
|
919
|
-
else if ((0,utilities
|
|
983
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.paths\\.\\d+")) {
|
|
920
984
|
newChild = new CMIPathsObject();
|
|
921
985
|
}
|
|
922
986
|
}
|
|
@@ -936,10 +1000,12 @@ var AICCImpl = (function (_super) {
|
|
|
936
1000
|
/***/ 429:
|
|
937
1001
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
938
1002
|
|
|
1003
|
+
// ESM COMPAT FLAG
|
|
1004
|
+
__webpack_require__.r(__webpack_exports__);
|
|
939
1005
|
|
|
940
1006
|
// EXPORTS
|
|
941
1007
|
__webpack_require__.d(__webpack_exports__, {
|
|
942
|
-
|
|
1008
|
+
"default": function() { return /* binding */ src_BaseAPI; }
|
|
943
1009
|
});
|
|
944
1010
|
|
|
945
1011
|
// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs
|
|
@@ -948,15 +1014,16 @@ var tslib_es6 = __webpack_require__(635);
|
|
|
948
1014
|
var array = __webpack_require__(589);
|
|
949
1015
|
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
950
1016
|
var exceptions = __webpack_require__(784);
|
|
951
|
-
// EXTERNAL MODULE: ./src/constants/error_codes.ts
|
|
952
|
-
var error_codes = __webpack_require__(797);
|
|
953
1017
|
// EXTERNAL MODULE: ./src/constants/api_constants.ts
|
|
954
1018
|
var api_constants = __webpack_require__(340);
|
|
955
1019
|
// EXTERNAL MODULE: ./src/utilities.ts
|
|
956
1020
|
var utilities = __webpack_require__(864);
|
|
1021
|
+
// EXTERNAL MODULE: ./src/constants/enums.ts
|
|
1022
|
+
var enums = __webpack_require__(56);
|
|
957
1023
|
;// ./src/constants/default_settings.ts
|
|
958
1024
|
|
|
959
1025
|
|
|
1026
|
+
|
|
960
1027
|
var DefaultSettings = {
|
|
961
1028
|
autocommit: false,
|
|
962
1029
|
autocommitSeconds: 10,
|
|
@@ -966,7 +1033,7 @@ var DefaultSettings = {
|
|
|
966
1033
|
dataCommitFormat: "json",
|
|
967
1034
|
commitRequestDataType: "application/json;charset=UTF-8",
|
|
968
1035
|
autoProgress: false,
|
|
969
|
-
logLevel:
|
|
1036
|
+
logLevel: enums.LogLevelEnum.ERROR,
|
|
970
1037
|
selfReportSessionTime: false,
|
|
971
1038
|
alwaysSendTotalTime: false,
|
|
972
1039
|
renderCommonCommitFields: false,
|
|
@@ -975,9 +1042,9 @@ var DefaultSettings = {
|
|
|
975
1042
|
xhrWithCredentials: false,
|
|
976
1043
|
fetchMode: "cors",
|
|
977
1044
|
responseHandler: function (response) {
|
|
978
|
-
return (0,tslib_es6
|
|
1045
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
979
1046
|
var responseText, httpResult;
|
|
980
|
-
return (0,tslib_es6
|
|
1047
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
981
1048
|
switch (_a.label) {
|
|
982
1049
|
case 0:
|
|
983
1050
|
if (!(typeof response !== "undefined")) return [3, 2];
|
|
@@ -992,13 +1059,13 @@ var DefaultSettings = {
|
|
|
992
1059
|
!{}.hasOwnProperty.call(httpResult, "result")) {
|
|
993
1060
|
if (response.status === 200) {
|
|
994
1061
|
return [2, {
|
|
995
|
-
result: api_constants
|
|
1062
|
+
result: api_constants.global_constants.SCORM_TRUE,
|
|
996
1063
|
errorCode: 0,
|
|
997
1064
|
}];
|
|
998
1065
|
}
|
|
999
1066
|
else {
|
|
1000
1067
|
return [2, {
|
|
1001
|
-
result: api_constants
|
|
1068
|
+
result: api_constants.global_constants.SCORM_FALSE,
|
|
1002
1069
|
errorCode: 101,
|
|
1003
1070
|
}];
|
|
1004
1071
|
}
|
|
@@ -1008,14 +1075,14 @@ var DefaultSettings = {
|
|
|
1008
1075
|
result: httpResult.result,
|
|
1009
1076
|
errorCode: httpResult.errorCode
|
|
1010
1077
|
? httpResult.errorCode
|
|
1011
|
-
: httpResult.result === api_constants
|
|
1078
|
+
: httpResult.result === api_constants.global_constants.SCORM_TRUE
|
|
1012
1079
|
? 0
|
|
1013
1080
|
: 101,
|
|
1014
1081
|
}];
|
|
1015
1082
|
}
|
|
1016
1083
|
_a.label = 2;
|
|
1017
1084
|
case 2: return [2, {
|
|
1018
|
-
result: api_constants
|
|
1085
|
+
result: api_constants.global_constants.SCORM_FALSE,
|
|
1019
1086
|
errorCode: 101,
|
|
1020
1087
|
}];
|
|
1021
1088
|
}
|
|
@@ -1027,16 +1094,28 @@ var DefaultSettings = {
|
|
|
1027
1094
|
},
|
|
1028
1095
|
onLogMessage: function (messageLevel, logMessage) {
|
|
1029
1096
|
switch (messageLevel) {
|
|
1030
|
-
case
|
|
1097
|
+
case "4":
|
|
1098
|
+
case 4:
|
|
1099
|
+
case "ERROR":
|
|
1100
|
+
case enums.LogLevelEnum.ERROR:
|
|
1031
1101
|
console.error(logMessage);
|
|
1032
1102
|
break;
|
|
1033
|
-
case
|
|
1103
|
+
case "3":
|
|
1104
|
+
case 3:
|
|
1105
|
+
case "WARN":
|
|
1106
|
+
case enums.LogLevelEnum.WARN:
|
|
1034
1107
|
console.warn(logMessage);
|
|
1035
1108
|
break;
|
|
1036
|
-
case
|
|
1109
|
+
case "2":
|
|
1110
|
+
case 2:
|
|
1111
|
+
case "INFO":
|
|
1112
|
+
case enums.LogLevelEnum.INFO:
|
|
1037
1113
|
console.info(logMessage);
|
|
1038
1114
|
break;
|
|
1039
|
-
case
|
|
1115
|
+
case "1":
|
|
1116
|
+
case 1:
|
|
1117
|
+
case "DEBUG":
|
|
1118
|
+
case enums.LogLevelEnum.DEBUG:
|
|
1040
1119
|
if (console.debug) {
|
|
1041
1120
|
console.debug(logMessage);
|
|
1042
1121
|
}
|
|
@@ -1048,6 +1127,7 @@ var DefaultSettings = {
|
|
|
1048
1127
|
},
|
|
1049
1128
|
scoItemIds: [],
|
|
1050
1129
|
scoItemIdValidator: false,
|
|
1130
|
+
globalObjectiveIds: [],
|
|
1051
1131
|
};
|
|
1052
1132
|
|
|
1053
1133
|
;// ./src/helpers/scheduled_commit.ts
|
|
@@ -1068,7 +1148,7 @@ var ScheduledCommit = (function () {
|
|
|
1068
1148
|
ScheduledCommit.prototype.wrapper = function () {
|
|
1069
1149
|
var _this = this;
|
|
1070
1150
|
if (!this._cancelled) {
|
|
1071
|
-
(function () { return (0,tslib_es6
|
|
1151
|
+
(function () { return (0,tslib_es6.__awaiter)(_this, void 0, void 0, function () { return (0,tslib_es6.__generator)(this, function (_a) {
|
|
1072
1152
|
switch (_a.label) {
|
|
1073
1153
|
case 0: return [4, this._API.commit(this._callback)];
|
|
1074
1154
|
case 1: return [2, _a.sent()];
|
|
@@ -1096,7 +1176,7 @@ var BaseAPI = (function () {
|
|
|
1096
1176
|
if (_newTarget === BaseAPI) {
|
|
1097
1177
|
throw new TypeError("Cannot construct BaseAPI instances directly");
|
|
1098
1178
|
}
|
|
1099
|
-
this.currentState = api_constants
|
|
1179
|
+
this.currentState = api_constants.global_constants.STATE_NOT_INITIALIZED;
|
|
1100
1180
|
this.lastErrorCode = "0";
|
|
1101
1181
|
this.listenerArray = [];
|
|
1102
1182
|
this._error_codes = error_codes;
|
|
@@ -1105,15 +1185,21 @@ var BaseAPI = (function () {
|
|
|
1105
1185
|
}
|
|
1106
1186
|
this.apiLogLevel = this.settings.logLevel;
|
|
1107
1187
|
this.selfReportSessionTime = this.settings.selfReportSessionTime;
|
|
1188
|
+
if (this.apiLogLevel === undefined) {
|
|
1189
|
+
this.apiLogLevel = enums.LogLevelEnum.NONE;
|
|
1190
|
+
}
|
|
1108
1191
|
}
|
|
1109
1192
|
BaseAPI.prototype.commonReset = function (settings) {
|
|
1110
|
-
this.
|
|
1111
|
-
this.
|
|
1193
|
+
this.apiLog("reset", "Called", enums.LogLevelEnum.INFO);
|
|
1194
|
+
this.settings = (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, this.settings), settings);
|
|
1195
|
+
this.clearScheduledCommit();
|
|
1196
|
+
this.currentState = api_constants.global_constants.STATE_NOT_INITIALIZED;
|
|
1112
1197
|
this.lastErrorCode = "0";
|
|
1113
1198
|
this.listenerArray = [];
|
|
1199
|
+
this.startingData = undefined;
|
|
1114
1200
|
};
|
|
1115
1201
|
BaseAPI.prototype.initialize = function (callbackName, initializeMessage, terminationMessage) {
|
|
1116
|
-
var returnValue = api_constants
|
|
1202
|
+
var returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1117
1203
|
if (this.isInitialized()) {
|
|
1118
1204
|
this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);
|
|
1119
1205
|
}
|
|
@@ -1124,17 +1210,17 @@ var BaseAPI = (function () {
|
|
|
1124
1210
|
if (this.selfReportSessionTime) {
|
|
1125
1211
|
this.cmi.setStartTime();
|
|
1126
1212
|
}
|
|
1127
|
-
this.currentState = api_constants
|
|
1213
|
+
this.currentState = api_constants.global_constants.STATE_INITIALIZED;
|
|
1128
1214
|
this.lastErrorCode = "0";
|
|
1129
|
-
returnValue = api_constants
|
|
1215
|
+
returnValue = api_constants.global_constants.SCORM_TRUE;
|
|
1130
1216
|
this.processListeners(callbackName);
|
|
1131
1217
|
}
|
|
1132
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
1218
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1133
1219
|
this.clearSCORMError(returnValue);
|
|
1134
1220
|
return returnValue;
|
|
1135
1221
|
};
|
|
1136
1222
|
BaseAPI.prototype.apiLog = function (functionName, logMessage, messageLevel, CMIElement) {
|
|
1137
|
-
logMessage = (0,utilities
|
|
1223
|
+
logMessage = (0,utilities.formatMessage)(functionName, logMessage, CMIElement);
|
|
1138
1224
|
if (messageLevel >= this.apiLogLevel) {
|
|
1139
1225
|
this.settings.onLogMessage(messageLevel, logMessage);
|
|
1140
1226
|
}
|
|
@@ -1151,20 +1237,20 @@ var BaseAPI = (function () {
|
|
|
1151
1237
|
return this._settings;
|
|
1152
1238
|
},
|
|
1153
1239
|
set: function (settings) {
|
|
1154
|
-
this._settings = (0,tslib_es6
|
|
1240
|
+
this._settings = (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, this._settings), settings);
|
|
1155
1241
|
},
|
|
1156
1242
|
enumerable: false,
|
|
1157
1243
|
configurable: true
|
|
1158
1244
|
});
|
|
1159
1245
|
BaseAPI.prototype.terminate = function (callbackName, checkTerminated) {
|
|
1160
|
-
return (0,tslib_es6
|
|
1246
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
1161
1247
|
var returnValue, result;
|
|
1162
|
-
return (0,tslib_es6
|
|
1248
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
1163
1249
|
switch (_a.label) {
|
|
1164
1250
|
case 0:
|
|
1165
|
-
returnValue = api_constants
|
|
1251
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1166
1252
|
if (!this.checkState(checkTerminated, this._error_codes.TERMINATION_BEFORE_INIT, this._error_codes.MULTIPLE_TERMINATION)) return [3, 2];
|
|
1167
|
-
this.currentState = api_constants
|
|
1253
|
+
this.currentState = api_constants.global_constants.STATE_TERMINATED;
|
|
1168
1254
|
return [4, this.storeData(true)];
|
|
1169
1255
|
case 1:
|
|
1170
1256
|
result = _a.sent();
|
|
@@ -1174,14 +1260,14 @@ var BaseAPI = (function () {
|
|
|
1174
1260
|
returnValue =
|
|
1175
1261
|
typeof result !== "undefined" && result.result
|
|
1176
1262
|
? result.result
|
|
1177
|
-
: api_constants
|
|
1263
|
+
: api_constants.global_constants.SCORM_FALSE;
|
|
1178
1264
|
if (checkTerminated)
|
|
1179
1265
|
this.lastErrorCode = "0";
|
|
1180
|
-
returnValue = api_constants
|
|
1266
|
+
returnValue = api_constants.global_constants.SCORM_TRUE;
|
|
1181
1267
|
this.processListeners(callbackName);
|
|
1182
1268
|
_a.label = 2;
|
|
1183
1269
|
case 2:
|
|
1184
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
1270
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1185
1271
|
this.clearSCORMError(returnValue);
|
|
1186
1272
|
return [2, returnValue];
|
|
1187
1273
|
}
|
|
@@ -1201,7 +1287,7 @@ var BaseAPI = (function () {
|
|
|
1201
1287
|
}
|
|
1202
1288
|
this.processListeners(callbackName, CMIElement);
|
|
1203
1289
|
}
|
|
1204
|
-
this.apiLog(callbackName, ": returned: " + returnValue,
|
|
1290
|
+
this.apiLog(callbackName, ": returned: " + returnValue, enums.LogLevelEnum.INFO, CMIElement);
|
|
1205
1291
|
if (returnValue === undefined) {
|
|
1206
1292
|
return "";
|
|
1207
1293
|
}
|
|
@@ -1212,7 +1298,7 @@ var BaseAPI = (function () {
|
|
|
1212
1298
|
if (value !== undefined) {
|
|
1213
1299
|
value = String(value);
|
|
1214
1300
|
}
|
|
1215
|
-
var returnValue = api_constants
|
|
1301
|
+
var returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1216
1302
|
if (this.checkState(checkTerminated, this._error_codes.STORE_BEFORE_INIT, this._error_codes.STORE_AFTER_TERM)) {
|
|
1217
1303
|
if (checkTerminated)
|
|
1218
1304
|
this.lastErrorCode = "0";
|
|
@@ -1225,27 +1311,26 @@ var BaseAPI = (function () {
|
|
|
1225
1311
|
this.processListeners(callbackName, CMIElement, value);
|
|
1226
1312
|
}
|
|
1227
1313
|
if (returnValue === undefined) {
|
|
1228
|
-
returnValue = api_constants
|
|
1314
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1229
1315
|
}
|
|
1230
1316
|
if (String(this.lastErrorCode) === "0") {
|
|
1231
1317
|
if (this.settings.autocommit) {
|
|
1232
1318
|
this.scheduleCommit(this.settings.autocommitSeconds * 1000, commitCallback);
|
|
1233
1319
|
}
|
|
1234
1320
|
}
|
|
1235
|
-
this.apiLog(callbackName, ": " + value + ": result: " + returnValue,
|
|
1321
|
+
this.apiLog(callbackName, ": " + value + ": result: " + returnValue, enums.LogLevelEnum.INFO, CMIElement);
|
|
1236
1322
|
this.clearSCORMError(returnValue);
|
|
1237
1323
|
return returnValue;
|
|
1238
1324
|
};
|
|
1239
1325
|
BaseAPI.prototype.commit = function (callbackName_1) {
|
|
1240
|
-
return (0,tslib_es6
|
|
1326
|
+
return (0,tslib_es6.__awaiter)(this, arguments, void 0, function (callbackName, checkTerminated) {
|
|
1241
1327
|
var returnValue, result;
|
|
1242
1328
|
if (checkTerminated === void 0) { checkTerminated = false; }
|
|
1243
|
-
return (0,tslib_es6
|
|
1329
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
1244
1330
|
switch (_a.label) {
|
|
1245
1331
|
case 0:
|
|
1246
|
-
console.log("commit");
|
|
1247
1332
|
this.clearScheduledCommit();
|
|
1248
|
-
returnValue = api_constants
|
|
1333
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1249
1334
|
if (!this.checkState(checkTerminated, this._error_codes.COMMIT_BEFORE_INIT, this._error_codes.COMMIT_AFTER_TERM)) return [3, 2];
|
|
1250
1335
|
return [4, this.storeData(false)];
|
|
1251
1336
|
case 1:
|
|
@@ -1256,14 +1341,14 @@ var BaseAPI = (function () {
|
|
|
1256
1341
|
returnValue =
|
|
1257
1342
|
typeof result !== "undefined" && result.result
|
|
1258
1343
|
? result.result
|
|
1259
|
-
: api_constants
|
|
1260
|
-
this.apiLog(callbackName, " Result: " + returnValue,
|
|
1344
|
+
: api_constants.global_constants.SCORM_FALSE;
|
|
1345
|
+
this.apiLog(callbackName, " Result: " + returnValue, enums.LogLevelEnum.DEBUG, "HttpRequest");
|
|
1261
1346
|
if (checkTerminated)
|
|
1262
1347
|
this.lastErrorCode = "0";
|
|
1263
1348
|
this.processListeners(callbackName);
|
|
1264
1349
|
_a.label = 2;
|
|
1265
1350
|
case 2:
|
|
1266
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
1351
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1267
1352
|
this.clearSCORMError(returnValue);
|
|
1268
1353
|
return [2, returnValue];
|
|
1269
1354
|
}
|
|
@@ -1273,7 +1358,7 @@ var BaseAPI = (function () {
|
|
|
1273
1358
|
BaseAPI.prototype.getLastError = function (callbackName) {
|
|
1274
1359
|
var returnValue = String(this.lastErrorCode);
|
|
1275
1360
|
this.processListeners(callbackName);
|
|
1276
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
1361
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1277
1362
|
return returnValue;
|
|
1278
1363
|
};
|
|
1279
1364
|
BaseAPI.prototype.getErrorString = function (callbackName, CMIErrorCode) {
|
|
@@ -1282,7 +1367,7 @@ var BaseAPI = (function () {
|
|
|
1282
1367
|
returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);
|
|
1283
1368
|
this.processListeners(callbackName);
|
|
1284
1369
|
}
|
|
1285
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
1370
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1286
1371
|
return returnValue;
|
|
1287
1372
|
};
|
|
1288
1373
|
BaseAPI.prototype.getDiagnostic = function (callbackName, CMIErrorCode) {
|
|
@@ -1291,7 +1376,7 @@ var BaseAPI = (function () {
|
|
|
1291
1376
|
returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);
|
|
1292
1377
|
this.processListeners(callbackName);
|
|
1293
1378
|
}
|
|
1294
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
1379
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1295
1380
|
return returnValue;
|
|
1296
1381
|
};
|
|
1297
1382
|
BaseAPI.prototype.checkState = function (checkTerminated, beforeInitError, afterTermError) {
|
|
@@ -1317,11 +1402,11 @@ var BaseAPI = (function () {
|
|
|
1317
1402
|
};
|
|
1318
1403
|
BaseAPI.prototype._commonSetCMIValue = function (methodName, scorm2004, CMIElement, value) {
|
|
1319
1404
|
if (!CMIElement || CMIElement === "") {
|
|
1320
|
-
return api_constants
|
|
1405
|
+
return api_constants.global_constants.SCORM_FALSE;
|
|
1321
1406
|
}
|
|
1322
1407
|
var structure = CMIElement.split(".");
|
|
1323
1408
|
var refObject = this;
|
|
1324
|
-
var returnValue = api_constants
|
|
1409
|
+
var returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1325
1410
|
var foundFirstIndex = false;
|
|
1326
1411
|
var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element.");
|
|
1327
1412
|
var invalidErrorCode = scorm2004
|
|
@@ -1335,20 +1420,20 @@ var BaseAPI = (function () {
|
|
|
1335
1420
|
this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);
|
|
1336
1421
|
}
|
|
1337
1422
|
else {
|
|
1338
|
-
refObject = (0,tslib_es6
|
|
1423
|
+
refObject = (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, refObject), { attribute: value });
|
|
1339
1424
|
}
|
|
1340
1425
|
}
|
|
1341
1426
|
else if (!this._checkObjectHasProperty(refObject, attribute)) {
|
|
1342
1427
|
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
1343
1428
|
}
|
|
1344
1429
|
else {
|
|
1345
|
-
if ((0,utilities
|
|
1430
|
+
if ((0,utilities.stringMatches)(CMIElement, "\\.correct_responses\\.\\d+") &&
|
|
1346
1431
|
this.isInitialized()) {
|
|
1347
1432
|
this.validateCorrectResponse(CMIElement, value);
|
|
1348
1433
|
}
|
|
1349
1434
|
if (!scorm2004 || this.lastErrorCode === "0") {
|
|
1350
1435
|
refObject[attribute] = value;
|
|
1351
|
-
returnValue = api_constants
|
|
1436
|
+
returnValue = api_constants.global_constants.SCORM_TRUE;
|
|
1352
1437
|
}
|
|
1353
1438
|
}
|
|
1354
1439
|
}
|
|
@@ -1358,7 +1443,7 @@ var BaseAPI = (function () {
|
|
|
1358
1443
|
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
1359
1444
|
break;
|
|
1360
1445
|
}
|
|
1361
|
-
if (refObject instanceof array
|
|
1446
|
+
if (refObject instanceof array.CMIArray) {
|
|
1362
1447
|
var index = parseInt(structure[idx + 1], 10);
|
|
1363
1448
|
if (!isNaN(index)) {
|
|
1364
1449
|
var item = refObject.childArray[index];
|
|
@@ -1384,8 +1469,8 @@ var BaseAPI = (function () {
|
|
|
1384
1469
|
}
|
|
1385
1470
|
}
|
|
1386
1471
|
}
|
|
1387
|
-
if (returnValue === api_constants
|
|
1388
|
-
this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value),
|
|
1472
|
+
if (returnValue === api_constants.global_constants.SCORM_FALSE) {
|
|
1473
|
+
this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value), enums.LogLevelEnum.WARN);
|
|
1389
1474
|
}
|
|
1390
1475
|
return returnValue;
|
|
1391
1476
|
};
|
|
@@ -1427,7 +1512,7 @@ var BaseAPI = (function () {
|
|
|
1427
1512
|
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
1428
1513
|
break;
|
|
1429
1514
|
}
|
|
1430
|
-
if (refObject instanceof array
|
|
1515
|
+
if (refObject instanceof array.CMIArray) {
|
|
1431
1516
|
var index = parseInt(structure[idx + 1], 10);
|
|
1432
1517
|
if (!isNaN(index)) {
|
|
1433
1518
|
var item = refObject.childArray[index];
|
|
@@ -1445,10 +1530,10 @@ var BaseAPI = (function () {
|
|
|
1445
1530
|
if (refObject === null || refObject === undefined) {
|
|
1446
1531
|
if (!scorm2004) {
|
|
1447
1532
|
if (attribute === "_children") {
|
|
1448
|
-
this.throwSCORMError(
|
|
1533
|
+
this.throwSCORMError(this._error_codes.CHILDREN_ERROR);
|
|
1449
1534
|
}
|
|
1450
1535
|
else if (attribute === "_count") {
|
|
1451
|
-
this.throwSCORMError(
|
|
1536
|
+
this.throwSCORMError(this._error_codes.COUNT_ERROR);
|
|
1452
1537
|
}
|
|
1453
1538
|
}
|
|
1454
1539
|
}
|
|
@@ -1457,13 +1542,13 @@ var BaseAPI = (function () {
|
|
|
1457
1542
|
}
|
|
1458
1543
|
};
|
|
1459
1544
|
BaseAPI.prototype.isInitialized = function () {
|
|
1460
|
-
return this.currentState === api_constants
|
|
1545
|
+
return this.currentState === api_constants.global_constants.STATE_INITIALIZED;
|
|
1461
1546
|
};
|
|
1462
1547
|
BaseAPI.prototype.isNotInitialized = function () {
|
|
1463
|
-
return this.currentState === api_constants
|
|
1548
|
+
return this.currentState === api_constants.global_constants.STATE_NOT_INITIALIZED;
|
|
1464
1549
|
};
|
|
1465
1550
|
BaseAPI.prototype.isTerminated = function () {
|
|
1466
|
-
return this.currentState === api_constants
|
|
1551
|
+
return this.currentState === api_constants.global_constants.STATE_TERMINATED;
|
|
1467
1552
|
};
|
|
1468
1553
|
BaseAPI.prototype.on = function (listenerName, callback) {
|
|
1469
1554
|
if (!callback)
|
|
@@ -1483,7 +1568,7 @@ var BaseAPI = (function () {
|
|
|
1483
1568
|
CMIElement: CMIElement,
|
|
1484
1569
|
callback: callback,
|
|
1485
1570
|
});
|
|
1486
|
-
this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length),
|
|
1571
|
+
this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), enums.LogLevelEnum.INFO, functionName);
|
|
1487
1572
|
}
|
|
1488
1573
|
};
|
|
1489
1574
|
BaseAPI.prototype.off = function (listenerName, callback) {
|
|
@@ -1506,7 +1591,7 @@ var BaseAPI = (function () {
|
|
|
1506
1591
|
});
|
|
1507
1592
|
if (removeIndex !== -1) {
|
|
1508
1593
|
this_1.listenerArray.splice(removeIndex, 1);
|
|
1509
|
-
this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length),
|
|
1594
|
+
this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), enums.LogLevelEnum.INFO, functionName);
|
|
1510
1595
|
}
|
|
1511
1596
|
};
|
|
1512
1597
|
var this_1 = this;
|
|
@@ -1539,7 +1624,7 @@ var BaseAPI = (function () {
|
|
|
1539
1624
|
}
|
|
1540
1625
|
};
|
|
1541
1626
|
BaseAPI.prototype.processListeners = function (functionName, CMIElement, value) {
|
|
1542
|
-
this.apiLog(functionName, value,
|
|
1627
|
+
this.apiLog(functionName, value, enums.LogLevelEnum.INFO, CMIElement);
|
|
1543
1628
|
for (var i = 0; i < this.listenerArray.length; i++) {
|
|
1544
1629
|
var listener = this.listenerArray[i];
|
|
1545
1630
|
var functionsMatch = listener.functionName === functionName;
|
|
@@ -1555,7 +1640,7 @@ var BaseAPI = (function () {
|
|
|
1555
1640
|
CMIElementsMatch = listener.CMIElement === CMIElement;
|
|
1556
1641
|
}
|
|
1557
1642
|
if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {
|
|
1558
|
-
this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName),
|
|
1643
|
+
this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), enums.LogLevelEnum.INFO, CMIElement);
|
|
1559
1644
|
listener.callback(CMIElement, value);
|
|
1560
1645
|
}
|
|
1561
1646
|
}
|
|
@@ -1564,11 +1649,11 @@ var BaseAPI = (function () {
|
|
|
1564
1649
|
if (!message) {
|
|
1565
1650
|
message = this.getLmsErrorMessageDetails(errorNumber);
|
|
1566
1651
|
}
|
|
1567
|
-
this.apiLog("throwSCORMError", errorNumber + ": " + message,
|
|
1652
|
+
this.apiLog("throwSCORMError", errorNumber + ": " + message, enums.LogLevelEnum.ERROR);
|
|
1568
1653
|
this.lastErrorCode = String(errorNumber);
|
|
1569
1654
|
};
|
|
1570
1655
|
BaseAPI.prototype.clearSCORMError = function (success) {
|
|
1571
|
-
if (success !== undefined && success !== api_constants
|
|
1656
|
+
if (success !== undefined && success !== api_constants.global_constants.SCORM_FALSE) {
|
|
1572
1657
|
this.lastErrorCode = "0";
|
|
1573
1658
|
}
|
|
1574
1659
|
};
|
|
@@ -1634,7 +1719,7 @@ var BaseAPI = (function () {
|
|
|
1634
1719
|
result.forEach(function (element) {
|
|
1635
1720
|
obj = {};
|
|
1636
1721
|
obj[element[0]] = element[1];
|
|
1637
|
-
_this.loadFromJSON((0,utilities
|
|
1722
|
+
_this.loadFromJSON((0,utilities.unflatten)(obj), CMIElement);
|
|
1638
1723
|
});
|
|
1639
1724
|
};
|
|
1640
1725
|
BaseAPI.prototype.loadFromJSON = function (json, CMIElement) {
|
|
@@ -1674,21 +1759,21 @@ var BaseAPI = (function () {
|
|
|
1674
1759
|
return JSON.parse(this.renderCMIToJSONString());
|
|
1675
1760
|
};
|
|
1676
1761
|
BaseAPI.prototype.processHttpRequest = function (url_1, params_1) {
|
|
1677
|
-
return (0,tslib_es6
|
|
1762
|
+
return (0,tslib_es6.__awaiter)(this, arguments, void 0, function (url, params, immediate) {
|
|
1678
1763
|
var api, genericError, process;
|
|
1679
1764
|
var _this = this;
|
|
1680
1765
|
if (immediate === void 0) { immediate = false; }
|
|
1681
|
-
return (0,tslib_es6
|
|
1766
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
1682
1767
|
switch (_a.label) {
|
|
1683
1768
|
case 0:
|
|
1684
1769
|
api = this;
|
|
1685
1770
|
genericError = {
|
|
1686
|
-
result: api_constants
|
|
1771
|
+
result: api_constants.global_constants.SCORM_FALSE,
|
|
1687
1772
|
errorCode: this.error_codes.GENERAL,
|
|
1688
1773
|
};
|
|
1689
1774
|
if (immediate) {
|
|
1690
|
-
this.performFetch(url, params).then(function (response) { return (0,tslib_es6
|
|
1691
|
-
return (0,tslib_es6
|
|
1775
|
+
this.performFetch(url, params).then(function (response) { return (0,tslib_es6.__awaiter)(_this, void 0, void 0, function () {
|
|
1776
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
1692
1777
|
switch (_a.label) {
|
|
1693
1778
|
case 0: return [4, this.transformResponse(response)];
|
|
1694
1779
|
case 1:
|
|
@@ -1698,13 +1783,13 @@ var BaseAPI = (function () {
|
|
|
1698
1783
|
});
|
|
1699
1784
|
}); });
|
|
1700
1785
|
return [2, {
|
|
1701
|
-
result: api_constants
|
|
1786
|
+
result: api_constants.global_constants.SCORM_TRUE,
|
|
1702
1787
|
errorCode: 0,
|
|
1703
1788
|
}];
|
|
1704
1789
|
}
|
|
1705
|
-
process = function (url, params, settings) { return (0,tslib_es6
|
|
1790
|
+
process = function (url, params, settings) { return (0,tslib_es6.__awaiter)(_this, void 0, void 0, function () {
|
|
1706
1791
|
var response, e_1;
|
|
1707
|
-
return (0,tslib_es6
|
|
1792
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
1708
1793
|
switch (_a.label) {
|
|
1709
1794
|
case 0:
|
|
1710
1795
|
_a.trys.push([0, 2, , 3]);
|
|
@@ -1715,7 +1800,7 @@ var BaseAPI = (function () {
|
|
|
1715
1800
|
return [2, this.transformResponse(response)];
|
|
1716
1801
|
case 2:
|
|
1717
1802
|
e_1 = _a.sent();
|
|
1718
|
-
this.apiLog("processHttpRequest", e_1,
|
|
1803
|
+
this.apiLog("processHttpRequest", e_1, enums.LogLevelEnum.ERROR);
|
|
1719
1804
|
api.processListeners("CommitError");
|
|
1720
1805
|
return [2, genericError];
|
|
1721
1806
|
case 3: return [2];
|
|
@@ -1731,14 +1816,14 @@ var BaseAPI = (function () {
|
|
|
1731
1816
|
BaseAPI.prototype.scheduleCommit = function (when, callback) {
|
|
1732
1817
|
if (!this._timeout) {
|
|
1733
1818
|
this._timeout = new ScheduledCommit(this, when, callback);
|
|
1734
|
-
this.apiLog("scheduleCommit", "scheduled",
|
|
1819
|
+
this.apiLog("scheduleCommit", "scheduled", enums.LogLevelEnum.DEBUG, "");
|
|
1735
1820
|
}
|
|
1736
1821
|
};
|
|
1737
1822
|
BaseAPI.prototype.clearScheduledCommit = function () {
|
|
1738
1823
|
if (this._timeout) {
|
|
1739
1824
|
this._timeout.cancel();
|
|
1740
1825
|
this._timeout = undefined;
|
|
1741
|
-
this.apiLog("clearScheduledCommit", "cleared",
|
|
1826
|
+
this.apiLog("clearScheduledCommit", "cleared", enums.LogLevelEnum.DEBUG, "");
|
|
1742
1827
|
}
|
|
1743
1828
|
};
|
|
1744
1829
|
BaseAPI.prototype._checkObjectHasProperty = function (refObject, attribute) {
|
|
@@ -1747,9 +1832,9 @@ var BaseAPI = (function () {
|
|
|
1747
1832
|
attribute in refObject);
|
|
1748
1833
|
};
|
|
1749
1834
|
BaseAPI.prototype.handleValueAccessException = function (e, returnValue) {
|
|
1750
|
-
if (e instanceof exceptions
|
|
1835
|
+
if (e instanceof exceptions.ValidationError) {
|
|
1751
1836
|
this.lastErrorCode = String(e.errorCode);
|
|
1752
|
-
returnValue = api_constants
|
|
1837
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1753
1838
|
}
|
|
1754
1839
|
else {
|
|
1755
1840
|
if (e instanceof Error && e.message) {
|
|
@@ -1767,20 +1852,20 @@ var BaseAPI = (function () {
|
|
|
1767
1852
|
var commitObject = this.settings.renderCommonCommitFields
|
|
1768
1853
|
? this.renderCommitObject(shouldTerminateCommit)
|
|
1769
1854
|
: this.renderCommitCMI(shouldTerminateCommit);
|
|
1770
|
-
if (
|
|
1855
|
+
if ([enums.LogLevelEnum.DEBUG, "1", 1, "DEBUG"].includes(this.apiLogLevel)) {
|
|
1771
1856
|
console.debug("Commit (terminated: " + (terminateCommit ? "yes" : "no") + "): ");
|
|
1772
1857
|
console.debug(commitObject);
|
|
1773
1858
|
}
|
|
1774
1859
|
return commitObject;
|
|
1775
1860
|
};
|
|
1776
1861
|
BaseAPI.prototype.performFetch = function (url, params) {
|
|
1777
|
-
return (0,tslib_es6
|
|
1778
|
-
return (0,tslib_es6
|
|
1862
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
1863
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
1779
1864
|
return [2, fetch(url, {
|
|
1780
1865
|
method: "POST",
|
|
1781
1866
|
mode: this.settings.fetchMode,
|
|
1782
1867
|
body: params instanceof Array ? params.join("&") : JSON.stringify(params),
|
|
1783
|
-
headers: (0,tslib_es6
|
|
1868
|
+
headers: (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, this.settings.xhrHeaders), { "Content-Type": this.settings.commitRequestDataType }),
|
|
1784
1869
|
credentials: this.settings.xhrWithCredentials ? "include" : undefined,
|
|
1785
1870
|
keepalive: true,
|
|
1786
1871
|
})];
|
|
@@ -1788,9 +1873,9 @@ var BaseAPI = (function () {
|
|
|
1788
1873
|
});
|
|
1789
1874
|
};
|
|
1790
1875
|
BaseAPI.prototype.transformResponse = function (response) {
|
|
1791
|
-
return (0,tslib_es6
|
|
1876
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
1792
1877
|
var result, _a;
|
|
1793
|
-
return (0,tslib_es6
|
|
1878
|
+
return (0,tslib_es6.__generator)(this, function (_c) {
|
|
1794
1879
|
switch (_c.label) {
|
|
1795
1880
|
case 0:
|
|
1796
1881
|
if (!(typeof this.settings.responseHandler === "function")) return [3, 2];
|
|
@@ -1806,8 +1891,7 @@ var BaseAPI = (function () {
|
|
|
1806
1891
|
result = _a;
|
|
1807
1892
|
if (response.status >= 200 &&
|
|
1808
1893
|
response.status <= 299 &&
|
|
1809
|
-
(result.result === true ||
|
|
1810
|
-
result.result === api_constants/* default */.A.global.SCORM_TRUE)) {
|
|
1894
|
+
(result.result === true || result.result === api_constants.global_constants.SCORM_TRUE)) {
|
|
1811
1895
|
this.processListeners("CommitSuccess");
|
|
1812
1896
|
}
|
|
1813
1897
|
else {
|
|
@@ -1828,6 +1912,7 @@ var BaseAPI = (function () {
|
|
|
1828
1912
|
/***/ 941:
|
|
1829
1913
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1830
1914
|
|
|
1915
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1831
1916
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1832
1917
|
/* harmony export */ Scorm12Impl: function() { return /* binding */ Scorm12Impl; }
|
|
1833
1918
|
/* harmony export */ });
|
|
@@ -1839,9 +1924,9 @@ var BaseAPI = (function () {
|
|
|
1839
1924
|
/* harmony import */ var _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(176);
|
|
1840
1925
|
/* harmony import */ var _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(833);
|
|
1841
1926
|
/* harmony import */ var _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(331);
|
|
1842
|
-
/* harmony import */ var
|
|
1843
|
-
/* harmony import */ var
|
|
1844
|
-
/* harmony import */ var
|
|
1927
|
+
/* harmony import */ var _constants_enums__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(56);
|
|
1928
|
+
/* harmony import */ var _BaseAPI__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(429);
|
|
1929
|
+
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(417);
|
|
1845
1930
|
|
|
1846
1931
|
|
|
1847
1932
|
|
|
@@ -1855,7 +1940,7 @@ var BaseAPI = (function () {
|
|
|
1855
1940
|
|
|
1856
1941
|
|
|
1857
1942
|
var Scorm12Impl = (function (_super) {
|
|
1858
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1943
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_10__.__extends)(Scorm12Impl, _super);
|
|
1859
1944
|
function Scorm12Impl(settings) {
|
|
1860
1945
|
var _this = this;
|
|
1861
1946
|
if (settings) {
|
|
@@ -1863,10 +1948,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
1863
1948
|
settings.mastery_override = false;
|
|
1864
1949
|
}
|
|
1865
1950
|
}
|
|
1866
|
-
_this = _super.call(this, _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__
|
|
1951
|
+
_this = _super.call(this, _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors, settings) || this;
|
|
1867
1952
|
_this.statusSetByModule = false;
|
|
1868
|
-
_this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
1869
|
-
_this.nav = new _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__
|
|
1953
|
+
_this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__.CMI();
|
|
1954
|
+
_this.nav = new _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__.NAV();
|
|
1870
1955
|
_this.LMSInitialize = _this.lmsInitialize;
|
|
1871
1956
|
_this.LMSFinish = _this.lmsFinish;
|
|
1872
1957
|
_this.LMSGetValue = _this.lmsGetValue;
|
|
@@ -1878,9 +1963,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
1878
1963
|
return _this;
|
|
1879
1964
|
}
|
|
1880
1965
|
Scorm12Impl.prototype.reset = function (settings) {
|
|
1966
|
+
var _a, _b;
|
|
1881
1967
|
this.commonReset(settings);
|
|
1882
|
-
this.cmi
|
|
1883
|
-
this.nav
|
|
1968
|
+
(_a = this.cmi) === null || _a === void 0 ? void 0 : _a.reset();
|
|
1969
|
+
(_b = this.nav) === null || _b === void 0 ? void 0 : _b.reset();
|
|
1884
1970
|
};
|
|
1885
1971
|
Scorm12Impl.prototype.lmsInitialize = function () {
|
|
1886
1972
|
this.cmi.initialize();
|
|
@@ -1894,8 +1980,8 @@ var Scorm12Impl = (function (_super) {
|
|
|
1894
1980
|
};
|
|
1895
1981
|
Scorm12Impl.prototype.lmsFinish = function () {
|
|
1896
1982
|
var _this = this;
|
|
1897
|
-
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1898
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1983
|
+
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(_this, void 0, void 0, function () {
|
|
1984
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_a) {
|
|
1899
1985
|
switch (_a.label) {
|
|
1900
1986
|
case 0: return [4, this.internalFinish()];
|
|
1901
1987
|
case 1:
|
|
@@ -1904,17 +1990,17 @@ var Scorm12Impl = (function (_super) {
|
|
|
1904
1990
|
}
|
|
1905
1991
|
});
|
|
1906
1992
|
}); })();
|
|
1907
|
-
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
1993
|
+
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE;
|
|
1908
1994
|
};
|
|
1909
1995
|
Scorm12Impl.prototype.internalFinish = function () {
|
|
1910
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1996
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(this, void 0, void 0, function () {
|
|
1911
1997
|
var result;
|
|
1912
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1998
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_a) {
|
|
1913
1999
|
switch (_a.label) {
|
|
1914
2000
|
case 0: return [4, this.terminate("LMSFinish", true)];
|
|
1915
2001
|
case 1:
|
|
1916
2002
|
result = _a.sent();
|
|
1917
|
-
if (result === _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2003
|
+
if (result === _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE) {
|
|
1918
2004
|
if (this.nav.event !== "") {
|
|
1919
2005
|
if (this.nav.event === "continue") {
|
|
1920
2006
|
this.processListeners("SequenceNext");
|
|
@@ -1947,8 +2033,8 @@ var Scorm12Impl = (function (_super) {
|
|
|
1947
2033
|
this.scheduleCommit(500, "LMSCommit");
|
|
1948
2034
|
}
|
|
1949
2035
|
else {
|
|
1950
|
-
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1951
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
2036
|
+
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(_this, void 0, void 0, function () {
|
|
2037
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_a) {
|
|
1952
2038
|
switch (_a.label) {
|
|
1953
2039
|
case 0: return [4, this.commit("LMSCommit", false)];
|
|
1954
2040
|
case 1:
|
|
@@ -1958,7 +2044,7 @@ var Scorm12Impl = (function (_super) {
|
|
|
1958
2044
|
});
|
|
1959
2045
|
}); })();
|
|
1960
2046
|
}
|
|
1961
|
-
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2047
|
+
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE;
|
|
1962
2048
|
};
|
|
1963
2049
|
Scorm12Impl.prototype.lmsGetLastError = function () {
|
|
1964
2050
|
return this.getLastError("LMSGetLastError");
|
|
@@ -1976,20 +2062,20 @@ var Scorm12Impl = (function (_super) {
|
|
|
1976
2062
|
return this._commonGetCMIValue("getCMIValue", false, CMIElement);
|
|
1977
2063
|
};
|
|
1978
2064
|
Scorm12Impl.prototype.getChildElement = function (CMIElement, _value, foundFirstIndex) {
|
|
1979
|
-
if ((0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
1980
|
-
return new _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__
|
|
2065
|
+
if ((0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.objectives\\.\\d+")) {
|
|
2066
|
+
return new _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__.CMIObjectivesObject();
|
|
1981
2067
|
}
|
|
1982
2068
|
else if (foundFirstIndex &&
|
|
1983
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
1984
|
-
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__
|
|
2069
|
+
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) {
|
|
2070
|
+
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__.CMIInteractionsCorrectResponsesObject();
|
|
1985
2071
|
}
|
|
1986
2072
|
else if (foundFirstIndex &&
|
|
1987
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
1988
|
-
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__
|
|
2073
|
+
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) {
|
|
2074
|
+
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__.CMIInteractionsObjectivesObject();
|
|
1989
2075
|
}
|
|
1990
2076
|
else if (!foundFirstIndex &&
|
|
1991
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
1992
|
-
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__
|
|
2077
|
+
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+")) {
|
|
2078
|
+
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__.CMIInteractionsObject();
|
|
1993
2079
|
}
|
|
1994
2080
|
return null;
|
|
1995
2081
|
};
|
|
@@ -1999,11 +2085,11 @@ var Scorm12Impl = (function (_super) {
|
|
|
1999
2085
|
var basicMessage = "No Error";
|
|
2000
2086
|
var detailMessage = "No Error";
|
|
2001
2087
|
errorNumber = String(errorNumber);
|
|
2002
|
-
if (_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2088
|
+
if (_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber]) {
|
|
2003
2089
|
basicMessage =
|
|
2004
|
-
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2090
|
+
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber].basicMessage;
|
|
2005
2091
|
detailMessage =
|
|
2006
|
-
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2092
|
+
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber].detailMessage;
|
|
2007
2093
|
}
|
|
2008
2094
|
return detail ? detailMessage : basicMessage;
|
|
2009
2095
|
};
|
|
@@ -2016,10 +2102,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
2016
2102
|
cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();
|
|
2017
2103
|
}
|
|
2018
2104
|
var result = [];
|
|
2019
|
-
var flattened = _utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
2105
|
+
var flattened = _utilities__WEBPACK_IMPORTED_MODULE_1__.flatten(cmiExport);
|
|
2020
2106
|
switch (this.settings.dataCommitFormat) {
|
|
2021
2107
|
case "flattened":
|
|
2022
|
-
return _utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
2108
|
+
return _utilities__WEBPACK_IMPORTED_MODULE_1__.flatten(cmiExport);
|
|
2023
2109
|
case "params":
|
|
2024
2110
|
for (var item in flattened) {
|
|
2025
2111
|
if ({}.hasOwnProperty.call(flattened, item)) {
|
|
@@ -2035,20 +2121,20 @@ var Scorm12Impl = (function (_super) {
|
|
|
2035
2121
|
Scorm12Impl.prototype.renderCommitObject = function (terminateCommit) {
|
|
2036
2122
|
var cmiExport = this.renderCommitCMI(terminateCommit);
|
|
2037
2123
|
var totalTimeHHMMSS = this.cmi.getCurrentTotalTime();
|
|
2038
|
-
var totalTimeSeconds = _utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
2124
|
+
var totalTimeSeconds = _utilities__WEBPACK_IMPORTED_MODULE_1__.getTimeAsSeconds(totalTimeHHMMSS, _constants_regex__WEBPACK_IMPORTED_MODULE_9__.scorm12_regex.CMITimespan);
|
|
2039
2125
|
var lessonStatus = this.cmi.core.lesson_status;
|
|
2040
|
-
var completionStatus =
|
|
2041
|
-
var successStatus =
|
|
2126
|
+
var completionStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.unknown;
|
|
2127
|
+
var successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.unknown;
|
|
2042
2128
|
if (lessonStatus) {
|
|
2043
2129
|
completionStatus =
|
|
2044
2130
|
lessonStatus === "completed" || lessonStatus === "passed"
|
|
2045
|
-
?
|
|
2046
|
-
:
|
|
2131
|
+
? _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.completed
|
|
2132
|
+
: _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.incomplete;
|
|
2047
2133
|
if (lessonStatus === "passed") {
|
|
2048
|
-
successStatus =
|
|
2134
|
+
successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.passed;
|
|
2049
2135
|
}
|
|
2050
2136
|
else if (lessonStatus === "failed") {
|
|
2051
|
-
successStatus =
|
|
2137
|
+
successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.failed;
|
|
2052
2138
|
}
|
|
2053
2139
|
}
|
|
2054
2140
|
var score = this.cmi.core.score;
|
|
@@ -2077,10 +2163,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
2077
2163
|
return commitObject;
|
|
2078
2164
|
};
|
|
2079
2165
|
Scorm12Impl.prototype.storeData = function (terminateCommit) {
|
|
2080
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
2166
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(this, void 0, void 0, function () {
|
|
2081
2167
|
var originalStatus, commitObject;
|
|
2082
2168
|
var _a, _b, _c;
|
|
2083
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
2169
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_d) {
|
|
2084
2170
|
switch (_d.label) {
|
|
2085
2171
|
case 0:
|
|
2086
2172
|
if (terminateCommit) {
|
|
@@ -2115,7 +2201,7 @@ var Scorm12Impl = (function (_super) {
|
|
|
2115
2201
|
return [4, this.processHttpRequest(this.settings.lmsCommitUrl, commitObject, terminateCommit)];
|
|
2116
2202
|
case 1: return [2, _d.sent()];
|
|
2117
2203
|
case 2: return [2, {
|
|
2118
|
-
result: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2204
|
+
result: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE,
|
|
2119
2205
|
errorCode: 0,
|
|
2120
2206
|
}];
|
|
2121
2207
|
}
|
|
@@ -2123,15 +2209,17 @@ var Scorm12Impl = (function (_super) {
|
|
|
2123
2209
|
});
|
|
2124
2210
|
};
|
|
2125
2211
|
return Scorm12Impl;
|
|
2126
|
-
}(
|
|
2212
|
+
}(_BaseAPI__WEBPACK_IMPORTED_MODULE_8__["default"]));
|
|
2127
2213
|
|
|
2128
2214
|
|
|
2129
2215
|
|
|
2130
2216
|
/***/ }),
|
|
2131
2217
|
|
|
2132
|
-
/***/
|
|
2218
|
+
/***/ 809:
|
|
2133
2219
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2134
2220
|
|
|
2221
|
+
// ESM COMPAT FLAG
|
|
2222
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2135
2223
|
|
|
2136
2224
|
// EXPORTS
|
|
2137
2225
|
__webpack_require__.d(__webpack_exports__, {
|
|
@@ -2150,6 +2238,27 @@ var regex = __webpack_require__(417);
|
|
|
2150
2238
|
var error_codes = __webpack_require__(797);
|
|
2151
2239
|
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
2152
2240
|
var exceptions = __webpack_require__(784);
|
|
2241
|
+
;// ./src/exceptions/scorm2004_exceptions.ts
|
|
2242
|
+
|
|
2243
|
+
|
|
2244
|
+
|
|
2245
|
+
var scorm2004_errors = api_constants.scorm2004_constants.error_descriptions;
|
|
2246
|
+
var Scorm2004ValidationError = (function (_super) {
|
|
2247
|
+
(0,tslib_es6.__extends)(Scorm2004ValidationError, _super);
|
|
2248
|
+
function Scorm2004ValidationError(errorCode) {
|
|
2249
|
+
var _this = this;
|
|
2250
|
+
if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {
|
|
2251
|
+
_this = _super.call(this, errorCode, scorm2004_errors[String(errorCode)].basicMessage, scorm2004_errors[String(errorCode)].detailMessage) || this;
|
|
2252
|
+
}
|
|
2253
|
+
else {
|
|
2254
|
+
_this = _super.call(this, 101, scorm2004_errors["101"].basicMessage, scorm2004_errors["101"].detailMessage) || this;
|
|
2255
|
+
}
|
|
2256
|
+
return _this;
|
|
2257
|
+
}
|
|
2258
|
+
return Scorm2004ValidationError;
|
|
2259
|
+
}(exceptions.ValidationError));
|
|
2260
|
+
|
|
2261
|
+
|
|
2153
2262
|
// EXTERNAL MODULE: ./src/utilities.ts
|
|
2154
2263
|
var utilities = __webpack_require__(864);
|
|
2155
2264
|
// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts
|
|
@@ -2161,10 +2270,10 @@ var validation = __webpack_require__(449);
|
|
|
2161
2270
|
|
|
2162
2271
|
|
|
2163
2272
|
function check2004ValidFormat(value, regexPattern, allowEmptyString) {
|
|
2164
|
-
return (0,validation
|
|
2273
|
+
return (0,validation.checkValidFormat)(value, regexPattern, error_codes.scorm2004_errors.TYPE_MISMATCH, Scorm2004ValidationError, allowEmptyString);
|
|
2165
2274
|
}
|
|
2166
2275
|
function check2004ValidRange(value, rangePattern) {
|
|
2167
|
-
return (0,validation
|
|
2276
|
+
return (0,validation.checkValidRange)(value, rangePattern, error_codes.scorm2004_errors.VALUE_OUT_OF_RANGE, Scorm2004ValidationError);
|
|
2168
2277
|
}
|
|
2169
2278
|
|
|
2170
2279
|
;// ./src/cmi/scorm2004/learner_preference.ts
|
|
@@ -2176,22 +2285,25 @@ function check2004ValidRange(value, rangePattern) {
|
|
|
2176
2285
|
|
|
2177
2286
|
|
|
2178
2287
|
var CMILearnerPreference = (function (_super) {
|
|
2179
|
-
(0,tslib_es6
|
|
2288
|
+
(0,tslib_es6.__extends)(CMILearnerPreference, _super);
|
|
2180
2289
|
function CMILearnerPreference() {
|
|
2181
2290
|
var _this = _super.call(this) || this;
|
|
2182
|
-
_this.__children = api_constants
|
|
2291
|
+
_this.__children = api_constants.scorm2004_constants.student_preference_children;
|
|
2183
2292
|
_this._audio_level = "1";
|
|
2184
2293
|
_this._language = "";
|
|
2185
2294
|
_this._delivery_speed = "1";
|
|
2186
2295
|
_this._audio_captioning = "0";
|
|
2187
2296
|
return _this;
|
|
2188
2297
|
}
|
|
2298
|
+
CMILearnerPreference.prototype.reset = function () {
|
|
2299
|
+
this._initialized = false;
|
|
2300
|
+
};
|
|
2189
2301
|
Object.defineProperty(CMILearnerPreference.prototype, "_children", {
|
|
2190
2302
|
get: function () {
|
|
2191
2303
|
return this.__children;
|
|
2192
2304
|
},
|
|
2193
2305
|
set: function (_children) {
|
|
2194
|
-
throw new
|
|
2306
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
2195
2307
|
},
|
|
2196
2308
|
enumerable: false,
|
|
2197
2309
|
configurable: true
|
|
@@ -2201,8 +2313,8 @@ var CMILearnerPreference = (function (_super) {
|
|
|
2201
2313
|
return this._audio_level;
|
|
2202
2314
|
},
|
|
2203
2315
|
set: function (audio_level) {
|
|
2204
|
-
if (check2004ValidFormat(audio_level, regex
|
|
2205
|
-
check2004ValidRange(audio_level, regex
|
|
2316
|
+
if (check2004ValidFormat(audio_level, regex.scorm2004_regex.CMIDecimal) &&
|
|
2317
|
+
check2004ValidRange(audio_level, regex.scorm2004_regex.audio_range)) {
|
|
2206
2318
|
this._audio_level = audio_level;
|
|
2207
2319
|
}
|
|
2208
2320
|
},
|
|
@@ -2214,7 +2326,7 @@ var CMILearnerPreference = (function (_super) {
|
|
|
2214
2326
|
return this._language;
|
|
2215
2327
|
},
|
|
2216
2328
|
set: function (language) {
|
|
2217
|
-
if (check2004ValidFormat(language, regex
|
|
2329
|
+
if (check2004ValidFormat(language, regex.scorm2004_regex.CMILang)) {
|
|
2218
2330
|
this._language = language;
|
|
2219
2331
|
}
|
|
2220
2332
|
},
|
|
@@ -2226,8 +2338,8 @@ var CMILearnerPreference = (function (_super) {
|
|
|
2226
2338
|
return this._delivery_speed;
|
|
2227
2339
|
},
|
|
2228
2340
|
set: function (delivery_speed) {
|
|
2229
|
-
if (check2004ValidFormat(delivery_speed, regex
|
|
2230
|
-
check2004ValidRange(delivery_speed, regex
|
|
2341
|
+
if (check2004ValidFormat(delivery_speed, regex.scorm2004_regex.CMIDecimal) &&
|
|
2342
|
+
check2004ValidRange(delivery_speed, regex.scorm2004_regex.speed_range)) {
|
|
2231
2343
|
this._delivery_speed = delivery_speed;
|
|
2232
2344
|
}
|
|
2233
2345
|
},
|
|
@@ -2239,8 +2351,8 @@ var CMILearnerPreference = (function (_super) {
|
|
|
2239
2351
|
return this._audio_captioning;
|
|
2240
2352
|
},
|
|
2241
2353
|
set: function (audio_captioning) {
|
|
2242
|
-
if (check2004ValidFormat(audio_captioning, regex
|
|
2243
|
-
check2004ValidRange(audio_captioning, regex
|
|
2354
|
+
if (check2004ValidFormat(audio_captioning, regex.scorm2004_regex.CMISInteger) &&
|
|
2355
|
+
check2004ValidRange(audio_captioning, regex.scorm2004_regex.text_range)) {
|
|
2244
2356
|
this._audio_captioning = audio_captioning;
|
|
2245
2357
|
}
|
|
2246
2358
|
},
|
|
@@ -2259,14 +2371,13 @@ var CMILearnerPreference = (function (_super) {
|
|
|
2259
2371
|
return result;
|
|
2260
2372
|
};
|
|
2261
2373
|
return CMILearnerPreference;
|
|
2262
|
-
}(base_cmi
|
|
2374
|
+
}(base_cmi.BaseCMI));
|
|
2263
2375
|
|
|
2264
2376
|
|
|
2265
2377
|
// EXTERNAL MODULE: ./src/cmi/common/array.ts
|
|
2266
2378
|
var array = __webpack_require__(589);
|
|
2267
2379
|
;// ./src/constants/response_constants.ts
|
|
2268
2380
|
|
|
2269
|
-
var scorm2004_regex = regex/* default */.A.scorm2004;
|
|
2270
2381
|
var LearnerResponses = {
|
|
2271
2382
|
"true-false": {
|
|
2272
2383
|
format: "^true$|^false$",
|
|
@@ -2275,59 +2386,59 @@ var LearnerResponses = {
|
|
|
2275
2386
|
unique: false,
|
|
2276
2387
|
},
|
|
2277
2388
|
choice: {
|
|
2278
|
-
format: scorm2004_regex.CMILongIdentifier,
|
|
2389
|
+
format: regex.scorm2004_regex.CMILongIdentifier,
|
|
2279
2390
|
max: 36,
|
|
2280
2391
|
delimiter: "[,]",
|
|
2281
2392
|
unique: true,
|
|
2282
2393
|
},
|
|
2283
2394
|
"fill-in": {
|
|
2284
|
-
format: scorm2004_regex.CMILangString250,
|
|
2395
|
+
format: regex.scorm2004_regex.CMILangString250,
|
|
2285
2396
|
max: 10,
|
|
2286
2397
|
delimiter: "[,]",
|
|
2287
2398
|
unique: false,
|
|
2288
2399
|
},
|
|
2289
2400
|
"long-fill-in": {
|
|
2290
|
-
format: scorm2004_regex.CMILangString4000,
|
|
2401
|
+
format: regex.scorm2004_regex.CMILangString4000,
|
|
2291
2402
|
max: 1,
|
|
2292
2403
|
delimiter: "",
|
|
2293
2404
|
unique: false,
|
|
2294
2405
|
},
|
|
2295
2406
|
matching: {
|
|
2296
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2297
|
-
format2: scorm2004_regex.CMIShortIdentifier,
|
|
2407
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2408
|
+
format2: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2298
2409
|
max: 36,
|
|
2299
2410
|
delimiter: "[,]",
|
|
2300
2411
|
delimiter2: "[.]",
|
|
2301
2412
|
unique: false,
|
|
2302
2413
|
},
|
|
2303
2414
|
performance: {
|
|
2304
|
-
format: "^$|" + scorm2004_regex.CMIShortIdentifier,
|
|
2305
|
-
format2: scorm2004_regex.CMIDecimal + "|^$|" + scorm2004_regex.CMIShortIdentifier,
|
|
2415
|
+
format: "^$|" + regex.scorm2004_regex.CMIShortIdentifier,
|
|
2416
|
+
format2: regex.scorm2004_regex.CMIDecimal + "|^$|" + regex.scorm2004_regex.CMIShortIdentifier,
|
|
2306
2417
|
max: 250,
|
|
2307
2418
|
delimiter: "[,]",
|
|
2308
2419
|
delimiter2: "[.]",
|
|
2309
2420
|
unique: false,
|
|
2310
2421
|
},
|
|
2311
2422
|
sequencing: {
|
|
2312
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2423
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2313
2424
|
max: 36,
|
|
2314
2425
|
delimiter: "[,]",
|
|
2315
2426
|
unique: false,
|
|
2316
2427
|
},
|
|
2317
2428
|
likert: {
|
|
2318
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2429
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2319
2430
|
max: 1,
|
|
2320
2431
|
delimiter: "",
|
|
2321
2432
|
unique: false,
|
|
2322
2433
|
},
|
|
2323
2434
|
numeric: {
|
|
2324
|
-
format: scorm2004_regex.CMIDecimal,
|
|
2435
|
+
format: regex.scorm2004_regex.CMIDecimal,
|
|
2325
2436
|
max: 1,
|
|
2326
2437
|
delimiter: "",
|
|
2327
2438
|
unique: false,
|
|
2328
2439
|
},
|
|
2329
2440
|
other: {
|
|
2330
|
-
format: scorm2004_regex.CMIString4000,
|
|
2441
|
+
format: regex.scorm2004_regex.CMIString4000,
|
|
2331
2442
|
max: 1,
|
|
2332
2443
|
delimiter: "",
|
|
2333
2444
|
unique: false,
|
|
@@ -2347,21 +2458,21 @@ var CorrectResponses = {
|
|
|
2347
2458
|
delimiter: "[,]",
|
|
2348
2459
|
unique: true,
|
|
2349
2460
|
duplicate: false,
|
|
2350
|
-
format: scorm2004_regex.CMILongIdentifier,
|
|
2461
|
+
format: regex.scorm2004_regex.CMILongIdentifier,
|
|
2351
2462
|
},
|
|
2352
2463
|
"fill-in": {
|
|
2353
2464
|
max: 10,
|
|
2354
2465
|
delimiter: "[,]",
|
|
2355
2466
|
unique: false,
|
|
2356
2467
|
duplicate: false,
|
|
2357
|
-
format: scorm2004_regex.CMILangString250cr,
|
|
2468
|
+
format: regex.scorm2004_regex.CMILangString250cr,
|
|
2358
2469
|
},
|
|
2359
2470
|
"long-fill-in": {
|
|
2360
2471
|
max: 1,
|
|
2361
2472
|
delimiter: "",
|
|
2362
2473
|
unique: false,
|
|
2363
2474
|
duplicate: true,
|
|
2364
|
-
format: scorm2004_regex.CMILangString4000,
|
|
2475
|
+
format: regex.scorm2004_regex.CMILangString4000,
|
|
2365
2476
|
},
|
|
2366
2477
|
matching: {
|
|
2367
2478
|
max: 36,
|
|
@@ -2369,8 +2480,8 @@ var CorrectResponses = {
|
|
|
2369
2480
|
delimiter2: "[.]",
|
|
2370
2481
|
unique: false,
|
|
2371
2482
|
duplicate: false,
|
|
2372
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2373
|
-
format2: scorm2004_regex.CMIShortIdentifier,
|
|
2483
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2484
|
+
format2: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2374
2485
|
},
|
|
2375
2486
|
performance: {
|
|
2376
2487
|
max: 250,
|
|
@@ -2379,22 +2490,22 @@ var CorrectResponses = {
|
|
|
2379
2490
|
delimiter3: "[:]",
|
|
2380
2491
|
unique: false,
|
|
2381
2492
|
duplicate: false,
|
|
2382
|
-
format: "^$|" + scorm2004_regex.CMIShortIdentifier,
|
|
2383
|
-
format2: scorm2004_regex.CMIDecimal + "|^$|" + scorm2004_regex.CMIShortIdentifier,
|
|
2493
|
+
format: "^$|" + regex.scorm2004_regex.CMIShortIdentifier,
|
|
2494
|
+
format2: regex.scorm2004_regex.CMIDecimal + "|^$|" + regex.scorm2004_regex.CMIShortIdentifier,
|
|
2384
2495
|
},
|
|
2385
2496
|
sequencing: {
|
|
2386
2497
|
max: 36,
|
|
2387
2498
|
delimiter: "[,]",
|
|
2388
2499
|
unique: false,
|
|
2389
2500
|
duplicate: false,
|
|
2390
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2501
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2391
2502
|
},
|
|
2392
2503
|
likert: {
|
|
2393
2504
|
max: 1,
|
|
2394
2505
|
delimiter: "",
|
|
2395
2506
|
unique: false,
|
|
2396
2507
|
duplicate: false,
|
|
2397
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2508
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2398
2509
|
limit: 1,
|
|
2399
2510
|
},
|
|
2400
2511
|
numeric: {
|
|
@@ -2402,7 +2513,7 @@ var CorrectResponses = {
|
|
|
2402
2513
|
delimiter: "[:]",
|
|
2403
2514
|
unique: false,
|
|
2404
2515
|
duplicate: false,
|
|
2405
|
-
format: scorm2004_regex.CMIDecimal,
|
|
2516
|
+
format: regex.scorm2004_regex.CMIDecimal,
|
|
2406
2517
|
limit: 1,
|
|
2407
2518
|
},
|
|
2408
2519
|
other: {
|
|
@@ -2410,7 +2521,7 @@ var CorrectResponses = {
|
|
|
2410
2521
|
delimiter: "",
|
|
2411
2522
|
unique: false,
|
|
2412
2523
|
duplicate: false,
|
|
2413
|
-
format: scorm2004_regex.CMIString4000,
|
|
2524
|
+
format: regex.scorm2004_regex.CMIString4000,
|
|
2414
2525
|
limit: 1,
|
|
2415
2526
|
},
|
|
2416
2527
|
};
|
|
@@ -2426,19 +2537,19 @@ var CorrectResponses = {
|
|
|
2426
2537
|
|
|
2427
2538
|
|
|
2428
2539
|
var CMIInteractions = (function (_super) {
|
|
2429
|
-
(0,tslib_es6
|
|
2540
|
+
(0,tslib_es6.__extends)(CMIInteractions, _super);
|
|
2430
2541
|
function CMIInteractions() {
|
|
2431
2542
|
return _super.call(this, {
|
|
2432
|
-
children: api_constants
|
|
2433
|
-
errorCode: error_codes
|
|
2434
|
-
errorClass:
|
|
2543
|
+
children: api_constants.scorm2004_constants.interactions_children,
|
|
2544
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2545
|
+
errorClass: Scorm2004ValidationError,
|
|
2435
2546
|
}) || this;
|
|
2436
2547
|
}
|
|
2437
2548
|
return CMIInteractions;
|
|
2438
|
-
}(array
|
|
2549
|
+
}(array.CMIArray));
|
|
2439
2550
|
|
|
2440
2551
|
var CMIInteractionsObject = (function (_super) {
|
|
2441
|
-
(0,tslib_es6
|
|
2552
|
+
(0,tslib_es6.__extends)(CMIInteractionsObject, _super);
|
|
2442
2553
|
function CMIInteractionsObject() {
|
|
2443
2554
|
var _this = _super.call(this) || this;
|
|
2444
2555
|
_this._id = "";
|
|
@@ -2449,15 +2560,15 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2449
2560
|
_this._result = "";
|
|
2450
2561
|
_this._latency = "";
|
|
2451
2562
|
_this._description = "";
|
|
2452
|
-
_this.objectives = new array
|
|
2453
|
-
errorCode: error_codes
|
|
2454
|
-
errorClass:
|
|
2455
|
-
children: api_constants
|
|
2563
|
+
_this.objectives = new array.CMIArray({
|
|
2564
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2565
|
+
errorClass: Scorm2004ValidationError,
|
|
2566
|
+
children: api_constants.scorm2004_constants.objectives_children,
|
|
2456
2567
|
});
|
|
2457
|
-
_this.correct_responses = new array
|
|
2458
|
-
errorCode: error_codes
|
|
2459
|
-
errorClass:
|
|
2460
|
-
children: api_constants
|
|
2568
|
+
_this.correct_responses = new array.CMIArray({
|
|
2569
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2570
|
+
errorClass: Scorm2004ValidationError,
|
|
2571
|
+
children: api_constants.scorm2004_constants.correct_responses_children,
|
|
2461
2572
|
});
|
|
2462
2573
|
return _this;
|
|
2463
2574
|
}
|
|
@@ -2467,12 +2578,33 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2467
2578
|
(_a = this.objectives) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
2468
2579
|
(_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.initialize();
|
|
2469
2580
|
};
|
|
2581
|
+
CMIInteractionsObject.prototype.reset = function () {
|
|
2582
|
+
this._initialized = false;
|
|
2583
|
+
this._id = "";
|
|
2584
|
+
this._type = "";
|
|
2585
|
+
this._timestamp = "";
|
|
2586
|
+
this._weighting = "";
|
|
2587
|
+
this._learner_response = "";
|
|
2588
|
+
this._result = "";
|
|
2589
|
+
this._latency = "";
|
|
2590
|
+
this._description = "";
|
|
2591
|
+
this.objectives = new array.CMIArray({
|
|
2592
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2593
|
+
errorClass: Scorm2004ValidationError,
|
|
2594
|
+
children: api_constants.scorm2004_constants.objectives_children,
|
|
2595
|
+
});
|
|
2596
|
+
this.correct_responses = new array.CMIArray({
|
|
2597
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2598
|
+
errorClass: Scorm2004ValidationError,
|
|
2599
|
+
children: api_constants.scorm2004_constants.correct_responses_children,
|
|
2600
|
+
});
|
|
2601
|
+
};
|
|
2470
2602
|
Object.defineProperty(CMIInteractionsObject.prototype, "id", {
|
|
2471
2603
|
get: function () {
|
|
2472
2604
|
return this._id;
|
|
2473
2605
|
},
|
|
2474
2606
|
set: function (id) {
|
|
2475
|
-
if (check2004ValidFormat(id, regex
|
|
2607
|
+
if (check2004ValidFormat(id, regex.scorm2004_regex.CMILongIdentifier)) {
|
|
2476
2608
|
this._id = id;
|
|
2477
2609
|
}
|
|
2478
2610
|
},
|
|
@@ -2485,10 +2617,10 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2485
2617
|
},
|
|
2486
2618
|
set: function (type) {
|
|
2487
2619
|
if (this.initialized && this._id === "") {
|
|
2488
|
-
throw new
|
|
2620
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2489
2621
|
}
|
|
2490
2622
|
else {
|
|
2491
|
-
if (check2004ValidFormat(type, regex
|
|
2623
|
+
if (check2004ValidFormat(type, regex.scorm2004_regex.CMIType)) {
|
|
2492
2624
|
this._type = type;
|
|
2493
2625
|
}
|
|
2494
2626
|
}
|
|
@@ -2502,10 +2634,10 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2502
2634
|
},
|
|
2503
2635
|
set: function (timestamp) {
|
|
2504
2636
|
if (this.initialized && this._id === "") {
|
|
2505
|
-
throw new
|
|
2637
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2506
2638
|
}
|
|
2507
2639
|
else {
|
|
2508
|
-
if (check2004ValidFormat(timestamp, regex
|
|
2640
|
+
if (check2004ValidFormat(timestamp, regex.scorm2004_regex.CMITime)) {
|
|
2509
2641
|
this._timestamp = timestamp;
|
|
2510
2642
|
}
|
|
2511
2643
|
}
|
|
@@ -2519,10 +2651,10 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2519
2651
|
},
|
|
2520
2652
|
set: function (weighting) {
|
|
2521
2653
|
if (this.initialized && this._id === "") {
|
|
2522
|
-
throw new
|
|
2654
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2523
2655
|
}
|
|
2524
2656
|
else {
|
|
2525
|
-
if (check2004ValidFormat(weighting, regex
|
|
2657
|
+
if (check2004ValidFormat(weighting, regex.scorm2004_regex.CMIDecimal)) {
|
|
2526
2658
|
this._weighting = weighting;
|
|
2527
2659
|
}
|
|
2528
2660
|
}
|
|
@@ -2536,7 +2668,7 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2536
2668
|
},
|
|
2537
2669
|
set: function (learner_response) {
|
|
2538
2670
|
if (this.initialized && (this._type === "" || this._id === "")) {
|
|
2539
|
-
throw new
|
|
2671
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2540
2672
|
}
|
|
2541
2673
|
else {
|
|
2542
2674
|
var nodes = [];
|
|
@@ -2555,28 +2687,28 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2555
2687
|
var values = nodes[i].split(response_type.delimiter2);
|
|
2556
2688
|
if (values.length === 2) {
|
|
2557
2689
|
if (!values[0].match(formatRegex)) {
|
|
2558
|
-
throw new
|
|
2690
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2559
2691
|
}
|
|
2560
2692
|
else {
|
|
2561
2693
|
if (!response_type.format2 ||
|
|
2562
2694
|
!values[1].match(new RegExp(response_type.format2))) {
|
|
2563
|
-
throw new
|
|
2695
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2564
2696
|
}
|
|
2565
2697
|
}
|
|
2566
2698
|
}
|
|
2567
2699
|
else {
|
|
2568
|
-
throw new
|
|
2700
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2569
2701
|
}
|
|
2570
2702
|
}
|
|
2571
2703
|
else {
|
|
2572
2704
|
if (!nodes[i].match(formatRegex)) {
|
|
2573
|
-
throw new
|
|
2705
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2574
2706
|
}
|
|
2575
2707
|
else {
|
|
2576
2708
|
if (nodes[i] !== "" && response_type.unique) {
|
|
2577
2709
|
for (var j = 0; j < i; j++) {
|
|
2578
2710
|
if (nodes[i] === nodes[j]) {
|
|
2579
|
-
throw new
|
|
2711
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2580
2712
|
}
|
|
2581
2713
|
}
|
|
2582
2714
|
}
|
|
@@ -2585,12 +2717,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2585
2717
|
}
|
|
2586
2718
|
}
|
|
2587
2719
|
else {
|
|
2588
|
-
throw new
|
|
2720
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE);
|
|
2589
2721
|
}
|
|
2590
2722
|
this._learner_response = learner_response;
|
|
2591
2723
|
}
|
|
2592
2724
|
else {
|
|
2593
|
-
throw new
|
|
2725
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2594
2726
|
}
|
|
2595
2727
|
}
|
|
2596
2728
|
},
|
|
@@ -2602,7 +2734,7 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2602
2734
|
return this._result;
|
|
2603
2735
|
},
|
|
2604
2736
|
set: function (result) {
|
|
2605
|
-
if (check2004ValidFormat(result, regex
|
|
2737
|
+
if (check2004ValidFormat(result, regex.scorm2004_regex.CMIResult)) {
|
|
2606
2738
|
this._result = result;
|
|
2607
2739
|
}
|
|
2608
2740
|
},
|
|
@@ -2615,10 +2747,10 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2615
2747
|
},
|
|
2616
2748
|
set: function (latency) {
|
|
2617
2749
|
if (this.initialized && this._id === "") {
|
|
2618
|
-
throw new
|
|
2750
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2619
2751
|
}
|
|
2620
2752
|
else {
|
|
2621
|
-
if (check2004ValidFormat(latency, regex
|
|
2753
|
+
if (check2004ValidFormat(latency, regex.scorm2004_regex.CMITimespan)) {
|
|
2622
2754
|
this._latency = latency;
|
|
2623
2755
|
}
|
|
2624
2756
|
}
|
|
@@ -2632,10 +2764,10 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2632
2764
|
},
|
|
2633
2765
|
set: function (description) {
|
|
2634
2766
|
if (this.initialized && this._id === "") {
|
|
2635
|
-
throw new
|
|
2767
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2636
2768
|
}
|
|
2637
2769
|
else {
|
|
2638
|
-
if (check2004ValidFormat(description, regex
|
|
2770
|
+
if (check2004ValidFormat(description, regex.scorm2004_regex.CMILangString250, true)) {
|
|
2639
2771
|
this._description = description;
|
|
2640
2772
|
}
|
|
2641
2773
|
}
|
|
@@ -2661,21 +2793,25 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2661
2793
|
return result;
|
|
2662
2794
|
};
|
|
2663
2795
|
return CMIInteractionsObject;
|
|
2664
|
-
}(base_cmi
|
|
2796
|
+
}(base_cmi.BaseCMI));
|
|
2665
2797
|
|
|
2666
2798
|
var CMIInteractionsObjectivesObject = (function (_super) {
|
|
2667
|
-
(0,tslib_es6
|
|
2799
|
+
(0,tslib_es6.__extends)(CMIInteractionsObjectivesObject, _super);
|
|
2668
2800
|
function CMIInteractionsObjectivesObject() {
|
|
2669
2801
|
var _this = _super.call(this) || this;
|
|
2670
2802
|
_this._id = "";
|
|
2671
2803
|
return _this;
|
|
2672
2804
|
}
|
|
2805
|
+
CMIInteractionsObjectivesObject.prototype.reset = function () {
|
|
2806
|
+
this._initialized = false;
|
|
2807
|
+
this._id = "";
|
|
2808
|
+
};
|
|
2673
2809
|
Object.defineProperty(CMIInteractionsObjectivesObject.prototype, "id", {
|
|
2674
2810
|
get: function () {
|
|
2675
2811
|
return this._id;
|
|
2676
2812
|
},
|
|
2677
2813
|
set: function (id) {
|
|
2678
|
-
if (check2004ValidFormat(id, regex
|
|
2814
|
+
if (check2004ValidFormat(id, regex.scorm2004_regex.CMILongIdentifier)) {
|
|
2679
2815
|
this._id = id;
|
|
2680
2816
|
}
|
|
2681
2817
|
},
|
|
@@ -2691,21 +2827,25 @@ var CMIInteractionsObjectivesObject = (function (_super) {
|
|
|
2691
2827
|
return result;
|
|
2692
2828
|
};
|
|
2693
2829
|
return CMIInteractionsObjectivesObject;
|
|
2694
|
-
}(base_cmi
|
|
2830
|
+
}(base_cmi.BaseCMI));
|
|
2695
2831
|
|
|
2696
2832
|
var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
2697
|
-
(0,tslib_es6
|
|
2833
|
+
(0,tslib_es6.__extends)(CMIInteractionsCorrectResponsesObject, _super);
|
|
2698
2834
|
function CMIInteractionsCorrectResponsesObject() {
|
|
2699
2835
|
var _this = _super.call(this) || this;
|
|
2700
2836
|
_this._pattern = "";
|
|
2701
2837
|
return _this;
|
|
2702
2838
|
}
|
|
2839
|
+
CMIInteractionsCorrectResponsesObject.prototype.reset = function () {
|
|
2840
|
+
this._initialized = false;
|
|
2841
|
+
this._pattern = "";
|
|
2842
|
+
};
|
|
2703
2843
|
Object.defineProperty(CMIInteractionsCorrectResponsesObject.prototype, "pattern", {
|
|
2704
2844
|
get: function () {
|
|
2705
2845
|
return this._pattern;
|
|
2706
2846
|
},
|
|
2707
2847
|
set: function (pattern) {
|
|
2708
|
-
if (check2004ValidFormat(pattern, regex
|
|
2848
|
+
if (check2004ValidFormat(pattern, regex.scorm2004_regex.CMIFeedback)) {
|
|
2709
2849
|
this._pattern = pattern;
|
|
2710
2850
|
}
|
|
2711
2851
|
},
|
|
@@ -2721,7 +2861,7 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
2721
2861
|
return result;
|
|
2722
2862
|
};
|
|
2723
2863
|
return CMIInteractionsCorrectResponsesObject;
|
|
2724
|
-
}(base_cmi
|
|
2864
|
+
}(base_cmi.BaseCMI));
|
|
2725
2865
|
|
|
2726
2866
|
|
|
2727
2867
|
// EXTERNAL MODULE: ./src/cmi/common/score.ts
|
|
@@ -2735,27 +2875,34 @@ var score = __webpack_require__(434);
|
|
|
2735
2875
|
|
|
2736
2876
|
|
|
2737
2877
|
var Scorm2004CMIScore = (function (_super) {
|
|
2738
|
-
(0,tslib_es6
|
|
2878
|
+
(0,tslib_es6.__extends)(Scorm2004CMIScore, _super);
|
|
2739
2879
|
function Scorm2004CMIScore() {
|
|
2740
2880
|
var _this = _super.call(this, {
|
|
2741
|
-
score_children: api_constants
|
|
2881
|
+
score_children: api_constants.scorm2004_constants.score_children,
|
|
2742
2882
|
max: "",
|
|
2743
|
-
invalidErrorCode: error_codes
|
|
2744
|
-
invalidTypeCode: error_codes
|
|
2745
|
-
invalidRangeCode: error_codes
|
|
2746
|
-
decimalRegex: regex
|
|
2747
|
-
errorClass:
|
|
2883
|
+
invalidErrorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2884
|
+
invalidTypeCode: error_codes.scorm2004_errors.TYPE_MISMATCH,
|
|
2885
|
+
invalidRangeCode: error_codes.scorm2004_errors.VALUE_OUT_OF_RANGE,
|
|
2886
|
+
decimalRegex: regex.scorm2004_regex.CMIDecimal,
|
|
2887
|
+
errorClass: Scorm2004ValidationError,
|
|
2748
2888
|
}) || this;
|
|
2749
2889
|
_this._scaled = "";
|
|
2750
2890
|
return _this;
|
|
2751
2891
|
}
|
|
2892
|
+
Scorm2004CMIScore.prototype.reset = function () {
|
|
2893
|
+
this._initialized = false;
|
|
2894
|
+
this._scaled = "";
|
|
2895
|
+
this._raw = "";
|
|
2896
|
+
this._min = "";
|
|
2897
|
+
this._max = "";
|
|
2898
|
+
};
|
|
2752
2899
|
Object.defineProperty(Scorm2004CMIScore.prototype, "scaled", {
|
|
2753
2900
|
get: function () {
|
|
2754
2901
|
return this._scaled;
|
|
2755
2902
|
},
|
|
2756
2903
|
set: function (scaled) {
|
|
2757
|
-
if (check2004ValidFormat(scaled, regex
|
|
2758
|
-
check2004ValidRange(scaled, regex
|
|
2904
|
+
if (check2004ValidFormat(scaled, regex.scorm2004_regex.CMIDecimal) &&
|
|
2905
|
+
check2004ValidRange(scaled, regex.scorm2004_regex.scaled_range)) {
|
|
2759
2906
|
this._scaled = scaled;
|
|
2760
2907
|
}
|
|
2761
2908
|
},
|
|
@@ -2774,7 +2921,7 @@ var Scorm2004CMIScore = (function (_super) {
|
|
|
2774
2921
|
return result;
|
|
2775
2922
|
};
|
|
2776
2923
|
return Scorm2004CMIScore;
|
|
2777
|
-
}(score
|
|
2924
|
+
}(score.CMIScore));
|
|
2778
2925
|
|
|
2779
2926
|
|
|
2780
2927
|
;// ./src/cmi/scorm2004/comments.ts
|
|
@@ -2787,31 +2934,31 @@ var Scorm2004CMIScore = (function (_super) {
|
|
|
2787
2934
|
|
|
2788
2935
|
|
|
2789
2936
|
var CMICommentsFromLMS = (function (_super) {
|
|
2790
|
-
(0,tslib_es6
|
|
2937
|
+
(0,tslib_es6.__extends)(CMICommentsFromLMS, _super);
|
|
2791
2938
|
function CMICommentsFromLMS() {
|
|
2792
2939
|
return _super.call(this, {
|
|
2793
|
-
children: api_constants
|
|
2794
|
-
errorCode: error_codes
|
|
2795
|
-
errorClass:
|
|
2940
|
+
children: api_constants.scorm2004_constants.comments_children,
|
|
2941
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2942
|
+
errorClass: Scorm2004ValidationError,
|
|
2796
2943
|
}) || this;
|
|
2797
2944
|
}
|
|
2798
2945
|
return CMICommentsFromLMS;
|
|
2799
|
-
}(array
|
|
2946
|
+
}(array.CMIArray));
|
|
2800
2947
|
|
|
2801
2948
|
var CMICommentsFromLearner = (function (_super) {
|
|
2802
|
-
(0,tslib_es6
|
|
2949
|
+
(0,tslib_es6.__extends)(CMICommentsFromLearner, _super);
|
|
2803
2950
|
function CMICommentsFromLearner() {
|
|
2804
2951
|
return _super.call(this, {
|
|
2805
|
-
children: api_constants
|
|
2806
|
-
errorCode: error_codes
|
|
2807
|
-
errorClass:
|
|
2952
|
+
children: api_constants.scorm2004_constants.comments_children,
|
|
2953
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2954
|
+
errorClass: Scorm2004ValidationError,
|
|
2808
2955
|
}) || this;
|
|
2809
2956
|
}
|
|
2810
2957
|
return CMICommentsFromLearner;
|
|
2811
|
-
}(array
|
|
2958
|
+
}(array.CMIArray));
|
|
2812
2959
|
|
|
2813
2960
|
var CMICommentsObject = (function (_super) {
|
|
2814
|
-
(0,tslib_es6
|
|
2961
|
+
(0,tslib_es6.__extends)(CMICommentsObject, _super);
|
|
2815
2962
|
function CMICommentsObject(readOnlyAfterInit) {
|
|
2816
2963
|
if (readOnlyAfterInit === void 0) { readOnlyAfterInit = false; }
|
|
2817
2964
|
var _this = _super.call(this) || this;
|
|
@@ -2824,16 +2971,19 @@ var CMICommentsObject = (function (_super) {
|
|
|
2824
2971
|
_this._readOnlyAfterInit = readOnlyAfterInit;
|
|
2825
2972
|
return _this;
|
|
2826
2973
|
}
|
|
2974
|
+
CMICommentsObject.prototype.reset = function () {
|
|
2975
|
+
this._initialized = false;
|
|
2976
|
+
};
|
|
2827
2977
|
Object.defineProperty(CMICommentsObject.prototype, "comment", {
|
|
2828
2978
|
get: function () {
|
|
2829
2979
|
return this._comment;
|
|
2830
2980
|
},
|
|
2831
2981
|
set: function (comment) {
|
|
2832
2982
|
if (this.initialized && this._readOnlyAfterInit) {
|
|
2833
|
-
throw new
|
|
2983
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
2834
2984
|
}
|
|
2835
2985
|
else {
|
|
2836
|
-
if (check2004ValidFormat(comment, regex
|
|
2986
|
+
if (check2004ValidFormat(comment, regex.scorm2004_regex.CMILangString4000, true)) {
|
|
2837
2987
|
this._comment = comment;
|
|
2838
2988
|
}
|
|
2839
2989
|
}
|
|
@@ -2847,10 +2997,10 @@ var CMICommentsObject = (function (_super) {
|
|
|
2847
2997
|
},
|
|
2848
2998
|
set: function (location) {
|
|
2849
2999
|
if (this.initialized && this._readOnlyAfterInit) {
|
|
2850
|
-
throw new
|
|
3000
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
2851
3001
|
}
|
|
2852
3002
|
else {
|
|
2853
|
-
if (check2004ValidFormat(location, regex
|
|
3003
|
+
if (check2004ValidFormat(location, regex.scorm2004_regex.CMIString250)) {
|
|
2854
3004
|
this._location = location;
|
|
2855
3005
|
}
|
|
2856
3006
|
}
|
|
@@ -2864,10 +3014,10 @@ var CMICommentsObject = (function (_super) {
|
|
|
2864
3014
|
},
|
|
2865
3015
|
set: function (timestamp) {
|
|
2866
3016
|
if (this.initialized && this._readOnlyAfterInit) {
|
|
2867
|
-
throw new
|
|
3017
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
2868
3018
|
}
|
|
2869
3019
|
else {
|
|
2870
|
-
if (check2004ValidFormat(timestamp, regex
|
|
3020
|
+
if (check2004ValidFormat(timestamp, regex.scorm2004_regex.CMITime)) {
|
|
2871
3021
|
this._timestamp = timestamp;
|
|
2872
3022
|
}
|
|
2873
3023
|
}
|
|
@@ -2886,7 +3036,7 @@ var CMICommentsObject = (function (_super) {
|
|
|
2886
3036
|
return result;
|
|
2887
3037
|
};
|
|
2888
3038
|
return CMICommentsObject;
|
|
2889
|
-
}(base_cmi
|
|
3039
|
+
}(base_cmi.BaseCMI));
|
|
2890
3040
|
|
|
2891
3041
|
|
|
2892
3042
|
;// ./src/cmi/scorm2004/objectives.ts
|
|
@@ -2900,19 +3050,28 @@ var CMICommentsObject = (function (_super) {
|
|
|
2900
3050
|
|
|
2901
3051
|
|
|
2902
3052
|
var CMIObjectives = (function (_super) {
|
|
2903
|
-
(0,tslib_es6
|
|
3053
|
+
(0,tslib_es6.__extends)(CMIObjectives, _super);
|
|
2904
3054
|
function CMIObjectives() {
|
|
2905
3055
|
return _super.call(this, {
|
|
2906
|
-
children: api_constants
|
|
2907
|
-
errorCode: error_codes
|
|
2908
|
-
errorClass:
|
|
3056
|
+
children: api_constants.scorm2004_constants.objectives_children,
|
|
3057
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
3058
|
+
errorClass: Scorm2004ValidationError,
|
|
2909
3059
|
}) || this;
|
|
2910
3060
|
}
|
|
3061
|
+
CMIObjectives.prototype.findObjectiveById = function (id) {
|
|
3062
|
+
return this.childArray.find(function (objective) { return objective.id === id; });
|
|
3063
|
+
};
|
|
3064
|
+
CMIObjectives.prototype.findObjectiveByIndex = function (index) {
|
|
3065
|
+
return this.childArray[index];
|
|
3066
|
+
};
|
|
3067
|
+
CMIObjectives.prototype.setObjectiveByIndex = function (index, objective) {
|
|
3068
|
+
this.childArray[index] = objective;
|
|
3069
|
+
};
|
|
2911
3070
|
return CMIObjectives;
|
|
2912
|
-
}(array
|
|
3071
|
+
}(array.CMIArray));
|
|
2913
3072
|
|
|
2914
3073
|
var CMIObjectivesObject = (function (_super) {
|
|
2915
|
-
(0,tslib_es6
|
|
3074
|
+
(0,tslib_es6.__extends)(CMIObjectivesObject, _super);
|
|
2916
3075
|
function CMIObjectivesObject() {
|
|
2917
3076
|
var _this = _super.call(this) || this;
|
|
2918
3077
|
_this._id = "";
|
|
@@ -2923,6 +3082,9 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2923
3082
|
_this.score = new Scorm2004CMIScore();
|
|
2924
3083
|
return _this;
|
|
2925
3084
|
}
|
|
3085
|
+
CMIObjectivesObject.prototype.reset = function () {
|
|
3086
|
+
this._initialized = false;
|
|
3087
|
+
};
|
|
2926
3088
|
CMIObjectivesObject.prototype.initialize = function () {
|
|
2927
3089
|
var _a;
|
|
2928
3090
|
_super.prototype.initialize.call(this);
|
|
@@ -2933,7 +3095,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2933
3095
|
return this._id;
|
|
2934
3096
|
},
|
|
2935
3097
|
set: function (id) {
|
|
2936
|
-
if (check2004ValidFormat(id, regex
|
|
3098
|
+
if (check2004ValidFormat(id, regex.scorm2004_regex.CMILongIdentifier)) {
|
|
2937
3099
|
this._id = id;
|
|
2938
3100
|
}
|
|
2939
3101
|
},
|
|
@@ -2946,10 +3108,10 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2946
3108
|
},
|
|
2947
3109
|
set: function (success_status) {
|
|
2948
3110
|
if (this.initialized && this._id === "") {
|
|
2949
|
-
throw new
|
|
3111
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2950
3112
|
}
|
|
2951
3113
|
else {
|
|
2952
|
-
if (check2004ValidFormat(success_status, regex
|
|
3114
|
+
if (check2004ValidFormat(success_status, regex.scorm2004_regex.CMISStatus)) {
|
|
2953
3115
|
this._success_status = success_status;
|
|
2954
3116
|
}
|
|
2955
3117
|
}
|
|
@@ -2963,10 +3125,10 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2963
3125
|
},
|
|
2964
3126
|
set: function (completion_status) {
|
|
2965
3127
|
if (this.initialized && this._id === "") {
|
|
2966
|
-
throw new
|
|
3128
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2967
3129
|
}
|
|
2968
3130
|
else {
|
|
2969
|
-
if (check2004ValidFormat(completion_status, regex
|
|
3131
|
+
if (check2004ValidFormat(completion_status, regex.scorm2004_regex.CMICStatus)) {
|
|
2970
3132
|
this._completion_status = completion_status;
|
|
2971
3133
|
}
|
|
2972
3134
|
}
|
|
@@ -2980,11 +3142,11 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2980
3142
|
},
|
|
2981
3143
|
set: function (progress_measure) {
|
|
2982
3144
|
if (this.initialized && this._id === "") {
|
|
2983
|
-
throw new
|
|
3145
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2984
3146
|
}
|
|
2985
3147
|
else {
|
|
2986
|
-
if (check2004ValidFormat(progress_measure, regex
|
|
2987
|
-
check2004ValidRange(progress_measure, regex
|
|
3148
|
+
if (check2004ValidFormat(progress_measure, regex.scorm2004_regex.CMIDecimal) &&
|
|
3149
|
+
check2004ValidRange(progress_measure, regex.scorm2004_regex.progress_range)) {
|
|
2988
3150
|
this._progress_measure = progress_measure;
|
|
2989
3151
|
}
|
|
2990
3152
|
}
|
|
@@ -2998,10 +3160,10 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2998
3160
|
},
|
|
2999
3161
|
set: function (description) {
|
|
3000
3162
|
if (this.initialized && this._id === "") {
|
|
3001
|
-
throw new
|
|
3163
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
3002
3164
|
}
|
|
3003
3165
|
else {
|
|
3004
|
-
if (check2004ValidFormat(description, regex
|
|
3166
|
+
if (check2004ValidFormat(description, regex.scorm2004_regex.CMILangString250, true)) {
|
|
3005
3167
|
this._description = description;
|
|
3006
3168
|
}
|
|
3007
3169
|
}
|
|
@@ -3023,7 +3185,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
3023
3185
|
return result;
|
|
3024
3186
|
};
|
|
3025
3187
|
return CMIObjectivesObject;
|
|
3026
|
-
}(base_cmi
|
|
3188
|
+
}(base_cmi.BaseCMI));
|
|
3027
3189
|
|
|
3028
3190
|
|
|
3029
3191
|
;// ./src/cmi/scorm2004/cmi.ts
|
|
@@ -3041,12 +3203,12 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
3041
3203
|
|
|
3042
3204
|
|
|
3043
3205
|
var CMI = (function (_super) {
|
|
3044
|
-
(0,tslib_es6
|
|
3206
|
+
(0,tslib_es6.__extends)(CMI, _super);
|
|
3045
3207
|
function CMI(initialized) {
|
|
3046
3208
|
if (initialized === void 0) { initialized = false; }
|
|
3047
3209
|
var _this = _super.call(this) || this;
|
|
3048
3210
|
_this.__version = "1.0";
|
|
3049
|
-
_this.__children = api_constants
|
|
3211
|
+
_this.__children = api_constants.scorm2004_constants.cmi_children;
|
|
3050
3212
|
_this._completion_status = "unknown";
|
|
3051
3213
|
_this._completion_threshold = "";
|
|
3052
3214
|
_this._credit = "credit";
|
|
@@ -3085,12 +3247,27 @@ var CMI = (function (_super) {
|
|
|
3085
3247
|
(_e = this.interactions) === null || _e === void 0 ? void 0 : _e.initialize();
|
|
3086
3248
|
(_f = this.objectives) === null || _f === void 0 ? void 0 : _f.initialize();
|
|
3087
3249
|
};
|
|
3250
|
+
CMI.prototype.reset = function () {
|
|
3251
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3252
|
+
this._initialized = false;
|
|
3253
|
+
this._completion_status = "incomplete";
|
|
3254
|
+
this._exit = "";
|
|
3255
|
+
this._session_time = "PT0H0M0S";
|
|
3256
|
+
this._progress_measure = "";
|
|
3257
|
+
this._location = "";
|
|
3258
|
+
(_a = this.objectives) === null || _a === void 0 ? void 0 : _a.reset(false);
|
|
3259
|
+
(_b = this.interactions) === null || _b === void 0 ? void 0 : _b.reset(true);
|
|
3260
|
+
(_c = this.score) === null || _c === void 0 ? void 0 : _c.reset();
|
|
3261
|
+
(_d = this.comments_from_learner) === null || _d === void 0 ? void 0 : _d.reset();
|
|
3262
|
+
(_e = this.comments_from_lms) === null || _e === void 0 ? void 0 : _e.reset();
|
|
3263
|
+
(_f = this.learner_preference) === null || _f === void 0 ? void 0 : _f.reset();
|
|
3264
|
+
};
|
|
3088
3265
|
Object.defineProperty(CMI.prototype, "_version", {
|
|
3089
3266
|
get: function () {
|
|
3090
3267
|
return this.__version;
|
|
3091
3268
|
},
|
|
3092
3269
|
set: function (_version) {
|
|
3093
|
-
throw new
|
|
3270
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3094
3271
|
},
|
|
3095
3272
|
enumerable: false,
|
|
3096
3273
|
configurable: true
|
|
@@ -3100,7 +3277,7 @@ var CMI = (function (_super) {
|
|
|
3100
3277
|
return this.__children;
|
|
3101
3278
|
},
|
|
3102
3279
|
set: function (_children) {
|
|
3103
|
-
throw new
|
|
3280
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3104
3281
|
},
|
|
3105
3282
|
enumerable: false,
|
|
3106
3283
|
configurable: true
|
|
@@ -3110,7 +3287,7 @@ var CMI = (function (_super) {
|
|
|
3110
3287
|
return this._completion_status;
|
|
3111
3288
|
},
|
|
3112
3289
|
set: function (completion_status) {
|
|
3113
|
-
if (check2004ValidFormat(completion_status, regex
|
|
3290
|
+
if (check2004ValidFormat(completion_status, regex.scorm2004_regex.CMICStatus)) {
|
|
3114
3291
|
this._completion_status = completion_status;
|
|
3115
3292
|
}
|
|
3116
3293
|
},
|
|
@@ -3123,7 +3300,7 @@ var CMI = (function (_super) {
|
|
|
3123
3300
|
},
|
|
3124
3301
|
set: function (completion_threshold) {
|
|
3125
3302
|
if (this.initialized) {
|
|
3126
|
-
throw new
|
|
3303
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3127
3304
|
}
|
|
3128
3305
|
else {
|
|
3129
3306
|
this._completion_threshold = completion_threshold;
|
|
@@ -3138,7 +3315,7 @@ var CMI = (function (_super) {
|
|
|
3138
3315
|
},
|
|
3139
3316
|
set: function (credit) {
|
|
3140
3317
|
if (this.initialized) {
|
|
3141
|
-
throw new
|
|
3318
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3142
3319
|
}
|
|
3143
3320
|
else {
|
|
3144
3321
|
this._credit = credit;
|
|
@@ -3153,7 +3330,7 @@ var CMI = (function (_super) {
|
|
|
3153
3330
|
},
|
|
3154
3331
|
set: function (entry) {
|
|
3155
3332
|
if (this.initialized) {
|
|
3156
|
-
throw new
|
|
3333
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3157
3334
|
}
|
|
3158
3335
|
else {
|
|
3159
3336
|
this._entry = entry;
|
|
@@ -3165,12 +3342,12 @@ var CMI = (function (_super) {
|
|
|
3165
3342
|
Object.defineProperty(CMI.prototype, "exit", {
|
|
3166
3343
|
get: function () {
|
|
3167
3344
|
if (!this.jsonString) {
|
|
3168
|
-
throw new
|
|
3345
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.WRITE_ONLY_ELEMENT);
|
|
3169
3346
|
}
|
|
3170
3347
|
return this._exit;
|
|
3171
3348
|
},
|
|
3172
3349
|
set: function (exit) {
|
|
3173
|
-
if (check2004ValidFormat(exit, regex
|
|
3350
|
+
if (check2004ValidFormat(exit, regex.scorm2004_regex.CMIExit, true)) {
|
|
3174
3351
|
this._exit = exit;
|
|
3175
3352
|
}
|
|
3176
3353
|
},
|
|
@@ -3183,7 +3360,7 @@ var CMI = (function (_super) {
|
|
|
3183
3360
|
},
|
|
3184
3361
|
set: function (launch_data) {
|
|
3185
3362
|
if (this.initialized) {
|
|
3186
|
-
throw new
|
|
3363
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3187
3364
|
}
|
|
3188
3365
|
else {
|
|
3189
3366
|
this._launch_data = launch_data;
|
|
@@ -3198,7 +3375,7 @@ var CMI = (function (_super) {
|
|
|
3198
3375
|
},
|
|
3199
3376
|
set: function (learner_id) {
|
|
3200
3377
|
if (this.initialized) {
|
|
3201
|
-
throw new
|
|
3378
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3202
3379
|
}
|
|
3203
3380
|
else {
|
|
3204
3381
|
this._learner_id = learner_id;
|
|
@@ -3213,7 +3390,7 @@ var CMI = (function (_super) {
|
|
|
3213
3390
|
},
|
|
3214
3391
|
set: function (learner_name) {
|
|
3215
3392
|
if (this.initialized) {
|
|
3216
|
-
throw new
|
|
3393
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3217
3394
|
}
|
|
3218
3395
|
else {
|
|
3219
3396
|
this._learner_name = learner_name;
|
|
@@ -3227,7 +3404,7 @@ var CMI = (function (_super) {
|
|
|
3227
3404
|
return this._location;
|
|
3228
3405
|
},
|
|
3229
3406
|
set: function (location) {
|
|
3230
|
-
if (check2004ValidFormat(location, regex
|
|
3407
|
+
if (check2004ValidFormat(location, regex.scorm2004_regex.CMIString1000)) {
|
|
3231
3408
|
this._location = location;
|
|
3232
3409
|
}
|
|
3233
3410
|
},
|
|
@@ -3240,7 +3417,7 @@ var CMI = (function (_super) {
|
|
|
3240
3417
|
},
|
|
3241
3418
|
set: function (max_time_allowed) {
|
|
3242
3419
|
if (this.initialized) {
|
|
3243
|
-
throw new
|
|
3420
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3244
3421
|
}
|
|
3245
3422
|
else {
|
|
3246
3423
|
this._max_time_allowed = max_time_allowed;
|
|
@@ -3255,7 +3432,7 @@ var CMI = (function (_super) {
|
|
|
3255
3432
|
},
|
|
3256
3433
|
set: function (mode) {
|
|
3257
3434
|
if (this.initialized) {
|
|
3258
|
-
throw new
|
|
3435
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3259
3436
|
}
|
|
3260
3437
|
else {
|
|
3261
3438
|
this._mode = mode;
|
|
@@ -3269,8 +3446,8 @@ var CMI = (function (_super) {
|
|
|
3269
3446
|
return this._progress_measure;
|
|
3270
3447
|
},
|
|
3271
3448
|
set: function (progress_measure) {
|
|
3272
|
-
if (check2004ValidFormat(progress_measure, regex
|
|
3273
|
-
check2004ValidRange(progress_measure, regex
|
|
3449
|
+
if (check2004ValidFormat(progress_measure, regex.scorm2004_regex.CMIDecimal) &&
|
|
3450
|
+
check2004ValidRange(progress_measure, regex.scorm2004_regex.progress_range)) {
|
|
3274
3451
|
this._progress_measure = progress_measure;
|
|
3275
3452
|
}
|
|
3276
3453
|
},
|
|
@@ -3283,7 +3460,7 @@ var CMI = (function (_super) {
|
|
|
3283
3460
|
},
|
|
3284
3461
|
set: function (scaled_passing_score) {
|
|
3285
3462
|
if (this.initialized) {
|
|
3286
|
-
throw new
|
|
3463
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3287
3464
|
}
|
|
3288
3465
|
else {
|
|
3289
3466
|
this._scaled_passing_score = scaled_passing_score;
|
|
@@ -3295,12 +3472,12 @@ var CMI = (function (_super) {
|
|
|
3295
3472
|
Object.defineProperty(CMI.prototype, "session_time", {
|
|
3296
3473
|
get: function () {
|
|
3297
3474
|
if (!this.jsonString) {
|
|
3298
|
-
throw new
|
|
3475
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.WRITE_ONLY_ELEMENT);
|
|
3299
3476
|
}
|
|
3300
3477
|
return this._session_time;
|
|
3301
3478
|
},
|
|
3302
3479
|
set: function (session_time) {
|
|
3303
|
-
if (check2004ValidFormat(session_time, regex
|
|
3480
|
+
if (check2004ValidFormat(session_time, regex.scorm2004_regex.CMITimespan)) {
|
|
3304
3481
|
this._session_time = session_time;
|
|
3305
3482
|
}
|
|
3306
3483
|
},
|
|
@@ -3312,7 +3489,7 @@ var CMI = (function (_super) {
|
|
|
3312
3489
|
return this._success_status;
|
|
3313
3490
|
},
|
|
3314
3491
|
set: function (success_status) {
|
|
3315
|
-
if (check2004ValidFormat(success_status, regex
|
|
3492
|
+
if (check2004ValidFormat(success_status, regex.scorm2004_regex.CMISStatus)) {
|
|
3316
3493
|
this._success_status = success_status;
|
|
3317
3494
|
}
|
|
3318
3495
|
},
|
|
@@ -3324,7 +3501,7 @@ var CMI = (function (_super) {
|
|
|
3324
3501
|
return this._suspend_data;
|
|
3325
3502
|
},
|
|
3326
3503
|
set: function (suspend_data) {
|
|
3327
|
-
if (check2004ValidFormat(suspend_data, regex
|
|
3504
|
+
if (check2004ValidFormat(suspend_data, regex.scorm2004_regex.CMIString64000, true)) {
|
|
3328
3505
|
this._suspend_data = suspend_data;
|
|
3329
3506
|
}
|
|
3330
3507
|
},
|
|
@@ -3337,7 +3514,7 @@ var CMI = (function (_super) {
|
|
|
3337
3514
|
},
|
|
3338
3515
|
set: function (time_limit_action) {
|
|
3339
3516
|
if (this.initialized) {
|
|
3340
|
-
throw new
|
|
3517
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3341
3518
|
}
|
|
3342
3519
|
else {
|
|
3343
3520
|
this._time_limit_action = time_limit_action;
|
|
@@ -3352,7 +3529,7 @@ var CMI = (function (_super) {
|
|
|
3352
3529
|
},
|
|
3353
3530
|
set: function (total_time) {
|
|
3354
3531
|
if (this.initialized) {
|
|
3355
|
-
throw new
|
|
3532
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3356
3533
|
}
|
|
3357
3534
|
else {
|
|
3358
3535
|
this._total_time = total_time;
|
|
@@ -3366,9 +3543,9 @@ var CMI = (function (_super) {
|
|
|
3366
3543
|
var startTime = this.start_time;
|
|
3367
3544
|
if (typeof startTime !== "undefined" && startTime !== null) {
|
|
3368
3545
|
var seconds = new Date().getTime() - startTime;
|
|
3369
|
-
sessionTime = utilities
|
|
3546
|
+
sessionTime = utilities.getSecondsAsISODuration(seconds / 1000);
|
|
3370
3547
|
}
|
|
3371
|
-
return utilities
|
|
3548
|
+
return utilities.addTwoDurations(this._total_time, sessionTime, regex.scorm2004_regex.CMITimespan);
|
|
3372
3549
|
};
|
|
3373
3550
|
CMI.prototype.toJSON = function () {
|
|
3374
3551
|
this.jsonString = true;
|
|
@@ -3401,7 +3578,7 @@ var CMI = (function (_super) {
|
|
|
3401
3578
|
return result;
|
|
3402
3579
|
};
|
|
3403
3580
|
return CMI;
|
|
3404
|
-
}(base_cmi
|
|
3581
|
+
}(base_cmi.BaseRootCMI));
|
|
3405
3582
|
|
|
3406
3583
|
|
|
3407
3584
|
;// ./src/constants/language_constants.ts
|
|
@@ -3810,11 +3987,15 @@ var enums = __webpack_require__(56);
|
|
|
3810
3987
|
|
|
3811
3988
|
|
|
3812
3989
|
|
|
3990
|
+
|
|
3991
|
+
|
|
3813
3992
|
var ADL = (function (_super) {
|
|
3814
|
-
(0,tslib_es6
|
|
3993
|
+
(0,tslib_es6.__extends)(ADL, _super);
|
|
3815
3994
|
function ADL() {
|
|
3816
3995
|
var _this = _super.call(this) || this;
|
|
3996
|
+
_this.data = new ADLData();
|
|
3817
3997
|
_this.nav = new ADLNav();
|
|
3998
|
+
_this.data = new ADLData();
|
|
3818
3999
|
return _this;
|
|
3819
4000
|
}
|
|
3820
4001
|
ADL.prototype.initialize = function () {
|
|
@@ -3822,19 +4003,25 @@ var ADL = (function (_super) {
|
|
|
3822
4003
|
_super.prototype.initialize.call(this);
|
|
3823
4004
|
(_a = this.nav) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
3824
4005
|
};
|
|
4006
|
+
ADL.prototype.reset = function () {
|
|
4007
|
+
var _a;
|
|
4008
|
+
this._initialized = false;
|
|
4009
|
+
(_a = this.nav) === null || _a === void 0 ? void 0 : _a.reset();
|
|
4010
|
+
};
|
|
3825
4011
|
ADL.prototype.toJSON = function () {
|
|
3826
4012
|
this.jsonString = true;
|
|
3827
4013
|
var result = {
|
|
3828
4014
|
nav: this.nav,
|
|
4015
|
+
data: this.data,
|
|
3829
4016
|
};
|
|
3830
4017
|
delete this.jsonString;
|
|
3831
4018
|
return result;
|
|
3832
4019
|
};
|
|
3833
4020
|
return ADL;
|
|
3834
|
-
}(base_cmi
|
|
4021
|
+
}(base_cmi.BaseCMI));
|
|
3835
4022
|
|
|
3836
4023
|
var ADLNav = (function (_super) {
|
|
3837
|
-
(0,tslib_es6
|
|
4024
|
+
(0,tslib_es6.__extends)(ADLNav, _super);
|
|
3838
4025
|
function ADLNav() {
|
|
3839
4026
|
var _this = _super.call(this) || this;
|
|
3840
4027
|
_this._request = "_none_";
|
|
@@ -3846,12 +4033,18 @@ var ADLNav = (function (_super) {
|
|
|
3846
4033
|
_super.prototype.initialize.call(this);
|
|
3847
4034
|
(_a = this.request_valid) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
3848
4035
|
};
|
|
4036
|
+
ADLNav.prototype.reset = function () {
|
|
4037
|
+
var _a;
|
|
4038
|
+
this._initialized = false;
|
|
4039
|
+
this._request = "_none_";
|
|
4040
|
+
(_a = this.request_valid) === null || _a === void 0 ? void 0 : _a.reset();
|
|
4041
|
+
};
|
|
3849
4042
|
Object.defineProperty(ADLNav.prototype, "request", {
|
|
3850
4043
|
get: function () {
|
|
3851
4044
|
return this._request;
|
|
3852
4045
|
},
|
|
3853
4046
|
set: function (request) {
|
|
3854
|
-
if (check2004ValidFormat(request, regex
|
|
4047
|
+
if (check2004ValidFormat(request, regex.scorm2004_regex.NAVEvent)) {
|
|
3855
4048
|
this._request = request;
|
|
3856
4049
|
}
|
|
3857
4050
|
},
|
|
@@ -3867,10 +4060,69 @@ var ADLNav = (function (_super) {
|
|
|
3867
4060
|
return result;
|
|
3868
4061
|
};
|
|
3869
4062
|
return ADLNav;
|
|
3870
|
-
}(base_cmi
|
|
4063
|
+
}(base_cmi.BaseCMI));
|
|
4064
|
+
|
|
4065
|
+
var ADLData = (function (_super) {
|
|
4066
|
+
(0,tslib_es6.__extends)(ADLData, _super);
|
|
4067
|
+
function ADLData() {
|
|
4068
|
+
return _super.call(this, {
|
|
4069
|
+
children: api_constants.scorm2004_constants.adl_data_children,
|
|
4070
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
4071
|
+
errorClass: Scorm2004ValidationError,
|
|
4072
|
+
}) || this;
|
|
4073
|
+
}
|
|
4074
|
+
return ADLData;
|
|
4075
|
+
}(array.CMIArray));
|
|
4076
|
+
|
|
4077
|
+
var ADLDataObject = (function (_super) {
|
|
4078
|
+
(0,tslib_es6.__extends)(ADLDataObject, _super);
|
|
4079
|
+
function ADLDataObject() {
|
|
4080
|
+
var _this = _super.call(this) || this;
|
|
4081
|
+
_this._id = "";
|
|
4082
|
+
_this._store = "";
|
|
4083
|
+
return _this;
|
|
4084
|
+
}
|
|
4085
|
+
ADLDataObject.prototype.reset = function () {
|
|
4086
|
+
this._initialized = false;
|
|
4087
|
+
};
|
|
4088
|
+
Object.defineProperty(ADLDataObject.prototype, "id", {
|
|
4089
|
+
get: function () {
|
|
4090
|
+
return this._id;
|
|
4091
|
+
},
|
|
4092
|
+
set: function (id) {
|
|
4093
|
+
if (check2004ValidFormat(id, regex.scorm2004_regex.CMILongIdentifier)) {
|
|
4094
|
+
this._id = id;
|
|
4095
|
+
}
|
|
4096
|
+
},
|
|
4097
|
+
enumerable: false,
|
|
4098
|
+
configurable: true
|
|
4099
|
+
});
|
|
4100
|
+
Object.defineProperty(ADLDataObject.prototype, "store", {
|
|
4101
|
+
get: function () {
|
|
4102
|
+
return this._store;
|
|
4103
|
+
},
|
|
4104
|
+
set: function (store) {
|
|
4105
|
+
if (check2004ValidFormat(store, regex.scorm2004_regex.CMILangString4000)) {
|
|
4106
|
+
this._store = store;
|
|
4107
|
+
}
|
|
4108
|
+
},
|
|
4109
|
+
enumerable: false,
|
|
4110
|
+
configurable: true
|
|
4111
|
+
});
|
|
4112
|
+
ADLDataObject.prototype.toJSON = function () {
|
|
4113
|
+
this.jsonString = true;
|
|
4114
|
+
var result = {
|
|
4115
|
+
id: this._id,
|
|
4116
|
+
store: this._store,
|
|
4117
|
+
};
|
|
4118
|
+
delete this.jsonString;
|
|
4119
|
+
return result;
|
|
4120
|
+
};
|
|
4121
|
+
return ADLDataObject;
|
|
4122
|
+
}(base_cmi.BaseCMI));
|
|
3871
4123
|
|
|
3872
4124
|
var ADLNavRequestValid = (function (_super) {
|
|
3873
|
-
(0,tslib_es6
|
|
4125
|
+
(0,tslib_es6.__extends)(ADLNavRequestValid, _super);
|
|
3874
4126
|
function ADLNavRequestValid() {
|
|
3875
4127
|
var _this = _super.call(this) || this;
|
|
3876
4128
|
_this._continue = "unknown";
|
|
@@ -3879,15 +4131,20 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
3879
4131
|
_this._jump = {};
|
|
3880
4132
|
return _this;
|
|
3881
4133
|
}
|
|
4134
|
+
ADLNavRequestValid.prototype.reset = function () {
|
|
4135
|
+
this._initialized = false;
|
|
4136
|
+
this._continue = "unknown";
|
|
4137
|
+
this._previous = "unknown";
|
|
4138
|
+
};
|
|
3882
4139
|
Object.defineProperty(ADLNavRequestValid.prototype, "continue", {
|
|
3883
4140
|
get: function () {
|
|
3884
4141
|
return this._continue;
|
|
3885
4142
|
},
|
|
3886
4143
|
set: function (_continue) {
|
|
3887
4144
|
if (this.initialized) {
|
|
3888
|
-
throw new
|
|
4145
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3889
4146
|
}
|
|
3890
|
-
if (check2004ValidFormat(_continue, regex
|
|
4147
|
+
if (check2004ValidFormat(_continue, regex.scorm2004_regex.NAVBoolean)) {
|
|
3891
4148
|
this._continue = _continue;
|
|
3892
4149
|
}
|
|
3893
4150
|
},
|
|
@@ -3900,9 +4157,9 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
3900
4157
|
},
|
|
3901
4158
|
set: function (_previous) {
|
|
3902
4159
|
if (this.initialized) {
|
|
3903
|
-
throw new
|
|
4160
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3904
4161
|
}
|
|
3905
|
-
if (check2004ValidFormat(_previous, regex
|
|
4162
|
+
if (check2004ValidFormat(_previous, regex.scorm2004_regex.NAVBoolean)) {
|
|
3906
4163
|
this._previous = _previous;
|
|
3907
4164
|
}
|
|
3908
4165
|
},
|
|
@@ -3915,17 +4172,17 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
3915
4172
|
},
|
|
3916
4173
|
set: function (choice) {
|
|
3917
4174
|
if (this.initialized) {
|
|
3918
|
-
throw new
|
|
4175
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3919
4176
|
}
|
|
3920
4177
|
if (typeof choice !== "object") {
|
|
3921
|
-
throw new
|
|
4178
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
3922
4179
|
}
|
|
3923
4180
|
for (var key in choice) {
|
|
3924
4181
|
if ({}.hasOwnProperty.call(choice, key)) {
|
|
3925
|
-
if (check2004ValidFormat(choice[key], regex
|
|
3926
|
-
check2004ValidFormat(key, regex
|
|
4182
|
+
if (check2004ValidFormat(choice[key], regex.scorm2004_regex.NAVBoolean) &&
|
|
4183
|
+
check2004ValidFormat(key, regex.scorm2004_regex.NAVTarget)) {
|
|
3927
4184
|
this._choice[key] =
|
|
3928
|
-
enums
|
|
4185
|
+
enums.NAVBoolean[choice[key]];
|
|
3929
4186
|
}
|
|
3930
4187
|
}
|
|
3931
4188
|
}
|
|
@@ -3939,16 +4196,16 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
3939
4196
|
},
|
|
3940
4197
|
set: function (jump) {
|
|
3941
4198
|
if (this.initialized) {
|
|
3942
|
-
throw new
|
|
4199
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3943
4200
|
}
|
|
3944
4201
|
if (typeof jump !== "object") {
|
|
3945
|
-
throw new
|
|
4202
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
3946
4203
|
}
|
|
3947
4204
|
for (var key in jump) {
|
|
3948
4205
|
if ({}.hasOwnProperty.call(jump, key)) {
|
|
3949
|
-
if (check2004ValidFormat(jump[key], regex
|
|
3950
|
-
check2004ValidFormat(key, regex
|
|
3951
|
-
this._jump[key] = enums
|
|
4206
|
+
if (check2004ValidFormat(jump[key], regex.scorm2004_regex.NAVBoolean) &&
|
|
4207
|
+
check2004ValidFormat(key, regex.scorm2004_regex.NAVTarget)) {
|
|
4208
|
+
this._jump[key] = enums.NAVBoolean[jump[key]];
|
|
3952
4209
|
}
|
|
3953
4210
|
}
|
|
3954
4211
|
}
|
|
@@ -3968,7 +4225,7 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
3968
4225
|
return result;
|
|
3969
4226
|
};
|
|
3970
4227
|
return ADLNavRequestValid;
|
|
3971
|
-
}(base_cmi
|
|
4228
|
+
}(base_cmi.BaseCMI));
|
|
3972
4229
|
|
|
3973
4230
|
|
|
3974
4231
|
;// ./src/Scorm2004API.ts
|
|
@@ -3987,9 +4244,8 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
3987
4244
|
|
|
3988
4245
|
|
|
3989
4246
|
|
|
3990
|
-
|
|
3991
4247
|
var Scorm2004Impl = (function (_super) {
|
|
3992
|
-
(0,tslib_es6
|
|
4248
|
+
(0,tslib_es6.__extends)(Scorm2004Impl, _super);
|
|
3993
4249
|
function Scorm2004Impl(settings) {
|
|
3994
4250
|
var _this = this;
|
|
3995
4251
|
if (settings) {
|
|
@@ -3997,8 +4253,9 @@ var Scorm2004Impl = (function (_super) {
|
|
|
3997
4253
|
settings.mastery_override = false;
|
|
3998
4254
|
}
|
|
3999
4255
|
}
|
|
4000
|
-
_this = _super.call(this, error_codes
|
|
4256
|
+
_this = _super.call(this, error_codes.scorm2004_errors, settings) || this;
|
|
4001
4257
|
_this._version = "1.0";
|
|
4258
|
+
_this._globalObjectives = [];
|
|
4002
4259
|
_this.cmi = new CMI();
|
|
4003
4260
|
_this.adl = new ADL();
|
|
4004
4261
|
_this.Initialize = _this.lmsInitialize;
|
|
@@ -4012,9 +4269,10 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4012
4269
|
return _this;
|
|
4013
4270
|
}
|
|
4014
4271
|
Scorm2004Impl.prototype.reset = function (settings) {
|
|
4272
|
+
var _a, _b;
|
|
4015
4273
|
this.commonReset(settings);
|
|
4016
|
-
this.cmi
|
|
4017
|
-
this.adl
|
|
4274
|
+
(_a = this.cmi) === null || _a === void 0 ? void 0 : _a.reset();
|
|
4275
|
+
(_b = this.adl) === null || _b === void 0 ? void 0 : _b.reset();
|
|
4018
4276
|
};
|
|
4019
4277
|
Object.defineProperty(Scorm2004Impl.prototype, "version", {
|
|
4020
4278
|
get: function () {
|
|
@@ -4023,14 +4281,21 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4023
4281
|
enumerable: false,
|
|
4024
4282
|
configurable: true
|
|
4025
4283
|
});
|
|
4284
|
+
Object.defineProperty(Scorm2004Impl.prototype, "globalObjectives", {
|
|
4285
|
+
get: function () {
|
|
4286
|
+
return this._globalObjectives;
|
|
4287
|
+
},
|
|
4288
|
+
enumerable: false,
|
|
4289
|
+
configurable: true
|
|
4290
|
+
});
|
|
4026
4291
|
Scorm2004Impl.prototype.lmsInitialize = function () {
|
|
4027
4292
|
this.cmi.initialize();
|
|
4028
4293
|
return this.initialize("Initialize");
|
|
4029
4294
|
};
|
|
4030
4295
|
Scorm2004Impl.prototype.lmsFinish = function () {
|
|
4031
4296
|
var _this = this;
|
|
4032
|
-
(function () { return (0,tslib_es6
|
|
4033
|
-
return (0,tslib_es6
|
|
4297
|
+
(function () { return (0,tslib_es6.__awaiter)(_this, void 0, void 0, function () {
|
|
4298
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
4034
4299
|
switch (_a.label) {
|
|
4035
4300
|
case 0: return [4, this.internalFinish()];
|
|
4036
4301
|
case 1:
|
|
@@ -4039,17 +4304,18 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4039
4304
|
}
|
|
4040
4305
|
});
|
|
4041
4306
|
}); })();
|
|
4042
|
-
return api_constants
|
|
4307
|
+
return api_constants.global_constants.SCORM_TRUE;
|
|
4043
4308
|
};
|
|
4044
4309
|
Scorm2004Impl.prototype.internalFinish = function () {
|
|
4045
|
-
return (0,tslib_es6
|
|
4310
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
4046
4311
|
var result, navActions, request, choiceJumpRegex, matches, target, action;
|
|
4047
|
-
|
|
4048
|
-
|
|
4312
|
+
var _a, _b, _c, _d;
|
|
4313
|
+
return (0,tslib_es6.__generator)(this, function (_e) {
|
|
4314
|
+
switch (_e.label) {
|
|
4049
4315
|
case 0: return [4, this.terminate("Terminate", true)];
|
|
4050
4316
|
case 1:
|
|
4051
|
-
result =
|
|
4052
|
-
if (result === api_constants
|
|
4317
|
+
result = _e.sent();
|
|
4318
|
+
if (result === api_constants.global_constants.SCORM_TRUE) {
|
|
4053
4319
|
if (this.adl.nav.request !== "_none_") {
|
|
4054
4320
|
navActions = {
|
|
4055
4321
|
continue: "SequenceNext",
|
|
@@ -4062,12 +4328,18 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4062
4328
|
abandonAll: "SequenceAbandonAll",
|
|
4063
4329
|
};
|
|
4064
4330
|
request = this.adl.nav.request;
|
|
4065
|
-
choiceJumpRegex = new RegExp(regex
|
|
4331
|
+
choiceJumpRegex = new RegExp(regex.scorm2004_regex.NAVEvent);
|
|
4066
4332
|
matches = request.match(choiceJumpRegex);
|
|
4067
4333
|
target = "";
|
|
4068
|
-
if (matches
|
|
4069
|
-
|
|
4070
|
-
|
|
4334
|
+
if (matches) {
|
|
4335
|
+
if ((_a = matches.groups) === null || _a === void 0 ? void 0 : _a.choice_target) {
|
|
4336
|
+
target = (_b = matches.groups) === null || _b === void 0 ? void 0 : _b.choice_target;
|
|
4337
|
+
request = "choice";
|
|
4338
|
+
}
|
|
4339
|
+
else if ((_c = matches.groups) === null || _c === void 0 ? void 0 : _c.jump_target) {
|
|
4340
|
+
target = (_d = matches.groups) === null || _d === void 0 ? void 0 : _d.jump_target;
|
|
4341
|
+
request = "jump";
|
|
4342
|
+
}
|
|
4071
4343
|
}
|
|
4072
4344
|
action = navActions[request];
|
|
4073
4345
|
if (action) {
|
|
@@ -4085,7 +4357,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4085
4357
|
};
|
|
4086
4358
|
Scorm2004Impl.prototype.lmsGetValue = function (CMIElement) {
|
|
4087
4359
|
var adlNavRequestRegex = "^adl\\.nav\\.request_valid\\.(choice|jump)\\.{target=\\S{0,}([a-zA-Z0-9-_]+)}$";
|
|
4088
|
-
if ((0,utilities
|
|
4360
|
+
if ((0,utilities.stringMatches)(CMIElement, adlNavRequestRegex)) {
|
|
4089
4361
|
var matches = CMIElement.match(adlNavRequestRegex);
|
|
4090
4362
|
var request = matches[1];
|
|
4091
4363
|
var target = matches[2].replace("{target=", "").replace("}", "");
|
|
@@ -4107,8 +4379,8 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4107
4379
|
this.scheduleCommit(500, "LMSCommit");
|
|
4108
4380
|
}
|
|
4109
4381
|
else {
|
|
4110
|
-
(function () { return (0,tslib_es6
|
|
4111
|
-
return (0,tslib_es6
|
|
4382
|
+
(function () { return (0,tslib_es6.__awaiter)(_this, void 0, void 0, function () {
|
|
4383
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
4112
4384
|
switch (_a.label) {
|
|
4113
4385
|
case 0: return [4, this.commit("LMSCommit", false)];
|
|
4114
4386
|
case 1:
|
|
@@ -4118,7 +4390,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4118
4390
|
});
|
|
4119
4391
|
}); })();
|
|
4120
4392
|
}
|
|
4121
|
-
return api_constants
|
|
4393
|
+
return api_constants.global_constants.SCORM_TRUE;
|
|
4122
4394
|
};
|
|
4123
4395
|
Scorm2004Impl.prototype.lmsGetLastError = function () {
|
|
4124
4396
|
return this.getLastError("GetLastError");
|
|
@@ -4130,29 +4402,58 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4130
4402
|
return this.getDiagnostic("GetDiagnostic", CMIErrorCode);
|
|
4131
4403
|
};
|
|
4132
4404
|
Scorm2004Impl.prototype.setCMIValue = function (CMIElement, value) {
|
|
4405
|
+
if ((0,utilities.stringMatches)(CMIElement, "cmi\\.objectives\\.\\d+")) {
|
|
4406
|
+
var parts = CMIElement.split(".");
|
|
4407
|
+
var index = Number(parts[2]);
|
|
4408
|
+
var element_base = "cmi.objectives.".concat(index);
|
|
4409
|
+
var objective_id_1;
|
|
4410
|
+
var setting_id = (0,utilities.stringMatches)(CMIElement, "cmi\\.objectives\\.\\d+\\.id");
|
|
4411
|
+
if (setting_id) {
|
|
4412
|
+
objective_id_1 = value;
|
|
4413
|
+
}
|
|
4414
|
+
else {
|
|
4415
|
+
var objective = this.cmi.objectives.findObjectiveByIndex(index);
|
|
4416
|
+
objective_id_1 = objective ? objective.id : undefined;
|
|
4417
|
+
}
|
|
4418
|
+
var is_global = objective_id_1 && this.settings.globalObjectiveIds.includes(objective_id_1);
|
|
4419
|
+
if (is_global) {
|
|
4420
|
+
var global_index = this._globalObjectives.findIndex(function (obj) { return obj.id === objective_id_1; });
|
|
4421
|
+
if (global_index === -1) {
|
|
4422
|
+
global_index = this._globalObjectives.length;
|
|
4423
|
+
var newGlobalObjective = new CMIObjectivesObject();
|
|
4424
|
+
newGlobalObjective.id = objective_id_1;
|
|
4425
|
+
this._globalObjectives.push(newGlobalObjective);
|
|
4426
|
+
}
|
|
4427
|
+
var global_element = CMIElement.replace(element_base, "_globalObjectives.".concat(global_index));
|
|
4428
|
+
this._commonSetCMIValue("SetGlobalObjectiveValue", true, global_element, value);
|
|
4429
|
+
}
|
|
4430
|
+
}
|
|
4133
4431
|
return this._commonSetCMIValue("SetValue", true, CMIElement, value);
|
|
4134
4432
|
};
|
|
4135
4433
|
Scorm2004Impl.prototype.getChildElement = function (CMIElement, value, foundFirstIndex) {
|
|
4136
|
-
if ((0,utilities
|
|
4434
|
+
if ((0,utilities.stringMatches)(CMIElement, "cmi\\.objectives\\.\\d+")) {
|
|
4137
4435
|
return new CMIObjectivesObject();
|
|
4138
4436
|
}
|
|
4139
4437
|
if (foundFirstIndex) {
|
|
4140
|
-
if ((0,utilities
|
|
4438
|
+
if ((0,utilities.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) {
|
|
4141
4439
|
return this.createCorrectResponsesObject(CMIElement, value);
|
|
4142
4440
|
}
|
|
4143
|
-
else if ((0,utilities
|
|
4441
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) {
|
|
4144
4442
|
return new CMIInteractionsObjectivesObject();
|
|
4145
4443
|
}
|
|
4146
4444
|
}
|
|
4147
|
-
else if ((0,utilities
|
|
4445
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+")) {
|
|
4148
4446
|
return new CMIInteractionsObject();
|
|
4149
4447
|
}
|
|
4150
|
-
if ((0,utilities
|
|
4448
|
+
if ((0,utilities.stringMatches)(CMIElement, "cmi\\.comments_from_learner\\.\\d+")) {
|
|
4151
4449
|
return new CMICommentsObject();
|
|
4152
4450
|
}
|
|
4153
|
-
else if ((0,utilities
|
|
4451
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.comments_from_lms\\.\\d+")) {
|
|
4154
4452
|
return new CMICommentsObject(true);
|
|
4155
4453
|
}
|
|
4454
|
+
if ((0,utilities.stringMatches)(CMIElement, "adl\\.data\\.\\d+")) {
|
|
4455
|
+
return new ADLDataObject();
|
|
4456
|
+
}
|
|
4156
4457
|
return null;
|
|
4157
4458
|
};
|
|
4158
4459
|
Scorm2004Impl.prototype.createCorrectResponsesObject = function (CMIElement, value) {
|
|
@@ -4161,7 +4462,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4161
4462
|
var interaction = this.cmi.interactions.childArray[index];
|
|
4162
4463
|
if (this.isInitialized()) {
|
|
4163
4464
|
if (!interaction.type) {
|
|
4164
|
-
this.throwSCORMError(error_codes
|
|
4465
|
+
this.throwSCORMError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
4165
4466
|
}
|
|
4166
4467
|
else {
|
|
4167
4468
|
this.checkDuplicateChoiceResponse(interaction, value);
|
|
@@ -4170,7 +4471,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4170
4471
|
this.checkValidResponseType(response_type, value, interaction.type);
|
|
4171
4472
|
}
|
|
4172
4473
|
else {
|
|
4173
|
-
this.throwSCORMError(error_codes
|
|
4474
|
+
this.throwSCORMError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE, "Incorrect Response Type: " + interaction.type);
|
|
4174
4475
|
}
|
|
4175
4476
|
}
|
|
4176
4477
|
}
|
|
@@ -4191,7 +4492,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4191
4492
|
this.checkCorrectResponseValue(interaction_type, nodes, value);
|
|
4192
4493
|
}
|
|
4193
4494
|
else if (nodes.length > response_type.max) {
|
|
4194
|
-
this.throwSCORMError(error_codes
|
|
4495
|
+
this.throwSCORMError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE, "Data Model Element Pattern Too Long");
|
|
4195
4496
|
}
|
|
4196
4497
|
};
|
|
4197
4498
|
Scorm2004Impl.prototype.checkDuplicateChoiceResponse = function (interaction, value) {
|
|
@@ -4200,7 +4501,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4200
4501
|
for (var i = 0; i < interaction_count && this.lastErrorCode === "0"; i++) {
|
|
4201
4502
|
var response = interaction.correct_responses.childArray[i];
|
|
4202
4503
|
if (response.pattern === value) {
|
|
4203
|
-
this.throwSCORMError(error_codes
|
|
4504
|
+
this.throwSCORMError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE);
|
|
4204
4505
|
}
|
|
4205
4506
|
}
|
|
4206
4507
|
}
|
|
@@ -4223,12 +4524,12 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4223
4524
|
}
|
|
4224
4525
|
else {
|
|
4225
4526
|
if (this.lastErrorCode === "0") {
|
|
4226
|
-
this.throwSCORMError(error_codes
|
|
4527
|
+
this.throwSCORMError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE, "Data Model Element Pattern Already Exists");
|
|
4227
4528
|
}
|
|
4228
4529
|
}
|
|
4229
4530
|
}
|
|
4230
4531
|
else {
|
|
4231
|
-
this.throwSCORMError(error_codes
|
|
4532
|
+
this.throwSCORMError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE, "Data Model Element Collection Limit Reached");
|
|
4232
4533
|
}
|
|
4233
4534
|
};
|
|
4234
4535
|
Scorm2004Impl.prototype.getCMIValue = function (CMIElement) {
|
|
@@ -4238,11 +4539,11 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4238
4539
|
var basicMessage = "";
|
|
4239
4540
|
var detailMessage = "";
|
|
4240
4541
|
errorNumber = String(errorNumber);
|
|
4241
|
-
if (api_constants
|
|
4542
|
+
if (api_constants.scorm2004_constants.error_descriptions[errorNumber]) {
|
|
4242
4543
|
basicMessage =
|
|
4243
|
-
api_constants
|
|
4544
|
+
api_constants.scorm2004_constants.error_descriptions[errorNumber].basicMessage;
|
|
4244
4545
|
detailMessage =
|
|
4245
|
-
api_constants
|
|
4546
|
+
api_constants.scorm2004_constants.error_descriptions[errorNumber].detailMessage;
|
|
4246
4547
|
}
|
|
4247
4548
|
return detail ? detailMessage : basicMessage;
|
|
4248
4549
|
};
|
|
@@ -4268,36 +4569,36 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4268
4569
|
if (values.length === 2) {
|
|
4269
4570
|
var matches = values[0].match(formatRegex);
|
|
4270
4571
|
if (!matches) {
|
|
4271
|
-
this.throwSCORMError(error_codes
|
|
4572
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4272
4573
|
}
|
|
4273
4574
|
else {
|
|
4274
4575
|
if (!response.format2 ||
|
|
4275
4576
|
!values[1].match(new RegExp(response.format2))) {
|
|
4276
|
-
this.throwSCORMError(error_codes
|
|
4577
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4277
4578
|
}
|
|
4278
4579
|
}
|
|
4279
4580
|
}
|
|
4280
4581
|
else {
|
|
4281
|
-
this.throwSCORMError(error_codes
|
|
4582
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4282
4583
|
}
|
|
4283
4584
|
}
|
|
4284
4585
|
else {
|
|
4285
4586
|
var matches = nodes[i].match(formatRegex);
|
|
4286
4587
|
if ((!matches && value !== "") ||
|
|
4287
4588
|
(!matches && interaction_type === "true-false")) {
|
|
4288
|
-
this.throwSCORMError(error_codes
|
|
4589
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4289
4590
|
}
|
|
4290
4591
|
else {
|
|
4291
4592
|
if (interaction_type === "numeric" && nodes.length > 1) {
|
|
4292
4593
|
if (Number(nodes[0]) > Number(nodes[1])) {
|
|
4293
|
-
this.throwSCORMError(error_codes
|
|
4594
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4294
4595
|
}
|
|
4295
4596
|
}
|
|
4296
4597
|
else {
|
|
4297
4598
|
if (nodes[i] !== "" && response.unique) {
|
|
4298
4599
|
for (var j = 0; j < i && this.lastErrorCode === "0"; j++) {
|
|
4299
4600
|
if (nodes[i] === nodes[j]) {
|
|
4300
|
-
this.throwSCORMError(error_codes
|
|
4601
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4301
4602
|
}
|
|
4302
4603
|
}
|
|
4303
4604
|
}
|
|
@@ -4316,12 +4617,12 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4316
4617
|
while (matches) {
|
|
4317
4618
|
switch (matches[2]) {
|
|
4318
4619
|
case "lang":
|
|
4319
|
-
langMatches = node.match(regex
|
|
4620
|
+
langMatches = node.match(regex.scorm2004_regex.CMILangcr);
|
|
4320
4621
|
if (langMatches) {
|
|
4321
4622
|
var lang = langMatches[3];
|
|
4322
4623
|
if (lang !== undefined && lang.length > 0) {
|
|
4323
4624
|
if (!language_constants.includes(lang.toLowerCase())) {
|
|
4324
|
-
this.throwSCORMError(error_codes
|
|
4625
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4325
4626
|
}
|
|
4326
4627
|
}
|
|
4327
4628
|
}
|
|
@@ -4330,7 +4631,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4330
4631
|
case "case_matters":
|
|
4331
4632
|
if (!seenLang && !seenOrder && !seenCase) {
|
|
4332
4633
|
if (matches[3] !== "true" && matches[3] !== "false") {
|
|
4333
|
-
this.throwSCORMError(error_codes
|
|
4634
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4334
4635
|
}
|
|
4335
4636
|
}
|
|
4336
4637
|
seenCase = true;
|
|
@@ -4338,7 +4639,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4338
4639
|
case "order_matters":
|
|
4339
4640
|
if (!seenCase && !seenLang && !seenOrder) {
|
|
4340
4641
|
if (matches[3] !== "true" && matches[3] !== "false") {
|
|
4341
|
-
this.throwSCORMError(error_codes
|
|
4642
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4342
4643
|
}
|
|
4343
4644
|
}
|
|
4344
4645
|
seenOrder = true;
|
|
@@ -4359,10 +4660,10 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4359
4660
|
cmiExport.cmi.total_time = this.cmi.getCurrentTotalTime();
|
|
4360
4661
|
}
|
|
4361
4662
|
var result = [];
|
|
4362
|
-
var flattened = utilities
|
|
4663
|
+
var flattened = utilities.flatten(cmiExport);
|
|
4363
4664
|
switch (this.settings.dataCommitFormat) {
|
|
4364
4665
|
case "flattened":
|
|
4365
|
-
return utilities
|
|
4666
|
+
return utilities.flatten(cmiExport);
|
|
4366
4667
|
case "params":
|
|
4367
4668
|
for (var item in flattened) {
|
|
4368
4669
|
if ({}.hasOwnProperty.call(flattened, item)) {
|
|
@@ -4378,23 +4679,23 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4378
4679
|
Scorm2004Impl.prototype.renderCommitObject = function (terminateCommit) {
|
|
4379
4680
|
var cmiExport = this.renderCommitCMI(terminateCommit);
|
|
4380
4681
|
var totalTimeDuration = this.cmi.getCurrentTotalTime();
|
|
4381
|
-
var totalTimeSeconds = utilities
|
|
4382
|
-
var completionStatus = enums
|
|
4383
|
-
var successStatus = enums
|
|
4682
|
+
var totalTimeSeconds = utilities.getDurationAsSeconds(totalTimeDuration, regex.scorm2004_regex.CMITimespan);
|
|
4683
|
+
var completionStatus = enums.CompletionStatus.unknown;
|
|
4684
|
+
var successStatus = enums.SuccessStatus.unknown;
|
|
4384
4685
|
if (this.cmi.completion_status) {
|
|
4385
4686
|
if (this.cmi.completion_status === "completed") {
|
|
4386
|
-
completionStatus = enums
|
|
4687
|
+
completionStatus = enums.CompletionStatus.completed;
|
|
4387
4688
|
}
|
|
4388
4689
|
else if (this.cmi.completion_status === "incomplete") {
|
|
4389
|
-
completionStatus = enums
|
|
4690
|
+
completionStatus = enums.CompletionStatus.incomplete;
|
|
4390
4691
|
}
|
|
4391
4692
|
}
|
|
4392
4693
|
if (this.cmi.success_status) {
|
|
4393
4694
|
if (this.cmi.success_status === "passed") {
|
|
4394
|
-
successStatus = enums
|
|
4695
|
+
successStatus = enums.SuccessStatus.passed;
|
|
4395
4696
|
}
|
|
4396
4697
|
else if (this.cmi.success_status === "failed") {
|
|
4397
|
-
successStatus = enums
|
|
4698
|
+
successStatus = enums.SuccessStatus.failed;
|
|
4398
4699
|
}
|
|
4399
4700
|
}
|
|
4400
4701
|
var score = this.cmi.score;
|
|
@@ -4426,10 +4727,10 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4426
4727
|
return commitObject;
|
|
4427
4728
|
};
|
|
4428
4729
|
Scorm2004Impl.prototype.storeData = function (terminateCommit) {
|
|
4429
|
-
return (0,tslib_es6
|
|
4730
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
4430
4731
|
var navRequest, commitObject, result;
|
|
4431
4732
|
var _a, _b, _c;
|
|
4432
|
-
return (0,tslib_es6
|
|
4733
|
+
return (0,tslib_es6.__generator)(this, function (_d) {
|
|
4433
4734
|
switch (_d.label) {
|
|
4434
4735
|
case 0:
|
|
4435
4736
|
if (terminateCommit) {
|
|
@@ -4457,7 +4758,6 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4457
4758
|
navRequest = false;
|
|
4458
4759
|
if (this.adl.nav.request !== ((_c = (_b = (_a = this.startingData) === null || _a === void 0 ? void 0 : _a.adl) === null || _b === void 0 ? void 0 : _b.nav) === null || _c === void 0 ? void 0 : _c.request) &&
|
|
4459
4760
|
this.adl.nav.request !== "_none_") {
|
|
4460
|
-
this.adl.nav.request = encodeURIComponent(this.adl.nav.request);
|
|
4461
4761
|
navRequest = true;
|
|
4462
4762
|
}
|
|
4463
4763
|
commitObject = this.getCommitObject(terminateCommit);
|
|
@@ -4474,7 +4774,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4474
4774
|
}
|
|
4475
4775
|
return [2, result];
|
|
4476
4776
|
case 2: return [2, {
|
|
4477
|
-
result: api_constants
|
|
4777
|
+
result: api_constants.global_constants.SCORM_TRUE,
|
|
4478
4778
|
errorCode: 0,
|
|
4479
4779
|
}];
|
|
4480
4780
|
}
|
|
@@ -4482,7 +4782,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4482
4782
|
});
|
|
4483
4783
|
};
|
|
4484
4784
|
return Scorm2004Impl;
|
|
4485
|
-
}(BaseAPI
|
|
4785
|
+
}(BaseAPI["default"]));
|
|
4486
4786
|
|
|
4487
4787
|
|
|
4488
4788
|
|
|
@@ -4491,29 +4791,40 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4491
4791
|
/***/ 589:
|
|
4492
4792
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
4493
4793
|
|
|
4794
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4494
4795
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4495
|
-
/* harmony export */
|
|
4796
|
+
/* harmony export */ CMIArray: function() { return /* binding */ CMIArray; }
|
|
4496
4797
|
/* harmony export */ });
|
|
4497
|
-
/* unused harmony export scorm12_error_codes */
|
|
4498
4798
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635);
|
|
4499
4799
|
/* harmony import */ var _base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
4500
|
-
/* harmony import */ var
|
|
4501
|
-
/* harmony import */ var
|
|
4800
|
+
/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(784);
|
|
4801
|
+
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(797);
|
|
4502
4802
|
|
|
4503
4803
|
|
|
4504
4804
|
|
|
4505
4805
|
|
|
4506
|
-
var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12;
|
|
4507
4806
|
var CMIArray = (function (_super) {
|
|
4508
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_3__
|
|
4807
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_3__.__extends)(CMIArray, _super);
|
|
4509
4808
|
function CMIArray(params) {
|
|
4510
4809
|
var _this = _super.call(this) || this;
|
|
4511
4810
|
_this.__children = params.children;
|
|
4512
|
-
_this._errorCode = params.errorCode ||
|
|
4513
|
-
_this._errorClass = params.errorClass ||
|
|
4811
|
+
_this._errorCode = params.errorCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.GENERAL;
|
|
4812
|
+
_this._errorClass = params.errorClass || _exceptions__WEBPACK_IMPORTED_MODULE_1__.BaseScormValidationError;
|
|
4514
4813
|
_this.childArray = [];
|
|
4515
4814
|
return _this;
|
|
4516
4815
|
}
|
|
4816
|
+
CMIArray.prototype.reset = function (wipe) {
|
|
4817
|
+
if (wipe === void 0) { wipe = false; }
|
|
4818
|
+
this._initialized = false;
|
|
4819
|
+
if (wipe) {
|
|
4820
|
+
this.childArray = [];
|
|
4821
|
+
}
|
|
4822
|
+
else {
|
|
4823
|
+
for (var i = 0; i < this.childArray.length; i++) {
|
|
4824
|
+
this.childArray[i].reset();
|
|
4825
|
+
}
|
|
4826
|
+
}
|
|
4827
|
+
};
|
|
4517
4828
|
Object.defineProperty(CMIArray.prototype, "_children", {
|
|
4518
4829
|
get: function () {
|
|
4519
4830
|
return this.__children;
|
|
@@ -4544,7 +4855,7 @@ var CMIArray = (function (_super) {
|
|
|
4544
4855
|
return result;
|
|
4545
4856
|
};
|
|
4546
4857
|
return CMIArray;
|
|
4547
|
-
}(_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
4858
|
+
}(_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
4548
4859
|
|
|
4549
4860
|
|
|
4550
4861
|
|
|
@@ -4553,9 +4864,10 @@ var CMIArray = (function (_super) {
|
|
|
4553
4864
|
/***/ 319:
|
|
4554
4865
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
4555
4866
|
|
|
4867
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4556
4868
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4557
|
-
/* harmony export */
|
|
4558
|
-
/* harmony export */
|
|
4869
|
+
/* harmony export */ BaseCMI: function() { return /* binding */ BaseCMI; },
|
|
4870
|
+
/* harmony export */ BaseRootCMI: function() { return /* binding */ BaseRootCMI; }
|
|
4559
4871
|
/* harmony export */ });
|
|
4560
4872
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
4561
4873
|
|
|
@@ -4588,7 +4900,7 @@ var BaseCMI = (function () {
|
|
|
4588
4900
|
}());
|
|
4589
4901
|
|
|
4590
4902
|
var BaseRootCMI = (function (_super) {
|
|
4591
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_0__
|
|
4903
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(BaseRootCMI, _super);
|
|
4592
4904
|
function BaseRootCMI() {
|
|
4593
4905
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
4594
4906
|
}
|
|
@@ -4602,10 +4914,10 @@ var BaseRootCMI = (function (_super) {
|
|
|
4602
4914
|
/***/ 434:
|
|
4603
4915
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
4604
4916
|
|
|
4917
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4605
4918
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4606
|
-
/* harmony export */
|
|
4919
|
+
/* harmony export */ CMIScore: function() { return /* binding */ CMIScore; }
|
|
4607
4920
|
/* harmony export */ });
|
|
4608
|
-
/* unused harmony export scorm12_error_codes */
|
|
4609
4921
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635);
|
|
4610
4922
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340);
|
|
4611
4923
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(417);
|
|
@@ -4618,30 +4930,30 @@ var BaseRootCMI = (function (_super) {
|
|
|
4618
4930
|
|
|
4619
4931
|
|
|
4620
4932
|
|
|
4621
|
-
var scorm12_constants = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12;
|
|
4622
|
-
var scorm12_regex = _constants_regex__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12;
|
|
4623
|
-
var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12;
|
|
4624
4933
|
var CMIScore = (function (_super) {
|
|
4625
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_4__
|
|
4934
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_4__.__extends)(CMIScore, _super);
|
|
4626
4935
|
function CMIScore(params) {
|
|
4627
4936
|
var _this = _super.call(this) || this;
|
|
4628
4937
|
_this._raw = "";
|
|
4629
4938
|
_this._min = "";
|
|
4630
|
-
_this.__children = params.score_children || scorm12_constants.score_children;
|
|
4939
|
+
_this.__children = params.score_children || _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__.scorm12_constants.score_children;
|
|
4631
4940
|
_this.__score_range = !params.score_range
|
|
4632
4941
|
? false
|
|
4633
|
-
: scorm12_regex.score_range;
|
|
4942
|
+
: _constants_regex__WEBPACK_IMPORTED_MODULE_1__.scorm12_regex.score_range;
|
|
4634
4943
|
_this._max = params.max || params.max === "" ? params.max : "100";
|
|
4635
4944
|
_this.__invalid_error_code =
|
|
4636
|
-
params.invalidErrorCode ||
|
|
4945
|
+
params.invalidErrorCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.INVALID_SET_VALUE;
|
|
4637
4946
|
_this.__invalid_type_code =
|
|
4638
|
-
params.invalidTypeCode ||
|
|
4947
|
+
params.invalidTypeCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.TYPE_MISMATCH;
|
|
4639
4948
|
_this.__invalid_range_code =
|
|
4640
|
-
params.invalidRangeCode ||
|
|
4641
|
-
_this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;
|
|
4949
|
+
params.invalidRangeCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.VALUE_OUT_OF_RANGE;
|
|
4950
|
+
_this.__decimal_regex = params.decimalRegex || _constants_regex__WEBPACK_IMPORTED_MODULE_1__.scorm12_regex.CMIDecimal;
|
|
4642
4951
|
_this.__error_class = params.errorClass;
|
|
4643
4952
|
return _this;
|
|
4644
4953
|
}
|
|
4954
|
+
CMIScore.prototype.reset = function () {
|
|
4955
|
+
this._initialized = false;
|
|
4956
|
+
};
|
|
4645
4957
|
Object.defineProperty(CMIScore.prototype, "_children", {
|
|
4646
4958
|
get: function () {
|
|
4647
4959
|
return this.__children;
|
|
@@ -4657,9 +4969,9 @@ var CMIScore = (function (_super) {
|
|
|
4657
4969
|
return this._raw;
|
|
4658
4970
|
},
|
|
4659
4971
|
set: function (raw) {
|
|
4660
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
4972
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidFormat)(raw, this.__decimal_regex, this.__invalid_type_code, this.__error_class) &&
|
|
4661
4973
|
(!this.__score_range ||
|
|
4662
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
4974
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidRange)(raw, this.__score_range, this.__invalid_range_code, this.__error_class))) {
|
|
4663
4975
|
this._raw = raw;
|
|
4664
4976
|
}
|
|
4665
4977
|
},
|
|
@@ -4671,9 +4983,9 @@ var CMIScore = (function (_super) {
|
|
|
4671
4983
|
return this._min;
|
|
4672
4984
|
},
|
|
4673
4985
|
set: function (min) {
|
|
4674
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
4986
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidFormat)(min, this.__decimal_regex, this.__invalid_type_code, this.__error_class) &&
|
|
4675
4987
|
(!this.__score_range ||
|
|
4676
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
4988
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidRange)(min, this.__score_range, this.__invalid_range_code, this.__error_class))) {
|
|
4677
4989
|
this._min = min;
|
|
4678
4990
|
}
|
|
4679
4991
|
},
|
|
@@ -4685,9 +4997,9 @@ var CMIScore = (function (_super) {
|
|
|
4685
4997
|
return this._max;
|
|
4686
4998
|
},
|
|
4687
4999
|
set: function (max) {
|
|
4688
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5000
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidFormat)(max, this.__decimal_regex, this.__invalid_type_code, this.__error_class) &&
|
|
4689
5001
|
(!this.__score_range ||
|
|
4690
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5002
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidRange)(max, this.__score_range, this.__invalid_range_code, this.__error_class))) {
|
|
4691
5003
|
this._max = max;
|
|
4692
5004
|
}
|
|
4693
5005
|
},
|
|
@@ -4705,7 +5017,7 @@ var CMIScore = (function (_super) {
|
|
|
4705
5017
|
return result;
|
|
4706
5018
|
};
|
|
4707
5019
|
return CMIScore;
|
|
4708
|
-
}(_base_cmi__WEBPACK_IMPORTED_MODULE_2__
|
|
5020
|
+
}(_base_cmi__WEBPACK_IMPORTED_MODULE_2__.BaseCMI));
|
|
4709
5021
|
|
|
4710
5022
|
|
|
4711
5023
|
|
|
@@ -4714,9 +5026,10 @@ var CMIScore = (function (_super) {
|
|
|
4714
5026
|
/***/ 449:
|
|
4715
5027
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
4716
5028
|
|
|
5029
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4717
5030
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4718
|
-
/* harmony export */
|
|
4719
|
-
/* harmony export */
|
|
5031
|
+
/* harmony export */ checkValidFormat: function() { return /* binding */ checkValidFormat; },
|
|
5032
|
+
/* harmony export */ checkValidRange: function() { return /* binding */ checkValidRange; }
|
|
4720
5033
|
/* harmony export */ });
|
|
4721
5034
|
function checkValidFormat(value, regexPattern, errorCode, errorClass, allowEmptyString) {
|
|
4722
5035
|
if (typeof value !== "string") {
|
|
@@ -4754,10 +5067,12 @@ function checkValidRange(value, rangePattern, errorCode, errorClass) {
|
|
|
4754
5067
|
/***/ 989:
|
|
4755
5068
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
4756
5069
|
|
|
5070
|
+
// ESM COMPAT FLAG
|
|
5071
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4757
5072
|
|
|
4758
5073
|
// EXPORTS
|
|
4759
5074
|
__webpack_require__.d(__webpack_exports__, {
|
|
4760
|
-
|
|
5075
|
+
CMI: function() { return /* binding */ CMI; }
|
|
4761
5076
|
});
|
|
4762
5077
|
|
|
4763
5078
|
// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs
|
|
@@ -4768,8 +5083,8 @@ var api_constants = __webpack_require__(340);
|
|
|
4768
5083
|
var error_codes = __webpack_require__(797);
|
|
4769
5084
|
// EXTERNAL MODULE: ./src/constants/regex.ts
|
|
4770
5085
|
var regex = __webpack_require__(417);
|
|
4771
|
-
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
4772
|
-
var
|
|
5086
|
+
// EXTERNAL MODULE: ./src/exceptions/scorm12_exceptions.ts
|
|
5087
|
+
var scorm12_exceptions = __webpack_require__(179);
|
|
4773
5088
|
// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts
|
|
4774
5089
|
var base_cmi = __webpack_require__(319);
|
|
4775
5090
|
// EXTERNAL MODULE: ./src/cmi/scorm12/validation.ts
|
|
@@ -4789,10 +5104,10 @@ var utilities = __webpack_require__(864);
|
|
|
4789
5104
|
|
|
4790
5105
|
|
|
4791
5106
|
var CMICore = (function (_super) {
|
|
4792
|
-
(0,tslib_es6
|
|
5107
|
+
(0,tslib_es6.__extends)(CMICore, _super);
|
|
4793
5108
|
function CMICore() {
|
|
4794
5109
|
var _this = _super.call(this) || this;
|
|
4795
|
-
_this.__children = api_constants
|
|
5110
|
+
_this.__children = api_constants.scorm12_constants.core_children;
|
|
4796
5111
|
_this._student_id = "";
|
|
4797
5112
|
_this._student_name = "";
|
|
4798
5113
|
_this._lesson_location = "";
|
|
@@ -4804,13 +5119,13 @@ var CMICore = (function (_super) {
|
|
|
4804
5119
|
_this._exit = "";
|
|
4805
5120
|
_this._session_time = "00:00:00";
|
|
4806
5121
|
_this._suspend_data = "";
|
|
4807
|
-
_this.score = new score
|
|
4808
|
-
score_children: api_constants
|
|
4809
|
-
score_range: regex
|
|
4810
|
-
invalidErrorCode: error_codes
|
|
4811
|
-
invalidTypeCode: error_codes
|
|
4812
|
-
invalidRangeCode: error_codes
|
|
4813
|
-
errorClass:
|
|
5122
|
+
_this.score = new score.CMIScore({
|
|
5123
|
+
score_children: api_constants.scorm12_constants.score_children,
|
|
5124
|
+
score_range: regex.scorm12_regex.score_range,
|
|
5125
|
+
invalidErrorCode: error_codes.scorm12_errors.INVALID_SET_VALUE,
|
|
5126
|
+
invalidTypeCode: error_codes.scorm12_errors.TYPE_MISMATCH,
|
|
5127
|
+
invalidRangeCode: error_codes.scorm12_errors.VALUE_OUT_OF_RANGE,
|
|
5128
|
+
errorClass: scorm12_exceptions.Scorm12ValidationError,
|
|
4814
5129
|
});
|
|
4815
5130
|
return _this;
|
|
4816
5131
|
}
|
|
@@ -4819,12 +5134,20 @@ var CMICore = (function (_super) {
|
|
|
4819
5134
|
_super.prototype.initialize.call(this);
|
|
4820
5135
|
(_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
4821
5136
|
};
|
|
5137
|
+
CMICore.prototype.reset = function () {
|
|
5138
|
+
var _a;
|
|
5139
|
+
this._initialized = false;
|
|
5140
|
+
this._exit = "";
|
|
5141
|
+
this._entry = "";
|
|
5142
|
+
this._session_time = "00:00:00";
|
|
5143
|
+
(_a = this.score) === null || _a === void 0 ? void 0 : _a.reset();
|
|
5144
|
+
};
|
|
4822
5145
|
Object.defineProperty(CMICore.prototype, "_children", {
|
|
4823
5146
|
get: function () {
|
|
4824
5147
|
return this.__children;
|
|
4825
5148
|
},
|
|
4826
5149
|
set: function (_children) {
|
|
4827
|
-
throw new
|
|
5150
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
4828
5151
|
},
|
|
4829
5152
|
enumerable: false,
|
|
4830
5153
|
configurable: true
|
|
@@ -4835,7 +5158,7 @@ var CMICore = (function (_super) {
|
|
|
4835
5158
|
},
|
|
4836
5159
|
set: function (student_id) {
|
|
4837
5160
|
if (this.initialized) {
|
|
4838
|
-
throw new
|
|
5161
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4839
5162
|
}
|
|
4840
5163
|
else {
|
|
4841
5164
|
this._student_id = student_id;
|
|
@@ -4850,7 +5173,7 @@ var CMICore = (function (_super) {
|
|
|
4850
5173
|
},
|
|
4851
5174
|
set: function (student_name) {
|
|
4852
5175
|
if (this.initialized) {
|
|
4853
|
-
throw new
|
|
5176
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4854
5177
|
}
|
|
4855
5178
|
else {
|
|
4856
5179
|
this._student_name = student_name;
|
|
@@ -4864,7 +5187,7 @@ var CMICore = (function (_super) {
|
|
|
4864
5187
|
return this._lesson_location;
|
|
4865
5188
|
},
|
|
4866
5189
|
set: function (lesson_location) {
|
|
4867
|
-
if ((0,validation
|
|
5190
|
+
if ((0,validation.check12ValidFormat)(lesson_location, regex.scorm12_regex.CMIString256, true)) {
|
|
4868
5191
|
this._lesson_location = lesson_location;
|
|
4869
5192
|
}
|
|
4870
5193
|
},
|
|
@@ -4877,7 +5200,7 @@ var CMICore = (function (_super) {
|
|
|
4877
5200
|
},
|
|
4878
5201
|
set: function (credit) {
|
|
4879
5202
|
if (this.initialized) {
|
|
4880
|
-
throw new
|
|
5203
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4881
5204
|
}
|
|
4882
5205
|
else {
|
|
4883
5206
|
this._credit = credit;
|
|
@@ -4892,12 +5215,12 @@ var CMICore = (function (_super) {
|
|
|
4892
5215
|
},
|
|
4893
5216
|
set: function (lesson_status) {
|
|
4894
5217
|
if (this.initialized) {
|
|
4895
|
-
if ((0,validation
|
|
5218
|
+
if ((0,validation.check12ValidFormat)(lesson_status, regex.scorm12_regex.CMIStatus)) {
|
|
4896
5219
|
this._lesson_status = lesson_status;
|
|
4897
5220
|
}
|
|
4898
5221
|
}
|
|
4899
5222
|
else {
|
|
4900
|
-
if ((0,validation
|
|
5223
|
+
if ((0,validation.check12ValidFormat)(lesson_status, regex.scorm12_regex.CMIStatus2)) {
|
|
4901
5224
|
this._lesson_status = lesson_status;
|
|
4902
5225
|
}
|
|
4903
5226
|
}
|
|
@@ -4911,7 +5234,7 @@ var CMICore = (function (_super) {
|
|
|
4911
5234
|
},
|
|
4912
5235
|
set: function (entry) {
|
|
4913
5236
|
if (this.initialized) {
|
|
4914
|
-
throw new
|
|
5237
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4915
5238
|
}
|
|
4916
5239
|
else {
|
|
4917
5240
|
this._entry = entry;
|
|
@@ -4926,7 +5249,7 @@ var CMICore = (function (_super) {
|
|
|
4926
5249
|
},
|
|
4927
5250
|
set: function (total_time) {
|
|
4928
5251
|
if (this.initialized) {
|
|
4929
|
-
throw new
|
|
5252
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4930
5253
|
}
|
|
4931
5254
|
else {
|
|
4932
5255
|
this._total_time = total_time;
|
|
@@ -4941,7 +5264,7 @@ var CMICore = (function (_super) {
|
|
|
4941
5264
|
},
|
|
4942
5265
|
set: function (lesson_mode) {
|
|
4943
5266
|
if (this.initialized) {
|
|
4944
|
-
throw new
|
|
5267
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4945
5268
|
}
|
|
4946
5269
|
else {
|
|
4947
5270
|
this._lesson_mode = lesson_mode;
|
|
@@ -4953,12 +5276,12 @@ var CMICore = (function (_super) {
|
|
|
4953
5276
|
Object.defineProperty(CMICore.prototype, "exit", {
|
|
4954
5277
|
get: function () {
|
|
4955
5278
|
if (!this.jsonString) {
|
|
4956
|
-
throw new
|
|
5279
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
4957
5280
|
}
|
|
4958
5281
|
return this._exit;
|
|
4959
5282
|
},
|
|
4960
5283
|
set: function (exit) {
|
|
4961
|
-
if ((0,validation
|
|
5284
|
+
if ((0,validation.check12ValidFormat)(exit, regex.scorm12_regex.CMIExit, true)) {
|
|
4962
5285
|
this._exit = exit;
|
|
4963
5286
|
}
|
|
4964
5287
|
},
|
|
@@ -4968,12 +5291,12 @@ var CMICore = (function (_super) {
|
|
|
4968
5291
|
Object.defineProperty(CMICore.prototype, "session_time", {
|
|
4969
5292
|
get: function () {
|
|
4970
5293
|
if (!this.jsonString) {
|
|
4971
|
-
throw new
|
|
5294
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
4972
5295
|
}
|
|
4973
5296
|
return this._session_time;
|
|
4974
5297
|
},
|
|
4975
5298
|
set: function (session_time) {
|
|
4976
|
-
if ((0,validation
|
|
5299
|
+
if ((0,validation.check12ValidFormat)(session_time, regex.scorm12_regex.CMITimespan)) {
|
|
4977
5300
|
this._session_time = session_time;
|
|
4978
5301
|
}
|
|
4979
5302
|
},
|
|
@@ -4985,7 +5308,7 @@ var CMICore = (function (_super) {
|
|
|
4985
5308
|
return this._suspend_data;
|
|
4986
5309
|
},
|
|
4987
5310
|
set: function (suspend_data) {
|
|
4988
|
-
if ((0,validation
|
|
5311
|
+
if ((0,validation.check12ValidFormat)(suspend_data, regex.scorm12_regex.CMIString4096, true)) {
|
|
4989
5312
|
this._suspend_data = suspend_data;
|
|
4990
5313
|
}
|
|
4991
5314
|
},
|
|
@@ -4997,9 +5320,9 @@ var CMICore = (function (_super) {
|
|
|
4997
5320
|
var startTime = start_time;
|
|
4998
5321
|
if (typeof startTime !== "undefined" && startTime !== null) {
|
|
4999
5322
|
var seconds = new Date().getTime() - startTime;
|
|
5000
|
-
sessionTime = utilities
|
|
5323
|
+
sessionTime = utilities.getSecondsAsHHMMSS(seconds / 1000);
|
|
5001
5324
|
}
|
|
5002
|
-
return utilities
|
|
5325
|
+
return utilities.addHHMMSSTimeStrings(this._total_time, sessionTime, new RegExp(regex.scorm12_regex.CMITimespan));
|
|
5003
5326
|
};
|
|
5004
5327
|
CMICore.prototype.toJSON = function () {
|
|
5005
5328
|
this.jsonString = true;
|
|
@@ -5019,7 +5342,7 @@ var CMICore = (function (_super) {
|
|
|
5019
5342
|
return result;
|
|
5020
5343
|
};
|
|
5021
5344
|
return CMICore;
|
|
5022
|
-
}(base_cmi
|
|
5345
|
+
}(base_cmi.BaseCMI));
|
|
5023
5346
|
|
|
5024
5347
|
|
|
5025
5348
|
// EXTERNAL MODULE: ./src/cmi/scorm12/objectives.ts
|
|
@@ -5044,7 +5367,7 @@ var interactions = __webpack_require__(833);
|
|
|
5044
5367
|
|
|
5045
5368
|
|
|
5046
5369
|
var CMI = (function (_super) {
|
|
5047
|
-
(0,tslib_es6
|
|
5370
|
+
(0,tslib_es6.__extends)(CMI, _super);
|
|
5048
5371
|
function CMI(cmi_children, student_data, initialized) {
|
|
5049
5372
|
var _this = _super.call(this) || this;
|
|
5050
5373
|
_this.__children = "";
|
|
@@ -5056,14 +5379,25 @@ var CMI = (function (_super) {
|
|
|
5056
5379
|
_this.initialize();
|
|
5057
5380
|
_this.__children = cmi_children
|
|
5058
5381
|
? cmi_children
|
|
5059
|
-
: api_constants
|
|
5382
|
+
: api_constants.scorm12_constants.cmi_children;
|
|
5060
5383
|
_this.core = new CMICore();
|
|
5061
|
-
_this.objectives = new objectives
|
|
5062
|
-
_this.student_data = student_data ? student_data : new scorm12_student_data
|
|
5063
|
-
_this.student_preference = new student_preference
|
|
5064
|
-
_this.interactions = new interactions
|
|
5384
|
+
_this.objectives = new objectives.CMIObjectives();
|
|
5385
|
+
_this.student_data = student_data ? student_data : new scorm12_student_data.CMIStudentData();
|
|
5386
|
+
_this.student_preference = new student_preference.CMIStudentPreference();
|
|
5387
|
+
_this.interactions = new interactions.CMIInteractions();
|
|
5065
5388
|
return _this;
|
|
5066
5389
|
}
|
|
5390
|
+
CMI.prototype.reset = function () {
|
|
5391
|
+
var _a, _b, _c;
|
|
5392
|
+
this._initialized = false;
|
|
5393
|
+
this._launch_data = "";
|
|
5394
|
+
this._comments = "";
|
|
5395
|
+
(_a = this.core) === null || _a === void 0 ? void 0 : _a.reset();
|
|
5396
|
+
this.objectives = new objectives.CMIObjectives();
|
|
5397
|
+
this.interactions = new interactions.CMIInteractions();
|
|
5398
|
+
(_b = this.student_data) === null || _b === void 0 ? void 0 : _b.reset();
|
|
5399
|
+
(_c = this.student_preference) === null || _c === void 0 ? void 0 : _c.reset();
|
|
5400
|
+
};
|
|
5067
5401
|
CMI.prototype.initialize = function () {
|
|
5068
5402
|
var _a, _b, _c, _d, _e;
|
|
5069
5403
|
_super.prototype.initialize.call(this);
|
|
@@ -5094,7 +5428,7 @@ var CMI = (function (_super) {
|
|
|
5094
5428
|
return this.__version;
|
|
5095
5429
|
},
|
|
5096
5430
|
set: function (_version) {
|
|
5097
|
-
throw new
|
|
5431
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
5098
5432
|
},
|
|
5099
5433
|
enumerable: false,
|
|
5100
5434
|
configurable: true
|
|
@@ -5104,7 +5438,7 @@ var CMI = (function (_super) {
|
|
|
5104
5438
|
return this.__children;
|
|
5105
5439
|
},
|
|
5106
5440
|
set: function (_children) {
|
|
5107
|
-
throw new
|
|
5441
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
5108
5442
|
},
|
|
5109
5443
|
enumerable: false,
|
|
5110
5444
|
configurable: true
|
|
@@ -5128,7 +5462,7 @@ var CMI = (function (_super) {
|
|
|
5128
5462
|
},
|
|
5129
5463
|
set: function (launch_data) {
|
|
5130
5464
|
if (this.initialized) {
|
|
5131
|
-
throw new
|
|
5465
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
5132
5466
|
}
|
|
5133
5467
|
else {
|
|
5134
5468
|
this._launch_data = launch_data;
|
|
@@ -5142,7 +5476,7 @@ var CMI = (function (_super) {
|
|
|
5142
5476
|
return this._comments;
|
|
5143
5477
|
},
|
|
5144
5478
|
set: function (comments) {
|
|
5145
|
-
if ((0,validation
|
|
5479
|
+
if ((0,validation.check12ValidFormat)(comments, regex.scorm12_regex.CMIString4096, true)) {
|
|
5146
5480
|
this._comments = comments;
|
|
5147
5481
|
}
|
|
5148
5482
|
},
|
|
@@ -5155,7 +5489,7 @@ var CMI = (function (_super) {
|
|
|
5155
5489
|
},
|
|
5156
5490
|
set: function (comments_from_lms) {
|
|
5157
5491
|
if (this.initialized) {
|
|
5158
|
-
throw new
|
|
5492
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
5159
5493
|
}
|
|
5160
5494
|
else {
|
|
5161
5495
|
this._comments_from_lms = comments_from_lms;
|
|
@@ -5168,7 +5502,7 @@ var CMI = (function (_super) {
|
|
|
5168
5502
|
return this.core.getCurrentTotalTime(this.start_time);
|
|
5169
5503
|
};
|
|
5170
5504
|
return CMI;
|
|
5171
|
-
}(base_cmi
|
|
5505
|
+
}(base_cmi.BaseRootCMI));
|
|
5172
5506
|
|
|
5173
5507
|
|
|
5174
5508
|
|
|
@@ -5177,17 +5511,18 @@ var CMI = (function (_super) {
|
|
|
5177
5511
|
/***/ 833:
|
|
5178
5512
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5179
5513
|
|
|
5514
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5180
5515
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5181
|
-
/* harmony export */
|
|
5182
|
-
/* harmony export */
|
|
5183
|
-
/* harmony export */
|
|
5184
|
-
/* harmony export */
|
|
5516
|
+
/* harmony export */ CMIInteractions: function() { return /* binding */ CMIInteractions; },
|
|
5517
|
+
/* harmony export */ CMIInteractionsCorrectResponsesObject: function() { return /* binding */ CMIInteractionsCorrectResponsesObject; },
|
|
5518
|
+
/* harmony export */ CMIInteractionsObject: function() { return /* binding */ CMIInteractionsObject; },
|
|
5519
|
+
/* harmony export */ CMIInteractionsObjectivesObject: function() { return /* binding */ CMIInteractionsObjectivesObject; }
|
|
5185
5520
|
/* harmony export */ });
|
|
5186
5521
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(635);
|
|
5187
5522
|
/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(589);
|
|
5188
5523
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
5189
5524
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(797);
|
|
5190
|
-
/* harmony import */ var
|
|
5525
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(179);
|
|
5191
5526
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(319);
|
|
5192
5527
|
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(915);
|
|
5193
5528
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(417);
|
|
@@ -5200,19 +5535,19 @@ var CMI = (function (_super) {
|
|
|
5200
5535
|
|
|
5201
5536
|
|
|
5202
5537
|
var CMIInteractions = (function (_super) {
|
|
5203
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
5538
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractions, _super);
|
|
5204
5539
|
function CMIInteractions() {
|
|
5205
5540
|
return _super.call(this, {
|
|
5206
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
5207
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__
|
|
5208
|
-
errorClass:
|
|
5541
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.interactions_children,
|
|
5542
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.INVALID_SET_VALUE,
|
|
5543
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError,
|
|
5209
5544
|
}) || this;
|
|
5210
5545
|
}
|
|
5211
5546
|
return CMIInteractions;
|
|
5212
|
-
}(_common_array__WEBPACK_IMPORTED_MODULE_0__
|
|
5547
|
+
}(_common_array__WEBPACK_IMPORTED_MODULE_0__.CMIArray));
|
|
5213
5548
|
|
|
5214
5549
|
var CMIInteractionsObject = (function (_super) {
|
|
5215
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
5550
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsObject, _super);
|
|
5216
5551
|
function CMIInteractionsObject() {
|
|
5217
5552
|
var _this = _super.call(this) || this;
|
|
5218
5553
|
_this._id = "";
|
|
@@ -5222,15 +5557,15 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5222
5557
|
_this._student_response = "";
|
|
5223
5558
|
_this._result = "";
|
|
5224
5559
|
_this._latency = "";
|
|
5225
|
-
_this.objectives = new _common_array__WEBPACK_IMPORTED_MODULE_0__
|
|
5226
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__
|
|
5227
|
-
errorClass:
|
|
5228
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
5560
|
+
_this.objectives = new _common_array__WEBPACK_IMPORTED_MODULE_0__.CMIArray({
|
|
5561
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.INVALID_SET_VALUE,
|
|
5562
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError,
|
|
5563
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.objectives_children,
|
|
5229
5564
|
});
|
|
5230
|
-
_this.correct_responses = new _common_array__WEBPACK_IMPORTED_MODULE_0__
|
|
5231
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__
|
|
5232
|
-
errorClass:
|
|
5233
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
5565
|
+
_this.correct_responses = new _common_array__WEBPACK_IMPORTED_MODULE_0__.CMIArray({
|
|
5566
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.INVALID_SET_VALUE,
|
|
5567
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError,
|
|
5568
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.correct_responses_children,
|
|
5234
5569
|
});
|
|
5235
5570
|
return _this;
|
|
5236
5571
|
}
|
|
@@ -5240,15 +5575,28 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5240
5575
|
(_a = this.objectives) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
5241
5576
|
(_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.initialize();
|
|
5242
5577
|
};
|
|
5578
|
+
CMIInteractionsObject.prototype.reset = function () {
|
|
5579
|
+
var _a, _b;
|
|
5580
|
+
this._initialized = false;
|
|
5581
|
+
this._id = "";
|
|
5582
|
+
this._time = "";
|
|
5583
|
+
this._type = "";
|
|
5584
|
+
this._weighting = "";
|
|
5585
|
+
this._student_response = "";
|
|
5586
|
+
this._result = "";
|
|
5587
|
+
this._latency = "";
|
|
5588
|
+
(_a = this.objectives) === null || _a === void 0 ? void 0 : _a.reset();
|
|
5589
|
+
(_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.reset();
|
|
5590
|
+
};
|
|
5243
5591
|
Object.defineProperty(CMIInteractionsObject.prototype, "id", {
|
|
5244
5592
|
get: function () {
|
|
5245
5593
|
if (!this.jsonString) {
|
|
5246
|
-
throw new
|
|
5594
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
5247
5595
|
}
|
|
5248
5596
|
return this._id;
|
|
5249
5597
|
},
|
|
5250
5598
|
set: function (id) {
|
|
5251
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5599
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIIdentifier)) {
|
|
5252
5600
|
this._id = id;
|
|
5253
5601
|
}
|
|
5254
5602
|
},
|
|
@@ -5258,12 +5606,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5258
5606
|
Object.defineProperty(CMIInteractionsObject.prototype, "time", {
|
|
5259
5607
|
get: function () {
|
|
5260
5608
|
if (!this.jsonString) {
|
|
5261
|
-
throw new
|
|
5609
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
5262
5610
|
}
|
|
5263
5611
|
return this._time;
|
|
5264
5612
|
},
|
|
5265
5613
|
set: function (time) {
|
|
5266
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5614
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(time, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMITime)) {
|
|
5267
5615
|
this._time = time;
|
|
5268
5616
|
}
|
|
5269
5617
|
},
|
|
@@ -5273,12 +5621,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5273
5621
|
Object.defineProperty(CMIInteractionsObject.prototype, "type", {
|
|
5274
5622
|
get: function () {
|
|
5275
5623
|
if (!this.jsonString) {
|
|
5276
|
-
throw new
|
|
5624
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
5277
5625
|
}
|
|
5278
5626
|
return this._type;
|
|
5279
5627
|
},
|
|
5280
5628
|
set: function (type) {
|
|
5281
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5629
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(type, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIType)) {
|
|
5282
5630
|
this._type = type;
|
|
5283
5631
|
}
|
|
5284
5632
|
},
|
|
@@ -5288,13 +5636,13 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5288
5636
|
Object.defineProperty(CMIInteractionsObject.prototype, "weighting", {
|
|
5289
5637
|
get: function () {
|
|
5290
5638
|
if (!this.jsonString) {
|
|
5291
|
-
throw new
|
|
5639
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
5292
5640
|
}
|
|
5293
5641
|
return this._weighting;
|
|
5294
5642
|
},
|
|
5295
5643
|
set: function (weighting) {
|
|
5296
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5297
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5644
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIDecimal) &&
|
|
5645
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidRange)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.weighting_range)) {
|
|
5298
5646
|
this._weighting = weighting;
|
|
5299
5647
|
}
|
|
5300
5648
|
},
|
|
@@ -5304,12 +5652,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5304
5652
|
Object.defineProperty(CMIInteractionsObject.prototype, "student_response", {
|
|
5305
5653
|
get: function () {
|
|
5306
5654
|
if (!this.jsonString) {
|
|
5307
|
-
throw new
|
|
5655
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
5308
5656
|
}
|
|
5309
5657
|
return this._student_response;
|
|
5310
5658
|
},
|
|
5311
5659
|
set: function (student_response) {
|
|
5312
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5660
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(student_response, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIFeedback, true)) {
|
|
5313
5661
|
this._student_response = student_response;
|
|
5314
5662
|
}
|
|
5315
5663
|
},
|
|
@@ -5319,12 +5667,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5319
5667
|
Object.defineProperty(CMIInteractionsObject.prototype, "result", {
|
|
5320
5668
|
get: function () {
|
|
5321
5669
|
if (!this.jsonString) {
|
|
5322
|
-
throw new
|
|
5670
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
5323
5671
|
}
|
|
5324
5672
|
return this._result;
|
|
5325
5673
|
},
|
|
5326
5674
|
set: function (result) {
|
|
5327
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5675
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(result, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIResult)) {
|
|
5328
5676
|
this._result = result;
|
|
5329
5677
|
}
|
|
5330
5678
|
},
|
|
@@ -5334,12 +5682,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5334
5682
|
Object.defineProperty(CMIInteractionsObject.prototype, "latency", {
|
|
5335
5683
|
get: function () {
|
|
5336
5684
|
if (!this.jsonString) {
|
|
5337
|
-
throw new
|
|
5685
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
5338
5686
|
}
|
|
5339
5687
|
return this._latency;
|
|
5340
5688
|
},
|
|
5341
5689
|
set: function (latency) {
|
|
5342
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5690
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(latency, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMITimespan)) {
|
|
5343
5691
|
this._latency = latency;
|
|
5344
5692
|
}
|
|
5345
5693
|
},
|
|
@@ -5363,21 +5711,25 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5363
5711
|
return result;
|
|
5364
5712
|
};
|
|
5365
5713
|
return CMIInteractionsObject;
|
|
5366
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
5714
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
5367
5715
|
|
|
5368
5716
|
var CMIInteractionsObjectivesObject = (function (_super) {
|
|
5369
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
5717
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsObjectivesObject, _super);
|
|
5370
5718
|
function CMIInteractionsObjectivesObject() {
|
|
5371
5719
|
var _this = _super.call(this) || this;
|
|
5372
5720
|
_this._id = "";
|
|
5373
5721
|
return _this;
|
|
5374
5722
|
}
|
|
5723
|
+
CMIInteractionsObjectivesObject.prototype.reset = function () {
|
|
5724
|
+
this._initialized = false;
|
|
5725
|
+
this._id = "";
|
|
5726
|
+
};
|
|
5375
5727
|
Object.defineProperty(CMIInteractionsObjectivesObject.prototype, "id", {
|
|
5376
5728
|
get: function () {
|
|
5377
5729
|
return this._id;
|
|
5378
5730
|
},
|
|
5379
5731
|
set: function (id) {
|
|
5380
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5732
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIIdentifier)) {
|
|
5381
5733
|
this._id = id;
|
|
5382
5734
|
}
|
|
5383
5735
|
},
|
|
@@ -5393,24 +5745,28 @@ var CMIInteractionsObjectivesObject = (function (_super) {
|
|
|
5393
5745
|
return result;
|
|
5394
5746
|
};
|
|
5395
5747
|
return CMIInteractionsObjectivesObject;
|
|
5396
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
5748
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
5397
5749
|
|
|
5398
5750
|
var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
5399
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
5751
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsCorrectResponsesObject, _super);
|
|
5400
5752
|
function CMIInteractionsCorrectResponsesObject() {
|
|
5401
5753
|
var _this = _super.call(this) || this;
|
|
5402
5754
|
_this._pattern = "";
|
|
5403
5755
|
return _this;
|
|
5404
5756
|
}
|
|
5757
|
+
CMIInteractionsCorrectResponsesObject.prototype.reset = function () {
|
|
5758
|
+
this._initialized = false;
|
|
5759
|
+
this._pattern = "";
|
|
5760
|
+
};
|
|
5405
5761
|
Object.defineProperty(CMIInteractionsCorrectResponsesObject.prototype, "pattern", {
|
|
5406
5762
|
get: function () {
|
|
5407
5763
|
if (!this.jsonString) {
|
|
5408
|
-
throw new
|
|
5764
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
5409
5765
|
}
|
|
5410
5766
|
return this._pattern;
|
|
5411
5767
|
},
|
|
5412
5768
|
set: function (pattern) {
|
|
5413
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5769
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(pattern, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIFeedback, true)) {
|
|
5414
5770
|
this._pattern = pattern;
|
|
5415
5771
|
}
|
|
5416
5772
|
},
|
|
@@ -5426,7 +5782,7 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
5426
5782
|
return result;
|
|
5427
5783
|
};
|
|
5428
5784
|
return CMIInteractionsCorrectResponsesObject;
|
|
5429
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
5785
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
5430
5786
|
|
|
5431
5787
|
|
|
5432
5788
|
|
|
@@ -5435,8 +5791,9 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
5435
5791
|
/***/ 331:
|
|
5436
5792
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5437
5793
|
|
|
5794
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5438
5795
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5439
|
-
/* harmony export */
|
|
5796
|
+
/* harmony export */ NAV: function() { return /* binding */ NAV; }
|
|
5440
5797
|
/* harmony export */ });
|
|
5441
5798
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635);
|
|
5442
5799
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
@@ -5447,18 +5804,22 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
5447
5804
|
|
|
5448
5805
|
|
|
5449
5806
|
var NAV = (function (_super) {
|
|
5450
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_3__
|
|
5807
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_3__.__extends)(NAV, _super);
|
|
5451
5808
|
function NAV() {
|
|
5452
5809
|
var _this = _super.call(this) || this;
|
|
5453
5810
|
_this._event = "";
|
|
5454
5811
|
return _this;
|
|
5455
5812
|
}
|
|
5813
|
+
NAV.prototype.reset = function () {
|
|
5814
|
+
this._event = "";
|
|
5815
|
+
this._initialized = false;
|
|
5816
|
+
};
|
|
5456
5817
|
Object.defineProperty(NAV.prototype, "event", {
|
|
5457
5818
|
get: function () {
|
|
5458
5819
|
return this._event;
|
|
5459
5820
|
},
|
|
5460
5821
|
set: function (event) {
|
|
5461
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_1__
|
|
5822
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_1__.check12ValidFormat)(event, _constants_regex__WEBPACK_IMPORTED_MODULE_2__.scorm12_regex.NAVEvent)) {
|
|
5462
5823
|
this._event = event;
|
|
5463
5824
|
}
|
|
5464
5825
|
},
|
|
@@ -5474,7 +5835,7 @@ var NAV = (function (_super) {
|
|
|
5474
5835
|
return result;
|
|
5475
5836
|
};
|
|
5476
5837
|
return NAV;
|
|
5477
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
5838
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
5478
5839
|
|
|
5479
5840
|
|
|
5480
5841
|
|
|
@@ -5483,9 +5844,10 @@ var NAV = (function (_super) {
|
|
|
5483
5844
|
/***/ 176:
|
|
5484
5845
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5485
5846
|
|
|
5847
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5486
5848
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5487
|
-
/* harmony export */
|
|
5488
|
-
/* harmony export */
|
|
5849
|
+
/* harmony export */ CMIObjectives: function() { return /* binding */ CMIObjectives; },
|
|
5850
|
+
/* harmony export */ CMIObjectivesObject: function() { return /* binding */ CMIObjectivesObject; }
|
|
5489
5851
|
/* harmony export */ });
|
|
5490
5852
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(635);
|
|
5491
5853
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
@@ -5493,7 +5855,7 @@ var NAV = (function (_super) {
|
|
|
5493
5855
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(340);
|
|
5494
5856
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(417);
|
|
5495
5857
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(797);
|
|
5496
|
-
/* harmony import */ var
|
|
5858
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(179);
|
|
5497
5859
|
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(915);
|
|
5498
5860
|
/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(589);
|
|
5499
5861
|
|
|
@@ -5506,39 +5868,46 @@ var NAV = (function (_super) {
|
|
|
5506
5868
|
|
|
5507
5869
|
|
|
5508
5870
|
var CMIObjectives = (function (_super) {
|
|
5509
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_8__
|
|
5871
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_8__.__extends)(CMIObjectives, _super);
|
|
5510
5872
|
function CMIObjectives() {
|
|
5511
5873
|
return _super.call(this, {
|
|
5512
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
5513
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
5514
|
-
errorClass:
|
|
5874
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.objectives_children,
|
|
5875
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.INVALID_SET_VALUE,
|
|
5876
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_5__.Scorm12ValidationError,
|
|
5515
5877
|
}) || this;
|
|
5516
5878
|
}
|
|
5517
5879
|
return CMIObjectives;
|
|
5518
|
-
}(_common_array__WEBPACK_IMPORTED_MODULE_7__
|
|
5880
|
+
}(_common_array__WEBPACK_IMPORTED_MODULE_7__.CMIArray));
|
|
5519
5881
|
|
|
5520
5882
|
var CMIObjectivesObject = (function (_super) {
|
|
5521
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_8__
|
|
5883
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_8__.__extends)(CMIObjectivesObject, _super);
|
|
5522
5884
|
function CMIObjectivesObject() {
|
|
5523
5885
|
var _this = _super.call(this) || this;
|
|
5524
5886
|
_this._id = "";
|
|
5525
5887
|
_this._status = "";
|
|
5526
|
-
_this.score = new _common_score__WEBPACK_IMPORTED_MODULE_1__
|
|
5527
|
-
score_children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
5528
|
-
score_range: _constants_regex__WEBPACK_IMPORTED_MODULE_3__
|
|
5529
|
-
invalidErrorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
5530
|
-
invalidTypeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
5531
|
-
invalidRangeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
5532
|
-
errorClass:
|
|
5888
|
+
_this.score = new _common_score__WEBPACK_IMPORTED_MODULE_1__.CMIScore({
|
|
5889
|
+
score_children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.score_children,
|
|
5890
|
+
score_range: _constants_regex__WEBPACK_IMPORTED_MODULE_3__.scorm12_regex.score_range,
|
|
5891
|
+
invalidErrorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.INVALID_SET_VALUE,
|
|
5892
|
+
invalidTypeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.TYPE_MISMATCH,
|
|
5893
|
+
invalidRangeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.VALUE_OUT_OF_RANGE,
|
|
5894
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_5__.Scorm12ValidationError,
|
|
5533
5895
|
});
|
|
5534
5896
|
return _this;
|
|
5535
5897
|
}
|
|
5898
|
+
CMIObjectivesObject.prototype.reset = function () {
|
|
5899
|
+
var _a;
|
|
5900
|
+
this._initialized = false;
|
|
5901
|
+
this._id = "";
|
|
5902
|
+
this._status = "";
|
|
5903
|
+
(_a = this.score) === null || _a === void 0 ? void 0 : _a.reset();
|
|
5904
|
+
};
|
|
5536
5905
|
Object.defineProperty(CMIObjectivesObject.prototype, "id", {
|
|
5537
5906
|
get: function () {
|
|
5538
5907
|
return this._id;
|
|
5539
5908
|
},
|
|
5540
5909
|
set: function (id) {
|
|
5541
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__
|
|
5910
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__.check12ValidFormat)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_3__.scorm12_regex.CMIIdentifier)) {
|
|
5542
5911
|
this._id = id;
|
|
5543
5912
|
}
|
|
5544
5913
|
},
|
|
@@ -5550,7 +5919,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
5550
5919
|
return this._status;
|
|
5551
5920
|
},
|
|
5552
5921
|
set: function (status) {
|
|
5553
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__
|
|
5922
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__.check12ValidFormat)(status, _constants_regex__WEBPACK_IMPORTED_MODULE_3__.scorm12_regex.CMIStatus2)) {
|
|
5554
5923
|
this._status = status;
|
|
5555
5924
|
}
|
|
5556
5925
|
},
|
|
@@ -5568,7 +5937,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
5568
5937
|
return result;
|
|
5569
5938
|
};
|
|
5570
5939
|
return CMIObjectivesObject;
|
|
5571
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
5940
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
5572
5941
|
|
|
5573
5942
|
|
|
5574
5943
|
|
|
@@ -5577,13 +5946,14 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
5577
5946
|
/***/ 532:
|
|
5578
5947
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5579
5948
|
|
|
5949
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5580
5950
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5581
|
-
/* harmony export */
|
|
5951
|
+
/* harmony export */ CMIStudentData: function() { return /* binding */ CMIStudentData; }
|
|
5582
5952
|
/* harmony export */ });
|
|
5583
5953
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635);
|
|
5584
5954
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
5585
5955
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
5586
|
-
/* harmony import */ var
|
|
5956
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(179);
|
|
5587
5957
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797);
|
|
5588
5958
|
|
|
5589
5959
|
|
|
@@ -5591,7 +5961,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
5591
5961
|
|
|
5592
5962
|
|
|
5593
5963
|
var CMIStudentData = (function (_super) {
|
|
5594
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_4__
|
|
5964
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_4__.__extends)(CMIStudentData, _super);
|
|
5595
5965
|
function CMIStudentData(student_data_children) {
|
|
5596
5966
|
var _this = _super.call(this) || this;
|
|
5597
5967
|
_this._mastery_score = "";
|
|
@@ -5599,15 +5969,18 @@ var CMIStudentData = (function (_super) {
|
|
|
5599
5969
|
_this._time_limit_action = "";
|
|
5600
5970
|
_this.__children = student_data_children
|
|
5601
5971
|
? student_data_children
|
|
5602
|
-
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
5972
|
+
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.student_data_children;
|
|
5603
5973
|
return _this;
|
|
5604
5974
|
}
|
|
5975
|
+
CMIStudentData.prototype.reset = function () {
|
|
5976
|
+
this._initialized = false;
|
|
5977
|
+
};
|
|
5605
5978
|
Object.defineProperty(CMIStudentData.prototype, "_children", {
|
|
5606
5979
|
get: function () {
|
|
5607
5980
|
return this.__children;
|
|
5608
5981
|
},
|
|
5609
5982
|
set: function (_children) {
|
|
5610
|
-
throw new
|
|
5983
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.INVALID_SET_VALUE);
|
|
5611
5984
|
},
|
|
5612
5985
|
enumerable: false,
|
|
5613
5986
|
configurable: true
|
|
@@ -5618,7 +5991,7 @@ var CMIStudentData = (function (_super) {
|
|
|
5618
5991
|
},
|
|
5619
5992
|
set: function (mastery_score) {
|
|
5620
5993
|
if (this.initialized) {
|
|
5621
|
-
throw new
|
|
5994
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.READ_ONLY_ELEMENT);
|
|
5622
5995
|
}
|
|
5623
5996
|
else {
|
|
5624
5997
|
this._mastery_score = mastery_score;
|
|
@@ -5633,7 +6006,7 @@ var CMIStudentData = (function (_super) {
|
|
|
5633
6006
|
},
|
|
5634
6007
|
set: function (max_time_allowed) {
|
|
5635
6008
|
if (this.initialized) {
|
|
5636
|
-
throw new
|
|
6009
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.READ_ONLY_ELEMENT);
|
|
5637
6010
|
}
|
|
5638
6011
|
else {
|
|
5639
6012
|
this._max_time_allowed = max_time_allowed;
|
|
@@ -5648,7 +6021,7 @@ var CMIStudentData = (function (_super) {
|
|
|
5648
6021
|
},
|
|
5649
6022
|
set: function (time_limit_action) {
|
|
5650
6023
|
if (this.initialized) {
|
|
5651
|
-
throw new
|
|
6024
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.READ_ONLY_ELEMENT);
|
|
5652
6025
|
}
|
|
5653
6026
|
else {
|
|
5654
6027
|
this._time_limit_action = time_limit_action;
|
|
@@ -5668,7 +6041,7 @@ var CMIStudentData = (function (_super) {
|
|
|
5668
6041
|
return result;
|
|
5669
6042
|
};
|
|
5670
6043
|
return CMIStudentData;
|
|
5671
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
6044
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
5672
6045
|
|
|
5673
6046
|
|
|
5674
6047
|
|
|
@@ -5677,16 +6050,17 @@ var CMIStudentData = (function (_super) {
|
|
|
5677
6050
|
/***/ 181:
|
|
5678
6051
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5679
6052
|
|
|
6053
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5680
6054
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5681
|
-
/* harmony export */
|
|
6055
|
+
/* harmony export */ CMIStudentPreference: function() { return /* binding */ CMIStudentPreference; }
|
|
5682
6056
|
/* harmony export */ });
|
|
5683
6057
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(635);
|
|
5684
6058
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
5685
6059
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
5686
|
-
/* harmony import */ var
|
|
5687
|
-
/* harmony import */ var
|
|
5688
|
-
/* harmony import */ var
|
|
5689
|
-
/* harmony import */ var
|
|
6060
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(179);
|
|
6061
|
+
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(915);
|
|
6062
|
+
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(417);
|
|
6063
|
+
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(797);
|
|
5690
6064
|
|
|
5691
6065
|
|
|
5692
6066
|
|
|
@@ -5695,7 +6069,7 @@ var CMIStudentData = (function (_super) {
|
|
|
5695
6069
|
|
|
5696
6070
|
|
|
5697
6071
|
var CMIStudentPreference = (function (_super) {
|
|
5698
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_6__
|
|
6072
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_6__.__extends)(CMIStudentPreference, _super);
|
|
5699
6073
|
function CMIStudentPreference(student_preference_children) {
|
|
5700
6074
|
var _this = _super.call(this) || this;
|
|
5701
6075
|
_this._audio = "";
|
|
@@ -5704,15 +6078,18 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5704
6078
|
_this._text = "";
|
|
5705
6079
|
_this.__children = student_preference_children
|
|
5706
6080
|
? student_preference_children
|
|
5707
|
-
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
6081
|
+
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.student_preference_children;
|
|
5708
6082
|
return _this;
|
|
5709
6083
|
}
|
|
6084
|
+
CMIStudentPreference.prototype.reset = function () {
|
|
6085
|
+
this._initialized = false;
|
|
6086
|
+
};
|
|
5710
6087
|
Object.defineProperty(CMIStudentPreference.prototype, "_children", {
|
|
5711
6088
|
get: function () {
|
|
5712
6089
|
return this.__children;
|
|
5713
6090
|
},
|
|
5714
6091
|
set: function (_children) {
|
|
5715
|
-
throw new
|
|
6092
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_5__.scorm12_errors.INVALID_SET_VALUE);
|
|
5716
6093
|
},
|
|
5717
6094
|
enumerable: false,
|
|
5718
6095
|
configurable: true
|
|
@@ -5722,8 +6099,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5722
6099
|
return this._audio;
|
|
5723
6100
|
},
|
|
5724
6101
|
set: function (audio) {
|
|
5725
|
-
if ((0,
|
|
5726
|
-
(0,
|
|
6102
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMISInteger) &&
|
|
6103
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidRange)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.audio_range)) {
|
|
5727
6104
|
this._audio = audio;
|
|
5728
6105
|
}
|
|
5729
6106
|
},
|
|
@@ -5735,7 +6112,7 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5735
6112
|
return this._language;
|
|
5736
6113
|
},
|
|
5737
6114
|
set: function (language) {
|
|
5738
|
-
if ((0,
|
|
6115
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(language, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMIString256)) {
|
|
5739
6116
|
this._language = language;
|
|
5740
6117
|
}
|
|
5741
6118
|
},
|
|
@@ -5747,8 +6124,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5747
6124
|
return this._speed;
|
|
5748
6125
|
},
|
|
5749
6126
|
set: function (speed) {
|
|
5750
|
-
if ((0,
|
|
5751
|
-
(0,
|
|
6127
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMISInteger) &&
|
|
6128
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidRange)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.speed_range)) {
|
|
5752
6129
|
this._speed = speed;
|
|
5753
6130
|
}
|
|
5754
6131
|
},
|
|
@@ -5760,8 +6137,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5760
6137
|
return this._text;
|
|
5761
6138
|
},
|
|
5762
6139
|
set: function (text) {
|
|
5763
|
-
if ((0,
|
|
5764
|
-
(0,
|
|
6140
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMISInteger) &&
|
|
6141
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidRange)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.text_range)) {
|
|
5765
6142
|
this._text = text;
|
|
5766
6143
|
}
|
|
5767
6144
|
},
|
|
@@ -5780,7 +6157,7 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5780
6157
|
return result;
|
|
5781
6158
|
};
|
|
5782
6159
|
return CMIStudentPreference;
|
|
5783
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
6160
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
5784
6161
|
|
|
5785
6162
|
|
|
5786
6163
|
|
|
@@ -5789,24 +6166,25 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5789
6166
|
/***/ 915:
|
|
5790
6167
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5791
6168
|
|
|
6169
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5792
6170
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5793
|
-
/* harmony export */
|
|
5794
|
-
/* harmony export */
|
|
6171
|
+
/* harmony export */ check12ValidFormat: function() { return /* binding */ check12ValidFormat; },
|
|
6172
|
+
/* harmony export */ check12ValidRange: function() { return /* binding */ check12ValidRange; }
|
|
5795
6173
|
/* harmony export */ });
|
|
5796
6174
|
/* harmony import */ var _common_validation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(449);
|
|
5797
6175
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(797);
|
|
5798
|
-
/* harmony import */ var
|
|
6176
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(179);
|
|
5799
6177
|
|
|
5800
6178
|
|
|
5801
6179
|
|
|
5802
6180
|
function check12ValidFormat(value, regexPattern, allowEmptyString) {
|
|
5803
|
-
return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__
|
|
6181
|
+
return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__.checkValidFormat)(value, regexPattern, _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__.scorm12_errors.TYPE_MISMATCH, _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_1__.Scorm12ValidationError, allowEmptyString);
|
|
5804
6182
|
}
|
|
5805
6183
|
function check12ValidRange(value, rangePattern, allowEmptyString) {
|
|
5806
6184
|
if (!allowEmptyString && value === "") {
|
|
5807
|
-
throw new
|
|
6185
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_1__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_0__.scorm12_errors.VALUE_OUT_OF_RANGE);
|
|
5808
6186
|
}
|
|
5809
|
-
return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__
|
|
6187
|
+
return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__.checkValidRange)(value, rangePattern, _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__.scorm12_errors.VALUE_OUT_OF_RANGE, _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_1__.Scorm12ValidationError);
|
|
5810
6188
|
}
|
|
5811
6189
|
|
|
5812
6190
|
|
|
@@ -5815,21 +6193,23 @@ function check12ValidRange(value, rangePattern, allowEmptyString) {
|
|
|
5815
6193
|
/***/ 340:
|
|
5816
6194
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5817
6195
|
|
|
6196
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6197
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6198
|
+
/* harmony export */ aicc_constants: function() { return /* binding */ aicc_constants; },
|
|
6199
|
+
/* harmony export */ global_constants: function() { return /* binding */ global_constants; },
|
|
6200
|
+
/* harmony export */ scorm12_constants: function() { return /* binding */ scorm12_constants; },
|
|
6201
|
+
/* harmony export */ scorm2004_constants: function() { return /* binding */ scorm2004_constants; }
|
|
6202
|
+
/* harmony export */ });
|
|
5818
6203
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
5819
6204
|
|
|
5820
|
-
var
|
|
6205
|
+
var global_constants = {
|
|
5821
6206
|
SCORM_TRUE: "true",
|
|
5822
6207
|
SCORM_FALSE: "false",
|
|
5823
6208
|
STATE_NOT_INITIALIZED: 0,
|
|
5824
6209
|
STATE_INITIALIZED: 1,
|
|
5825
6210
|
STATE_TERMINATED: 2,
|
|
5826
|
-
LOG_LEVEL_DEBUG: 1,
|
|
5827
|
-
LOG_LEVEL_INFO: 2,
|
|
5828
|
-
LOG_LEVEL_WARNING: 3,
|
|
5829
|
-
LOG_LEVEL_ERROR: 4,
|
|
5830
|
-
LOG_LEVEL_NONE: 5,
|
|
5831
6211
|
};
|
|
5832
|
-
var
|
|
6212
|
+
var scorm12_constants = {
|
|
5833
6213
|
cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",
|
|
5834
6214
|
core_children: "student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",
|
|
5835
6215
|
score_children: "raw,min,max",
|
|
@@ -5890,7 +6270,7 @@ var scorm12 = {
|
|
|
5890
6270
|
},
|
|
5891
6271
|
},
|
|
5892
6272
|
};
|
|
5893
|
-
var
|
|
6273
|
+
var aicc_constants = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, scorm12_constants), {
|
|
5894
6274
|
cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",
|
|
5895
6275
|
student_preference_children: "audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",
|
|
5896
6276
|
student_data_children: "attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",
|
|
@@ -5899,7 +6279,7 @@ var aicc = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__W
|
|
|
5899
6279
|
attempt_records_children: "score,lesson_status",
|
|
5900
6280
|
paths_children: "location_id,date,time,status,why_left,time_in_element",
|
|
5901
6281
|
});
|
|
5902
|
-
var
|
|
6282
|
+
var scorm2004_constants = {
|
|
5903
6283
|
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",
|
|
5904
6284
|
comments_children: "comment,timestamp,location",
|
|
5905
6285
|
score_children: "max,raw,scaled,min",
|
|
@@ -5908,6 +6288,7 @@ var scorm2004 = {
|
|
|
5908
6288
|
student_data_children: "mastery_score,max_time_allowed,time_limit_action",
|
|
5909
6289
|
student_preference_children: "audio_level,audio_captioning,delivery_speed,language",
|
|
5910
6290
|
interactions_children: "id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",
|
|
6291
|
+
adl_data_children: "id,store",
|
|
5911
6292
|
error_descriptions: {
|
|
5912
6293
|
"0": {
|
|
5913
6294
|
basicMessage: "No Error",
|
|
@@ -6015,13 +6396,6 @@ var scorm2004 = {
|
|
|
6015
6396
|
},
|
|
6016
6397
|
},
|
|
6017
6398
|
};
|
|
6018
|
-
var APIConstants = {
|
|
6019
|
-
global: global,
|
|
6020
|
-
scorm12: scorm12,
|
|
6021
|
-
aicc: aicc,
|
|
6022
|
-
scorm2004: scorm2004,
|
|
6023
|
-
};
|
|
6024
|
-
/* harmony default export */ __webpack_exports__.A = (APIConstants);
|
|
6025
6399
|
|
|
6026
6400
|
|
|
6027
6401
|
/***/ }),
|
|
@@ -6029,10 +6403,12 @@ var APIConstants = {
|
|
|
6029
6403
|
/***/ 56:
|
|
6030
6404
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6031
6405
|
|
|
6406
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6032
6407
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6033
|
-
/* harmony export */
|
|
6034
|
-
/* harmony export */
|
|
6035
|
-
/* harmony export */
|
|
6408
|
+
/* harmony export */ CompletionStatus: function() { return /* binding */ CompletionStatus; },
|
|
6409
|
+
/* harmony export */ LogLevelEnum: function() { return /* binding */ LogLevelEnum; },
|
|
6410
|
+
/* harmony export */ NAVBoolean: function() { return /* binding */ NAVBoolean; },
|
|
6411
|
+
/* harmony export */ SuccessStatus: function() { return /* binding */ SuccessStatus; }
|
|
6036
6412
|
/* harmony export */ });
|
|
6037
6413
|
var NAVBoolean;
|
|
6038
6414
|
(function (NAVBoolean) {
|
|
@@ -6052,6 +6428,15 @@ var CompletionStatus;
|
|
|
6052
6428
|
CompletionStatus["incomplete"] = "incomplete";
|
|
6053
6429
|
CompletionStatus["unknown"] = "unknown";
|
|
6054
6430
|
})(CompletionStatus || (CompletionStatus = {}));
|
|
6431
|
+
var LogLevelEnum;
|
|
6432
|
+
(function (LogLevelEnum) {
|
|
6433
|
+
LogLevelEnum[LogLevelEnum["_"] = 0] = "_";
|
|
6434
|
+
LogLevelEnum[LogLevelEnum["DEBUG"] = 1] = "DEBUG";
|
|
6435
|
+
LogLevelEnum[LogLevelEnum["INFO"] = 2] = "INFO";
|
|
6436
|
+
LogLevelEnum[LogLevelEnum["WARN"] = 3] = "WARN";
|
|
6437
|
+
LogLevelEnum[LogLevelEnum["ERROR"] = 4] = "ERROR";
|
|
6438
|
+
LogLevelEnum[LogLevelEnum["NONE"] = 5] = "NONE";
|
|
6439
|
+
})(LogLevelEnum || (LogLevelEnum = {}));
|
|
6055
6440
|
|
|
6056
6441
|
|
|
6057
6442
|
/***/ }),
|
|
@@ -6059,9 +6444,15 @@ var CompletionStatus;
|
|
|
6059
6444
|
/***/ 797:
|
|
6060
6445
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6061
6446
|
|
|
6447
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6448
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6449
|
+
/* harmony export */ global_errors: function() { return /* binding */ global_errors; },
|
|
6450
|
+
/* harmony export */ scorm12_errors: function() { return /* binding */ scorm12_errors; },
|
|
6451
|
+
/* harmony export */ scorm2004_errors: function() { return /* binding */ scorm2004_errors; }
|
|
6452
|
+
/* harmony export */ });
|
|
6062
6453
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
6063
6454
|
|
|
6064
|
-
var
|
|
6455
|
+
var global_errors = {
|
|
6065
6456
|
GENERAL: 101,
|
|
6066
6457
|
INITIALIZATION_FAILED: 101,
|
|
6067
6458
|
INITIALIZED: 101,
|
|
@@ -6091,13 +6482,8 @@ var global = {
|
|
|
6091
6482
|
VALUE_OUT_OF_RANGE: 101,
|
|
6092
6483
|
DEPENDENCY_NOT_ESTABLISHED: 101,
|
|
6093
6484
|
};
|
|
6094
|
-
var
|
|
6095
|
-
var
|
|
6096
|
-
var ErrorCodes = {
|
|
6097
|
-
scorm12: scorm12,
|
|
6098
|
-
scorm2004: scorm2004,
|
|
6099
|
-
};
|
|
6100
|
-
/* harmony default export */ __webpack_exports__.A = (ErrorCodes);
|
|
6485
|
+
var scorm12_errors = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, global_errors), { RETRIEVE_BEFORE_INIT: 301, STORE_BEFORE_INIT: 301, COMMIT_BEFORE_INIT: 301, ARGUMENT_ERROR: 201, CHILDREN_ERROR: 202, COUNT_ERROR: 203, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 401, VALUE_NOT_INITIALIZED: 301, INVALID_SET_VALUE: 402, READ_ONLY_ELEMENT: 403, WRITE_ONLY_ELEMENT: 404, TYPE_MISMATCH: 405, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 });
|
|
6486
|
+
var scorm2004_errors = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, global_errors), { INITIALIZATION_FAILED: 102, INITIALIZED: 103, TERMINATED: 104, TERMINATION_FAILURE: 111, TERMINATION_BEFORE_INIT: 112, MULTIPLE_TERMINATIONS: 113, RETRIEVE_BEFORE_INIT: 122, RETRIEVE_AFTER_TERM: 123, STORE_BEFORE_INIT: 132, STORE_AFTER_TERM: 133, COMMIT_BEFORE_INIT: 142, COMMIT_AFTER_TERM: 143, ARGUMENT_ERROR: 201, GENERAL_GET_FAILURE: 301, GENERAL_SET_FAILURE: 351, GENERAL_COMMIT_FAILURE: 391, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 402, VALUE_NOT_INITIALIZED: 403, READ_ONLY_ELEMENT: 404, WRITE_ONLY_ELEMENT: 405, TYPE_MISMATCH: 406, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 });
|
|
6101
6487
|
|
|
6102
6488
|
|
|
6103
6489
|
/***/ }),
|
|
@@ -6105,9 +6491,15 @@ var ErrorCodes = {
|
|
|
6105
6491
|
/***/ 417:
|
|
6106
6492
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6107
6493
|
|
|
6494
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6495
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6496
|
+
/* harmony export */ aicc_regex: function() { return /* binding */ aicc_regex; },
|
|
6497
|
+
/* harmony export */ scorm12_regex: function() { return /* binding */ scorm12_regex; },
|
|
6498
|
+
/* harmony export */ scorm2004_regex: function() { return /* binding */ scorm2004_regex; }
|
|
6499
|
+
/* harmony export */ });
|
|
6108
6500
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
6109
6501
|
|
|
6110
|
-
var
|
|
6502
|
+
var scorm12_regex = {
|
|
6111
6503
|
CMIString256: "^.{0,255}$",
|
|
6112
6504
|
CMIString4096: "^.{0,4096}$",
|
|
6113
6505
|
CMITime: "^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",
|
|
@@ -6130,10 +6522,10 @@ var scorm12 = {
|
|
|
6130
6522
|
weighting_range: "-100#100",
|
|
6131
6523
|
text_range: "-1#1",
|
|
6132
6524
|
};
|
|
6133
|
-
var
|
|
6525
|
+
var aicc_regex = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, scorm12_regex), {
|
|
6134
6526
|
CMIIdentifier: "^\\w{1,255}$",
|
|
6135
6527
|
});
|
|
6136
|
-
var
|
|
6528
|
+
var scorm2004_regex = {
|
|
6137
6529
|
CMIString200: "^[\\u0000-\\uFFFF]{0,200}$",
|
|
6138
6530
|
CMIString250: "^[\\u0000-\\uFFFF]{0,250}$",
|
|
6139
6531
|
CMIString1000: "^[\\u0000-\\uFFFF]{0,1000}$",
|
|
@@ -6160,7 +6552,7 @@ var scorm2004 = {
|
|
|
6160
6552
|
CMIExit: "^(time-out|suspend|logout|normal)$",
|
|
6161
6553
|
CMIType: "^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",
|
|
6162
6554
|
CMIResult: "^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",
|
|
6163
|
-
NAVEvent: "^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target
|
|
6555
|
+
NAVEvent: "^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=(?<choice_target>\\S{0,}[a-zA-Z0-9-_]+)})?choice|(\\{target=(?<jump_target>\\S{0,}[a-zA-Z0-9-_]+)})?jump)$",
|
|
6164
6556
|
NAVBoolean: "^(unknown|true|false$)",
|
|
6165
6557
|
NAVTarget: "^{target=\\S{0,}[a-zA-Z0-9-_]+}$",
|
|
6166
6558
|
scaled_range: "-1#1",
|
|
@@ -6169,12 +6561,6 @@ var scorm2004 = {
|
|
|
6169
6561
|
text_range: "-1#1",
|
|
6170
6562
|
progress_range: "0#1",
|
|
6171
6563
|
};
|
|
6172
|
-
var Regex = {
|
|
6173
|
-
aicc: aicc,
|
|
6174
|
-
scorm12: scorm12,
|
|
6175
|
-
scorm2004: scorm2004,
|
|
6176
|
-
};
|
|
6177
|
-
/* harmony default export */ __webpack_exports__.A = (Regex);
|
|
6178
6564
|
|
|
6179
6565
|
|
|
6180
6566
|
/***/ }),
|
|
@@ -6182,22 +6568,15 @@ var Regex = {
|
|
|
6182
6568
|
/***/ 784:
|
|
6183
6569
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6184
6570
|
|
|
6571
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6185
6572
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6186
|
-
/* harmony export */
|
|
6187
|
-
/* harmony export */
|
|
6188
|
-
/* harmony export */ tQ: function() { return /* binding */ Scorm12ValidationError; },
|
|
6189
|
-
/* harmony export */ wq: function() { return /* binding */ Scorm2004ValidationError; },
|
|
6190
|
-
/* harmony export */ yI: function() { return /* binding */ ValidationError; }
|
|
6573
|
+
/* harmony export */ BaseScormValidationError: function() { return /* binding */ BaseScormValidationError; },
|
|
6574
|
+
/* harmony export */ ValidationError: function() { return /* binding */ ValidationError; }
|
|
6191
6575
|
/* harmony export */ });
|
|
6192
|
-
/* harmony import */ var
|
|
6193
|
-
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340);
|
|
6194
|
-
|
|
6576
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
6195
6577
|
|
|
6196
|
-
var scorm12_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.error_descriptions;
|
|
6197
|
-
var aicc_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.aicc.error_descriptions;
|
|
6198
|
-
var scorm2004_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm2004.error_descriptions;
|
|
6199
6578
|
var BaseScormValidationError = (function (_super) {
|
|
6200
|
-
(0,
|
|
6579
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(BaseScormValidationError, _super);
|
|
6201
6580
|
function BaseScormValidationError(errorCode) {
|
|
6202
6581
|
var _this = _super.call(this, errorCode.toString()) || this;
|
|
6203
6582
|
_this._errorCode = errorCode;
|
|
@@ -6211,18 +6590,15 @@ var BaseScormValidationError = (function (_super) {
|
|
|
6211
6590
|
enumerable: false,
|
|
6212
6591
|
configurable: true
|
|
6213
6592
|
});
|
|
6214
|
-
BaseScormValidationError.prototype.setMessage = function (message) {
|
|
6215
|
-
this.message = message;
|
|
6216
|
-
};
|
|
6217
6593
|
return BaseScormValidationError;
|
|
6218
6594
|
}(Error));
|
|
6219
6595
|
|
|
6220
6596
|
var ValidationError = (function (_super) {
|
|
6221
|
-
(0,
|
|
6597
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(ValidationError, _super);
|
|
6222
6598
|
function ValidationError(errorCode, errorMessage, detailedMessage) {
|
|
6223
6599
|
var _this = _super.call(this, errorCode) || this;
|
|
6224
6600
|
_this._detailedMessage = "";
|
|
6225
|
-
_this.
|
|
6601
|
+
_this.message = errorMessage;
|
|
6226
6602
|
_this._errorMessage = errorMessage;
|
|
6227
6603
|
if (detailedMessage) {
|
|
6228
6604
|
_this._detailedMessage = detailedMessage;
|
|
@@ -6246,8 +6622,26 @@ var ValidationError = (function (_super) {
|
|
|
6246
6622
|
return ValidationError;
|
|
6247
6623
|
}(BaseScormValidationError));
|
|
6248
6624
|
|
|
6625
|
+
|
|
6626
|
+
|
|
6627
|
+
/***/ }),
|
|
6628
|
+
|
|
6629
|
+
/***/ 179:
|
|
6630
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6631
|
+
|
|
6632
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6633
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6634
|
+
/* harmony export */ Scorm12ValidationError: function() { return /* binding */ Scorm12ValidationError; }
|
|
6635
|
+
/* harmony export */ });
|
|
6636
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(635);
|
|
6637
|
+
/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(784);
|
|
6638
|
+
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
6639
|
+
|
|
6640
|
+
|
|
6641
|
+
|
|
6642
|
+
var scorm12_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.error_descriptions;
|
|
6249
6643
|
var Scorm12ValidationError = (function (_super) {
|
|
6250
|
-
(0,
|
|
6644
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_2__.__extends)(Scorm12ValidationError, _super);
|
|
6251
6645
|
function Scorm12ValidationError(errorCode) {
|
|
6252
6646
|
var _this = this;
|
|
6253
6647
|
if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {
|
|
@@ -6259,37 +6653,7 @@ var Scorm12ValidationError = (function (_super) {
|
|
|
6259
6653
|
return _this;
|
|
6260
6654
|
}
|
|
6261
6655
|
return Scorm12ValidationError;
|
|
6262
|
-
}(ValidationError));
|
|
6263
|
-
|
|
6264
|
-
var AICCValidationError = (function (_super) {
|
|
6265
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(AICCValidationError, _super);
|
|
6266
|
-
function AICCValidationError(errorCode) {
|
|
6267
|
-
var _this = this;
|
|
6268
|
-
if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {
|
|
6269
|
-
_this = _super.call(this, errorCode, aicc_errors[String(errorCode)].basicMessage, aicc_errors[String(errorCode)].detailMessage) || this;
|
|
6270
|
-
}
|
|
6271
|
-
else {
|
|
6272
|
-
_this = _super.call(this, 101, aicc_errors["101"].basicMessage, aicc_errors["101"].detailMessage) || this;
|
|
6273
|
-
}
|
|
6274
|
-
return _this;
|
|
6275
|
-
}
|
|
6276
|
-
return AICCValidationError;
|
|
6277
|
-
}(ValidationError));
|
|
6278
|
-
|
|
6279
|
-
var Scorm2004ValidationError = (function (_super) {
|
|
6280
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(Scorm2004ValidationError, _super);
|
|
6281
|
-
function Scorm2004ValidationError(errorCode) {
|
|
6282
|
-
var _this = this;
|
|
6283
|
-
if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {
|
|
6284
|
-
_this = _super.call(this, errorCode, scorm2004_errors[String(errorCode)].basicMessage, scorm2004_errors[String(errorCode)].detailMessage) || this;
|
|
6285
|
-
}
|
|
6286
|
-
else {
|
|
6287
|
-
_this = _super.call(this, 101, scorm2004_errors["101"].basicMessage, scorm2004_errors["101"].detailMessage) || this;
|
|
6288
|
-
}
|
|
6289
|
-
return _this;
|
|
6290
|
-
}
|
|
6291
|
-
return Scorm2004ValidationError;
|
|
6292
|
-
}(ValidationError));
|
|
6656
|
+
}(_exceptions__WEBPACK_IMPORTED_MODULE_0__.ValidationError));
|
|
6293
6657
|
|
|
6294
6658
|
|
|
6295
6659
|
|
|
@@ -6298,19 +6662,24 @@ var Scorm2004ValidationError = (function (_super) {
|
|
|
6298
6662
|
/***/ 864:
|
|
6299
6663
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6300
6664
|
|
|
6665
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6301
6666
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6302
|
-
/* harmony export */
|
|
6303
|
-
/* harmony export */
|
|
6304
|
-
/* harmony export */
|
|
6305
|
-
/* harmony export */
|
|
6306
|
-
/* harmony export */
|
|
6307
|
-
/* harmony export */
|
|
6308
|
-
/* harmony export */
|
|
6309
|
-
/* harmony export */
|
|
6310
|
-
/* harmony export */
|
|
6311
|
-
/* harmony export */
|
|
6667
|
+
/* harmony export */ SECONDS_PER_DAY: function() { return /* binding */ SECONDS_PER_DAY; },
|
|
6668
|
+
/* harmony export */ SECONDS_PER_HOUR: function() { return /* binding */ SECONDS_PER_HOUR; },
|
|
6669
|
+
/* harmony export */ SECONDS_PER_MINUTE: function() { return /* binding */ SECONDS_PER_MINUTE; },
|
|
6670
|
+
/* harmony export */ SECONDS_PER_SECOND: function() { return /* binding */ SECONDS_PER_SECOND; },
|
|
6671
|
+
/* harmony export */ addHHMMSSTimeStrings: function() { return /* binding */ addHHMMSSTimeStrings; },
|
|
6672
|
+
/* harmony export */ addTwoDurations: function() { return /* binding */ addTwoDurations; },
|
|
6673
|
+
/* harmony export */ countDecimals: function() { return /* binding */ countDecimals; },
|
|
6674
|
+
/* harmony export */ flatten: function() { return /* binding */ flatten; },
|
|
6675
|
+
/* harmony export */ formatMessage: function() { return /* binding */ formatMessage; },
|
|
6676
|
+
/* harmony export */ getDurationAsSeconds: function() { return /* binding */ getDurationAsSeconds; },
|
|
6677
|
+
/* harmony export */ getSecondsAsHHMMSS: function() { return /* binding */ getSecondsAsHHMMSS; },
|
|
6678
|
+
/* harmony export */ getSecondsAsISODuration: function() { return /* binding */ getSecondsAsISODuration; },
|
|
6679
|
+
/* harmony export */ getTimeAsSeconds: function() { return /* binding */ getTimeAsSeconds; },
|
|
6680
|
+
/* harmony export */ stringMatches: function() { return /* binding */ stringMatches; },
|
|
6681
|
+
/* harmony export */ unflatten: function() { return /* binding */ unflatten; }
|
|
6312
6682
|
/* harmony export */ });
|
|
6313
|
-
/* unused harmony exports SECONDS_PER_SECOND, SECONDS_PER_MINUTE, SECONDS_PER_HOUR, SECONDS_PER_DAY, countDecimals */
|
|
6314
6683
|
var SECONDS_PER_SECOND = 1.0;
|
|
6315
6684
|
var SECONDS_PER_MINUTE = 60;
|
|
6316
6685
|
var SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;
|
|
@@ -6502,13 +6871,40 @@ function stringMatches(str, tester) {
|
|
|
6502
6871
|
/***/ 635:
|
|
6503
6872
|
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
6504
6873
|
|
|
6874
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6505
6875
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6506
|
-
/* harmony export */
|
|
6507
|
-
/* harmony export */
|
|
6508
|
-
/* harmony export */
|
|
6509
|
-
/* harmony export */
|
|
6876
|
+
/* harmony export */ __addDisposableResource: function() { return /* binding */ __addDisposableResource; },
|
|
6877
|
+
/* harmony export */ __assign: function() { return /* binding */ __assign; },
|
|
6878
|
+
/* harmony export */ __asyncDelegator: function() { return /* binding */ __asyncDelegator; },
|
|
6879
|
+
/* harmony export */ __asyncGenerator: function() { return /* binding */ __asyncGenerator; },
|
|
6880
|
+
/* harmony export */ __asyncValues: function() { return /* binding */ __asyncValues; },
|
|
6881
|
+
/* harmony export */ __await: function() { return /* binding */ __await; },
|
|
6882
|
+
/* harmony export */ __awaiter: function() { return /* binding */ __awaiter; },
|
|
6883
|
+
/* harmony export */ __classPrivateFieldGet: function() { return /* binding */ __classPrivateFieldGet; },
|
|
6884
|
+
/* harmony export */ __classPrivateFieldIn: function() { return /* binding */ __classPrivateFieldIn; },
|
|
6885
|
+
/* harmony export */ __classPrivateFieldSet: function() { return /* binding */ __classPrivateFieldSet; },
|
|
6886
|
+
/* harmony export */ __createBinding: function() { return /* binding */ __createBinding; },
|
|
6887
|
+
/* harmony export */ __decorate: function() { return /* binding */ __decorate; },
|
|
6888
|
+
/* harmony export */ __disposeResources: function() { return /* binding */ __disposeResources; },
|
|
6889
|
+
/* harmony export */ __esDecorate: function() { return /* binding */ __esDecorate; },
|
|
6890
|
+
/* harmony export */ __exportStar: function() { return /* binding */ __exportStar; },
|
|
6891
|
+
/* harmony export */ __extends: function() { return /* binding */ __extends; },
|
|
6892
|
+
/* harmony export */ __generator: function() { return /* binding */ __generator; },
|
|
6893
|
+
/* harmony export */ __importDefault: function() { return /* binding */ __importDefault; },
|
|
6894
|
+
/* harmony export */ __importStar: function() { return /* binding */ __importStar; },
|
|
6895
|
+
/* harmony export */ __makeTemplateObject: function() { return /* binding */ __makeTemplateObject; },
|
|
6896
|
+
/* harmony export */ __metadata: function() { return /* binding */ __metadata; },
|
|
6897
|
+
/* harmony export */ __param: function() { return /* binding */ __param; },
|
|
6898
|
+
/* harmony export */ __propKey: function() { return /* binding */ __propKey; },
|
|
6899
|
+
/* harmony export */ __read: function() { return /* binding */ __read; },
|
|
6900
|
+
/* harmony export */ __rest: function() { return /* binding */ __rest; },
|
|
6901
|
+
/* harmony export */ __runInitializers: function() { return /* binding */ __runInitializers; },
|
|
6902
|
+
/* harmony export */ __setFunctionName: function() { return /* binding */ __setFunctionName; },
|
|
6903
|
+
/* harmony export */ __spread: function() { return /* binding */ __spread; },
|
|
6904
|
+
/* harmony export */ __spreadArray: function() { return /* binding */ __spreadArray; },
|
|
6905
|
+
/* harmony export */ __spreadArrays: function() { return /* binding */ __spreadArrays; },
|
|
6906
|
+
/* harmony export */ __values: function() { return /* binding */ __values; }
|
|
6510
6907
|
/* harmony export */ });
|
|
6511
|
-
/* 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 */
|
|
6512
6908
|
/******************************************************************************
|
|
6513
6909
|
Copyright (c) Microsoft Corporation.
|
|
6514
6910
|
|
|
@@ -6858,7 +7254,7 @@ function __disposeResources(env) {
|
|
|
6858
7254
|
return next();
|
|
6859
7255
|
}
|
|
6860
7256
|
|
|
6861
|
-
/*
|
|
7257
|
+
/* harmony default export */ __webpack_exports__["default"] = ({
|
|
6862
7258
|
__extends,
|
|
6863
7259
|
__assign,
|
|
6864
7260
|
__rest,
|
|
@@ -6954,9 +7350,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6954
7350
|
/* harmony export */ Scorm12API: function() { return /* binding */ Scorm12API; },
|
|
6955
7351
|
/* harmony export */ Scorm2004API: function() { return /* binding */ Scorm2004API; }
|
|
6956
7352
|
/* harmony export */ });
|
|
6957
|
-
/* harmony import */ var _AICC__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
7353
|
+
/* harmony import */ var _AICC__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(916);
|
|
6958
7354
|
/* harmony import */ var _Scorm12API__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(941);
|
|
6959
|
-
/* harmony import */ var _Scorm2004API__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
7355
|
+
/* harmony import */ var _Scorm2004API__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(809);
|
|
6960
7356
|
|
|
6961
7357
|
|
|
6962
7358
|
|
|
@@ -6966,7 +7362,7 @@ var AICC = _AICC__WEBPACK_IMPORTED_MODULE_0__.AICCImpl;
|
|
|
6966
7362
|
|
|
6967
7363
|
|
|
6968
7364
|
var __webpack_export_target__ = this;
|
|
6969
|
-
for(var
|
|
7365
|
+
for(var __webpack_i__ in __webpack_exports__) __webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
6970
7366
|
if(__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, "__esModule", { value: true });
|
|
6971
7367
|
/******/ })()
|
|
6972
7368
|
;
|