scorm-again 3.0.0 → 3.0.2
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.map +1 -0
- package/dist/aicc.min.js.map +1 -0
- package/dist/cross-frame-api.js +26 -11
- package/dist/cross-frame-api.js.map +1 -0
- package/dist/cross-frame-api.min.js +1 -1
- package/dist/cross-frame-api.min.js.map +1 -0
- package/dist/cross-frame-lms.js +16 -4
- package/dist/cross-frame-lms.js.map +1 -0
- package/dist/cross-frame-lms.min.js +1 -1
- package/dist/cross-frame-lms.min.js.map +1 -0
- package/dist/esm/aicc.js.map +1 -0
- package/dist/esm/aicc.min.js.map +1 -0
- package/dist/esm/cross-frame-api.js +115 -108
- package/dist/esm/cross-frame-api.js.map +1 -0
- package/dist/esm/cross-frame-api.min.js +1 -1
- package/dist/esm/cross-frame-api.min.js.map +1 -0
- package/dist/esm/cross-frame-lms.js +32 -30
- package/dist/esm/cross-frame-lms.js.map +1 -0
- package/dist/esm/cross-frame-lms.min.js +1 -1
- package/dist/esm/cross-frame-lms.min.js.map +1 -0
- package/dist/esm/scorm-again.js +804 -506
- package/dist/esm/scorm-again.js.map +1 -0
- package/dist/esm/scorm-again.min.js +1 -1
- package/dist/esm/scorm-again.min.js.map +1 -0
- package/dist/esm/scorm12.js +152 -373
- package/dist/esm/scorm12.js.map +1 -0
- package/dist/esm/scorm12.min.js +1 -1
- package/dist/esm/scorm12.min.js.map +1 -0
- package/dist/esm/scorm2004.js +582 -312
- package/dist/esm/scorm2004.js.map +1 -0
- package/dist/esm/scorm2004.min.js +1 -1
- package/dist/esm/scorm2004.min.js.map +1 -0
- package/dist/scorm-again.js +1205 -334
- package/dist/scorm-again.js.map +1 -0
- package/dist/scorm-again.min.js +1 -1
- package/dist/scorm-again.min.js.map +1 -0
- package/dist/scorm12.js +832 -71
- package/dist/scorm12.js.map +1 -0
- package/dist/scorm12.min.js +1 -1
- package/dist/scorm12.min.js.map +1 -0
- package/dist/scorm2004.js +1078 -292
- package/dist/scorm2004.js.map +1 -0
- package/dist/scorm2004.min.js +1 -1
- package/dist/scorm2004.min.js.map +1 -0
- package/dist/types/BaseAPI.d.ts +3 -3
- package/dist/types/Scorm2004API.d.ts +1 -0
- package/dist/types/cmi/scorm2004/sequencing/handlers/termination_handler.d.ts +2 -2
- package/dist/types/interfaces/services.d.ts +3 -2
- package/dist/types/services/EventService.d.ts +3 -3
- package/package.json +41 -44
package/dist/esm/scorm2004.js
CHANGED
|
@@ -8,7 +8,7 @@ const designations = {
|
|
|
8
8
|
M: SECONDS_PER_MINUTE,
|
|
9
9
|
S: SECONDS_PER_SECOND
|
|
10
10
|
};
|
|
11
|
-
const getSecondsAsISODuration =
|
|
11
|
+
const getSecondsAsISODuration = (seconds) => {
|
|
12
12
|
if (!seconds || seconds <= 0) {
|
|
13
13
|
return "PT0S";
|
|
14
14
|
}
|
|
@@ -33,7 +33,7 @@ const getSecondsAsISODuration = memoize((seconds) => {
|
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
35
|
return duration;
|
|
36
|
-
}
|
|
36
|
+
};
|
|
37
37
|
const getDurationAsSeconds = memoize(
|
|
38
38
|
(duration, durationRegex) => {
|
|
39
39
|
if (typeof durationRegex === "string") {
|
|
@@ -211,18 +211,19 @@ function parseNavigationRequest(navRequest) {
|
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
class BaseCMI {
|
|
214
|
+
/**
|
|
215
|
+
* Flag used during JSON serialization to allow getter access without initialization checks.
|
|
216
|
+
* When true, getters can be accessed before the API is initialized, which is necessary
|
|
217
|
+
* for serializing the CMI data structure to JSON format.
|
|
218
|
+
*/
|
|
219
|
+
jsonString = false;
|
|
220
|
+
_cmi_element;
|
|
221
|
+
_initialized = false;
|
|
214
222
|
/**
|
|
215
223
|
* Constructor for BaseCMI
|
|
216
224
|
* @param {string} cmi_element
|
|
217
225
|
*/
|
|
218
226
|
constructor(cmi_element) {
|
|
219
|
-
/**
|
|
220
|
-
* Flag used during JSON serialization to allow getter access without initialization checks.
|
|
221
|
-
* When true, getters can be accessed before the API is initialized, which is necessary
|
|
222
|
-
* for serializing the CMI data structure to JSON format.
|
|
223
|
-
*/
|
|
224
|
-
this.jsonString = false;
|
|
225
|
-
this._initialized = false;
|
|
226
227
|
this._cmi_element = cmi_element;
|
|
227
228
|
}
|
|
228
229
|
/**
|
|
@@ -240,6 +241,7 @@ class BaseCMI {
|
|
|
240
241
|
}
|
|
241
242
|
}
|
|
242
243
|
class BaseRootCMI extends BaseCMI {
|
|
244
|
+
_start_time;
|
|
243
245
|
/**
|
|
244
246
|
* Start time of the session
|
|
245
247
|
* @type {number | undefined}
|
|
@@ -266,6 +268,7 @@ class BaseScormValidationError extends Error {
|
|
|
266
268
|
this._errorCode = errorCode;
|
|
267
269
|
Object.setPrototypeOf(this, BaseScormValidationError.prototype);
|
|
268
270
|
}
|
|
271
|
+
_errorCode;
|
|
269
272
|
/**
|
|
270
273
|
* Getter for _errorCode
|
|
271
274
|
* @return {number}
|
|
@@ -284,7 +287,6 @@ class ValidationError extends BaseScormValidationError {
|
|
|
284
287
|
*/
|
|
285
288
|
constructor(CMIElement, errorCode, errorMessage, detailedMessage) {
|
|
286
289
|
super(CMIElement, errorCode);
|
|
287
|
-
this._detailedMessage = "";
|
|
288
290
|
this.message = `${CMIElement} : ${errorMessage}`;
|
|
289
291
|
this._errorMessage = errorMessage;
|
|
290
292
|
if (detailedMessage) {
|
|
@@ -292,6 +294,8 @@ class ValidationError extends BaseScormValidationError {
|
|
|
292
294
|
}
|
|
293
295
|
Object.setPrototypeOf(this, ValidationError.prototype);
|
|
294
296
|
}
|
|
297
|
+
_errorMessage;
|
|
298
|
+
_detailedMessage = "";
|
|
295
299
|
/**
|
|
296
300
|
* Getter for _errorMessage
|
|
297
301
|
* @return {string}
|
|
@@ -610,6 +614,10 @@ const scorm2004_errors = {
|
|
|
610
614
|
};
|
|
611
615
|
|
|
612
616
|
class CMIArray extends BaseCMI {
|
|
617
|
+
_errorCode;
|
|
618
|
+
_errorClass;
|
|
619
|
+
__children;
|
|
620
|
+
childArray;
|
|
613
621
|
/**
|
|
614
622
|
* Constructor cmi *.n arrays
|
|
615
623
|
* @param {object} params
|
|
@@ -1476,6 +1484,10 @@ const ValidLanguages = [
|
|
|
1476
1484
|
];
|
|
1477
1485
|
|
|
1478
1486
|
class ScheduledCommit {
|
|
1487
|
+
_API;
|
|
1488
|
+
_cancelled = false;
|
|
1489
|
+
_timeout;
|
|
1490
|
+
_callback;
|
|
1479
1491
|
/**
|
|
1480
1492
|
* Constructor for ScheduledCommit
|
|
1481
1493
|
* @param {BaseAPI} API
|
|
@@ -1483,7 +1495,6 @@ class ScheduledCommit {
|
|
|
1483
1495
|
* @param {string} callback
|
|
1484
1496
|
*/
|
|
1485
1497
|
constructor(API, when, callback) {
|
|
1486
|
-
this._cancelled = false;
|
|
1487
1498
|
this._API = API;
|
|
1488
1499
|
this._timeout = setTimeout(this.wrapper.bind(this), when);
|
|
1489
1500
|
this._callback = callback;
|
|
@@ -1540,6 +1551,14 @@ var RuleActionType = /* @__PURE__ */ ((RuleActionType2) => {
|
|
|
1540
1551
|
return RuleActionType2;
|
|
1541
1552
|
})(RuleActionType || {});
|
|
1542
1553
|
class RuleCondition extends BaseCMI {
|
|
1554
|
+
_condition = "always" /* ALWAYS */;
|
|
1555
|
+
_operator = null;
|
|
1556
|
+
_parameters = /* @__PURE__ */ new Map();
|
|
1557
|
+
_referencedObjective = null;
|
|
1558
|
+
// Optional, overridable provider for current time (LMS may set via SequencingService)
|
|
1559
|
+
static _now = () => /* @__PURE__ */ new Date();
|
|
1560
|
+
// Optional, overridable hook for getting elapsed seconds
|
|
1561
|
+
static _getElapsedSecondsHook = void 0;
|
|
1543
1562
|
/**
|
|
1544
1563
|
* Constructor for RuleCondition
|
|
1545
1564
|
* @param {RuleConditionType} condition - The condition type
|
|
@@ -1548,22 +1567,10 @@ class RuleCondition extends BaseCMI {
|
|
|
1548
1567
|
*/
|
|
1549
1568
|
constructor(condition = "always" /* ALWAYS */, operator = null, parameters = /* @__PURE__ */ new Map()) {
|
|
1550
1569
|
super("ruleCondition");
|
|
1551
|
-
this._condition = "always" /* ALWAYS */;
|
|
1552
|
-
this._operator = null;
|
|
1553
|
-
this._parameters = /* @__PURE__ */ new Map();
|
|
1554
|
-
this._referencedObjective = null;
|
|
1555
1570
|
this._condition = condition;
|
|
1556
1571
|
this._operator = operator;
|
|
1557
1572
|
this._parameters = parameters;
|
|
1558
1573
|
}
|
|
1559
|
-
static {
|
|
1560
|
-
// Optional, overridable provider for current time (LMS may set via SequencingService)
|
|
1561
|
-
this._now = () => /* @__PURE__ */ new Date();
|
|
1562
|
-
}
|
|
1563
|
-
static {
|
|
1564
|
-
// Optional, overridable hook for getting elapsed seconds
|
|
1565
|
-
this._getElapsedSecondsHook = void 0;
|
|
1566
|
-
}
|
|
1567
1574
|
/**
|
|
1568
1575
|
* Allow integrators to override the clock used for time-based rules.
|
|
1569
1576
|
*/
|
|
@@ -1831,6 +1838,9 @@ class RuleCondition extends BaseCMI {
|
|
|
1831
1838
|
}
|
|
1832
1839
|
}
|
|
1833
1840
|
class SequencingRule extends BaseCMI {
|
|
1841
|
+
_conditions = [];
|
|
1842
|
+
_action = "skip" /* SKIP */;
|
|
1843
|
+
_conditionCombination = "and" /* AND */;
|
|
1834
1844
|
/**
|
|
1835
1845
|
* Constructor for SequencingRule
|
|
1836
1846
|
* @param {RuleActionType} action - The action to take when the rule conditions are met
|
|
@@ -1838,9 +1848,6 @@ class SequencingRule extends BaseCMI {
|
|
|
1838
1848
|
*/
|
|
1839
1849
|
constructor(action = "skip" /* SKIP */, conditionCombination = "and" /* AND */) {
|
|
1840
1850
|
super("sequencingRule");
|
|
1841
|
-
this._conditions = [];
|
|
1842
|
-
this._action = "skip" /* SKIP */;
|
|
1843
|
-
this._conditionCombination = "and" /* AND */;
|
|
1844
1851
|
this._action = action;
|
|
1845
1852
|
this._conditionCombination = conditionCombination;
|
|
1846
1853
|
}
|
|
@@ -1954,14 +1961,14 @@ class SequencingRule extends BaseCMI {
|
|
|
1954
1961
|
}
|
|
1955
1962
|
}
|
|
1956
1963
|
class SequencingRules extends BaseCMI {
|
|
1964
|
+
_preConditionRules = [];
|
|
1965
|
+
_exitConditionRules = [];
|
|
1966
|
+
_postConditionRules = [];
|
|
1957
1967
|
/**
|
|
1958
1968
|
* Constructor for SequencingRules
|
|
1959
1969
|
*/
|
|
1960
1970
|
constructor() {
|
|
1961
1971
|
super("sequencingRules");
|
|
1962
|
-
this._preConditionRules = [];
|
|
1963
|
-
this._exitConditionRules = [];
|
|
1964
|
-
this._postConditionRules = [];
|
|
1965
1972
|
}
|
|
1966
1973
|
/**
|
|
1967
1974
|
* Called when the API needs to be reset
|
|
@@ -2702,6 +2709,10 @@ var DeliveryRequestType = /* @__PURE__ */ ((DeliveryRequestType2) => {
|
|
|
2702
2709
|
return DeliveryRequestType2;
|
|
2703
2710
|
})(DeliveryRequestType || {});
|
|
2704
2711
|
class SequencingResult {
|
|
2712
|
+
deliveryRequest;
|
|
2713
|
+
targetActivity;
|
|
2714
|
+
exception;
|
|
2715
|
+
endSequencingSession;
|
|
2705
2716
|
constructor(deliveryRequest = "doNotDeliver" /* DO_NOT_DELIVER */, targetActivity = null, exception = null, endSequencingSession = false) {
|
|
2706
2717
|
this.deliveryRequest = deliveryRequest;
|
|
2707
2718
|
this.targetActivity = targetActivity;
|
|
@@ -2710,6 +2721,10 @@ class SequencingResult {
|
|
|
2710
2721
|
}
|
|
2711
2722
|
}
|
|
2712
2723
|
class FlowSubprocessResult {
|
|
2724
|
+
identifiedActivity;
|
|
2725
|
+
deliverable;
|
|
2726
|
+
exception;
|
|
2727
|
+
endSequencingSession;
|
|
2713
2728
|
constructor(identifiedActivity, deliverable, exception = null, endSequencingSession = false) {
|
|
2714
2729
|
this.identifiedActivity = identifiedActivity;
|
|
2715
2730
|
this.deliverable = deliverable;
|
|
@@ -2718,6 +2733,8 @@ class FlowSubprocessResult {
|
|
|
2718
2733
|
}
|
|
2719
2734
|
}
|
|
2720
2735
|
class ChoiceTraversalResult {
|
|
2736
|
+
activity;
|
|
2737
|
+
exception;
|
|
2721
2738
|
constructor(activity, exception = null) {
|
|
2722
2739
|
this.activity = activity;
|
|
2723
2740
|
this.exception = exception;
|
|
@@ -2730,6 +2747,8 @@ var FlowSubprocessMode = /* @__PURE__ */ ((FlowSubprocessMode2) => {
|
|
|
2730
2747
|
})(FlowSubprocessMode || {});
|
|
2731
2748
|
|
|
2732
2749
|
class RuleEvaluationEngine {
|
|
2750
|
+
now;
|
|
2751
|
+
getAttemptElapsedSecondsHook;
|
|
2733
2752
|
constructor(options = {}) {
|
|
2734
2753
|
this.now = options.now || (() => /* @__PURE__ */ new Date());
|
|
2735
2754
|
this.getAttemptElapsedSecondsHook = options.getAttemptElapsedSecondsHook || null;
|
|
@@ -3030,42 +3049,42 @@ var RandomizationTiming = /* @__PURE__ */ ((RandomizationTiming2) => {
|
|
|
3030
3049
|
return RandomizationTiming2;
|
|
3031
3050
|
})(RandomizationTiming || {});
|
|
3032
3051
|
class SequencingControls extends BaseCMI {
|
|
3052
|
+
// Sequencing Control Modes
|
|
3053
|
+
_enabled = true;
|
|
3054
|
+
_choice = true;
|
|
3055
|
+
_choiceExit = true;
|
|
3056
|
+
// Per SCORM 2004 Sequencing & Navigation, flow defaults to true
|
|
3057
|
+
_flow = true;
|
|
3058
|
+
_forwardOnly = false;
|
|
3059
|
+
_useCurrentAttemptObjectiveInfo = true;
|
|
3060
|
+
_useCurrentAttemptProgressInfo = true;
|
|
3061
|
+
// Constrain Choice Controls
|
|
3062
|
+
_preventActivation = false;
|
|
3063
|
+
_constrainChoice = false;
|
|
3064
|
+
// Rule-driven traversal limiter (e.g., post-condition stopForwardTraversal)
|
|
3065
|
+
_stopForwardTraversal = false;
|
|
3066
|
+
// Rollup Controls
|
|
3067
|
+
_rollupObjectiveSatisfied = true;
|
|
3068
|
+
_rollupProgressCompletion = true;
|
|
3069
|
+
_objectiveMeasureWeight = 1;
|
|
3070
|
+
// Selection Controls
|
|
3071
|
+
_selectionTiming = "never" /* NEVER */;
|
|
3072
|
+
_selectCount = null;
|
|
3073
|
+
_selectionCountStatus = false;
|
|
3074
|
+
_randomizeChildren = false;
|
|
3075
|
+
// Randomization Controls
|
|
3076
|
+
_randomizationTiming = "never" /* NEVER */;
|
|
3077
|
+
_reorderChildren = false;
|
|
3078
|
+
// Auto-completion/satisfaction controls
|
|
3079
|
+
_completionSetByContent = false;
|
|
3080
|
+
_objectiveSetByContent = false;
|
|
3081
|
+
// Delivery Controls
|
|
3082
|
+
_tracked = true;
|
|
3033
3083
|
/**
|
|
3034
3084
|
* Constructor for SequencingControls
|
|
3035
3085
|
*/
|
|
3036
3086
|
constructor() {
|
|
3037
3087
|
super("sequencingControls");
|
|
3038
|
-
// Sequencing Control Modes
|
|
3039
|
-
this._enabled = true;
|
|
3040
|
-
this._choice = true;
|
|
3041
|
-
this._choiceExit = true;
|
|
3042
|
-
// Per SCORM 2004 Sequencing & Navigation, flow defaults to true
|
|
3043
|
-
this._flow = true;
|
|
3044
|
-
this._forwardOnly = false;
|
|
3045
|
-
this._useCurrentAttemptObjectiveInfo = true;
|
|
3046
|
-
this._useCurrentAttemptProgressInfo = true;
|
|
3047
|
-
// Constrain Choice Controls
|
|
3048
|
-
this._preventActivation = false;
|
|
3049
|
-
this._constrainChoice = false;
|
|
3050
|
-
// Rule-driven traversal limiter (e.g., post-condition stopForwardTraversal)
|
|
3051
|
-
this._stopForwardTraversal = false;
|
|
3052
|
-
// Rollup Controls
|
|
3053
|
-
this._rollupObjectiveSatisfied = true;
|
|
3054
|
-
this._rollupProgressCompletion = true;
|
|
3055
|
-
this._objectiveMeasureWeight = 1;
|
|
3056
|
-
// Selection Controls
|
|
3057
|
-
this._selectionTiming = "never" /* NEVER */;
|
|
3058
|
-
this._selectCount = null;
|
|
3059
|
-
this._selectionCountStatus = false;
|
|
3060
|
-
this._randomizeChildren = false;
|
|
3061
|
-
// Randomization Controls
|
|
3062
|
-
this._randomizationTiming = "never" /* NEVER */;
|
|
3063
|
-
this._reorderChildren = false;
|
|
3064
|
-
// Auto-completion/satisfaction controls
|
|
3065
|
-
this._completionSetByContent = false;
|
|
3066
|
-
this._objectiveSetByContent = false;
|
|
3067
|
-
// Delivery Controls
|
|
3068
|
-
this._tracked = true;
|
|
3069
3088
|
}
|
|
3070
3089
|
/**
|
|
3071
3090
|
* Reset the sequencing controls to their default values
|
|
@@ -4463,6 +4482,19 @@ class RetryRequestHandler {
|
|
|
4463
4482
|
}
|
|
4464
4483
|
|
|
4465
4484
|
class SequencingProcess {
|
|
4485
|
+
activityTree;
|
|
4486
|
+
// Extracted services
|
|
4487
|
+
treeQueries;
|
|
4488
|
+
constraintValidator;
|
|
4489
|
+
ruleEngine;
|
|
4490
|
+
traversalService;
|
|
4491
|
+
// Request handlers
|
|
4492
|
+
flowHandler;
|
|
4493
|
+
choiceHandler;
|
|
4494
|
+
exitHandler;
|
|
4495
|
+
retryHandler;
|
|
4496
|
+
// Time function (exposed for testing)
|
|
4497
|
+
_now;
|
|
4466
4498
|
/**
|
|
4467
4499
|
* Get/set the current time function (used for testing time-dependent logic)
|
|
4468
4500
|
*/
|
|
@@ -4486,6 +4518,7 @@ class SequencingProcess {
|
|
|
4486
4518
|
);
|
|
4487
4519
|
this.retryHandler = new RetryRequestHandler(this.activityTree, this.traversalService);
|
|
4488
4520
|
}
|
|
4521
|
+
_getAttemptElapsedSecondsHook;
|
|
4489
4522
|
/**
|
|
4490
4523
|
* Get/set the elapsed seconds hook (used for time-based rules)
|
|
4491
4524
|
*/
|
|
@@ -4720,9 +4753,12 @@ class SequencingProcess {
|
|
|
4720
4753
|
}
|
|
4721
4754
|
|
|
4722
4755
|
class ActivityDeliveryService {
|
|
4756
|
+
eventService;
|
|
4757
|
+
loggingService;
|
|
4758
|
+
callbacks;
|
|
4759
|
+
currentDeliveredActivity = null;
|
|
4760
|
+
pendingDelivery = null;
|
|
4723
4761
|
constructor(eventService, loggingService, callbacks = {}) {
|
|
4724
|
-
this.currentDeliveredActivity = null;
|
|
4725
|
-
this.pendingDelivery = null;
|
|
4726
4762
|
this.eventService = eventService;
|
|
4727
4763
|
this.loggingService = loggingService;
|
|
4728
4764
|
this.callbacks = callbacks;
|
|
@@ -4808,6 +4844,8 @@ class ActivityDeliveryService {
|
|
|
4808
4844
|
}
|
|
4809
4845
|
|
|
4810
4846
|
class AsynchronousHttpService {
|
|
4847
|
+
settings;
|
|
4848
|
+
error_codes;
|
|
4811
4849
|
/**
|
|
4812
4850
|
* Constructor for AsynchronousHttpService
|
|
4813
4851
|
* @param {Settings} settings - The settings object
|
|
@@ -5003,6 +5041,7 @@ function getErrorCode(errorCodes, key) {
|
|
|
5003
5041
|
return code;
|
|
5004
5042
|
}
|
|
5005
5043
|
class CMIValueAccessService {
|
|
5044
|
+
context;
|
|
5006
5045
|
constructor(context) {
|
|
5007
5046
|
this.context = context;
|
|
5008
5047
|
}
|
|
@@ -5367,11 +5406,13 @@ class CMIValueAccessService {
|
|
|
5367
5406
|
}
|
|
5368
5407
|
|
|
5369
5408
|
class LoggingService {
|
|
5409
|
+
static _instance;
|
|
5410
|
+
_logLevel = LogLevelEnum.ERROR;
|
|
5411
|
+
_logHandler;
|
|
5370
5412
|
/**
|
|
5371
5413
|
* Private constructor to prevent direct instantiation
|
|
5372
5414
|
*/
|
|
5373
5415
|
constructor() {
|
|
5374
|
-
this._logLevel = LogLevelEnum.ERROR;
|
|
5375
5416
|
this._logHandler = defaultLogHandler;
|
|
5376
5417
|
}
|
|
5377
5418
|
/**
|
|
@@ -5525,6 +5566,12 @@ function getLoggingService() {
|
|
|
5525
5566
|
}
|
|
5526
5567
|
|
|
5527
5568
|
class ErrorHandlingService {
|
|
5569
|
+
_lastErrorCode = "0";
|
|
5570
|
+
_lastDiagnostic = "";
|
|
5571
|
+
_errorCodes;
|
|
5572
|
+
_apiLog;
|
|
5573
|
+
_getLmsErrorMessageDetails;
|
|
5574
|
+
_loggingService;
|
|
5528
5575
|
/**
|
|
5529
5576
|
* Constructor for ErrorHandlingService
|
|
5530
5577
|
*
|
|
@@ -5534,8 +5581,6 @@ class ErrorHandlingService {
|
|
|
5534
5581
|
* @param {ILoggingService} loggingService - Optional logging service instance
|
|
5535
5582
|
*/
|
|
5536
5583
|
constructor(errorCodes, apiLog, getLmsErrorMessageDetails, loggingService) {
|
|
5537
|
-
this._lastErrorCode = "0";
|
|
5538
|
-
this._lastDiagnostic = "";
|
|
5539
5584
|
this._errorCodes = errorCodes;
|
|
5540
5585
|
this._apiLog = apiLog;
|
|
5541
5586
|
this._getLmsErrorMessageDetails = getLmsErrorMessageDetails;
|
|
@@ -5682,15 +5727,17 @@ function createErrorHandlingService(errorCodes, apiLog, getLmsErrorMessageDetail
|
|
|
5682
5727
|
}
|
|
5683
5728
|
|
|
5684
5729
|
class EventService {
|
|
5730
|
+
// Map of function names to listeners for faster lookups
|
|
5731
|
+
listenerMap = /* @__PURE__ */ new Map();
|
|
5732
|
+
// Total count of listeners for logging
|
|
5733
|
+
listenerCount = 0;
|
|
5734
|
+
// Function to log API messages
|
|
5735
|
+
apiLog;
|
|
5685
5736
|
/**
|
|
5686
5737
|
* Constructor for EventService
|
|
5687
5738
|
* @param {Function} apiLog - Function to log API messages
|
|
5688
5739
|
*/
|
|
5689
5740
|
constructor(apiLog) {
|
|
5690
|
-
// Map of function names to listeners for faster lookups
|
|
5691
|
-
this.listenerMap = /* @__PURE__ */ new Map();
|
|
5692
|
-
// Total count of listeners for logging
|
|
5693
|
-
this.listenerCount = 0;
|
|
5694
5741
|
this.apiLog = apiLog;
|
|
5695
5742
|
}
|
|
5696
5743
|
/**
|
|
@@ -5858,10 +5905,6 @@ class OfflineStorageService {
|
|
|
5858
5905
|
*/
|
|
5859
5906
|
constructor(settings, error_codes, apiLog) {
|
|
5860
5907
|
this.apiLog = apiLog;
|
|
5861
|
-
this.storeName = "scorm_again_offline_data";
|
|
5862
|
-
this.syncQueue = "scorm_again_sync_queue";
|
|
5863
|
-
this.isOnline = navigator.onLine;
|
|
5864
|
-
this.syncInProgress = false;
|
|
5865
5908
|
this.settings = settings;
|
|
5866
5909
|
this.error_codes = error_codes;
|
|
5867
5910
|
this.boundOnlineStatusChangeHandler = this.handleOnlineStatusChange.bind(this);
|
|
@@ -5870,6 +5913,14 @@ class OfflineStorageService {
|
|
|
5870
5913
|
window.addEventListener("offline", this.boundOnlineStatusChangeHandler);
|
|
5871
5914
|
window.addEventListener("scorm-again:network-status", this.boundCustomNetworkStatusHandler);
|
|
5872
5915
|
}
|
|
5916
|
+
settings;
|
|
5917
|
+
error_codes;
|
|
5918
|
+
storeName = "scorm_again_offline_data";
|
|
5919
|
+
syncQueue = "scorm_again_sync_queue";
|
|
5920
|
+
isOnline = navigator.onLine;
|
|
5921
|
+
syncInProgress = false;
|
|
5922
|
+
boundOnlineStatusChangeHandler;
|
|
5923
|
+
boundCustomNetworkStatusHandler;
|
|
5873
5924
|
/**
|
|
5874
5925
|
* Handle changes in online status
|
|
5875
5926
|
*/
|
|
@@ -6181,7 +6232,7 @@ class OfflineStorageService {
|
|
|
6181
6232
|
localStorage.setItem(key, JSON.stringify(data));
|
|
6182
6233
|
} catch (error) {
|
|
6183
6234
|
if (error instanceof DOMException && error.name === "QuotaExceededError") {
|
|
6184
|
-
throw new Error("storage quota exceeded - localStorage is full");
|
|
6235
|
+
throw new Error("storage quota exceeded - localStorage is full", { cause: error });
|
|
6185
6236
|
}
|
|
6186
6237
|
throw error;
|
|
6187
6238
|
}
|
|
@@ -6295,6 +6346,8 @@ var RollupConsiderationType = /* @__PURE__ */ ((RollupConsiderationType2) => {
|
|
|
6295
6346
|
return RollupConsiderationType2;
|
|
6296
6347
|
})(RollupConsiderationType || {});
|
|
6297
6348
|
class RollupCondition extends BaseCMI {
|
|
6349
|
+
_condition = "always" /* ALWAYS */;
|
|
6350
|
+
_parameters = /* @__PURE__ */ new Map();
|
|
6298
6351
|
/**
|
|
6299
6352
|
* Constructor for RollupCondition
|
|
6300
6353
|
* @param {RollupConditionType} condition - The condition type
|
|
@@ -6302,8 +6355,6 @@ class RollupCondition extends BaseCMI {
|
|
|
6302
6355
|
*/
|
|
6303
6356
|
constructor(condition = "always" /* ALWAYS */, parameters = /* @__PURE__ */ new Map()) {
|
|
6304
6357
|
super("rollupCondition");
|
|
6305
|
-
this._condition = "always" /* ALWAYS */;
|
|
6306
|
-
this._parameters = /* @__PURE__ */ new Map();
|
|
6307
6358
|
this._condition = condition;
|
|
6308
6359
|
this._parameters = parameters;
|
|
6309
6360
|
}
|
|
@@ -6391,6 +6442,11 @@ class RollupCondition extends BaseCMI {
|
|
|
6391
6442
|
}
|
|
6392
6443
|
}
|
|
6393
6444
|
class RollupRule extends BaseCMI {
|
|
6445
|
+
_conditions = [];
|
|
6446
|
+
_action = "satisfied" /* SATISFIED */;
|
|
6447
|
+
_consideration = "all" /* ALL */;
|
|
6448
|
+
_minimumCount = 0;
|
|
6449
|
+
_minimumPercent = 0;
|
|
6394
6450
|
/**
|
|
6395
6451
|
* Constructor for RollupRule
|
|
6396
6452
|
* @param {RollupActionType} action - The action to take when the rule conditions are met
|
|
@@ -6400,11 +6456,6 @@ class RollupRule extends BaseCMI {
|
|
|
6400
6456
|
*/
|
|
6401
6457
|
constructor(action = "satisfied" /* SATISFIED */, consideration = "all" /* ALL */, minimumCount = 0, minimumPercent = 0) {
|
|
6402
6458
|
super("rollupRule");
|
|
6403
|
-
this._conditions = [];
|
|
6404
|
-
this._action = "satisfied" /* SATISFIED */;
|
|
6405
|
-
this._consideration = "all" /* ALL */;
|
|
6406
|
-
this._minimumCount = 0;
|
|
6407
|
-
this._minimumPercent = 0;
|
|
6408
6459
|
this._action = action;
|
|
6409
6460
|
this._consideration = consideration;
|
|
6410
6461
|
this._minimumCount = minimumCount;
|
|
@@ -6557,12 +6608,12 @@ class RollupRule extends BaseCMI {
|
|
|
6557
6608
|
}
|
|
6558
6609
|
}
|
|
6559
6610
|
class RollupRules extends BaseCMI {
|
|
6611
|
+
_rules = [];
|
|
6560
6612
|
/**
|
|
6561
6613
|
* Constructor for RollupRules
|
|
6562
6614
|
*/
|
|
6563
6615
|
constructor() {
|
|
6564
6616
|
super("rollupRules");
|
|
6565
|
-
this._rules = [];
|
|
6566
6617
|
}
|
|
6567
6618
|
/**
|
|
6568
6619
|
* Called when the API needs to be reset
|
|
@@ -6753,22 +6804,28 @@ class RollupRules extends BaseCMI {
|
|
|
6753
6804
|
}
|
|
6754
6805
|
|
|
6755
6806
|
class ActivityObjective {
|
|
6807
|
+
_id;
|
|
6808
|
+
_description;
|
|
6809
|
+
_satisfiedByMeasure;
|
|
6810
|
+
_minNormalizedMeasure;
|
|
6811
|
+
_mapInfo;
|
|
6812
|
+
_isPrimary;
|
|
6813
|
+
_satisfiedStatus = false;
|
|
6814
|
+
_satisfiedStatusKnown = false;
|
|
6815
|
+
// Note: measureStatus has no dirty flag because it is not synchronized to global
|
|
6816
|
+
// objectives. It serves as a validity gate for other synced properties.
|
|
6817
|
+
_measureStatus = false;
|
|
6818
|
+
_normalizedMeasure = 0;
|
|
6819
|
+
_progressMeasure = 0;
|
|
6820
|
+
_progressMeasureStatus = false;
|
|
6821
|
+
_completionStatus = CompletionStatus.UNKNOWN;
|
|
6822
|
+
_progressStatus = false;
|
|
6823
|
+
// Dirty flags for tracking which properties have been modified locally
|
|
6824
|
+
_satisfiedStatusDirty = false;
|
|
6825
|
+
_normalizedMeasureDirty = false;
|
|
6826
|
+
_completionStatusDirty = false;
|
|
6827
|
+
_progressMeasureDirty = false;
|
|
6756
6828
|
constructor(id, options = {}) {
|
|
6757
|
-
this._satisfiedStatus = false;
|
|
6758
|
-
this._satisfiedStatusKnown = false;
|
|
6759
|
-
// Note: measureStatus has no dirty flag because it is not synchronized to global
|
|
6760
|
-
// objectives. It serves as a validity gate for other synced properties.
|
|
6761
|
-
this._measureStatus = false;
|
|
6762
|
-
this._normalizedMeasure = 0;
|
|
6763
|
-
this._progressMeasure = 0;
|
|
6764
|
-
this._progressMeasureStatus = false;
|
|
6765
|
-
this._completionStatus = CompletionStatus.UNKNOWN;
|
|
6766
|
-
this._progressStatus = false;
|
|
6767
|
-
// Dirty flags for tracking which properties have been modified locally
|
|
6768
|
-
this._satisfiedStatusDirty = false;
|
|
6769
|
-
this._normalizedMeasureDirty = false;
|
|
6770
|
-
this._completionStatusDirty = false;
|
|
6771
|
-
this._progressMeasureDirty = false;
|
|
6772
6829
|
this._id = id;
|
|
6773
6830
|
this._description = options.description ?? null;
|
|
6774
6831
|
this._satisfiedByMeasure = options.satisfiedByMeasure ?? false;
|
|
@@ -6963,6 +7020,90 @@ class ActivityObjective {
|
|
|
6963
7020
|
}
|
|
6964
7021
|
}
|
|
6965
7022
|
class Activity extends BaseCMI {
|
|
7023
|
+
_id = "";
|
|
7024
|
+
_title = "";
|
|
7025
|
+
_children = [];
|
|
7026
|
+
_parent = null;
|
|
7027
|
+
_isVisible = true;
|
|
7028
|
+
_isActive = false;
|
|
7029
|
+
_isSuspended = false;
|
|
7030
|
+
_isCompleted = false;
|
|
7031
|
+
_completionStatus = CompletionStatus.UNKNOWN;
|
|
7032
|
+
_successStatus = SuccessStatus.UNKNOWN;
|
|
7033
|
+
_attemptCount = 0;
|
|
7034
|
+
_attemptCompletionAmount = 0;
|
|
7035
|
+
_attemptAbsoluteDuration = "PT0H0M0S";
|
|
7036
|
+
_attemptExperiencedDuration = "PT0H0M0S";
|
|
7037
|
+
_activityAbsoluteDuration = "PT0H0M0S";
|
|
7038
|
+
_activityExperiencedDuration = "PT0H0M0S";
|
|
7039
|
+
// Duration tracking fields (separate from limits) - actual calculated values
|
|
7040
|
+
_attemptAbsoluteDurationValue = "PT0H0M0S";
|
|
7041
|
+
_attemptExperiencedDurationValue = "PT0H0M0S";
|
|
7042
|
+
_activityAbsoluteDurationValue = "PT0H0M0S";
|
|
7043
|
+
_activityExperiencedDurationValue = "PT0H0M0S";
|
|
7044
|
+
// Timestamp tracking for duration calculation
|
|
7045
|
+
_activityStartTimestampUtc = null;
|
|
7046
|
+
_attemptStartTimestampUtc = null;
|
|
7047
|
+
_activityEndedDate = null;
|
|
7048
|
+
_objectiveSatisfiedStatus = false;
|
|
7049
|
+
_objectiveSatisfiedStatusKnown = false;
|
|
7050
|
+
_objectiveMeasureStatus = false;
|
|
7051
|
+
_objectiveNormalizedMeasure = 0;
|
|
7052
|
+
_scaledPassingScore = 0.7;
|
|
7053
|
+
// Default passing score
|
|
7054
|
+
// Dirty flags for tracking which activity-level objective properties have been modified locally
|
|
7055
|
+
_objectiveSatisfiedStatusDirty = false;
|
|
7056
|
+
_objectiveNormalizedMeasureDirty = false;
|
|
7057
|
+
_objectiveMeasureStatusDirty = false;
|
|
7058
|
+
_progressMeasure = 0;
|
|
7059
|
+
_progressMeasureStatus = false;
|
|
7060
|
+
_location = "";
|
|
7061
|
+
_attemptAbsoluteStartTime = "";
|
|
7062
|
+
_learnerPrefs = null;
|
|
7063
|
+
_activityAttemptActive = false;
|
|
7064
|
+
_isHiddenFromChoice = false;
|
|
7065
|
+
_isAvailable = true;
|
|
7066
|
+
_hideLmsUi = [];
|
|
7067
|
+
_auxiliaryResources = [];
|
|
7068
|
+
_attemptLimit = null;
|
|
7069
|
+
_attemptAbsoluteDurationLimit = null;
|
|
7070
|
+
_activityAbsoluteDurationLimit = null;
|
|
7071
|
+
_timeLimitAction = null;
|
|
7072
|
+
_timeLimitDuration = null;
|
|
7073
|
+
_beginTimeLimit = null;
|
|
7074
|
+
_endTimeLimit = null;
|
|
7075
|
+
_launchData = "";
|
|
7076
|
+
_credit = "credit";
|
|
7077
|
+
_maxTimeAllowed = "";
|
|
7078
|
+
_completionThreshold = "";
|
|
7079
|
+
_sequencingControls;
|
|
7080
|
+
_sequencingRules;
|
|
7081
|
+
_rollupRules;
|
|
7082
|
+
_processedChildren = null;
|
|
7083
|
+
_isNewAttempt = false;
|
|
7084
|
+
_primaryObjective = null;
|
|
7085
|
+
_objectives = [];
|
|
7086
|
+
_rollupConsiderations = {
|
|
7087
|
+
requiredForSatisfied: "always",
|
|
7088
|
+
requiredForNotSatisfied: "always",
|
|
7089
|
+
requiredForCompleted: "always",
|
|
7090
|
+
requiredForIncomplete: "always",
|
|
7091
|
+
measureSatisfactionIfActive: true
|
|
7092
|
+
};
|
|
7093
|
+
// Individual rollup consideration properties for this activity (RB.1.4.2)
|
|
7094
|
+
// These determine when THIS activity is included in parent rollup calculations
|
|
7095
|
+
_requiredForSatisfied = "always";
|
|
7096
|
+
_requiredForNotSatisfied = "always";
|
|
7097
|
+
_requiredForCompleted = "always";
|
|
7098
|
+
_requiredForIncomplete = "always";
|
|
7099
|
+
_wasSkipped = false;
|
|
7100
|
+
_attemptProgressStatus = false;
|
|
7101
|
+
_wasAutoCompleted = false;
|
|
7102
|
+
_wasAutoSatisfied = false;
|
|
7103
|
+
_completedByMeasure = false;
|
|
7104
|
+
_minProgressMeasure = 1;
|
|
7105
|
+
_progressWeight = 1;
|
|
7106
|
+
_attemptCompletionAmountStatus = false;
|
|
6966
7107
|
/**
|
|
6967
7108
|
* Constructor for Activity
|
|
6968
7109
|
* @param {string} id - The unique identifier for this activity
|
|
@@ -6970,87 +7111,6 @@ class Activity extends BaseCMI {
|
|
|
6970
7111
|
*/
|
|
6971
7112
|
constructor(id = "", title = "") {
|
|
6972
7113
|
super("activity");
|
|
6973
|
-
this._id = "";
|
|
6974
|
-
this._title = "";
|
|
6975
|
-
this._children = [];
|
|
6976
|
-
this._parent = null;
|
|
6977
|
-
this._isVisible = true;
|
|
6978
|
-
this._isActive = false;
|
|
6979
|
-
this._isSuspended = false;
|
|
6980
|
-
this._isCompleted = false;
|
|
6981
|
-
this._completionStatus = CompletionStatus.UNKNOWN;
|
|
6982
|
-
this._successStatus = SuccessStatus.UNKNOWN;
|
|
6983
|
-
this._attemptCount = 0;
|
|
6984
|
-
this._attemptCompletionAmount = 0;
|
|
6985
|
-
this._attemptAbsoluteDuration = "PT0H0M0S";
|
|
6986
|
-
this._attemptExperiencedDuration = "PT0H0M0S";
|
|
6987
|
-
this._activityAbsoluteDuration = "PT0H0M0S";
|
|
6988
|
-
this._activityExperiencedDuration = "PT0H0M0S";
|
|
6989
|
-
// Duration tracking fields (separate from limits) - actual calculated values
|
|
6990
|
-
this._attemptAbsoluteDurationValue = "PT0H0M0S";
|
|
6991
|
-
this._attemptExperiencedDurationValue = "PT0H0M0S";
|
|
6992
|
-
this._activityAbsoluteDurationValue = "PT0H0M0S";
|
|
6993
|
-
this._activityExperiencedDurationValue = "PT0H0M0S";
|
|
6994
|
-
// Timestamp tracking for duration calculation
|
|
6995
|
-
this._activityStartTimestampUtc = null;
|
|
6996
|
-
this._attemptStartTimestampUtc = null;
|
|
6997
|
-
this._activityEndedDate = null;
|
|
6998
|
-
this._objectiveSatisfiedStatus = false;
|
|
6999
|
-
this._objectiveSatisfiedStatusKnown = false;
|
|
7000
|
-
this._objectiveMeasureStatus = false;
|
|
7001
|
-
this._objectiveNormalizedMeasure = 0;
|
|
7002
|
-
this._scaledPassingScore = 0.7;
|
|
7003
|
-
// Default passing score
|
|
7004
|
-
// Dirty flags for tracking which activity-level objective properties have been modified locally
|
|
7005
|
-
this._objectiveSatisfiedStatusDirty = false;
|
|
7006
|
-
this._objectiveNormalizedMeasureDirty = false;
|
|
7007
|
-
this._objectiveMeasureStatusDirty = false;
|
|
7008
|
-
this._progressMeasure = 0;
|
|
7009
|
-
this._progressMeasureStatus = false;
|
|
7010
|
-
this._location = "";
|
|
7011
|
-
this._attemptAbsoluteStartTime = "";
|
|
7012
|
-
this._learnerPrefs = null;
|
|
7013
|
-
this._activityAttemptActive = false;
|
|
7014
|
-
this._isHiddenFromChoice = false;
|
|
7015
|
-
this._isAvailable = true;
|
|
7016
|
-
this._hideLmsUi = [];
|
|
7017
|
-
this._auxiliaryResources = [];
|
|
7018
|
-
this._attemptLimit = null;
|
|
7019
|
-
this._attemptAbsoluteDurationLimit = null;
|
|
7020
|
-
this._activityAbsoluteDurationLimit = null;
|
|
7021
|
-
this._timeLimitAction = null;
|
|
7022
|
-
this._timeLimitDuration = null;
|
|
7023
|
-
this._beginTimeLimit = null;
|
|
7024
|
-
this._endTimeLimit = null;
|
|
7025
|
-
this._launchData = "";
|
|
7026
|
-
this._credit = "credit";
|
|
7027
|
-
this._maxTimeAllowed = "";
|
|
7028
|
-
this._completionThreshold = "";
|
|
7029
|
-
this._processedChildren = null;
|
|
7030
|
-
this._isNewAttempt = false;
|
|
7031
|
-
this._primaryObjective = null;
|
|
7032
|
-
this._objectives = [];
|
|
7033
|
-
this._rollupConsiderations = {
|
|
7034
|
-
requiredForSatisfied: "always",
|
|
7035
|
-
requiredForNotSatisfied: "always",
|
|
7036
|
-
requiredForCompleted: "always",
|
|
7037
|
-
requiredForIncomplete: "always",
|
|
7038
|
-
measureSatisfactionIfActive: true
|
|
7039
|
-
};
|
|
7040
|
-
// Individual rollup consideration properties for this activity (RB.1.4.2)
|
|
7041
|
-
// These determine when THIS activity is included in parent rollup calculations
|
|
7042
|
-
this._requiredForSatisfied = "always";
|
|
7043
|
-
this._requiredForNotSatisfied = "always";
|
|
7044
|
-
this._requiredForCompleted = "always";
|
|
7045
|
-
this._requiredForIncomplete = "always";
|
|
7046
|
-
this._wasSkipped = false;
|
|
7047
|
-
this._attemptProgressStatus = false;
|
|
7048
|
-
this._wasAutoCompleted = false;
|
|
7049
|
-
this._wasAutoSatisfied = false;
|
|
7050
|
-
this._completedByMeasure = false;
|
|
7051
|
-
this._minProgressMeasure = 1;
|
|
7052
|
-
this._progressWeight = 1;
|
|
7053
|
-
this._attemptCompletionAmountStatus = false;
|
|
7054
7114
|
this._id = id;
|
|
7055
7115
|
this._title = title;
|
|
7056
7116
|
this._sequencingControls = new SequencingControls();
|
|
@@ -8756,6 +8816,7 @@ class RollupChildFilter {
|
|
|
8756
8816
|
}
|
|
8757
8817
|
|
|
8758
8818
|
class RollupRuleEvaluator {
|
|
8819
|
+
childFilter;
|
|
8759
8820
|
/**
|
|
8760
8821
|
* Create a new RollupRuleEvaluator
|
|
8761
8822
|
*
|
|
@@ -8877,6 +8938,8 @@ class RollupRuleEvaluator {
|
|
|
8877
8938
|
}
|
|
8878
8939
|
|
|
8879
8940
|
class MeasureRollupProcessor {
|
|
8941
|
+
childFilter;
|
|
8942
|
+
eventCallback;
|
|
8880
8943
|
/**
|
|
8881
8944
|
* Create a new MeasureRollupProcessor
|
|
8882
8945
|
*
|
|
@@ -9053,6 +9116,9 @@ class MeasureRollupProcessor {
|
|
|
9053
9116
|
}
|
|
9054
9117
|
|
|
9055
9118
|
class ObjectiveRollupProcessor {
|
|
9119
|
+
childFilter;
|
|
9120
|
+
ruleEvaluator;
|
|
9121
|
+
eventCallback;
|
|
9056
9122
|
/**
|
|
9057
9123
|
* Create a new ObjectiveRollupProcessor
|
|
9058
9124
|
*
|
|
@@ -9187,6 +9253,10 @@ class ObjectiveRollupProcessor {
|
|
|
9187
9253
|
}
|
|
9188
9254
|
|
|
9189
9255
|
class ProgressRollupProcessor {
|
|
9256
|
+
childFilter;
|
|
9257
|
+
ruleEvaluator;
|
|
9258
|
+
objectiveProcessor;
|
|
9259
|
+
eventCallback;
|
|
9190
9260
|
/**
|
|
9191
9261
|
* Create a new ProgressRollupProcessor
|
|
9192
9262
|
*
|
|
@@ -9280,6 +9350,7 @@ class ProgressRollupProcessor {
|
|
|
9280
9350
|
}
|
|
9281
9351
|
|
|
9282
9352
|
class DurationRollupProcessor {
|
|
9353
|
+
eventCallback;
|
|
9283
9354
|
/**
|
|
9284
9355
|
* Create a new DurationRollupProcessor
|
|
9285
9356
|
*
|
|
@@ -9388,6 +9459,11 @@ class DurationRollupProcessor {
|
|
|
9388
9459
|
|
|
9389
9460
|
const MAX_CLUSTER_DEPTH = 10;
|
|
9390
9461
|
class CrossClusterProcessor {
|
|
9462
|
+
measureProcessor;
|
|
9463
|
+
objectiveProcessor;
|
|
9464
|
+
progressProcessor;
|
|
9465
|
+
eventCallback;
|
|
9466
|
+
processingClusters = /* @__PURE__ */ new Set();
|
|
9391
9467
|
/**
|
|
9392
9468
|
* Create a new CrossClusterProcessor
|
|
9393
9469
|
*
|
|
@@ -9397,7 +9473,6 @@ class CrossClusterProcessor {
|
|
|
9397
9473
|
* @param eventCallback - Optional callback for firing events
|
|
9398
9474
|
*/
|
|
9399
9475
|
constructor(measureProcessor, objectiveProcessor, progressProcessor, eventCallback) {
|
|
9400
|
-
this.processingClusters = /* @__PURE__ */ new Set();
|
|
9401
9476
|
this.measureProcessor = measureProcessor;
|
|
9402
9477
|
this.objectiveProcessor = objectiveProcessor;
|
|
9403
9478
|
this.progressProcessor = progressProcessor;
|
|
@@ -9538,6 +9613,7 @@ class CrossClusterProcessor {
|
|
|
9538
9613
|
}
|
|
9539
9614
|
|
|
9540
9615
|
class GlobalObjectiveSynchronizer {
|
|
9616
|
+
eventCallback;
|
|
9541
9617
|
/**
|
|
9542
9618
|
* Create a new GlobalObjectiveSynchronizer
|
|
9543
9619
|
*
|
|
@@ -9928,6 +10004,9 @@ class GlobalObjectiveSynchronizer {
|
|
|
9928
10004
|
}
|
|
9929
10005
|
|
|
9930
10006
|
class RollupStateValidator {
|
|
10007
|
+
rollupStateLog = [];
|
|
10008
|
+
childFilter;
|
|
10009
|
+
eventCallback;
|
|
9931
10010
|
/**
|
|
9932
10011
|
* Create a new RollupStateValidator
|
|
9933
10012
|
*
|
|
@@ -9935,7 +10014,6 @@ class RollupStateValidator {
|
|
|
9935
10014
|
* @param eventCallback - Optional callback for firing events
|
|
9936
10015
|
*/
|
|
9937
10016
|
constructor(childFilter, eventCallback) {
|
|
9938
|
-
this.rollupStateLog = [];
|
|
9939
10017
|
this.childFilter = childFilter;
|
|
9940
10018
|
this.eventCallback = eventCallback || null;
|
|
9941
10019
|
}
|
|
@@ -10059,6 +10137,16 @@ class RollupStateValidator {
|
|
|
10059
10137
|
}
|
|
10060
10138
|
|
|
10061
10139
|
class RollupProcess {
|
|
10140
|
+
childFilter;
|
|
10141
|
+
ruleEvaluator;
|
|
10142
|
+
measureProcessor;
|
|
10143
|
+
objectiveProcessor;
|
|
10144
|
+
progressProcessor;
|
|
10145
|
+
durationProcessor;
|
|
10146
|
+
globalObjectiveSynchronizer;
|
|
10147
|
+
stateValidator;
|
|
10148
|
+
crossClusterProcessor;
|
|
10149
|
+
eventCallback;
|
|
10062
10150
|
/**
|
|
10063
10151
|
* Create a new RollupProcess orchestrator
|
|
10064
10152
|
*
|
|
@@ -10271,6 +10359,7 @@ function validateSuccessStatus(value) {
|
|
|
10271
10359
|
return null;
|
|
10272
10360
|
}
|
|
10273
10361
|
class RteDataTransferService {
|
|
10362
|
+
context;
|
|
10274
10363
|
constructor(context) {
|
|
10275
10364
|
this.context = context;
|
|
10276
10365
|
}
|
|
@@ -10432,8 +10521,16 @@ class RteDataTransferService {
|
|
|
10432
10521
|
}
|
|
10433
10522
|
|
|
10434
10523
|
class TerminationHandler {
|
|
10524
|
+
activityTree;
|
|
10525
|
+
sequencingProcess;
|
|
10526
|
+
rollupProcess;
|
|
10527
|
+
globalObjectiveMap;
|
|
10528
|
+
eventCallback;
|
|
10529
|
+
getCMIData;
|
|
10530
|
+
is4thEdition;
|
|
10531
|
+
invalidateCacheCallback = null;
|
|
10532
|
+
_rteDataTransferService;
|
|
10435
10533
|
constructor(activityTree, sequencingProcess, rollupProcess, globalObjectiveMap, eventCallback = null, options) {
|
|
10436
|
-
this.invalidateCacheCallback = null;
|
|
10437
10534
|
this.activityTree = activityTree;
|
|
10438
10535
|
this.sequencingProcess = sequencingProcess;
|
|
10439
10536
|
this.rollupProcess = rollupProcess;
|
|
@@ -10545,7 +10642,7 @@ class TerminationHandler {
|
|
|
10545
10642
|
this.endAttempt(this.activityTree.currentActivity);
|
|
10546
10643
|
}
|
|
10547
10644
|
}
|
|
10548
|
-
let processedExit
|
|
10645
|
+
let processedExit;
|
|
10549
10646
|
let postConditionResult;
|
|
10550
10647
|
do {
|
|
10551
10648
|
processedExit = false;
|
|
@@ -11018,6 +11115,9 @@ class TerminationHandler {
|
|
|
11018
11115
|
}
|
|
11019
11116
|
|
|
11020
11117
|
class DeliveryRequest {
|
|
11118
|
+
valid;
|
|
11119
|
+
targetActivity;
|
|
11120
|
+
exception;
|
|
11021
11121
|
constructor(valid = false, targetActivity = null, exception = null) {
|
|
11022
11122
|
this.valid = valid;
|
|
11023
11123
|
this.targetActivity = targetActivity;
|
|
@@ -11025,13 +11125,22 @@ class DeliveryRequest {
|
|
|
11025
11125
|
}
|
|
11026
11126
|
}
|
|
11027
11127
|
class DeliveryHandler {
|
|
11128
|
+
static HIDE_LMS_UI_ORDER = [...HIDE_LMS_UI_TOKENS];
|
|
11129
|
+
activityTree;
|
|
11130
|
+
rollupProcess;
|
|
11131
|
+
globalObjectiveMap;
|
|
11132
|
+
adlNav;
|
|
11133
|
+
eventCallback;
|
|
11134
|
+
now;
|
|
11135
|
+
defaultHideLmsUi;
|
|
11136
|
+
defaultAuxiliaryResources;
|
|
11137
|
+
_deliveryInProgress = false;
|
|
11138
|
+
contentDelivered = false;
|
|
11139
|
+
checkActivityCallback = null;
|
|
11140
|
+
invalidateCacheCallback = null;
|
|
11141
|
+
updateNavigationValidityCallback = null;
|
|
11142
|
+
clearSuspendedActivityCallback = null;
|
|
11028
11143
|
constructor(activityTree, rollupProcess, globalObjectiveMap, adlNav = null, eventCallback = null, options) {
|
|
11029
|
-
this._deliveryInProgress = false;
|
|
11030
|
-
this.contentDelivered = false;
|
|
11031
|
-
this.checkActivityCallback = null;
|
|
11032
|
-
this.invalidateCacheCallback = null;
|
|
11033
|
-
this.updateNavigationValidityCallback = null;
|
|
11034
|
-
this.clearSuspendedActivityCallback = null;
|
|
11035
11144
|
this.activityTree = activityTree;
|
|
11036
11145
|
this.rollupProcess = rollupProcess;
|
|
11037
11146
|
this.globalObjectiveMap = globalObjectiveMap;
|
|
@@ -11041,9 +11150,6 @@ class DeliveryHandler {
|
|
|
11041
11150
|
this.defaultHideLmsUi = options?.defaultHideLmsUi ? [...options.defaultHideLmsUi] : [];
|
|
11042
11151
|
this.defaultAuxiliaryResources = options?.defaultAuxiliaryResources ? options.defaultAuxiliaryResources.map((resource) => ({ ...resource })) : [];
|
|
11043
11152
|
}
|
|
11044
|
-
static {
|
|
11045
|
-
this.HIDE_LMS_UI_ORDER = [...HIDE_LMS_UI_TOKENS];
|
|
11046
|
-
}
|
|
11047
11153
|
/**
|
|
11048
11154
|
* Set callback to check activity validity
|
|
11049
11155
|
*/
|
|
@@ -11328,9 +11434,11 @@ class DeliveryHandler {
|
|
|
11328
11434
|
}
|
|
11329
11435
|
|
|
11330
11436
|
class NavigationLookAhead {
|
|
11437
|
+
activityTree;
|
|
11438
|
+
sequencingProcess;
|
|
11439
|
+
cache = null;
|
|
11440
|
+
isDirty = true;
|
|
11331
11441
|
constructor(activityTree, sequencingProcess) {
|
|
11332
|
-
this.cache = null;
|
|
11333
|
-
this.isDirty = true;
|
|
11334
11442
|
this.activityTree = activityTree;
|
|
11335
11443
|
this.sequencingProcess = sequencingProcess;
|
|
11336
11444
|
}
|
|
@@ -11681,6 +11789,11 @@ var NavigationRequestType = /* @__PURE__ */ ((NavigationRequestType2) => {
|
|
|
11681
11789
|
return NavigationRequestType2;
|
|
11682
11790
|
})(NavigationRequestType || {});
|
|
11683
11791
|
class NavigationRequestResult {
|
|
11792
|
+
valid;
|
|
11793
|
+
terminationRequest;
|
|
11794
|
+
sequencingRequest;
|
|
11795
|
+
targetActivityId;
|
|
11796
|
+
exception;
|
|
11684
11797
|
constructor(valid = false, terminationRequest = null, sequencingRequest = null, targetActivityId = null, exception = null) {
|
|
11685
11798
|
this.valid = valid;
|
|
11686
11799
|
this.terminationRequest = terminationRequest;
|
|
@@ -11690,8 +11803,13 @@ class NavigationRequestResult {
|
|
|
11690
11803
|
}
|
|
11691
11804
|
}
|
|
11692
11805
|
class NavigationValidityService {
|
|
11806
|
+
activityTree;
|
|
11807
|
+
sequencingProcess;
|
|
11808
|
+
adlNav;
|
|
11809
|
+
eventCallback;
|
|
11810
|
+
navigationLookAhead;
|
|
11811
|
+
getEffectiveHideLmsUiCallback = null;
|
|
11693
11812
|
constructor(activityTree, sequencingProcess, adlNav = null, eventCallback = null) {
|
|
11694
|
-
this.getEffectiveHideLmsUiCallback = null;
|
|
11695
11813
|
this.activityTree = activityTree;
|
|
11696
11814
|
this.sequencingProcess = sequencingProcess;
|
|
11697
11815
|
this.adlNav = adlNav;
|
|
@@ -12376,9 +12494,9 @@ class NavigationValidityService {
|
|
|
12376
12494
|
}
|
|
12377
12495
|
|
|
12378
12496
|
class GlobalObjectiveService {
|
|
12497
|
+
globalObjectiveMap = /* @__PURE__ */ new Map();
|
|
12498
|
+
eventCallback = null;
|
|
12379
12499
|
constructor(eventCallback) {
|
|
12380
|
-
this.globalObjectiveMap = /* @__PURE__ */ new Map();
|
|
12381
|
-
this.eventCallback = null;
|
|
12382
12500
|
this.eventCallback = eventCallback || null;
|
|
12383
12501
|
}
|
|
12384
12502
|
/**
|
|
@@ -12637,11 +12755,16 @@ class GlobalObjectiveService {
|
|
|
12637
12755
|
}
|
|
12638
12756
|
|
|
12639
12757
|
class SequencingStateManager {
|
|
12758
|
+
activityTree;
|
|
12759
|
+
globalObjectiveService;
|
|
12760
|
+
rollupProcess;
|
|
12761
|
+
adlNav;
|
|
12762
|
+
eventCallback;
|
|
12763
|
+
getEffectiveHideLmsUiCallback = null;
|
|
12764
|
+
getEffectiveAuxiliaryResourcesCallback = null;
|
|
12765
|
+
contentDeliveredGetter = null;
|
|
12766
|
+
contentDeliveredSetter = null;
|
|
12640
12767
|
constructor(activityTree, globalObjectiveService, rollupProcess, adlNav = null, eventCallback = null) {
|
|
12641
|
-
this.getEffectiveHideLmsUiCallback = null;
|
|
12642
|
-
this.getEffectiveAuxiliaryResourcesCallback = null;
|
|
12643
|
-
this.contentDeliveredGetter = null;
|
|
12644
|
-
this.contentDeliveredSetter = null;
|
|
12645
12768
|
this.activityTree = activityTree;
|
|
12646
12769
|
this.globalObjectiveService = globalObjectiveService;
|
|
12647
12770
|
this.rollupProcess = rollupProcess;
|
|
@@ -13008,8 +13131,11 @@ class SequencingStateManager {
|
|
|
13008
13131
|
}
|
|
13009
13132
|
|
|
13010
13133
|
class DeliveryValidator {
|
|
13134
|
+
activityTree;
|
|
13135
|
+
eventCallback;
|
|
13136
|
+
now;
|
|
13137
|
+
contentDeliveredGetter = null;
|
|
13011
13138
|
constructor(activityTree, eventCallback = null, options) {
|
|
13012
|
-
this.contentDeliveredGetter = null;
|
|
13013
13139
|
this.activityTree = activityTree;
|
|
13014
13140
|
this.eventCallback = eventCallback;
|
|
13015
13141
|
this.now = options?.now || (() => /* @__PURE__ */ new Date());
|
|
@@ -13586,8 +13712,24 @@ class DeliveryValidator {
|
|
|
13586
13712
|
}
|
|
13587
13713
|
|
|
13588
13714
|
class OverallSequencingProcess {
|
|
13715
|
+
// Core dependencies
|
|
13716
|
+
activityTree;
|
|
13717
|
+
sequencingProcess;
|
|
13718
|
+
rollupProcess;
|
|
13719
|
+
adlNav;
|
|
13720
|
+
eventCallback = null;
|
|
13721
|
+
// Extracted services
|
|
13722
|
+
terminationHandler;
|
|
13723
|
+
deliveryHandler;
|
|
13724
|
+
navigationValidityService;
|
|
13725
|
+
globalObjectiveService;
|
|
13726
|
+
stateManager;
|
|
13727
|
+
deliveryValidator;
|
|
13728
|
+
navigationLookAhead;
|
|
13729
|
+
// Configuration
|
|
13730
|
+
enhancedDeliveryValidation;
|
|
13731
|
+
is4thEdition;
|
|
13589
13732
|
constructor(activityTree, sequencingProcess, rollupProcess, adlNav = null, eventCallback = null, options) {
|
|
13590
|
-
this.eventCallback = null;
|
|
13591
13733
|
this.activityTree = activityTree;
|
|
13592
13734
|
this.sequencingProcess = sequencingProcess;
|
|
13593
13735
|
this.rollupProcess = rollupProcess;
|
|
@@ -14057,14 +14199,22 @@ class OverallSequencingProcess {
|
|
|
14057
14199
|
}
|
|
14058
14200
|
|
|
14059
14201
|
class SequencingService {
|
|
14202
|
+
sequencing;
|
|
14203
|
+
cmi;
|
|
14204
|
+
adl;
|
|
14205
|
+
eventService;
|
|
14206
|
+
loggingService;
|
|
14207
|
+
activityDeliveryService;
|
|
14208
|
+
rollupProcess;
|
|
14209
|
+
overallSequencingProcess = null;
|
|
14210
|
+
sequencingProcess = null;
|
|
14211
|
+
eventListeners = {};
|
|
14212
|
+
configuration;
|
|
14213
|
+
isInitialized = false;
|
|
14214
|
+
isSequencingActive = false;
|
|
14215
|
+
lastCMIValues = /* @__PURE__ */ new Map();
|
|
14216
|
+
lastSequencingResult = null;
|
|
14060
14217
|
constructor(sequencing, cmi, adl, eventService, loggingService, configuration = {}) {
|
|
14061
|
-
this.overallSequencingProcess = null;
|
|
14062
|
-
this.sequencingProcess = null;
|
|
14063
|
-
this.eventListeners = {};
|
|
14064
|
-
this.isInitialized = false;
|
|
14065
|
-
this.isSequencingActive = false;
|
|
14066
|
-
this.lastCMIValues = /* @__PURE__ */ new Map();
|
|
14067
|
-
this.lastSequencingResult = null;
|
|
14068
14218
|
this.sequencing = sequencing;
|
|
14069
14219
|
this.cmi = cmi;
|
|
14070
14220
|
this.adl = adl;
|
|
@@ -14968,6 +15118,8 @@ class SerializationService {
|
|
|
14968
15118
|
}
|
|
14969
15119
|
|
|
14970
15120
|
class SynchronousHttpService {
|
|
15121
|
+
settings;
|
|
15122
|
+
error_codes;
|
|
14971
15123
|
/**
|
|
14972
15124
|
* Constructor for SynchronousHttpService
|
|
14973
15125
|
* @param {InternalSettings} settings - The settings object
|
|
@@ -15170,6 +15322,17 @@ class ValidationService {
|
|
|
15170
15322
|
const validationService = new ValidationService();
|
|
15171
15323
|
|
|
15172
15324
|
class BaseAPI {
|
|
15325
|
+
_timeout;
|
|
15326
|
+
_error_codes;
|
|
15327
|
+
_settings = DefaultSettings;
|
|
15328
|
+
_httpService;
|
|
15329
|
+
_eventService;
|
|
15330
|
+
_serializationService;
|
|
15331
|
+
_errorHandlingService;
|
|
15332
|
+
_loggingService;
|
|
15333
|
+
_offlineStorageService;
|
|
15334
|
+
_cmiValueAccessService;
|
|
15335
|
+
_courseId = "";
|
|
15173
15336
|
/**
|
|
15174
15337
|
* Constructor for Base API class. Sets some shared API fields, as well as
|
|
15175
15338
|
* sets up options for the API.
|
|
@@ -15184,8 +15347,6 @@ class BaseAPI {
|
|
|
15184
15347
|
* @param {IOfflineStorageService} offlineStorageService - Optional Offline Storage service instance
|
|
15185
15348
|
*/
|
|
15186
15349
|
constructor(error_codes, settings, httpService, eventService, serializationService, cmiDataService, errorHandlingService, loggingService, offlineStorageService) {
|
|
15187
|
-
this._settings = DefaultSettings;
|
|
15188
|
-
this._courseId = "";
|
|
15189
15350
|
if (new.target === BaseAPI) {
|
|
15190
15351
|
throw new TypeError("Cannot construct BaseAPI instances directly");
|
|
15191
15352
|
}
|
|
@@ -15312,6 +15473,8 @@ class BaseAPI {
|
|
|
15312
15473
|
};
|
|
15313
15474
|
this._cmiValueAccessService = new CMIValueAccessService(cmiValueAccessContext);
|
|
15314
15475
|
}
|
|
15476
|
+
startingData;
|
|
15477
|
+
currentState;
|
|
15315
15478
|
/**
|
|
15316
15479
|
* Get the last error code
|
|
15317
15480
|
* @return {string}
|
|
@@ -16224,16 +16387,16 @@ class BaseAPI {
|
|
|
16224
16387
|
}
|
|
16225
16388
|
|
|
16226
16389
|
class CMILearnerPreference extends BaseCMI {
|
|
16390
|
+
__children = scorm2004_constants.student_preference_children;
|
|
16391
|
+
_audio_level = "1";
|
|
16392
|
+
_language = "";
|
|
16393
|
+
_delivery_speed = "1";
|
|
16394
|
+
_audio_captioning = "0";
|
|
16227
16395
|
/**
|
|
16228
16396
|
* Constructor for cmi.learner_preference
|
|
16229
16397
|
*/
|
|
16230
16398
|
constructor() {
|
|
16231
16399
|
super("cmi.learner_preference");
|
|
16232
|
-
this.__children = scorm2004_constants.student_preference_children;
|
|
16233
|
-
this._audio_level = "1";
|
|
16234
|
-
this._language = "";
|
|
16235
|
-
this._delivery_speed = "1";
|
|
16236
|
-
this._audio_captioning = "0";
|
|
16237
16400
|
}
|
|
16238
16401
|
/**
|
|
16239
16402
|
* Called when the API has been reset
|
|
@@ -16397,20 +16560,20 @@ class CMIInteractions extends CMIArray {
|
|
|
16397
16560
|
}
|
|
16398
16561
|
}
|
|
16399
16562
|
class CMIInteractionsObject extends BaseCMI {
|
|
16563
|
+
_id = "";
|
|
16564
|
+
_idIsSet = false;
|
|
16565
|
+
_type = "";
|
|
16566
|
+
_timestamp = "";
|
|
16567
|
+
_weighting = "";
|
|
16568
|
+
_learner_response = "";
|
|
16569
|
+
_result = "";
|
|
16570
|
+
_latency = "";
|
|
16571
|
+
_description = "";
|
|
16400
16572
|
/**
|
|
16401
16573
|
* Constructor for cmi.interaction.n
|
|
16402
16574
|
*/
|
|
16403
16575
|
constructor() {
|
|
16404
16576
|
super("cmi.interactions.n");
|
|
16405
|
-
this._id = "";
|
|
16406
|
-
this._idIsSet = false;
|
|
16407
|
-
this._type = "";
|
|
16408
|
-
this._timestamp = "";
|
|
16409
|
-
this._weighting = "";
|
|
16410
|
-
this._learner_response = "";
|
|
16411
|
-
this._result = "";
|
|
16412
|
-
this._latency = "";
|
|
16413
|
-
this._description = "";
|
|
16414
16577
|
this.objectives = new CMIArray({
|
|
16415
16578
|
CMIElement: "cmi.interactions.n.objectives",
|
|
16416
16579
|
errorCode: scorm2004_errors.READ_ONLY_ELEMENT,
|
|
@@ -16424,6 +16587,8 @@ class CMIInteractionsObject extends BaseCMI {
|
|
|
16424
16587
|
children: scorm2004_constants.correct_responses_children
|
|
16425
16588
|
});
|
|
16426
16589
|
}
|
|
16590
|
+
objectives;
|
|
16591
|
+
correct_responses;
|
|
16427
16592
|
/**
|
|
16428
16593
|
* Called when the API has been initialized after the CMI has been created
|
|
16429
16594
|
*/
|
|
@@ -16763,12 +16928,12 @@ class CMIInteractionsObject extends BaseCMI {
|
|
|
16763
16928
|
}
|
|
16764
16929
|
}
|
|
16765
16930
|
class CMIInteractionsObjectivesObject extends BaseCMI {
|
|
16931
|
+
_id = "";
|
|
16766
16932
|
/**
|
|
16767
16933
|
* Constructor for cmi.interactions.n.objectives.n
|
|
16768
16934
|
*/
|
|
16769
16935
|
constructor() {
|
|
16770
16936
|
super("cmi.interactions.n.objectives.n");
|
|
16771
|
-
this._id = "";
|
|
16772
16937
|
}
|
|
16773
16938
|
/**
|
|
16774
16939
|
* Called when the API has been reset
|
|
@@ -16983,13 +17148,14 @@ function validatePattern(type, pattern, responseDef) {
|
|
|
16983
17148
|
}
|
|
16984
17149
|
}
|
|
16985
17150
|
class CMIInteractionsCorrectResponsesObject extends BaseCMI {
|
|
17151
|
+
_pattern = "";
|
|
17152
|
+
_interactionType;
|
|
16986
17153
|
/**
|
|
16987
17154
|
* Constructor for cmi.interactions.n.correct_responses.n
|
|
16988
17155
|
* @param interactionType The type of interaction (e.g. "numeric", "choice", etc.)
|
|
16989
17156
|
*/
|
|
16990
17157
|
constructor(interactionType) {
|
|
16991
17158
|
super("cmi.interactions.n.correct_responses.n");
|
|
16992
|
-
this._pattern = "";
|
|
16993
17159
|
this._interactionType = interactionType;
|
|
16994
17160
|
}
|
|
16995
17161
|
reset() {
|
|
@@ -17026,6 +17192,21 @@ class CMIInteractionsCorrectResponsesObject extends BaseCMI {
|
|
|
17026
17192
|
}
|
|
17027
17193
|
|
|
17028
17194
|
class CMIScore extends BaseCMI {
|
|
17195
|
+
__children;
|
|
17196
|
+
/**
|
|
17197
|
+
* Score range validation pattern (e.g., "0#100" for SCORM 1.2).
|
|
17198
|
+
* Set to `false` to disable range validation (e.g., for SCORM 2004 where scores have no upper bound).
|
|
17199
|
+
* This property is intentionally unused in the base class but provides subclass flexibility.
|
|
17200
|
+
*/
|
|
17201
|
+
__score_range;
|
|
17202
|
+
__invalid_error_code;
|
|
17203
|
+
__invalid_type_code;
|
|
17204
|
+
__invalid_range_code;
|
|
17205
|
+
__decimal_regex;
|
|
17206
|
+
__error_class;
|
|
17207
|
+
_raw = "";
|
|
17208
|
+
_min = "";
|
|
17209
|
+
_max;
|
|
17029
17210
|
/**
|
|
17030
17211
|
* Constructor for *.score
|
|
17031
17212
|
*
|
|
@@ -17049,8 +17230,6 @@ class CMIScore extends BaseCMI {
|
|
|
17049
17230
|
*/
|
|
17050
17231
|
constructor(params) {
|
|
17051
17232
|
super(params.CMIElement);
|
|
17052
|
-
this._raw = "";
|
|
17053
|
-
this._min = "";
|
|
17054
17233
|
this.__children = params.score_children || scorm12_constants.score_children;
|
|
17055
17234
|
this.__score_range = !params.score_range ? false : scorm12_regex.score_range;
|
|
17056
17235
|
this._max = params.max || params.max === "" ? params.max : "100";
|
|
@@ -17198,6 +17377,7 @@ class CMIScore extends BaseCMI {
|
|
|
17198
17377
|
}
|
|
17199
17378
|
|
|
17200
17379
|
class Scorm2004CMIScore extends CMIScore {
|
|
17380
|
+
_scaled = "";
|
|
17201
17381
|
/**
|
|
17202
17382
|
* Constructor for cmi *.score
|
|
17203
17383
|
*/
|
|
@@ -17212,7 +17392,6 @@ class Scorm2004CMIScore extends CMIScore {
|
|
|
17212
17392
|
decimalRegex: scorm2004_regex.CMIDecimal,
|
|
17213
17393
|
errorClass: Scorm2004ValidationError
|
|
17214
17394
|
});
|
|
17215
|
-
this._scaled = "";
|
|
17216
17395
|
}
|
|
17217
17396
|
/**
|
|
17218
17397
|
* Called when the API has been reset
|
|
@@ -17299,6 +17478,10 @@ class CMICommentsFromLearner extends CMIArray {
|
|
|
17299
17478
|
}
|
|
17300
17479
|
}
|
|
17301
17480
|
class CMICommentsObject extends BaseCMI {
|
|
17481
|
+
_comment = "";
|
|
17482
|
+
_location = "";
|
|
17483
|
+
_timestamp = "";
|
|
17484
|
+
_readOnlyAfterInit;
|
|
17302
17485
|
/**
|
|
17303
17486
|
* Constructor for cmi.comments_from_learner.n and cmi.comments_from_lms.n
|
|
17304
17487
|
* @param {boolean} readOnlyAfterInit
|
|
@@ -17308,9 +17491,6 @@ class CMICommentsObject extends BaseCMI {
|
|
|
17308
17491
|
this._comment = "";
|
|
17309
17492
|
this._location = "";
|
|
17310
17493
|
this._timestamp = "";
|
|
17311
|
-
this._comment = "";
|
|
17312
|
-
this._location = "";
|
|
17313
|
-
this._timestamp = "";
|
|
17314
17494
|
this._readOnlyAfterInit = readOnlyAfterInit;
|
|
17315
17495
|
}
|
|
17316
17496
|
/**
|
|
@@ -17453,17 +17633,17 @@ class CMIObjectives extends CMIArray {
|
|
|
17453
17633
|
}
|
|
17454
17634
|
}
|
|
17455
17635
|
class CMIObjectivesObject extends BaseCMI {
|
|
17636
|
+
_id = "";
|
|
17637
|
+
_idIsSet = false;
|
|
17638
|
+
_success_status = "unknown";
|
|
17639
|
+
_completion_status = "unknown";
|
|
17640
|
+
_progress_measure = "";
|
|
17641
|
+
_description = "";
|
|
17456
17642
|
/**
|
|
17457
17643
|
* Constructor for cmi.objectives.n
|
|
17458
17644
|
*/
|
|
17459
17645
|
constructor() {
|
|
17460
17646
|
super("cmi.objectives.n");
|
|
17461
|
-
this._id = "";
|
|
17462
|
-
this._idIsSet = false;
|
|
17463
|
-
this._success_status = "unknown";
|
|
17464
|
-
this._completion_status = "unknown";
|
|
17465
|
-
this._progress_measure = "";
|
|
17466
|
-
this._description = "";
|
|
17467
17647
|
this.score = new Scorm2004CMIScore();
|
|
17468
17648
|
}
|
|
17469
17649
|
reset() {
|
|
@@ -17476,6 +17656,7 @@ class CMIObjectivesObject extends BaseCMI {
|
|
|
17476
17656
|
this._description = "";
|
|
17477
17657
|
this.score?.reset();
|
|
17478
17658
|
}
|
|
17659
|
+
score;
|
|
17479
17660
|
/**
|
|
17480
17661
|
* Called when the API has been initialized after the CMI has been created
|
|
17481
17662
|
*/
|
|
@@ -17675,13 +17856,13 @@ class CMIObjectivesObject extends BaseCMI {
|
|
|
17675
17856
|
}
|
|
17676
17857
|
|
|
17677
17858
|
class CMIMetadata extends BaseCMI {
|
|
17859
|
+
__version = "1.0";
|
|
17860
|
+
__children = scorm2004_constants.cmi_children;
|
|
17678
17861
|
/**
|
|
17679
17862
|
* Constructor for CMIMetadata
|
|
17680
17863
|
*/
|
|
17681
17864
|
constructor() {
|
|
17682
17865
|
super("cmi");
|
|
17683
|
-
this.__version = "1.0";
|
|
17684
|
-
this.__children = scorm2004_constants.cmi_children;
|
|
17685
17866
|
}
|
|
17686
17867
|
/**
|
|
17687
17868
|
* Getter for __version
|
|
@@ -17726,13 +17907,13 @@ class CMIMetadata extends BaseCMI {
|
|
|
17726
17907
|
}
|
|
17727
17908
|
|
|
17728
17909
|
class CMILearner extends BaseCMI {
|
|
17910
|
+
_learner_id = "";
|
|
17911
|
+
_learner_name = "";
|
|
17729
17912
|
/**
|
|
17730
17913
|
* Constructor for CMILearner
|
|
17731
17914
|
*/
|
|
17732
17915
|
constructor() {
|
|
17733
17916
|
super("cmi");
|
|
17734
|
-
this._learner_id = "";
|
|
17735
|
-
this._learner_name = "";
|
|
17736
17917
|
}
|
|
17737
17918
|
/**
|
|
17738
17919
|
* Getter for _learner_id
|
|
@@ -17785,14 +17966,14 @@ class CMILearner extends BaseCMI {
|
|
|
17785
17966
|
}
|
|
17786
17967
|
|
|
17787
17968
|
class CMIStatus extends BaseCMI {
|
|
17969
|
+
_completion_status = "unknown";
|
|
17970
|
+
_success_status = "unknown";
|
|
17971
|
+
_progress_measure = "";
|
|
17788
17972
|
/**
|
|
17789
17973
|
* Constructor for CMIStatus
|
|
17790
17974
|
*/
|
|
17791
17975
|
constructor() {
|
|
17792
17976
|
super("cmi");
|
|
17793
|
-
this._completion_status = "unknown";
|
|
17794
|
-
this._success_status = "unknown";
|
|
17795
|
-
this._progress_measure = "";
|
|
17796
17977
|
}
|
|
17797
17978
|
/**
|
|
17798
17979
|
* Getter for _completion_status
|
|
@@ -17870,15 +18051,15 @@ class CMIStatus extends BaseCMI {
|
|
|
17870
18051
|
}
|
|
17871
18052
|
|
|
17872
18053
|
class CMISession extends BaseCMI {
|
|
18054
|
+
_entry = "";
|
|
18055
|
+
_exit = "";
|
|
18056
|
+
_session_time = "PT0H0M0S";
|
|
18057
|
+
_total_time = "PT0S";
|
|
17873
18058
|
/**
|
|
17874
18059
|
* Constructor for CMISession
|
|
17875
18060
|
*/
|
|
17876
18061
|
constructor() {
|
|
17877
18062
|
super("cmi");
|
|
17878
|
-
this._entry = "";
|
|
17879
|
-
this._exit = "";
|
|
17880
|
-
this._session_time = "PT0H0M0S";
|
|
17881
|
-
this._total_time = "PT0S";
|
|
17882
18063
|
}
|
|
17883
18064
|
/**
|
|
17884
18065
|
* Getter for _entry
|
|
@@ -18016,14 +18197,14 @@ class CMISession extends BaseCMI {
|
|
|
18016
18197
|
}
|
|
18017
18198
|
|
|
18018
18199
|
class CMIContent extends BaseCMI {
|
|
18200
|
+
_location = "";
|
|
18201
|
+
_launch_data = "";
|
|
18202
|
+
_suspend_data = "";
|
|
18019
18203
|
/**
|
|
18020
18204
|
* Constructor for CMIContent
|
|
18021
18205
|
*/
|
|
18022
18206
|
constructor() {
|
|
18023
18207
|
super("cmi");
|
|
18024
|
-
this._location = "";
|
|
18025
|
-
this._launch_data = "";
|
|
18026
|
-
this._suspend_data = "";
|
|
18027
18208
|
}
|
|
18028
18209
|
/**
|
|
18029
18210
|
* Getter for _location
|
|
@@ -18094,15 +18275,15 @@ class CMIContent extends BaseCMI {
|
|
|
18094
18275
|
}
|
|
18095
18276
|
|
|
18096
18277
|
class CMISettings extends BaseCMI {
|
|
18278
|
+
_credit = "credit";
|
|
18279
|
+
_mode = "normal";
|
|
18280
|
+
_time_limit_action = "continue,no message";
|
|
18281
|
+
_max_time_allowed = "";
|
|
18097
18282
|
/**
|
|
18098
18283
|
* Constructor for CMISettings
|
|
18099
18284
|
*/
|
|
18100
18285
|
constructor() {
|
|
18101
18286
|
super("cmi");
|
|
18102
|
-
this._credit = "credit";
|
|
18103
|
-
this._mode = "normal";
|
|
18104
|
-
this._time_limit_action = "continue,no message";
|
|
18105
|
-
this._max_time_allowed = "";
|
|
18106
18287
|
}
|
|
18107
18288
|
/**
|
|
18108
18289
|
* Getter for _credit
|
|
@@ -18222,13 +18403,13 @@ class CMISettings extends BaseCMI {
|
|
|
18222
18403
|
}
|
|
18223
18404
|
|
|
18224
18405
|
class CMIThresholds extends BaseCMI {
|
|
18406
|
+
_scaled_passing_score = "";
|
|
18407
|
+
_completion_threshold = "";
|
|
18225
18408
|
/**
|
|
18226
18409
|
* Constructor for CMIThresholds
|
|
18227
18410
|
*/
|
|
18228
18411
|
constructor() {
|
|
18229
18412
|
super("cmi");
|
|
18230
|
-
this._scaled_passing_score = "";
|
|
18231
|
-
this._completion_threshold = "";
|
|
18232
18413
|
}
|
|
18233
18414
|
/**
|
|
18234
18415
|
* Getter for _scaled_passing_score
|
|
@@ -18336,6 +18517,21 @@ class CMI extends BaseRootCMI {
|
|
|
18336
18517
|
this.objectives = new CMIObjectives();
|
|
18337
18518
|
if (initialized) this.initialize();
|
|
18338
18519
|
}
|
|
18520
|
+
// New component classes
|
|
18521
|
+
metadata;
|
|
18522
|
+
learner;
|
|
18523
|
+
status;
|
|
18524
|
+
session;
|
|
18525
|
+
content;
|
|
18526
|
+
settings;
|
|
18527
|
+
thresholds;
|
|
18528
|
+
// Original complex objects
|
|
18529
|
+
learner_preference;
|
|
18530
|
+
score;
|
|
18531
|
+
comments_from_learner;
|
|
18532
|
+
comments_from_lms;
|
|
18533
|
+
interactions;
|
|
18534
|
+
objectives;
|
|
18339
18535
|
/**
|
|
18340
18536
|
* Called when the API has been initialized after the CMI has been created
|
|
18341
18537
|
*/
|
|
@@ -18780,11 +18976,12 @@ class ADL extends BaseCMI {
|
|
|
18780
18976
|
*/
|
|
18781
18977
|
constructor() {
|
|
18782
18978
|
super("adl");
|
|
18783
|
-
this.data = new ADLData();
|
|
18784
|
-
this._sequencing = null;
|
|
18785
18979
|
this.nav = new ADLNav();
|
|
18786
18980
|
this.data = new ADLData();
|
|
18787
18981
|
}
|
|
18982
|
+
nav;
|
|
18983
|
+
data = new ADLData();
|
|
18984
|
+
_sequencing = null;
|
|
18788
18985
|
/**
|
|
18789
18986
|
* Called when the API has been initialized after the CMI has been created
|
|
18790
18987
|
*/
|
|
@@ -18837,16 +19034,17 @@ class ADL extends BaseCMI {
|
|
|
18837
19034
|
}
|
|
18838
19035
|
}
|
|
18839
19036
|
class ADLNav extends BaseCMI {
|
|
19037
|
+
_request = "_none_";
|
|
19038
|
+
_sequencing = null;
|
|
18840
19039
|
/**
|
|
18841
19040
|
* Constructor for `adl.nav`
|
|
18842
19041
|
*/
|
|
18843
19042
|
constructor() {
|
|
18844
19043
|
super("adl.nav");
|
|
18845
|
-
this._request = "_none_";
|
|
18846
|
-
this._sequencing = null;
|
|
18847
19044
|
this.request_valid = new ADLNavRequestValid();
|
|
18848
19045
|
this.request_valid.setParentNav(this);
|
|
18849
19046
|
}
|
|
19047
|
+
request_valid;
|
|
18850
19048
|
/**
|
|
18851
19049
|
* Getter for sequencing
|
|
18852
19050
|
* @return {Sequencing | null}
|
|
@@ -18925,12 +19123,12 @@ class ADLData extends CMIArray {
|
|
|
18925
19123
|
}
|
|
18926
19124
|
}
|
|
18927
19125
|
class ADLDataObject extends BaseCMI {
|
|
19126
|
+
_id = "";
|
|
19127
|
+
_store = "";
|
|
19128
|
+
_idIsSet = false;
|
|
19129
|
+
_storeIsSet = false;
|
|
18928
19130
|
constructor() {
|
|
18929
19131
|
super("adl.data.n");
|
|
18930
|
-
this._id = "";
|
|
18931
|
-
this._store = "";
|
|
18932
|
-
this._idIsSet = false;
|
|
18933
|
-
this._storeIsSet = false;
|
|
18934
19132
|
}
|
|
18935
19133
|
/**
|
|
18936
19134
|
* Called when the API has been reset
|
|
@@ -19017,10 +19215,8 @@ class ADLDataObject extends BaseCMI {
|
|
|
19017
19215
|
}
|
|
19018
19216
|
}
|
|
19019
19217
|
class ADLNavRequestValidChoice {
|
|
19020
|
-
|
|
19021
|
-
|
|
19022
|
-
this._staticValues = {};
|
|
19023
|
-
}
|
|
19218
|
+
_parentNav = null;
|
|
19219
|
+
_staticValues = {};
|
|
19024
19220
|
setParentNav(nav) {
|
|
19025
19221
|
this._parentNav = nav;
|
|
19026
19222
|
}
|
|
@@ -19059,10 +19255,8 @@ class ADLNavRequestValidChoice {
|
|
|
19059
19255
|
}
|
|
19060
19256
|
}
|
|
19061
19257
|
class ADLNavRequestValidJump {
|
|
19062
|
-
|
|
19063
|
-
|
|
19064
|
-
this._staticValues = {};
|
|
19065
|
-
}
|
|
19258
|
+
_parentNav = null;
|
|
19259
|
+
_staticValues = {};
|
|
19066
19260
|
setParentNav(nav) {
|
|
19067
19261
|
this._parentNav = nav;
|
|
19068
19262
|
}
|
|
@@ -19094,19 +19288,21 @@ class ADLNavRequestValidJump {
|
|
|
19094
19288
|
}
|
|
19095
19289
|
}
|
|
19096
19290
|
class ADLNavRequestValid extends BaseCMI {
|
|
19291
|
+
_continue = "unknown";
|
|
19292
|
+
_previous = "unknown";
|
|
19293
|
+
_choice;
|
|
19294
|
+
_jump;
|
|
19295
|
+
_exit = "unknown";
|
|
19296
|
+
_exitAll = "unknown";
|
|
19297
|
+
_abandon = "unknown";
|
|
19298
|
+
_abandonAll = "unknown";
|
|
19299
|
+
_suspendAll = "unknown";
|
|
19300
|
+
_parentNav = null;
|
|
19097
19301
|
/**
|
|
19098
19302
|
* Constructor for adl.nav.request_valid
|
|
19099
19303
|
*/
|
|
19100
19304
|
constructor() {
|
|
19101
19305
|
super("adl.nav.request_valid");
|
|
19102
|
-
this._continue = "unknown";
|
|
19103
|
-
this._previous = "unknown";
|
|
19104
|
-
this._exit = "unknown";
|
|
19105
|
-
this._exitAll = "unknown";
|
|
19106
|
-
this._abandon = "unknown";
|
|
19107
|
-
this._abandonAll = "unknown";
|
|
19108
|
-
this._suspendAll = "unknown";
|
|
19109
|
-
this._parentNav = null;
|
|
19110
19306
|
this._choice = new ADLNavRequestValidChoice();
|
|
19111
19307
|
this._jump = new ADLNavRequestValidJump();
|
|
19112
19308
|
}
|
|
@@ -19428,15 +19624,15 @@ class ADLNavRequestValid extends BaseCMI {
|
|
|
19428
19624
|
}
|
|
19429
19625
|
|
|
19430
19626
|
class ActivityTree extends BaseCMI {
|
|
19627
|
+
_root = null;
|
|
19628
|
+
_currentActivity = null;
|
|
19629
|
+
_suspendedActivity = null;
|
|
19630
|
+
_activities = /* @__PURE__ */ new Map();
|
|
19431
19631
|
/**
|
|
19432
19632
|
* Constructor for ActivityTree
|
|
19433
19633
|
*/
|
|
19434
19634
|
constructor(root) {
|
|
19435
19635
|
super("activityTree");
|
|
19436
|
-
this._root = null;
|
|
19437
|
-
this._currentActivity = null;
|
|
19438
|
-
this._suspendedActivity = null;
|
|
19439
|
-
this._activities = /* @__PURE__ */ new Map();
|
|
19440
19636
|
if (root) {
|
|
19441
19637
|
this.root = root;
|
|
19442
19638
|
}
|
|
@@ -19758,15 +19954,19 @@ class ActivityTree extends BaseCMI {
|
|
|
19758
19954
|
}
|
|
19759
19955
|
|
|
19760
19956
|
class Sequencing extends BaseCMI {
|
|
19957
|
+
_activityTree;
|
|
19958
|
+
_sequencingRules;
|
|
19959
|
+
_sequencingControls;
|
|
19960
|
+
_rollupRules;
|
|
19961
|
+
_adlNav = null;
|
|
19962
|
+
_hideLmsUi = [];
|
|
19963
|
+
_auxiliaryResources = [];
|
|
19964
|
+
_overallSequencingProcess = null;
|
|
19761
19965
|
/**
|
|
19762
19966
|
* Constructor for Sequencing
|
|
19763
19967
|
*/
|
|
19764
19968
|
constructor() {
|
|
19765
19969
|
super("sequencing");
|
|
19766
|
-
this._adlNav = null;
|
|
19767
|
-
this._hideLmsUi = [];
|
|
19768
|
-
this._auxiliaryResources = [];
|
|
19769
|
-
this._overallSequencingProcess = null;
|
|
19770
19970
|
this._activityTree = new ActivityTree();
|
|
19771
19971
|
this._sequencingRules = new SequencingRules();
|
|
19772
19972
|
this._sequencingControls = new SequencingControls();
|
|
@@ -19968,6 +20168,7 @@ class Sequencing extends BaseCMI {
|
|
|
19968
20168
|
}
|
|
19969
20169
|
|
|
19970
20170
|
class Scorm2004ResponseValidator {
|
|
20171
|
+
context;
|
|
19971
20172
|
constructor(context) {
|
|
19972
20173
|
this.context = context;
|
|
19973
20174
|
}
|
|
@@ -20174,7 +20375,7 @@ class Scorm2004ResponseValidator {
|
|
|
20174
20375
|
let seenLang = false;
|
|
20175
20376
|
const prefixRegex = new RegExp("^({(lang|case_matters|order_matters)=([^}]+)})");
|
|
20176
20377
|
let matches = node.match(prefixRegex);
|
|
20177
|
-
let langMatches
|
|
20378
|
+
let langMatches;
|
|
20178
20379
|
while (matches) {
|
|
20179
20380
|
switch (matches[2]) {
|
|
20180
20381
|
case "lang":
|
|
@@ -20214,6 +20415,8 @@ class Scorm2004ResponseValidator {
|
|
|
20214
20415
|
}
|
|
20215
20416
|
|
|
20216
20417
|
class Scorm2004CMIHandler {
|
|
20418
|
+
context;
|
|
20419
|
+
responseValidator;
|
|
20217
20420
|
constructor(context, responseValidator) {
|
|
20218
20421
|
this.context = context;
|
|
20219
20422
|
this.responseValidator = responseValidator;
|
|
@@ -20877,6 +21080,8 @@ class SequencingConfigurationBuilder {
|
|
|
20877
21080
|
}
|
|
20878
21081
|
|
|
20879
21082
|
class ActivityTreeBuilder {
|
|
21083
|
+
sequencingCollections;
|
|
21084
|
+
sequencingConfigBuilder;
|
|
20880
21085
|
constructor(collections, sequencingConfigBuilder) {
|
|
20881
21086
|
this.sequencingCollections = collections || {};
|
|
20882
21087
|
this.sequencingConfigBuilder = sequencingConfigBuilder || new SequencingConfigurationBuilder();
|
|
@@ -21076,8 +21281,9 @@ class ActivityTreeBuilder {
|
|
|
21076
21281
|
}
|
|
21077
21282
|
|
|
21078
21283
|
class GlobalObjectiveManager {
|
|
21284
|
+
_globalObjectives = [];
|
|
21285
|
+
context;
|
|
21079
21286
|
constructor(context) {
|
|
21080
|
-
this._globalObjectives = [];
|
|
21081
21287
|
this.context = context;
|
|
21082
21288
|
}
|
|
21083
21289
|
/**
|
|
@@ -21505,6 +21711,8 @@ class GlobalObjectiveManager {
|
|
|
21505
21711
|
}
|
|
21506
21712
|
|
|
21507
21713
|
class SequencingStatePersistence {
|
|
21714
|
+
context;
|
|
21715
|
+
globalObjectiveManager;
|
|
21508
21716
|
constructor(context, globalObjectiveManager) {
|
|
21509
21717
|
this.context = context;
|
|
21510
21718
|
this.globalObjectiveManager = globalObjectiveManager;
|
|
@@ -21756,6 +21964,8 @@ class SequencingStatePersistence {
|
|
|
21756
21964
|
}
|
|
21757
21965
|
|
|
21758
21966
|
class Scorm2004DataSerializer {
|
|
21967
|
+
context;
|
|
21968
|
+
globalObjectiveManager;
|
|
21759
21969
|
constructor(context, globalObjectiveManager) {
|
|
21760
21970
|
this.context = context;
|
|
21761
21971
|
this.globalObjectiveManager = globalObjectiveManager || null;
|
|
@@ -21906,6 +22116,19 @@ class Scorm2004DataSerializer {
|
|
|
21906
22116
|
}
|
|
21907
22117
|
|
|
21908
22118
|
class Scorm2004API extends BaseAPI {
|
|
22119
|
+
_version = "1.0";
|
|
22120
|
+
_sequencing;
|
|
22121
|
+
_sequencingService = null;
|
|
22122
|
+
_extractedScoItemIds = [];
|
|
22123
|
+
_sequencingCollections = {};
|
|
22124
|
+
// Extracted class instances
|
|
22125
|
+
_responseValidator;
|
|
22126
|
+
_cmiHandler;
|
|
22127
|
+
_activityTreeBuilder;
|
|
22128
|
+
_sequencingConfigBuilder;
|
|
22129
|
+
_globalObjectiveManager;
|
|
22130
|
+
_statePersistence = null;
|
|
22131
|
+
_dataSerializer;
|
|
21909
22132
|
/**
|
|
21910
22133
|
* Constructor for SCORM 2004 API
|
|
21911
22134
|
* @param {Settings} settings
|
|
@@ -21919,11 +22142,6 @@ class Scorm2004API extends BaseAPI {
|
|
|
21919
22142
|
}
|
|
21920
22143
|
}
|
|
21921
22144
|
super(scorm2004_errors, settingsCopy, httpService);
|
|
21922
|
-
this._version = "1.0";
|
|
21923
|
-
this._sequencingService = null;
|
|
21924
|
-
this._extractedScoItemIds = [];
|
|
21925
|
-
this._sequencingCollections = {};
|
|
21926
|
-
this._statePersistence = null;
|
|
21927
22145
|
this.cmi = new CMI();
|
|
21928
22146
|
this.adl = new ADL();
|
|
21929
22147
|
this._sequencing = new Sequencing();
|
|
@@ -21979,6 +22197,16 @@ class Scorm2004API extends BaseAPI {
|
|
|
21979
22197
|
this.GetErrorString = this.lmsGetErrorString;
|
|
21980
22198
|
this.GetDiagnostic = this.lmsGetDiagnostic;
|
|
21981
22199
|
}
|
|
22200
|
+
cmi;
|
|
22201
|
+
adl;
|
|
22202
|
+
Initialize;
|
|
22203
|
+
Terminate;
|
|
22204
|
+
GetValue;
|
|
22205
|
+
SetValue;
|
|
22206
|
+
Commit;
|
|
22207
|
+
GetLastError;
|
|
22208
|
+
GetErrorString;
|
|
22209
|
+
GetDiagnostic;
|
|
21982
22210
|
/**
|
|
21983
22211
|
* Called when the API needs to be reset
|
|
21984
22212
|
*
|
|
@@ -22132,6 +22360,11 @@ class Scorm2004API extends BaseAPI {
|
|
|
22132
22360
|
processedSequencingRequest = requestToProcess;
|
|
22133
22361
|
}
|
|
22134
22362
|
} catch (error) {
|
|
22363
|
+
this.apiLog(
|
|
22364
|
+
"lmsFinish",
|
|
22365
|
+
`Sequencing navigation failed, falling back to event-based navigation: ${error}`,
|
|
22366
|
+
LogLevelEnum.WARN
|
|
22367
|
+
);
|
|
22135
22368
|
navigationHandled = false;
|
|
22136
22369
|
}
|
|
22137
22370
|
}
|
|
@@ -22169,6 +22402,14 @@ class Scorm2004API extends BaseAPI {
|
|
|
22169
22402
|
* @return {string} The value of the element, or empty string
|
|
22170
22403
|
*/
|
|
22171
22404
|
lmsGetValue(CMIElement) {
|
|
22405
|
+
if (this.isTerminated()) {
|
|
22406
|
+
this.lastErrorCode = String(scorm2004_errors.RETRIEVE_AFTER_TERM);
|
|
22407
|
+
return "";
|
|
22408
|
+
}
|
|
22409
|
+
if (!this.isInitialized()) {
|
|
22410
|
+
this.lastErrorCode = String(scorm2004_errors.RETRIEVE_BEFORE_INIT);
|
|
22411
|
+
return "";
|
|
22412
|
+
}
|
|
22172
22413
|
if (CMIElement === "adl.nav.request") {
|
|
22173
22414
|
this.throwSCORMError(
|
|
22174
22415
|
CMIElement,
|
|
@@ -22201,14 +22442,6 @@ class Scorm2004API extends BaseAPI {
|
|
|
22201
22442
|
}
|
|
22202
22443
|
}
|
|
22203
22444
|
}
|
|
22204
|
-
if (this.isTerminated()) {
|
|
22205
|
-
this.lastErrorCode = String(scorm2004_errors.RETRIEVE_AFTER_TERM);
|
|
22206
|
-
return "";
|
|
22207
|
-
}
|
|
22208
|
-
if (!this.isInitialized()) {
|
|
22209
|
-
this.lastErrorCode = String(scorm2004_errors.RETRIEVE_BEFORE_INIT);
|
|
22210
|
-
return "";
|
|
22211
|
-
}
|
|
22212
22445
|
if (CMIElement === "cmi.completion_status") {
|
|
22213
22446
|
return this._cmiHandler.evaluateCompletionStatus();
|
|
22214
22447
|
}
|
|
@@ -22225,12 +22458,7 @@ class Scorm2004API extends BaseAPI {
|
|
|
22225
22458
|
* @return {string} "true" or "false"
|
|
22226
22459
|
*/
|
|
22227
22460
|
lmsSetValue(CMIElement, value) {
|
|
22228
|
-
|
|
22229
|
-
try {
|
|
22230
|
-
oldValue = this.getCMIValue(CMIElement);
|
|
22231
|
-
} catch (error) {
|
|
22232
|
-
oldValue = null;
|
|
22233
|
-
}
|
|
22461
|
+
const oldValue = this._peekCMIValue(CMIElement);
|
|
22234
22462
|
const result = this.setValue("SetValue", "Commit", true, CMIElement, value);
|
|
22235
22463
|
if (result === global_constants.SCORM_TRUE && this._sequencingService) {
|
|
22236
22464
|
try {
|
|
@@ -22362,6 +22590,48 @@ class Scorm2004API extends BaseAPI {
|
|
|
22362
22590
|
}
|
|
22363
22591
|
this._responseValidator.validateCorrectResponse(CMIElement, interaction, value);
|
|
22364
22592
|
}
|
|
22593
|
+
/**
|
|
22594
|
+
* Silently peeks at a CMI value without triggering error logging or
|
|
22595
|
+
* mutating lastErrorCode. Returns null if the element doesn't exist.
|
|
22596
|
+
* Used internally to capture old values before SetValue overwrites them.
|
|
22597
|
+
*
|
|
22598
|
+
* @param {string} CMIElement - dot-delimited CMI path (e.g. "cmi.interactions.0.id")
|
|
22599
|
+
* @return {*} the current value, or null if the path doesn't resolve
|
|
22600
|
+
*/
|
|
22601
|
+
_peekCMIValue(CMIElement) {
|
|
22602
|
+
if (!CMIElement || typeof CMIElement !== "string") {
|
|
22603
|
+
return null;
|
|
22604
|
+
}
|
|
22605
|
+
const segments = CMIElement.split(".");
|
|
22606
|
+
let refObject = this;
|
|
22607
|
+
for (let i = 0; i < segments.length; i++) {
|
|
22608
|
+
const attribute = segments[i];
|
|
22609
|
+
if (refObject == null) {
|
|
22610
|
+
return null;
|
|
22611
|
+
}
|
|
22612
|
+
try {
|
|
22613
|
+
refObject = refObject[attribute];
|
|
22614
|
+
} catch {
|
|
22615
|
+
return null;
|
|
22616
|
+
}
|
|
22617
|
+
if (refObject instanceof CMIArray) {
|
|
22618
|
+
const nextIndex = i + 1;
|
|
22619
|
+
if (nextIndex >= segments.length) {
|
|
22620
|
+
return refObject;
|
|
22621
|
+
}
|
|
22622
|
+
const nextSegment = segments[nextIndex];
|
|
22623
|
+
const index = Number(nextSegment);
|
|
22624
|
+
if (!Number.isNaN(index) && Number.isInteger(index) && index >= 0) {
|
|
22625
|
+
if (index >= refObject.childArray.length) {
|
|
22626
|
+
return null;
|
|
22627
|
+
}
|
|
22628
|
+
refObject = refObject.childArray[index];
|
|
22629
|
+
i++;
|
|
22630
|
+
}
|
|
22631
|
+
}
|
|
22632
|
+
}
|
|
22633
|
+
return refObject ?? null;
|
|
22634
|
+
}
|
|
22365
22635
|
/**
|
|
22366
22636
|
* Gets a value from the CMI Object
|
|
22367
22637
|
* @param {string} CMIElement
|