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/scorm2004.js
CHANGED
|
@@ -23,9 +23,12 @@ var error_codes = __webpack_require__(797);
|
|
|
23
23
|
var api_constants = __webpack_require__(340);
|
|
24
24
|
// EXTERNAL MODULE: ./src/utilities.ts
|
|
25
25
|
var utilities = __webpack_require__(864);
|
|
26
|
+
// EXTERNAL MODULE: ./src/constants/enums.ts
|
|
27
|
+
var enums = __webpack_require__(56);
|
|
26
28
|
;// ./src/constants/default_settings.ts
|
|
27
29
|
|
|
28
30
|
|
|
31
|
+
|
|
29
32
|
var DefaultSettings = {
|
|
30
33
|
autocommit: false,
|
|
31
34
|
autocommitSeconds: 10,
|
|
@@ -35,7 +38,7 @@ var DefaultSettings = {
|
|
|
35
38
|
dataCommitFormat: "json",
|
|
36
39
|
commitRequestDataType: "application/json;charset=UTF-8",
|
|
37
40
|
autoProgress: false,
|
|
38
|
-
logLevel:
|
|
41
|
+
logLevel: enums/* LogLevelEnum */.Mb.ERROR,
|
|
39
42
|
selfReportSessionTime: false,
|
|
40
43
|
alwaysSendTotalTime: false,
|
|
41
44
|
renderCommonCommitFields: false,
|
|
@@ -96,16 +99,28 @@ var DefaultSettings = {
|
|
|
96
99
|
},
|
|
97
100
|
onLogMessage: function (messageLevel, logMessage) {
|
|
98
101
|
switch (messageLevel) {
|
|
99
|
-
case
|
|
102
|
+
case "4":
|
|
103
|
+
case 4:
|
|
104
|
+
case "ERROR":
|
|
105
|
+
case enums/* LogLevelEnum */.Mb.ERROR:
|
|
100
106
|
console.error(logMessage);
|
|
101
107
|
break;
|
|
102
|
-
case
|
|
108
|
+
case "3":
|
|
109
|
+
case 3:
|
|
110
|
+
case "WARN":
|
|
111
|
+
case enums/* LogLevelEnum */.Mb.WARN:
|
|
103
112
|
console.warn(logMessage);
|
|
104
113
|
break;
|
|
105
|
-
case
|
|
114
|
+
case "2":
|
|
115
|
+
case 2:
|
|
116
|
+
case "INFO":
|
|
117
|
+
case enums/* LogLevelEnum */.Mb.INFO:
|
|
106
118
|
console.info(logMessage);
|
|
107
119
|
break;
|
|
108
|
-
case
|
|
120
|
+
case "1":
|
|
121
|
+
case 1:
|
|
122
|
+
case "DEBUG":
|
|
123
|
+
case enums/* LogLevelEnum */.Mb.DEBUG:
|
|
109
124
|
if (console.debug) {
|
|
110
125
|
console.debug(logMessage);
|
|
111
126
|
}
|
|
@@ -158,6 +173,7 @@ var ScheduledCommit = (function () {
|
|
|
158
173
|
|
|
159
174
|
|
|
160
175
|
|
|
176
|
+
|
|
161
177
|
var BaseAPI = (function () {
|
|
162
178
|
function BaseAPI(error_codes, settings) {
|
|
163
179
|
var _newTarget = this.constructor;
|
|
@@ -174,6 +190,9 @@ var BaseAPI = (function () {
|
|
|
174
190
|
}
|
|
175
191
|
this.apiLogLevel = this.settings.logLevel;
|
|
176
192
|
this.selfReportSessionTime = this.settings.selfReportSessionTime;
|
|
193
|
+
if (this.apiLogLevel === undefined) {
|
|
194
|
+
this.apiLogLevel = enums/* LogLevelEnum */.Mb.NONE;
|
|
195
|
+
}
|
|
177
196
|
}
|
|
178
197
|
BaseAPI.prototype.commonReset = function (settings) {
|
|
179
198
|
this.settings = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, this.settings), settings);
|
|
@@ -198,7 +217,7 @@ var BaseAPI = (function () {
|
|
|
198
217
|
returnValue = api_constants/* default */.A.global.SCORM_TRUE;
|
|
199
218
|
this.processListeners(callbackName);
|
|
200
219
|
}
|
|
201
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
220
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums/* LogLevelEnum */.Mb.INFO);
|
|
202
221
|
this.clearSCORMError(returnValue);
|
|
203
222
|
return returnValue;
|
|
204
223
|
};
|
|
@@ -250,7 +269,7 @@ var BaseAPI = (function () {
|
|
|
250
269
|
this.processListeners(callbackName);
|
|
251
270
|
_a.label = 2;
|
|
252
271
|
case 2:
|
|
253
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
272
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums/* LogLevelEnum */.Mb.INFO);
|
|
254
273
|
this.clearSCORMError(returnValue);
|
|
255
274
|
return [2, returnValue];
|
|
256
275
|
}
|
|
@@ -270,7 +289,7 @@ var BaseAPI = (function () {
|
|
|
270
289
|
}
|
|
271
290
|
this.processListeners(callbackName, CMIElement);
|
|
272
291
|
}
|
|
273
|
-
this.apiLog(callbackName, ": returned: " + returnValue,
|
|
292
|
+
this.apiLog(callbackName, ": returned: " + returnValue, enums/* LogLevelEnum */.Mb.INFO, CMIElement);
|
|
274
293
|
if (returnValue === undefined) {
|
|
275
294
|
return "";
|
|
276
295
|
}
|
|
@@ -301,7 +320,7 @@ var BaseAPI = (function () {
|
|
|
301
320
|
this.scheduleCommit(this.settings.autocommitSeconds * 1000, commitCallback);
|
|
302
321
|
}
|
|
303
322
|
}
|
|
304
|
-
this.apiLog(callbackName, ": " + value + ": result: " + returnValue,
|
|
323
|
+
this.apiLog(callbackName, ": " + value + ": result: " + returnValue, enums/* LogLevelEnum */.Mb.INFO, CMIElement);
|
|
305
324
|
this.clearSCORMError(returnValue);
|
|
306
325
|
return returnValue;
|
|
307
326
|
};
|
|
@@ -312,7 +331,6 @@ var BaseAPI = (function () {
|
|
|
312
331
|
return (0,tslib_es6/* __generator */.YH)(this, function (_a) {
|
|
313
332
|
switch (_a.label) {
|
|
314
333
|
case 0:
|
|
315
|
-
console.log("commit");
|
|
316
334
|
this.clearScheduledCommit();
|
|
317
335
|
returnValue = api_constants/* default */.A.global.SCORM_FALSE;
|
|
318
336
|
if (!this.checkState(checkTerminated, this._error_codes.COMMIT_BEFORE_INIT, this._error_codes.COMMIT_AFTER_TERM)) return [3, 2];
|
|
@@ -326,13 +344,13 @@ var BaseAPI = (function () {
|
|
|
326
344
|
typeof result !== "undefined" && result.result
|
|
327
345
|
? result.result
|
|
328
346
|
: api_constants/* default */.A.global.SCORM_FALSE;
|
|
329
|
-
this.apiLog(callbackName, " Result: " + returnValue,
|
|
347
|
+
this.apiLog(callbackName, " Result: " + returnValue, enums/* LogLevelEnum */.Mb.DEBUG, "HttpRequest");
|
|
330
348
|
if (checkTerminated)
|
|
331
349
|
this.lastErrorCode = "0";
|
|
332
350
|
this.processListeners(callbackName);
|
|
333
351
|
_a.label = 2;
|
|
334
352
|
case 2:
|
|
335
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
353
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums/* LogLevelEnum */.Mb.INFO);
|
|
336
354
|
this.clearSCORMError(returnValue);
|
|
337
355
|
return [2, returnValue];
|
|
338
356
|
}
|
|
@@ -342,7 +360,7 @@ var BaseAPI = (function () {
|
|
|
342
360
|
BaseAPI.prototype.getLastError = function (callbackName) {
|
|
343
361
|
var returnValue = String(this.lastErrorCode);
|
|
344
362
|
this.processListeners(callbackName);
|
|
345
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
363
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums/* LogLevelEnum */.Mb.INFO);
|
|
346
364
|
return returnValue;
|
|
347
365
|
};
|
|
348
366
|
BaseAPI.prototype.getErrorString = function (callbackName, CMIErrorCode) {
|
|
@@ -351,7 +369,7 @@ var BaseAPI = (function () {
|
|
|
351
369
|
returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);
|
|
352
370
|
this.processListeners(callbackName);
|
|
353
371
|
}
|
|
354
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
372
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums/* LogLevelEnum */.Mb.INFO);
|
|
355
373
|
return returnValue;
|
|
356
374
|
};
|
|
357
375
|
BaseAPI.prototype.getDiagnostic = function (callbackName, CMIErrorCode) {
|
|
@@ -360,7 +378,7 @@ var BaseAPI = (function () {
|
|
|
360
378
|
returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);
|
|
361
379
|
this.processListeners(callbackName);
|
|
362
380
|
}
|
|
363
|
-
this.apiLog(callbackName, "returned: " + returnValue,
|
|
381
|
+
this.apiLog(callbackName, "returned: " + returnValue, enums/* LogLevelEnum */.Mb.INFO);
|
|
364
382
|
return returnValue;
|
|
365
383
|
};
|
|
366
384
|
BaseAPI.prototype.checkState = function (checkTerminated, beforeInitError, afterTermError) {
|
|
@@ -454,7 +472,7 @@ var BaseAPI = (function () {
|
|
|
454
472
|
}
|
|
455
473
|
}
|
|
456
474
|
if (returnValue === api_constants/* default */.A.global.SCORM_FALSE) {
|
|
457
|
-
this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value),
|
|
475
|
+
this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value), enums/* LogLevelEnum */.Mb.WARN);
|
|
458
476
|
}
|
|
459
477
|
return returnValue;
|
|
460
478
|
};
|
|
@@ -552,7 +570,7 @@ var BaseAPI = (function () {
|
|
|
552
570
|
CMIElement: CMIElement,
|
|
553
571
|
callback: callback,
|
|
554
572
|
});
|
|
555
|
-
this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length),
|
|
573
|
+
this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), enums/* LogLevelEnum */.Mb.INFO, functionName);
|
|
556
574
|
}
|
|
557
575
|
};
|
|
558
576
|
BaseAPI.prototype.off = function (listenerName, callback) {
|
|
@@ -575,7 +593,7 @@ var BaseAPI = (function () {
|
|
|
575
593
|
});
|
|
576
594
|
if (removeIndex !== -1) {
|
|
577
595
|
this_1.listenerArray.splice(removeIndex, 1);
|
|
578
|
-
this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length),
|
|
596
|
+
this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), enums/* LogLevelEnum */.Mb.INFO, functionName);
|
|
579
597
|
}
|
|
580
598
|
};
|
|
581
599
|
var this_1 = this;
|
|
@@ -608,7 +626,7 @@ var BaseAPI = (function () {
|
|
|
608
626
|
}
|
|
609
627
|
};
|
|
610
628
|
BaseAPI.prototype.processListeners = function (functionName, CMIElement, value) {
|
|
611
|
-
this.apiLog(functionName, value,
|
|
629
|
+
this.apiLog(functionName, value, enums/* LogLevelEnum */.Mb.INFO, CMIElement);
|
|
612
630
|
for (var i = 0; i < this.listenerArray.length; i++) {
|
|
613
631
|
var listener = this.listenerArray[i];
|
|
614
632
|
var functionsMatch = listener.functionName === functionName;
|
|
@@ -624,7 +642,7 @@ var BaseAPI = (function () {
|
|
|
624
642
|
CMIElementsMatch = listener.CMIElement === CMIElement;
|
|
625
643
|
}
|
|
626
644
|
if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {
|
|
627
|
-
this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName),
|
|
645
|
+
this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), enums/* LogLevelEnum */.Mb.INFO, CMIElement);
|
|
628
646
|
listener.callback(CMIElement, value);
|
|
629
647
|
}
|
|
630
648
|
}
|
|
@@ -633,7 +651,7 @@ var BaseAPI = (function () {
|
|
|
633
651
|
if (!message) {
|
|
634
652
|
message = this.getLmsErrorMessageDetails(errorNumber);
|
|
635
653
|
}
|
|
636
|
-
this.apiLog("throwSCORMError", errorNumber + ": " + message,
|
|
654
|
+
this.apiLog("throwSCORMError", errorNumber + ": " + message, enums/* LogLevelEnum */.Mb.ERROR);
|
|
637
655
|
this.lastErrorCode = String(errorNumber);
|
|
638
656
|
};
|
|
639
657
|
BaseAPI.prototype.clearSCORMError = function (success) {
|
|
@@ -784,7 +802,7 @@ var BaseAPI = (function () {
|
|
|
784
802
|
return [2, this.transformResponse(response)];
|
|
785
803
|
case 2:
|
|
786
804
|
e_1 = _a.sent();
|
|
787
|
-
this.apiLog("processHttpRequest", e_1,
|
|
805
|
+
this.apiLog("processHttpRequest", e_1, enums/* LogLevelEnum */.Mb.ERROR);
|
|
788
806
|
api.processListeners("CommitError");
|
|
789
807
|
return [2, genericError];
|
|
790
808
|
case 3: return [2];
|
|
@@ -800,14 +818,14 @@ var BaseAPI = (function () {
|
|
|
800
818
|
BaseAPI.prototype.scheduleCommit = function (when, callback) {
|
|
801
819
|
if (!this._timeout) {
|
|
802
820
|
this._timeout = new ScheduledCommit(this, when, callback);
|
|
803
|
-
this.apiLog("scheduleCommit", "scheduled",
|
|
821
|
+
this.apiLog("scheduleCommit", "scheduled", enums/* LogLevelEnum */.Mb.DEBUG, "");
|
|
804
822
|
}
|
|
805
823
|
};
|
|
806
824
|
BaseAPI.prototype.clearScheduledCommit = function () {
|
|
807
825
|
if (this._timeout) {
|
|
808
826
|
this._timeout.cancel();
|
|
809
827
|
this._timeout = undefined;
|
|
810
|
-
this.apiLog("clearScheduledCommit", "cleared",
|
|
828
|
+
this.apiLog("clearScheduledCommit", "cleared", enums/* LogLevelEnum */.Mb.DEBUG, "");
|
|
811
829
|
}
|
|
812
830
|
};
|
|
813
831
|
BaseAPI.prototype._checkObjectHasProperty = function (refObject, attribute) {
|
|
@@ -836,7 +854,7 @@ var BaseAPI = (function () {
|
|
|
836
854
|
var commitObject = this.settings.renderCommonCommitFields
|
|
837
855
|
? this.renderCommitObject(shouldTerminateCommit)
|
|
838
856
|
: this.renderCommitCMI(shouldTerminateCommit);
|
|
839
|
-
if (
|
|
857
|
+
if ([enums/* LogLevelEnum */.Mb.DEBUG, "1", 1, "DEBUG"].includes(this.apiLogLevel)) {
|
|
840
858
|
console.debug("Commit (terminated: " + (terminateCommit ? "yes" : "no") + "): ");
|
|
841
859
|
console.debug(commitObject);
|
|
842
860
|
}
|
|
@@ -1168,11 +1186,6 @@ var global = {
|
|
|
1168
1186
|
STATE_NOT_INITIALIZED: 0,
|
|
1169
1187
|
STATE_INITIALIZED: 1,
|
|
1170
1188
|
STATE_TERMINATED: 2,
|
|
1171
|
-
LOG_LEVEL_DEBUG: 1,
|
|
1172
|
-
LOG_LEVEL_INFO: 2,
|
|
1173
|
-
LOG_LEVEL_WARNING: 3,
|
|
1174
|
-
LOG_LEVEL_ERROR: 4,
|
|
1175
|
-
LOG_LEVEL_NONE: 5,
|
|
1176
1189
|
};
|
|
1177
1190
|
var scorm12 = {
|
|
1178
1191
|
cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",
|
|
@@ -1376,6 +1389,7 @@ var APIConstants = {
|
|
|
1376
1389
|
|
|
1377
1390
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1378
1391
|
/* harmony export */ K$: function() { return /* binding */ NAVBoolean; },
|
|
1392
|
+
/* harmony export */ Mb: function() { return /* binding */ LogLevelEnum; },
|
|
1379
1393
|
/* harmony export */ YE: function() { return /* binding */ SuccessStatus; },
|
|
1380
1394
|
/* harmony export */ lC: function() { return /* binding */ CompletionStatus; }
|
|
1381
1395
|
/* harmony export */ });
|
|
@@ -1397,6 +1411,15 @@ var CompletionStatus;
|
|
|
1397
1411
|
CompletionStatus["incomplete"] = "incomplete";
|
|
1398
1412
|
CompletionStatus["unknown"] = "unknown";
|
|
1399
1413
|
})(CompletionStatus || (CompletionStatus = {}));
|
|
1414
|
+
var LogLevelEnum;
|
|
1415
|
+
(function (LogLevelEnum) {
|
|
1416
|
+
LogLevelEnum[LogLevelEnum["_"] = 0] = "_";
|
|
1417
|
+
LogLevelEnum[LogLevelEnum["DEBUG"] = 1] = "DEBUG";
|
|
1418
|
+
LogLevelEnum[LogLevelEnum["INFO"] = 2] = "INFO";
|
|
1419
|
+
LogLevelEnum[LogLevelEnum["WARN"] = 3] = "WARN";
|
|
1420
|
+
LogLevelEnum[LogLevelEnum["ERROR"] = 4] = "ERROR";
|
|
1421
|
+
LogLevelEnum[LogLevelEnum["NONE"] = 5] = "NONE";
|
|
1422
|
+
})(LogLevelEnum || (LogLevelEnum = {}));
|
|
1400
1423
|
|
|
1401
1424
|
|
|
1402
1425
|
/***/ }),
|
|
@@ -1505,7 +1528,7 @@ var scorm2004 = {
|
|
|
1505
1528
|
CMIExit: "^(time-out|suspend|logout|normal)$",
|
|
1506
1529
|
CMIType: "^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",
|
|
1507
1530
|
CMIResult: "^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",
|
|
1508
|
-
NAVEvent: "^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target
|
|
1531
|
+
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)$",
|
|
1509
1532
|
NAVBoolean: "^(unknown|true|false$)",
|
|
1510
1533
|
NAVTarget: "^{target=\\S{0,}[a-zA-Z0-9-_]+}$",
|
|
1511
1534
|
scaled_range: "-1#1",
|
|
@@ -1555,9 +1578,6 @@ var BaseScormValidationError = (function (_super) {
|
|
|
1555
1578
|
enumerable: false,
|
|
1556
1579
|
configurable: true
|
|
1557
1580
|
});
|
|
1558
|
-
BaseScormValidationError.prototype.setMessage = function (message) {
|
|
1559
|
-
this.message = message;
|
|
1560
|
-
};
|
|
1561
1581
|
return BaseScormValidationError;
|
|
1562
1582
|
}(Error));
|
|
1563
1583
|
|
|
@@ -1566,7 +1586,7 @@ var ValidationError = (function (_super) {
|
|
|
1566
1586
|
function ValidationError(errorCode, errorMessage, detailedMessage) {
|
|
1567
1587
|
var _this = _super.call(this, errorCode) || this;
|
|
1568
1588
|
_this._detailedMessage = "";
|
|
1569
|
-
_this.
|
|
1589
|
+
_this.message = errorMessage;
|
|
1570
1590
|
_this._errorMessage = errorMessage;
|
|
1571
1591
|
if (detailedMessage) {
|
|
1572
1592
|
_this._detailedMessage = detailedMessage;
|
|
@@ -4203,11 +4223,12 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4203
4223
|
Scorm2004Impl.prototype.internalFinish = function () {
|
|
4204
4224
|
return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () {
|
|
4205
4225
|
var result, navActions, request, choiceJumpRegex, matches, target, action;
|
|
4206
|
-
|
|
4207
|
-
|
|
4226
|
+
var _a, _b, _c, _d;
|
|
4227
|
+
return (0,tslib_es6/* __generator */.YH)(this, function (_e) {
|
|
4228
|
+
switch (_e.label) {
|
|
4208
4229
|
case 0: return [4, this.terminate("Terminate", true)];
|
|
4209
4230
|
case 1:
|
|
4210
|
-
result =
|
|
4231
|
+
result = _e.sent();
|
|
4211
4232
|
if (result === api_constants/* default */.A.global.SCORM_TRUE) {
|
|
4212
4233
|
if (this.adl.nav.request !== "_none_") {
|
|
4213
4234
|
navActions = {
|
|
@@ -4224,9 +4245,15 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4224
4245
|
choiceJumpRegex = new RegExp(regex/* default */.A.scorm2004.NAVEvent);
|
|
4225
4246
|
matches = request.match(choiceJumpRegex);
|
|
4226
4247
|
target = "";
|
|
4227
|
-
if (matches
|
|
4228
|
-
|
|
4229
|
-
|
|
4248
|
+
if (matches) {
|
|
4249
|
+
if ((_a = matches.groups) === null || _a === void 0 ? void 0 : _a.choice_target) {
|
|
4250
|
+
target = (_b = matches.groups) === null || _b === void 0 ? void 0 : _b.choice_target;
|
|
4251
|
+
request = "choice";
|
|
4252
|
+
}
|
|
4253
|
+
else if ((_c = matches.groups) === null || _c === void 0 ? void 0 : _c.jump_target) {
|
|
4254
|
+
target = (_d = matches.groups) === null || _d === void 0 ? void 0 : _d.jump_target;
|
|
4255
|
+
request = "jump";
|
|
4256
|
+
}
|
|
4230
4257
|
}
|
|
4231
4258
|
action = navActions[request];
|
|
4232
4259
|
if (action) {
|
|
@@ -4616,7 +4643,6 @@ var Scorm2004Impl = (function (_super) {
|
|
|
4616
4643
|
navRequest = false;
|
|
4617
4644
|
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) &&
|
|
4618
4645
|
this.adl.nav.request !== "_none_") {
|
|
4619
|
-
this.adl.nav.request = encodeURIComponent(this.adl.nav.request);
|
|
4620
4646
|
navRequest = true;
|
|
4621
4647
|
}
|
|
4622
4648
|
commitObject = this.getCommitObject(terminateCommit);
|