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