scorm-again 2.5.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aicc.js +648 -485
- package/dist/aicc.js.map +1 -1
- package/dist/aicc.min.js +1 -1
- package/dist/aicc.min.js.map +1 -1
- package/dist/esm/aicc.js +664 -488
- package/dist/esm/aicc.js.map +1 -1
- package/dist/esm/aicc.min.js +1 -1
- package/dist/esm/aicc.min.js.map +1 -1
- package/dist/esm/scorm-again.js +1111 -729
- package/dist/esm/scorm-again.js.map +1 -1
- package/dist/esm/scorm-again.min.js +1 -1
- package/dist/esm/scorm-again.min.js.map +1 -1
- package/dist/esm/scorm12.js +506 -393
- package/dist/esm/scorm12.js.map +1 -1
- package/dist/esm/scorm12.min.js +1 -1
- package/dist/esm/scorm12.min.js.map +1 -1
- package/dist/esm/scorm2004.js +672 -451
- package/dist/esm/scorm2004.js.map +1 -1
- package/dist/esm/scorm2004.min.js +1 -1
- package/dist/esm/scorm2004.min.js.map +1 -1
- package/dist/scorm-again.js +1087 -717
- package/dist/scorm-again.js.map +1 -1
- package/dist/scorm-again.min.js +1 -1
- package/dist/scorm-again.min.js.map +1 -1
- package/dist/scorm12.js +493 -392
- package/dist/scorm12.js.map +1 -1
- package/dist/scorm12.min.js +1 -1
- package/dist/scorm12.min.js.map +1 -1
- package/dist/scorm2004.js +658 -450
- package/dist/scorm2004.js.map +1 -1
- package/dist/scorm2004.min.js +1 -1
- package/dist/scorm2004.min.js.map +1 -1
- package/package.json +14 -14
- package/src/AICC.ts +3 -0
- package/src/BaseAPI.ts +33 -30
- package/src/Scorm12API.ts +14 -14
- package/src/Scorm2004API.ts +99 -33
- package/src/cmi/aicc/attempts.ts +22 -12
- package/src/cmi/aicc/cmi.ts +2 -2
- package/src/cmi/aicc/core.ts +44 -26
- package/src/cmi/aicc/evaluation.ts +31 -12
- package/src/cmi/aicc/paths.ts +29 -15
- package/src/cmi/aicc/student_data.ts +14 -5
- package/src/cmi/aicc/student_demographics.ts +31 -24
- package/src/cmi/aicc/student_preferences.ts +11 -11
- package/src/cmi/aicc/tries.ts +24 -14
- package/src/cmi/aicc/validation.ts +3 -4
- package/src/cmi/common/array.ts +17 -5
- package/src/cmi/common/base_cmi.ts +3 -1
- package/src/cmi/common/score.ts +16 -13
- package/src/cmi/scorm12/cmi.ts +25 -10
- package/src/cmi/scorm12/interactions.ts +62 -28
- package/src/cmi/scorm12/nav.ts +13 -5
- package/src/cmi/scorm12/objectives.ts +28 -18
- package/src/cmi/scorm12/student_data.ts +15 -8
- package/src/cmi/scorm12/student_preference.ts +20 -13
- package/src/cmi/scorm12/validation.ts +7 -7
- package/src/cmi/scorm2004/adl.ts +141 -25
- package/src/cmi/scorm2004/cmi.ts +50 -55
- package/src/cmi/scorm2004/comments.ts +21 -20
- package/src/cmi/scorm2004/interactions.ts +73 -32
- package/src/cmi/scorm2004/learner_preference.ts +20 -13
- package/src/cmi/scorm2004/objectives.ts +41 -16
- package/src/cmi/scorm2004/score.ts +22 -11
- package/src/cmi/scorm2004/validation.ts +4 -4
- package/src/constants/api_constants.ts +8 -19
- package/src/constants/default_settings.ts +6 -5
- package/src/constants/error_codes.ts +5 -12
- package/src/constants/regex.ts +4 -10
- package/src/constants/response_constants.ts +1 -2
- package/src/exceptions/aicc_exceptions.ts +29 -0
- package/src/exceptions/scorm12_exceptions.ts +29 -0
- package/src/exceptions/scorm2004_exceptions.ts +29 -0
- package/src/exceptions.ts +0 -81
- package/src/types/api_types.ts +3 -2
- package/test/AICC.spec.ts +114 -43
- package/test/Scorm12API.spec.ts +37 -39
- package/test/Scorm2004API.spec.ts +165 -80
- package/test/cmi/aicc_cmi.spec.ts +6 -9
- package/test/cmi/scorm12_cmi.spec.ts +8 -8
- package/test/cmi/scorm2004_cmi.spec.ts +8 -9
- package/test/exceptions.spec.ts +11 -9
- package/test/types/api_types.spec.ts +3 -3
- package/test/utilities.spec.ts +1 -4
- package/webpack.config.js +4 -0
package/dist/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,8 +1014,6 @@ 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
|
|
@@ -969,7 +1033,7 @@ var DefaultSettings = {
|
|
|
969
1033
|
dataCommitFormat: "json",
|
|
970
1034
|
commitRequestDataType: "application/json;charset=UTF-8",
|
|
971
1035
|
autoProgress: false,
|
|
972
|
-
logLevel: enums
|
|
1036
|
+
logLevel: enums.LogLevelEnum.ERROR,
|
|
973
1037
|
selfReportSessionTime: false,
|
|
974
1038
|
alwaysSendTotalTime: false,
|
|
975
1039
|
renderCommonCommitFields: false,
|
|
@@ -978,9 +1042,9 @@ var DefaultSettings = {
|
|
|
978
1042
|
xhrWithCredentials: false,
|
|
979
1043
|
fetchMode: "cors",
|
|
980
1044
|
responseHandler: function (response) {
|
|
981
|
-
return (0,tslib_es6
|
|
1045
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
982
1046
|
var responseText, httpResult;
|
|
983
|
-
return (0,tslib_es6
|
|
1047
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
984
1048
|
switch (_a.label) {
|
|
985
1049
|
case 0:
|
|
986
1050
|
if (!(typeof response !== "undefined")) return [3, 2];
|
|
@@ -995,13 +1059,13 @@ var DefaultSettings = {
|
|
|
995
1059
|
!{}.hasOwnProperty.call(httpResult, "result")) {
|
|
996
1060
|
if (response.status === 200) {
|
|
997
1061
|
return [2, {
|
|
998
|
-
result: api_constants
|
|
1062
|
+
result: api_constants.global_constants.SCORM_TRUE,
|
|
999
1063
|
errorCode: 0,
|
|
1000
1064
|
}];
|
|
1001
1065
|
}
|
|
1002
1066
|
else {
|
|
1003
1067
|
return [2, {
|
|
1004
|
-
result: api_constants
|
|
1068
|
+
result: api_constants.global_constants.SCORM_FALSE,
|
|
1005
1069
|
errorCode: 101,
|
|
1006
1070
|
}];
|
|
1007
1071
|
}
|
|
@@ -1011,14 +1075,14 @@ var DefaultSettings = {
|
|
|
1011
1075
|
result: httpResult.result,
|
|
1012
1076
|
errorCode: httpResult.errorCode
|
|
1013
1077
|
? httpResult.errorCode
|
|
1014
|
-
: httpResult.result === api_constants
|
|
1078
|
+
: httpResult.result === api_constants.global_constants.SCORM_TRUE
|
|
1015
1079
|
? 0
|
|
1016
1080
|
: 101,
|
|
1017
1081
|
}];
|
|
1018
1082
|
}
|
|
1019
1083
|
_a.label = 2;
|
|
1020
1084
|
case 2: return [2, {
|
|
1021
|
-
result: api_constants
|
|
1085
|
+
result: api_constants.global_constants.SCORM_FALSE,
|
|
1022
1086
|
errorCode: 101,
|
|
1023
1087
|
}];
|
|
1024
1088
|
}
|
|
@@ -1033,25 +1097,25 @@ var DefaultSettings = {
|
|
|
1033
1097
|
case "4":
|
|
1034
1098
|
case 4:
|
|
1035
1099
|
case "ERROR":
|
|
1036
|
-
case enums
|
|
1100
|
+
case enums.LogLevelEnum.ERROR:
|
|
1037
1101
|
console.error(logMessage);
|
|
1038
1102
|
break;
|
|
1039
1103
|
case "3":
|
|
1040
1104
|
case 3:
|
|
1041
1105
|
case "WARN":
|
|
1042
|
-
case enums
|
|
1106
|
+
case enums.LogLevelEnum.WARN:
|
|
1043
1107
|
console.warn(logMessage);
|
|
1044
1108
|
break;
|
|
1045
1109
|
case "2":
|
|
1046
1110
|
case 2:
|
|
1047
1111
|
case "INFO":
|
|
1048
|
-
case enums
|
|
1112
|
+
case enums.LogLevelEnum.INFO:
|
|
1049
1113
|
console.info(logMessage);
|
|
1050
1114
|
break;
|
|
1051
1115
|
case "1":
|
|
1052
1116
|
case 1:
|
|
1053
1117
|
case "DEBUG":
|
|
1054
|
-
case enums
|
|
1118
|
+
case enums.LogLevelEnum.DEBUG:
|
|
1055
1119
|
if (console.debug) {
|
|
1056
1120
|
console.debug(logMessage);
|
|
1057
1121
|
}
|
|
@@ -1063,6 +1127,7 @@ var DefaultSettings = {
|
|
|
1063
1127
|
},
|
|
1064
1128
|
scoItemIds: [],
|
|
1065
1129
|
scoItemIdValidator: false,
|
|
1130
|
+
globalObjectiveIds: [],
|
|
1066
1131
|
};
|
|
1067
1132
|
|
|
1068
1133
|
;// ./src/helpers/scheduled_commit.ts
|
|
@@ -1083,7 +1148,7 @@ var ScheduledCommit = (function () {
|
|
|
1083
1148
|
ScheduledCommit.prototype.wrapper = function () {
|
|
1084
1149
|
var _this = this;
|
|
1085
1150
|
if (!this._cancelled) {
|
|
1086
|
-
(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) {
|
|
1087
1152
|
switch (_a.label) {
|
|
1088
1153
|
case 0: return [4, this._API.commit(this._callback)];
|
|
1089
1154
|
case 1: return [2, _a.sent()];
|
|
@@ -1104,7 +1169,6 @@ var ScheduledCommit = (function () {
|
|
|
1104
1169
|
|
|
1105
1170
|
|
|
1106
1171
|
|
|
1107
|
-
|
|
1108
1172
|
var BaseAPI = (function () {
|
|
1109
1173
|
function BaseAPI(error_codes, settings) {
|
|
1110
1174
|
var _newTarget = this.constructor;
|
|
@@ -1112,7 +1176,7 @@ var BaseAPI = (function () {
|
|
|
1112
1176
|
if (_newTarget === BaseAPI) {
|
|
1113
1177
|
throw new TypeError("Cannot construct BaseAPI instances directly");
|
|
1114
1178
|
}
|
|
1115
|
-
this.currentState = api_constants
|
|
1179
|
+
this.currentState = api_constants.global_constants.STATE_NOT_INITIALIZED;
|
|
1116
1180
|
this.lastErrorCode = "0";
|
|
1117
1181
|
this.listenerArray = [];
|
|
1118
1182
|
this._error_codes = error_codes;
|
|
@@ -1122,17 +1186,20 @@ var BaseAPI = (function () {
|
|
|
1122
1186
|
this.apiLogLevel = this.settings.logLevel;
|
|
1123
1187
|
this.selfReportSessionTime = this.settings.selfReportSessionTime;
|
|
1124
1188
|
if (this.apiLogLevel === undefined) {
|
|
1125
|
-
this.apiLogLevel = enums
|
|
1189
|
+
this.apiLogLevel = enums.LogLevelEnum.NONE;
|
|
1126
1190
|
}
|
|
1127
1191
|
}
|
|
1128
1192
|
BaseAPI.prototype.commonReset = function (settings) {
|
|
1129
|
-
this.
|
|
1130
|
-
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;
|
|
1131
1197
|
this.lastErrorCode = "0";
|
|
1132
1198
|
this.listenerArray = [];
|
|
1199
|
+
this.startingData = undefined;
|
|
1133
1200
|
};
|
|
1134
1201
|
BaseAPI.prototype.initialize = function (callbackName, initializeMessage, terminationMessage) {
|
|
1135
|
-
var returnValue = api_constants
|
|
1202
|
+
var returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1136
1203
|
if (this.isInitialized()) {
|
|
1137
1204
|
this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);
|
|
1138
1205
|
}
|
|
@@ -1143,17 +1210,17 @@ var BaseAPI = (function () {
|
|
|
1143
1210
|
if (this.selfReportSessionTime) {
|
|
1144
1211
|
this.cmi.setStartTime();
|
|
1145
1212
|
}
|
|
1146
|
-
this.currentState = api_constants
|
|
1213
|
+
this.currentState = api_constants.global_constants.STATE_INITIALIZED;
|
|
1147
1214
|
this.lastErrorCode = "0";
|
|
1148
|
-
returnValue = api_constants
|
|
1215
|
+
returnValue = api_constants.global_constants.SCORM_TRUE;
|
|
1149
1216
|
this.processListeners(callbackName);
|
|
1150
1217
|
}
|
|
1151
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
1218
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1152
1219
|
this.clearSCORMError(returnValue);
|
|
1153
1220
|
return returnValue;
|
|
1154
1221
|
};
|
|
1155
1222
|
BaseAPI.prototype.apiLog = function (functionName, logMessage, messageLevel, CMIElement) {
|
|
1156
|
-
logMessage = (0,utilities
|
|
1223
|
+
logMessage = (0,utilities.formatMessage)(functionName, logMessage, CMIElement);
|
|
1157
1224
|
if (messageLevel >= this.apiLogLevel) {
|
|
1158
1225
|
this.settings.onLogMessage(messageLevel, logMessage);
|
|
1159
1226
|
}
|
|
@@ -1170,20 +1237,20 @@ var BaseAPI = (function () {
|
|
|
1170
1237
|
return this._settings;
|
|
1171
1238
|
},
|
|
1172
1239
|
set: function (settings) {
|
|
1173
|
-
this._settings = (0,tslib_es6
|
|
1240
|
+
this._settings = (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, this._settings), settings);
|
|
1174
1241
|
},
|
|
1175
1242
|
enumerable: false,
|
|
1176
1243
|
configurable: true
|
|
1177
1244
|
});
|
|
1178
1245
|
BaseAPI.prototype.terminate = function (callbackName, checkTerminated) {
|
|
1179
|
-
return (0,tslib_es6
|
|
1246
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
1180
1247
|
var returnValue, result;
|
|
1181
|
-
return (0,tslib_es6
|
|
1248
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
1182
1249
|
switch (_a.label) {
|
|
1183
1250
|
case 0:
|
|
1184
|
-
returnValue = api_constants
|
|
1251
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1185
1252
|
if (!this.checkState(checkTerminated, this._error_codes.TERMINATION_BEFORE_INIT, this._error_codes.MULTIPLE_TERMINATION)) return [3, 2];
|
|
1186
|
-
this.currentState = api_constants
|
|
1253
|
+
this.currentState = api_constants.global_constants.STATE_TERMINATED;
|
|
1187
1254
|
return [4, this.storeData(true)];
|
|
1188
1255
|
case 1:
|
|
1189
1256
|
result = _a.sent();
|
|
@@ -1193,14 +1260,14 @@ var BaseAPI = (function () {
|
|
|
1193
1260
|
returnValue =
|
|
1194
1261
|
typeof result !== "undefined" && result.result
|
|
1195
1262
|
? result.result
|
|
1196
|
-
: api_constants
|
|
1263
|
+
: api_constants.global_constants.SCORM_FALSE;
|
|
1197
1264
|
if (checkTerminated)
|
|
1198
1265
|
this.lastErrorCode = "0";
|
|
1199
|
-
returnValue = api_constants
|
|
1266
|
+
returnValue = api_constants.global_constants.SCORM_TRUE;
|
|
1200
1267
|
this.processListeners(callbackName);
|
|
1201
1268
|
_a.label = 2;
|
|
1202
1269
|
case 2:
|
|
1203
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
1270
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1204
1271
|
this.clearSCORMError(returnValue);
|
|
1205
1272
|
return [2, returnValue];
|
|
1206
1273
|
}
|
|
@@ -1220,7 +1287,7 @@ var BaseAPI = (function () {
|
|
|
1220
1287
|
}
|
|
1221
1288
|
this.processListeners(callbackName, CMIElement);
|
|
1222
1289
|
}
|
|
1223
|
-
this.apiLog(callbackName, ": returned: " + returnValue, enums
|
|
1290
|
+
this.apiLog(callbackName, ": returned: " + returnValue, enums.LogLevelEnum.INFO, CMIElement);
|
|
1224
1291
|
if (returnValue === undefined) {
|
|
1225
1292
|
return "";
|
|
1226
1293
|
}
|
|
@@ -1231,7 +1298,7 @@ var BaseAPI = (function () {
|
|
|
1231
1298
|
if (value !== undefined) {
|
|
1232
1299
|
value = String(value);
|
|
1233
1300
|
}
|
|
1234
|
-
var returnValue = api_constants
|
|
1301
|
+
var returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1235
1302
|
if (this.checkState(checkTerminated, this._error_codes.STORE_BEFORE_INIT, this._error_codes.STORE_AFTER_TERM)) {
|
|
1236
1303
|
if (checkTerminated)
|
|
1237
1304
|
this.lastErrorCode = "0";
|
|
@@ -1244,26 +1311,26 @@ var BaseAPI = (function () {
|
|
|
1244
1311
|
this.processListeners(callbackName, CMIElement, value);
|
|
1245
1312
|
}
|
|
1246
1313
|
if (returnValue === undefined) {
|
|
1247
|
-
returnValue = api_constants
|
|
1314
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1248
1315
|
}
|
|
1249
1316
|
if (String(this.lastErrorCode) === "0") {
|
|
1250
1317
|
if (this.settings.autocommit) {
|
|
1251
1318
|
this.scheduleCommit(this.settings.autocommitSeconds * 1000, commitCallback);
|
|
1252
1319
|
}
|
|
1253
1320
|
}
|
|
1254
|
-
this.apiLog(callbackName, ": " + value + ": result: " + returnValue, enums
|
|
1321
|
+
this.apiLog(callbackName, ": " + value + ": result: " + returnValue, enums.LogLevelEnum.INFO, CMIElement);
|
|
1255
1322
|
this.clearSCORMError(returnValue);
|
|
1256
1323
|
return returnValue;
|
|
1257
1324
|
};
|
|
1258
1325
|
BaseAPI.prototype.commit = function (callbackName_1) {
|
|
1259
|
-
return (0,tslib_es6
|
|
1326
|
+
return (0,tslib_es6.__awaiter)(this, arguments, void 0, function (callbackName, checkTerminated) {
|
|
1260
1327
|
var returnValue, result;
|
|
1261
1328
|
if (checkTerminated === void 0) { checkTerminated = false; }
|
|
1262
|
-
return (0,tslib_es6
|
|
1329
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
1263
1330
|
switch (_a.label) {
|
|
1264
1331
|
case 0:
|
|
1265
1332
|
this.clearScheduledCommit();
|
|
1266
|
-
returnValue = api_constants
|
|
1333
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1267
1334
|
if (!this.checkState(checkTerminated, this._error_codes.COMMIT_BEFORE_INIT, this._error_codes.COMMIT_AFTER_TERM)) return [3, 2];
|
|
1268
1335
|
return [4, this.storeData(false)];
|
|
1269
1336
|
case 1:
|
|
@@ -1274,14 +1341,14 @@ var BaseAPI = (function () {
|
|
|
1274
1341
|
returnValue =
|
|
1275
1342
|
typeof result !== "undefined" && result.result
|
|
1276
1343
|
? result.result
|
|
1277
|
-
: api_constants
|
|
1278
|
-
this.apiLog(callbackName, " Result: " + returnValue, enums
|
|
1344
|
+
: api_constants.global_constants.SCORM_FALSE;
|
|
1345
|
+
this.apiLog(callbackName, " Result: " + returnValue, enums.LogLevelEnum.DEBUG, "HttpRequest");
|
|
1279
1346
|
if (checkTerminated)
|
|
1280
1347
|
this.lastErrorCode = "0";
|
|
1281
1348
|
this.processListeners(callbackName);
|
|
1282
1349
|
_a.label = 2;
|
|
1283
1350
|
case 2:
|
|
1284
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
1351
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1285
1352
|
this.clearSCORMError(returnValue);
|
|
1286
1353
|
return [2, returnValue];
|
|
1287
1354
|
}
|
|
@@ -1291,7 +1358,7 @@ var BaseAPI = (function () {
|
|
|
1291
1358
|
BaseAPI.prototype.getLastError = function (callbackName) {
|
|
1292
1359
|
var returnValue = String(this.lastErrorCode);
|
|
1293
1360
|
this.processListeners(callbackName);
|
|
1294
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
1361
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1295
1362
|
return returnValue;
|
|
1296
1363
|
};
|
|
1297
1364
|
BaseAPI.prototype.getErrorString = function (callbackName, CMIErrorCode) {
|
|
@@ -1300,7 +1367,7 @@ var BaseAPI = (function () {
|
|
|
1300
1367
|
returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);
|
|
1301
1368
|
this.processListeners(callbackName);
|
|
1302
1369
|
}
|
|
1303
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
1370
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1304
1371
|
return returnValue;
|
|
1305
1372
|
};
|
|
1306
1373
|
BaseAPI.prototype.getDiagnostic = function (callbackName, CMIErrorCode) {
|
|
@@ -1309,7 +1376,7 @@ var BaseAPI = (function () {
|
|
|
1309
1376
|
returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);
|
|
1310
1377
|
this.processListeners(callbackName);
|
|
1311
1378
|
}
|
|
1312
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
1379
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1313
1380
|
return returnValue;
|
|
1314
1381
|
};
|
|
1315
1382
|
BaseAPI.prototype.checkState = function (checkTerminated, beforeInitError, afterTermError) {
|
|
@@ -1335,11 +1402,11 @@ var BaseAPI = (function () {
|
|
|
1335
1402
|
};
|
|
1336
1403
|
BaseAPI.prototype._commonSetCMIValue = function (methodName, scorm2004, CMIElement, value) {
|
|
1337
1404
|
if (!CMIElement || CMIElement === "") {
|
|
1338
|
-
return api_constants
|
|
1405
|
+
return api_constants.global_constants.SCORM_FALSE;
|
|
1339
1406
|
}
|
|
1340
1407
|
var structure = CMIElement.split(".");
|
|
1341
1408
|
var refObject = this;
|
|
1342
|
-
var returnValue = api_constants
|
|
1409
|
+
var returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1343
1410
|
var foundFirstIndex = false;
|
|
1344
1411
|
var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element.");
|
|
1345
1412
|
var invalidErrorCode = scorm2004
|
|
@@ -1353,20 +1420,20 @@ var BaseAPI = (function () {
|
|
|
1353
1420
|
this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);
|
|
1354
1421
|
}
|
|
1355
1422
|
else {
|
|
1356
|
-
refObject = (0,tslib_es6
|
|
1423
|
+
refObject = (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, refObject), { attribute: value });
|
|
1357
1424
|
}
|
|
1358
1425
|
}
|
|
1359
1426
|
else if (!this._checkObjectHasProperty(refObject, attribute)) {
|
|
1360
1427
|
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
1361
1428
|
}
|
|
1362
1429
|
else {
|
|
1363
|
-
if ((0,utilities
|
|
1430
|
+
if ((0,utilities.stringMatches)(CMIElement, "\\.correct_responses\\.\\d+") &&
|
|
1364
1431
|
this.isInitialized()) {
|
|
1365
1432
|
this.validateCorrectResponse(CMIElement, value);
|
|
1366
1433
|
}
|
|
1367
1434
|
if (!scorm2004 || this.lastErrorCode === "0") {
|
|
1368
1435
|
refObject[attribute] = value;
|
|
1369
|
-
returnValue = api_constants
|
|
1436
|
+
returnValue = api_constants.global_constants.SCORM_TRUE;
|
|
1370
1437
|
}
|
|
1371
1438
|
}
|
|
1372
1439
|
}
|
|
@@ -1376,7 +1443,7 @@ var BaseAPI = (function () {
|
|
|
1376
1443
|
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
1377
1444
|
break;
|
|
1378
1445
|
}
|
|
1379
|
-
if (refObject instanceof array
|
|
1446
|
+
if (refObject instanceof array.CMIArray) {
|
|
1380
1447
|
var index = parseInt(structure[idx + 1], 10);
|
|
1381
1448
|
if (!isNaN(index)) {
|
|
1382
1449
|
var item = refObject.childArray[index];
|
|
@@ -1402,8 +1469,8 @@ var BaseAPI = (function () {
|
|
|
1402
1469
|
}
|
|
1403
1470
|
}
|
|
1404
1471
|
}
|
|
1405
|
-
if (returnValue === api_constants
|
|
1406
|
-
this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value), enums
|
|
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);
|
|
1407
1474
|
}
|
|
1408
1475
|
return returnValue;
|
|
1409
1476
|
};
|
|
@@ -1445,7 +1512,7 @@ var BaseAPI = (function () {
|
|
|
1445
1512
|
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
1446
1513
|
break;
|
|
1447
1514
|
}
|
|
1448
|
-
if (refObject instanceof array
|
|
1515
|
+
if (refObject instanceof array.CMIArray) {
|
|
1449
1516
|
var index = parseInt(structure[idx + 1], 10);
|
|
1450
1517
|
if (!isNaN(index)) {
|
|
1451
1518
|
var item = refObject.childArray[index];
|
|
@@ -1463,10 +1530,10 @@ var BaseAPI = (function () {
|
|
|
1463
1530
|
if (refObject === null || refObject === undefined) {
|
|
1464
1531
|
if (!scorm2004) {
|
|
1465
1532
|
if (attribute === "_children") {
|
|
1466
|
-
this.throwSCORMError(
|
|
1533
|
+
this.throwSCORMError(this._error_codes.CHILDREN_ERROR);
|
|
1467
1534
|
}
|
|
1468
1535
|
else if (attribute === "_count") {
|
|
1469
|
-
this.throwSCORMError(
|
|
1536
|
+
this.throwSCORMError(this._error_codes.COUNT_ERROR);
|
|
1470
1537
|
}
|
|
1471
1538
|
}
|
|
1472
1539
|
}
|
|
@@ -1475,13 +1542,13 @@ var BaseAPI = (function () {
|
|
|
1475
1542
|
}
|
|
1476
1543
|
};
|
|
1477
1544
|
BaseAPI.prototype.isInitialized = function () {
|
|
1478
|
-
return this.currentState === api_constants
|
|
1545
|
+
return this.currentState === api_constants.global_constants.STATE_INITIALIZED;
|
|
1479
1546
|
};
|
|
1480
1547
|
BaseAPI.prototype.isNotInitialized = function () {
|
|
1481
|
-
return this.currentState === api_constants
|
|
1548
|
+
return this.currentState === api_constants.global_constants.STATE_NOT_INITIALIZED;
|
|
1482
1549
|
};
|
|
1483
1550
|
BaseAPI.prototype.isTerminated = function () {
|
|
1484
|
-
return this.currentState === api_constants
|
|
1551
|
+
return this.currentState === api_constants.global_constants.STATE_TERMINATED;
|
|
1485
1552
|
};
|
|
1486
1553
|
BaseAPI.prototype.on = function (listenerName, callback) {
|
|
1487
1554
|
if (!callback)
|
|
@@ -1501,7 +1568,7 @@ var BaseAPI = (function () {
|
|
|
1501
1568
|
CMIElement: CMIElement,
|
|
1502
1569
|
callback: callback,
|
|
1503
1570
|
});
|
|
1504
|
-
this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), enums
|
|
1571
|
+
this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), enums.LogLevelEnum.INFO, functionName);
|
|
1505
1572
|
}
|
|
1506
1573
|
};
|
|
1507
1574
|
BaseAPI.prototype.off = function (listenerName, callback) {
|
|
@@ -1524,7 +1591,7 @@ var BaseAPI = (function () {
|
|
|
1524
1591
|
});
|
|
1525
1592
|
if (removeIndex !== -1) {
|
|
1526
1593
|
this_1.listenerArray.splice(removeIndex, 1);
|
|
1527
|
-
this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), enums
|
|
1594
|
+
this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), enums.LogLevelEnum.INFO, functionName);
|
|
1528
1595
|
}
|
|
1529
1596
|
};
|
|
1530
1597
|
var this_1 = this;
|
|
@@ -1557,7 +1624,7 @@ var BaseAPI = (function () {
|
|
|
1557
1624
|
}
|
|
1558
1625
|
};
|
|
1559
1626
|
BaseAPI.prototype.processListeners = function (functionName, CMIElement, value) {
|
|
1560
|
-
this.apiLog(functionName, value, enums
|
|
1627
|
+
this.apiLog(functionName, value, enums.LogLevelEnum.INFO, CMIElement);
|
|
1561
1628
|
for (var i = 0; i < this.listenerArray.length; i++) {
|
|
1562
1629
|
var listener = this.listenerArray[i];
|
|
1563
1630
|
var functionsMatch = listener.functionName === functionName;
|
|
@@ -1573,7 +1640,7 @@ var BaseAPI = (function () {
|
|
|
1573
1640
|
CMIElementsMatch = listener.CMIElement === CMIElement;
|
|
1574
1641
|
}
|
|
1575
1642
|
if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {
|
|
1576
|
-
this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), enums
|
|
1643
|
+
this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), enums.LogLevelEnum.INFO, CMIElement);
|
|
1577
1644
|
listener.callback(CMIElement, value);
|
|
1578
1645
|
}
|
|
1579
1646
|
}
|
|
@@ -1582,11 +1649,11 @@ var BaseAPI = (function () {
|
|
|
1582
1649
|
if (!message) {
|
|
1583
1650
|
message = this.getLmsErrorMessageDetails(errorNumber);
|
|
1584
1651
|
}
|
|
1585
|
-
this.apiLog("throwSCORMError", errorNumber + ": " + message, enums
|
|
1652
|
+
this.apiLog("throwSCORMError", errorNumber + ": " + message, enums.LogLevelEnum.ERROR);
|
|
1586
1653
|
this.lastErrorCode = String(errorNumber);
|
|
1587
1654
|
};
|
|
1588
1655
|
BaseAPI.prototype.clearSCORMError = function (success) {
|
|
1589
|
-
if (success !== undefined && success !== api_constants
|
|
1656
|
+
if (success !== undefined && success !== api_constants.global_constants.SCORM_FALSE) {
|
|
1590
1657
|
this.lastErrorCode = "0";
|
|
1591
1658
|
}
|
|
1592
1659
|
};
|
|
@@ -1652,7 +1719,7 @@ var BaseAPI = (function () {
|
|
|
1652
1719
|
result.forEach(function (element) {
|
|
1653
1720
|
obj = {};
|
|
1654
1721
|
obj[element[0]] = element[1];
|
|
1655
|
-
_this.loadFromJSON((0,utilities
|
|
1722
|
+
_this.loadFromJSON((0,utilities.unflatten)(obj), CMIElement);
|
|
1656
1723
|
});
|
|
1657
1724
|
};
|
|
1658
1725
|
BaseAPI.prototype.loadFromJSON = function (json, CMIElement) {
|
|
@@ -1692,21 +1759,21 @@ var BaseAPI = (function () {
|
|
|
1692
1759
|
return JSON.parse(this.renderCMIToJSONString());
|
|
1693
1760
|
};
|
|
1694
1761
|
BaseAPI.prototype.processHttpRequest = function (url_1, params_1) {
|
|
1695
|
-
return (0,tslib_es6
|
|
1762
|
+
return (0,tslib_es6.__awaiter)(this, arguments, void 0, function (url, params, immediate) {
|
|
1696
1763
|
var api, genericError, process;
|
|
1697
1764
|
var _this = this;
|
|
1698
1765
|
if (immediate === void 0) { immediate = false; }
|
|
1699
|
-
return (0,tslib_es6
|
|
1766
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
1700
1767
|
switch (_a.label) {
|
|
1701
1768
|
case 0:
|
|
1702
1769
|
api = this;
|
|
1703
1770
|
genericError = {
|
|
1704
|
-
result: api_constants
|
|
1771
|
+
result: api_constants.global_constants.SCORM_FALSE,
|
|
1705
1772
|
errorCode: this.error_codes.GENERAL,
|
|
1706
1773
|
};
|
|
1707
1774
|
if (immediate) {
|
|
1708
|
-
this.performFetch(url, params).then(function (response) { return (0,tslib_es6
|
|
1709
|
-
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) {
|
|
1710
1777
|
switch (_a.label) {
|
|
1711
1778
|
case 0: return [4, this.transformResponse(response)];
|
|
1712
1779
|
case 1:
|
|
@@ -1716,13 +1783,13 @@ var BaseAPI = (function () {
|
|
|
1716
1783
|
});
|
|
1717
1784
|
}); });
|
|
1718
1785
|
return [2, {
|
|
1719
|
-
result: api_constants
|
|
1786
|
+
result: api_constants.global_constants.SCORM_TRUE,
|
|
1720
1787
|
errorCode: 0,
|
|
1721
1788
|
}];
|
|
1722
1789
|
}
|
|
1723
|
-
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 () {
|
|
1724
1791
|
var response, e_1;
|
|
1725
|
-
return (0,tslib_es6
|
|
1792
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
1726
1793
|
switch (_a.label) {
|
|
1727
1794
|
case 0:
|
|
1728
1795
|
_a.trys.push([0, 2, , 3]);
|
|
@@ -1733,7 +1800,7 @@ var BaseAPI = (function () {
|
|
|
1733
1800
|
return [2, this.transformResponse(response)];
|
|
1734
1801
|
case 2:
|
|
1735
1802
|
e_1 = _a.sent();
|
|
1736
|
-
this.apiLog("processHttpRequest", e_1, enums
|
|
1803
|
+
this.apiLog("processHttpRequest", e_1, enums.LogLevelEnum.ERROR);
|
|
1737
1804
|
api.processListeners("CommitError");
|
|
1738
1805
|
return [2, genericError];
|
|
1739
1806
|
case 3: return [2];
|
|
@@ -1749,14 +1816,14 @@ var BaseAPI = (function () {
|
|
|
1749
1816
|
BaseAPI.prototype.scheduleCommit = function (when, callback) {
|
|
1750
1817
|
if (!this._timeout) {
|
|
1751
1818
|
this._timeout = new ScheduledCommit(this, when, callback);
|
|
1752
|
-
this.apiLog("scheduleCommit", "scheduled", enums
|
|
1819
|
+
this.apiLog("scheduleCommit", "scheduled", enums.LogLevelEnum.DEBUG, "");
|
|
1753
1820
|
}
|
|
1754
1821
|
};
|
|
1755
1822
|
BaseAPI.prototype.clearScheduledCommit = function () {
|
|
1756
1823
|
if (this._timeout) {
|
|
1757
1824
|
this._timeout.cancel();
|
|
1758
1825
|
this._timeout = undefined;
|
|
1759
|
-
this.apiLog("clearScheduledCommit", "cleared", enums
|
|
1826
|
+
this.apiLog("clearScheduledCommit", "cleared", enums.LogLevelEnum.DEBUG, "");
|
|
1760
1827
|
}
|
|
1761
1828
|
};
|
|
1762
1829
|
BaseAPI.prototype._checkObjectHasProperty = function (refObject, attribute) {
|
|
@@ -1765,9 +1832,9 @@ var BaseAPI = (function () {
|
|
|
1765
1832
|
attribute in refObject);
|
|
1766
1833
|
};
|
|
1767
1834
|
BaseAPI.prototype.handleValueAccessException = function (e, returnValue) {
|
|
1768
|
-
if (e instanceof exceptions
|
|
1835
|
+
if (e instanceof exceptions.ValidationError) {
|
|
1769
1836
|
this.lastErrorCode = String(e.errorCode);
|
|
1770
|
-
returnValue = api_constants
|
|
1837
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1771
1838
|
}
|
|
1772
1839
|
else {
|
|
1773
1840
|
if (e instanceof Error && e.message) {
|
|
@@ -1785,20 +1852,20 @@ var BaseAPI = (function () {
|
|
|
1785
1852
|
var commitObject = this.settings.renderCommonCommitFields
|
|
1786
1853
|
? this.renderCommitObject(shouldTerminateCommit)
|
|
1787
1854
|
: this.renderCommitCMI(shouldTerminateCommit);
|
|
1788
|
-
if ([enums
|
|
1855
|
+
if ([enums.LogLevelEnum.DEBUG, "1", 1, "DEBUG"].includes(this.apiLogLevel)) {
|
|
1789
1856
|
console.debug("Commit (terminated: " + (terminateCommit ? "yes" : "no") + "): ");
|
|
1790
1857
|
console.debug(commitObject);
|
|
1791
1858
|
}
|
|
1792
1859
|
return commitObject;
|
|
1793
1860
|
};
|
|
1794
1861
|
BaseAPI.prototype.performFetch = function (url, params) {
|
|
1795
|
-
return (0,tslib_es6
|
|
1796
|
-
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) {
|
|
1797
1864
|
return [2, fetch(url, {
|
|
1798
1865
|
method: "POST",
|
|
1799
1866
|
mode: this.settings.fetchMode,
|
|
1800
1867
|
body: params instanceof Array ? params.join("&") : JSON.stringify(params),
|
|
1801
|
-
headers: (0,tslib_es6
|
|
1868
|
+
headers: (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, this.settings.xhrHeaders), { "Content-Type": this.settings.commitRequestDataType }),
|
|
1802
1869
|
credentials: this.settings.xhrWithCredentials ? "include" : undefined,
|
|
1803
1870
|
keepalive: true,
|
|
1804
1871
|
})];
|
|
@@ -1806,9 +1873,9 @@ var BaseAPI = (function () {
|
|
|
1806
1873
|
});
|
|
1807
1874
|
};
|
|
1808
1875
|
BaseAPI.prototype.transformResponse = function (response) {
|
|
1809
|
-
return (0,tslib_es6
|
|
1876
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
1810
1877
|
var result, _a;
|
|
1811
|
-
return (0,tslib_es6
|
|
1878
|
+
return (0,tslib_es6.__generator)(this, function (_c) {
|
|
1812
1879
|
switch (_c.label) {
|
|
1813
1880
|
case 0:
|
|
1814
1881
|
if (!(typeof this.settings.responseHandler === "function")) return [3, 2];
|
|
@@ -1824,8 +1891,7 @@ var BaseAPI = (function () {
|
|
|
1824
1891
|
result = _a;
|
|
1825
1892
|
if (response.status >= 200 &&
|
|
1826
1893
|
response.status <= 299 &&
|
|
1827
|
-
(result.result === true ||
|
|
1828
|
-
result.result === api_constants/* default */.A.global.SCORM_TRUE)) {
|
|
1894
|
+
(result.result === true || result.result === api_constants.global_constants.SCORM_TRUE)) {
|
|
1829
1895
|
this.processListeners("CommitSuccess");
|
|
1830
1896
|
}
|
|
1831
1897
|
else {
|
|
@@ -1846,6 +1912,7 @@ var BaseAPI = (function () {
|
|
|
1846
1912
|
/***/ 941:
|
|
1847
1913
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1848
1914
|
|
|
1915
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1849
1916
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1850
1917
|
/* harmony export */ Scorm12Impl: function() { return /* binding */ Scorm12Impl; }
|
|
1851
1918
|
/* harmony export */ });
|
|
@@ -1857,9 +1924,9 @@ var BaseAPI = (function () {
|
|
|
1857
1924
|
/* harmony import */ var _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(176);
|
|
1858
1925
|
/* harmony import */ var _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(833);
|
|
1859
1926
|
/* harmony import */ var _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(331);
|
|
1860
|
-
/* harmony import */ var
|
|
1861
|
-
/* harmony import */ var
|
|
1862
|
-
/* 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);
|
|
1863
1930
|
|
|
1864
1931
|
|
|
1865
1932
|
|
|
@@ -1873,7 +1940,7 @@ var BaseAPI = (function () {
|
|
|
1873
1940
|
|
|
1874
1941
|
|
|
1875
1942
|
var Scorm12Impl = (function (_super) {
|
|
1876
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1943
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_10__.__extends)(Scorm12Impl, _super);
|
|
1877
1944
|
function Scorm12Impl(settings) {
|
|
1878
1945
|
var _this = this;
|
|
1879
1946
|
if (settings) {
|
|
@@ -1881,10 +1948,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
1881
1948
|
settings.mastery_override = false;
|
|
1882
1949
|
}
|
|
1883
1950
|
}
|
|
1884
|
-
_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;
|
|
1885
1952
|
_this.statusSetByModule = false;
|
|
1886
|
-
_this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
1887
|
-
_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();
|
|
1888
1955
|
_this.LMSInitialize = _this.lmsInitialize;
|
|
1889
1956
|
_this.LMSFinish = _this.lmsFinish;
|
|
1890
1957
|
_this.LMSGetValue = _this.lmsGetValue;
|
|
@@ -1896,9 +1963,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
1896
1963
|
return _this;
|
|
1897
1964
|
}
|
|
1898
1965
|
Scorm12Impl.prototype.reset = function (settings) {
|
|
1966
|
+
var _a, _b;
|
|
1899
1967
|
this.commonReset(settings);
|
|
1900
|
-
this.cmi
|
|
1901
|
-
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();
|
|
1902
1970
|
};
|
|
1903
1971
|
Scorm12Impl.prototype.lmsInitialize = function () {
|
|
1904
1972
|
this.cmi.initialize();
|
|
@@ -1912,8 +1980,8 @@ var Scorm12Impl = (function (_super) {
|
|
|
1912
1980
|
};
|
|
1913
1981
|
Scorm12Impl.prototype.lmsFinish = function () {
|
|
1914
1982
|
var _this = this;
|
|
1915
|
-
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1916
|
-
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) {
|
|
1917
1985
|
switch (_a.label) {
|
|
1918
1986
|
case 0: return [4, this.internalFinish()];
|
|
1919
1987
|
case 1:
|
|
@@ -1922,17 +1990,17 @@ var Scorm12Impl = (function (_super) {
|
|
|
1922
1990
|
}
|
|
1923
1991
|
});
|
|
1924
1992
|
}); })();
|
|
1925
|
-
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
1993
|
+
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE;
|
|
1926
1994
|
};
|
|
1927
1995
|
Scorm12Impl.prototype.internalFinish = function () {
|
|
1928
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1996
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(this, void 0, void 0, function () {
|
|
1929
1997
|
var result;
|
|
1930
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1998
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_a) {
|
|
1931
1999
|
switch (_a.label) {
|
|
1932
2000
|
case 0: return [4, this.terminate("LMSFinish", true)];
|
|
1933
2001
|
case 1:
|
|
1934
2002
|
result = _a.sent();
|
|
1935
|
-
if (result === _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2003
|
+
if (result === _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE) {
|
|
1936
2004
|
if (this.nav.event !== "") {
|
|
1937
2005
|
if (this.nav.event === "continue") {
|
|
1938
2006
|
this.processListeners("SequenceNext");
|
|
@@ -1965,8 +2033,8 @@ var Scorm12Impl = (function (_super) {
|
|
|
1965
2033
|
this.scheduleCommit(500, "LMSCommit");
|
|
1966
2034
|
}
|
|
1967
2035
|
else {
|
|
1968
|
-
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1969
|
-
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) {
|
|
1970
2038
|
switch (_a.label) {
|
|
1971
2039
|
case 0: return [4, this.commit("LMSCommit", false)];
|
|
1972
2040
|
case 1:
|
|
@@ -1976,7 +2044,7 @@ var Scorm12Impl = (function (_super) {
|
|
|
1976
2044
|
});
|
|
1977
2045
|
}); })();
|
|
1978
2046
|
}
|
|
1979
|
-
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2047
|
+
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE;
|
|
1980
2048
|
};
|
|
1981
2049
|
Scorm12Impl.prototype.lmsGetLastError = function () {
|
|
1982
2050
|
return this.getLastError("LMSGetLastError");
|
|
@@ -1994,20 +2062,20 @@ var Scorm12Impl = (function (_super) {
|
|
|
1994
2062
|
return this._commonGetCMIValue("getCMIValue", false, CMIElement);
|
|
1995
2063
|
};
|
|
1996
2064
|
Scorm12Impl.prototype.getChildElement = function (CMIElement, _value, foundFirstIndex) {
|
|
1997
|
-
if ((0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
1998
|
-
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();
|
|
1999
2067
|
}
|
|
2000
2068
|
else if (foundFirstIndex &&
|
|
2001
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
2002
|
-
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();
|
|
2003
2071
|
}
|
|
2004
2072
|
else if (foundFirstIndex &&
|
|
2005
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
2006
|
-
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();
|
|
2007
2075
|
}
|
|
2008
2076
|
else if (!foundFirstIndex &&
|
|
2009
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
2010
|
-
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();
|
|
2011
2079
|
}
|
|
2012
2080
|
return null;
|
|
2013
2081
|
};
|
|
@@ -2017,11 +2085,11 @@ var Scorm12Impl = (function (_super) {
|
|
|
2017
2085
|
var basicMessage = "No Error";
|
|
2018
2086
|
var detailMessage = "No Error";
|
|
2019
2087
|
errorNumber = String(errorNumber);
|
|
2020
|
-
if (_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2088
|
+
if (_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber]) {
|
|
2021
2089
|
basicMessage =
|
|
2022
|
-
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2090
|
+
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber].basicMessage;
|
|
2023
2091
|
detailMessage =
|
|
2024
|
-
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2092
|
+
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber].detailMessage;
|
|
2025
2093
|
}
|
|
2026
2094
|
return detail ? detailMessage : basicMessage;
|
|
2027
2095
|
};
|
|
@@ -2034,10 +2102,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
2034
2102
|
cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();
|
|
2035
2103
|
}
|
|
2036
2104
|
var result = [];
|
|
2037
|
-
var flattened = _utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
2105
|
+
var flattened = _utilities__WEBPACK_IMPORTED_MODULE_1__.flatten(cmiExport);
|
|
2038
2106
|
switch (this.settings.dataCommitFormat) {
|
|
2039
2107
|
case "flattened":
|
|
2040
|
-
return _utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
2108
|
+
return _utilities__WEBPACK_IMPORTED_MODULE_1__.flatten(cmiExport);
|
|
2041
2109
|
case "params":
|
|
2042
2110
|
for (var item in flattened) {
|
|
2043
2111
|
if ({}.hasOwnProperty.call(flattened, item)) {
|
|
@@ -2053,20 +2121,20 @@ var Scorm12Impl = (function (_super) {
|
|
|
2053
2121
|
Scorm12Impl.prototype.renderCommitObject = function (terminateCommit) {
|
|
2054
2122
|
var cmiExport = this.renderCommitCMI(terminateCommit);
|
|
2055
2123
|
var totalTimeHHMMSS = this.cmi.getCurrentTotalTime();
|
|
2056
|
-
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);
|
|
2057
2125
|
var lessonStatus = this.cmi.core.lesson_status;
|
|
2058
|
-
var completionStatus =
|
|
2059
|
-
var successStatus =
|
|
2126
|
+
var completionStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.unknown;
|
|
2127
|
+
var successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.unknown;
|
|
2060
2128
|
if (lessonStatus) {
|
|
2061
2129
|
completionStatus =
|
|
2062
2130
|
lessonStatus === "completed" || lessonStatus === "passed"
|
|
2063
|
-
?
|
|
2064
|
-
:
|
|
2131
|
+
? _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.completed
|
|
2132
|
+
: _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.incomplete;
|
|
2065
2133
|
if (lessonStatus === "passed") {
|
|
2066
|
-
successStatus =
|
|
2134
|
+
successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.passed;
|
|
2067
2135
|
}
|
|
2068
2136
|
else if (lessonStatus === "failed") {
|
|
2069
|
-
successStatus =
|
|
2137
|
+
successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.failed;
|
|
2070
2138
|
}
|
|
2071
2139
|
}
|
|
2072
2140
|
var score = this.cmi.core.score;
|
|
@@ -2095,10 +2163,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
2095
2163
|
return commitObject;
|
|
2096
2164
|
};
|
|
2097
2165
|
Scorm12Impl.prototype.storeData = function (terminateCommit) {
|
|
2098
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
2166
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(this, void 0, void 0, function () {
|
|
2099
2167
|
var originalStatus, commitObject;
|
|
2100
2168
|
var _a, _b, _c;
|
|
2101
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
2169
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_d) {
|
|
2102
2170
|
switch (_d.label) {
|
|
2103
2171
|
case 0:
|
|
2104
2172
|
if (terminateCommit) {
|
|
@@ -2133,7 +2201,7 @@ var Scorm12Impl = (function (_super) {
|
|
|
2133
2201
|
return [4, this.processHttpRequest(this.settings.lmsCommitUrl, commitObject, terminateCommit)];
|
|
2134
2202
|
case 1: return [2, _d.sent()];
|
|
2135
2203
|
case 2: return [2, {
|
|
2136
|
-
result: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2204
|
+
result: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE,
|
|
2137
2205
|
errorCode: 0,
|
|
2138
2206
|
}];
|
|
2139
2207
|
}
|
|
@@ -2141,15 +2209,17 @@ var Scorm12Impl = (function (_super) {
|
|
|
2141
2209
|
});
|
|
2142
2210
|
};
|
|
2143
2211
|
return Scorm12Impl;
|
|
2144
|
-
}(
|
|
2212
|
+
}(_BaseAPI__WEBPACK_IMPORTED_MODULE_8__["default"]));
|
|
2145
2213
|
|
|
2146
2214
|
|
|
2147
2215
|
|
|
2148
2216
|
/***/ }),
|
|
2149
2217
|
|
|
2150
|
-
/***/
|
|
2218
|
+
/***/ 809:
|
|
2151
2219
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2152
2220
|
|
|
2221
|
+
// ESM COMPAT FLAG
|
|
2222
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2153
2223
|
|
|
2154
2224
|
// EXPORTS
|
|
2155
2225
|
__webpack_require__.d(__webpack_exports__, {
|
|
@@ -2168,6 +2238,27 @@ var regex = __webpack_require__(417);
|
|
|
2168
2238
|
var error_codes = __webpack_require__(797);
|
|
2169
2239
|
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
2170
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
|
+
|
|
2171
2262
|
// EXTERNAL MODULE: ./src/utilities.ts
|
|
2172
2263
|
var utilities = __webpack_require__(864);
|
|
2173
2264
|
// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts
|
|
@@ -2179,10 +2270,10 @@ var validation = __webpack_require__(449);
|
|
|
2179
2270
|
|
|
2180
2271
|
|
|
2181
2272
|
function check2004ValidFormat(value, regexPattern, allowEmptyString) {
|
|
2182
|
-
return (0,validation
|
|
2273
|
+
return (0,validation.checkValidFormat)(value, regexPattern, error_codes.scorm2004_errors.TYPE_MISMATCH, Scorm2004ValidationError, allowEmptyString);
|
|
2183
2274
|
}
|
|
2184
2275
|
function check2004ValidRange(value, rangePattern) {
|
|
2185
|
-
return (0,validation
|
|
2276
|
+
return (0,validation.checkValidRange)(value, rangePattern, error_codes.scorm2004_errors.VALUE_OUT_OF_RANGE, Scorm2004ValidationError);
|
|
2186
2277
|
}
|
|
2187
2278
|
|
|
2188
2279
|
;// ./src/cmi/scorm2004/learner_preference.ts
|
|
@@ -2194,22 +2285,25 @@ function check2004ValidRange(value, rangePattern) {
|
|
|
2194
2285
|
|
|
2195
2286
|
|
|
2196
2287
|
var CMILearnerPreference = (function (_super) {
|
|
2197
|
-
(0,tslib_es6
|
|
2288
|
+
(0,tslib_es6.__extends)(CMILearnerPreference, _super);
|
|
2198
2289
|
function CMILearnerPreference() {
|
|
2199
2290
|
var _this = _super.call(this) || this;
|
|
2200
|
-
_this.__children = api_constants
|
|
2291
|
+
_this.__children = api_constants.scorm2004_constants.student_preference_children;
|
|
2201
2292
|
_this._audio_level = "1";
|
|
2202
2293
|
_this._language = "";
|
|
2203
2294
|
_this._delivery_speed = "1";
|
|
2204
2295
|
_this._audio_captioning = "0";
|
|
2205
2296
|
return _this;
|
|
2206
2297
|
}
|
|
2298
|
+
CMILearnerPreference.prototype.reset = function () {
|
|
2299
|
+
this._initialized = false;
|
|
2300
|
+
};
|
|
2207
2301
|
Object.defineProperty(CMILearnerPreference.prototype, "_children", {
|
|
2208
2302
|
get: function () {
|
|
2209
2303
|
return this.__children;
|
|
2210
2304
|
},
|
|
2211
2305
|
set: function (_children) {
|
|
2212
|
-
throw new
|
|
2306
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
2213
2307
|
},
|
|
2214
2308
|
enumerable: false,
|
|
2215
2309
|
configurable: true
|
|
@@ -2219,8 +2313,8 @@ var CMILearnerPreference = (function (_super) {
|
|
|
2219
2313
|
return this._audio_level;
|
|
2220
2314
|
},
|
|
2221
2315
|
set: function (audio_level) {
|
|
2222
|
-
if (check2004ValidFormat(audio_level, regex
|
|
2223
|
-
check2004ValidRange(audio_level, regex
|
|
2316
|
+
if (check2004ValidFormat(audio_level, regex.scorm2004_regex.CMIDecimal) &&
|
|
2317
|
+
check2004ValidRange(audio_level, regex.scorm2004_regex.audio_range)) {
|
|
2224
2318
|
this._audio_level = audio_level;
|
|
2225
2319
|
}
|
|
2226
2320
|
},
|
|
@@ -2232,7 +2326,7 @@ var CMILearnerPreference = (function (_super) {
|
|
|
2232
2326
|
return this._language;
|
|
2233
2327
|
},
|
|
2234
2328
|
set: function (language) {
|
|
2235
|
-
if (check2004ValidFormat(language, regex
|
|
2329
|
+
if (check2004ValidFormat(language, regex.scorm2004_regex.CMILang)) {
|
|
2236
2330
|
this._language = language;
|
|
2237
2331
|
}
|
|
2238
2332
|
},
|
|
@@ -2244,8 +2338,8 @@ var CMILearnerPreference = (function (_super) {
|
|
|
2244
2338
|
return this._delivery_speed;
|
|
2245
2339
|
},
|
|
2246
2340
|
set: function (delivery_speed) {
|
|
2247
|
-
if (check2004ValidFormat(delivery_speed, regex
|
|
2248
|
-
check2004ValidRange(delivery_speed, regex
|
|
2341
|
+
if (check2004ValidFormat(delivery_speed, regex.scorm2004_regex.CMIDecimal) &&
|
|
2342
|
+
check2004ValidRange(delivery_speed, regex.scorm2004_regex.speed_range)) {
|
|
2249
2343
|
this._delivery_speed = delivery_speed;
|
|
2250
2344
|
}
|
|
2251
2345
|
},
|
|
@@ -2257,8 +2351,8 @@ var CMILearnerPreference = (function (_super) {
|
|
|
2257
2351
|
return this._audio_captioning;
|
|
2258
2352
|
},
|
|
2259
2353
|
set: function (audio_captioning) {
|
|
2260
|
-
if (check2004ValidFormat(audio_captioning, regex
|
|
2261
|
-
check2004ValidRange(audio_captioning, regex
|
|
2354
|
+
if (check2004ValidFormat(audio_captioning, regex.scorm2004_regex.CMISInteger) &&
|
|
2355
|
+
check2004ValidRange(audio_captioning, regex.scorm2004_regex.text_range)) {
|
|
2262
2356
|
this._audio_captioning = audio_captioning;
|
|
2263
2357
|
}
|
|
2264
2358
|
},
|
|
@@ -2277,14 +2371,13 @@ var CMILearnerPreference = (function (_super) {
|
|
|
2277
2371
|
return result;
|
|
2278
2372
|
};
|
|
2279
2373
|
return CMILearnerPreference;
|
|
2280
|
-
}(base_cmi
|
|
2374
|
+
}(base_cmi.BaseCMI));
|
|
2281
2375
|
|
|
2282
2376
|
|
|
2283
2377
|
// EXTERNAL MODULE: ./src/cmi/common/array.ts
|
|
2284
2378
|
var array = __webpack_require__(589);
|
|
2285
2379
|
;// ./src/constants/response_constants.ts
|
|
2286
2380
|
|
|
2287
|
-
var scorm2004_regex = regex/* default */.A.scorm2004;
|
|
2288
2381
|
var LearnerResponses = {
|
|
2289
2382
|
"true-false": {
|
|
2290
2383
|
format: "^true$|^false$",
|
|
@@ -2293,59 +2386,59 @@ var LearnerResponses = {
|
|
|
2293
2386
|
unique: false,
|
|
2294
2387
|
},
|
|
2295
2388
|
choice: {
|
|
2296
|
-
format: scorm2004_regex.CMILongIdentifier,
|
|
2389
|
+
format: regex.scorm2004_regex.CMILongIdentifier,
|
|
2297
2390
|
max: 36,
|
|
2298
2391
|
delimiter: "[,]",
|
|
2299
2392
|
unique: true,
|
|
2300
2393
|
},
|
|
2301
2394
|
"fill-in": {
|
|
2302
|
-
format: scorm2004_regex.CMILangString250,
|
|
2395
|
+
format: regex.scorm2004_regex.CMILangString250,
|
|
2303
2396
|
max: 10,
|
|
2304
2397
|
delimiter: "[,]",
|
|
2305
2398
|
unique: false,
|
|
2306
2399
|
},
|
|
2307
2400
|
"long-fill-in": {
|
|
2308
|
-
format: scorm2004_regex.CMILangString4000,
|
|
2401
|
+
format: regex.scorm2004_regex.CMILangString4000,
|
|
2309
2402
|
max: 1,
|
|
2310
2403
|
delimiter: "",
|
|
2311
2404
|
unique: false,
|
|
2312
2405
|
},
|
|
2313
2406
|
matching: {
|
|
2314
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2315
|
-
format2: scorm2004_regex.CMIShortIdentifier,
|
|
2407
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2408
|
+
format2: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2316
2409
|
max: 36,
|
|
2317
2410
|
delimiter: "[,]",
|
|
2318
2411
|
delimiter2: "[.]",
|
|
2319
2412
|
unique: false,
|
|
2320
2413
|
},
|
|
2321
2414
|
performance: {
|
|
2322
|
-
format: "^$|" + scorm2004_regex.CMIShortIdentifier,
|
|
2323
|
-
format2: scorm2004_regex.CMIDecimal + "|^$|" + scorm2004_regex.CMIShortIdentifier,
|
|
2415
|
+
format: "^$|" + regex.scorm2004_regex.CMIShortIdentifier,
|
|
2416
|
+
format2: regex.scorm2004_regex.CMIDecimal + "|^$|" + regex.scorm2004_regex.CMIShortIdentifier,
|
|
2324
2417
|
max: 250,
|
|
2325
2418
|
delimiter: "[,]",
|
|
2326
2419
|
delimiter2: "[.]",
|
|
2327
2420
|
unique: false,
|
|
2328
2421
|
},
|
|
2329
2422
|
sequencing: {
|
|
2330
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2423
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2331
2424
|
max: 36,
|
|
2332
2425
|
delimiter: "[,]",
|
|
2333
2426
|
unique: false,
|
|
2334
2427
|
},
|
|
2335
2428
|
likert: {
|
|
2336
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2429
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2337
2430
|
max: 1,
|
|
2338
2431
|
delimiter: "",
|
|
2339
2432
|
unique: false,
|
|
2340
2433
|
},
|
|
2341
2434
|
numeric: {
|
|
2342
|
-
format: scorm2004_regex.CMIDecimal,
|
|
2435
|
+
format: regex.scorm2004_regex.CMIDecimal,
|
|
2343
2436
|
max: 1,
|
|
2344
2437
|
delimiter: "",
|
|
2345
2438
|
unique: false,
|
|
2346
2439
|
},
|
|
2347
2440
|
other: {
|
|
2348
|
-
format: scorm2004_regex.CMIString4000,
|
|
2441
|
+
format: regex.scorm2004_regex.CMIString4000,
|
|
2349
2442
|
max: 1,
|
|
2350
2443
|
delimiter: "",
|
|
2351
2444
|
unique: false,
|
|
@@ -2365,21 +2458,21 @@ var CorrectResponses = {
|
|
|
2365
2458
|
delimiter: "[,]",
|
|
2366
2459
|
unique: true,
|
|
2367
2460
|
duplicate: false,
|
|
2368
|
-
format: scorm2004_regex.CMILongIdentifier,
|
|
2461
|
+
format: regex.scorm2004_regex.CMILongIdentifier,
|
|
2369
2462
|
},
|
|
2370
2463
|
"fill-in": {
|
|
2371
2464
|
max: 10,
|
|
2372
2465
|
delimiter: "[,]",
|
|
2373
2466
|
unique: false,
|
|
2374
2467
|
duplicate: false,
|
|
2375
|
-
format: scorm2004_regex.CMILangString250cr,
|
|
2468
|
+
format: regex.scorm2004_regex.CMILangString250cr,
|
|
2376
2469
|
},
|
|
2377
2470
|
"long-fill-in": {
|
|
2378
2471
|
max: 1,
|
|
2379
2472
|
delimiter: "",
|
|
2380
2473
|
unique: false,
|
|
2381
2474
|
duplicate: true,
|
|
2382
|
-
format: scorm2004_regex.CMILangString4000,
|
|
2475
|
+
format: regex.scorm2004_regex.CMILangString4000,
|
|
2383
2476
|
},
|
|
2384
2477
|
matching: {
|
|
2385
2478
|
max: 36,
|
|
@@ -2387,8 +2480,8 @@ var CorrectResponses = {
|
|
|
2387
2480
|
delimiter2: "[.]",
|
|
2388
2481
|
unique: false,
|
|
2389
2482
|
duplicate: false,
|
|
2390
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2391
|
-
format2: scorm2004_regex.CMIShortIdentifier,
|
|
2483
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2484
|
+
format2: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2392
2485
|
},
|
|
2393
2486
|
performance: {
|
|
2394
2487
|
max: 250,
|
|
@@ -2397,22 +2490,22 @@ var CorrectResponses = {
|
|
|
2397
2490
|
delimiter3: "[:]",
|
|
2398
2491
|
unique: false,
|
|
2399
2492
|
duplicate: false,
|
|
2400
|
-
format: "^$|" + scorm2004_regex.CMIShortIdentifier,
|
|
2401
|
-
format2: scorm2004_regex.CMIDecimal + "|^$|" + scorm2004_regex.CMIShortIdentifier,
|
|
2493
|
+
format: "^$|" + regex.scorm2004_regex.CMIShortIdentifier,
|
|
2494
|
+
format2: regex.scorm2004_regex.CMIDecimal + "|^$|" + regex.scorm2004_regex.CMIShortIdentifier,
|
|
2402
2495
|
},
|
|
2403
2496
|
sequencing: {
|
|
2404
2497
|
max: 36,
|
|
2405
2498
|
delimiter: "[,]",
|
|
2406
2499
|
unique: false,
|
|
2407
2500
|
duplicate: false,
|
|
2408
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2501
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2409
2502
|
},
|
|
2410
2503
|
likert: {
|
|
2411
2504
|
max: 1,
|
|
2412
2505
|
delimiter: "",
|
|
2413
2506
|
unique: false,
|
|
2414
2507
|
duplicate: false,
|
|
2415
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2508
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2416
2509
|
limit: 1,
|
|
2417
2510
|
},
|
|
2418
2511
|
numeric: {
|
|
@@ -2420,7 +2513,7 @@ var CorrectResponses = {
|
|
|
2420
2513
|
delimiter: "[:]",
|
|
2421
2514
|
unique: false,
|
|
2422
2515
|
duplicate: false,
|
|
2423
|
-
format: scorm2004_regex.CMIDecimal,
|
|
2516
|
+
format: regex.scorm2004_regex.CMIDecimal,
|
|
2424
2517
|
limit: 1,
|
|
2425
2518
|
},
|
|
2426
2519
|
other: {
|
|
@@ -2428,7 +2521,7 @@ var CorrectResponses = {
|
|
|
2428
2521
|
delimiter: "",
|
|
2429
2522
|
unique: false,
|
|
2430
2523
|
duplicate: false,
|
|
2431
|
-
format: scorm2004_regex.CMIString4000,
|
|
2524
|
+
format: regex.scorm2004_regex.CMIString4000,
|
|
2432
2525
|
limit: 1,
|
|
2433
2526
|
},
|
|
2434
2527
|
};
|
|
@@ -2444,19 +2537,19 @@ var CorrectResponses = {
|
|
|
2444
2537
|
|
|
2445
2538
|
|
|
2446
2539
|
var CMIInteractions = (function (_super) {
|
|
2447
|
-
(0,tslib_es6
|
|
2540
|
+
(0,tslib_es6.__extends)(CMIInteractions, _super);
|
|
2448
2541
|
function CMIInteractions() {
|
|
2449
2542
|
return _super.call(this, {
|
|
2450
|
-
children: api_constants
|
|
2451
|
-
errorCode: error_codes
|
|
2452
|
-
errorClass:
|
|
2543
|
+
children: api_constants.scorm2004_constants.interactions_children,
|
|
2544
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2545
|
+
errorClass: Scorm2004ValidationError,
|
|
2453
2546
|
}) || this;
|
|
2454
2547
|
}
|
|
2455
2548
|
return CMIInteractions;
|
|
2456
|
-
}(array
|
|
2549
|
+
}(array.CMIArray));
|
|
2457
2550
|
|
|
2458
2551
|
var CMIInteractionsObject = (function (_super) {
|
|
2459
|
-
(0,tslib_es6
|
|
2552
|
+
(0,tslib_es6.__extends)(CMIInteractionsObject, _super);
|
|
2460
2553
|
function CMIInteractionsObject() {
|
|
2461
2554
|
var _this = _super.call(this) || this;
|
|
2462
2555
|
_this._id = "";
|
|
@@ -2467,15 +2560,15 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2467
2560
|
_this._result = "";
|
|
2468
2561
|
_this._latency = "";
|
|
2469
2562
|
_this._description = "";
|
|
2470
|
-
_this.objectives = new array
|
|
2471
|
-
errorCode: error_codes
|
|
2472
|
-
errorClass:
|
|
2473
|
-
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,
|
|
2474
2567
|
});
|
|
2475
|
-
_this.correct_responses = new array
|
|
2476
|
-
errorCode: error_codes
|
|
2477
|
-
errorClass:
|
|
2478
|
-
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,
|
|
2479
2572
|
});
|
|
2480
2573
|
return _this;
|
|
2481
2574
|
}
|
|
@@ -2485,12 +2578,33 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2485
2578
|
(_a = this.objectives) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
2486
2579
|
(_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.initialize();
|
|
2487
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
|
+
};
|
|
2488
2602
|
Object.defineProperty(CMIInteractionsObject.prototype, "id", {
|
|
2489
2603
|
get: function () {
|
|
2490
2604
|
return this._id;
|
|
2491
2605
|
},
|
|
2492
2606
|
set: function (id) {
|
|
2493
|
-
if (check2004ValidFormat(id, regex
|
|
2607
|
+
if (check2004ValidFormat(id, regex.scorm2004_regex.CMILongIdentifier)) {
|
|
2494
2608
|
this._id = id;
|
|
2495
2609
|
}
|
|
2496
2610
|
},
|
|
@@ -2503,10 +2617,10 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2503
2617
|
},
|
|
2504
2618
|
set: function (type) {
|
|
2505
2619
|
if (this.initialized && this._id === "") {
|
|
2506
|
-
throw new
|
|
2620
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2507
2621
|
}
|
|
2508
2622
|
else {
|
|
2509
|
-
if (check2004ValidFormat(type, regex
|
|
2623
|
+
if (check2004ValidFormat(type, regex.scorm2004_regex.CMIType)) {
|
|
2510
2624
|
this._type = type;
|
|
2511
2625
|
}
|
|
2512
2626
|
}
|
|
@@ -2520,10 +2634,10 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2520
2634
|
},
|
|
2521
2635
|
set: function (timestamp) {
|
|
2522
2636
|
if (this.initialized && this._id === "") {
|
|
2523
|
-
throw new
|
|
2637
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2524
2638
|
}
|
|
2525
2639
|
else {
|
|
2526
|
-
if (check2004ValidFormat(timestamp, regex
|
|
2640
|
+
if (check2004ValidFormat(timestamp, regex.scorm2004_regex.CMITime)) {
|
|
2527
2641
|
this._timestamp = timestamp;
|
|
2528
2642
|
}
|
|
2529
2643
|
}
|
|
@@ -2537,10 +2651,10 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2537
2651
|
},
|
|
2538
2652
|
set: function (weighting) {
|
|
2539
2653
|
if (this.initialized && this._id === "") {
|
|
2540
|
-
throw new
|
|
2654
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2541
2655
|
}
|
|
2542
2656
|
else {
|
|
2543
|
-
if (check2004ValidFormat(weighting, regex
|
|
2657
|
+
if (check2004ValidFormat(weighting, regex.scorm2004_regex.CMIDecimal)) {
|
|
2544
2658
|
this._weighting = weighting;
|
|
2545
2659
|
}
|
|
2546
2660
|
}
|
|
@@ -2554,7 +2668,7 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2554
2668
|
},
|
|
2555
2669
|
set: function (learner_response) {
|
|
2556
2670
|
if (this.initialized && (this._type === "" || this._id === "")) {
|
|
2557
|
-
throw new
|
|
2671
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2558
2672
|
}
|
|
2559
2673
|
else {
|
|
2560
2674
|
var nodes = [];
|
|
@@ -2573,28 +2687,28 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2573
2687
|
var values = nodes[i].split(response_type.delimiter2);
|
|
2574
2688
|
if (values.length === 2) {
|
|
2575
2689
|
if (!values[0].match(formatRegex)) {
|
|
2576
|
-
throw new
|
|
2690
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2577
2691
|
}
|
|
2578
2692
|
else {
|
|
2579
2693
|
if (!response_type.format2 ||
|
|
2580
2694
|
!values[1].match(new RegExp(response_type.format2))) {
|
|
2581
|
-
throw new
|
|
2695
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2582
2696
|
}
|
|
2583
2697
|
}
|
|
2584
2698
|
}
|
|
2585
2699
|
else {
|
|
2586
|
-
throw new
|
|
2700
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2587
2701
|
}
|
|
2588
2702
|
}
|
|
2589
2703
|
else {
|
|
2590
2704
|
if (!nodes[i].match(formatRegex)) {
|
|
2591
|
-
throw new
|
|
2705
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2592
2706
|
}
|
|
2593
2707
|
else {
|
|
2594
2708
|
if (nodes[i] !== "" && response_type.unique) {
|
|
2595
2709
|
for (var j = 0; j < i; j++) {
|
|
2596
2710
|
if (nodes[i] === nodes[j]) {
|
|
2597
|
-
throw new
|
|
2711
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2598
2712
|
}
|
|
2599
2713
|
}
|
|
2600
2714
|
}
|
|
@@ -2603,12 +2717,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2603
2717
|
}
|
|
2604
2718
|
}
|
|
2605
2719
|
else {
|
|
2606
|
-
throw new
|
|
2720
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE);
|
|
2607
2721
|
}
|
|
2608
2722
|
this._learner_response = learner_response;
|
|
2609
2723
|
}
|
|
2610
2724
|
else {
|
|
2611
|
-
throw new
|
|
2725
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2612
2726
|
}
|
|
2613
2727
|
}
|
|
2614
2728
|
},
|
|
@@ -2620,7 +2734,7 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2620
2734
|
return this._result;
|
|
2621
2735
|
},
|
|
2622
2736
|
set: function (result) {
|
|
2623
|
-
if (check2004ValidFormat(result, regex
|
|
2737
|
+
if (check2004ValidFormat(result, regex.scorm2004_regex.CMIResult)) {
|
|
2624
2738
|
this._result = result;
|
|
2625
2739
|
}
|
|
2626
2740
|
},
|
|
@@ -2633,10 +2747,10 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2633
2747
|
},
|
|
2634
2748
|
set: function (latency) {
|
|
2635
2749
|
if (this.initialized && this._id === "") {
|
|
2636
|
-
throw new
|
|
2750
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2637
2751
|
}
|
|
2638
2752
|
else {
|
|
2639
|
-
if (check2004ValidFormat(latency, regex
|
|
2753
|
+
if (check2004ValidFormat(latency, regex.scorm2004_regex.CMITimespan)) {
|
|
2640
2754
|
this._latency = latency;
|
|
2641
2755
|
}
|
|
2642
2756
|
}
|
|
@@ -2650,10 +2764,10 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2650
2764
|
},
|
|
2651
2765
|
set: function (description) {
|
|
2652
2766
|
if (this.initialized && this._id === "") {
|
|
2653
|
-
throw new
|
|
2767
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2654
2768
|
}
|
|
2655
2769
|
else {
|
|
2656
|
-
if (check2004ValidFormat(description, regex
|
|
2770
|
+
if (check2004ValidFormat(description, regex.scorm2004_regex.CMILangString250, true)) {
|
|
2657
2771
|
this._description = description;
|
|
2658
2772
|
}
|
|
2659
2773
|
}
|
|
@@ -2679,21 +2793,25 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2679
2793
|
return result;
|
|
2680
2794
|
};
|
|
2681
2795
|
return CMIInteractionsObject;
|
|
2682
|
-
}(base_cmi
|
|
2796
|
+
}(base_cmi.BaseCMI));
|
|
2683
2797
|
|
|
2684
2798
|
var CMIInteractionsObjectivesObject = (function (_super) {
|
|
2685
|
-
(0,tslib_es6
|
|
2799
|
+
(0,tslib_es6.__extends)(CMIInteractionsObjectivesObject, _super);
|
|
2686
2800
|
function CMIInteractionsObjectivesObject() {
|
|
2687
2801
|
var _this = _super.call(this) || this;
|
|
2688
2802
|
_this._id = "";
|
|
2689
2803
|
return _this;
|
|
2690
2804
|
}
|
|
2805
|
+
CMIInteractionsObjectivesObject.prototype.reset = function () {
|
|
2806
|
+
this._initialized = false;
|
|
2807
|
+
this._id = "";
|
|
2808
|
+
};
|
|
2691
2809
|
Object.defineProperty(CMIInteractionsObjectivesObject.prototype, "id", {
|
|
2692
2810
|
get: function () {
|
|
2693
2811
|
return this._id;
|
|
2694
2812
|
},
|
|
2695
2813
|
set: function (id) {
|
|
2696
|
-
if (check2004ValidFormat(id, regex
|
|
2814
|
+
if (check2004ValidFormat(id, regex.scorm2004_regex.CMILongIdentifier)) {
|
|
2697
2815
|
this._id = id;
|
|
2698
2816
|
}
|
|
2699
2817
|
},
|
|
@@ -2709,21 +2827,25 @@ var CMIInteractionsObjectivesObject = (function (_super) {
|
|
|
2709
2827
|
return result;
|
|
2710
2828
|
};
|
|
2711
2829
|
return CMIInteractionsObjectivesObject;
|
|
2712
|
-
}(base_cmi
|
|
2830
|
+
}(base_cmi.BaseCMI));
|
|
2713
2831
|
|
|
2714
2832
|
var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
2715
|
-
(0,tslib_es6
|
|
2833
|
+
(0,tslib_es6.__extends)(CMIInteractionsCorrectResponsesObject, _super);
|
|
2716
2834
|
function CMIInteractionsCorrectResponsesObject() {
|
|
2717
2835
|
var _this = _super.call(this) || this;
|
|
2718
2836
|
_this._pattern = "";
|
|
2719
2837
|
return _this;
|
|
2720
2838
|
}
|
|
2839
|
+
CMIInteractionsCorrectResponsesObject.prototype.reset = function () {
|
|
2840
|
+
this._initialized = false;
|
|
2841
|
+
this._pattern = "";
|
|
2842
|
+
};
|
|
2721
2843
|
Object.defineProperty(CMIInteractionsCorrectResponsesObject.prototype, "pattern", {
|
|
2722
2844
|
get: function () {
|
|
2723
2845
|
return this._pattern;
|
|
2724
2846
|
},
|
|
2725
2847
|
set: function (pattern) {
|
|
2726
|
-
if (check2004ValidFormat(pattern, regex
|
|
2848
|
+
if (check2004ValidFormat(pattern, regex.scorm2004_regex.CMIFeedback)) {
|
|
2727
2849
|
this._pattern = pattern;
|
|
2728
2850
|
}
|
|
2729
2851
|
},
|
|
@@ -2739,7 +2861,7 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
2739
2861
|
return result;
|
|
2740
2862
|
};
|
|
2741
2863
|
return CMIInteractionsCorrectResponsesObject;
|
|
2742
|
-
}(base_cmi
|
|
2864
|
+
}(base_cmi.BaseCMI));
|
|
2743
2865
|
|
|
2744
2866
|
|
|
2745
2867
|
// EXTERNAL MODULE: ./src/cmi/common/score.ts
|
|
@@ -2753,27 +2875,34 @@ var score = __webpack_require__(434);
|
|
|
2753
2875
|
|
|
2754
2876
|
|
|
2755
2877
|
var Scorm2004CMIScore = (function (_super) {
|
|
2756
|
-
(0,tslib_es6
|
|
2878
|
+
(0,tslib_es6.__extends)(Scorm2004CMIScore, _super);
|
|
2757
2879
|
function Scorm2004CMIScore() {
|
|
2758
2880
|
var _this = _super.call(this, {
|
|
2759
|
-
score_children: api_constants
|
|
2881
|
+
score_children: api_constants.scorm2004_constants.score_children,
|
|
2760
2882
|
max: "",
|
|
2761
|
-
invalidErrorCode: error_codes
|
|
2762
|
-
invalidTypeCode: error_codes
|
|
2763
|
-
invalidRangeCode: error_codes
|
|
2764
|
-
decimalRegex: regex
|
|
2765
|
-
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,
|
|
2766
2888
|
}) || this;
|
|
2767
2889
|
_this._scaled = "";
|
|
2768
2890
|
return _this;
|
|
2769
2891
|
}
|
|
2892
|
+
Scorm2004CMIScore.prototype.reset = function () {
|
|
2893
|
+
this._initialized = false;
|
|
2894
|
+
this._scaled = "";
|
|
2895
|
+
this._raw = "";
|
|
2896
|
+
this._min = "";
|
|
2897
|
+
this._max = "";
|
|
2898
|
+
};
|
|
2770
2899
|
Object.defineProperty(Scorm2004CMIScore.prototype, "scaled", {
|
|
2771
2900
|
get: function () {
|
|
2772
2901
|
return this._scaled;
|
|
2773
2902
|
},
|
|
2774
2903
|
set: function (scaled) {
|
|
2775
|
-
if (check2004ValidFormat(scaled, regex
|
|
2776
|
-
check2004ValidRange(scaled, regex
|
|
2904
|
+
if (check2004ValidFormat(scaled, regex.scorm2004_regex.CMIDecimal) &&
|
|
2905
|
+
check2004ValidRange(scaled, regex.scorm2004_regex.scaled_range)) {
|
|
2777
2906
|
this._scaled = scaled;
|
|
2778
2907
|
}
|
|
2779
2908
|
},
|
|
@@ -2792,7 +2921,7 @@ var Scorm2004CMIScore = (function (_super) {
|
|
|
2792
2921
|
return result;
|
|
2793
2922
|
};
|
|
2794
2923
|
return Scorm2004CMIScore;
|
|
2795
|
-
}(score
|
|
2924
|
+
}(score.CMIScore));
|
|
2796
2925
|
|
|
2797
2926
|
|
|
2798
2927
|
;// ./src/cmi/scorm2004/comments.ts
|
|
@@ -2805,31 +2934,31 @@ var Scorm2004CMIScore = (function (_super) {
|
|
|
2805
2934
|
|
|
2806
2935
|
|
|
2807
2936
|
var CMICommentsFromLMS = (function (_super) {
|
|
2808
|
-
(0,tslib_es6
|
|
2937
|
+
(0,tslib_es6.__extends)(CMICommentsFromLMS, _super);
|
|
2809
2938
|
function CMICommentsFromLMS() {
|
|
2810
2939
|
return _super.call(this, {
|
|
2811
|
-
children: api_constants
|
|
2812
|
-
errorCode: error_codes
|
|
2813
|
-
errorClass:
|
|
2940
|
+
children: api_constants.scorm2004_constants.comments_children,
|
|
2941
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2942
|
+
errorClass: Scorm2004ValidationError,
|
|
2814
2943
|
}) || this;
|
|
2815
2944
|
}
|
|
2816
2945
|
return CMICommentsFromLMS;
|
|
2817
|
-
}(array
|
|
2946
|
+
}(array.CMIArray));
|
|
2818
2947
|
|
|
2819
2948
|
var CMICommentsFromLearner = (function (_super) {
|
|
2820
|
-
(0,tslib_es6
|
|
2949
|
+
(0,tslib_es6.__extends)(CMICommentsFromLearner, _super);
|
|
2821
2950
|
function CMICommentsFromLearner() {
|
|
2822
2951
|
return _super.call(this, {
|
|
2823
|
-
children: api_constants
|
|
2824
|
-
errorCode: error_codes
|
|
2825
|
-
errorClass:
|
|
2952
|
+
children: api_constants.scorm2004_constants.comments_children,
|
|
2953
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2954
|
+
errorClass: Scorm2004ValidationError,
|
|
2826
2955
|
}) || this;
|
|
2827
2956
|
}
|
|
2828
2957
|
return CMICommentsFromLearner;
|
|
2829
|
-
}(array
|
|
2958
|
+
}(array.CMIArray));
|
|
2830
2959
|
|
|
2831
2960
|
var CMICommentsObject = (function (_super) {
|
|
2832
|
-
(0,tslib_es6
|
|
2961
|
+
(0,tslib_es6.__extends)(CMICommentsObject, _super);
|
|
2833
2962
|
function CMICommentsObject(readOnlyAfterInit) {
|
|
2834
2963
|
if (readOnlyAfterInit === void 0) { readOnlyAfterInit = false; }
|
|
2835
2964
|
var _this = _super.call(this) || this;
|
|
@@ -2842,16 +2971,19 @@ var CMICommentsObject = (function (_super) {
|
|
|
2842
2971
|
_this._readOnlyAfterInit = readOnlyAfterInit;
|
|
2843
2972
|
return _this;
|
|
2844
2973
|
}
|
|
2974
|
+
CMICommentsObject.prototype.reset = function () {
|
|
2975
|
+
this._initialized = false;
|
|
2976
|
+
};
|
|
2845
2977
|
Object.defineProperty(CMICommentsObject.prototype, "comment", {
|
|
2846
2978
|
get: function () {
|
|
2847
2979
|
return this._comment;
|
|
2848
2980
|
},
|
|
2849
2981
|
set: function (comment) {
|
|
2850
2982
|
if (this.initialized && this._readOnlyAfterInit) {
|
|
2851
|
-
throw new
|
|
2983
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
2852
2984
|
}
|
|
2853
2985
|
else {
|
|
2854
|
-
if (check2004ValidFormat(comment, regex
|
|
2986
|
+
if (check2004ValidFormat(comment, regex.scorm2004_regex.CMILangString4000, true)) {
|
|
2855
2987
|
this._comment = comment;
|
|
2856
2988
|
}
|
|
2857
2989
|
}
|
|
@@ -2865,10 +2997,10 @@ var CMICommentsObject = (function (_super) {
|
|
|
2865
2997
|
},
|
|
2866
2998
|
set: function (location) {
|
|
2867
2999
|
if (this.initialized && this._readOnlyAfterInit) {
|
|
2868
|
-
throw new
|
|
3000
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
2869
3001
|
}
|
|
2870
3002
|
else {
|
|
2871
|
-
if (check2004ValidFormat(location, regex
|
|
3003
|
+
if (check2004ValidFormat(location, regex.scorm2004_regex.CMIString250)) {
|
|
2872
3004
|
this._location = location;
|
|
2873
3005
|
}
|
|
2874
3006
|
}
|
|
@@ -2882,10 +3014,10 @@ var CMICommentsObject = (function (_super) {
|
|
|
2882
3014
|
},
|
|
2883
3015
|
set: function (timestamp) {
|
|
2884
3016
|
if (this.initialized && this._readOnlyAfterInit) {
|
|
2885
|
-
throw new
|
|
3017
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
2886
3018
|
}
|
|
2887
3019
|
else {
|
|
2888
|
-
if (check2004ValidFormat(timestamp, regex
|
|
3020
|
+
if (check2004ValidFormat(timestamp, regex.scorm2004_regex.CMITime)) {
|
|
2889
3021
|
this._timestamp = timestamp;
|
|
2890
3022
|
}
|
|
2891
3023
|
}
|
|
@@ -2904,7 +3036,7 @@ var CMICommentsObject = (function (_super) {
|
|
|
2904
3036
|
return result;
|
|
2905
3037
|
};
|
|
2906
3038
|
return CMICommentsObject;
|
|
2907
|
-
}(base_cmi
|
|
3039
|
+
}(base_cmi.BaseCMI));
|
|
2908
3040
|
|
|
2909
3041
|
|
|
2910
3042
|
;// ./src/cmi/scorm2004/objectives.ts
|
|
@@ -2918,19 +3050,28 @@ var CMICommentsObject = (function (_super) {
|
|
|
2918
3050
|
|
|
2919
3051
|
|
|
2920
3052
|
var CMIObjectives = (function (_super) {
|
|
2921
|
-
(0,tslib_es6
|
|
3053
|
+
(0,tslib_es6.__extends)(CMIObjectives, _super);
|
|
2922
3054
|
function CMIObjectives() {
|
|
2923
3055
|
return _super.call(this, {
|
|
2924
|
-
children: api_constants
|
|
2925
|
-
errorCode: error_codes
|
|
2926
|
-
errorClass:
|
|
3056
|
+
children: api_constants.scorm2004_constants.objectives_children,
|
|
3057
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
3058
|
+
errorClass: Scorm2004ValidationError,
|
|
2927
3059
|
}) || this;
|
|
2928
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
|
+
};
|
|
2929
3070
|
return CMIObjectives;
|
|
2930
|
-
}(array
|
|
3071
|
+
}(array.CMIArray));
|
|
2931
3072
|
|
|
2932
3073
|
var CMIObjectivesObject = (function (_super) {
|
|
2933
|
-
(0,tslib_es6
|
|
3074
|
+
(0,tslib_es6.__extends)(CMIObjectivesObject, _super);
|
|
2934
3075
|
function CMIObjectivesObject() {
|
|
2935
3076
|
var _this = _super.call(this) || this;
|
|
2936
3077
|
_this._id = "";
|
|
@@ -2941,6 +3082,9 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2941
3082
|
_this.score = new Scorm2004CMIScore();
|
|
2942
3083
|
return _this;
|
|
2943
3084
|
}
|
|
3085
|
+
CMIObjectivesObject.prototype.reset = function () {
|
|
3086
|
+
this._initialized = false;
|
|
3087
|
+
};
|
|
2944
3088
|
CMIObjectivesObject.prototype.initialize = function () {
|
|
2945
3089
|
var _a;
|
|
2946
3090
|
_super.prototype.initialize.call(this);
|
|
@@ -2951,7 +3095,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2951
3095
|
return this._id;
|
|
2952
3096
|
},
|
|
2953
3097
|
set: function (id) {
|
|
2954
|
-
if (check2004ValidFormat(id, regex
|
|
3098
|
+
if (check2004ValidFormat(id, regex.scorm2004_regex.CMILongIdentifier)) {
|
|
2955
3099
|
this._id = id;
|
|
2956
3100
|
}
|
|
2957
3101
|
},
|
|
@@ -2964,10 +3108,10 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2964
3108
|
},
|
|
2965
3109
|
set: function (success_status) {
|
|
2966
3110
|
if (this.initialized && this._id === "") {
|
|
2967
|
-
throw new
|
|
3111
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2968
3112
|
}
|
|
2969
3113
|
else {
|
|
2970
|
-
if (check2004ValidFormat(success_status, regex
|
|
3114
|
+
if (check2004ValidFormat(success_status, regex.scorm2004_regex.CMISStatus)) {
|
|
2971
3115
|
this._success_status = success_status;
|
|
2972
3116
|
}
|
|
2973
3117
|
}
|
|
@@ -2981,10 +3125,10 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2981
3125
|
},
|
|
2982
3126
|
set: function (completion_status) {
|
|
2983
3127
|
if (this.initialized && this._id === "") {
|
|
2984
|
-
throw new
|
|
3128
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2985
3129
|
}
|
|
2986
3130
|
else {
|
|
2987
|
-
if (check2004ValidFormat(completion_status, regex
|
|
3131
|
+
if (check2004ValidFormat(completion_status, regex.scorm2004_regex.CMICStatus)) {
|
|
2988
3132
|
this._completion_status = completion_status;
|
|
2989
3133
|
}
|
|
2990
3134
|
}
|
|
@@ -2998,11 +3142,11 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2998
3142
|
},
|
|
2999
3143
|
set: function (progress_measure) {
|
|
3000
3144
|
if (this.initialized && this._id === "") {
|
|
3001
|
-
throw new
|
|
3145
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
3002
3146
|
}
|
|
3003
3147
|
else {
|
|
3004
|
-
if (check2004ValidFormat(progress_measure, regex
|
|
3005
|
-
check2004ValidRange(progress_measure, regex
|
|
3148
|
+
if (check2004ValidFormat(progress_measure, regex.scorm2004_regex.CMIDecimal) &&
|
|
3149
|
+
check2004ValidRange(progress_measure, regex.scorm2004_regex.progress_range)) {
|
|
3006
3150
|
this._progress_measure = progress_measure;
|
|
3007
3151
|
}
|
|
3008
3152
|
}
|
|
@@ -3016,10 +3160,10 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
3016
3160
|
},
|
|
3017
3161
|
set: function (description) {
|
|
3018
3162
|
if (this.initialized && this._id === "") {
|
|
3019
|
-
throw new
|
|
3163
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
3020
3164
|
}
|
|
3021
3165
|
else {
|
|
3022
|
-
if (check2004ValidFormat(description, regex
|
|
3166
|
+
if (check2004ValidFormat(description, regex.scorm2004_regex.CMILangString250, true)) {
|
|
3023
3167
|
this._description = description;
|
|
3024
3168
|
}
|
|
3025
3169
|
}
|
|
@@ -3041,7 +3185,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
3041
3185
|
return result;
|
|
3042
3186
|
};
|
|
3043
3187
|
return CMIObjectivesObject;
|
|
3044
|
-
}(base_cmi
|
|
3188
|
+
}(base_cmi.BaseCMI));
|
|
3045
3189
|
|
|
3046
3190
|
|
|
3047
3191
|
;// ./src/cmi/scorm2004/cmi.ts
|
|
@@ -3059,12 +3203,12 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
3059
3203
|
|
|
3060
3204
|
|
|
3061
3205
|
var CMI = (function (_super) {
|
|
3062
|
-
(0,tslib_es6
|
|
3206
|
+
(0,tslib_es6.__extends)(CMI, _super);
|
|
3063
3207
|
function CMI(initialized) {
|
|
3064
3208
|
if (initialized === void 0) { initialized = false; }
|
|
3065
3209
|
var _this = _super.call(this) || this;
|
|
3066
3210
|
_this.__version = "1.0";
|
|
3067
|
-
_this.__children = api_constants
|
|
3211
|
+
_this.__children = api_constants.scorm2004_constants.cmi_children;
|
|
3068
3212
|
_this._completion_status = "unknown";
|
|
3069
3213
|
_this._completion_threshold = "";
|
|
3070
3214
|
_this._credit = "credit";
|
|
@@ -3103,12 +3247,27 @@ var CMI = (function (_super) {
|
|
|
3103
3247
|
(_e = this.interactions) === null || _e === void 0 ? void 0 : _e.initialize();
|
|
3104
3248
|
(_f = this.objectives) === null || _f === void 0 ? void 0 : _f.initialize();
|
|
3105
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
|
+
};
|
|
3106
3265
|
Object.defineProperty(CMI.prototype, "_version", {
|
|
3107
3266
|
get: function () {
|
|
3108
3267
|
return this.__version;
|
|
3109
3268
|
},
|
|
3110
3269
|
set: function (_version) {
|
|
3111
|
-
throw new
|
|
3270
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3112
3271
|
},
|
|
3113
3272
|
enumerable: false,
|
|
3114
3273
|
configurable: true
|
|
@@ -3118,7 +3277,7 @@ var CMI = (function (_super) {
|
|
|
3118
3277
|
return this.__children;
|
|
3119
3278
|
},
|
|
3120
3279
|
set: function (_children) {
|
|
3121
|
-
throw new
|
|
3280
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3122
3281
|
},
|
|
3123
3282
|
enumerable: false,
|
|
3124
3283
|
configurable: true
|
|
@@ -3128,7 +3287,7 @@ var CMI = (function (_super) {
|
|
|
3128
3287
|
return this._completion_status;
|
|
3129
3288
|
},
|
|
3130
3289
|
set: function (completion_status) {
|
|
3131
|
-
if (check2004ValidFormat(completion_status, regex
|
|
3290
|
+
if (check2004ValidFormat(completion_status, regex.scorm2004_regex.CMICStatus)) {
|
|
3132
3291
|
this._completion_status = completion_status;
|
|
3133
3292
|
}
|
|
3134
3293
|
},
|
|
@@ -3141,7 +3300,7 @@ var CMI = (function (_super) {
|
|
|
3141
3300
|
},
|
|
3142
3301
|
set: function (completion_threshold) {
|
|
3143
3302
|
if (this.initialized) {
|
|
3144
|
-
throw new
|
|
3303
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3145
3304
|
}
|
|
3146
3305
|
else {
|
|
3147
3306
|
this._completion_threshold = completion_threshold;
|
|
@@ -3156,7 +3315,7 @@ var CMI = (function (_super) {
|
|
|
3156
3315
|
},
|
|
3157
3316
|
set: function (credit) {
|
|
3158
3317
|
if (this.initialized) {
|
|
3159
|
-
throw new
|
|
3318
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3160
3319
|
}
|
|
3161
3320
|
else {
|
|
3162
3321
|
this._credit = credit;
|
|
@@ -3171,7 +3330,7 @@ var CMI = (function (_super) {
|
|
|
3171
3330
|
},
|
|
3172
3331
|
set: function (entry) {
|
|
3173
3332
|
if (this.initialized) {
|
|
3174
|
-
throw new
|
|
3333
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3175
3334
|
}
|
|
3176
3335
|
else {
|
|
3177
3336
|
this._entry = entry;
|
|
@@ -3183,12 +3342,12 @@ var CMI = (function (_super) {
|
|
|
3183
3342
|
Object.defineProperty(CMI.prototype, "exit", {
|
|
3184
3343
|
get: function () {
|
|
3185
3344
|
if (!this.jsonString) {
|
|
3186
|
-
throw new
|
|
3345
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.WRITE_ONLY_ELEMENT);
|
|
3187
3346
|
}
|
|
3188
3347
|
return this._exit;
|
|
3189
3348
|
},
|
|
3190
3349
|
set: function (exit) {
|
|
3191
|
-
if (check2004ValidFormat(exit, regex
|
|
3350
|
+
if (check2004ValidFormat(exit, regex.scorm2004_regex.CMIExit, true)) {
|
|
3192
3351
|
this._exit = exit;
|
|
3193
3352
|
}
|
|
3194
3353
|
},
|
|
@@ -3201,7 +3360,7 @@ var CMI = (function (_super) {
|
|
|
3201
3360
|
},
|
|
3202
3361
|
set: function (launch_data) {
|
|
3203
3362
|
if (this.initialized) {
|
|
3204
|
-
throw new
|
|
3363
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3205
3364
|
}
|
|
3206
3365
|
else {
|
|
3207
3366
|
this._launch_data = launch_data;
|
|
@@ -3216,7 +3375,7 @@ var CMI = (function (_super) {
|
|
|
3216
3375
|
},
|
|
3217
3376
|
set: function (learner_id) {
|
|
3218
3377
|
if (this.initialized) {
|
|
3219
|
-
throw new
|
|
3378
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3220
3379
|
}
|
|
3221
3380
|
else {
|
|
3222
3381
|
this._learner_id = learner_id;
|
|
@@ -3231,7 +3390,7 @@ var CMI = (function (_super) {
|
|
|
3231
3390
|
},
|
|
3232
3391
|
set: function (learner_name) {
|
|
3233
3392
|
if (this.initialized) {
|
|
3234
|
-
throw new
|
|
3393
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3235
3394
|
}
|
|
3236
3395
|
else {
|
|
3237
3396
|
this._learner_name = learner_name;
|
|
@@ -3245,7 +3404,7 @@ var CMI = (function (_super) {
|
|
|
3245
3404
|
return this._location;
|
|
3246
3405
|
},
|
|
3247
3406
|
set: function (location) {
|
|
3248
|
-
if (check2004ValidFormat(location, regex
|
|
3407
|
+
if (check2004ValidFormat(location, regex.scorm2004_regex.CMIString1000)) {
|
|
3249
3408
|
this._location = location;
|
|
3250
3409
|
}
|
|
3251
3410
|
},
|
|
@@ -3258,7 +3417,7 @@ var CMI = (function (_super) {
|
|
|
3258
3417
|
},
|
|
3259
3418
|
set: function (max_time_allowed) {
|
|
3260
3419
|
if (this.initialized) {
|
|
3261
|
-
throw new
|
|
3420
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3262
3421
|
}
|
|
3263
3422
|
else {
|
|
3264
3423
|
this._max_time_allowed = max_time_allowed;
|
|
@@ -3273,7 +3432,7 @@ var CMI = (function (_super) {
|
|
|
3273
3432
|
},
|
|
3274
3433
|
set: function (mode) {
|
|
3275
3434
|
if (this.initialized) {
|
|
3276
|
-
throw new
|
|
3435
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3277
3436
|
}
|
|
3278
3437
|
else {
|
|
3279
3438
|
this._mode = mode;
|
|
@@ -3287,8 +3446,8 @@ var CMI = (function (_super) {
|
|
|
3287
3446
|
return this._progress_measure;
|
|
3288
3447
|
},
|
|
3289
3448
|
set: function (progress_measure) {
|
|
3290
|
-
if (check2004ValidFormat(progress_measure, regex
|
|
3291
|
-
check2004ValidRange(progress_measure, regex
|
|
3449
|
+
if (check2004ValidFormat(progress_measure, regex.scorm2004_regex.CMIDecimal) &&
|
|
3450
|
+
check2004ValidRange(progress_measure, regex.scorm2004_regex.progress_range)) {
|
|
3292
3451
|
this._progress_measure = progress_measure;
|
|
3293
3452
|
}
|
|
3294
3453
|
},
|
|
@@ -3301,7 +3460,7 @@ var CMI = (function (_super) {
|
|
|
3301
3460
|
},
|
|
3302
3461
|
set: function (scaled_passing_score) {
|
|
3303
3462
|
if (this.initialized) {
|
|
3304
|
-
throw new
|
|
3463
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3305
3464
|
}
|
|
3306
3465
|
else {
|
|
3307
3466
|
this._scaled_passing_score = scaled_passing_score;
|
|
@@ -3313,12 +3472,12 @@ var CMI = (function (_super) {
|
|
|
3313
3472
|
Object.defineProperty(CMI.prototype, "session_time", {
|
|
3314
3473
|
get: function () {
|
|
3315
3474
|
if (!this.jsonString) {
|
|
3316
|
-
throw new
|
|
3475
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.WRITE_ONLY_ELEMENT);
|
|
3317
3476
|
}
|
|
3318
3477
|
return this._session_time;
|
|
3319
3478
|
},
|
|
3320
3479
|
set: function (session_time) {
|
|
3321
|
-
if (check2004ValidFormat(session_time, regex
|
|
3480
|
+
if (check2004ValidFormat(session_time, regex.scorm2004_regex.CMITimespan)) {
|
|
3322
3481
|
this._session_time = session_time;
|
|
3323
3482
|
}
|
|
3324
3483
|
},
|
|
@@ -3330,7 +3489,7 @@ var CMI = (function (_super) {
|
|
|
3330
3489
|
return this._success_status;
|
|
3331
3490
|
},
|
|
3332
3491
|
set: function (success_status) {
|
|
3333
|
-
if (check2004ValidFormat(success_status, regex
|
|
3492
|
+
if (check2004ValidFormat(success_status, regex.scorm2004_regex.CMISStatus)) {
|
|
3334
3493
|
this._success_status = success_status;
|
|
3335
3494
|
}
|
|
3336
3495
|
},
|
|
@@ -3342,7 +3501,7 @@ var CMI = (function (_super) {
|
|
|
3342
3501
|
return this._suspend_data;
|
|
3343
3502
|
},
|
|
3344
3503
|
set: function (suspend_data) {
|
|
3345
|
-
if (check2004ValidFormat(suspend_data, regex
|
|
3504
|
+
if (check2004ValidFormat(suspend_data, regex.scorm2004_regex.CMIString64000, true)) {
|
|
3346
3505
|
this._suspend_data = suspend_data;
|
|
3347
3506
|
}
|
|
3348
3507
|
},
|
|
@@ -3355,7 +3514,7 @@ var CMI = (function (_super) {
|
|
|
3355
3514
|
},
|
|
3356
3515
|
set: function (time_limit_action) {
|
|
3357
3516
|
if (this.initialized) {
|
|
3358
|
-
throw new
|
|
3517
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3359
3518
|
}
|
|
3360
3519
|
else {
|
|
3361
3520
|
this._time_limit_action = time_limit_action;
|
|
@@ -3370,7 +3529,7 @@ var CMI = (function (_super) {
|
|
|
3370
3529
|
},
|
|
3371
3530
|
set: function (total_time) {
|
|
3372
3531
|
if (this.initialized) {
|
|
3373
|
-
throw new
|
|
3532
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3374
3533
|
}
|
|
3375
3534
|
else {
|
|
3376
3535
|
this._total_time = total_time;
|
|
@@ -3384,9 +3543,9 @@ var CMI = (function (_super) {
|
|
|
3384
3543
|
var startTime = this.start_time;
|
|
3385
3544
|
if (typeof startTime !== "undefined" && startTime !== null) {
|
|
3386
3545
|
var seconds = new Date().getTime() - startTime;
|
|
3387
|
-
sessionTime = utilities
|
|
3546
|
+
sessionTime = utilities.getSecondsAsISODuration(seconds / 1000);
|
|
3388
3547
|
}
|
|
3389
|
-
return utilities
|
|
3548
|
+
return utilities.addTwoDurations(this._total_time, sessionTime, regex.scorm2004_regex.CMITimespan);
|
|
3390
3549
|
};
|
|
3391
3550
|
CMI.prototype.toJSON = function () {
|
|
3392
3551
|
this.jsonString = true;
|
|
@@ -3419,7 +3578,7 @@ var CMI = (function (_super) {
|
|
|
3419
3578
|
return result;
|
|
3420
3579
|
};
|
|
3421
3580
|
return CMI;
|
|
3422
|
-
}(base_cmi
|
|
3581
|
+
}(base_cmi.BaseRootCMI));
|
|
3423
3582
|
|
|
3424
3583
|
|
|
3425
3584
|
;// ./src/constants/language_constants.ts
|
|
@@ -3828,11 +3987,15 @@ var enums = __webpack_require__(56);
|
|
|
3828
3987
|
|
|
3829
3988
|
|
|
3830
3989
|
|
|
3990
|
+
|
|
3991
|
+
|
|
3831
3992
|
var ADL = (function (_super) {
|
|
3832
|
-
(0,tslib_es6
|
|
3993
|
+
(0,tslib_es6.__extends)(ADL, _super);
|
|
3833
3994
|
function ADL() {
|
|
3834
3995
|
var _this = _super.call(this) || this;
|
|
3996
|
+
_this.data = new ADLData();
|
|
3835
3997
|
_this.nav = new ADLNav();
|
|
3998
|
+
_this.data = new ADLData();
|
|
3836
3999
|
return _this;
|
|
3837
4000
|
}
|
|
3838
4001
|
ADL.prototype.initialize = function () {
|
|
@@ -3840,19 +4003,25 @@ var ADL = (function (_super) {
|
|
|
3840
4003
|
_super.prototype.initialize.call(this);
|
|
3841
4004
|
(_a = this.nav) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
3842
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
|
+
};
|
|
3843
4011
|
ADL.prototype.toJSON = function () {
|
|
3844
4012
|
this.jsonString = true;
|
|
3845
4013
|
var result = {
|
|
3846
4014
|
nav: this.nav,
|
|
4015
|
+
data: this.data,
|
|
3847
4016
|
};
|
|
3848
4017
|
delete this.jsonString;
|
|
3849
4018
|
return result;
|
|
3850
4019
|
};
|
|
3851
4020
|
return ADL;
|
|
3852
|
-
}(base_cmi
|
|
4021
|
+
}(base_cmi.BaseCMI));
|
|
3853
4022
|
|
|
3854
4023
|
var ADLNav = (function (_super) {
|
|
3855
|
-
(0,tslib_es6
|
|
4024
|
+
(0,tslib_es6.__extends)(ADLNav, _super);
|
|
3856
4025
|
function ADLNav() {
|
|
3857
4026
|
var _this = _super.call(this) || this;
|
|
3858
4027
|
_this._request = "_none_";
|
|
@@ -3864,12 +4033,18 @@ var ADLNav = (function (_super) {
|
|
|
3864
4033
|
_super.prototype.initialize.call(this);
|
|
3865
4034
|
(_a = this.request_valid) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
3866
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
|
+
};
|
|
3867
4042
|
Object.defineProperty(ADLNav.prototype, "request", {
|
|
3868
4043
|
get: function () {
|
|
3869
4044
|
return this._request;
|
|
3870
4045
|
},
|
|
3871
4046
|
set: function (request) {
|
|
3872
|
-
if (check2004ValidFormat(request, regex
|
|
4047
|
+
if (check2004ValidFormat(request, regex.scorm2004_regex.NAVEvent)) {
|
|
3873
4048
|
this._request = request;
|
|
3874
4049
|
}
|
|
3875
4050
|
},
|
|
@@ -3885,10 +4060,69 @@ var ADLNav = (function (_super) {
|
|
|
3885
4060
|
return result;
|
|
3886
4061
|
};
|
|
3887
4062
|
return ADLNav;
|
|
3888
|
-
}(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));
|
|
3889
4123
|
|
|
3890
4124
|
var ADLNavRequestValid = (function (_super) {
|
|
3891
|
-
(0,tslib_es6
|
|
4125
|
+
(0,tslib_es6.__extends)(ADLNavRequestValid, _super);
|
|
3892
4126
|
function ADLNavRequestValid() {
|
|
3893
4127
|
var _this = _super.call(this) || this;
|
|
3894
4128
|
_this._continue = "unknown";
|
|
@@ -3897,15 +4131,20 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
3897
4131
|
_this._jump = {};
|
|
3898
4132
|
return _this;
|
|
3899
4133
|
}
|
|
4134
|
+
ADLNavRequestValid.prototype.reset = function () {
|
|
4135
|
+
this._initialized = false;
|
|
4136
|
+
this._continue = "unknown";
|
|
4137
|
+
this._previous = "unknown";
|
|
4138
|
+
};
|
|
3900
4139
|
Object.defineProperty(ADLNavRequestValid.prototype, "continue", {
|
|
3901
4140
|
get: function () {
|
|
3902
4141
|
return this._continue;
|
|
3903
4142
|
},
|
|
3904
4143
|
set: function (_continue) {
|
|
3905
4144
|
if (this.initialized) {
|
|
3906
|
-
throw new
|
|
4145
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3907
4146
|
}
|
|
3908
|
-
if (check2004ValidFormat(_continue, regex
|
|
4147
|
+
if (check2004ValidFormat(_continue, regex.scorm2004_regex.NAVBoolean)) {
|
|
3909
4148
|
this._continue = _continue;
|
|
3910
4149
|
}
|
|
3911
4150
|
},
|
|
@@ -3918,9 +4157,9 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
3918
4157
|
},
|
|
3919
4158
|
set: function (_previous) {
|
|
3920
4159
|
if (this.initialized) {
|
|
3921
|
-
throw new
|
|
4160
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3922
4161
|
}
|
|
3923
|
-
if (check2004ValidFormat(_previous, regex
|
|
4162
|
+
if (check2004ValidFormat(_previous, regex.scorm2004_regex.NAVBoolean)) {
|
|
3924
4163
|
this._previous = _previous;
|
|
3925
4164
|
}
|
|
3926
4165
|
},
|
|
@@ -3933,17 +4172,17 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
3933
4172
|
},
|
|
3934
4173
|
set: function (choice) {
|
|
3935
4174
|
if (this.initialized) {
|
|
3936
|
-
throw new
|
|
4175
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3937
4176
|
}
|
|
3938
4177
|
if (typeof choice !== "object") {
|
|
3939
|
-
throw new
|
|
4178
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
3940
4179
|
}
|
|
3941
4180
|
for (var key in choice) {
|
|
3942
4181
|
if ({}.hasOwnProperty.call(choice, key)) {
|
|
3943
|
-
if (check2004ValidFormat(choice[key], regex
|
|
3944
|
-
check2004ValidFormat(key, regex
|
|
4182
|
+
if (check2004ValidFormat(choice[key], regex.scorm2004_regex.NAVBoolean) &&
|
|
4183
|
+
check2004ValidFormat(key, regex.scorm2004_regex.NAVTarget)) {
|
|
3945
4184
|
this._choice[key] =
|
|
3946
|
-
enums
|
|
4185
|
+
enums.NAVBoolean[choice[key]];
|
|
3947
4186
|
}
|
|
3948
4187
|
}
|
|
3949
4188
|
}
|
|
@@ -3957,16 +4196,16 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
3957
4196
|
},
|
|
3958
4197
|
set: function (jump) {
|
|
3959
4198
|
if (this.initialized) {
|
|
3960
|
-
throw new
|
|
4199
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3961
4200
|
}
|
|
3962
4201
|
if (typeof jump !== "object") {
|
|
3963
|
-
throw new
|
|
4202
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
3964
4203
|
}
|
|
3965
4204
|
for (var key in jump) {
|
|
3966
4205
|
if ({}.hasOwnProperty.call(jump, key)) {
|
|
3967
|
-
if (check2004ValidFormat(jump[key], regex
|
|
3968
|
-
check2004ValidFormat(key, regex
|
|
3969
|
-
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]];
|
|
3970
4209
|
}
|
|
3971
4210
|
}
|
|
3972
4211
|
}
|
|
@@ -3986,7 +4225,7 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
3986
4225
|
return result;
|
|
3987
4226
|
};
|
|
3988
4227
|
return ADLNavRequestValid;
|
|
3989
|
-
}(base_cmi
|
|
4228
|
+
}(base_cmi.BaseCMI));
|
|
3990
4229
|
|
|
3991
4230
|
|
|
3992
4231
|
;// ./src/Scorm2004API.ts
|
|
@@ -4005,9 +4244,8 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
4005
4244
|
|
|
4006
4245
|
|
|
4007
4246
|
|
|
4008
|
-
|
|
4009
4247
|
var Scorm2004Impl = (function (_super) {
|
|
4010
|
-
(0,tslib_es6
|
|
4248
|
+
(0,tslib_es6.__extends)(Scorm2004Impl, _super);
|
|
4011
4249
|
function Scorm2004Impl(settings) {
|
|
4012
4250
|
var _this = this;
|
|
4013
4251
|
if (settings) {
|
|
@@ -4015,8 +4253,9 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4015
4253
|
settings.mastery_override = false;
|
|
4016
4254
|
}
|
|
4017
4255
|
}
|
|
4018
|
-
_this = _super.call(this, error_codes
|
|
4256
|
+
_this = _super.call(this, error_codes.scorm2004_errors, settings) || this;
|
|
4019
4257
|
_this._version = "1.0";
|
|
4258
|
+
_this._globalObjectives = [];
|
|
4020
4259
|
_this.cmi = new CMI();
|
|
4021
4260
|
_this.adl = new ADL();
|
|
4022
4261
|
_this.Initialize = _this.lmsInitialize;
|
|
@@ -4030,9 +4269,10 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4030
4269
|
return _this;
|
|
4031
4270
|
}
|
|
4032
4271
|
Scorm2004Impl.prototype.reset = function (settings) {
|
|
4272
|
+
var _a, _b;
|
|
4033
4273
|
this.commonReset(settings);
|
|
4034
|
-
this.cmi
|
|
4035
|
-
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();
|
|
4036
4276
|
};
|
|
4037
4277
|
Object.defineProperty(Scorm2004Impl.prototype, "version", {
|
|
4038
4278
|
get: function () {
|
|
@@ -4041,14 +4281,21 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4041
4281
|
enumerable: false,
|
|
4042
4282
|
configurable: true
|
|
4043
4283
|
});
|
|
4284
|
+
Object.defineProperty(Scorm2004Impl.prototype, "globalObjectives", {
|
|
4285
|
+
get: function () {
|
|
4286
|
+
return this._globalObjectives;
|
|
4287
|
+
},
|
|
4288
|
+
enumerable: false,
|
|
4289
|
+
configurable: true
|
|
4290
|
+
});
|
|
4044
4291
|
Scorm2004Impl.prototype.lmsInitialize = function () {
|
|
4045
4292
|
this.cmi.initialize();
|
|
4046
4293
|
return this.initialize("Initialize");
|
|
4047
4294
|
};
|
|
4048
4295
|
Scorm2004Impl.prototype.lmsFinish = function () {
|
|
4049
4296
|
var _this = this;
|
|
4050
|
-
(function () { return (0,tslib_es6
|
|
4051
|
-
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) {
|
|
4052
4299
|
switch (_a.label) {
|
|
4053
4300
|
case 0: return [4, this.internalFinish()];
|
|
4054
4301
|
case 1:
|
|
@@ -4057,18 +4304,18 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4057
4304
|
}
|
|
4058
4305
|
});
|
|
4059
4306
|
}); })();
|
|
4060
|
-
return api_constants
|
|
4307
|
+
return api_constants.global_constants.SCORM_TRUE;
|
|
4061
4308
|
};
|
|
4062
4309
|
Scorm2004Impl.prototype.internalFinish = function () {
|
|
4063
|
-
return (0,tslib_es6
|
|
4310
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
4064
4311
|
var result, navActions, request, choiceJumpRegex, matches, target, action;
|
|
4065
4312
|
var _a, _b, _c, _d;
|
|
4066
|
-
return (0,tslib_es6
|
|
4313
|
+
return (0,tslib_es6.__generator)(this, function (_e) {
|
|
4067
4314
|
switch (_e.label) {
|
|
4068
4315
|
case 0: return [4, this.terminate("Terminate", true)];
|
|
4069
4316
|
case 1:
|
|
4070
4317
|
result = _e.sent();
|
|
4071
|
-
if (result === api_constants
|
|
4318
|
+
if (result === api_constants.global_constants.SCORM_TRUE) {
|
|
4072
4319
|
if (this.adl.nav.request !== "_none_") {
|
|
4073
4320
|
navActions = {
|
|
4074
4321
|
continue: "SequenceNext",
|
|
@@ -4081,7 +4328,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4081
4328
|
abandonAll: "SequenceAbandonAll",
|
|
4082
4329
|
};
|
|
4083
4330
|
request = this.adl.nav.request;
|
|
4084
|
-
choiceJumpRegex = new RegExp(regex
|
|
4331
|
+
choiceJumpRegex = new RegExp(regex.scorm2004_regex.NAVEvent);
|
|
4085
4332
|
matches = request.match(choiceJumpRegex);
|
|
4086
4333
|
target = "";
|
|
4087
4334
|
if (matches) {
|
|
@@ -4110,7 +4357,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4110
4357
|
};
|
|
4111
4358
|
Scorm2004Impl.prototype.lmsGetValue = function (CMIElement) {
|
|
4112
4359
|
var adlNavRequestRegex = "^adl\\.nav\\.request_valid\\.(choice|jump)\\.{target=\\S{0,}([a-zA-Z0-9-_]+)}$";
|
|
4113
|
-
if ((0,utilities
|
|
4360
|
+
if ((0,utilities.stringMatches)(CMIElement, adlNavRequestRegex)) {
|
|
4114
4361
|
var matches = CMIElement.match(adlNavRequestRegex);
|
|
4115
4362
|
var request = matches[1];
|
|
4116
4363
|
var target = matches[2].replace("{target=", "").replace("}", "");
|
|
@@ -4132,8 +4379,8 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4132
4379
|
this.scheduleCommit(500, "LMSCommit");
|
|
4133
4380
|
}
|
|
4134
4381
|
else {
|
|
4135
|
-
(function () { return (0,tslib_es6
|
|
4136
|
-
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) {
|
|
4137
4384
|
switch (_a.label) {
|
|
4138
4385
|
case 0: return [4, this.commit("LMSCommit", false)];
|
|
4139
4386
|
case 1:
|
|
@@ -4143,7 +4390,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4143
4390
|
});
|
|
4144
4391
|
}); })();
|
|
4145
4392
|
}
|
|
4146
|
-
return api_constants
|
|
4393
|
+
return api_constants.global_constants.SCORM_TRUE;
|
|
4147
4394
|
};
|
|
4148
4395
|
Scorm2004Impl.prototype.lmsGetLastError = function () {
|
|
4149
4396
|
return this.getLastError("GetLastError");
|
|
@@ -4155,29 +4402,58 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4155
4402
|
return this.getDiagnostic("GetDiagnostic", CMIErrorCode);
|
|
4156
4403
|
};
|
|
4157
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
|
+
}
|
|
4158
4431
|
return this._commonSetCMIValue("SetValue", true, CMIElement, value);
|
|
4159
4432
|
};
|
|
4160
4433
|
Scorm2004Impl.prototype.getChildElement = function (CMIElement, value, foundFirstIndex) {
|
|
4161
|
-
if ((0,utilities
|
|
4434
|
+
if ((0,utilities.stringMatches)(CMIElement, "cmi\\.objectives\\.\\d+")) {
|
|
4162
4435
|
return new CMIObjectivesObject();
|
|
4163
4436
|
}
|
|
4164
4437
|
if (foundFirstIndex) {
|
|
4165
|
-
if ((0,utilities
|
|
4438
|
+
if ((0,utilities.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) {
|
|
4166
4439
|
return this.createCorrectResponsesObject(CMIElement, value);
|
|
4167
4440
|
}
|
|
4168
|
-
else if ((0,utilities
|
|
4441
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) {
|
|
4169
4442
|
return new CMIInteractionsObjectivesObject();
|
|
4170
4443
|
}
|
|
4171
4444
|
}
|
|
4172
|
-
else if ((0,utilities
|
|
4445
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+")) {
|
|
4173
4446
|
return new CMIInteractionsObject();
|
|
4174
4447
|
}
|
|
4175
|
-
if ((0,utilities
|
|
4448
|
+
if ((0,utilities.stringMatches)(CMIElement, "cmi\\.comments_from_learner\\.\\d+")) {
|
|
4176
4449
|
return new CMICommentsObject();
|
|
4177
4450
|
}
|
|
4178
|
-
else if ((0,utilities
|
|
4451
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.comments_from_lms\\.\\d+")) {
|
|
4179
4452
|
return new CMICommentsObject(true);
|
|
4180
4453
|
}
|
|
4454
|
+
if ((0,utilities.stringMatches)(CMIElement, "adl\\.data\\.\\d+")) {
|
|
4455
|
+
return new ADLDataObject();
|
|
4456
|
+
}
|
|
4181
4457
|
return null;
|
|
4182
4458
|
};
|
|
4183
4459
|
Scorm2004Impl.prototype.createCorrectResponsesObject = function (CMIElement, value) {
|
|
@@ -4186,7 +4462,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4186
4462
|
var interaction = this.cmi.interactions.childArray[index];
|
|
4187
4463
|
if (this.isInitialized()) {
|
|
4188
4464
|
if (!interaction.type) {
|
|
4189
|
-
this.throwSCORMError(error_codes
|
|
4465
|
+
this.throwSCORMError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
4190
4466
|
}
|
|
4191
4467
|
else {
|
|
4192
4468
|
this.checkDuplicateChoiceResponse(interaction, value);
|
|
@@ -4195,7 +4471,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4195
4471
|
this.checkValidResponseType(response_type, value, interaction.type);
|
|
4196
4472
|
}
|
|
4197
4473
|
else {
|
|
4198
|
-
this.throwSCORMError(error_codes
|
|
4474
|
+
this.throwSCORMError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE, "Incorrect Response Type: " + interaction.type);
|
|
4199
4475
|
}
|
|
4200
4476
|
}
|
|
4201
4477
|
}
|
|
@@ -4216,7 +4492,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4216
4492
|
this.checkCorrectResponseValue(interaction_type, nodes, value);
|
|
4217
4493
|
}
|
|
4218
4494
|
else if (nodes.length > response_type.max) {
|
|
4219
|
-
this.throwSCORMError(error_codes
|
|
4495
|
+
this.throwSCORMError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE, "Data Model Element Pattern Too Long");
|
|
4220
4496
|
}
|
|
4221
4497
|
};
|
|
4222
4498
|
Scorm2004Impl.prototype.checkDuplicateChoiceResponse = function (interaction, value) {
|
|
@@ -4225,7 +4501,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4225
4501
|
for (var i = 0; i < interaction_count && this.lastErrorCode === "0"; i++) {
|
|
4226
4502
|
var response = interaction.correct_responses.childArray[i];
|
|
4227
4503
|
if (response.pattern === value) {
|
|
4228
|
-
this.throwSCORMError(error_codes
|
|
4504
|
+
this.throwSCORMError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE);
|
|
4229
4505
|
}
|
|
4230
4506
|
}
|
|
4231
4507
|
}
|
|
@@ -4248,12 +4524,12 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4248
4524
|
}
|
|
4249
4525
|
else {
|
|
4250
4526
|
if (this.lastErrorCode === "0") {
|
|
4251
|
-
this.throwSCORMError(error_codes
|
|
4527
|
+
this.throwSCORMError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE, "Data Model Element Pattern Already Exists");
|
|
4252
4528
|
}
|
|
4253
4529
|
}
|
|
4254
4530
|
}
|
|
4255
4531
|
else {
|
|
4256
|
-
this.throwSCORMError(error_codes
|
|
4532
|
+
this.throwSCORMError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE, "Data Model Element Collection Limit Reached");
|
|
4257
4533
|
}
|
|
4258
4534
|
};
|
|
4259
4535
|
Scorm2004Impl.prototype.getCMIValue = function (CMIElement) {
|
|
@@ -4263,11 +4539,11 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4263
4539
|
var basicMessage = "";
|
|
4264
4540
|
var detailMessage = "";
|
|
4265
4541
|
errorNumber = String(errorNumber);
|
|
4266
|
-
if (api_constants
|
|
4542
|
+
if (api_constants.scorm2004_constants.error_descriptions[errorNumber]) {
|
|
4267
4543
|
basicMessage =
|
|
4268
|
-
api_constants
|
|
4544
|
+
api_constants.scorm2004_constants.error_descriptions[errorNumber].basicMessage;
|
|
4269
4545
|
detailMessage =
|
|
4270
|
-
api_constants
|
|
4546
|
+
api_constants.scorm2004_constants.error_descriptions[errorNumber].detailMessage;
|
|
4271
4547
|
}
|
|
4272
4548
|
return detail ? detailMessage : basicMessage;
|
|
4273
4549
|
};
|
|
@@ -4293,36 +4569,36 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4293
4569
|
if (values.length === 2) {
|
|
4294
4570
|
var matches = values[0].match(formatRegex);
|
|
4295
4571
|
if (!matches) {
|
|
4296
|
-
this.throwSCORMError(error_codes
|
|
4572
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4297
4573
|
}
|
|
4298
4574
|
else {
|
|
4299
4575
|
if (!response.format2 ||
|
|
4300
4576
|
!values[1].match(new RegExp(response.format2))) {
|
|
4301
|
-
this.throwSCORMError(error_codes
|
|
4577
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4302
4578
|
}
|
|
4303
4579
|
}
|
|
4304
4580
|
}
|
|
4305
4581
|
else {
|
|
4306
|
-
this.throwSCORMError(error_codes
|
|
4582
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4307
4583
|
}
|
|
4308
4584
|
}
|
|
4309
4585
|
else {
|
|
4310
4586
|
var matches = nodes[i].match(formatRegex);
|
|
4311
4587
|
if ((!matches && value !== "") ||
|
|
4312
4588
|
(!matches && interaction_type === "true-false")) {
|
|
4313
|
-
this.throwSCORMError(error_codes
|
|
4589
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4314
4590
|
}
|
|
4315
4591
|
else {
|
|
4316
4592
|
if (interaction_type === "numeric" && nodes.length > 1) {
|
|
4317
4593
|
if (Number(nodes[0]) > Number(nodes[1])) {
|
|
4318
|
-
this.throwSCORMError(error_codes
|
|
4594
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4319
4595
|
}
|
|
4320
4596
|
}
|
|
4321
4597
|
else {
|
|
4322
4598
|
if (nodes[i] !== "" && response.unique) {
|
|
4323
4599
|
for (var j = 0; j < i && this.lastErrorCode === "0"; j++) {
|
|
4324
4600
|
if (nodes[i] === nodes[j]) {
|
|
4325
|
-
this.throwSCORMError(error_codes
|
|
4601
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4326
4602
|
}
|
|
4327
4603
|
}
|
|
4328
4604
|
}
|
|
@@ -4341,12 +4617,12 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4341
4617
|
while (matches) {
|
|
4342
4618
|
switch (matches[2]) {
|
|
4343
4619
|
case "lang":
|
|
4344
|
-
langMatches = node.match(regex
|
|
4620
|
+
langMatches = node.match(regex.scorm2004_regex.CMILangcr);
|
|
4345
4621
|
if (langMatches) {
|
|
4346
4622
|
var lang = langMatches[3];
|
|
4347
4623
|
if (lang !== undefined && lang.length > 0) {
|
|
4348
4624
|
if (!language_constants.includes(lang.toLowerCase())) {
|
|
4349
|
-
this.throwSCORMError(error_codes
|
|
4625
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4350
4626
|
}
|
|
4351
4627
|
}
|
|
4352
4628
|
}
|
|
@@ -4355,7 +4631,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4355
4631
|
case "case_matters":
|
|
4356
4632
|
if (!seenLang && !seenOrder && !seenCase) {
|
|
4357
4633
|
if (matches[3] !== "true" && matches[3] !== "false") {
|
|
4358
|
-
this.throwSCORMError(error_codes
|
|
4634
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4359
4635
|
}
|
|
4360
4636
|
}
|
|
4361
4637
|
seenCase = true;
|
|
@@ -4363,7 +4639,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4363
4639
|
case "order_matters":
|
|
4364
4640
|
if (!seenCase && !seenLang && !seenOrder) {
|
|
4365
4641
|
if (matches[3] !== "true" && matches[3] !== "false") {
|
|
4366
|
-
this.throwSCORMError(error_codes
|
|
4642
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4367
4643
|
}
|
|
4368
4644
|
}
|
|
4369
4645
|
seenOrder = true;
|
|
@@ -4384,10 +4660,10 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4384
4660
|
cmiExport.cmi.total_time = this.cmi.getCurrentTotalTime();
|
|
4385
4661
|
}
|
|
4386
4662
|
var result = [];
|
|
4387
|
-
var flattened = utilities
|
|
4663
|
+
var flattened = utilities.flatten(cmiExport);
|
|
4388
4664
|
switch (this.settings.dataCommitFormat) {
|
|
4389
4665
|
case "flattened":
|
|
4390
|
-
return utilities
|
|
4666
|
+
return utilities.flatten(cmiExport);
|
|
4391
4667
|
case "params":
|
|
4392
4668
|
for (var item in flattened) {
|
|
4393
4669
|
if ({}.hasOwnProperty.call(flattened, item)) {
|
|
@@ -4403,23 +4679,23 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4403
4679
|
Scorm2004Impl.prototype.renderCommitObject = function (terminateCommit) {
|
|
4404
4680
|
var cmiExport = this.renderCommitCMI(terminateCommit);
|
|
4405
4681
|
var totalTimeDuration = this.cmi.getCurrentTotalTime();
|
|
4406
|
-
var totalTimeSeconds = utilities
|
|
4407
|
-
var completionStatus = enums
|
|
4408
|
-
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;
|
|
4409
4685
|
if (this.cmi.completion_status) {
|
|
4410
4686
|
if (this.cmi.completion_status === "completed") {
|
|
4411
|
-
completionStatus = enums
|
|
4687
|
+
completionStatus = enums.CompletionStatus.completed;
|
|
4412
4688
|
}
|
|
4413
4689
|
else if (this.cmi.completion_status === "incomplete") {
|
|
4414
|
-
completionStatus = enums
|
|
4690
|
+
completionStatus = enums.CompletionStatus.incomplete;
|
|
4415
4691
|
}
|
|
4416
4692
|
}
|
|
4417
4693
|
if (this.cmi.success_status) {
|
|
4418
4694
|
if (this.cmi.success_status === "passed") {
|
|
4419
|
-
successStatus = enums
|
|
4695
|
+
successStatus = enums.SuccessStatus.passed;
|
|
4420
4696
|
}
|
|
4421
4697
|
else if (this.cmi.success_status === "failed") {
|
|
4422
|
-
successStatus = enums
|
|
4698
|
+
successStatus = enums.SuccessStatus.failed;
|
|
4423
4699
|
}
|
|
4424
4700
|
}
|
|
4425
4701
|
var score = this.cmi.score;
|
|
@@ -4451,10 +4727,10 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4451
4727
|
return commitObject;
|
|
4452
4728
|
};
|
|
4453
4729
|
Scorm2004Impl.prototype.storeData = function (terminateCommit) {
|
|
4454
|
-
return (0,tslib_es6
|
|
4730
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
4455
4731
|
var navRequest, commitObject, result;
|
|
4456
4732
|
var _a, _b, _c;
|
|
4457
|
-
return (0,tslib_es6
|
|
4733
|
+
return (0,tslib_es6.__generator)(this, function (_d) {
|
|
4458
4734
|
switch (_d.label) {
|
|
4459
4735
|
case 0:
|
|
4460
4736
|
if (terminateCommit) {
|
|
@@ -4498,7 +4774,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4498
4774
|
}
|
|
4499
4775
|
return [2, result];
|
|
4500
4776
|
case 2: return [2, {
|
|
4501
|
-
result: api_constants
|
|
4777
|
+
result: api_constants.global_constants.SCORM_TRUE,
|
|
4502
4778
|
errorCode: 0,
|
|
4503
4779
|
}];
|
|
4504
4780
|
}
|
|
@@ -4506,7 +4782,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4506
4782
|
});
|
|
4507
4783
|
};
|
|
4508
4784
|
return Scorm2004Impl;
|
|
4509
|
-
}(BaseAPI
|
|
4785
|
+
}(BaseAPI["default"]));
|
|
4510
4786
|
|
|
4511
4787
|
|
|
4512
4788
|
|
|
@@ -4515,29 +4791,40 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4515
4791
|
/***/ 589:
|
|
4516
4792
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
4517
4793
|
|
|
4794
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4518
4795
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4519
|
-
/* harmony export */
|
|
4796
|
+
/* harmony export */ CMIArray: function() { return /* binding */ CMIArray; }
|
|
4520
4797
|
/* harmony export */ });
|
|
4521
|
-
/* unused harmony export scorm12_error_codes */
|
|
4522
4798
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635);
|
|
4523
4799
|
/* harmony import */ var _base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
4524
|
-
/* harmony import */ var
|
|
4525
|
-
/* 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);
|
|
4526
4802
|
|
|
4527
4803
|
|
|
4528
4804
|
|
|
4529
4805
|
|
|
4530
|
-
var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12;
|
|
4531
4806
|
var CMIArray = (function (_super) {
|
|
4532
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_3__
|
|
4807
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_3__.__extends)(CMIArray, _super);
|
|
4533
4808
|
function CMIArray(params) {
|
|
4534
4809
|
var _this = _super.call(this) || this;
|
|
4535
4810
|
_this.__children = params.children;
|
|
4536
|
-
_this._errorCode = params.errorCode ||
|
|
4537
|
-
_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;
|
|
4538
4813
|
_this.childArray = [];
|
|
4539
4814
|
return _this;
|
|
4540
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
|
+
};
|
|
4541
4828
|
Object.defineProperty(CMIArray.prototype, "_children", {
|
|
4542
4829
|
get: function () {
|
|
4543
4830
|
return this.__children;
|
|
@@ -4568,7 +4855,7 @@ var CMIArray = (function (_super) {
|
|
|
4568
4855
|
return result;
|
|
4569
4856
|
};
|
|
4570
4857
|
return CMIArray;
|
|
4571
|
-
}(_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
4858
|
+
}(_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
4572
4859
|
|
|
4573
4860
|
|
|
4574
4861
|
|
|
@@ -4577,9 +4864,10 @@ var CMIArray = (function (_super) {
|
|
|
4577
4864
|
/***/ 319:
|
|
4578
4865
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
4579
4866
|
|
|
4867
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4580
4868
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4581
|
-
/* harmony export */
|
|
4582
|
-
/* harmony export */
|
|
4869
|
+
/* harmony export */ BaseCMI: function() { return /* binding */ BaseCMI; },
|
|
4870
|
+
/* harmony export */ BaseRootCMI: function() { return /* binding */ BaseRootCMI; }
|
|
4583
4871
|
/* harmony export */ });
|
|
4584
4872
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
4585
4873
|
|
|
@@ -4612,7 +4900,7 @@ var BaseCMI = (function () {
|
|
|
4612
4900
|
}());
|
|
4613
4901
|
|
|
4614
4902
|
var BaseRootCMI = (function (_super) {
|
|
4615
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_0__
|
|
4903
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(BaseRootCMI, _super);
|
|
4616
4904
|
function BaseRootCMI() {
|
|
4617
4905
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
4618
4906
|
}
|
|
@@ -4626,10 +4914,10 @@ var BaseRootCMI = (function (_super) {
|
|
|
4626
4914
|
/***/ 434:
|
|
4627
4915
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
4628
4916
|
|
|
4917
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4629
4918
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4630
|
-
/* harmony export */
|
|
4919
|
+
/* harmony export */ CMIScore: function() { return /* binding */ CMIScore; }
|
|
4631
4920
|
/* harmony export */ });
|
|
4632
|
-
/* unused harmony export scorm12_error_codes */
|
|
4633
4921
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635);
|
|
4634
4922
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340);
|
|
4635
4923
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(417);
|
|
@@ -4642,30 +4930,30 @@ var BaseRootCMI = (function (_super) {
|
|
|
4642
4930
|
|
|
4643
4931
|
|
|
4644
4932
|
|
|
4645
|
-
var scorm12_constants = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12;
|
|
4646
|
-
var scorm12_regex = _constants_regex__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12;
|
|
4647
|
-
var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12;
|
|
4648
4933
|
var CMIScore = (function (_super) {
|
|
4649
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_4__
|
|
4934
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_4__.__extends)(CMIScore, _super);
|
|
4650
4935
|
function CMIScore(params) {
|
|
4651
4936
|
var _this = _super.call(this) || this;
|
|
4652
4937
|
_this._raw = "";
|
|
4653
4938
|
_this._min = "";
|
|
4654
|
-
_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;
|
|
4655
4940
|
_this.__score_range = !params.score_range
|
|
4656
4941
|
? false
|
|
4657
|
-
: scorm12_regex.score_range;
|
|
4942
|
+
: _constants_regex__WEBPACK_IMPORTED_MODULE_1__.scorm12_regex.score_range;
|
|
4658
4943
|
_this._max = params.max || params.max === "" ? params.max : "100";
|
|
4659
4944
|
_this.__invalid_error_code =
|
|
4660
|
-
params.invalidErrorCode ||
|
|
4945
|
+
params.invalidErrorCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.INVALID_SET_VALUE;
|
|
4661
4946
|
_this.__invalid_type_code =
|
|
4662
|
-
params.invalidTypeCode ||
|
|
4947
|
+
params.invalidTypeCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.TYPE_MISMATCH;
|
|
4663
4948
|
_this.__invalid_range_code =
|
|
4664
|
-
params.invalidRangeCode ||
|
|
4665
|
-
_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;
|
|
4666
4951
|
_this.__error_class = params.errorClass;
|
|
4667
4952
|
return _this;
|
|
4668
4953
|
}
|
|
4954
|
+
CMIScore.prototype.reset = function () {
|
|
4955
|
+
this._initialized = false;
|
|
4956
|
+
};
|
|
4669
4957
|
Object.defineProperty(CMIScore.prototype, "_children", {
|
|
4670
4958
|
get: function () {
|
|
4671
4959
|
return this.__children;
|
|
@@ -4681,9 +4969,9 @@ var CMIScore = (function (_super) {
|
|
|
4681
4969
|
return this._raw;
|
|
4682
4970
|
},
|
|
4683
4971
|
set: function (raw) {
|
|
4684
|
-
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) &&
|
|
4685
4973
|
(!this.__score_range ||
|
|
4686
|
-
(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))) {
|
|
4687
4975
|
this._raw = raw;
|
|
4688
4976
|
}
|
|
4689
4977
|
},
|
|
@@ -4695,9 +4983,9 @@ var CMIScore = (function (_super) {
|
|
|
4695
4983
|
return this._min;
|
|
4696
4984
|
},
|
|
4697
4985
|
set: function (min) {
|
|
4698
|
-
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) &&
|
|
4699
4987
|
(!this.__score_range ||
|
|
4700
|
-
(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))) {
|
|
4701
4989
|
this._min = min;
|
|
4702
4990
|
}
|
|
4703
4991
|
},
|
|
@@ -4709,9 +4997,9 @@ var CMIScore = (function (_super) {
|
|
|
4709
4997
|
return this._max;
|
|
4710
4998
|
},
|
|
4711
4999
|
set: function (max) {
|
|
4712
|
-
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) &&
|
|
4713
5001
|
(!this.__score_range ||
|
|
4714
|
-
(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))) {
|
|
4715
5003
|
this._max = max;
|
|
4716
5004
|
}
|
|
4717
5005
|
},
|
|
@@ -4729,7 +5017,7 @@ var CMIScore = (function (_super) {
|
|
|
4729
5017
|
return result;
|
|
4730
5018
|
};
|
|
4731
5019
|
return CMIScore;
|
|
4732
|
-
}(_base_cmi__WEBPACK_IMPORTED_MODULE_2__
|
|
5020
|
+
}(_base_cmi__WEBPACK_IMPORTED_MODULE_2__.BaseCMI));
|
|
4733
5021
|
|
|
4734
5022
|
|
|
4735
5023
|
|
|
@@ -4738,9 +5026,10 @@ var CMIScore = (function (_super) {
|
|
|
4738
5026
|
/***/ 449:
|
|
4739
5027
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
4740
5028
|
|
|
5029
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4741
5030
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4742
|
-
/* harmony export */
|
|
4743
|
-
/* harmony export */
|
|
5031
|
+
/* harmony export */ checkValidFormat: function() { return /* binding */ checkValidFormat; },
|
|
5032
|
+
/* harmony export */ checkValidRange: function() { return /* binding */ checkValidRange; }
|
|
4744
5033
|
/* harmony export */ });
|
|
4745
5034
|
function checkValidFormat(value, regexPattern, errorCode, errorClass, allowEmptyString) {
|
|
4746
5035
|
if (typeof value !== "string") {
|
|
@@ -4778,10 +5067,12 @@ function checkValidRange(value, rangePattern, errorCode, errorClass) {
|
|
|
4778
5067
|
/***/ 989:
|
|
4779
5068
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
4780
5069
|
|
|
5070
|
+
// ESM COMPAT FLAG
|
|
5071
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4781
5072
|
|
|
4782
5073
|
// EXPORTS
|
|
4783
5074
|
__webpack_require__.d(__webpack_exports__, {
|
|
4784
|
-
|
|
5075
|
+
CMI: function() { return /* binding */ CMI; }
|
|
4785
5076
|
});
|
|
4786
5077
|
|
|
4787
5078
|
// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs
|
|
@@ -4792,8 +5083,8 @@ var api_constants = __webpack_require__(340);
|
|
|
4792
5083
|
var error_codes = __webpack_require__(797);
|
|
4793
5084
|
// EXTERNAL MODULE: ./src/constants/regex.ts
|
|
4794
5085
|
var regex = __webpack_require__(417);
|
|
4795
|
-
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
4796
|
-
var
|
|
5086
|
+
// EXTERNAL MODULE: ./src/exceptions/scorm12_exceptions.ts
|
|
5087
|
+
var scorm12_exceptions = __webpack_require__(179);
|
|
4797
5088
|
// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts
|
|
4798
5089
|
var base_cmi = __webpack_require__(319);
|
|
4799
5090
|
// EXTERNAL MODULE: ./src/cmi/scorm12/validation.ts
|
|
@@ -4813,10 +5104,10 @@ var utilities = __webpack_require__(864);
|
|
|
4813
5104
|
|
|
4814
5105
|
|
|
4815
5106
|
var CMICore = (function (_super) {
|
|
4816
|
-
(0,tslib_es6
|
|
5107
|
+
(0,tslib_es6.__extends)(CMICore, _super);
|
|
4817
5108
|
function CMICore() {
|
|
4818
5109
|
var _this = _super.call(this) || this;
|
|
4819
|
-
_this.__children = api_constants
|
|
5110
|
+
_this.__children = api_constants.scorm12_constants.core_children;
|
|
4820
5111
|
_this._student_id = "";
|
|
4821
5112
|
_this._student_name = "";
|
|
4822
5113
|
_this._lesson_location = "";
|
|
@@ -4828,13 +5119,13 @@ var CMICore = (function (_super) {
|
|
|
4828
5119
|
_this._exit = "";
|
|
4829
5120
|
_this._session_time = "00:00:00";
|
|
4830
5121
|
_this._suspend_data = "";
|
|
4831
|
-
_this.score = new score
|
|
4832
|
-
score_children: api_constants
|
|
4833
|
-
score_range: regex
|
|
4834
|
-
invalidErrorCode: error_codes
|
|
4835
|
-
invalidTypeCode: error_codes
|
|
4836
|
-
invalidRangeCode: error_codes
|
|
4837
|
-
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,
|
|
4838
5129
|
});
|
|
4839
5130
|
return _this;
|
|
4840
5131
|
}
|
|
@@ -4843,12 +5134,20 @@ var CMICore = (function (_super) {
|
|
|
4843
5134
|
_super.prototype.initialize.call(this);
|
|
4844
5135
|
(_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
4845
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
|
+
};
|
|
4846
5145
|
Object.defineProperty(CMICore.prototype, "_children", {
|
|
4847
5146
|
get: function () {
|
|
4848
5147
|
return this.__children;
|
|
4849
5148
|
},
|
|
4850
5149
|
set: function (_children) {
|
|
4851
|
-
throw new
|
|
5150
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
4852
5151
|
},
|
|
4853
5152
|
enumerable: false,
|
|
4854
5153
|
configurable: true
|
|
@@ -4859,7 +5158,7 @@ var CMICore = (function (_super) {
|
|
|
4859
5158
|
},
|
|
4860
5159
|
set: function (student_id) {
|
|
4861
5160
|
if (this.initialized) {
|
|
4862
|
-
throw new
|
|
5161
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4863
5162
|
}
|
|
4864
5163
|
else {
|
|
4865
5164
|
this._student_id = student_id;
|
|
@@ -4874,7 +5173,7 @@ var CMICore = (function (_super) {
|
|
|
4874
5173
|
},
|
|
4875
5174
|
set: function (student_name) {
|
|
4876
5175
|
if (this.initialized) {
|
|
4877
|
-
throw new
|
|
5176
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4878
5177
|
}
|
|
4879
5178
|
else {
|
|
4880
5179
|
this._student_name = student_name;
|
|
@@ -4888,7 +5187,7 @@ var CMICore = (function (_super) {
|
|
|
4888
5187
|
return this._lesson_location;
|
|
4889
5188
|
},
|
|
4890
5189
|
set: function (lesson_location) {
|
|
4891
|
-
if ((0,validation
|
|
5190
|
+
if ((0,validation.check12ValidFormat)(lesson_location, regex.scorm12_regex.CMIString256, true)) {
|
|
4892
5191
|
this._lesson_location = lesson_location;
|
|
4893
5192
|
}
|
|
4894
5193
|
},
|
|
@@ -4901,7 +5200,7 @@ var CMICore = (function (_super) {
|
|
|
4901
5200
|
},
|
|
4902
5201
|
set: function (credit) {
|
|
4903
5202
|
if (this.initialized) {
|
|
4904
|
-
throw new
|
|
5203
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4905
5204
|
}
|
|
4906
5205
|
else {
|
|
4907
5206
|
this._credit = credit;
|
|
@@ -4916,12 +5215,12 @@ var CMICore = (function (_super) {
|
|
|
4916
5215
|
},
|
|
4917
5216
|
set: function (lesson_status) {
|
|
4918
5217
|
if (this.initialized) {
|
|
4919
|
-
if ((0,validation
|
|
5218
|
+
if ((0,validation.check12ValidFormat)(lesson_status, regex.scorm12_regex.CMIStatus)) {
|
|
4920
5219
|
this._lesson_status = lesson_status;
|
|
4921
5220
|
}
|
|
4922
5221
|
}
|
|
4923
5222
|
else {
|
|
4924
|
-
if ((0,validation
|
|
5223
|
+
if ((0,validation.check12ValidFormat)(lesson_status, regex.scorm12_regex.CMIStatus2)) {
|
|
4925
5224
|
this._lesson_status = lesson_status;
|
|
4926
5225
|
}
|
|
4927
5226
|
}
|
|
@@ -4935,7 +5234,7 @@ var CMICore = (function (_super) {
|
|
|
4935
5234
|
},
|
|
4936
5235
|
set: function (entry) {
|
|
4937
5236
|
if (this.initialized) {
|
|
4938
|
-
throw new
|
|
5237
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4939
5238
|
}
|
|
4940
5239
|
else {
|
|
4941
5240
|
this._entry = entry;
|
|
@@ -4950,7 +5249,7 @@ var CMICore = (function (_super) {
|
|
|
4950
5249
|
},
|
|
4951
5250
|
set: function (total_time) {
|
|
4952
5251
|
if (this.initialized) {
|
|
4953
|
-
throw new
|
|
5252
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4954
5253
|
}
|
|
4955
5254
|
else {
|
|
4956
5255
|
this._total_time = total_time;
|
|
@@ -4965,7 +5264,7 @@ var CMICore = (function (_super) {
|
|
|
4965
5264
|
},
|
|
4966
5265
|
set: function (lesson_mode) {
|
|
4967
5266
|
if (this.initialized) {
|
|
4968
|
-
throw new
|
|
5267
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4969
5268
|
}
|
|
4970
5269
|
else {
|
|
4971
5270
|
this._lesson_mode = lesson_mode;
|
|
@@ -4977,12 +5276,12 @@ var CMICore = (function (_super) {
|
|
|
4977
5276
|
Object.defineProperty(CMICore.prototype, "exit", {
|
|
4978
5277
|
get: function () {
|
|
4979
5278
|
if (!this.jsonString) {
|
|
4980
|
-
throw new
|
|
5279
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
4981
5280
|
}
|
|
4982
5281
|
return this._exit;
|
|
4983
5282
|
},
|
|
4984
5283
|
set: function (exit) {
|
|
4985
|
-
if ((0,validation
|
|
5284
|
+
if ((0,validation.check12ValidFormat)(exit, regex.scorm12_regex.CMIExit, true)) {
|
|
4986
5285
|
this._exit = exit;
|
|
4987
5286
|
}
|
|
4988
5287
|
},
|
|
@@ -4992,12 +5291,12 @@ var CMICore = (function (_super) {
|
|
|
4992
5291
|
Object.defineProperty(CMICore.prototype, "session_time", {
|
|
4993
5292
|
get: function () {
|
|
4994
5293
|
if (!this.jsonString) {
|
|
4995
|
-
throw new
|
|
5294
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
4996
5295
|
}
|
|
4997
5296
|
return this._session_time;
|
|
4998
5297
|
},
|
|
4999
5298
|
set: function (session_time) {
|
|
5000
|
-
if ((0,validation
|
|
5299
|
+
if ((0,validation.check12ValidFormat)(session_time, regex.scorm12_regex.CMITimespan)) {
|
|
5001
5300
|
this._session_time = session_time;
|
|
5002
5301
|
}
|
|
5003
5302
|
},
|
|
@@ -5009,7 +5308,7 @@ var CMICore = (function (_super) {
|
|
|
5009
5308
|
return this._suspend_data;
|
|
5010
5309
|
},
|
|
5011
5310
|
set: function (suspend_data) {
|
|
5012
|
-
if ((0,validation
|
|
5311
|
+
if ((0,validation.check12ValidFormat)(suspend_data, regex.scorm12_regex.CMIString4096, true)) {
|
|
5013
5312
|
this._suspend_data = suspend_data;
|
|
5014
5313
|
}
|
|
5015
5314
|
},
|
|
@@ -5021,9 +5320,9 @@ var CMICore = (function (_super) {
|
|
|
5021
5320
|
var startTime = start_time;
|
|
5022
5321
|
if (typeof startTime !== "undefined" && startTime !== null) {
|
|
5023
5322
|
var seconds = new Date().getTime() - startTime;
|
|
5024
|
-
sessionTime = utilities
|
|
5323
|
+
sessionTime = utilities.getSecondsAsHHMMSS(seconds / 1000);
|
|
5025
5324
|
}
|
|
5026
|
-
return utilities
|
|
5325
|
+
return utilities.addHHMMSSTimeStrings(this._total_time, sessionTime, new RegExp(regex.scorm12_regex.CMITimespan));
|
|
5027
5326
|
};
|
|
5028
5327
|
CMICore.prototype.toJSON = function () {
|
|
5029
5328
|
this.jsonString = true;
|
|
@@ -5043,7 +5342,7 @@ var CMICore = (function (_super) {
|
|
|
5043
5342
|
return result;
|
|
5044
5343
|
};
|
|
5045
5344
|
return CMICore;
|
|
5046
|
-
}(base_cmi
|
|
5345
|
+
}(base_cmi.BaseCMI));
|
|
5047
5346
|
|
|
5048
5347
|
|
|
5049
5348
|
// EXTERNAL MODULE: ./src/cmi/scorm12/objectives.ts
|
|
@@ -5068,7 +5367,7 @@ var interactions = __webpack_require__(833);
|
|
|
5068
5367
|
|
|
5069
5368
|
|
|
5070
5369
|
var CMI = (function (_super) {
|
|
5071
|
-
(0,tslib_es6
|
|
5370
|
+
(0,tslib_es6.__extends)(CMI, _super);
|
|
5072
5371
|
function CMI(cmi_children, student_data, initialized) {
|
|
5073
5372
|
var _this = _super.call(this) || this;
|
|
5074
5373
|
_this.__children = "";
|
|
@@ -5080,14 +5379,25 @@ var CMI = (function (_super) {
|
|
|
5080
5379
|
_this.initialize();
|
|
5081
5380
|
_this.__children = cmi_children
|
|
5082
5381
|
? cmi_children
|
|
5083
|
-
: api_constants
|
|
5382
|
+
: api_constants.scorm12_constants.cmi_children;
|
|
5084
5383
|
_this.core = new CMICore();
|
|
5085
|
-
_this.objectives = new objectives
|
|
5086
|
-
_this.student_data = student_data ? student_data : new scorm12_student_data
|
|
5087
|
-
_this.student_preference = new student_preference
|
|
5088
|
-
_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();
|
|
5089
5388
|
return _this;
|
|
5090
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
|
+
};
|
|
5091
5401
|
CMI.prototype.initialize = function () {
|
|
5092
5402
|
var _a, _b, _c, _d, _e;
|
|
5093
5403
|
_super.prototype.initialize.call(this);
|
|
@@ -5118,7 +5428,7 @@ var CMI = (function (_super) {
|
|
|
5118
5428
|
return this.__version;
|
|
5119
5429
|
},
|
|
5120
5430
|
set: function (_version) {
|
|
5121
|
-
throw new
|
|
5431
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
5122
5432
|
},
|
|
5123
5433
|
enumerable: false,
|
|
5124
5434
|
configurable: true
|
|
@@ -5128,7 +5438,7 @@ var CMI = (function (_super) {
|
|
|
5128
5438
|
return this.__children;
|
|
5129
5439
|
},
|
|
5130
5440
|
set: function (_children) {
|
|
5131
|
-
throw new
|
|
5441
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
5132
5442
|
},
|
|
5133
5443
|
enumerable: false,
|
|
5134
5444
|
configurable: true
|
|
@@ -5152,7 +5462,7 @@ var CMI = (function (_super) {
|
|
|
5152
5462
|
},
|
|
5153
5463
|
set: function (launch_data) {
|
|
5154
5464
|
if (this.initialized) {
|
|
5155
|
-
throw new
|
|
5465
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
5156
5466
|
}
|
|
5157
5467
|
else {
|
|
5158
5468
|
this._launch_data = launch_data;
|
|
@@ -5166,7 +5476,7 @@ var CMI = (function (_super) {
|
|
|
5166
5476
|
return this._comments;
|
|
5167
5477
|
},
|
|
5168
5478
|
set: function (comments) {
|
|
5169
|
-
if ((0,validation
|
|
5479
|
+
if ((0,validation.check12ValidFormat)(comments, regex.scorm12_regex.CMIString4096, true)) {
|
|
5170
5480
|
this._comments = comments;
|
|
5171
5481
|
}
|
|
5172
5482
|
},
|
|
@@ -5179,7 +5489,7 @@ var CMI = (function (_super) {
|
|
|
5179
5489
|
},
|
|
5180
5490
|
set: function (comments_from_lms) {
|
|
5181
5491
|
if (this.initialized) {
|
|
5182
|
-
throw new
|
|
5492
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
5183
5493
|
}
|
|
5184
5494
|
else {
|
|
5185
5495
|
this._comments_from_lms = comments_from_lms;
|
|
@@ -5192,7 +5502,7 @@ var CMI = (function (_super) {
|
|
|
5192
5502
|
return this.core.getCurrentTotalTime(this.start_time);
|
|
5193
5503
|
};
|
|
5194
5504
|
return CMI;
|
|
5195
|
-
}(base_cmi
|
|
5505
|
+
}(base_cmi.BaseRootCMI));
|
|
5196
5506
|
|
|
5197
5507
|
|
|
5198
5508
|
|
|
@@ -5201,17 +5511,18 @@ var CMI = (function (_super) {
|
|
|
5201
5511
|
/***/ 833:
|
|
5202
5512
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5203
5513
|
|
|
5514
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5204
5515
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5205
|
-
/* harmony export */
|
|
5206
|
-
/* harmony export */
|
|
5207
|
-
/* harmony export */
|
|
5208
|
-
/* 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; }
|
|
5209
5520
|
/* harmony export */ });
|
|
5210
5521
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(635);
|
|
5211
5522
|
/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(589);
|
|
5212
5523
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
5213
5524
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(797);
|
|
5214
|
-
/* harmony import */ var
|
|
5525
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(179);
|
|
5215
5526
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(319);
|
|
5216
5527
|
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(915);
|
|
5217
5528
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(417);
|
|
@@ -5224,19 +5535,19 @@ var CMI = (function (_super) {
|
|
|
5224
5535
|
|
|
5225
5536
|
|
|
5226
5537
|
var CMIInteractions = (function (_super) {
|
|
5227
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
5538
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractions, _super);
|
|
5228
5539
|
function CMIInteractions() {
|
|
5229
5540
|
return _super.call(this, {
|
|
5230
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
5231
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__
|
|
5232
|
-
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,
|
|
5233
5544
|
}) || this;
|
|
5234
5545
|
}
|
|
5235
5546
|
return CMIInteractions;
|
|
5236
|
-
}(_common_array__WEBPACK_IMPORTED_MODULE_0__
|
|
5547
|
+
}(_common_array__WEBPACK_IMPORTED_MODULE_0__.CMIArray));
|
|
5237
5548
|
|
|
5238
5549
|
var CMIInteractionsObject = (function (_super) {
|
|
5239
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
5550
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsObject, _super);
|
|
5240
5551
|
function CMIInteractionsObject() {
|
|
5241
5552
|
var _this = _super.call(this) || this;
|
|
5242
5553
|
_this._id = "";
|
|
@@ -5246,15 +5557,15 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5246
5557
|
_this._student_response = "";
|
|
5247
5558
|
_this._result = "";
|
|
5248
5559
|
_this._latency = "";
|
|
5249
|
-
_this.objectives = new _common_array__WEBPACK_IMPORTED_MODULE_0__
|
|
5250
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__
|
|
5251
|
-
errorClass:
|
|
5252
|
-
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,
|
|
5253
5564
|
});
|
|
5254
|
-
_this.correct_responses = new _common_array__WEBPACK_IMPORTED_MODULE_0__
|
|
5255
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__
|
|
5256
|
-
errorClass:
|
|
5257
|
-
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,
|
|
5258
5569
|
});
|
|
5259
5570
|
return _this;
|
|
5260
5571
|
}
|
|
@@ -5264,15 +5575,28 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5264
5575
|
(_a = this.objectives) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
5265
5576
|
(_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.initialize();
|
|
5266
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
|
+
};
|
|
5267
5591
|
Object.defineProperty(CMIInteractionsObject.prototype, "id", {
|
|
5268
5592
|
get: function () {
|
|
5269
5593
|
if (!this.jsonString) {
|
|
5270
|
-
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);
|
|
5271
5595
|
}
|
|
5272
5596
|
return this._id;
|
|
5273
5597
|
},
|
|
5274
5598
|
set: function (id) {
|
|
5275
|
-
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)) {
|
|
5276
5600
|
this._id = id;
|
|
5277
5601
|
}
|
|
5278
5602
|
},
|
|
@@ -5282,12 +5606,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5282
5606
|
Object.defineProperty(CMIInteractionsObject.prototype, "time", {
|
|
5283
5607
|
get: function () {
|
|
5284
5608
|
if (!this.jsonString) {
|
|
5285
|
-
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);
|
|
5286
5610
|
}
|
|
5287
5611
|
return this._time;
|
|
5288
5612
|
},
|
|
5289
5613
|
set: function (time) {
|
|
5290
|
-
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)) {
|
|
5291
5615
|
this._time = time;
|
|
5292
5616
|
}
|
|
5293
5617
|
},
|
|
@@ -5297,12 +5621,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5297
5621
|
Object.defineProperty(CMIInteractionsObject.prototype, "type", {
|
|
5298
5622
|
get: function () {
|
|
5299
5623
|
if (!this.jsonString) {
|
|
5300
|
-
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);
|
|
5301
5625
|
}
|
|
5302
5626
|
return this._type;
|
|
5303
5627
|
},
|
|
5304
5628
|
set: function (type) {
|
|
5305
|
-
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)) {
|
|
5306
5630
|
this._type = type;
|
|
5307
5631
|
}
|
|
5308
5632
|
},
|
|
@@ -5312,13 +5636,13 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5312
5636
|
Object.defineProperty(CMIInteractionsObject.prototype, "weighting", {
|
|
5313
5637
|
get: function () {
|
|
5314
5638
|
if (!this.jsonString) {
|
|
5315
|
-
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);
|
|
5316
5640
|
}
|
|
5317
5641
|
return this._weighting;
|
|
5318
5642
|
},
|
|
5319
5643
|
set: function (weighting) {
|
|
5320
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5321
|
-
(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)) {
|
|
5322
5646
|
this._weighting = weighting;
|
|
5323
5647
|
}
|
|
5324
5648
|
},
|
|
@@ -5328,12 +5652,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5328
5652
|
Object.defineProperty(CMIInteractionsObject.prototype, "student_response", {
|
|
5329
5653
|
get: function () {
|
|
5330
5654
|
if (!this.jsonString) {
|
|
5331
|
-
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);
|
|
5332
5656
|
}
|
|
5333
5657
|
return this._student_response;
|
|
5334
5658
|
},
|
|
5335
5659
|
set: function (student_response) {
|
|
5336
|
-
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)) {
|
|
5337
5661
|
this._student_response = student_response;
|
|
5338
5662
|
}
|
|
5339
5663
|
},
|
|
@@ -5343,12 +5667,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5343
5667
|
Object.defineProperty(CMIInteractionsObject.prototype, "result", {
|
|
5344
5668
|
get: function () {
|
|
5345
5669
|
if (!this.jsonString) {
|
|
5346
|
-
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);
|
|
5347
5671
|
}
|
|
5348
5672
|
return this._result;
|
|
5349
5673
|
},
|
|
5350
5674
|
set: function (result) {
|
|
5351
|
-
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)) {
|
|
5352
5676
|
this._result = result;
|
|
5353
5677
|
}
|
|
5354
5678
|
},
|
|
@@ -5358,12 +5682,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5358
5682
|
Object.defineProperty(CMIInteractionsObject.prototype, "latency", {
|
|
5359
5683
|
get: function () {
|
|
5360
5684
|
if (!this.jsonString) {
|
|
5361
|
-
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);
|
|
5362
5686
|
}
|
|
5363
5687
|
return this._latency;
|
|
5364
5688
|
},
|
|
5365
5689
|
set: function (latency) {
|
|
5366
|
-
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)) {
|
|
5367
5691
|
this._latency = latency;
|
|
5368
5692
|
}
|
|
5369
5693
|
},
|
|
@@ -5387,21 +5711,25 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5387
5711
|
return result;
|
|
5388
5712
|
};
|
|
5389
5713
|
return CMIInteractionsObject;
|
|
5390
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
5714
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
5391
5715
|
|
|
5392
5716
|
var CMIInteractionsObjectivesObject = (function (_super) {
|
|
5393
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
5717
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsObjectivesObject, _super);
|
|
5394
5718
|
function CMIInteractionsObjectivesObject() {
|
|
5395
5719
|
var _this = _super.call(this) || this;
|
|
5396
5720
|
_this._id = "";
|
|
5397
5721
|
return _this;
|
|
5398
5722
|
}
|
|
5723
|
+
CMIInteractionsObjectivesObject.prototype.reset = function () {
|
|
5724
|
+
this._initialized = false;
|
|
5725
|
+
this._id = "";
|
|
5726
|
+
};
|
|
5399
5727
|
Object.defineProperty(CMIInteractionsObjectivesObject.prototype, "id", {
|
|
5400
5728
|
get: function () {
|
|
5401
5729
|
return this._id;
|
|
5402
5730
|
},
|
|
5403
5731
|
set: function (id) {
|
|
5404
|
-
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)) {
|
|
5405
5733
|
this._id = id;
|
|
5406
5734
|
}
|
|
5407
5735
|
},
|
|
@@ -5417,24 +5745,28 @@ var CMIInteractionsObjectivesObject = (function (_super) {
|
|
|
5417
5745
|
return result;
|
|
5418
5746
|
};
|
|
5419
5747
|
return CMIInteractionsObjectivesObject;
|
|
5420
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
5748
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
5421
5749
|
|
|
5422
5750
|
var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
5423
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
5751
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsCorrectResponsesObject, _super);
|
|
5424
5752
|
function CMIInteractionsCorrectResponsesObject() {
|
|
5425
5753
|
var _this = _super.call(this) || this;
|
|
5426
5754
|
_this._pattern = "";
|
|
5427
5755
|
return _this;
|
|
5428
5756
|
}
|
|
5757
|
+
CMIInteractionsCorrectResponsesObject.prototype.reset = function () {
|
|
5758
|
+
this._initialized = false;
|
|
5759
|
+
this._pattern = "";
|
|
5760
|
+
};
|
|
5429
5761
|
Object.defineProperty(CMIInteractionsCorrectResponsesObject.prototype, "pattern", {
|
|
5430
5762
|
get: function () {
|
|
5431
5763
|
if (!this.jsonString) {
|
|
5432
|
-
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);
|
|
5433
5765
|
}
|
|
5434
5766
|
return this._pattern;
|
|
5435
5767
|
},
|
|
5436
5768
|
set: function (pattern) {
|
|
5437
|
-
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)) {
|
|
5438
5770
|
this._pattern = pattern;
|
|
5439
5771
|
}
|
|
5440
5772
|
},
|
|
@@ -5450,7 +5782,7 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
5450
5782
|
return result;
|
|
5451
5783
|
};
|
|
5452
5784
|
return CMIInteractionsCorrectResponsesObject;
|
|
5453
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
5785
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
5454
5786
|
|
|
5455
5787
|
|
|
5456
5788
|
|
|
@@ -5459,8 +5791,9 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
5459
5791
|
/***/ 331:
|
|
5460
5792
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5461
5793
|
|
|
5794
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5462
5795
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5463
|
-
/* harmony export */
|
|
5796
|
+
/* harmony export */ NAV: function() { return /* binding */ NAV; }
|
|
5464
5797
|
/* harmony export */ });
|
|
5465
5798
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635);
|
|
5466
5799
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
@@ -5471,18 +5804,22 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
5471
5804
|
|
|
5472
5805
|
|
|
5473
5806
|
var NAV = (function (_super) {
|
|
5474
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_3__
|
|
5807
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_3__.__extends)(NAV, _super);
|
|
5475
5808
|
function NAV() {
|
|
5476
5809
|
var _this = _super.call(this) || this;
|
|
5477
5810
|
_this._event = "";
|
|
5478
5811
|
return _this;
|
|
5479
5812
|
}
|
|
5813
|
+
NAV.prototype.reset = function () {
|
|
5814
|
+
this._event = "";
|
|
5815
|
+
this._initialized = false;
|
|
5816
|
+
};
|
|
5480
5817
|
Object.defineProperty(NAV.prototype, "event", {
|
|
5481
5818
|
get: function () {
|
|
5482
5819
|
return this._event;
|
|
5483
5820
|
},
|
|
5484
5821
|
set: function (event) {
|
|
5485
|
-
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)) {
|
|
5486
5823
|
this._event = event;
|
|
5487
5824
|
}
|
|
5488
5825
|
},
|
|
@@ -5498,7 +5835,7 @@ var NAV = (function (_super) {
|
|
|
5498
5835
|
return result;
|
|
5499
5836
|
};
|
|
5500
5837
|
return NAV;
|
|
5501
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
5838
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
5502
5839
|
|
|
5503
5840
|
|
|
5504
5841
|
|
|
@@ -5507,9 +5844,10 @@ var NAV = (function (_super) {
|
|
|
5507
5844
|
/***/ 176:
|
|
5508
5845
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5509
5846
|
|
|
5847
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5510
5848
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5511
|
-
/* harmony export */
|
|
5512
|
-
/* harmony export */
|
|
5849
|
+
/* harmony export */ CMIObjectives: function() { return /* binding */ CMIObjectives; },
|
|
5850
|
+
/* harmony export */ CMIObjectivesObject: function() { return /* binding */ CMIObjectivesObject; }
|
|
5513
5851
|
/* harmony export */ });
|
|
5514
5852
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(635);
|
|
5515
5853
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
@@ -5517,7 +5855,7 @@ var NAV = (function (_super) {
|
|
|
5517
5855
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(340);
|
|
5518
5856
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(417);
|
|
5519
5857
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(797);
|
|
5520
|
-
/* harmony import */ var
|
|
5858
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(179);
|
|
5521
5859
|
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(915);
|
|
5522
5860
|
/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(589);
|
|
5523
5861
|
|
|
@@ -5530,39 +5868,46 @@ var NAV = (function (_super) {
|
|
|
5530
5868
|
|
|
5531
5869
|
|
|
5532
5870
|
var CMIObjectives = (function (_super) {
|
|
5533
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_8__
|
|
5871
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_8__.__extends)(CMIObjectives, _super);
|
|
5534
5872
|
function CMIObjectives() {
|
|
5535
5873
|
return _super.call(this, {
|
|
5536
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
5537
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
5538
|
-
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,
|
|
5539
5877
|
}) || this;
|
|
5540
5878
|
}
|
|
5541
5879
|
return CMIObjectives;
|
|
5542
|
-
}(_common_array__WEBPACK_IMPORTED_MODULE_7__
|
|
5880
|
+
}(_common_array__WEBPACK_IMPORTED_MODULE_7__.CMIArray));
|
|
5543
5881
|
|
|
5544
5882
|
var CMIObjectivesObject = (function (_super) {
|
|
5545
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_8__
|
|
5883
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_8__.__extends)(CMIObjectivesObject, _super);
|
|
5546
5884
|
function CMIObjectivesObject() {
|
|
5547
5885
|
var _this = _super.call(this) || this;
|
|
5548
5886
|
_this._id = "";
|
|
5549
5887
|
_this._status = "";
|
|
5550
|
-
_this.score = new _common_score__WEBPACK_IMPORTED_MODULE_1__
|
|
5551
|
-
score_children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
5552
|
-
score_range: _constants_regex__WEBPACK_IMPORTED_MODULE_3__
|
|
5553
|
-
invalidErrorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
5554
|
-
invalidTypeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
5555
|
-
invalidRangeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
5556
|
-
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,
|
|
5557
5895
|
});
|
|
5558
5896
|
return _this;
|
|
5559
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
|
+
};
|
|
5560
5905
|
Object.defineProperty(CMIObjectivesObject.prototype, "id", {
|
|
5561
5906
|
get: function () {
|
|
5562
5907
|
return this._id;
|
|
5563
5908
|
},
|
|
5564
5909
|
set: function (id) {
|
|
5565
|
-
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)) {
|
|
5566
5911
|
this._id = id;
|
|
5567
5912
|
}
|
|
5568
5913
|
},
|
|
@@ -5574,7 +5919,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
5574
5919
|
return this._status;
|
|
5575
5920
|
},
|
|
5576
5921
|
set: function (status) {
|
|
5577
|
-
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)) {
|
|
5578
5923
|
this._status = status;
|
|
5579
5924
|
}
|
|
5580
5925
|
},
|
|
@@ -5592,7 +5937,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
5592
5937
|
return result;
|
|
5593
5938
|
};
|
|
5594
5939
|
return CMIObjectivesObject;
|
|
5595
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
5940
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
5596
5941
|
|
|
5597
5942
|
|
|
5598
5943
|
|
|
@@ -5601,13 +5946,14 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
5601
5946
|
/***/ 532:
|
|
5602
5947
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5603
5948
|
|
|
5949
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5604
5950
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5605
|
-
/* harmony export */
|
|
5951
|
+
/* harmony export */ CMIStudentData: function() { return /* binding */ CMIStudentData; }
|
|
5606
5952
|
/* harmony export */ });
|
|
5607
5953
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635);
|
|
5608
5954
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
5609
5955
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
5610
|
-
/* harmony import */ var
|
|
5956
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(179);
|
|
5611
5957
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797);
|
|
5612
5958
|
|
|
5613
5959
|
|
|
@@ -5615,7 +5961,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
5615
5961
|
|
|
5616
5962
|
|
|
5617
5963
|
var CMIStudentData = (function (_super) {
|
|
5618
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_4__
|
|
5964
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_4__.__extends)(CMIStudentData, _super);
|
|
5619
5965
|
function CMIStudentData(student_data_children) {
|
|
5620
5966
|
var _this = _super.call(this) || this;
|
|
5621
5967
|
_this._mastery_score = "";
|
|
@@ -5623,15 +5969,18 @@ var CMIStudentData = (function (_super) {
|
|
|
5623
5969
|
_this._time_limit_action = "";
|
|
5624
5970
|
_this.__children = student_data_children
|
|
5625
5971
|
? student_data_children
|
|
5626
|
-
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
5972
|
+
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.student_data_children;
|
|
5627
5973
|
return _this;
|
|
5628
5974
|
}
|
|
5975
|
+
CMIStudentData.prototype.reset = function () {
|
|
5976
|
+
this._initialized = false;
|
|
5977
|
+
};
|
|
5629
5978
|
Object.defineProperty(CMIStudentData.prototype, "_children", {
|
|
5630
5979
|
get: function () {
|
|
5631
5980
|
return this.__children;
|
|
5632
5981
|
},
|
|
5633
5982
|
set: function (_children) {
|
|
5634
|
-
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);
|
|
5635
5984
|
},
|
|
5636
5985
|
enumerable: false,
|
|
5637
5986
|
configurable: true
|
|
@@ -5642,7 +5991,7 @@ var CMIStudentData = (function (_super) {
|
|
|
5642
5991
|
},
|
|
5643
5992
|
set: function (mastery_score) {
|
|
5644
5993
|
if (this.initialized) {
|
|
5645
|
-
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);
|
|
5646
5995
|
}
|
|
5647
5996
|
else {
|
|
5648
5997
|
this._mastery_score = mastery_score;
|
|
@@ -5657,7 +6006,7 @@ var CMIStudentData = (function (_super) {
|
|
|
5657
6006
|
},
|
|
5658
6007
|
set: function (max_time_allowed) {
|
|
5659
6008
|
if (this.initialized) {
|
|
5660
|
-
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);
|
|
5661
6010
|
}
|
|
5662
6011
|
else {
|
|
5663
6012
|
this._max_time_allowed = max_time_allowed;
|
|
@@ -5672,7 +6021,7 @@ var CMIStudentData = (function (_super) {
|
|
|
5672
6021
|
},
|
|
5673
6022
|
set: function (time_limit_action) {
|
|
5674
6023
|
if (this.initialized) {
|
|
5675
|
-
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);
|
|
5676
6025
|
}
|
|
5677
6026
|
else {
|
|
5678
6027
|
this._time_limit_action = time_limit_action;
|
|
@@ -5692,7 +6041,7 @@ var CMIStudentData = (function (_super) {
|
|
|
5692
6041
|
return result;
|
|
5693
6042
|
};
|
|
5694
6043
|
return CMIStudentData;
|
|
5695
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
6044
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
5696
6045
|
|
|
5697
6046
|
|
|
5698
6047
|
|
|
@@ -5701,16 +6050,17 @@ var CMIStudentData = (function (_super) {
|
|
|
5701
6050
|
/***/ 181:
|
|
5702
6051
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5703
6052
|
|
|
6053
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5704
6054
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5705
|
-
/* harmony export */
|
|
6055
|
+
/* harmony export */ CMIStudentPreference: function() { return /* binding */ CMIStudentPreference; }
|
|
5706
6056
|
/* harmony export */ });
|
|
5707
6057
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(635);
|
|
5708
6058
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
5709
6059
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
5710
|
-
/* harmony import */ var
|
|
5711
|
-
/* harmony import */ var
|
|
5712
|
-
/* harmony import */ var
|
|
5713
|
-
/* 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);
|
|
5714
6064
|
|
|
5715
6065
|
|
|
5716
6066
|
|
|
@@ -5719,7 +6069,7 @@ var CMIStudentData = (function (_super) {
|
|
|
5719
6069
|
|
|
5720
6070
|
|
|
5721
6071
|
var CMIStudentPreference = (function (_super) {
|
|
5722
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_6__
|
|
6072
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_6__.__extends)(CMIStudentPreference, _super);
|
|
5723
6073
|
function CMIStudentPreference(student_preference_children) {
|
|
5724
6074
|
var _this = _super.call(this) || this;
|
|
5725
6075
|
_this._audio = "";
|
|
@@ -5728,15 +6078,18 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5728
6078
|
_this._text = "";
|
|
5729
6079
|
_this.__children = student_preference_children
|
|
5730
6080
|
? student_preference_children
|
|
5731
|
-
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
6081
|
+
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.student_preference_children;
|
|
5732
6082
|
return _this;
|
|
5733
6083
|
}
|
|
6084
|
+
CMIStudentPreference.prototype.reset = function () {
|
|
6085
|
+
this._initialized = false;
|
|
6086
|
+
};
|
|
5734
6087
|
Object.defineProperty(CMIStudentPreference.prototype, "_children", {
|
|
5735
6088
|
get: function () {
|
|
5736
6089
|
return this.__children;
|
|
5737
6090
|
},
|
|
5738
6091
|
set: function (_children) {
|
|
5739
|
-
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);
|
|
5740
6093
|
},
|
|
5741
6094
|
enumerable: false,
|
|
5742
6095
|
configurable: true
|
|
@@ -5746,8 +6099,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5746
6099
|
return this._audio;
|
|
5747
6100
|
},
|
|
5748
6101
|
set: function (audio) {
|
|
5749
|
-
if ((0,
|
|
5750
|
-
(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)) {
|
|
5751
6104
|
this._audio = audio;
|
|
5752
6105
|
}
|
|
5753
6106
|
},
|
|
@@ -5759,7 +6112,7 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5759
6112
|
return this._language;
|
|
5760
6113
|
},
|
|
5761
6114
|
set: function (language) {
|
|
5762
|
-
if ((0,
|
|
6115
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(language, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMIString256)) {
|
|
5763
6116
|
this._language = language;
|
|
5764
6117
|
}
|
|
5765
6118
|
},
|
|
@@ -5771,8 +6124,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5771
6124
|
return this._speed;
|
|
5772
6125
|
},
|
|
5773
6126
|
set: function (speed) {
|
|
5774
|
-
if ((0,
|
|
5775
|
-
(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)) {
|
|
5776
6129
|
this._speed = speed;
|
|
5777
6130
|
}
|
|
5778
6131
|
},
|
|
@@ -5784,8 +6137,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5784
6137
|
return this._text;
|
|
5785
6138
|
},
|
|
5786
6139
|
set: function (text) {
|
|
5787
|
-
if ((0,
|
|
5788
|
-
(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)) {
|
|
5789
6142
|
this._text = text;
|
|
5790
6143
|
}
|
|
5791
6144
|
},
|
|
@@ -5804,7 +6157,7 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5804
6157
|
return result;
|
|
5805
6158
|
};
|
|
5806
6159
|
return CMIStudentPreference;
|
|
5807
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
6160
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
5808
6161
|
|
|
5809
6162
|
|
|
5810
6163
|
|
|
@@ -5813,24 +6166,25 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5813
6166
|
/***/ 915:
|
|
5814
6167
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5815
6168
|
|
|
6169
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5816
6170
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5817
|
-
/* harmony export */
|
|
5818
|
-
/* harmony export */
|
|
6171
|
+
/* harmony export */ check12ValidFormat: function() { return /* binding */ check12ValidFormat; },
|
|
6172
|
+
/* harmony export */ check12ValidRange: function() { return /* binding */ check12ValidRange; }
|
|
5819
6173
|
/* harmony export */ });
|
|
5820
6174
|
/* harmony import */ var _common_validation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(449);
|
|
5821
6175
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(797);
|
|
5822
|
-
/* harmony import */ var
|
|
6176
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(179);
|
|
5823
6177
|
|
|
5824
6178
|
|
|
5825
6179
|
|
|
5826
6180
|
function check12ValidFormat(value, regexPattern, allowEmptyString) {
|
|
5827
|
-
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);
|
|
5828
6182
|
}
|
|
5829
6183
|
function check12ValidRange(value, rangePattern, allowEmptyString) {
|
|
5830
6184
|
if (!allowEmptyString && value === "") {
|
|
5831
|
-
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);
|
|
5832
6186
|
}
|
|
5833
|
-
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);
|
|
5834
6188
|
}
|
|
5835
6189
|
|
|
5836
6190
|
|
|
@@ -5839,16 +6193,23 @@ function check12ValidRange(value, rangePattern, allowEmptyString) {
|
|
|
5839
6193
|
/***/ 340:
|
|
5840
6194
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5841
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 */ });
|
|
5842
6203
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
5843
6204
|
|
|
5844
|
-
var
|
|
6205
|
+
var global_constants = {
|
|
5845
6206
|
SCORM_TRUE: "true",
|
|
5846
6207
|
SCORM_FALSE: "false",
|
|
5847
6208
|
STATE_NOT_INITIALIZED: 0,
|
|
5848
6209
|
STATE_INITIALIZED: 1,
|
|
5849
6210
|
STATE_TERMINATED: 2,
|
|
5850
6211
|
};
|
|
5851
|
-
var
|
|
6212
|
+
var scorm12_constants = {
|
|
5852
6213
|
cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",
|
|
5853
6214
|
core_children: "student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",
|
|
5854
6215
|
score_children: "raw,min,max",
|
|
@@ -5909,7 +6270,7 @@ var scorm12 = {
|
|
|
5909
6270
|
},
|
|
5910
6271
|
},
|
|
5911
6272
|
};
|
|
5912
|
-
var
|
|
6273
|
+
var aicc_constants = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, scorm12_constants), {
|
|
5913
6274
|
cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",
|
|
5914
6275
|
student_preference_children: "audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",
|
|
5915
6276
|
student_data_children: "attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",
|
|
@@ -5918,7 +6279,7 @@ var aicc = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__W
|
|
|
5918
6279
|
attempt_records_children: "score,lesson_status",
|
|
5919
6280
|
paths_children: "location_id,date,time,status,why_left,time_in_element",
|
|
5920
6281
|
});
|
|
5921
|
-
var
|
|
6282
|
+
var scorm2004_constants = {
|
|
5922
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",
|
|
5923
6284
|
comments_children: "comment,timestamp,location",
|
|
5924
6285
|
score_children: "max,raw,scaled,min",
|
|
@@ -5927,6 +6288,7 @@ var scorm2004 = {
|
|
|
5927
6288
|
student_data_children: "mastery_score,max_time_allowed,time_limit_action",
|
|
5928
6289
|
student_preference_children: "audio_level,audio_captioning,delivery_speed,language",
|
|
5929
6290
|
interactions_children: "id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",
|
|
6291
|
+
adl_data_children: "id,store",
|
|
5930
6292
|
error_descriptions: {
|
|
5931
6293
|
"0": {
|
|
5932
6294
|
basicMessage: "No Error",
|
|
@@ -6034,13 +6396,6 @@ var scorm2004 = {
|
|
|
6034
6396
|
},
|
|
6035
6397
|
},
|
|
6036
6398
|
};
|
|
6037
|
-
var APIConstants = {
|
|
6038
|
-
global: global,
|
|
6039
|
-
scorm12: scorm12,
|
|
6040
|
-
aicc: aicc,
|
|
6041
|
-
scorm2004: scorm2004,
|
|
6042
|
-
};
|
|
6043
|
-
/* harmony default export */ __webpack_exports__.A = (APIConstants);
|
|
6044
6399
|
|
|
6045
6400
|
|
|
6046
6401
|
/***/ }),
|
|
@@ -6048,11 +6403,12 @@ var APIConstants = {
|
|
|
6048
6403
|
/***/ 56:
|
|
6049
6404
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6050
6405
|
|
|
6406
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6051
6407
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6052
|
-
/* harmony export */
|
|
6053
|
-
/* harmony export */
|
|
6054
|
-
/* harmony export */
|
|
6055
|
-
/* 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; }
|
|
6056
6412
|
/* harmony export */ });
|
|
6057
6413
|
var NAVBoolean;
|
|
6058
6414
|
(function (NAVBoolean) {
|
|
@@ -6088,9 +6444,15 @@ var LogLevelEnum;
|
|
|
6088
6444
|
/***/ 797:
|
|
6089
6445
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6090
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 */ });
|
|
6091
6453
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
6092
6454
|
|
|
6093
|
-
var
|
|
6455
|
+
var global_errors = {
|
|
6094
6456
|
GENERAL: 101,
|
|
6095
6457
|
INITIALIZATION_FAILED: 101,
|
|
6096
6458
|
INITIALIZED: 101,
|
|
@@ -6120,13 +6482,8 @@ var global = {
|
|
|
6120
6482
|
VALUE_OUT_OF_RANGE: 101,
|
|
6121
6483
|
DEPENDENCY_NOT_ESTABLISHED: 101,
|
|
6122
6484
|
};
|
|
6123
|
-
var
|
|
6124
|
-
var
|
|
6125
|
-
var ErrorCodes = {
|
|
6126
|
-
scorm12: scorm12,
|
|
6127
|
-
scorm2004: scorm2004,
|
|
6128
|
-
};
|
|
6129
|
-
/* 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 });
|
|
6130
6487
|
|
|
6131
6488
|
|
|
6132
6489
|
/***/ }),
|
|
@@ -6134,9 +6491,15 @@ var ErrorCodes = {
|
|
|
6134
6491
|
/***/ 417:
|
|
6135
6492
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6136
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 */ });
|
|
6137
6500
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
6138
6501
|
|
|
6139
|
-
var
|
|
6502
|
+
var scorm12_regex = {
|
|
6140
6503
|
CMIString256: "^.{0,255}$",
|
|
6141
6504
|
CMIString4096: "^.{0,4096}$",
|
|
6142
6505
|
CMITime: "^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",
|
|
@@ -6159,10 +6522,10 @@ var scorm12 = {
|
|
|
6159
6522
|
weighting_range: "-100#100",
|
|
6160
6523
|
text_range: "-1#1",
|
|
6161
6524
|
};
|
|
6162
|
-
var
|
|
6525
|
+
var aicc_regex = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, scorm12_regex), {
|
|
6163
6526
|
CMIIdentifier: "^\\w{1,255}$",
|
|
6164
6527
|
});
|
|
6165
|
-
var
|
|
6528
|
+
var scorm2004_regex = {
|
|
6166
6529
|
CMIString200: "^[\\u0000-\\uFFFF]{0,200}$",
|
|
6167
6530
|
CMIString250: "^[\\u0000-\\uFFFF]{0,250}$",
|
|
6168
6531
|
CMIString1000: "^[\\u0000-\\uFFFF]{0,1000}$",
|
|
@@ -6198,12 +6561,6 @@ var scorm2004 = {
|
|
|
6198
6561
|
text_range: "-1#1",
|
|
6199
6562
|
progress_range: "0#1",
|
|
6200
6563
|
};
|
|
6201
|
-
var Regex = {
|
|
6202
|
-
aicc: aicc,
|
|
6203
|
-
scorm12: scorm12,
|
|
6204
|
-
scorm2004: scorm2004,
|
|
6205
|
-
};
|
|
6206
|
-
/* harmony default export */ __webpack_exports__.A = (Regex);
|
|
6207
6564
|
|
|
6208
6565
|
|
|
6209
6566
|
/***/ }),
|
|
@@ -6211,22 +6568,15 @@ var Regex = {
|
|
|
6211
6568
|
/***/ 784:
|
|
6212
6569
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6213
6570
|
|
|
6571
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6214
6572
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6215
|
-
/* harmony export */
|
|
6216
|
-
/* harmony export */
|
|
6217
|
-
/* harmony export */ tQ: function() { return /* binding */ Scorm12ValidationError; },
|
|
6218
|
-
/* harmony export */ wq: function() { return /* binding */ Scorm2004ValidationError; },
|
|
6219
|
-
/* harmony export */ yI: function() { return /* binding */ ValidationError; }
|
|
6573
|
+
/* harmony export */ BaseScormValidationError: function() { return /* binding */ BaseScormValidationError; },
|
|
6574
|
+
/* harmony export */ ValidationError: function() { return /* binding */ ValidationError; }
|
|
6220
6575
|
/* harmony export */ });
|
|
6221
|
-
/* harmony import */ var
|
|
6222
|
-
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340);
|
|
6223
|
-
|
|
6576
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
6224
6577
|
|
|
6225
|
-
var scorm12_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.error_descriptions;
|
|
6226
|
-
var aicc_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.aicc.error_descriptions;
|
|
6227
|
-
var scorm2004_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm2004.error_descriptions;
|
|
6228
6578
|
var BaseScormValidationError = (function (_super) {
|
|
6229
|
-
(0,
|
|
6579
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(BaseScormValidationError, _super);
|
|
6230
6580
|
function BaseScormValidationError(errorCode) {
|
|
6231
6581
|
var _this = _super.call(this, errorCode.toString()) || this;
|
|
6232
6582
|
_this._errorCode = errorCode;
|
|
@@ -6244,7 +6594,7 @@ var BaseScormValidationError = (function (_super) {
|
|
|
6244
6594
|
}(Error));
|
|
6245
6595
|
|
|
6246
6596
|
var ValidationError = (function (_super) {
|
|
6247
|
-
(0,
|
|
6597
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(ValidationError, _super);
|
|
6248
6598
|
function ValidationError(errorCode, errorMessage, detailedMessage) {
|
|
6249
6599
|
var _this = _super.call(this, errorCode) || this;
|
|
6250
6600
|
_this._detailedMessage = "";
|
|
@@ -6272,8 +6622,26 @@ var ValidationError = (function (_super) {
|
|
|
6272
6622
|
return ValidationError;
|
|
6273
6623
|
}(BaseScormValidationError));
|
|
6274
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;
|
|
6275
6643
|
var Scorm12ValidationError = (function (_super) {
|
|
6276
|
-
(0,
|
|
6644
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_2__.__extends)(Scorm12ValidationError, _super);
|
|
6277
6645
|
function Scorm12ValidationError(errorCode) {
|
|
6278
6646
|
var _this = this;
|
|
6279
6647
|
if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {
|
|
@@ -6285,37 +6653,7 @@ var Scorm12ValidationError = (function (_super) {
|
|
|
6285
6653
|
return _this;
|
|
6286
6654
|
}
|
|
6287
6655
|
return Scorm12ValidationError;
|
|
6288
|
-
}(ValidationError));
|
|
6289
|
-
|
|
6290
|
-
var AICCValidationError = (function (_super) {
|
|
6291
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(AICCValidationError, _super);
|
|
6292
|
-
function AICCValidationError(errorCode) {
|
|
6293
|
-
var _this = this;
|
|
6294
|
-
if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {
|
|
6295
|
-
_this = _super.call(this, errorCode, aicc_errors[String(errorCode)].basicMessage, aicc_errors[String(errorCode)].detailMessage) || this;
|
|
6296
|
-
}
|
|
6297
|
-
else {
|
|
6298
|
-
_this = _super.call(this, 101, aicc_errors["101"].basicMessage, aicc_errors["101"].detailMessage) || this;
|
|
6299
|
-
}
|
|
6300
|
-
return _this;
|
|
6301
|
-
}
|
|
6302
|
-
return AICCValidationError;
|
|
6303
|
-
}(ValidationError));
|
|
6304
|
-
|
|
6305
|
-
var Scorm2004ValidationError = (function (_super) {
|
|
6306
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(Scorm2004ValidationError, _super);
|
|
6307
|
-
function Scorm2004ValidationError(errorCode) {
|
|
6308
|
-
var _this = this;
|
|
6309
|
-
if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {
|
|
6310
|
-
_this = _super.call(this, errorCode, scorm2004_errors[String(errorCode)].basicMessage, scorm2004_errors[String(errorCode)].detailMessage) || this;
|
|
6311
|
-
}
|
|
6312
|
-
else {
|
|
6313
|
-
_this = _super.call(this, 101, scorm2004_errors["101"].basicMessage, scorm2004_errors["101"].detailMessage) || this;
|
|
6314
|
-
}
|
|
6315
|
-
return _this;
|
|
6316
|
-
}
|
|
6317
|
-
return Scorm2004ValidationError;
|
|
6318
|
-
}(ValidationError));
|
|
6656
|
+
}(_exceptions__WEBPACK_IMPORTED_MODULE_0__.ValidationError));
|
|
6319
6657
|
|
|
6320
6658
|
|
|
6321
6659
|
|
|
@@ -6324,19 +6662,24 @@ var Scorm2004ValidationError = (function (_super) {
|
|
|
6324
6662
|
/***/ 864:
|
|
6325
6663
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6326
6664
|
|
|
6665
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6327
6666
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6328
|
-
/* harmony export */
|
|
6329
|
-
/* harmony export */
|
|
6330
|
-
/* harmony export */
|
|
6331
|
-
/* harmony export */
|
|
6332
|
-
/* harmony export */
|
|
6333
|
-
/* harmony export */
|
|
6334
|
-
/* harmony export */
|
|
6335
|
-
/* harmony export */
|
|
6336
|
-
/* harmony export */
|
|
6337
|
-
/* 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; }
|
|
6338
6682
|
/* harmony export */ });
|
|
6339
|
-
/* unused harmony exports SECONDS_PER_SECOND, SECONDS_PER_MINUTE, SECONDS_PER_HOUR, SECONDS_PER_DAY, countDecimals */
|
|
6340
6683
|
var SECONDS_PER_SECOND = 1.0;
|
|
6341
6684
|
var SECONDS_PER_MINUTE = 60;
|
|
6342
6685
|
var SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;
|
|
@@ -6528,13 +6871,40 @@ function stringMatches(str, tester) {
|
|
|
6528
6871
|
/***/ 635:
|
|
6529
6872
|
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
6530
6873
|
|
|
6874
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6531
6875
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6532
|
-
/* harmony export */
|
|
6533
|
-
/* harmony export */
|
|
6534
|
-
/* harmony export */
|
|
6535
|
-
/* 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; }
|
|
6536
6907
|
/* harmony export */ });
|
|
6537
|
-
/* 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 */
|
|
6538
6908
|
/******************************************************************************
|
|
6539
6909
|
Copyright (c) Microsoft Corporation.
|
|
6540
6910
|
|
|
@@ -6884,7 +7254,7 @@ function __disposeResources(env) {
|
|
|
6884
7254
|
return next();
|
|
6885
7255
|
}
|
|
6886
7256
|
|
|
6887
|
-
/*
|
|
7257
|
+
/* harmony default export */ __webpack_exports__["default"] = ({
|
|
6888
7258
|
__extends,
|
|
6889
7259
|
__assign,
|
|
6890
7260
|
__rest,
|
|
@@ -6980,9 +7350,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6980
7350
|
/* harmony export */ Scorm12API: function() { return /* binding */ Scorm12API; },
|
|
6981
7351
|
/* harmony export */ Scorm2004API: function() { return /* binding */ Scorm2004API; }
|
|
6982
7352
|
/* harmony export */ });
|
|
6983
|
-
/* harmony import */ var _AICC__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
7353
|
+
/* harmony import */ var _AICC__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(916);
|
|
6984
7354
|
/* harmony import */ var _Scorm12API__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(941);
|
|
6985
|
-
/* harmony import */ var _Scorm2004API__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
7355
|
+
/* harmony import */ var _Scorm2004API__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(809);
|
|
6986
7356
|
|
|
6987
7357
|
|
|
6988
7358
|
|
|
@@ -6992,7 +7362,7 @@ var AICC = _AICC__WEBPACK_IMPORTED_MODULE_0__.AICCImpl;
|
|
|
6992
7362
|
|
|
6993
7363
|
|
|
6994
7364
|
var __webpack_export_target__ = this;
|
|
6995
|
-
for(var
|
|
7365
|
+
for(var __webpack_i__ in __webpack_exports__) __webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
6996
7366
|
if(__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, "__esModule", { value: true });
|
|
6997
7367
|
/******/ })()
|
|
6998
7368
|
;
|