scorm-again 2.4.1 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -23
- package/dist/aicc.js +55 -35
- 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 +55 -35
- 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 +68 -42
- 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 +55 -35
- 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 +68 -42
- 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 +68 -42
- 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 +55 -35
- 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 +68 -42
- package/dist/scorm2004.js.map +1 -1
- package/dist/scorm2004.min.js +1 -1
- package/dist/scorm2004.min.js.map +1 -1
- package/package.json +4 -4
- package/src/BaseAPI.ts +27 -65
- package/src/Scorm2004API.ts +8 -4
- package/src/constants/api_constants.ts +0 -10
- package/src/constants/default_settings.ts +20 -7
- package/src/constants/enums.ts +9 -0
- package/src/constants/regex.ts +1 -1
- package/src/exceptions.ts +1 -5
- package/src/types/api_types.ts +26 -3
- package/test/types/api_types.spec.ts +38 -45
package/dist/esm/scorm2004.js
CHANGED
|
@@ -21,9 +21,12 @@ var error_codes = __webpack_require__(797);
|
|
|
21
21
|
var api_constants = __webpack_require__(340);
|
|
22
22
|
// EXTERNAL MODULE: ./src/utilities.ts
|
|
23
23
|
var utilities = __webpack_require__(864);
|
|
24
|
+
// EXTERNAL MODULE: ./src/constants/enums.ts
|
|
25
|
+
var enums = __webpack_require__(56);
|
|
24
26
|
;// ./src/constants/default_settings.ts
|
|
25
27
|
|
|
26
28
|
|
|
29
|
+
|
|
27
30
|
var DefaultSettings = {
|
|
28
31
|
autocommit: false,
|
|
29
32
|
autocommitSeconds: 10,
|
|
@@ -33,7 +36,7 @@ var DefaultSettings = {
|
|
|
33
36
|
dataCommitFormat: "json",
|
|
34
37
|
commitRequestDataType: "application/json;charset=UTF-8",
|
|
35
38
|
autoProgress: false,
|
|
36
|
-
logLevel:
|
|
39
|
+
logLevel: enums/* LogLevelEnum */.Mb.ERROR,
|
|
37
40
|
selfReportSessionTime: false,
|
|
38
41
|
alwaysSendTotalTime: false,
|
|
39
42
|
renderCommonCommitFields: false,
|
|
@@ -94,16 +97,28 @@ var DefaultSettings = {
|
|
|
94
97
|
},
|
|
95
98
|
onLogMessage: function (messageLevel, logMessage) {
|
|
96
99
|
switch (messageLevel) {
|
|
97
|
-
case
|
|
100
|
+
case "4":
|
|
101
|
+
case 4:
|
|
102
|
+
case "ERROR":
|
|
103
|
+
case enums/* LogLevelEnum */.Mb.ERROR:
|
|
98
104
|
console.error(logMessage);
|
|
99
105
|
break;
|
|
100
|
-
case
|
|
106
|
+
case "3":
|
|
107
|
+
case 3:
|
|
108
|
+
case "WARN":
|
|
109
|
+
case enums/* LogLevelEnum */.Mb.WARN:
|
|
101
110
|
console.warn(logMessage);
|
|
102
111
|
break;
|
|
103
|
-
case
|
|
112
|
+
case "2":
|
|
113
|
+
case 2:
|
|
114
|
+
case "INFO":
|
|
115
|
+
case enums/* LogLevelEnum */.Mb.INFO:
|
|
104
116
|
console.info(logMessage);
|
|
105
117
|
break;
|
|
106
|
-
case
|
|
118
|
+
case "1":
|
|
119
|
+
case 1:
|
|
120
|
+
case "DEBUG":
|
|
121
|
+
case enums/* LogLevelEnum */.Mb.DEBUG:
|
|
107
122
|
if (console.debug) {
|
|
108
123
|
console.debug(logMessage);
|
|
109
124
|
}
|
|
@@ -156,6 +171,7 @@ var ScheduledCommit = (function () {
|
|
|
156
171
|
|
|
157
172
|
|
|
158
173
|
|
|
174
|
+
|
|
159
175
|
var BaseAPI = (function () {
|
|
160
176
|
function BaseAPI(error_codes, settings) {
|
|
161
177
|
var _newTarget = this.constructor;
|
|
@@ -172,6 +188,9 @@ var BaseAPI = (function () {
|
|
|
172
188
|
}
|
|
173
189
|
this.apiLogLevel = this.settings.logLevel;
|
|
174
190
|
this.selfReportSessionTime = this.settings.selfReportSessionTime;
|
|
191
|
+
if (this.apiLogLevel === undefined) {
|
|
192
|
+
this.apiLogLevel = enums/* LogLevelEnum */.Mb.NONE;
|
|
193
|
+
}
|
|
175
194
|
}
|
|
176
195
|
BaseAPI.prototype.commonReset = function (settings) {
|
|
177
196
|
this.settings = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, this.settings), settings);
|
|
@@ -196,7 +215,7 @@ var BaseAPI = (function () {
|
|
|
196
215
|
returnValue = api_constants/* default */.A.global.SCORM_TRUE;
|
|
197
216
|
this.processListeners(callbackName);
|
|
198
217
|
}
|
|
199
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
218
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums/* LogLevelEnum */.Mb.INFO);
|
|
200
219
|
this.clearSCORMError(returnValue);
|
|
201
220
|
return returnValue;
|
|
202
221
|
};
|
|
@@ -248,7 +267,7 @@ var BaseAPI = (function () {
|
|
|
248
267
|
this.processListeners(callbackName);
|
|
249
268
|
_a.label = 2;
|
|
250
269
|
case 2:
|
|
251
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
270
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums/* LogLevelEnum */.Mb.INFO);
|
|
252
271
|
this.clearSCORMError(returnValue);
|
|
253
272
|
return [2, returnValue];
|
|
254
273
|
}
|
|
@@ -268,7 +287,7 @@ var BaseAPI = (function () {
|
|
|
268
287
|
}
|
|
269
288
|
this.processListeners(callbackName, CMIElement);
|
|
270
289
|
}
|
|
271
|
-
this.apiLog(callbackName, ": returned: " + returnValue,
|
|
290
|
+
this.apiLog(callbackName, ": returned: " + returnValue, enums/* LogLevelEnum */.Mb.INFO, CMIElement);
|
|
272
291
|
if (returnValue === undefined) {
|
|
273
292
|
return "";
|
|
274
293
|
}
|
|
@@ -299,7 +318,7 @@ var BaseAPI = (function () {
|
|
|
299
318
|
this.scheduleCommit(this.settings.autocommitSeconds * 1000, commitCallback);
|
|
300
319
|
}
|
|
301
320
|
}
|
|
302
|
-
this.apiLog(callbackName, ": " + value + ": result: " + returnValue,
|
|
321
|
+
this.apiLog(callbackName, ": " + value + ": result: " + returnValue, enums/* LogLevelEnum */.Mb.INFO, CMIElement);
|
|
303
322
|
this.clearSCORMError(returnValue);
|
|
304
323
|
return returnValue;
|
|
305
324
|
};
|
|
@@ -310,7 +329,6 @@ var BaseAPI = (function () {
|
|
|
310
329
|
return (0,tslib_es6/* __generator */.YH)(this, function (_a) {
|
|
311
330
|
switch (_a.label) {
|
|
312
331
|
case 0:
|
|
313
|
-
console.log("commit");
|
|
314
332
|
this.clearScheduledCommit();
|
|
315
333
|
returnValue = api_constants/* default */.A.global.SCORM_FALSE;
|
|
316
334
|
if (!this.checkState(checkTerminated, this._error_codes.COMMIT_BEFORE_INIT, this._error_codes.COMMIT_AFTER_TERM)) return [3, 2];
|
|
@@ -324,13 +342,13 @@ var BaseAPI = (function () {
|
|
|
324
342
|
typeof result !== "undefined" && result.result
|
|
325
343
|
? result.result
|
|
326
344
|
: api_constants/* default */.A.global.SCORM_FALSE;
|
|
327
|
-
this.apiLog(callbackName, " Result: " + returnValue,
|
|
345
|
+
this.apiLog(callbackName, " Result: " + returnValue, enums/* LogLevelEnum */.Mb.DEBUG, "HttpRequest");
|
|
328
346
|
if (checkTerminated)
|
|
329
347
|
this.lastErrorCode = "0";
|
|
330
348
|
this.processListeners(callbackName);
|
|
331
349
|
_a.label = 2;
|
|
332
350
|
case 2:
|
|
333
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
351
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums/* LogLevelEnum */.Mb.INFO);
|
|
334
352
|
this.clearSCORMError(returnValue);
|
|
335
353
|
return [2, returnValue];
|
|
336
354
|
}
|
|
@@ -340,7 +358,7 @@ var BaseAPI = (function () {
|
|
|
340
358
|
BaseAPI.prototype.getLastError = function (callbackName) {
|
|
341
359
|
var returnValue = String(this.lastErrorCode);
|
|
342
360
|
this.processListeners(callbackName);
|
|
343
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
361
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums/* LogLevelEnum */.Mb.INFO);
|
|
344
362
|
return returnValue;
|
|
345
363
|
};
|
|
346
364
|
BaseAPI.prototype.getErrorString = function (callbackName, CMIErrorCode) {
|
|
@@ -349,7 +367,7 @@ var BaseAPI = (function () {
|
|
|
349
367
|
returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);
|
|
350
368
|
this.processListeners(callbackName);
|
|
351
369
|
}
|
|
352
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
370
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums/* LogLevelEnum */.Mb.INFO);
|
|
353
371
|
return returnValue;
|
|
354
372
|
};
|
|
355
373
|
BaseAPI.prototype.getDiagnostic = function (callbackName, CMIErrorCode) {
|
|
@@ -358,7 +376,7 @@ var BaseAPI = (function () {
|
|
|
358
376
|
returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);
|
|
359
377
|
this.processListeners(callbackName);
|
|
360
378
|
}
|
|
361
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
379
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums/* LogLevelEnum */.Mb.INFO);
|
|
362
380
|
return returnValue;
|
|
363
381
|
};
|
|
364
382
|
BaseAPI.prototype.checkState = function (checkTerminated, beforeInitError, afterTermError) {
|
|
@@ -452,7 +470,7 @@ var BaseAPI = (function () {
|
|
|
452
470
|
}
|
|
453
471
|
}
|
|
454
472
|
if (returnValue === api_constants/* default */.A.global.SCORM_FALSE) {
|
|
455
|
-
this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value),
|
|
473
|
+
this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value), enums/* LogLevelEnum */.Mb.WARN);
|
|
456
474
|
}
|
|
457
475
|
return returnValue;
|
|
458
476
|
};
|
|
@@ -550,7 +568,7 @@ var BaseAPI = (function () {
|
|
|
550
568
|
CMIElement: CMIElement,
|
|
551
569
|
callback: callback,
|
|
552
570
|
});
|
|
553
|
-
this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length),
|
|
571
|
+
this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), enums/* LogLevelEnum */.Mb.INFO, functionName);
|
|
554
572
|
}
|
|
555
573
|
};
|
|
556
574
|
BaseAPI.prototype.off = function (listenerName, callback) {
|
|
@@ -573,7 +591,7 @@ var BaseAPI = (function () {
|
|
|
573
591
|
});
|
|
574
592
|
if (removeIndex !== -1) {
|
|
575
593
|
this_1.listenerArray.splice(removeIndex, 1);
|
|
576
|
-
this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length),
|
|
594
|
+
this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), enums/* LogLevelEnum */.Mb.INFO, functionName);
|
|
577
595
|
}
|
|
578
596
|
};
|
|
579
597
|
var this_1 = this;
|
|
@@ -606,7 +624,7 @@ var BaseAPI = (function () {
|
|
|
606
624
|
}
|
|
607
625
|
};
|
|
608
626
|
BaseAPI.prototype.processListeners = function (functionName, CMIElement, value) {
|
|
609
|
-
this.apiLog(functionName, value,
|
|
627
|
+
this.apiLog(functionName, value, enums/* LogLevelEnum */.Mb.INFO, CMIElement);
|
|
610
628
|
for (var i = 0; i < this.listenerArray.length; i++) {
|
|
611
629
|
var listener = this.listenerArray[i];
|
|
612
630
|
var functionsMatch = listener.functionName === functionName;
|
|
@@ -622,7 +640,7 @@ var BaseAPI = (function () {
|
|
|
622
640
|
CMIElementsMatch = listener.CMIElement === CMIElement;
|
|
623
641
|
}
|
|
624
642
|
if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {
|
|
625
|
-
this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName),
|
|
643
|
+
this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), enums/* LogLevelEnum */.Mb.INFO, CMIElement);
|
|
626
644
|
listener.callback(CMIElement, value);
|
|
627
645
|
}
|
|
628
646
|
}
|
|
@@ -631,7 +649,7 @@ var BaseAPI = (function () {
|
|
|
631
649
|
if (!message) {
|
|
632
650
|
message = this.getLmsErrorMessageDetails(errorNumber);
|
|
633
651
|
}
|
|
634
|
-
this.apiLog("throwSCORMError", errorNumber + ": " + message,
|
|
652
|
+
this.apiLog("throwSCORMError", errorNumber + ": " + message, enums/* LogLevelEnum */.Mb.ERROR);
|
|
635
653
|
this.lastErrorCode = String(errorNumber);
|
|
636
654
|
};
|
|
637
655
|
BaseAPI.prototype.clearSCORMError = function (success) {
|
|
@@ -782,7 +800,7 @@ var BaseAPI = (function () {
|
|
|
782
800
|
return [2, this.transformResponse(response)];
|
|
783
801
|
case 2:
|
|
784
802
|
e_1 = _a.sent();
|
|
785
|
-
this.apiLog("processHttpRequest", e_1,
|
|
803
|
+
this.apiLog("processHttpRequest", e_1, enums/* LogLevelEnum */.Mb.ERROR);
|
|
786
804
|
api.processListeners("CommitError");
|
|
787
805
|
return [2, genericError];
|
|
788
806
|
case 3: return [2];
|
|
@@ -798,14 +816,14 @@ var BaseAPI = (function () {
|
|
|
798
816
|
BaseAPI.prototype.scheduleCommit = function (when, callback) {
|
|
799
817
|
if (!this._timeout) {
|
|
800
818
|
this._timeout = new ScheduledCommit(this, when, callback);
|
|
801
|
-
this.apiLog("scheduleCommit", "scheduled",
|
|
819
|
+
this.apiLog("scheduleCommit", "scheduled", enums/* LogLevelEnum */.Mb.DEBUG, "");
|
|
802
820
|
}
|
|
803
821
|
};
|
|
804
822
|
BaseAPI.prototype.clearScheduledCommit = function () {
|
|
805
823
|
if (this._timeout) {
|
|
806
824
|
this._timeout.cancel();
|
|
807
825
|
this._timeout = undefined;
|
|
808
|
-
this.apiLog("clearScheduledCommit", "cleared",
|
|
826
|
+
this.apiLog("clearScheduledCommit", "cleared", enums/* LogLevelEnum */.Mb.DEBUG, "");
|
|
809
827
|
}
|
|
810
828
|
};
|
|
811
829
|
BaseAPI.prototype._checkObjectHasProperty = function (refObject, attribute) {
|
|
@@ -834,7 +852,7 @@ var BaseAPI = (function () {
|
|
|
834
852
|
var commitObject = this.settings.renderCommonCommitFields
|
|
835
853
|
? this.renderCommitObject(shouldTerminateCommit)
|
|
836
854
|
: this.renderCommitCMI(shouldTerminateCommit);
|
|
837
|
-
if (
|
|
855
|
+
if ([enums/* LogLevelEnum */.Mb.DEBUG, "1", 1, "DEBUG"].includes(this.apiLogLevel)) {
|
|
838
856
|
console.debug("Commit (terminated: " + (terminateCommit ? "yes" : "no") + "): ");
|
|
839
857
|
console.debug(commitObject);
|
|
840
858
|
}
|
|
@@ -1166,11 +1184,6 @@ var global = {
|
|
|
1166
1184
|
STATE_NOT_INITIALIZED: 0,
|
|
1167
1185
|
STATE_INITIALIZED: 1,
|
|
1168
1186
|
STATE_TERMINATED: 2,
|
|
1169
|
-
LOG_LEVEL_DEBUG: 1,
|
|
1170
|
-
LOG_LEVEL_INFO: 2,
|
|
1171
|
-
LOG_LEVEL_WARNING: 3,
|
|
1172
|
-
LOG_LEVEL_ERROR: 4,
|
|
1173
|
-
LOG_LEVEL_NONE: 5,
|
|
1174
1187
|
};
|
|
1175
1188
|
var scorm12 = {
|
|
1176
1189
|
cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",
|
|
@@ -1374,6 +1387,7 @@ var APIConstants = {
|
|
|
1374
1387
|
|
|
1375
1388
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1376
1389
|
/* harmony export */ K$: function() { return /* binding */ NAVBoolean; },
|
|
1390
|
+
/* harmony export */ Mb: function() { return /* binding */ LogLevelEnum; },
|
|
1377
1391
|
/* harmony export */ YE: function() { return /* binding */ SuccessStatus; },
|
|
1378
1392
|
/* harmony export */ lC: function() { return /* binding */ CompletionStatus; }
|
|
1379
1393
|
/* harmony export */ });
|
|
@@ -1395,6 +1409,15 @@ var CompletionStatus;
|
|
|
1395
1409
|
CompletionStatus["incomplete"] = "incomplete";
|
|
1396
1410
|
CompletionStatus["unknown"] = "unknown";
|
|
1397
1411
|
})(CompletionStatus || (CompletionStatus = {}));
|
|
1412
|
+
var LogLevelEnum;
|
|
1413
|
+
(function (LogLevelEnum) {
|
|
1414
|
+
LogLevelEnum[LogLevelEnum["_"] = 0] = "_";
|
|
1415
|
+
LogLevelEnum[LogLevelEnum["DEBUG"] = 1] = "DEBUG";
|
|
1416
|
+
LogLevelEnum[LogLevelEnum["INFO"] = 2] = "INFO";
|
|
1417
|
+
LogLevelEnum[LogLevelEnum["WARN"] = 3] = "WARN";
|
|
1418
|
+
LogLevelEnum[LogLevelEnum["ERROR"] = 4] = "ERROR";
|
|
1419
|
+
LogLevelEnum[LogLevelEnum["NONE"] = 5] = "NONE";
|
|
1420
|
+
})(LogLevelEnum || (LogLevelEnum = {}));
|
|
1398
1421
|
|
|
1399
1422
|
|
|
1400
1423
|
/***/ }),
|
|
@@ -1503,7 +1526,7 @@ var scorm2004 = {
|
|
|
1503
1526
|
CMIExit: "^(time-out|suspend|logout|normal)$",
|
|
1504
1527
|
CMIType: "^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",
|
|
1505
1528
|
CMIResult: "^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",
|
|
1506
|
-
NAVEvent: "^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target
|
|
1529
|
+
NAVEvent: "^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=(?<choice_target>\\S{0,}[a-zA-Z0-9-_]+)})?choice|(\\{target=(?<jump_target>\\S{0,}[a-zA-Z0-9-_]+)})?jump)$",
|
|
1507
1530
|
NAVBoolean: "^(unknown|true|false$)",
|
|
1508
1531
|
NAVTarget: "^{target=\\S{0,}[a-zA-Z0-9-_]+}$",
|
|
1509
1532
|
scaled_range: "-1#1",
|
|
@@ -1553,9 +1576,6 @@ var BaseScormValidationError = (function (_super) {
|
|
|
1553
1576
|
enumerable: false,
|
|
1554
1577
|
configurable: true
|
|
1555
1578
|
});
|
|
1556
|
-
BaseScormValidationError.prototype.setMessage = function (message) {
|
|
1557
|
-
this.message = message;
|
|
1558
|
-
};
|
|
1559
1579
|
return BaseScormValidationError;
|
|
1560
1580
|
}(Error));
|
|
1561
1581
|
|
|
@@ -1564,7 +1584,7 @@ var ValidationError = (function (_super) {
|
|
|
1564
1584
|
function ValidationError(errorCode, errorMessage, detailedMessage) {
|
|
1565
1585
|
var _this = _super.call(this, errorCode) || this;
|
|
1566
1586
|
_this._detailedMessage = "";
|
|
1567
|
-
_this.
|
|
1587
|
+
_this.message = errorMessage;
|
|
1568
1588
|
_this._errorMessage = errorMessage;
|
|
1569
1589
|
if (detailedMessage) {
|
|
1570
1590
|
_this._detailedMessage = detailedMessage;
|
|
@@ -4188,11 +4208,12 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4188
4208
|
Scorm2004Impl.prototype.internalFinish = function () {
|
|
4189
4209
|
return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () {
|
|
4190
4210
|
var result, navActions, request, choiceJumpRegex, matches, target, action;
|
|
4191
|
-
|
|
4192
|
-
|
|
4211
|
+
var _a, _b, _c, _d;
|
|
4212
|
+
return (0,tslib_es6/* __generator */.YH)(this, function (_e) {
|
|
4213
|
+
switch (_e.label) {
|
|
4193
4214
|
case 0: return [4, this.terminate("Terminate", true)];
|
|
4194
4215
|
case 1:
|
|
4195
|
-
result =
|
|
4216
|
+
result = _e.sent();
|
|
4196
4217
|
if (result === api_constants/* default */.A.global.SCORM_TRUE) {
|
|
4197
4218
|
if (this.adl.nav.request !== "_none_") {
|
|
4198
4219
|
navActions = {
|
|
@@ -4209,9 +4230,15 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4209
4230
|
choiceJumpRegex = new RegExp(regex/* default */.A.scorm2004.NAVEvent);
|
|
4210
4231
|
matches = request.match(choiceJumpRegex);
|
|
4211
4232
|
target = "";
|
|
4212
|
-
if (matches
|
|
4213
|
-
|
|
4214
|
-
|
|
4233
|
+
if (matches) {
|
|
4234
|
+
if ((_a = matches.groups) === null || _a === void 0 ? void 0 : _a.choice_target) {
|
|
4235
|
+
target = (_b = matches.groups) === null || _b === void 0 ? void 0 : _b.choice_target;
|
|
4236
|
+
request = "choice";
|
|
4237
|
+
}
|
|
4238
|
+
else if ((_c = matches.groups) === null || _c === void 0 ? void 0 : _c.jump_target) {
|
|
4239
|
+
target = (_d = matches.groups) === null || _d === void 0 ? void 0 : _d.jump_target;
|
|
4240
|
+
request = "jump";
|
|
4241
|
+
}
|
|
4215
4242
|
}
|
|
4216
4243
|
action = navActions[request];
|
|
4217
4244
|
if (action) {
|
|
@@ -4601,7 +4628,6 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4601
4628
|
navRequest = false;
|
|
4602
4629
|
if (this.adl.nav.request !== ((_c = (_b = (_a = this.startingData) === null || _a === void 0 ? void 0 : _a.adl) === null || _b === void 0 ? void 0 : _b.nav) === null || _c === void 0 ? void 0 : _c.request) &&
|
|
4603
4630
|
this.adl.nav.request !== "_none_") {
|
|
4604
|
-
this.adl.nav.request = encodeURIComponent(this.adl.nav.request);
|
|
4605
4631
|
navRequest = true;
|
|
4606
4632
|
}
|
|
4607
4633
|
commitObject = this.getCommitObject(terminateCommit);
|