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/esm/scorm-again.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/******/ var __webpack_modules__ = ({
|
|
2
2
|
|
|
3
|
-
/***/
|
|
3
|
+
/***/ 916:
|
|
4
4
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5
5
|
|
|
6
|
+
// ESM COMPAT FLAG
|
|
7
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6
8
|
|
|
7
9
|
// EXPORTS
|
|
8
10
|
__webpack_require__.d(__webpack_exports__, {
|
|
9
|
-
|
|
11
|
+
AICCImpl: function() { return /* binding */ AICCImpl; }
|
|
10
12
|
});
|
|
11
13
|
|
|
12
14
|
// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs
|
|
@@ -21,6 +23,27 @@ var api_constants = __webpack_require__(340);
|
|
|
21
23
|
var array = __webpack_require__(589);
|
|
22
24
|
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
23
25
|
var exceptions = __webpack_require__(784);
|
|
26
|
+
;// ./src/exceptions/aicc_exceptions.ts
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
var aicc_errors = api_constants.aicc_constants.error_descriptions;
|
|
31
|
+
var AICCValidationError = (function (_super) {
|
|
32
|
+
(0,tslib_es6.__extends)(AICCValidationError, _super);
|
|
33
|
+
function AICCValidationError(errorCode) {
|
|
34
|
+
var _this = this;
|
|
35
|
+
if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {
|
|
36
|
+
_this = _super.call(this, errorCode, aicc_errors[String(errorCode)].basicMessage, aicc_errors[String(errorCode)].detailMessage) || this;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
_this = _super.call(this, 101, aicc_errors["101"].basicMessage, aicc_errors["101"].detailMessage) || this;
|
|
40
|
+
}
|
|
41
|
+
return _this;
|
|
42
|
+
}
|
|
43
|
+
return AICCValidationError;
|
|
44
|
+
}(exceptions.ValidationError));
|
|
45
|
+
|
|
46
|
+
|
|
24
47
|
// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts
|
|
25
48
|
var base_cmi = __webpack_require__(319);
|
|
26
49
|
// EXTERNAL MODULE: ./src/constants/error_codes.ts
|
|
@@ -31,9 +54,8 @@ var validation = __webpack_require__(449);
|
|
|
31
54
|
|
|
32
55
|
|
|
33
56
|
|
|
34
|
-
var aicc_error_codes = error_codes/* default */.A.scorm12;
|
|
35
57
|
function checkAICCValidFormat(value, regexPattern, allowEmptyString) {
|
|
36
|
-
return (0,validation
|
|
58
|
+
return (0,validation.checkValidFormat)(value, regexPattern, error_codes.scorm12_errors.TYPE_MISMATCH, AICCValidationError, allowEmptyString);
|
|
37
59
|
}
|
|
38
60
|
|
|
39
61
|
// EXTERNAL MODULE: ./src/constants/regex.ts
|
|
@@ -48,7 +70,7 @@ var regex = __webpack_require__(417);
|
|
|
48
70
|
|
|
49
71
|
|
|
50
72
|
var CMIEvaluation = (function (_super) {
|
|
51
|
-
(0,tslib_es6
|
|
73
|
+
(0,tslib_es6.__extends)(CMIEvaluation, _super);
|
|
52
74
|
function CMIEvaluation() {
|
|
53
75
|
var _this = _super.call(this) || this;
|
|
54
76
|
_this.comments = new CMIEvaluationComments();
|
|
@@ -59,6 +81,11 @@ var CMIEvaluation = (function (_super) {
|
|
|
59
81
|
_super.prototype.initialize.call(this);
|
|
60
82
|
(_a = this.comments) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
61
83
|
};
|
|
84
|
+
CMIEvaluation.prototype.reset = function () {
|
|
85
|
+
var _a;
|
|
86
|
+
this._initialized = false;
|
|
87
|
+
(_a = this.comments) === null || _a === void 0 ? void 0 : _a.reset();
|
|
88
|
+
};
|
|
62
89
|
CMIEvaluation.prototype.toJSON = function () {
|
|
63
90
|
this.jsonString = true;
|
|
64
91
|
var result = {
|
|
@@ -68,21 +95,21 @@ var CMIEvaluation = (function (_super) {
|
|
|
68
95
|
return result;
|
|
69
96
|
};
|
|
70
97
|
return CMIEvaluation;
|
|
71
|
-
}(base_cmi
|
|
98
|
+
}(base_cmi.BaseCMI));
|
|
72
99
|
|
|
73
100
|
var CMIEvaluationComments = (function (_super) {
|
|
74
|
-
(0,tslib_es6
|
|
101
|
+
(0,tslib_es6.__extends)(CMIEvaluationComments, _super);
|
|
75
102
|
function CMIEvaluationComments() {
|
|
76
103
|
return _super.call(this, {
|
|
77
|
-
children: api_constants
|
|
78
|
-
errorCode: error_codes
|
|
79
|
-
errorClass:
|
|
104
|
+
children: api_constants.aicc_constants.comments_children,
|
|
105
|
+
errorCode: error_codes.scorm12_errors.INVALID_SET_VALUE,
|
|
106
|
+
errorClass: AICCValidationError,
|
|
80
107
|
}) || this;
|
|
81
108
|
}
|
|
82
109
|
return CMIEvaluationComments;
|
|
83
|
-
}(array
|
|
110
|
+
}(array.CMIArray));
|
|
84
111
|
var CMIEvaluationCommentsObject = (function (_super) {
|
|
85
|
-
(0,tslib_es6
|
|
112
|
+
(0,tslib_es6.__extends)(CMIEvaluationCommentsObject, _super);
|
|
86
113
|
function CMIEvaluationCommentsObject() {
|
|
87
114
|
var _this = _super.call(this) || this;
|
|
88
115
|
_this._content = "";
|
|
@@ -90,12 +117,18 @@ var CMIEvaluationCommentsObject = (function (_super) {
|
|
|
90
117
|
_this._time = "";
|
|
91
118
|
return _this;
|
|
92
119
|
}
|
|
120
|
+
CMIEvaluationCommentsObject.prototype.reset = function () {
|
|
121
|
+
this._initialized = false;
|
|
122
|
+
this._content = "";
|
|
123
|
+
this._location = "";
|
|
124
|
+
this._time = "";
|
|
125
|
+
};
|
|
93
126
|
Object.defineProperty(CMIEvaluationCommentsObject.prototype, "content", {
|
|
94
127
|
get: function () {
|
|
95
128
|
return this._content;
|
|
96
129
|
},
|
|
97
130
|
set: function (content) {
|
|
98
|
-
if (checkAICCValidFormat(content, regex
|
|
131
|
+
if (checkAICCValidFormat(content, regex.aicc_regex.CMIString256)) {
|
|
99
132
|
this._content = content;
|
|
100
133
|
}
|
|
101
134
|
},
|
|
@@ -107,7 +140,7 @@ var CMIEvaluationCommentsObject = (function (_super) {
|
|
|
107
140
|
return this._location;
|
|
108
141
|
},
|
|
109
142
|
set: function (location) {
|
|
110
|
-
if (checkAICCValidFormat(location, regex
|
|
143
|
+
if (checkAICCValidFormat(location, regex.aicc_regex.CMIString256)) {
|
|
111
144
|
this._location = location;
|
|
112
145
|
}
|
|
113
146
|
},
|
|
@@ -119,7 +152,7 @@ var CMIEvaluationCommentsObject = (function (_super) {
|
|
|
119
152
|
return this._time;
|
|
120
153
|
},
|
|
121
154
|
set: function (time) {
|
|
122
|
-
if (checkAICCValidFormat(time, regex
|
|
155
|
+
if (checkAICCValidFormat(time, regex.aicc_regex.CMITime)) {
|
|
123
156
|
this._time = time;
|
|
124
157
|
}
|
|
125
158
|
},
|
|
@@ -137,7 +170,7 @@ var CMIEvaluationCommentsObject = (function (_super) {
|
|
|
137
170
|
return result;
|
|
138
171
|
};
|
|
139
172
|
return CMIEvaluationCommentsObject;
|
|
140
|
-
}(base_cmi
|
|
173
|
+
}(base_cmi.BaseCMI));
|
|
141
174
|
|
|
142
175
|
|
|
143
176
|
// EXTERNAL MODULE: ./src/cmi/scorm12/student_preference.ts
|
|
@@ -152,17 +185,17 @@ var student_preference = __webpack_require__(181);
|
|
|
152
185
|
|
|
153
186
|
|
|
154
187
|
var AICCStudentPreferences = (function (_super) {
|
|
155
|
-
(0,tslib_es6
|
|
188
|
+
(0,tslib_es6.__extends)(AICCStudentPreferences, _super);
|
|
156
189
|
function AICCStudentPreferences() {
|
|
157
|
-
var _this = _super.call(this, api_constants
|
|
190
|
+
var _this = _super.call(this, api_constants.aicc_constants.student_preference_children) || this;
|
|
158
191
|
_this._lesson_type = "";
|
|
159
192
|
_this._text_color = "";
|
|
160
193
|
_this._text_location = "";
|
|
161
194
|
_this._text_size = "";
|
|
162
195
|
_this._video = "";
|
|
163
|
-
_this.windows = new array
|
|
164
|
-
errorCode: error_codes
|
|
165
|
-
errorClass:
|
|
196
|
+
_this.windows = new array.CMIArray({
|
|
197
|
+
errorCode: error_codes.scorm12_errors.INVALID_SET_VALUE,
|
|
198
|
+
errorClass: AICCValidationError,
|
|
166
199
|
children: "",
|
|
167
200
|
});
|
|
168
201
|
return _this;
|
|
@@ -177,7 +210,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
177
210
|
return this._lesson_type;
|
|
178
211
|
},
|
|
179
212
|
set: function (lesson_type) {
|
|
180
|
-
if (checkAICCValidFormat(lesson_type, regex
|
|
213
|
+
if (checkAICCValidFormat(lesson_type, regex.aicc_regex.CMIString256)) {
|
|
181
214
|
this._lesson_type = lesson_type;
|
|
182
215
|
}
|
|
183
216
|
},
|
|
@@ -189,7 +222,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
189
222
|
return this._text_color;
|
|
190
223
|
},
|
|
191
224
|
set: function (text_color) {
|
|
192
|
-
if (checkAICCValidFormat(text_color, regex
|
|
225
|
+
if (checkAICCValidFormat(text_color, regex.aicc_regex.CMIString256)) {
|
|
193
226
|
this._text_color = text_color;
|
|
194
227
|
}
|
|
195
228
|
},
|
|
@@ -201,7 +234,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
201
234
|
return this._text_location;
|
|
202
235
|
},
|
|
203
236
|
set: function (text_location) {
|
|
204
|
-
if (checkAICCValidFormat(text_location, regex
|
|
237
|
+
if (checkAICCValidFormat(text_location, regex.aicc_regex.CMIString256)) {
|
|
205
238
|
this._text_location = text_location;
|
|
206
239
|
}
|
|
207
240
|
},
|
|
@@ -213,7 +246,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
213
246
|
return this._text_size;
|
|
214
247
|
},
|
|
215
248
|
set: function (text_size) {
|
|
216
|
-
if (checkAICCValidFormat(text_size, regex
|
|
249
|
+
if (checkAICCValidFormat(text_size, regex.aicc_regex.CMIString256)) {
|
|
217
250
|
this._text_size = text_size;
|
|
218
251
|
}
|
|
219
252
|
},
|
|
@@ -225,7 +258,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
225
258
|
return this._video;
|
|
226
259
|
},
|
|
227
260
|
set: function (video) {
|
|
228
|
-
if (checkAICCValidFormat(video, regex
|
|
261
|
+
if (checkAICCValidFormat(video, regex.aicc_regex.CMIString256)) {
|
|
229
262
|
this._video = video;
|
|
230
263
|
}
|
|
231
264
|
},
|
|
@@ -250,7 +283,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
250
283
|
return result;
|
|
251
284
|
};
|
|
252
285
|
return AICCStudentPreferences;
|
|
253
|
-
}(student_preference
|
|
286
|
+
}(student_preference.CMIStudentPreference));
|
|
254
287
|
|
|
255
288
|
|
|
256
289
|
;// ./src/cmi/aicc/student_demographics.ts
|
|
@@ -260,10 +293,10 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
260
293
|
|
|
261
294
|
|
|
262
295
|
var CMIStudentDemographics = (function (_super) {
|
|
263
|
-
(0,tslib_es6
|
|
296
|
+
(0,tslib_es6.__extends)(CMIStudentDemographics, _super);
|
|
264
297
|
function CMIStudentDemographics() {
|
|
265
298
|
var _this = _super.call(this) || this;
|
|
266
|
-
_this.__children = api_constants
|
|
299
|
+
_this.__children = api_constants.aicc_constants.student_demographics_children;
|
|
267
300
|
_this._city = "";
|
|
268
301
|
_this._class = "";
|
|
269
302
|
_this._company = "";
|
|
@@ -279,6 +312,9 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
279
312
|
_this._years_experience = "";
|
|
280
313
|
return _this;
|
|
281
314
|
}
|
|
315
|
+
CMIStudentDemographics.prototype.reset = function () {
|
|
316
|
+
this._initialized = false;
|
|
317
|
+
};
|
|
282
318
|
Object.defineProperty(CMIStudentDemographics.prototype, "_children", {
|
|
283
319
|
get: function () {
|
|
284
320
|
return this.__children;
|
|
@@ -292,7 +328,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
292
328
|
},
|
|
293
329
|
set: function (city) {
|
|
294
330
|
if (this.initialized) {
|
|
295
|
-
throw new
|
|
331
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
296
332
|
}
|
|
297
333
|
else {
|
|
298
334
|
this._city = city;
|
|
@@ -307,7 +343,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
307
343
|
},
|
|
308
344
|
set: function (clazz) {
|
|
309
345
|
if (this.initialized) {
|
|
310
|
-
throw new
|
|
346
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
311
347
|
}
|
|
312
348
|
else {
|
|
313
349
|
this._class = clazz;
|
|
@@ -322,7 +358,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
322
358
|
},
|
|
323
359
|
set: function (company) {
|
|
324
360
|
if (this.initialized) {
|
|
325
|
-
throw new
|
|
361
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
326
362
|
}
|
|
327
363
|
else {
|
|
328
364
|
this._company = company;
|
|
@@ -337,7 +373,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
337
373
|
},
|
|
338
374
|
set: function (country) {
|
|
339
375
|
if (this.initialized) {
|
|
340
|
-
throw new
|
|
376
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
341
377
|
}
|
|
342
378
|
else {
|
|
343
379
|
this._country = country;
|
|
@@ -352,7 +388,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
352
388
|
},
|
|
353
389
|
set: function (experience) {
|
|
354
390
|
if (this.initialized) {
|
|
355
|
-
throw new
|
|
391
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
356
392
|
}
|
|
357
393
|
else {
|
|
358
394
|
this._experience = experience;
|
|
@@ -367,7 +403,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
367
403
|
},
|
|
368
404
|
set: function (familiar_name) {
|
|
369
405
|
if (this.initialized) {
|
|
370
|
-
throw new
|
|
406
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
371
407
|
}
|
|
372
408
|
else {
|
|
373
409
|
this._familiar_name = familiar_name;
|
|
@@ -382,7 +418,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
382
418
|
},
|
|
383
419
|
set: function (instructor_name) {
|
|
384
420
|
if (this.initialized) {
|
|
385
|
-
throw new
|
|
421
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
386
422
|
}
|
|
387
423
|
else {
|
|
388
424
|
this._instructor_name = instructor_name;
|
|
@@ -397,7 +433,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
397
433
|
},
|
|
398
434
|
set: function (title) {
|
|
399
435
|
if (this.initialized) {
|
|
400
|
-
throw new
|
|
436
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
401
437
|
}
|
|
402
438
|
else {
|
|
403
439
|
this._title = title;
|
|
@@ -412,7 +448,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
412
448
|
},
|
|
413
449
|
set: function (native_language) {
|
|
414
450
|
if (this.initialized) {
|
|
415
|
-
throw new
|
|
451
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
416
452
|
}
|
|
417
453
|
else {
|
|
418
454
|
this._native_language = native_language;
|
|
@@ -427,7 +463,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
427
463
|
},
|
|
428
464
|
set: function (state) {
|
|
429
465
|
if (this.initialized) {
|
|
430
|
-
throw new
|
|
466
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
431
467
|
}
|
|
432
468
|
else {
|
|
433
469
|
this._state = state;
|
|
@@ -442,7 +478,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
442
478
|
},
|
|
443
479
|
set: function (street_address) {
|
|
444
480
|
if (this.initialized) {
|
|
445
|
-
throw new
|
|
481
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
446
482
|
}
|
|
447
483
|
else {
|
|
448
484
|
this._street_address = street_address;
|
|
@@ -457,7 +493,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
457
493
|
},
|
|
458
494
|
set: function (telephone) {
|
|
459
495
|
if (this.initialized) {
|
|
460
|
-
throw new
|
|
496
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
461
497
|
}
|
|
462
498
|
else {
|
|
463
499
|
this._telephone = telephone;
|
|
@@ -472,7 +508,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
472
508
|
},
|
|
473
509
|
set: function (years_experience) {
|
|
474
510
|
if (this.initialized) {
|
|
475
|
-
throw new
|
|
511
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
476
512
|
}
|
|
477
513
|
else {
|
|
478
514
|
this._years_experience = years_experience;
|
|
@@ -502,7 +538,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
502
538
|
return result;
|
|
503
539
|
};
|
|
504
540
|
return CMIStudentDemographics;
|
|
505
|
-
}(base_cmi
|
|
541
|
+
}(base_cmi.BaseCMI));
|
|
506
542
|
|
|
507
543
|
|
|
508
544
|
// EXTERNAL MODULE: ./src/cmi/common/score.ts
|
|
@@ -518,28 +554,28 @@ var score = __webpack_require__(434);
|
|
|
518
554
|
|
|
519
555
|
|
|
520
556
|
var CMITries = (function (_super) {
|
|
521
|
-
(0,tslib_es6
|
|
557
|
+
(0,tslib_es6.__extends)(CMITries, _super);
|
|
522
558
|
function CMITries() {
|
|
523
559
|
return _super.call(this, {
|
|
524
|
-
children: api_constants
|
|
560
|
+
children: api_constants.aicc_constants.tries_children,
|
|
525
561
|
}) || this;
|
|
526
562
|
}
|
|
527
563
|
return CMITries;
|
|
528
|
-
}(array
|
|
564
|
+
}(array.CMIArray));
|
|
529
565
|
|
|
530
566
|
var CMITriesObject = (function (_super) {
|
|
531
|
-
(0,tslib_es6
|
|
567
|
+
(0,tslib_es6.__extends)(CMITriesObject, _super);
|
|
532
568
|
function CMITriesObject() {
|
|
533
569
|
var _this = _super.call(this) || this;
|
|
534
570
|
_this._status = "";
|
|
535
571
|
_this._time = "";
|
|
536
|
-
_this.score = new score
|
|
537
|
-
score_children: api_constants
|
|
538
|
-
score_range: regex
|
|
539
|
-
invalidErrorCode: error_codes
|
|
540
|
-
invalidTypeCode: error_codes
|
|
541
|
-
invalidRangeCode: error_codes
|
|
542
|
-
errorClass:
|
|
572
|
+
_this.score = new score.CMIScore({
|
|
573
|
+
score_children: api_constants.aicc_constants.score_children,
|
|
574
|
+
score_range: regex.aicc_regex.score_range,
|
|
575
|
+
invalidErrorCode: error_codes.scorm12_errors.INVALID_SET_VALUE,
|
|
576
|
+
invalidTypeCode: error_codes.scorm12_errors.TYPE_MISMATCH,
|
|
577
|
+
invalidRangeCode: error_codes.scorm12_errors.VALUE_OUT_OF_RANGE,
|
|
578
|
+
errorClass: AICCValidationError,
|
|
543
579
|
});
|
|
544
580
|
return _this;
|
|
545
581
|
}
|
|
@@ -548,12 +584,19 @@ var CMITriesObject = (function (_super) {
|
|
|
548
584
|
_super.prototype.initialize.call(this);
|
|
549
585
|
(_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
550
586
|
};
|
|
587
|
+
CMITriesObject.prototype.reset = function () {
|
|
588
|
+
var _a;
|
|
589
|
+
this._initialized = false;
|
|
590
|
+
this._status = "";
|
|
591
|
+
this._time = "";
|
|
592
|
+
(_a = this.score) === null || _a === void 0 ? void 0 : _a.reset();
|
|
593
|
+
};
|
|
551
594
|
Object.defineProperty(CMITriesObject.prototype, "status", {
|
|
552
595
|
get: function () {
|
|
553
596
|
return this._status;
|
|
554
597
|
},
|
|
555
598
|
set: function (status) {
|
|
556
|
-
if (checkAICCValidFormat(status, regex
|
|
599
|
+
if (checkAICCValidFormat(status, regex.aicc_regex.CMIStatus2)) {
|
|
557
600
|
this._status = status;
|
|
558
601
|
}
|
|
559
602
|
},
|
|
@@ -565,7 +608,7 @@ var CMITriesObject = (function (_super) {
|
|
|
565
608
|
return this._time;
|
|
566
609
|
},
|
|
567
610
|
set: function (time) {
|
|
568
|
-
if (checkAICCValidFormat(time, regex
|
|
611
|
+
if (checkAICCValidFormat(time, regex.aicc_regex.CMITime)) {
|
|
569
612
|
this._time = time;
|
|
570
613
|
}
|
|
571
614
|
},
|
|
@@ -583,7 +626,7 @@ var CMITriesObject = (function (_super) {
|
|
|
583
626
|
return result;
|
|
584
627
|
};
|
|
585
628
|
return CMITriesObject;
|
|
586
|
-
}(base_cmi
|
|
629
|
+
}(base_cmi.BaseCMI));
|
|
587
630
|
|
|
588
631
|
|
|
589
632
|
// EXTERNAL MODULE: ./src/cmi/scorm12/student_data.ts
|
|
@@ -599,41 +642,47 @@ var student_data = __webpack_require__(532);
|
|
|
599
642
|
|
|
600
643
|
|
|
601
644
|
var CMIAttemptRecords = (function (_super) {
|
|
602
|
-
(0,tslib_es6
|
|
645
|
+
(0,tslib_es6.__extends)(CMIAttemptRecords, _super);
|
|
603
646
|
function CMIAttemptRecords() {
|
|
604
647
|
return _super.call(this, {
|
|
605
|
-
children: api_constants
|
|
648
|
+
children: api_constants.aicc_constants.attempt_records_children,
|
|
606
649
|
}) || this;
|
|
607
650
|
}
|
|
608
651
|
return CMIAttemptRecords;
|
|
609
|
-
}(array
|
|
652
|
+
}(array.CMIArray));
|
|
610
653
|
|
|
611
654
|
var CMIAttemptRecordsObject = (function (_super) {
|
|
612
|
-
(0,tslib_es6
|
|
655
|
+
(0,tslib_es6.__extends)(CMIAttemptRecordsObject, _super);
|
|
613
656
|
function CMIAttemptRecordsObject() {
|
|
614
657
|
var _this = _super.call(this) || this;
|
|
615
658
|
_this._lesson_status = "";
|
|
616
|
-
_this.score = new score
|
|
617
|
-
score_children: api_constants
|
|
618
|
-
score_range: regex
|
|
619
|
-
invalidErrorCode: error_codes
|
|
620
|
-
invalidTypeCode: error_codes
|
|
621
|
-
invalidRangeCode: error_codes
|
|
622
|
-
errorClass:
|
|
659
|
+
_this.score = new score.CMIScore({
|
|
660
|
+
score_children: api_constants.aicc_constants.score_children,
|
|
661
|
+
score_range: regex.aicc_regex.score_range,
|
|
662
|
+
invalidErrorCode: error_codes.scorm12_errors.INVALID_SET_VALUE,
|
|
663
|
+
invalidTypeCode: error_codes.scorm12_errors.TYPE_MISMATCH,
|
|
664
|
+
invalidRangeCode: error_codes.scorm12_errors.VALUE_OUT_OF_RANGE,
|
|
665
|
+
errorClass: AICCValidationError,
|
|
623
666
|
});
|
|
624
667
|
return _this;
|
|
625
668
|
}
|
|
626
669
|
CMIAttemptRecordsObject.prototype.initialize = function () {
|
|
627
670
|
var _a;
|
|
628
671
|
_super.prototype.initialize.call(this);
|
|
672
|
+
this._lesson_status = "";
|
|
629
673
|
(_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
630
674
|
};
|
|
675
|
+
CMIAttemptRecordsObject.prototype.reset = function () {
|
|
676
|
+
var _a;
|
|
677
|
+
this._initialized = false;
|
|
678
|
+
(_a = this.score) === null || _a === void 0 ? void 0 : _a.reset();
|
|
679
|
+
};
|
|
631
680
|
Object.defineProperty(CMIAttemptRecordsObject.prototype, "lesson_status", {
|
|
632
681
|
get: function () {
|
|
633
682
|
return this._lesson_status;
|
|
634
683
|
},
|
|
635
684
|
set: function (lesson_status) {
|
|
636
|
-
if (checkAICCValidFormat(lesson_status, regex
|
|
685
|
+
if (checkAICCValidFormat(lesson_status, regex.aicc_regex.CMIStatus2)) {
|
|
637
686
|
this._lesson_status = lesson_status;
|
|
638
687
|
}
|
|
639
688
|
},
|
|
@@ -650,7 +699,7 @@ var CMIAttemptRecordsObject = (function (_super) {
|
|
|
650
699
|
return result;
|
|
651
700
|
};
|
|
652
701
|
return CMIAttemptRecordsObject;
|
|
653
|
-
}(base_cmi
|
|
702
|
+
}(base_cmi.BaseCMI));
|
|
654
703
|
|
|
655
704
|
|
|
656
705
|
;// ./src/cmi/aicc/student_data.ts
|
|
@@ -662,9 +711,9 @@ var CMIAttemptRecordsObject = (function (_super) {
|
|
|
662
711
|
|
|
663
712
|
|
|
664
713
|
var AICCCMIStudentData = (function (_super) {
|
|
665
|
-
(0,tslib_es6
|
|
714
|
+
(0,tslib_es6.__extends)(AICCCMIStudentData, _super);
|
|
666
715
|
function AICCCMIStudentData() {
|
|
667
|
-
var _this = _super.call(this, api_constants
|
|
716
|
+
var _this = _super.call(this, api_constants.aicc_constants.student_data_children) || this;
|
|
668
717
|
_this._tries_during_lesson = "";
|
|
669
718
|
_this.tries = new CMITries();
|
|
670
719
|
_this.attempt_records = new CMIAttemptRecords();
|
|
@@ -676,13 +725,19 @@ var AICCCMIStudentData = (function (_super) {
|
|
|
676
725
|
(_a = this.tries) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
677
726
|
(_b = this.attempt_records) === null || _b === void 0 ? void 0 : _b.initialize();
|
|
678
727
|
};
|
|
728
|
+
AICCCMIStudentData.prototype.reset = function () {
|
|
729
|
+
var _a, _b;
|
|
730
|
+
this._initialized = false;
|
|
731
|
+
(_a = this.tries) === null || _a === void 0 ? void 0 : _a.reset(true);
|
|
732
|
+
(_b = this.attempt_records) === null || _b === void 0 ? void 0 : _b.reset(true);
|
|
733
|
+
};
|
|
679
734
|
Object.defineProperty(AICCCMIStudentData.prototype, "tries_during_lesson", {
|
|
680
735
|
get: function () {
|
|
681
736
|
return this._tries_during_lesson;
|
|
682
737
|
},
|
|
683
738
|
set: function (tries_during_lesson) {
|
|
684
739
|
if (this.initialized) {
|
|
685
|
-
throw new
|
|
740
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
686
741
|
}
|
|
687
742
|
else {
|
|
688
743
|
this._tries_during_lesson = tries_during_lesson;
|
|
@@ -704,7 +759,7 @@ var AICCCMIStudentData = (function (_super) {
|
|
|
704
759
|
return result;
|
|
705
760
|
};
|
|
706
761
|
return AICCCMIStudentData;
|
|
707
|
-
}(student_data
|
|
762
|
+
}(student_data.CMIStudentData));
|
|
708
763
|
|
|
709
764
|
|
|
710
765
|
;// ./src/cmi/aicc/paths.ts
|
|
@@ -715,17 +770,17 @@ var AICCCMIStudentData = (function (_super) {
|
|
|
715
770
|
|
|
716
771
|
|
|
717
772
|
var CMIPaths = (function (_super) {
|
|
718
|
-
(0,tslib_es6
|
|
773
|
+
(0,tslib_es6.__extends)(CMIPaths, _super);
|
|
719
774
|
function CMIPaths() {
|
|
720
775
|
return _super.call(this, {
|
|
721
|
-
children: api_constants
|
|
776
|
+
children: api_constants.aicc_constants.paths_children,
|
|
722
777
|
}) || this;
|
|
723
778
|
}
|
|
724
779
|
return CMIPaths;
|
|
725
|
-
}(array
|
|
780
|
+
}(array.CMIArray));
|
|
726
781
|
|
|
727
782
|
var CMIPathsObject = (function (_super) {
|
|
728
|
-
(0,tslib_es6
|
|
783
|
+
(0,tslib_es6.__extends)(CMIPathsObject, _super);
|
|
729
784
|
function CMIPathsObject() {
|
|
730
785
|
var _this = _super.call(this) || this;
|
|
731
786
|
_this._location_id = "";
|
|
@@ -736,12 +791,21 @@ var CMIPathsObject = (function (_super) {
|
|
|
736
791
|
_this._time_in_element = "";
|
|
737
792
|
return _this;
|
|
738
793
|
}
|
|
794
|
+
CMIPathsObject.prototype.reset = function () {
|
|
795
|
+
this._initialized = false;
|
|
796
|
+
this._location_id = "";
|
|
797
|
+
this._date = "";
|
|
798
|
+
this._time = "";
|
|
799
|
+
this._status = "";
|
|
800
|
+
this._why_left = "";
|
|
801
|
+
this._time_in_element = "";
|
|
802
|
+
};
|
|
739
803
|
Object.defineProperty(CMIPathsObject.prototype, "location_id", {
|
|
740
804
|
get: function () {
|
|
741
805
|
return this._location_id;
|
|
742
806
|
},
|
|
743
807
|
set: function (location_id) {
|
|
744
|
-
if (checkAICCValidFormat(location_id, regex
|
|
808
|
+
if (checkAICCValidFormat(location_id, regex.aicc_regex.CMIString256)) {
|
|
745
809
|
this._location_id = location_id;
|
|
746
810
|
}
|
|
747
811
|
},
|
|
@@ -753,7 +817,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
753
817
|
return this._date;
|
|
754
818
|
},
|
|
755
819
|
set: function (date) {
|
|
756
|
-
if (checkAICCValidFormat(date, regex
|
|
820
|
+
if (checkAICCValidFormat(date, regex.aicc_regex.CMIString256)) {
|
|
757
821
|
this._date = date;
|
|
758
822
|
}
|
|
759
823
|
},
|
|
@@ -765,7 +829,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
765
829
|
return this._time;
|
|
766
830
|
},
|
|
767
831
|
set: function (time) {
|
|
768
|
-
if (checkAICCValidFormat(time, regex
|
|
832
|
+
if (checkAICCValidFormat(time, regex.aicc_regex.CMITime)) {
|
|
769
833
|
this._time = time;
|
|
770
834
|
}
|
|
771
835
|
},
|
|
@@ -777,7 +841,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
777
841
|
return this._status;
|
|
778
842
|
},
|
|
779
843
|
set: function (status) {
|
|
780
|
-
if (checkAICCValidFormat(status, regex
|
|
844
|
+
if (checkAICCValidFormat(status, regex.aicc_regex.CMIStatus2)) {
|
|
781
845
|
this._status = status;
|
|
782
846
|
}
|
|
783
847
|
},
|
|
@@ -789,7 +853,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
789
853
|
return this._why_left;
|
|
790
854
|
},
|
|
791
855
|
set: function (why_left) {
|
|
792
|
-
if (checkAICCValidFormat(why_left, regex
|
|
856
|
+
if (checkAICCValidFormat(why_left, regex.aicc_regex.CMIString256)) {
|
|
793
857
|
this._why_left = why_left;
|
|
794
858
|
}
|
|
795
859
|
},
|
|
@@ -801,7 +865,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
801
865
|
return this._time_in_element;
|
|
802
866
|
},
|
|
803
867
|
set: function (time_in_element) {
|
|
804
|
-
if (checkAICCValidFormat(time_in_element, regex
|
|
868
|
+
if (checkAICCValidFormat(time_in_element, regex.aicc_regex.CMITime)) {
|
|
805
869
|
this._time_in_element = time_in_element;
|
|
806
870
|
}
|
|
807
871
|
},
|
|
@@ -822,7 +886,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
822
886
|
return result;
|
|
823
887
|
};
|
|
824
888
|
return CMIPathsObject;
|
|
825
|
-
}(base_cmi
|
|
889
|
+
}(base_cmi.BaseCMI));
|
|
826
890
|
|
|
827
891
|
|
|
828
892
|
;// ./src/cmi/aicc/cmi.ts
|
|
@@ -835,10 +899,10 @@ var CMIPathsObject = (function (_super) {
|
|
|
835
899
|
|
|
836
900
|
|
|
837
901
|
var CMI = (function (_super) {
|
|
838
|
-
(0,tslib_es6
|
|
902
|
+
(0,tslib_es6.__extends)(CMI, _super);
|
|
839
903
|
function CMI(initialized) {
|
|
840
904
|
if (initialized === void 0) { initialized = false; }
|
|
841
|
-
var _this = _super.call(this, api_constants
|
|
905
|
+
var _this = _super.call(this, api_constants.aicc_constants.cmi_children) || this;
|
|
842
906
|
if (initialized)
|
|
843
907
|
_this.initialize();
|
|
844
908
|
_this.student_preference = new AICCStudentPreferences();
|
|
@@ -877,7 +941,7 @@ var CMI = (function (_super) {
|
|
|
877
941
|
return result;
|
|
878
942
|
};
|
|
879
943
|
return CMI;
|
|
880
|
-
}(cmi
|
|
944
|
+
}(cmi.CMI));
|
|
881
945
|
|
|
882
946
|
|
|
883
947
|
// EXTERNAL MODULE: ./src/cmi/scorm12/nav.ts
|
|
@@ -895,26 +959,26 @@ var utilities = __webpack_require__(864);
|
|
|
895
959
|
|
|
896
960
|
|
|
897
961
|
var AICCImpl = (function (_super) {
|
|
898
|
-
(0,tslib_es6
|
|
962
|
+
(0,tslib_es6.__extends)(AICCImpl, _super);
|
|
899
963
|
function AICCImpl(settings) {
|
|
900
964
|
var _this = _super.call(this, settings) || this;
|
|
901
965
|
_this.cmi = new CMI();
|
|
902
|
-
_this.nav = new nav
|
|
966
|
+
_this.nav = new nav.NAV();
|
|
903
967
|
return _this;
|
|
904
968
|
}
|
|
905
969
|
AICCImpl.prototype.getChildElement = function (CMIElement, value, foundFirstIndex) {
|
|
906
970
|
var newChild = _super.prototype.getChildElement.call(this, CMIElement, value, foundFirstIndex);
|
|
907
971
|
if (!newChild) {
|
|
908
|
-
if ((0,utilities
|
|
972
|
+
if ((0,utilities.stringMatches)(CMIElement, "cmi\\.evaluation\\.comments\\.\\d+")) {
|
|
909
973
|
newChild = new CMIEvaluationCommentsObject();
|
|
910
974
|
}
|
|
911
|
-
else if ((0,utilities
|
|
975
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.student_data\\.tries\\.\\d+")) {
|
|
912
976
|
newChild = new CMITriesObject();
|
|
913
977
|
}
|
|
914
|
-
else if ((0,utilities
|
|
978
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.student_data\\.attempt_records\\.\\d+")) {
|
|
915
979
|
newChild = new CMIAttemptRecordsObject();
|
|
916
980
|
}
|
|
917
|
-
else if ((0,utilities
|
|
981
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.paths\\.\\d+")) {
|
|
918
982
|
newChild = new CMIPathsObject();
|
|
919
983
|
}
|
|
920
984
|
}
|
|
@@ -925,7 +989,7 @@ var AICCImpl = (function (_super) {
|
|
|
925
989
|
this.nav = newAPI.nav;
|
|
926
990
|
};
|
|
927
991
|
return AICCImpl;
|
|
928
|
-
}(Scorm12API
|
|
992
|
+
}(Scorm12API.Scorm12Impl));
|
|
929
993
|
|
|
930
994
|
|
|
931
995
|
|
|
@@ -934,10 +998,12 @@ var AICCImpl = (function (_super) {
|
|
|
934
998
|
/***/ 429:
|
|
935
999
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
936
1000
|
|
|
1001
|
+
// ESM COMPAT FLAG
|
|
1002
|
+
__webpack_require__.r(__webpack_exports__);
|
|
937
1003
|
|
|
938
1004
|
// EXPORTS
|
|
939
1005
|
__webpack_require__.d(__webpack_exports__, {
|
|
940
|
-
|
|
1006
|
+
"default": function() { return /* binding */ src_BaseAPI; }
|
|
941
1007
|
});
|
|
942
1008
|
|
|
943
1009
|
// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs
|
|
@@ -946,8 +1012,6 @@ var tslib_es6 = __webpack_require__(635);
|
|
|
946
1012
|
var array = __webpack_require__(589);
|
|
947
1013
|
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
948
1014
|
var exceptions = __webpack_require__(784);
|
|
949
|
-
// EXTERNAL MODULE: ./src/constants/error_codes.ts
|
|
950
|
-
var error_codes = __webpack_require__(797);
|
|
951
1015
|
// EXTERNAL MODULE: ./src/constants/api_constants.ts
|
|
952
1016
|
var api_constants = __webpack_require__(340);
|
|
953
1017
|
// EXTERNAL MODULE: ./src/utilities.ts
|
|
@@ -967,7 +1031,7 @@ var DefaultSettings = {
|
|
|
967
1031
|
dataCommitFormat: "json",
|
|
968
1032
|
commitRequestDataType: "application/json;charset=UTF-8",
|
|
969
1033
|
autoProgress: false,
|
|
970
|
-
logLevel: enums
|
|
1034
|
+
logLevel: enums.LogLevelEnum.ERROR,
|
|
971
1035
|
selfReportSessionTime: false,
|
|
972
1036
|
alwaysSendTotalTime: false,
|
|
973
1037
|
renderCommonCommitFields: false,
|
|
@@ -976,9 +1040,9 @@ var DefaultSettings = {
|
|
|
976
1040
|
xhrWithCredentials: false,
|
|
977
1041
|
fetchMode: "cors",
|
|
978
1042
|
responseHandler: function (response) {
|
|
979
|
-
return (0,tslib_es6
|
|
1043
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
980
1044
|
var responseText, httpResult;
|
|
981
|
-
return (0,tslib_es6
|
|
1045
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
982
1046
|
switch (_a.label) {
|
|
983
1047
|
case 0:
|
|
984
1048
|
if (!(typeof response !== "undefined")) return [3, 2];
|
|
@@ -993,13 +1057,13 @@ var DefaultSettings = {
|
|
|
993
1057
|
!{}.hasOwnProperty.call(httpResult, "result")) {
|
|
994
1058
|
if (response.status === 200) {
|
|
995
1059
|
return [2, {
|
|
996
|
-
result: api_constants
|
|
1060
|
+
result: api_constants.global_constants.SCORM_TRUE,
|
|
997
1061
|
errorCode: 0,
|
|
998
1062
|
}];
|
|
999
1063
|
}
|
|
1000
1064
|
else {
|
|
1001
1065
|
return [2, {
|
|
1002
|
-
result: api_constants
|
|
1066
|
+
result: api_constants.global_constants.SCORM_FALSE,
|
|
1003
1067
|
errorCode: 101,
|
|
1004
1068
|
}];
|
|
1005
1069
|
}
|
|
@@ -1009,14 +1073,14 @@ var DefaultSettings = {
|
|
|
1009
1073
|
result: httpResult.result,
|
|
1010
1074
|
errorCode: httpResult.errorCode
|
|
1011
1075
|
? httpResult.errorCode
|
|
1012
|
-
: httpResult.result === api_constants
|
|
1076
|
+
: httpResult.result === api_constants.global_constants.SCORM_TRUE
|
|
1013
1077
|
? 0
|
|
1014
1078
|
: 101,
|
|
1015
1079
|
}];
|
|
1016
1080
|
}
|
|
1017
1081
|
_a.label = 2;
|
|
1018
1082
|
case 2: return [2, {
|
|
1019
|
-
result: api_constants
|
|
1083
|
+
result: api_constants.global_constants.SCORM_FALSE,
|
|
1020
1084
|
errorCode: 101,
|
|
1021
1085
|
}];
|
|
1022
1086
|
}
|
|
@@ -1031,25 +1095,25 @@ var DefaultSettings = {
|
|
|
1031
1095
|
case "4":
|
|
1032
1096
|
case 4:
|
|
1033
1097
|
case "ERROR":
|
|
1034
|
-
case enums
|
|
1098
|
+
case enums.LogLevelEnum.ERROR:
|
|
1035
1099
|
console.error(logMessage);
|
|
1036
1100
|
break;
|
|
1037
1101
|
case "3":
|
|
1038
1102
|
case 3:
|
|
1039
1103
|
case "WARN":
|
|
1040
|
-
case enums
|
|
1104
|
+
case enums.LogLevelEnum.WARN:
|
|
1041
1105
|
console.warn(logMessage);
|
|
1042
1106
|
break;
|
|
1043
1107
|
case "2":
|
|
1044
1108
|
case 2:
|
|
1045
1109
|
case "INFO":
|
|
1046
|
-
case enums
|
|
1110
|
+
case enums.LogLevelEnum.INFO:
|
|
1047
1111
|
console.info(logMessage);
|
|
1048
1112
|
break;
|
|
1049
1113
|
case "1":
|
|
1050
1114
|
case 1:
|
|
1051
1115
|
case "DEBUG":
|
|
1052
|
-
case enums
|
|
1116
|
+
case enums.LogLevelEnum.DEBUG:
|
|
1053
1117
|
if (console.debug) {
|
|
1054
1118
|
console.debug(logMessage);
|
|
1055
1119
|
}
|
|
@@ -1061,6 +1125,7 @@ var DefaultSettings = {
|
|
|
1061
1125
|
},
|
|
1062
1126
|
scoItemIds: [],
|
|
1063
1127
|
scoItemIdValidator: false,
|
|
1128
|
+
globalObjectiveIds: [],
|
|
1064
1129
|
};
|
|
1065
1130
|
|
|
1066
1131
|
;// ./src/helpers/scheduled_commit.ts
|
|
@@ -1081,7 +1146,7 @@ var ScheduledCommit = (function () {
|
|
|
1081
1146
|
ScheduledCommit.prototype.wrapper = function () {
|
|
1082
1147
|
var _this = this;
|
|
1083
1148
|
if (!this._cancelled) {
|
|
1084
|
-
(function () { return (0,tslib_es6
|
|
1149
|
+
(function () { return (0,tslib_es6.__awaiter)(_this, void 0, void 0, function () { return (0,tslib_es6.__generator)(this, function (_a) {
|
|
1085
1150
|
switch (_a.label) {
|
|
1086
1151
|
case 0: return [4, this._API.commit(this._callback)];
|
|
1087
1152
|
case 1: return [2, _a.sent()];
|
|
@@ -1102,7 +1167,6 @@ var ScheduledCommit = (function () {
|
|
|
1102
1167
|
|
|
1103
1168
|
|
|
1104
1169
|
|
|
1105
|
-
|
|
1106
1170
|
var BaseAPI = (function () {
|
|
1107
1171
|
function BaseAPI(error_codes, settings) {
|
|
1108
1172
|
var _newTarget = this.constructor;
|
|
@@ -1110,7 +1174,7 @@ var BaseAPI = (function () {
|
|
|
1110
1174
|
if (_newTarget === BaseAPI) {
|
|
1111
1175
|
throw new TypeError("Cannot construct BaseAPI instances directly");
|
|
1112
1176
|
}
|
|
1113
|
-
this.currentState = api_constants
|
|
1177
|
+
this.currentState = api_constants.global_constants.STATE_NOT_INITIALIZED;
|
|
1114
1178
|
this.lastErrorCode = "0";
|
|
1115
1179
|
this.listenerArray = [];
|
|
1116
1180
|
this._error_codes = error_codes;
|
|
@@ -1120,17 +1184,20 @@ var BaseAPI = (function () {
|
|
|
1120
1184
|
this.apiLogLevel = this.settings.logLevel;
|
|
1121
1185
|
this.selfReportSessionTime = this.settings.selfReportSessionTime;
|
|
1122
1186
|
if (this.apiLogLevel === undefined) {
|
|
1123
|
-
this.apiLogLevel = enums
|
|
1187
|
+
this.apiLogLevel = enums.LogLevelEnum.NONE;
|
|
1124
1188
|
}
|
|
1125
1189
|
}
|
|
1126
1190
|
BaseAPI.prototype.commonReset = function (settings) {
|
|
1127
|
-
this.
|
|
1128
|
-
this.
|
|
1191
|
+
this.apiLog("reset", "Called", enums.LogLevelEnum.INFO);
|
|
1192
|
+
this.settings = (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, this.settings), settings);
|
|
1193
|
+
this.clearScheduledCommit();
|
|
1194
|
+
this.currentState = api_constants.global_constants.STATE_NOT_INITIALIZED;
|
|
1129
1195
|
this.lastErrorCode = "0";
|
|
1130
1196
|
this.listenerArray = [];
|
|
1197
|
+
this.startingData = undefined;
|
|
1131
1198
|
};
|
|
1132
1199
|
BaseAPI.prototype.initialize = function (callbackName, initializeMessage, terminationMessage) {
|
|
1133
|
-
var returnValue = api_constants
|
|
1200
|
+
var returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1134
1201
|
if (this.isInitialized()) {
|
|
1135
1202
|
this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);
|
|
1136
1203
|
}
|
|
@@ -1141,17 +1208,17 @@ var BaseAPI = (function () {
|
|
|
1141
1208
|
if (this.selfReportSessionTime) {
|
|
1142
1209
|
this.cmi.setStartTime();
|
|
1143
1210
|
}
|
|
1144
|
-
this.currentState = api_constants
|
|
1211
|
+
this.currentState = api_constants.global_constants.STATE_INITIALIZED;
|
|
1145
1212
|
this.lastErrorCode = "0";
|
|
1146
|
-
returnValue = api_constants
|
|
1213
|
+
returnValue = api_constants.global_constants.SCORM_TRUE;
|
|
1147
1214
|
this.processListeners(callbackName);
|
|
1148
1215
|
}
|
|
1149
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
1216
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1150
1217
|
this.clearSCORMError(returnValue);
|
|
1151
1218
|
return returnValue;
|
|
1152
1219
|
};
|
|
1153
1220
|
BaseAPI.prototype.apiLog = function (functionName, logMessage, messageLevel, CMIElement) {
|
|
1154
|
-
logMessage = (0,utilities
|
|
1221
|
+
logMessage = (0,utilities.formatMessage)(functionName, logMessage, CMIElement);
|
|
1155
1222
|
if (messageLevel >= this.apiLogLevel) {
|
|
1156
1223
|
this.settings.onLogMessage(messageLevel, logMessage);
|
|
1157
1224
|
}
|
|
@@ -1168,20 +1235,20 @@ var BaseAPI = (function () {
|
|
|
1168
1235
|
return this._settings;
|
|
1169
1236
|
},
|
|
1170
1237
|
set: function (settings) {
|
|
1171
|
-
this._settings = (0,tslib_es6
|
|
1238
|
+
this._settings = (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, this._settings), settings);
|
|
1172
1239
|
},
|
|
1173
1240
|
enumerable: false,
|
|
1174
1241
|
configurable: true
|
|
1175
1242
|
});
|
|
1176
1243
|
BaseAPI.prototype.terminate = function (callbackName, checkTerminated) {
|
|
1177
|
-
return (0,tslib_es6
|
|
1244
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
1178
1245
|
var returnValue, result;
|
|
1179
|
-
return (0,tslib_es6
|
|
1246
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
1180
1247
|
switch (_a.label) {
|
|
1181
1248
|
case 0:
|
|
1182
|
-
returnValue = api_constants
|
|
1249
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1183
1250
|
if (!this.checkState(checkTerminated, this._error_codes.TERMINATION_BEFORE_INIT, this._error_codes.MULTIPLE_TERMINATION)) return [3, 2];
|
|
1184
|
-
this.currentState = api_constants
|
|
1251
|
+
this.currentState = api_constants.global_constants.STATE_TERMINATED;
|
|
1185
1252
|
return [4, this.storeData(true)];
|
|
1186
1253
|
case 1:
|
|
1187
1254
|
result = _a.sent();
|
|
@@ -1191,14 +1258,14 @@ var BaseAPI = (function () {
|
|
|
1191
1258
|
returnValue =
|
|
1192
1259
|
typeof result !== "undefined" && result.result
|
|
1193
1260
|
? result.result
|
|
1194
|
-
: api_constants
|
|
1261
|
+
: api_constants.global_constants.SCORM_FALSE;
|
|
1195
1262
|
if (checkTerminated)
|
|
1196
1263
|
this.lastErrorCode = "0";
|
|
1197
|
-
returnValue = api_constants
|
|
1264
|
+
returnValue = api_constants.global_constants.SCORM_TRUE;
|
|
1198
1265
|
this.processListeners(callbackName);
|
|
1199
1266
|
_a.label = 2;
|
|
1200
1267
|
case 2:
|
|
1201
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
1268
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1202
1269
|
this.clearSCORMError(returnValue);
|
|
1203
1270
|
return [2, returnValue];
|
|
1204
1271
|
}
|
|
@@ -1218,7 +1285,7 @@ var BaseAPI = (function () {
|
|
|
1218
1285
|
}
|
|
1219
1286
|
this.processListeners(callbackName, CMIElement);
|
|
1220
1287
|
}
|
|
1221
|
-
this.apiLog(callbackName, ": returned: " + returnValue, enums
|
|
1288
|
+
this.apiLog(callbackName, ": returned: " + returnValue, enums.LogLevelEnum.INFO, CMIElement);
|
|
1222
1289
|
if (returnValue === undefined) {
|
|
1223
1290
|
return "";
|
|
1224
1291
|
}
|
|
@@ -1229,7 +1296,7 @@ var BaseAPI = (function () {
|
|
|
1229
1296
|
if (value !== undefined) {
|
|
1230
1297
|
value = String(value);
|
|
1231
1298
|
}
|
|
1232
|
-
var returnValue = api_constants
|
|
1299
|
+
var returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1233
1300
|
if (this.checkState(checkTerminated, this._error_codes.STORE_BEFORE_INIT, this._error_codes.STORE_AFTER_TERM)) {
|
|
1234
1301
|
if (checkTerminated)
|
|
1235
1302
|
this.lastErrorCode = "0";
|
|
@@ -1242,26 +1309,26 @@ var BaseAPI = (function () {
|
|
|
1242
1309
|
this.processListeners(callbackName, CMIElement, value);
|
|
1243
1310
|
}
|
|
1244
1311
|
if (returnValue === undefined) {
|
|
1245
|
-
returnValue = api_constants
|
|
1312
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1246
1313
|
}
|
|
1247
1314
|
if (String(this.lastErrorCode) === "0") {
|
|
1248
1315
|
if (this.settings.autocommit) {
|
|
1249
1316
|
this.scheduleCommit(this.settings.autocommitSeconds * 1000, commitCallback);
|
|
1250
1317
|
}
|
|
1251
1318
|
}
|
|
1252
|
-
this.apiLog(callbackName, ": " + value + ": result: " + returnValue, enums
|
|
1319
|
+
this.apiLog(callbackName, ": " + value + ": result: " + returnValue, enums.LogLevelEnum.INFO, CMIElement);
|
|
1253
1320
|
this.clearSCORMError(returnValue);
|
|
1254
1321
|
return returnValue;
|
|
1255
1322
|
};
|
|
1256
1323
|
BaseAPI.prototype.commit = function (callbackName_1) {
|
|
1257
|
-
return (0,tslib_es6
|
|
1324
|
+
return (0,tslib_es6.__awaiter)(this, arguments, void 0, function (callbackName, checkTerminated) {
|
|
1258
1325
|
var returnValue, result;
|
|
1259
1326
|
if (checkTerminated === void 0) { checkTerminated = false; }
|
|
1260
|
-
return (0,tslib_es6
|
|
1327
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
1261
1328
|
switch (_a.label) {
|
|
1262
1329
|
case 0:
|
|
1263
1330
|
this.clearScheduledCommit();
|
|
1264
|
-
returnValue = api_constants
|
|
1331
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1265
1332
|
if (!this.checkState(checkTerminated, this._error_codes.COMMIT_BEFORE_INIT, this._error_codes.COMMIT_AFTER_TERM)) return [3, 2];
|
|
1266
1333
|
return [4, this.storeData(false)];
|
|
1267
1334
|
case 1:
|
|
@@ -1272,14 +1339,14 @@ var BaseAPI = (function () {
|
|
|
1272
1339
|
returnValue =
|
|
1273
1340
|
typeof result !== "undefined" && result.result
|
|
1274
1341
|
? result.result
|
|
1275
|
-
: api_constants
|
|
1276
|
-
this.apiLog(callbackName, " Result: " + returnValue, enums
|
|
1342
|
+
: api_constants.global_constants.SCORM_FALSE;
|
|
1343
|
+
this.apiLog(callbackName, " Result: " + returnValue, enums.LogLevelEnum.DEBUG, "HttpRequest");
|
|
1277
1344
|
if (checkTerminated)
|
|
1278
1345
|
this.lastErrorCode = "0";
|
|
1279
1346
|
this.processListeners(callbackName);
|
|
1280
1347
|
_a.label = 2;
|
|
1281
1348
|
case 2:
|
|
1282
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
1349
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1283
1350
|
this.clearSCORMError(returnValue);
|
|
1284
1351
|
return [2, returnValue];
|
|
1285
1352
|
}
|
|
@@ -1289,7 +1356,7 @@ var BaseAPI = (function () {
|
|
|
1289
1356
|
BaseAPI.prototype.getLastError = function (callbackName) {
|
|
1290
1357
|
var returnValue = String(this.lastErrorCode);
|
|
1291
1358
|
this.processListeners(callbackName);
|
|
1292
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
1359
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1293
1360
|
return returnValue;
|
|
1294
1361
|
};
|
|
1295
1362
|
BaseAPI.prototype.getErrorString = function (callbackName, CMIErrorCode) {
|
|
@@ -1298,7 +1365,7 @@ var BaseAPI = (function () {
|
|
|
1298
1365
|
returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);
|
|
1299
1366
|
this.processListeners(callbackName);
|
|
1300
1367
|
}
|
|
1301
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
1368
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1302
1369
|
return returnValue;
|
|
1303
1370
|
};
|
|
1304
1371
|
BaseAPI.prototype.getDiagnostic = function (callbackName, CMIErrorCode) {
|
|
@@ -1307,7 +1374,7 @@ var BaseAPI = (function () {
|
|
|
1307
1374
|
returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);
|
|
1308
1375
|
this.processListeners(callbackName);
|
|
1309
1376
|
}
|
|
1310
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
1377
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1311
1378
|
return returnValue;
|
|
1312
1379
|
};
|
|
1313
1380
|
BaseAPI.prototype.checkState = function (checkTerminated, beforeInitError, afterTermError) {
|
|
@@ -1333,11 +1400,11 @@ var BaseAPI = (function () {
|
|
|
1333
1400
|
};
|
|
1334
1401
|
BaseAPI.prototype._commonSetCMIValue = function (methodName, scorm2004, CMIElement, value) {
|
|
1335
1402
|
if (!CMIElement || CMIElement === "") {
|
|
1336
|
-
return api_constants
|
|
1403
|
+
return api_constants.global_constants.SCORM_FALSE;
|
|
1337
1404
|
}
|
|
1338
1405
|
var structure = CMIElement.split(".");
|
|
1339
1406
|
var refObject = this;
|
|
1340
|
-
var returnValue = api_constants
|
|
1407
|
+
var returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1341
1408
|
var foundFirstIndex = false;
|
|
1342
1409
|
var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element.");
|
|
1343
1410
|
var invalidErrorCode = scorm2004
|
|
@@ -1351,20 +1418,20 @@ var BaseAPI = (function () {
|
|
|
1351
1418
|
this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);
|
|
1352
1419
|
}
|
|
1353
1420
|
else {
|
|
1354
|
-
refObject = (0,tslib_es6
|
|
1421
|
+
refObject = (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, refObject), { attribute: value });
|
|
1355
1422
|
}
|
|
1356
1423
|
}
|
|
1357
1424
|
else if (!this._checkObjectHasProperty(refObject, attribute)) {
|
|
1358
1425
|
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
1359
1426
|
}
|
|
1360
1427
|
else {
|
|
1361
|
-
if ((0,utilities
|
|
1428
|
+
if ((0,utilities.stringMatches)(CMIElement, "\\.correct_responses\\.\\d+") &&
|
|
1362
1429
|
this.isInitialized()) {
|
|
1363
1430
|
this.validateCorrectResponse(CMIElement, value);
|
|
1364
1431
|
}
|
|
1365
1432
|
if (!scorm2004 || this.lastErrorCode === "0") {
|
|
1366
1433
|
refObject[attribute] = value;
|
|
1367
|
-
returnValue = api_constants
|
|
1434
|
+
returnValue = api_constants.global_constants.SCORM_TRUE;
|
|
1368
1435
|
}
|
|
1369
1436
|
}
|
|
1370
1437
|
}
|
|
@@ -1374,7 +1441,7 @@ var BaseAPI = (function () {
|
|
|
1374
1441
|
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
1375
1442
|
break;
|
|
1376
1443
|
}
|
|
1377
|
-
if (refObject instanceof array
|
|
1444
|
+
if (refObject instanceof array.CMIArray) {
|
|
1378
1445
|
var index = parseInt(structure[idx + 1], 10);
|
|
1379
1446
|
if (!isNaN(index)) {
|
|
1380
1447
|
var item = refObject.childArray[index];
|
|
@@ -1400,8 +1467,8 @@ var BaseAPI = (function () {
|
|
|
1400
1467
|
}
|
|
1401
1468
|
}
|
|
1402
1469
|
}
|
|
1403
|
-
if (returnValue === api_constants
|
|
1404
|
-
this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value), enums
|
|
1470
|
+
if (returnValue === api_constants.global_constants.SCORM_FALSE) {
|
|
1471
|
+
this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value), enums.LogLevelEnum.WARN);
|
|
1405
1472
|
}
|
|
1406
1473
|
return returnValue;
|
|
1407
1474
|
};
|
|
@@ -1443,7 +1510,7 @@ var BaseAPI = (function () {
|
|
|
1443
1510
|
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
1444
1511
|
break;
|
|
1445
1512
|
}
|
|
1446
|
-
if (refObject instanceof array
|
|
1513
|
+
if (refObject instanceof array.CMIArray) {
|
|
1447
1514
|
var index = parseInt(structure[idx + 1], 10);
|
|
1448
1515
|
if (!isNaN(index)) {
|
|
1449
1516
|
var item = refObject.childArray[index];
|
|
@@ -1461,10 +1528,10 @@ var BaseAPI = (function () {
|
|
|
1461
1528
|
if (refObject === null || refObject === undefined) {
|
|
1462
1529
|
if (!scorm2004) {
|
|
1463
1530
|
if (attribute === "_children") {
|
|
1464
|
-
this.throwSCORMError(
|
|
1531
|
+
this.throwSCORMError(this._error_codes.CHILDREN_ERROR);
|
|
1465
1532
|
}
|
|
1466
1533
|
else if (attribute === "_count") {
|
|
1467
|
-
this.throwSCORMError(
|
|
1534
|
+
this.throwSCORMError(this._error_codes.COUNT_ERROR);
|
|
1468
1535
|
}
|
|
1469
1536
|
}
|
|
1470
1537
|
}
|
|
@@ -1473,13 +1540,13 @@ var BaseAPI = (function () {
|
|
|
1473
1540
|
}
|
|
1474
1541
|
};
|
|
1475
1542
|
BaseAPI.prototype.isInitialized = function () {
|
|
1476
|
-
return this.currentState === api_constants
|
|
1543
|
+
return this.currentState === api_constants.global_constants.STATE_INITIALIZED;
|
|
1477
1544
|
};
|
|
1478
1545
|
BaseAPI.prototype.isNotInitialized = function () {
|
|
1479
|
-
return this.currentState === api_constants
|
|
1546
|
+
return this.currentState === api_constants.global_constants.STATE_NOT_INITIALIZED;
|
|
1480
1547
|
};
|
|
1481
1548
|
BaseAPI.prototype.isTerminated = function () {
|
|
1482
|
-
return this.currentState === api_constants
|
|
1549
|
+
return this.currentState === api_constants.global_constants.STATE_TERMINATED;
|
|
1483
1550
|
};
|
|
1484
1551
|
BaseAPI.prototype.on = function (listenerName, callback) {
|
|
1485
1552
|
if (!callback)
|
|
@@ -1499,7 +1566,7 @@ var BaseAPI = (function () {
|
|
|
1499
1566
|
CMIElement: CMIElement,
|
|
1500
1567
|
callback: callback,
|
|
1501
1568
|
});
|
|
1502
|
-
this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), enums
|
|
1569
|
+
this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), enums.LogLevelEnum.INFO, functionName);
|
|
1503
1570
|
}
|
|
1504
1571
|
};
|
|
1505
1572
|
BaseAPI.prototype.off = function (listenerName, callback) {
|
|
@@ -1522,7 +1589,7 @@ var BaseAPI = (function () {
|
|
|
1522
1589
|
});
|
|
1523
1590
|
if (removeIndex !== -1) {
|
|
1524
1591
|
this_1.listenerArray.splice(removeIndex, 1);
|
|
1525
|
-
this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), enums
|
|
1592
|
+
this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), enums.LogLevelEnum.INFO, functionName);
|
|
1526
1593
|
}
|
|
1527
1594
|
};
|
|
1528
1595
|
var this_1 = this;
|
|
@@ -1555,7 +1622,7 @@ var BaseAPI = (function () {
|
|
|
1555
1622
|
}
|
|
1556
1623
|
};
|
|
1557
1624
|
BaseAPI.prototype.processListeners = function (functionName, CMIElement, value) {
|
|
1558
|
-
this.apiLog(functionName, value, enums
|
|
1625
|
+
this.apiLog(functionName, value, enums.LogLevelEnum.INFO, CMIElement);
|
|
1559
1626
|
for (var i = 0; i < this.listenerArray.length; i++) {
|
|
1560
1627
|
var listener = this.listenerArray[i];
|
|
1561
1628
|
var functionsMatch = listener.functionName === functionName;
|
|
@@ -1571,7 +1638,7 @@ var BaseAPI = (function () {
|
|
|
1571
1638
|
CMIElementsMatch = listener.CMIElement === CMIElement;
|
|
1572
1639
|
}
|
|
1573
1640
|
if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {
|
|
1574
|
-
this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), enums
|
|
1641
|
+
this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), enums.LogLevelEnum.INFO, CMIElement);
|
|
1575
1642
|
listener.callback(CMIElement, value);
|
|
1576
1643
|
}
|
|
1577
1644
|
}
|
|
@@ -1580,11 +1647,11 @@ var BaseAPI = (function () {
|
|
|
1580
1647
|
if (!message) {
|
|
1581
1648
|
message = this.getLmsErrorMessageDetails(errorNumber);
|
|
1582
1649
|
}
|
|
1583
|
-
this.apiLog("throwSCORMError", errorNumber + ": " + message, enums
|
|
1650
|
+
this.apiLog("throwSCORMError", errorNumber + ": " + message, enums.LogLevelEnum.ERROR);
|
|
1584
1651
|
this.lastErrorCode = String(errorNumber);
|
|
1585
1652
|
};
|
|
1586
1653
|
BaseAPI.prototype.clearSCORMError = function (success) {
|
|
1587
|
-
if (success !== undefined && success !== api_constants
|
|
1654
|
+
if (success !== undefined && success !== api_constants.global_constants.SCORM_FALSE) {
|
|
1588
1655
|
this.lastErrorCode = "0";
|
|
1589
1656
|
}
|
|
1590
1657
|
};
|
|
@@ -1650,7 +1717,7 @@ var BaseAPI = (function () {
|
|
|
1650
1717
|
result.forEach(function (element) {
|
|
1651
1718
|
obj = {};
|
|
1652
1719
|
obj[element[0]] = element[1];
|
|
1653
|
-
_this.loadFromJSON((0,utilities
|
|
1720
|
+
_this.loadFromJSON((0,utilities.unflatten)(obj), CMIElement);
|
|
1654
1721
|
});
|
|
1655
1722
|
};
|
|
1656
1723
|
BaseAPI.prototype.loadFromJSON = function (json, CMIElement) {
|
|
@@ -1690,21 +1757,21 @@ var BaseAPI = (function () {
|
|
|
1690
1757
|
return JSON.parse(this.renderCMIToJSONString());
|
|
1691
1758
|
};
|
|
1692
1759
|
BaseAPI.prototype.processHttpRequest = function (url_1, params_1) {
|
|
1693
|
-
return (0,tslib_es6
|
|
1760
|
+
return (0,tslib_es6.__awaiter)(this, arguments, void 0, function (url, params, immediate) {
|
|
1694
1761
|
var api, genericError, process;
|
|
1695
1762
|
var _this = this;
|
|
1696
1763
|
if (immediate === void 0) { immediate = false; }
|
|
1697
|
-
return (0,tslib_es6
|
|
1764
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
1698
1765
|
switch (_a.label) {
|
|
1699
1766
|
case 0:
|
|
1700
1767
|
api = this;
|
|
1701
1768
|
genericError = {
|
|
1702
|
-
result: api_constants
|
|
1769
|
+
result: api_constants.global_constants.SCORM_FALSE,
|
|
1703
1770
|
errorCode: this.error_codes.GENERAL,
|
|
1704
1771
|
};
|
|
1705
1772
|
if (immediate) {
|
|
1706
|
-
this.performFetch(url, params).then(function (response) { return (0,tslib_es6
|
|
1707
|
-
return (0,tslib_es6
|
|
1773
|
+
this.performFetch(url, params).then(function (response) { return (0,tslib_es6.__awaiter)(_this, void 0, void 0, function () {
|
|
1774
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
1708
1775
|
switch (_a.label) {
|
|
1709
1776
|
case 0: return [4, this.transformResponse(response)];
|
|
1710
1777
|
case 1:
|
|
@@ -1714,13 +1781,13 @@ var BaseAPI = (function () {
|
|
|
1714
1781
|
});
|
|
1715
1782
|
}); });
|
|
1716
1783
|
return [2, {
|
|
1717
|
-
result: api_constants
|
|
1784
|
+
result: api_constants.global_constants.SCORM_TRUE,
|
|
1718
1785
|
errorCode: 0,
|
|
1719
1786
|
}];
|
|
1720
1787
|
}
|
|
1721
|
-
process = function (url, params, settings) { return (0,tslib_es6
|
|
1788
|
+
process = function (url, params, settings) { return (0,tslib_es6.__awaiter)(_this, void 0, void 0, function () {
|
|
1722
1789
|
var response, e_1;
|
|
1723
|
-
return (0,tslib_es6
|
|
1790
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
1724
1791
|
switch (_a.label) {
|
|
1725
1792
|
case 0:
|
|
1726
1793
|
_a.trys.push([0, 2, , 3]);
|
|
@@ -1731,7 +1798,7 @@ var BaseAPI = (function () {
|
|
|
1731
1798
|
return [2, this.transformResponse(response)];
|
|
1732
1799
|
case 2:
|
|
1733
1800
|
e_1 = _a.sent();
|
|
1734
|
-
this.apiLog("processHttpRequest", e_1, enums
|
|
1801
|
+
this.apiLog("processHttpRequest", e_1, enums.LogLevelEnum.ERROR);
|
|
1735
1802
|
api.processListeners("CommitError");
|
|
1736
1803
|
return [2, genericError];
|
|
1737
1804
|
case 3: return [2];
|
|
@@ -1747,14 +1814,14 @@ var BaseAPI = (function () {
|
|
|
1747
1814
|
BaseAPI.prototype.scheduleCommit = function (when, callback) {
|
|
1748
1815
|
if (!this._timeout) {
|
|
1749
1816
|
this._timeout = new ScheduledCommit(this, when, callback);
|
|
1750
|
-
this.apiLog("scheduleCommit", "scheduled", enums
|
|
1817
|
+
this.apiLog("scheduleCommit", "scheduled", enums.LogLevelEnum.DEBUG, "");
|
|
1751
1818
|
}
|
|
1752
1819
|
};
|
|
1753
1820
|
BaseAPI.prototype.clearScheduledCommit = function () {
|
|
1754
1821
|
if (this._timeout) {
|
|
1755
1822
|
this._timeout.cancel();
|
|
1756
1823
|
this._timeout = undefined;
|
|
1757
|
-
this.apiLog("clearScheduledCommit", "cleared", enums
|
|
1824
|
+
this.apiLog("clearScheduledCommit", "cleared", enums.LogLevelEnum.DEBUG, "");
|
|
1758
1825
|
}
|
|
1759
1826
|
};
|
|
1760
1827
|
BaseAPI.prototype._checkObjectHasProperty = function (refObject, attribute) {
|
|
@@ -1763,9 +1830,9 @@ var BaseAPI = (function () {
|
|
|
1763
1830
|
attribute in refObject);
|
|
1764
1831
|
};
|
|
1765
1832
|
BaseAPI.prototype.handleValueAccessException = function (e, returnValue) {
|
|
1766
|
-
if (e instanceof exceptions
|
|
1833
|
+
if (e instanceof exceptions.ValidationError) {
|
|
1767
1834
|
this.lastErrorCode = String(e.errorCode);
|
|
1768
|
-
returnValue = api_constants
|
|
1835
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1769
1836
|
}
|
|
1770
1837
|
else {
|
|
1771
1838
|
if (e instanceof Error && e.message) {
|
|
@@ -1783,20 +1850,20 @@ var BaseAPI = (function () {
|
|
|
1783
1850
|
var commitObject = this.settings.renderCommonCommitFields
|
|
1784
1851
|
? this.renderCommitObject(shouldTerminateCommit)
|
|
1785
1852
|
: this.renderCommitCMI(shouldTerminateCommit);
|
|
1786
|
-
if ([enums
|
|
1853
|
+
if ([enums.LogLevelEnum.DEBUG, "1", 1, "DEBUG"].includes(this.apiLogLevel)) {
|
|
1787
1854
|
console.debug("Commit (terminated: " + (terminateCommit ? "yes" : "no") + "): ");
|
|
1788
1855
|
console.debug(commitObject);
|
|
1789
1856
|
}
|
|
1790
1857
|
return commitObject;
|
|
1791
1858
|
};
|
|
1792
1859
|
BaseAPI.prototype.performFetch = function (url, params) {
|
|
1793
|
-
return (0,tslib_es6
|
|
1794
|
-
return (0,tslib_es6
|
|
1860
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
1861
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
1795
1862
|
return [2, fetch(url, {
|
|
1796
1863
|
method: "POST",
|
|
1797
1864
|
mode: this.settings.fetchMode,
|
|
1798
1865
|
body: params instanceof Array ? params.join("&") : JSON.stringify(params),
|
|
1799
|
-
headers: (0,tslib_es6
|
|
1866
|
+
headers: (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, this.settings.xhrHeaders), { "Content-Type": this.settings.commitRequestDataType }),
|
|
1800
1867
|
credentials: this.settings.xhrWithCredentials ? "include" : undefined,
|
|
1801
1868
|
keepalive: true,
|
|
1802
1869
|
})];
|
|
@@ -1804,9 +1871,9 @@ var BaseAPI = (function () {
|
|
|
1804
1871
|
});
|
|
1805
1872
|
};
|
|
1806
1873
|
BaseAPI.prototype.transformResponse = function (response) {
|
|
1807
|
-
return (0,tslib_es6
|
|
1874
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
1808
1875
|
var result, _a;
|
|
1809
|
-
return (0,tslib_es6
|
|
1876
|
+
return (0,tslib_es6.__generator)(this, function (_c) {
|
|
1810
1877
|
switch (_c.label) {
|
|
1811
1878
|
case 0:
|
|
1812
1879
|
if (!(typeof this.settings.responseHandler === "function")) return [3, 2];
|
|
@@ -1822,8 +1889,7 @@ var BaseAPI = (function () {
|
|
|
1822
1889
|
result = _a;
|
|
1823
1890
|
if (response.status >= 200 &&
|
|
1824
1891
|
response.status <= 299 &&
|
|
1825
|
-
(result.result === true ||
|
|
1826
|
-
result.result === api_constants/* default */.A.global.SCORM_TRUE)) {
|
|
1892
|
+
(result.result === true || result.result === api_constants.global_constants.SCORM_TRUE)) {
|
|
1827
1893
|
this.processListeners("CommitSuccess");
|
|
1828
1894
|
}
|
|
1829
1895
|
else {
|
|
@@ -1844,8 +1910,9 @@ var BaseAPI = (function () {
|
|
|
1844
1910
|
/***/ 941:
|
|
1845
1911
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1846
1912
|
|
|
1913
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1847
1914
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1848
|
-
/* harmony export */
|
|
1915
|
+
/* harmony export */ Scorm12Impl: function() { return /* binding */ Scorm12Impl; }
|
|
1849
1916
|
/* harmony export */ });
|
|
1850
1917
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(635);
|
|
1851
1918
|
/* harmony import */ var _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(989);
|
|
@@ -1855,9 +1922,9 @@ var BaseAPI = (function () {
|
|
|
1855
1922
|
/* harmony import */ var _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(176);
|
|
1856
1923
|
/* harmony import */ var _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(833);
|
|
1857
1924
|
/* harmony import */ var _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(331);
|
|
1858
|
-
/* harmony import */ var
|
|
1859
|
-
/* harmony import */ var
|
|
1860
|
-
/* harmony import */ var
|
|
1925
|
+
/* harmony import */ var _constants_enums__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(56);
|
|
1926
|
+
/* harmony import */ var _BaseAPI__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(429);
|
|
1927
|
+
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(417);
|
|
1861
1928
|
|
|
1862
1929
|
|
|
1863
1930
|
|
|
@@ -1871,7 +1938,7 @@ var BaseAPI = (function () {
|
|
|
1871
1938
|
|
|
1872
1939
|
|
|
1873
1940
|
var Scorm12Impl = (function (_super) {
|
|
1874
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1941
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_10__.__extends)(Scorm12Impl, _super);
|
|
1875
1942
|
function Scorm12Impl(settings) {
|
|
1876
1943
|
var _this = this;
|
|
1877
1944
|
if (settings) {
|
|
@@ -1879,10 +1946,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
1879
1946
|
settings.mastery_override = false;
|
|
1880
1947
|
}
|
|
1881
1948
|
}
|
|
1882
|
-
_this = _super.call(this, _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__
|
|
1949
|
+
_this = _super.call(this, _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors, settings) || this;
|
|
1883
1950
|
_this.statusSetByModule = false;
|
|
1884
|
-
_this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
1885
|
-
_this.nav = new _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__
|
|
1951
|
+
_this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__.CMI();
|
|
1952
|
+
_this.nav = new _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__.NAV();
|
|
1886
1953
|
_this.LMSInitialize = _this.lmsInitialize;
|
|
1887
1954
|
_this.LMSFinish = _this.lmsFinish;
|
|
1888
1955
|
_this.LMSGetValue = _this.lmsGetValue;
|
|
@@ -1894,9 +1961,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
1894
1961
|
return _this;
|
|
1895
1962
|
}
|
|
1896
1963
|
Scorm12Impl.prototype.reset = function (settings) {
|
|
1964
|
+
var _a, _b;
|
|
1897
1965
|
this.commonReset(settings);
|
|
1898
|
-
this.cmi
|
|
1899
|
-
this.nav
|
|
1966
|
+
(_a = this.cmi) === null || _a === void 0 ? void 0 : _a.reset();
|
|
1967
|
+
(_b = this.nav) === null || _b === void 0 ? void 0 : _b.reset();
|
|
1900
1968
|
};
|
|
1901
1969
|
Scorm12Impl.prototype.lmsInitialize = function () {
|
|
1902
1970
|
this.cmi.initialize();
|
|
@@ -1910,8 +1978,8 @@ var Scorm12Impl = (function (_super) {
|
|
|
1910
1978
|
};
|
|
1911
1979
|
Scorm12Impl.prototype.lmsFinish = function () {
|
|
1912
1980
|
var _this = this;
|
|
1913
|
-
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1914
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1981
|
+
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(_this, void 0, void 0, function () {
|
|
1982
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_a) {
|
|
1915
1983
|
switch (_a.label) {
|
|
1916
1984
|
case 0: return [4, this.internalFinish()];
|
|
1917
1985
|
case 1:
|
|
@@ -1920,17 +1988,17 @@ var Scorm12Impl = (function (_super) {
|
|
|
1920
1988
|
}
|
|
1921
1989
|
});
|
|
1922
1990
|
}); })();
|
|
1923
|
-
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
1991
|
+
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE;
|
|
1924
1992
|
};
|
|
1925
1993
|
Scorm12Impl.prototype.internalFinish = function () {
|
|
1926
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1994
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(this, void 0, void 0, function () {
|
|
1927
1995
|
var result;
|
|
1928
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1996
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_a) {
|
|
1929
1997
|
switch (_a.label) {
|
|
1930
1998
|
case 0: return [4, this.terminate("LMSFinish", true)];
|
|
1931
1999
|
case 1:
|
|
1932
2000
|
result = _a.sent();
|
|
1933
|
-
if (result === _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2001
|
+
if (result === _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE) {
|
|
1934
2002
|
if (this.nav.event !== "") {
|
|
1935
2003
|
if (this.nav.event === "continue") {
|
|
1936
2004
|
this.processListeners("SequenceNext");
|
|
@@ -1963,8 +2031,8 @@ var Scorm12Impl = (function (_super) {
|
|
|
1963
2031
|
this.scheduleCommit(500, "LMSCommit");
|
|
1964
2032
|
}
|
|
1965
2033
|
else {
|
|
1966
|
-
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1967
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
2034
|
+
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(_this, void 0, void 0, function () {
|
|
2035
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_a) {
|
|
1968
2036
|
switch (_a.label) {
|
|
1969
2037
|
case 0: return [4, this.commit("LMSCommit", false)];
|
|
1970
2038
|
case 1:
|
|
@@ -1974,7 +2042,7 @@ var Scorm12Impl = (function (_super) {
|
|
|
1974
2042
|
});
|
|
1975
2043
|
}); })();
|
|
1976
2044
|
}
|
|
1977
|
-
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2045
|
+
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE;
|
|
1978
2046
|
};
|
|
1979
2047
|
Scorm12Impl.prototype.lmsGetLastError = function () {
|
|
1980
2048
|
return this.getLastError("LMSGetLastError");
|
|
@@ -1992,20 +2060,20 @@ var Scorm12Impl = (function (_super) {
|
|
|
1992
2060
|
return this._commonGetCMIValue("getCMIValue", false, CMIElement);
|
|
1993
2061
|
};
|
|
1994
2062
|
Scorm12Impl.prototype.getChildElement = function (CMIElement, _value, foundFirstIndex) {
|
|
1995
|
-
if ((0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
1996
|
-
return new _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__
|
|
2063
|
+
if ((0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.objectives\\.\\d+")) {
|
|
2064
|
+
return new _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__.CMIObjectivesObject();
|
|
1997
2065
|
}
|
|
1998
2066
|
else if (foundFirstIndex &&
|
|
1999
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
2000
|
-
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__
|
|
2067
|
+
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) {
|
|
2068
|
+
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__.CMIInteractionsCorrectResponsesObject();
|
|
2001
2069
|
}
|
|
2002
2070
|
else if (foundFirstIndex &&
|
|
2003
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
2004
|
-
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__
|
|
2071
|
+
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) {
|
|
2072
|
+
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__.CMIInteractionsObjectivesObject();
|
|
2005
2073
|
}
|
|
2006
2074
|
else if (!foundFirstIndex &&
|
|
2007
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
2008
|
-
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__
|
|
2075
|
+
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+")) {
|
|
2076
|
+
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__.CMIInteractionsObject();
|
|
2009
2077
|
}
|
|
2010
2078
|
return null;
|
|
2011
2079
|
};
|
|
@@ -2015,11 +2083,11 @@ var Scorm12Impl = (function (_super) {
|
|
|
2015
2083
|
var basicMessage = "No Error";
|
|
2016
2084
|
var detailMessage = "No Error";
|
|
2017
2085
|
errorNumber = String(errorNumber);
|
|
2018
|
-
if (_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2086
|
+
if (_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber]) {
|
|
2019
2087
|
basicMessage =
|
|
2020
|
-
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2088
|
+
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber].basicMessage;
|
|
2021
2089
|
detailMessage =
|
|
2022
|
-
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2090
|
+
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber].detailMessage;
|
|
2023
2091
|
}
|
|
2024
2092
|
return detail ? detailMessage : basicMessage;
|
|
2025
2093
|
};
|
|
@@ -2032,10 +2100,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
2032
2100
|
cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();
|
|
2033
2101
|
}
|
|
2034
2102
|
var result = [];
|
|
2035
|
-
var flattened = _utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
2103
|
+
var flattened = _utilities__WEBPACK_IMPORTED_MODULE_1__.flatten(cmiExport);
|
|
2036
2104
|
switch (this.settings.dataCommitFormat) {
|
|
2037
2105
|
case "flattened":
|
|
2038
|
-
return _utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
2106
|
+
return _utilities__WEBPACK_IMPORTED_MODULE_1__.flatten(cmiExport);
|
|
2039
2107
|
case "params":
|
|
2040
2108
|
for (var item in flattened) {
|
|
2041
2109
|
if ({}.hasOwnProperty.call(flattened, item)) {
|
|
@@ -2051,20 +2119,20 @@ var Scorm12Impl = (function (_super) {
|
|
|
2051
2119
|
Scorm12Impl.prototype.renderCommitObject = function (terminateCommit) {
|
|
2052
2120
|
var cmiExport = this.renderCommitCMI(terminateCommit);
|
|
2053
2121
|
var totalTimeHHMMSS = this.cmi.getCurrentTotalTime();
|
|
2054
|
-
var totalTimeSeconds = _utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
2122
|
+
var totalTimeSeconds = _utilities__WEBPACK_IMPORTED_MODULE_1__.getTimeAsSeconds(totalTimeHHMMSS, _constants_regex__WEBPACK_IMPORTED_MODULE_9__.scorm12_regex.CMITimespan);
|
|
2055
2123
|
var lessonStatus = this.cmi.core.lesson_status;
|
|
2056
|
-
var completionStatus =
|
|
2057
|
-
var successStatus =
|
|
2124
|
+
var completionStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.unknown;
|
|
2125
|
+
var successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.unknown;
|
|
2058
2126
|
if (lessonStatus) {
|
|
2059
2127
|
completionStatus =
|
|
2060
2128
|
lessonStatus === "completed" || lessonStatus === "passed"
|
|
2061
|
-
?
|
|
2062
|
-
:
|
|
2129
|
+
? _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.completed
|
|
2130
|
+
: _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.incomplete;
|
|
2063
2131
|
if (lessonStatus === "passed") {
|
|
2064
|
-
successStatus =
|
|
2132
|
+
successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.passed;
|
|
2065
2133
|
}
|
|
2066
2134
|
else if (lessonStatus === "failed") {
|
|
2067
|
-
successStatus =
|
|
2135
|
+
successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.failed;
|
|
2068
2136
|
}
|
|
2069
2137
|
}
|
|
2070
2138
|
var score = this.cmi.core.score;
|
|
@@ -2093,10 +2161,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
2093
2161
|
return commitObject;
|
|
2094
2162
|
};
|
|
2095
2163
|
Scorm12Impl.prototype.storeData = function (terminateCommit) {
|
|
2096
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
2164
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(this, void 0, void 0, function () {
|
|
2097
2165
|
var originalStatus, commitObject;
|
|
2098
2166
|
var _a, _b, _c;
|
|
2099
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
2167
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_d) {
|
|
2100
2168
|
switch (_d.label) {
|
|
2101
2169
|
case 0:
|
|
2102
2170
|
if (terminateCommit) {
|
|
@@ -2131,7 +2199,7 @@ var Scorm12Impl = (function (_super) {
|
|
|
2131
2199
|
return [4, this.processHttpRequest(this.settings.lmsCommitUrl, commitObject, terminateCommit)];
|
|
2132
2200
|
case 1: return [2, _d.sent()];
|
|
2133
2201
|
case 2: return [2, {
|
|
2134
|
-
result: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2202
|
+
result: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE,
|
|
2135
2203
|
errorCode: 0,
|
|
2136
2204
|
}];
|
|
2137
2205
|
}
|
|
@@ -2139,19 +2207,21 @@ var Scorm12Impl = (function (_super) {
|
|
|
2139
2207
|
});
|
|
2140
2208
|
};
|
|
2141
2209
|
return Scorm12Impl;
|
|
2142
|
-
}(
|
|
2210
|
+
}(_BaseAPI__WEBPACK_IMPORTED_MODULE_8__["default"]));
|
|
2143
2211
|
|
|
2144
2212
|
|
|
2145
2213
|
|
|
2146
2214
|
/***/ }),
|
|
2147
2215
|
|
|
2148
|
-
/***/
|
|
2216
|
+
/***/ 809:
|
|
2149
2217
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2150
2218
|
|
|
2219
|
+
// ESM COMPAT FLAG
|
|
2220
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2151
2221
|
|
|
2152
2222
|
// EXPORTS
|
|
2153
2223
|
__webpack_require__.d(__webpack_exports__, {
|
|
2154
|
-
|
|
2224
|
+
Scorm2004Impl: function() { return /* binding */ Scorm2004Impl; }
|
|
2155
2225
|
});
|
|
2156
2226
|
|
|
2157
2227
|
// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs
|
|
@@ -2166,6 +2236,27 @@ var regex = __webpack_require__(417);
|
|
|
2166
2236
|
var error_codes = __webpack_require__(797);
|
|
2167
2237
|
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
2168
2238
|
var exceptions = __webpack_require__(784);
|
|
2239
|
+
;// ./src/exceptions/scorm2004_exceptions.ts
|
|
2240
|
+
|
|
2241
|
+
|
|
2242
|
+
|
|
2243
|
+
var scorm2004_errors = api_constants.scorm2004_constants.error_descriptions;
|
|
2244
|
+
var Scorm2004ValidationError = (function (_super) {
|
|
2245
|
+
(0,tslib_es6.__extends)(Scorm2004ValidationError, _super);
|
|
2246
|
+
function Scorm2004ValidationError(errorCode) {
|
|
2247
|
+
var _this = this;
|
|
2248
|
+
if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {
|
|
2249
|
+
_this = _super.call(this, errorCode, scorm2004_errors[String(errorCode)].basicMessage, scorm2004_errors[String(errorCode)].detailMessage) || this;
|
|
2250
|
+
}
|
|
2251
|
+
else {
|
|
2252
|
+
_this = _super.call(this, 101, scorm2004_errors["101"].basicMessage, scorm2004_errors["101"].detailMessage) || this;
|
|
2253
|
+
}
|
|
2254
|
+
return _this;
|
|
2255
|
+
}
|
|
2256
|
+
return Scorm2004ValidationError;
|
|
2257
|
+
}(exceptions.ValidationError));
|
|
2258
|
+
|
|
2259
|
+
|
|
2169
2260
|
// EXTERNAL MODULE: ./src/utilities.ts
|
|
2170
2261
|
var utilities = __webpack_require__(864);
|
|
2171
2262
|
// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts
|
|
@@ -2177,10 +2268,10 @@ var validation = __webpack_require__(449);
|
|
|
2177
2268
|
|
|
2178
2269
|
|
|
2179
2270
|
function check2004ValidFormat(value, regexPattern, allowEmptyString) {
|
|
2180
|
-
return (0,validation
|
|
2271
|
+
return (0,validation.checkValidFormat)(value, regexPattern, error_codes.scorm2004_errors.TYPE_MISMATCH, Scorm2004ValidationError, allowEmptyString);
|
|
2181
2272
|
}
|
|
2182
2273
|
function check2004ValidRange(value, rangePattern) {
|
|
2183
|
-
return (0,validation
|
|
2274
|
+
return (0,validation.checkValidRange)(value, rangePattern, error_codes.scorm2004_errors.VALUE_OUT_OF_RANGE, Scorm2004ValidationError);
|
|
2184
2275
|
}
|
|
2185
2276
|
|
|
2186
2277
|
;// ./src/cmi/scorm2004/learner_preference.ts
|
|
@@ -2192,22 +2283,25 @@ function check2004ValidRange(value, rangePattern) {
|
|
|
2192
2283
|
|
|
2193
2284
|
|
|
2194
2285
|
var CMILearnerPreference = (function (_super) {
|
|
2195
|
-
(0,tslib_es6
|
|
2286
|
+
(0,tslib_es6.__extends)(CMILearnerPreference, _super);
|
|
2196
2287
|
function CMILearnerPreference() {
|
|
2197
2288
|
var _this = _super.call(this) || this;
|
|
2198
|
-
_this.__children = api_constants
|
|
2289
|
+
_this.__children = api_constants.scorm2004_constants.student_preference_children;
|
|
2199
2290
|
_this._audio_level = "1";
|
|
2200
2291
|
_this._language = "";
|
|
2201
2292
|
_this._delivery_speed = "1";
|
|
2202
2293
|
_this._audio_captioning = "0";
|
|
2203
2294
|
return _this;
|
|
2204
2295
|
}
|
|
2296
|
+
CMILearnerPreference.prototype.reset = function () {
|
|
2297
|
+
this._initialized = false;
|
|
2298
|
+
};
|
|
2205
2299
|
Object.defineProperty(CMILearnerPreference.prototype, "_children", {
|
|
2206
2300
|
get: function () {
|
|
2207
2301
|
return this.__children;
|
|
2208
2302
|
},
|
|
2209
2303
|
set: function (_children) {
|
|
2210
|
-
throw new
|
|
2304
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
2211
2305
|
},
|
|
2212
2306
|
enumerable: false,
|
|
2213
2307
|
configurable: true
|
|
@@ -2217,8 +2311,8 @@ var CMILearnerPreference = (function (_super) {
|
|
|
2217
2311
|
return this._audio_level;
|
|
2218
2312
|
},
|
|
2219
2313
|
set: function (audio_level) {
|
|
2220
|
-
if (check2004ValidFormat(audio_level, regex
|
|
2221
|
-
check2004ValidRange(audio_level, regex
|
|
2314
|
+
if (check2004ValidFormat(audio_level, regex.scorm2004_regex.CMIDecimal) &&
|
|
2315
|
+
check2004ValidRange(audio_level, regex.scorm2004_regex.audio_range)) {
|
|
2222
2316
|
this._audio_level = audio_level;
|
|
2223
2317
|
}
|
|
2224
2318
|
},
|
|
@@ -2230,7 +2324,7 @@ var CMILearnerPreference = (function (_super) {
|
|
|
2230
2324
|
return this._language;
|
|
2231
2325
|
},
|
|
2232
2326
|
set: function (language) {
|
|
2233
|
-
if (check2004ValidFormat(language, regex
|
|
2327
|
+
if (check2004ValidFormat(language, regex.scorm2004_regex.CMILang)) {
|
|
2234
2328
|
this._language = language;
|
|
2235
2329
|
}
|
|
2236
2330
|
},
|
|
@@ -2242,8 +2336,8 @@ var CMILearnerPreference = (function (_super) {
|
|
|
2242
2336
|
return this._delivery_speed;
|
|
2243
2337
|
},
|
|
2244
2338
|
set: function (delivery_speed) {
|
|
2245
|
-
if (check2004ValidFormat(delivery_speed, regex
|
|
2246
|
-
check2004ValidRange(delivery_speed, regex
|
|
2339
|
+
if (check2004ValidFormat(delivery_speed, regex.scorm2004_regex.CMIDecimal) &&
|
|
2340
|
+
check2004ValidRange(delivery_speed, regex.scorm2004_regex.speed_range)) {
|
|
2247
2341
|
this._delivery_speed = delivery_speed;
|
|
2248
2342
|
}
|
|
2249
2343
|
},
|
|
@@ -2255,8 +2349,8 @@ var CMILearnerPreference = (function (_super) {
|
|
|
2255
2349
|
return this._audio_captioning;
|
|
2256
2350
|
},
|
|
2257
2351
|
set: function (audio_captioning) {
|
|
2258
|
-
if (check2004ValidFormat(audio_captioning, regex
|
|
2259
|
-
check2004ValidRange(audio_captioning, regex
|
|
2352
|
+
if (check2004ValidFormat(audio_captioning, regex.scorm2004_regex.CMISInteger) &&
|
|
2353
|
+
check2004ValidRange(audio_captioning, regex.scorm2004_regex.text_range)) {
|
|
2260
2354
|
this._audio_captioning = audio_captioning;
|
|
2261
2355
|
}
|
|
2262
2356
|
},
|
|
@@ -2275,14 +2369,13 @@ var CMILearnerPreference = (function (_super) {
|
|
|
2275
2369
|
return result;
|
|
2276
2370
|
};
|
|
2277
2371
|
return CMILearnerPreference;
|
|
2278
|
-
}(base_cmi
|
|
2372
|
+
}(base_cmi.BaseCMI));
|
|
2279
2373
|
|
|
2280
2374
|
|
|
2281
2375
|
// EXTERNAL MODULE: ./src/cmi/common/array.ts
|
|
2282
2376
|
var array = __webpack_require__(589);
|
|
2283
2377
|
;// ./src/constants/response_constants.ts
|
|
2284
2378
|
|
|
2285
|
-
var scorm2004_regex = regex/* default */.A.scorm2004;
|
|
2286
2379
|
var LearnerResponses = {
|
|
2287
2380
|
"true-false": {
|
|
2288
2381
|
format: "^true$|^false$",
|
|
@@ -2291,59 +2384,59 @@ var LearnerResponses = {
|
|
|
2291
2384
|
unique: false,
|
|
2292
2385
|
},
|
|
2293
2386
|
choice: {
|
|
2294
|
-
format: scorm2004_regex.CMILongIdentifier,
|
|
2387
|
+
format: regex.scorm2004_regex.CMILongIdentifier,
|
|
2295
2388
|
max: 36,
|
|
2296
2389
|
delimiter: "[,]",
|
|
2297
2390
|
unique: true,
|
|
2298
2391
|
},
|
|
2299
2392
|
"fill-in": {
|
|
2300
|
-
format: scorm2004_regex.CMILangString250,
|
|
2393
|
+
format: regex.scorm2004_regex.CMILangString250,
|
|
2301
2394
|
max: 10,
|
|
2302
2395
|
delimiter: "[,]",
|
|
2303
2396
|
unique: false,
|
|
2304
2397
|
},
|
|
2305
2398
|
"long-fill-in": {
|
|
2306
|
-
format: scorm2004_regex.CMILangString4000,
|
|
2399
|
+
format: regex.scorm2004_regex.CMILangString4000,
|
|
2307
2400
|
max: 1,
|
|
2308
2401
|
delimiter: "",
|
|
2309
2402
|
unique: false,
|
|
2310
2403
|
},
|
|
2311
2404
|
matching: {
|
|
2312
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2313
|
-
format2: scorm2004_regex.CMIShortIdentifier,
|
|
2405
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2406
|
+
format2: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2314
2407
|
max: 36,
|
|
2315
2408
|
delimiter: "[,]",
|
|
2316
2409
|
delimiter2: "[.]",
|
|
2317
2410
|
unique: false,
|
|
2318
2411
|
},
|
|
2319
2412
|
performance: {
|
|
2320
|
-
format: "^$|" + scorm2004_regex.CMIShortIdentifier,
|
|
2321
|
-
format2: scorm2004_regex.CMIDecimal + "|^$|" + scorm2004_regex.CMIShortIdentifier,
|
|
2413
|
+
format: "^$|" + regex.scorm2004_regex.CMIShortIdentifier,
|
|
2414
|
+
format2: regex.scorm2004_regex.CMIDecimal + "|^$|" + regex.scorm2004_regex.CMIShortIdentifier,
|
|
2322
2415
|
max: 250,
|
|
2323
2416
|
delimiter: "[,]",
|
|
2324
2417
|
delimiter2: "[.]",
|
|
2325
2418
|
unique: false,
|
|
2326
2419
|
},
|
|
2327
2420
|
sequencing: {
|
|
2328
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2421
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2329
2422
|
max: 36,
|
|
2330
2423
|
delimiter: "[,]",
|
|
2331
2424
|
unique: false,
|
|
2332
2425
|
},
|
|
2333
2426
|
likert: {
|
|
2334
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2427
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2335
2428
|
max: 1,
|
|
2336
2429
|
delimiter: "",
|
|
2337
2430
|
unique: false,
|
|
2338
2431
|
},
|
|
2339
2432
|
numeric: {
|
|
2340
|
-
format: scorm2004_regex.CMIDecimal,
|
|
2433
|
+
format: regex.scorm2004_regex.CMIDecimal,
|
|
2341
2434
|
max: 1,
|
|
2342
2435
|
delimiter: "",
|
|
2343
2436
|
unique: false,
|
|
2344
2437
|
},
|
|
2345
2438
|
other: {
|
|
2346
|
-
format: scorm2004_regex.CMIString4000,
|
|
2439
|
+
format: regex.scorm2004_regex.CMIString4000,
|
|
2347
2440
|
max: 1,
|
|
2348
2441
|
delimiter: "",
|
|
2349
2442
|
unique: false,
|
|
@@ -2363,21 +2456,21 @@ var CorrectResponses = {
|
|
|
2363
2456
|
delimiter: "[,]",
|
|
2364
2457
|
unique: true,
|
|
2365
2458
|
duplicate: false,
|
|
2366
|
-
format: scorm2004_regex.CMILongIdentifier,
|
|
2459
|
+
format: regex.scorm2004_regex.CMILongIdentifier,
|
|
2367
2460
|
},
|
|
2368
2461
|
"fill-in": {
|
|
2369
2462
|
max: 10,
|
|
2370
2463
|
delimiter: "[,]",
|
|
2371
2464
|
unique: false,
|
|
2372
2465
|
duplicate: false,
|
|
2373
|
-
format: scorm2004_regex.CMILangString250cr,
|
|
2466
|
+
format: regex.scorm2004_regex.CMILangString250cr,
|
|
2374
2467
|
},
|
|
2375
2468
|
"long-fill-in": {
|
|
2376
2469
|
max: 1,
|
|
2377
2470
|
delimiter: "",
|
|
2378
2471
|
unique: false,
|
|
2379
2472
|
duplicate: true,
|
|
2380
|
-
format: scorm2004_regex.CMILangString4000,
|
|
2473
|
+
format: regex.scorm2004_regex.CMILangString4000,
|
|
2381
2474
|
},
|
|
2382
2475
|
matching: {
|
|
2383
2476
|
max: 36,
|
|
@@ -2385,8 +2478,8 @@ var CorrectResponses = {
|
|
|
2385
2478
|
delimiter2: "[.]",
|
|
2386
2479
|
unique: false,
|
|
2387
2480
|
duplicate: false,
|
|
2388
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2389
|
-
format2: scorm2004_regex.CMIShortIdentifier,
|
|
2481
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2482
|
+
format2: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2390
2483
|
},
|
|
2391
2484
|
performance: {
|
|
2392
2485
|
max: 250,
|
|
@@ -2395,22 +2488,22 @@ var CorrectResponses = {
|
|
|
2395
2488
|
delimiter3: "[:]",
|
|
2396
2489
|
unique: false,
|
|
2397
2490
|
duplicate: false,
|
|
2398
|
-
format: "^$|" + scorm2004_regex.CMIShortIdentifier,
|
|
2399
|
-
format2: scorm2004_regex.CMIDecimal + "|^$|" + scorm2004_regex.CMIShortIdentifier,
|
|
2491
|
+
format: "^$|" + regex.scorm2004_regex.CMIShortIdentifier,
|
|
2492
|
+
format2: regex.scorm2004_regex.CMIDecimal + "|^$|" + regex.scorm2004_regex.CMIShortIdentifier,
|
|
2400
2493
|
},
|
|
2401
2494
|
sequencing: {
|
|
2402
2495
|
max: 36,
|
|
2403
2496
|
delimiter: "[,]",
|
|
2404
2497
|
unique: false,
|
|
2405
2498
|
duplicate: false,
|
|
2406
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2499
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2407
2500
|
},
|
|
2408
2501
|
likert: {
|
|
2409
2502
|
max: 1,
|
|
2410
2503
|
delimiter: "",
|
|
2411
2504
|
unique: false,
|
|
2412
2505
|
duplicate: false,
|
|
2413
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2506
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2414
2507
|
limit: 1,
|
|
2415
2508
|
},
|
|
2416
2509
|
numeric: {
|
|
@@ -2418,7 +2511,7 @@ var CorrectResponses = {
|
|
|
2418
2511
|
delimiter: "[:]",
|
|
2419
2512
|
unique: false,
|
|
2420
2513
|
duplicate: false,
|
|
2421
|
-
format: scorm2004_regex.CMIDecimal,
|
|
2514
|
+
format: regex.scorm2004_regex.CMIDecimal,
|
|
2422
2515
|
limit: 1,
|
|
2423
2516
|
},
|
|
2424
2517
|
other: {
|
|
@@ -2426,7 +2519,7 @@ var CorrectResponses = {
|
|
|
2426
2519
|
delimiter: "",
|
|
2427
2520
|
unique: false,
|
|
2428
2521
|
duplicate: false,
|
|
2429
|
-
format: scorm2004_regex.CMIString4000,
|
|
2522
|
+
format: regex.scorm2004_regex.CMIString4000,
|
|
2430
2523
|
limit: 1,
|
|
2431
2524
|
},
|
|
2432
2525
|
};
|
|
@@ -2442,19 +2535,19 @@ var CorrectResponses = {
|
|
|
2442
2535
|
|
|
2443
2536
|
|
|
2444
2537
|
var CMIInteractions = (function (_super) {
|
|
2445
|
-
(0,tslib_es6
|
|
2538
|
+
(0,tslib_es6.__extends)(CMIInteractions, _super);
|
|
2446
2539
|
function CMIInteractions() {
|
|
2447
2540
|
return _super.call(this, {
|
|
2448
|
-
children: api_constants
|
|
2449
|
-
errorCode: error_codes
|
|
2450
|
-
errorClass:
|
|
2541
|
+
children: api_constants.scorm2004_constants.interactions_children,
|
|
2542
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2543
|
+
errorClass: Scorm2004ValidationError,
|
|
2451
2544
|
}) || this;
|
|
2452
2545
|
}
|
|
2453
2546
|
return CMIInteractions;
|
|
2454
|
-
}(array
|
|
2547
|
+
}(array.CMIArray));
|
|
2455
2548
|
|
|
2456
2549
|
var CMIInteractionsObject = (function (_super) {
|
|
2457
|
-
(0,tslib_es6
|
|
2550
|
+
(0,tslib_es6.__extends)(CMIInteractionsObject, _super);
|
|
2458
2551
|
function CMIInteractionsObject() {
|
|
2459
2552
|
var _this = _super.call(this) || this;
|
|
2460
2553
|
_this._id = "";
|
|
@@ -2465,15 +2558,15 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2465
2558
|
_this._result = "";
|
|
2466
2559
|
_this._latency = "";
|
|
2467
2560
|
_this._description = "";
|
|
2468
|
-
_this.objectives = new array
|
|
2469
|
-
errorCode: error_codes
|
|
2470
|
-
errorClass:
|
|
2471
|
-
children: api_constants
|
|
2561
|
+
_this.objectives = new array.CMIArray({
|
|
2562
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2563
|
+
errorClass: Scorm2004ValidationError,
|
|
2564
|
+
children: api_constants.scorm2004_constants.objectives_children,
|
|
2472
2565
|
});
|
|
2473
|
-
_this.correct_responses = new array
|
|
2474
|
-
errorCode: error_codes
|
|
2475
|
-
errorClass:
|
|
2476
|
-
children: api_constants
|
|
2566
|
+
_this.correct_responses = new array.CMIArray({
|
|
2567
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2568
|
+
errorClass: Scorm2004ValidationError,
|
|
2569
|
+
children: api_constants.scorm2004_constants.correct_responses_children,
|
|
2477
2570
|
});
|
|
2478
2571
|
return _this;
|
|
2479
2572
|
}
|
|
@@ -2483,12 +2576,33 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2483
2576
|
(_a = this.objectives) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
2484
2577
|
(_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.initialize();
|
|
2485
2578
|
};
|
|
2579
|
+
CMIInteractionsObject.prototype.reset = function () {
|
|
2580
|
+
this._initialized = false;
|
|
2581
|
+
this._id = "";
|
|
2582
|
+
this._type = "";
|
|
2583
|
+
this._timestamp = "";
|
|
2584
|
+
this._weighting = "";
|
|
2585
|
+
this._learner_response = "";
|
|
2586
|
+
this._result = "";
|
|
2587
|
+
this._latency = "";
|
|
2588
|
+
this._description = "";
|
|
2589
|
+
this.objectives = new array.CMIArray({
|
|
2590
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2591
|
+
errorClass: Scorm2004ValidationError,
|
|
2592
|
+
children: api_constants.scorm2004_constants.objectives_children,
|
|
2593
|
+
});
|
|
2594
|
+
this.correct_responses = new array.CMIArray({
|
|
2595
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2596
|
+
errorClass: Scorm2004ValidationError,
|
|
2597
|
+
children: api_constants.scorm2004_constants.correct_responses_children,
|
|
2598
|
+
});
|
|
2599
|
+
};
|
|
2486
2600
|
Object.defineProperty(CMIInteractionsObject.prototype, "id", {
|
|
2487
2601
|
get: function () {
|
|
2488
2602
|
return this._id;
|
|
2489
2603
|
},
|
|
2490
2604
|
set: function (id) {
|
|
2491
|
-
if (check2004ValidFormat(id, regex
|
|
2605
|
+
if (check2004ValidFormat(id, regex.scorm2004_regex.CMILongIdentifier)) {
|
|
2492
2606
|
this._id = id;
|
|
2493
2607
|
}
|
|
2494
2608
|
},
|
|
@@ -2501,10 +2615,10 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2501
2615
|
},
|
|
2502
2616
|
set: function (type) {
|
|
2503
2617
|
if (this.initialized && this._id === "") {
|
|
2504
|
-
throw new
|
|
2618
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2505
2619
|
}
|
|
2506
2620
|
else {
|
|
2507
|
-
if (check2004ValidFormat(type, regex
|
|
2621
|
+
if (check2004ValidFormat(type, regex.scorm2004_regex.CMIType)) {
|
|
2508
2622
|
this._type = type;
|
|
2509
2623
|
}
|
|
2510
2624
|
}
|
|
@@ -2518,10 +2632,10 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2518
2632
|
},
|
|
2519
2633
|
set: function (timestamp) {
|
|
2520
2634
|
if (this.initialized && this._id === "") {
|
|
2521
|
-
throw new
|
|
2635
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2522
2636
|
}
|
|
2523
2637
|
else {
|
|
2524
|
-
if (check2004ValidFormat(timestamp, regex
|
|
2638
|
+
if (check2004ValidFormat(timestamp, regex.scorm2004_regex.CMITime)) {
|
|
2525
2639
|
this._timestamp = timestamp;
|
|
2526
2640
|
}
|
|
2527
2641
|
}
|
|
@@ -2535,10 +2649,10 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2535
2649
|
},
|
|
2536
2650
|
set: function (weighting) {
|
|
2537
2651
|
if (this.initialized && this._id === "") {
|
|
2538
|
-
throw new
|
|
2652
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2539
2653
|
}
|
|
2540
2654
|
else {
|
|
2541
|
-
if (check2004ValidFormat(weighting, regex
|
|
2655
|
+
if (check2004ValidFormat(weighting, regex.scorm2004_regex.CMIDecimal)) {
|
|
2542
2656
|
this._weighting = weighting;
|
|
2543
2657
|
}
|
|
2544
2658
|
}
|
|
@@ -2552,7 +2666,7 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2552
2666
|
},
|
|
2553
2667
|
set: function (learner_response) {
|
|
2554
2668
|
if (this.initialized && (this._type === "" || this._id === "")) {
|
|
2555
|
-
throw new
|
|
2669
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2556
2670
|
}
|
|
2557
2671
|
else {
|
|
2558
2672
|
var nodes = [];
|
|
@@ -2571,28 +2685,28 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2571
2685
|
var values = nodes[i].split(response_type.delimiter2);
|
|
2572
2686
|
if (values.length === 2) {
|
|
2573
2687
|
if (!values[0].match(formatRegex)) {
|
|
2574
|
-
throw new
|
|
2688
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2575
2689
|
}
|
|
2576
2690
|
else {
|
|
2577
2691
|
if (!response_type.format2 ||
|
|
2578
2692
|
!values[1].match(new RegExp(response_type.format2))) {
|
|
2579
|
-
throw new
|
|
2693
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2580
2694
|
}
|
|
2581
2695
|
}
|
|
2582
2696
|
}
|
|
2583
2697
|
else {
|
|
2584
|
-
throw new
|
|
2698
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2585
2699
|
}
|
|
2586
2700
|
}
|
|
2587
2701
|
else {
|
|
2588
2702
|
if (!nodes[i].match(formatRegex)) {
|
|
2589
|
-
throw new
|
|
2703
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2590
2704
|
}
|
|
2591
2705
|
else {
|
|
2592
2706
|
if (nodes[i] !== "" && response_type.unique) {
|
|
2593
2707
|
for (var j = 0; j < i; j++) {
|
|
2594
2708
|
if (nodes[i] === nodes[j]) {
|
|
2595
|
-
throw new
|
|
2709
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2596
2710
|
}
|
|
2597
2711
|
}
|
|
2598
2712
|
}
|
|
@@ -2601,12 +2715,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2601
2715
|
}
|
|
2602
2716
|
}
|
|
2603
2717
|
else {
|
|
2604
|
-
throw new
|
|
2718
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE);
|
|
2605
2719
|
}
|
|
2606
2720
|
this._learner_response = learner_response;
|
|
2607
2721
|
}
|
|
2608
2722
|
else {
|
|
2609
|
-
throw new
|
|
2723
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2610
2724
|
}
|
|
2611
2725
|
}
|
|
2612
2726
|
},
|
|
@@ -2618,7 +2732,7 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2618
2732
|
return this._result;
|
|
2619
2733
|
},
|
|
2620
2734
|
set: function (result) {
|
|
2621
|
-
if (check2004ValidFormat(result, regex
|
|
2735
|
+
if (check2004ValidFormat(result, regex.scorm2004_regex.CMIResult)) {
|
|
2622
2736
|
this._result = result;
|
|
2623
2737
|
}
|
|
2624
2738
|
},
|
|
@@ -2631,10 +2745,10 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2631
2745
|
},
|
|
2632
2746
|
set: function (latency) {
|
|
2633
2747
|
if (this.initialized && this._id === "") {
|
|
2634
|
-
throw new
|
|
2748
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2635
2749
|
}
|
|
2636
2750
|
else {
|
|
2637
|
-
if (check2004ValidFormat(latency, regex
|
|
2751
|
+
if (check2004ValidFormat(latency, regex.scorm2004_regex.CMITimespan)) {
|
|
2638
2752
|
this._latency = latency;
|
|
2639
2753
|
}
|
|
2640
2754
|
}
|
|
@@ -2648,10 +2762,10 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2648
2762
|
},
|
|
2649
2763
|
set: function (description) {
|
|
2650
2764
|
if (this.initialized && this._id === "") {
|
|
2651
|
-
throw new
|
|
2765
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2652
2766
|
}
|
|
2653
2767
|
else {
|
|
2654
|
-
if (check2004ValidFormat(description, regex
|
|
2768
|
+
if (check2004ValidFormat(description, regex.scorm2004_regex.CMILangString250, true)) {
|
|
2655
2769
|
this._description = description;
|
|
2656
2770
|
}
|
|
2657
2771
|
}
|
|
@@ -2677,21 +2791,25 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2677
2791
|
return result;
|
|
2678
2792
|
};
|
|
2679
2793
|
return CMIInteractionsObject;
|
|
2680
|
-
}(base_cmi
|
|
2794
|
+
}(base_cmi.BaseCMI));
|
|
2681
2795
|
|
|
2682
2796
|
var CMIInteractionsObjectivesObject = (function (_super) {
|
|
2683
|
-
(0,tslib_es6
|
|
2797
|
+
(0,tslib_es6.__extends)(CMIInteractionsObjectivesObject, _super);
|
|
2684
2798
|
function CMIInteractionsObjectivesObject() {
|
|
2685
2799
|
var _this = _super.call(this) || this;
|
|
2686
2800
|
_this._id = "";
|
|
2687
2801
|
return _this;
|
|
2688
2802
|
}
|
|
2803
|
+
CMIInteractionsObjectivesObject.prototype.reset = function () {
|
|
2804
|
+
this._initialized = false;
|
|
2805
|
+
this._id = "";
|
|
2806
|
+
};
|
|
2689
2807
|
Object.defineProperty(CMIInteractionsObjectivesObject.prototype, "id", {
|
|
2690
2808
|
get: function () {
|
|
2691
2809
|
return this._id;
|
|
2692
2810
|
},
|
|
2693
2811
|
set: function (id) {
|
|
2694
|
-
if (check2004ValidFormat(id, regex
|
|
2812
|
+
if (check2004ValidFormat(id, regex.scorm2004_regex.CMILongIdentifier)) {
|
|
2695
2813
|
this._id = id;
|
|
2696
2814
|
}
|
|
2697
2815
|
},
|
|
@@ -2707,21 +2825,25 @@ var CMIInteractionsObjectivesObject = (function (_super) {
|
|
|
2707
2825
|
return result;
|
|
2708
2826
|
};
|
|
2709
2827
|
return CMIInteractionsObjectivesObject;
|
|
2710
|
-
}(base_cmi
|
|
2828
|
+
}(base_cmi.BaseCMI));
|
|
2711
2829
|
|
|
2712
2830
|
var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
2713
|
-
(0,tslib_es6
|
|
2831
|
+
(0,tslib_es6.__extends)(CMIInteractionsCorrectResponsesObject, _super);
|
|
2714
2832
|
function CMIInteractionsCorrectResponsesObject() {
|
|
2715
2833
|
var _this = _super.call(this) || this;
|
|
2716
2834
|
_this._pattern = "";
|
|
2717
2835
|
return _this;
|
|
2718
2836
|
}
|
|
2837
|
+
CMIInteractionsCorrectResponsesObject.prototype.reset = function () {
|
|
2838
|
+
this._initialized = false;
|
|
2839
|
+
this._pattern = "";
|
|
2840
|
+
};
|
|
2719
2841
|
Object.defineProperty(CMIInteractionsCorrectResponsesObject.prototype, "pattern", {
|
|
2720
2842
|
get: function () {
|
|
2721
2843
|
return this._pattern;
|
|
2722
2844
|
},
|
|
2723
2845
|
set: function (pattern) {
|
|
2724
|
-
if (check2004ValidFormat(pattern, regex
|
|
2846
|
+
if (check2004ValidFormat(pattern, regex.scorm2004_regex.CMIFeedback)) {
|
|
2725
2847
|
this._pattern = pattern;
|
|
2726
2848
|
}
|
|
2727
2849
|
},
|
|
@@ -2737,7 +2859,7 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
2737
2859
|
return result;
|
|
2738
2860
|
};
|
|
2739
2861
|
return CMIInteractionsCorrectResponsesObject;
|
|
2740
|
-
}(base_cmi
|
|
2862
|
+
}(base_cmi.BaseCMI));
|
|
2741
2863
|
|
|
2742
2864
|
|
|
2743
2865
|
// EXTERNAL MODULE: ./src/cmi/common/score.ts
|
|
@@ -2751,27 +2873,34 @@ var score = __webpack_require__(434);
|
|
|
2751
2873
|
|
|
2752
2874
|
|
|
2753
2875
|
var Scorm2004CMIScore = (function (_super) {
|
|
2754
|
-
(0,tslib_es6
|
|
2876
|
+
(0,tslib_es6.__extends)(Scorm2004CMIScore, _super);
|
|
2755
2877
|
function Scorm2004CMIScore() {
|
|
2756
2878
|
var _this = _super.call(this, {
|
|
2757
|
-
score_children: api_constants
|
|
2879
|
+
score_children: api_constants.scorm2004_constants.score_children,
|
|
2758
2880
|
max: "",
|
|
2759
|
-
invalidErrorCode: error_codes
|
|
2760
|
-
invalidTypeCode: error_codes
|
|
2761
|
-
invalidRangeCode: error_codes
|
|
2762
|
-
decimalRegex: regex
|
|
2763
|
-
errorClass:
|
|
2881
|
+
invalidErrorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2882
|
+
invalidTypeCode: error_codes.scorm2004_errors.TYPE_MISMATCH,
|
|
2883
|
+
invalidRangeCode: error_codes.scorm2004_errors.VALUE_OUT_OF_RANGE,
|
|
2884
|
+
decimalRegex: regex.scorm2004_regex.CMIDecimal,
|
|
2885
|
+
errorClass: Scorm2004ValidationError,
|
|
2764
2886
|
}) || this;
|
|
2765
2887
|
_this._scaled = "";
|
|
2766
2888
|
return _this;
|
|
2767
2889
|
}
|
|
2890
|
+
Scorm2004CMIScore.prototype.reset = function () {
|
|
2891
|
+
this._initialized = false;
|
|
2892
|
+
this._scaled = "";
|
|
2893
|
+
this._raw = "";
|
|
2894
|
+
this._min = "";
|
|
2895
|
+
this._max = "";
|
|
2896
|
+
};
|
|
2768
2897
|
Object.defineProperty(Scorm2004CMIScore.prototype, "scaled", {
|
|
2769
2898
|
get: function () {
|
|
2770
2899
|
return this._scaled;
|
|
2771
2900
|
},
|
|
2772
2901
|
set: function (scaled) {
|
|
2773
|
-
if (check2004ValidFormat(scaled, regex
|
|
2774
|
-
check2004ValidRange(scaled, regex
|
|
2902
|
+
if (check2004ValidFormat(scaled, regex.scorm2004_regex.CMIDecimal) &&
|
|
2903
|
+
check2004ValidRange(scaled, regex.scorm2004_regex.scaled_range)) {
|
|
2775
2904
|
this._scaled = scaled;
|
|
2776
2905
|
}
|
|
2777
2906
|
},
|
|
@@ -2790,7 +2919,7 @@ var Scorm2004CMIScore = (function (_super) {
|
|
|
2790
2919
|
return result;
|
|
2791
2920
|
};
|
|
2792
2921
|
return Scorm2004CMIScore;
|
|
2793
|
-
}(score
|
|
2922
|
+
}(score.CMIScore));
|
|
2794
2923
|
|
|
2795
2924
|
|
|
2796
2925
|
;// ./src/cmi/scorm2004/comments.ts
|
|
@@ -2803,31 +2932,31 @@ var Scorm2004CMIScore = (function (_super) {
|
|
|
2803
2932
|
|
|
2804
2933
|
|
|
2805
2934
|
var CMICommentsFromLMS = (function (_super) {
|
|
2806
|
-
(0,tslib_es6
|
|
2935
|
+
(0,tslib_es6.__extends)(CMICommentsFromLMS, _super);
|
|
2807
2936
|
function CMICommentsFromLMS() {
|
|
2808
2937
|
return _super.call(this, {
|
|
2809
|
-
children: api_constants
|
|
2810
|
-
errorCode: error_codes
|
|
2811
|
-
errorClass:
|
|
2938
|
+
children: api_constants.scorm2004_constants.comments_children,
|
|
2939
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2940
|
+
errorClass: Scorm2004ValidationError,
|
|
2812
2941
|
}) || this;
|
|
2813
2942
|
}
|
|
2814
2943
|
return CMICommentsFromLMS;
|
|
2815
|
-
}(array
|
|
2944
|
+
}(array.CMIArray));
|
|
2816
2945
|
|
|
2817
2946
|
var CMICommentsFromLearner = (function (_super) {
|
|
2818
|
-
(0,tslib_es6
|
|
2947
|
+
(0,tslib_es6.__extends)(CMICommentsFromLearner, _super);
|
|
2819
2948
|
function CMICommentsFromLearner() {
|
|
2820
2949
|
return _super.call(this, {
|
|
2821
|
-
children: api_constants
|
|
2822
|
-
errorCode: error_codes
|
|
2823
|
-
errorClass:
|
|
2950
|
+
children: api_constants.scorm2004_constants.comments_children,
|
|
2951
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2952
|
+
errorClass: Scorm2004ValidationError,
|
|
2824
2953
|
}) || this;
|
|
2825
2954
|
}
|
|
2826
2955
|
return CMICommentsFromLearner;
|
|
2827
|
-
}(array
|
|
2956
|
+
}(array.CMIArray));
|
|
2828
2957
|
|
|
2829
2958
|
var CMICommentsObject = (function (_super) {
|
|
2830
|
-
(0,tslib_es6
|
|
2959
|
+
(0,tslib_es6.__extends)(CMICommentsObject, _super);
|
|
2831
2960
|
function CMICommentsObject(readOnlyAfterInit) {
|
|
2832
2961
|
if (readOnlyAfterInit === void 0) { readOnlyAfterInit = false; }
|
|
2833
2962
|
var _this = _super.call(this) || this;
|
|
@@ -2840,16 +2969,19 @@ var CMICommentsObject = (function (_super) {
|
|
|
2840
2969
|
_this._readOnlyAfterInit = readOnlyAfterInit;
|
|
2841
2970
|
return _this;
|
|
2842
2971
|
}
|
|
2972
|
+
CMICommentsObject.prototype.reset = function () {
|
|
2973
|
+
this._initialized = false;
|
|
2974
|
+
};
|
|
2843
2975
|
Object.defineProperty(CMICommentsObject.prototype, "comment", {
|
|
2844
2976
|
get: function () {
|
|
2845
2977
|
return this._comment;
|
|
2846
2978
|
},
|
|
2847
2979
|
set: function (comment) {
|
|
2848
2980
|
if (this.initialized && this._readOnlyAfterInit) {
|
|
2849
|
-
throw new
|
|
2981
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
2850
2982
|
}
|
|
2851
2983
|
else {
|
|
2852
|
-
if (check2004ValidFormat(comment, regex
|
|
2984
|
+
if (check2004ValidFormat(comment, regex.scorm2004_regex.CMILangString4000, true)) {
|
|
2853
2985
|
this._comment = comment;
|
|
2854
2986
|
}
|
|
2855
2987
|
}
|
|
@@ -2863,10 +2995,10 @@ var CMICommentsObject = (function (_super) {
|
|
|
2863
2995
|
},
|
|
2864
2996
|
set: function (location) {
|
|
2865
2997
|
if (this.initialized && this._readOnlyAfterInit) {
|
|
2866
|
-
throw new
|
|
2998
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
2867
2999
|
}
|
|
2868
3000
|
else {
|
|
2869
|
-
if (check2004ValidFormat(location, regex
|
|
3001
|
+
if (check2004ValidFormat(location, regex.scorm2004_regex.CMIString250)) {
|
|
2870
3002
|
this._location = location;
|
|
2871
3003
|
}
|
|
2872
3004
|
}
|
|
@@ -2880,10 +3012,10 @@ var CMICommentsObject = (function (_super) {
|
|
|
2880
3012
|
},
|
|
2881
3013
|
set: function (timestamp) {
|
|
2882
3014
|
if (this.initialized && this._readOnlyAfterInit) {
|
|
2883
|
-
throw new
|
|
3015
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
2884
3016
|
}
|
|
2885
3017
|
else {
|
|
2886
|
-
if (check2004ValidFormat(timestamp, regex
|
|
3018
|
+
if (check2004ValidFormat(timestamp, regex.scorm2004_regex.CMITime)) {
|
|
2887
3019
|
this._timestamp = timestamp;
|
|
2888
3020
|
}
|
|
2889
3021
|
}
|
|
@@ -2902,7 +3034,7 @@ var CMICommentsObject = (function (_super) {
|
|
|
2902
3034
|
return result;
|
|
2903
3035
|
};
|
|
2904
3036
|
return CMICommentsObject;
|
|
2905
|
-
}(base_cmi
|
|
3037
|
+
}(base_cmi.BaseCMI));
|
|
2906
3038
|
|
|
2907
3039
|
|
|
2908
3040
|
;// ./src/cmi/scorm2004/objectives.ts
|
|
@@ -2916,19 +3048,28 @@ var CMICommentsObject = (function (_super) {
|
|
|
2916
3048
|
|
|
2917
3049
|
|
|
2918
3050
|
var CMIObjectives = (function (_super) {
|
|
2919
|
-
(0,tslib_es6
|
|
3051
|
+
(0,tslib_es6.__extends)(CMIObjectives, _super);
|
|
2920
3052
|
function CMIObjectives() {
|
|
2921
3053
|
return _super.call(this, {
|
|
2922
|
-
children: api_constants
|
|
2923
|
-
errorCode: error_codes
|
|
2924
|
-
errorClass:
|
|
3054
|
+
children: api_constants.scorm2004_constants.objectives_children,
|
|
3055
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
3056
|
+
errorClass: Scorm2004ValidationError,
|
|
2925
3057
|
}) || this;
|
|
2926
3058
|
}
|
|
3059
|
+
CMIObjectives.prototype.findObjectiveById = function (id) {
|
|
3060
|
+
return this.childArray.find(function (objective) { return objective.id === id; });
|
|
3061
|
+
};
|
|
3062
|
+
CMIObjectives.prototype.findObjectiveByIndex = function (index) {
|
|
3063
|
+
return this.childArray[index];
|
|
3064
|
+
};
|
|
3065
|
+
CMIObjectives.prototype.setObjectiveByIndex = function (index, objective) {
|
|
3066
|
+
this.childArray[index] = objective;
|
|
3067
|
+
};
|
|
2927
3068
|
return CMIObjectives;
|
|
2928
|
-
}(array
|
|
3069
|
+
}(array.CMIArray));
|
|
2929
3070
|
|
|
2930
3071
|
var CMIObjectivesObject = (function (_super) {
|
|
2931
|
-
(0,tslib_es6
|
|
3072
|
+
(0,tslib_es6.__extends)(CMIObjectivesObject, _super);
|
|
2932
3073
|
function CMIObjectivesObject() {
|
|
2933
3074
|
var _this = _super.call(this) || this;
|
|
2934
3075
|
_this._id = "";
|
|
@@ -2939,6 +3080,9 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2939
3080
|
_this.score = new Scorm2004CMIScore();
|
|
2940
3081
|
return _this;
|
|
2941
3082
|
}
|
|
3083
|
+
CMIObjectivesObject.prototype.reset = function () {
|
|
3084
|
+
this._initialized = false;
|
|
3085
|
+
};
|
|
2942
3086
|
CMIObjectivesObject.prototype.initialize = function () {
|
|
2943
3087
|
var _a;
|
|
2944
3088
|
_super.prototype.initialize.call(this);
|
|
@@ -2949,7 +3093,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2949
3093
|
return this._id;
|
|
2950
3094
|
},
|
|
2951
3095
|
set: function (id) {
|
|
2952
|
-
if (check2004ValidFormat(id, regex
|
|
3096
|
+
if (check2004ValidFormat(id, regex.scorm2004_regex.CMILongIdentifier)) {
|
|
2953
3097
|
this._id = id;
|
|
2954
3098
|
}
|
|
2955
3099
|
},
|
|
@@ -2962,10 +3106,10 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2962
3106
|
},
|
|
2963
3107
|
set: function (success_status) {
|
|
2964
3108
|
if (this.initialized && this._id === "") {
|
|
2965
|
-
throw new
|
|
3109
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2966
3110
|
}
|
|
2967
3111
|
else {
|
|
2968
|
-
if (check2004ValidFormat(success_status, regex
|
|
3112
|
+
if (check2004ValidFormat(success_status, regex.scorm2004_regex.CMISStatus)) {
|
|
2969
3113
|
this._success_status = success_status;
|
|
2970
3114
|
}
|
|
2971
3115
|
}
|
|
@@ -2979,10 +3123,10 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2979
3123
|
},
|
|
2980
3124
|
set: function (completion_status) {
|
|
2981
3125
|
if (this.initialized && this._id === "") {
|
|
2982
|
-
throw new
|
|
3126
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2983
3127
|
}
|
|
2984
3128
|
else {
|
|
2985
|
-
if (check2004ValidFormat(completion_status, regex
|
|
3129
|
+
if (check2004ValidFormat(completion_status, regex.scorm2004_regex.CMICStatus)) {
|
|
2986
3130
|
this._completion_status = completion_status;
|
|
2987
3131
|
}
|
|
2988
3132
|
}
|
|
@@ -2996,11 +3140,11 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2996
3140
|
},
|
|
2997
3141
|
set: function (progress_measure) {
|
|
2998
3142
|
if (this.initialized && this._id === "") {
|
|
2999
|
-
throw new
|
|
3143
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
3000
3144
|
}
|
|
3001
3145
|
else {
|
|
3002
|
-
if (check2004ValidFormat(progress_measure, regex
|
|
3003
|
-
check2004ValidRange(progress_measure, regex
|
|
3146
|
+
if (check2004ValidFormat(progress_measure, regex.scorm2004_regex.CMIDecimal) &&
|
|
3147
|
+
check2004ValidRange(progress_measure, regex.scorm2004_regex.progress_range)) {
|
|
3004
3148
|
this._progress_measure = progress_measure;
|
|
3005
3149
|
}
|
|
3006
3150
|
}
|
|
@@ -3014,10 +3158,10 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
3014
3158
|
},
|
|
3015
3159
|
set: function (description) {
|
|
3016
3160
|
if (this.initialized && this._id === "") {
|
|
3017
|
-
throw new
|
|
3161
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
3018
3162
|
}
|
|
3019
3163
|
else {
|
|
3020
|
-
if (check2004ValidFormat(description, regex
|
|
3164
|
+
if (check2004ValidFormat(description, regex.scorm2004_regex.CMILangString250, true)) {
|
|
3021
3165
|
this._description = description;
|
|
3022
3166
|
}
|
|
3023
3167
|
}
|
|
@@ -3039,7 +3183,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
3039
3183
|
return result;
|
|
3040
3184
|
};
|
|
3041
3185
|
return CMIObjectivesObject;
|
|
3042
|
-
}(base_cmi
|
|
3186
|
+
}(base_cmi.BaseCMI));
|
|
3043
3187
|
|
|
3044
3188
|
|
|
3045
3189
|
;// ./src/cmi/scorm2004/cmi.ts
|
|
@@ -3057,12 +3201,12 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
3057
3201
|
|
|
3058
3202
|
|
|
3059
3203
|
var CMI = (function (_super) {
|
|
3060
|
-
(0,tslib_es6
|
|
3204
|
+
(0,tslib_es6.__extends)(CMI, _super);
|
|
3061
3205
|
function CMI(initialized) {
|
|
3062
3206
|
if (initialized === void 0) { initialized = false; }
|
|
3063
3207
|
var _this = _super.call(this) || this;
|
|
3064
3208
|
_this.__version = "1.0";
|
|
3065
|
-
_this.__children = api_constants
|
|
3209
|
+
_this.__children = api_constants.scorm2004_constants.cmi_children;
|
|
3066
3210
|
_this._completion_status = "unknown";
|
|
3067
3211
|
_this._completion_threshold = "";
|
|
3068
3212
|
_this._credit = "credit";
|
|
@@ -3101,12 +3245,27 @@ var CMI = (function (_super) {
|
|
|
3101
3245
|
(_e = this.interactions) === null || _e === void 0 ? void 0 : _e.initialize();
|
|
3102
3246
|
(_f = this.objectives) === null || _f === void 0 ? void 0 : _f.initialize();
|
|
3103
3247
|
};
|
|
3248
|
+
CMI.prototype.reset = function () {
|
|
3249
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3250
|
+
this._initialized = false;
|
|
3251
|
+
this._completion_status = "incomplete";
|
|
3252
|
+
this._exit = "";
|
|
3253
|
+
this._session_time = "PT0H0M0S";
|
|
3254
|
+
this._progress_measure = "";
|
|
3255
|
+
this._location = "";
|
|
3256
|
+
(_a = this.objectives) === null || _a === void 0 ? void 0 : _a.reset(false);
|
|
3257
|
+
(_b = this.interactions) === null || _b === void 0 ? void 0 : _b.reset(true);
|
|
3258
|
+
(_c = this.score) === null || _c === void 0 ? void 0 : _c.reset();
|
|
3259
|
+
(_d = this.comments_from_learner) === null || _d === void 0 ? void 0 : _d.reset();
|
|
3260
|
+
(_e = this.comments_from_lms) === null || _e === void 0 ? void 0 : _e.reset();
|
|
3261
|
+
(_f = this.learner_preference) === null || _f === void 0 ? void 0 : _f.reset();
|
|
3262
|
+
};
|
|
3104
3263
|
Object.defineProperty(CMI.prototype, "_version", {
|
|
3105
3264
|
get: function () {
|
|
3106
3265
|
return this.__version;
|
|
3107
3266
|
},
|
|
3108
3267
|
set: function (_version) {
|
|
3109
|
-
throw new
|
|
3268
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3110
3269
|
},
|
|
3111
3270
|
enumerable: false,
|
|
3112
3271
|
configurable: true
|
|
@@ -3116,7 +3275,7 @@ var CMI = (function (_super) {
|
|
|
3116
3275
|
return this.__children;
|
|
3117
3276
|
},
|
|
3118
3277
|
set: function (_children) {
|
|
3119
|
-
throw new
|
|
3278
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3120
3279
|
},
|
|
3121
3280
|
enumerable: false,
|
|
3122
3281
|
configurable: true
|
|
@@ -3126,7 +3285,7 @@ var CMI = (function (_super) {
|
|
|
3126
3285
|
return this._completion_status;
|
|
3127
3286
|
},
|
|
3128
3287
|
set: function (completion_status) {
|
|
3129
|
-
if (check2004ValidFormat(completion_status, regex
|
|
3288
|
+
if (check2004ValidFormat(completion_status, regex.scorm2004_regex.CMICStatus)) {
|
|
3130
3289
|
this._completion_status = completion_status;
|
|
3131
3290
|
}
|
|
3132
3291
|
},
|
|
@@ -3139,7 +3298,7 @@ var CMI = (function (_super) {
|
|
|
3139
3298
|
},
|
|
3140
3299
|
set: function (completion_threshold) {
|
|
3141
3300
|
if (this.initialized) {
|
|
3142
|
-
throw new
|
|
3301
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3143
3302
|
}
|
|
3144
3303
|
else {
|
|
3145
3304
|
this._completion_threshold = completion_threshold;
|
|
@@ -3154,7 +3313,7 @@ var CMI = (function (_super) {
|
|
|
3154
3313
|
},
|
|
3155
3314
|
set: function (credit) {
|
|
3156
3315
|
if (this.initialized) {
|
|
3157
|
-
throw new
|
|
3316
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3158
3317
|
}
|
|
3159
3318
|
else {
|
|
3160
3319
|
this._credit = credit;
|
|
@@ -3169,7 +3328,7 @@ var CMI = (function (_super) {
|
|
|
3169
3328
|
},
|
|
3170
3329
|
set: function (entry) {
|
|
3171
3330
|
if (this.initialized) {
|
|
3172
|
-
throw new
|
|
3331
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3173
3332
|
}
|
|
3174
3333
|
else {
|
|
3175
3334
|
this._entry = entry;
|
|
@@ -3181,12 +3340,12 @@ var CMI = (function (_super) {
|
|
|
3181
3340
|
Object.defineProperty(CMI.prototype, "exit", {
|
|
3182
3341
|
get: function () {
|
|
3183
3342
|
if (!this.jsonString) {
|
|
3184
|
-
throw new
|
|
3343
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.WRITE_ONLY_ELEMENT);
|
|
3185
3344
|
}
|
|
3186
3345
|
return this._exit;
|
|
3187
3346
|
},
|
|
3188
3347
|
set: function (exit) {
|
|
3189
|
-
if (check2004ValidFormat(exit, regex
|
|
3348
|
+
if (check2004ValidFormat(exit, regex.scorm2004_regex.CMIExit, true)) {
|
|
3190
3349
|
this._exit = exit;
|
|
3191
3350
|
}
|
|
3192
3351
|
},
|
|
@@ -3199,7 +3358,7 @@ var CMI = (function (_super) {
|
|
|
3199
3358
|
},
|
|
3200
3359
|
set: function (launch_data) {
|
|
3201
3360
|
if (this.initialized) {
|
|
3202
|
-
throw new
|
|
3361
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3203
3362
|
}
|
|
3204
3363
|
else {
|
|
3205
3364
|
this._launch_data = launch_data;
|
|
@@ -3214,7 +3373,7 @@ var CMI = (function (_super) {
|
|
|
3214
3373
|
},
|
|
3215
3374
|
set: function (learner_id) {
|
|
3216
3375
|
if (this.initialized) {
|
|
3217
|
-
throw new
|
|
3376
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3218
3377
|
}
|
|
3219
3378
|
else {
|
|
3220
3379
|
this._learner_id = learner_id;
|
|
@@ -3229,7 +3388,7 @@ var CMI = (function (_super) {
|
|
|
3229
3388
|
},
|
|
3230
3389
|
set: function (learner_name) {
|
|
3231
3390
|
if (this.initialized) {
|
|
3232
|
-
throw new
|
|
3391
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3233
3392
|
}
|
|
3234
3393
|
else {
|
|
3235
3394
|
this._learner_name = learner_name;
|
|
@@ -3243,7 +3402,7 @@ var CMI = (function (_super) {
|
|
|
3243
3402
|
return this._location;
|
|
3244
3403
|
},
|
|
3245
3404
|
set: function (location) {
|
|
3246
|
-
if (check2004ValidFormat(location, regex
|
|
3405
|
+
if (check2004ValidFormat(location, regex.scorm2004_regex.CMIString1000)) {
|
|
3247
3406
|
this._location = location;
|
|
3248
3407
|
}
|
|
3249
3408
|
},
|
|
@@ -3256,7 +3415,7 @@ var CMI = (function (_super) {
|
|
|
3256
3415
|
},
|
|
3257
3416
|
set: function (max_time_allowed) {
|
|
3258
3417
|
if (this.initialized) {
|
|
3259
|
-
throw new
|
|
3418
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3260
3419
|
}
|
|
3261
3420
|
else {
|
|
3262
3421
|
this._max_time_allowed = max_time_allowed;
|
|
@@ -3271,7 +3430,7 @@ var CMI = (function (_super) {
|
|
|
3271
3430
|
},
|
|
3272
3431
|
set: function (mode) {
|
|
3273
3432
|
if (this.initialized) {
|
|
3274
|
-
throw new
|
|
3433
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3275
3434
|
}
|
|
3276
3435
|
else {
|
|
3277
3436
|
this._mode = mode;
|
|
@@ -3285,8 +3444,8 @@ var CMI = (function (_super) {
|
|
|
3285
3444
|
return this._progress_measure;
|
|
3286
3445
|
},
|
|
3287
3446
|
set: function (progress_measure) {
|
|
3288
|
-
if (check2004ValidFormat(progress_measure, regex
|
|
3289
|
-
check2004ValidRange(progress_measure, regex
|
|
3447
|
+
if (check2004ValidFormat(progress_measure, regex.scorm2004_regex.CMIDecimal) &&
|
|
3448
|
+
check2004ValidRange(progress_measure, regex.scorm2004_regex.progress_range)) {
|
|
3290
3449
|
this._progress_measure = progress_measure;
|
|
3291
3450
|
}
|
|
3292
3451
|
},
|
|
@@ -3299,7 +3458,7 @@ var CMI = (function (_super) {
|
|
|
3299
3458
|
},
|
|
3300
3459
|
set: function (scaled_passing_score) {
|
|
3301
3460
|
if (this.initialized) {
|
|
3302
|
-
throw new
|
|
3461
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3303
3462
|
}
|
|
3304
3463
|
else {
|
|
3305
3464
|
this._scaled_passing_score = scaled_passing_score;
|
|
@@ -3311,12 +3470,12 @@ var CMI = (function (_super) {
|
|
|
3311
3470
|
Object.defineProperty(CMI.prototype, "session_time", {
|
|
3312
3471
|
get: function () {
|
|
3313
3472
|
if (!this.jsonString) {
|
|
3314
|
-
throw new
|
|
3473
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.WRITE_ONLY_ELEMENT);
|
|
3315
3474
|
}
|
|
3316
3475
|
return this._session_time;
|
|
3317
3476
|
},
|
|
3318
3477
|
set: function (session_time) {
|
|
3319
|
-
if (check2004ValidFormat(session_time, regex
|
|
3478
|
+
if (check2004ValidFormat(session_time, regex.scorm2004_regex.CMITimespan)) {
|
|
3320
3479
|
this._session_time = session_time;
|
|
3321
3480
|
}
|
|
3322
3481
|
},
|
|
@@ -3328,7 +3487,7 @@ var CMI = (function (_super) {
|
|
|
3328
3487
|
return this._success_status;
|
|
3329
3488
|
},
|
|
3330
3489
|
set: function (success_status) {
|
|
3331
|
-
if (check2004ValidFormat(success_status, regex
|
|
3490
|
+
if (check2004ValidFormat(success_status, regex.scorm2004_regex.CMISStatus)) {
|
|
3332
3491
|
this._success_status = success_status;
|
|
3333
3492
|
}
|
|
3334
3493
|
},
|
|
@@ -3340,7 +3499,7 @@ var CMI = (function (_super) {
|
|
|
3340
3499
|
return this._suspend_data;
|
|
3341
3500
|
},
|
|
3342
3501
|
set: function (suspend_data) {
|
|
3343
|
-
if (check2004ValidFormat(suspend_data, regex
|
|
3502
|
+
if (check2004ValidFormat(suspend_data, regex.scorm2004_regex.CMIString64000, true)) {
|
|
3344
3503
|
this._suspend_data = suspend_data;
|
|
3345
3504
|
}
|
|
3346
3505
|
},
|
|
@@ -3353,7 +3512,7 @@ var CMI = (function (_super) {
|
|
|
3353
3512
|
},
|
|
3354
3513
|
set: function (time_limit_action) {
|
|
3355
3514
|
if (this.initialized) {
|
|
3356
|
-
throw new
|
|
3515
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3357
3516
|
}
|
|
3358
3517
|
else {
|
|
3359
3518
|
this._time_limit_action = time_limit_action;
|
|
@@ -3368,7 +3527,7 @@ var CMI = (function (_super) {
|
|
|
3368
3527
|
},
|
|
3369
3528
|
set: function (total_time) {
|
|
3370
3529
|
if (this.initialized) {
|
|
3371
|
-
throw new
|
|
3530
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3372
3531
|
}
|
|
3373
3532
|
else {
|
|
3374
3533
|
this._total_time = total_time;
|
|
@@ -3382,9 +3541,9 @@ var CMI = (function (_super) {
|
|
|
3382
3541
|
var startTime = this.start_time;
|
|
3383
3542
|
if (typeof startTime !== "undefined" && startTime !== null) {
|
|
3384
3543
|
var seconds = new Date().getTime() - startTime;
|
|
3385
|
-
sessionTime = utilities
|
|
3544
|
+
sessionTime = utilities.getSecondsAsISODuration(seconds / 1000);
|
|
3386
3545
|
}
|
|
3387
|
-
return utilities
|
|
3546
|
+
return utilities.addTwoDurations(this._total_time, sessionTime, regex.scorm2004_regex.CMITimespan);
|
|
3388
3547
|
};
|
|
3389
3548
|
CMI.prototype.toJSON = function () {
|
|
3390
3549
|
this.jsonString = true;
|
|
@@ -3417,7 +3576,7 @@ var CMI = (function (_super) {
|
|
|
3417
3576
|
return result;
|
|
3418
3577
|
};
|
|
3419
3578
|
return CMI;
|
|
3420
|
-
}(base_cmi
|
|
3579
|
+
}(base_cmi.BaseRootCMI));
|
|
3421
3580
|
|
|
3422
3581
|
|
|
3423
3582
|
;// ./src/constants/language_constants.ts
|
|
@@ -3826,11 +3985,15 @@ var enums = __webpack_require__(56);
|
|
|
3826
3985
|
|
|
3827
3986
|
|
|
3828
3987
|
|
|
3988
|
+
|
|
3989
|
+
|
|
3829
3990
|
var ADL = (function (_super) {
|
|
3830
|
-
(0,tslib_es6
|
|
3991
|
+
(0,tslib_es6.__extends)(ADL, _super);
|
|
3831
3992
|
function ADL() {
|
|
3832
3993
|
var _this = _super.call(this) || this;
|
|
3994
|
+
_this.data = new ADLData();
|
|
3833
3995
|
_this.nav = new ADLNav();
|
|
3996
|
+
_this.data = new ADLData();
|
|
3834
3997
|
return _this;
|
|
3835
3998
|
}
|
|
3836
3999
|
ADL.prototype.initialize = function () {
|
|
@@ -3838,19 +4001,25 @@ var ADL = (function (_super) {
|
|
|
3838
4001
|
_super.prototype.initialize.call(this);
|
|
3839
4002
|
(_a = this.nav) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
3840
4003
|
};
|
|
4004
|
+
ADL.prototype.reset = function () {
|
|
4005
|
+
var _a;
|
|
4006
|
+
this._initialized = false;
|
|
4007
|
+
(_a = this.nav) === null || _a === void 0 ? void 0 : _a.reset();
|
|
4008
|
+
};
|
|
3841
4009
|
ADL.prototype.toJSON = function () {
|
|
3842
4010
|
this.jsonString = true;
|
|
3843
4011
|
var result = {
|
|
3844
4012
|
nav: this.nav,
|
|
4013
|
+
data: this.data,
|
|
3845
4014
|
};
|
|
3846
4015
|
delete this.jsonString;
|
|
3847
4016
|
return result;
|
|
3848
4017
|
};
|
|
3849
4018
|
return ADL;
|
|
3850
|
-
}(base_cmi
|
|
4019
|
+
}(base_cmi.BaseCMI));
|
|
3851
4020
|
|
|
3852
4021
|
var ADLNav = (function (_super) {
|
|
3853
|
-
(0,tslib_es6
|
|
4022
|
+
(0,tslib_es6.__extends)(ADLNav, _super);
|
|
3854
4023
|
function ADLNav() {
|
|
3855
4024
|
var _this = _super.call(this) || this;
|
|
3856
4025
|
_this._request = "_none_";
|
|
@@ -3862,12 +4031,18 @@ var ADLNav = (function (_super) {
|
|
|
3862
4031
|
_super.prototype.initialize.call(this);
|
|
3863
4032
|
(_a = this.request_valid) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
3864
4033
|
};
|
|
4034
|
+
ADLNav.prototype.reset = function () {
|
|
4035
|
+
var _a;
|
|
4036
|
+
this._initialized = false;
|
|
4037
|
+
this._request = "_none_";
|
|
4038
|
+
(_a = this.request_valid) === null || _a === void 0 ? void 0 : _a.reset();
|
|
4039
|
+
};
|
|
3865
4040
|
Object.defineProperty(ADLNav.prototype, "request", {
|
|
3866
4041
|
get: function () {
|
|
3867
4042
|
return this._request;
|
|
3868
4043
|
},
|
|
3869
4044
|
set: function (request) {
|
|
3870
|
-
if (check2004ValidFormat(request, regex
|
|
4045
|
+
if (check2004ValidFormat(request, regex.scorm2004_regex.NAVEvent)) {
|
|
3871
4046
|
this._request = request;
|
|
3872
4047
|
}
|
|
3873
4048
|
},
|
|
@@ -3883,10 +4058,69 @@ var ADLNav = (function (_super) {
|
|
|
3883
4058
|
return result;
|
|
3884
4059
|
};
|
|
3885
4060
|
return ADLNav;
|
|
3886
|
-
}(base_cmi
|
|
4061
|
+
}(base_cmi.BaseCMI));
|
|
4062
|
+
|
|
4063
|
+
var ADLData = (function (_super) {
|
|
4064
|
+
(0,tslib_es6.__extends)(ADLData, _super);
|
|
4065
|
+
function ADLData() {
|
|
4066
|
+
return _super.call(this, {
|
|
4067
|
+
children: api_constants.scorm2004_constants.adl_data_children,
|
|
4068
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
4069
|
+
errorClass: Scorm2004ValidationError,
|
|
4070
|
+
}) || this;
|
|
4071
|
+
}
|
|
4072
|
+
return ADLData;
|
|
4073
|
+
}(array.CMIArray));
|
|
4074
|
+
|
|
4075
|
+
var ADLDataObject = (function (_super) {
|
|
4076
|
+
(0,tslib_es6.__extends)(ADLDataObject, _super);
|
|
4077
|
+
function ADLDataObject() {
|
|
4078
|
+
var _this = _super.call(this) || this;
|
|
4079
|
+
_this._id = "";
|
|
4080
|
+
_this._store = "";
|
|
4081
|
+
return _this;
|
|
4082
|
+
}
|
|
4083
|
+
ADLDataObject.prototype.reset = function () {
|
|
4084
|
+
this._initialized = false;
|
|
4085
|
+
};
|
|
4086
|
+
Object.defineProperty(ADLDataObject.prototype, "id", {
|
|
4087
|
+
get: function () {
|
|
4088
|
+
return this._id;
|
|
4089
|
+
},
|
|
4090
|
+
set: function (id) {
|
|
4091
|
+
if (check2004ValidFormat(id, regex.scorm2004_regex.CMILongIdentifier)) {
|
|
4092
|
+
this._id = id;
|
|
4093
|
+
}
|
|
4094
|
+
},
|
|
4095
|
+
enumerable: false,
|
|
4096
|
+
configurable: true
|
|
4097
|
+
});
|
|
4098
|
+
Object.defineProperty(ADLDataObject.prototype, "store", {
|
|
4099
|
+
get: function () {
|
|
4100
|
+
return this._store;
|
|
4101
|
+
},
|
|
4102
|
+
set: function (store) {
|
|
4103
|
+
if (check2004ValidFormat(store, regex.scorm2004_regex.CMILangString4000)) {
|
|
4104
|
+
this._store = store;
|
|
4105
|
+
}
|
|
4106
|
+
},
|
|
4107
|
+
enumerable: false,
|
|
4108
|
+
configurable: true
|
|
4109
|
+
});
|
|
4110
|
+
ADLDataObject.prototype.toJSON = function () {
|
|
4111
|
+
this.jsonString = true;
|
|
4112
|
+
var result = {
|
|
4113
|
+
id: this._id,
|
|
4114
|
+
store: this._store,
|
|
4115
|
+
};
|
|
4116
|
+
delete this.jsonString;
|
|
4117
|
+
return result;
|
|
4118
|
+
};
|
|
4119
|
+
return ADLDataObject;
|
|
4120
|
+
}(base_cmi.BaseCMI));
|
|
3887
4121
|
|
|
3888
4122
|
var ADLNavRequestValid = (function (_super) {
|
|
3889
|
-
(0,tslib_es6
|
|
4123
|
+
(0,tslib_es6.__extends)(ADLNavRequestValid, _super);
|
|
3890
4124
|
function ADLNavRequestValid() {
|
|
3891
4125
|
var _this = _super.call(this) || this;
|
|
3892
4126
|
_this._continue = "unknown";
|
|
@@ -3895,15 +4129,20 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
3895
4129
|
_this._jump = {};
|
|
3896
4130
|
return _this;
|
|
3897
4131
|
}
|
|
4132
|
+
ADLNavRequestValid.prototype.reset = function () {
|
|
4133
|
+
this._initialized = false;
|
|
4134
|
+
this._continue = "unknown";
|
|
4135
|
+
this._previous = "unknown";
|
|
4136
|
+
};
|
|
3898
4137
|
Object.defineProperty(ADLNavRequestValid.prototype, "continue", {
|
|
3899
4138
|
get: function () {
|
|
3900
4139
|
return this._continue;
|
|
3901
4140
|
},
|
|
3902
4141
|
set: function (_continue) {
|
|
3903
4142
|
if (this.initialized) {
|
|
3904
|
-
throw new
|
|
4143
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3905
4144
|
}
|
|
3906
|
-
if (check2004ValidFormat(_continue, regex
|
|
4145
|
+
if (check2004ValidFormat(_continue, regex.scorm2004_regex.NAVBoolean)) {
|
|
3907
4146
|
this._continue = _continue;
|
|
3908
4147
|
}
|
|
3909
4148
|
},
|
|
@@ -3916,9 +4155,9 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
3916
4155
|
},
|
|
3917
4156
|
set: function (_previous) {
|
|
3918
4157
|
if (this.initialized) {
|
|
3919
|
-
throw new
|
|
4158
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3920
4159
|
}
|
|
3921
|
-
if (check2004ValidFormat(_previous, regex
|
|
4160
|
+
if (check2004ValidFormat(_previous, regex.scorm2004_regex.NAVBoolean)) {
|
|
3922
4161
|
this._previous = _previous;
|
|
3923
4162
|
}
|
|
3924
4163
|
},
|
|
@@ -3931,17 +4170,17 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
3931
4170
|
},
|
|
3932
4171
|
set: function (choice) {
|
|
3933
4172
|
if (this.initialized) {
|
|
3934
|
-
throw new
|
|
4173
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3935
4174
|
}
|
|
3936
4175
|
if (typeof choice !== "object") {
|
|
3937
|
-
throw new
|
|
4176
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
3938
4177
|
}
|
|
3939
4178
|
for (var key in choice) {
|
|
3940
4179
|
if ({}.hasOwnProperty.call(choice, key)) {
|
|
3941
|
-
if (check2004ValidFormat(choice[key], regex
|
|
3942
|
-
check2004ValidFormat(key, regex
|
|
4180
|
+
if (check2004ValidFormat(choice[key], regex.scorm2004_regex.NAVBoolean) &&
|
|
4181
|
+
check2004ValidFormat(key, regex.scorm2004_regex.NAVTarget)) {
|
|
3943
4182
|
this._choice[key] =
|
|
3944
|
-
enums
|
|
4183
|
+
enums.NAVBoolean[choice[key]];
|
|
3945
4184
|
}
|
|
3946
4185
|
}
|
|
3947
4186
|
}
|
|
@@ -3955,16 +4194,16 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
3955
4194
|
},
|
|
3956
4195
|
set: function (jump) {
|
|
3957
4196
|
if (this.initialized) {
|
|
3958
|
-
throw new
|
|
4197
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3959
4198
|
}
|
|
3960
4199
|
if (typeof jump !== "object") {
|
|
3961
|
-
throw new
|
|
4200
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
3962
4201
|
}
|
|
3963
4202
|
for (var key in jump) {
|
|
3964
4203
|
if ({}.hasOwnProperty.call(jump, key)) {
|
|
3965
|
-
if (check2004ValidFormat(jump[key], regex
|
|
3966
|
-
check2004ValidFormat(key, regex
|
|
3967
|
-
this._jump[key] = enums
|
|
4204
|
+
if (check2004ValidFormat(jump[key], regex.scorm2004_regex.NAVBoolean) &&
|
|
4205
|
+
check2004ValidFormat(key, regex.scorm2004_regex.NAVTarget)) {
|
|
4206
|
+
this._jump[key] = enums.NAVBoolean[jump[key]];
|
|
3968
4207
|
}
|
|
3969
4208
|
}
|
|
3970
4209
|
}
|
|
@@ -3984,7 +4223,7 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
3984
4223
|
return result;
|
|
3985
4224
|
};
|
|
3986
4225
|
return ADLNavRequestValid;
|
|
3987
|
-
}(base_cmi
|
|
4226
|
+
}(base_cmi.BaseCMI));
|
|
3988
4227
|
|
|
3989
4228
|
|
|
3990
4229
|
;// ./src/Scorm2004API.ts
|
|
@@ -4003,9 +4242,8 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
4003
4242
|
|
|
4004
4243
|
|
|
4005
4244
|
|
|
4006
|
-
|
|
4007
4245
|
var Scorm2004Impl = (function (_super) {
|
|
4008
|
-
(0,tslib_es6
|
|
4246
|
+
(0,tslib_es6.__extends)(Scorm2004Impl, _super);
|
|
4009
4247
|
function Scorm2004Impl(settings) {
|
|
4010
4248
|
var _this = this;
|
|
4011
4249
|
if (settings) {
|
|
@@ -4013,8 +4251,9 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4013
4251
|
settings.mastery_override = false;
|
|
4014
4252
|
}
|
|
4015
4253
|
}
|
|
4016
|
-
_this = _super.call(this, error_codes
|
|
4254
|
+
_this = _super.call(this, error_codes.scorm2004_errors, settings) || this;
|
|
4017
4255
|
_this._version = "1.0";
|
|
4256
|
+
_this._globalObjectives = [];
|
|
4018
4257
|
_this.cmi = new CMI();
|
|
4019
4258
|
_this.adl = new ADL();
|
|
4020
4259
|
_this.Initialize = _this.lmsInitialize;
|
|
@@ -4028,9 +4267,10 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4028
4267
|
return _this;
|
|
4029
4268
|
}
|
|
4030
4269
|
Scorm2004Impl.prototype.reset = function (settings) {
|
|
4270
|
+
var _a, _b;
|
|
4031
4271
|
this.commonReset(settings);
|
|
4032
|
-
this.cmi
|
|
4033
|
-
this.adl
|
|
4272
|
+
(_a = this.cmi) === null || _a === void 0 ? void 0 : _a.reset();
|
|
4273
|
+
(_b = this.adl) === null || _b === void 0 ? void 0 : _b.reset();
|
|
4034
4274
|
};
|
|
4035
4275
|
Object.defineProperty(Scorm2004Impl.prototype, "version", {
|
|
4036
4276
|
get: function () {
|
|
@@ -4039,14 +4279,21 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4039
4279
|
enumerable: false,
|
|
4040
4280
|
configurable: true
|
|
4041
4281
|
});
|
|
4282
|
+
Object.defineProperty(Scorm2004Impl.prototype, "globalObjectives", {
|
|
4283
|
+
get: function () {
|
|
4284
|
+
return this._globalObjectives;
|
|
4285
|
+
},
|
|
4286
|
+
enumerable: false,
|
|
4287
|
+
configurable: true
|
|
4288
|
+
});
|
|
4042
4289
|
Scorm2004Impl.prototype.lmsInitialize = function () {
|
|
4043
4290
|
this.cmi.initialize();
|
|
4044
4291
|
return this.initialize("Initialize");
|
|
4045
4292
|
};
|
|
4046
4293
|
Scorm2004Impl.prototype.lmsFinish = function () {
|
|
4047
4294
|
var _this = this;
|
|
4048
|
-
(function () { return (0,tslib_es6
|
|
4049
|
-
return (0,tslib_es6
|
|
4295
|
+
(function () { return (0,tslib_es6.__awaiter)(_this, void 0, void 0, function () {
|
|
4296
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
4050
4297
|
switch (_a.label) {
|
|
4051
4298
|
case 0: return [4, this.internalFinish()];
|
|
4052
4299
|
case 1:
|
|
@@ -4055,18 +4302,18 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4055
4302
|
}
|
|
4056
4303
|
});
|
|
4057
4304
|
}); })();
|
|
4058
|
-
return api_constants
|
|
4305
|
+
return api_constants.global_constants.SCORM_TRUE;
|
|
4059
4306
|
};
|
|
4060
4307
|
Scorm2004Impl.prototype.internalFinish = function () {
|
|
4061
|
-
return (0,tslib_es6
|
|
4308
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
4062
4309
|
var result, navActions, request, choiceJumpRegex, matches, target, action;
|
|
4063
4310
|
var _a, _b, _c, _d;
|
|
4064
|
-
return (0,tslib_es6
|
|
4311
|
+
return (0,tslib_es6.__generator)(this, function (_e) {
|
|
4065
4312
|
switch (_e.label) {
|
|
4066
4313
|
case 0: return [4, this.terminate("Terminate", true)];
|
|
4067
4314
|
case 1:
|
|
4068
4315
|
result = _e.sent();
|
|
4069
|
-
if (result === api_constants
|
|
4316
|
+
if (result === api_constants.global_constants.SCORM_TRUE) {
|
|
4070
4317
|
if (this.adl.nav.request !== "_none_") {
|
|
4071
4318
|
navActions = {
|
|
4072
4319
|
continue: "SequenceNext",
|
|
@@ -4079,7 +4326,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4079
4326
|
abandonAll: "SequenceAbandonAll",
|
|
4080
4327
|
};
|
|
4081
4328
|
request = this.adl.nav.request;
|
|
4082
|
-
choiceJumpRegex = new RegExp(regex
|
|
4329
|
+
choiceJumpRegex = new RegExp(regex.scorm2004_regex.NAVEvent);
|
|
4083
4330
|
matches = request.match(choiceJumpRegex);
|
|
4084
4331
|
target = "";
|
|
4085
4332
|
if (matches) {
|
|
@@ -4108,7 +4355,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4108
4355
|
};
|
|
4109
4356
|
Scorm2004Impl.prototype.lmsGetValue = function (CMIElement) {
|
|
4110
4357
|
var adlNavRequestRegex = "^adl\\.nav\\.request_valid\\.(choice|jump)\\.{target=\\S{0,}([a-zA-Z0-9-_]+)}$";
|
|
4111
|
-
if ((0,utilities
|
|
4358
|
+
if ((0,utilities.stringMatches)(CMIElement, adlNavRequestRegex)) {
|
|
4112
4359
|
var matches = CMIElement.match(adlNavRequestRegex);
|
|
4113
4360
|
var request = matches[1];
|
|
4114
4361
|
var target = matches[2].replace("{target=", "").replace("}", "");
|
|
@@ -4130,8 +4377,8 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4130
4377
|
this.scheduleCommit(500, "LMSCommit");
|
|
4131
4378
|
}
|
|
4132
4379
|
else {
|
|
4133
|
-
(function () { return (0,tslib_es6
|
|
4134
|
-
return (0,tslib_es6
|
|
4380
|
+
(function () { return (0,tslib_es6.__awaiter)(_this, void 0, void 0, function () {
|
|
4381
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
4135
4382
|
switch (_a.label) {
|
|
4136
4383
|
case 0: return [4, this.commit("LMSCommit", false)];
|
|
4137
4384
|
case 1:
|
|
@@ -4141,7 +4388,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4141
4388
|
});
|
|
4142
4389
|
}); })();
|
|
4143
4390
|
}
|
|
4144
|
-
return api_constants
|
|
4391
|
+
return api_constants.global_constants.SCORM_TRUE;
|
|
4145
4392
|
};
|
|
4146
4393
|
Scorm2004Impl.prototype.lmsGetLastError = function () {
|
|
4147
4394
|
return this.getLastError("GetLastError");
|
|
@@ -4153,29 +4400,58 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4153
4400
|
return this.getDiagnostic("GetDiagnostic", CMIErrorCode);
|
|
4154
4401
|
};
|
|
4155
4402
|
Scorm2004Impl.prototype.setCMIValue = function (CMIElement, value) {
|
|
4403
|
+
if ((0,utilities.stringMatches)(CMIElement, "cmi\\.objectives\\.\\d+")) {
|
|
4404
|
+
var parts = CMIElement.split(".");
|
|
4405
|
+
var index = Number(parts[2]);
|
|
4406
|
+
var element_base = "cmi.objectives.".concat(index);
|
|
4407
|
+
var objective_id_1;
|
|
4408
|
+
var setting_id = (0,utilities.stringMatches)(CMIElement, "cmi\\.objectives\\.\\d+\\.id");
|
|
4409
|
+
if (setting_id) {
|
|
4410
|
+
objective_id_1 = value;
|
|
4411
|
+
}
|
|
4412
|
+
else {
|
|
4413
|
+
var objective = this.cmi.objectives.findObjectiveByIndex(index);
|
|
4414
|
+
objective_id_1 = objective ? objective.id : undefined;
|
|
4415
|
+
}
|
|
4416
|
+
var is_global = objective_id_1 && this.settings.globalObjectiveIds.includes(objective_id_1);
|
|
4417
|
+
if (is_global) {
|
|
4418
|
+
var global_index = this._globalObjectives.findIndex(function (obj) { return obj.id === objective_id_1; });
|
|
4419
|
+
if (global_index === -1) {
|
|
4420
|
+
global_index = this._globalObjectives.length;
|
|
4421
|
+
var newGlobalObjective = new CMIObjectivesObject();
|
|
4422
|
+
newGlobalObjective.id = objective_id_1;
|
|
4423
|
+
this._globalObjectives.push(newGlobalObjective);
|
|
4424
|
+
}
|
|
4425
|
+
var global_element = CMIElement.replace(element_base, "_globalObjectives.".concat(global_index));
|
|
4426
|
+
this._commonSetCMIValue("SetGlobalObjectiveValue", true, global_element, value);
|
|
4427
|
+
}
|
|
4428
|
+
}
|
|
4156
4429
|
return this._commonSetCMIValue("SetValue", true, CMIElement, value);
|
|
4157
4430
|
};
|
|
4158
4431
|
Scorm2004Impl.prototype.getChildElement = function (CMIElement, value, foundFirstIndex) {
|
|
4159
|
-
if ((0,utilities
|
|
4432
|
+
if ((0,utilities.stringMatches)(CMIElement, "cmi\\.objectives\\.\\d+")) {
|
|
4160
4433
|
return new CMIObjectivesObject();
|
|
4161
4434
|
}
|
|
4162
4435
|
if (foundFirstIndex) {
|
|
4163
|
-
if ((0,utilities
|
|
4436
|
+
if ((0,utilities.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) {
|
|
4164
4437
|
return this.createCorrectResponsesObject(CMIElement, value);
|
|
4165
4438
|
}
|
|
4166
|
-
else if ((0,utilities
|
|
4439
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) {
|
|
4167
4440
|
return new CMIInteractionsObjectivesObject();
|
|
4168
4441
|
}
|
|
4169
4442
|
}
|
|
4170
|
-
else if ((0,utilities
|
|
4443
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+")) {
|
|
4171
4444
|
return new CMIInteractionsObject();
|
|
4172
4445
|
}
|
|
4173
|
-
if ((0,utilities
|
|
4446
|
+
if ((0,utilities.stringMatches)(CMIElement, "cmi\\.comments_from_learner\\.\\d+")) {
|
|
4174
4447
|
return new CMICommentsObject();
|
|
4175
4448
|
}
|
|
4176
|
-
else if ((0,utilities
|
|
4449
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.comments_from_lms\\.\\d+")) {
|
|
4177
4450
|
return new CMICommentsObject(true);
|
|
4178
4451
|
}
|
|
4452
|
+
if ((0,utilities.stringMatches)(CMIElement, "adl\\.data\\.\\d+")) {
|
|
4453
|
+
return new ADLDataObject();
|
|
4454
|
+
}
|
|
4179
4455
|
return null;
|
|
4180
4456
|
};
|
|
4181
4457
|
Scorm2004Impl.prototype.createCorrectResponsesObject = function (CMIElement, value) {
|
|
@@ -4184,7 +4460,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4184
4460
|
var interaction = this.cmi.interactions.childArray[index];
|
|
4185
4461
|
if (this.isInitialized()) {
|
|
4186
4462
|
if (!interaction.type) {
|
|
4187
|
-
this.throwSCORMError(error_codes
|
|
4463
|
+
this.throwSCORMError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
4188
4464
|
}
|
|
4189
4465
|
else {
|
|
4190
4466
|
this.checkDuplicateChoiceResponse(interaction, value);
|
|
@@ -4193,7 +4469,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4193
4469
|
this.checkValidResponseType(response_type, value, interaction.type);
|
|
4194
4470
|
}
|
|
4195
4471
|
else {
|
|
4196
|
-
this.throwSCORMError(error_codes
|
|
4472
|
+
this.throwSCORMError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE, "Incorrect Response Type: " + interaction.type);
|
|
4197
4473
|
}
|
|
4198
4474
|
}
|
|
4199
4475
|
}
|
|
@@ -4214,7 +4490,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4214
4490
|
this.checkCorrectResponseValue(interaction_type, nodes, value);
|
|
4215
4491
|
}
|
|
4216
4492
|
else if (nodes.length > response_type.max) {
|
|
4217
|
-
this.throwSCORMError(error_codes
|
|
4493
|
+
this.throwSCORMError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE, "Data Model Element Pattern Too Long");
|
|
4218
4494
|
}
|
|
4219
4495
|
};
|
|
4220
4496
|
Scorm2004Impl.prototype.checkDuplicateChoiceResponse = function (interaction, value) {
|
|
@@ -4223,7 +4499,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4223
4499
|
for (var i = 0; i < interaction_count && this.lastErrorCode === "0"; i++) {
|
|
4224
4500
|
var response = interaction.correct_responses.childArray[i];
|
|
4225
4501
|
if (response.pattern === value) {
|
|
4226
|
-
this.throwSCORMError(error_codes
|
|
4502
|
+
this.throwSCORMError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE);
|
|
4227
4503
|
}
|
|
4228
4504
|
}
|
|
4229
4505
|
}
|
|
@@ -4246,12 +4522,12 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4246
4522
|
}
|
|
4247
4523
|
else {
|
|
4248
4524
|
if (this.lastErrorCode === "0") {
|
|
4249
|
-
this.throwSCORMError(error_codes
|
|
4525
|
+
this.throwSCORMError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE, "Data Model Element Pattern Already Exists");
|
|
4250
4526
|
}
|
|
4251
4527
|
}
|
|
4252
4528
|
}
|
|
4253
4529
|
else {
|
|
4254
|
-
this.throwSCORMError(error_codes
|
|
4530
|
+
this.throwSCORMError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE, "Data Model Element Collection Limit Reached");
|
|
4255
4531
|
}
|
|
4256
4532
|
};
|
|
4257
4533
|
Scorm2004Impl.prototype.getCMIValue = function (CMIElement) {
|
|
@@ -4261,11 +4537,11 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4261
4537
|
var basicMessage = "";
|
|
4262
4538
|
var detailMessage = "";
|
|
4263
4539
|
errorNumber = String(errorNumber);
|
|
4264
|
-
if (api_constants
|
|
4540
|
+
if (api_constants.scorm2004_constants.error_descriptions[errorNumber]) {
|
|
4265
4541
|
basicMessage =
|
|
4266
|
-
api_constants
|
|
4542
|
+
api_constants.scorm2004_constants.error_descriptions[errorNumber].basicMessage;
|
|
4267
4543
|
detailMessage =
|
|
4268
|
-
api_constants
|
|
4544
|
+
api_constants.scorm2004_constants.error_descriptions[errorNumber].detailMessage;
|
|
4269
4545
|
}
|
|
4270
4546
|
return detail ? detailMessage : basicMessage;
|
|
4271
4547
|
};
|
|
@@ -4291,36 +4567,36 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4291
4567
|
if (values.length === 2) {
|
|
4292
4568
|
var matches = values[0].match(formatRegex);
|
|
4293
4569
|
if (!matches) {
|
|
4294
|
-
this.throwSCORMError(error_codes
|
|
4570
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4295
4571
|
}
|
|
4296
4572
|
else {
|
|
4297
4573
|
if (!response.format2 ||
|
|
4298
4574
|
!values[1].match(new RegExp(response.format2))) {
|
|
4299
|
-
this.throwSCORMError(error_codes
|
|
4575
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4300
4576
|
}
|
|
4301
4577
|
}
|
|
4302
4578
|
}
|
|
4303
4579
|
else {
|
|
4304
|
-
this.throwSCORMError(error_codes
|
|
4580
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4305
4581
|
}
|
|
4306
4582
|
}
|
|
4307
4583
|
else {
|
|
4308
4584
|
var matches = nodes[i].match(formatRegex);
|
|
4309
4585
|
if ((!matches && value !== "") ||
|
|
4310
4586
|
(!matches && interaction_type === "true-false")) {
|
|
4311
|
-
this.throwSCORMError(error_codes
|
|
4587
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4312
4588
|
}
|
|
4313
4589
|
else {
|
|
4314
4590
|
if (interaction_type === "numeric" && nodes.length > 1) {
|
|
4315
4591
|
if (Number(nodes[0]) > Number(nodes[1])) {
|
|
4316
|
-
this.throwSCORMError(error_codes
|
|
4592
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4317
4593
|
}
|
|
4318
4594
|
}
|
|
4319
4595
|
else {
|
|
4320
4596
|
if (nodes[i] !== "" && response.unique) {
|
|
4321
4597
|
for (var j = 0; j < i && this.lastErrorCode === "0"; j++) {
|
|
4322
4598
|
if (nodes[i] === nodes[j]) {
|
|
4323
|
-
this.throwSCORMError(error_codes
|
|
4599
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4324
4600
|
}
|
|
4325
4601
|
}
|
|
4326
4602
|
}
|
|
@@ -4339,12 +4615,12 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4339
4615
|
while (matches) {
|
|
4340
4616
|
switch (matches[2]) {
|
|
4341
4617
|
case "lang":
|
|
4342
|
-
langMatches = node.match(regex
|
|
4618
|
+
langMatches = node.match(regex.scorm2004_regex.CMILangcr);
|
|
4343
4619
|
if (langMatches) {
|
|
4344
4620
|
var lang = langMatches[3];
|
|
4345
4621
|
if (lang !== undefined && lang.length > 0) {
|
|
4346
4622
|
if (!language_constants.includes(lang.toLowerCase())) {
|
|
4347
|
-
this.throwSCORMError(error_codes
|
|
4623
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4348
4624
|
}
|
|
4349
4625
|
}
|
|
4350
4626
|
}
|
|
@@ -4353,7 +4629,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4353
4629
|
case "case_matters":
|
|
4354
4630
|
if (!seenLang && !seenOrder && !seenCase) {
|
|
4355
4631
|
if (matches[3] !== "true" && matches[3] !== "false") {
|
|
4356
|
-
this.throwSCORMError(error_codes
|
|
4632
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4357
4633
|
}
|
|
4358
4634
|
}
|
|
4359
4635
|
seenCase = true;
|
|
@@ -4361,7 +4637,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4361
4637
|
case "order_matters":
|
|
4362
4638
|
if (!seenCase && !seenLang && !seenOrder) {
|
|
4363
4639
|
if (matches[3] !== "true" && matches[3] !== "false") {
|
|
4364
|
-
this.throwSCORMError(error_codes
|
|
4640
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4365
4641
|
}
|
|
4366
4642
|
}
|
|
4367
4643
|
seenOrder = true;
|
|
@@ -4382,10 +4658,10 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4382
4658
|
cmiExport.cmi.total_time = this.cmi.getCurrentTotalTime();
|
|
4383
4659
|
}
|
|
4384
4660
|
var result = [];
|
|
4385
|
-
var flattened = utilities
|
|
4661
|
+
var flattened = utilities.flatten(cmiExport);
|
|
4386
4662
|
switch (this.settings.dataCommitFormat) {
|
|
4387
4663
|
case "flattened":
|
|
4388
|
-
return utilities
|
|
4664
|
+
return utilities.flatten(cmiExport);
|
|
4389
4665
|
case "params":
|
|
4390
4666
|
for (var item in flattened) {
|
|
4391
4667
|
if ({}.hasOwnProperty.call(flattened, item)) {
|
|
@@ -4401,23 +4677,23 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4401
4677
|
Scorm2004Impl.prototype.renderCommitObject = function (terminateCommit) {
|
|
4402
4678
|
var cmiExport = this.renderCommitCMI(terminateCommit);
|
|
4403
4679
|
var totalTimeDuration = this.cmi.getCurrentTotalTime();
|
|
4404
|
-
var totalTimeSeconds = utilities
|
|
4405
|
-
var completionStatus = enums
|
|
4406
|
-
var successStatus = enums
|
|
4680
|
+
var totalTimeSeconds = utilities.getDurationAsSeconds(totalTimeDuration, regex.scorm2004_regex.CMITimespan);
|
|
4681
|
+
var completionStatus = enums.CompletionStatus.unknown;
|
|
4682
|
+
var successStatus = enums.SuccessStatus.unknown;
|
|
4407
4683
|
if (this.cmi.completion_status) {
|
|
4408
4684
|
if (this.cmi.completion_status === "completed") {
|
|
4409
|
-
completionStatus = enums
|
|
4685
|
+
completionStatus = enums.CompletionStatus.completed;
|
|
4410
4686
|
}
|
|
4411
4687
|
else if (this.cmi.completion_status === "incomplete") {
|
|
4412
|
-
completionStatus = enums
|
|
4688
|
+
completionStatus = enums.CompletionStatus.incomplete;
|
|
4413
4689
|
}
|
|
4414
4690
|
}
|
|
4415
4691
|
if (this.cmi.success_status) {
|
|
4416
4692
|
if (this.cmi.success_status === "passed") {
|
|
4417
|
-
successStatus = enums
|
|
4693
|
+
successStatus = enums.SuccessStatus.passed;
|
|
4418
4694
|
}
|
|
4419
4695
|
else if (this.cmi.success_status === "failed") {
|
|
4420
|
-
successStatus = enums
|
|
4696
|
+
successStatus = enums.SuccessStatus.failed;
|
|
4421
4697
|
}
|
|
4422
4698
|
}
|
|
4423
4699
|
var score = this.cmi.score;
|
|
@@ -4449,10 +4725,10 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4449
4725
|
return commitObject;
|
|
4450
4726
|
};
|
|
4451
4727
|
Scorm2004Impl.prototype.storeData = function (terminateCommit) {
|
|
4452
|
-
return (0,tslib_es6
|
|
4728
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
4453
4729
|
var navRequest, commitObject, result;
|
|
4454
4730
|
var _a, _b, _c;
|
|
4455
|
-
return (0,tslib_es6
|
|
4731
|
+
return (0,tslib_es6.__generator)(this, function (_d) {
|
|
4456
4732
|
switch (_d.label) {
|
|
4457
4733
|
case 0:
|
|
4458
4734
|
if (terminateCommit) {
|
|
@@ -4496,7 +4772,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4496
4772
|
}
|
|
4497
4773
|
return [2, result];
|
|
4498
4774
|
case 2: return [2, {
|
|
4499
|
-
result: api_constants
|
|
4775
|
+
result: api_constants.global_constants.SCORM_TRUE,
|
|
4500
4776
|
errorCode: 0,
|
|
4501
4777
|
}];
|
|
4502
4778
|
}
|
|
@@ -4504,7 +4780,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4504
4780
|
});
|
|
4505
4781
|
};
|
|
4506
4782
|
return Scorm2004Impl;
|
|
4507
|
-
}(BaseAPI
|
|
4783
|
+
}(BaseAPI["default"]));
|
|
4508
4784
|
|
|
4509
4785
|
|
|
4510
4786
|
|
|
@@ -4513,29 +4789,40 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4513
4789
|
/***/ 589:
|
|
4514
4790
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
4515
4791
|
|
|
4792
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4516
4793
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4517
|
-
/* harmony export */
|
|
4794
|
+
/* harmony export */ CMIArray: function() { return /* binding */ CMIArray; }
|
|
4518
4795
|
/* harmony export */ });
|
|
4519
|
-
/* unused harmony export scorm12_error_codes */
|
|
4520
4796
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635);
|
|
4521
4797
|
/* harmony import */ var _base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
4522
|
-
/* harmony import */ var
|
|
4523
|
-
/* harmony import */ var
|
|
4798
|
+
/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(784);
|
|
4799
|
+
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(797);
|
|
4524
4800
|
|
|
4525
4801
|
|
|
4526
4802
|
|
|
4527
4803
|
|
|
4528
|
-
var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12;
|
|
4529
4804
|
var CMIArray = (function (_super) {
|
|
4530
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_3__
|
|
4805
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_3__.__extends)(CMIArray, _super);
|
|
4531
4806
|
function CMIArray(params) {
|
|
4532
4807
|
var _this = _super.call(this) || this;
|
|
4533
4808
|
_this.__children = params.children;
|
|
4534
|
-
_this._errorCode = params.errorCode ||
|
|
4535
|
-
_this._errorClass = params.errorClass ||
|
|
4809
|
+
_this._errorCode = params.errorCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.GENERAL;
|
|
4810
|
+
_this._errorClass = params.errorClass || _exceptions__WEBPACK_IMPORTED_MODULE_1__.BaseScormValidationError;
|
|
4536
4811
|
_this.childArray = [];
|
|
4537
4812
|
return _this;
|
|
4538
4813
|
}
|
|
4814
|
+
CMIArray.prototype.reset = function (wipe) {
|
|
4815
|
+
if (wipe === void 0) { wipe = false; }
|
|
4816
|
+
this._initialized = false;
|
|
4817
|
+
if (wipe) {
|
|
4818
|
+
this.childArray = [];
|
|
4819
|
+
}
|
|
4820
|
+
else {
|
|
4821
|
+
for (var i = 0; i < this.childArray.length; i++) {
|
|
4822
|
+
this.childArray[i].reset();
|
|
4823
|
+
}
|
|
4824
|
+
}
|
|
4825
|
+
};
|
|
4539
4826
|
Object.defineProperty(CMIArray.prototype, "_children", {
|
|
4540
4827
|
get: function () {
|
|
4541
4828
|
return this.__children;
|
|
@@ -4566,7 +4853,7 @@ var CMIArray = (function (_super) {
|
|
|
4566
4853
|
return result;
|
|
4567
4854
|
};
|
|
4568
4855
|
return CMIArray;
|
|
4569
|
-
}(_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
4856
|
+
}(_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
4570
4857
|
|
|
4571
4858
|
|
|
4572
4859
|
|
|
@@ -4575,9 +4862,10 @@ var CMIArray = (function (_super) {
|
|
|
4575
4862
|
/***/ 319:
|
|
4576
4863
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
4577
4864
|
|
|
4865
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4578
4866
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4579
|
-
/* harmony export */
|
|
4580
|
-
/* harmony export */
|
|
4867
|
+
/* harmony export */ BaseCMI: function() { return /* binding */ BaseCMI; },
|
|
4868
|
+
/* harmony export */ BaseRootCMI: function() { return /* binding */ BaseRootCMI; }
|
|
4581
4869
|
/* harmony export */ });
|
|
4582
4870
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
4583
4871
|
|
|
@@ -4610,7 +4898,7 @@ var BaseCMI = (function () {
|
|
|
4610
4898
|
}());
|
|
4611
4899
|
|
|
4612
4900
|
var BaseRootCMI = (function (_super) {
|
|
4613
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_0__
|
|
4901
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(BaseRootCMI, _super);
|
|
4614
4902
|
function BaseRootCMI() {
|
|
4615
4903
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
4616
4904
|
}
|
|
@@ -4624,10 +4912,10 @@ var BaseRootCMI = (function (_super) {
|
|
|
4624
4912
|
/***/ 434:
|
|
4625
4913
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
4626
4914
|
|
|
4915
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4627
4916
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4628
|
-
/* harmony export */
|
|
4917
|
+
/* harmony export */ CMIScore: function() { return /* binding */ CMIScore; }
|
|
4629
4918
|
/* harmony export */ });
|
|
4630
|
-
/* unused harmony export scorm12_error_codes */
|
|
4631
4919
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635);
|
|
4632
4920
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340);
|
|
4633
4921
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(417);
|
|
@@ -4640,30 +4928,30 @@ var BaseRootCMI = (function (_super) {
|
|
|
4640
4928
|
|
|
4641
4929
|
|
|
4642
4930
|
|
|
4643
|
-
var scorm12_constants = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12;
|
|
4644
|
-
var scorm12_regex = _constants_regex__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12;
|
|
4645
|
-
var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12;
|
|
4646
4931
|
var CMIScore = (function (_super) {
|
|
4647
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_4__
|
|
4932
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_4__.__extends)(CMIScore, _super);
|
|
4648
4933
|
function CMIScore(params) {
|
|
4649
4934
|
var _this = _super.call(this) || this;
|
|
4650
4935
|
_this._raw = "";
|
|
4651
4936
|
_this._min = "";
|
|
4652
|
-
_this.__children = params.score_children || scorm12_constants.score_children;
|
|
4937
|
+
_this.__children = params.score_children || _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__.scorm12_constants.score_children;
|
|
4653
4938
|
_this.__score_range = !params.score_range
|
|
4654
4939
|
? false
|
|
4655
|
-
: scorm12_regex.score_range;
|
|
4940
|
+
: _constants_regex__WEBPACK_IMPORTED_MODULE_1__.scorm12_regex.score_range;
|
|
4656
4941
|
_this._max = params.max || params.max === "" ? params.max : "100";
|
|
4657
4942
|
_this.__invalid_error_code =
|
|
4658
|
-
params.invalidErrorCode ||
|
|
4943
|
+
params.invalidErrorCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.INVALID_SET_VALUE;
|
|
4659
4944
|
_this.__invalid_type_code =
|
|
4660
|
-
params.invalidTypeCode ||
|
|
4945
|
+
params.invalidTypeCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.TYPE_MISMATCH;
|
|
4661
4946
|
_this.__invalid_range_code =
|
|
4662
|
-
params.invalidRangeCode ||
|
|
4663
|
-
_this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;
|
|
4947
|
+
params.invalidRangeCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.VALUE_OUT_OF_RANGE;
|
|
4948
|
+
_this.__decimal_regex = params.decimalRegex || _constants_regex__WEBPACK_IMPORTED_MODULE_1__.scorm12_regex.CMIDecimal;
|
|
4664
4949
|
_this.__error_class = params.errorClass;
|
|
4665
4950
|
return _this;
|
|
4666
4951
|
}
|
|
4952
|
+
CMIScore.prototype.reset = function () {
|
|
4953
|
+
this._initialized = false;
|
|
4954
|
+
};
|
|
4667
4955
|
Object.defineProperty(CMIScore.prototype, "_children", {
|
|
4668
4956
|
get: function () {
|
|
4669
4957
|
return this.__children;
|
|
@@ -4679,9 +4967,9 @@ var CMIScore = (function (_super) {
|
|
|
4679
4967
|
return this._raw;
|
|
4680
4968
|
},
|
|
4681
4969
|
set: function (raw) {
|
|
4682
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
4970
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidFormat)(raw, this.__decimal_regex, this.__invalid_type_code, this.__error_class) &&
|
|
4683
4971
|
(!this.__score_range ||
|
|
4684
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
4972
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidRange)(raw, this.__score_range, this.__invalid_range_code, this.__error_class))) {
|
|
4685
4973
|
this._raw = raw;
|
|
4686
4974
|
}
|
|
4687
4975
|
},
|
|
@@ -4693,9 +4981,9 @@ var CMIScore = (function (_super) {
|
|
|
4693
4981
|
return this._min;
|
|
4694
4982
|
},
|
|
4695
4983
|
set: function (min) {
|
|
4696
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
4984
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidFormat)(min, this.__decimal_regex, this.__invalid_type_code, this.__error_class) &&
|
|
4697
4985
|
(!this.__score_range ||
|
|
4698
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
4986
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidRange)(min, this.__score_range, this.__invalid_range_code, this.__error_class))) {
|
|
4699
4987
|
this._min = min;
|
|
4700
4988
|
}
|
|
4701
4989
|
},
|
|
@@ -4707,9 +4995,9 @@ var CMIScore = (function (_super) {
|
|
|
4707
4995
|
return this._max;
|
|
4708
4996
|
},
|
|
4709
4997
|
set: function (max) {
|
|
4710
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
4998
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidFormat)(max, this.__decimal_regex, this.__invalid_type_code, this.__error_class) &&
|
|
4711
4999
|
(!this.__score_range ||
|
|
4712
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5000
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidRange)(max, this.__score_range, this.__invalid_range_code, this.__error_class))) {
|
|
4713
5001
|
this._max = max;
|
|
4714
5002
|
}
|
|
4715
5003
|
},
|
|
@@ -4727,7 +5015,7 @@ var CMIScore = (function (_super) {
|
|
|
4727
5015
|
return result;
|
|
4728
5016
|
};
|
|
4729
5017
|
return CMIScore;
|
|
4730
|
-
}(_base_cmi__WEBPACK_IMPORTED_MODULE_2__
|
|
5018
|
+
}(_base_cmi__WEBPACK_IMPORTED_MODULE_2__.BaseCMI));
|
|
4731
5019
|
|
|
4732
5020
|
|
|
4733
5021
|
|
|
@@ -4736,9 +5024,10 @@ var CMIScore = (function (_super) {
|
|
|
4736
5024
|
/***/ 449:
|
|
4737
5025
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
4738
5026
|
|
|
5027
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4739
5028
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4740
|
-
/* harmony export */
|
|
4741
|
-
/* harmony export */
|
|
5029
|
+
/* harmony export */ checkValidFormat: function() { return /* binding */ checkValidFormat; },
|
|
5030
|
+
/* harmony export */ checkValidRange: function() { return /* binding */ checkValidRange; }
|
|
4742
5031
|
/* harmony export */ });
|
|
4743
5032
|
function checkValidFormat(value, regexPattern, errorCode, errorClass, allowEmptyString) {
|
|
4744
5033
|
if (typeof value !== "string") {
|
|
@@ -4776,10 +5065,12 @@ function checkValidRange(value, rangePattern, errorCode, errorClass) {
|
|
|
4776
5065
|
/***/ 989:
|
|
4777
5066
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
4778
5067
|
|
|
5068
|
+
// ESM COMPAT FLAG
|
|
5069
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4779
5070
|
|
|
4780
5071
|
// EXPORTS
|
|
4781
5072
|
__webpack_require__.d(__webpack_exports__, {
|
|
4782
|
-
|
|
5073
|
+
CMI: function() { return /* binding */ CMI; }
|
|
4783
5074
|
});
|
|
4784
5075
|
|
|
4785
5076
|
// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs
|
|
@@ -4790,8 +5081,8 @@ var api_constants = __webpack_require__(340);
|
|
|
4790
5081
|
var error_codes = __webpack_require__(797);
|
|
4791
5082
|
// EXTERNAL MODULE: ./src/constants/regex.ts
|
|
4792
5083
|
var regex = __webpack_require__(417);
|
|
4793
|
-
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
4794
|
-
var
|
|
5084
|
+
// EXTERNAL MODULE: ./src/exceptions/scorm12_exceptions.ts
|
|
5085
|
+
var scorm12_exceptions = __webpack_require__(179);
|
|
4795
5086
|
// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts
|
|
4796
5087
|
var base_cmi = __webpack_require__(319);
|
|
4797
5088
|
// EXTERNAL MODULE: ./src/cmi/scorm12/validation.ts
|
|
@@ -4811,10 +5102,10 @@ var utilities = __webpack_require__(864);
|
|
|
4811
5102
|
|
|
4812
5103
|
|
|
4813
5104
|
var CMICore = (function (_super) {
|
|
4814
|
-
(0,tslib_es6
|
|
5105
|
+
(0,tslib_es6.__extends)(CMICore, _super);
|
|
4815
5106
|
function CMICore() {
|
|
4816
5107
|
var _this = _super.call(this) || this;
|
|
4817
|
-
_this.__children = api_constants
|
|
5108
|
+
_this.__children = api_constants.scorm12_constants.core_children;
|
|
4818
5109
|
_this._student_id = "";
|
|
4819
5110
|
_this._student_name = "";
|
|
4820
5111
|
_this._lesson_location = "";
|
|
@@ -4826,13 +5117,13 @@ var CMICore = (function (_super) {
|
|
|
4826
5117
|
_this._exit = "";
|
|
4827
5118
|
_this._session_time = "00:00:00";
|
|
4828
5119
|
_this._suspend_data = "";
|
|
4829
|
-
_this.score = new score
|
|
4830
|
-
score_children: api_constants
|
|
4831
|
-
score_range: regex
|
|
4832
|
-
invalidErrorCode: error_codes
|
|
4833
|
-
invalidTypeCode: error_codes
|
|
4834
|
-
invalidRangeCode: error_codes
|
|
4835
|
-
errorClass:
|
|
5120
|
+
_this.score = new score.CMIScore({
|
|
5121
|
+
score_children: api_constants.scorm12_constants.score_children,
|
|
5122
|
+
score_range: regex.scorm12_regex.score_range,
|
|
5123
|
+
invalidErrorCode: error_codes.scorm12_errors.INVALID_SET_VALUE,
|
|
5124
|
+
invalidTypeCode: error_codes.scorm12_errors.TYPE_MISMATCH,
|
|
5125
|
+
invalidRangeCode: error_codes.scorm12_errors.VALUE_OUT_OF_RANGE,
|
|
5126
|
+
errorClass: scorm12_exceptions.Scorm12ValidationError,
|
|
4836
5127
|
});
|
|
4837
5128
|
return _this;
|
|
4838
5129
|
}
|
|
@@ -4841,12 +5132,20 @@ var CMICore = (function (_super) {
|
|
|
4841
5132
|
_super.prototype.initialize.call(this);
|
|
4842
5133
|
(_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
4843
5134
|
};
|
|
5135
|
+
CMICore.prototype.reset = function () {
|
|
5136
|
+
var _a;
|
|
5137
|
+
this._initialized = false;
|
|
5138
|
+
this._exit = "";
|
|
5139
|
+
this._entry = "";
|
|
5140
|
+
this._session_time = "00:00:00";
|
|
5141
|
+
(_a = this.score) === null || _a === void 0 ? void 0 : _a.reset();
|
|
5142
|
+
};
|
|
4844
5143
|
Object.defineProperty(CMICore.prototype, "_children", {
|
|
4845
5144
|
get: function () {
|
|
4846
5145
|
return this.__children;
|
|
4847
5146
|
},
|
|
4848
5147
|
set: function (_children) {
|
|
4849
|
-
throw new
|
|
5148
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
4850
5149
|
},
|
|
4851
5150
|
enumerable: false,
|
|
4852
5151
|
configurable: true
|
|
@@ -4857,7 +5156,7 @@ var CMICore = (function (_super) {
|
|
|
4857
5156
|
},
|
|
4858
5157
|
set: function (student_id) {
|
|
4859
5158
|
if (this.initialized) {
|
|
4860
|
-
throw new
|
|
5159
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4861
5160
|
}
|
|
4862
5161
|
else {
|
|
4863
5162
|
this._student_id = student_id;
|
|
@@ -4872,7 +5171,7 @@ var CMICore = (function (_super) {
|
|
|
4872
5171
|
},
|
|
4873
5172
|
set: function (student_name) {
|
|
4874
5173
|
if (this.initialized) {
|
|
4875
|
-
throw new
|
|
5174
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4876
5175
|
}
|
|
4877
5176
|
else {
|
|
4878
5177
|
this._student_name = student_name;
|
|
@@ -4886,7 +5185,7 @@ var CMICore = (function (_super) {
|
|
|
4886
5185
|
return this._lesson_location;
|
|
4887
5186
|
},
|
|
4888
5187
|
set: function (lesson_location) {
|
|
4889
|
-
if ((0,validation
|
|
5188
|
+
if ((0,validation.check12ValidFormat)(lesson_location, regex.scorm12_regex.CMIString256, true)) {
|
|
4890
5189
|
this._lesson_location = lesson_location;
|
|
4891
5190
|
}
|
|
4892
5191
|
},
|
|
@@ -4899,7 +5198,7 @@ var CMICore = (function (_super) {
|
|
|
4899
5198
|
},
|
|
4900
5199
|
set: function (credit) {
|
|
4901
5200
|
if (this.initialized) {
|
|
4902
|
-
throw new
|
|
5201
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4903
5202
|
}
|
|
4904
5203
|
else {
|
|
4905
5204
|
this._credit = credit;
|
|
@@ -4914,12 +5213,12 @@ var CMICore = (function (_super) {
|
|
|
4914
5213
|
},
|
|
4915
5214
|
set: function (lesson_status) {
|
|
4916
5215
|
if (this.initialized) {
|
|
4917
|
-
if ((0,validation
|
|
5216
|
+
if ((0,validation.check12ValidFormat)(lesson_status, regex.scorm12_regex.CMIStatus)) {
|
|
4918
5217
|
this._lesson_status = lesson_status;
|
|
4919
5218
|
}
|
|
4920
5219
|
}
|
|
4921
5220
|
else {
|
|
4922
|
-
if ((0,validation
|
|
5221
|
+
if ((0,validation.check12ValidFormat)(lesson_status, regex.scorm12_regex.CMIStatus2)) {
|
|
4923
5222
|
this._lesson_status = lesson_status;
|
|
4924
5223
|
}
|
|
4925
5224
|
}
|
|
@@ -4933,7 +5232,7 @@ var CMICore = (function (_super) {
|
|
|
4933
5232
|
},
|
|
4934
5233
|
set: function (entry) {
|
|
4935
5234
|
if (this.initialized) {
|
|
4936
|
-
throw new
|
|
5235
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4937
5236
|
}
|
|
4938
5237
|
else {
|
|
4939
5238
|
this._entry = entry;
|
|
@@ -4948,7 +5247,7 @@ var CMICore = (function (_super) {
|
|
|
4948
5247
|
},
|
|
4949
5248
|
set: function (total_time) {
|
|
4950
5249
|
if (this.initialized) {
|
|
4951
|
-
throw new
|
|
5250
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4952
5251
|
}
|
|
4953
5252
|
else {
|
|
4954
5253
|
this._total_time = total_time;
|
|
@@ -4963,7 +5262,7 @@ var CMICore = (function (_super) {
|
|
|
4963
5262
|
},
|
|
4964
5263
|
set: function (lesson_mode) {
|
|
4965
5264
|
if (this.initialized) {
|
|
4966
|
-
throw new
|
|
5265
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4967
5266
|
}
|
|
4968
5267
|
else {
|
|
4969
5268
|
this._lesson_mode = lesson_mode;
|
|
@@ -4975,12 +5274,12 @@ var CMICore = (function (_super) {
|
|
|
4975
5274
|
Object.defineProperty(CMICore.prototype, "exit", {
|
|
4976
5275
|
get: function () {
|
|
4977
5276
|
if (!this.jsonString) {
|
|
4978
|
-
throw new
|
|
5277
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
4979
5278
|
}
|
|
4980
5279
|
return this._exit;
|
|
4981
5280
|
},
|
|
4982
5281
|
set: function (exit) {
|
|
4983
|
-
if ((0,validation
|
|
5282
|
+
if ((0,validation.check12ValidFormat)(exit, regex.scorm12_regex.CMIExit, true)) {
|
|
4984
5283
|
this._exit = exit;
|
|
4985
5284
|
}
|
|
4986
5285
|
},
|
|
@@ -4990,12 +5289,12 @@ var CMICore = (function (_super) {
|
|
|
4990
5289
|
Object.defineProperty(CMICore.prototype, "session_time", {
|
|
4991
5290
|
get: function () {
|
|
4992
5291
|
if (!this.jsonString) {
|
|
4993
|
-
throw new
|
|
5292
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
4994
5293
|
}
|
|
4995
5294
|
return this._session_time;
|
|
4996
5295
|
},
|
|
4997
5296
|
set: function (session_time) {
|
|
4998
|
-
if ((0,validation
|
|
5297
|
+
if ((0,validation.check12ValidFormat)(session_time, regex.scorm12_regex.CMITimespan)) {
|
|
4999
5298
|
this._session_time = session_time;
|
|
5000
5299
|
}
|
|
5001
5300
|
},
|
|
@@ -5007,7 +5306,7 @@ var CMICore = (function (_super) {
|
|
|
5007
5306
|
return this._suspend_data;
|
|
5008
5307
|
},
|
|
5009
5308
|
set: function (suspend_data) {
|
|
5010
|
-
if ((0,validation
|
|
5309
|
+
if ((0,validation.check12ValidFormat)(suspend_data, regex.scorm12_regex.CMIString4096, true)) {
|
|
5011
5310
|
this._suspend_data = suspend_data;
|
|
5012
5311
|
}
|
|
5013
5312
|
},
|
|
@@ -5019,9 +5318,9 @@ var CMICore = (function (_super) {
|
|
|
5019
5318
|
var startTime = start_time;
|
|
5020
5319
|
if (typeof startTime !== "undefined" && startTime !== null) {
|
|
5021
5320
|
var seconds = new Date().getTime() - startTime;
|
|
5022
|
-
sessionTime = utilities
|
|
5321
|
+
sessionTime = utilities.getSecondsAsHHMMSS(seconds / 1000);
|
|
5023
5322
|
}
|
|
5024
|
-
return utilities
|
|
5323
|
+
return utilities.addHHMMSSTimeStrings(this._total_time, sessionTime, new RegExp(regex.scorm12_regex.CMITimespan));
|
|
5025
5324
|
};
|
|
5026
5325
|
CMICore.prototype.toJSON = function () {
|
|
5027
5326
|
this.jsonString = true;
|
|
@@ -5041,7 +5340,7 @@ var CMICore = (function (_super) {
|
|
|
5041
5340
|
return result;
|
|
5042
5341
|
};
|
|
5043
5342
|
return CMICore;
|
|
5044
|
-
}(base_cmi
|
|
5343
|
+
}(base_cmi.BaseCMI));
|
|
5045
5344
|
|
|
5046
5345
|
|
|
5047
5346
|
// EXTERNAL MODULE: ./src/cmi/scorm12/objectives.ts
|
|
@@ -5066,7 +5365,7 @@ var interactions = __webpack_require__(833);
|
|
|
5066
5365
|
|
|
5067
5366
|
|
|
5068
5367
|
var CMI = (function (_super) {
|
|
5069
|
-
(0,tslib_es6
|
|
5368
|
+
(0,tslib_es6.__extends)(CMI, _super);
|
|
5070
5369
|
function CMI(cmi_children, student_data, initialized) {
|
|
5071
5370
|
var _this = _super.call(this) || this;
|
|
5072
5371
|
_this.__children = "";
|
|
@@ -5078,14 +5377,25 @@ var CMI = (function (_super) {
|
|
|
5078
5377
|
_this.initialize();
|
|
5079
5378
|
_this.__children = cmi_children
|
|
5080
5379
|
? cmi_children
|
|
5081
|
-
: api_constants
|
|
5380
|
+
: api_constants.scorm12_constants.cmi_children;
|
|
5082
5381
|
_this.core = new CMICore();
|
|
5083
|
-
_this.objectives = new objectives
|
|
5084
|
-
_this.student_data = student_data ? student_data : new scorm12_student_data
|
|
5085
|
-
_this.student_preference = new student_preference
|
|
5086
|
-
_this.interactions = new interactions
|
|
5382
|
+
_this.objectives = new objectives.CMIObjectives();
|
|
5383
|
+
_this.student_data = student_data ? student_data : new scorm12_student_data.CMIStudentData();
|
|
5384
|
+
_this.student_preference = new student_preference.CMIStudentPreference();
|
|
5385
|
+
_this.interactions = new interactions.CMIInteractions();
|
|
5087
5386
|
return _this;
|
|
5088
5387
|
}
|
|
5388
|
+
CMI.prototype.reset = function () {
|
|
5389
|
+
var _a, _b, _c;
|
|
5390
|
+
this._initialized = false;
|
|
5391
|
+
this._launch_data = "";
|
|
5392
|
+
this._comments = "";
|
|
5393
|
+
(_a = this.core) === null || _a === void 0 ? void 0 : _a.reset();
|
|
5394
|
+
this.objectives = new objectives.CMIObjectives();
|
|
5395
|
+
this.interactions = new interactions.CMIInteractions();
|
|
5396
|
+
(_b = this.student_data) === null || _b === void 0 ? void 0 : _b.reset();
|
|
5397
|
+
(_c = this.student_preference) === null || _c === void 0 ? void 0 : _c.reset();
|
|
5398
|
+
};
|
|
5089
5399
|
CMI.prototype.initialize = function () {
|
|
5090
5400
|
var _a, _b, _c, _d, _e;
|
|
5091
5401
|
_super.prototype.initialize.call(this);
|
|
@@ -5116,7 +5426,7 @@ var CMI = (function (_super) {
|
|
|
5116
5426
|
return this.__version;
|
|
5117
5427
|
},
|
|
5118
5428
|
set: function (_version) {
|
|
5119
|
-
throw new
|
|
5429
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
5120
5430
|
},
|
|
5121
5431
|
enumerable: false,
|
|
5122
5432
|
configurable: true
|
|
@@ -5126,7 +5436,7 @@ var CMI = (function (_super) {
|
|
|
5126
5436
|
return this.__children;
|
|
5127
5437
|
},
|
|
5128
5438
|
set: function (_children) {
|
|
5129
|
-
throw new
|
|
5439
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
5130
5440
|
},
|
|
5131
5441
|
enumerable: false,
|
|
5132
5442
|
configurable: true
|
|
@@ -5150,7 +5460,7 @@ var CMI = (function (_super) {
|
|
|
5150
5460
|
},
|
|
5151
5461
|
set: function (launch_data) {
|
|
5152
5462
|
if (this.initialized) {
|
|
5153
|
-
throw new
|
|
5463
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
5154
5464
|
}
|
|
5155
5465
|
else {
|
|
5156
5466
|
this._launch_data = launch_data;
|
|
@@ -5164,7 +5474,7 @@ var CMI = (function (_super) {
|
|
|
5164
5474
|
return this._comments;
|
|
5165
5475
|
},
|
|
5166
5476
|
set: function (comments) {
|
|
5167
|
-
if ((0,validation
|
|
5477
|
+
if ((0,validation.check12ValidFormat)(comments, regex.scorm12_regex.CMIString4096, true)) {
|
|
5168
5478
|
this._comments = comments;
|
|
5169
5479
|
}
|
|
5170
5480
|
},
|
|
@@ -5177,7 +5487,7 @@ var CMI = (function (_super) {
|
|
|
5177
5487
|
},
|
|
5178
5488
|
set: function (comments_from_lms) {
|
|
5179
5489
|
if (this.initialized) {
|
|
5180
|
-
throw new
|
|
5490
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
5181
5491
|
}
|
|
5182
5492
|
else {
|
|
5183
5493
|
this._comments_from_lms = comments_from_lms;
|
|
@@ -5190,7 +5500,7 @@ var CMI = (function (_super) {
|
|
|
5190
5500
|
return this.core.getCurrentTotalTime(this.start_time);
|
|
5191
5501
|
};
|
|
5192
5502
|
return CMI;
|
|
5193
|
-
}(base_cmi
|
|
5503
|
+
}(base_cmi.BaseRootCMI));
|
|
5194
5504
|
|
|
5195
5505
|
|
|
5196
5506
|
|
|
@@ -5199,17 +5509,18 @@ var CMI = (function (_super) {
|
|
|
5199
5509
|
/***/ 833:
|
|
5200
5510
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5201
5511
|
|
|
5512
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5202
5513
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5203
|
-
/* harmony export */
|
|
5204
|
-
/* harmony export */
|
|
5205
|
-
/* harmony export */
|
|
5206
|
-
/* harmony export */
|
|
5514
|
+
/* harmony export */ CMIInteractions: function() { return /* binding */ CMIInteractions; },
|
|
5515
|
+
/* harmony export */ CMIInteractionsCorrectResponsesObject: function() { return /* binding */ CMIInteractionsCorrectResponsesObject; },
|
|
5516
|
+
/* harmony export */ CMIInteractionsObject: function() { return /* binding */ CMIInteractionsObject; },
|
|
5517
|
+
/* harmony export */ CMIInteractionsObjectivesObject: function() { return /* binding */ CMIInteractionsObjectivesObject; }
|
|
5207
5518
|
/* harmony export */ });
|
|
5208
5519
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(635);
|
|
5209
5520
|
/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(589);
|
|
5210
5521
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
5211
5522
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(797);
|
|
5212
|
-
/* harmony import */ var
|
|
5523
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(179);
|
|
5213
5524
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(319);
|
|
5214
5525
|
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(915);
|
|
5215
5526
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(417);
|
|
@@ -5222,19 +5533,19 @@ var CMI = (function (_super) {
|
|
|
5222
5533
|
|
|
5223
5534
|
|
|
5224
5535
|
var CMIInteractions = (function (_super) {
|
|
5225
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
5536
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractions, _super);
|
|
5226
5537
|
function CMIInteractions() {
|
|
5227
5538
|
return _super.call(this, {
|
|
5228
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
5229
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__
|
|
5230
|
-
errorClass:
|
|
5539
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.interactions_children,
|
|
5540
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.INVALID_SET_VALUE,
|
|
5541
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError,
|
|
5231
5542
|
}) || this;
|
|
5232
5543
|
}
|
|
5233
5544
|
return CMIInteractions;
|
|
5234
|
-
}(_common_array__WEBPACK_IMPORTED_MODULE_0__
|
|
5545
|
+
}(_common_array__WEBPACK_IMPORTED_MODULE_0__.CMIArray));
|
|
5235
5546
|
|
|
5236
5547
|
var CMIInteractionsObject = (function (_super) {
|
|
5237
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
5548
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsObject, _super);
|
|
5238
5549
|
function CMIInteractionsObject() {
|
|
5239
5550
|
var _this = _super.call(this) || this;
|
|
5240
5551
|
_this._id = "";
|
|
@@ -5244,15 +5555,15 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5244
5555
|
_this._student_response = "";
|
|
5245
5556
|
_this._result = "";
|
|
5246
5557
|
_this._latency = "";
|
|
5247
|
-
_this.objectives = new _common_array__WEBPACK_IMPORTED_MODULE_0__
|
|
5248
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__
|
|
5249
|
-
errorClass:
|
|
5250
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
5558
|
+
_this.objectives = new _common_array__WEBPACK_IMPORTED_MODULE_0__.CMIArray({
|
|
5559
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.INVALID_SET_VALUE,
|
|
5560
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError,
|
|
5561
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.objectives_children,
|
|
5251
5562
|
});
|
|
5252
|
-
_this.correct_responses = new _common_array__WEBPACK_IMPORTED_MODULE_0__
|
|
5253
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__
|
|
5254
|
-
errorClass:
|
|
5255
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
5563
|
+
_this.correct_responses = new _common_array__WEBPACK_IMPORTED_MODULE_0__.CMIArray({
|
|
5564
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.INVALID_SET_VALUE,
|
|
5565
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError,
|
|
5566
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.correct_responses_children,
|
|
5256
5567
|
});
|
|
5257
5568
|
return _this;
|
|
5258
5569
|
}
|
|
@@ -5262,15 +5573,28 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5262
5573
|
(_a = this.objectives) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
5263
5574
|
(_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.initialize();
|
|
5264
5575
|
};
|
|
5576
|
+
CMIInteractionsObject.prototype.reset = function () {
|
|
5577
|
+
var _a, _b;
|
|
5578
|
+
this._initialized = false;
|
|
5579
|
+
this._id = "";
|
|
5580
|
+
this._time = "";
|
|
5581
|
+
this._type = "";
|
|
5582
|
+
this._weighting = "";
|
|
5583
|
+
this._student_response = "";
|
|
5584
|
+
this._result = "";
|
|
5585
|
+
this._latency = "";
|
|
5586
|
+
(_a = this.objectives) === null || _a === void 0 ? void 0 : _a.reset();
|
|
5587
|
+
(_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.reset();
|
|
5588
|
+
};
|
|
5265
5589
|
Object.defineProperty(CMIInteractionsObject.prototype, "id", {
|
|
5266
5590
|
get: function () {
|
|
5267
5591
|
if (!this.jsonString) {
|
|
5268
|
-
throw new
|
|
5592
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
5269
5593
|
}
|
|
5270
5594
|
return this._id;
|
|
5271
5595
|
},
|
|
5272
5596
|
set: function (id) {
|
|
5273
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5597
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIIdentifier)) {
|
|
5274
5598
|
this._id = id;
|
|
5275
5599
|
}
|
|
5276
5600
|
},
|
|
@@ -5280,12 +5604,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5280
5604
|
Object.defineProperty(CMIInteractionsObject.prototype, "time", {
|
|
5281
5605
|
get: function () {
|
|
5282
5606
|
if (!this.jsonString) {
|
|
5283
|
-
throw new
|
|
5607
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
5284
5608
|
}
|
|
5285
5609
|
return this._time;
|
|
5286
5610
|
},
|
|
5287
5611
|
set: function (time) {
|
|
5288
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5612
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(time, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMITime)) {
|
|
5289
5613
|
this._time = time;
|
|
5290
5614
|
}
|
|
5291
5615
|
},
|
|
@@ -5295,12 +5619,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5295
5619
|
Object.defineProperty(CMIInteractionsObject.prototype, "type", {
|
|
5296
5620
|
get: function () {
|
|
5297
5621
|
if (!this.jsonString) {
|
|
5298
|
-
throw new
|
|
5622
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
5299
5623
|
}
|
|
5300
5624
|
return this._type;
|
|
5301
5625
|
},
|
|
5302
5626
|
set: function (type) {
|
|
5303
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5627
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(type, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIType)) {
|
|
5304
5628
|
this._type = type;
|
|
5305
5629
|
}
|
|
5306
5630
|
},
|
|
@@ -5310,13 +5634,13 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5310
5634
|
Object.defineProperty(CMIInteractionsObject.prototype, "weighting", {
|
|
5311
5635
|
get: function () {
|
|
5312
5636
|
if (!this.jsonString) {
|
|
5313
|
-
throw new
|
|
5637
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
5314
5638
|
}
|
|
5315
5639
|
return this._weighting;
|
|
5316
5640
|
},
|
|
5317
5641
|
set: function (weighting) {
|
|
5318
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5319
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5642
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIDecimal) &&
|
|
5643
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidRange)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.weighting_range)) {
|
|
5320
5644
|
this._weighting = weighting;
|
|
5321
5645
|
}
|
|
5322
5646
|
},
|
|
@@ -5326,12 +5650,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5326
5650
|
Object.defineProperty(CMIInteractionsObject.prototype, "student_response", {
|
|
5327
5651
|
get: function () {
|
|
5328
5652
|
if (!this.jsonString) {
|
|
5329
|
-
throw new
|
|
5653
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
5330
5654
|
}
|
|
5331
5655
|
return this._student_response;
|
|
5332
5656
|
},
|
|
5333
5657
|
set: function (student_response) {
|
|
5334
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5658
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(student_response, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIFeedback, true)) {
|
|
5335
5659
|
this._student_response = student_response;
|
|
5336
5660
|
}
|
|
5337
5661
|
},
|
|
@@ -5341,12 +5665,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5341
5665
|
Object.defineProperty(CMIInteractionsObject.prototype, "result", {
|
|
5342
5666
|
get: function () {
|
|
5343
5667
|
if (!this.jsonString) {
|
|
5344
|
-
throw new
|
|
5668
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
5345
5669
|
}
|
|
5346
5670
|
return this._result;
|
|
5347
5671
|
},
|
|
5348
5672
|
set: function (result) {
|
|
5349
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5673
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(result, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIResult)) {
|
|
5350
5674
|
this._result = result;
|
|
5351
5675
|
}
|
|
5352
5676
|
},
|
|
@@ -5356,12 +5680,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5356
5680
|
Object.defineProperty(CMIInteractionsObject.prototype, "latency", {
|
|
5357
5681
|
get: function () {
|
|
5358
5682
|
if (!this.jsonString) {
|
|
5359
|
-
throw new
|
|
5683
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
5360
5684
|
}
|
|
5361
5685
|
return this._latency;
|
|
5362
5686
|
},
|
|
5363
5687
|
set: function (latency) {
|
|
5364
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5688
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(latency, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMITimespan)) {
|
|
5365
5689
|
this._latency = latency;
|
|
5366
5690
|
}
|
|
5367
5691
|
},
|
|
@@ -5385,21 +5709,25 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5385
5709
|
return result;
|
|
5386
5710
|
};
|
|
5387
5711
|
return CMIInteractionsObject;
|
|
5388
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
5712
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
5389
5713
|
|
|
5390
5714
|
var CMIInteractionsObjectivesObject = (function (_super) {
|
|
5391
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
5715
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsObjectivesObject, _super);
|
|
5392
5716
|
function CMIInteractionsObjectivesObject() {
|
|
5393
5717
|
var _this = _super.call(this) || this;
|
|
5394
5718
|
_this._id = "";
|
|
5395
5719
|
return _this;
|
|
5396
5720
|
}
|
|
5721
|
+
CMIInteractionsObjectivesObject.prototype.reset = function () {
|
|
5722
|
+
this._initialized = false;
|
|
5723
|
+
this._id = "";
|
|
5724
|
+
};
|
|
5397
5725
|
Object.defineProperty(CMIInteractionsObjectivesObject.prototype, "id", {
|
|
5398
5726
|
get: function () {
|
|
5399
5727
|
return this._id;
|
|
5400
5728
|
},
|
|
5401
5729
|
set: function (id) {
|
|
5402
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5730
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIIdentifier)) {
|
|
5403
5731
|
this._id = id;
|
|
5404
5732
|
}
|
|
5405
5733
|
},
|
|
@@ -5415,24 +5743,28 @@ var CMIInteractionsObjectivesObject = (function (_super) {
|
|
|
5415
5743
|
return result;
|
|
5416
5744
|
};
|
|
5417
5745
|
return CMIInteractionsObjectivesObject;
|
|
5418
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
5746
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
5419
5747
|
|
|
5420
5748
|
var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
5421
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
5749
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsCorrectResponsesObject, _super);
|
|
5422
5750
|
function CMIInteractionsCorrectResponsesObject() {
|
|
5423
5751
|
var _this = _super.call(this) || this;
|
|
5424
5752
|
_this._pattern = "";
|
|
5425
5753
|
return _this;
|
|
5426
5754
|
}
|
|
5755
|
+
CMIInteractionsCorrectResponsesObject.prototype.reset = function () {
|
|
5756
|
+
this._initialized = false;
|
|
5757
|
+
this._pattern = "";
|
|
5758
|
+
};
|
|
5427
5759
|
Object.defineProperty(CMIInteractionsCorrectResponsesObject.prototype, "pattern", {
|
|
5428
5760
|
get: function () {
|
|
5429
5761
|
if (!this.jsonString) {
|
|
5430
|
-
throw new
|
|
5762
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
5431
5763
|
}
|
|
5432
5764
|
return this._pattern;
|
|
5433
5765
|
},
|
|
5434
5766
|
set: function (pattern) {
|
|
5435
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5767
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(pattern, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIFeedback, true)) {
|
|
5436
5768
|
this._pattern = pattern;
|
|
5437
5769
|
}
|
|
5438
5770
|
},
|
|
@@ -5448,7 +5780,7 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
5448
5780
|
return result;
|
|
5449
5781
|
};
|
|
5450
5782
|
return CMIInteractionsCorrectResponsesObject;
|
|
5451
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
5783
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
5452
5784
|
|
|
5453
5785
|
|
|
5454
5786
|
|
|
@@ -5457,8 +5789,9 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
5457
5789
|
/***/ 331:
|
|
5458
5790
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5459
5791
|
|
|
5792
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5460
5793
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5461
|
-
/* harmony export */
|
|
5794
|
+
/* harmony export */ NAV: function() { return /* binding */ NAV; }
|
|
5462
5795
|
/* harmony export */ });
|
|
5463
5796
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635);
|
|
5464
5797
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
@@ -5469,18 +5802,22 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
5469
5802
|
|
|
5470
5803
|
|
|
5471
5804
|
var NAV = (function (_super) {
|
|
5472
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_3__
|
|
5805
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_3__.__extends)(NAV, _super);
|
|
5473
5806
|
function NAV() {
|
|
5474
5807
|
var _this = _super.call(this) || this;
|
|
5475
5808
|
_this._event = "";
|
|
5476
5809
|
return _this;
|
|
5477
5810
|
}
|
|
5811
|
+
NAV.prototype.reset = function () {
|
|
5812
|
+
this._event = "";
|
|
5813
|
+
this._initialized = false;
|
|
5814
|
+
};
|
|
5478
5815
|
Object.defineProperty(NAV.prototype, "event", {
|
|
5479
5816
|
get: function () {
|
|
5480
5817
|
return this._event;
|
|
5481
5818
|
},
|
|
5482
5819
|
set: function (event) {
|
|
5483
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_1__
|
|
5820
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_1__.check12ValidFormat)(event, _constants_regex__WEBPACK_IMPORTED_MODULE_2__.scorm12_regex.NAVEvent)) {
|
|
5484
5821
|
this._event = event;
|
|
5485
5822
|
}
|
|
5486
5823
|
},
|
|
@@ -5496,7 +5833,7 @@ var NAV = (function (_super) {
|
|
|
5496
5833
|
return result;
|
|
5497
5834
|
};
|
|
5498
5835
|
return NAV;
|
|
5499
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
5836
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
5500
5837
|
|
|
5501
5838
|
|
|
5502
5839
|
|
|
@@ -5505,9 +5842,10 @@ var NAV = (function (_super) {
|
|
|
5505
5842
|
/***/ 176:
|
|
5506
5843
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5507
5844
|
|
|
5845
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5508
5846
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5509
|
-
/* harmony export */
|
|
5510
|
-
/* harmony export */
|
|
5847
|
+
/* harmony export */ CMIObjectives: function() { return /* binding */ CMIObjectives; },
|
|
5848
|
+
/* harmony export */ CMIObjectivesObject: function() { return /* binding */ CMIObjectivesObject; }
|
|
5511
5849
|
/* harmony export */ });
|
|
5512
5850
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(635);
|
|
5513
5851
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
@@ -5515,7 +5853,7 @@ var NAV = (function (_super) {
|
|
|
5515
5853
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(340);
|
|
5516
5854
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(417);
|
|
5517
5855
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(797);
|
|
5518
|
-
/* harmony import */ var
|
|
5856
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(179);
|
|
5519
5857
|
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(915);
|
|
5520
5858
|
/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(589);
|
|
5521
5859
|
|
|
@@ -5528,39 +5866,46 @@ var NAV = (function (_super) {
|
|
|
5528
5866
|
|
|
5529
5867
|
|
|
5530
5868
|
var CMIObjectives = (function (_super) {
|
|
5531
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_8__
|
|
5869
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_8__.__extends)(CMIObjectives, _super);
|
|
5532
5870
|
function CMIObjectives() {
|
|
5533
5871
|
return _super.call(this, {
|
|
5534
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
5535
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
5536
|
-
errorClass:
|
|
5872
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.objectives_children,
|
|
5873
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.INVALID_SET_VALUE,
|
|
5874
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_5__.Scorm12ValidationError,
|
|
5537
5875
|
}) || this;
|
|
5538
5876
|
}
|
|
5539
5877
|
return CMIObjectives;
|
|
5540
|
-
}(_common_array__WEBPACK_IMPORTED_MODULE_7__
|
|
5878
|
+
}(_common_array__WEBPACK_IMPORTED_MODULE_7__.CMIArray));
|
|
5541
5879
|
|
|
5542
5880
|
var CMIObjectivesObject = (function (_super) {
|
|
5543
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_8__
|
|
5881
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_8__.__extends)(CMIObjectivesObject, _super);
|
|
5544
5882
|
function CMIObjectivesObject() {
|
|
5545
5883
|
var _this = _super.call(this) || this;
|
|
5546
5884
|
_this._id = "";
|
|
5547
5885
|
_this._status = "";
|
|
5548
|
-
_this.score = new _common_score__WEBPACK_IMPORTED_MODULE_1__
|
|
5549
|
-
score_children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
5550
|
-
score_range: _constants_regex__WEBPACK_IMPORTED_MODULE_3__
|
|
5551
|
-
invalidErrorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
5552
|
-
invalidTypeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
5553
|
-
invalidRangeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
5554
|
-
errorClass:
|
|
5886
|
+
_this.score = new _common_score__WEBPACK_IMPORTED_MODULE_1__.CMIScore({
|
|
5887
|
+
score_children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.score_children,
|
|
5888
|
+
score_range: _constants_regex__WEBPACK_IMPORTED_MODULE_3__.scorm12_regex.score_range,
|
|
5889
|
+
invalidErrorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.INVALID_SET_VALUE,
|
|
5890
|
+
invalidTypeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.TYPE_MISMATCH,
|
|
5891
|
+
invalidRangeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.VALUE_OUT_OF_RANGE,
|
|
5892
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_5__.Scorm12ValidationError,
|
|
5555
5893
|
});
|
|
5556
5894
|
return _this;
|
|
5557
5895
|
}
|
|
5896
|
+
CMIObjectivesObject.prototype.reset = function () {
|
|
5897
|
+
var _a;
|
|
5898
|
+
this._initialized = false;
|
|
5899
|
+
this._id = "";
|
|
5900
|
+
this._status = "";
|
|
5901
|
+
(_a = this.score) === null || _a === void 0 ? void 0 : _a.reset();
|
|
5902
|
+
};
|
|
5558
5903
|
Object.defineProperty(CMIObjectivesObject.prototype, "id", {
|
|
5559
5904
|
get: function () {
|
|
5560
5905
|
return this._id;
|
|
5561
5906
|
},
|
|
5562
5907
|
set: function (id) {
|
|
5563
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__
|
|
5908
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__.check12ValidFormat)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_3__.scorm12_regex.CMIIdentifier)) {
|
|
5564
5909
|
this._id = id;
|
|
5565
5910
|
}
|
|
5566
5911
|
},
|
|
@@ -5572,7 +5917,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
5572
5917
|
return this._status;
|
|
5573
5918
|
},
|
|
5574
5919
|
set: function (status) {
|
|
5575
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__
|
|
5920
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__.check12ValidFormat)(status, _constants_regex__WEBPACK_IMPORTED_MODULE_3__.scorm12_regex.CMIStatus2)) {
|
|
5576
5921
|
this._status = status;
|
|
5577
5922
|
}
|
|
5578
5923
|
},
|
|
@@ -5590,7 +5935,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
5590
5935
|
return result;
|
|
5591
5936
|
};
|
|
5592
5937
|
return CMIObjectivesObject;
|
|
5593
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
5938
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
5594
5939
|
|
|
5595
5940
|
|
|
5596
5941
|
|
|
@@ -5599,13 +5944,14 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
5599
5944
|
/***/ 532:
|
|
5600
5945
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5601
5946
|
|
|
5947
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5602
5948
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5603
|
-
/* harmony export */
|
|
5949
|
+
/* harmony export */ CMIStudentData: function() { return /* binding */ CMIStudentData; }
|
|
5604
5950
|
/* harmony export */ });
|
|
5605
5951
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635);
|
|
5606
5952
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
5607
5953
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
5608
|
-
/* harmony import */ var
|
|
5954
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(179);
|
|
5609
5955
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797);
|
|
5610
5956
|
|
|
5611
5957
|
|
|
@@ -5613,7 +5959,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
5613
5959
|
|
|
5614
5960
|
|
|
5615
5961
|
var CMIStudentData = (function (_super) {
|
|
5616
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_4__
|
|
5962
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_4__.__extends)(CMIStudentData, _super);
|
|
5617
5963
|
function CMIStudentData(student_data_children) {
|
|
5618
5964
|
var _this = _super.call(this) || this;
|
|
5619
5965
|
_this._mastery_score = "";
|
|
@@ -5621,15 +5967,18 @@ var CMIStudentData = (function (_super) {
|
|
|
5621
5967
|
_this._time_limit_action = "";
|
|
5622
5968
|
_this.__children = student_data_children
|
|
5623
5969
|
? student_data_children
|
|
5624
|
-
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
5970
|
+
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.student_data_children;
|
|
5625
5971
|
return _this;
|
|
5626
5972
|
}
|
|
5973
|
+
CMIStudentData.prototype.reset = function () {
|
|
5974
|
+
this._initialized = false;
|
|
5975
|
+
};
|
|
5627
5976
|
Object.defineProperty(CMIStudentData.prototype, "_children", {
|
|
5628
5977
|
get: function () {
|
|
5629
5978
|
return this.__children;
|
|
5630
5979
|
},
|
|
5631
5980
|
set: function (_children) {
|
|
5632
|
-
throw new
|
|
5981
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.INVALID_SET_VALUE);
|
|
5633
5982
|
},
|
|
5634
5983
|
enumerable: false,
|
|
5635
5984
|
configurable: true
|
|
@@ -5640,7 +5989,7 @@ var CMIStudentData = (function (_super) {
|
|
|
5640
5989
|
},
|
|
5641
5990
|
set: function (mastery_score) {
|
|
5642
5991
|
if (this.initialized) {
|
|
5643
|
-
throw new
|
|
5992
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.READ_ONLY_ELEMENT);
|
|
5644
5993
|
}
|
|
5645
5994
|
else {
|
|
5646
5995
|
this._mastery_score = mastery_score;
|
|
@@ -5655,7 +6004,7 @@ var CMIStudentData = (function (_super) {
|
|
|
5655
6004
|
},
|
|
5656
6005
|
set: function (max_time_allowed) {
|
|
5657
6006
|
if (this.initialized) {
|
|
5658
|
-
throw new
|
|
6007
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.READ_ONLY_ELEMENT);
|
|
5659
6008
|
}
|
|
5660
6009
|
else {
|
|
5661
6010
|
this._max_time_allowed = max_time_allowed;
|
|
@@ -5670,7 +6019,7 @@ var CMIStudentData = (function (_super) {
|
|
|
5670
6019
|
},
|
|
5671
6020
|
set: function (time_limit_action) {
|
|
5672
6021
|
if (this.initialized) {
|
|
5673
|
-
throw new
|
|
6022
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.READ_ONLY_ELEMENT);
|
|
5674
6023
|
}
|
|
5675
6024
|
else {
|
|
5676
6025
|
this._time_limit_action = time_limit_action;
|
|
@@ -5690,7 +6039,7 @@ var CMIStudentData = (function (_super) {
|
|
|
5690
6039
|
return result;
|
|
5691
6040
|
};
|
|
5692
6041
|
return CMIStudentData;
|
|
5693
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
6042
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
5694
6043
|
|
|
5695
6044
|
|
|
5696
6045
|
|
|
@@ -5699,16 +6048,17 @@ var CMIStudentData = (function (_super) {
|
|
|
5699
6048
|
/***/ 181:
|
|
5700
6049
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5701
6050
|
|
|
6051
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5702
6052
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5703
|
-
/* harmony export */
|
|
6053
|
+
/* harmony export */ CMIStudentPreference: function() { return /* binding */ CMIStudentPreference; }
|
|
5704
6054
|
/* harmony export */ });
|
|
5705
6055
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(635);
|
|
5706
6056
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
5707
6057
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
5708
|
-
/* harmony import */ var
|
|
5709
|
-
/* harmony import */ var
|
|
5710
|
-
/* harmony import */ var
|
|
5711
|
-
/* harmony import */ var
|
|
6058
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(179);
|
|
6059
|
+
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(915);
|
|
6060
|
+
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(417);
|
|
6061
|
+
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(797);
|
|
5712
6062
|
|
|
5713
6063
|
|
|
5714
6064
|
|
|
@@ -5717,7 +6067,7 @@ var CMIStudentData = (function (_super) {
|
|
|
5717
6067
|
|
|
5718
6068
|
|
|
5719
6069
|
var CMIStudentPreference = (function (_super) {
|
|
5720
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_6__
|
|
6070
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_6__.__extends)(CMIStudentPreference, _super);
|
|
5721
6071
|
function CMIStudentPreference(student_preference_children) {
|
|
5722
6072
|
var _this = _super.call(this) || this;
|
|
5723
6073
|
_this._audio = "";
|
|
@@ -5726,15 +6076,18 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5726
6076
|
_this._text = "";
|
|
5727
6077
|
_this.__children = student_preference_children
|
|
5728
6078
|
? student_preference_children
|
|
5729
|
-
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
6079
|
+
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.student_preference_children;
|
|
5730
6080
|
return _this;
|
|
5731
6081
|
}
|
|
6082
|
+
CMIStudentPreference.prototype.reset = function () {
|
|
6083
|
+
this._initialized = false;
|
|
6084
|
+
};
|
|
5732
6085
|
Object.defineProperty(CMIStudentPreference.prototype, "_children", {
|
|
5733
6086
|
get: function () {
|
|
5734
6087
|
return this.__children;
|
|
5735
6088
|
},
|
|
5736
6089
|
set: function (_children) {
|
|
5737
|
-
throw new
|
|
6090
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_5__.scorm12_errors.INVALID_SET_VALUE);
|
|
5738
6091
|
},
|
|
5739
6092
|
enumerable: false,
|
|
5740
6093
|
configurable: true
|
|
@@ -5744,8 +6097,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5744
6097
|
return this._audio;
|
|
5745
6098
|
},
|
|
5746
6099
|
set: function (audio) {
|
|
5747
|
-
if ((0,
|
|
5748
|
-
(0,
|
|
6100
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMISInteger) &&
|
|
6101
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidRange)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.audio_range)) {
|
|
5749
6102
|
this._audio = audio;
|
|
5750
6103
|
}
|
|
5751
6104
|
},
|
|
@@ -5757,7 +6110,7 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5757
6110
|
return this._language;
|
|
5758
6111
|
},
|
|
5759
6112
|
set: function (language) {
|
|
5760
|
-
if ((0,
|
|
6113
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(language, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMIString256)) {
|
|
5761
6114
|
this._language = language;
|
|
5762
6115
|
}
|
|
5763
6116
|
},
|
|
@@ -5769,8 +6122,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5769
6122
|
return this._speed;
|
|
5770
6123
|
},
|
|
5771
6124
|
set: function (speed) {
|
|
5772
|
-
if ((0,
|
|
5773
|
-
(0,
|
|
6125
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMISInteger) &&
|
|
6126
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidRange)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.speed_range)) {
|
|
5774
6127
|
this._speed = speed;
|
|
5775
6128
|
}
|
|
5776
6129
|
},
|
|
@@ -5782,8 +6135,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5782
6135
|
return this._text;
|
|
5783
6136
|
},
|
|
5784
6137
|
set: function (text) {
|
|
5785
|
-
if ((0,
|
|
5786
|
-
(0,
|
|
6138
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMISInteger) &&
|
|
6139
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidRange)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.text_range)) {
|
|
5787
6140
|
this._text = text;
|
|
5788
6141
|
}
|
|
5789
6142
|
},
|
|
@@ -5802,7 +6155,7 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5802
6155
|
return result;
|
|
5803
6156
|
};
|
|
5804
6157
|
return CMIStudentPreference;
|
|
5805
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
6158
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
5806
6159
|
|
|
5807
6160
|
|
|
5808
6161
|
|
|
@@ -5811,24 +6164,25 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5811
6164
|
/***/ 915:
|
|
5812
6165
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5813
6166
|
|
|
6167
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5814
6168
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5815
|
-
/* harmony export */
|
|
5816
|
-
/* harmony export */
|
|
6169
|
+
/* harmony export */ check12ValidFormat: function() { return /* binding */ check12ValidFormat; },
|
|
6170
|
+
/* harmony export */ check12ValidRange: function() { return /* binding */ check12ValidRange; }
|
|
5817
6171
|
/* harmony export */ });
|
|
5818
6172
|
/* harmony import */ var _common_validation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(449);
|
|
5819
6173
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(797);
|
|
5820
|
-
/* harmony import */ var
|
|
6174
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(179);
|
|
5821
6175
|
|
|
5822
6176
|
|
|
5823
6177
|
|
|
5824
6178
|
function check12ValidFormat(value, regexPattern, allowEmptyString) {
|
|
5825
|
-
return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__
|
|
6179
|
+
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);
|
|
5826
6180
|
}
|
|
5827
6181
|
function check12ValidRange(value, rangePattern, allowEmptyString) {
|
|
5828
6182
|
if (!allowEmptyString && value === "") {
|
|
5829
|
-
throw new
|
|
6183
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_1__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_0__.scorm12_errors.VALUE_OUT_OF_RANGE);
|
|
5830
6184
|
}
|
|
5831
|
-
return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__
|
|
6185
|
+
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);
|
|
5832
6186
|
}
|
|
5833
6187
|
|
|
5834
6188
|
|
|
@@ -5837,16 +6191,23 @@ function check12ValidRange(value, rangePattern, allowEmptyString) {
|
|
|
5837
6191
|
/***/ 340:
|
|
5838
6192
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5839
6193
|
|
|
6194
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6195
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6196
|
+
/* harmony export */ aicc_constants: function() { return /* binding */ aicc_constants; },
|
|
6197
|
+
/* harmony export */ global_constants: function() { return /* binding */ global_constants; },
|
|
6198
|
+
/* harmony export */ scorm12_constants: function() { return /* binding */ scorm12_constants; },
|
|
6199
|
+
/* harmony export */ scorm2004_constants: function() { return /* binding */ scorm2004_constants; }
|
|
6200
|
+
/* harmony export */ });
|
|
5840
6201
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
5841
6202
|
|
|
5842
|
-
var
|
|
6203
|
+
var global_constants = {
|
|
5843
6204
|
SCORM_TRUE: "true",
|
|
5844
6205
|
SCORM_FALSE: "false",
|
|
5845
6206
|
STATE_NOT_INITIALIZED: 0,
|
|
5846
6207
|
STATE_INITIALIZED: 1,
|
|
5847
6208
|
STATE_TERMINATED: 2,
|
|
5848
6209
|
};
|
|
5849
|
-
var
|
|
6210
|
+
var scorm12_constants = {
|
|
5850
6211
|
cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",
|
|
5851
6212
|
core_children: "student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",
|
|
5852
6213
|
score_children: "raw,min,max",
|
|
@@ -5907,7 +6268,7 @@ var scorm12 = {
|
|
|
5907
6268
|
},
|
|
5908
6269
|
},
|
|
5909
6270
|
};
|
|
5910
|
-
var
|
|
6271
|
+
var aicc_constants = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, scorm12_constants), {
|
|
5911
6272
|
cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",
|
|
5912
6273
|
student_preference_children: "audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",
|
|
5913
6274
|
student_data_children: "attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",
|
|
@@ -5916,7 +6277,7 @@ var aicc = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__W
|
|
|
5916
6277
|
attempt_records_children: "score,lesson_status",
|
|
5917
6278
|
paths_children: "location_id,date,time,status,why_left,time_in_element",
|
|
5918
6279
|
});
|
|
5919
|
-
var
|
|
6280
|
+
var scorm2004_constants = {
|
|
5920
6281
|
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",
|
|
5921
6282
|
comments_children: "comment,timestamp,location",
|
|
5922
6283
|
score_children: "max,raw,scaled,min",
|
|
@@ -5925,6 +6286,7 @@ var scorm2004 = {
|
|
|
5925
6286
|
student_data_children: "mastery_score,max_time_allowed,time_limit_action",
|
|
5926
6287
|
student_preference_children: "audio_level,audio_captioning,delivery_speed,language",
|
|
5927
6288
|
interactions_children: "id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",
|
|
6289
|
+
adl_data_children: "id,store",
|
|
5928
6290
|
error_descriptions: {
|
|
5929
6291
|
"0": {
|
|
5930
6292
|
basicMessage: "No Error",
|
|
@@ -6032,13 +6394,6 @@ var scorm2004 = {
|
|
|
6032
6394
|
},
|
|
6033
6395
|
},
|
|
6034
6396
|
};
|
|
6035
|
-
var APIConstants = {
|
|
6036
|
-
global: global,
|
|
6037
|
-
scorm12: scorm12,
|
|
6038
|
-
aicc: aicc,
|
|
6039
|
-
scorm2004: scorm2004,
|
|
6040
|
-
};
|
|
6041
|
-
/* harmony default export */ __webpack_exports__.A = (APIConstants);
|
|
6042
6397
|
|
|
6043
6398
|
|
|
6044
6399
|
/***/ }),
|
|
@@ -6046,11 +6401,12 @@ var APIConstants = {
|
|
|
6046
6401
|
/***/ 56:
|
|
6047
6402
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6048
6403
|
|
|
6404
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6049
6405
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6050
|
-
/* harmony export */
|
|
6051
|
-
/* harmony export */
|
|
6052
|
-
/* harmony export */
|
|
6053
|
-
/* harmony export */
|
|
6406
|
+
/* harmony export */ CompletionStatus: function() { return /* binding */ CompletionStatus; },
|
|
6407
|
+
/* harmony export */ LogLevelEnum: function() { return /* binding */ LogLevelEnum; },
|
|
6408
|
+
/* harmony export */ NAVBoolean: function() { return /* binding */ NAVBoolean; },
|
|
6409
|
+
/* harmony export */ SuccessStatus: function() { return /* binding */ SuccessStatus; }
|
|
6054
6410
|
/* harmony export */ });
|
|
6055
6411
|
var NAVBoolean;
|
|
6056
6412
|
(function (NAVBoolean) {
|
|
@@ -6086,9 +6442,15 @@ var LogLevelEnum;
|
|
|
6086
6442
|
/***/ 797:
|
|
6087
6443
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6088
6444
|
|
|
6445
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6446
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6447
|
+
/* harmony export */ global_errors: function() { return /* binding */ global_errors; },
|
|
6448
|
+
/* harmony export */ scorm12_errors: function() { return /* binding */ scorm12_errors; },
|
|
6449
|
+
/* harmony export */ scorm2004_errors: function() { return /* binding */ scorm2004_errors; }
|
|
6450
|
+
/* harmony export */ });
|
|
6089
6451
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
6090
6452
|
|
|
6091
|
-
var
|
|
6453
|
+
var global_errors = {
|
|
6092
6454
|
GENERAL: 101,
|
|
6093
6455
|
INITIALIZATION_FAILED: 101,
|
|
6094
6456
|
INITIALIZED: 101,
|
|
@@ -6118,13 +6480,8 @@ var global = {
|
|
|
6118
6480
|
VALUE_OUT_OF_RANGE: 101,
|
|
6119
6481
|
DEPENDENCY_NOT_ESTABLISHED: 101,
|
|
6120
6482
|
};
|
|
6121
|
-
var
|
|
6122
|
-
var
|
|
6123
|
-
var ErrorCodes = {
|
|
6124
|
-
scorm12: scorm12,
|
|
6125
|
-
scorm2004: scorm2004,
|
|
6126
|
-
};
|
|
6127
|
-
/* harmony default export */ __webpack_exports__.A = (ErrorCodes);
|
|
6483
|
+
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 });
|
|
6484
|
+
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 });
|
|
6128
6485
|
|
|
6129
6486
|
|
|
6130
6487
|
/***/ }),
|
|
@@ -6132,9 +6489,15 @@ var ErrorCodes = {
|
|
|
6132
6489
|
/***/ 417:
|
|
6133
6490
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6134
6491
|
|
|
6492
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6493
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6494
|
+
/* harmony export */ aicc_regex: function() { return /* binding */ aicc_regex; },
|
|
6495
|
+
/* harmony export */ scorm12_regex: function() { return /* binding */ scorm12_regex; },
|
|
6496
|
+
/* harmony export */ scorm2004_regex: function() { return /* binding */ scorm2004_regex; }
|
|
6497
|
+
/* harmony export */ });
|
|
6135
6498
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
6136
6499
|
|
|
6137
|
-
var
|
|
6500
|
+
var scorm12_regex = {
|
|
6138
6501
|
CMIString256: "^.{0,255}$",
|
|
6139
6502
|
CMIString4096: "^.{0,4096}$",
|
|
6140
6503
|
CMITime: "^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",
|
|
@@ -6157,10 +6520,10 @@ var scorm12 = {
|
|
|
6157
6520
|
weighting_range: "-100#100",
|
|
6158
6521
|
text_range: "-1#1",
|
|
6159
6522
|
};
|
|
6160
|
-
var
|
|
6523
|
+
var aicc_regex = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, scorm12_regex), {
|
|
6161
6524
|
CMIIdentifier: "^\\w{1,255}$",
|
|
6162
6525
|
});
|
|
6163
|
-
var
|
|
6526
|
+
var scorm2004_regex = {
|
|
6164
6527
|
CMIString200: "^[\\u0000-\\uFFFF]{0,200}$",
|
|
6165
6528
|
CMIString250: "^[\\u0000-\\uFFFF]{0,250}$",
|
|
6166
6529
|
CMIString1000: "^[\\u0000-\\uFFFF]{0,1000}$",
|
|
@@ -6196,12 +6559,6 @@ var scorm2004 = {
|
|
|
6196
6559
|
text_range: "-1#1",
|
|
6197
6560
|
progress_range: "0#1",
|
|
6198
6561
|
};
|
|
6199
|
-
var Regex = {
|
|
6200
|
-
aicc: aicc,
|
|
6201
|
-
scorm12: scorm12,
|
|
6202
|
-
scorm2004: scorm2004,
|
|
6203
|
-
};
|
|
6204
|
-
/* harmony default export */ __webpack_exports__.A = (Regex);
|
|
6205
6562
|
|
|
6206
6563
|
|
|
6207
6564
|
/***/ }),
|
|
@@ -6209,22 +6566,15 @@ var Regex = {
|
|
|
6209
6566
|
/***/ 784:
|
|
6210
6567
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6211
6568
|
|
|
6569
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6212
6570
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6213
|
-
/* harmony export */
|
|
6214
|
-
/* harmony export */
|
|
6215
|
-
/* harmony export */ tQ: function() { return /* binding */ Scorm12ValidationError; },
|
|
6216
|
-
/* harmony export */ wq: function() { return /* binding */ Scorm2004ValidationError; },
|
|
6217
|
-
/* harmony export */ yI: function() { return /* binding */ ValidationError; }
|
|
6571
|
+
/* harmony export */ BaseScormValidationError: function() { return /* binding */ BaseScormValidationError; },
|
|
6572
|
+
/* harmony export */ ValidationError: function() { return /* binding */ ValidationError; }
|
|
6218
6573
|
/* harmony export */ });
|
|
6219
|
-
/* harmony import */ var
|
|
6220
|
-
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340);
|
|
6221
|
-
|
|
6574
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
6222
6575
|
|
|
6223
|
-
var scorm12_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.error_descriptions;
|
|
6224
|
-
var aicc_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.aicc.error_descriptions;
|
|
6225
|
-
var scorm2004_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm2004.error_descriptions;
|
|
6226
6576
|
var BaseScormValidationError = (function (_super) {
|
|
6227
|
-
(0,
|
|
6577
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(BaseScormValidationError, _super);
|
|
6228
6578
|
function BaseScormValidationError(errorCode) {
|
|
6229
6579
|
var _this = _super.call(this, errorCode.toString()) || this;
|
|
6230
6580
|
_this._errorCode = errorCode;
|
|
@@ -6242,7 +6592,7 @@ var BaseScormValidationError = (function (_super) {
|
|
|
6242
6592
|
}(Error));
|
|
6243
6593
|
|
|
6244
6594
|
var ValidationError = (function (_super) {
|
|
6245
|
-
(0,
|
|
6595
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(ValidationError, _super);
|
|
6246
6596
|
function ValidationError(errorCode, errorMessage, detailedMessage) {
|
|
6247
6597
|
var _this = _super.call(this, errorCode) || this;
|
|
6248
6598
|
_this._detailedMessage = "";
|
|
@@ -6270,8 +6620,26 @@ var ValidationError = (function (_super) {
|
|
|
6270
6620
|
return ValidationError;
|
|
6271
6621
|
}(BaseScormValidationError));
|
|
6272
6622
|
|
|
6623
|
+
|
|
6624
|
+
|
|
6625
|
+
/***/ }),
|
|
6626
|
+
|
|
6627
|
+
/***/ 179:
|
|
6628
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6629
|
+
|
|
6630
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6631
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6632
|
+
/* harmony export */ Scorm12ValidationError: function() { return /* binding */ Scorm12ValidationError; }
|
|
6633
|
+
/* harmony export */ });
|
|
6634
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(635);
|
|
6635
|
+
/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(784);
|
|
6636
|
+
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
6637
|
+
|
|
6638
|
+
|
|
6639
|
+
|
|
6640
|
+
var scorm12_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.error_descriptions;
|
|
6273
6641
|
var Scorm12ValidationError = (function (_super) {
|
|
6274
|
-
(0,
|
|
6642
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_2__.__extends)(Scorm12ValidationError, _super);
|
|
6275
6643
|
function Scorm12ValidationError(errorCode) {
|
|
6276
6644
|
var _this = this;
|
|
6277
6645
|
if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {
|
|
@@ -6283,37 +6651,7 @@ var Scorm12ValidationError = (function (_super) {
|
|
|
6283
6651
|
return _this;
|
|
6284
6652
|
}
|
|
6285
6653
|
return Scorm12ValidationError;
|
|
6286
|
-
}(ValidationError));
|
|
6287
|
-
|
|
6288
|
-
var AICCValidationError = (function (_super) {
|
|
6289
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(AICCValidationError, _super);
|
|
6290
|
-
function AICCValidationError(errorCode) {
|
|
6291
|
-
var _this = this;
|
|
6292
|
-
if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {
|
|
6293
|
-
_this = _super.call(this, errorCode, aicc_errors[String(errorCode)].basicMessage, aicc_errors[String(errorCode)].detailMessage) || this;
|
|
6294
|
-
}
|
|
6295
|
-
else {
|
|
6296
|
-
_this = _super.call(this, 101, aicc_errors["101"].basicMessage, aicc_errors["101"].detailMessage) || this;
|
|
6297
|
-
}
|
|
6298
|
-
return _this;
|
|
6299
|
-
}
|
|
6300
|
-
return AICCValidationError;
|
|
6301
|
-
}(ValidationError));
|
|
6302
|
-
|
|
6303
|
-
var Scorm2004ValidationError = (function (_super) {
|
|
6304
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(Scorm2004ValidationError, _super);
|
|
6305
|
-
function Scorm2004ValidationError(errorCode) {
|
|
6306
|
-
var _this = this;
|
|
6307
|
-
if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {
|
|
6308
|
-
_this = _super.call(this, errorCode, scorm2004_errors[String(errorCode)].basicMessage, scorm2004_errors[String(errorCode)].detailMessage) || this;
|
|
6309
|
-
}
|
|
6310
|
-
else {
|
|
6311
|
-
_this = _super.call(this, 101, scorm2004_errors["101"].basicMessage, scorm2004_errors["101"].detailMessage) || this;
|
|
6312
|
-
}
|
|
6313
|
-
return _this;
|
|
6314
|
-
}
|
|
6315
|
-
return Scorm2004ValidationError;
|
|
6316
|
-
}(ValidationError));
|
|
6654
|
+
}(_exceptions__WEBPACK_IMPORTED_MODULE_0__.ValidationError));
|
|
6317
6655
|
|
|
6318
6656
|
|
|
6319
6657
|
|
|
@@ -6322,19 +6660,24 @@ var Scorm2004ValidationError = (function (_super) {
|
|
|
6322
6660
|
/***/ 864:
|
|
6323
6661
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6324
6662
|
|
|
6663
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6325
6664
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6326
|
-
/* harmony export */
|
|
6327
|
-
/* harmony export */
|
|
6328
|
-
/* harmony export */
|
|
6329
|
-
/* harmony export */
|
|
6330
|
-
/* harmony export */
|
|
6331
|
-
/* harmony export */
|
|
6332
|
-
/* harmony export */
|
|
6333
|
-
/* harmony export */
|
|
6334
|
-
/* harmony export */
|
|
6335
|
-
/* harmony export */
|
|
6665
|
+
/* harmony export */ SECONDS_PER_DAY: function() { return /* binding */ SECONDS_PER_DAY; },
|
|
6666
|
+
/* harmony export */ SECONDS_PER_HOUR: function() { return /* binding */ SECONDS_PER_HOUR; },
|
|
6667
|
+
/* harmony export */ SECONDS_PER_MINUTE: function() { return /* binding */ SECONDS_PER_MINUTE; },
|
|
6668
|
+
/* harmony export */ SECONDS_PER_SECOND: function() { return /* binding */ SECONDS_PER_SECOND; },
|
|
6669
|
+
/* harmony export */ addHHMMSSTimeStrings: function() { return /* binding */ addHHMMSSTimeStrings; },
|
|
6670
|
+
/* harmony export */ addTwoDurations: function() { return /* binding */ addTwoDurations; },
|
|
6671
|
+
/* harmony export */ countDecimals: function() { return /* binding */ countDecimals; },
|
|
6672
|
+
/* harmony export */ flatten: function() { return /* binding */ flatten; },
|
|
6673
|
+
/* harmony export */ formatMessage: function() { return /* binding */ formatMessage; },
|
|
6674
|
+
/* harmony export */ getDurationAsSeconds: function() { return /* binding */ getDurationAsSeconds; },
|
|
6675
|
+
/* harmony export */ getSecondsAsHHMMSS: function() { return /* binding */ getSecondsAsHHMMSS; },
|
|
6676
|
+
/* harmony export */ getSecondsAsISODuration: function() { return /* binding */ getSecondsAsISODuration; },
|
|
6677
|
+
/* harmony export */ getTimeAsSeconds: function() { return /* binding */ getTimeAsSeconds; },
|
|
6678
|
+
/* harmony export */ stringMatches: function() { return /* binding */ stringMatches; },
|
|
6679
|
+
/* harmony export */ unflatten: function() { return /* binding */ unflatten; }
|
|
6336
6680
|
/* harmony export */ });
|
|
6337
|
-
/* unused harmony exports SECONDS_PER_SECOND, SECONDS_PER_MINUTE, SECONDS_PER_HOUR, SECONDS_PER_DAY, countDecimals */
|
|
6338
6681
|
var SECONDS_PER_SECOND = 1.0;
|
|
6339
6682
|
var SECONDS_PER_MINUTE = 60;
|
|
6340
6683
|
var SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;
|
|
@@ -6526,13 +6869,40 @@ function stringMatches(str, tester) {
|
|
|
6526
6869
|
/***/ 635:
|
|
6527
6870
|
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
6528
6871
|
|
|
6872
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6529
6873
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6530
|
-
/* harmony export */
|
|
6531
|
-
/* harmony export */
|
|
6532
|
-
/* harmony export */
|
|
6533
|
-
/* harmony export */
|
|
6874
|
+
/* harmony export */ __addDisposableResource: function() { return /* binding */ __addDisposableResource; },
|
|
6875
|
+
/* harmony export */ __assign: function() { return /* binding */ __assign; },
|
|
6876
|
+
/* harmony export */ __asyncDelegator: function() { return /* binding */ __asyncDelegator; },
|
|
6877
|
+
/* harmony export */ __asyncGenerator: function() { return /* binding */ __asyncGenerator; },
|
|
6878
|
+
/* harmony export */ __asyncValues: function() { return /* binding */ __asyncValues; },
|
|
6879
|
+
/* harmony export */ __await: function() { return /* binding */ __await; },
|
|
6880
|
+
/* harmony export */ __awaiter: function() { return /* binding */ __awaiter; },
|
|
6881
|
+
/* harmony export */ __classPrivateFieldGet: function() { return /* binding */ __classPrivateFieldGet; },
|
|
6882
|
+
/* harmony export */ __classPrivateFieldIn: function() { return /* binding */ __classPrivateFieldIn; },
|
|
6883
|
+
/* harmony export */ __classPrivateFieldSet: function() { return /* binding */ __classPrivateFieldSet; },
|
|
6884
|
+
/* harmony export */ __createBinding: function() { return /* binding */ __createBinding; },
|
|
6885
|
+
/* harmony export */ __decorate: function() { return /* binding */ __decorate; },
|
|
6886
|
+
/* harmony export */ __disposeResources: function() { return /* binding */ __disposeResources; },
|
|
6887
|
+
/* harmony export */ __esDecorate: function() { return /* binding */ __esDecorate; },
|
|
6888
|
+
/* harmony export */ __exportStar: function() { return /* binding */ __exportStar; },
|
|
6889
|
+
/* harmony export */ __extends: function() { return /* binding */ __extends; },
|
|
6890
|
+
/* harmony export */ __generator: function() { return /* binding */ __generator; },
|
|
6891
|
+
/* harmony export */ __importDefault: function() { return /* binding */ __importDefault; },
|
|
6892
|
+
/* harmony export */ __importStar: function() { return /* binding */ __importStar; },
|
|
6893
|
+
/* harmony export */ __makeTemplateObject: function() { return /* binding */ __makeTemplateObject; },
|
|
6894
|
+
/* harmony export */ __metadata: function() { return /* binding */ __metadata; },
|
|
6895
|
+
/* harmony export */ __param: function() { return /* binding */ __param; },
|
|
6896
|
+
/* harmony export */ __propKey: function() { return /* binding */ __propKey; },
|
|
6897
|
+
/* harmony export */ __read: function() { return /* binding */ __read; },
|
|
6898
|
+
/* harmony export */ __rest: function() { return /* binding */ __rest; },
|
|
6899
|
+
/* harmony export */ __runInitializers: function() { return /* binding */ __runInitializers; },
|
|
6900
|
+
/* harmony export */ __setFunctionName: function() { return /* binding */ __setFunctionName; },
|
|
6901
|
+
/* harmony export */ __spread: function() { return /* binding */ __spread; },
|
|
6902
|
+
/* harmony export */ __spreadArray: function() { return /* binding */ __spreadArray; },
|
|
6903
|
+
/* harmony export */ __spreadArrays: function() { return /* binding */ __spreadArrays; },
|
|
6904
|
+
/* harmony export */ __values: function() { return /* binding */ __values; }
|
|
6534
6905
|
/* harmony export */ });
|
|
6535
|
-
/* 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 */
|
|
6536
6906
|
/******************************************************************************
|
|
6537
6907
|
Copyright (c) Microsoft Corporation.
|
|
6538
6908
|
|
|
@@ -6882,7 +7252,7 @@ function __disposeResources(env) {
|
|
|
6882
7252
|
return next();
|
|
6883
7253
|
}
|
|
6884
7254
|
|
|
6885
|
-
/*
|
|
7255
|
+
/* harmony default export */ __webpack_exports__["default"] = ({
|
|
6886
7256
|
__extends,
|
|
6887
7257
|
__assign,
|
|
6888
7258
|
__rest,
|
|
@@ -6959,27 +7329,39 @@ function __disposeResources(env) {
|
|
|
6959
7329
|
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
|
|
6960
7330
|
/******/ }();
|
|
6961
7331
|
/******/
|
|
7332
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
7333
|
+
/******/ !function() {
|
|
7334
|
+
/******/ // define __esModule on exports
|
|
7335
|
+
/******/ __webpack_require__.r = function(exports) {
|
|
7336
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
7337
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
7338
|
+
/******/ }
|
|
7339
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
7340
|
+
/******/ };
|
|
7341
|
+
/******/ }();
|
|
7342
|
+
/******/
|
|
6962
7343
|
/************************************************************************/
|
|
6963
7344
|
var __webpack_exports__ = {};
|
|
7345
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6964
7346
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6965
|
-
/* harmony export */
|
|
6966
|
-
/* harmony export */
|
|
6967
|
-
/* harmony export */
|
|
7347
|
+
/* harmony export */ AICC: function() { return /* binding */ AICC; },
|
|
7348
|
+
/* harmony export */ Scorm12API: function() { return /* binding */ Scorm12API; },
|
|
7349
|
+
/* harmony export */ Scorm2004API: function() { return /* binding */ Scorm2004API; }
|
|
6968
7350
|
/* harmony export */ });
|
|
6969
|
-
/* harmony import */ var _AICC__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
7351
|
+
/* harmony import */ var _AICC__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(916);
|
|
6970
7352
|
/* harmony import */ var _Scorm12API__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(941);
|
|
6971
|
-
/* harmony import */ var _Scorm2004API__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
7353
|
+
/* harmony import */ var _Scorm2004API__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(809);
|
|
6972
7354
|
|
|
6973
7355
|
|
|
6974
7356
|
|
|
6975
|
-
var Scorm12API = _Scorm12API__WEBPACK_IMPORTED_MODULE_1__
|
|
6976
|
-
var Scorm2004API = _Scorm2004API__WEBPACK_IMPORTED_MODULE_2__
|
|
6977
|
-
var AICC = _AICC__WEBPACK_IMPORTED_MODULE_0__
|
|
7357
|
+
var Scorm12API = _Scorm12API__WEBPACK_IMPORTED_MODULE_1__.Scorm12Impl;
|
|
7358
|
+
var Scorm2004API = _Scorm2004API__WEBPACK_IMPORTED_MODULE_2__.Scorm2004Impl;
|
|
7359
|
+
var AICC = _AICC__WEBPACK_IMPORTED_MODULE_0__.AICCImpl;
|
|
6978
7360
|
|
|
6979
7361
|
|
|
6980
|
-
var __webpack_exports__AICC = __webpack_exports__.
|
|
6981
|
-
var __webpack_exports__Scorm12API = __webpack_exports__.
|
|
6982
|
-
var __webpack_exports__Scorm2004API = __webpack_exports__.
|
|
7362
|
+
var __webpack_exports__AICC = __webpack_exports__.AICC;
|
|
7363
|
+
var __webpack_exports__Scorm12API = __webpack_exports__.Scorm12API;
|
|
7364
|
+
var __webpack_exports__Scorm2004API = __webpack_exports__.Scorm2004API;
|
|
6983
7365
|
export { __webpack_exports__AICC as AICC, __webpack_exports__Scorm12API as Scorm12API, __webpack_exports__Scorm2004API as Scorm2004API };
|
|
6984
7366
|
|
|
6985
7367
|
//# sourceMappingURL=scorm-again.js.map
|