scorm-again 2.5.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aicc.js +657 -489
- 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 +670 -489
- 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 +1113 -729
- package/dist/esm/scorm-again.js.map +1 -1
- package/dist/esm/scorm-again.min.js +1 -1
- package/dist/esm/scorm-again.min.js.map +1 -1
- package/dist/esm/scorm12.js +512 -394
- 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 +678 -452
- 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 +1100 -728
- 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 +500 -394
- 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 +665 -452
- package/dist/scorm2004.js.map +1 -1
- package/dist/scorm2004.min.js +1 -1
- package/dist/scorm2004.min.js.map +1 -1
- package/dist_test.html +208 -0
- package/package.json +14 -14
- package/src/AICC.ts +6 -3
- package/src/BaseAPI.ts +43 -37
- package/src/Scorm12API.ts +17 -23
- package/src/Scorm2004API.ts +99 -42
- package/src/ScormAgain.ts +3 -7
- package/src/cmi/aicc/attempts.ts +22 -12
- package/src/cmi/aicc/cmi.ts +2 -2
- package/src/cmi/aicc/core.ts +44 -26
- package/src/cmi/aicc/evaluation.ts +31 -12
- package/src/cmi/aicc/paths.ts +29 -15
- package/src/cmi/aicc/student_data.ts +14 -5
- package/src/cmi/aicc/student_demographics.ts +31 -24
- package/src/cmi/aicc/student_preferences.ts +11 -11
- package/src/cmi/aicc/tries.ts +24 -14
- package/src/cmi/aicc/validation.ts +3 -4
- package/src/cmi/common/array.ts +17 -5
- package/src/cmi/common/base_cmi.ts +3 -1
- package/src/cmi/common/score.ts +16 -13
- package/src/cmi/scorm12/cmi.ts +25 -10
- package/src/cmi/scorm12/interactions.ts +62 -28
- package/src/cmi/scorm12/nav.ts +13 -5
- package/src/cmi/scorm12/objectives.ts +28 -18
- package/src/cmi/scorm12/student_data.ts +15 -8
- package/src/cmi/scorm12/student_preference.ts +20 -13
- package/src/cmi/scorm12/validation.ts +7 -7
- package/src/cmi/scorm2004/adl.ts +141 -25
- package/src/cmi/scorm2004/cmi.ts +50 -55
- package/src/cmi/scorm2004/comments.ts +21 -20
- package/src/cmi/scorm2004/interactions.ts +73 -32
- package/src/cmi/scorm2004/learner_preference.ts +20 -13
- package/src/cmi/scorm2004/objectives.ts +41 -16
- package/src/cmi/scorm2004/score.ts +22 -11
- package/src/cmi/scorm2004/validation.ts +4 -4
- package/src/constants/api_constants.ts +8 -19
- package/src/constants/default_settings.ts +6 -5
- package/src/constants/error_codes.ts +5 -12
- package/src/constants/regex.ts +4 -10
- package/src/constants/response_constants.ts +1 -2
- package/src/exceptions/aicc_exceptions.ts +29 -0
- package/src/exceptions/scorm12_exceptions.ts +29 -0
- package/src/exceptions/scorm2004_exceptions.ts +29 -0
- package/src/exceptions.ts +0 -81
- package/src/types/api_types.ts +3 -2
- package/test/AICC.spec.ts +114 -43
- package/test/Scorm12API.spec.ts +60 -39
- package/test/Scorm2004API.spec.ts +165 -80
- package/test/cmi/aicc_cmi.spec.ts +6 -9
- package/test/cmi/scorm12_cmi.spec.ts +8 -8
- package/test/cmi/scorm2004_cmi.spec.ts +8 -9
- package/test/exceptions.spec.ts +11 -9
- package/test/types/api_types.spec.ts +3 -3
- package/test/utilities.spec.ts +1 -4
- package/webpack.config.js +5 -1
package/dist/scorm-again.js
CHANGED
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
/******/ "use strict";
|
|
3
3
|
/******/ var __webpack_modules__ = ({
|
|
4
4
|
|
|
5
|
-
/***/
|
|
5
|
+
/***/ 916:
|
|
6
6
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
7
7
|
|
|
8
|
+
// ESM COMPAT FLAG
|
|
9
|
+
__webpack_require__.r(__webpack_exports__);
|
|
8
10
|
|
|
9
11
|
// EXPORTS
|
|
10
12
|
__webpack_require__.d(__webpack_exports__, {
|
|
11
|
-
|
|
13
|
+
AICC: function() { return /* binding */ AICCImpl; }
|
|
12
14
|
});
|
|
13
15
|
|
|
14
16
|
// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs
|
|
@@ -23,6 +25,27 @@ var api_constants = __webpack_require__(340);
|
|
|
23
25
|
var array = __webpack_require__(589);
|
|
24
26
|
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
25
27
|
var exceptions = __webpack_require__(784);
|
|
28
|
+
;// ./src/exceptions/aicc_exceptions.ts
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
var aicc_errors = api_constants.aicc_constants.error_descriptions;
|
|
33
|
+
var AICCValidationError = (function (_super) {
|
|
34
|
+
(0,tslib_es6.__extends)(AICCValidationError, _super);
|
|
35
|
+
function AICCValidationError(errorCode) {
|
|
36
|
+
var _this = this;
|
|
37
|
+
if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {
|
|
38
|
+
_this = _super.call(this, errorCode, aicc_errors[String(errorCode)].basicMessage, aicc_errors[String(errorCode)].detailMessage) || this;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
_this = _super.call(this, 101, aicc_errors["101"].basicMessage, aicc_errors["101"].detailMessage) || this;
|
|
42
|
+
}
|
|
43
|
+
return _this;
|
|
44
|
+
}
|
|
45
|
+
return AICCValidationError;
|
|
46
|
+
}(exceptions.ValidationError));
|
|
47
|
+
|
|
48
|
+
|
|
26
49
|
// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts
|
|
27
50
|
var base_cmi = __webpack_require__(319);
|
|
28
51
|
// EXTERNAL MODULE: ./src/constants/error_codes.ts
|
|
@@ -33,9 +56,8 @@ var validation = __webpack_require__(449);
|
|
|
33
56
|
|
|
34
57
|
|
|
35
58
|
|
|
36
|
-
var aicc_error_codes = error_codes/* default */.A.scorm12;
|
|
37
59
|
function checkAICCValidFormat(value, regexPattern, allowEmptyString) {
|
|
38
|
-
return (0,validation
|
|
60
|
+
return (0,validation.checkValidFormat)(value, regexPattern, error_codes.scorm12_errors.TYPE_MISMATCH, AICCValidationError, allowEmptyString);
|
|
39
61
|
}
|
|
40
62
|
|
|
41
63
|
// EXTERNAL MODULE: ./src/constants/regex.ts
|
|
@@ -50,7 +72,7 @@ var regex = __webpack_require__(417);
|
|
|
50
72
|
|
|
51
73
|
|
|
52
74
|
var CMIEvaluation = (function (_super) {
|
|
53
|
-
(0,tslib_es6
|
|
75
|
+
(0,tslib_es6.__extends)(CMIEvaluation, _super);
|
|
54
76
|
function CMIEvaluation() {
|
|
55
77
|
var _this = _super.call(this) || this;
|
|
56
78
|
_this.comments = new CMIEvaluationComments();
|
|
@@ -61,6 +83,11 @@ var CMIEvaluation = (function (_super) {
|
|
|
61
83
|
_super.prototype.initialize.call(this);
|
|
62
84
|
(_a = this.comments) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
63
85
|
};
|
|
86
|
+
CMIEvaluation.prototype.reset = function () {
|
|
87
|
+
var _a;
|
|
88
|
+
this._initialized = false;
|
|
89
|
+
(_a = this.comments) === null || _a === void 0 ? void 0 : _a.reset();
|
|
90
|
+
};
|
|
64
91
|
CMIEvaluation.prototype.toJSON = function () {
|
|
65
92
|
this.jsonString = true;
|
|
66
93
|
var result = {
|
|
@@ -70,21 +97,21 @@ var CMIEvaluation = (function (_super) {
|
|
|
70
97
|
return result;
|
|
71
98
|
};
|
|
72
99
|
return CMIEvaluation;
|
|
73
|
-
}(base_cmi
|
|
100
|
+
}(base_cmi.BaseCMI));
|
|
74
101
|
|
|
75
102
|
var CMIEvaluationComments = (function (_super) {
|
|
76
|
-
(0,tslib_es6
|
|
103
|
+
(0,tslib_es6.__extends)(CMIEvaluationComments, _super);
|
|
77
104
|
function CMIEvaluationComments() {
|
|
78
105
|
return _super.call(this, {
|
|
79
|
-
children: api_constants
|
|
80
|
-
errorCode: error_codes
|
|
81
|
-
errorClass:
|
|
106
|
+
children: api_constants.aicc_constants.comments_children,
|
|
107
|
+
errorCode: error_codes.scorm12_errors.INVALID_SET_VALUE,
|
|
108
|
+
errorClass: AICCValidationError,
|
|
82
109
|
}) || this;
|
|
83
110
|
}
|
|
84
111
|
return CMIEvaluationComments;
|
|
85
|
-
}(array
|
|
112
|
+
}(array.CMIArray));
|
|
86
113
|
var CMIEvaluationCommentsObject = (function (_super) {
|
|
87
|
-
(0,tslib_es6
|
|
114
|
+
(0,tslib_es6.__extends)(CMIEvaluationCommentsObject, _super);
|
|
88
115
|
function CMIEvaluationCommentsObject() {
|
|
89
116
|
var _this = _super.call(this) || this;
|
|
90
117
|
_this._content = "";
|
|
@@ -92,12 +119,18 @@ var CMIEvaluationCommentsObject = (function (_super) {
|
|
|
92
119
|
_this._time = "";
|
|
93
120
|
return _this;
|
|
94
121
|
}
|
|
122
|
+
CMIEvaluationCommentsObject.prototype.reset = function () {
|
|
123
|
+
this._initialized = false;
|
|
124
|
+
this._content = "";
|
|
125
|
+
this._location = "";
|
|
126
|
+
this._time = "";
|
|
127
|
+
};
|
|
95
128
|
Object.defineProperty(CMIEvaluationCommentsObject.prototype, "content", {
|
|
96
129
|
get: function () {
|
|
97
130
|
return this._content;
|
|
98
131
|
},
|
|
99
132
|
set: function (content) {
|
|
100
|
-
if (checkAICCValidFormat(content, regex
|
|
133
|
+
if (checkAICCValidFormat(content, regex.aicc_regex.CMIString256)) {
|
|
101
134
|
this._content = content;
|
|
102
135
|
}
|
|
103
136
|
},
|
|
@@ -109,7 +142,7 @@ var CMIEvaluationCommentsObject = (function (_super) {
|
|
|
109
142
|
return this._location;
|
|
110
143
|
},
|
|
111
144
|
set: function (location) {
|
|
112
|
-
if (checkAICCValidFormat(location, regex
|
|
145
|
+
if (checkAICCValidFormat(location, regex.aicc_regex.CMIString256)) {
|
|
113
146
|
this._location = location;
|
|
114
147
|
}
|
|
115
148
|
},
|
|
@@ -121,7 +154,7 @@ var CMIEvaluationCommentsObject = (function (_super) {
|
|
|
121
154
|
return this._time;
|
|
122
155
|
},
|
|
123
156
|
set: function (time) {
|
|
124
|
-
if (checkAICCValidFormat(time, regex
|
|
157
|
+
if (checkAICCValidFormat(time, regex.aicc_regex.CMITime)) {
|
|
125
158
|
this._time = time;
|
|
126
159
|
}
|
|
127
160
|
},
|
|
@@ -139,7 +172,7 @@ var CMIEvaluationCommentsObject = (function (_super) {
|
|
|
139
172
|
return result;
|
|
140
173
|
};
|
|
141
174
|
return CMIEvaluationCommentsObject;
|
|
142
|
-
}(base_cmi
|
|
175
|
+
}(base_cmi.BaseCMI));
|
|
143
176
|
|
|
144
177
|
|
|
145
178
|
// EXTERNAL MODULE: ./src/cmi/scorm12/student_preference.ts
|
|
@@ -154,17 +187,17 @@ var student_preference = __webpack_require__(181);
|
|
|
154
187
|
|
|
155
188
|
|
|
156
189
|
var AICCStudentPreferences = (function (_super) {
|
|
157
|
-
(0,tslib_es6
|
|
190
|
+
(0,tslib_es6.__extends)(AICCStudentPreferences, _super);
|
|
158
191
|
function AICCStudentPreferences() {
|
|
159
|
-
var _this = _super.call(this, api_constants
|
|
192
|
+
var _this = _super.call(this, api_constants.aicc_constants.student_preference_children) || this;
|
|
160
193
|
_this._lesson_type = "";
|
|
161
194
|
_this._text_color = "";
|
|
162
195
|
_this._text_location = "";
|
|
163
196
|
_this._text_size = "";
|
|
164
197
|
_this._video = "";
|
|
165
|
-
_this.windows = new array
|
|
166
|
-
errorCode: error_codes
|
|
167
|
-
errorClass:
|
|
198
|
+
_this.windows = new array.CMIArray({
|
|
199
|
+
errorCode: error_codes.scorm12_errors.INVALID_SET_VALUE,
|
|
200
|
+
errorClass: AICCValidationError,
|
|
168
201
|
children: "",
|
|
169
202
|
});
|
|
170
203
|
return _this;
|
|
@@ -179,7 +212,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
179
212
|
return this._lesson_type;
|
|
180
213
|
},
|
|
181
214
|
set: function (lesson_type) {
|
|
182
|
-
if (checkAICCValidFormat(lesson_type, regex
|
|
215
|
+
if (checkAICCValidFormat(lesson_type, regex.aicc_regex.CMIString256)) {
|
|
183
216
|
this._lesson_type = lesson_type;
|
|
184
217
|
}
|
|
185
218
|
},
|
|
@@ -191,7 +224,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
191
224
|
return this._text_color;
|
|
192
225
|
},
|
|
193
226
|
set: function (text_color) {
|
|
194
|
-
if (checkAICCValidFormat(text_color, regex
|
|
227
|
+
if (checkAICCValidFormat(text_color, regex.aicc_regex.CMIString256)) {
|
|
195
228
|
this._text_color = text_color;
|
|
196
229
|
}
|
|
197
230
|
},
|
|
@@ -203,7 +236,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
203
236
|
return this._text_location;
|
|
204
237
|
},
|
|
205
238
|
set: function (text_location) {
|
|
206
|
-
if (checkAICCValidFormat(text_location, regex
|
|
239
|
+
if (checkAICCValidFormat(text_location, regex.aicc_regex.CMIString256)) {
|
|
207
240
|
this._text_location = text_location;
|
|
208
241
|
}
|
|
209
242
|
},
|
|
@@ -215,7 +248,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
215
248
|
return this._text_size;
|
|
216
249
|
},
|
|
217
250
|
set: function (text_size) {
|
|
218
|
-
if (checkAICCValidFormat(text_size, regex
|
|
251
|
+
if (checkAICCValidFormat(text_size, regex.aicc_regex.CMIString256)) {
|
|
219
252
|
this._text_size = text_size;
|
|
220
253
|
}
|
|
221
254
|
},
|
|
@@ -227,7 +260,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
227
260
|
return this._video;
|
|
228
261
|
},
|
|
229
262
|
set: function (video) {
|
|
230
|
-
if (checkAICCValidFormat(video, regex
|
|
263
|
+
if (checkAICCValidFormat(video, regex.aicc_regex.CMIString256)) {
|
|
231
264
|
this._video = video;
|
|
232
265
|
}
|
|
233
266
|
},
|
|
@@ -252,7 +285,7 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
252
285
|
return result;
|
|
253
286
|
};
|
|
254
287
|
return AICCStudentPreferences;
|
|
255
|
-
}(student_preference
|
|
288
|
+
}(student_preference.CMIStudentPreference));
|
|
256
289
|
|
|
257
290
|
|
|
258
291
|
;// ./src/cmi/aicc/student_demographics.ts
|
|
@@ -262,10 +295,10 @@ var AICCStudentPreferences = (function (_super) {
|
|
|
262
295
|
|
|
263
296
|
|
|
264
297
|
var CMIStudentDemographics = (function (_super) {
|
|
265
|
-
(0,tslib_es6
|
|
298
|
+
(0,tslib_es6.__extends)(CMIStudentDemographics, _super);
|
|
266
299
|
function CMIStudentDemographics() {
|
|
267
300
|
var _this = _super.call(this) || this;
|
|
268
|
-
_this.__children = api_constants
|
|
301
|
+
_this.__children = api_constants.aicc_constants.student_demographics_children;
|
|
269
302
|
_this._city = "";
|
|
270
303
|
_this._class = "";
|
|
271
304
|
_this._company = "";
|
|
@@ -281,6 +314,9 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
281
314
|
_this._years_experience = "";
|
|
282
315
|
return _this;
|
|
283
316
|
}
|
|
317
|
+
CMIStudentDemographics.prototype.reset = function () {
|
|
318
|
+
this._initialized = false;
|
|
319
|
+
};
|
|
284
320
|
Object.defineProperty(CMIStudentDemographics.prototype, "_children", {
|
|
285
321
|
get: function () {
|
|
286
322
|
return this.__children;
|
|
@@ -294,7 +330,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
294
330
|
},
|
|
295
331
|
set: function (city) {
|
|
296
332
|
if (this.initialized) {
|
|
297
|
-
throw new
|
|
333
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
298
334
|
}
|
|
299
335
|
else {
|
|
300
336
|
this._city = city;
|
|
@@ -309,7 +345,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
309
345
|
},
|
|
310
346
|
set: function (clazz) {
|
|
311
347
|
if (this.initialized) {
|
|
312
|
-
throw new
|
|
348
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
313
349
|
}
|
|
314
350
|
else {
|
|
315
351
|
this._class = clazz;
|
|
@@ -324,7 +360,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
324
360
|
},
|
|
325
361
|
set: function (company) {
|
|
326
362
|
if (this.initialized) {
|
|
327
|
-
throw new
|
|
363
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
328
364
|
}
|
|
329
365
|
else {
|
|
330
366
|
this._company = company;
|
|
@@ -339,7 +375,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
339
375
|
},
|
|
340
376
|
set: function (country) {
|
|
341
377
|
if (this.initialized) {
|
|
342
|
-
throw new
|
|
378
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
343
379
|
}
|
|
344
380
|
else {
|
|
345
381
|
this._country = country;
|
|
@@ -354,7 +390,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
354
390
|
},
|
|
355
391
|
set: function (experience) {
|
|
356
392
|
if (this.initialized) {
|
|
357
|
-
throw new
|
|
393
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
358
394
|
}
|
|
359
395
|
else {
|
|
360
396
|
this._experience = experience;
|
|
@@ -369,7 +405,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
369
405
|
},
|
|
370
406
|
set: function (familiar_name) {
|
|
371
407
|
if (this.initialized) {
|
|
372
|
-
throw new
|
|
408
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
373
409
|
}
|
|
374
410
|
else {
|
|
375
411
|
this._familiar_name = familiar_name;
|
|
@@ -384,7 +420,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
384
420
|
},
|
|
385
421
|
set: function (instructor_name) {
|
|
386
422
|
if (this.initialized) {
|
|
387
|
-
throw new
|
|
423
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
388
424
|
}
|
|
389
425
|
else {
|
|
390
426
|
this._instructor_name = instructor_name;
|
|
@@ -399,7 +435,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
399
435
|
},
|
|
400
436
|
set: function (title) {
|
|
401
437
|
if (this.initialized) {
|
|
402
|
-
throw new
|
|
438
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
403
439
|
}
|
|
404
440
|
else {
|
|
405
441
|
this._title = title;
|
|
@@ -414,7 +450,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
414
450
|
},
|
|
415
451
|
set: function (native_language) {
|
|
416
452
|
if (this.initialized) {
|
|
417
|
-
throw new
|
|
453
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
418
454
|
}
|
|
419
455
|
else {
|
|
420
456
|
this._native_language = native_language;
|
|
@@ -429,7 +465,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
429
465
|
},
|
|
430
466
|
set: function (state) {
|
|
431
467
|
if (this.initialized) {
|
|
432
|
-
throw new
|
|
468
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
433
469
|
}
|
|
434
470
|
else {
|
|
435
471
|
this._state = state;
|
|
@@ -444,7 +480,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
444
480
|
},
|
|
445
481
|
set: function (street_address) {
|
|
446
482
|
if (this.initialized) {
|
|
447
|
-
throw new
|
|
483
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
448
484
|
}
|
|
449
485
|
else {
|
|
450
486
|
this._street_address = street_address;
|
|
@@ -459,7 +495,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
459
495
|
},
|
|
460
496
|
set: function (telephone) {
|
|
461
497
|
if (this.initialized) {
|
|
462
|
-
throw new
|
|
498
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
463
499
|
}
|
|
464
500
|
else {
|
|
465
501
|
this._telephone = telephone;
|
|
@@ -474,7 +510,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
474
510
|
},
|
|
475
511
|
set: function (years_experience) {
|
|
476
512
|
if (this.initialized) {
|
|
477
|
-
throw new
|
|
513
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
478
514
|
}
|
|
479
515
|
else {
|
|
480
516
|
this._years_experience = years_experience;
|
|
@@ -504,7 +540,7 @@ var CMIStudentDemographics = (function (_super) {
|
|
|
504
540
|
return result;
|
|
505
541
|
};
|
|
506
542
|
return CMIStudentDemographics;
|
|
507
|
-
}(base_cmi
|
|
543
|
+
}(base_cmi.BaseCMI));
|
|
508
544
|
|
|
509
545
|
|
|
510
546
|
// EXTERNAL MODULE: ./src/cmi/common/score.ts
|
|
@@ -520,28 +556,28 @@ var score = __webpack_require__(434);
|
|
|
520
556
|
|
|
521
557
|
|
|
522
558
|
var CMITries = (function (_super) {
|
|
523
|
-
(0,tslib_es6
|
|
559
|
+
(0,tslib_es6.__extends)(CMITries, _super);
|
|
524
560
|
function CMITries() {
|
|
525
561
|
return _super.call(this, {
|
|
526
|
-
children: api_constants
|
|
562
|
+
children: api_constants.aicc_constants.tries_children,
|
|
527
563
|
}) || this;
|
|
528
564
|
}
|
|
529
565
|
return CMITries;
|
|
530
|
-
}(array
|
|
566
|
+
}(array.CMIArray));
|
|
531
567
|
|
|
532
568
|
var CMITriesObject = (function (_super) {
|
|
533
|
-
(0,tslib_es6
|
|
569
|
+
(0,tslib_es6.__extends)(CMITriesObject, _super);
|
|
534
570
|
function CMITriesObject() {
|
|
535
571
|
var _this = _super.call(this) || this;
|
|
536
572
|
_this._status = "";
|
|
537
573
|
_this._time = "";
|
|
538
|
-
_this.score = new score
|
|
539
|
-
score_children: api_constants
|
|
540
|
-
score_range: regex
|
|
541
|
-
invalidErrorCode: error_codes
|
|
542
|
-
invalidTypeCode: error_codes
|
|
543
|
-
invalidRangeCode: error_codes
|
|
544
|
-
errorClass:
|
|
574
|
+
_this.score = new score.CMIScore({
|
|
575
|
+
score_children: api_constants.aicc_constants.score_children,
|
|
576
|
+
score_range: regex.aicc_regex.score_range,
|
|
577
|
+
invalidErrorCode: error_codes.scorm12_errors.INVALID_SET_VALUE,
|
|
578
|
+
invalidTypeCode: error_codes.scorm12_errors.TYPE_MISMATCH,
|
|
579
|
+
invalidRangeCode: error_codes.scorm12_errors.VALUE_OUT_OF_RANGE,
|
|
580
|
+
errorClass: AICCValidationError,
|
|
545
581
|
});
|
|
546
582
|
return _this;
|
|
547
583
|
}
|
|
@@ -550,12 +586,19 @@ var CMITriesObject = (function (_super) {
|
|
|
550
586
|
_super.prototype.initialize.call(this);
|
|
551
587
|
(_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
552
588
|
};
|
|
589
|
+
CMITriesObject.prototype.reset = function () {
|
|
590
|
+
var _a;
|
|
591
|
+
this._initialized = false;
|
|
592
|
+
this._status = "";
|
|
593
|
+
this._time = "";
|
|
594
|
+
(_a = this.score) === null || _a === void 0 ? void 0 : _a.reset();
|
|
595
|
+
};
|
|
553
596
|
Object.defineProperty(CMITriesObject.prototype, "status", {
|
|
554
597
|
get: function () {
|
|
555
598
|
return this._status;
|
|
556
599
|
},
|
|
557
600
|
set: function (status) {
|
|
558
|
-
if (checkAICCValidFormat(status, regex
|
|
601
|
+
if (checkAICCValidFormat(status, regex.aicc_regex.CMIStatus2)) {
|
|
559
602
|
this._status = status;
|
|
560
603
|
}
|
|
561
604
|
},
|
|
@@ -567,7 +610,7 @@ var CMITriesObject = (function (_super) {
|
|
|
567
610
|
return this._time;
|
|
568
611
|
},
|
|
569
612
|
set: function (time) {
|
|
570
|
-
if (checkAICCValidFormat(time, regex
|
|
613
|
+
if (checkAICCValidFormat(time, regex.aicc_regex.CMITime)) {
|
|
571
614
|
this._time = time;
|
|
572
615
|
}
|
|
573
616
|
},
|
|
@@ -585,7 +628,7 @@ var CMITriesObject = (function (_super) {
|
|
|
585
628
|
return result;
|
|
586
629
|
};
|
|
587
630
|
return CMITriesObject;
|
|
588
|
-
}(base_cmi
|
|
631
|
+
}(base_cmi.BaseCMI));
|
|
589
632
|
|
|
590
633
|
|
|
591
634
|
// EXTERNAL MODULE: ./src/cmi/scorm12/student_data.ts
|
|
@@ -601,41 +644,47 @@ var student_data = __webpack_require__(532);
|
|
|
601
644
|
|
|
602
645
|
|
|
603
646
|
var CMIAttemptRecords = (function (_super) {
|
|
604
|
-
(0,tslib_es6
|
|
647
|
+
(0,tslib_es6.__extends)(CMIAttemptRecords, _super);
|
|
605
648
|
function CMIAttemptRecords() {
|
|
606
649
|
return _super.call(this, {
|
|
607
|
-
children: api_constants
|
|
650
|
+
children: api_constants.aicc_constants.attempt_records_children,
|
|
608
651
|
}) || this;
|
|
609
652
|
}
|
|
610
653
|
return CMIAttemptRecords;
|
|
611
|
-
}(array
|
|
654
|
+
}(array.CMIArray));
|
|
612
655
|
|
|
613
656
|
var CMIAttemptRecordsObject = (function (_super) {
|
|
614
|
-
(0,tslib_es6
|
|
657
|
+
(0,tslib_es6.__extends)(CMIAttemptRecordsObject, _super);
|
|
615
658
|
function CMIAttemptRecordsObject() {
|
|
616
659
|
var _this = _super.call(this) || this;
|
|
617
660
|
_this._lesson_status = "";
|
|
618
|
-
_this.score = new score
|
|
619
|
-
score_children: api_constants
|
|
620
|
-
score_range: regex
|
|
621
|
-
invalidErrorCode: error_codes
|
|
622
|
-
invalidTypeCode: error_codes
|
|
623
|
-
invalidRangeCode: error_codes
|
|
624
|
-
errorClass:
|
|
661
|
+
_this.score = new score.CMIScore({
|
|
662
|
+
score_children: api_constants.aicc_constants.score_children,
|
|
663
|
+
score_range: regex.aicc_regex.score_range,
|
|
664
|
+
invalidErrorCode: error_codes.scorm12_errors.INVALID_SET_VALUE,
|
|
665
|
+
invalidTypeCode: error_codes.scorm12_errors.TYPE_MISMATCH,
|
|
666
|
+
invalidRangeCode: error_codes.scorm12_errors.VALUE_OUT_OF_RANGE,
|
|
667
|
+
errorClass: AICCValidationError,
|
|
625
668
|
});
|
|
626
669
|
return _this;
|
|
627
670
|
}
|
|
628
671
|
CMIAttemptRecordsObject.prototype.initialize = function () {
|
|
629
672
|
var _a;
|
|
630
673
|
_super.prototype.initialize.call(this);
|
|
674
|
+
this._lesson_status = "";
|
|
631
675
|
(_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
632
676
|
};
|
|
677
|
+
CMIAttemptRecordsObject.prototype.reset = function () {
|
|
678
|
+
var _a;
|
|
679
|
+
this._initialized = false;
|
|
680
|
+
(_a = this.score) === null || _a === void 0 ? void 0 : _a.reset();
|
|
681
|
+
};
|
|
633
682
|
Object.defineProperty(CMIAttemptRecordsObject.prototype, "lesson_status", {
|
|
634
683
|
get: function () {
|
|
635
684
|
return this._lesson_status;
|
|
636
685
|
},
|
|
637
686
|
set: function (lesson_status) {
|
|
638
|
-
if (checkAICCValidFormat(lesson_status, regex
|
|
687
|
+
if (checkAICCValidFormat(lesson_status, regex.aicc_regex.CMIStatus2)) {
|
|
639
688
|
this._lesson_status = lesson_status;
|
|
640
689
|
}
|
|
641
690
|
},
|
|
@@ -652,7 +701,7 @@ var CMIAttemptRecordsObject = (function (_super) {
|
|
|
652
701
|
return result;
|
|
653
702
|
};
|
|
654
703
|
return CMIAttemptRecordsObject;
|
|
655
|
-
}(base_cmi
|
|
704
|
+
}(base_cmi.BaseCMI));
|
|
656
705
|
|
|
657
706
|
|
|
658
707
|
;// ./src/cmi/aicc/student_data.ts
|
|
@@ -664,9 +713,9 @@ var CMIAttemptRecordsObject = (function (_super) {
|
|
|
664
713
|
|
|
665
714
|
|
|
666
715
|
var AICCCMIStudentData = (function (_super) {
|
|
667
|
-
(0,tslib_es6
|
|
716
|
+
(0,tslib_es6.__extends)(AICCCMIStudentData, _super);
|
|
668
717
|
function AICCCMIStudentData() {
|
|
669
|
-
var _this = _super.call(this, api_constants
|
|
718
|
+
var _this = _super.call(this, api_constants.aicc_constants.student_data_children) || this;
|
|
670
719
|
_this._tries_during_lesson = "";
|
|
671
720
|
_this.tries = new CMITries();
|
|
672
721
|
_this.attempt_records = new CMIAttemptRecords();
|
|
@@ -678,13 +727,19 @@ var AICCCMIStudentData = (function (_super) {
|
|
|
678
727
|
(_a = this.tries) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
679
728
|
(_b = this.attempt_records) === null || _b === void 0 ? void 0 : _b.initialize();
|
|
680
729
|
};
|
|
730
|
+
AICCCMIStudentData.prototype.reset = function () {
|
|
731
|
+
var _a, _b;
|
|
732
|
+
this._initialized = false;
|
|
733
|
+
(_a = this.tries) === null || _a === void 0 ? void 0 : _a.reset(true);
|
|
734
|
+
(_b = this.attempt_records) === null || _b === void 0 ? void 0 : _b.reset(true);
|
|
735
|
+
};
|
|
681
736
|
Object.defineProperty(AICCCMIStudentData.prototype, "tries_during_lesson", {
|
|
682
737
|
get: function () {
|
|
683
738
|
return this._tries_during_lesson;
|
|
684
739
|
},
|
|
685
740
|
set: function (tries_during_lesson) {
|
|
686
741
|
if (this.initialized) {
|
|
687
|
-
throw new
|
|
742
|
+
throw new AICCValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
688
743
|
}
|
|
689
744
|
else {
|
|
690
745
|
this._tries_during_lesson = tries_during_lesson;
|
|
@@ -706,7 +761,7 @@ var AICCCMIStudentData = (function (_super) {
|
|
|
706
761
|
return result;
|
|
707
762
|
};
|
|
708
763
|
return AICCCMIStudentData;
|
|
709
|
-
}(student_data
|
|
764
|
+
}(student_data.CMIStudentData));
|
|
710
765
|
|
|
711
766
|
|
|
712
767
|
;// ./src/cmi/aicc/paths.ts
|
|
@@ -717,17 +772,17 @@ var AICCCMIStudentData = (function (_super) {
|
|
|
717
772
|
|
|
718
773
|
|
|
719
774
|
var CMIPaths = (function (_super) {
|
|
720
|
-
(0,tslib_es6
|
|
775
|
+
(0,tslib_es6.__extends)(CMIPaths, _super);
|
|
721
776
|
function CMIPaths() {
|
|
722
777
|
return _super.call(this, {
|
|
723
|
-
children: api_constants
|
|
778
|
+
children: api_constants.aicc_constants.paths_children,
|
|
724
779
|
}) || this;
|
|
725
780
|
}
|
|
726
781
|
return CMIPaths;
|
|
727
|
-
}(array
|
|
782
|
+
}(array.CMIArray));
|
|
728
783
|
|
|
729
784
|
var CMIPathsObject = (function (_super) {
|
|
730
|
-
(0,tslib_es6
|
|
785
|
+
(0,tslib_es6.__extends)(CMIPathsObject, _super);
|
|
731
786
|
function CMIPathsObject() {
|
|
732
787
|
var _this = _super.call(this) || this;
|
|
733
788
|
_this._location_id = "";
|
|
@@ -738,12 +793,21 @@ var CMIPathsObject = (function (_super) {
|
|
|
738
793
|
_this._time_in_element = "";
|
|
739
794
|
return _this;
|
|
740
795
|
}
|
|
796
|
+
CMIPathsObject.prototype.reset = function () {
|
|
797
|
+
this._initialized = false;
|
|
798
|
+
this._location_id = "";
|
|
799
|
+
this._date = "";
|
|
800
|
+
this._time = "";
|
|
801
|
+
this._status = "";
|
|
802
|
+
this._why_left = "";
|
|
803
|
+
this._time_in_element = "";
|
|
804
|
+
};
|
|
741
805
|
Object.defineProperty(CMIPathsObject.prototype, "location_id", {
|
|
742
806
|
get: function () {
|
|
743
807
|
return this._location_id;
|
|
744
808
|
},
|
|
745
809
|
set: function (location_id) {
|
|
746
|
-
if (checkAICCValidFormat(location_id, regex
|
|
810
|
+
if (checkAICCValidFormat(location_id, regex.aicc_regex.CMIString256)) {
|
|
747
811
|
this._location_id = location_id;
|
|
748
812
|
}
|
|
749
813
|
},
|
|
@@ -755,7 +819,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
755
819
|
return this._date;
|
|
756
820
|
},
|
|
757
821
|
set: function (date) {
|
|
758
|
-
if (checkAICCValidFormat(date, regex
|
|
822
|
+
if (checkAICCValidFormat(date, regex.aicc_regex.CMIString256)) {
|
|
759
823
|
this._date = date;
|
|
760
824
|
}
|
|
761
825
|
},
|
|
@@ -767,7 +831,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
767
831
|
return this._time;
|
|
768
832
|
},
|
|
769
833
|
set: function (time) {
|
|
770
|
-
if (checkAICCValidFormat(time, regex
|
|
834
|
+
if (checkAICCValidFormat(time, regex.aicc_regex.CMITime)) {
|
|
771
835
|
this._time = time;
|
|
772
836
|
}
|
|
773
837
|
},
|
|
@@ -779,7 +843,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
779
843
|
return this._status;
|
|
780
844
|
},
|
|
781
845
|
set: function (status) {
|
|
782
|
-
if (checkAICCValidFormat(status, regex
|
|
846
|
+
if (checkAICCValidFormat(status, regex.aicc_regex.CMIStatus2)) {
|
|
783
847
|
this._status = status;
|
|
784
848
|
}
|
|
785
849
|
},
|
|
@@ -791,7 +855,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
791
855
|
return this._why_left;
|
|
792
856
|
},
|
|
793
857
|
set: function (why_left) {
|
|
794
|
-
if (checkAICCValidFormat(why_left, regex
|
|
858
|
+
if (checkAICCValidFormat(why_left, regex.aicc_regex.CMIString256)) {
|
|
795
859
|
this._why_left = why_left;
|
|
796
860
|
}
|
|
797
861
|
},
|
|
@@ -803,7 +867,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
803
867
|
return this._time_in_element;
|
|
804
868
|
},
|
|
805
869
|
set: function (time_in_element) {
|
|
806
|
-
if (checkAICCValidFormat(time_in_element, regex
|
|
870
|
+
if (checkAICCValidFormat(time_in_element, regex.aicc_regex.CMITime)) {
|
|
807
871
|
this._time_in_element = time_in_element;
|
|
808
872
|
}
|
|
809
873
|
},
|
|
@@ -824,7 +888,7 @@ var CMIPathsObject = (function (_super) {
|
|
|
824
888
|
return result;
|
|
825
889
|
};
|
|
826
890
|
return CMIPathsObject;
|
|
827
|
-
}(base_cmi
|
|
891
|
+
}(base_cmi.BaseCMI));
|
|
828
892
|
|
|
829
893
|
|
|
830
894
|
;// ./src/cmi/aicc/cmi.ts
|
|
@@ -837,10 +901,10 @@ var CMIPathsObject = (function (_super) {
|
|
|
837
901
|
|
|
838
902
|
|
|
839
903
|
var CMI = (function (_super) {
|
|
840
|
-
(0,tslib_es6
|
|
904
|
+
(0,tslib_es6.__extends)(CMI, _super);
|
|
841
905
|
function CMI(initialized) {
|
|
842
906
|
if (initialized === void 0) { initialized = false; }
|
|
843
|
-
var _this = _super.call(this, api_constants
|
|
907
|
+
var _this = _super.call(this, api_constants.aicc_constants.cmi_children) || this;
|
|
844
908
|
if (initialized)
|
|
845
909
|
_this.initialize();
|
|
846
910
|
_this.student_preference = new AICCStudentPreferences();
|
|
@@ -879,7 +943,7 @@ var CMI = (function (_super) {
|
|
|
879
943
|
return result;
|
|
880
944
|
};
|
|
881
945
|
return CMI;
|
|
882
|
-
}(cmi
|
|
946
|
+
}(cmi.CMI));
|
|
883
947
|
|
|
884
948
|
|
|
885
949
|
// EXTERNAL MODULE: ./src/cmi/scorm12/nav.ts
|
|
@@ -897,26 +961,26 @@ var utilities = __webpack_require__(864);
|
|
|
897
961
|
|
|
898
962
|
|
|
899
963
|
var AICCImpl = (function (_super) {
|
|
900
|
-
(0,tslib_es6
|
|
964
|
+
(0,tslib_es6.__extends)(AICCImpl, _super);
|
|
901
965
|
function AICCImpl(settings) {
|
|
902
966
|
var _this = _super.call(this, settings) || this;
|
|
903
967
|
_this.cmi = new CMI();
|
|
904
|
-
_this.nav = new nav
|
|
968
|
+
_this.nav = new nav.NAV();
|
|
905
969
|
return _this;
|
|
906
970
|
}
|
|
907
971
|
AICCImpl.prototype.getChildElement = function (CMIElement, value, foundFirstIndex) {
|
|
908
972
|
var newChild = _super.prototype.getChildElement.call(this, CMIElement, value, foundFirstIndex);
|
|
909
973
|
if (!newChild) {
|
|
910
|
-
if ((0,utilities
|
|
974
|
+
if ((0,utilities.stringMatches)(CMIElement, "cmi\\.evaluation\\.comments\\.\\d+")) {
|
|
911
975
|
newChild = new CMIEvaluationCommentsObject();
|
|
912
976
|
}
|
|
913
|
-
else if ((0,utilities
|
|
977
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.student_data\\.tries\\.\\d+")) {
|
|
914
978
|
newChild = new CMITriesObject();
|
|
915
979
|
}
|
|
916
|
-
else if ((0,utilities
|
|
980
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.student_data\\.attempt_records\\.\\d+")) {
|
|
917
981
|
newChild = new CMIAttemptRecordsObject();
|
|
918
982
|
}
|
|
919
|
-
else if ((0,utilities
|
|
983
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.paths\\.\\d+")) {
|
|
920
984
|
newChild = new CMIPathsObject();
|
|
921
985
|
}
|
|
922
986
|
}
|
|
@@ -927,7 +991,7 @@ var AICCImpl = (function (_super) {
|
|
|
927
991
|
this.nav = newAPI.nav;
|
|
928
992
|
};
|
|
929
993
|
return AICCImpl;
|
|
930
|
-
}(Scorm12API.
|
|
994
|
+
}(Scorm12API.Scorm12API));
|
|
931
995
|
|
|
932
996
|
|
|
933
997
|
|
|
@@ -936,10 +1000,12 @@ var AICCImpl = (function (_super) {
|
|
|
936
1000
|
/***/ 429:
|
|
937
1001
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
938
1002
|
|
|
1003
|
+
// ESM COMPAT FLAG
|
|
1004
|
+
__webpack_require__.r(__webpack_exports__);
|
|
939
1005
|
|
|
940
1006
|
// EXPORTS
|
|
941
1007
|
__webpack_require__.d(__webpack_exports__, {
|
|
942
|
-
|
|
1008
|
+
"default": function() { return /* binding */ src_BaseAPI; }
|
|
943
1009
|
});
|
|
944
1010
|
|
|
945
1011
|
// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs
|
|
@@ -948,8 +1014,6 @@ var tslib_es6 = __webpack_require__(635);
|
|
|
948
1014
|
var array = __webpack_require__(589);
|
|
949
1015
|
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
950
1016
|
var exceptions = __webpack_require__(784);
|
|
951
|
-
// EXTERNAL MODULE: ./src/constants/error_codes.ts
|
|
952
|
-
var error_codes = __webpack_require__(797);
|
|
953
1017
|
// EXTERNAL MODULE: ./src/constants/api_constants.ts
|
|
954
1018
|
var api_constants = __webpack_require__(340);
|
|
955
1019
|
// EXTERNAL MODULE: ./src/utilities.ts
|
|
@@ -969,7 +1033,7 @@ var DefaultSettings = {
|
|
|
969
1033
|
dataCommitFormat: "json",
|
|
970
1034
|
commitRequestDataType: "application/json;charset=UTF-8",
|
|
971
1035
|
autoProgress: false,
|
|
972
|
-
logLevel: enums
|
|
1036
|
+
logLevel: enums.LogLevelEnum.ERROR,
|
|
973
1037
|
selfReportSessionTime: false,
|
|
974
1038
|
alwaysSendTotalTime: false,
|
|
975
1039
|
renderCommonCommitFields: false,
|
|
@@ -978,9 +1042,9 @@ var DefaultSettings = {
|
|
|
978
1042
|
xhrWithCredentials: false,
|
|
979
1043
|
fetchMode: "cors",
|
|
980
1044
|
responseHandler: function (response) {
|
|
981
|
-
return (0,tslib_es6
|
|
1045
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
982
1046
|
var responseText, httpResult;
|
|
983
|
-
return (0,tslib_es6
|
|
1047
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
984
1048
|
switch (_a.label) {
|
|
985
1049
|
case 0:
|
|
986
1050
|
if (!(typeof response !== "undefined")) return [3, 2];
|
|
@@ -995,13 +1059,13 @@ var DefaultSettings = {
|
|
|
995
1059
|
!{}.hasOwnProperty.call(httpResult, "result")) {
|
|
996
1060
|
if (response.status === 200) {
|
|
997
1061
|
return [2, {
|
|
998
|
-
result: api_constants
|
|
1062
|
+
result: api_constants.global_constants.SCORM_TRUE,
|
|
999
1063
|
errorCode: 0,
|
|
1000
1064
|
}];
|
|
1001
1065
|
}
|
|
1002
1066
|
else {
|
|
1003
1067
|
return [2, {
|
|
1004
|
-
result: api_constants
|
|
1068
|
+
result: api_constants.global_constants.SCORM_FALSE,
|
|
1005
1069
|
errorCode: 101,
|
|
1006
1070
|
}];
|
|
1007
1071
|
}
|
|
@@ -1011,14 +1075,14 @@ var DefaultSettings = {
|
|
|
1011
1075
|
result: httpResult.result,
|
|
1012
1076
|
errorCode: httpResult.errorCode
|
|
1013
1077
|
? httpResult.errorCode
|
|
1014
|
-
: httpResult.result === api_constants
|
|
1078
|
+
: httpResult.result === api_constants.global_constants.SCORM_TRUE
|
|
1015
1079
|
? 0
|
|
1016
1080
|
: 101,
|
|
1017
1081
|
}];
|
|
1018
1082
|
}
|
|
1019
1083
|
_a.label = 2;
|
|
1020
1084
|
case 2: return [2, {
|
|
1021
|
-
result: api_constants
|
|
1085
|
+
result: api_constants.global_constants.SCORM_FALSE,
|
|
1022
1086
|
errorCode: 101,
|
|
1023
1087
|
}];
|
|
1024
1088
|
}
|
|
@@ -1033,25 +1097,25 @@ var DefaultSettings = {
|
|
|
1033
1097
|
case "4":
|
|
1034
1098
|
case 4:
|
|
1035
1099
|
case "ERROR":
|
|
1036
|
-
case enums
|
|
1100
|
+
case enums.LogLevelEnum.ERROR:
|
|
1037
1101
|
console.error(logMessage);
|
|
1038
1102
|
break;
|
|
1039
1103
|
case "3":
|
|
1040
1104
|
case 3:
|
|
1041
1105
|
case "WARN":
|
|
1042
|
-
case enums
|
|
1106
|
+
case enums.LogLevelEnum.WARN:
|
|
1043
1107
|
console.warn(logMessage);
|
|
1044
1108
|
break;
|
|
1045
1109
|
case "2":
|
|
1046
1110
|
case 2:
|
|
1047
1111
|
case "INFO":
|
|
1048
|
-
case enums
|
|
1112
|
+
case enums.LogLevelEnum.INFO:
|
|
1049
1113
|
console.info(logMessage);
|
|
1050
1114
|
break;
|
|
1051
1115
|
case "1":
|
|
1052
1116
|
case 1:
|
|
1053
1117
|
case "DEBUG":
|
|
1054
|
-
case enums
|
|
1118
|
+
case enums.LogLevelEnum.DEBUG:
|
|
1055
1119
|
if (console.debug) {
|
|
1056
1120
|
console.debug(logMessage);
|
|
1057
1121
|
}
|
|
@@ -1063,6 +1127,7 @@ var DefaultSettings = {
|
|
|
1063
1127
|
},
|
|
1064
1128
|
scoItemIds: [],
|
|
1065
1129
|
scoItemIdValidator: false,
|
|
1130
|
+
globalObjectiveIds: [],
|
|
1066
1131
|
};
|
|
1067
1132
|
|
|
1068
1133
|
;// ./src/helpers/scheduled_commit.ts
|
|
@@ -1083,7 +1148,7 @@ var ScheduledCommit = (function () {
|
|
|
1083
1148
|
ScheduledCommit.prototype.wrapper = function () {
|
|
1084
1149
|
var _this = this;
|
|
1085
1150
|
if (!this._cancelled) {
|
|
1086
|
-
(function () { return (0,tslib_es6
|
|
1151
|
+
(function () { return (0,tslib_es6.__awaiter)(_this, void 0, void 0, function () { return (0,tslib_es6.__generator)(this, function (_a) {
|
|
1087
1152
|
switch (_a.label) {
|
|
1088
1153
|
case 0: return [4, this._API.commit(this._callback)];
|
|
1089
1154
|
case 1: return [2, _a.sent()];
|
|
@@ -1104,7 +1169,6 @@ var ScheduledCommit = (function () {
|
|
|
1104
1169
|
|
|
1105
1170
|
|
|
1106
1171
|
|
|
1107
|
-
|
|
1108
1172
|
var BaseAPI = (function () {
|
|
1109
1173
|
function BaseAPI(error_codes, settings) {
|
|
1110
1174
|
var _newTarget = this.constructor;
|
|
@@ -1112,7 +1176,7 @@ var BaseAPI = (function () {
|
|
|
1112
1176
|
if (_newTarget === BaseAPI) {
|
|
1113
1177
|
throw new TypeError("Cannot construct BaseAPI instances directly");
|
|
1114
1178
|
}
|
|
1115
|
-
this.currentState = api_constants
|
|
1179
|
+
this.currentState = api_constants.global_constants.STATE_NOT_INITIALIZED;
|
|
1116
1180
|
this.lastErrorCode = "0";
|
|
1117
1181
|
this.listenerArray = [];
|
|
1118
1182
|
this._error_codes = error_codes;
|
|
@@ -1122,17 +1186,20 @@ var BaseAPI = (function () {
|
|
|
1122
1186
|
this.apiLogLevel = this.settings.logLevel;
|
|
1123
1187
|
this.selfReportSessionTime = this.settings.selfReportSessionTime;
|
|
1124
1188
|
if (this.apiLogLevel === undefined) {
|
|
1125
|
-
this.apiLogLevel = enums
|
|
1189
|
+
this.apiLogLevel = enums.LogLevelEnum.NONE;
|
|
1126
1190
|
}
|
|
1127
1191
|
}
|
|
1128
1192
|
BaseAPI.prototype.commonReset = function (settings) {
|
|
1129
|
-
this.
|
|
1130
|
-
this.
|
|
1193
|
+
this.apiLog("reset", "Called", enums.LogLevelEnum.INFO);
|
|
1194
|
+
this.settings = (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, this.settings), settings);
|
|
1195
|
+
this.clearScheduledCommit();
|
|
1196
|
+
this.currentState = api_constants.global_constants.STATE_NOT_INITIALIZED;
|
|
1131
1197
|
this.lastErrorCode = "0";
|
|
1132
1198
|
this.listenerArray = [];
|
|
1199
|
+
this.startingData = undefined;
|
|
1133
1200
|
};
|
|
1134
1201
|
BaseAPI.prototype.initialize = function (callbackName, initializeMessage, terminationMessage) {
|
|
1135
|
-
var returnValue = api_constants
|
|
1202
|
+
var returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1136
1203
|
if (this.isInitialized()) {
|
|
1137
1204
|
this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);
|
|
1138
1205
|
}
|
|
@@ -1143,17 +1210,17 @@ var BaseAPI = (function () {
|
|
|
1143
1210
|
if (this.selfReportSessionTime) {
|
|
1144
1211
|
this.cmi.setStartTime();
|
|
1145
1212
|
}
|
|
1146
|
-
this.currentState = api_constants
|
|
1213
|
+
this.currentState = api_constants.global_constants.STATE_INITIALIZED;
|
|
1147
1214
|
this.lastErrorCode = "0";
|
|
1148
|
-
returnValue = api_constants
|
|
1215
|
+
returnValue = api_constants.global_constants.SCORM_TRUE;
|
|
1149
1216
|
this.processListeners(callbackName);
|
|
1150
1217
|
}
|
|
1151
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
1218
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1152
1219
|
this.clearSCORMError(returnValue);
|
|
1153
1220
|
return returnValue;
|
|
1154
1221
|
};
|
|
1155
1222
|
BaseAPI.prototype.apiLog = function (functionName, logMessage, messageLevel, CMIElement) {
|
|
1156
|
-
logMessage = (0,utilities
|
|
1223
|
+
logMessage = (0,utilities.formatMessage)(functionName, logMessage, CMIElement);
|
|
1157
1224
|
if (messageLevel >= this.apiLogLevel) {
|
|
1158
1225
|
this.settings.onLogMessage(messageLevel, logMessage);
|
|
1159
1226
|
}
|
|
@@ -1170,20 +1237,20 @@ var BaseAPI = (function () {
|
|
|
1170
1237
|
return this._settings;
|
|
1171
1238
|
},
|
|
1172
1239
|
set: function (settings) {
|
|
1173
|
-
this._settings = (0,tslib_es6
|
|
1240
|
+
this._settings = (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, this._settings), settings);
|
|
1174
1241
|
},
|
|
1175
1242
|
enumerable: false,
|
|
1176
1243
|
configurable: true
|
|
1177
1244
|
});
|
|
1178
1245
|
BaseAPI.prototype.terminate = function (callbackName, checkTerminated) {
|
|
1179
|
-
return (0,tslib_es6
|
|
1246
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
1180
1247
|
var returnValue, result;
|
|
1181
|
-
return (0,tslib_es6
|
|
1248
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
1182
1249
|
switch (_a.label) {
|
|
1183
1250
|
case 0:
|
|
1184
|
-
returnValue = api_constants
|
|
1251
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1185
1252
|
if (!this.checkState(checkTerminated, this._error_codes.TERMINATION_BEFORE_INIT, this._error_codes.MULTIPLE_TERMINATION)) return [3, 2];
|
|
1186
|
-
this.currentState = api_constants
|
|
1253
|
+
this.currentState = api_constants.global_constants.STATE_TERMINATED;
|
|
1187
1254
|
return [4, this.storeData(true)];
|
|
1188
1255
|
case 1:
|
|
1189
1256
|
result = _a.sent();
|
|
@@ -1193,14 +1260,14 @@ var BaseAPI = (function () {
|
|
|
1193
1260
|
returnValue =
|
|
1194
1261
|
typeof result !== "undefined" && result.result
|
|
1195
1262
|
? result.result
|
|
1196
|
-
: api_constants
|
|
1263
|
+
: api_constants.global_constants.SCORM_FALSE;
|
|
1197
1264
|
if (checkTerminated)
|
|
1198
1265
|
this.lastErrorCode = "0";
|
|
1199
|
-
returnValue = api_constants
|
|
1266
|
+
returnValue = api_constants.global_constants.SCORM_TRUE;
|
|
1200
1267
|
this.processListeners(callbackName);
|
|
1201
1268
|
_a.label = 2;
|
|
1202
1269
|
case 2:
|
|
1203
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
1270
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1204
1271
|
this.clearSCORMError(returnValue);
|
|
1205
1272
|
return [2, returnValue];
|
|
1206
1273
|
}
|
|
@@ -1220,7 +1287,7 @@ var BaseAPI = (function () {
|
|
|
1220
1287
|
}
|
|
1221
1288
|
this.processListeners(callbackName, CMIElement);
|
|
1222
1289
|
}
|
|
1223
|
-
this.apiLog(callbackName, ": returned: " + returnValue, enums
|
|
1290
|
+
this.apiLog(callbackName, ": returned: " + returnValue, enums.LogLevelEnum.INFO, CMIElement);
|
|
1224
1291
|
if (returnValue === undefined) {
|
|
1225
1292
|
return "";
|
|
1226
1293
|
}
|
|
@@ -1231,7 +1298,7 @@ var BaseAPI = (function () {
|
|
|
1231
1298
|
if (value !== undefined) {
|
|
1232
1299
|
value = String(value);
|
|
1233
1300
|
}
|
|
1234
|
-
var returnValue = api_constants
|
|
1301
|
+
var returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1235
1302
|
if (this.checkState(checkTerminated, this._error_codes.STORE_BEFORE_INIT, this._error_codes.STORE_AFTER_TERM)) {
|
|
1236
1303
|
if (checkTerminated)
|
|
1237
1304
|
this.lastErrorCode = "0";
|
|
@@ -1244,26 +1311,26 @@ var BaseAPI = (function () {
|
|
|
1244
1311
|
this.processListeners(callbackName, CMIElement, value);
|
|
1245
1312
|
}
|
|
1246
1313
|
if (returnValue === undefined) {
|
|
1247
|
-
returnValue = api_constants
|
|
1314
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1248
1315
|
}
|
|
1249
1316
|
if (String(this.lastErrorCode) === "0") {
|
|
1250
1317
|
if (this.settings.autocommit) {
|
|
1251
1318
|
this.scheduleCommit(this.settings.autocommitSeconds * 1000, commitCallback);
|
|
1252
1319
|
}
|
|
1253
1320
|
}
|
|
1254
|
-
this.apiLog(callbackName, ": " + value + ": result: " + returnValue, enums
|
|
1321
|
+
this.apiLog(callbackName, ": " + value + ": result: " + returnValue, enums.LogLevelEnum.INFO, CMIElement);
|
|
1255
1322
|
this.clearSCORMError(returnValue);
|
|
1256
1323
|
return returnValue;
|
|
1257
1324
|
};
|
|
1258
1325
|
BaseAPI.prototype.commit = function (callbackName_1) {
|
|
1259
|
-
return (0,tslib_es6
|
|
1326
|
+
return (0,tslib_es6.__awaiter)(this, arguments, void 0, function (callbackName, checkTerminated) {
|
|
1260
1327
|
var returnValue, result;
|
|
1261
1328
|
if (checkTerminated === void 0) { checkTerminated = false; }
|
|
1262
|
-
return (0,tslib_es6
|
|
1329
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
1263
1330
|
switch (_a.label) {
|
|
1264
1331
|
case 0:
|
|
1265
1332
|
this.clearScheduledCommit();
|
|
1266
|
-
returnValue = api_constants
|
|
1333
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1267
1334
|
if (!this.checkState(checkTerminated, this._error_codes.COMMIT_BEFORE_INIT, this._error_codes.COMMIT_AFTER_TERM)) return [3, 2];
|
|
1268
1335
|
return [4, this.storeData(false)];
|
|
1269
1336
|
case 1:
|
|
@@ -1274,14 +1341,14 @@ var BaseAPI = (function () {
|
|
|
1274
1341
|
returnValue =
|
|
1275
1342
|
typeof result !== "undefined" && result.result
|
|
1276
1343
|
? result.result
|
|
1277
|
-
: api_constants
|
|
1278
|
-
this.apiLog(callbackName, " Result: " + returnValue, enums
|
|
1344
|
+
: api_constants.global_constants.SCORM_FALSE;
|
|
1345
|
+
this.apiLog(callbackName, " Result: " + returnValue, enums.LogLevelEnum.DEBUG, "HttpRequest");
|
|
1279
1346
|
if (checkTerminated)
|
|
1280
1347
|
this.lastErrorCode = "0";
|
|
1281
1348
|
this.processListeners(callbackName);
|
|
1282
1349
|
_a.label = 2;
|
|
1283
1350
|
case 2:
|
|
1284
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
1351
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1285
1352
|
this.clearSCORMError(returnValue);
|
|
1286
1353
|
return [2, returnValue];
|
|
1287
1354
|
}
|
|
@@ -1291,7 +1358,7 @@ var BaseAPI = (function () {
|
|
|
1291
1358
|
BaseAPI.prototype.getLastError = function (callbackName) {
|
|
1292
1359
|
var returnValue = String(this.lastErrorCode);
|
|
1293
1360
|
this.processListeners(callbackName);
|
|
1294
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
1361
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1295
1362
|
return returnValue;
|
|
1296
1363
|
};
|
|
1297
1364
|
BaseAPI.prototype.getErrorString = function (callbackName, CMIErrorCode) {
|
|
@@ -1300,7 +1367,7 @@ var BaseAPI = (function () {
|
|
|
1300
1367
|
returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);
|
|
1301
1368
|
this.processListeners(callbackName);
|
|
1302
1369
|
}
|
|
1303
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
1370
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1304
1371
|
return returnValue;
|
|
1305
1372
|
};
|
|
1306
1373
|
BaseAPI.prototype.getDiagnostic = function (callbackName, CMIErrorCode) {
|
|
@@ -1309,7 +1376,7 @@ var BaseAPI = (function () {
|
|
|
1309
1376
|
returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);
|
|
1310
1377
|
this.processListeners(callbackName);
|
|
1311
1378
|
}
|
|
1312
|
-
this.apiLog(callbackName, "returned: " + returnValue, enums
|
|
1379
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums.LogLevelEnum.INFO);
|
|
1313
1380
|
return returnValue;
|
|
1314
1381
|
};
|
|
1315
1382
|
BaseAPI.prototype.checkState = function (checkTerminated, beforeInitError, afterTermError) {
|
|
@@ -1335,11 +1402,11 @@ var BaseAPI = (function () {
|
|
|
1335
1402
|
};
|
|
1336
1403
|
BaseAPI.prototype._commonSetCMIValue = function (methodName, scorm2004, CMIElement, value) {
|
|
1337
1404
|
if (!CMIElement || CMIElement === "") {
|
|
1338
|
-
return api_constants
|
|
1405
|
+
return api_constants.global_constants.SCORM_FALSE;
|
|
1339
1406
|
}
|
|
1340
1407
|
var structure = CMIElement.split(".");
|
|
1341
1408
|
var refObject = this;
|
|
1342
|
-
var returnValue = api_constants
|
|
1409
|
+
var returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1343
1410
|
var foundFirstIndex = false;
|
|
1344
1411
|
var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element.");
|
|
1345
1412
|
var invalidErrorCode = scorm2004
|
|
@@ -1353,20 +1420,20 @@ var BaseAPI = (function () {
|
|
|
1353
1420
|
this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);
|
|
1354
1421
|
}
|
|
1355
1422
|
else {
|
|
1356
|
-
refObject = (0,tslib_es6
|
|
1423
|
+
refObject = (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, refObject), { attribute: value });
|
|
1357
1424
|
}
|
|
1358
1425
|
}
|
|
1359
1426
|
else if (!this._checkObjectHasProperty(refObject, attribute)) {
|
|
1360
1427
|
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
1361
1428
|
}
|
|
1362
1429
|
else {
|
|
1363
|
-
if ((0,utilities
|
|
1430
|
+
if ((0,utilities.stringMatches)(CMIElement, "\\.correct_responses\\.\\d+") &&
|
|
1364
1431
|
this.isInitialized()) {
|
|
1365
1432
|
this.validateCorrectResponse(CMIElement, value);
|
|
1366
1433
|
}
|
|
1367
1434
|
if (!scorm2004 || this.lastErrorCode === "0") {
|
|
1368
1435
|
refObject[attribute] = value;
|
|
1369
|
-
returnValue = api_constants
|
|
1436
|
+
returnValue = api_constants.global_constants.SCORM_TRUE;
|
|
1370
1437
|
}
|
|
1371
1438
|
}
|
|
1372
1439
|
}
|
|
@@ -1376,7 +1443,7 @@ var BaseAPI = (function () {
|
|
|
1376
1443
|
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
1377
1444
|
break;
|
|
1378
1445
|
}
|
|
1379
|
-
if (refObject instanceof array
|
|
1446
|
+
if (refObject instanceof array.CMIArray) {
|
|
1380
1447
|
var index = parseInt(structure[idx + 1], 10);
|
|
1381
1448
|
if (!isNaN(index)) {
|
|
1382
1449
|
var item = refObject.childArray[index];
|
|
@@ -1402,8 +1469,8 @@ var BaseAPI = (function () {
|
|
|
1402
1469
|
}
|
|
1403
1470
|
}
|
|
1404
1471
|
}
|
|
1405
|
-
if (returnValue === api_constants
|
|
1406
|
-
this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value), enums
|
|
1472
|
+
if (returnValue === api_constants.global_constants.SCORM_FALSE) {
|
|
1473
|
+
this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value), enums.LogLevelEnum.WARN);
|
|
1407
1474
|
}
|
|
1408
1475
|
return returnValue;
|
|
1409
1476
|
};
|
|
@@ -1445,7 +1512,7 @@ var BaseAPI = (function () {
|
|
|
1445
1512
|
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
|
|
1446
1513
|
break;
|
|
1447
1514
|
}
|
|
1448
|
-
if (refObject instanceof array
|
|
1515
|
+
if (refObject instanceof array.CMIArray) {
|
|
1449
1516
|
var index = parseInt(structure[idx + 1], 10);
|
|
1450
1517
|
if (!isNaN(index)) {
|
|
1451
1518
|
var item = refObject.childArray[index];
|
|
@@ -1463,10 +1530,10 @@ var BaseAPI = (function () {
|
|
|
1463
1530
|
if (refObject === null || refObject === undefined) {
|
|
1464
1531
|
if (!scorm2004) {
|
|
1465
1532
|
if (attribute === "_children") {
|
|
1466
|
-
this.throwSCORMError(
|
|
1533
|
+
this.throwSCORMError(this._error_codes.CHILDREN_ERROR);
|
|
1467
1534
|
}
|
|
1468
1535
|
else if (attribute === "_count") {
|
|
1469
|
-
this.throwSCORMError(
|
|
1536
|
+
this.throwSCORMError(this._error_codes.COUNT_ERROR);
|
|
1470
1537
|
}
|
|
1471
1538
|
}
|
|
1472
1539
|
}
|
|
@@ -1475,13 +1542,13 @@ var BaseAPI = (function () {
|
|
|
1475
1542
|
}
|
|
1476
1543
|
};
|
|
1477
1544
|
BaseAPI.prototype.isInitialized = function () {
|
|
1478
|
-
return this.currentState === api_constants
|
|
1545
|
+
return this.currentState === api_constants.global_constants.STATE_INITIALIZED;
|
|
1479
1546
|
};
|
|
1480
1547
|
BaseAPI.prototype.isNotInitialized = function () {
|
|
1481
|
-
return this.currentState === api_constants
|
|
1548
|
+
return this.currentState === api_constants.global_constants.STATE_NOT_INITIALIZED;
|
|
1482
1549
|
};
|
|
1483
1550
|
BaseAPI.prototype.isTerminated = function () {
|
|
1484
|
-
return this.currentState === api_constants
|
|
1551
|
+
return this.currentState === api_constants.global_constants.STATE_TERMINATED;
|
|
1485
1552
|
};
|
|
1486
1553
|
BaseAPI.prototype.on = function (listenerName, callback) {
|
|
1487
1554
|
if (!callback)
|
|
@@ -1501,7 +1568,7 @@ var BaseAPI = (function () {
|
|
|
1501
1568
|
CMIElement: CMIElement,
|
|
1502
1569
|
callback: callback,
|
|
1503
1570
|
});
|
|
1504
|
-
this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), enums
|
|
1571
|
+
this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), enums.LogLevelEnum.INFO, functionName);
|
|
1505
1572
|
}
|
|
1506
1573
|
};
|
|
1507
1574
|
BaseAPI.prototype.off = function (listenerName, callback) {
|
|
@@ -1524,7 +1591,7 @@ var BaseAPI = (function () {
|
|
|
1524
1591
|
});
|
|
1525
1592
|
if (removeIndex !== -1) {
|
|
1526
1593
|
this_1.listenerArray.splice(removeIndex, 1);
|
|
1527
|
-
this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), enums
|
|
1594
|
+
this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), enums.LogLevelEnum.INFO, functionName);
|
|
1528
1595
|
}
|
|
1529
1596
|
};
|
|
1530
1597
|
var this_1 = this;
|
|
@@ -1557,7 +1624,7 @@ var BaseAPI = (function () {
|
|
|
1557
1624
|
}
|
|
1558
1625
|
};
|
|
1559
1626
|
BaseAPI.prototype.processListeners = function (functionName, CMIElement, value) {
|
|
1560
|
-
this.apiLog(functionName, value, enums
|
|
1627
|
+
this.apiLog(functionName, value, enums.LogLevelEnum.INFO, CMIElement);
|
|
1561
1628
|
for (var i = 0; i < this.listenerArray.length; i++) {
|
|
1562
1629
|
var listener = this.listenerArray[i];
|
|
1563
1630
|
var functionsMatch = listener.functionName === functionName;
|
|
@@ -1573,7 +1640,7 @@ var BaseAPI = (function () {
|
|
|
1573
1640
|
CMIElementsMatch = listener.CMIElement === CMIElement;
|
|
1574
1641
|
}
|
|
1575
1642
|
if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {
|
|
1576
|
-
this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), enums
|
|
1643
|
+
this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), enums.LogLevelEnum.INFO, CMIElement);
|
|
1577
1644
|
listener.callback(CMIElement, value);
|
|
1578
1645
|
}
|
|
1579
1646
|
}
|
|
@@ -1582,11 +1649,11 @@ var BaseAPI = (function () {
|
|
|
1582
1649
|
if (!message) {
|
|
1583
1650
|
message = this.getLmsErrorMessageDetails(errorNumber);
|
|
1584
1651
|
}
|
|
1585
|
-
this.apiLog("throwSCORMError", errorNumber + ": " + message, enums
|
|
1652
|
+
this.apiLog("throwSCORMError", errorNumber + ": " + message, enums.LogLevelEnum.ERROR);
|
|
1586
1653
|
this.lastErrorCode = String(errorNumber);
|
|
1587
1654
|
};
|
|
1588
1655
|
BaseAPI.prototype.clearSCORMError = function (success) {
|
|
1589
|
-
if (success !== undefined && success !== api_constants
|
|
1656
|
+
if (success !== undefined && success !== api_constants.global_constants.SCORM_FALSE) {
|
|
1590
1657
|
this.lastErrorCode = "0";
|
|
1591
1658
|
}
|
|
1592
1659
|
};
|
|
@@ -1652,11 +1719,16 @@ var BaseAPI = (function () {
|
|
|
1652
1719
|
result.forEach(function (element) {
|
|
1653
1720
|
obj = {};
|
|
1654
1721
|
obj[element[0]] = element[1];
|
|
1655
|
-
_this.loadFromJSON((0,utilities
|
|
1722
|
+
_this.loadFromJSON((0,utilities.unflatten)(obj), CMIElement);
|
|
1656
1723
|
});
|
|
1657
1724
|
};
|
|
1658
1725
|
BaseAPI.prototype.loadFromJSON = function (json, CMIElement) {
|
|
1659
1726
|
if (CMIElement === void 0) { CMIElement = ""; }
|
|
1727
|
+
if ((!CMIElement || CMIElement === "") &&
|
|
1728
|
+
!Object.hasOwnProperty.call(json, "cmi") &&
|
|
1729
|
+
!Object.hasOwnProperty.call(json, "adl")) {
|
|
1730
|
+
CMIElement = "cmi";
|
|
1731
|
+
}
|
|
1660
1732
|
if (!this.isNotInitialized()) {
|
|
1661
1733
|
console.error("loadFromJSON can only be called before the call to lmsInitialize.");
|
|
1662
1734
|
return;
|
|
@@ -1692,21 +1764,21 @@ var BaseAPI = (function () {
|
|
|
1692
1764
|
return JSON.parse(this.renderCMIToJSONString());
|
|
1693
1765
|
};
|
|
1694
1766
|
BaseAPI.prototype.processHttpRequest = function (url_1, params_1) {
|
|
1695
|
-
return (0,tslib_es6
|
|
1767
|
+
return (0,tslib_es6.__awaiter)(this, arguments, void 0, function (url, params, immediate) {
|
|
1696
1768
|
var api, genericError, process;
|
|
1697
1769
|
var _this = this;
|
|
1698
1770
|
if (immediate === void 0) { immediate = false; }
|
|
1699
|
-
return (0,tslib_es6
|
|
1771
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
1700
1772
|
switch (_a.label) {
|
|
1701
1773
|
case 0:
|
|
1702
1774
|
api = this;
|
|
1703
1775
|
genericError = {
|
|
1704
|
-
result: api_constants
|
|
1776
|
+
result: api_constants.global_constants.SCORM_FALSE,
|
|
1705
1777
|
errorCode: this.error_codes.GENERAL,
|
|
1706
1778
|
};
|
|
1707
1779
|
if (immediate) {
|
|
1708
|
-
this.performFetch(url, params).then(function (response) { return (0,tslib_es6
|
|
1709
|
-
return (0,tslib_es6
|
|
1780
|
+
this.performFetch(url, params).then(function (response) { return (0,tslib_es6.__awaiter)(_this, void 0, void 0, function () {
|
|
1781
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
1710
1782
|
switch (_a.label) {
|
|
1711
1783
|
case 0: return [4, this.transformResponse(response)];
|
|
1712
1784
|
case 1:
|
|
@@ -1716,13 +1788,13 @@ var BaseAPI = (function () {
|
|
|
1716
1788
|
});
|
|
1717
1789
|
}); });
|
|
1718
1790
|
return [2, {
|
|
1719
|
-
result: api_constants
|
|
1791
|
+
result: api_constants.global_constants.SCORM_TRUE,
|
|
1720
1792
|
errorCode: 0,
|
|
1721
1793
|
}];
|
|
1722
1794
|
}
|
|
1723
|
-
process = function (url, params, settings) { return (0,tslib_es6
|
|
1795
|
+
process = function (url, params, settings) { return (0,tslib_es6.__awaiter)(_this, void 0, void 0, function () {
|
|
1724
1796
|
var response, e_1;
|
|
1725
|
-
return (0,tslib_es6
|
|
1797
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
1726
1798
|
switch (_a.label) {
|
|
1727
1799
|
case 0:
|
|
1728
1800
|
_a.trys.push([0, 2, , 3]);
|
|
@@ -1733,7 +1805,7 @@ var BaseAPI = (function () {
|
|
|
1733
1805
|
return [2, this.transformResponse(response)];
|
|
1734
1806
|
case 2:
|
|
1735
1807
|
e_1 = _a.sent();
|
|
1736
|
-
this.apiLog("processHttpRequest", e_1, enums
|
|
1808
|
+
this.apiLog("processHttpRequest", e_1, enums.LogLevelEnum.ERROR);
|
|
1737
1809
|
api.processListeners("CommitError");
|
|
1738
1810
|
return [2, genericError];
|
|
1739
1811
|
case 3: return [2];
|
|
@@ -1749,14 +1821,14 @@ var BaseAPI = (function () {
|
|
|
1749
1821
|
BaseAPI.prototype.scheduleCommit = function (when, callback) {
|
|
1750
1822
|
if (!this._timeout) {
|
|
1751
1823
|
this._timeout = new ScheduledCommit(this, when, callback);
|
|
1752
|
-
this.apiLog("scheduleCommit", "scheduled", enums
|
|
1824
|
+
this.apiLog("scheduleCommit", "scheduled", enums.LogLevelEnum.DEBUG, "");
|
|
1753
1825
|
}
|
|
1754
1826
|
};
|
|
1755
1827
|
BaseAPI.prototype.clearScheduledCommit = function () {
|
|
1756
1828
|
if (this._timeout) {
|
|
1757
1829
|
this._timeout.cancel();
|
|
1758
1830
|
this._timeout = undefined;
|
|
1759
|
-
this.apiLog("clearScheduledCommit", "cleared", enums
|
|
1831
|
+
this.apiLog("clearScheduledCommit", "cleared", enums.LogLevelEnum.DEBUG, "");
|
|
1760
1832
|
}
|
|
1761
1833
|
};
|
|
1762
1834
|
BaseAPI.prototype._checkObjectHasProperty = function (refObject, attribute) {
|
|
@@ -1765,9 +1837,9 @@ var BaseAPI = (function () {
|
|
|
1765
1837
|
attribute in refObject);
|
|
1766
1838
|
};
|
|
1767
1839
|
BaseAPI.prototype.handleValueAccessException = function (e, returnValue) {
|
|
1768
|
-
if (e instanceof exceptions
|
|
1840
|
+
if (e instanceof exceptions.ValidationError) {
|
|
1769
1841
|
this.lastErrorCode = String(e.errorCode);
|
|
1770
|
-
returnValue = api_constants
|
|
1842
|
+
returnValue = api_constants.global_constants.SCORM_FALSE;
|
|
1771
1843
|
}
|
|
1772
1844
|
else {
|
|
1773
1845
|
if (e instanceof Error && e.message) {
|
|
@@ -1785,20 +1857,20 @@ var BaseAPI = (function () {
|
|
|
1785
1857
|
var commitObject = this.settings.renderCommonCommitFields
|
|
1786
1858
|
? this.renderCommitObject(shouldTerminateCommit)
|
|
1787
1859
|
: this.renderCommitCMI(shouldTerminateCommit);
|
|
1788
|
-
if ([enums
|
|
1860
|
+
if ([enums.LogLevelEnum.DEBUG, "1", 1, "DEBUG"].includes(this.apiLogLevel)) {
|
|
1789
1861
|
console.debug("Commit (terminated: " + (terminateCommit ? "yes" : "no") + "): ");
|
|
1790
1862
|
console.debug(commitObject);
|
|
1791
1863
|
}
|
|
1792
1864
|
return commitObject;
|
|
1793
1865
|
};
|
|
1794
1866
|
BaseAPI.prototype.performFetch = function (url, params) {
|
|
1795
|
-
return (0,tslib_es6
|
|
1796
|
-
return (0,tslib_es6
|
|
1867
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
1868
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
1797
1869
|
return [2, fetch(url, {
|
|
1798
1870
|
method: "POST",
|
|
1799
1871
|
mode: this.settings.fetchMode,
|
|
1800
1872
|
body: params instanceof Array ? params.join("&") : JSON.stringify(params),
|
|
1801
|
-
headers: (0,tslib_es6
|
|
1873
|
+
headers: (0,tslib_es6.__assign)((0,tslib_es6.__assign)({}, this.settings.xhrHeaders), { "Content-Type": this.settings.commitRequestDataType }),
|
|
1802
1874
|
credentials: this.settings.xhrWithCredentials ? "include" : undefined,
|
|
1803
1875
|
keepalive: true,
|
|
1804
1876
|
})];
|
|
@@ -1806,9 +1878,9 @@ var BaseAPI = (function () {
|
|
|
1806
1878
|
});
|
|
1807
1879
|
};
|
|
1808
1880
|
BaseAPI.prototype.transformResponse = function (response) {
|
|
1809
|
-
return (0,tslib_es6
|
|
1881
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
1810
1882
|
var result, _a;
|
|
1811
|
-
return (0,tslib_es6
|
|
1883
|
+
return (0,tslib_es6.__generator)(this, function (_c) {
|
|
1812
1884
|
switch (_c.label) {
|
|
1813
1885
|
case 0:
|
|
1814
1886
|
if (!(typeof this.settings.responseHandler === "function")) return [3, 2];
|
|
@@ -1824,8 +1896,7 @@ var BaseAPI = (function () {
|
|
|
1824
1896
|
result = _a;
|
|
1825
1897
|
if (response.status >= 200 &&
|
|
1826
1898
|
response.status <= 299 &&
|
|
1827
|
-
(result.result === true ||
|
|
1828
|
-
result.result === api_constants/* default */.A.global.SCORM_TRUE)) {
|
|
1899
|
+
(result.result === true || result.result === api_constants.global_constants.SCORM_TRUE)) {
|
|
1829
1900
|
this.processListeners("CommitSuccess");
|
|
1830
1901
|
}
|
|
1831
1902
|
else {
|
|
@@ -1846,8 +1917,9 @@ var BaseAPI = (function () {
|
|
|
1846
1917
|
/***/ 941:
|
|
1847
1918
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1848
1919
|
|
|
1920
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1849
1921
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1850
|
-
/* harmony export */
|
|
1922
|
+
/* harmony export */ Scorm12API: function() { return /* binding */ Scorm12Impl; }
|
|
1851
1923
|
/* harmony export */ });
|
|
1852
1924
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(635);
|
|
1853
1925
|
/* harmony import */ var _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(989);
|
|
@@ -1857,9 +1929,9 @@ var BaseAPI = (function () {
|
|
|
1857
1929
|
/* harmony import */ var _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(176);
|
|
1858
1930
|
/* harmony import */ var _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(833);
|
|
1859
1931
|
/* harmony import */ var _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(331);
|
|
1860
|
-
/* harmony import */ var
|
|
1861
|
-
/* harmony import */ var
|
|
1862
|
-
/* harmony import */ var
|
|
1932
|
+
/* harmony import */ var _constants_enums__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(56);
|
|
1933
|
+
/* harmony import */ var _BaseAPI__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(429);
|
|
1934
|
+
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(417);
|
|
1863
1935
|
|
|
1864
1936
|
|
|
1865
1937
|
|
|
@@ -1873,7 +1945,7 @@ var BaseAPI = (function () {
|
|
|
1873
1945
|
|
|
1874
1946
|
|
|
1875
1947
|
var Scorm12Impl = (function (_super) {
|
|
1876
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1948
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_10__.__extends)(Scorm12Impl, _super);
|
|
1877
1949
|
function Scorm12Impl(settings) {
|
|
1878
1950
|
var _this = this;
|
|
1879
1951
|
if (settings) {
|
|
@@ -1881,10 +1953,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
1881
1953
|
settings.mastery_override = false;
|
|
1882
1954
|
}
|
|
1883
1955
|
}
|
|
1884
|
-
_this = _super.call(this, _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__
|
|
1956
|
+
_this = _super.call(this, _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors, settings) || this;
|
|
1885
1957
|
_this.statusSetByModule = false;
|
|
1886
|
-
_this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
1887
|
-
_this.nav = new _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__
|
|
1958
|
+
_this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__.CMI();
|
|
1959
|
+
_this.nav = new _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__.NAV();
|
|
1888
1960
|
_this.LMSInitialize = _this.lmsInitialize;
|
|
1889
1961
|
_this.LMSFinish = _this.lmsFinish;
|
|
1890
1962
|
_this.LMSGetValue = _this.lmsGetValue;
|
|
@@ -1896,9 +1968,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
1896
1968
|
return _this;
|
|
1897
1969
|
}
|
|
1898
1970
|
Scorm12Impl.prototype.reset = function (settings) {
|
|
1971
|
+
var _a, _b;
|
|
1899
1972
|
this.commonReset(settings);
|
|
1900
|
-
this.cmi
|
|
1901
|
-
this.nav
|
|
1973
|
+
(_a = this.cmi) === null || _a === void 0 ? void 0 : _a.reset();
|
|
1974
|
+
(_b = this.nav) === null || _b === void 0 ? void 0 : _b.reset();
|
|
1902
1975
|
};
|
|
1903
1976
|
Scorm12Impl.prototype.lmsInitialize = function () {
|
|
1904
1977
|
this.cmi.initialize();
|
|
@@ -1912,8 +1985,8 @@ var Scorm12Impl = (function (_super) {
|
|
|
1912
1985
|
};
|
|
1913
1986
|
Scorm12Impl.prototype.lmsFinish = function () {
|
|
1914
1987
|
var _this = this;
|
|
1915
|
-
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1916
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1988
|
+
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(_this, void 0, void 0, function () {
|
|
1989
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_a) {
|
|
1917
1990
|
switch (_a.label) {
|
|
1918
1991
|
case 0: return [4, this.internalFinish()];
|
|
1919
1992
|
case 1:
|
|
@@ -1922,17 +1995,17 @@ var Scorm12Impl = (function (_super) {
|
|
|
1922
1995
|
}
|
|
1923
1996
|
});
|
|
1924
1997
|
}); })();
|
|
1925
|
-
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
1998
|
+
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE;
|
|
1926
1999
|
};
|
|
1927
2000
|
Scorm12Impl.prototype.internalFinish = function () {
|
|
1928
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
2001
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(this, void 0, void 0, function () {
|
|
1929
2002
|
var result;
|
|
1930
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
2003
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_a) {
|
|
1931
2004
|
switch (_a.label) {
|
|
1932
2005
|
case 0: return [4, this.terminate("LMSFinish", true)];
|
|
1933
2006
|
case 1:
|
|
1934
2007
|
result = _a.sent();
|
|
1935
|
-
if (result === _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2008
|
+
if (result === _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE) {
|
|
1936
2009
|
if (this.nav.event !== "") {
|
|
1937
2010
|
if (this.nav.event === "continue") {
|
|
1938
2011
|
this.processListeners("SequenceNext");
|
|
@@ -1965,8 +2038,8 @@ var Scorm12Impl = (function (_super) {
|
|
|
1965
2038
|
this.scheduleCommit(500, "LMSCommit");
|
|
1966
2039
|
}
|
|
1967
2040
|
else {
|
|
1968
|
-
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
1969
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
2041
|
+
(function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(_this, void 0, void 0, function () {
|
|
2042
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_a) {
|
|
1970
2043
|
switch (_a.label) {
|
|
1971
2044
|
case 0: return [4, this.commit("LMSCommit", false)];
|
|
1972
2045
|
case 1:
|
|
@@ -1976,7 +2049,7 @@ var Scorm12Impl = (function (_super) {
|
|
|
1976
2049
|
});
|
|
1977
2050
|
}); })();
|
|
1978
2051
|
}
|
|
1979
|
-
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2052
|
+
return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE;
|
|
1980
2053
|
};
|
|
1981
2054
|
Scorm12Impl.prototype.lmsGetLastError = function () {
|
|
1982
2055
|
return this.getLastError("LMSGetLastError");
|
|
@@ -1994,20 +2067,20 @@ var Scorm12Impl = (function (_super) {
|
|
|
1994
2067
|
return this._commonGetCMIValue("getCMIValue", false, CMIElement);
|
|
1995
2068
|
};
|
|
1996
2069
|
Scorm12Impl.prototype.getChildElement = function (CMIElement, _value, foundFirstIndex) {
|
|
1997
|
-
if ((0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
1998
|
-
return new _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__
|
|
2070
|
+
if ((0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.objectives\\.\\d+")) {
|
|
2071
|
+
return new _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__.CMIObjectivesObject();
|
|
1999
2072
|
}
|
|
2000
2073
|
else if (foundFirstIndex &&
|
|
2001
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
2002
|
-
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__
|
|
2074
|
+
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) {
|
|
2075
|
+
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__.CMIInteractionsCorrectResponsesObject();
|
|
2003
2076
|
}
|
|
2004
2077
|
else if (foundFirstIndex &&
|
|
2005
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
2006
|
-
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__
|
|
2078
|
+
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) {
|
|
2079
|
+
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__.CMIInteractionsObjectivesObject();
|
|
2007
2080
|
}
|
|
2008
2081
|
else if (!foundFirstIndex &&
|
|
2009
|
-
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
2010
|
-
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__
|
|
2082
|
+
(0,_utilities__WEBPACK_IMPORTED_MODULE_1__.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+")) {
|
|
2083
|
+
return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__.CMIInteractionsObject();
|
|
2011
2084
|
}
|
|
2012
2085
|
return null;
|
|
2013
2086
|
};
|
|
@@ -2017,11 +2090,11 @@ var Scorm12Impl = (function (_super) {
|
|
|
2017
2090
|
var basicMessage = "No Error";
|
|
2018
2091
|
var detailMessage = "No Error";
|
|
2019
2092
|
errorNumber = String(errorNumber);
|
|
2020
|
-
if (_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2093
|
+
if (_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber]) {
|
|
2021
2094
|
basicMessage =
|
|
2022
|
-
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2095
|
+
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber].basicMessage;
|
|
2023
2096
|
detailMessage =
|
|
2024
|
-
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2097
|
+
_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.error_descriptions[errorNumber].detailMessage;
|
|
2025
2098
|
}
|
|
2026
2099
|
return detail ? detailMessage : basicMessage;
|
|
2027
2100
|
};
|
|
@@ -2034,10 +2107,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
2034
2107
|
cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();
|
|
2035
2108
|
}
|
|
2036
2109
|
var result = [];
|
|
2037
|
-
var flattened = _utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
2110
|
+
var flattened = _utilities__WEBPACK_IMPORTED_MODULE_1__.flatten(cmiExport);
|
|
2038
2111
|
switch (this.settings.dataCommitFormat) {
|
|
2039
2112
|
case "flattened":
|
|
2040
|
-
return _utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
2113
|
+
return _utilities__WEBPACK_IMPORTED_MODULE_1__.flatten(cmiExport);
|
|
2041
2114
|
case "params":
|
|
2042
2115
|
for (var item in flattened) {
|
|
2043
2116
|
if ({}.hasOwnProperty.call(flattened, item)) {
|
|
@@ -2053,20 +2126,20 @@ var Scorm12Impl = (function (_super) {
|
|
|
2053
2126
|
Scorm12Impl.prototype.renderCommitObject = function (terminateCommit) {
|
|
2054
2127
|
var cmiExport = this.renderCommitCMI(terminateCommit);
|
|
2055
2128
|
var totalTimeHHMMSS = this.cmi.getCurrentTotalTime();
|
|
2056
|
-
var totalTimeSeconds = _utilities__WEBPACK_IMPORTED_MODULE_1__
|
|
2129
|
+
var totalTimeSeconds = _utilities__WEBPACK_IMPORTED_MODULE_1__.getTimeAsSeconds(totalTimeHHMMSS, _constants_regex__WEBPACK_IMPORTED_MODULE_9__.scorm12_regex.CMITimespan);
|
|
2057
2130
|
var lessonStatus = this.cmi.core.lesson_status;
|
|
2058
|
-
var completionStatus =
|
|
2059
|
-
var successStatus =
|
|
2131
|
+
var completionStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.unknown;
|
|
2132
|
+
var successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.unknown;
|
|
2060
2133
|
if (lessonStatus) {
|
|
2061
2134
|
completionStatus =
|
|
2062
2135
|
lessonStatus === "completed" || lessonStatus === "passed"
|
|
2063
|
-
?
|
|
2064
|
-
:
|
|
2136
|
+
? _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.completed
|
|
2137
|
+
: _constants_enums__WEBPACK_IMPORTED_MODULE_7__.CompletionStatus.incomplete;
|
|
2065
2138
|
if (lessonStatus === "passed") {
|
|
2066
|
-
successStatus =
|
|
2139
|
+
successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.passed;
|
|
2067
2140
|
}
|
|
2068
2141
|
else if (lessonStatus === "failed") {
|
|
2069
|
-
successStatus =
|
|
2142
|
+
successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_7__.SuccessStatus.failed;
|
|
2070
2143
|
}
|
|
2071
2144
|
}
|
|
2072
2145
|
var score = this.cmi.core.score;
|
|
@@ -2095,10 +2168,10 @@ var Scorm12Impl = (function (_super) {
|
|
|
2095
2168
|
return commitObject;
|
|
2096
2169
|
};
|
|
2097
2170
|
Scorm12Impl.prototype.storeData = function (terminateCommit) {
|
|
2098
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
2171
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(this, void 0, void 0, function () {
|
|
2099
2172
|
var originalStatus, commitObject;
|
|
2100
2173
|
var _a, _b, _c;
|
|
2101
|
-
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__
|
|
2174
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_d) {
|
|
2102
2175
|
switch (_d.label) {
|
|
2103
2176
|
case 0:
|
|
2104
2177
|
if (terminateCommit) {
|
|
@@ -2133,7 +2206,7 @@ var Scorm12Impl = (function (_super) {
|
|
|
2133
2206
|
return [4, this.processHttpRequest(this.settings.lmsCommitUrl, commitObject, terminateCommit)];
|
|
2134
2207
|
case 1: return [2, _d.sent()];
|
|
2135
2208
|
case 2: return [2, {
|
|
2136
|
-
result: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
2209
|
+
result: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.global_constants.SCORM_TRUE,
|
|
2137
2210
|
errorCode: 0,
|
|
2138
2211
|
}];
|
|
2139
2212
|
}
|
|
@@ -2141,19 +2214,21 @@ var Scorm12Impl = (function (_super) {
|
|
|
2141
2214
|
});
|
|
2142
2215
|
};
|
|
2143
2216
|
return Scorm12Impl;
|
|
2144
|
-
}(
|
|
2217
|
+
}(_BaseAPI__WEBPACK_IMPORTED_MODULE_8__["default"]));
|
|
2145
2218
|
|
|
2146
2219
|
|
|
2147
2220
|
|
|
2148
2221
|
/***/ }),
|
|
2149
2222
|
|
|
2150
|
-
/***/
|
|
2223
|
+
/***/ 809:
|
|
2151
2224
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2152
2225
|
|
|
2226
|
+
// ESM COMPAT FLAG
|
|
2227
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2153
2228
|
|
|
2154
2229
|
// EXPORTS
|
|
2155
2230
|
__webpack_require__.d(__webpack_exports__, {
|
|
2156
|
-
|
|
2231
|
+
Scorm2004API: function() { return /* binding */ Scorm2004Impl; }
|
|
2157
2232
|
});
|
|
2158
2233
|
|
|
2159
2234
|
// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs
|
|
@@ -2168,6 +2243,27 @@ var regex = __webpack_require__(417);
|
|
|
2168
2243
|
var error_codes = __webpack_require__(797);
|
|
2169
2244
|
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
2170
2245
|
var exceptions = __webpack_require__(784);
|
|
2246
|
+
;// ./src/exceptions/scorm2004_exceptions.ts
|
|
2247
|
+
|
|
2248
|
+
|
|
2249
|
+
|
|
2250
|
+
var scorm2004_errors = api_constants.scorm2004_constants.error_descriptions;
|
|
2251
|
+
var Scorm2004ValidationError = (function (_super) {
|
|
2252
|
+
(0,tslib_es6.__extends)(Scorm2004ValidationError, _super);
|
|
2253
|
+
function Scorm2004ValidationError(errorCode) {
|
|
2254
|
+
var _this = this;
|
|
2255
|
+
if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {
|
|
2256
|
+
_this = _super.call(this, errorCode, scorm2004_errors[String(errorCode)].basicMessage, scorm2004_errors[String(errorCode)].detailMessage) || this;
|
|
2257
|
+
}
|
|
2258
|
+
else {
|
|
2259
|
+
_this = _super.call(this, 101, scorm2004_errors["101"].basicMessage, scorm2004_errors["101"].detailMessage) || this;
|
|
2260
|
+
}
|
|
2261
|
+
return _this;
|
|
2262
|
+
}
|
|
2263
|
+
return Scorm2004ValidationError;
|
|
2264
|
+
}(exceptions.ValidationError));
|
|
2265
|
+
|
|
2266
|
+
|
|
2171
2267
|
// EXTERNAL MODULE: ./src/utilities.ts
|
|
2172
2268
|
var utilities = __webpack_require__(864);
|
|
2173
2269
|
// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts
|
|
@@ -2179,10 +2275,10 @@ var validation = __webpack_require__(449);
|
|
|
2179
2275
|
|
|
2180
2276
|
|
|
2181
2277
|
function check2004ValidFormat(value, regexPattern, allowEmptyString) {
|
|
2182
|
-
return (0,validation
|
|
2278
|
+
return (0,validation.checkValidFormat)(value, regexPattern, error_codes.scorm2004_errors.TYPE_MISMATCH, Scorm2004ValidationError, allowEmptyString);
|
|
2183
2279
|
}
|
|
2184
2280
|
function check2004ValidRange(value, rangePattern) {
|
|
2185
|
-
return (0,validation
|
|
2281
|
+
return (0,validation.checkValidRange)(value, rangePattern, error_codes.scorm2004_errors.VALUE_OUT_OF_RANGE, Scorm2004ValidationError);
|
|
2186
2282
|
}
|
|
2187
2283
|
|
|
2188
2284
|
;// ./src/cmi/scorm2004/learner_preference.ts
|
|
@@ -2194,22 +2290,25 @@ function check2004ValidRange(value, rangePattern) {
|
|
|
2194
2290
|
|
|
2195
2291
|
|
|
2196
2292
|
var CMILearnerPreference = (function (_super) {
|
|
2197
|
-
(0,tslib_es6
|
|
2293
|
+
(0,tslib_es6.__extends)(CMILearnerPreference, _super);
|
|
2198
2294
|
function CMILearnerPreference() {
|
|
2199
2295
|
var _this = _super.call(this) || this;
|
|
2200
|
-
_this.__children = api_constants
|
|
2296
|
+
_this.__children = api_constants.scorm2004_constants.student_preference_children;
|
|
2201
2297
|
_this._audio_level = "1";
|
|
2202
2298
|
_this._language = "";
|
|
2203
2299
|
_this._delivery_speed = "1";
|
|
2204
2300
|
_this._audio_captioning = "0";
|
|
2205
2301
|
return _this;
|
|
2206
2302
|
}
|
|
2303
|
+
CMILearnerPreference.prototype.reset = function () {
|
|
2304
|
+
this._initialized = false;
|
|
2305
|
+
};
|
|
2207
2306
|
Object.defineProperty(CMILearnerPreference.prototype, "_children", {
|
|
2208
2307
|
get: function () {
|
|
2209
2308
|
return this.__children;
|
|
2210
2309
|
},
|
|
2211
2310
|
set: function (_children) {
|
|
2212
|
-
throw new
|
|
2311
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
2213
2312
|
},
|
|
2214
2313
|
enumerable: false,
|
|
2215
2314
|
configurable: true
|
|
@@ -2219,8 +2318,8 @@ var CMILearnerPreference = (function (_super) {
|
|
|
2219
2318
|
return this._audio_level;
|
|
2220
2319
|
},
|
|
2221
2320
|
set: function (audio_level) {
|
|
2222
|
-
if (check2004ValidFormat(audio_level, regex
|
|
2223
|
-
check2004ValidRange(audio_level, regex
|
|
2321
|
+
if (check2004ValidFormat(audio_level, regex.scorm2004_regex.CMIDecimal) &&
|
|
2322
|
+
check2004ValidRange(audio_level, regex.scorm2004_regex.audio_range)) {
|
|
2224
2323
|
this._audio_level = audio_level;
|
|
2225
2324
|
}
|
|
2226
2325
|
},
|
|
@@ -2232,7 +2331,7 @@ var CMILearnerPreference = (function (_super) {
|
|
|
2232
2331
|
return this._language;
|
|
2233
2332
|
},
|
|
2234
2333
|
set: function (language) {
|
|
2235
|
-
if (check2004ValidFormat(language, regex
|
|
2334
|
+
if (check2004ValidFormat(language, regex.scorm2004_regex.CMILang)) {
|
|
2236
2335
|
this._language = language;
|
|
2237
2336
|
}
|
|
2238
2337
|
},
|
|
@@ -2244,8 +2343,8 @@ var CMILearnerPreference = (function (_super) {
|
|
|
2244
2343
|
return this._delivery_speed;
|
|
2245
2344
|
},
|
|
2246
2345
|
set: function (delivery_speed) {
|
|
2247
|
-
if (check2004ValidFormat(delivery_speed, regex
|
|
2248
|
-
check2004ValidRange(delivery_speed, regex
|
|
2346
|
+
if (check2004ValidFormat(delivery_speed, regex.scorm2004_regex.CMIDecimal) &&
|
|
2347
|
+
check2004ValidRange(delivery_speed, regex.scorm2004_regex.speed_range)) {
|
|
2249
2348
|
this._delivery_speed = delivery_speed;
|
|
2250
2349
|
}
|
|
2251
2350
|
},
|
|
@@ -2257,8 +2356,8 @@ var CMILearnerPreference = (function (_super) {
|
|
|
2257
2356
|
return this._audio_captioning;
|
|
2258
2357
|
},
|
|
2259
2358
|
set: function (audio_captioning) {
|
|
2260
|
-
if (check2004ValidFormat(audio_captioning, regex
|
|
2261
|
-
check2004ValidRange(audio_captioning, regex
|
|
2359
|
+
if (check2004ValidFormat(audio_captioning, regex.scorm2004_regex.CMISInteger) &&
|
|
2360
|
+
check2004ValidRange(audio_captioning, regex.scorm2004_regex.text_range)) {
|
|
2262
2361
|
this._audio_captioning = audio_captioning;
|
|
2263
2362
|
}
|
|
2264
2363
|
},
|
|
@@ -2277,14 +2376,13 @@ var CMILearnerPreference = (function (_super) {
|
|
|
2277
2376
|
return result;
|
|
2278
2377
|
};
|
|
2279
2378
|
return CMILearnerPreference;
|
|
2280
|
-
}(base_cmi
|
|
2379
|
+
}(base_cmi.BaseCMI));
|
|
2281
2380
|
|
|
2282
2381
|
|
|
2283
2382
|
// EXTERNAL MODULE: ./src/cmi/common/array.ts
|
|
2284
2383
|
var array = __webpack_require__(589);
|
|
2285
2384
|
;// ./src/constants/response_constants.ts
|
|
2286
2385
|
|
|
2287
|
-
var scorm2004_regex = regex/* default */.A.scorm2004;
|
|
2288
2386
|
var LearnerResponses = {
|
|
2289
2387
|
"true-false": {
|
|
2290
2388
|
format: "^true$|^false$",
|
|
@@ -2293,59 +2391,59 @@ var LearnerResponses = {
|
|
|
2293
2391
|
unique: false,
|
|
2294
2392
|
},
|
|
2295
2393
|
choice: {
|
|
2296
|
-
format: scorm2004_regex.CMILongIdentifier,
|
|
2394
|
+
format: regex.scorm2004_regex.CMILongIdentifier,
|
|
2297
2395
|
max: 36,
|
|
2298
2396
|
delimiter: "[,]",
|
|
2299
2397
|
unique: true,
|
|
2300
2398
|
},
|
|
2301
2399
|
"fill-in": {
|
|
2302
|
-
format: scorm2004_regex.CMILangString250,
|
|
2400
|
+
format: regex.scorm2004_regex.CMILangString250,
|
|
2303
2401
|
max: 10,
|
|
2304
2402
|
delimiter: "[,]",
|
|
2305
2403
|
unique: false,
|
|
2306
2404
|
},
|
|
2307
2405
|
"long-fill-in": {
|
|
2308
|
-
format: scorm2004_regex.CMILangString4000,
|
|
2406
|
+
format: regex.scorm2004_regex.CMILangString4000,
|
|
2309
2407
|
max: 1,
|
|
2310
2408
|
delimiter: "",
|
|
2311
2409
|
unique: false,
|
|
2312
2410
|
},
|
|
2313
2411
|
matching: {
|
|
2314
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2315
|
-
format2: scorm2004_regex.CMIShortIdentifier,
|
|
2412
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2413
|
+
format2: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2316
2414
|
max: 36,
|
|
2317
2415
|
delimiter: "[,]",
|
|
2318
2416
|
delimiter2: "[.]",
|
|
2319
2417
|
unique: false,
|
|
2320
2418
|
},
|
|
2321
2419
|
performance: {
|
|
2322
|
-
format: "^$|" + scorm2004_regex.CMIShortIdentifier,
|
|
2323
|
-
format2: scorm2004_regex.CMIDecimal + "|^$|" + scorm2004_regex.CMIShortIdentifier,
|
|
2420
|
+
format: "^$|" + regex.scorm2004_regex.CMIShortIdentifier,
|
|
2421
|
+
format2: regex.scorm2004_regex.CMIDecimal + "|^$|" + regex.scorm2004_regex.CMIShortIdentifier,
|
|
2324
2422
|
max: 250,
|
|
2325
2423
|
delimiter: "[,]",
|
|
2326
2424
|
delimiter2: "[.]",
|
|
2327
2425
|
unique: false,
|
|
2328
2426
|
},
|
|
2329
2427
|
sequencing: {
|
|
2330
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2428
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2331
2429
|
max: 36,
|
|
2332
2430
|
delimiter: "[,]",
|
|
2333
2431
|
unique: false,
|
|
2334
2432
|
},
|
|
2335
2433
|
likert: {
|
|
2336
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2434
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2337
2435
|
max: 1,
|
|
2338
2436
|
delimiter: "",
|
|
2339
2437
|
unique: false,
|
|
2340
2438
|
},
|
|
2341
2439
|
numeric: {
|
|
2342
|
-
format: scorm2004_regex.CMIDecimal,
|
|
2440
|
+
format: regex.scorm2004_regex.CMIDecimal,
|
|
2343
2441
|
max: 1,
|
|
2344
2442
|
delimiter: "",
|
|
2345
2443
|
unique: false,
|
|
2346
2444
|
},
|
|
2347
2445
|
other: {
|
|
2348
|
-
format: scorm2004_regex.CMIString4000,
|
|
2446
|
+
format: regex.scorm2004_regex.CMIString4000,
|
|
2349
2447
|
max: 1,
|
|
2350
2448
|
delimiter: "",
|
|
2351
2449
|
unique: false,
|
|
@@ -2365,21 +2463,21 @@ var CorrectResponses = {
|
|
|
2365
2463
|
delimiter: "[,]",
|
|
2366
2464
|
unique: true,
|
|
2367
2465
|
duplicate: false,
|
|
2368
|
-
format: scorm2004_regex.CMILongIdentifier,
|
|
2466
|
+
format: regex.scorm2004_regex.CMILongIdentifier,
|
|
2369
2467
|
},
|
|
2370
2468
|
"fill-in": {
|
|
2371
2469
|
max: 10,
|
|
2372
2470
|
delimiter: "[,]",
|
|
2373
2471
|
unique: false,
|
|
2374
2472
|
duplicate: false,
|
|
2375
|
-
format: scorm2004_regex.CMILangString250cr,
|
|
2473
|
+
format: regex.scorm2004_regex.CMILangString250cr,
|
|
2376
2474
|
},
|
|
2377
2475
|
"long-fill-in": {
|
|
2378
2476
|
max: 1,
|
|
2379
2477
|
delimiter: "",
|
|
2380
2478
|
unique: false,
|
|
2381
2479
|
duplicate: true,
|
|
2382
|
-
format: scorm2004_regex.CMILangString4000,
|
|
2480
|
+
format: regex.scorm2004_regex.CMILangString4000,
|
|
2383
2481
|
},
|
|
2384
2482
|
matching: {
|
|
2385
2483
|
max: 36,
|
|
@@ -2387,8 +2485,8 @@ var CorrectResponses = {
|
|
|
2387
2485
|
delimiter2: "[.]",
|
|
2388
2486
|
unique: false,
|
|
2389
2487
|
duplicate: false,
|
|
2390
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2391
|
-
format2: scorm2004_regex.CMIShortIdentifier,
|
|
2488
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2489
|
+
format2: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2392
2490
|
},
|
|
2393
2491
|
performance: {
|
|
2394
2492
|
max: 250,
|
|
@@ -2397,22 +2495,22 @@ var CorrectResponses = {
|
|
|
2397
2495
|
delimiter3: "[:]",
|
|
2398
2496
|
unique: false,
|
|
2399
2497
|
duplicate: false,
|
|
2400
|
-
format: "^$|" + scorm2004_regex.CMIShortIdentifier,
|
|
2401
|
-
format2: scorm2004_regex.CMIDecimal + "|^$|" + scorm2004_regex.CMIShortIdentifier,
|
|
2498
|
+
format: "^$|" + regex.scorm2004_regex.CMIShortIdentifier,
|
|
2499
|
+
format2: regex.scorm2004_regex.CMIDecimal + "|^$|" + regex.scorm2004_regex.CMIShortIdentifier,
|
|
2402
2500
|
},
|
|
2403
2501
|
sequencing: {
|
|
2404
2502
|
max: 36,
|
|
2405
2503
|
delimiter: "[,]",
|
|
2406
2504
|
unique: false,
|
|
2407
2505
|
duplicate: false,
|
|
2408
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2506
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2409
2507
|
},
|
|
2410
2508
|
likert: {
|
|
2411
2509
|
max: 1,
|
|
2412
2510
|
delimiter: "",
|
|
2413
2511
|
unique: false,
|
|
2414
2512
|
duplicate: false,
|
|
2415
|
-
format: scorm2004_regex.CMIShortIdentifier,
|
|
2513
|
+
format: regex.scorm2004_regex.CMIShortIdentifier,
|
|
2416
2514
|
limit: 1,
|
|
2417
2515
|
},
|
|
2418
2516
|
numeric: {
|
|
@@ -2420,7 +2518,7 @@ var CorrectResponses = {
|
|
|
2420
2518
|
delimiter: "[:]",
|
|
2421
2519
|
unique: false,
|
|
2422
2520
|
duplicate: false,
|
|
2423
|
-
format: scorm2004_regex.CMIDecimal,
|
|
2521
|
+
format: regex.scorm2004_regex.CMIDecimal,
|
|
2424
2522
|
limit: 1,
|
|
2425
2523
|
},
|
|
2426
2524
|
other: {
|
|
@@ -2428,7 +2526,7 @@ var CorrectResponses = {
|
|
|
2428
2526
|
delimiter: "",
|
|
2429
2527
|
unique: false,
|
|
2430
2528
|
duplicate: false,
|
|
2431
|
-
format: scorm2004_regex.CMIString4000,
|
|
2529
|
+
format: regex.scorm2004_regex.CMIString4000,
|
|
2432
2530
|
limit: 1,
|
|
2433
2531
|
},
|
|
2434
2532
|
};
|
|
@@ -2444,19 +2542,19 @@ var CorrectResponses = {
|
|
|
2444
2542
|
|
|
2445
2543
|
|
|
2446
2544
|
var CMIInteractions = (function (_super) {
|
|
2447
|
-
(0,tslib_es6
|
|
2545
|
+
(0,tslib_es6.__extends)(CMIInteractions, _super);
|
|
2448
2546
|
function CMIInteractions() {
|
|
2449
2547
|
return _super.call(this, {
|
|
2450
|
-
children: api_constants
|
|
2451
|
-
errorCode: error_codes
|
|
2452
|
-
errorClass:
|
|
2548
|
+
children: api_constants.scorm2004_constants.interactions_children,
|
|
2549
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2550
|
+
errorClass: Scorm2004ValidationError,
|
|
2453
2551
|
}) || this;
|
|
2454
2552
|
}
|
|
2455
2553
|
return CMIInteractions;
|
|
2456
|
-
}(array
|
|
2554
|
+
}(array.CMIArray));
|
|
2457
2555
|
|
|
2458
2556
|
var CMIInteractionsObject = (function (_super) {
|
|
2459
|
-
(0,tslib_es6
|
|
2557
|
+
(0,tslib_es6.__extends)(CMIInteractionsObject, _super);
|
|
2460
2558
|
function CMIInteractionsObject() {
|
|
2461
2559
|
var _this = _super.call(this) || this;
|
|
2462
2560
|
_this._id = "";
|
|
@@ -2467,15 +2565,15 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2467
2565
|
_this._result = "";
|
|
2468
2566
|
_this._latency = "";
|
|
2469
2567
|
_this._description = "";
|
|
2470
|
-
_this.objectives = new array
|
|
2471
|
-
errorCode: error_codes
|
|
2472
|
-
errorClass:
|
|
2473
|
-
children: api_constants
|
|
2568
|
+
_this.objectives = new array.CMIArray({
|
|
2569
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2570
|
+
errorClass: Scorm2004ValidationError,
|
|
2571
|
+
children: api_constants.scorm2004_constants.objectives_children,
|
|
2474
2572
|
});
|
|
2475
|
-
_this.correct_responses = new array
|
|
2476
|
-
errorCode: error_codes
|
|
2477
|
-
errorClass:
|
|
2478
|
-
children: api_constants
|
|
2573
|
+
_this.correct_responses = new array.CMIArray({
|
|
2574
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2575
|
+
errorClass: Scorm2004ValidationError,
|
|
2576
|
+
children: api_constants.scorm2004_constants.correct_responses_children,
|
|
2479
2577
|
});
|
|
2480
2578
|
return _this;
|
|
2481
2579
|
}
|
|
@@ -2485,12 +2583,33 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2485
2583
|
(_a = this.objectives) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
2486
2584
|
(_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.initialize();
|
|
2487
2585
|
};
|
|
2586
|
+
CMIInteractionsObject.prototype.reset = function () {
|
|
2587
|
+
this._initialized = false;
|
|
2588
|
+
this._id = "";
|
|
2589
|
+
this._type = "";
|
|
2590
|
+
this._timestamp = "";
|
|
2591
|
+
this._weighting = "";
|
|
2592
|
+
this._learner_response = "";
|
|
2593
|
+
this._result = "";
|
|
2594
|
+
this._latency = "";
|
|
2595
|
+
this._description = "";
|
|
2596
|
+
this.objectives = new array.CMIArray({
|
|
2597
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2598
|
+
errorClass: Scorm2004ValidationError,
|
|
2599
|
+
children: api_constants.scorm2004_constants.objectives_children,
|
|
2600
|
+
});
|
|
2601
|
+
this.correct_responses = new array.CMIArray({
|
|
2602
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2603
|
+
errorClass: Scorm2004ValidationError,
|
|
2604
|
+
children: api_constants.scorm2004_constants.correct_responses_children,
|
|
2605
|
+
});
|
|
2606
|
+
};
|
|
2488
2607
|
Object.defineProperty(CMIInteractionsObject.prototype, "id", {
|
|
2489
2608
|
get: function () {
|
|
2490
2609
|
return this._id;
|
|
2491
2610
|
},
|
|
2492
2611
|
set: function (id) {
|
|
2493
|
-
if (check2004ValidFormat(id, regex
|
|
2612
|
+
if (check2004ValidFormat(id, regex.scorm2004_regex.CMILongIdentifier)) {
|
|
2494
2613
|
this._id = id;
|
|
2495
2614
|
}
|
|
2496
2615
|
},
|
|
@@ -2503,10 +2622,10 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2503
2622
|
},
|
|
2504
2623
|
set: function (type) {
|
|
2505
2624
|
if (this.initialized && this._id === "") {
|
|
2506
|
-
throw new
|
|
2625
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2507
2626
|
}
|
|
2508
2627
|
else {
|
|
2509
|
-
if (check2004ValidFormat(type, regex
|
|
2628
|
+
if (check2004ValidFormat(type, regex.scorm2004_regex.CMIType)) {
|
|
2510
2629
|
this._type = type;
|
|
2511
2630
|
}
|
|
2512
2631
|
}
|
|
@@ -2520,10 +2639,10 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2520
2639
|
},
|
|
2521
2640
|
set: function (timestamp) {
|
|
2522
2641
|
if (this.initialized && this._id === "") {
|
|
2523
|
-
throw new
|
|
2642
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2524
2643
|
}
|
|
2525
2644
|
else {
|
|
2526
|
-
if (check2004ValidFormat(timestamp, regex
|
|
2645
|
+
if (check2004ValidFormat(timestamp, regex.scorm2004_regex.CMITime)) {
|
|
2527
2646
|
this._timestamp = timestamp;
|
|
2528
2647
|
}
|
|
2529
2648
|
}
|
|
@@ -2537,10 +2656,10 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2537
2656
|
},
|
|
2538
2657
|
set: function (weighting) {
|
|
2539
2658
|
if (this.initialized && this._id === "") {
|
|
2540
|
-
throw new
|
|
2659
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2541
2660
|
}
|
|
2542
2661
|
else {
|
|
2543
|
-
if (check2004ValidFormat(weighting, regex
|
|
2662
|
+
if (check2004ValidFormat(weighting, regex.scorm2004_regex.CMIDecimal)) {
|
|
2544
2663
|
this._weighting = weighting;
|
|
2545
2664
|
}
|
|
2546
2665
|
}
|
|
@@ -2554,7 +2673,7 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2554
2673
|
},
|
|
2555
2674
|
set: function (learner_response) {
|
|
2556
2675
|
if (this.initialized && (this._type === "" || this._id === "")) {
|
|
2557
|
-
throw new
|
|
2676
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2558
2677
|
}
|
|
2559
2678
|
else {
|
|
2560
2679
|
var nodes = [];
|
|
@@ -2573,28 +2692,28 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2573
2692
|
var values = nodes[i].split(response_type.delimiter2);
|
|
2574
2693
|
if (values.length === 2) {
|
|
2575
2694
|
if (!values[0].match(formatRegex)) {
|
|
2576
|
-
throw new
|
|
2695
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2577
2696
|
}
|
|
2578
2697
|
else {
|
|
2579
2698
|
if (!response_type.format2 ||
|
|
2580
2699
|
!values[1].match(new RegExp(response_type.format2))) {
|
|
2581
|
-
throw new
|
|
2700
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2582
2701
|
}
|
|
2583
2702
|
}
|
|
2584
2703
|
}
|
|
2585
2704
|
else {
|
|
2586
|
-
throw new
|
|
2705
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2587
2706
|
}
|
|
2588
2707
|
}
|
|
2589
2708
|
else {
|
|
2590
2709
|
if (!nodes[i].match(formatRegex)) {
|
|
2591
|
-
throw new
|
|
2710
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2592
2711
|
}
|
|
2593
2712
|
else {
|
|
2594
2713
|
if (nodes[i] !== "" && response_type.unique) {
|
|
2595
2714
|
for (var j = 0; j < i; j++) {
|
|
2596
2715
|
if (nodes[i] === nodes[j]) {
|
|
2597
|
-
throw new
|
|
2716
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2598
2717
|
}
|
|
2599
2718
|
}
|
|
2600
2719
|
}
|
|
@@ -2603,12 +2722,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2603
2722
|
}
|
|
2604
2723
|
}
|
|
2605
2724
|
else {
|
|
2606
|
-
throw new
|
|
2725
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE);
|
|
2607
2726
|
}
|
|
2608
2727
|
this._learner_response = learner_response;
|
|
2609
2728
|
}
|
|
2610
2729
|
else {
|
|
2611
|
-
throw new
|
|
2730
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
2612
2731
|
}
|
|
2613
2732
|
}
|
|
2614
2733
|
},
|
|
@@ -2620,7 +2739,7 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2620
2739
|
return this._result;
|
|
2621
2740
|
},
|
|
2622
2741
|
set: function (result) {
|
|
2623
|
-
if (check2004ValidFormat(result, regex
|
|
2742
|
+
if (check2004ValidFormat(result, regex.scorm2004_regex.CMIResult)) {
|
|
2624
2743
|
this._result = result;
|
|
2625
2744
|
}
|
|
2626
2745
|
},
|
|
@@ -2633,10 +2752,10 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2633
2752
|
},
|
|
2634
2753
|
set: function (latency) {
|
|
2635
2754
|
if (this.initialized && this._id === "") {
|
|
2636
|
-
throw new
|
|
2755
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2637
2756
|
}
|
|
2638
2757
|
else {
|
|
2639
|
-
if (check2004ValidFormat(latency, regex
|
|
2758
|
+
if (check2004ValidFormat(latency, regex.scorm2004_regex.CMITimespan)) {
|
|
2640
2759
|
this._latency = latency;
|
|
2641
2760
|
}
|
|
2642
2761
|
}
|
|
@@ -2650,10 +2769,10 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2650
2769
|
},
|
|
2651
2770
|
set: function (description) {
|
|
2652
2771
|
if (this.initialized && this._id === "") {
|
|
2653
|
-
throw new
|
|
2772
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2654
2773
|
}
|
|
2655
2774
|
else {
|
|
2656
|
-
if (check2004ValidFormat(description, regex
|
|
2775
|
+
if (check2004ValidFormat(description, regex.scorm2004_regex.CMILangString250, true)) {
|
|
2657
2776
|
this._description = description;
|
|
2658
2777
|
}
|
|
2659
2778
|
}
|
|
@@ -2679,21 +2798,25 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
2679
2798
|
return result;
|
|
2680
2799
|
};
|
|
2681
2800
|
return CMIInteractionsObject;
|
|
2682
|
-
}(base_cmi
|
|
2801
|
+
}(base_cmi.BaseCMI));
|
|
2683
2802
|
|
|
2684
2803
|
var CMIInteractionsObjectivesObject = (function (_super) {
|
|
2685
|
-
(0,tslib_es6
|
|
2804
|
+
(0,tslib_es6.__extends)(CMIInteractionsObjectivesObject, _super);
|
|
2686
2805
|
function CMIInteractionsObjectivesObject() {
|
|
2687
2806
|
var _this = _super.call(this) || this;
|
|
2688
2807
|
_this._id = "";
|
|
2689
2808
|
return _this;
|
|
2690
2809
|
}
|
|
2810
|
+
CMIInteractionsObjectivesObject.prototype.reset = function () {
|
|
2811
|
+
this._initialized = false;
|
|
2812
|
+
this._id = "";
|
|
2813
|
+
};
|
|
2691
2814
|
Object.defineProperty(CMIInteractionsObjectivesObject.prototype, "id", {
|
|
2692
2815
|
get: function () {
|
|
2693
2816
|
return this._id;
|
|
2694
2817
|
},
|
|
2695
2818
|
set: function (id) {
|
|
2696
|
-
if (check2004ValidFormat(id, regex
|
|
2819
|
+
if (check2004ValidFormat(id, regex.scorm2004_regex.CMILongIdentifier)) {
|
|
2697
2820
|
this._id = id;
|
|
2698
2821
|
}
|
|
2699
2822
|
},
|
|
@@ -2709,21 +2832,25 @@ var CMIInteractionsObjectivesObject = (function (_super) {
|
|
|
2709
2832
|
return result;
|
|
2710
2833
|
};
|
|
2711
2834
|
return CMIInteractionsObjectivesObject;
|
|
2712
|
-
}(base_cmi
|
|
2835
|
+
}(base_cmi.BaseCMI));
|
|
2713
2836
|
|
|
2714
2837
|
var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
2715
|
-
(0,tslib_es6
|
|
2838
|
+
(0,tslib_es6.__extends)(CMIInteractionsCorrectResponsesObject, _super);
|
|
2716
2839
|
function CMIInteractionsCorrectResponsesObject() {
|
|
2717
2840
|
var _this = _super.call(this) || this;
|
|
2718
2841
|
_this._pattern = "";
|
|
2719
2842
|
return _this;
|
|
2720
2843
|
}
|
|
2844
|
+
CMIInteractionsCorrectResponsesObject.prototype.reset = function () {
|
|
2845
|
+
this._initialized = false;
|
|
2846
|
+
this._pattern = "";
|
|
2847
|
+
};
|
|
2721
2848
|
Object.defineProperty(CMIInteractionsCorrectResponsesObject.prototype, "pattern", {
|
|
2722
2849
|
get: function () {
|
|
2723
2850
|
return this._pattern;
|
|
2724
2851
|
},
|
|
2725
2852
|
set: function (pattern) {
|
|
2726
|
-
if (check2004ValidFormat(pattern, regex
|
|
2853
|
+
if (check2004ValidFormat(pattern, regex.scorm2004_regex.CMIFeedback)) {
|
|
2727
2854
|
this._pattern = pattern;
|
|
2728
2855
|
}
|
|
2729
2856
|
},
|
|
@@ -2739,7 +2866,7 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
2739
2866
|
return result;
|
|
2740
2867
|
};
|
|
2741
2868
|
return CMIInteractionsCorrectResponsesObject;
|
|
2742
|
-
}(base_cmi
|
|
2869
|
+
}(base_cmi.BaseCMI));
|
|
2743
2870
|
|
|
2744
2871
|
|
|
2745
2872
|
// EXTERNAL MODULE: ./src/cmi/common/score.ts
|
|
@@ -2753,27 +2880,34 @@ var score = __webpack_require__(434);
|
|
|
2753
2880
|
|
|
2754
2881
|
|
|
2755
2882
|
var Scorm2004CMIScore = (function (_super) {
|
|
2756
|
-
(0,tslib_es6
|
|
2883
|
+
(0,tslib_es6.__extends)(Scorm2004CMIScore, _super);
|
|
2757
2884
|
function Scorm2004CMIScore() {
|
|
2758
2885
|
var _this = _super.call(this, {
|
|
2759
|
-
score_children: api_constants
|
|
2886
|
+
score_children: api_constants.scorm2004_constants.score_children,
|
|
2760
2887
|
max: "",
|
|
2761
|
-
invalidErrorCode: error_codes
|
|
2762
|
-
invalidTypeCode: error_codes
|
|
2763
|
-
invalidRangeCode: error_codes
|
|
2764
|
-
decimalRegex: regex
|
|
2765
|
-
errorClass:
|
|
2888
|
+
invalidErrorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2889
|
+
invalidTypeCode: error_codes.scorm2004_errors.TYPE_MISMATCH,
|
|
2890
|
+
invalidRangeCode: error_codes.scorm2004_errors.VALUE_OUT_OF_RANGE,
|
|
2891
|
+
decimalRegex: regex.scorm2004_regex.CMIDecimal,
|
|
2892
|
+
errorClass: Scorm2004ValidationError,
|
|
2766
2893
|
}) || this;
|
|
2767
2894
|
_this._scaled = "";
|
|
2768
2895
|
return _this;
|
|
2769
2896
|
}
|
|
2897
|
+
Scorm2004CMIScore.prototype.reset = function () {
|
|
2898
|
+
this._initialized = false;
|
|
2899
|
+
this._scaled = "";
|
|
2900
|
+
this._raw = "";
|
|
2901
|
+
this._min = "";
|
|
2902
|
+
this._max = "";
|
|
2903
|
+
};
|
|
2770
2904
|
Object.defineProperty(Scorm2004CMIScore.prototype, "scaled", {
|
|
2771
2905
|
get: function () {
|
|
2772
2906
|
return this._scaled;
|
|
2773
2907
|
},
|
|
2774
2908
|
set: function (scaled) {
|
|
2775
|
-
if (check2004ValidFormat(scaled, regex
|
|
2776
|
-
check2004ValidRange(scaled, regex
|
|
2909
|
+
if (check2004ValidFormat(scaled, regex.scorm2004_regex.CMIDecimal) &&
|
|
2910
|
+
check2004ValidRange(scaled, regex.scorm2004_regex.scaled_range)) {
|
|
2777
2911
|
this._scaled = scaled;
|
|
2778
2912
|
}
|
|
2779
2913
|
},
|
|
@@ -2792,7 +2926,7 @@ var Scorm2004CMIScore = (function (_super) {
|
|
|
2792
2926
|
return result;
|
|
2793
2927
|
};
|
|
2794
2928
|
return Scorm2004CMIScore;
|
|
2795
|
-
}(score
|
|
2929
|
+
}(score.CMIScore));
|
|
2796
2930
|
|
|
2797
2931
|
|
|
2798
2932
|
;// ./src/cmi/scorm2004/comments.ts
|
|
@@ -2805,31 +2939,31 @@ var Scorm2004CMIScore = (function (_super) {
|
|
|
2805
2939
|
|
|
2806
2940
|
|
|
2807
2941
|
var CMICommentsFromLMS = (function (_super) {
|
|
2808
|
-
(0,tslib_es6
|
|
2942
|
+
(0,tslib_es6.__extends)(CMICommentsFromLMS, _super);
|
|
2809
2943
|
function CMICommentsFromLMS() {
|
|
2810
2944
|
return _super.call(this, {
|
|
2811
|
-
children: api_constants
|
|
2812
|
-
errorCode: error_codes
|
|
2813
|
-
errorClass:
|
|
2945
|
+
children: api_constants.scorm2004_constants.comments_children,
|
|
2946
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2947
|
+
errorClass: Scorm2004ValidationError,
|
|
2814
2948
|
}) || this;
|
|
2815
2949
|
}
|
|
2816
2950
|
return CMICommentsFromLMS;
|
|
2817
|
-
}(array
|
|
2951
|
+
}(array.CMIArray));
|
|
2818
2952
|
|
|
2819
2953
|
var CMICommentsFromLearner = (function (_super) {
|
|
2820
|
-
(0,tslib_es6
|
|
2954
|
+
(0,tslib_es6.__extends)(CMICommentsFromLearner, _super);
|
|
2821
2955
|
function CMICommentsFromLearner() {
|
|
2822
2956
|
return _super.call(this, {
|
|
2823
|
-
children: api_constants
|
|
2824
|
-
errorCode: error_codes
|
|
2825
|
-
errorClass:
|
|
2957
|
+
children: api_constants.scorm2004_constants.comments_children,
|
|
2958
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
2959
|
+
errorClass: Scorm2004ValidationError,
|
|
2826
2960
|
}) || this;
|
|
2827
2961
|
}
|
|
2828
2962
|
return CMICommentsFromLearner;
|
|
2829
|
-
}(array
|
|
2963
|
+
}(array.CMIArray));
|
|
2830
2964
|
|
|
2831
2965
|
var CMICommentsObject = (function (_super) {
|
|
2832
|
-
(0,tslib_es6
|
|
2966
|
+
(0,tslib_es6.__extends)(CMICommentsObject, _super);
|
|
2833
2967
|
function CMICommentsObject(readOnlyAfterInit) {
|
|
2834
2968
|
if (readOnlyAfterInit === void 0) { readOnlyAfterInit = false; }
|
|
2835
2969
|
var _this = _super.call(this) || this;
|
|
@@ -2842,16 +2976,19 @@ var CMICommentsObject = (function (_super) {
|
|
|
2842
2976
|
_this._readOnlyAfterInit = readOnlyAfterInit;
|
|
2843
2977
|
return _this;
|
|
2844
2978
|
}
|
|
2979
|
+
CMICommentsObject.prototype.reset = function () {
|
|
2980
|
+
this._initialized = false;
|
|
2981
|
+
};
|
|
2845
2982
|
Object.defineProperty(CMICommentsObject.prototype, "comment", {
|
|
2846
2983
|
get: function () {
|
|
2847
2984
|
return this._comment;
|
|
2848
2985
|
},
|
|
2849
2986
|
set: function (comment) {
|
|
2850
2987
|
if (this.initialized && this._readOnlyAfterInit) {
|
|
2851
|
-
throw new
|
|
2988
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
2852
2989
|
}
|
|
2853
2990
|
else {
|
|
2854
|
-
if (check2004ValidFormat(comment, regex
|
|
2991
|
+
if (check2004ValidFormat(comment, regex.scorm2004_regex.CMILangString4000, true)) {
|
|
2855
2992
|
this._comment = comment;
|
|
2856
2993
|
}
|
|
2857
2994
|
}
|
|
@@ -2865,10 +3002,10 @@ var CMICommentsObject = (function (_super) {
|
|
|
2865
3002
|
},
|
|
2866
3003
|
set: function (location) {
|
|
2867
3004
|
if (this.initialized && this._readOnlyAfterInit) {
|
|
2868
|
-
throw new
|
|
3005
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
2869
3006
|
}
|
|
2870
3007
|
else {
|
|
2871
|
-
if (check2004ValidFormat(location, regex
|
|
3008
|
+
if (check2004ValidFormat(location, regex.scorm2004_regex.CMIString250)) {
|
|
2872
3009
|
this._location = location;
|
|
2873
3010
|
}
|
|
2874
3011
|
}
|
|
@@ -2882,10 +3019,10 @@ var CMICommentsObject = (function (_super) {
|
|
|
2882
3019
|
},
|
|
2883
3020
|
set: function (timestamp) {
|
|
2884
3021
|
if (this.initialized && this._readOnlyAfterInit) {
|
|
2885
|
-
throw new
|
|
3022
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
2886
3023
|
}
|
|
2887
3024
|
else {
|
|
2888
|
-
if (check2004ValidFormat(timestamp, regex
|
|
3025
|
+
if (check2004ValidFormat(timestamp, regex.scorm2004_regex.CMITime)) {
|
|
2889
3026
|
this._timestamp = timestamp;
|
|
2890
3027
|
}
|
|
2891
3028
|
}
|
|
@@ -2904,7 +3041,7 @@ var CMICommentsObject = (function (_super) {
|
|
|
2904
3041
|
return result;
|
|
2905
3042
|
};
|
|
2906
3043
|
return CMICommentsObject;
|
|
2907
|
-
}(base_cmi
|
|
3044
|
+
}(base_cmi.BaseCMI));
|
|
2908
3045
|
|
|
2909
3046
|
|
|
2910
3047
|
;// ./src/cmi/scorm2004/objectives.ts
|
|
@@ -2918,19 +3055,28 @@ var CMICommentsObject = (function (_super) {
|
|
|
2918
3055
|
|
|
2919
3056
|
|
|
2920
3057
|
var CMIObjectives = (function (_super) {
|
|
2921
|
-
(0,tslib_es6
|
|
3058
|
+
(0,tslib_es6.__extends)(CMIObjectives, _super);
|
|
2922
3059
|
function CMIObjectives() {
|
|
2923
3060
|
return _super.call(this, {
|
|
2924
|
-
children: api_constants
|
|
2925
|
-
errorCode: error_codes
|
|
2926
|
-
errorClass:
|
|
3061
|
+
children: api_constants.scorm2004_constants.objectives_children,
|
|
3062
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
3063
|
+
errorClass: Scorm2004ValidationError,
|
|
2927
3064
|
}) || this;
|
|
2928
3065
|
}
|
|
3066
|
+
CMIObjectives.prototype.findObjectiveById = function (id) {
|
|
3067
|
+
return this.childArray.find(function (objective) { return objective.id === id; });
|
|
3068
|
+
};
|
|
3069
|
+
CMIObjectives.prototype.findObjectiveByIndex = function (index) {
|
|
3070
|
+
return this.childArray[index];
|
|
3071
|
+
};
|
|
3072
|
+
CMIObjectives.prototype.setObjectiveByIndex = function (index, objective) {
|
|
3073
|
+
this.childArray[index] = objective;
|
|
3074
|
+
};
|
|
2929
3075
|
return CMIObjectives;
|
|
2930
|
-
}(array
|
|
3076
|
+
}(array.CMIArray));
|
|
2931
3077
|
|
|
2932
3078
|
var CMIObjectivesObject = (function (_super) {
|
|
2933
|
-
(0,tslib_es6
|
|
3079
|
+
(0,tslib_es6.__extends)(CMIObjectivesObject, _super);
|
|
2934
3080
|
function CMIObjectivesObject() {
|
|
2935
3081
|
var _this = _super.call(this) || this;
|
|
2936
3082
|
_this._id = "";
|
|
@@ -2941,6 +3087,9 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2941
3087
|
_this.score = new Scorm2004CMIScore();
|
|
2942
3088
|
return _this;
|
|
2943
3089
|
}
|
|
3090
|
+
CMIObjectivesObject.prototype.reset = function () {
|
|
3091
|
+
this._initialized = false;
|
|
3092
|
+
};
|
|
2944
3093
|
CMIObjectivesObject.prototype.initialize = function () {
|
|
2945
3094
|
var _a;
|
|
2946
3095
|
_super.prototype.initialize.call(this);
|
|
@@ -2951,7 +3100,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2951
3100
|
return this._id;
|
|
2952
3101
|
},
|
|
2953
3102
|
set: function (id) {
|
|
2954
|
-
if (check2004ValidFormat(id, regex
|
|
3103
|
+
if (check2004ValidFormat(id, regex.scorm2004_regex.CMILongIdentifier)) {
|
|
2955
3104
|
this._id = id;
|
|
2956
3105
|
}
|
|
2957
3106
|
},
|
|
@@ -2964,10 +3113,10 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2964
3113
|
},
|
|
2965
3114
|
set: function (success_status) {
|
|
2966
3115
|
if (this.initialized && this._id === "") {
|
|
2967
|
-
throw new
|
|
3116
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2968
3117
|
}
|
|
2969
3118
|
else {
|
|
2970
|
-
if (check2004ValidFormat(success_status, regex
|
|
3119
|
+
if (check2004ValidFormat(success_status, regex.scorm2004_regex.CMISStatus)) {
|
|
2971
3120
|
this._success_status = success_status;
|
|
2972
3121
|
}
|
|
2973
3122
|
}
|
|
@@ -2981,10 +3130,10 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2981
3130
|
},
|
|
2982
3131
|
set: function (completion_status) {
|
|
2983
3132
|
if (this.initialized && this._id === "") {
|
|
2984
|
-
throw new
|
|
3133
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
2985
3134
|
}
|
|
2986
3135
|
else {
|
|
2987
|
-
if (check2004ValidFormat(completion_status, regex
|
|
3136
|
+
if (check2004ValidFormat(completion_status, regex.scorm2004_regex.CMICStatus)) {
|
|
2988
3137
|
this._completion_status = completion_status;
|
|
2989
3138
|
}
|
|
2990
3139
|
}
|
|
@@ -2998,11 +3147,11 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
2998
3147
|
},
|
|
2999
3148
|
set: function (progress_measure) {
|
|
3000
3149
|
if (this.initialized && this._id === "") {
|
|
3001
|
-
throw new
|
|
3150
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
3002
3151
|
}
|
|
3003
3152
|
else {
|
|
3004
|
-
if (check2004ValidFormat(progress_measure, regex
|
|
3005
|
-
check2004ValidRange(progress_measure, regex
|
|
3153
|
+
if (check2004ValidFormat(progress_measure, regex.scorm2004_regex.CMIDecimal) &&
|
|
3154
|
+
check2004ValidRange(progress_measure, regex.scorm2004_regex.progress_range)) {
|
|
3006
3155
|
this._progress_measure = progress_measure;
|
|
3007
3156
|
}
|
|
3008
3157
|
}
|
|
@@ -3016,10 +3165,10 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
3016
3165
|
},
|
|
3017
3166
|
set: function (description) {
|
|
3018
3167
|
if (this.initialized && this._id === "") {
|
|
3019
|
-
throw new
|
|
3168
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
3020
3169
|
}
|
|
3021
3170
|
else {
|
|
3022
|
-
if (check2004ValidFormat(description, regex
|
|
3171
|
+
if (check2004ValidFormat(description, regex.scorm2004_regex.CMILangString250, true)) {
|
|
3023
3172
|
this._description = description;
|
|
3024
3173
|
}
|
|
3025
3174
|
}
|
|
@@ -3041,7 +3190,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
3041
3190
|
return result;
|
|
3042
3191
|
};
|
|
3043
3192
|
return CMIObjectivesObject;
|
|
3044
|
-
}(base_cmi
|
|
3193
|
+
}(base_cmi.BaseCMI));
|
|
3045
3194
|
|
|
3046
3195
|
|
|
3047
3196
|
;// ./src/cmi/scorm2004/cmi.ts
|
|
@@ -3059,12 +3208,12 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
3059
3208
|
|
|
3060
3209
|
|
|
3061
3210
|
var CMI = (function (_super) {
|
|
3062
|
-
(0,tslib_es6
|
|
3211
|
+
(0,tslib_es6.__extends)(CMI, _super);
|
|
3063
3212
|
function CMI(initialized) {
|
|
3064
3213
|
if (initialized === void 0) { initialized = false; }
|
|
3065
3214
|
var _this = _super.call(this) || this;
|
|
3066
3215
|
_this.__version = "1.0";
|
|
3067
|
-
_this.__children = api_constants
|
|
3216
|
+
_this.__children = api_constants.scorm2004_constants.cmi_children;
|
|
3068
3217
|
_this._completion_status = "unknown";
|
|
3069
3218
|
_this._completion_threshold = "";
|
|
3070
3219
|
_this._credit = "credit";
|
|
@@ -3103,12 +3252,27 @@ var CMI = (function (_super) {
|
|
|
3103
3252
|
(_e = this.interactions) === null || _e === void 0 ? void 0 : _e.initialize();
|
|
3104
3253
|
(_f = this.objectives) === null || _f === void 0 ? void 0 : _f.initialize();
|
|
3105
3254
|
};
|
|
3255
|
+
CMI.prototype.reset = function () {
|
|
3256
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3257
|
+
this._initialized = false;
|
|
3258
|
+
this._completion_status = "incomplete";
|
|
3259
|
+
this._exit = "";
|
|
3260
|
+
this._session_time = "PT0H0M0S";
|
|
3261
|
+
this._progress_measure = "";
|
|
3262
|
+
this._location = "";
|
|
3263
|
+
(_a = this.objectives) === null || _a === void 0 ? void 0 : _a.reset(false);
|
|
3264
|
+
(_b = this.interactions) === null || _b === void 0 ? void 0 : _b.reset(true);
|
|
3265
|
+
(_c = this.score) === null || _c === void 0 ? void 0 : _c.reset();
|
|
3266
|
+
(_d = this.comments_from_learner) === null || _d === void 0 ? void 0 : _d.reset();
|
|
3267
|
+
(_e = this.comments_from_lms) === null || _e === void 0 ? void 0 : _e.reset();
|
|
3268
|
+
(_f = this.learner_preference) === null || _f === void 0 ? void 0 : _f.reset();
|
|
3269
|
+
};
|
|
3106
3270
|
Object.defineProperty(CMI.prototype, "_version", {
|
|
3107
3271
|
get: function () {
|
|
3108
3272
|
return this.__version;
|
|
3109
3273
|
},
|
|
3110
3274
|
set: function (_version) {
|
|
3111
|
-
throw new
|
|
3275
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3112
3276
|
},
|
|
3113
3277
|
enumerable: false,
|
|
3114
3278
|
configurable: true
|
|
@@ -3118,7 +3282,7 @@ var CMI = (function (_super) {
|
|
|
3118
3282
|
return this.__children;
|
|
3119
3283
|
},
|
|
3120
3284
|
set: function (_children) {
|
|
3121
|
-
throw new
|
|
3285
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3122
3286
|
},
|
|
3123
3287
|
enumerable: false,
|
|
3124
3288
|
configurable: true
|
|
@@ -3128,7 +3292,7 @@ var CMI = (function (_super) {
|
|
|
3128
3292
|
return this._completion_status;
|
|
3129
3293
|
},
|
|
3130
3294
|
set: function (completion_status) {
|
|
3131
|
-
if (check2004ValidFormat(completion_status, regex
|
|
3295
|
+
if (check2004ValidFormat(completion_status, regex.scorm2004_regex.CMICStatus)) {
|
|
3132
3296
|
this._completion_status = completion_status;
|
|
3133
3297
|
}
|
|
3134
3298
|
},
|
|
@@ -3141,7 +3305,7 @@ var CMI = (function (_super) {
|
|
|
3141
3305
|
},
|
|
3142
3306
|
set: function (completion_threshold) {
|
|
3143
3307
|
if (this.initialized) {
|
|
3144
|
-
throw new
|
|
3308
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3145
3309
|
}
|
|
3146
3310
|
else {
|
|
3147
3311
|
this._completion_threshold = completion_threshold;
|
|
@@ -3156,7 +3320,7 @@ var CMI = (function (_super) {
|
|
|
3156
3320
|
},
|
|
3157
3321
|
set: function (credit) {
|
|
3158
3322
|
if (this.initialized) {
|
|
3159
|
-
throw new
|
|
3323
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3160
3324
|
}
|
|
3161
3325
|
else {
|
|
3162
3326
|
this._credit = credit;
|
|
@@ -3171,7 +3335,7 @@ var CMI = (function (_super) {
|
|
|
3171
3335
|
},
|
|
3172
3336
|
set: function (entry) {
|
|
3173
3337
|
if (this.initialized) {
|
|
3174
|
-
throw new
|
|
3338
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3175
3339
|
}
|
|
3176
3340
|
else {
|
|
3177
3341
|
this._entry = entry;
|
|
@@ -3183,12 +3347,12 @@ var CMI = (function (_super) {
|
|
|
3183
3347
|
Object.defineProperty(CMI.prototype, "exit", {
|
|
3184
3348
|
get: function () {
|
|
3185
3349
|
if (!this.jsonString) {
|
|
3186
|
-
throw new
|
|
3350
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.WRITE_ONLY_ELEMENT);
|
|
3187
3351
|
}
|
|
3188
3352
|
return this._exit;
|
|
3189
3353
|
},
|
|
3190
3354
|
set: function (exit) {
|
|
3191
|
-
if (check2004ValidFormat(exit, regex
|
|
3355
|
+
if (check2004ValidFormat(exit, regex.scorm2004_regex.CMIExit, true)) {
|
|
3192
3356
|
this._exit = exit;
|
|
3193
3357
|
}
|
|
3194
3358
|
},
|
|
@@ -3201,7 +3365,7 @@ var CMI = (function (_super) {
|
|
|
3201
3365
|
},
|
|
3202
3366
|
set: function (launch_data) {
|
|
3203
3367
|
if (this.initialized) {
|
|
3204
|
-
throw new
|
|
3368
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3205
3369
|
}
|
|
3206
3370
|
else {
|
|
3207
3371
|
this._launch_data = launch_data;
|
|
@@ -3216,7 +3380,7 @@ var CMI = (function (_super) {
|
|
|
3216
3380
|
},
|
|
3217
3381
|
set: function (learner_id) {
|
|
3218
3382
|
if (this.initialized) {
|
|
3219
|
-
throw new
|
|
3383
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3220
3384
|
}
|
|
3221
3385
|
else {
|
|
3222
3386
|
this._learner_id = learner_id;
|
|
@@ -3231,7 +3395,7 @@ var CMI = (function (_super) {
|
|
|
3231
3395
|
},
|
|
3232
3396
|
set: function (learner_name) {
|
|
3233
3397
|
if (this.initialized) {
|
|
3234
|
-
throw new
|
|
3398
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3235
3399
|
}
|
|
3236
3400
|
else {
|
|
3237
3401
|
this._learner_name = learner_name;
|
|
@@ -3245,7 +3409,7 @@ var CMI = (function (_super) {
|
|
|
3245
3409
|
return this._location;
|
|
3246
3410
|
},
|
|
3247
3411
|
set: function (location) {
|
|
3248
|
-
if (check2004ValidFormat(location, regex
|
|
3412
|
+
if (check2004ValidFormat(location, regex.scorm2004_regex.CMIString1000)) {
|
|
3249
3413
|
this._location = location;
|
|
3250
3414
|
}
|
|
3251
3415
|
},
|
|
@@ -3258,7 +3422,7 @@ var CMI = (function (_super) {
|
|
|
3258
3422
|
},
|
|
3259
3423
|
set: function (max_time_allowed) {
|
|
3260
3424
|
if (this.initialized) {
|
|
3261
|
-
throw new
|
|
3425
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3262
3426
|
}
|
|
3263
3427
|
else {
|
|
3264
3428
|
this._max_time_allowed = max_time_allowed;
|
|
@@ -3273,7 +3437,7 @@ var CMI = (function (_super) {
|
|
|
3273
3437
|
},
|
|
3274
3438
|
set: function (mode) {
|
|
3275
3439
|
if (this.initialized) {
|
|
3276
|
-
throw new
|
|
3440
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3277
3441
|
}
|
|
3278
3442
|
else {
|
|
3279
3443
|
this._mode = mode;
|
|
@@ -3287,8 +3451,8 @@ var CMI = (function (_super) {
|
|
|
3287
3451
|
return this._progress_measure;
|
|
3288
3452
|
},
|
|
3289
3453
|
set: function (progress_measure) {
|
|
3290
|
-
if (check2004ValidFormat(progress_measure, regex
|
|
3291
|
-
check2004ValidRange(progress_measure, regex
|
|
3454
|
+
if (check2004ValidFormat(progress_measure, regex.scorm2004_regex.CMIDecimal) &&
|
|
3455
|
+
check2004ValidRange(progress_measure, regex.scorm2004_regex.progress_range)) {
|
|
3292
3456
|
this._progress_measure = progress_measure;
|
|
3293
3457
|
}
|
|
3294
3458
|
},
|
|
@@ -3301,7 +3465,7 @@ var CMI = (function (_super) {
|
|
|
3301
3465
|
},
|
|
3302
3466
|
set: function (scaled_passing_score) {
|
|
3303
3467
|
if (this.initialized) {
|
|
3304
|
-
throw new
|
|
3468
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3305
3469
|
}
|
|
3306
3470
|
else {
|
|
3307
3471
|
this._scaled_passing_score = scaled_passing_score;
|
|
@@ -3313,12 +3477,12 @@ var CMI = (function (_super) {
|
|
|
3313
3477
|
Object.defineProperty(CMI.prototype, "session_time", {
|
|
3314
3478
|
get: function () {
|
|
3315
3479
|
if (!this.jsonString) {
|
|
3316
|
-
throw new
|
|
3480
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.WRITE_ONLY_ELEMENT);
|
|
3317
3481
|
}
|
|
3318
3482
|
return this._session_time;
|
|
3319
3483
|
},
|
|
3320
3484
|
set: function (session_time) {
|
|
3321
|
-
if (check2004ValidFormat(session_time, regex
|
|
3485
|
+
if (check2004ValidFormat(session_time, regex.scorm2004_regex.CMITimespan)) {
|
|
3322
3486
|
this._session_time = session_time;
|
|
3323
3487
|
}
|
|
3324
3488
|
},
|
|
@@ -3330,7 +3494,7 @@ var CMI = (function (_super) {
|
|
|
3330
3494
|
return this._success_status;
|
|
3331
3495
|
},
|
|
3332
3496
|
set: function (success_status) {
|
|
3333
|
-
if (check2004ValidFormat(success_status, regex
|
|
3497
|
+
if (check2004ValidFormat(success_status, regex.scorm2004_regex.CMISStatus)) {
|
|
3334
3498
|
this._success_status = success_status;
|
|
3335
3499
|
}
|
|
3336
3500
|
},
|
|
@@ -3342,7 +3506,7 @@ var CMI = (function (_super) {
|
|
|
3342
3506
|
return this._suspend_data;
|
|
3343
3507
|
},
|
|
3344
3508
|
set: function (suspend_data) {
|
|
3345
|
-
if (check2004ValidFormat(suspend_data, regex
|
|
3509
|
+
if (check2004ValidFormat(suspend_data, regex.scorm2004_regex.CMIString64000, true)) {
|
|
3346
3510
|
this._suspend_data = suspend_data;
|
|
3347
3511
|
}
|
|
3348
3512
|
},
|
|
@@ -3355,7 +3519,7 @@ var CMI = (function (_super) {
|
|
|
3355
3519
|
},
|
|
3356
3520
|
set: function (time_limit_action) {
|
|
3357
3521
|
if (this.initialized) {
|
|
3358
|
-
throw new
|
|
3522
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3359
3523
|
}
|
|
3360
3524
|
else {
|
|
3361
3525
|
this._time_limit_action = time_limit_action;
|
|
@@ -3370,7 +3534,7 @@ var CMI = (function (_super) {
|
|
|
3370
3534
|
},
|
|
3371
3535
|
set: function (total_time) {
|
|
3372
3536
|
if (this.initialized) {
|
|
3373
|
-
throw new
|
|
3537
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3374
3538
|
}
|
|
3375
3539
|
else {
|
|
3376
3540
|
this._total_time = total_time;
|
|
@@ -3384,9 +3548,9 @@ var CMI = (function (_super) {
|
|
|
3384
3548
|
var startTime = this.start_time;
|
|
3385
3549
|
if (typeof startTime !== "undefined" && startTime !== null) {
|
|
3386
3550
|
var seconds = new Date().getTime() - startTime;
|
|
3387
|
-
sessionTime = utilities
|
|
3551
|
+
sessionTime = utilities.getSecondsAsISODuration(seconds / 1000);
|
|
3388
3552
|
}
|
|
3389
|
-
return utilities
|
|
3553
|
+
return utilities.addTwoDurations(this._total_time, sessionTime, regex.scorm2004_regex.CMITimespan);
|
|
3390
3554
|
};
|
|
3391
3555
|
CMI.prototype.toJSON = function () {
|
|
3392
3556
|
this.jsonString = true;
|
|
@@ -3419,7 +3583,7 @@ var CMI = (function (_super) {
|
|
|
3419
3583
|
return result;
|
|
3420
3584
|
};
|
|
3421
3585
|
return CMI;
|
|
3422
|
-
}(base_cmi
|
|
3586
|
+
}(base_cmi.BaseRootCMI));
|
|
3423
3587
|
|
|
3424
3588
|
|
|
3425
3589
|
;// ./src/constants/language_constants.ts
|
|
@@ -3828,11 +3992,15 @@ var enums = __webpack_require__(56);
|
|
|
3828
3992
|
|
|
3829
3993
|
|
|
3830
3994
|
|
|
3995
|
+
|
|
3996
|
+
|
|
3831
3997
|
var ADL = (function (_super) {
|
|
3832
|
-
(0,tslib_es6
|
|
3998
|
+
(0,tslib_es6.__extends)(ADL, _super);
|
|
3833
3999
|
function ADL() {
|
|
3834
4000
|
var _this = _super.call(this) || this;
|
|
4001
|
+
_this.data = new ADLData();
|
|
3835
4002
|
_this.nav = new ADLNav();
|
|
4003
|
+
_this.data = new ADLData();
|
|
3836
4004
|
return _this;
|
|
3837
4005
|
}
|
|
3838
4006
|
ADL.prototype.initialize = function () {
|
|
@@ -3840,19 +4008,25 @@ var ADL = (function (_super) {
|
|
|
3840
4008
|
_super.prototype.initialize.call(this);
|
|
3841
4009
|
(_a = this.nav) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
3842
4010
|
};
|
|
4011
|
+
ADL.prototype.reset = function () {
|
|
4012
|
+
var _a;
|
|
4013
|
+
this._initialized = false;
|
|
4014
|
+
(_a = this.nav) === null || _a === void 0 ? void 0 : _a.reset();
|
|
4015
|
+
};
|
|
3843
4016
|
ADL.prototype.toJSON = function () {
|
|
3844
4017
|
this.jsonString = true;
|
|
3845
4018
|
var result = {
|
|
3846
4019
|
nav: this.nav,
|
|
4020
|
+
data: this.data,
|
|
3847
4021
|
};
|
|
3848
4022
|
delete this.jsonString;
|
|
3849
4023
|
return result;
|
|
3850
4024
|
};
|
|
3851
4025
|
return ADL;
|
|
3852
|
-
}(base_cmi
|
|
4026
|
+
}(base_cmi.BaseCMI));
|
|
3853
4027
|
|
|
3854
4028
|
var ADLNav = (function (_super) {
|
|
3855
|
-
(0,tslib_es6
|
|
4029
|
+
(0,tslib_es6.__extends)(ADLNav, _super);
|
|
3856
4030
|
function ADLNav() {
|
|
3857
4031
|
var _this = _super.call(this) || this;
|
|
3858
4032
|
_this._request = "_none_";
|
|
@@ -3864,12 +4038,18 @@ var ADLNav = (function (_super) {
|
|
|
3864
4038
|
_super.prototype.initialize.call(this);
|
|
3865
4039
|
(_a = this.request_valid) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
3866
4040
|
};
|
|
4041
|
+
ADLNav.prototype.reset = function () {
|
|
4042
|
+
var _a;
|
|
4043
|
+
this._initialized = false;
|
|
4044
|
+
this._request = "_none_";
|
|
4045
|
+
(_a = this.request_valid) === null || _a === void 0 ? void 0 : _a.reset();
|
|
4046
|
+
};
|
|
3867
4047
|
Object.defineProperty(ADLNav.prototype, "request", {
|
|
3868
4048
|
get: function () {
|
|
3869
4049
|
return this._request;
|
|
3870
4050
|
},
|
|
3871
4051
|
set: function (request) {
|
|
3872
|
-
if (check2004ValidFormat(request, regex
|
|
4052
|
+
if (check2004ValidFormat(request, regex.scorm2004_regex.NAVEvent)) {
|
|
3873
4053
|
this._request = request;
|
|
3874
4054
|
}
|
|
3875
4055
|
},
|
|
@@ -3885,10 +4065,69 @@ var ADLNav = (function (_super) {
|
|
|
3885
4065
|
return result;
|
|
3886
4066
|
};
|
|
3887
4067
|
return ADLNav;
|
|
3888
|
-
}(base_cmi
|
|
4068
|
+
}(base_cmi.BaseCMI));
|
|
4069
|
+
|
|
4070
|
+
var ADLData = (function (_super) {
|
|
4071
|
+
(0,tslib_es6.__extends)(ADLData, _super);
|
|
4072
|
+
function ADLData() {
|
|
4073
|
+
return _super.call(this, {
|
|
4074
|
+
children: api_constants.scorm2004_constants.adl_data_children,
|
|
4075
|
+
errorCode: error_codes.scorm2004_errors.READ_ONLY_ELEMENT,
|
|
4076
|
+
errorClass: Scorm2004ValidationError,
|
|
4077
|
+
}) || this;
|
|
4078
|
+
}
|
|
4079
|
+
return ADLData;
|
|
4080
|
+
}(array.CMIArray));
|
|
4081
|
+
|
|
4082
|
+
var ADLDataObject = (function (_super) {
|
|
4083
|
+
(0,tslib_es6.__extends)(ADLDataObject, _super);
|
|
4084
|
+
function ADLDataObject() {
|
|
4085
|
+
var _this = _super.call(this) || this;
|
|
4086
|
+
_this._id = "";
|
|
4087
|
+
_this._store = "";
|
|
4088
|
+
return _this;
|
|
4089
|
+
}
|
|
4090
|
+
ADLDataObject.prototype.reset = function () {
|
|
4091
|
+
this._initialized = false;
|
|
4092
|
+
};
|
|
4093
|
+
Object.defineProperty(ADLDataObject.prototype, "id", {
|
|
4094
|
+
get: function () {
|
|
4095
|
+
return this._id;
|
|
4096
|
+
},
|
|
4097
|
+
set: function (id) {
|
|
4098
|
+
if (check2004ValidFormat(id, regex.scorm2004_regex.CMILongIdentifier)) {
|
|
4099
|
+
this._id = id;
|
|
4100
|
+
}
|
|
4101
|
+
},
|
|
4102
|
+
enumerable: false,
|
|
4103
|
+
configurable: true
|
|
4104
|
+
});
|
|
4105
|
+
Object.defineProperty(ADLDataObject.prototype, "store", {
|
|
4106
|
+
get: function () {
|
|
4107
|
+
return this._store;
|
|
4108
|
+
},
|
|
4109
|
+
set: function (store) {
|
|
4110
|
+
if (check2004ValidFormat(store, regex.scorm2004_regex.CMILangString4000)) {
|
|
4111
|
+
this._store = store;
|
|
4112
|
+
}
|
|
4113
|
+
},
|
|
4114
|
+
enumerable: false,
|
|
4115
|
+
configurable: true
|
|
4116
|
+
});
|
|
4117
|
+
ADLDataObject.prototype.toJSON = function () {
|
|
4118
|
+
this.jsonString = true;
|
|
4119
|
+
var result = {
|
|
4120
|
+
id: this._id,
|
|
4121
|
+
store: this._store,
|
|
4122
|
+
};
|
|
4123
|
+
delete this.jsonString;
|
|
4124
|
+
return result;
|
|
4125
|
+
};
|
|
4126
|
+
return ADLDataObject;
|
|
4127
|
+
}(base_cmi.BaseCMI));
|
|
3889
4128
|
|
|
3890
4129
|
var ADLNavRequestValid = (function (_super) {
|
|
3891
|
-
(0,tslib_es6
|
|
4130
|
+
(0,tslib_es6.__extends)(ADLNavRequestValid, _super);
|
|
3892
4131
|
function ADLNavRequestValid() {
|
|
3893
4132
|
var _this = _super.call(this) || this;
|
|
3894
4133
|
_this._continue = "unknown";
|
|
@@ -3897,15 +4136,20 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
3897
4136
|
_this._jump = {};
|
|
3898
4137
|
return _this;
|
|
3899
4138
|
}
|
|
4139
|
+
ADLNavRequestValid.prototype.reset = function () {
|
|
4140
|
+
this._initialized = false;
|
|
4141
|
+
this._continue = "unknown";
|
|
4142
|
+
this._previous = "unknown";
|
|
4143
|
+
};
|
|
3900
4144
|
Object.defineProperty(ADLNavRequestValid.prototype, "continue", {
|
|
3901
4145
|
get: function () {
|
|
3902
4146
|
return this._continue;
|
|
3903
4147
|
},
|
|
3904
4148
|
set: function (_continue) {
|
|
3905
4149
|
if (this.initialized) {
|
|
3906
|
-
throw new
|
|
4150
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3907
4151
|
}
|
|
3908
|
-
if (check2004ValidFormat(_continue, regex
|
|
4152
|
+
if (check2004ValidFormat(_continue, regex.scorm2004_regex.NAVBoolean)) {
|
|
3909
4153
|
this._continue = _continue;
|
|
3910
4154
|
}
|
|
3911
4155
|
},
|
|
@@ -3918,9 +4162,9 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
3918
4162
|
},
|
|
3919
4163
|
set: function (_previous) {
|
|
3920
4164
|
if (this.initialized) {
|
|
3921
|
-
throw new
|
|
4165
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3922
4166
|
}
|
|
3923
|
-
if (check2004ValidFormat(_previous, regex
|
|
4167
|
+
if (check2004ValidFormat(_previous, regex.scorm2004_regex.NAVBoolean)) {
|
|
3924
4168
|
this._previous = _previous;
|
|
3925
4169
|
}
|
|
3926
4170
|
},
|
|
@@ -3933,17 +4177,17 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
3933
4177
|
},
|
|
3934
4178
|
set: function (choice) {
|
|
3935
4179
|
if (this.initialized) {
|
|
3936
|
-
throw new
|
|
4180
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3937
4181
|
}
|
|
3938
4182
|
if (typeof choice !== "object") {
|
|
3939
|
-
throw new
|
|
4183
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
3940
4184
|
}
|
|
3941
4185
|
for (var key in choice) {
|
|
3942
4186
|
if ({}.hasOwnProperty.call(choice, key)) {
|
|
3943
|
-
if (check2004ValidFormat(choice[key], regex
|
|
3944
|
-
check2004ValidFormat(key, regex
|
|
4187
|
+
if (check2004ValidFormat(choice[key], regex.scorm2004_regex.NAVBoolean) &&
|
|
4188
|
+
check2004ValidFormat(key, regex.scorm2004_regex.NAVTarget)) {
|
|
3945
4189
|
this._choice[key] =
|
|
3946
|
-
enums
|
|
4190
|
+
enums.NAVBoolean[choice[key]];
|
|
3947
4191
|
}
|
|
3948
4192
|
}
|
|
3949
4193
|
}
|
|
@@ -3957,16 +4201,16 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
3957
4201
|
},
|
|
3958
4202
|
set: function (jump) {
|
|
3959
4203
|
if (this.initialized) {
|
|
3960
|
-
throw new
|
|
4204
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.READ_ONLY_ELEMENT);
|
|
3961
4205
|
}
|
|
3962
4206
|
if (typeof jump !== "object") {
|
|
3963
|
-
throw new
|
|
4207
|
+
throw new Scorm2004ValidationError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
3964
4208
|
}
|
|
3965
4209
|
for (var key in jump) {
|
|
3966
4210
|
if ({}.hasOwnProperty.call(jump, key)) {
|
|
3967
|
-
if (check2004ValidFormat(jump[key], regex
|
|
3968
|
-
check2004ValidFormat(key, regex
|
|
3969
|
-
this._jump[key] = enums
|
|
4211
|
+
if (check2004ValidFormat(jump[key], regex.scorm2004_regex.NAVBoolean) &&
|
|
4212
|
+
check2004ValidFormat(key, regex.scorm2004_regex.NAVTarget)) {
|
|
4213
|
+
this._jump[key] = enums.NAVBoolean[jump[key]];
|
|
3970
4214
|
}
|
|
3971
4215
|
}
|
|
3972
4216
|
}
|
|
@@ -3986,7 +4230,7 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
3986
4230
|
return result;
|
|
3987
4231
|
};
|
|
3988
4232
|
return ADLNavRequestValid;
|
|
3989
|
-
}(base_cmi
|
|
4233
|
+
}(base_cmi.BaseCMI));
|
|
3990
4234
|
|
|
3991
4235
|
|
|
3992
4236
|
;// ./src/Scorm2004API.ts
|
|
@@ -4005,9 +4249,8 @@ var ADLNavRequestValid = (function (_super) {
|
|
|
4005
4249
|
|
|
4006
4250
|
|
|
4007
4251
|
|
|
4008
|
-
|
|
4009
4252
|
var Scorm2004Impl = (function (_super) {
|
|
4010
|
-
(0,tslib_es6
|
|
4253
|
+
(0,tslib_es6.__extends)(Scorm2004Impl, _super);
|
|
4011
4254
|
function Scorm2004Impl(settings) {
|
|
4012
4255
|
var _this = this;
|
|
4013
4256
|
if (settings) {
|
|
@@ -4015,8 +4258,9 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4015
4258
|
settings.mastery_override = false;
|
|
4016
4259
|
}
|
|
4017
4260
|
}
|
|
4018
|
-
_this = _super.call(this, error_codes
|
|
4261
|
+
_this = _super.call(this, error_codes.scorm2004_errors, settings) || this;
|
|
4019
4262
|
_this._version = "1.0";
|
|
4263
|
+
_this._globalObjectives = [];
|
|
4020
4264
|
_this.cmi = new CMI();
|
|
4021
4265
|
_this.adl = new ADL();
|
|
4022
4266
|
_this.Initialize = _this.lmsInitialize;
|
|
@@ -4030,9 +4274,10 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4030
4274
|
return _this;
|
|
4031
4275
|
}
|
|
4032
4276
|
Scorm2004Impl.prototype.reset = function (settings) {
|
|
4277
|
+
var _a, _b;
|
|
4033
4278
|
this.commonReset(settings);
|
|
4034
|
-
this.cmi
|
|
4035
|
-
this.adl
|
|
4279
|
+
(_a = this.cmi) === null || _a === void 0 ? void 0 : _a.reset();
|
|
4280
|
+
(_b = this.adl) === null || _b === void 0 ? void 0 : _b.reset();
|
|
4036
4281
|
};
|
|
4037
4282
|
Object.defineProperty(Scorm2004Impl.prototype, "version", {
|
|
4038
4283
|
get: function () {
|
|
@@ -4041,14 +4286,21 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4041
4286
|
enumerable: false,
|
|
4042
4287
|
configurable: true
|
|
4043
4288
|
});
|
|
4289
|
+
Object.defineProperty(Scorm2004Impl.prototype, "globalObjectives", {
|
|
4290
|
+
get: function () {
|
|
4291
|
+
return this._globalObjectives;
|
|
4292
|
+
},
|
|
4293
|
+
enumerable: false,
|
|
4294
|
+
configurable: true
|
|
4295
|
+
});
|
|
4044
4296
|
Scorm2004Impl.prototype.lmsInitialize = function () {
|
|
4045
4297
|
this.cmi.initialize();
|
|
4046
4298
|
return this.initialize("Initialize");
|
|
4047
4299
|
};
|
|
4048
4300
|
Scorm2004Impl.prototype.lmsFinish = function () {
|
|
4049
4301
|
var _this = this;
|
|
4050
|
-
(function () { return (0,tslib_es6
|
|
4051
|
-
return (0,tslib_es6
|
|
4302
|
+
(function () { return (0,tslib_es6.__awaiter)(_this, void 0, void 0, function () {
|
|
4303
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
4052
4304
|
switch (_a.label) {
|
|
4053
4305
|
case 0: return [4, this.internalFinish()];
|
|
4054
4306
|
case 1:
|
|
@@ -4057,18 +4309,18 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4057
4309
|
}
|
|
4058
4310
|
});
|
|
4059
4311
|
}); })();
|
|
4060
|
-
return api_constants
|
|
4312
|
+
return api_constants.global_constants.SCORM_TRUE;
|
|
4061
4313
|
};
|
|
4062
4314
|
Scorm2004Impl.prototype.internalFinish = function () {
|
|
4063
|
-
return (0,tslib_es6
|
|
4315
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
4064
4316
|
var result, navActions, request, choiceJumpRegex, matches, target, action;
|
|
4065
4317
|
var _a, _b, _c, _d;
|
|
4066
|
-
return (0,tslib_es6
|
|
4318
|
+
return (0,tslib_es6.__generator)(this, function (_e) {
|
|
4067
4319
|
switch (_e.label) {
|
|
4068
4320
|
case 0: return [4, this.terminate("Terminate", true)];
|
|
4069
4321
|
case 1:
|
|
4070
4322
|
result = _e.sent();
|
|
4071
|
-
if (result === api_constants
|
|
4323
|
+
if (result === api_constants.global_constants.SCORM_TRUE) {
|
|
4072
4324
|
if (this.adl.nav.request !== "_none_") {
|
|
4073
4325
|
navActions = {
|
|
4074
4326
|
continue: "SequenceNext",
|
|
@@ -4081,7 +4333,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4081
4333
|
abandonAll: "SequenceAbandonAll",
|
|
4082
4334
|
};
|
|
4083
4335
|
request = this.adl.nav.request;
|
|
4084
|
-
choiceJumpRegex = new RegExp(regex
|
|
4336
|
+
choiceJumpRegex = new RegExp(regex.scorm2004_regex.NAVEvent);
|
|
4085
4337
|
matches = request.match(choiceJumpRegex);
|
|
4086
4338
|
target = "";
|
|
4087
4339
|
if (matches) {
|
|
@@ -4110,7 +4362,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4110
4362
|
};
|
|
4111
4363
|
Scorm2004Impl.prototype.lmsGetValue = function (CMIElement) {
|
|
4112
4364
|
var adlNavRequestRegex = "^adl\\.nav\\.request_valid\\.(choice|jump)\\.{target=\\S{0,}([a-zA-Z0-9-_]+)}$";
|
|
4113
|
-
if ((0,utilities
|
|
4365
|
+
if ((0,utilities.stringMatches)(CMIElement, adlNavRequestRegex)) {
|
|
4114
4366
|
var matches = CMIElement.match(adlNavRequestRegex);
|
|
4115
4367
|
var request = matches[1];
|
|
4116
4368
|
var target = matches[2].replace("{target=", "").replace("}", "");
|
|
@@ -4132,8 +4384,8 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4132
4384
|
this.scheduleCommit(500, "LMSCommit");
|
|
4133
4385
|
}
|
|
4134
4386
|
else {
|
|
4135
|
-
(function () { return (0,tslib_es6
|
|
4136
|
-
return (0,tslib_es6
|
|
4387
|
+
(function () { return (0,tslib_es6.__awaiter)(_this, void 0, void 0, function () {
|
|
4388
|
+
return (0,tslib_es6.__generator)(this, function (_a) {
|
|
4137
4389
|
switch (_a.label) {
|
|
4138
4390
|
case 0: return [4, this.commit("LMSCommit", false)];
|
|
4139
4391
|
case 1:
|
|
@@ -4143,7 +4395,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4143
4395
|
});
|
|
4144
4396
|
}); })();
|
|
4145
4397
|
}
|
|
4146
|
-
return api_constants
|
|
4398
|
+
return api_constants.global_constants.SCORM_TRUE;
|
|
4147
4399
|
};
|
|
4148
4400
|
Scorm2004Impl.prototype.lmsGetLastError = function () {
|
|
4149
4401
|
return this.getLastError("GetLastError");
|
|
@@ -4155,29 +4407,58 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4155
4407
|
return this.getDiagnostic("GetDiagnostic", CMIErrorCode);
|
|
4156
4408
|
};
|
|
4157
4409
|
Scorm2004Impl.prototype.setCMIValue = function (CMIElement, value) {
|
|
4410
|
+
if ((0,utilities.stringMatches)(CMIElement, "cmi\\.objectives\\.\\d+")) {
|
|
4411
|
+
var parts = CMIElement.split(".");
|
|
4412
|
+
var index = Number(parts[2]);
|
|
4413
|
+
var element_base = "cmi.objectives.".concat(index);
|
|
4414
|
+
var objective_id_1;
|
|
4415
|
+
var setting_id = (0,utilities.stringMatches)(CMIElement, "cmi\\.objectives\\.\\d+\\.id");
|
|
4416
|
+
if (setting_id) {
|
|
4417
|
+
objective_id_1 = value;
|
|
4418
|
+
}
|
|
4419
|
+
else {
|
|
4420
|
+
var objective = this.cmi.objectives.findObjectiveByIndex(index);
|
|
4421
|
+
objective_id_1 = objective ? objective.id : undefined;
|
|
4422
|
+
}
|
|
4423
|
+
var is_global = objective_id_1 && this.settings.globalObjectiveIds.includes(objective_id_1);
|
|
4424
|
+
if (is_global) {
|
|
4425
|
+
var global_index = this._globalObjectives.findIndex(function (obj) { return obj.id === objective_id_1; });
|
|
4426
|
+
if (global_index === -1) {
|
|
4427
|
+
global_index = this._globalObjectives.length;
|
|
4428
|
+
var newGlobalObjective = new CMIObjectivesObject();
|
|
4429
|
+
newGlobalObjective.id = objective_id_1;
|
|
4430
|
+
this._globalObjectives.push(newGlobalObjective);
|
|
4431
|
+
}
|
|
4432
|
+
var global_element = CMIElement.replace(element_base, "_globalObjectives.".concat(global_index));
|
|
4433
|
+
this._commonSetCMIValue("SetGlobalObjectiveValue", true, global_element, value);
|
|
4434
|
+
}
|
|
4435
|
+
}
|
|
4158
4436
|
return this._commonSetCMIValue("SetValue", true, CMIElement, value);
|
|
4159
4437
|
};
|
|
4160
4438
|
Scorm2004Impl.prototype.getChildElement = function (CMIElement, value, foundFirstIndex) {
|
|
4161
|
-
if ((0,utilities
|
|
4439
|
+
if ((0,utilities.stringMatches)(CMIElement, "cmi\\.objectives\\.\\d+")) {
|
|
4162
4440
|
return new CMIObjectivesObject();
|
|
4163
4441
|
}
|
|
4164
4442
|
if (foundFirstIndex) {
|
|
4165
|
-
if ((0,utilities
|
|
4443
|
+
if ((0,utilities.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) {
|
|
4166
4444
|
return this.createCorrectResponsesObject(CMIElement, value);
|
|
4167
4445
|
}
|
|
4168
|
-
else if ((0,utilities
|
|
4446
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) {
|
|
4169
4447
|
return new CMIInteractionsObjectivesObject();
|
|
4170
4448
|
}
|
|
4171
4449
|
}
|
|
4172
|
-
else if ((0,utilities
|
|
4450
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.interactions\\.\\d+")) {
|
|
4173
4451
|
return new CMIInteractionsObject();
|
|
4174
4452
|
}
|
|
4175
|
-
if ((0,utilities
|
|
4453
|
+
if ((0,utilities.stringMatches)(CMIElement, "cmi\\.comments_from_learner\\.\\d+")) {
|
|
4176
4454
|
return new CMICommentsObject();
|
|
4177
4455
|
}
|
|
4178
|
-
else if ((0,utilities
|
|
4456
|
+
else if ((0,utilities.stringMatches)(CMIElement, "cmi\\.comments_from_lms\\.\\d+")) {
|
|
4179
4457
|
return new CMICommentsObject(true);
|
|
4180
4458
|
}
|
|
4459
|
+
if ((0,utilities.stringMatches)(CMIElement, "adl\\.data\\.\\d+")) {
|
|
4460
|
+
return new ADLDataObject();
|
|
4461
|
+
}
|
|
4181
4462
|
return null;
|
|
4182
4463
|
};
|
|
4183
4464
|
Scorm2004Impl.prototype.createCorrectResponsesObject = function (CMIElement, value) {
|
|
@@ -4186,7 +4467,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4186
4467
|
var interaction = this.cmi.interactions.childArray[index];
|
|
4187
4468
|
if (this.isInitialized()) {
|
|
4188
4469
|
if (!interaction.type) {
|
|
4189
|
-
this.throwSCORMError(error_codes
|
|
4470
|
+
this.throwSCORMError(error_codes.scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
4190
4471
|
}
|
|
4191
4472
|
else {
|
|
4192
4473
|
this.checkDuplicateChoiceResponse(interaction, value);
|
|
@@ -4195,7 +4476,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4195
4476
|
this.checkValidResponseType(response_type, value, interaction.type);
|
|
4196
4477
|
}
|
|
4197
4478
|
else {
|
|
4198
|
-
this.throwSCORMError(error_codes
|
|
4479
|
+
this.throwSCORMError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE, "Incorrect Response Type: " + interaction.type);
|
|
4199
4480
|
}
|
|
4200
4481
|
}
|
|
4201
4482
|
}
|
|
@@ -4216,7 +4497,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4216
4497
|
this.checkCorrectResponseValue(interaction_type, nodes, value);
|
|
4217
4498
|
}
|
|
4218
4499
|
else if (nodes.length > response_type.max) {
|
|
4219
|
-
this.throwSCORMError(error_codes
|
|
4500
|
+
this.throwSCORMError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE, "Data Model Element Pattern Too Long");
|
|
4220
4501
|
}
|
|
4221
4502
|
};
|
|
4222
4503
|
Scorm2004Impl.prototype.checkDuplicateChoiceResponse = function (interaction, value) {
|
|
@@ -4225,7 +4506,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4225
4506
|
for (var i = 0; i < interaction_count && this.lastErrorCode === "0"; i++) {
|
|
4226
4507
|
var response = interaction.correct_responses.childArray[i];
|
|
4227
4508
|
if (response.pattern === value) {
|
|
4228
|
-
this.throwSCORMError(error_codes
|
|
4509
|
+
this.throwSCORMError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE);
|
|
4229
4510
|
}
|
|
4230
4511
|
}
|
|
4231
4512
|
}
|
|
@@ -4248,12 +4529,12 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4248
4529
|
}
|
|
4249
4530
|
else {
|
|
4250
4531
|
if (this.lastErrorCode === "0") {
|
|
4251
|
-
this.throwSCORMError(error_codes
|
|
4532
|
+
this.throwSCORMError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE, "Data Model Element Pattern Already Exists");
|
|
4252
4533
|
}
|
|
4253
4534
|
}
|
|
4254
4535
|
}
|
|
4255
4536
|
else {
|
|
4256
|
-
this.throwSCORMError(error_codes
|
|
4537
|
+
this.throwSCORMError(error_codes.scorm2004_errors.GENERAL_SET_FAILURE, "Data Model Element Collection Limit Reached");
|
|
4257
4538
|
}
|
|
4258
4539
|
};
|
|
4259
4540
|
Scorm2004Impl.prototype.getCMIValue = function (CMIElement) {
|
|
@@ -4263,11 +4544,11 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4263
4544
|
var basicMessage = "";
|
|
4264
4545
|
var detailMessage = "";
|
|
4265
4546
|
errorNumber = String(errorNumber);
|
|
4266
|
-
if (api_constants
|
|
4547
|
+
if (api_constants.scorm2004_constants.error_descriptions[errorNumber]) {
|
|
4267
4548
|
basicMessage =
|
|
4268
|
-
api_constants
|
|
4549
|
+
api_constants.scorm2004_constants.error_descriptions[errorNumber].basicMessage;
|
|
4269
4550
|
detailMessage =
|
|
4270
|
-
api_constants
|
|
4551
|
+
api_constants.scorm2004_constants.error_descriptions[errorNumber].detailMessage;
|
|
4271
4552
|
}
|
|
4272
4553
|
return detail ? detailMessage : basicMessage;
|
|
4273
4554
|
};
|
|
@@ -4293,36 +4574,36 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4293
4574
|
if (values.length === 2) {
|
|
4294
4575
|
var matches = values[0].match(formatRegex);
|
|
4295
4576
|
if (!matches) {
|
|
4296
|
-
this.throwSCORMError(error_codes
|
|
4577
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4297
4578
|
}
|
|
4298
4579
|
else {
|
|
4299
4580
|
if (!response.format2 ||
|
|
4300
4581
|
!values[1].match(new RegExp(response.format2))) {
|
|
4301
|
-
this.throwSCORMError(error_codes
|
|
4582
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4302
4583
|
}
|
|
4303
4584
|
}
|
|
4304
4585
|
}
|
|
4305
4586
|
else {
|
|
4306
|
-
this.throwSCORMError(error_codes
|
|
4587
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4307
4588
|
}
|
|
4308
4589
|
}
|
|
4309
4590
|
else {
|
|
4310
4591
|
var matches = nodes[i].match(formatRegex);
|
|
4311
4592
|
if ((!matches && value !== "") ||
|
|
4312
4593
|
(!matches && interaction_type === "true-false")) {
|
|
4313
|
-
this.throwSCORMError(error_codes
|
|
4594
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4314
4595
|
}
|
|
4315
4596
|
else {
|
|
4316
4597
|
if (interaction_type === "numeric" && nodes.length > 1) {
|
|
4317
4598
|
if (Number(nodes[0]) > Number(nodes[1])) {
|
|
4318
|
-
this.throwSCORMError(error_codes
|
|
4599
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4319
4600
|
}
|
|
4320
4601
|
}
|
|
4321
4602
|
else {
|
|
4322
4603
|
if (nodes[i] !== "" && response.unique) {
|
|
4323
4604
|
for (var j = 0; j < i && this.lastErrorCode === "0"; j++) {
|
|
4324
4605
|
if (nodes[i] === nodes[j]) {
|
|
4325
|
-
this.throwSCORMError(error_codes
|
|
4606
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4326
4607
|
}
|
|
4327
4608
|
}
|
|
4328
4609
|
}
|
|
@@ -4341,12 +4622,12 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4341
4622
|
while (matches) {
|
|
4342
4623
|
switch (matches[2]) {
|
|
4343
4624
|
case "lang":
|
|
4344
|
-
langMatches = node.match(regex
|
|
4625
|
+
langMatches = node.match(regex.scorm2004_regex.CMILangcr);
|
|
4345
4626
|
if (langMatches) {
|
|
4346
4627
|
var lang = langMatches[3];
|
|
4347
4628
|
if (lang !== undefined && lang.length > 0) {
|
|
4348
4629
|
if (!language_constants.includes(lang.toLowerCase())) {
|
|
4349
|
-
this.throwSCORMError(error_codes
|
|
4630
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4350
4631
|
}
|
|
4351
4632
|
}
|
|
4352
4633
|
}
|
|
@@ -4355,7 +4636,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4355
4636
|
case "case_matters":
|
|
4356
4637
|
if (!seenLang && !seenOrder && !seenCase) {
|
|
4357
4638
|
if (matches[3] !== "true" && matches[3] !== "false") {
|
|
4358
|
-
this.throwSCORMError(error_codes
|
|
4639
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4359
4640
|
}
|
|
4360
4641
|
}
|
|
4361
4642
|
seenCase = true;
|
|
@@ -4363,7 +4644,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4363
4644
|
case "order_matters":
|
|
4364
4645
|
if (!seenCase && !seenLang && !seenOrder) {
|
|
4365
4646
|
if (matches[3] !== "true" && matches[3] !== "false") {
|
|
4366
|
-
this.throwSCORMError(error_codes
|
|
4647
|
+
this.throwSCORMError(error_codes.scorm2004_errors.TYPE_MISMATCH);
|
|
4367
4648
|
}
|
|
4368
4649
|
}
|
|
4369
4650
|
seenOrder = true;
|
|
@@ -4384,10 +4665,10 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4384
4665
|
cmiExport.cmi.total_time = this.cmi.getCurrentTotalTime();
|
|
4385
4666
|
}
|
|
4386
4667
|
var result = [];
|
|
4387
|
-
var flattened = utilities
|
|
4668
|
+
var flattened = utilities.flatten(cmiExport);
|
|
4388
4669
|
switch (this.settings.dataCommitFormat) {
|
|
4389
4670
|
case "flattened":
|
|
4390
|
-
return utilities
|
|
4671
|
+
return utilities.flatten(cmiExport);
|
|
4391
4672
|
case "params":
|
|
4392
4673
|
for (var item in flattened) {
|
|
4393
4674
|
if ({}.hasOwnProperty.call(flattened, item)) {
|
|
@@ -4403,23 +4684,23 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4403
4684
|
Scorm2004Impl.prototype.renderCommitObject = function (terminateCommit) {
|
|
4404
4685
|
var cmiExport = this.renderCommitCMI(terminateCommit);
|
|
4405
4686
|
var totalTimeDuration = this.cmi.getCurrentTotalTime();
|
|
4406
|
-
var totalTimeSeconds = utilities
|
|
4407
|
-
var completionStatus = enums
|
|
4408
|
-
var successStatus = enums
|
|
4687
|
+
var totalTimeSeconds = utilities.getDurationAsSeconds(totalTimeDuration, regex.scorm2004_regex.CMITimespan);
|
|
4688
|
+
var completionStatus = enums.CompletionStatus.unknown;
|
|
4689
|
+
var successStatus = enums.SuccessStatus.unknown;
|
|
4409
4690
|
if (this.cmi.completion_status) {
|
|
4410
4691
|
if (this.cmi.completion_status === "completed") {
|
|
4411
|
-
completionStatus = enums
|
|
4692
|
+
completionStatus = enums.CompletionStatus.completed;
|
|
4412
4693
|
}
|
|
4413
4694
|
else if (this.cmi.completion_status === "incomplete") {
|
|
4414
|
-
completionStatus = enums
|
|
4695
|
+
completionStatus = enums.CompletionStatus.incomplete;
|
|
4415
4696
|
}
|
|
4416
4697
|
}
|
|
4417
4698
|
if (this.cmi.success_status) {
|
|
4418
4699
|
if (this.cmi.success_status === "passed") {
|
|
4419
|
-
successStatus = enums
|
|
4700
|
+
successStatus = enums.SuccessStatus.passed;
|
|
4420
4701
|
}
|
|
4421
4702
|
else if (this.cmi.success_status === "failed") {
|
|
4422
|
-
successStatus = enums
|
|
4703
|
+
successStatus = enums.SuccessStatus.failed;
|
|
4423
4704
|
}
|
|
4424
4705
|
}
|
|
4425
4706
|
var score = this.cmi.score;
|
|
@@ -4451,10 +4732,10 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4451
4732
|
return commitObject;
|
|
4452
4733
|
};
|
|
4453
4734
|
Scorm2004Impl.prototype.storeData = function (terminateCommit) {
|
|
4454
|
-
return (0,tslib_es6
|
|
4735
|
+
return (0,tslib_es6.__awaiter)(this, void 0, void 0, function () {
|
|
4455
4736
|
var navRequest, commitObject, result;
|
|
4456
4737
|
var _a, _b, _c;
|
|
4457
|
-
return (0,tslib_es6
|
|
4738
|
+
return (0,tslib_es6.__generator)(this, function (_d) {
|
|
4458
4739
|
switch (_d.label) {
|
|
4459
4740
|
case 0:
|
|
4460
4741
|
if (terminateCommit) {
|
|
@@ -4498,7 +4779,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4498
4779
|
}
|
|
4499
4780
|
return [2, result];
|
|
4500
4781
|
case 2: return [2, {
|
|
4501
|
-
result: api_constants
|
|
4782
|
+
result: api_constants.global_constants.SCORM_TRUE,
|
|
4502
4783
|
errorCode: 0,
|
|
4503
4784
|
}];
|
|
4504
4785
|
}
|
|
@@ -4506,7 +4787,7 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4506
4787
|
});
|
|
4507
4788
|
};
|
|
4508
4789
|
return Scorm2004Impl;
|
|
4509
|
-
}(BaseAPI
|
|
4790
|
+
}(BaseAPI["default"]));
|
|
4510
4791
|
|
|
4511
4792
|
|
|
4512
4793
|
|
|
@@ -4515,29 +4796,40 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4515
4796
|
/***/ 589:
|
|
4516
4797
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
4517
4798
|
|
|
4799
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4518
4800
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4519
|
-
/* harmony export */
|
|
4801
|
+
/* harmony export */ CMIArray: function() { return /* binding */ CMIArray; }
|
|
4520
4802
|
/* harmony export */ });
|
|
4521
|
-
/* unused harmony export scorm12_error_codes */
|
|
4522
4803
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635);
|
|
4523
4804
|
/* harmony import */ var _base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
4524
|
-
/* harmony import */ var
|
|
4525
|
-
/* harmony import */ var
|
|
4805
|
+
/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(784);
|
|
4806
|
+
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(797);
|
|
4526
4807
|
|
|
4527
4808
|
|
|
4528
4809
|
|
|
4529
4810
|
|
|
4530
|
-
var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12;
|
|
4531
4811
|
var CMIArray = (function (_super) {
|
|
4532
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_3__
|
|
4812
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_3__.__extends)(CMIArray, _super);
|
|
4533
4813
|
function CMIArray(params) {
|
|
4534
4814
|
var _this = _super.call(this) || this;
|
|
4535
4815
|
_this.__children = params.children;
|
|
4536
|
-
_this._errorCode = params.errorCode ||
|
|
4537
|
-
_this._errorClass = params.errorClass ||
|
|
4816
|
+
_this._errorCode = params.errorCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.GENERAL;
|
|
4817
|
+
_this._errorClass = params.errorClass || _exceptions__WEBPACK_IMPORTED_MODULE_1__.BaseScormValidationError;
|
|
4538
4818
|
_this.childArray = [];
|
|
4539
4819
|
return _this;
|
|
4540
4820
|
}
|
|
4821
|
+
CMIArray.prototype.reset = function (wipe) {
|
|
4822
|
+
if (wipe === void 0) { wipe = false; }
|
|
4823
|
+
this._initialized = false;
|
|
4824
|
+
if (wipe) {
|
|
4825
|
+
this.childArray = [];
|
|
4826
|
+
}
|
|
4827
|
+
else {
|
|
4828
|
+
for (var i = 0; i < this.childArray.length; i++) {
|
|
4829
|
+
this.childArray[i].reset();
|
|
4830
|
+
}
|
|
4831
|
+
}
|
|
4832
|
+
};
|
|
4541
4833
|
Object.defineProperty(CMIArray.prototype, "_children", {
|
|
4542
4834
|
get: function () {
|
|
4543
4835
|
return this.__children;
|
|
@@ -4568,7 +4860,7 @@ var CMIArray = (function (_super) {
|
|
|
4568
4860
|
return result;
|
|
4569
4861
|
};
|
|
4570
4862
|
return CMIArray;
|
|
4571
|
-
}(_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
4863
|
+
}(_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
4572
4864
|
|
|
4573
4865
|
|
|
4574
4866
|
|
|
@@ -4577,9 +4869,10 @@ var CMIArray = (function (_super) {
|
|
|
4577
4869
|
/***/ 319:
|
|
4578
4870
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
4579
4871
|
|
|
4872
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4580
4873
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4581
|
-
/* harmony export */
|
|
4582
|
-
/* harmony export */
|
|
4874
|
+
/* harmony export */ BaseCMI: function() { return /* binding */ BaseCMI; },
|
|
4875
|
+
/* harmony export */ BaseRootCMI: function() { return /* binding */ BaseRootCMI; }
|
|
4583
4876
|
/* harmony export */ });
|
|
4584
4877
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
4585
4878
|
|
|
@@ -4612,7 +4905,7 @@ var BaseCMI = (function () {
|
|
|
4612
4905
|
}());
|
|
4613
4906
|
|
|
4614
4907
|
var BaseRootCMI = (function (_super) {
|
|
4615
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_0__
|
|
4908
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(BaseRootCMI, _super);
|
|
4616
4909
|
function BaseRootCMI() {
|
|
4617
4910
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
4618
4911
|
}
|
|
@@ -4626,10 +4919,10 @@ var BaseRootCMI = (function (_super) {
|
|
|
4626
4919
|
/***/ 434:
|
|
4627
4920
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
4628
4921
|
|
|
4922
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4629
4923
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4630
|
-
/* harmony export */
|
|
4924
|
+
/* harmony export */ CMIScore: function() { return /* binding */ CMIScore; }
|
|
4631
4925
|
/* harmony export */ });
|
|
4632
|
-
/* unused harmony export scorm12_error_codes */
|
|
4633
4926
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635);
|
|
4634
4927
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340);
|
|
4635
4928
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(417);
|
|
@@ -4642,30 +4935,30 @@ var BaseRootCMI = (function (_super) {
|
|
|
4642
4935
|
|
|
4643
4936
|
|
|
4644
4937
|
|
|
4645
|
-
var scorm12_constants = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12;
|
|
4646
|
-
var scorm12_regex = _constants_regex__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12;
|
|
4647
|
-
var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12;
|
|
4648
4938
|
var CMIScore = (function (_super) {
|
|
4649
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_4__
|
|
4939
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_4__.__extends)(CMIScore, _super);
|
|
4650
4940
|
function CMIScore(params) {
|
|
4651
4941
|
var _this = _super.call(this) || this;
|
|
4652
4942
|
_this._raw = "";
|
|
4653
4943
|
_this._min = "";
|
|
4654
|
-
_this.__children = params.score_children || scorm12_constants.score_children;
|
|
4944
|
+
_this.__children = params.score_children || _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__.scorm12_constants.score_children;
|
|
4655
4945
|
_this.__score_range = !params.score_range
|
|
4656
4946
|
? false
|
|
4657
|
-
: scorm12_regex.score_range;
|
|
4947
|
+
: _constants_regex__WEBPACK_IMPORTED_MODULE_1__.scorm12_regex.score_range;
|
|
4658
4948
|
_this._max = params.max || params.max === "" ? params.max : "100";
|
|
4659
4949
|
_this.__invalid_error_code =
|
|
4660
|
-
params.invalidErrorCode ||
|
|
4950
|
+
params.invalidErrorCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.INVALID_SET_VALUE;
|
|
4661
4951
|
_this.__invalid_type_code =
|
|
4662
|
-
params.invalidTypeCode ||
|
|
4952
|
+
params.invalidTypeCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.TYPE_MISMATCH;
|
|
4663
4953
|
_this.__invalid_range_code =
|
|
4664
|
-
params.invalidRangeCode ||
|
|
4665
|
-
_this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;
|
|
4954
|
+
params.invalidRangeCode || _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.VALUE_OUT_OF_RANGE;
|
|
4955
|
+
_this.__decimal_regex = params.decimalRegex || _constants_regex__WEBPACK_IMPORTED_MODULE_1__.scorm12_regex.CMIDecimal;
|
|
4666
4956
|
_this.__error_class = params.errorClass;
|
|
4667
4957
|
return _this;
|
|
4668
4958
|
}
|
|
4959
|
+
CMIScore.prototype.reset = function () {
|
|
4960
|
+
this._initialized = false;
|
|
4961
|
+
};
|
|
4669
4962
|
Object.defineProperty(CMIScore.prototype, "_children", {
|
|
4670
4963
|
get: function () {
|
|
4671
4964
|
return this.__children;
|
|
@@ -4681,9 +4974,9 @@ var CMIScore = (function (_super) {
|
|
|
4681
4974
|
return this._raw;
|
|
4682
4975
|
},
|
|
4683
4976
|
set: function (raw) {
|
|
4684
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
4977
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidFormat)(raw, this.__decimal_regex, this.__invalid_type_code, this.__error_class) &&
|
|
4685
4978
|
(!this.__score_range ||
|
|
4686
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
4979
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidRange)(raw, this.__score_range, this.__invalid_range_code, this.__error_class))) {
|
|
4687
4980
|
this._raw = raw;
|
|
4688
4981
|
}
|
|
4689
4982
|
},
|
|
@@ -4695,9 +4988,9 @@ var CMIScore = (function (_super) {
|
|
|
4695
4988
|
return this._min;
|
|
4696
4989
|
},
|
|
4697
4990
|
set: function (min) {
|
|
4698
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
4991
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidFormat)(min, this.__decimal_regex, this.__invalid_type_code, this.__error_class) &&
|
|
4699
4992
|
(!this.__score_range ||
|
|
4700
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
4993
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidRange)(min, this.__score_range, this.__invalid_range_code, this.__error_class))) {
|
|
4701
4994
|
this._min = min;
|
|
4702
4995
|
}
|
|
4703
4996
|
},
|
|
@@ -4709,9 +5002,9 @@ var CMIScore = (function (_super) {
|
|
|
4709
5002
|
return this._max;
|
|
4710
5003
|
},
|
|
4711
5004
|
set: function (max) {
|
|
4712
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5005
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidFormat)(max, this.__decimal_regex, this.__invalid_type_code, this.__error_class) &&
|
|
4713
5006
|
(!this.__score_range ||
|
|
4714
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5007
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.checkValidRange)(max, this.__score_range, this.__invalid_range_code, this.__error_class))) {
|
|
4715
5008
|
this._max = max;
|
|
4716
5009
|
}
|
|
4717
5010
|
},
|
|
@@ -4729,7 +5022,7 @@ var CMIScore = (function (_super) {
|
|
|
4729
5022
|
return result;
|
|
4730
5023
|
};
|
|
4731
5024
|
return CMIScore;
|
|
4732
|
-
}(_base_cmi__WEBPACK_IMPORTED_MODULE_2__
|
|
5025
|
+
}(_base_cmi__WEBPACK_IMPORTED_MODULE_2__.BaseCMI));
|
|
4733
5026
|
|
|
4734
5027
|
|
|
4735
5028
|
|
|
@@ -4738,9 +5031,10 @@ var CMIScore = (function (_super) {
|
|
|
4738
5031
|
/***/ 449:
|
|
4739
5032
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
4740
5033
|
|
|
5034
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4741
5035
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4742
|
-
/* harmony export */
|
|
4743
|
-
/* harmony export */
|
|
5036
|
+
/* harmony export */ checkValidFormat: function() { return /* binding */ checkValidFormat; },
|
|
5037
|
+
/* harmony export */ checkValidRange: function() { return /* binding */ checkValidRange; }
|
|
4744
5038
|
/* harmony export */ });
|
|
4745
5039
|
function checkValidFormat(value, regexPattern, errorCode, errorClass, allowEmptyString) {
|
|
4746
5040
|
if (typeof value !== "string") {
|
|
@@ -4778,10 +5072,12 @@ function checkValidRange(value, rangePattern, errorCode, errorClass) {
|
|
|
4778
5072
|
/***/ 989:
|
|
4779
5073
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
4780
5074
|
|
|
5075
|
+
// ESM COMPAT FLAG
|
|
5076
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4781
5077
|
|
|
4782
5078
|
// EXPORTS
|
|
4783
5079
|
__webpack_require__.d(__webpack_exports__, {
|
|
4784
|
-
|
|
5080
|
+
CMI: function() { return /* binding */ CMI; }
|
|
4785
5081
|
});
|
|
4786
5082
|
|
|
4787
5083
|
// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs
|
|
@@ -4792,8 +5088,8 @@ var api_constants = __webpack_require__(340);
|
|
|
4792
5088
|
var error_codes = __webpack_require__(797);
|
|
4793
5089
|
// EXTERNAL MODULE: ./src/constants/regex.ts
|
|
4794
5090
|
var regex = __webpack_require__(417);
|
|
4795
|
-
// EXTERNAL MODULE: ./src/exceptions.ts
|
|
4796
|
-
var
|
|
5091
|
+
// EXTERNAL MODULE: ./src/exceptions/scorm12_exceptions.ts
|
|
5092
|
+
var scorm12_exceptions = __webpack_require__(179);
|
|
4797
5093
|
// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts
|
|
4798
5094
|
var base_cmi = __webpack_require__(319);
|
|
4799
5095
|
// EXTERNAL MODULE: ./src/cmi/scorm12/validation.ts
|
|
@@ -4813,10 +5109,10 @@ var utilities = __webpack_require__(864);
|
|
|
4813
5109
|
|
|
4814
5110
|
|
|
4815
5111
|
var CMICore = (function (_super) {
|
|
4816
|
-
(0,tslib_es6
|
|
5112
|
+
(0,tslib_es6.__extends)(CMICore, _super);
|
|
4817
5113
|
function CMICore() {
|
|
4818
5114
|
var _this = _super.call(this) || this;
|
|
4819
|
-
_this.__children = api_constants
|
|
5115
|
+
_this.__children = api_constants.scorm12_constants.core_children;
|
|
4820
5116
|
_this._student_id = "";
|
|
4821
5117
|
_this._student_name = "";
|
|
4822
5118
|
_this._lesson_location = "";
|
|
@@ -4828,13 +5124,13 @@ var CMICore = (function (_super) {
|
|
|
4828
5124
|
_this._exit = "";
|
|
4829
5125
|
_this._session_time = "00:00:00";
|
|
4830
5126
|
_this._suspend_data = "";
|
|
4831
|
-
_this.score = new score
|
|
4832
|
-
score_children: api_constants
|
|
4833
|
-
score_range: regex
|
|
4834
|
-
invalidErrorCode: error_codes
|
|
4835
|
-
invalidTypeCode: error_codes
|
|
4836
|
-
invalidRangeCode: error_codes
|
|
4837
|
-
errorClass:
|
|
5127
|
+
_this.score = new score.CMIScore({
|
|
5128
|
+
score_children: api_constants.scorm12_constants.score_children,
|
|
5129
|
+
score_range: regex.scorm12_regex.score_range,
|
|
5130
|
+
invalidErrorCode: error_codes.scorm12_errors.INVALID_SET_VALUE,
|
|
5131
|
+
invalidTypeCode: error_codes.scorm12_errors.TYPE_MISMATCH,
|
|
5132
|
+
invalidRangeCode: error_codes.scorm12_errors.VALUE_OUT_OF_RANGE,
|
|
5133
|
+
errorClass: scorm12_exceptions.Scorm12ValidationError,
|
|
4838
5134
|
});
|
|
4839
5135
|
return _this;
|
|
4840
5136
|
}
|
|
@@ -4843,12 +5139,20 @@ var CMICore = (function (_super) {
|
|
|
4843
5139
|
_super.prototype.initialize.call(this);
|
|
4844
5140
|
(_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
4845
5141
|
};
|
|
5142
|
+
CMICore.prototype.reset = function () {
|
|
5143
|
+
var _a;
|
|
5144
|
+
this._initialized = false;
|
|
5145
|
+
this._exit = "";
|
|
5146
|
+
this._entry = "";
|
|
5147
|
+
this._session_time = "00:00:00";
|
|
5148
|
+
(_a = this.score) === null || _a === void 0 ? void 0 : _a.reset();
|
|
5149
|
+
};
|
|
4846
5150
|
Object.defineProperty(CMICore.prototype, "_children", {
|
|
4847
5151
|
get: function () {
|
|
4848
5152
|
return this.__children;
|
|
4849
5153
|
},
|
|
4850
5154
|
set: function (_children) {
|
|
4851
|
-
throw new
|
|
5155
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
4852
5156
|
},
|
|
4853
5157
|
enumerable: false,
|
|
4854
5158
|
configurable: true
|
|
@@ -4859,7 +5163,7 @@ var CMICore = (function (_super) {
|
|
|
4859
5163
|
},
|
|
4860
5164
|
set: function (student_id) {
|
|
4861
5165
|
if (this.initialized) {
|
|
4862
|
-
throw new
|
|
5166
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4863
5167
|
}
|
|
4864
5168
|
else {
|
|
4865
5169
|
this._student_id = student_id;
|
|
@@ -4874,7 +5178,7 @@ var CMICore = (function (_super) {
|
|
|
4874
5178
|
},
|
|
4875
5179
|
set: function (student_name) {
|
|
4876
5180
|
if (this.initialized) {
|
|
4877
|
-
throw new
|
|
5181
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4878
5182
|
}
|
|
4879
5183
|
else {
|
|
4880
5184
|
this._student_name = student_name;
|
|
@@ -4888,7 +5192,7 @@ var CMICore = (function (_super) {
|
|
|
4888
5192
|
return this._lesson_location;
|
|
4889
5193
|
},
|
|
4890
5194
|
set: function (lesson_location) {
|
|
4891
|
-
if ((0,validation
|
|
5195
|
+
if ((0,validation.check12ValidFormat)(lesson_location, regex.scorm12_regex.CMIString256, true)) {
|
|
4892
5196
|
this._lesson_location = lesson_location;
|
|
4893
5197
|
}
|
|
4894
5198
|
},
|
|
@@ -4901,7 +5205,7 @@ var CMICore = (function (_super) {
|
|
|
4901
5205
|
},
|
|
4902
5206
|
set: function (credit) {
|
|
4903
5207
|
if (this.initialized) {
|
|
4904
|
-
throw new
|
|
5208
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4905
5209
|
}
|
|
4906
5210
|
else {
|
|
4907
5211
|
this._credit = credit;
|
|
@@ -4916,12 +5220,12 @@ var CMICore = (function (_super) {
|
|
|
4916
5220
|
},
|
|
4917
5221
|
set: function (lesson_status) {
|
|
4918
5222
|
if (this.initialized) {
|
|
4919
|
-
if ((0,validation
|
|
5223
|
+
if ((0,validation.check12ValidFormat)(lesson_status, regex.scorm12_regex.CMIStatus)) {
|
|
4920
5224
|
this._lesson_status = lesson_status;
|
|
4921
5225
|
}
|
|
4922
5226
|
}
|
|
4923
5227
|
else {
|
|
4924
|
-
if ((0,validation
|
|
5228
|
+
if ((0,validation.check12ValidFormat)(lesson_status, regex.scorm12_regex.CMIStatus2)) {
|
|
4925
5229
|
this._lesson_status = lesson_status;
|
|
4926
5230
|
}
|
|
4927
5231
|
}
|
|
@@ -4935,7 +5239,7 @@ var CMICore = (function (_super) {
|
|
|
4935
5239
|
},
|
|
4936
5240
|
set: function (entry) {
|
|
4937
5241
|
if (this.initialized) {
|
|
4938
|
-
throw new
|
|
5242
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4939
5243
|
}
|
|
4940
5244
|
else {
|
|
4941
5245
|
this._entry = entry;
|
|
@@ -4950,7 +5254,7 @@ var CMICore = (function (_super) {
|
|
|
4950
5254
|
},
|
|
4951
5255
|
set: function (total_time) {
|
|
4952
5256
|
if (this.initialized) {
|
|
4953
|
-
throw new
|
|
5257
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4954
5258
|
}
|
|
4955
5259
|
else {
|
|
4956
5260
|
this._total_time = total_time;
|
|
@@ -4965,7 +5269,7 @@ var CMICore = (function (_super) {
|
|
|
4965
5269
|
},
|
|
4966
5270
|
set: function (lesson_mode) {
|
|
4967
5271
|
if (this.initialized) {
|
|
4968
|
-
throw new
|
|
5272
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
4969
5273
|
}
|
|
4970
5274
|
else {
|
|
4971
5275
|
this._lesson_mode = lesson_mode;
|
|
@@ -4977,12 +5281,12 @@ var CMICore = (function (_super) {
|
|
|
4977
5281
|
Object.defineProperty(CMICore.prototype, "exit", {
|
|
4978
5282
|
get: function () {
|
|
4979
5283
|
if (!this.jsonString) {
|
|
4980
|
-
throw new
|
|
5284
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
4981
5285
|
}
|
|
4982
5286
|
return this._exit;
|
|
4983
5287
|
},
|
|
4984
5288
|
set: function (exit) {
|
|
4985
|
-
if ((0,validation
|
|
5289
|
+
if ((0,validation.check12ValidFormat)(exit, regex.scorm12_regex.CMIExit, true)) {
|
|
4986
5290
|
this._exit = exit;
|
|
4987
5291
|
}
|
|
4988
5292
|
},
|
|
@@ -4992,12 +5296,12 @@ var CMICore = (function (_super) {
|
|
|
4992
5296
|
Object.defineProperty(CMICore.prototype, "session_time", {
|
|
4993
5297
|
get: function () {
|
|
4994
5298
|
if (!this.jsonString) {
|
|
4995
|
-
throw new
|
|
5299
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
4996
5300
|
}
|
|
4997
5301
|
return this._session_time;
|
|
4998
5302
|
},
|
|
4999
5303
|
set: function (session_time) {
|
|
5000
|
-
if ((0,validation
|
|
5304
|
+
if ((0,validation.check12ValidFormat)(session_time, regex.scorm12_regex.CMITimespan)) {
|
|
5001
5305
|
this._session_time = session_time;
|
|
5002
5306
|
}
|
|
5003
5307
|
},
|
|
@@ -5009,7 +5313,7 @@ var CMICore = (function (_super) {
|
|
|
5009
5313
|
return this._suspend_data;
|
|
5010
5314
|
},
|
|
5011
5315
|
set: function (suspend_data) {
|
|
5012
|
-
if ((0,validation
|
|
5316
|
+
if ((0,validation.check12ValidFormat)(suspend_data, regex.scorm12_regex.CMIString4096, true)) {
|
|
5013
5317
|
this._suspend_data = suspend_data;
|
|
5014
5318
|
}
|
|
5015
5319
|
},
|
|
@@ -5021,9 +5325,9 @@ var CMICore = (function (_super) {
|
|
|
5021
5325
|
var startTime = start_time;
|
|
5022
5326
|
if (typeof startTime !== "undefined" && startTime !== null) {
|
|
5023
5327
|
var seconds = new Date().getTime() - startTime;
|
|
5024
|
-
sessionTime = utilities
|
|
5328
|
+
sessionTime = utilities.getSecondsAsHHMMSS(seconds / 1000);
|
|
5025
5329
|
}
|
|
5026
|
-
return utilities
|
|
5330
|
+
return utilities.addHHMMSSTimeStrings(this._total_time, sessionTime, new RegExp(regex.scorm12_regex.CMITimespan));
|
|
5027
5331
|
};
|
|
5028
5332
|
CMICore.prototype.toJSON = function () {
|
|
5029
5333
|
this.jsonString = true;
|
|
@@ -5043,7 +5347,7 @@ var CMICore = (function (_super) {
|
|
|
5043
5347
|
return result;
|
|
5044
5348
|
};
|
|
5045
5349
|
return CMICore;
|
|
5046
|
-
}(base_cmi
|
|
5350
|
+
}(base_cmi.BaseCMI));
|
|
5047
5351
|
|
|
5048
5352
|
|
|
5049
5353
|
// EXTERNAL MODULE: ./src/cmi/scorm12/objectives.ts
|
|
@@ -5068,7 +5372,7 @@ var interactions = __webpack_require__(833);
|
|
|
5068
5372
|
|
|
5069
5373
|
|
|
5070
5374
|
var CMI = (function (_super) {
|
|
5071
|
-
(0,tslib_es6
|
|
5375
|
+
(0,tslib_es6.__extends)(CMI, _super);
|
|
5072
5376
|
function CMI(cmi_children, student_data, initialized) {
|
|
5073
5377
|
var _this = _super.call(this) || this;
|
|
5074
5378
|
_this.__children = "";
|
|
@@ -5080,14 +5384,25 @@ var CMI = (function (_super) {
|
|
|
5080
5384
|
_this.initialize();
|
|
5081
5385
|
_this.__children = cmi_children
|
|
5082
5386
|
? cmi_children
|
|
5083
|
-
: api_constants
|
|
5387
|
+
: api_constants.scorm12_constants.cmi_children;
|
|
5084
5388
|
_this.core = new CMICore();
|
|
5085
|
-
_this.objectives = new objectives
|
|
5086
|
-
_this.student_data = student_data ? student_data : new scorm12_student_data
|
|
5087
|
-
_this.student_preference = new student_preference
|
|
5088
|
-
_this.interactions = new interactions
|
|
5389
|
+
_this.objectives = new objectives.CMIObjectives();
|
|
5390
|
+
_this.student_data = student_data ? student_data : new scorm12_student_data.CMIStudentData();
|
|
5391
|
+
_this.student_preference = new student_preference.CMIStudentPreference();
|
|
5392
|
+
_this.interactions = new interactions.CMIInteractions();
|
|
5089
5393
|
return _this;
|
|
5090
5394
|
}
|
|
5395
|
+
CMI.prototype.reset = function () {
|
|
5396
|
+
var _a, _b, _c;
|
|
5397
|
+
this._initialized = false;
|
|
5398
|
+
this._launch_data = "";
|
|
5399
|
+
this._comments = "";
|
|
5400
|
+
(_a = this.core) === null || _a === void 0 ? void 0 : _a.reset();
|
|
5401
|
+
this.objectives = new objectives.CMIObjectives();
|
|
5402
|
+
this.interactions = new interactions.CMIInteractions();
|
|
5403
|
+
(_b = this.student_data) === null || _b === void 0 ? void 0 : _b.reset();
|
|
5404
|
+
(_c = this.student_preference) === null || _c === void 0 ? void 0 : _c.reset();
|
|
5405
|
+
};
|
|
5091
5406
|
CMI.prototype.initialize = function () {
|
|
5092
5407
|
var _a, _b, _c, _d, _e;
|
|
5093
5408
|
_super.prototype.initialize.call(this);
|
|
@@ -5118,7 +5433,7 @@ var CMI = (function (_super) {
|
|
|
5118
5433
|
return this.__version;
|
|
5119
5434
|
},
|
|
5120
5435
|
set: function (_version) {
|
|
5121
|
-
throw new
|
|
5436
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
5122
5437
|
},
|
|
5123
5438
|
enumerable: false,
|
|
5124
5439
|
configurable: true
|
|
@@ -5128,7 +5443,7 @@ var CMI = (function (_super) {
|
|
|
5128
5443
|
return this.__children;
|
|
5129
5444
|
},
|
|
5130
5445
|
set: function (_children) {
|
|
5131
|
-
throw new
|
|
5446
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.INVALID_SET_VALUE);
|
|
5132
5447
|
},
|
|
5133
5448
|
enumerable: false,
|
|
5134
5449
|
configurable: true
|
|
@@ -5152,7 +5467,7 @@ var CMI = (function (_super) {
|
|
|
5152
5467
|
},
|
|
5153
5468
|
set: function (launch_data) {
|
|
5154
5469
|
if (this.initialized) {
|
|
5155
|
-
throw new
|
|
5470
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
5156
5471
|
}
|
|
5157
5472
|
else {
|
|
5158
5473
|
this._launch_data = launch_data;
|
|
@@ -5166,7 +5481,7 @@ var CMI = (function (_super) {
|
|
|
5166
5481
|
return this._comments;
|
|
5167
5482
|
},
|
|
5168
5483
|
set: function (comments) {
|
|
5169
|
-
if ((0,validation
|
|
5484
|
+
if ((0,validation.check12ValidFormat)(comments, regex.scorm12_regex.CMIString4096, true)) {
|
|
5170
5485
|
this._comments = comments;
|
|
5171
5486
|
}
|
|
5172
5487
|
},
|
|
@@ -5179,7 +5494,7 @@ var CMI = (function (_super) {
|
|
|
5179
5494
|
},
|
|
5180
5495
|
set: function (comments_from_lms) {
|
|
5181
5496
|
if (this.initialized) {
|
|
5182
|
-
throw new
|
|
5497
|
+
throw new scorm12_exceptions.Scorm12ValidationError(error_codes.scorm12_errors.READ_ONLY_ELEMENT);
|
|
5183
5498
|
}
|
|
5184
5499
|
else {
|
|
5185
5500
|
this._comments_from_lms = comments_from_lms;
|
|
@@ -5192,7 +5507,7 @@ var CMI = (function (_super) {
|
|
|
5192
5507
|
return this.core.getCurrentTotalTime(this.start_time);
|
|
5193
5508
|
};
|
|
5194
5509
|
return CMI;
|
|
5195
|
-
}(base_cmi
|
|
5510
|
+
}(base_cmi.BaseRootCMI));
|
|
5196
5511
|
|
|
5197
5512
|
|
|
5198
5513
|
|
|
@@ -5201,17 +5516,18 @@ var CMI = (function (_super) {
|
|
|
5201
5516
|
/***/ 833:
|
|
5202
5517
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5203
5518
|
|
|
5519
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5204
5520
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5205
|
-
/* harmony export */
|
|
5206
|
-
/* harmony export */
|
|
5207
|
-
/* harmony export */
|
|
5208
|
-
/* harmony export */
|
|
5521
|
+
/* harmony export */ CMIInteractions: function() { return /* binding */ CMIInteractions; },
|
|
5522
|
+
/* harmony export */ CMIInteractionsCorrectResponsesObject: function() { return /* binding */ CMIInteractionsCorrectResponsesObject; },
|
|
5523
|
+
/* harmony export */ CMIInteractionsObject: function() { return /* binding */ CMIInteractionsObject; },
|
|
5524
|
+
/* harmony export */ CMIInteractionsObjectivesObject: function() { return /* binding */ CMIInteractionsObjectivesObject; }
|
|
5209
5525
|
/* harmony export */ });
|
|
5210
5526
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(635);
|
|
5211
5527
|
/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(589);
|
|
5212
5528
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
5213
5529
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(797);
|
|
5214
|
-
/* harmony import */ var
|
|
5530
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(179);
|
|
5215
5531
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(319);
|
|
5216
5532
|
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(915);
|
|
5217
5533
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(417);
|
|
@@ -5224,19 +5540,19 @@ var CMI = (function (_super) {
|
|
|
5224
5540
|
|
|
5225
5541
|
|
|
5226
5542
|
var CMIInteractions = (function (_super) {
|
|
5227
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
5543
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractions, _super);
|
|
5228
5544
|
function CMIInteractions() {
|
|
5229
5545
|
return _super.call(this, {
|
|
5230
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
5231
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__
|
|
5232
|
-
errorClass:
|
|
5546
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.interactions_children,
|
|
5547
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.INVALID_SET_VALUE,
|
|
5548
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError,
|
|
5233
5549
|
}) || this;
|
|
5234
5550
|
}
|
|
5235
5551
|
return CMIInteractions;
|
|
5236
|
-
}(_common_array__WEBPACK_IMPORTED_MODULE_0__
|
|
5552
|
+
}(_common_array__WEBPACK_IMPORTED_MODULE_0__.CMIArray));
|
|
5237
5553
|
|
|
5238
5554
|
var CMIInteractionsObject = (function (_super) {
|
|
5239
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
5555
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsObject, _super);
|
|
5240
5556
|
function CMIInteractionsObject() {
|
|
5241
5557
|
var _this = _super.call(this) || this;
|
|
5242
5558
|
_this._id = "";
|
|
@@ -5246,15 +5562,15 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5246
5562
|
_this._student_response = "";
|
|
5247
5563
|
_this._result = "";
|
|
5248
5564
|
_this._latency = "";
|
|
5249
|
-
_this.objectives = new _common_array__WEBPACK_IMPORTED_MODULE_0__
|
|
5250
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__
|
|
5251
|
-
errorClass:
|
|
5252
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
5565
|
+
_this.objectives = new _common_array__WEBPACK_IMPORTED_MODULE_0__.CMIArray({
|
|
5566
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.INVALID_SET_VALUE,
|
|
5567
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError,
|
|
5568
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.objectives_children,
|
|
5253
5569
|
});
|
|
5254
|
-
_this.correct_responses = new _common_array__WEBPACK_IMPORTED_MODULE_0__
|
|
5255
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__
|
|
5256
|
-
errorClass:
|
|
5257
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
5570
|
+
_this.correct_responses = new _common_array__WEBPACK_IMPORTED_MODULE_0__.CMIArray({
|
|
5571
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.INVALID_SET_VALUE,
|
|
5572
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError,
|
|
5573
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.correct_responses_children,
|
|
5258
5574
|
});
|
|
5259
5575
|
return _this;
|
|
5260
5576
|
}
|
|
@@ -5264,15 +5580,28 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5264
5580
|
(_a = this.objectives) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
5265
5581
|
(_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.initialize();
|
|
5266
5582
|
};
|
|
5583
|
+
CMIInteractionsObject.prototype.reset = function () {
|
|
5584
|
+
var _a, _b;
|
|
5585
|
+
this._initialized = false;
|
|
5586
|
+
this._id = "";
|
|
5587
|
+
this._time = "";
|
|
5588
|
+
this._type = "";
|
|
5589
|
+
this._weighting = "";
|
|
5590
|
+
this._student_response = "";
|
|
5591
|
+
this._result = "";
|
|
5592
|
+
this._latency = "";
|
|
5593
|
+
(_a = this.objectives) === null || _a === void 0 ? void 0 : _a.reset();
|
|
5594
|
+
(_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.reset();
|
|
5595
|
+
};
|
|
5267
5596
|
Object.defineProperty(CMIInteractionsObject.prototype, "id", {
|
|
5268
5597
|
get: function () {
|
|
5269
5598
|
if (!this.jsonString) {
|
|
5270
|
-
throw new
|
|
5599
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
5271
5600
|
}
|
|
5272
5601
|
return this._id;
|
|
5273
5602
|
},
|
|
5274
5603
|
set: function (id) {
|
|
5275
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5604
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIIdentifier)) {
|
|
5276
5605
|
this._id = id;
|
|
5277
5606
|
}
|
|
5278
5607
|
},
|
|
@@ -5282,12 +5611,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5282
5611
|
Object.defineProperty(CMIInteractionsObject.prototype, "time", {
|
|
5283
5612
|
get: function () {
|
|
5284
5613
|
if (!this.jsonString) {
|
|
5285
|
-
throw new
|
|
5614
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
5286
5615
|
}
|
|
5287
5616
|
return this._time;
|
|
5288
5617
|
},
|
|
5289
5618
|
set: function (time) {
|
|
5290
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5619
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(time, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMITime)) {
|
|
5291
5620
|
this._time = time;
|
|
5292
5621
|
}
|
|
5293
5622
|
},
|
|
@@ -5297,12 +5626,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5297
5626
|
Object.defineProperty(CMIInteractionsObject.prototype, "type", {
|
|
5298
5627
|
get: function () {
|
|
5299
5628
|
if (!this.jsonString) {
|
|
5300
|
-
throw new
|
|
5629
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
5301
5630
|
}
|
|
5302
5631
|
return this._type;
|
|
5303
5632
|
},
|
|
5304
5633
|
set: function (type) {
|
|
5305
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5634
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(type, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIType)) {
|
|
5306
5635
|
this._type = type;
|
|
5307
5636
|
}
|
|
5308
5637
|
},
|
|
@@ -5312,13 +5641,13 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5312
5641
|
Object.defineProperty(CMIInteractionsObject.prototype, "weighting", {
|
|
5313
5642
|
get: function () {
|
|
5314
5643
|
if (!this.jsonString) {
|
|
5315
|
-
throw new
|
|
5644
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
5316
5645
|
}
|
|
5317
5646
|
return this._weighting;
|
|
5318
5647
|
},
|
|
5319
5648
|
set: function (weighting) {
|
|
5320
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5321
|
-
(0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5649
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIDecimal) &&
|
|
5650
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidRange)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.weighting_range)) {
|
|
5322
5651
|
this._weighting = weighting;
|
|
5323
5652
|
}
|
|
5324
5653
|
},
|
|
@@ -5328,12 +5657,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5328
5657
|
Object.defineProperty(CMIInteractionsObject.prototype, "student_response", {
|
|
5329
5658
|
get: function () {
|
|
5330
5659
|
if (!this.jsonString) {
|
|
5331
|
-
throw new
|
|
5660
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
5332
5661
|
}
|
|
5333
5662
|
return this._student_response;
|
|
5334
5663
|
},
|
|
5335
5664
|
set: function (student_response) {
|
|
5336
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5665
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(student_response, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIFeedback, true)) {
|
|
5337
5666
|
this._student_response = student_response;
|
|
5338
5667
|
}
|
|
5339
5668
|
},
|
|
@@ -5343,12 +5672,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5343
5672
|
Object.defineProperty(CMIInteractionsObject.prototype, "result", {
|
|
5344
5673
|
get: function () {
|
|
5345
5674
|
if (!this.jsonString) {
|
|
5346
|
-
throw new
|
|
5675
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
5347
5676
|
}
|
|
5348
5677
|
return this._result;
|
|
5349
5678
|
},
|
|
5350
5679
|
set: function (result) {
|
|
5351
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5680
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(result, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIResult)) {
|
|
5352
5681
|
this._result = result;
|
|
5353
5682
|
}
|
|
5354
5683
|
},
|
|
@@ -5358,12 +5687,12 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5358
5687
|
Object.defineProperty(CMIInteractionsObject.prototype, "latency", {
|
|
5359
5688
|
get: function () {
|
|
5360
5689
|
if (!this.jsonString) {
|
|
5361
|
-
throw new
|
|
5690
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
5362
5691
|
}
|
|
5363
5692
|
return this._latency;
|
|
5364
5693
|
},
|
|
5365
5694
|
set: function (latency) {
|
|
5366
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5695
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(latency, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMITimespan)) {
|
|
5367
5696
|
this._latency = latency;
|
|
5368
5697
|
}
|
|
5369
5698
|
},
|
|
@@ -5387,21 +5716,25 @@ var CMIInteractionsObject = (function (_super) {
|
|
|
5387
5716
|
return result;
|
|
5388
5717
|
};
|
|
5389
5718
|
return CMIInteractionsObject;
|
|
5390
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
5719
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
5391
5720
|
|
|
5392
5721
|
var CMIInteractionsObjectivesObject = (function (_super) {
|
|
5393
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
5722
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsObjectivesObject, _super);
|
|
5394
5723
|
function CMIInteractionsObjectivesObject() {
|
|
5395
5724
|
var _this = _super.call(this) || this;
|
|
5396
5725
|
_this._id = "";
|
|
5397
5726
|
return _this;
|
|
5398
5727
|
}
|
|
5728
|
+
CMIInteractionsObjectivesObject.prototype.reset = function () {
|
|
5729
|
+
this._initialized = false;
|
|
5730
|
+
this._id = "";
|
|
5731
|
+
};
|
|
5399
5732
|
Object.defineProperty(CMIInteractionsObjectivesObject.prototype, "id", {
|
|
5400
5733
|
get: function () {
|
|
5401
5734
|
return this._id;
|
|
5402
5735
|
},
|
|
5403
5736
|
set: function (id) {
|
|
5404
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5737
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIIdentifier)) {
|
|
5405
5738
|
this._id = id;
|
|
5406
5739
|
}
|
|
5407
5740
|
},
|
|
@@ -5417,24 +5750,28 @@ var CMIInteractionsObjectivesObject = (function (_super) {
|
|
|
5417
5750
|
return result;
|
|
5418
5751
|
};
|
|
5419
5752
|
return CMIInteractionsObjectivesObject;
|
|
5420
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
5753
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
5421
5754
|
|
|
5422
5755
|
var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
5423
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_7__
|
|
5756
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CMIInteractionsCorrectResponsesObject, _super);
|
|
5424
5757
|
function CMIInteractionsCorrectResponsesObject() {
|
|
5425
5758
|
var _this = _super.call(this) || this;
|
|
5426
5759
|
_this._pattern = "";
|
|
5427
5760
|
return _this;
|
|
5428
5761
|
}
|
|
5762
|
+
CMIInteractionsCorrectResponsesObject.prototype.reset = function () {
|
|
5763
|
+
this._initialized = false;
|
|
5764
|
+
this._pattern = "";
|
|
5765
|
+
};
|
|
5429
5766
|
Object.defineProperty(CMIInteractionsCorrectResponsesObject.prototype, "pattern", {
|
|
5430
5767
|
get: function () {
|
|
5431
5768
|
if (!this.jsonString) {
|
|
5432
|
-
throw new
|
|
5769
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_3__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__.scorm12_errors.WRITE_ONLY_ELEMENT);
|
|
5433
5770
|
}
|
|
5434
5771
|
return this._pattern;
|
|
5435
5772
|
},
|
|
5436
5773
|
set: function (pattern) {
|
|
5437
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__
|
|
5774
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__.check12ValidFormat)(pattern, _constants_regex__WEBPACK_IMPORTED_MODULE_6__.scorm12_regex.CMIFeedback, true)) {
|
|
5438
5775
|
this._pattern = pattern;
|
|
5439
5776
|
}
|
|
5440
5777
|
},
|
|
@@ -5450,7 +5787,7 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
5450
5787
|
return result;
|
|
5451
5788
|
};
|
|
5452
5789
|
return CMIInteractionsCorrectResponsesObject;
|
|
5453
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__
|
|
5790
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__.BaseCMI));
|
|
5454
5791
|
|
|
5455
5792
|
|
|
5456
5793
|
|
|
@@ -5459,8 +5796,9 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
5459
5796
|
/***/ 331:
|
|
5460
5797
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5461
5798
|
|
|
5799
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5462
5800
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5463
|
-
/* harmony export */
|
|
5801
|
+
/* harmony export */ NAV: function() { return /* binding */ NAV; }
|
|
5464
5802
|
/* harmony export */ });
|
|
5465
5803
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635);
|
|
5466
5804
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
@@ -5471,18 +5809,22 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) {
|
|
|
5471
5809
|
|
|
5472
5810
|
|
|
5473
5811
|
var NAV = (function (_super) {
|
|
5474
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_3__
|
|
5812
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_3__.__extends)(NAV, _super);
|
|
5475
5813
|
function NAV() {
|
|
5476
5814
|
var _this = _super.call(this) || this;
|
|
5477
5815
|
_this._event = "";
|
|
5478
5816
|
return _this;
|
|
5479
5817
|
}
|
|
5818
|
+
NAV.prototype.reset = function () {
|
|
5819
|
+
this._event = "";
|
|
5820
|
+
this._initialized = false;
|
|
5821
|
+
};
|
|
5480
5822
|
Object.defineProperty(NAV.prototype, "event", {
|
|
5481
5823
|
get: function () {
|
|
5482
5824
|
return this._event;
|
|
5483
5825
|
},
|
|
5484
5826
|
set: function (event) {
|
|
5485
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_1__
|
|
5827
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_1__.check12ValidFormat)(event, _constants_regex__WEBPACK_IMPORTED_MODULE_2__.scorm12_regex.NAVEvent)) {
|
|
5486
5828
|
this._event = event;
|
|
5487
5829
|
}
|
|
5488
5830
|
},
|
|
@@ -5498,7 +5840,7 @@ var NAV = (function (_super) {
|
|
|
5498
5840
|
return result;
|
|
5499
5841
|
};
|
|
5500
5842
|
return NAV;
|
|
5501
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
5843
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
5502
5844
|
|
|
5503
5845
|
|
|
5504
5846
|
|
|
@@ -5507,9 +5849,10 @@ var NAV = (function (_super) {
|
|
|
5507
5849
|
/***/ 176:
|
|
5508
5850
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5509
5851
|
|
|
5852
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5510
5853
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5511
|
-
/* harmony export */
|
|
5512
|
-
/* harmony export */
|
|
5854
|
+
/* harmony export */ CMIObjectives: function() { return /* binding */ CMIObjectives; },
|
|
5855
|
+
/* harmony export */ CMIObjectivesObject: function() { return /* binding */ CMIObjectivesObject; }
|
|
5513
5856
|
/* harmony export */ });
|
|
5514
5857
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(635);
|
|
5515
5858
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
@@ -5517,7 +5860,7 @@ var NAV = (function (_super) {
|
|
|
5517
5860
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(340);
|
|
5518
5861
|
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(417);
|
|
5519
5862
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(797);
|
|
5520
|
-
/* harmony import */ var
|
|
5863
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(179);
|
|
5521
5864
|
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(915);
|
|
5522
5865
|
/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(589);
|
|
5523
5866
|
|
|
@@ -5530,39 +5873,46 @@ var NAV = (function (_super) {
|
|
|
5530
5873
|
|
|
5531
5874
|
|
|
5532
5875
|
var CMIObjectives = (function (_super) {
|
|
5533
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_8__
|
|
5876
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_8__.__extends)(CMIObjectives, _super);
|
|
5534
5877
|
function CMIObjectives() {
|
|
5535
5878
|
return _super.call(this, {
|
|
5536
|
-
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
5537
|
-
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
5538
|
-
errorClass:
|
|
5879
|
+
children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.objectives_children,
|
|
5880
|
+
errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.INVALID_SET_VALUE,
|
|
5881
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_5__.Scorm12ValidationError,
|
|
5539
5882
|
}) || this;
|
|
5540
5883
|
}
|
|
5541
5884
|
return CMIObjectives;
|
|
5542
|
-
}(_common_array__WEBPACK_IMPORTED_MODULE_7__
|
|
5885
|
+
}(_common_array__WEBPACK_IMPORTED_MODULE_7__.CMIArray));
|
|
5543
5886
|
|
|
5544
5887
|
var CMIObjectivesObject = (function (_super) {
|
|
5545
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_8__
|
|
5888
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_8__.__extends)(CMIObjectivesObject, _super);
|
|
5546
5889
|
function CMIObjectivesObject() {
|
|
5547
5890
|
var _this = _super.call(this) || this;
|
|
5548
5891
|
_this._id = "";
|
|
5549
5892
|
_this._status = "";
|
|
5550
|
-
_this.score = new _common_score__WEBPACK_IMPORTED_MODULE_1__
|
|
5551
|
-
score_children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__
|
|
5552
|
-
score_range: _constants_regex__WEBPACK_IMPORTED_MODULE_3__
|
|
5553
|
-
invalidErrorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
5554
|
-
invalidTypeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
5555
|
-
invalidRangeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__
|
|
5556
|
-
errorClass:
|
|
5893
|
+
_this.score = new _common_score__WEBPACK_IMPORTED_MODULE_1__.CMIScore({
|
|
5894
|
+
score_children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__.scorm12_constants.score_children,
|
|
5895
|
+
score_range: _constants_regex__WEBPACK_IMPORTED_MODULE_3__.scorm12_regex.score_range,
|
|
5896
|
+
invalidErrorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.INVALID_SET_VALUE,
|
|
5897
|
+
invalidTypeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.TYPE_MISMATCH,
|
|
5898
|
+
invalidRangeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__.scorm12_errors.VALUE_OUT_OF_RANGE,
|
|
5899
|
+
errorClass: _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_5__.Scorm12ValidationError,
|
|
5557
5900
|
});
|
|
5558
5901
|
return _this;
|
|
5559
5902
|
}
|
|
5903
|
+
CMIObjectivesObject.prototype.reset = function () {
|
|
5904
|
+
var _a;
|
|
5905
|
+
this._initialized = false;
|
|
5906
|
+
this._id = "";
|
|
5907
|
+
this._status = "";
|
|
5908
|
+
(_a = this.score) === null || _a === void 0 ? void 0 : _a.reset();
|
|
5909
|
+
};
|
|
5560
5910
|
Object.defineProperty(CMIObjectivesObject.prototype, "id", {
|
|
5561
5911
|
get: function () {
|
|
5562
5912
|
return this._id;
|
|
5563
5913
|
},
|
|
5564
5914
|
set: function (id) {
|
|
5565
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__
|
|
5915
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__.check12ValidFormat)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_3__.scorm12_regex.CMIIdentifier)) {
|
|
5566
5916
|
this._id = id;
|
|
5567
5917
|
}
|
|
5568
5918
|
},
|
|
@@ -5574,7 +5924,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
5574
5924
|
return this._status;
|
|
5575
5925
|
},
|
|
5576
5926
|
set: function (status) {
|
|
5577
|
-
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__
|
|
5927
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__.check12ValidFormat)(status, _constants_regex__WEBPACK_IMPORTED_MODULE_3__.scorm12_regex.CMIStatus2)) {
|
|
5578
5928
|
this._status = status;
|
|
5579
5929
|
}
|
|
5580
5930
|
},
|
|
@@ -5592,7 +5942,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
5592
5942
|
return result;
|
|
5593
5943
|
};
|
|
5594
5944
|
return CMIObjectivesObject;
|
|
5595
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
5945
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
5596
5946
|
|
|
5597
5947
|
|
|
5598
5948
|
|
|
@@ -5601,13 +5951,14 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
5601
5951
|
/***/ 532:
|
|
5602
5952
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5603
5953
|
|
|
5954
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5604
5955
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5605
|
-
/* harmony export */
|
|
5956
|
+
/* harmony export */ CMIStudentData: function() { return /* binding */ CMIStudentData; }
|
|
5606
5957
|
/* harmony export */ });
|
|
5607
5958
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635);
|
|
5608
5959
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
5609
5960
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
5610
|
-
/* harmony import */ var
|
|
5961
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(179);
|
|
5611
5962
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797);
|
|
5612
5963
|
|
|
5613
5964
|
|
|
@@ -5615,7 +5966,7 @@ var CMIObjectivesObject = (function (_super) {
|
|
|
5615
5966
|
|
|
5616
5967
|
|
|
5617
5968
|
var CMIStudentData = (function (_super) {
|
|
5618
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_4__
|
|
5969
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_4__.__extends)(CMIStudentData, _super);
|
|
5619
5970
|
function CMIStudentData(student_data_children) {
|
|
5620
5971
|
var _this = _super.call(this) || this;
|
|
5621
5972
|
_this._mastery_score = "";
|
|
@@ -5623,15 +5974,18 @@ var CMIStudentData = (function (_super) {
|
|
|
5623
5974
|
_this._time_limit_action = "";
|
|
5624
5975
|
_this.__children = student_data_children
|
|
5625
5976
|
? student_data_children
|
|
5626
|
-
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
5977
|
+
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.student_data_children;
|
|
5627
5978
|
return _this;
|
|
5628
5979
|
}
|
|
5980
|
+
CMIStudentData.prototype.reset = function () {
|
|
5981
|
+
this._initialized = false;
|
|
5982
|
+
};
|
|
5629
5983
|
Object.defineProperty(CMIStudentData.prototype, "_children", {
|
|
5630
5984
|
get: function () {
|
|
5631
5985
|
return this.__children;
|
|
5632
5986
|
},
|
|
5633
5987
|
set: function (_children) {
|
|
5634
|
-
throw new
|
|
5988
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.INVALID_SET_VALUE);
|
|
5635
5989
|
},
|
|
5636
5990
|
enumerable: false,
|
|
5637
5991
|
configurable: true
|
|
@@ -5642,7 +5996,7 @@ var CMIStudentData = (function (_super) {
|
|
|
5642
5996
|
},
|
|
5643
5997
|
set: function (mastery_score) {
|
|
5644
5998
|
if (this.initialized) {
|
|
5645
|
-
throw new
|
|
5999
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.READ_ONLY_ELEMENT);
|
|
5646
6000
|
}
|
|
5647
6001
|
else {
|
|
5648
6002
|
this._mastery_score = mastery_score;
|
|
@@ -5657,7 +6011,7 @@ var CMIStudentData = (function (_super) {
|
|
|
5657
6011
|
},
|
|
5658
6012
|
set: function (max_time_allowed) {
|
|
5659
6013
|
if (this.initialized) {
|
|
5660
|
-
throw new
|
|
6014
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.READ_ONLY_ELEMENT);
|
|
5661
6015
|
}
|
|
5662
6016
|
else {
|
|
5663
6017
|
this._max_time_allowed = max_time_allowed;
|
|
@@ -5672,7 +6026,7 @@ var CMIStudentData = (function (_super) {
|
|
|
5672
6026
|
},
|
|
5673
6027
|
set: function (time_limit_action) {
|
|
5674
6028
|
if (this.initialized) {
|
|
5675
|
-
throw new
|
|
6029
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__.scorm12_errors.READ_ONLY_ELEMENT);
|
|
5676
6030
|
}
|
|
5677
6031
|
else {
|
|
5678
6032
|
this._time_limit_action = time_limit_action;
|
|
@@ -5692,7 +6046,7 @@ var CMIStudentData = (function (_super) {
|
|
|
5692
6046
|
return result;
|
|
5693
6047
|
};
|
|
5694
6048
|
return CMIStudentData;
|
|
5695
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
6049
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
5696
6050
|
|
|
5697
6051
|
|
|
5698
6052
|
|
|
@@ -5701,16 +6055,17 @@ var CMIStudentData = (function (_super) {
|
|
|
5701
6055
|
/***/ 181:
|
|
5702
6056
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5703
6057
|
|
|
6058
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5704
6059
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5705
|
-
/* harmony export */
|
|
6060
|
+
/* harmony export */ CMIStudentPreference: function() { return /* binding */ CMIStudentPreference; }
|
|
5706
6061
|
/* harmony export */ });
|
|
5707
6062
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(635);
|
|
5708
6063
|
/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
|
5709
6064
|
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
5710
|
-
/* harmony import */ var
|
|
5711
|
-
/* harmony import */ var
|
|
5712
|
-
/* harmony import */ var
|
|
5713
|
-
/* harmony import */ var
|
|
6065
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(179);
|
|
6066
|
+
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(915);
|
|
6067
|
+
/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(417);
|
|
6068
|
+
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(797);
|
|
5714
6069
|
|
|
5715
6070
|
|
|
5716
6071
|
|
|
@@ -5719,7 +6074,7 @@ var CMIStudentData = (function (_super) {
|
|
|
5719
6074
|
|
|
5720
6075
|
|
|
5721
6076
|
var CMIStudentPreference = (function (_super) {
|
|
5722
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_6__
|
|
6077
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_6__.__extends)(CMIStudentPreference, _super);
|
|
5723
6078
|
function CMIStudentPreference(student_preference_children) {
|
|
5724
6079
|
var _this = _super.call(this) || this;
|
|
5725
6080
|
_this._audio = "";
|
|
@@ -5728,15 +6083,18 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5728
6083
|
_this._text = "";
|
|
5729
6084
|
_this.__children = student_preference_children
|
|
5730
6085
|
? student_preference_children
|
|
5731
|
-
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__
|
|
6086
|
+
: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.student_preference_children;
|
|
5732
6087
|
return _this;
|
|
5733
6088
|
}
|
|
6089
|
+
CMIStudentPreference.prototype.reset = function () {
|
|
6090
|
+
this._initialized = false;
|
|
6091
|
+
};
|
|
5734
6092
|
Object.defineProperty(CMIStudentPreference.prototype, "_children", {
|
|
5735
6093
|
get: function () {
|
|
5736
6094
|
return this.__children;
|
|
5737
6095
|
},
|
|
5738
6096
|
set: function (_children) {
|
|
5739
|
-
throw new
|
|
6097
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_2__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_5__.scorm12_errors.INVALID_SET_VALUE);
|
|
5740
6098
|
},
|
|
5741
6099
|
enumerable: false,
|
|
5742
6100
|
configurable: true
|
|
@@ -5746,8 +6104,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5746
6104
|
return this._audio;
|
|
5747
6105
|
},
|
|
5748
6106
|
set: function (audio) {
|
|
5749
|
-
if ((0,
|
|
5750
|
-
(0,
|
|
6107
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMISInteger) &&
|
|
6108
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidRange)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.audio_range)) {
|
|
5751
6109
|
this._audio = audio;
|
|
5752
6110
|
}
|
|
5753
6111
|
},
|
|
@@ -5759,7 +6117,7 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5759
6117
|
return this._language;
|
|
5760
6118
|
},
|
|
5761
6119
|
set: function (language) {
|
|
5762
|
-
if ((0,
|
|
6120
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(language, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMIString256)) {
|
|
5763
6121
|
this._language = language;
|
|
5764
6122
|
}
|
|
5765
6123
|
},
|
|
@@ -5771,8 +6129,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5771
6129
|
return this._speed;
|
|
5772
6130
|
},
|
|
5773
6131
|
set: function (speed) {
|
|
5774
|
-
if ((0,
|
|
5775
|
-
(0,
|
|
6132
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMISInteger) &&
|
|
6133
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidRange)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.speed_range)) {
|
|
5776
6134
|
this._speed = speed;
|
|
5777
6135
|
}
|
|
5778
6136
|
},
|
|
@@ -5784,8 +6142,8 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5784
6142
|
return this._text;
|
|
5785
6143
|
},
|
|
5786
6144
|
set: function (text) {
|
|
5787
|
-
if ((0,
|
|
5788
|
-
(0,
|
|
6145
|
+
if ((0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidFormat)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.CMISInteger) &&
|
|
6146
|
+
(0,_validation__WEBPACK_IMPORTED_MODULE_3__.check12ValidRange)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_4__.scorm12_regex.text_range)) {
|
|
5789
6147
|
this._text = text;
|
|
5790
6148
|
}
|
|
5791
6149
|
},
|
|
@@ -5804,7 +6162,7 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5804
6162
|
return result;
|
|
5805
6163
|
};
|
|
5806
6164
|
return CMIStudentPreference;
|
|
5807
|
-
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__
|
|
6165
|
+
}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__.BaseCMI));
|
|
5808
6166
|
|
|
5809
6167
|
|
|
5810
6168
|
|
|
@@ -5813,24 +6171,25 @@ var CMIStudentPreference = (function (_super) {
|
|
|
5813
6171
|
/***/ 915:
|
|
5814
6172
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5815
6173
|
|
|
6174
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5816
6175
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5817
|
-
/* harmony export */
|
|
5818
|
-
/* harmony export */
|
|
6176
|
+
/* harmony export */ check12ValidFormat: function() { return /* binding */ check12ValidFormat; },
|
|
6177
|
+
/* harmony export */ check12ValidRange: function() { return /* binding */ check12ValidRange; }
|
|
5819
6178
|
/* harmony export */ });
|
|
5820
6179
|
/* harmony import */ var _common_validation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(449);
|
|
5821
6180
|
/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(797);
|
|
5822
|
-
/* harmony import */ var
|
|
6181
|
+
/* harmony import */ var _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(179);
|
|
5823
6182
|
|
|
5824
6183
|
|
|
5825
6184
|
|
|
5826
6185
|
function check12ValidFormat(value, regexPattern, allowEmptyString) {
|
|
5827
|
-
return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__
|
|
6186
|
+
return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__.checkValidFormat)(value, regexPattern, _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__.scorm12_errors.TYPE_MISMATCH, _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_1__.Scorm12ValidationError, allowEmptyString);
|
|
5828
6187
|
}
|
|
5829
6188
|
function check12ValidRange(value, rangePattern, allowEmptyString) {
|
|
5830
6189
|
if (!allowEmptyString && value === "") {
|
|
5831
|
-
throw new
|
|
6190
|
+
throw new _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_1__.Scorm12ValidationError(_constants_error_codes__WEBPACK_IMPORTED_MODULE_0__.scorm12_errors.VALUE_OUT_OF_RANGE);
|
|
5832
6191
|
}
|
|
5833
|
-
return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__
|
|
6192
|
+
return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__.checkValidRange)(value, rangePattern, _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__.scorm12_errors.VALUE_OUT_OF_RANGE, _exceptions_scorm12_exceptions__WEBPACK_IMPORTED_MODULE_1__.Scorm12ValidationError);
|
|
5834
6193
|
}
|
|
5835
6194
|
|
|
5836
6195
|
|
|
@@ -5839,16 +6198,23 @@ function check12ValidRange(value, rangePattern, allowEmptyString) {
|
|
|
5839
6198
|
/***/ 340:
|
|
5840
6199
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5841
6200
|
|
|
6201
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6202
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6203
|
+
/* harmony export */ aicc_constants: function() { return /* binding */ aicc_constants; },
|
|
6204
|
+
/* harmony export */ global_constants: function() { return /* binding */ global_constants; },
|
|
6205
|
+
/* harmony export */ scorm12_constants: function() { return /* binding */ scorm12_constants; },
|
|
6206
|
+
/* harmony export */ scorm2004_constants: function() { return /* binding */ scorm2004_constants; }
|
|
6207
|
+
/* harmony export */ });
|
|
5842
6208
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
5843
6209
|
|
|
5844
|
-
var
|
|
6210
|
+
var global_constants = {
|
|
5845
6211
|
SCORM_TRUE: "true",
|
|
5846
6212
|
SCORM_FALSE: "false",
|
|
5847
6213
|
STATE_NOT_INITIALIZED: 0,
|
|
5848
6214
|
STATE_INITIALIZED: 1,
|
|
5849
6215
|
STATE_TERMINATED: 2,
|
|
5850
6216
|
};
|
|
5851
|
-
var
|
|
6217
|
+
var scorm12_constants = {
|
|
5852
6218
|
cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",
|
|
5853
6219
|
core_children: "student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",
|
|
5854
6220
|
score_children: "raw,min,max",
|
|
@@ -5909,7 +6275,7 @@ var scorm12 = {
|
|
|
5909
6275
|
},
|
|
5910
6276
|
},
|
|
5911
6277
|
};
|
|
5912
|
-
var
|
|
6278
|
+
var aicc_constants = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, scorm12_constants), {
|
|
5913
6279
|
cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",
|
|
5914
6280
|
student_preference_children: "audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",
|
|
5915
6281
|
student_data_children: "attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",
|
|
@@ -5918,7 +6284,7 @@ var aicc = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__W
|
|
|
5918
6284
|
attempt_records_children: "score,lesson_status",
|
|
5919
6285
|
paths_children: "location_id,date,time,status,why_left,time_in_element",
|
|
5920
6286
|
});
|
|
5921
|
-
var
|
|
6287
|
+
var scorm2004_constants = {
|
|
5922
6288
|
cmi_children: "_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time",
|
|
5923
6289
|
comments_children: "comment,timestamp,location",
|
|
5924
6290
|
score_children: "max,raw,scaled,min",
|
|
@@ -5927,6 +6293,7 @@ var scorm2004 = {
|
|
|
5927
6293
|
student_data_children: "mastery_score,max_time_allowed,time_limit_action",
|
|
5928
6294
|
student_preference_children: "audio_level,audio_captioning,delivery_speed,language",
|
|
5929
6295
|
interactions_children: "id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",
|
|
6296
|
+
adl_data_children: "id,store",
|
|
5930
6297
|
error_descriptions: {
|
|
5931
6298
|
"0": {
|
|
5932
6299
|
basicMessage: "No Error",
|
|
@@ -6034,13 +6401,6 @@ var scorm2004 = {
|
|
|
6034
6401
|
},
|
|
6035
6402
|
},
|
|
6036
6403
|
};
|
|
6037
|
-
var APIConstants = {
|
|
6038
|
-
global: global,
|
|
6039
|
-
scorm12: scorm12,
|
|
6040
|
-
aicc: aicc,
|
|
6041
|
-
scorm2004: scorm2004,
|
|
6042
|
-
};
|
|
6043
|
-
/* harmony default export */ __webpack_exports__.A = (APIConstants);
|
|
6044
6404
|
|
|
6045
6405
|
|
|
6046
6406
|
/***/ }),
|
|
@@ -6048,11 +6408,12 @@ var APIConstants = {
|
|
|
6048
6408
|
/***/ 56:
|
|
6049
6409
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6050
6410
|
|
|
6411
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6051
6412
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6052
|
-
/* harmony export */
|
|
6053
|
-
/* harmony export */
|
|
6054
|
-
/* harmony export */
|
|
6055
|
-
/* harmony export */
|
|
6413
|
+
/* harmony export */ CompletionStatus: function() { return /* binding */ CompletionStatus; },
|
|
6414
|
+
/* harmony export */ LogLevelEnum: function() { return /* binding */ LogLevelEnum; },
|
|
6415
|
+
/* harmony export */ NAVBoolean: function() { return /* binding */ NAVBoolean; },
|
|
6416
|
+
/* harmony export */ SuccessStatus: function() { return /* binding */ SuccessStatus; }
|
|
6056
6417
|
/* harmony export */ });
|
|
6057
6418
|
var NAVBoolean;
|
|
6058
6419
|
(function (NAVBoolean) {
|
|
@@ -6088,9 +6449,15 @@ var LogLevelEnum;
|
|
|
6088
6449
|
/***/ 797:
|
|
6089
6450
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6090
6451
|
|
|
6452
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6453
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6454
|
+
/* harmony export */ global_errors: function() { return /* binding */ global_errors; },
|
|
6455
|
+
/* harmony export */ scorm12_errors: function() { return /* binding */ scorm12_errors; },
|
|
6456
|
+
/* harmony export */ scorm2004_errors: function() { return /* binding */ scorm2004_errors; }
|
|
6457
|
+
/* harmony export */ });
|
|
6091
6458
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
6092
6459
|
|
|
6093
|
-
var
|
|
6460
|
+
var global_errors = {
|
|
6094
6461
|
GENERAL: 101,
|
|
6095
6462
|
INITIALIZATION_FAILED: 101,
|
|
6096
6463
|
INITIALIZED: 101,
|
|
@@ -6120,13 +6487,8 @@ var global = {
|
|
|
6120
6487
|
VALUE_OUT_OF_RANGE: 101,
|
|
6121
6488
|
DEPENDENCY_NOT_ESTABLISHED: 101,
|
|
6122
6489
|
};
|
|
6123
|
-
var
|
|
6124
|
-
var
|
|
6125
|
-
var ErrorCodes = {
|
|
6126
|
-
scorm12: scorm12,
|
|
6127
|
-
scorm2004: scorm2004,
|
|
6128
|
-
};
|
|
6129
|
-
/* harmony default export */ __webpack_exports__.A = (ErrorCodes);
|
|
6490
|
+
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 });
|
|
6491
|
+
var scorm2004_errors = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, global_errors), { INITIALIZATION_FAILED: 102, INITIALIZED: 103, TERMINATED: 104, TERMINATION_FAILURE: 111, TERMINATION_BEFORE_INIT: 112, MULTIPLE_TERMINATIONS: 113, RETRIEVE_BEFORE_INIT: 122, RETRIEVE_AFTER_TERM: 123, STORE_BEFORE_INIT: 132, STORE_AFTER_TERM: 133, COMMIT_BEFORE_INIT: 142, COMMIT_AFTER_TERM: 143, ARGUMENT_ERROR: 201, GENERAL_GET_FAILURE: 301, GENERAL_SET_FAILURE: 351, GENERAL_COMMIT_FAILURE: 391, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 402, VALUE_NOT_INITIALIZED: 403, READ_ONLY_ELEMENT: 404, WRITE_ONLY_ELEMENT: 405, TYPE_MISMATCH: 406, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 });
|
|
6130
6492
|
|
|
6131
6493
|
|
|
6132
6494
|
/***/ }),
|
|
@@ -6134,9 +6496,15 @@ var ErrorCodes = {
|
|
|
6134
6496
|
/***/ 417:
|
|
6135
6497
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6136
6498
|
|
|
6499
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6500
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6501
|
+
/* harmony export */ aicc_regex: function() { return /* binding */ aicc_regex; },
|
|
6502
|
+
/* harmony export */ scorm12_regex: function() { return /* binding */ scorm12_regex; },
|
|
6503
|
+
/* harmony export */ scorm2004_regex: function() { return /* binding */ scorm2004_regex; }
|
|
6504
|
+
/* harmony export */ });
|
|
6137
6505
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
6138
6506
|
|
|
6139
|
-
var
|
|
6507
|
+
var scorm12_regex = {
|
|
6140
6508
|
CMIString256: "^.{0,255}$",
|
|
6141
6509
|
CMIString4096: "^.{0,4096}$",
|
|
6142
6510
|
CMITime: "^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",
|
|
@@ -6159,10 +6527,10 @@ var scorm12 = {
|
|
|
6159
6527
|
weighting_range: "-100#100",
|
|
6160
6528
|
text_range: "-1#1",
|
|
6161
6529
|
};
|
|
6162
|
-
var
|
|
6530
|
+
var aicc_regex = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, scorm12_regex), {
|
|
6163
6531
|
CMIIdentifier: "^\\w{1,255}$",
|
|
6164
6532
|
});
|
|
6165
|
-
var
|
|
6533
|
+
var scorm2004_regex = {
|
|
6166
6534
|
CMIString200: "^[\\u0000-\\uFFFF]{0,200}$",
|
|
6167
6535
|
CMIString250: "^[\\u0000-\\uFFFF]{0,250}$",
|
|
6168
6536
|
CMIString1000: "^[\\u0000-\\uFFFF]{0,1000}$",
|
|
@@ -6198,12 +6566,6 @@ var scorm2004 = {
|
|
|
6198
6566
|
text_range: "-1#1",
|
|
6199
6567
|
progress_range: "0#1",
|
|
6200
6568
|
};
|
|
6201
|
-
var Regex = {
|
|
6202
|
-
aicc: aicc,
|
|
6203
|
-
scorm12: scorm12,
|
|
6204
|
-
scorm2004: scorm2004,
|
|
6205
|
-
};
|
|
6206
|
-
/* harmony default export */ __webpack_exports__.A = (Regex);
|
|
6207
6569
|
|
|
6208
6570
|
|
|
6209
6571
|
/***/ }),
|
|
@@ -6211,22 +6573,15 @@ var Regex = {
|
|
|
6211
6573
|
/***/ 784:
|
|
6212
6574
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6213
6575
|
|
|
6576
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6214
6577
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6215
|
-
/* harmony export */
|
|
6216
|
-
/* harmony export */
|
|
6217
|
-
/* harmony export */ tQ: function() { return /* binding */ Scorm12ValidationError; },
|
|
6218
|
-
/* harmony export */ wq: function() { return /* binding */ Scorm2004ValidationError; },
|
|
6219
|
-
/* harmony export */ yI: function() { return /* binding */ ValidationError; }
|
|
6578
|
+
/* harmony export */ BaseScormValidationError: function() { return /* binding */ BaseScormValidationError; },
|
|
6579
|
+
/* harmony export */ ValidationError: function() { return /* binding */ ValidationError; }
|
|
6220
6580
|
/* harmony export */ });
|
|
6221
|
-
/* harmony import */ var
|
|
6222
|
-
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340);
|
|
6223
|
-
|
|
6581
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635);
|
|
6224
6582
|
|
|
6225
|
-
var scorm12_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.error_descriptions;
|
|
6226
|
-
var aicc_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.aicc.error_descriptions;
|
|
6227
|
-
var scorm2004_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm2004.error_descriptions;
|
|
6228
6583
|
var BaseScormValidationError = (function (_super) {
|
|
6229
|
-
(0,
|
|
6584
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(BaseScormValidationError, _super);
|
|
6230
6585
|
function BaseScormValidationError(errorCode) {
|
|
6231
6586
|
var _this = _super.call(this, errorCode.toString()) || this;
|
|
6232
6587
|
_this._errorCode = errorCode;
|
|
@@ -6244,7 +6599,7 @@ var BaseScormValidationError = (function (_super) {
|
|
|
6244
6599
|
}(Error));
|
|
6245
6600
|
|
|
6246
6601
|
var ValidationError = (function (_super) {
|
|
6247
|
-
(0,
|
|
6602
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(ValidationError, _super);
|
|
6248
6603
|
function ValidationError(errorCode, errorMessage, detailedMessage) {
|
|
6249
6604
|
var _this = _super.call(this, errorCode) || this;
|
|
6250
6605
|
_this._detailedMessage = "";
|
|
@@ -6272,8 +6627,26 @@ var ValidationError = (function (_super) {
|
|
|
6272
6627
|
return ValidationError;
|
|
6273
6628
|
}(BaseScormValidationError));
|
|
6274
6629
|
|
|
6630
|
+
|
|
6631
|
+
|
|
6632
|
+
/***/ }),
|
|
6633
|
+
|
|
6634
|
+
/***/ 179:
|
|
6635
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6636
|
+
|
|
6637
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6638
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6639
|
+
/* harmony export */ Scorm12ValidationError: function() { return /* binding */ Scorm12ValidationError; }
|
|
6640
|
+
/* harmony export */ });
|
|
6641
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(635);
|
|
6642
|
+
/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(784);
|
|
6643
|
+
/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340);
|
|
6644
|
+
|
|
6645
|
+
|
|
6646
|
+
|
|
6647
|
+
var scorm12_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__.scorm12_constants.error_descriptions;
|
|
6275
6648
|
var Scorm12ValidationError = (function (_super) {
|
|
6276
|
-
(0,
|
|
6649
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_2__.__extends)(Scorm12ValidationError, _super);
|
|
6277
6650
|
function Scorm12ValidationError(errorCode) {
|
|
6278
6651
|
var _this = this;
|
|
6279
6652
|
if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {
|
|
@@ -6285,37 +6658,7 @@ var Scorm12ValidationError = (function (_super) {
|
|
|
6285
6658
|
return _this;
|
|
6286
6659
|
}
|
|
6287
6660
|
return Scorm12ValidationError;
|
|
6288
|
-
}(ValidationError));
|
|
6289
|
-
|
|
6290
|
-
var AICCValidationError = (function (_super) {
|
|
6291
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(AICCValidationError, _super);
|
|
6292
|
-
function AICCValidationError(errorCode) {
|
|
6293
|
-
var _this = this;
|
|
6294
|
-
if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {
|
|
6295
|
-
_this = _super.call(this, errorCode, aicc_errors[String(errorCode)].basicMessage, aicc_errors[String(errorCode)].detailMessage) || this;
|
|
6296
|
-
}
|
|
6297
|
-
else {
|
|
6298
|
-
_this = _super.call(this, 101, aicc_errors["101"].basicMessage, aicc_errors["101"].detailMessage) || this;
|
|
6299
|
-
}
|
|
6300
|
-
return _this;
|
|
6301
|
-
}
|
|
6302
|
-
return AICCValidationError;
|
|
6303
|
-
}(ValidationError));
|
|
6304
|
-
|
|
6305
|
-
var Scorm2004ValidationError = (function (_super) {
|
|
6306
|
-
(0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(Scorm2004ValidationError, _super);
|
|
6307
|
-
function Scorm2004ValidationError(errorCode) {
|
|
6308
|
-
var _this = this;
|
|
6309
|
-
if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {
|
|
6310
|
-
_this = _super.call(this, errorCode, scorm2004_errors[String(errorCode)].basicMessage, scorm2004_errors[String(errorCode)].detailMessage) || this;
|
|
6311
|
-
}
|
|
6312
|
-
else {
|
|
6313
|
-
_this = _super.call(this, 101, scorm2004_errors["101"].basicMessage, scorm2004_errors["101"].detailMessage) || this;
|
|
6314
|
-
}
|
|
6315
|
-
return _this;
|
|
6316
|
-
}
|
|
6317
|
-
return Scorm2004ValidationError;
|
|
6318
|
-
}(ValidationError));
|
|
6661
|
+
}(_exceptions__WEBPACK_IMPORTED_MODULE_0__.ValidationError));
|
|
6319
6662
|
|
|
6320
6663
|
|
|
6321
6664
|
|
|
@@ -6324,19 +6667,24 @@ var Scorm2004ValidationError = (function (_super) {
|
|
|
6324
6667
|
/***/ 864:
|
|
6325
6668
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6326
6669
|
|
|
6670
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6327
6671
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6328
|
-
/* harmony export */
|
|
6329
|
-
/* harmony export */
|
|
6330
|
-
/* harmony export */
|
|
6331
|
-
/* harmony export */
|
|
6332
|
-
/* harmony export */
|
|
6333
|
-
/* harmony export */
|
|
6334
|
-
/* harmony export */
|
|
6335
|
-
/* harmony export */
|
|
6336
|
-
/* harmony export */
|
|
6337
|
-
/* harmony export */
|
|
6672
|
+
/* harmony export */ SECONDS_PER_DAY: function() { return /* binding */ SECONDS_PER_DAY; },
|
|
6673
|
+
/* harmony export */ SECONDS_PER_HOUR: function() { return /* binding */ SECONDS_PER_HOUR; },
|
|
6674
|
+
/* harmony export */ SECONDS_PER_MINUTE: function() { return /* binding */ SECONDS_PER_MINUTE; },
|
|
6675
|
+
/* harmony export */ SECONDS_PER_SECOND: function() { return /* binding */ SECONDS_PER_SECOND; },
|
|
6676
|
+
/* harmony export */ addHHMMSSTimeStrings: function() { return /* binding */ addHHMMSSTimeStrings; },
|
|
6677
|
+
/* harmony export */ addTwoDurations: function() { return /* binding */ addTwoDurations; },
|
|
6678
|
+
/* harmony export */ countDecimals: function() { return /* binding */ countDecimals; },
|
|
6679
|
+
/* harmony export */ flatten: function() { return /* binding */ flatten; },
|
|
6680
|
+
/* harmony export */ formatMessage: function() { return /* binding */ formatMessage; },
|
|
6681
|
+
/* harmony export */ getDurationAsSeconds: function() { return /* binding */ getDurationAsSeconds; },
|
|
6682
|
+
/* harmony export */ getSecondsAsHHMMSS: function() { return /* binding */ getSecondsAsHHMMSS; },
|
|
6683
|
+
/* harmony export */ getSecondsAsISODuration: function() { return /* binding */ getSecondsAsISODuration; },
|
|
6684
|
+
/* harmony export */ getTimeAsSeconds: function() { return /* binding */ getTimeAsSeconds; },
|
|
6685
|
+
/* harmony export */ stringMatches: function() { return /* binding */ stringMatches; },
|
|
6686
|
+
/* harmony export */ unflatten: function() { return /* binding */ unflatten; }
|
|
6338
6687
|
/* harmony export */ });
|
|
6339
|
-
/* unused harmony exports SECONDS_PER_SECOND, SECONDS_PER_MINUTE, SECONDS_PER_HOUR, SECONDS_PER_DAY, countDecimals */
|
|
6340
6688
|
var SECONDS_PER_SECOND = 1.0;
|
|
6341
6689
|
var SECONDS_PER_MINUTE = 60;
|
|
6342
6690
|
var SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;
|
|
@@ -6528,13 +6876,40 @@ function stringMatches(str, tester) {
|
|
|
6528
6876
|
/***/ 635:
|
|
6529
6877
|
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
6530
6878
|
|
|
6879
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6531
6880
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6532
|
-
/* harmony export */
|
|
6533
|
-
/* harmony export */
|
|
6534
|
-
/* harmony export */
|
|
6535
|
-
/* harmony export */
|
|
6881
|
+
/* harmony export */ __addDisposableResource: function() { return /* binding */ __addDisposableResource; },
|
|
6882
|
+
/* harmony export */ __assign: function() { return /* binding */ __assign; },
|
|
6883
|
+
/* harmony export */ __asyncDelegator: function() { return /* binding */ __asyncDelegator; },
|
|
6884
|
+
/* harmony export */ __asyncGenerator: function() { return /* binding */ __asyncGenerator; },
|
|
6885
|
+
/* harmony export */ __asyncValues: function() { return /* binding */ __asyncValues; },
|
|
6886
|
+
/* harmony export */ __await: function() { return /* binding */ __await; },
|
|
6887
|
+
/* harmony export */ __awaiter: function() { return /* binding */ __awaiter; },
|
|
6888
|
+
/* harmony export */ __classPrivateFieldGet: function() { return /* binding */ __classPrivateFieldGet; },
|
|
6889
|
+
/* harmony export */ __classPrivateFieldIn: function() { return /* binding */ __classPrivateFieldIn; },
|
|
6890
|
+
/* harmony export */ __classPrivateFieldSet: function() { return /* binding */ __classPrivateFieldSet; },
|
|
6891
|
+
/* harmony export */ __createBinding: function() { return /* binding */ __createBinding; },
|
|
6892
|
+
/* harmony export */ __decorate: function() { return /* binding */ __decorate; },
|
|
6893
|
+
/* harmony export */ __disposeResources: function() { return /* binding */ __disposeResources; },
|
|
6894
|
+
/* harmony export */ __esDecorate: function() { return /* binding */ __esDecorate; },
|
|
6895
|
+
/* harmony export */ __exportStar: function() { return /* binding */ __exportStar; },
|
|
6896
|
+
/* harmony export */ __extends: function() { return /* binding */ __extends; },
|
|
6897
|
+
/* harmony export */ __generator: function() { return /* binding */ __generator; },
|
|
6898
|
+
/* harmony export */ __importDefault: function() { return /* binding */ __importDefault; },
|
|
6899
|
+
/* harmony export */ __importStar: function() { return /* binding */ __importStar; },
|
|
6900
|
+
/* harmony export */ __makeTemplateObject: function() { return /* binding */ __makeTemplateObject; },
|
|
6901
|
+
/* harmony export */ __metadata: function() { return /* binding */ __metadata; },
|
|
6902
|
+
/* harmony export */ __param: function() { return /* binding */ __param; },
|
|
6903
|
+
/* harmony export */ __propKey: function() { return /* binding */ __propKey; },
|
|
6904
|
+
/* harmony export */ __read: function() { return /* binding */ __read; },
|
|
6905
|
+
/* harmony export */ __rest: function() { return /* binding */ __rest; },
|
|
6906
|
+
/* harmony export */ __runInitializers: function() { return /* binding */ __runInitializers; },
|
|
6907
|
+
/* harmony export */ __setFunctionName: function() { return /* binding */ __setFunctionName; },
|
|
6908
|
+
/* harmony export */ __spread: function() { return /* binding */ __spread; },
|
|
6909
|
+
/* harmony export */ __spreadArray: function() { return /* binding */ __spreadArray; },
|
|
6910
|
+
/* harmony export */ __spreadArrays: function() { return /* binding */ __spreadArrays; },
|
|
6911
|
+
/* harmony export */ __values: function() { return /* binding */ __values; }
|
|
6536
6912
|
/* harmony export */ });
|
|
6537
|
-
/* unused harmony exports __rest, __decorate, __param, __esDecorate, __runInitializers, __propKey, __setFunctionName, __metadata, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn, __addDisposableResource, __disposeResources */
|
|
6538
6913
|
/******************************************************************************
|
|
6539
6914
|
Copyright (c) Microsoft Corporation.
|
|
6540
6915
|
|
|
@@ -6884,7 +7259,7 @@ function __disposeResources(env) {
|
|
|
6884
7259
|
return next();
|
|
6885
7260
|
}
|
|
6886
7261
|
|
|
6887
|
-
/*
|
|
7262
|
+
/* harmony default export */ __webpack_exports__["default"] = ({
|
|
6888
7263
|
__extends,
|
|
6889
7264
|
__assign,
|
|
6890
7265
|
__rest,
|
|
@@ -6976,23 +7351,20 @@ function __disposeResources(env) {
|
|
|
6976
7351
|
var __webpack_exports__ = {};
|
|
6977
7352
|
__webpack_require__.r(__webpack_exports__);
|
|
6978
7353
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6979
|
-
/* harmony export */ AICC: function() { return /*
|
|
6980
|
-
/* harmony export */ Scorm12API: function() { return /*
|
|
6981
|
-
/* harmony export */ Scorm2004API: function() { return /*
|
|
7354
|
+
/* harmony export */ AICC: function() { return /* reexport safe */ _AICC__WEBPACK_IMPORTED_MODULE_0__.AICC; },
|
|
7355
|
+
/* harmony export */ Scorm12API: function() { return /* reexport safe */ _Scorm12API__WEBPACK_IMPORTED_MODULE_1__.Scorm12API; },
|
|
7356
|
+
/* harmony export */ Scorm2004API: function() { return /* reexport safe */ _Scorm2004API__WEBPACK_IMPORTED_MODULE_2__.Scorm2004API; }
|
|
6982
7357
|
/* harmony export */ });
|
|
6983
|
-
/* harmony import */ var _AICC__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
7358
|
+
/* harmony import */ var _AICC__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(916);
|
|
6984
7359
|
/* harmony import */ var _Scorm12API__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(941);
|
|
6985
|
-
/* harmony import */ var _Scorm2004API__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
7360
|
+
/* harmony import */ var _Scorm2004API__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(809);
|
|
6986
7361
|
|
|
6987
7362
|
|
|
6988
7363
|
|
|
6989
|
-
var Scorm12API = _Scorm12API__WEBPACK_IMPORTED_MODULE_1__.Scorm12Impl;
|
|
6990
|
-
var Scorm2004API = _Scorm2004API__WEBPACK_IMPORTED_MODULE_2__.Scorm2004Impl;
|
|
6991
|
-
var AICC = _AICC__WEBPACK_IMPORTED_MODULE_0__.AICCImpl;
|
|
6992
7364
|
|
|
6993
7365
|
|
|
6994
|
-
var __webpack_export_target__ =
|
|
6995
|
-
for(var
|
|
7366
|
+
var __webpack_export_target__ = window;
|
|
7367
|
+
for(var __webpack_i__ in __webpack_exports__) __webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
6996
7368
|
if(__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, "__esModule", { value: true });
|
|
6997
7369
|
/******/ })()
|
|
6998
7370
|
;
|