scorm-again 2.4.1 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -23
- package/dist/aicc.js +676 -493
- package/dist/aicc.js.map +1 -1
- package/dist/aicc.min.js +1 -1
- package/dist/aicc.min.js.map +1 -1
- package/dist/esm/aicc.js +692 -496
- package/dist/esm/aicc.js.map +1 -1
- package/dist/esm/aicc.min.js +1 -1
- package/dist/esm/aicc.min.js.map +1 -1
- package/dist/esm/scorm-again.js +1151 -743
- package/dist/esm/scorm-again.js.map +1 -1
- package/dist/esm/scorm-again.min.js +1 -1
- package/dist/esm/scorm-again.min.js.map +1 -1
- package/dist/esm/scorm12.js +534 -401
- package/dist/esm/scorm12.js.map +1 -1
- package/dist/esm/scorm12.min.js +1 -1
- package/dist/esm/scorm12.min.js.map +1 -1
- package/dist/esm/scorm2004.js +712 -465
- package/dist/esm/scorm2004.js.map +1 -1
- package/dist/esm/scorm2004.min.js +1 -1
- package/dist/esm/scorm2004.min.js.map +1 -1
- package/dist/scorm-again.js +1127 -731
- package/dist/scorm-again.js.map +1 -1
- package/dist/scorm-again.min.js +1 -1
- package/dist/scorm-again.min.js.map +1 -1
- package/dist/scorm12.js +521 -400
- package/dist/scorm12.js.map +1 -1
- package/dist/scorm12.min.js +1 -1
- package/dist/scorm12.min.js.map +1 -1
- package/dist/scorm2004.js +698 -464
- package/dist/scorm2004.js.map +1 -1
- package/dist/scorm2004.min.js +1 -1
- package/dist/scorm2004.min.js.map +1 -1
- package/package.json +15 -15
- package/src/AICC.ts +3 -0
- package/src/BaseAPI.ts +60 -95
- package/src/Scorm12API.ts +14 -14
- package/src/Scorm2004API.ts +107 -37
- package/src/cmi/aicc/attempts.ts +22 -12
- package/src/cmi/aicc/cmi.ts +2 -2
- package/src/cmi/aicc/core.ts +44 -26
- package/src/cmi/aicc/evaluation.ts +31 -12
- package/src/cmi/aicc/paths.ts +29 -15
- package/src/cmi/aicc/student_data.ts +14 -5
- package/src/cmi/aicc/student_demographics.ts +31 -24
- package/src/cmi/aicc/student_preferences.ts +11 -11
- package/src/cmi/aicc/tries.ts +24 -14
- package/src/cmi/aicc/validation.ts +3 -4
- package/src/cmi/common/array.ts +17 -5
- package/src/cmi/common/base_cmi.ts +3 -1
- package/src/cmi/common/score.ts +16 -13
- package/src/cmi/scorm12/cmi.ts +25 -10
- package/src/cmi/scorm12/interactions.ts +62 -28
- package/src/cmi/scorm12/nav.ts +13 -5
- package/src/cmi/scorm12/objectives.ts +28 -18
- package/src/cmi/scorm12/student_data.ts +15 -8
- package/src/cmi/scorm12/student_preference.ts +20 -13
- package/src/cmi/scorm12/validation.ts +7 -7
- package/src/cmi/scorm2004/adl.ts +141 -25
- package/src/cmi/scorm2004/cmi.ts +50 -55
- package/src/cmi/scorm2004/comments.ts +21 -20
- package/src/cmi/scorm2004/interactions.ts +73 -32
- package/src/cmi/scorm2004/learner_preference.ts +20 -13
- package/src/cmi/scorm2004/objectives.ts +41 -16
- package/src/cmi/scorm2004/score.ts +22 -11
- package/src/cmi/scorm2004/validation.ts +4 -4
- package/src/constants/api_constants.ts +8 -29
- package/src/constants/default_settings.ts +26 -12
- package/src/constants/enums.ts +9 -0
- package/src/constants/error_codes.ts +5 -12
- package/src/constants/regex.ts +5 -11
- package/src/constants/response_constants.ts +1 -2
- package/src/exceptions/aicc_exceptions.ts +29 -0
- package/src/exceptions/scorm12_exceptions.ts +29 -0
- package/src/exceptions/scorm2004_exceptions.ts +29 -0
- package/src/exceptions.ts +1 -86
- package/src/types/api_types.ts +29 -5
- package/test/AICC.spec.ts +114 -43
- package/test/Scorm12API.spec.ts +37 -39
- package/test/Scorm2004API.spec.ts +165 -80
- package/test/cmi/aicc_cmi.spec.ts +6 -9
- package/test/cmi/scorm12_cmi.spec.ts +8 -8
- package/test/cmi/scorm2004_cmi.spec.ts +8 -9
- package/test/exceptions.spec.ts +11 -9
- package/test/types/api_types.spec.ts +40 -47
- package/test/utilities.spec.ts +1 -4
- package/webpack.config.js +4 -0
package/dist/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,15 +1012,16 @@ 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
|
|
954
1018
|
var utilities = __webpack_require__(864);
|
|
1019
|
+
// EXTERNAL MODULE: ./src/constants/enums.ts
|
|
1020
|
+
var enums = __webpack_require__(56);
|
|
955
1021
|
;// ./src/constants/default_settings.ts
|
|
956
1022
|
|
|
957
1023
|
|
|
1024
|
+
|
|
958
1025
|
var DefaultSettings = {
|
|
959
1026
|
autocommit: false,
|
|
960
1027
|
autocommitSeconds: 10,
|
|
@@ -964,7 +1031,7 @@ var DefaultSettings = {
|
|
|
964
1031
|
dataCommitFormat: "json",
|
|
965
1032
|
commitRequestDataType: "application/json;charset=UTF-8",
|
|
966
1033
|
autoProgress: false,
|
|
967
|
-
logLevel:
|
|
1034
|
+
logLevel: enums.LogLevelEnum.ERROR,
|
|
968
1035
|
selfReportSessionTime: false,
|
|
969
1036
|
alwaysSendTotalTime: false,
|
|
970
1037
|
renderCommonCommitFields: false,
|
|
@@ -973,9 +1040,9 @@ var DefaultSettings = {
|
|
|
973
1040
|
xhrWithCredentials: false,
|
|
974
1041
|
fetchMode: "cors",
|
|
975
1042
|
responseHandler: function (response) {
|
|
976
|
-
return (0,tslib_es6
|
|
1043
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
977
1044
|
var responseText, httpResult;
|
|
978
|
-
return (0,tslib_es6
|
|
1045
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
979
1046
|
switch (_a.label) {
|
|
980
1047
|
case 0:
|
|
981
1048
|
if (!(typeof response !== "undefined")) return [3, 2];
|
|
@@ -990,13 +1057,13 @@ var DefaultSettings = {
|
|
|
990
1057
|
!{}.hasOwnProperty.call(httpResult, "result")) {
|
|
991
1058
|
if (response.status === 200) {
|
|
992
1059
|
return [2, {
|
|
993
|
-
result: api_constants
|
|
1060
|
+
result: api_constants.global_constants.SCORM_TRUE,
|
|
994
1061
|
errorCode: 0,
|
|
995
1062
|
}];
|
|
996
1063
|
}
|
|
997
1064
|
else {
|
|
998
1065
|
return [2, {
|
|
999
|
-
result: api_constants
|
|
1066
|
+
result: api_constants.global_constants.SCORM_FALSE,
|
|
1000
1067
|
errorCode: 101,
|
|
1001
1068
|
}];
|
|
1002
1069
|
}
|
|
@@ -1006,14 +1073,14 @@ var DefaultSettings = {
|
|
|
1006
1073
|
result: httpResult.result,
|
|
1007
1074
|
errorCode: httpResult.errorCode
|
|
1008
1075
|
? httpResult.errorCode
|
|
1009
|
-
: httpResult.result === api_constants
|
|
1076
|
+
: httpResult.result === api_constants.global_constants.SCORM_TRUE
|
|
1010
1077
|
? 0
|
|
1011
1078
|
: 101,
|
|
1012
1079
|
}];
|
|
1013
1080
|
}
|
|
1014
1081
|
_a.label = 2;
|
|
1015
1082
|
case 2: return [2, {
|
|
1016
|
-
result: api_constants
|
|
1083
|
+
result: api_constants.global_constants.SCORM_FALSE,
|
|
1017
1084
|
errorCode: 101,
|
|
1018
1085
|
}];
|
|
1019
1086
|
}
|
|
@@ -1025,16 +1092,28 @@ var DefaultSettings = {
|
|
|
1025
1092
|
},
|
|
1026
1093
|
onLogMessage: function (messageLevel, logMessage) {
|
|
1027
1094
|
switch (messageLevel) {
|
|
1028
|
-
case
|
|
1095
|
+
case "4":
|
|
1096
|
+
case 4:
|
|
1097
|
+
case "ERROR":
|
|
1098
|
+
case enums.LogLevelEnum.ERROR:
|
|
1029
1099
|
console.error(logMessage);
|
|
1030
1100
|
break;
|
|
1031
|
-
case
|
|
1101
|
+
case "3":
|
|
1102
|
+
case 3:
|
|
1103
|
+
case "WARN":
|
|
1104
|
+
case enums.LogLevelEnum.WARN:
|
|
1032
1105
|
console.warn(logMessage);
|
|
1033
1106
|
break;
|
|
1034
|
-
case
|
|
1107
|
+
case "2":
|
|
1108
|
+
case 2:
|
|
1109
|
+
case "INFO":
|
|
1110
|
+
case enums.LogLevelEnum.INFO:
|
|
1035
1111
|
console.info(logMessage);
|
|
1036
1112
|
break;
|
|
1037
|
-
case
|
|
1113
|
+
case "1":
|
|
1114
|
+
case 1:
|
|
1115
|
+
case "DEBUG":
|
|
1116
|
+
case enums.LogLevelEnum.DEBUG:
|
|
1038
1117
|
if (console.debug) {
|
|
1039
1118
|
console.debug(logMessage);
|
|
1040
1119
|
}
|
|
@@ -1046,6 +1125,7 @@ var DefaultSettings = {
|
|
|
1046
1125
|
},
|
|
1047
1126
|
scoItemIds: [],
|
|
1048
1127
|
scoItemIdValidator: false,
|
|
1128
|
+
globalObjectiveIds: [],
|
|
1049
1129
|
};
|
|
1050
1130
|
|
|
1051
1131
|
;// ./src/helpers/scheduled_commit.ts
|
|
@@ -1066,7 +1146,7 @@ var ScheduledCommit = (function () {
|
|
|
1066
1146
|
ScheduledCommit.prototype.wrapper = function () {
|
|
1067
1147
|
var _this = this;
|
|
1068
1148
|
if (!this._cancelled) {
|
|
1069
|
-
(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) {
|
|
1070
1150
|
switch (_a.label) {
|
|
1071
1151
|
case 0: return [4, this._API.commit(this._callback)];
|
|
1072
1152
|
case 1: return [2, _a.sent()];
|
|
@@ -1094,7 +1174,7 @@ var BaseAPI = (function () {
|
|
|
1094
1174
|
if (_newTarget === BaseAPI) {
|
|
1095
1175
|
throw new TypeError("Cannot construct BaseAPI instances directly");
|
|
1096
1176
|
}
|
|
1097
|
-
this.currentState = api_constants
|
|
1177
|
+
this.currentState = api_constants.global_constants.STATE_NOT_INITIALIZED;
|
|
1098
1178
|
this.lastErrorCode = "0";
|
|
1099
1179
|
this.listenerArray = [];
|
|
1100
1180
|
this._error_codes = error_codes;
|
|
@@ -1103,15 +1183,21 @@ var BaseAPI = (function () {
|
|
|
1103
1183
|
}
|
|
1104
1184
|
this.apiLogLevel = this.settings.logLevel;
|
|
1105
1185
|
this.selfReportSessionTime = this.settings.selfReportSessionTime;
|
|
1186
|
+
if (this.apiLogLevel === undefined) {
|
|
1187
|
+
this.apiLogLevel = enums.LogLevelEnum.NONE;
|
|
1188
|
+
}
|
|
1106
1189
|
}
|
|
1107
1190
|
BaseAPI.prototype.commonReset = function (settings) {
|
|
1108
|
-
this.
|
|
1109
|
-
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;
|
|
1110
1195
|
this.lastErrorCode = "0";
|
|
1111
1196
|
this.listenerArray = [];
|
|
1197
|
+
this.startingData = undefined;
|
|
1112
1198
|
};
|
|
1113
1199
|
BaseAPI.prototype.initialize = function (callbackName, initializeMessage, terminationMessage) {
|
|
1114
|
-
var returnValue = api_constants
|
|
1200
|
+
var returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1115
1201
|
if (this.isInitialized()) {
|
|
1116
1202
|
this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);
|
|
1117
1203
|
}
|
|
@@ -1122,17 +1208,17 @@ var BaseAPI = (function () {
|
|
|
1122
1208
|
if (this.selfReportSessionTime) {
|
|
1123
1209
|
this.cmi.setStartTime();
|
|
1124
1210
|
}
|
|
1125
|
-
this.currentState = api_constants
|
|
1211
|
+
this.currentState = api_constants.global_constants.STATE_INITIALIZED;
|
|
1126
1212
|
this.lastErrorCode = "0";
|
|
1127
|
-
returnValue = api_constants
|
|
1213
|
+
returnValue = api_constants.global_constants.SCORM_TRUE;
|
|
1128
1214
|
this.processListeners(callbackName);
|
|
1129
1215
|
}
|
|
1130
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
1216
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1131
1217
|
this.clearSCORMError(returnValue);
|
|
1132
1218
|
return returnValue;
|
|
1133
1219
|
};
|
|
1134
1220
|
BaseAPI.prototype.apiLog = function (functionName, logMessage, messageLevel, CMIElement) {
|
|
1135
|
-
logMessage = (0,utilities
|
|
1221
|
+
logMessage = (0,utilities.formatMessage)(functionName, logMessage, CMIElement);
|
|
1136
1222
|
if (messageLevel >= this.apiLogLevel) {
|
|
1137
1223
|
this.settings.onLogMessage(messageLevel, logMessage);
|
|
1138
1224
|
}
|
|
@@ -1149,20 +1235,20 @@ var BaseAPI = (function () {
|
|
|
1149
1235
|
return this._settings;
|
|
1150
1236
|
},
|
|
1151
1237
|
set: function (settings) {
|
|
1152
|
-
this._settings = (0,tslib_es6
|
|
1238
|
+
this._settings = (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, this._settings), settings);
|
|
1153
1239
|
},
|
|
1154
1240
|
enumerable: false,
|
|
1155
1241
|
configurable: true
|
|
1156
1242
|
});
|
|
1157
1243
|
BaseAPI.prototype.terminate = function (callbackName, checkTerminated) {
|
|
1158
|
-
return (0,tslib_es6
|
|
1244
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
1159
1245
|
var returnValue, result;
|
|
1160
|
-
return (0,tslib_es6
|
|
1246
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
1161
1247
|
switch (_a.label) {
|
|
1162
1248
|
case 0:
|
|
1163
|
-
returnValue = api_constants
|
|
1249
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1164
1250
|
if (!this.checkState(checkTerminated, this._error_codes.TERMINATION_BEFORE_INIT, this._error_codes.MULTIPLE_TERMINATION)) return [3, 2];
|
|
1165
|
-
this.currentState = api_constants
|
|
1251
|
+
this.currentState = api_constants.global_constants.STATE_TERMINATED;
|
|
1166
1252
|
return [4, this.storeData(true)];
|
|
1167
1253
|
case 1:
|
|
1168
1254
|
result = _a.sent();
|
|
@@ -1172,14 +1258,14 @@ var BaseAPI = (function () {
|
|
|
1172
1258
|
returnValue =
|
|
1173
1259
|
typeof result !== "undefined" && result.result
|
|
1174
1260
|
? result.result
|
|
1175
|
-
: api_constants
|
|
1261
|
+
: api_constants.global_constants.SCORM_FALSE;
|
|
1176
1262
|
if (checkTerminated)
|
|
1177
1263
|
this.lastErrorCode = "0";
|
|
1178
|
-
returnValue = api_constants
|
|
1264
|
+
returnValue = api_constants.global_constants.SCORM_TRUE;
|
|
1179
1265
|
this.processListeners(callbackName);
|
|
1180
1266
|
_a.label = 2;
|
|
1181
1267
|
case 2:
|
|
1182
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
1268
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1183
1269
|
this.clearSCORMError(returnValue);
|
|
1184
1270
|
return [2, returnValue];
|
|
1185
1271
|
}
|
|
@@ -1199,7 +1285,7 @@ var BaseAPI = (function () {
|
|
|
1199
1285
|
}
|
|
1200
1286
|
this.processListeners(callbackName, CMIElement);
|
|
1201
1287
|
}
|
|
1202
|
-
this.apiLog(callbackName, ": returned: " + returnValue,
|
|
1288
|
+
this.apiLog(callbackName, ": returned: " + returnValue, enums.LogLevelEnum.INFO, CMIElement);
|
|
1203
1289
|
if (returnValue === undefined) {
|
|
1204
1290
|
return "";
|
|
1205
1291
|
}
|
|
@@ -1210,7 +1296,7 @@ var BaseAPI = (function () {
|
|
|
1210
1296
|
if (value !== undefined) {
|
|
1211
1297
|
value = String(value);
|
|
1212
1298
|
}
|
|
1213
|
-
var returnValue = api_constants
|
|
1299
|
+
var returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1214
1300
|
if (this.checkState(checkTerminated, this._error_codes.STORE_BEFORE_INIT, this._error_codes.STORE_AFTER_TERM)) {
|
|
1215
1301
|
if (checkTerminated)
|
|
1216
1302
|
this.lastErrorCode = "0";
|
|
@@ -1223,27 +1309,26 @@ var BaseAPI = (function () {
|
|
|
1223
1309
|
this.processListeners(callbackName, CMIElement, value);
|
|
1224
1310
|
}
|
|
1225
1311
|
if (returnValue === undefined) {
|
|
1226
|
-
returnValue = api_constants
|
|
1312
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1227
1313
|
}
|
|
1228
1314
|
if (String(this.lastErrorCode) === "0") {
|
|
1229
1315
|
if (this.settings.autocommit) {
|
|
1230
1316
|
this.scheduleCommit(this.settings.autocommitSeconds * 1000, commitCallback);
|
|
1231
1317
|
}
|
|
1232
1318
|
}
|
|
1233
|
-
this.apiLog(callbackName, ": " + value + ": result: " + returnValue,
|
|
1319
|
+
this.apiLog(callbackName, ": " + value + ": result: " + returnValue, enums.LogLevelEnum.INFO, CMIElement);
|
|
1234
1320
|
this.clearSCORMError(returnValue);
|
|
1235
1321
|
return returnValue;
|
|
1236
1322
|
};
|
|
1237
1323
|
BaseAPI.prototype.commit = function (callbackName_1) {
|
|
1238
|
-
return (0,tslib_es6
|
|
1324
|
+
return (0,tslib_es6.__awaiter)(this, arguments, void 0, function (callbackName, checkTerminated) {
|
|
1239
1325
|
var returnValue, result;
|
|
1240
1326
|
if (checkTerminated === void 0) { checkTerminated = false; }
|
|
1241
|
-
return (0,tslib_es6
|
|
1327
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
1242
1328
|
switch (_a.label) {
|
|
1243
1329
|
case 0:
|
|
1244
|
-
console.log("commit");
|
|
1245
1330
|
this.clearScheduledCommit();
|
|
1246
|
-
returnValue = api_constants
|
|
1331
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1247
1332
|
if (!this.checkState(checkTerminated, this._error_codes.COMMIT_BEFORE_INIT, this._error_codes.COMMIT_AFTER_TERM)) return [3, 2];
|
|
1248
1333
|
return [4, this.storeData(false)];
|
|
1249
1334
|
case 1:
|
|
@@ -1254,14 +1339,14 @@ var BaseAPI = (function () {
|
|
|
1254
1339
|
returnValue =
|
|
1255
1340
|
typeof result !== "undefined" && result.result
|
|
1256
1341
|
? result.result
|
|
1257
|
-
: api_constants
|
|
1258
|
-
this.apiLog(callbackName, " Result: " + returnValue,
|
|
1342
|
+
: api_constants.global_constants.SCORM_FALSE;
|
|
1343
|
+
this.apiLog(callbackName, " Result: " + returnValue, enums.LogLevelEnum.DEBUG, "HttpRequest");
|
|
1259
1344
|
if (checkTerminated)
|
|
1260
1345
|
this.lastErrorCode = "0";
|
|
1261
1346
|
this.processListeners(callbackName);
|
|
1262
1347
|
_a.label = 2;
|
|
1263
1348
|
case 2:
|
|
1264
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
1349
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1265
1350
|
this.clearSCORMError(returnValue);
|
|
1266
1351
|
return [2, returnValue];
|
|
1267
1352
|
}
|
|
@@ -1271,7 +1356,7 @@ var BaseAPI = (function () {
|
|
|
1271
1356
|
BaseAPI.prototype.getLastError = function (callbackName) {
|
|
1272
1357
|
var returnValue = String(this.lastErrorCode);
|
|
1273
1358
|
this.processListeners(callbackName);
|
|
1274
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
1359
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1275
1360
|
return returnValue;
|
|
1276
1361
|
};
|
|
1277
1362
|
BaseAPI.prototype.getErrorString = function (callbackName, CMIErrorCode) {
|
|
@@ -1280,7 +1365,7 @@ var BaseAPI = (function () {
|
|
|
1280
1365
|
returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);
|
|
1281
1366
|
this.processListeners(callbackName);
|
|
1282
1367
|
}
|
|
1283
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
1368
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1284
1369
|
return returnValue;
|
|
1285
1370
|
};
|
|
1286
1371
|
BaseAPI.prototype.getDiagnostic = function (callbackName, CMIErrorCode) {
|
|
@@ -1289,7 +1374,7 @@ var BaseAPI = (function () {
|
|
|
1289
1374
|
returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);
|
|
1290
1375
|
this.processListeners(callbackName);
|
|
1291
1376
|
}
|
|
1292
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
1377
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1293
1378
|
return returnValue;
|
|
1294
1379
|
};
|
|
1295
1380
|
BaseAPI.prototype.checkState = function (checkTerminated, beforeInitError, afterTermError) {
|
|
@@ -1315,11 +1400,11 @@ var BaseAPI = (function () {
|
|
|
1315
1400
|
};
|
|
1316
1401
|
BaseAPI.prototype._commonSetCMIValue = function (methodName, scorm2004, CMIElement, value) {
|
|
1317
1402
|
if (!CMIElement || CMIElement === "") {
|
|
1318
|
-
return api_constants
|
|
1403
|
+
return api_constants.global_constants.SCORM_FALSE;
|
|
1319
1404
|
}
|
|
1320
1405
|
var structure = CMIElement.split(".");
|
|
1321
1406
|
var refObject = this;
|
|
1322
|
-
var returnValue = api_constants
|
|
1407
|
+
var returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1323
1408
|
var foundFirstIndex = false;
|
|
1324
1409
|
var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element.");
|
|
1325
1410
|
var invalidErrorCode = scorm2004
|
|
@@ -1333,20 +1418,20 @@ var BaseAPI = (function () {
|
|
|
1333
1418
|
this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);
|
|
1334
1419
|
}
|
|
1335
1420
|
else {
|
|
1336
|
-
refObject = (0,tslib_es6
|
|
1421
|
+
refObject = (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, refObject), { attribute: value });
|
|
1337
1422
|
}
|
|
1338
1423
|
}
|
|
1339
1424
|
else if (!this._checkObjectHasProperty(refObject, attribute)) {
|
|
1340
1425
|
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
1341
1426
|
}
|
|
1342
1427
|
else {
|
|
1343
|
-
if ((0,utilities
|
|
1428
|
+
if ((0,utilities.stringMatches)(CMIElement, "\\.correct_responses\\.\\d+") &&
|
|
1344
1429
|
this.isInitialized()) {
|
|
1345
1430
|
this.validateCorrectResponse(CMIElement, value);
|
|
1346
1431
|
}
|
|
1347
1432
|
if (!scorm2004 || this.lastErrorCode === "0") {
|
|
1348
1433
|
refObject[attribute] = value;
|
|
1349
|
-
returnValue = api_constants
|
|
1434
|
+
returnValue = api_constants.global_constants.SCORM_TRUE;
|
|
1350
1435
|
}
|
|
1351
1436
|
}
|
|
1352
1437
|
}
|
|
@@ -1356,7 +1441,7 @@ var BaseAPI = (function () {
|
|
|
1356
1441
|
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
1357
1442
|
break;
|
|
1358
1443
|
}
|
|
1359
|
-
if (refObject instanceof array
|
|
1444
|
+
if (refObject instanceof array.CMIArray) {
|
|
1360
1445
|
var index = parseInt(structure[idx + 1], 10);
|
|
1361
1446
|
if (!isNaN(index)) {
|
|
1362
1447
|
var item = refObject.childArray[index];
|
|
@@ -1382,8 +1467,8 @@ var BaseAPI = (function () {
|
|
|
1382
1467
|
}
|
|
1383
1468
|
}
|
|
1384
1469
|
}
|
|
1385
|
-
if (returnValue === api_constants
|
|
1386
|
-
this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value),
|
|
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);
|
|
1387
1472
|
}
|
|
1388
1473
|
return returnValue;
|
|
1389
1474
|
};
|
|
@@ -1425,7 +1510,7 @@ var BaseAPI = (function () {
|
|
|
1425
1510
|
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
1426
1511
|
break;
|
|
1427
1512
|
}
|
|
1428
|
-
if (refObject instanceof array
|
|
1513
|
+
if (refObject instanceof array.CMIArray) {
|
|
1429
1514
|
var index = parseInt(structure[idx + 1], 10);
|
|
1430
1515
|
if (!isNaN(index)) {
|
|
1431
1516
|
var item = refObject.childArray[index];
|
|
@@ -1443,10 +1528,10 @@ var BaseAPI = (function () {
|
|
|
1443
1528
|
if (refObject === null || refObject === undefined) {
|
|
1444
1529
|
if (!scorm2004) {
|
|
1445
1530
|
if (attribute === "_children") {
|
|
1446
|
-
this.throwSCORMError(
|
|
1531
|
+
this.throwSCORMError(this._error_codes.CHILDREN_ERROR);
|
|
1447
1532
|
}
|
|
1448
1533
|
else if (attribute === "_count") {
|
|
1449
|
-
this.throwSCORMError(
|
|
1534
|
+
this.throwSCORMError(this._error_codes.COUNT_ERROR);
|
|
1450
1535
|
}
|
|
1451
1536
|
}
|
|
1452
1537
|
}
|
|
@@ -1455,13 +1540,13 @@ var BaseAPI = (function () {
|
|
|
1455
1540
|
}
|
|
1456
1541
|
};
|
|
1457
1542
|
BaseAPI.prototype.isInitialized = function () {
|
|
1458
|
-
return this.currentState === api_constants
|
|
1543
|
+
return this.currentState === api_constants.global_constants.STATE_INITIALIZED;
|
|
1459
1544
|
};
|
|
1460
1545
|
BaseAPI.prototype.isNotInitialized = function () {
|
|
1461
|
-
return this.currentState === api_constants
|
|
1546
|
+
return this.currentState === api_constants.global_constants.STATE_NOT_INITIALIZED;
|
|
1462
1547
|
};
|
|
1463
1548
|
BaseAPI.prototype.isTerminated = function () {
|
|
1464
|
-
return this.currentState === api_constants
|
|
1549
|
+
return this.currentState === api_constants.global_constants.STATE_TERMINATED;
|
|
1465
1550
|
};
|
|
1466
1551
|
BaseAPI.prototype.on = function (listenerName, callback) {
|
|
1467
1552
|
if (!callback)
|
|
@@ -1481,7 +1566,7 @@ var BaseAPI = (function () {
|
|
|
1481
1566
|
CMIElement: CMIElement,
|
|
1482
1567
|
callback: callback,
|
|
1483
1568
|
});
|
|
1484
|
-
this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length),
|
|
1569
|
+
this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), enums.LogLevelEnum.INFO, functionName);
|
|
1485
1570
|
}
|
|
1486
1571
|
};
|
|
1487
1572
|
BaseAPI.prototype.off = function (listenerName, callback) {
|
|
@@ -1504,7 +1589,7 @@ var BaseAPI = (function () {
|
|
|
1504
1589
|
});
|
|
1505
1590
|
if (removeIndex !== -1) {
|
|
1506
1591
|
this_1.listenerArray.splice(removeIndex, 1);
|
|
1507
|
-
this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length),
|
|
1592
|
+
this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), enums.LogLevelEnum.INFO, functionName);
|
|
1508
1593
|
}
|
|
1509
1594
|
};
|
|
1510
1595
|
var this_1 = this;
|
|
@@ -1537,7 +1622,7 @@ var BaseAPI = (function () {
|
|
|
1537
1622
|
}
|
|
1538
1623
|
};
|
|
1539
1624
|
BaseAPI.prototype.processListeners = function (functionName, CMIElement, value) {
|
|
1540
|
-
this.apiLog(functionName, value,
|
|
1625
|
+
this.apiLog(functionName, value, enums.LogLevelEnum.INFO, CMIElement);
|
|
1541
1626
|
for (var i = 0; i < this.listenerArray.length; i++) {
|
|
1542
1627
|
var listener = this.listenerArray[i];
|
|
1543
1628
|
var functionsMatch = listener.functionName === functionName;
|
|
@@ -1553,7 +1638,7 @@ var BaseAPI = (function () {
|
|
|
1553
1638
|
CMIElementsMatch = listener.CMIElement === CMIElement;
|
|
1554
1639
|
}
|
|
1555
1640
|
if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {
|
|
1556
|
-
this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName),
|
|
1641
|
+
this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), enums.LogLevelEnum.INFO, CMIElement);
|
|
1557
1642
|
listener.callback(CMIElement, value);
|
|
1558
1643
|
}
|
|
1559
1644
|
}
|
|
@@ -1562,11 +1647,11 @@ var BaseAPI = (function () {
|
|
|
1562
1647
|
if (!message) {
|
|
1563
1648
|
message = this.getLmsErrorMessageDetails(errorNumber);
|
|
1564
1649
|
}
|
|
1565
|
-
this.apiLog("throwSCORMError", errorNumber + ": " + message,
|
|
1650
|
+
this.apiLog("throwSCORMError", errorNumber + ": " + message, enums.LogLevelEnum.ERROR);
|
|
1566
1651
|
this.lastErrorCode = String(errorNumber);
|
|
1567
1652
|
};
|
|
1568
1653
|
BaseAPI.prototype.clearSCORMError = function (success) {
|
|
1569
|
-
if (success !== undefined && success !== api_constants
|
|
1654
|
+
if (success !== undefined && success !== api_constants.global_constants.SCORM_FALSE) {
|
|
1570
1655
|
this.lastErrorCode = "0";
|
|
1571
1656
|
}
|
|
1572
1657
|
};
|
|
@@ -1632,7 +1717,7 @@ var BaseAPI = (function () {
|
|
|
1632
1717
|
result.forEach(function (element) {
|
|
1633
1718
|
obj = {};
|
|
1634
1719
|
obj[element[0]] = element[1];
|
|
1635
|
-
_this.loadFromJSON((0,utilities
|
|
1720
|
+
_this.loadFromJSON((0,utilities.unflatten)(obj), CMIElement);
|
|
1636
1721
|
});
|
|
1637
1722
|
};
|
|
1638
1723
|
BaseAPI.prototype.loadFromJSON = function (json, CMIElement) {
|
|
@@ -1672,21 +1757,21 @@ var BaseAPI = (function () {
|
|
|
1672
1757
|
return JSON.parse(this.renderCMIToJSONString());
|
|
1673
1758
|
};
|
|
1674
1759
|
BaseAPI.prototype.processHttpRequest = function (url_1, params_1) {
|
|
1675
|
-
return (0,tslib_es6
|
|
1760
|
+
return (0,tslib_es6.__awaiter)(this, arguments, void 0, function (url, params, immediate) {
|
|
1676
1761
|
var api, genericError, process;
|
|
1677
1762
|
var _this = this;
|
|
1678
1763
|
if (immediate === void 0) { immediate = false; }
|
|
1679
|
-
return (0,tslib_es6
|
|
1764
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
1680
1765
|
switch (_a.label) {
|
|
1681
1766
|
case 0:
|
|
1682
1767
|
api = this;
|
|
1683
1768
|
genericError = {
|
|
1684
|
-
result: api_constants
|
|
1769
|
+
result: api_constants.global_constants.SCORM_FALSE,
|
|
1685
1770
|
errorCode: this.error_codes.GENERAL,
|
|
1686
1771
|
};
|
|
1687
1772
|
if (immediate) {
|
|
1688
|
-
this.performFetch(url, params).then(function (response) { return (0,tslib_es6
|
|
1689
|
-
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) {
|
|
1690
1775
|
switch (_a.label) {
|
|
1691
1776
|
case 0: return [4, this.transformResponse(response)];
|
|
1692
1777
|
case 1:
|
|
@@ -1696,13 +1781,13 @@ var BaseAPI = (function () {
|
|
|
1696
1781
|
});
|
|
1697
1782
|
}); });
|
|
1698
1783
|
return [2, {
|
|
1699
|
-
result: api_constants
|
|
1784
|
+
result: api_constants.global_constants.SCORM_TRUE,
|
|
1700
1785
|
errorCode: 0,
|
|
1701
1786
|
}];
|
|
1702
1787
|
}
|
|
1703
|
-
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 () {
|
|
1704
1789
|
var response, e_1;
|
|
1705
|
-
return (0,tslib_es6
|
|
1790
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
1706
1791
|
switch (_a.label) {
|
|
1707
1792
|
case 0:
|
|
1708
1793
|
_a.trys.push([0, 2, , 3]);
|
|
@@ -1713,7 +1798,7 @@ var BaseAPI = (function () {
|
|
|
1713
1798
|
return [2, this.transformResponse(response)];
|
|
1714
1799
|
case 2:
|
|
1715
1800
|
e_1 = _a.sent();
|
|
1716
|
-
this.apiLog("processHttpRequest", e_1,
|
|
1801
|
+
this.apiLog("processHttpRequest", e_1, enums.LogLevelEnum.ERROR);
|
|
1717
1802
|
api.processListeners("CommitError");
|
|
1718
1803
|
return [2, genericError];
|
|
1719
1804
|
case 3: return [2];
|
|
@@ -1729,14 +1814,14 @@ var BaseAPI = (function () {
|
|
|
1729
1814
|
BaseAPI.prototype.scheduleCommit = function (when, callback) {
|
|
1730
1815
|
if (!this._timeout) {
|
|
1731
1816
|
this._timeout = new ScheduledCommit(this, when, callback);
|
|
1732
|
-
this.apiLog("scheduleCommit", "scheduled",
|
|
1817
|
+
this.apiLog("scheduleCommit", "scheduled", enums.LogLevelEnum.DEBUG, "");
|
|
1733
1818
|
}
|
|
1734
1819
|
};
|
|
1735
1820
|
BaseAPI.prototype.clearScheduledCommit = function () {
|
|
1736
1821
|
if (this._timeout) {
|
|
1737
1822
|
this._timeout.cancel();
|
|
1738
1823
|
this._timeout = undefined;
|
|
1739
|
-
this.apiLog("clearScheduledCommit", "cleared",
|
|
1824
|
+
this.apiLog("clearScheduledCommit", "cleared", enums.LogLevelEnum.DEBUG, "");
|
|
1740
1825
|
}
|
|
1741
1826
|
};
|
|
1742
1827
|
BaseAPI.prototype._checkObjectHasProperty = function (refObject, attribute) {
|
|
@@ -1745,9 +1830,9 @@ var BaseAPI = (function () {
|
|
|
1745
1830
|
attribute in refObject);
|
|
1746
1831
|
};
|
|
1747
1832
|
BaseAPI.prototype.handleValueAccessException = function (e, returnValue) {
|
|
1748
|
-
if (e instanceof exceptions
|
|
1833
|
+
if (e instanceof exceptions.ValidationError) {
|
|
1749
1834
|
this.lastErrorCode = String(e.errorCode);
|
|
1750
|
-
returnValue = api_constants
|
|
1835
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1751
1836
|
}
|
|
1752
1837
|
else {
|
|
1753
1838
|
if (e instanceof Error && e.message) {
|
|
@@ -1765,20 +1850,20 @@ var BaseAPI = (function () {
|
|
|
1765
1850
|
var commitObject = this.settings.renderCommonCommitFields
|
|
1766
1851
|
? this.renderCommitObject(shouldTerminateCommit)
|
|
1767
1852
|
: this.renderCommitCMI(shouldTerminateCommit);
|
|
1768
|
-
if (
|
|
1853
|
+
if ([enums.LogLevelEnum.DEBUG, "1", 1, "DEBUG"].includes(this.apiLogLevel)) {
|
|
1769
1854
|
console.debug("Commit (terminated: " + (terminateCommit ? "yes" : "no") + "): ");
|
|
1770
1855
|
console.debug(commitObject);
|
|
1771
1856
|
}
|
|
1772
1857
|
return commitObject;
|
|
1773
1858
|
};
|
|
1774
1859
|
BaseAPI.prototype.performFetch = function (url, params) {
|
|
1775
|
-
return (0,tslib_es6
|
|
1776
|
-
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) {
|
|
1777
1862
|
return [2, fetch(url, {
|
|
1778
1863
|
method: "POST",
|
|
1779
1864
|
mode: this.settings.fetchMode,
|
|
1780
1865
|
body: params instanceof Array ? params.join("&") : JSON.stringify(params),
|
|
1781
|
-
headers: (0,tslib_es6
|
|
1866
|
+
headers: (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, this.settings.xhrHeaders), { "Content-Type": this.settings.commitRequestDataType }),
|
|
1782
1867
|
credentials: this.settings.xhrWithCredentials ? "include" : undefined,
|
|
1783
1868
|
keepalive: true,
|
|
1784
1869
|
})];
|
|
@@ -1786,9 +1871,9 @@ var BaseAPI = (function () {
|
|
|
1786
1871
|
});
|
|
1787
1872
|
};
|
|
1788
1873
|
BaseAPI.prototype.transformResponse = function (response) {
|
|
1789
|
-
return (0,tslib_es6
|
|
1874
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
1790
1875
|
var result, _a;
|
|
1791
|
-
return (0,tslib_es6
|
|
1876
|
+
return (0,tslib_es6.__generator)(this, function (_c) {
|
|
1792
1877
|
switch (_c.label) {
|
|
1793
1878
|
case 0:
|
|
1794
1879
|
if (!(typeof this.settings.responseHandler === "function")) return [3, 2];
|
|
@@ -1804,8 +1889,7 @@ var BaseAPI = (function () {
|
|
|
1804
1889
|
result = _a;
|
|
1805
1890
|
if (response.status >= 200 &&
|
|
1806
1891
|
response.status <= 299 &&
|
|
1807
|
-
(result.result === true ||
|
|
1808
|
-
result.result === api_constants/* default */.A.global.SCORM_TRUE)) {
|
|
1892
|
+
(result.result === true || result.result === api_constants.global_constants.SCORM_TRUE)) {
|
|
1809
1893
|
this.processListeners("CommitSuccess");
|
|
1810
1894
|
}
|
|
1811
1895
|
else {
|
|
@@ -1826,8 +1910,9 @@ var BaseAPI = (function () {
|
|
|
1826
1910
|
/***/ 941:
|
|
1827
1911
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1828
1912
|
|
|
1913
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1829
1914
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1830
|
-
/* harmony export */
|
|
1915
|
+
/* harmony export */ Scorm12Impl: function() { return /* binding */ Scorm12Impl; }
|
|
1831
1916
|
/* harmony export */ });
|
|
1832
1917
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(635);
|
|
1833
1918
|
/* harmony import */ var _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(989);
|
|
@@ -1837,9 +1922,9 @@ var BaseAPI = (function () {
|
|
|
1837
1922
|
/* harmony import */ var _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(176);
|
|
1838
1923
|
/* harmony import */ var _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(833);
|
|
1839
1924
|
/* harmony import */ var _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(331);
|
|
1840
|
-
/* harmony import */ var
|
|
1841
|
-
/* harmony import */ var
|
|
1842
|
-
/* 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);
|
|
1843
1928
|
|
|
1844
1929
|
|
|
1845
1930
|
|
|
@@ -1853,7 +1938,7 @@ var BaseAPI = (function () {
|
|
|
1853
1938
|
|
|
1854
1939
|
|
|
1855
1940
|
var Scorm12Impl = (function (_super) {
|
|
1856
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1941
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_10__.__extends)(Scorm12Impl, _super);
|
|
1857
1942
|
function Scorm12Impl(settings) {
|
|
1858
1943
|
var _this = this;
|
|
1859
1944
|
if (settings) {
|
|
@@ -1861,10 +1946,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
1861
1946
|
settings.mastery_override = false;
|
|
1862
1947
|
}
|
|
1863
1948
|
}
|
|
1864
|
-
_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;
|
|
1865
1950
|
_this.statusSetByModule = false;
|
|
1866
|
-
_this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
1867
|
-
_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();
|
|
1868
1953
|
_this.LMSInitialize = _this.lmsInitialize;
|
|
1869
1954
|
_this.LMSFinish = _this.lmsFinish;
|
|
1870
1955
|
_this.LMSGetValue = _this.lmsGetValue;
|
|
@@ -1876,9 +1961,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
1876
1961
|
return _this;
|
|
1877
1962
|
}
|
|
1878
1963
|
Scorm12Impl.prototype.reset = function (settings) {
|
|
1964
|
+
var _a, _b;
|
|
1879
1965
|
this.commonReset(settings);
|
|
1880
|
-
this.cmi
|
|
1881
|
-
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();
|
|
1882
1968
|
};
|
|
1883
1969
|
Scorm12Impl.prototype.lmsInitialize = function () {
|
|
1884
1970
|
this.cmi.initialize();
|
|
@@ -1892,8 +1978,8 @@ var Scorm12Impl = (function (_super) {
|
|
|
1892
1978
|
};
|
|
1893
1979
|
Scorm12Impl.prototype.lmsFinish = function () {
|
|
1894
1980
|
var _this = this;
|
|
1895
|
-
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1896
|
-
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) {
|
|
1897
1983
|
switch (_a.label) {
|
|
1898
1984
|
case 0: return [4, this.internalFinish()];
|
|
1899
1985
|
case 1:
|
|
@@ -1902,17 +1988,17 @@ var Scorm12Impl = (function (_super) {
|
|
|
1902
1988
|
}
|
|
1903
1989
|
});
|
|
1904
1990
|
}); })();
|
|
1905
|
-
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
1991
|
+
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE;
|
|
1906
1992
|
};
|
|
1907
1993
|
Scorm12Impl.prototype.internalFinish = function () {
|
|
1908
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1994
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(this, void 0, void 0, function () {
|
|
1909
1995
|
var result;
|
|
1910
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1996
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_a) {
|
|
1911
1997
|
switch (_a.label) {
|
|
1912
1998
|
case 0: return [4, this.terminate("LMSFinish", true)];
|
|
1913
1999
|
case 1:
|
|
1914
2000
|
result = _a.sent();
|
|
1915
|
-
if (result === _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2001
|
+
if (result === _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE) {
|
|
1916
2002
|
if (this.nav.event !== "") {
|
|
1917
2003
|
if (this.nav.event === "continue") {
|
|
1918
2004
|
this.processListeners("SequenceNext");
|
|
@@ -1945,8 +2031,8 @@ var Scorm12Impl = (function (_super) {
|
|
|
1945
2031
|
this.scheduleCommit(500, "LMSCommit");
|
|
1946
2032
|
}
|
|
1947
2033
|
else {
|
|
1948
|
-
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1949
|
-
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) {
|
|
1950
2036
|
switch (_a.label) {
|
|
1951
2037
|
case 0: return [4, this.commit("LMSCommit", false)];
|
|
1952
2038
|
case 1:
|
|
@@ -1956,7 +2042,7 @@ var Scorm12Impl = (function (_super) {
|
|
|
1956
2042
|
});
|
|
1957
2043
|
}); })();
|
|
1958
2044
|
}
|
|
1959
|
-
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2045
|
+
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE;
|
|
1960
2046
|
};
|
|
1961
2047
|
Scorm12Impl.prototype.lmsGetLastError = function () {
|
|
1962
2048
|
return this.getLastError("LMSGetLastError");
|
|
@@ -1974,20 +2060,20 @@ var Scorm12Impl = (function (_super) {
|
|
|
1974
2060
|
return this._commonGetCMIValue("getCMIValue", false, CMIElement);
|
|
1975
2061
|
};
|
|
1976
2062
|
Scorm12Impl.prototype.getChildElement = function (CMIElement, _value, foundFirstIndex) {
|
|
1977
|
-
if ((0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
1978
|
-
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();
|
|
1979
2065
|
}
|
|
1980
2066
|
else if (foundFirstIndex &&
|
|
1981
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
1982
|
-
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();
|
|
1983
2069
|
}
|
|
1984
2070
|
else if (foundFirstIndex &&
|
|
1985
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
1986
|
-
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();
|
|
1987
2073
|
}
|
|
1988
2074
|
else if (!foundFirstIndex &&
|
|
1989
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
1990
|
-
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();
|
|
1991
2077
|
}
|
|
1992
2078
|
return null;
|
|
1993
2079
|
};
|
|
@@ -1997,11 +2083,11 @@ var Scorm12Impl = (function (_super) {
|
|
|
1997
2083
|
var basicMessage = "No Error";
|
|
1998
2084
|
var detailMessage = "No Error";
|
|
1999
2085
|
errorNumber = String(errorNumber);
|
|
2000
|
-
if (_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2086
|
+
if (_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber]) {
|
|
2001
2087
|
basicMessage =
|
|
2002
|
-
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2088
|
+
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber].basicMessage;
|
|
2003
2089
|
detailMessage =
|
|
2004
|
-
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2090
|
+
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber].detailMessage;
|
|
2005
2091
|
}
|
|
2006
2092
|
return detail ? detailMessage : basicMessage;
|
|
2007
2093
|
};
|
|
@@ -2014,10 +2100,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
2014
2100
|
cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();
|
|
2015
2101
|
}
|
|
2016
2102
|
var result = [];
|
|
2017
|
-
var flattened = _utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
2103
|
+
var flattened = _utilities__WEBPACK_IMPORTED_MODULE_1__.flatten(cmiExport);
|
|
2018
2104
|
switch (this.settings.dataCommitFormat) {
|
|
2019
2105
|
case "flattened":
|
|
2020
|
-
return _utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
2106
|
+
return _utilities__WEBPACK_IMPORTED_MODULE_1__.flatten(cmiExport);
|
|
2021
2107
|
case "params":
|
|
2022
2108
|
for (var item in flattened) {
|
|
2023
2109
|
if ({}.hasOwnProperty.call(flattened, item)) {
|
|
@@ -2033,20 +2119,20 @@ var Scorm12Impl = (function (_super) {
|
|
|
2033
2119
|
Scorm12Impl.prototype.renderCommitObject = function (terminateCommit) {
|
|
2034
2120
|
var cmiExport = this.renderCommitCMI(terminateCommit);
|
|
2035
2121
|
var totalTimeHHMMSS = this.cmi.getCurrentTotalTime();
|
|
2036
|
-
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);
|
|
2037
2123
|
var lessonStatus = this.cmi.core.lesson_status;
|
|
2038
|
-
var completionStatus =
|
|
2039
|
-
var successStatus =
|
|
2124
|
+
var completionStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.unknown;
|
|
2125
|
+
var successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.unknown;
|
|
2040
2126
|
if (lessonStatus) {
|
|
2041
2127
|
completionStatus =
|
|
2042
2128
|
lessonStatus === "completed" || lessonStatus === "passed"
|
|
2043
|
-
?
|
|
2044
|
-
:
|
|
2129
|
+
? _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.completed
|
|
2130
|
+
: _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.incomplete;
|
|
2045
2131
|
if (lessonStatus === "passed") {
|
|
2046
|
-
successStatus =
|
|
2132
|
+
successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.passed;
|
|
2047
2133
|
}
|
|
2048
2134
|
else if (lessonStatus === "failed") {
|
|
2049
|
-
successStatus =
|
|
2135
|
+
successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.failed;
|
|
2050
2136
|
}
|
|
2051
2137
|
}
|
|
2052
2138
|
var score = this.cmi.core.score;
|
|
@@ -2075,10 +2161,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
2075
2161
|
return commitObject;
|
|
2076
2162
|
};
|
|
2077
2163
|
Scorm12Impl.prototype.storeData = function (terminateCommit) {
|
|
2078
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
2164
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(this, void 0, void 0, function () {
|
|
2079
2165
|
var originalStatus, commitObject;
|
|
2080
2166
|
var _a, _b, _c;
|
|
2081
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
2167
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_d) {
|
|
2082
2168
|
switch (_d.label) {
|
|
2083
2169
|
case 0:
|
|
2084
2170
|
if (terminateCommit) {
|
|
@@ -2113,7 +2199,7 @@ var Scorm12Impl = (function (_super) {
|
|
|
2113
2199
|
return [4, this.processHttpRequest(this.settings.lmsCommitUrl, commitObject, terminateCommit)];
|
|
2114
2200
|
case 1: return [2, _d.sent()];
|
|
2115
2201
|
case 2: return [2, {
|
|
2116
|
-
result: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2202
|
+
result: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE,
|
|
2117
2203
|
errorCode: 0,
|
|
2118
2204
|
}];
|
|
2119
2205
|
}
|
|
@@ -2121,19 +2207,21 @@ var Scorm12Impl = (function (_super) {
|
|
|
2121
2207
|
});
|
|
2122
2208
|
};
|
|
2123
2209
|
return Scorm12Impl;
|
|
2124
|
-
}(
|
|
2210
|
+
}(_BaseAPI__WEBPACK_IMPORTED_MODULE_8__["default"]));
|
|
2125
2211
|
|
|
2126
2212
|
|
|
2127
2213
|
|
|
2128
2214
|
/***/ }),
|
|
2129
2215
|
|
|
2130
|
-
/***/
|
|
2216
|
+
/***/ 809:
|
|
2131
2217
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2132
2218
|
|
|
2219
|
+
// ESM COMPAT FLAG
|
|
2220
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2133
2221
|
|
|
2134
2222
|
// EXPORTS
|
|
2135
2223
|
__webpack_require__.d(__webpack_exports__, {
|
|
2136
|
-
|
|
2224
|
+
Scorm2004Impl: function() { return /* binding */ Scorm2004Impl; }
|
|
2137
2225
|
});
|
|
2138
2226
|
|
|
2139
2227
|
// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs
|
|
@@ -2148,6 +2236,27 @@ var regex = __webpack_require__(417);
|
|
|
2148
2236
|
var error_codes = __webpack_require__(797);
|
|
2149
2237
|
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
2150
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
|
+
|
|
2151
2260
|
// EXTERNAL MODULE: ./src/utilities.ts
|
|
2152
2261
|
var utilities = __webpack_require__(864);
|
|
2153
2262
|
// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts
|
|
@@ -2159,10 +2268,10 @@ var validation = __webpack_require__(449);
|
|
|
2159
2268
|
|
|
2160
2269
|
|
|
2161
2270
|
function check2004ValidFormat(value, regexPattern, allowEmptyString) {
|
|
2162
|
-
return (0,validation
|
|
2271
|
+
return (0,validation.checkValidFormat)(value, regexPattern, error_codes.scorm2004_errors.TYPE_MISMATCH, Scorm2004ValidationError, allowEmptyString);
|
|
2163
2272
|
}
|
|
2164
2273
|
function check2004ValidRange(value, rangePattern) {
|
|
2165
|
-
return (0,validation
|
|
2274
|
+
return (0,validation.checkValidRange)(value, rangePattern, error_codes.scorm2004_errors.VALUE_OUT_OF_RANGE, Scorm2004ValidationError);
|
|
2166
2275
|
}
|
|
2167
2276
|
|
|
2168
2277
|
;// ./src/cmi/scorm2004/learner_preference.ts
|
|
@@ -2174,22 +2283,25 @@ function check2004ValidRange(value, rangePattern) {
|
|
|
2174
2283
|
|
|
2175
2284
|
|
|
2176
2285
|
var CMILearnerPreference = (function (_super) {
|
|
2177
|
-
(0,tslib_es6
|
|
2286
|
+
(0,tslib_es6.__extends)(CMILearnerPreference, _super);
|
|
2178
2287
|
function CMILearnerPreference() {
|
|
2179
2288
|
var _this = _super.call(this) || this;
|
|
2180
|
-
_this.__children = api_constants
|
|
2289
|
+
_this.__children = api_constants.scorm2004_constants.student_preference_children;
|
|
2181
2290
|
_this._audio_level = "1";
|
|
2182
2291
|
_this._language = "";
|
|
2183
2292
|
_this._delivery_speed = "1";
|
|
2184
2293
|
_this._audio_captioning = "0";
|
|
2185
2294
|
return _this;
|
|
2186
2295
|
}
|
|
2296
|
+
CMILearnerPreference.prototype.reset = function () {
|
|
2297
|
+
this._initialized = false;
|
|
2298
|
+
};
|
|
2187
2299
|
Object.defineProperty(CMILearnerPreference.prototype, "_children", {
|
|
2188
2300
|
get: function () {
|
|
2189
2301
|
return this.__children;
|
|
2190
2302
|
},
|
|
2191
2303
|
set: function (_children) {
|
|
2192
|
-
throw new
|
|
2304
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
2193
2305
|
},
|
|
2194
2306
|
enumerable: false,
|
|
2195
2307
|
configurable: true
|
|
@@ -2199,8 +2311,8 @@ var CMILearnerPreference = (function (_super) {
|
|
|
2199
2311
|
return this._audio_level;
|
|
2200
2312
|
},
|
|
2201
2313
|
set: function (audio_level) {
|
|
2202
|
-
if (check2004ValidFormat(audio_level, regex
|
|
2203
|
-
check2004ValidRange(audio_level, regex
|
|
2314
|
+
if (check2004ValidFormat(audio_level, regex.scorm2004_regex.CMIDecimal) &&
|
|
2315
|
+
check2004ValidRange(audio_level, regex.scorm2004_regex.audio_range)) {
|
|
2204
2316
|
this._audio_level = audio_level;
|
|
2205
2317
|
}
|
|
2206
2318
|
},
|
|
@@ -2212,7 +2324,7 @@ var CMILearnerPreference = (function (_super) {
|
|
|
2212
2324
|
return this._language;
|
|
2213
2325
|
},
|
|
2214
2326
|
set: function (language) {
|
|
2215
|
-
if (check2004ValidFormat(language, regex
|
|
2327
|
+
if (check2004ValidFormat(language, regex.scorm2004_regex.CMILang)) {
|
|
2216
2328
|
this._language = language;
|
|
2217
2329
|
}
|
|
2218
2330
|
},
|
|
@@ -2224,8 +2336,8 @@ var CMILearnerPreference = (function (_super) {
|
|
|
2224
2336
|
return this._delivery_speed;
|
|
2225
2337
|
},
|
|
2226
2338
|
set: function (delivery_speed) {
|
|
2227
|
-
if (check2004ValidFormat(delivery_speed, regex
|
|
2228
|
-
check2004ValidRange(delivery_speed, regex
|
|
2339
|
+
if (check2004ValidFormat(delivery_speed, regex.scorm2004_regex.CMIDecimal) &&
|
|
2340
|
+
check2004ValidRange(delivery_speed, regex.scorm2004_regex.speed_range)) {
|
|
2229
2341
|
this._delivery_speed = delivery_speed;
|
|
2230
2342
|
}
|
|
2231
2343
|
},
|
|
@@ -2237,8 +2349,8 @@ var CMILearnerPreference = (function (_super) {
|
|
|
2237
2349
|
return this._audio_captioning;
|
|
2238
2350
|
},
|
|
2239
2351
|
set: function (audio_captioning) {
|
|
2240
|
-
if (check2004ValidFormat(audio_captioning, regex
|
|
2241
|
-
check2004ValidRange(audio_captioning, regex
|
|
2352
|
+
if (check2004ValidFormat(audio_captioning, regex.scorm2004_regex.CMISInteger) &&
|
|
2353
|
+
check2004ValidRange(audio_captioning, regex.scorm2004_regex.text_range)) {
|
|
2242
2354
|
this._audio_captioning = audio_captioning;
|
|
2243
2355
|
}
|
|
2244
2356
|
},
|
|
@@ -2257,14 +2369,13 @@ var CMILearnerPreference = (function (_super) {
|
|
|
2257
2369
|
return result;
|
|
2258
2370
|
};
|
|
2259
2371
|
return CMILearnerPreference;
|
|
2260
|
-
}(base_cmi
|
|
2372
|
+
}(base_cmi.BaseCMI));
|
|
2261
2373
|
|
|
2262
2374
|
|
|
2263
2375
|
// EXTERNAL MODULE: ./src/cmi/common/array.ts
|
|
2264
2376
|
var array = __webpack_require__(589);
|
|
2265
2377
|
;// ./src/constants/response_constants.ts
|
|
2266
2378
|
|
|
2267
|
-
var scorm2004_regex = regex/* default */.A.scorm2004;
|
|
2268
2379
|
var LearnerResponses = {
|
|
2269
2380
|
"true-false": {
|
|
2270
2381
|
format: "^true$|^false$",
|
|
@@ -2273,59 +2384,59 @@ var LearnerResponses = {
|
|
|
2273
2384
|
unique: false,
|
|
2274
2385
|
},
|
|
2275
2386
|
choice: {
|
|
2276
|
-
format: scorm2004_regex.CMILongIdentifier,
|
|
2387
|
+
format: regex.scorm2004_regex.CMILongIdentifier,
|
|
2277
2388
|
max: 36,
|
|
2278
2389
|
delimiter: "[,]",
|
|
2279
2390
|
unique: true,
|
|
2280
2391
|
},
|
|
2281
2392
|
"fill-in": {
|
|
2282
|
-
format: scorm2004_regex.CMILangString250,
|
|
2393
|
+
format: regex.scorm2004_regex.CMILangString250,
|
|
2283
2394
|
max: 10,
|
|
2284
2395
|
delimiter: "[,]",
|
|
2285
2396
|
unique: false,
|
|
2286
2397
|
},
|
|
2287
2398
|
"long-fill-in": {
|
|
2288
|
-
format: scorm2004_regex.CMILangString4000,
|
|
2399
|
+
format: regex.scorm2004_regex.CMILangString4000,
|
|
2289
2400
|
max: 1,
|
|
2290
2401
|
delimiter: "",
|
|
2291
2402
|
unique: false,
|
|
2292
2403
|
},
|
|
2293
2404
|
matching: {
|
|
2294
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2295
|
-
format2: scorm2004_regex.CMIShortIdentifier,
|
|
2405
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2406
|
+
format2: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2296
2407
|
max: 36,
|
|
2297
2408
|
delimiter: "[,]",
|
|
2298
2409
|
delimiter2: "[.]",
|
|
2299
2410
|
unique: false,
|
|
2300
2411
|
},
|
|
2301
2412
|
performance: {
|
|
2302
|
-
format: "^$|" + scorm2004_regex.CMIShortIdentifier,
|
|
2303
|
-
format2: scorm2004_regex.CMIDecimal + "|^$|" + scorm2004_regex.CMIShortIdentifier,
|
|
2413
|
+
format: "^$|" + regex.scorm2004_regex.CMIShortIdentifier,
|
|
2414
|
+
format2: regex.scorm2004_regex.CMIDecimal + "|^$|" + regex.scorm2004_regex.CMIShortIdentifier,
|
|
2304
2415
|
max: 250,
|
|
2305
2416
|
delimiter: "[,]",
|
|
2306
2417
|
delimiter2: "[.]",
|
|
2307
2418
|
unique: false,
|
|
2308
2419
|
},
|
|
2309
2420
|
sequencing: {
|
|
2310
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2421
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2311
2422
|
max: 36,
|
|
2312
2423
|
delimiter: "[,]",
|
|
2313
2424
|
unique: false,
|
|
2314
2425
|
},
|
|
2315
2426
|
likert: {
|
|
2316
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2427
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2317
2428
|
max: 1,
|
|
2318
2429
|
delimiter: "",
|
|
2319
2430
|
unique: false,
|
|
2320
2431
|
},
|
|
2321
2432
|
numeric: {
|
|
2322
|
-
format: scorm2004_regex.CMIDecimal,
|
|
2433
|
+
format: regex.scorm2004_regex.CMIDecimal,
|
|
2323
2434
|
max: 1,
|
|
2324
2435
|
delimiter: "",
|
|
2325
2436
|
unique: false,
|
|
2326
2437
|
},
|
|
2327
2438
|
other: {
|
|
2328
|
-
format: scorm2004_regex.CMIString4000,
|
|
2439
|
+
format: regex.scorm2004_regex.CMIString4000,
|
|
2329
2440
|
max: 1,
|
|
2330
2441
|
delimiter: "",
|
|
2331
2442
|
unique: false,
|
|
@@ -2345,21 +2456,21 @@ var CorrectResponses = {
|
|
|
2345
2456
|
delimiter: "[,]",
|
|
2346
2457
|
unique: true,
|
|
2347
2458
|
duplicate: false,
|
|
2348
|
-
format: scorm2004_regex.CMILongIdentifier,
|
|
2459
|
+
format: regex.scorm2004_regex.CMILongIdentifier,
|
|
2349
2460
|
},
|
|
2350
2461
|
"fill-in": {
|
|
2351
2462
|
max: 10,
|
|
2352
2463
|
delimiter: "[,]",
|
|
2353
2464
|
unique: false,
|
|
2354
2465
|
duplicate: false,
|
|
2355
|
-
format: scorm2004_regex.CMILangString250cr,
|
|
2466
|
+
format: regex.scorm2004_regex.CMILangString250cr,
|
|
2356
2467
|
},
|
|
2357
2468
|
"long-fill-in": {
|
|
2358
2469
|
max: 1,
|
|
2359
2470
|
delimiter: "",
|
|
2360
2471
|
unique: false,
|
|
2361
2472
|
duplicate: true,
|
|
2362
|
-
format: scorm2004_regex.CMILangString4000,
|
|
2473
|
+
format: regex.scorm2004_regex.CMILangString4000,
|
|
2363
2474
|
},
|
|
2364
2475
|
matching: {
|
|
2365
2476
|
max: 36,
|
|
@@ -2367,8 +2478,8 @@ var CorrectResponses = {
|
|
|
2367
2478
|
delimiter2: "[.]",
|
|
2368
2479
|
unique: false,
|
|
2369
2480
|
duplicate: false,
|
|
2370
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2371
|
-
format2: scorm2004_regex.CMIShortIdentifier,
|
|
2481
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2482
|
+
format2: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2372
2483
|
},
|
|
2373
2484
|
performance: {
|
|
2374
2485
|
max: 250,
|
|
@@ -2377,22 +2488,22 @@ var CorrectResponses = {
|
|
|
2377
2488
|
delimiter3: "[:]",
|
|
2378
2489
|
unique: false,
|
|
2379
2490
|
duplicate: false,
|
|
2380
|
-
format: "^$|" + scorm2004_regex.CMIShortIdentifier,
|
|
2381
|
-
format2: scorm2004_regex.CMIDecimal + "|^$|" + scorm2004_regex.CMIShortIdentifier,
|
|
2491
|
+
format: "^$|" + regex.scorm2004_regex.CMIShortIdentifier,
|
|
2492
|
+
format2: regex.scorm2004_regex.CMIDecimal + "|^$|" + regex.scorm2004_regex.CMIShortIdentifier,
|
|
2382
2493
|
},
|
|
2383
2494
|
sequencing: {
|
|
2384
2495
|
max: 36,
|
|
2385
2496
|
delimiter: "[,]",
|
|
2386
2497
|
unique: false,
|
|
2387
2498
|
duplicate: false,
|
|
2388
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2499
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2389
2500
|
},
|
|
2390
2501
|
likert: {
|
|
2391
2502
|
max: 1,
|
|
2392
2503
|
delimiter: "",
|
|
2393
2504
|
unique: false,
|
|
2394
2505
|
duplicate: false,
|
|
2395
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2506
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2396
2507
|
limit: 1,
|
|
2397
2508
|
},
|
|
2398
2509
|
numeric: {
|
|
@@ -2400,7 +2511,7 @@ var CorrectResponses = {
|
|
|
2400
2511
|
delimiter: "[:]",
|
|
2401
2512
|
unique: false,
|
|
2402
2513
|
duplicate: false,
|
|
2403
|
-
format: scorm2004_regex.CMIDecimal,
|
|
2514
|
+
format: regex.scorm2004_regex.CMIDecimal,
|
|
2404
2515
|
limit: 1,
|
|
2405
2516
|
},
|
|
2406
2517
|
other: {
|
|
@@ -2408,7 +2519,7 @@ var CorrectResponses = {
|
|
|
2408
2519
|
delimiter: "",
|
|
2409
2520
|
unique: false,
|
|
2410
2521
|
duplicate: false,
|
|
2411
|
-
format: scorm2004_regex.CMIString4000,
|
|
2522
|
+
format: regex.scorm2004_regex.CMIString4000,
|
|
2412
2523
|
limit: 1,
|
|
2413
2524
|
},
|
|
2414
2525
|
};
|
|
@@ -2424,19 +2535,19 @@ var CorrectResponses = {
|
|
|
2424
2535
|
|
|
2425
2536
|
|
|
2426
2537
|
var CMIInteractions = (function (_super) {
|
|
2427
|
-
(0,tslib_es6
|
|
2538
|
+
(0,tslib_es6.__extends)(CMIInteractions, _super);
|
|
2428
2539
|
function CMIInteractions() {
|
|
2429
2540
|
return _super.call(this, {
|
|
2430
|
-
children: api_constants
|
|
2431
|
-
errorCode: error_codes
|
|
2432
|
-
errorClass:
|
|
2541
|
+
children: api_constants.scorm2004_constants.interactions_children,
|
|
2542
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2543
|
+
errorClass: Scorm2004ValidationError,
|
|
2433
2544
|
}) || this;
|
|
2434
2545
|
}
|
|
2435
2546
|
return CMIInteractions;
|
|
2436
|
-
}(array
|
|
2547
|
+
}(array.CMIArray));
|
|
2437
2548
|
|
|
2438
2549
|
var CMIInteractionsObject = (function (_super) {
|
|
2439
|
-
(0,tslib_es6
|
|
2550
|
+
(0,tslib_es6.__extends)(CMIInteractionsObject, _super);
|
|
2440
2551
|
function CMIInteractionsObject() {
|
|
2441
2552
|
var _this = _super.call(this) || this;
|
|
2442
2553
|
_this._id = "";
|
|
@@ -2447,15 +2558,15 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2447
2558
|
_this._result = "";
|
|
2448
2559
|
_this._latency = "";
|
|
2449
2560
|
_this._description = "";
|
|
2450
|
-
_this.objectives = new array
|
|
2451
|
-
errorCode: error_codes
|
|
2452
|
-
errorClass:
|
|
2453
|
-
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,
|
|
2454
2565
|
});
|
|
2455
|
-
_this.correct_responses = new array
|
|
2456
|
-
errorCode: error_codes
|
|
2457
|
-
errorClass:
|
|
2458
|
-
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,
|
|
2459
2570
|
});
|
|
2460
2571
|
return _this;
|
|
2461
2572
|
}
|
|
@@ -2465,12 +2576,33 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2465
2576
|
(_a = this.objectives) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
2466
2577
|
(_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.initialize();
|
|
2467
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
|
+
};
|
|
2468
2600
|
Object.defineProperty(CMIInteractionsObject.prototype, "id", {
|
|
2469
2601
|
get: function () {
|
|
2470
2602
|
return this._id;
|
|
2471
2603
|
},
|
|
2472
2604
|
set: function (id) {
|
|
2473
|
-
if (check2004ValidFormat(id, regex
|
|
2605
|
+
if (check2004ValidFormat(id, regex.scorm2004_regex.CMILongIdentifier)) {
|
|
2474
2606
|
this._id = id;
|
|
2475
2607
|
}
|
|
2476
2608
|
},
|
|
@@ -2483,10 +2615,10 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2483
2615
|
},
|
|
2484
2616
|
set: function (type) {
|
|
2485
2617
|
if (this.initialized && this._id === "") {
|
|
2486
|
-
throw new
|
|
2618
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2487
2619
|
}
|
|
2488
2620
|
else {
|
|
2489
|
-
if (check2004ValidFormat(type, regex
|
|
2621
|
+
if (check2004ValidFormat(type, regex.scorm2004_regex.CMIType)) {
|
|
2490
2622
|
this._type = type;
|
|
2491
2623
|
}
|
|
2492
2624
|
}
|
|
@@ -2500,10 +2632,10 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2500
2632
|
},
|
|
2501
2633
|
set: function (timestamp) {
|
|
2502
2634
|
if (this.initialized && this._id === "") {
|
|
2503
|
-
throw new
|
|
2635
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2504
2636
|
}
|
|
2505
2637
|
else {
|
|
2506
|
-
if (check2004ValidFormat(timestamp, regex
|
|
2638
|
+
if (check2004ValidFormat(timestamp, regex.scorm2004_regex.CMITime)) {
|
|
2507
2639
|
this._timestamp = timestamp;
|
|
2508
2640
|
}
|
|
2509
2641
|
}
|
|
@@ -2517,10 +2649,10 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2517
2649
|
},
|
|
2518
2650
|
set: function (weighting) {
|
|
2519
2651
|
if (this.initialized && this._id === "") {
|
|
2520
|
-
throw new
|
|
2652
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2521
2653
|
}
|
|
2522
2654
|
else {
|
|
2523
|
-
if (check2004ValidFormat(weighting, regex
|
|
2655
|
+
if (check2004ValidFormat(weighting, regex.scorm2004_regex.CMIDecimal)) {
|
|
2524
2656
|
this._weighting = weighting;
|
|
2525
2657
|
}
|
|
2526
2658
|
}
|
|
@@ -2534,7 +2666,7 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2534
2666
|
},
|
|
2535
2667
|
set: function (learner_response) {
|
|
2536
2668
|
if (this.initialized && (this._type === "" || this._id === "")) {
|
|
2537
|
-
throw new
|
|
2669
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2538
2670
|
}
|
|
2539
2671
|
else {
|
|
2540
2672
|
var nodes = [];
|
|
@@ -2553,28 +2685,28 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2553
2685
|
var values = nodes[i].split(response_type.delimiter2);
|
|
2554
2686
|
if (values.length === 2) {
|
|
2555
2687
|
if (!values[0].match(formatRegex)) {
|
|
2556
|
-
throw new
|
|
2688
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2557
2689
|
}
|
|
2558
2690
|
else {
|
|
2559
2691
|
if (!response_type.format2 ||
|
|
2560
2692
|
!values[1].match(new RegExp(response_type.format2))) {
|
|
2561
|
-
throw new
|
|
2693
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2562
2694
|
}
|
|
2563
2695
|
}
|
|
2564
2696
|
}
|
|
2565
2697
|
else {
|
|
2566
|
-
throw new
|
|
2698
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2567
2699
|
}
|
|
2568
2700
|
}
|
|
2569
2701
|
else {
|
|
2570
2702
|
if (!nodes[i].match(formatRegex)) {
|
|
2571
|
-
throw new
|
|
2703
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2572
2704
|
}
|
|
2573
2705
|
else {
|
|
2574
2706
|
if (nodes[i] !== "" && response_type.unique) {
|
|
2575
2707
|
for (var j = 0; j < i; j++) {
|
|
2576
2708
|
if (nodes[i] === nodes[j]) {
|
|
2577
|
-
throw new
|
|
2709
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2578
2710
|
}
|
|
2579
2711
|
}
|
|
2580
2712
|
}
|
|
@@ -2583,12 +2715,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2583
2715
|
}
|
|
2584
2716
|
}
|
|
2585
2717
|
else {
|
|
2586
|
-
throw new
|
|
2718
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE);
|
|
2587
2719
|
}
|
|
2588
2720
|
this._learner_response = learner_response;
|
|
2589
2721
|
}
|
|
2590
2722
|
else {
|
|
2591
|
-
throw new
|
|
2723
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2592
2724
|
}
|
|
2593
2725
|
}
|
|
2594
2726
|
},
|
|
@@ -2600,7 +2732,7 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2600
2732
|
return this._result;
|
|
2601
2733
|
},
|
|
2602
2734
|
set: function (result) {
|
|
2603
|
-
if (check2004ValidFormat(result, regex
|
|
2735
|
+
if (check2004ValidFormat(result, regex.scorm2004_regex.CMIResult)) {
|
|
2604
2736
|
this._result = result;
|
|
2605
2737
|
}
|
|
2606
2738
|
},
|
|
@@ -2613,10 +2745,10 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2613
2745
|
},
|
|
2614
2746
|
set: function (latency) {
|
|
2615
2747
|
if (this.initialized && this._id === "") {
|
|
2616
|
-
throw new
|
|
2748
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2617
2749
|
}
|
|
2618
2750
|
else {
|
|
2619
|
-
if (check2004ValidFormat(latency, regex
|
|
2751
|
+
if (check2004ValidFormat(latency, regex.scorm2004_regex.CMITimespan)) {
|
|
2620
2752
|
this._latency = latency;
|
|
2621
2753
|
}
|
|
2622
2754
|
}
|
|
@@ -2630,10 +2762,10 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2630
2762
|
},
|
|
2631
2763
|
set: function (description) {
|
|
2632
2764
|
if (this.initialized && this._id === "") {
|
|
2633
|
-
throw new
|
|
2765
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2634
2766
|
}
|
|
2635
2767
|
else {
|
|
2636
|
-
if (check2004ValidFormat(description, regex
|
|
2768
|
+
if (check2004ValidFormat(description, regex.scorm2004_regex.CMILangString250, true)) {
|
|
2637
2769
|
this._description = description;
|
|
2638
2770
|
}
|
|
2639
2771
|
}
|
|
@@ -2659,21 +2791,25 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2659
2791
|
return result;
|
|
2660
2792
|
};
|
|
2661
2793
|
return CMIInteractionsObject;
|
|
2662
|
-
}(base_cmi
|
|
2794
|
+
}(base_cmi.BaseCMI));
|
|
2663
2795
|
|
|
2664
2796
|
var CMIInteractionsObjectivesObject = (function (_super) {
|
|
2665
|
-
(0,tslib_es6
|
|
2797
|
+
(0,tslib_es6.__extends)(CMIInteractionsObjectivesObject, _super);
|
|
2666
2798
|
function CMIInteractionsObjectivesObject() {
|
|
2667
2799
|
var _this = _super.call(this) || this;
|
|
2668
2800
|
_this._id = "";
|
|
2669
2801
|
return _this;
|
|
2670
2802
|
}
|
|
2803
|
+
CMIInteractionsObjectivesObject.prototype.reset = function () {
|
|
2804
|
+
this._initialized = false;
|
|
2805
|
+
this._id = "";
|
|
2806
|
+
};
|
|
2671
2807
|
Object.defineProperty(CMIInteractionsObjectivesObject.prototype, "id", {
|
|
2672
2808
|
get: function () {
|
|
2673
2809
|
return this._id;
|
|
2674
2810
|
},
|
|
2675
2811
|
set: function (id) {
|
|
2676
|
-
if (check2004ValidFormat(id, regex
|
|
2812
|
+
if (check2004ValidFormat(id, regex.scorm2004_regex.CMILongIdentifier)) {
|
|
2677
2813
|
this._id = id;
|
|
2678
2814
|
}
|
|
2679
2815
|
},
|
|
@@ -2689,21 +2825,25 @@ var CMIInteractionsObjectivesObject = (function (_super) {
|
|
|
2689
2825
|
return result;
|
|
2690
2826
|
};
|
|
2691
2827
|
return CMIInteractionsObjectivesObject;
|
|
2692
|
-
}(base_cmi
|
|
2828
|
+
}(base_cmi.BaseCMI));
|
|
2693
2829
|
|
|
2694
2830
|
var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
2695
|
-
(0,tslib_es6
|
|
2831
|
+
(0,tslib_es6.__extends)(CMIInteractionsCorrectResponsesObject, _super);
|
|
2696
2832
|
function CMIInteractionsCorrectResponsesObject() {
|
|
2697
2833
|
var _this = _super.call(this) || this;
|
|
2698
2834
|
_this._pattern = "";
|
|
2699
2835
|
return _this;
|
|
2700
2836
|
}
|
|
2837
|
+
CMIInteractionsCorrectResponsesObject.prototype.reset = function () {
|
|
2838
|
+
this._initialized = false;
|
|
2839
|
+
this._pattern = "";
|
|
2840
|
+
};
|
|
2701
2841
|
Object.defineProperty(CMIInteractionsCorrectResponsesObject.prototype, "pattern", {
|
|
2702
2842
|
get: function () {
|
|
2703
2843
|
return this._pattern;
|
|
2704
2844
|
},
|
|
2705
2845
|
set: function (pattern) {
|
|
2706
|
-
if (check2004ValidFormat(pattern, regex
|
|
2846
|
+
if (check2004ValidFormat(pattern, regex.scorm2004_regex.CMIFeedback)) {
|
|
2707
2847
|
this._pattern = pattern;
|
|
2708
2848
|
}
|
|
2709
2849
|
},
|
|
@@ -2719,7 +2859,7 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
2719
2859
|
return result;
|
|
2720
2860
|
};
|
|
2721
2861
|
return CMIInteractionsCorrectResponsesObject;
|
|
2722
|
-
}(base_cmi
|
|
2862
|
+
}(base_cmi.BaseCMI));
|
|
2723
2863
|
|
|
2724
2864
|
|
|
2725
2865
|
// EXTERNAL MODULE: ./src/cmi/common/score.ts
|
|
@@ -2733,27 +2873,34 @@ var score = __webpack_require__(434);
|
|
|
2733
2873
|
|
|
2734
2874
|
|
|
2735
2875
|
var Scorm2004CMIScore = (function (_super) {
|
|
2736
|
-
(0,tslib_es6
|
|
2876
|
+
(0,tslib_es6.__extends)(Scorm2004CMIScore, _super);
|
|
2737
2877
|
function Scorm2004CMIScore() {
|
|
2738
2878
|
var _this = _super.call(this, {
|
|
2739
|
-
score_children: api_constants
|
|
2879
|
+
score_children: api_constants.scorm2004_constants.score_children,
|
|
2740
2880
|
max: "",
|
|
2741
|
-
invalidErrorCode: error_codes
|
|
2742
|
-
invalidTypeCode: error_codes
|
|
2743
|
-
invalidRangeCode: error_codes
|
|
2744
|
-
decimalRegex: regex
|
|
2745
|
-
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,
|
|
2746
2886
|
}) || this;
|
|
2747
2887
|
_this._scaled = "";
|
|
2748
2888
|
return _this;
|
|
2749
2889
|
}
|
|
2890
|
+
Scorm2004CMIScore.prototype.reset = function () {
|
|
2891
|
+
this._initialized = false;
|
|
2892
|
+
this._scaled = "";
|
|
2893
|
+
this._raw = "";
|
|
2894
|
+
this._min = "";
|
|
2895
|
+
this._max = "";
|
|
2896
|
+
};
|
|
2750
2897
|
Object.defineProperty(Scorm2004CMIScore.prototype, "scaled", {
|
|
2751
2898
|
get: function () {
|
|
2752
2899
|
return this._scaled;
|
|
2753
2900
|
},
|
|
2754
2901
|
set: function (scaled) {
|
|
2755
|
-
if (check2004ValidFormat(scaled, regex
|
|
2756
|
-
check2004ValidRange(scaled, regex
|
|
2902
|
+
if (check2004ValidFormat(scaled, regex.scorm2004_regex.CMIDecimal) &&
|
|
2903
|
+
check2004ValidRange(scaled, regex.scorm2004_regex.scaled_range)) {
|
|
2757
2904
|
this._scaled = scaled;
|
|
2758
2905
|
}
|
|
2759
2906
|
},
|
|
@@ -2772,7 +2919,7 @@ var Scorm2004CMIScore = (function (_super) {
|
|
|
2772
2919
|
return result;
|
|
2773
2920
|
};
|
|
2774
2921
|
return Scorm2004CMIScore;
|
|
2775
|
-
}(score
|
|
2922
|
+
}(score.CMIScore));
|
|
2776
2923
|
|
|
2777
2924
|
|
|
2778
2925
|
;// ./src/cmi/scorm2004/comments.ts
|
|
@@ -2785,31 +2932,31 @@ var Scorm2004CMIScore = (function (_super) {
|
|
|
2785
2932
|
|
|
2786
2933
|
|
|
2787
2934
|
var CMICommentsFromLMS = (function (_super) {
|
|
2788
|
-
(0,tslib_es6
|
|
2935
|
+
(0,tslib_es6.__extends)(CMICommentsFromLMS, _super);
|
|
2789
2936
|
function CMICommentsFromLMS() {
|
|
2790
2937
|
return _super.call(this, {
|
|
2791
|
-
children: api_constants
|
|
2792
|
-
errorCode: error_codes
|
|
2793
|
-
errorClass:
|
|
2938
|
+
children: api_constants.scorm2004_constants.comments_children,
|
|
2939
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2940
|
+
errorClass: Scorm2004ValidationError,
|
|
2794
2941
|
}) || this;
|
|
2795
2942
|
}
|
|
2796
2943
|
return CMICommentsFromLMS;
|
|
2797
|
-
}(array
|
|
2944
|
+
}(array.CMIArray));
|
|
2798
2945
|
|
|
2799
2946
|
var CMICommentsFromLearner = (function (_super) {
|
|
2800
|
-
(0,tslib_es6
|
|
2947
|
+
(0,tslib_es6.__extends)(CMICommentsFromLearner, _super);
|
|
2801
2948
|
function CMICommentsFromLearner() {
|
|
2802
2949
|
return _super.call(this, {
|
|
2803
|
-
children: api_constants
|
|
2804
|
-
errorCode: error_codes
|
|
2805
|
-
errorClass:
|
|
2950
|
+
children: api_constants.scorm2004_constants.comments_children,
|
|
2951
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2952
|
+
errorClass: Scorm2004ValidationError,
|
|
2806
2953
|
}) || this;
|
|
2807
2954
|
}
|
|
2808
2955
|
return CMICommentsFromLearner;
|
|
2809
|
-
}(array
|
|
2956
|
+
}(array.CMIArray));
|
|
2810
2957
|
|
|
2811
2958
|
var CMICommentsObject = (function (_super) {
|
|
2812
|
-
(0,tslib_es6
|
|
2959
|
+
(0,tslib_es6.__extends)(CMICommentsObject, _super);
|
|
2813
2960
|
function CMICommentsObject(readOnlyAfterInit) {
|
|
2814
2961
|
if (readOnlyAfterInit === void 0) { readOnlyAfterInit = false; }
|
|
2815
2962
|
var _this = _super.call(this) || this;
|
|
@@ -2822,16 +2969,19 @@ var CMICommentsObject = (function (_super) {
|
|
|
2822
2969
|
_this._readOnlyAfterInit = readOnlyAfterInit;
|
|
2823
2970
|
return _this;
|
|
2824
2971
|
}
|
|
2972
|
+
CMICommentsObject.prototype.reset = function () {
|
|
2973
|
+
this._initialized = false;
|
|
2974
|
+
};
|
|
2825
2975
|
Object.defineProperty(CMICommentsObject.prototype, "comment", {
|
|
2826
2976
|
get: function () {
|
|
2827
2977
|
return this._comment;
|
|
2828
2978
|
},
|
|
2829
2979
|
set: function (comment) {
|
|
2830
2980
|
if (this.initialized && this._readOnlyAfterInit) {
|
|
2831
|
-
throw new
|
|
2981
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
2832
2982
|
}
|
|
2833
2983
|
else {
|
|
2834
|
-
if (check2004ValidFormat(comment, regex
|
|
2984
|
+
if (check2004ValidFormat(comment, regex.scorm2004_regex.CMILangString4000, true)) {
|
|
2835
2985
|
this._comment = comment;
|
|
2836
2986
|
}
|
|
2837
2987
|
}
|
|
@@ -2845,10 +2995,10 @@ var CMICommentsObject = (function (_super) {
|
|
|
2845
2995
|
},
|
|
2846
2996
|
set: function (location) {
|
|
2847
2997
|
if (this.initialized && this._readOnlyAfterInit) {
|
|
2848
|
-
throw new
|
|
2998
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
2849
2999
|
}
|
|
2850
3000
|
else {
|
|
2851
|
-
if (check2004ValidFormat(location, regex
|
|
3001
|
+
if (check2004ValidFormat(location, regex.scorm2004_regex.CMIString250)) {
|
|
2852
3002
|
this._location = location;
|
|
2853
3003
|
}
|
|
2854
3004
|
}
|
|
@@ -2862,10 +3012,10 @@ var CMICommentsObject = (function (_super) {
|
|
|
2862
3012
|
},
|
|
2863
3013
|
set: function (timestamp) {
|
|
2864
3014
|
if (this.initialized && this._readOnlyAfterInit) {
|
|
2865
|
-
throw new
|
|
3015
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
2866
3016
|
}
|
|
2867
3017
|
else {
|
|
2868
|
-
if (check2004ValidFormat(timestamp, regex
|
|
3018
|
+
if (check2004ValidFormat(timestamp, regex.scorm2004_regex.CMITime)) {
|
|
2869
3019
|
this._timestamp = timestamp;
|
|
2870
3020
|
}
|
|
2871
3021
|
}
|
|
@@ -2884,7 +3034,7 @@ var CMICommentsObject = (function (_super) {
|
|
|
2884
3034
|
return result;
|
|
2885
3035
|
};
|
|
2886
3036
|
return CMICommentsObject;
|
|
2887
|
-
}(base_cmi
|
|
3037
|
+
}(base_cmi.BaseCMI));
|
|
2888
3038
|
|
|
2889
3039
|
|
|
2890
3040
|
;// ./src/cmi/scorm2004/objectives.ts
|
|
@@ -2898,19 +3048,28 @@ var CMICommentsObject = (function (_super) {
|
|
|
2898
3048
|
|
|
2899
3049
|
|
|
2900
3050
|
var CMIObjectives = (function (_super) {
|
|
2901
|
-
(0,tslib_es6
|
|
3051
|
+
(0,tslib_es6.__extends)(CMIObjectives, _super);
|
|
2902
3052
|
function CMIObjectives() {
|
|
2903
3053
|
return _super.call(this, {
|
|
2904
|
-
children: api_constants
|
|
2905
|
-
errorCode: error_codes
|
|
2906
|
-
errorClass:
|
|
3054
|
+
children: api_constants.scorm2004_constants.objectives_children,
|
|
3055
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
3056
|
+
errorClass: Scorm2004ValidationError,
|
|
2907
3057
|
}) || this;
|
|
2908
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
|
+
};
|
|
2909
3068
|
return CMIObjectives;
|
|
2910
|
-
}(array
|
|
3069
|
+
}(array.CMIArray));
|
|
2911
3070
|
|
|
2912
3071
|
var CMIObjectivesObject = (function (_super) {
|
|
2913
|
-
(0,tslib_es6
|
|
3072
|
+
(0,tslib_es6.__extends)(CMIObjectivesObject, _super);
|
|
2914
3073
|
function CMIObjectivesObject() {
|
|
2915
3074
|
var _this = _super.call(this) || this;
|
|
2916
3075
|
_this._id = "";
|
|
@@ -2921,6 +3080,9 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2921
3080
|
_this.score = new Scorm2004CMIScore();
|
|
2922
3081
|
return _this;
|
|
2923
3082
|
}
|
|
3083
|
+
CMIObjectivesObject.prototype.reset = function () {
|
|
3084
|
+
this._initialized = false;
|
|
3085
|
+
};
|
|
2924
3086
|
CMIObjectivesObject.prototype.initialize = function () {
|
|
2925
3087
|
var _a;
|
|
2926
3088
|
_super.prototype.initialize.call(this);
|
|
@@ -2931,7 +3093,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2931
3093
|
return this._id;
|
|
2932
3094
|
},
|
|
2933
3095
|
set: function (id) {
|
|
2934
|
-
if (check2004ValidFormat(id, regex
|
|
3096
|
+
if (check2004ValidFormat(id, regex.scorm2004_regex.CMILongIdentifier)) {
|
|
2935
3097
|
this._id = id;
|
|
2936
3098
|
}
|
|
2937
3099
|
},
|
|
@@ -2944,10 +3106,10 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2944
3106
|
},
|
|
2945
3107
|
set: function (success_status) {
|
|
2946
3108
|
if (this.initialized && this._id === "") {
|
|
2947
|
-
throw new
|
|
3109
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2948
3110
|
}
|
|
2949
3111
|
else {
|
|
2950
|
-
if (check2004ValidFormat(success_status, regex
|
|
3112
|
+
if (check2004ValidFormat(success_status, regex.scorm2004_regex.CMISStatus)) {
|
|
2951
3113
|
this._success_status = success_status;
|
|
2952
3114
|
}
|
|
2953
3115
|
}
|
|
@@ -2961,10 +3123,10 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2961
3123
|
},
|
|
2962
3124
|
set: function (completion_status) {
|
|
2963
3125
|
if (this.initialized && this._id === "") {
|
|
2964
|
-
throw new
|
|
3126
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2965
3127
|
}
|
|
2966
3128
|
else {
|
|
2967
|
-
if (check2004ValidFormat(completion_status, regex
|
|
3129
|
+
if (check2004ValidFormat(completion_status, regex.scorm2004_regex.CMICStatus)) {
|
|
2968
3130
|
this._completion_status = completion_status;
|
|
2969
3131
|
}
|
|
2970
3132
|
}
|
|
@@ -2978,11 +3140,11 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2978
3140
|
},
|
|
2979
3141
|
set: function (progress_measure) {
|
|
2980
3142
|
if (this.initialized && this._id === "") {
|
|
2981
|
-
throw new
|
|
3143
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2982
3144
|
}
|
|
2983
3145
|
else {
|
|
2984
|
-
if (check2004ValidFormat(progress_measure, regex
|
|
2985
|
-
check2004ValidRange(progress_measure, regex
|
|
3146
|
+
if (check2004ValidFormat(progress_measure, regex.scorm2004_regex.CMIDecimal) &&
|
|
3147
|
+
check2004ValidRange(progress_measure, regex.scorm2004_regex.progress_range)) {
|
|
2986
3148
|
this._progress_measure = progress_measure;
|
|
2987
3149
|
}
|
|
2988
3150
|
}
|
|
@@ -2996,10 +3158,10 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2996
3158
|
},
|
|
2997
3159
|
set: function (description) {
|
|
2998
3160
|
if (this.initialized && this._id === "") {
|
|
2999
|
-
throw new
|
|
3161
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
3000
3162
|
}
|
|
3001
3163
|
else {
|
|
3002
|
-
if (check2004ValidFormat(description, regex
|
|
3164
|
+
if (check2004ValidFormat(description, regex.scorm2004_regex.CMILangString250, true)) {
|
|
3003
3165
|
this._description = description;
|
|
3004
3166
|
}
|
|
3005
3167
|
}
|
|
@@ -3021,7 +3183,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
3021
3183
|
return result;
|
|
3022
3184
|
};
|
|
3023
3185
|
return CMIObjectivesObject;
|
|
3024
|
-
}(base_cmi
|
|
3186
|
+
}(base_cmi.BaseCMI));
|
|
3025
3187
|
|
|
3026
3188
|
|
|
3027
3189
|
;// ./src/cmi/scorm2004/cmi.ts
|
|
@@ -3039,12 +3201,12 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
3039
3201
|
|
|
3040
3202
|
|
|
3041
3203
|
var CMI = (function (_super) {
|
|
3042
|
-
(0,tslib_es6
|
|
3204
|
+
(0,tslib_es6.__extends)(CMI, _super);
|
|
3043
3205
|
function CMI(initialized) {
|
|
3044
3206
|
if (initialized === void 0) { initialized = false; }
|
|
3045
3207
|
var _this = _super.call(this) || this;
|
|
3046
3208
|
_this.__version = "1.0";
|
|
3047
|
-
_this.__children = api_constants
|
|
3209
|
+
_this.__children = api_constants.scorm2004_constants.cmi_children;
|
|
3048
3210
|
_this._completion_status = "unknown";
|
|
3049
3211
|
_this._completion_threshold = "";
|
|
3050
3212
|
_this._credit = "credit";
|
|
@@ -3083,12 +3245,27 @@ var CMI = (function (_super) {
|
|
|
3083
3245
|
(_e = this.interactions) === null || _e === void 0 ? void 0 : _e.initialize();
|
|
3084
3246
|
(_f = this.objectives) === null || _f === void 0 ? void 0 : _f.initialize();
|
|
3085
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
|
+
};
|
|
3086
3263
|
Object.defineProperty(CMI.prototype, "_version", {
|
|
3087
3264
|
get: function () {
|
|
3088
3265
|
return this.__version;
|
|
3089
3266
|
},
|
|
3090
3267
|
set: function (_version) {
|
|
3091
|
-
throw new
|
|
3268
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3092
3269
|
},
|
|
3093
3270
|
enumerable: false,
|
|
3094
3271
|
configurable: true
|
|
@@ -3098,7 +3275,7 @@ var CMI = (function (_super) {
|
|
|
3098
3275
|
return this.__children;
|
|
3099
3276
|
},
|
|
3100
3277
|
set: function (_children) {
|
|
3101
|
-
throw new
|
|
3278
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3102
3279
|
},
|
|
3103
3280
|
enumerable: false,
|
|
3104
3281
|
configurable: true
|
|
@@ -3108,7 +3285,7 @@ var CMI = (function (_super) {
|
|
|
3108
3285
|
return this._completion_status;
|
|
3109
3286
|
},
|
|
3110
3287
|
set: function (completion_status) {
|
|
3111
|
-
if (check2004ValidFormat(completion_status, regex
|
|
3288
|
+
if (check2004ValidFormat(completion_status, regex.scorm2004_regex.CMICStatus)) {
|
|
3112
3289
|
this._completion_status = completion_status;
|
|
3113
3290
|
}
|
|
3114
3291
|
},
|
|
@@ -3121,7 +3298,7 @@ var CMI = (function (_super) {
|
|
|
3121
3298
|
},
|
|
3122
3299
|
set: function (completion_threshold) {
|
|
3123
3300
|
if (this.initialized) {
|
|
3124
|
-
throw new
|
|
3301
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3125
3302
|
}
|
|
3126
3303
|
else {
|
|
3127
3304
|
this._completion_threshold = completion_threshold;
|
|
@@ -3136,7 +3313,7 @@ var CMI = (function (_super) {
|
|
|
3136
3313
|
},
|
|
3137
3314
|
set: function (credit) {
|
|
3138
3315
|
if (this.initialized) {
|
|
3139
|
-
throw new
|
|
3316
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3140
3317
|
}
|
|
3141
3318
|
else {
|
|
3142
3319
|
this._credit = credit;
|
|
@@ -3151,7 +3328,7 @@ var CMI = (function (_super) {
|
|
|
3151
3328
|
},
|
|
3152
3329
|
set: function (entry) {
|
|
3153
3330
|
if (this.initialized) {
|
|
3154
|
-
throw new
|
|
3331
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3155
3332
|
}
|
|
3156
3333
|
else {
|
|
3157
3334
|
this._entry = entry;
|
|
@@ -3163,12 +3340,12 @@ var CMI = (function (_super) {
|
|
|
3163
3340
|
Object.defineProperty(CMI.prototype, "exit", {
|
|
3164
3341
|
get: function () {
|
|
3165
3342
|
if (!this.jsonString) {
|
|
3166
|
-
throw new
|
|
3343
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.WRITE_ONLY_ELEMENT);
|
|
3167
3344
|
}
|
|
3168
3345
|
return this._exit;
|
|
3169
3346
|
},
|
|
3170
3347
|
set: function (exit) {
|
|
3171
|
-
if (check2004ValidFormat(exit, regex
|
|
3348
|
+
if (check2004ValidFormat(exit, regex.scorm2004_regex.CMIExit, true)) {
|
|
3172
3349
|
this._exit = exit;
|
|
3173
3350
|
}
|
|
3174
3351
|
},
|
|
@@ -3181,7 +3358,7 @@ var CMI = (function (_super) {
|
|
|
3181
3358
|
},
|
|
3182
3359
|
set: function (launch_data) {
|
|
3183
3360
|
if (this.initialized) {
|
|
3184
|
-
throw new
|
|
3361
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3185
3362
|
}
|
|
3186
3363
|
else {
|
|
3187
3364
|
this._launch_data = launch_data;
|
|
@@ -3196,7 +3373,7 @@ var CMI = (function (_super) {
|
|
|
3196
3373
|
},
|
|
3197
3374
|
set: function (learner_id) {
|
|
3198
3375
|
if (this.initialized) {
|
|
3199
|
-
throw new
|
|
3376
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3200
3377
|
}
|
|
3201
3378
|
else {
|
|
3202
3379
|
this._learner_id = learner_id;
|
|
@@ -3211,7 +3388,7 @@ var CMI = (function (_super) {
|
|
|
3211
3388
|
},
|
|
3212
3389
|
set: function (learner_name) {
|
|
3213
3390
|
if (this.initialized) {
|
|
3214
|
-
throw new
|
|
3391
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3215
3392
|
}
|
|
3216
3393
|
else {
|
|
3217
3394
|
this._learner_name = learner_name;
|
|
@@ -3225,7 +3402,7 @@ var CMI = (function (_super) {
|
|
|
3225
3402
|
return this._location;
|
|
3226
3403
|
},
|
|
3227
3404
|
set: function (location) {
|
|
3228
|
-
if (check2004ValidFormat(location, regex
|
|
3405
|
+
if (check2004ValidFormat(location, regex.scorm2004_regex.CMIString1000)) {
|
|
3229
3406
|
this._location = location;
|
|
3230
3407
|
}
|
|
3231
3408
|
},
|
|
@@ -3238,7 +3415,7 @@ var CMI = (function (_super) {
|
|
|
3238
3415
|
},
|
|
3239
3416
|
set: function (max_time_allowed) {
|
|
3240
3417
|
if (this.initialized) {
|
|
3241
|
-
throw new
|
|
3418
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3242
3419
|
}
|
|
3243
3420
|
else {
|
|
3244
3421
|
this._max_time_allowed = max_time_allowed;
|
|
@@ -3253,7 +3430,7 @@ var CMI = (function (_super) {
|
|
|
3253
3430
|
},
|
|
3254
3431
|
set: function (mode) {
|
|
3255
3432
|
if (this.initialized) {
|
|
3256
|
-
throw new
|
|
3433
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3257
3434
|
}
|
|
3258
3435
|
else {
|
|
3259
3436
|
this._mode = mode;
|
|
@@ -3267,8 +3444,8 @@ var CMI = (function (_super) {
|
|
|
3267
3444
|
return this._progress_measure;
|
|
3268
3445
|
},
|
|
3269
3446
|
set: function (progress_measure) {
|
|
3270
|
-
if (check2004ValidFormat(progress_measure, regex
|
|
3271
|
-
check2004ValidRange(progress_measure, regex
|
|
3447
|
+
if (check2004ValidFormat(progress_measure, regex.scorm2004_regex.CMIDecimal) &&
|
|
3448
|
+
check2004ValidRange(progress_measure, regex.scorm2004_regex.progress_range)) {
|
|
3272
3449
|
this._progress_measure = progress_measure;
|
|
3273
3450
|
}
|
|
3274
3451
|
},
|
|
@@ -3281,7 +3458,7 @@ var CMI = (function (_super) {
|
|
|
3281
3458
|
},
|
|
3282
3459
|
set: function (scaled_passing_score) {
|
|
3283
3460
|
if (this.initialized) {
|
|
3284
|
-
throw new
|
|
3461
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3285
3462
|
}
|
|
3286
3463
|
else {
|
|
3287
3464
|
this._scaled_passing_score = scaled_passing_score;
|
|
@@ -3293,12 +3470,12 @@ var CMI = (function (_super) {
|
|
|
3293
3470
|
Object.defineProperty(CMI.prototype, "session_time", {
|
|
3294
3471
|
get: function () {
|
|
3295
3472
|
if (!this.jsonString) {
|
|
3296
|
-
throw new
|
|
3473
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.WRITE_ONLY_ELEMENT);
|
|
3297
3474
|
}
|
|
3298
3475
|
return this._session_time;
|
|
3299
3476
|
},
|
|
3300
3477
|
set: function (session_time) {
|
|
3301
|
-
if (check2004ValidFormat(session_time, regex
|
|
3478
|
+
if (check2004ValidFormat(session_time, regex.scorm2004_regex.CMITimespan)) {
|
|
3302
3479
|
this._session_time = session_time;
|
|
3303
3480
|
}
|
|
3304
3481
|
},
|
|
@@ -3310,7 +3487,7 @@ var CMI = (function (_super) {
|
|
|
3310
3487
|
return this._success_status;
|
|
3311
3488
|
},
|
|
3312
3489
|
set: function (success_status) {
|
|
3313
|
-
if (check2004ValidFormat(success_status, regex
|
|
3490
|
+
if (check2004ValidFormat(success_status, regex.scorm2004_regex.CMISStatus)) {
|
|
3314
3491
|
this._success_status = success_status;
|
|
3315
3492
|
}
|
|
3316
3493
|
},
|
|
@@ -3322,7 +3499,7 @@ var CMI = (function (_super) {
|
|
|
3322
3499
|
return this._suspend_data;
|
|
3323
3500
|
},
|
|
3324
3501
|
set: function (suspend_data) {
|
|
3325
|
-
if (check2004ValidFormat(suspend_data, regex
|
|
3502
|
+
if (check2004ValidFormat(suspend_data, regex.scorm2004_regex.CMIString64000, true)) {
|
|
3326
3503
|
this._suspend_data = suspend_data;
|
|
3327
3504
|
}
|
|
3328
3505
|
},
|
|
@@ -3335,7 +3512,7 @@ var CMI = (function (_super) {
|
|
|
3335
3512
|
},
|
|
3336
3513
|
set: function (time_limit_action) {
|
|
3337
3514
|
if (this.initialized) {
|
|
3338
|
-
throw new
|
|
3515
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3339
3516
|
}
|
|
3340
3517
|
else {
|
|
3341
3518
|
this._time_limit_action = time_limit_action;
|
|
@@ -3350,7 +3527,7 @@ var CMI = (function (_super) {
|
|
|
3350
3527
|
},
|
|
3351
3528
|
set: function (total_time) {
|
|
3352
3529
|
if (this.initialized) {
|
|
3353
|
-
throw new
|
|
3530
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3354
3531
|
}
|
|
3355
3532
|
else {
|
|
3356
3533
|
this._total_time = total_time;
|
|
@@ -3364,9 +3541,9 @@ var CMI = (function (_super) {
|
|
|
3364
3541
|
var startTime = this.start_time;
|
|
3365
3542
|
if (typeof startTime !== "undefined" && startTime !== null) {
|
|
3366
3543
|
var seconds = new Date().getTime() - startTime;
|
|
3367
|
-
sessionTime = utilities
|
|
3544
|
+
sessionTime = utilities.getSecondsAsISODuration(seconds / 1000);
|
|
3368
3545
|
}
|
|
3369
|
-
return utilities
|
|
3546
|
+
return utilities.addTwoDurations(this._total_time, sessionTime, regex.scorm2004_regex.CMITimespan);
|
|
3370
3547
|
};
|
|
3371
3548
|
CMI.prototype.toJSON = function () {
|
|
3372
3549
|
this.jsonString = true;
|
|
@@ -3399,7 +3576,7 @@ var CMI = (function (_super) {
|
|
|
3399
3576
|
return result;
|
|
3400
3577
|
};
|
|
3401
3578
|
return CMI;
|
|
3402
|
-
}(base_cmi
|
|
3579
|
+
}(base_cmi.BaseRootCMI));
|
|
3403
3580
|
|
|
3404
3581
|
|
|
3405
3582
|
;// ./src/constants/language_constants.ts
|
|
@@ -3808,11 +3985,15 @@ var enums = __webpack_require__(56);
|
|
|
3808
3985
|
|
|
3809
3986
|
|
|
3810
3987
|
|
|
3988
|
+
|
|
3989
|
+
|
|
3811
3990
|
var ADL = (function (_super) {
|
|
3812
|
-
(0,tslib_es6
|
|
3991
|
+
(0,tslib_es6.__extends)(ADL, _super);
|
|
3813
3992
|
function ADL() {
|
|
3814
3993
|
var _this = _super.call(this) || this;
|
|
3994
|
+
_this.data = new ADLData();
|
|
3815
3995
|
_this.nav = new ADLNav();
|
|
3996
|
+
_this.data = new ADLData();
|
|
3816
3997
|
return _this;
|
|
3817
3998
|
}
|
|
3818
3999
|
ADL.prototype.initialize = function () {
|
|
@@ -3820,19 +4001,25 @@ var ADL = (function (_super) {
|
|
|
3820
4001
|
_super.prototype.initialize.call(this);
|
|
3821
4002
|
(_a = this.nav) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
3822
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
|
+
};
|
|
3823
4009
|
ADL.prototype.toJSON = function () {
|
|
3824
4010
|
this.jsonString = true;
|
|
3825
4011
|
var result = {
|
|
3826
4012
|
nav: this.nav,
|
|
4013
|
+
data: this.data,
|
|
3827
4014
|
};
|
|
3828
4015
|
delete this.jsonString;
|
|
3829
4016
|
return result;
|
|
3830
4017
|
};
|
|
3831
4018
|
return ADL;
|
|
3832
|
-
}(base_cmi
|
|
4019
|
+
}(base_cmi.BaseCMI));
|
|
3833
4020
|
|
|
3834
4021
|
var ADLNav = (function (_super) {
|
|
3835
|
-
(0,tslib_es6
|
|
4022
|
+
(0,tslib_es6.__extends)(ADLNav, _super);
|
|
3836
4023
|
function ADLNav() {
|
|
3837
4024
|
var _this = _super.call(this) || this;
|
|
3838
4025
|
_this._request = "_none_";
|
|
@@ -3844,12 +4031,18 @@ var ADLNav = (function (_super) {
|
|
|
3844
4031
|
_super.prototype.initialize.call(this);
|
|
3845
4032
|
(_a = this.request_valid) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
3846
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
|
+
};
|
|
3847
4040
|
Object.defineProperty(ADLNav.prototype, "request", {
|
|
3848
4041
|
get: function () {
|
|
3849
4042
|
return this._request;
|
|
3850
4043
|
},
|
|
3851
4044
|
set: function (request) {
|
|
3852
|
-
if (check2004ValidFormat(request, regex
|
|
4045
|
+
if (check2004ValidFormat(request, regex.scorm2004_regex.NAVEvent)) {
|
|
3853
4046
|
this._request = request;
|
|
3854
4047
|
}
|
|
3855
4048
|
},
|
|
@@ -3865,10 +4058,69 @@ var ADLNav = (function (_super) {
|
|
|
3865
4058
|
return result;
|
|
3866
4059
|
};
|
|
3867
4060
|
return ADLNav;
|
|
3868
|
-
}(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));
|
|
3869
4121
|
|
|
3870
4122
|
var ADLNavRequestValid = (function (_super) {
|
|
3871
|
-
(0,tslib_es6
|
|
4123
|
+
(0,tslib_es6.__extends)(ADLNavRequestValid, _super);
|
|
3872
4124
|
function ADLNavRequestValid() {
|
|
3873
4125
|
var _this = _super.call(this) || this;
|
|
3874
4126
|
_this._continue = "unknown";
|
|
@@ -3877,15 +4129,20 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
3877
4129
|
_this._jump = {};
|
|
3878
4130
|
return _this;
|
|
3879
4131
|
}
|
|
4132
|
+
ADLNavRequestValid.prototype.reset = function () {
|
|
4133
|
+
this._initialized = false;
|
|
4134
|
+
this._continue = "unknown";
|
|
4135
|
+
this._previous = "unknown";
|
|
4136
|
+
};
|
|
3880
4137
|
Object.defineProperty(ADLNavRequestValid.prototype, "continue", {
|
|
3881
4138
|
get: function () {
|
|
3882
4139
|
return this._continue;
|
|
3883
4140
|
},
|
|
3884
4141
|
set: function (_continue) {
|
|
3885
4142
|
if (this.initialized) {
|
|
3886
|
-
throw new
|
|
4143
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3887
4144
|
}
|
|
3888
|
-
if (check2004ValidFormat(_continue, regex
|
|
4145
|
+
if (check2004ValidFormat(_continue, regex.scorm2004_regex.NAVBoolean)) {
|
|
3889
4146
|
this._continue = _continue;
|
|
3890
4147
|
}
|
|
3891
4148
|
},
|
|
@@ -3898,9 +4155,9 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
3898
4155
|
},
|
|
3899
4156
|
set: function (_previous) {
|
|
3900
4157
|
if (this.initialized) {
|
|
3901
|
-
throw new
|
|
4158
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3902
4159
|
}
|
|
3903
|
-
if (check2004ValidFormat(_previous, regex
|
|
4160
|
+
if (check2004ValidFormat(_previous, regex.scorm2004_regex.NAVBoolean)) {
|
|
3904
4161
|
this._previous = _previous;
|
|
3905
4162
|
}
|
|
3906
4163
|
},
|
|
@@ -3913,17 +4170,17 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
3913
4170
|
},
|
|
3914
4171
|
set: function (choice) {
|
|
3915
4172
|
if (this.initialized) {
|
|
3916
|
-
throw new
|
|
4173
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3917
4174
|
}
|
|
3918
4175
|
if (typeof choice !== "object") {
|
|
3919
|
-
throw new
|
|
4176
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
3920
4177
|
}
|
|
3921
4178
|
for (var key in choice) {
|
|
3922
4179
|
if ({}.hasOwnProperty.call(choice, key)) {
|
|
3923
|
-
if (check2004ValidFormat(choice[key], regex
|
|
3924
|
-
check2004ValidFormat(key, regex
|
|
4180
|
+
if (check2004ValidFormat(choice[key], regex.scorm2004_regex.NAVBoolean) &&
|
|
4181
|
+
check2004ValidFormat(key, regex.scorm2004_regex.NAVTarget)) {
|
|
3925
4182
|
this._choice[key] =
|
|
3926
|
-
enums
|
|
4183
|
+
enums.NAVBoolean[choice[key]];
|
|
3927
4184
|
}
|
|
3928
4185
|
}
|
|
3929
4186
|
}
|
|
@@ -3937,16 +4194,16 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
3937
4194
|
},
|
|
3938
4195
|
set: function (jump) {
|
|
3939
4196
|
if (this.initialized) {
|
|
3940
|
-
throw new
|
|
4197
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3941
4198
|
}
|
|
3942
4199
|
if (typeof jump !== "object") {
|
|
3943
|
-
throw new
|
|
4200
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
3944
4201
|
}
|
|
3945
4202
|
for (var key in jump) {
|
|
3946
4203
|
if ({}.hasOwnProperty.call(jump, key)) {
|
|
3947
|
-
if (check2004ValidFormat(jump[key], regex
|
|
3948
|
-
check2004ValidFormat(key, regex
|
|
3949
|
-
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]];
|
|
3950
4207
|
}
|
|
3951
4208
|
}
|
|
3952
4209
|
}
|
|
@@ -3966,7 +4223,7 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
3966
4223
|
return result;
|
|
3967
4224
|
};
|
|
3968
4225
|
return ADLNavRequestValid;
|
|
3969
|
-
}(base_cmi
|
|
4226
|
+
}(base_cmi.BaseCMI));
|
|
3970
4227
|
|
|
3971
4228
|
|
|
3972
4229
|
;// ./src/Scorm2004API.ts
|
|
@@ -3985,9 +4242,8 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
3985
4242
|
|
|
3986
4243
|
|
|
3987
4244
|
|
|
3988
|
-
|
|
3989
4245
|
var Scorm2004Impl = (function (_super) {
|
|
3990
|
-
(0,tslib_es6
|
|
4246
|
+
(0,tslib_es6.__extends)(Scorm2004Impl, _super);
|
|
3991
4247
|
function Scorm2004Impl(settings) {
|
|
3992
4248
|
var _this = this;
|
|
3993
4249
|
if (settings) {
|
|
@@ -3995,8 +4251,9 @@ var Scorm2004Impl = (function (_super) {
|
|
|
3995
4251
|
settings.mastery_override = false;
|
|
3996
4252
|
}
|
|
3997
4253
|
}
|
|
3998
|
-
_this = _super.call(this, error_codes
|
|
4254
|
+
_this = _super.call(this, error_codes.scorm2004_errors, settings) || this;
|
|
3999
4255
|
_this._version = "1.0";
|
|
4256
|
+
_this._globalObjectives = [];
|
|
4000
4257
|
_this.cmi = new CMI();
|
|
4001
4258
|
_this.adl = new ADL();
|
|
4002
4259
|
_this.Initialize = _this.lmsInitialize;
|
|
@@ -4010,9 +4267,10 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4010
4267
|
return _this;
|
|
4011
4268
|
}
|
|
4012
4269
|
Scorm2004Impl.prototype.reset = function (settings) {
|
|
4270
|
+
var _a, _b;
|
|
4013
4271
|
this.commonReset(settings);
|
|
4014
|
-
this.cmi
|
|
4015
|
-
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();
|
|
4016
4274
|
};
|
|
4017
4275
|
Object.defineProperty(Scorm2004Impl.prototype, "version", {
|
|
4018
4276
|
get: function () {
|
|
@@ -4021,14 +4279,21 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4021
4279
|
enumerable: false,
|
|
4022
4280
|
configurable: true
|
|
4023
4281
|
});
|
|
4282
|
+
Object.defineProperty(Scorm2004Impl.prototype, "globalObjectives", {
|
|
4283
|
+
get: function () {
|
|
4284
|
+
return this._globalObjectives;
|
|
4285
|
+
},
|
|
4286
|
+
enumerable: false,
|
|
4287
|
+
configurable: true
|
|
4288
|
+
});
|
|
4024
4289
|
Scorm2004Impl.prototype.lmsInitialize = function () {
|
|
4025
4290
|
this.cmi.initialize();
|
|
4026
4291
|
return this.initialize("Initialize");
|
|
4027
4292
|
};
|
|
4028
4293
|
Scorm2004Impl.prototype.lmsFinish = function () {
|
|
4029
4294
|
var _this = this;
|
|
4030
|
-
(function () { return (0,tslib_es6
|
|
4031
|
-
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) {
|
|
4032
4297
|
switch (_a.label) {
|
|
4033
4298
|
case 0: return [4, this.internalFinish()];
|
|
4034
4299
|
case 1:
|
|
@@ -4037,17 +4302,18 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4037
4302
|
}
|
|
4038
4303
|
});
|
|
4039
4304
|
}); })();
|
|
4040
|
-
return api_constants
|
|
4305
|
+
return api_constants.global_constants.SCORM_TRUE;
|
|
4041
4306
|
};
|
|
4042
4307
|
Scorm2004Impl.prototype.internalFinish = function () {
|
|
4043
|
-
return (0,tslib_es6
|
|
4308
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
4044
4309
|
var result, navActions, request, choiceJumpRegex, matches, target, action;
|
|
4045
|
-
|
|
4046
|
-
|
|
4310
|
+
var _a, _b, _c, _d;
|
|
4311
|
+
return (0,tslib_es6.__generator)(this, function (_e) {
|
|
4312
|
+
switch (_e.label) {
|
|
4047
4313
|
case 0: return [4, this.terminate("Terminate", true)];
|
|
4048
4314
|
case 1:
|
|
4049
|
-
result =
|
|
4050
|
-
if (result === api_constants
|
|
4315
|
+
result = _e.sent();
|
|
4316
|
+
if (result === api_constants.global_constants.SCORM_TRUE) {
|
|
4051
4317
|
if (this.adl.nav.request !== "_none_") {
|
|
4052
4318
|
navActions = {
|
|
4053
4319
|
continue: "SequenceNext",
|
|
@@ -4060,12 +4326,18 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4060
4326
|
abandonAll: "SequenceAbandonAll",
|
|
4061
4327
|
};
|
|
4062
4328
|
request = this.adl.nav.request;
|
|
4063
|
-
choiceJumpRegex = new RegExp(regex
|
|
4329
|
+
choiceJumpRegex = new RegExp(regex.scorm2004_regex.NAVEvent);
|
|
4064
4330
|
matches = request.match(choiceJumpRegex);
|
|
4065
4331
|
target = "";
|
|
4066
|
-
if (matches
|
|
4067
|
-
|
|
4068
|
-
|
|
4332
|
+
if (matches) {
|
|
4333
|
+
if ((_a = matches.groups) === null || _a === void 0 ? void 0 : _a.choice_target) {
|
|
4334
|
+
target = (_b = matches.groups) === null || _b === void 0 ? void 0 : _b.choice_target;
|
|
4335
|
+
request = "choice";
|
|
4336
|
+
}
|
|
4337
|
+
else if ((_c = matches.groups) === null || _c === void 0 ? void 0 : _c.jump_target) {
|
|
4338
|
+
target = (_d = matches.groups) === null || _d === void 0 ? void 0 : _d.jump_target;
|
|
4339
|
+
request = "jump";
|
|
4340
|
+
}
|
|
4069
4341
|
}
|
|
4070
4342
|
action = navActions[request];
|
|
4071
4343
|
if (action) {
|
|
@@ -4083,7 +4355,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4083
4355
|
};
|
|
4084
4356
|
Scorm2004Impl.prototype.lmsGetValue = function (CMIElement) {
|
|
4085
4357
|
var adlNavRequestRegex = "^adl\\.nav\\.request_valid\\.(choice|jump)\\.{target=\\S{0,}([a-zA-Z0-9-_]+)}$";
|
|
4086
|
-
if ((0,utilities
|
|
4358
|
+
if ((0,utilities.stringMatches)(CMIElement, adlNavRequestRegex)) {
|
|
4087
4359
|
var matches = CMIElement.match(adlNavRequestRegex);
|
|
4088
4360
|
var request = matches[1];
|
|
4089
4361
|
var target = matches[2].replace("{target=", "").replace("}", "");
|
|
@@ -4105,8 +4377,8 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4105
4377
|
this.scheduleCommit(500, "LMSCommit");
|
|
4106
4378
|
}
|
|
4107
4379
|
else {
|
|
4108
|
-
(function () { return (0,tslib_es6
|
|
4109
|
-
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) {
|
|
4110
4382
|
switch (_a.label) {
|
|
4111
4383
|
case 0: return [4, this.commit("LMSCommit", false)];
|
|
4112
4384
|
case 1:
|
|
@@ -4116,7 +4388,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4116
4388
|
});
|
|
4117
4389
|
}); })();
|
|
4118
4390
|
}
|
|
4119
|
-
return api_constants
|
|
4391
|
+
return api_constants.global_constants.SCORM_TRUE;
|
|
4120
4392
|
};
|
|
4121
4393
|
Scorm2004Impl.prototype.lmsGetLastError = function () {
|
|
4122
4394
|
return this.getLastError("GetLastError");
|
|
@@ -4128,29 +4400,58 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4128
4400
|
return this.getDiagnostic("GetDiagnostic", CMIErrorCode);
|
|
4129
4401
|
};
|
|
4130
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
|
+
}
|
|
4131
4429
|
return this._commonSetCMIValue("SetValue", true, CMIElement, value);
|
|
4132
4430
|
};
|
|
4133
4431
|
Scorm2004Impl.prototype.getChildElement = function (CMIElement, value, foundFirstIndex) {
|
|
4134
|
-
if ((0,utilities
|
|
4432
|
+
if ((0,utilities.stringMatches)(CMIElement, "cmi\\.objectives\\.\\d+")) {
|
|
4135
4433
|
return new CMIObjectivesObject();
|
|
4136
4434
|
}
|
|
4137
4435
|
if (foundFirstIndex) {
|
|
4138
|
-
if ((0,utilities
|
|
4436
|
+
if ((0,utilities.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) {
|
|
4139
4437
|
return this.createCorrectResponsesObject(CMIElement, value);
|
|
4140
4438
|
}
|
|
4141
|
-
else if ((0,utilities
|
|
4439
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) {
|
|
4142
4440
|
return new CMIInteractionsObjectivesObject();
|
|
4143
4441
|
}
|
|
4144
4442
|
}
|
|
4145
|
-
else if ((0,utilities
|
|
4443
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+")) {
|
|
4146
4444
|
return new CMIInteractionsObject();
|
|
4147
4445
|
}
|
|
4148
|
-
if ((0,utilities
|
|
4446
|
+
if ((0,utilities.stringMatches)(CMIElement, "cmi\\.comments_from_learner\\.\\d+")) {
|
|
4149
4447
|
return new CMICommentsObject();
|
|
4150
4448
|
}
|
|
4151
|
-
else if ((0,utilities
|
|
4449
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.comments_from_lms\\.\\d+")) {
|
|
4152
4450
|
return new CMICommentsObject(true);
|
|
4153
4451
|
}
|
|
4452
|
+
if ((0,utilities.stringMatches)(CMIElement, "adl\\.data\\.\\d+")) {
|
|
4453
|
+
return new ADLDataObject();
|
|
4454
|
+
}
|
|
4154
4455
|
return null;
|
|
4155
4456
|
};
|
|
4156
4457
|
Scorm2004Impl.prototype.createCorrectResponsesObject = function (CMIElement, value) {
|
|
@@ -4159,7 +4460,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4159
4460
|
var interaction = this.cmi.interactions.childArray[index];
|
|
4160
4461
|
if (this.isInitialized()) {
|
|
4161
4462
|
if (!interaction.type) {
|
|
4162
|
-
this.throwSCORMError(error_codes
|
|
4463
|
+
this.throwSCORMError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
4163
4464
|
}
|
|
4164
4465
|
else {
|
|
4165
4466
|
this.checkDuplicateChoiceResponse(interaction, value);
|
|
@@ -4168,7 +4469,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4168
4469
|
this.checkValidResponseType(response_type, value, interaction.type);
|
|
4169
4470
|
}
|
|
4170
4471
|
else {
|
|
4171
|
-
this.throwSCORMError(error_codes
|
|
4472
|
+
this.throwSCORMError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE, "Incorrect Response Type: " + interaction.type);
|
|
4172
4473
|
}
|
|
4173
4474
|
}
|
|
4174
4475
|
}
|
|
@@ -4189,7 +4490,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4189
4490
|
this.checkCorrectResponseValue(interaction_type, nodes, value);
|
|
4190
4491
|
}
|
|
4191
4492
|
else if (nodes.length > response_type.max) {
|
|
4192
|
-
this.throwSCORMError(error_codes
|
|
4493
|
+
this.throwSCORMError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE, "Data Model Element Pattern Too Long");
|
|
4193
4494
|
}
|
|
4194
4495
|
};
|
|
4195
4496
|
Scorm2004Impl.prototype.checkDuplicateChoiceResponse = function (interaction, value) {
|
|
@@ -4198,7 +4499,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4198
4499
|
for (var i = 0; i < interaction_count && this.lastErrorCode === "0"; i++) {
|
|
4199
4500
|
var response = interaction.correct_responses.childArray[i];
|
|
4200
4501
|
if (response.pattern === value) {
|
|
4201
|
-
this.throwSCORMError(error_codes
|
|
4502
|
+
this.throwSCORMError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE);
|
|
4202
4503
|
}
|
|
4203
4504
|
}
|
|
4204
4505
|
}
|
|
@@ -4221,12 +4522,12 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4221
4522
|
}
|
|
4222
4523
|
else {
|
|
4223
4524
|
if (this.lastErrorCode === "0") {
|
|
4224
|
-
this.throwSCORMError(error_codes
|
|
4525
|
+
this.throwSCORMError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE, "Data Model Element Pattern Already Exists");
|
|
4225
4526
|
}
|
|
4226
4527
|
}
|
|
4227
4528
|
}
|
|
4228
4529
|
else {
|
|
4229
|
-
this.throwSCORMError(error_codes
|
|
4530
|
+
this.throwSCORMError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE, "Data Model Element Collection Limit Reached");
|
|
4230
4531
|
}
|
|
4231
4532
|
};
|
|
4232
4533
|
Scorm2004Impl.prototype.getCMIValue = function (CMIElement) {
|
|
@@ -4236,11 +4537,11 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4236
4537
|
var basicMessage = "";
|
|
4237
4538
|
var detailMessage = "";
|
|
4238
4539
|
errorNumber = String(errorNumber);
|
|
4239
|
-
if (api_constants
|
|
4540
|
+
if (api_constants.scorm2004_constants.error_descriptions[errorNumber]) {
|
|
4240
4541
|
basicMessage =
|
|
4241
|
-
api_constants
|
|
4542
|
+
api_constants.scorm2004_constants.error_descriptions[errorNumber].basicMessage;
|
|
4242
4543
|
detailMessage =
|
|
4243
|
-
api_constants
|
|
4544
|
+
api_constants.scorm2004_constants.error_descriptions[errorNumber].detailMessage;
|
|
4244
4545
|
}
|
|
4245
4546
|
return detail ? detailMessage : basicMessage;
|
|
4246
4547
|
};
|
|
@@ -4266,36 +4567,36 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4266
4567
|
if (values.length === 2) {
|
|
4267
4568
|
var matches = values[0].match(formatRegex);
|
|
4268
4569
|
if (!matches) {
|
|
4269
|
-
this.throwSCORMError(error_codes
|
|
4570
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4270
4571
|
}
|
|
4271
4572
|
else {
|
|
4272
4573
|
if (!response.format2 ||
|
|
4273
4574
|
!values[1].match(new RegExp(response.format2))) {
|
|
4274
|
-
this.throwSCORMError(error_codes
|
|
4575
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4275
4576
|
}
|
|
4276
4577
|
}
|
|
4277
4578
|
}
|
|
4278
4579
|
else {
|
|
4279
|
-
this.throwSCORMError(error_codes
|
|
4580
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4280
4581
|
}
|
|
4281
4582
|
}
|
|
4282
4583
|
else {
|
|
4283
4584
|
var matches = nodes[i].match(formatRegex);
|
|
4284
4585
|
if ((!matches && value !== "") ||
|
|
4285
4586
|
(!matches && interaction_type === "true-false")) {
|
|
4286
|
-
this.throwSCORMError(error_codes
|
|
4587
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4287
4588
|
}
|
|
4288
4589
|
else {
|
|
4289
4590
|
if (interaction_type === "numeric" && nodes.length > 1) {
|
|
4290
4591
|
if (Number(nodes[0]) > Number(nodes[1])) {
|
|
4291
|
-
this.throwSCORMError(error_codes
|
|
4592
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4292
4593
|
}
|
|
4293
4594
|
}
|
|
4294
4595
|
else {
|
|
4295
4596
|
if (nodes[i] !== "" && response.unique) {
|
|
4296
4597
|
for (var j = 0; j < i && this.lastErrorCode === "0"; j++) {
|
|
4297
4598
|
if (nodes[i] === nodes[j]) {
|
|
4298
|
-
this.throwSCORMError(error_codes
|
|
4599
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4299
4600
|
}
|
|
4300
4601
|
}
|
|
4301
4602
|
}
|
|
@@ -4314,12 +4615,12 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4314
4615
|
while (matches) {
|
|
4315
4616
|
switch (matches[2]) {
|
|
4316
4617
|
case "lang":
|
|
4317
|
-
langMatches = node.match(regex
|
|
4618
|
+
langMatches = node.match(regex.scorm2004_regex.CMILangcr);
|
|
4318
4619
|
if (langMatches) {
|
|
4319
4620
|
var lang = langMatches[3];
|
|
4320
4621
|
if (lang !== undefined && lang.length > 0) {
|
|
4321
4622
|
if (!language_constants.includes(lang.toLowerCase())) {
|
|
4322
|
-
this.throwSCORMError(error_codes
|
|
4623
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4323
4624
|
}
|
|
4324
4625
|
}
|
|
4325
4626
|
}
|
|
@@ -4328,7 +4629,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4328
4629
|
case "case_matters":
|
|
4329
4630
|
if (!seenLang && !seenOrder && !seenCase) {
|
|
4330
4631
|
if (matches[3] !== "true" && matches[3] !== "false") {
|
|
4331
|
-
this.throwSCORMError(error_codes
|
|
4632
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4332
4633
|
}
|
|
4333
4634
|
}
|
|
4334
4635
|
seenCase = true;
|
|
@@ -4336,7 +4637,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4336
4637
|
case "order_matters":
|
|
4337
4638
|
if (!seenCase && !seenLang && !seenOrder) {
|
|
4338
4639
|
if (matches[3] !== "true" && matches[3] !== "false") {
|
|
4339
|
-
this.throwSCORMError(error_codes
|
|
4640
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4340
4641
|
}
|
|
4341
4642
|
}
|
|
4342
4643
|
seenOrder = true;
|
|
@@ -4357,10 +4658,10 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4357
4658
|
cmiExport.cmi.total_time = this.cmi.getCurrentTotalTime();
|
|
4358
4659
|
}
|
|
4359
4660
|
var result = [];
|
|
4360
|
-
var flattened = utilities
|
|
4661
|
+
var flattened = utilities.flatten(cmiExport);
|
|
4361
4662
|
switch (this.settings.dataCommitFormat) {
|
|
4362
4663
|
case "flattened":
|
|
4363
|
-
return utilities
|
|
4664
|
+
return utilities.flatten(cmiExport);
|
|
4364
4665
|
case "params":
|
|
4365
4666
|
for (var item in flattened) {
|
|
4366
4667
|
if ({}.hasOwnProperty.call(flattened, item)) {
|
|
@@ -4376,23 +4677,23 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4376
4677
|
Scorm2004Impl.prototype.renderCommitObject = function (terminateCommit) {
|
|
4377
4678
|
var cmiExport = this.renderCommitCMI(terminateCommit);
|
|
4378
4679
|
var totalTimeDuration = this.cmi.getCurrentTotalTime();
|
|
4379
|
-
var totalTimeSeconds = utilities
|
|
4380
|
-
var completionStatus = enums
|
|
4381
|
-
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;
|
|
4382
4683
|
if (this.cmi.completion_status) {
|
|
4383
4684
|
if (this.cmi.completion_status === "completed") {
|
|
4384
|
-
completionStatus = enums
|
|
4685
|
+
completionStatus = enums.CompletionStatus.completed;
|
|
4385
4686
|
}
|
|
4386
4687
|
else if (this.cmi.completion_status === "incomplete") {
|
|
4387
|
-
completionStatus = enums
|
|
4688
|
+
completionStatus = enums.CompletionStatus.incomplete;
|
|
4388
4689
|
}
|
|
4389
4690
|
}
|
|
4390
4691
|
if (this.cmi.success_status) {
|
|
4391
4692
|
if (this.cmi.success_status === "passed") {
|
|
4392
|
-
successStatus = enums
|
|
4693
|
+
successStatus = enums.SuccessStatus.passed;
|
|
4393
4694
|
}
|
|
4394
4695
|
else if (this.cmi.success_status === "failed") {
|
|
4395
|
-
successStatus = enums
|
|
4696
|
+
successStatus = enums.SuccessStatus.failed;
|
|
4396
4697
|
}
|
|
4397
4698
|
}
|
|
4398
4699
|
var score = this.cmi.score;
|
|
@@ -4424,10 +4725,10 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4424
4725
|
return commitObject;
|
|
4425
4726
|
};
|
|
4426
4727
|
Scorm2004Impl.prototype.storeData = function (terminateCommit) {
|
|
4427
|
-
return (0,tslib_es6
|
|
4728
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
4428
4729
|
var navRequest, commitObject, result;
|
|
4429
4730
|
var _a, _b, _c;
|
|
4430
|
-
return (0,tslib_es6
|
|
4731
|
+
return (0,tslib_es6.__generator)(this, function (_d) {
|
|
4431
4732
|
switch (_d.label) {
|
|
4432
4733
|
case 0:
|
|
4433
4734
|
if (terminateCommit) {
|
|
@@ -4455,7 +4756,6 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4455
4756
|
navRequest = false;
|
|
4456
4757
|
if (this.adl.nav.request !== ((_c = (_b = (_a = this.startingData) === null || _a === void 0 ? void 0 : _a.adl) === null || _b === void 0 ? void 0 : _b.nav) === null || _c === void 0 ? void 0 : _c.request) &&
|
|
4457
4758
|
this.adl.nav.request !== "_none_") {
|
|
4458
|
-
this.adl.nav.request = encodeURIComponent(this.adl.nav.request);
|
|
4459
4759
|
navRequest = true;
|
|
4460
4760
|
}
|
|
4461
4761
|
commitObject = this.getCommitObject(terminateCommit);
|
|
@@ -4472,7 +4772,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4472
4772
|
}
|
|
4473
4773
|
return [2, result];
|
|
4474
4774
|
case 2: return [2, {
|
|
4475
|
-
result: api_constants
|
|
4775
|
+
result: api_constants.global_constants.SCORM_TRUE,
|
|
4476
4776
|
errorCode: 0,
|
|
4477
4777
|
}];
|
|
4478
4778
|
}
|
|
@@ -4480,7 +4780,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4480
4780
|
});
|
|
4481
4781
|
};
|
|
4482
4782
|
return Scorm2004Impl;
|
|
4483
|
-
}(BaseAPI
|
|
4783
|
+
}(BaseAPI["default"]));
|
|
4484
4784
|
|
|
4485
4785
|
|
|
4486
4786
|
|
|
@@ -4489,29 +4789,40 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4489
4789
|
/***/ 589:
|
|
4490
4790
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
4491
4791
|
|
|
4792
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4492
4793
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4493
|
-
/* harmony export */
|
|
4794
|
+
/* harmony export */ CMIArray: function() { return /* binding */ CMIArray; }
|
|
4494
4795
|
/* harmony export */ });
|
|
4495
|
-
/* unused harmony export scorm12_error_codes */
|
|
4496
4796
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635);
|
|
4497
4797
|
/* harmony import */ var _base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
4498
|
-
/* harmony import */ var
|
|
4499
|
-
/* 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);
|
|
4500
4800
|
|
|
4501
4801
|
|
|
4502
4802
|
|
|
4503
4803
|
|
|
4504
|
-
var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12;
|
|
4505
4804
|
var CMIArray = (function (_super) {
|
|
4506
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_3__
|
|
4805
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_3__.__extends)(CMIArray, _super);
|
|
4507
4806
|
function CMIArray(params) {
|
|
4508
4807
|
var _this = _super.call(this) || this;
|
|
4509
4808
|
_this.__children = params.children;
|
|
4510
|
-
_this._errorCode = params.errorCode ||
|
|
4511
|
-
_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;
|
|
4512
4811
|
_this.childArray = [];
|
|
4513
4812
|
return _this;
|
|
4514
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
|
+
};
|
|
4515
4826
|
Object.defineProperty(CMIArray.prototype, "_children", {
|
|
4516
4827
|
get: function () {
|
|
4517
4828
|
return this.__children;
|
|
@@ -4542,7 +4853,7 @@ var CMIArray = (function (_super) {
|
|
|
4542
4853
|
return result;
|
|
4543
4854
|
};
|
|
4544
4855
|
return CMIArray;
|
|
4545
|
-
}(_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
4856
|
+
}(_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
4546
4857
|
|
|
4547
4858
|
|
|
4548
4859
|
|
|
@@ -4551,9 +4862,10 @@ var CMIArray = (function (_super) {
|
|
|
4551
4862
|
/***/ 319:
|
|
4552
4863
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
4553
4864
|
|
|
4865
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4554
4866
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4555
|
-
/* harmony export */
|
|
4556
|
-
/* harmony export */
|
|
4867
|
+
/* harmony export */ BaseCMI: function() { return /* binding */ BaseCMI; },
|
|
4868
|
+
/* harmony export */ BaseRootCMI: function() { return /* binding */ BaseRootCMI; }
|
|
4557
4869
|
/* harmony export */ });
|
|
4558
4870
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
4559
4871
|
|
|
@@ -4586,7 +4898,7 @@ var BaseCMI = (function () {
|
|
|
4586
4898
|
}());
|
|
4587
4899
|
|
|
4588
4900
|
var BaseRootCMI = (function (_super) {
|
|
4589
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_0__
|
|
4901
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(BaseRootCMI, _super);
|
|
4590
4902
|
function BaseRootCMI() {
|
|
4591
4903
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
4592
4904
|
}
|
|
@@ -4600,10 +4912,10 @@ var BaseRootCMI = (function (_super) {
|
|
|
4600
4912
|
/***/ 434:
|
|
4601
4913
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
4602
4914
|
|
|
4915
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4603
4916
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4604
|
-
/* harmony export */
|
|
4917
|
+
/* harmony export */ CMIScore: function() { return /* binding */ CMIScore; }
|
|
4605
4918
|
/* harmony export */ });
|
|
4606
|
-
/* unused harmony export scorm12_error_codes */
|
|
4607
4919
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635);
|
|
4608
4920
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340);
|
|
4609
4921
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(417);
|
|
@@ -4616,30 +4928,30 @@ var BaseRootCMI = (function (_super) {
|
|
|
4616
4928
|
|
|
4617
4929
|
|
|
4618
4930
|
|
|
4619
|
-
var scorm12_constants = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12;
|
|
4620
|
-
var scorm12_regex = _constants_regex__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12;
|
|
4621
|
-
var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12;
|
|
4622
4931
|
var CMIScore = (function (_super) {
|
|
4623
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_4__
|
|
4932
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_4__.__extends)(CMIScore, _super);
|
|
4624
4933
|
function CMIScore(params) {
|
|
4625
4934
|
var _this = _super.call(this) || this;
|
|
4626
4935
|
_this._raw = "";
|
|
4627
4936
|
_this._min = "";
|
|
4628
|
-
_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;
|
|
4629
4938
|
_this.__score_range = !params.score_range
|
|
4630
4939
|
? false
|
|
4631
|
-
: scorm12_regex.score_range;
|
|
4940
|
+
: _constants_regex__WEBPACK_IMPORTED_MODULE_1__.scorm12_regex.score_range;
|
|
4632
4941
|
_this._max = params.max || params.max === "" ? params.max : "100";
|
|
4633
4942
|
_this.__invalid_error_code =
|
|
4634
|
-
params.invalidErrorCode ||
|
|
4943
|
+
params.invalidErrorCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.INVALID_SET_VALUE;
|
|
4635
4944
|
_this.__invalid_type_code =
|
|
4636
|
-
params.invalidTypeCode ||
|
|
4945
|
+
params.invalidTypeCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.TYPE_MISMATCH;
|
|
4637
4946
|
_this.__invalid_range_code =
|
|
4638
|
-
params.invalidRangeCode ||
|
|
4639
|
-
_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;
|
|
4640
4949
|
_this.__error_class = params.errorClass;
|
|
4641
4950
|
return _this;
|
|
4642
4951
|
}
|
|
4952
|
+
CMIScore.prototype.reset = function () {
|
|
4953
|
+
this._initialized = false;
|
|
4954
|
+
};
|
|
4643
4955
|
Object.defineProperty(CMIScore.prototype, "_children", {
|
|
4644
4956
|
get: function () {
|
|
4645
4957
|
return this.__children;
|
|
@@ -4655,9 +4967,9 @@ var CMIScore = (function (_super) {
|
|
|
4655
4967
|
return this._raw;
|
|
4656
4968
|
},
|
|
4657
4969
|
set: function (raw) {
|
|
4658
|
-
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) &&
|
|
4659
4971
|
(!this.__score_range ||
|
|
4660
|
-
(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))) {
|
|
4661
4973
|
this._raw = raw;
|
|
4662
4974
|
}
|
|
4663
4975
|
},
|
|
@@ -4669,9 +4981,9 @@ var CMIScore = (function (_super) {
|
|
|
4669
4981
|
return this._min;
|
|
4670
4982
|
},
|
|
4671
4983
|
set: function (min) {
|
|
4672
|
-
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) &&
|
|
4673
4985
|
(!this.__score_range ||
|
|
4674
|
-
(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))) {
|
|
4675
4987
|
this._min = min;
|
|
4676
4988
|
}
|
|
4677
4989
|
},
|
|
@@ -4683,9 +4995,9 @@ var CMIScore = (function (_super) {
|
|
|
4683
4995
|
return this._max;
|
|
4684
4996
|
},
|
|
4685
4997
|
set: function (max) {
|
|
4686
|
-
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) &&
|
|
4687
4999
|
(!this.__score_range ||
|
|
4688
|
-
(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))) {
|
|
4689
5001
|
this._max = max;
|
|
4690
5002
|
}
|
|
4691
5003
|
},
|
|
@@ -4703,7 +5015,7 @@ var CMIScore = (function (_super) {
|
|
|
4703
5015
|
return result;
|
|
4704
5016
|
};
|
|
4705
5017
|
return CMIScore;
|
|
4706
|
-
}(_base_cmi__WEBPACK_IMPORTED_MODULE_2__
|
|
5018
|
+
}(_base_cmi__WEBPACK_IMPORTED_MODULE_2__.BaseCMI));
|
|
4707
5019
|
|
|
4708
5020
|
|
|
4709
5021
|
|
|
@@ -4712,9 +5024,10 @@ var CMIScore = (function (_super) {
|
|
|
4712
5024
|
/***/ 449:
|
|
4713
5025
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
4714
5026
|
|
|
5027
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4715
5028
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4716
|
-
/* harmony export */
|
|
4717
|
-
/* harmony export */
|
|
5029
|
+
/* harmony export */ checkValidFormat: function() { return /* binding */ checkValidFormat; },
|
|
5030
|
+
/* harmony export */ checkValidRange: function() { return /* binding */ checkValidRange; }
|
|
4718
5031
|
/* harmony export */ });
|
|
4719
5032
|
function checkValidFormat(value, regexPattern, errorCode, errorClass, allowEmptyString) {
|
|
4720
5033
|
if (typeof value !== "string") {
|
|
@@ -4752,10 +5065,12 @@ function checkValidRange(value, rangePattern, errorCode, errorClass) {
|
|
|
4752
5065
|
/***/ 989:
|
|
4753
5066
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
4754
5067
|
|
|
5068
|
+
// ESM COMPAT FLAG
|
|
5069
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4755
5070
|
|
|
4756
5071
|
// EXPORTS
|
|
4757
5072
|
__webpack_require__.d(__webpack_exports__, {
|
|
4758
|
-
|
|
5073
|
+
CMI: function() { return /* binding */ CMI; }
|
|
4759
5074
|
});
|
|
4760
5075
|
|
|
4761
5076
|
// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs
|
|
@@ -4766,8 +5081,8 @@ var api_constants = __webpack_require__(340);
|
|
|
4766
5081
|
var error_codes = __webpack_require__(797);
|
|
4767
5082
|
// EXTERNAL MODULE: ./src/constants/regex.ts
|
|
4768
5083
|
var regex = __webpack_require__(417);
|
|
4769
|
-
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
4770
|
-
var
|
|
5084
|
+
// EXTERNAL MODULE: ./src/exceptions/scorm12_exceptions.ts
|
|
5085
|
+
var scorm12_exceptions = __webpack_require__(179);
|
|
4771
5086
|
// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts
|
|
4772
5087
|
var base_cmi = __webpack_require__(319);
|
|
4773
5088
|
// EXTERNAL MODULE: ./src/cmi/scorm12/validation.ts
|
|
@@ -4787,10 +5102,10 @@ var utilities = __webpack_require__(864);
|
|
|
4787
5102
|
|
|
4788
5103
|
|
|
4789
5104
|
var CMICore = (function (_super) {
|
|
4790
|
-
(0,tslib_es6
|
|
5105
|
+
(0,tslib_es6.__extends)(CMICore, _super);
|
|
4791
5106
|
function CMICore() {
|
|
4792
5107
|
var _this = _super.call(this) || this;
|
|
4793
|
-
_this.__children = api_constants
|
|
5108
|
+
_this.__children = api_constants.scorm12_constants.core_children;
|
|
4794
5109
|
_this._student_id = "";
|
|
4795
5110
|
_this._student_name = "";
|
|
4796
5111
|
_this._lesson_location = "";
|
|
@@ -4802,13 +5117,13 @@ var CMICore = (function (_super) {
|
|
|
4802
5117
|
_this._exit = "";
|
|
4803
5118
|
_this._session_time = "00:00:00";
|
|
4804
5119
|
_this._suspend_data = "";
|
|
4805
|
-
_this.score = new score
|
|
4806
|
-
score_children: api_constants
|
|
4807
|
-
score_range: regex
|
|
4808
|
-
invalidErrorCode: error_codes
|
|
4809
|
-
invalidTypeCode: error_codes
|
|
4810
|
-
invalidRangeCode: error_codes
|
|
4811
|
-
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,
|
|
4812
5127
|
});
|
|
4813
5128
|
return _this;
|
|
4814
5129
|
}
|
|
@@ -4817,12 +5132,20 @@ var CMICore = (function (_super) {
|
|
|
4817
5132
|
_super.prototype.initialize.call(this);
|
|
4818
5133
|
(_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
4819
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
|
+
};
|
|
4820
5143
|
Object.defineProperty(CMICore.prototype, "_children", {
|
|
4821
5144
|
get: function () {
|
|
4822
5145
|
return this.__children;
|
|
4823
5146
|
},
|
|
4824
5147
|
set: function (_children) {
|
|
4825
|
-
throw new
|
|
5148
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
4826
5149
|
},
|
|
4827
5150
|
enumerable: false,
|
|
4828
5151
|
configurable: true
|
|
@@ -4833,7 +5156,7 @@ var CMICore = (function (_super) {
|
|
|
4833
5156
|
},
|
|
4834
5157
|
set: function (student_id) {
|
|
4835
5158
|
if (this.initialized) {
|
|
4836
|
-
throw new
|
|
5159
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4837
5160
|
}
|
|
4838
5161
|
else {
|
|
4839
5162
|
this._student_id = student_id;
|
|
@@ -4848,7 +5171,7 @@ var CMICore = (function (_super) {
|
|
|
4848
5171
|
},
|
|
4849
5172
|
set: function (student_name) {
|
|
4850
5173
|
if (this.initialized) {
|
|
4851
|
-
throw new
|
|
5174
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4852
5175
|
}
|
|
4853
5176
|
else {
|
|
4854
5177
|
this._student_name = student_name;
|
|
@@ -4862,7 +5185,7 @@ var CMICore = (function (_super) {
|
|
|
4862
5185
|
return this._lesson_location;
|
|
4863
5186
|
},
|
|
4864
5187
|
set: function (lesson_location) {
|
|
4865
|
-
if ((0,validation
|
|
5188
|
+
if ((0,validation.check12ValidFormat)(lesson_location, regex.scorm12_regex.CMIString256, true)) {
|
|
4866
5189
|
this._lesson_location = lesson_location;
|
|
4867
5190
|
}
|
|
4868
5191
|
},
|
|
@@ -4875,7 +5198,7 @@ var CMICore = (function (_super) {
|
|
|
4875
5198
|
},
|
|
4876
5199
|
set: function (credit) {
|
|
4877
5200
|
if (this.initialized) {
|
|
4878
|
-
throw new
|
|
5201
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4879
5202
|
}
|
|
4880
5203
|
else {
|
|
4881
5204
|
this._credit = credit;
|
|
@@ -4890,12 +5213,12 @@ var CMICore = (function (_super) {
|
|
|
4890
5213
|
},
|
|
4891
5214
|
set: function (lesson_status) {
|
|
4892
5215
|
if (this.initialized) {
|
|
4893
|
-
if ((0,validation
|
|
5216
|
+
if ((0,validation.check12ValidFormat)(lesson_status, regex.scorm12_regex.CMIStatus)) {
|
|
4894
5217
|
this._lesson_status = lesson_status;
|
|
4895
5218
|
}
|
|
4896
5219
|
}
|
|
4897
5220
|
else {
|
|
4898
|
-
if ((0,validation
|
|
5221
|
+
if ((0,validation.check12ValidFormat)(lesson_status, regex.scorm12_regex.CMIStatus2)) {
|
|
4899
5222
|
this._lesson_status = lesson_status;
|
|
4900
5223
|
}
|
|
4901
5224
|
}
|
|
@@ -4909,7 +5232,7 @@ var CMICore = (function (_super) {
|
|
|
4909
5232
|
},
|
|
4910
5233
|
set: function (entry) {
|
|
4911
5234
|
if (this.initialized) {
|
|
4912
|
-
throw new
|
|
5235
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4913
5236
|
}
|
|
4914
5237
|
else {
|
|
4915
5238
|
this._entry = entry;
|
|
@@ -4924,7 +5247,7 @@ var CMICore = (function (_super) {
|
|
|
4924
5247
|
},
|
|
4925
5248
|
set: function (total_time) {
|
|
4926
5249
|
if (this.initialized) {
|
|
4927
|
-
throw new
|
|
5250
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4928
5251
|
}
|
|
4929
5252
|
else {
|
|
4930
5253
|
this._total_time = total_time;
|
|
@@ -4939,7 +5262,7 @@ var CMICore = (function (_super) {
|
|
|
4939
5262
|
},
|
|
4940
5263
|
set: function (lesson_mode) {
|
|
4941
5264
|
if (this.initialized) {
|
|
4942
|
-
throw new
|
|
5265
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4943
5266
|
}
|
|
4944
5267
|
else {
|
|
4945
5268
|
this._lesson_mode = lesson_mode;
|
|
@@ -4951,12 +5274,12 @@ var CMICore = (function (_super) {
|
|
|
4951
5274
|
Object.defineProperty(CMICore.prototype, "exit", {
|
|
4952
5275
|
get: function () {
|
|
4953
5276
|
if (!this.jsonString) {
|
|
4954
|
-
throw new
|
|
5277
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
4955
5278
|
}
|
|
4956
5279
|
return this._exit;
|
|
4957
5280
|
},
|
|
4958
5281
|
set: function (exit) {
|
|
4959
|
-
if ((0,validation
|
|
5282
|
+
if ((0,validation.check12ValidFormat)(exit, regex.scorm12_regex.CMIExit, true)) {
|
|
4960
5283
|
this._exit = exit;
|
|
4961
5284
|
}
|
|
4962
5285
|
},
|
|
@@ -4966,12 +5289,12 @@ var CMICore = (function (_super) {
|
|
|
4966
5289
|
Object.defineProperty(CMICore.prototype, "session_time", {
|
|
4967
5290
|
get: function () {
|
|
4968
5291
|
if (!this.jsonString) {
|
|
4969
|
-
throw new
|
|
5292
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
4970
5293
|
}
|
|
4971
5294
|
return this._session_time;
|
|
4972
5295
|
},
|
|
4973
5296
|
set: function (session_time) {
|
|
4974
|
-
if ((0,validation
|
|
5297
|
+
if ((0,validation.check12ValidFormat)(session_time, regex.scorm12_regex.CMITimespan)) {
|
|
4975
5298
|
this._session_time = session_time;
|
|
4976
5299
|
}
|
|
4977
5300
|
},
|
|
@@ -4983,7 +5306,7 @@ var CMICore = (function (_super) {
|
|
|
4983
5306
|
return this._suspend_data;
|
|
4984
5307
|
},
|
|
4985
5308
|
set: function (suspend_data) {
|
|
4986
|
-
if ((0,validation
|
|
5309
|
+
if ((0,validation.check12ValidFormat)(suspend_data, regex.scorm12_regex.CMIString4096, true)) {
|
|
4987
5310
|
this._suspend_data = suspend_data;
|
|
4988
5311
|
}
|
|
4989
5312
|
},
|
|
@@ -4995,9 +5318,9 @@ var CMICore = (function (_super) {
|
|
|
4995
5318
|
var startTime = start_time;
|
|
4996
5319
|
if (typeof startTime !== "undefined" && startTime !== null) {
|
|
4997
5320
|
var seconds = new Date().getTime() - startTime;
|
|
4998
|
-
sessionTime = utilities
|
|
5321
|
+
sessionTime = utilities.getSecondsAsHHMMSS(seconds / 1000);
|
|
4999
5322
|
}
|
|
5000
|
-
return utilities
|
|
5323
|
+
return utilities.addHHMMSSTimeStrings(this._total_time, sessionTime, new RegExp(regex.scorm12_regex.CMITimespan));
|
|
5001
5324
|
};
|
|
5002
5325
|
CMICore.prototype.toJSON = function () {
|
|
5003
5326
|
this.jsonString = true;
|
|
@@ -5017,7 +5340,7 @@ var CMICore = (function (_super) {
|
|
|
5017
5340
|
return result;
|
|
5018
5341
|
};
|
|
5019
5342
|
return CMICore;
|
|
5020
|
-
}(base_cmi
|
|
5343
|
+
}(base_cmi.BaseCMI));
|
|
5021
5344
|
|
|
5022
5345
|
|
|
5023
5346
|
// EXTERNAL MODULE: ./src/cmi/scorm12/objectives.ts
|
|
@@ -5042,7 +5365,7 @@ var interactions = __webpack_require__(833);
|
|
|
5042
5365
|
|
|
5043
5366
|
|
|
5044
5367
|
var CMI = (function (_super) {
|
|
5045
|
-
(0,tslib_es6
|
|
5368
|
+
(0,tslib_es6.__extends)(CMI, _super);
|
|
5046
5369
|
function CMI(cmi_children, student_data, initialized) {
|
|
5047
5370
|
var _this = _super.call(this) || this;
|
|
5048
5371
|
_this.__children = "";
|
|
@@ -5054,14 +5377,25 @@ var CMI = (function (_super) {
|
|
|
5054
5377
|
_this.initialize();
|
|
5055
5378
|
_this.__children = cmi_children
|
|
5056
5379
|
? cmi_children
|
|
5057
|
-
: api_constants
|
|
5380
|
+
: api_constants.scorm12_constants.cmi_children;
|
|
5058
5381
|
_this.core = new CMICore();
|
|
5059
|
-
_this.objectives = new objectives
|
|
5060
|
-
_this.student_data = student_data ? student_data : new scorm12_student_data
|
|
5061
|
-
_this.student_preference = new student_preference
|
|
5062
|
-
_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();
|
|
5063
5386
|
return _this;
|
|
5064
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
|
+
};
|
|
5065
5399
|
CMI.prototype.initialize = function () {
|
|
5066
5400
|
var _a, _b, _c, _d, _e;
|
|
5067
5401
|
_super.prototype.initialize.call(this);
|
|
@@ -5092,7 +5426,7 @@ var CMI = (function (_super) {
|
|
|
5092
5426
|
return this.__version;
|
|
5093
5427
|
},
|
|
5094
5428
|
set: function (_version) {
|
|
5095
|
-
throw new
|
|
5429
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
5096
5430
|
},
|
|
5097
5431
|
enumerable: false,
|
|
5098
5432
|
configurable: true
|
|
@@ -5102,7 +5436,7 @@ var CMI = (function (_super) {
|
|
|
5102
5436
|
return this.__children;
|
|
5103
5437
|
},
|
|
5104
5438
|
set: function (_children) {
|
|
5105
|
-
throw new
|
|
5439
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
5106
5440
|
},
|
|
5107
5441
|
enumerable: false,
|
|
5108
5442
|
configurable: true
|
|
@@ -5126,7 +5460,7 @@ var CMI = (function (_super) {
|
|
|
5126
5460
|
},
|
|
5127
5461
|
set: function (launch_data) {
|
|
5128
5462
|
if (this.initialized) {
|
|
5129
|
-
throw new
|
|
5463
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
5130
5464
|
}
|
|
5131
5465
|
else {
|
|
5132
5466
|
this._launch_data = launch_data;
|
|
@@ -5140,7 +5474,7 @@ var CMI = (function (_super) {
|
|
|
5140
5474
|
return this._comments;
|
|
5141
5475
|
},
|
|
5142
5476
|
set: function (comments) {
|
|
5143
|
-
if ((0,validation
|
|
5477
|
+
if ((0,validation.check12ValidFormat)(comments, regex.scorm12_regex.CMIString4096, true)) {
|
|
5144
5478
|
this._comments = comments;
|
|
5145
5479
|
}
|
|
5146
5480
|
},
|
|
@@ -5153,7 +5487,7 @@ var CMI = (function (_super) {
|
|
|
5153
5487
|
},
|
|
5154
5488
|
set: function (comments_from_lms) {
|
|
5155
5489
|
if (this.initialized) {
|
|
5156
|
-
throw new
|
|
5490
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
5157
5491
|
}
|
|
5158
5492
|
else {
|
|
5159
5493
|
this._comments_from_lms = comments_from_lms;
|
|
@@ -5166,7 +5500,7 @@ var CMI = (function (_super) {
|
|
|
5166
5500
|
return this.core.getCurrentTotalTime(this.start_time);
|
|
5167
5501
|
};
|
|
5168
5502
|
return CMI;
|
|
5169
|
-
}(base_cmi
|
|
5503
|
+
}(base_cmi.BaseRootCMI));
|
|
5170
5504
|
|
|
5171
5505
|
|
|
5172
5506
|
|
|
@@ -5175,17 +5509,18 @@ var CMI = (function (_super) {
|
|
|
5175
5509
|
/***/ 833:
|
|
5176
5510
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5177
5511
|
|
|
5512
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5178
5513
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5179
|
-
/* harmony export */
|
|
5180
|
-
/* harmony export */
|
|
5181
|
-
/* harmony export */
|
|
5182
|
-
/* 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; }
|
|
5183
5518
|
/* harmony export */ });
|
|
5184
5519
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(635);
|
|
5185
5520
|
/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(589);
|
|
5186
5521
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
5187
5522
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(797);
|
|
5188
|
-
/* harmony import */ var
|
|
5523
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(179);
|
|
5189
5524
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(319);
|
|
5190
5525
|
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(915);
|
|
5191
5526
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(417);
|
|
@@ -5198,19 +5533,19 @@ var CMI = (function (_super) {
|
|
|
5198
5533
|
|
|
5199
5534
|
|
|
5200
5535
|
var CMIInteractions = (function (_super) {
|
|
5201
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
5536
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractions, _super);
|
|
5202
5537
|
function CMIInteractions() {
|
|
5203
5538
|
return _super.call(this, {
|
|
5204
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
5205
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__
|
|
5206
|
-
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,
|
|
5207
5542
|
}) || this;
|
|
5208
5543
|
}
|
|
5209
5544
|
return CMIInteractions;
|
|
5210
|
-
}(_common_array__WEBPACK_IMPORTED_MODULE_0__
|
|
5545
|
+
}(_common_array__WEBPACK_IMPORTED_MODULE_0__.CMIArray));
|
|
5211
5546
|
|
|
5212
5547
|
var CMIInteractionsObject = (function (_super) {
|
|
5213
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
5548
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsObject, _super);
|
|
5214
5549
|
function CMIInteractionsObject() {
|
|
5215
5550
|
var _this = _super.call(this) || this;
|
|
5216
5551
|
_this._id = "";
|
|
@@ -5220,15 +5555,15 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5220
5555
|
_this._student_response = "";
|
|
5221
5556
|
_this._result = "";
|
|
5222
5557
|
_this._latency = "";
|
|
5223
|
-
_this.objectives = new _common_array__WEBPACK_IMPORTED_MODULE_0__
|
|
5224
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__
|
|
5225
|
-
errorClass:
|
|
5226
|
-
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,
|
|
5227
5562
|
});
|
|
5228
|
-
_this.correct_responses = new _common_array__WEBPACK_IMPORTED_MODULE_0__
|
|
5229
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__
|
|
5230
|
-
errorClass:
|
|
5231
|
-
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,
|
|
5232
5567
|
});
|
|
5233
5568
|
return _this;
|
|
5234
5569
|
}
|
|
@@ -5238,15 +5573,28 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5238
5573
|
(_a = this.objectives) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
5239
5574
|
(_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.initialize();
|
|
5240
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
|
+
};
|
|
5241
5589
|
Object.defineProperty(CMIInteractionsObject.prototype, "id", {
|
|
5242
5590
|
get: function () {
|
|
5243
5591
|
if (!this.jsonString) {
|
|
5244
|
-
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);
|
|
5245
5593
|
}
|
|
5246
5594
|
return this._id;
|
|
5247
5595
|
},
|
|
5248
5596
|
set: function (id) {
|
|
5249
|
-
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)) {
|
|
5250
5598
|
this._id = id;
|
|
5251
5599
|
}
|
|
5252
5600
|
},
|
|
@@ -5256,12 +5604,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5256
5604
|
Object.defineProperty(CMIInteractionsObject.prototype, "time", {
|
|
5257
5605
|
get: function () {
|
|
5258
5606
|
if (!this.jsonString) {
|
|
5259
|
-
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);
|
|
5260
5608
|
}
|
|
5261
5609
|
return this._time;
|
|
5262
5610
|
},
|
|
5263
5611
|
set: function (time) {
|
|
5264
|
-
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)) {
|
|
5265
5613
|
this._time = time;
|
|
5266
5614
|
}
|
|
5267
5615
|
},
|
|
@@ -5271,12 +5619,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5271
5619
|
Object.defineProperty(CMIInteractionsObject.prototype, "type", {
|
|
5272
5620
|
get: function () {
|
|
5273
5621
|
if (!this.jsonString) {
|
|
5274
|
-
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);
|
|
5275
5623
|
}
|
|
5276
5624
|
return this._type;
|
|
5277
5625
|
},
|
|
5278
5626
|
set: function (type) {
|
|
5279
|
-
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)) {
|
|
5280
5628
|
this._type = type;
|
|
5281
5629
|
}
|
|
5282
5630
|
},
|
|
@@ -5286,13 +5634,13 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5286
5634
|
Object.defineProperty(CMIInteractionsObject.prototype, "weighting", {
|
|
5287
5635
|
get: function () {
|
|
5288
5636
|
if (!this.jsonString) {
|
|
5289
|
-
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);
|
|
5290
5638
|
}
|
|
5291
5639
|
return this._weighting;
|
|
5292
5640
|
},
|
|
5293
5641
|
set: function (weighting) {
|
|
5294
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5295
|
-
(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)) {
|
|
5296
5644
|
this._weighting = weighting;
|
|
5297
5645
|
}
|
|
5298
5646
|
},
|
|
@@ -5302,12 +5650,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5302
5650
|
Object.defineProperty(CMIInteractionsObject.prototype, "student_response", {
|
|
5303
5651
|
get: function () {
|
|
5304
5652
|
if (!this.jsonString) {
|
|
5305
|
-
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);
|
|
5306
5654
|
}
|
|
5307
5655
|
return this._student_response;
|
|
5308
5656
|
},
|
|
5309
5657
|
set: function (student_response) {
|
|
5310
|
-
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)) {
|
|
5311
5659
|
this._student_response = student_response;
|
|
5312
5660
|
}
|
|
5313
5661
|
},
|
|
@@ -5317,12 +5665,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5317
5665
|
Object.defineProperty(CMIInteractionsObject.prototype, "result", {
|
|
5318
5666
|
get: function () {
|
|
5319
5667
|
if (!this.jsonString) {
|
|
5320
|
-
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);
|
|
5321
5669
|
}
|
|
5322
5670
|
return this._result;
|
|
5323
5671
|
},
|
|
5324
5672
|
set: function (result) {
|
|
5325
|
-
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)) {
|
|
5326
5674
|
this._result = result;
|
|
5327
5675
|
}
|
|
5328
5676
|
},
|
|
@@ -5332,12 +5680,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5332
5680
|
Object.defineProperty(CMIInteractionsObject.prototype, "latency", {
|
|
5333
5681
|
get: function () {
|
|
5334
5682
|
if (!this.jsonString) {
|
|
5335
|
-
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);
|
|
5336
5684
|
}
|
|
5337
5685
|
return this._latency;
|
|
5338
5686
|
},
|
|
5339
5687
|
set: function (latency) {
|
|
5340
|
-
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)) {
|
|
5341
5689
|
this._latency = latency;
|
|
5342
5690
|
}
|
|
5343
5691
|
},
|
|
@@ -5361,21 +5709,25 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5361
5709
|
return result;
|
|
5362
5710
|
};
|
|
5363
5711
|
return CMIInteractionsObject;
|
|
5364
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
5712
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
5365
5713
|
|
|
5366
5714
|
var CMIInteractionsObjectivesObject = (function (_super) {
|
|
5367
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
5715
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsObjectivesObject, _super);
|
|
5368
5716
|
function CMIInteractionsObjectivesObject() {
|
|
5369
5717
|
var _this = _super.call(this) || this;
|
|
5370
5718
|
_this._id = "";
|
|
5371
5719
|
return _this;
|
|
5372
5720
|
}
|
|
5721
|
+
CMIInteractionsObjectivesObject.prototype.reset = function () {
|
|
5722
|
+
this._initialized = false;
|
|
5723
|
+
this._id = "";
|
|
5724
|
+
};
|
|
5373
5725
|
Object.defineProperty(CMIInteractionsObjectivesObject.prototype, "id", {
|
|
5374
5726
|
get: function () {
|
|
5375
5727
|
return this._id;
|
|
5376
5728
|
},
|
|
5377
5729
|
set: function (id) {
|
|
5378
|
-
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)) {
|
|
5379
5731
|
this._id = id;
|
|
5380
5732
|
}
|
|
5381
5733
|
},
|
|
@@ -5391,24 +5743,28 @@ var CMIInteractionsObjectivesObject = (function (_super) {
|
|
|
5391
5743
|
return result;
|
|
5392
5744
|
};
|
|
5393
5745
|
return CMIInteractionsObjectivesObject;
|
|
5394
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
5746
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
5395
5747
|
|
|
5396
5748
|
var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
5397
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
5749
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsCorrectResponsesObject, _super);
|
|
5398
5750
|
function CMIInteractionsCorrectResponsesObject() {
|
|
5399
5751
|
var _this = _super.call(this) || this;
|
|
5400
5752
|
_this._pattern = "";
|
|
5401
5753
|
return _this;
|
|
5402
5754
|
}
|
|
5755
|
+
CMIInteractionsCorrectResponsesObject.prototype.reset = function () {
|
|
5756
|
+
this._initialized = false;
|
|
5757
|
+
this._pattern = "";
|
|
5758
|
+
};
|
|
5403
5759
|
Object.defineProperty(CMIInteractionsCorrectResponsesObject.prototype, "pattern", {
|
|
5404
5760
|
get: function () {
|
|
5405
5761
|
if (!this.jsonString) {
|
|
5406
|
-
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);
|
|
5407
5763
|
}
|
|
5408
5764
|
return this._pattern;
|
|
5409
5765
|
},
|
|
5410
5766
|
set: function (pattern) {
|
|
5411
|
-
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)) {
|
|
5412
5768
|
this._pattern = pattern;
|
|
5413
5769
|
}
|
|
5414
5770
|
},
|
|
@@ -5424,7 +5780,7 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
5424
5780
|
return result;
|
|
5425
5781
|
};
|
|
5426
5782
|
return CMIInteractionsCorrectResponsesObject;
|
|
5427
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
5783
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
5428
5784
|
|
|
5429
5785
|
|
|
5430
5786
|
|
|
@@ -5433,8 +5789,9 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
5433
5789
|
/***/ 331:
|
|
5434
5790
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5435
5791
|
|
|
5792
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5436
5793
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5437
|
-
/* harmony export */
|
|
5794
|
+
/* harmony export */ NAV: function() { return /* binding */ NAV; }
|
|
5438
5795
|
/* harmony export */ });
|
|
5439
5796
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635);
|
|
5440
5797
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
@@ -5445,18 +5802,22 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
5445
5802
|
|
|
5446
5803
|
|
|
5447
5804
|
var NAV = (function (_super) {
|
|
5448
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_3__
|
|
5805
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_3__.__extends)(NAV, _super);
|
|
5449
5806
|
function NAV() {
|
|
5450
5807
|
var _this = _super.call(this) || this;
|
|
5451
5808
|
_this._event = "";
|
|
5452
5809
|
return _this;
|
|
5453
5810
|
}
|
|
5811
|
+
NAV.prototype.reset = function () {
|
|
5812
|
+
this._event = "";
|
|
5813
|
+
this._initialized = false;
|
|
5814
|
+
};
|
|
5454
5815
|
Object.defineProperty(NAV.prototype, "event", {
|
|
5455
5816
|
get: function () {
|
|
5456
5817
|
return this._event;
|
|
5457
5818
|
},
|
|
5458
5819
|
set: function (event) {
|
|
5459
|
-
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)) {
|
|
5460
5821
|
this._event = event;
|
|
5461
5822
|
}
|
|
5462
5823
|
},
|
|
@@ -5472,7 +5833,7 @@ var NAV = (function (_super) {
|
|
|
5472
5833
|
return result;
|
|
5473
5834
|
};
|
|
5474
5835
|
return NAV;
|
|
5475
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
5836
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
5476
5837
|
|
|
5477
5838
|
|
|
5478
5839
|
|
|
@@ -5481,9 +5842,10 @@ var NAV = (function (_super) {
|
|
|
5481
5842
|
/***/ 176:
|
|
5482
5843
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5483
5844
|
|
|
5845
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5484
5846
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5485
|
-
/* harmony export */
|
|
5486
|
-
/* harmony export */
|
|
5847
|
+
/* harmony export */ CMIObjectives: function() { return /* binding */ CMIObjectives; },
|
|
5848
|
+
/* harmony export */ CMIObjectivesObject: function() { return /* binding */ CMIObjectivesObject; }
|
|
5487
5849
|
/* harmony export */ });
|
|
5488
5850
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(635);
|
|
5489
5851
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
@@ -5491,7 +5853,7 @@ var NAV = (function (_super) {
|
|
|
5491
5853
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(340);
|
|
5492
5854
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(417);
|
|
5493
5855
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(797);
|
|
5494
|
-
/* harmony import */ var
|
|
5856
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(179);
|
|
5495
5857
|
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(915);
|
|
5496
5858
|
/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(589);
|
|
5497
5859
|
|
|
@@ -5504,39 +5866,46 @@ var NAV = (function (_super) {
|
|
|
5504
5866
|
|
|
5505
5867
|
|
|
5506
5868
|
var CMIObjectives = (function (_super) {
|
|
5507
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_8__
|
|
5869
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_8__.__extends)(CMIObjectives, _super);
|
|
5508
5870
|
function CMIObjectives() {
|
|
5509
5871
|
return _super.call(this, {
|
|
5510
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
5511
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
5512
|
-
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,
|
|
5513
5875
|
}) || this;
|
|
5514
5876
|
}
|
|
5515
5877
|
return CMIObjectives;
|
|
5516
|
-
}(_common_array__WEBPACK_IMPORTED_MODULE_7__
|
|
5878
|
+
}(_common_array__WEBPACK_IMPORTED_MODULE_7__.CMIArray));
|
|
5517
5879
|
|
|
5518
5880
|
var CMIObjectivesObject = (function (_super) {
|
|
5519
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_8__
|
|
5881
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_8__.__extends)(CMIObjectivesObject, _super);
|
|
5520
5882
|
function CMIObjectivesObject() {
|
|
5521
5883
|
var _this = _super.call(this) || this;
|
|
5522
5884
|
_this._id = "";
|
|
5523
5885
|
_this._status = "";
|
|
5524
|
-
_this.score = new _common_score__WEBPACK_IMPORTED_MODULE_1__
|
|
5525
|
-
score_children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
5526
|
-
score_range: _constants_regex__WEBPACK_IMPORTED_MODULE_3__
|
|
5527
|
-
invalidErrorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
5528
|
-
invalidTypeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
5529
|
-
invalidRangeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
5530
|
-
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,
|
|
5531
5893
|
});
|
|
5532
5894
|
return _this;
|
|
5533
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
|
+
};
|
|
5534
5903
|
Object.defineProperty(CMIObjectivesObject.prototype, "id", {
|
|
5535
5904
|
get: function () {
|
|
5536
5905
|
return this._id;
|
|
5537
5906
|
},
|
|
5538
5907
|
set: function (id) {
|
|
5539
|
-
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)) {
|
|
5540
5909
|
this._id = id;
|
|
5541
5910
|
}
|
|
5542
5911
|
},
|
|
@@ -5548,7 +5917,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
5548
5917
|
return this._status;
|
|
5549
5918
|
},
|
|
5550
5919
|
set: function (status) {
|
|
5551
|
-
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)) {
|
|
5552
5921
|
this._status = status;
|
|
5553
5922
|
}
|
|
5554
5923
|
},
|
|
@@ -5566,7 +5935,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
5566
5935
|
return result;
|
|
5567
5936
|
};
|
|
5568
5937
|
return CMIObjectivesObject;
|
|
5569
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
5938
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
5570
5939
|
|
|
5571
5940
|
|
|
5572
5941
|
|
|
@@ -5575,13 +5944,14 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
5575
5944
|
/***/ 532:
|
|
5576
5945
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5577
5946
|
|
|
5947
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5578
5948
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5579
|
-
/* harmony export */
|
|
5949
|
+
/* harmony export */ CMIStudentData: function() { return /* binding */ CMIStudentData; }
|
|
5580
5950
|
/* harmony export */ });
|
|
5581
5951
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635);
|
|
5582
5952
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
5583
5953
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
5584
|
-
/* harmony import */ var
|
|
5954
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(179);
|
|
5585
5955
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797);
|
|
5586
5956
|
|
|
5587
5957
|
|
|
@@ -5589,7 +5959,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
5589
5959
|
|
|
5590
5960
|
|
|
5591
5961
|
var CMIStudentData = (function (_super) {
|
|
5592
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_4__
|
|
5962
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_4__.__extends)(CMIStudentData, _super);
|
|
5593
5963
|
function CMIStudentData(student_data_children) {
|
|
5594
5964
|
var _this = _super.call(this) || this;
|
|
5595
5965
|
_this._mastery_score = "";
|
|
@@ -5597,15 +5967,18 @@ var CMIStudentData = (function (_super) {
|
|
|
5597
5967
|
_this._time_limit_action = "";
|
|
5598
5968
|
_this.__children = student_data_children
|
|
5599
5969
|
? student_data_children
|
|
5600
|
-
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
5970
|
+
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.student_data_children;
|
|
5601
5971
|
return _this;
|
|
5602
5972
|
}
|
|
5973
|
+
CMIStudentData.prototype.reset = function () {
|
|
5974
|
+
this._initialized = false;
|
|
5975
|
+
};
|
|
5603
5976
|
Object.defineProperty(CMIStudentData.prototype, "_children", {
|
|
5604
5977
|
get: function () {
|
|
5605
5978
|
return this.__children;
|
|
5606
5979
|
},
|
|
5607
5980
|
set: function (_children) {
|
|
5608
|
-
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);
|
|
5609
5982
|
},
|
|
5610
5983
|
enumerable: false,
|
|
5611
5984
|
configurable: true
|
|
@@ -5616,7 +5989,7 @@ var CMIStudentData = (function (_super) {
|
|
|
5616
5989
|
},
|
|
5617
5990
|
set: function (mastery_score) {
|
|
5618
5991
|
if (this.initialized) {
|
|
5619
|
-
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);
|
|
5620
5993
|
}
|
|
5621
5994
|
else {
|
|
5622
5995
|
this._mastery_score = mastery_score;
|
|
@@ -5631,7 +6004,7 @@ var CMIStudentData = (function (_super) {
|
|
|
5631
6004
|
},
|
|
5632
6005
|
set: function (max_time_allowed) {
|
|
5633
6006
|
if (this.initialized) {
|
|
5634
|
-
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);
|
|
5635
6008
|
}
|
|
5636
6009
|
else {
|
|
5637
6010
|
this._max_time_allowed = max_time_allowed;
|
|
@@ -5646,7 +6019,7 @@ var CMIStudentData = (function (_super) {
|
|
|
5646
6019
|
},
|
|
5647
6020
|
set: function (time_limit_action) {
|
|
5648
6021
|
if (this.initialized) {
|
|
5649
|
-
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);
|
|
5650
6023
|
}
|
|
5651
6024
|
else {
|
|
5652
6025
|
this._time_limit_action = time_limit_action;
|
|
@@ -5666,7 +6039,7 @@ var CMIStudentData = (function (_super) {
|
|
|
5666
6039
|
return result;
|
|
5667
6040
|
};
|
|
5668
6041
|
return CMIStudentData;
|
|
5669
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
6042
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
5670
6043
|
|
|
5671
6044
|
|
|
5672
6045
|
|
|
@@ -5675,16 +6048,17 @@ var CMIStudentData = (function (_super) {
|
|
|
5675
6048
|
/***/ 181:
|
|
5676
6049
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5677
6050
|
|
|
6051
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5678
6052
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5679
|
-
/* harmony export */
|
|
6053
|
+
/* harmony export */ CMIStudentPreference: function() { return /* binding */ CMIStudentPreference; }
|
|
5680
6054
|
/* harmony export */ });
|
|
5681
6055
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(635);
|
|
5682
6056
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
5683
6057
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
5684
|
-
/* harmony import */ var
|
|
5685
|
-
/* harmony import */ var
|
|
5686
|
-
/* harmony import */ var
|
|
5687
|
-
/* 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);
|
|
5688
6062
|
|
|
5689
6063
|
|
|
5690
6064
|
|
|
@@ -5693,7 +6067,7 @@ var CMIStudentData = (function (_super) {
|
|
|
5693
6067
|
|
|
5694
6068
|
|
|
5695
6069
|
var CMIStudentPreference = (function (_super) {
|
|
5696
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_6__
|
|
6070
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_6__.__extends)(CMIStudentPreference, _super);
|
|
5697
6071
|
function CMIStudentPreference(student_preference_children) {
|
|
5698
6072
|
var _this = _super.call(this) || this;
|
|
5699
6073
|
_this._audio = "";
|
|
@@ -5702,15 +6076,18 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5702
6076
|
_this._text = "";
|
|
5703
6077
|
_this.__children = student_preference_children
|
|
5704
6078
|
? student_preference_children
|
|
5705
|
-
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
6079
|
+
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.student_preference_children;
|
|
5706
6080
|
return _this;
|
|
5707
6081
|
}
|
|
6082
|
+
CMIStudentPreference.prototype.reset = function () {
|
|
6083
|
+
this._initialized = false;
|
|
6084
|
+
};
|
|
5708
6085
|
Object.defineProperty(CMIStudentPreference.prototype, "_children", {
|
|
5709
6086
|
get: function () {
|
|
5710
6087
|
return this.__children;
|
|
5711
6088
|
},
|
|
5712
6089
|
set: function (_children) {
|
|
5713
|
-
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);
|
|
5714
6091
|
},
|
|
5715
6092
|
enumerable: false,
|
|
5716
6093
|
configurable: true
|
|
@@ -5720,8 +6097,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5720
6097
|
return this._audio;
|
|
5721
6098
|
},
|
|
5722
6099
|
set: function (audio) {
|
|
5723
|
-
if ((0,
|
|
5724
|
-
(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)) {
|
|
5725
6102
|
this._audio = audio;
|
|
5726
6103
|
}
|
|
5727
6104
|
},
|
|
@@ -5733,7 +6110,7 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5733
6110
|
return this._language;
|
|
5734
6111
|
},
|
|
5735
6112
|
set: function (language) {
|
|
5736
|
-
if ((0,
|
|
6113
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(language, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMIString256)) {
|
|
5737
6114
|
this._language = language;
|
|
5738
6115
|
}
|
|
5739
6116
|
},
|
|
@@ -5745,8 +6122,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5745
6122
|
return this._speed;
|
|
5746
6123
|
},
|
|
5747
6124
|
set: function (speed) {
|
|
5748
|
-
if ((0,
|
|
5749
|
-
(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)) {
|
|
5750
6127
|
this._speed = speed;
|
|
5751
6128
|
}
|
|
5752
6129
|
},
|
|
@@ -5758,8 +6135,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5758
6135
|
return this._text;
|
|
5759
6136
|
},
|
|
5760
6137
|
set: function (text) {
|
|
5761
|
-
if ((0,
|
|
5762
|
-
(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)) {
|
|
5763
6140
|
this._text = text;
|
|
5764
6141
|
}
|
|
5765
6142
|
},
|
|
@@ -5778,7 +6155,7 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5778
6155
|
return result;
|
|
5779
6156
|
};
|
|
5780
6157
|
return CMIStudentPreference;
|
|
5781
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
6158
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
5782
6159
|
|
|
5783
6160
|
|
|
5784
6161
|
|
|
@@ -5787,24 +6164,25 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5787
6164
|
/***/ 915:
|
|
5788
6165
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5789
6166
|
|
|
6167
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5790
6168
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5791
|
-
/* harmony export */
|
|
5792
|
-
/* harmony export */
|
|
6169
|
+
/* harmony export */ check12ValidFormat: function() { return /* binding */ check12ValidFormat; },
|
|
6170
|
+
/* harmony export */ check12ValidRange: function() { return /* binding */ check12ValidRange; }
|
|
5793
6171
|
/* harmony export */ });
|
|
5794
6172
|
/* harmony import */ var _common_validation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(449);
|
|
5795
6173
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(797);
|
|
5796
|
-
/* harmony import */ var
|
|
6174
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(179);
|
|
5797
6175
|
|
|
5798
6176
|
|
|
5799
6177
|
|
|
5800
6178
|
function check12ValidFormat(value, regexPattern, allowEmptyString) {
|
|
5801
|
-
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);
|
|
5802
6180
|
}
|
|
5803
6181
|
function check12ValidRange(value, rangePattern, allowEmptyString) {
|
|
5804
6182
|
if (!allowEmptyString && value === "") {
|
|
5805
|
-
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);
|
|
5806
6184
|
}
|
|
5807
|
-
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);
|
|
5808
6186
|
}
|
|
5809
6187
|
|
|
5810
6188
|
|
|
@@ -5813,21 +6191,23 @@ function check12ValidRange(value, rangePattern, allowEmptyString) {
|
|
|
5813
6191
|
/***/ 340:
|
|
5814
6192
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5815
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 */ });
|
|
5816
6201
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
5817
6202
|
|
|
5818
|
-
var
|
|
6203
|
+
var global_constants = {
|
|
5819
6204
|
SCORM_TRUE: "true",
|
|
5820
6205
|
SCORM_FALSE: "false",
|
|
5821
6206
|
STATE_NOT_INITIALIZED: 0,
|
|
5822
6207
|
STATE_INITIALIZED: 1,
|
|
5823
6208
|
STATE_TERMINATED: 2,
|
|
5824
|
-
LOG_LEVEL_DEBUG: 1,
|
|
5825
|
-
LOG_LEVEL_INFO: 2,
|
|
5826
|
-
LOG_LEVEL_WARNING: 3,
|
|
5827
|
-
LOG_LEVEL_ERROR: 4,
|
|
5828
|
-
LOG_LEVEL_NONE: 5,
|
|
5829
6209
|
};
|
|
5830
|
-
var
|
|
6210
|
+
var scorm12_constants = {
|
|
5831
6211
|
cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",
|
|
5832
6212
|
core_children: "student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",
|
|
5833
6213
|
score_children: "raw,min,max",
|
|
@@ -5888,7 +6268,7 @@ var scorm12 = {
|
|
|
5888
6268
|
},
|
|
5889
6269
|
},
|
|
5890
6270
|
};
|
|
5891
|
-
var
|
|
6271
|
+
var aicc_constants = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, scorm12_constants), {
|
|
5892
6272
|
cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",
|
|
5893
6273
|
student_preference_children: "audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",
|
|
5894
6274
|
student_data_children: "attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",
|
|
@@ -5897,7 +6277,7 @@ var aicc = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__W
|
|
|
5897
6277
|
attempt_records_children: "score,lesson_status",
|
|
5898
6278
|
paths_children: "location_id,date,time,status,why_left,time_in_element",
|
|
5899
6279
|
});
|
|
5900
|
-
var
|
|
6280
|
+
var scorm2004_constants = {
|
|
5901
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",
|
|
5902
6282
|
comments_children: "comment,timestamp,location",
|
|
5903
6283
|
score_children: "max,raw,scaled,min",
|
|
@@ -5906,6 +6286,7 @@ var scorm2004 = {
|
|
|
5906
6286
|
student_data_children: "mastery_score,max_time_allowed,time_limit_action",
|
|
5907
6287
|
student_preference_children: "audio_level,audio_captioning,delivery_speed,language",
|
|
5908
6288
|
interactions_children: "id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",
|
|
6289
|
+
adl_data_children: "id,store",
|
|
5909
6290
|
error_descriptions: {
|
|
5910
6291
|
"0": {
|
|
5911
6292
|
basicMessage: "No Error",
|
|
@@ -6013,13 +6394,6 @@ var scorm2004 = {
|
|
|
6013
6394
|
},
|
|
6014
6395
|
},
|
|
6015
6396
|
};
|
|
6016
|
-
var APIConstants = {
|
|
6017
|
-
global: global,
|
|
6018
|
-
scorm12: scorm12,
|
|
6019
|
-
aicc: aicc,
|
|
6020
|
-
scorm2004: scorm2004,
|
|
6021
|
-
};
|
|
6022
|
-
/* harmony default export */ __webpack_exports__.A = (APIConstants);
|
|
6023
6397
|
|
|
6024
6398
|
|
|
6025
6399
|
/***/ }),
|
|
@@ -6027,10 +6401,12 @@ var APIConstants = {
|
|
|
6027
6401
|
/***/ 56:
|
|
6028
6402
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6029
6403
|
|
|
6404
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6030
6405
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6031
|
-
/* harmony export */
|
|
6032
|
-
/* harmony export */
|
|
6033
|
-
/* 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; }
|
|
6034
6410
|
/* harmony export */ });
|
|
6035
6411
|
var NAVBoolean;
|
|
6036
6412
|
(function (NAVBoolean) {
|
|
@@ -6050,6 +6426,15 @@ var CompletionStatus;
|
|
|
6050
6426
|
CompletionStatus["incomplete"] = "incomplete";
|
|
6051
6427
|
CompletionStatus["unknown"] = "unknown";
|
|
6052
6428
|
})(CompletionStatus || (CompletionStatus = {}));
|
|
6429
|
+
var LogLevelEnum;
|
|
6430
|
+
(function (LogLevelEnum) {
|
|
6431
|
+
LogLevelEnum[LogLevelEnum["_"] = 0] = "_";
|
|
6432
|
+
LogLevelEnum[LogLevelEnum["DEBUG"] = 1] = "DEBUG";
|
|
6433
|
+
LogLevelEnum[LogLevelEnum["INFO"] = 2] = "INFO";
|
|
6434
|
+
LogLevelEnum[LogLevelEnum["WARN"] = 3] = "WARN";
|
|
6435
|
+
LogLevelEnum[LogLevelEnum["ERROR"] = 4] = "ERROR";
|
|
6436
|
+
LogLevelEnum[LogLevelEnum["NONE"] = 5] = "NONE";
|
|
6437
|
+
})(LogLevelEnum || (LogLevelEnum = {}));
|
|
6053
6438
|
|
|
6054
6439
|
|
|
6055
6440
|
/***/ }),
|
|
@@ -6057,9 +6442,15 @@ var CompletionStatus;
|
|
|
6057
6442
|
/***/ 797:
|
|
6058
6443
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6059
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 */ });
|
|
6060
6451
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
6061
6452
|
|
|
6062
|
-
var
|
|
6453
|
+
var global_errors = {
|
|
6063
6454
|
GENERAL: 101,
|
|
6064
6455
|
INITIALIZATION_FAILED: 101,
|
|
6065
6456
|
INITIALIZED: 101,
|
|
@@ -6089,13 +6480,8 @@ var global = {
|
|
|
6089
6480
|
VALUE_OUT_OF_RANGE: 101,
|
|
6090
6481
|
DEPENDENCY_NOT_ESTABLISHED: 101,
|
|
6091
6482
|
};
|
|
6092
|
-
var
|
|
6093
|
-
var
|
|
6094
|
-
var ErrorCodes = {
|
|
6095
|
-
scorm12: scorm12,
|
|
6096
|
-
scorm2004: scorm2004,
|
|
6097
|
-
};
|
|
6098
|
-
/* 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 });
|
|
6099
6485
|
|
|
6100
6486
|
|
|
6101
6487
|
/***/ }),
|
|
@@ -6103,9 +6489,15 @@ var ErrorCodes = {
|
|
|
6103
6489
|
/***/ 417:
|
|
6104
6490
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6105
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 */ });
|
|
6106
6498
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
6107
6499
|
|
|
6108
|
-
var
|
|
6500
|
+
var scorm12_regex = {
|
|
6109
6501
|
CMIString256: "^.{0,255}$",
|
|
6110
6502
|
CMIString4096: "^.{0,4096}$",
|
|
6111
6503
|
CMITime: "^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",
|
|
@@ -6128,10 +6520,10 @@ var scorm12 = {
|
|
|
6128
6520
|
weighting_range: "-100#100",
|
|
6129
6521
|
text_range: "-1#1",
|
|
6130
6522
|
};
|
|
6131
|
-
var
|
|
6523
|
+
var aicc_regex = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, scorm12_regex), {
|
|
6132
6524
|
CMIIdentifier: "^\\w{1,255}$",
|
|
6133
6525
|
});
|
|
6134
|
-
var
|
|
6526
|
+
var scorm2004_regex = {
|
|
6135
6527
|
CMIString200: "^[\\u0000-\\uFFFF]{0,200}$",
|
|
6136
6528
|
CMIString250: "^[\\u0000-\\uFFFF]{0,250}$",
|
|
6137
6529
|
CMIString1000: "^[\\u0000-\\uFFFF]{0,1000}$",
|
|
@@ -6158,7 +6550,7 @@ var scorm2004 = {
|
|
|
6158
6550
|
CMIExit: "^(time-out|suspend|logout|normal)$",
|
|
6159
6551
|
CMIType: "^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",
|
|
6160
6552
|
CMIResult: "^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",
|
|
6161
|
-
NAVEvent: "^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target
|
|
6553
|
+
NAVEvent: "^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=(?<choice_target>\\S{0,}[a-zA-Z0-9-_]+)})?choice|(\\{target=(?<jump_target>\\S{0,}[a-zA-Z0-9-_]+)})?jump)$",
|
|
6162
6554
|
NAVBoolean: "^(unknown|true|false$)",
|
|
6163
6555
|
NAVTarget: "^{target=\\S{0,}[a-zA-Z0-9-_]+}$",
|
|
6164
6556
|
scaled_range: "-1#1",
|
|
@@ -6167,12 +6559,6 @@ var scorm2004 = {
|
|
|
6167
6559
|
text_range: "-1#1",
|
|
6168
6560
|
progress_range: "0#1",
|
|
6169
6561
|
};
|
|
6170
|
-
var Regex = {
|
|
6171
|
-
aicc: aicc,
|
|
6172
|
-
scorm12: scorm12,
|
|
6173
|
-
scorm2004: scorm2004,
|
|
6174
|
-
};
|
|
6175
|
-
/* harmony default export */ __webpack_exports__.A = (Regex);
|
|
6176
6562
|
|
|
6177
6563
|
|
|
6178
6564
|
/***/ }),
|
|
@@ -6180,22 +6566,15 @@ var Regex = {
|
|
|
6180
6566
|
/***/ 784:
|
|
6181
6567
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6182
6568
|
|
|
6569
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6183
6570
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6184
|
-
/* harmony export */
|
|
6185
|
-
/* harmony export */
|
|
6186
|
-
/* harmony export */ tQ: function() { return /* binding */ Scorm12ValidationError; },
|
|
6187
|
-
/* harmony export */ wq: function() { return /* binding */ Scorm2004ValidationError; },
|
|
6188
|
-
/* harmony export */ yI: function() { return /* binding */ ValidationError; }
|
|
6571
|
+
/* harmony export */ BaseScormValidationError: function() { return /* binding */ BaseScormValidationError; },
|
|
6572
|
+
/* harmony export */ ValidationError: function() { return /* binding */ ValidationError; }
|
|
6189
6573
|
/* harmony export */ });
|
|
6190
|
-
/* harmony import */ var
|
|
6191
|
-
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340);
|
|
6192
|
-
|
|
6574
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
6193
6575
|
|
|
6194
|
-
var scorm12_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.error_descriptions;
|
|
6195
|
-
var aicc_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.aicc.error_descriptions;
|
|
6196
|
-
var scorm2004_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm2004.error_descriptions;
|
|
6197
6576
|
var BaseScormValidationError = (function (_super) {
|
|
6198
|
-
(0,
|
|
6577
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(BaseScormValidationError, _super);
|
|
6199
6578
|
function BaseScormValidationError(errorCode) {
|
|
6200
6579
|
var _this = _super.call(this, errorCode.toString()) || this;
|
|
6201
6580
|
_this._errorCode = errorCode;
|
|
@@ -6209,18 +6588,15 @@ var BaseScormValidationError = (function (_super) {
|
|
|
6209
6588
|
enumerable: false,
|
|
6210
6589
|
configurable: true
|
|
6211
6590
|
});
|
|
6212
|
-
BaseScormValidationError.prototype.setMessage = function (message) {
|
|
6213
|
-
this.message = message;
|
|
6214
|
-
};
|
|
6215
6591
|
return BaseScormValidationError;
|
|
6216
6592
|
}(Error));
|
|
6217
6593
|
|
|
6218
6594
|
var ValidationError = (function (_super) {
|
|
6219
|
-
(0,
|
|
6595
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(ValidationError, _super);
|
|
6220
6596
|
function ValidationError(errorCode, errorMessage, detailedMessage) {
|
|
6221
6597
|
var _this = _super.call(this, errorCode) || this;
|
|
6222
6598
|
_this._detailedMessage = "";
|
|
6223
|
-
_this.
|
|
6599
|
+
_this.message = errorMessage;
|
|
6224
6600
|
_this._errorMessage = errorMessage;
|
|
6225
6601
|
if (detailedMessage) {
|
|
6226
6602
|
_this._detailedMessage = detailedMessage;
|
|
@@ -6244,8 +6620,26 @@ var ValidationError = (function (_super) {
|
|
|
6244
6620
|
return ValidationError;
|
|
6245
6621
|
}(BaseScormValidationError));
|
|
6246
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;
|
|
6247
6641
|
var Scorm12ValidationError = (function (_super) {
|
|
6248
|
-
(0,
|
|
6642
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_2__.__extends)(Scorm12ValidationError, _super);
|
|
6249
6643
|
function Scorm12ValidationError(errorCode) {
|
|
6250
6644
|
var _this = this;
|
|
6251
6645
|
if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {
|
|
@@ -6257,37 +6651,7 @@ var Scorm12ValidationError = (function (_super) {
|
|
|
6257
6651
|
return _this;
|
|
6258
6652
|
}
|
|
6259
6653
|
return Scorm12ValidationError;
|
|
6260
|
-
}(ValidationError));
|
|
6261
|
-
|
|
6262
|
-
var AICCValidationError = (function (_super) {
|
|
6263
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(AICCValidationError, _super);
|
|
6264
|
-
function AICCValidationError(errorCode) {
|
|
6265
|
-
var _this = this;
|
|
6266
|
-
if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {
|
|
6267
|
-
_this = _super.call(this, errorCode, aicc_errors[String(errorCode)].basicMessage, aicc_errors[String(errorCode)].detailMessage) || this;
|
|
6268
|
-
}
|
|
6269
|
-
else {
|
|
6270
|
-
_this = _super.call(this, 101, aicc_errors["101"].basicMessage, aicc_errors["101"].detailMessage) || this;
|
|
6271
|
-
}
|
|
6272
|
-
return _this;
|
|
6273
|
-
}
|
|
6274
|
-
return AICCValidationError;
|
|
6275
|
-
}(ValidationError));
|
|
6276
|
-
|
|
6277
|
-
var Scorm2004ValidationError = (function (_super) {
|
|
6278
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(Scorm2004ValidationError, _super);
|
|
6279
|
-
function Scorm2004ValidationError(errorCode) {
|
|
6280
|
-
var _this = this;
|
|
6281
|
-
if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {
|
|
6282
|
-
_this = _super.call(this, errorCode, scorm2004_errors[String(errorCode)].basicMessage, scorm2004_errors[String(errorCode)].detailMessage) || this;
|
|
6283
|
-
}
|
|
6284
|
-
else {
|
|
6285
|
-
_this = _super.call(this, 101, scorm2004_errors["101"].basicMessage, scorm2004_errors["101"].detailMessage) || this;
|
|
6286
|
-
}
|
|
6287
|
-
return _this;
|
|
6288
|
-
}
|
|
6289
|
-
return Scorm2004ValidationError;
|
|
6290
|
-
}(ValidationError));
|
|
6654
|
+
}(_exceptions__WEBPACK_IMPORTED_MODULE_0__.ValidationError));
|
|
6291
6655
|
|
|
6292
6656
|
|
|
6293
6657
|
|
|
@@ -6296,19 +6660,24 @@ var Scorm2004ValidationError = (function (_super) {
|
|
|
6296
6660
|
/***/ 864:
|
|
6297
6661
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6298
6662
|
|
|
6663
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6299
6664
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6300
|
-
/* harmony export */
|
|
6301
|
-
/* harmony export */
|
|
6302
|
-
/* harmony export */
|
|
6303
|
-
/* harmony export */
|
|
6304
|
-
/* harmony export */
|
|
6305
|
-
/* harmony export */
|
|
6306
|
-
/* harmony export */
|
|
6307
|
-
/* harmony export */
|
|
6308
|
-
/* harmony export */
|
|
6309
|
-
/* 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; }
|
|
6310
6680
|
/* harmony export */ });
|
|
6311
|
-
/* unused harmony exports SECONDS_PER_SECOND, SECONDS_PER_MINUTE, SECONDS_PER_HOUR, SECONDS_PER_DAY, countDecimals */
|
|
6312
6681
|
var SECONDS_PER_SECOND = 1.0;
|
|
6313
6682
|
var SECONDS_PER_MINUTE = 60;
|
|
6314
6683
|
var SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;
|
|
@@ -6500,13 +6869,40 @@ function stringMatches(str, tester) {
|
|
|
6500
6869
|
/***/ 635:
|
|
6501
6870
|
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
6502
6871
|
|
|
6872
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6503
6873
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6504
|
-
/* harmony export */
|
|
6505
|
-
/* harmony export */
|
|
6506
|
-
/* harmony export */
|
|
6507
|
-
/* 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; }
|
|
6508
6905
|
/* harmony export */ });
|
|
6509
|
-
/* 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 */
|
|
6510
6906
|
/******************************************************************************
|
|
6511
6907
|
Copyright (c) Microsoft Corporation.
|
|
6512
6908
|
|
|
@@ -6856,7 +7252,7 @@ function __disposeResources(env) {
|
|
|
6856
7252
|
return next();
|
|
6857
7253
|
}
|
|
6858
7254
|
|
|
6859
|
-
/*
|
|
7255
|
+
/* harmony default export */ __webpack_exports__["default"] = ({
|
|
6860
7256
|
__extends,
|
|
6861
7257
|
__assign,
|
|
6862
7258
|
__rest,
|
|
@@ -6933,27 +7329,39 @@ function __disposeResources(env) {
|
|
|
6933
7329
|
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
|
|
6934
7330
|
/******/ }();
|
|
6935
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
|
+
/******/
|
|
6936
7343
|
/************************************************************************/
|
|
6937
7344
|
var __webpack_exports__ = {};
|
|
7345
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6938
7346
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6939
|
-
/* harmony export */
|
|
6940
|
-
/* harmony export */
|
|
6941
|
-
/* 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; }
|
|
6942
7350
|
/* harmony export */ });
|
|
6943
|
-
/* harmony import */ var _AICC__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
7351
|
+
/* harmony import */ var _AICC__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(916);
|
|
6944
7352
|
/* harmony import */ var _Scorm12API__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(941);
|
|
6945
|
-
/* harmony import */ var _Scorm2004API__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
7353
|
+
/* harmony import */ var _Scorm2004API__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(809);
|
|
6946
7354
|
|
|
6947
7355
|
|
|
6948
7356
|
|
|
6949
|
-
var Scorm12API = _Scorm12API__WEBPACK_IMPORTED_MODULE_1__
|
|
6950
|
-
var Scorm2004API = _Scorm2004API__WEBPACK_IMPORTED_MODULE_2__
|
|
6951
|
-
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;
|
|
6952
7360
|
|
|
6953
7361
|
|
|
6954
|
-
var __webpack_exports__AICC = __webpack_exports__.
|
|
6955
|
-
var __webpack_exports__Scorm12API = __webpack_exports__.
|
|
6956
|
-
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;
|
|
6957
7365
|
export { __webpack_exports__AICC as AICC, __webpack_exports__Scorm12API as Scorm12API, __webpack_exports__Scorm2004API as Scorm2004API };
|
|
6958
7366
|
|
|
6959
7367
|
//# sourceMappingURL=scorm-again.js.map
|