scorm-again 3.1.4 → 3.1.5
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/esm/scorm-again.js +1080 -187
- 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 +14 -3
- 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 +1080 -187
- 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 +1406 -410
- package/dist/scorm-again.js.map +1 -1
- package/dist/scorm-again.min.js +1 -1
- package/dist/scorm12.js +54 -14
- package/dist/scorm12.js.map +1 -1
- package/dist/scorm12.min.js +1 -1
- package/dist/scorm2004.js +1401 -405
- package/dist/scorm2004.js.map +1 -1
- package/dist/scorm2004.min.js +1 -1
- package/dist/types/Scorm2004API.d.ts +11 -0
- package/dist/types/cmi/scorm2004/sequencing/activity.d.ts +47 -5
- package/dist/types/cmi/scorm2004/sequencing/handlers/rte_data_transfer.d.ts +1 -0
- package/dist/types/cmi/scorm2004/sequencing/objectives/global_objective_synchronizer.d.ts +17 -1
- package/dist/types/cmi/scorm2004/sequencing/sequencing_rules.d.ts +6 -1
- package/dist/types/cmi/scorm2004/sequencing/traversal/flow_traversal_service.d.ts +5 -2
- package/dist/types/constants/regex.d.ts +1 -0
- package/dist/types/types/api_types.d.ts +12 -0
- package/dist/types/types/sequencing_types.d.ts +7 -0
- package/dist/types/utilities/core.d.ts +4 -1
- package/package.json +1 -1
package/dist/scorm2004.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
this.Scorm2004API = (function () {
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
function _array_like_to_array$
|
|
4
|
+
function _array_like_to_array$g(arr, len) {
|
|
5
5
|
if (len == null || len > arr.length) len = arr.length;
|
|
6
6
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
7
7
|
return arr2;
|
|
@@ -9,10 +9,10 @@ this.Scorm2004API = (function () {
|
|
|
9
9
|
function _array_with_holes$6(arr) {
|
|
10
10
|
if (Array.isArray(arr)) return arr;
|
|
11
11
|
}
|
|
12
|
-
function _array_without_holes$
|
|
13
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
12
|
+
function _array_without_holes$b(arr) {
|
|
13
|
+
if (Array.isArray(arr)) return _array_like_to_array$g(arr);
|
|
14
14
|
}
|
|
15
|
-
function _iterable_to_array$
|
|
15
|
+
function _iterable_to_array$b(iter) {
|
|
16
16
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
17
17
|
}
|
|
18
18
|
function _iterable_to_array_limit$6(arr, i) {
|
|
@@ -42,22 +42,22 @@ this.Scorm2004API = (function () {
|
|
|
42
42
|
function _non_iterable_rest$6() {
|
|
43
43
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
44
44
|
}
|
|
45
|
-
function _non_iterable_spread$
|
|
45
|
+
function _non_iterable_spread$b() {
|
|
46
46
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
47
47
|
}
|
|
48
48
|
function _sliced_to_array$6(arr, i) {
|
|
49
|
-
return _array_with_holes$6(arr) || _iterable_to_array_limit$6(arr, i) || _unsupported_iterable_to_array$
|
|
49
|
+
return _array_with_holes$6(arr) || _iterable_to_array_limit$6(arr, i) || _unsupported_iterable_to_array$g(arr, i) || _non_iterable_rest$6();
|
|
50
50
|
}
|
|
51
|
-
function _to_consumable_array$
|
|
52
|
-
return _array_without_holes$
|
|
51
|
+
function _to_consumable_array$b(arr) {
|
|
52
|
+
return _array_without_holes$b(arr) || _iterable_to_array$b(arr) || _unsupported_iterable_to_array$g(arr) || _non_iterable_spread$b();
|
|
53
53
|
}
|
|
54
|
-
function _unsupported_iterable_to_array$
|
|
54
|
+
function _unsupported_iterable_to_array$g(o, minLen) {
|
|
55
55
|
if (!o) return;
|
|
56
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
56
|
+
if (typeof o === "string") return _array_like_to_array$g(o, minLen);
|
|
57
57
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
58
58
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
59
59
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
60
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
60
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$g(o, minLen);
|
|
61
61
|
}
|
|
62
62
|
var SECONDS_PER_SECOND = 1;
|
|
63
63
|
var SECONDS_PER_MINUTE = 60;
|
|
@@ -213,15 +213,21 @@ this.Scorm2004API = (function () {
|
|
|
213
213
|
}
|
|
214
214
|
return new RegExp(tester).test(str);
|
|
215
215
|
}
|
|
216
|
-
function memoize(fn, keyFn) {
|
|
216
|
+
function memoize(fn, keyFn, options) {
|
|
217
217
|
var cache = /* @__PURE__ */ new Map();
|
|
218
218
|
return function() {
|
|
219
219
|
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
|
220
220
|
args[_key] = arguments[_key];
|
|
221
221
|
}
|
|
222
|
-
var key = keyFn ? keyFn.apply(void 0, _to_consumable_array$
|
|
222
|
+
var key = keyFn ? keyFn.apply(void 0, _to_consumable_array$b(args)) : JSON.stringify(args);
|
|
223
|
+
if ((options === null || options === void 0 ? void 0 : options.maxKeyLength) !== void 0 && key.length > options.maxKeyLength) {
|
|
224
|
+
return fn.apply(void 0, _to_consumable_array$b(args));
|
|
225
|
+
}
|
|
223
226
|
return cache.has(key) ? cache.get(key) : function() {
|
|
224
|
-
var result = fn.apply(void 0, _to_consumable_array$
|
|
227
|
+
var result = fn.apply(void 0, _to_consumable_array$b(args));
|
|
228
|
+
if ((options === null || options === void 0 ? void 0 : options.maxEntries) !== void 0 && cache.size >= options.maxEntries) {
|
|
229
|
+
cache.delete(cache.keys().next().value);
|
|
230
|
+
}
|
|
225
231
|
cache.set(key, result);
|
|
226
232
|
return result;
|
|
227
233
|
}();
|
|
@@ -1034,7 +1040,7 @@ this.Scorm2004API = (function () {
|
|
|
1034
1040
|
}
|
|
1035
1041
|
return target;
|
|
1036
1042
|
}
|
|
1037
|
-
function ownKeys$
|
|
1043
|
+
function ownKeys$5(object, enumerableOnly) {
|
|
1038
1044
|
var keys = Object.keys(object);
|
|
1039
1045
|
if (Object.getOwnPropertySymbols) {
|
|
1040
1046
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -1042,12 +1048,12 @@ this.Scorm2004API = (function () {
|
|
|
1042
1048
|
}
|
|
1043
1049
|
return keys;
|
|
1044
1050
|
}
|
|
1045
|
-
function _object_spread_props$
|
|
1051
|
+
function _object_spread_props$5(target, source) {
|
|
1046
1052
|
source = source != null ? source : {};
|
|
1047
1053
|
if (Object.getOwnPropertyDescriptors) {
|
|
1048
1054
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
1049
1055
|
} else {
|
|
1050
|
-
ownKeys$
|
|
1056
|
+
ownKeys$5(Object(source)).forEach(function(key) {
|
|
1051
1057
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
1052
1058
|
});
|
|
1053
1059
|
}
|
|
@@ -1083,7 +1089,7 @@ this.Scorm2004API = (function () {
|
|
|
1083
1089
|
VALUE_OUT_OF_RANGE: 101,
|
|
1084
1090
|
DEPENDENCY_NOT_ESTABLISHED: 101
|
|
1085
1091
|
};
|
|
1086
|
-
var scorm12_errors = _object_spread_props$
|
|
1092
|
+
var scorm12_errors = _object_spread_props$5(_object_spread$f({}, global_errors), {
|
|
1087
1093
|
RETRIEVE_BEFORE_INIT: 301,
|
|
1088
1094
|
STORE_BEFORE_INIT: 301,
|
|
1089
1095
|
COMMIT_BEFORE_INIT: 301,
|
|
@@ -1103,7 +1109,7 @@ this.Scorm2004API = (function () {
|
|
|
1103
1109
|
VALUE_OUT_OF_RANGE: 405,
|
|
1104
1110
|
DEPENDENCY_NOT_ESTABLISHED: 408
|
|
1105
1111
|
});
|
|
1106
|
-
var scorm2004_errors = _object_spread_props$
|
|
1112
|
+
var scorm2004_errors = _object_spread_props$5(_object_spread$f({}, global_errors), {
|
|
1107
1113
|
INITIALIZATION_FAILED: 102,
|
|
1108
1114
|
INITIALIZED: 103,
|
|
1109
1115
|
TERMINATED: 104,
|
|
@@ -1685,6 +1691,7 @@ this.Scorm2004API = (function () {
|
|
|
1685
1691
|
* Subtag: 2-8 alphanumeric characters
|
|
1686
1692
|
*/ CMILang: "^([a-zA-Z]{1,8}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",
|
|
1687
1693
|
/** CMILangString250 - String with optional language tag, max 250 chars (RTE C.1.3) */ CMILangString250: "^({lang=([a-zA-Z]{1,8}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$",
|
|
1694
|
+
/** CMILangString - Optional language tag, no length cap; RTE C.1.3 SPM is a floor and is deliberately not enforced */ CMILangString: "^({lang=([a-zA-Z]{1,8}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).*$)?$",
|
|
1688
1695
|
/** CMILangcr - Language tag pattern with content */ CMILangcr: "^(({lang=([a-zA-Z]{1,8}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",
|
|
1689
1696
|
/** CMILangString250cr - String with optional language tag (carriage return variant) */ CMILangString250cr: "^(({lang=([a-zA-Z]{1,8}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$",
|
|
1690
1697
|
/** CMILangString4000 - String with optional language tag, max 4000 chars (RTE C.1.3) */ CMILangString4000: "^({lang=([a-zA-Z]{1,8}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$",
|
|
@@ -2720,12 +2727,6 @@ this.Scorm2004API = (function () {
|
|
|
2720
2727
|
var __publicField$11 = function __publicField(obj, key, value) {
|
|
2721
2728
|
return __defNormalProp$11(obj, (typeof key === "undefined" ? "undefined" : _type_of$12(key)) !== "symbol" ? key + "" : key, value);
|
|
2722
2729
|
};
|
|
2723
|
-
var RuleConditionOperator = /* @__PURE__ */ function(RuleConditionOperator2) {
|
|
2724
|
-
RuleConditionOperator2["NOT"] = "not";
|
|
2725
|
-
RuleConditionOperator2["AND"] = "and";
|
|
2726
|
-
RuleConditionOperator2["OR"] = "or";
|
|
2727
|
-
return RuleConditionOperator2;
|
|
2728
|
-
}(RuleConditionOperator || {});
|
|
2729
2730
|
var RuleActionType = /* @__PURE__ */ function(RuleActionType2) {
|
|
2730
2731
|
RuleActionType2["SKIP"] = "skip";
|
|
2731
2732
|
RuleActionType2["DISABLED"] = "disabled";
|
|
@@ -2740,6 +2741,82 @@ this.Scorm2004API = (function () {
|
|
|
2740
2741
|
RuleActionType2["EXIT"] = "exit";
|
|
2741
2742
|
return RuleActionType2;
|
|
2742
2743
|
}(RuleActionType || {});
|
|
2744
|
+
function kleeneNot(value) {
|
|
2745
|
+
if (value === "unknown") {
|
|
2746
|
+
return "unknown";
|
|
2747
|
+
}
|
|
2748
|
+
return !value;
|
|
2749
|
+
}
|
|
2750
|
+
function kleeneAnd(values) {
|
|
2751
|
+
var hasUnknown = false;
|
|
2752
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
2753
|
+
try {
|
|
2754
|
+
for(var _iterator = values[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
2755
|
+
var value = _step.value;
|
|
2756
|
+
if (value === false) {
|
|
2757
|
+
return false;
|
|
2758
|
+
}
|
|
2759
|
+
if (value === "unknown") {
|
|
2760
|
+
hasUnknown = true;
|
|
2761
|
+
}
|
|
2762
|
+
}
|
|
2763
|
+
} catch (err) {
|
|
2764
|
+
_didIteratorError = true;
|
|
2765
|
+
_iteratorError = err;
|
|
2766
|
+
} finally{
|
|
2767
|
+
try {
|
|
2768
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
2769
|
+
_iterator.return();
|
|
2770
|
+
}
|
|
2771
|
+
} finally{
|
|
2772
|
+
if (_didIteratorError) {
|
|
2773
|
+
throw _iteratorError;
|
|
2774
|
+
}
|
|
2775
|
+
}
|
|
2776
|
+
}
|
|
2777
|
+
return hasUnknown ? "unknown" : true;
|
|
2778
|
+
}
|
|
2779
|
+
function kleeneOr(values) {
|
|
2780
|
+
var hasUnknown = false;
|
|
2781
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
2782
|
+
try {
|
|
2783
|
+
for(var _iterator = values[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
2784
|
+
var value = _step.value;
|
|
2785
|
+
if (value === true) {
|
|
2786
|
+
return true;
|
|
2787
|
+
}
|
|
2788
|
+
if (value === "unknown") {
|
|
2789
|
+
hasUnknown = true;
|
|
2790
|
+
}
|
|
2791
|
+
}
|
|
2792
|
+
} catch (err) {
|
|
2793
|
+
_didIteratorError = true;
|
|
2794
|
+
_iteratorError = err;
|
|
2795
|
+
} finally{
|
|
2796
|
+
try {
|
|
2797
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
2798
|
+
_iterator.return();
|
|
2799
|
+
}
|
|
2800
|
+
} finally{
|
|
2801
|
+
if (_didIteratorError) {
|
|
2802
|
+
throw _iteratorError;
|
|
2803
|
+
}
|
|
2804
|
+
}
|
|
2805
|
+
}
|
|
2806
|
+
return hasUnknown ? "unknown" : false;
|
|
2807
|
+
}
|
|
2808
|
+
function combineRuleConditionResults(values, conditionCombination) {
|
|
2809
|
+
if (values.length === 0) {
|
|
2810
|
+
return false;
|
|
2811
|
+
}
|
|
2812
|
+
if (conditionCombination === "all" || conditionCombination === "and" /* AND */ ) {
|
|
2813
|
+
return kleeneAnd(values);
|
|
2814
|
+
}
|
|
2815
|
+
if (conditionCombination === "any" || conditionCombination === "or" /* OR */ ) {
|
|
2816
|
+
return kleeneOr(values);
|
|
2817
|
+
}
|
|
2818
|
+
return false;
|
|
2819
|
+
}
|
|
2743
2820
|
var _RuleCondition = /*#__PURE__*/ function(BaseCMI) {
|
|
2744
2821
|
_inherits$l(_RuleCondition, BaseCMI);
|
|
2745
2822
|
function _RuleCondition() {
|
|
@@ -2845,53 +2922,74 @@ this.Scorm2004API = (function () {
|
|
|
2845
2922
|
/**
|
|
2846
2923
|
* Evaluate the condition for an activity
|
|
2847
2924
|
* @param {Activity} activity - The activity to evaluate the condition for
|
|
2848
|
-
* @return {
|
|
2925
|
+
* @return {RuleConditionEvaluation} - True, false, or unknown per SCORM 2004 4th Ed.
|
|
2849
2926
|
*/ key: "evaluate",
|
|
2850
2927
|
value: function evaluate(activity) {
|
|
2851
2928
|
var result;
|
|
2929
|
+
var hasReferencedObjective = this._referencedObjective !== null;
|
|
2852
2930
|
var referencedObjective = this.resolveReferencedObjective(activity);
|
|
2853
2931
|
switch(this._condition){
|
|
2854
2932
|
case "satisfied" /* SATISFIED */ :
|
|
2855
2933
|
case "objectiveSatisfied" /* OBJECTIVE_SATISFIED */ :
|
|
2856
|
-
if (referencedObjective) {
|
|
2857
|
-
result =
|
|
2934
|
+
if (hasReferencedObjective && !referencedObjective) {
|
|
2935
|
+
result = false;
|
|
2936
|
+
} else if (referencedObjective) {
|
|
2937
|
+
result = referencedObjective.satisfiedStatusKnown || referencedObjective.progressStatus ? referencedObjective.satisfiedStatus === true : "unknown";
|
|
2938
|
+
} else if (activity.objectiveSatisfiedStatusKnown) {
|
|
2939
|
+
result = activity.objectiveSatisfiedStatus === true;
|
|
2940
|
+
} else if (activity.successStatus !== SuccessStatus.UNKNOWN) {
|
|
2941
|
+
result = activity.successStatus === SuccessStatus.PASSED;
|
|
2858
2942
|
} else {
|
|
2859
|
-
result =
|
|
2943
|
+
result = "unknown";
|
|
2860
2944
|
}
|
|
2861
2945
|
break;
|
|
2862
2946
|
case "objectiveStatusKnown" /* OBJECTIVE_STATUS_KNOWN */ :
|
|
2863
|
-
result = referencedObjective ? !!referencedObjective.
|
|
2947
|
+
result = hasReferencedObjective && !referencedObjective ? false : referencedObjective ? !!referencedObjective.satisfiedStatusKnown : !!activity.objectiveSatisfiedStatusKnown;
|
|
2864
2948
|
break;
|
|
2865
2949
|
case "objectiveMeasureKnown" /* OBJECTIVE_MEASURE_KNOWN */ :
|
|
2866
|
-
result = referencedObjective ? !!referencedObjective.measureStatus : !!activity.objectiveMeasureStatus;
|
|
2950
|
+
result = hasReferencedObjective && !referencedObjective ? false : referencedObjective ? !!referencedObjective.measureStatus : !!activity.objectiveMeasureStatus;
|
|
2867
2951
|
break;
|
|
2868
2952
|
case "objectiveMeasureGreaterThan" /* OBJECTIVE_MEASURE_GREATER_THAN */ :
|
|
2869
2953
|
{
|
|
2954
|
+
if (hasReferencedObjective && !referencedObjective) {
|
|
2955
|
+
result = false;
|
|
2956
|
+
break;
|
|
2957
|
+
}
|
|
2870
2958
|
var greaterThanValue = this._parameters.get("threshold") || 0;
|
|
2871
2959
|
var measureStatus = referencedObjective ? referencedObjective.measureStatus : activity.objectiveMeasureStatus;
|
|
2872
2960
|
var measureValue = referencedObjective ? referencedObjective.normalizedMeasure : activity.objectiveNormalizedMeasure;
|
|
2873
|
-
result =
|
|
2961
|
+
result = measureStatus ? measureValue > greaterThanValue : "unknown";
|
|
2874
2962
|
break;
|
|
2875
2963
|
}
|
|
2876
2964
|
case "objectiveMeasureLessThan" /* OBJECTIVE_MEASURE_LESS_THAN */ :
|
|
2877
2965
|
{
|
|
2966
|
+
if (hasReferencedObjective && !referencedObjective) {
|
|
2967
|
+
result = false;
|
|
2968
|
+
break;
|
|
2969
|
+
}
|
|
2878
2970
|
var lessThanValue = this._parameters.get("threshold") || 0;
|
|
2879
2971
|
var measureStatus1 = referencedObjective ? referencedObjective.measureStatus : activity.objectiveMeasureStatus;
|
|
2880
2972
|
var measureValue1 = referencedObjective ? referencedObjective.normalizedMeasure : activity.objectiveNormalizedMeasure;
|
|
2881
|
-
result =
|
|
2973
|
+
result = measureStatus1 ? measureValue1 < lessThanValue : "unknown";
|
|
2882
2974
|
break;
|
|
2883
2975
|
}
|
|
2884
2976
|
case "completed" /* COMPLETED */ :
|
|
2885
2977
|
case "activityCompleted" /* ACTIVITY_COMPLETED */ :
|
|
2886
|
-
if (referencedObjective) {
|
|
2887
|
-
result =
|
|
2978
|
+
if (hasReferencedObjective && !referencedObjective) {
|
|
2979
|
+
result = false;
|
|
2980
|
+
} else if (referencedObjective) {
|
|
2981
|
+
result = referencedObjective.completionStatus === CompletionStatus.UNKNOWN ? "unknown" : referencedObjective.completionStatus === CompletionStatus.COMPLETED;
|
|
2982
|
+
} else if (activity.completionStatus === CompletionStatus.UNKNOWN) {
|
|
2983
|
+
result = "unknown";
|
|
2888
2984
|
} else {
|
|
2889
|
-
result = activity.
|
|
2985
|
+
result = activity.completionStatus === CompletionStatus.COMPLETED;
|
|
2890
2986
|
}
|
|
2891
2987
|
break;
|
|
2892
2988
|
case "progressKnown" /* PROGRESS_KNOWN */ :
|
|
2893
2989
|
case "activityProgressKnown" /* ACTIVITY_PROGRESS_KNOWN */ :
|
|
2894
|
-
if (referencedObjective) {
|
|
2990
|
+
if (hasReferencedObjective && !referencedObjective) {
|
|
2991
|
+
result = false;
|
|
2992
|
+
} else if (referencedObjective) {
|
|
2895
2993
|
result = referencedObjective.completionStatus !== CompletionStatus.UNKNOWN;
|
|
2896
2994
|
} else {
|
|
2897
2995
|
result = activity.completionStatus !== "unknown";
|
|
@@ -2920,7 +3018,7 @@ this.Scorm2004API = (function () {
|
|
|
2920
3018
|
break;
|
|
2921
3019
|
}
|
|
2922
3020
|
if (this._operator === "not" /* NOT */ ) {
|
|
2923
|
-
result =
|
|
3021
|
+
result = kleeneNot(result);
|
|
2924
3022
|
}
|
|
2925
3023
|
return result;
|
|
2926
3024
|
}
|
|
@@ -3169,19 +3267,9 @@ this.Scorm2004API = (function () {
|
|
|
3169
3267
|
* @return {boolean} - True if the rule conditions are met, false otherwise
|
|
3170
3268
|
*/ key: "evaluate",
|
|
3171
3269
|
value: function evaluate(activity) {
|
|
3172
|
-
|
|
3173
|
-
return
|
|
3174
|
-
}
|
|
3175
|
-
if (this._conditionCombination === "all" || this._conditionCombination === "and" /* AND */ ) {
|
|
3176
|
-
return this._conditions.every(function(condition) {
|
|
3177
|
-
return condition.evaluate(activity);
|
|
3178
|
-
});
|
|
3179
|
-
} else if (this._conditionCombination === "any" || this._conditionCombination === "or" /* OR */ ) {
|
|
3180
|
-
return this._conditions.some(function(condition) {
|
|
3181
|
-
return condition.evaluate(activity);
|
|
3182
|
-
});
|
|
3183
|
-
}
|
|
3184
|
-
return false;
|
|
3270
|
+
return combineRuleConditionResults(this._conditions.map(function(condition) {
|
|
3271
|
+
return condition.evaluate(activity);
|
|
3272
|
+
}), this._conditionCombination) === true;
|
|
3185
3273
|
}
|
|
3186
3274
|
},
|
|
3187
3275
|
{
|
|
@@ -4415,23 +4503,10 @@ this.Scorm2004API = (function () {
|
|
|
4415
4503
|
* Evaluates individual sequencing rule conditions
|
|
4416
4504
|
* @param {Activity} activity - The activity to evaluate the rule for
|
|
4417
4505
|
* @param {SequencingRule} rule - The rule to evaluate
|
|
4418
|
-
* @return {boolean} - True
|
|
4506
|
+
* @return {boolean} - True only when the rule evaluates to definite true
|
|
4419
4507
|
*/ key: "checkRuleSubprocess",
|
|
4420
4508
|
value: function checkRuleSubprocess(activity, rule) {
|
|
4421
|
-
|
|
4422
|
-
return true;
|
|
4423
|
-
}
|
|
4424
|
-
var conditionCombination = rule.conditionCombination;
|
|
4425
|
-
if (conditionCombination === "all" || conditionCombination === RuleConditionOperator.AND) {
|
|
4426
|
-
return rule.conditions.every(function(condition) {
|
|
4427
|
-
return condition.evaluate(activity);
|
|
4428
|
-
});
|
|
4429
|
-
} else if (conditionCombination === "any" || conditionCombination === RuleConditionOperator.OR) {
|
|
4430
|
-
return rule.conditions.some(function(condition) {
|
|
4431
|
-
return condition.evaluate(activity);
|
|
4432
|
-
});
|
|
4433
|
-
}
|
|
4434
|
-
return false;
|
|
4509
|
+
return rule.evaluate(activity);
|
|
4435
4510
|
}
|
|
4436
4511
|
},
|
|
4437
4512
|
{
|
|
@@ -5272,13 +5347,13 @@ this.Scorm2004API = (function () {
|
|
|
5272
5347
|
return SequencingControls;
|
|
5273
5348
|
}(BaseCMI);
|
|
5274
5349
|
|
|
5275
|
-
function _array_like_to_array$
|
|
5350
|
+
function _array_like_to_array$f(arr, len) {
|
|
5276
5351
|
if (len == null || len > arr.length) len = arr.length;
|
|
5277
5352
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
5278
5353
|
return arr2;
|
|
5279
5354
|
}
|
|
5280
|
-
function _array_without_holes$
|
|
5281
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
5355
|
+
function _array_without_holes$a(arr) {
|
|
5356
|
+
if (Array.isArray(arr)) return _array_like_to_array$f(arr);
|
|
5282
5357
|
}
|
|
5283
5358
|
function _class_call_check$10(instance, Constructor) {
|
|
5284
5359
|
if (!(instance instanceof Constructor)) {
|
|
@@ -5298,22 +5373,22 @@ this.Scorm2004API = (function () {
|
|
|
5298
5373
|
if (staticProps) _defineProperties$10(Constructor, staticProps);
|
|
5299
5374
|
return Constructor;
|
|
5300
5375
|
}
|
|
5301
|
-
function _iterable_to_array$
|
|
5376
|
+
function _iterable_to_array$a(iter) {
|
|
5302
5377
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
5303
5378
|
}
|
|
5304
|
-
function _non_iterable_spread$
|
|
5379
|
+
function _non_iterable_spread$a() {
|
|
5305
5380
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
5306
5381
|
}
|
|
5307
|
-
function _to_consumable_array$
|
|
5308
|
-
return _array_without_holes$
|
|
5382
|
+
function _to_consumable_array$a(arr) {
|
|
5383
|
+
return _array_without_holes$a(arr) || _iterable_to_array$a(arr) || _unsupported_iterable_to_array$f(arr) || _non_iterable_spread$a();
|
|
5309
5384
|
}
|
|
5310
|
-
function _unsupported_iterable_to_array$
|
|
5385
|
+
function _unsupported_iterable_to_array$f(o, minLen) {
|
|
5311
5386
|
if (!o) return;
|
|
5312
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
5387
|
+
if (typeof o === "string") return _array_like_to_array$f(o, minLen);
|
|
5313
5388
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
5314
5389
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
5315
5390
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
5316
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
5391
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$f(o, minLen);
|
|
5317
5392
|
}
|
|
5318
5393
|
var SelectionRandomization = /*#__PURE__*/ function() {
|
|
5319
5394
|
function SelectionRandomization() {
|
|
@@ -5329,7 +5404,7 @@ this.Scorm2004API = (function () {
|
|
|
5329
5404
|
* @return {Activity[]} - The selected child activities
|
|
5330
5405
|
*/ function selectChildrenProcess(activity) {
|
|
5331
5406
|
var controls = activity.sequencingControls;
|
|
5332
|
-
var children = _to_consumable_array$
|
|
5407
|
+
var children = _to_consumable_array$a(activity.children);
|
|
5333
5408
|
if (controls.selectionTiming === SelectionTiming.NEVER) {
|
|
5334
5409
|
return children;
|
|
5335
5410
|
}
|
|
@@ -5398,7 +5473,7 @@ this.Scorm2004API = (function () {
|
|
|
5398
5473
|
*/ function randomizeChildrenProcess(activity) {
|
|
5399
5474
|
var _activity_children;
|
|
5400
5475
|
var controls = activity.sequencingControls;
|
|
5401
|
-
var children = _to_consumable_array$
|
|
5476
|
+
var children = _to_consumable_array$a(activity.children);
|
|
5402
5477
|
if (controls.randomizationTiming === RandomizationTiming.NEVER) {
|
|
5403
5478
|
return children;
|
|
5404
5479
|
}
|
|
@@ -5408,7 +5483,7 @@ this.Scorm2004API = (function () {
|
|
|
5408
5483
|
if (!controls.randomizeChildren) {
|
|
5409
5484
|
return children;
|
|
5410
5485
|
}
|
|
5411
|
-
var randomizedChildren = _to_consumable_array$
|
|
5486
|
+
var randomizedChildren = _to_consumable_array$a(children);
|
|
5412
5487
|
for(var i = randomizedChildren.length - 1; i > 0; i--){
|
|
5413
5488
|
var j = Math.floor(Math.random() * (i + 1));
|
|
5414
5489
|
var tempI = randomizedChildren[i];
|
|
@@ -5422,7 +5497,7 @@ this.Scorm2004API = (function () {
|
|
|
5422
5497
|
controls.reorderChildren = true;
|
|
5423
5498
|
}
|
|
5424
5499
|
activity.children.length = 0;
|
|
5425
|
-
(_activity_children = activity.children).push.apply(_activity_children, _to_consumable_array$
|
|
5500
|
+
(_activity_children = activity.children).push.apply(_activity_children, _to_consumable_array$a(randomizedChildren));
|
|
5426
5501
|
return randomizedChildren;
|
|
5427
5502
|
}
|
|
5428
5503
|
},
|
|
@@ -5557,13 +5632,17 @@ this.Scorm2004API = (function () {
|
|
|
5557
5632
|
* @param {Activity} fromActivity - The activity to flow from
|
|
5558
5633
|
* @param {FlowSubprocessMode} direction - The flow direction
|
|
5559
5634
|
* @return {FlowSubprocessResult} - Result containing the deliverable activity
|
|
5635
|
+
* @spec SN Book: SB.2.3 (Flow Subprocess) - preserves the SB.2.1 effective traversal direction for SB.2.2.
|
|
5636
|
+
* @spec SN Book: SB.2.2 (Flow Activity Traversal Subprocess) - evaluates candidates using the effective direction returned by SB.2.1.
|
|
5560
5637
|
*/ key: "flowSubprocess",
|
|
5561
5638
|
value: function flowSubprocess(fromActivity, direction) {
|
|
5562
5639
|
var candidateActivity = fromActivity;
|
|
5563
5640
|
var firstIteration = true;
|
|
5564
5641
|
var lastCandidateHadNoChildren = false;
|
|
5642
|
+
var currentDirection = direction;
|
|
5643
|
+
var forwardOnlyCluster = null;
|
|
5565
5644
|
while(candidateActivity){
|
|
5566
|
-
var traversalResult = this.flowTreeTraversalSubprocess(candidateActivity,
|
|
5645
|
+
var traversalResult = this.flowTreeTraversalSubprocess(candidateActivity, currentDirection, firstIteration, forwardOnlyCluster);
|
|
5567
5646
|
if (!traversalResult.activity) {
|
|
5568
5647
|
var exceptionCode = null;
|
|
5569
5648
|
if (traversalResult.exception) {
|
|
@@ -5575,12 +5654,17 @@ this.Scorm2004API = (function () {
|
|
|
5575
5654
|
}
|
|
5576
5655
|
return new FlowSubprocessResult(candidateActivity, false, exceptionCode, traversalResult.endSequencingSession);
|
|
5577
5656
|
}
|
|
5657
|
+
var effectiveDirection = traversalResult.direction || currentDirection;
|
|
5658
|
+
if (traversalResult.forwardOnlyCluster) {
|
|
5659
|
+
forwardOnlyCluster = traversalResult.forwardOnlyCluster;
|
|
5660
|
+
}
|
|
5578
5661
|
lastCandidateHadNoChildren = traversalResult.activity.children.length > 0 && traversalResult.activity.getAvailableChildren().length === 0;
|
|
5579
|
-
var deliverable = this.flowActivityTraversalSubprocess(traversalResult.activity,
|
|
5662
|
+
var deliverable = this.flowActivityTraversalSubprocess(traversalResult.activity, effectiveDirection === FlowSubprocessMode.FORWARD, true, effectiveDirection);
|
|
5580
5663
|
if (deliverable) {
|
|
5581
5664
|
return new FlowSubprocessResult(deliverable, true, null, false);
|
|
5582
5665
|
}
|
|
5583
5666
|
candidateActivity = traversalResult.activity;
|
|
5667
|
+
currentDirection = effectiveDirection;
|
|
5584
5668
|
firstIteration = false;
|
|
5585
5669
|
}
|
|
5586
5670
|
return new FlowSubprocessResult(null, false, null, false);
|
|
@@ -5593,12 +5677,14 @@ this.Scorm2004API = (function () {
|
|
|
5593
5677
|
* @param {Activity} fromActivity - The activity to traverse from
|
|
5594
5678
|
* @param {FlowSubprocessMode} direction - The traversal direction
|
|
5595
5679
|
* @param {boolean} skipChildren - Whether to skip checking children
|
|
5680
|
+
* @param {Activity | null} forwardTraversalBoundary - Cluster boundary for an SB.2.1 forwardOnly direction reversal
|
|
5596
5681
|
* @return {FlowTreeTraversalResult} - The next activity and flags
|
|
5682
|
+
* @spec SN Book: SB.2.1 (Flow Tree Traversal Subprocess) - backward traversal into a forwardOnly cluster selects the first available child and reverses traversal direction to Forward.
|
|
5597
5683
|
*/ key: "flowTreeTraversalSubprocess",
|
|
5598
5684
|
value: function flowTreeTraversalSubprocess(fromActivity, direction) {
|
|
5599
|
-
var skipChildren = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
|
|
5685
|
+
var skipChildren = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false, forwardTraversalBoundary = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null;
|
|
5600
5686
|
if (direction === FlowSubprocessMode.FORWARD) {
|
|
5601
|
-
return this.traverseForward(fromActivity, skipChildren);
|
|
5687
|
+
return this.traverseForward(fromActivity, skipChildren, forwardTraversalBoundary);
|
|
5602
5688
|
} else {
|
|
5603
5689
|
return this.traverseBackward(fromActivity);
|
|
5604
5690
|
}
|
|
@@ -5609,10 +5695,19 @@ this.Scorm2004API = (function () {
|
|
|
5609
5695
|
* Traverse forward in the activity tree
|
|
5610
5696
|
* @param {Activity} fromActivity - Starting activity
|
|
5611
5697
|
* @param {boolean} skipChildren - Whether to skip children
|
|
5698
|
+
* @param {Activity | null} forwardTraversalBoundary - Cluster boundary for an SB.2.1 forwardOnly direction reversal
|
|
5612
5699
|
* @return {FlowTreeTraversalResult}
|
|
5700
|
+
* @spec SN Book: SB.2.1 (Flow Tree Traversal Subprocess) - a reversed Forward traversal from a forwardOnly cluster remains within that cluster.
|
|
5613
5701
|
*/ key: "traverseForward",
|
|
5614
5702
|
value: function traverseForward(fromActivity, skipChildren) {
|
|
5615
|
-
|
|
5703
|
+
var forwardTraversalBoundary = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
|
|
5704
|
+
if (forwardTraversalBoundary && !this.isDescendantOfOrSelf(fromActivity, forwardTraversalBoundary)) {
|
|
5705
|
+
return {
|
|
5706
|
+
activity: null,
|
|
5707
|
+
endSequencingSession: false
|
|
5708
|
+
};
|
|
5709
|
+
}
|
|
5710
|
+
if (!forwardTraversalBoundary && skipChildren && this.isActivityLastOverall(fromActivity)) {
|
|
5616
5711
|
if (this.activityTree.root) {
|
|
5617
5712
|
this.terminateDescendentAttempts(this.activityTree.root);
|
|
5618
5713
|
}
|
|
@@ -5640,6 +5735,12 @@ this.Scorm2004API = (function () {
|
|
|
5640
5735
|
endSequencingSession: false
|
|
5641
5736
|
};
|
|
5642
5737
|
}
|
|
5738
|
+
if (forwardTraversalBoundary && (current === forwardTraversalBoundary || current.parent === forwardTraversalBoundary)) {
|
|
5739
|
+
return {
|
|
5740
|
+
activity: null,
|
|
5741
|
+
endSequencingSession: false
|
|
5742
|
+
};
|
|
5743
|
+
}
|
|
5643
5744
|
current = current.parent;
|
|
5644
5745
|
}
|
|
5645
5746
|
if (this.activityTree.root) {
|
|
@@ -5656,6 +5757,7 @@ this.Scorm2004API = (function () {
|
|
|
5656
5757
|
* Traverse backward in the activity tree
|
|
5657
5758
|
* @param {Activity} fromActivity - Starting activity
|
|
5658
5759
|
* @return {FlowTreeTraversalResult}
|
|
5760
|
+
* @spec SN Book: SB.2.1 (Flow Tree Traversal Subprocess) - backward traversal into a forwardOnly cluster selects the first available child and reverses traversal direction to Forward.
|
|
5659
5761
|
*/ key: "traverseBackward",
|
|
5660
5762
|
value: function traverseBackward(fromActivity) {
|
|
5661
5763
|
if (fromActivity.parent && fromActivity.parent.sequencingControls.forwardOnly) {
|
|
@@ -5667,10 +5769,7 @@ this.Scorm2004API = (function () {
|
|
|
5667
5769
|
}
|
|
5668
5770
|
var previousSibling = this.activityTree.getPreviousSibling(fromActivity);
|
|
5669
5771
|
if (previousSibling) {
|
|
5670
|
-
return
|
|
5671
|
-
activity: this.getLastDescendant(previousSibling),
|
|
5672
|
-
endSequencingSession: false
|
|
5673
|
-
};
|
|
5772
|
+
return this.getBackwardTraversalEntry(previousSibling);
|
|
5674
5773
|
}
|
|
5675
5774
|
var current = fromActivity;
|
|
5676
5775
|
var ancestorIterations = 0;
|
|
@@ -5681,10 +5780,7 @@ this.Scorm2004API = (function () {
|
|
|
5681
5780
|
}
|
|
5682
5781
|
var parentPreviousSibling = this.activityTree.getPreviousSibling(current.parent);
|
|
5683
5782
|
if (parentPreviousSibling) {
|
|
5684
|
-
return
|
|
5685
|
-
activity: this.getLastDescendant(parentPreviousSibling),
|
|
5686
|
-
endSequencingSession: false
|
|
5687
|
-
};
|
|
5783
|
+
return this.getBackwardTraversalEntry(parentPreviousSibling);
|
|
5688
5784
|
}
|
|
5689
5785
|
current = current.parent;
|
|
5690
5786
|
}
|
|
@@ -5696,28 +5792,59 @@ this.Scorm2004API = (function () {
|
|
|
5696
5792
|
},
|
|
5697
5793
|
{
|
|
5698
5794
|
/**
|
|
5699
|
-
* Get the
|
|
5795
|
+
* Get the activity entered by backward traversal.
|
|
5700
5796
|
* @param {Activity} activity - The activity
|
|
5701
|
-
* @return {
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
|
|
5797
|
+
* @return {FlowTreeTraversalResult} - The entered activity and effective direction
|
|
5798
|
+
* @spec SN Book: SB.2.1 (Flow Tree Traversal Subprocess) - entering a forwardOnly cluster while moving Backward uses the first available child and changes direction to Forward.
|
|
5799
|
+
*/ key: "getBackwardTraversalEntry",
|
|
5800
|
+
value: function getBackwardTraversalEntry(activity) {
|
|
5801
|
+
var enteredActivity = activity;
|
|
5705
5802
|
var iterations = 0;
|
|
5706
5803
|
var maxIterations = 1e4;
|
|
5707
5804
|
while(true){
|
|
5708
5805
|
if (++iterations > maxIterations) {
|
|
5709
|
-
throw new Error("Infinite loop detected while getting
|
|
5806
|
+
throw new Error("Infinite loop detected while getting backward traversal entry");
|
|
5710
5807
|
}
|
|
5711
|
-
this.ensureSelectionAndRandomization(
|
|
5712
|
-
var children =
|
|
5808
|
+
this.ensureSelectionAndRandomization(enteredActivity);
|
|
5809
|
+
var children = enteredActivity.getAvailableChildren();
|
|
5713
5810
|
if (children.length === 0) {
|
|
5714
5811
|
break;
|
|
5715
5812
|
}
|
|
5813
|
+
if (enteredActivity.sequencingControls.forwardOnly) {
|
|
5814
|
+
return {
|
|
5815
|
+
activity: children[0] || null,
|
|
5816
|
+
endSequencingSession: false,
|
|
5817
|
+
direction: FlowSubprocessMode.FORWARD,
|
|
5818
|
+
forwardOnlyCluster: enteredActivity
|
|
5819
|
+
};
|
|
5820
|
+
}
|
|
5716
5821
|
var lastChild = children[children.length - 1];
|
|
5717
5822
|
if (!lastChild) break;
|
|
5718
|
-
|
|
5823
|
+
enteredActivity = lastChild;
|
|
5824
|
+
}
|
|
5825
|
+
return {
|
|
5826
|
+
activity: enteredActivity,
|
|
5827
|
+
endSequencingSession: false
|
|
5828
|
+
};
|
|
5829
|
+
}
|
|
5830
|
+
},
|
|
5831
|
+
{
|
|
5832
|
+
/**
|
|
5833
|
+
* Check whether an activity is the same as or beneath an ancestor.
|
|
5834
|
+
* @param {Activity} activity - The activity to check
|
|
5835
|
+
* @param {Activity} ancestor - The expected ancestor
|
|
5836
|
+
* @return {boolean} - True when activity is within ancestor
|
|
5837
|
+
* @spec SN Book: SB.2.1 (Flow Tree Traversal Subprocess) - bounds Forward traversal after a forwardOnly direction reversal to the entered cluster.
|
|
5838
|
+
*/ key: "isDescendantOfOrSelf",
|
|
5839
|
+
value: function isDescendantOfOrSelf(activity, ancestor) {
|
|
5840
|
+
var current = activity;
|
|
5841
|
+
while(current){
|
|
5842
|
+
if (current === ancestor) {
|
|
5843
|
+
return true;
|
|
5844
|
+
}
|
|
5845
|
+
current = current.parent;
|
|
5719
5846
|
}
|
|
5720
|
-
return
|
|
5847
|
+
return false;
|
|
5721
5848
|
}
|
|
5722
5849
|
},
|
|
5723
5850
|
{
|
|
@@ -7359,7 +7486,7 @@ this.Scorm2004API = (function () {
|
|
|
7359
7486
|
}
|
|
7360
7487
|
return target;
|
|
7361
7488
|
}
|
|
7362
|
-
function ownKeys$
|
|
7489
|
+
function ownKeys$4(object, enumerableOnly) {
|
|
7363
7490
|
var keys = Object.keys(object);
|
|
7364
7491
|
if (Object.getOwnPropertySymbols) {
|
|
7365
7492
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -7367,12 +7494,12 @@ this.Scorm2004API = (function () {
|
|
|
7367
7494
|
}
|
|
7368
7495
|
return keys;
|
|
7369
7496
|
}
|
|
7370
|
-
function _object_spread_props$
|
|
7497
|
+
function _object_spread_props$4(target, source) {
|
|
7371
7498
|
source = source != null ? source : {};
|
|
7372
7499
|
if (Object.getOwnPropertyDescriptors) {
|
|
7373
7500
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
7374
7501
|
} else {
|
|
7375
|
-
ownKeys$
|
|
7502
|
+
ownKeys$4(Object(source)).forEach(function(key) {
|
|
7376
7503
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
7377
7504
|
});
|
|
7378
7505
|
}
|
|
@@ -7656,7 +7783,7 @@ this.Scorm2004API = (function () {
|
|
|
7656
7783
|
method: "POST",
|
|
7657
7784
|
mode: this.settings.fetchMode,
|
|
7658
7785
|
body: body,
|
|
7659
|
-
headers: _object_spread_props$
|
|
7786
|
+
headers: _object_spread_props$4(_object_spread$c({}, this.settings.xhrHeaders), {
|
|
7660
7787
|
"Content-Type": contentType
|
|
7661
7788
|
}),
|
|
7662
7789
|
keepalive: true
|
|
@@ -9057,7 +9184,7 @@ this.Scorm2004API = (function () {
|
|
|
9057
9184
|
}
|
|
9058
9185
|
return target;
|
|
9059
9186
|
}
|
|
9060
|
-
function ownKeys$
|
|
9187
|
+
function ownKeys$3(object, enumerableOnly) {
|
|
9061
9188
|
var keys = Object.keys(object);
|
|
9062
9189
|
if (Object.getOwnPropertySymbols) {
|
|
9063
9190
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -9065,12 +9192,12 @@ this.Scorm2004API = (function () {
|
|
|
9065
9192
|
}
|
|
9066
9193
|
return keys;
|
|
9067
9194
|
}
|
|
9068
|
-
function _object_spread_props$
|
|
9195
|
+
function _object_spread_props$3(target, source) {
|
|
9069
9196
|
source = source != null ? source : {};
|
|
9070
9197
|
if (Object.getOwnPropertyDescriptors) {
|
|
9071
9198
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
9072
9199
|
} else {
|
|
9073
|
-
ownKeys$
|
|
9200
|
+
ownKeys$3(Object(source)).forEach(function(key) {
|
|
9074
9201
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
9075
9202
|
});
|
|
9076
9203
|
}
|
|
@@ -9543,7 +9670,7 @@ this.Scorm2004API = (function () {
|
|
|
9543
9670
|
method: "POST",
|
|
9544
9671
|
mode: this.settings.fetchMode,
|
|
9545
9672
|
body: JSON.stringify(processedData),
|
|
9546
|
-
headers: _object_spread_props$
|
|
9673
|
+
headers: _object_spread_props$3(_object_spread$b({}, this.settings.xhrHeaders), {
|
|
9547
9674
|
"Content-Type": this.settings.commitRequestDataType
|
|
9548
9675
|
})
|
|
9549
9676
|
};
|
|
@@ -9732,6 +9859,10 @@ this.Scorm2004API = (function () {
|
|
|
9732
9859
|
function(CMIElement, value, regexPattern, errorCode, _errorClass, allowEmptyString) {
|
|
9733
9860
|
var valueKey = typeof value === "string" ? value : "[".concat(typeof value === "undefined" ? "undefined" : _type_of$L(value), "]");
|
|
9734
9861
|
return "".concat(CMIElement, ":").concat(valueKey, ":").concat(regexPattern, ":").concat(errorCode, ":").concat(allowEmptyString || false);
|
|
9862
|
+
}, // Normal capped CMI values and regexes fit within 2000 characters; large uncapped values bypass caching.
|
|
9863
|
+
{
|
|
9864
|
+
maxEntries: 1e3,
|
|
9865
|
+
maxKeyLength: 2e3
|
|
9735
9866
|
});
|
|
9736
9867
|
var checkValidRange = memoize(function(CMIElement, value, rangePattern, errorCode, errorClass) {
|
|
9737
9868
|
var ranges = rangePattern.split("#");
|
|
@@ -9754,6 +9885,8 @@ this.Scorm2004API = (function () {
|
|
|
9754
9885
|
// since it can't be stringified and doesn't affect the validation result
|
|
9755
9886
|
function(CMIElement, value, rangePattern, errorCode, _errorClass) {
|
|
9756
9887
|
return "".concat(CMIElement, ":").concat(value, ":").concat(rangePattern, ":").concat(errorCode);
|
|
9888
|
+
}, {
|
|
9889
|
+
maxEntries: 1e3
|
|
9757
9890
|
});
|
|
9758
9891
|
|
|
9759
9892
|
function check2004ValidFormat(CMIElement, value, regexPattern, allowEmptyString) {
|
|
@@ -10422,13 +10555,13 @@ this.Scorm2004API = (function () {
|
|
|
10422
10555
|
return RollupRules;
|
|
10423
10556
|
}(BaseCMI);
|
|
10424
10557
|
|
|
10425
|
-
function _array_like_to_array$
|
|
10558
|
+
function _array_like_to_array$e(arr, len) {
|
|
10426
10559
|
if (len == null || len > arr.length) len = arr.length;
|
|
10427
10560
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
10428
10561
|
return arr2;
|
|
10429
10562
|
}
|
|
10430
|
-
function _array_without_holes$
|
|
10431
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
10563
|
+
function _array_without_holes$9(arr) {
|
|
10564
|
+
if (Array.isArray(arr)) return _array_like_to_array$e(arr);
|
|
10432
10565
|
}
|
|
10433
10566
|
function _assert_this_initialized$i(self) {
|
|
10434
10567
|
if (self === void 0) {
|
|
@@ -10515,10 +10648,10 @@ this.Scorm2004API = (function () {
|
|
|
10515
10648
|
return left instanceof right;
|
|
10516
10649
|
}
|
|
10517
10650
|
}
|
|
10518
|
-
function _iterable_to_array$
|
|
10651
|
+
function _iterable_to_array$9(iter) {
|
|
10519
10652
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
10520
10653
|
}
|
|
10521
|
-
function _non_iterable_spread$
|
|
10654
|
+
function _non_iterable_spread$9() {
|
|
10522
10655
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
10523
10656
|
}
|
|
10524
10657
|
function _object_spread$a(target) {
|
|
@@ -10556,20 +10689,20 @@ this.Scorm2004API = (function () {
|
|
|
10556
10689
|
}
|
|
10557
10690
|
return object;
|
|
10558
10691
|
}
|
|
10559
|
-
function _to_consumable_array$
|
|
10560
|
-
return _array_without_holes$
|
|
10692
|
+
function _to_consumable_array$9(arr) {
|
|
10693
|
+
return _array_without_holes$9(arr) || _iterable_to_array$9(arr) || _unsupported_iterable_to_array$e(arr) || _non_iterable_spread$9();
|
|
10561
10694
|
}
|
|
10562
10695
|
function _type_of$J(obj) {
|
|
10563
10696
|
"@swc/helpers - typeof";
|
|
10564
10697
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
10565
10698
|
}
|
|
10566
|
-
function _unsupported_iterable_to_array$
|
|
10699
|
+
function _unsupported_iterable_to_array$e(o, minLen) {
|
|
10567
10700
|
if (!o) return;
|
|
10568
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
10701
|
+
if (typeof o === "string") return _array_like_to_array$e(o, minLen);
|
|
10569
10702
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
10570
10703
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
10571
10704
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
10572
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
10705
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$e(o, minLen);
|
|
10573
10706
|
}
|
|
10574
10707
|
function _is_native_reflect_construct$i() {
|
|
10575
10708
|
try {
|
|
@@ -10608,6 +10741,12 @@ this.Scorm2004API = (function () {
|
|
|
10608
10741
|
// objectives. It serves as a validity gate for other synced properties.
|
|
10609
10742
|
__publicField$J(this, "_measureStatus", false);
|
|
10610
10743
|
__publicField$J(this, "_normalizedMeasure", 0);
|
|
10744
|
+
__publicField$J(this, "_rawScore", "");
|
|
10745
|
+
__publicField$J(this, "_rawScoreKnown", false);
|
|
10746
|
+
__publicField$J(this, "_minScore", "");
|
|
10747
|
+
__publicField$J(this, "_minScoreKnown", false);
|
|
10748
|
+
__publicField$J(this, "_maxScore", "");
|
|
10749
|
+
__publicField$J(this, "_maxScoreKnown", false);
|
|
10611
10750
|
__publicField$J(this, "_progressMeasure", 0);
|
|
10612
10751
|
__publicField$J(this, "_progressMeasureStatus", false);
|
|
10613
10752
|
__publicField$J(this, "_completionStatus", CompletionStatus.UNKNOWN);
|
|
@@ -10617,11 +10756,14 @@ this.Scorm2004API = (function () {
|
|
|
10617
10756
|
__publicField$J(this, "_normalizedMeasureDirty", false);
|
|
10618
10757
|
__publicField$J(this, "_completionStatusDirty", false);
|
|
10619
10758
|
__publicField$J(this, "_progressMeasureDirty", false);
|
|
10759
|
+
__publicField$J(this, "_rawScoreDirty", false);
|
|
10760
|
+
__publicField$J(this, "_minScoreDirty", false);
|
|
10761
|
+
__publicField$J(this, "_maxScoreDirty", false);
|
|
10620
10762
|
this._id = id;
|
|
10621
10763
|
this._description = (_options_description = options.description) !== null && _options_description !== void 0 ? _options_description : null;
|
|
10622
10764
|
this._satisfiedByMeasure = (_options_satisfiedByMeasure = options.satisfiedByMeasure) !== null && _options_satisfiedByMeasure !== void 0 ? _options_satisfiedByMeasure : false;
|
|
10623
10765
|
this._minNormalizedMeasure = (_options_minNormalizedMeasure = options.minNormalizedMeasure) !== null && _options_minNormalizedMeasure !== void 0 ? _options_minNormalizedMeasure : null;
|
|
10624
|
-
this._mapInfo = options.mapInfo ? _to_consumable_array$
|
|
10766
|
+
this._mapInfo = options.mapInfo ? _to_consumable_array$9(options.mapInfo) : [];
|
|
10625
10767
|
this._isPrimary = (_options_isPrimary = options.isPrimary) !== null && _options_isPrimary !== void 0 ? _options_isPrimary : false;
|
|
10626
10768
|
}
|
|
10627
10769
|
_create_class$N(ActivityObjective, [
|
|
@@ -10661,7 +10803,7 @@ this.Scorm2004API = (function () {
|
|
|
10661
10803
|
return this._mapInfo;
|
|
10662
10804
|
},
|
|
10663
10805
|
set: function set(mapInfo) {
|
|
10664
|
-
this._mapInfo = _to_consumable_array$
|
|
10806
|
+
this._mapInfo = _to_consumable_array$9(mapInfo);
|
|
10665
10807
|
}
|
|
10666
10808
|
},
|
|
10667
10809
|
{
|
|
@@ -10682,6 +10824,8 @@ this.Scorm2004API = (function () {
|
|
|
10682
10824
|
if (this._satisfiedStatus !== value) {
|
|
10683
10825
|
this._satisfiedStatus = value;
|
|
10684
10826
|
this._satisfiedStatusDirty = true;
|
|
10827
|
+
this._satisfiedStatusKnown = true;
|
|
10828
|
+
this._progressStatus = true;
|
|
10685
10829
|
}
|
|
10686
10830
|
}
|
|
10687
10831
|
},
|
|
@@ -10715,6 +10859,120 @@ this.Scorm2004API = (function () {
|
|
|
10715
10859
|
}
|
|
10716
10860
|
}
|
|
10717
10861
|
},
|
|
10862
|
+
{
|
|
10863
|
+
key: "rawScore",
|
|
10864
|
+
get: /**
|
|
10865
|
+
* Return the known raw score value held for ADLSEQ objective score mapping.
|
|
10866
|
+
*
|
|
10867
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw score mapInfo
|
|
10868
|
+
*/ function get() {
|
|
10869
|
+
return this._rawScore;
|
|
10870
|
+
},
|
|
10871
|
+
set: /**
|
|
10872
|
+
* Store the RTE raw score associated with this objective.
|
|
10873
|
+
*
|
|
10874
|
+
* @spec SCORM 2004 4th Ed. SN 3.10.3 / ADLSEQ objectives extension - raw score mapInfo
|
|
10875
|
+
*/ function set(value) {
|
|
10876
|
+
if (this._rawScore !== value) {
|
|
10877
|
+
this._rawScore = value;
|
|
10878
|
+
this._rawScoreDirty = true;
|
|
10879
|
+
}
|
|
10880
|
+
this._rawScoreKnown = value !== "";
|
|
10881
|
+
}
|
|
10882
|
+
},
|
|
10883
|
+
{
|
|
10884
|
+
key: "rawScoreKnown",
|
|
10885
|
+
get: /**
|
|
10886
|
+
* Return whether this objective's raw score is known.
|
|
10887
|
+
*
|
|
10888
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw score known state
|
|
10889
|
+
*/ function get() {
|
|
10890
|
+
return this._rawScoreKnown;
|
|
10891
|
+
},
|
|
10892
|
+
set: /**
|
|
10893
|
+
* Set whether this objective's raw score is known.
|
|
10894
|
+
*
|
|
10895
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw score known state
|
|
10896
|
+
*/ function set(value) {
|
|
10897
|
+
this._rawScoreKnown = value;
|
|
10898
|
+
}
|
|
10899
|
+
},
|
|
10900
|
+
{
|
|
10901
|
+
key: "minScore",
|
|
10902
|
+
get: /**
|
|
10903
|
+
* Return the known minimum score value held for ADLSEQ objective score mapping.
|
|
10904
|
+
*
|
|
10905
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - min score mapInfo
|
|
10906
|
+
*/ function get() {
|
|
10907
|
+
return this._minScore;
|
|
10908
|
+
},
|
|
10909
|
+
set: /**
|
|
10910
|
+
* Store the RTE minimum score associated with this objective.
|
|
10911
|
+
*
|
|
10912
|
+
* @spec SCORM 2004 4th Ed. SN 3.10.3 / ADLSEQ objectives extension - min score mapInfo
|
|
10913
|
+
*/ function set(value) {
|
|
10914
|
+
if (this._minScore !== value) {
|
|
10915
|
+
this._minScore = value;
|
|
10916
|
+
this._minScoreDirty = true;
|
|
10917
|
+
}
|
|
10918
|
+
this._minScoreKnown = value !== "";
|
|
10919
|
+
}
|
|
10920
|
+
},
|
|
10921
|
+
{
|
|
10922
|
+
key: "minScoreKnown",
|
|
10923
|
+
get: /**
|
|
10924
|
+
* Return whether this objective's minimum score is known.
|
|
10925
|
+
*
|
|
10926
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - min score known state
|
|
10927
|
+
*/ function get() {
|
|
10928
|
+
return this._minScoreKnown;
|
|
10929
|
+
},
|
|
10930
|
+
set: /**
|
|
10931
|
+
* Set whether this objective's minimum score is known.
|
|
10932
|
+
*
|
|
10933
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - min score known state
|
|
10934
|
+
*/ function set(value) {
|
|
10935
|
+
this._minScoreKnown = value;
|
|
10936
|
+
}
|
|
10937
|
+
},
|
|
10938
|
+
{
|
|
10939
|
+
key: "maxScore",
|
|
10940
|
+
get: /**
|
|
10941
|
+
* Return the known maximum score value held for ADLSEQ objective score mapping.
|
|
10942
|
+
*
|
|
10943
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - max score mapInfo
|
|
10944
|
+
*/ function get() {
|
|
10945
|
+
return this._maxScore;
|
|
10946
|
+
},
|
|
10947
|
+
set: /**
|
|
10948
|
+
* Store the RTE maximum score associated with this objective.
|
|
10949
|
+
*
|
|
10950
|
+
* @spec SCORM 2004 4th Ed. SN 3.10.3 / ADLSEQ objectives extension - max score mapInfo
|
|
10951
|
+
*/ function set(value) {
|
|
10952
|
+
if (this._maxScore !== value) {
|
|
10953
|
+
this._maxScore = value;
|
|
10954
|
+
this._maxScoreDirty = true;
|
|
10955
|
+
}
|
|
10956
|
+
this._maxScoreKnown = value !== "";
|
|
10957
|
+
}
|
|
10958
|
+
},
|
|
10959
|
+
{
|
|
10960
|
+
key: "maxScoreKnown",
|
|
10961
|
+
get: /**
|
|
10962
|
+
* Return whether this objective's maximum score is known.
|
|
10963
|
+
*
|
|
10964
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - max score known state
|
|
10965
|
+
*/ function get() {
|
|
10966
|
+
return this._maxScoreKnown;
|
|
10967
|
+
},
|
|
10968
|
+
set: /**
|
|
10969
|
+
* Set whether this objective's maximum score is known.
|
|
10970
|
+
*
|
|
10971
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - max score known state
|
|
10972
|
+
*/ function set(value) {
|
|
10973
|
+
this._maxScoreKnown = value;
|
|
10974
|
+
}
|
|
10975
|
+
},
|
|
10718
10976
|
{
|
|
10719
10977
|
key: "progressMeasure",
|
|
10720
10978
|
get: function get() {
|
|
@@ -10758,7 +11016,11 @@ this.Scorm2004API = (function () {
|
|
|
10758
11016
|
}
|
|
10759
11017
|
},
|
|
10760
11018
|
{
|
|
10761
|
-
|
|
11019
|
+
/**
|
|
11020
|
+
* Report whether a local objective field has changed since the last global write.
|
|
11021
|
+
*
|
|
11022
|
+
* @spec SCORM 2004 4th Ed. SN 3.10.3 / ADLSEQ objectives extension - write maps use known local objective data
|
|
11023
|
+
*/ key: "isDirty",
|
|
10762
11024
|
value: function isDirty(property) {
|
|
10763
11025
|
switch(property){
|
|
10764
11026
|
case "satisfiedStatus":
|
|
@@ -10769,11 +11031,21 @@ this.Scorm2004API = (function () {
|
|
|
10769
11031
|
return this._completionStatusDirty;
|
|
10770
11032
|
case "progressMeasure":
|
|
10771
11033
|
return this._progressMeasureDirty;
|
|
11034
|
+
case "rawScore":
|
|
11035
|
+
return this._rawScoreDirty;
|
|
11036
|
+
case "minScore":
|
|
11037
|
+
return this._minScoreDirty;
|
|
11038
|
+
case "maxScore":
|
|
11039
|
+
return this._maxScoreDirty;
|
|
10772
11040
|
}
|
|
10773
11041
|
}
|
|
10774
11042
|
},
|
|
10775
11043
|
{
|
|
10776
|
-
|
|
11044
|
+
/**
|
|
11045
|
+
* Clear a local objective dirty flag after a successful global write.
|
|
11046
|
+
*
|
|
11047
|
+
* @spec SCORM 2004 4th Ed. SN 3.10.3 / ADLSEQ objectives extension - write maps update global objective state
|
|
11048
|
+
*/ key: "clearDirty",
|
|
10777
11049
|
value: function clearDirty(property) {
|
|
10778
11050
|
switch(property){
|
|
10779
11051
|
case "satisfiedStatus":
|
|
@@ -10788,16 +11060,33 @@ this.Scorm2004API = (function () {
|
|
|
10788
11060
|
case "progressMeasure":
|
|
10789
11061
|
this._progressMeasureDirty = false;
|
|
10790
11062
|
break;
|
|
11063
|
+
case "rawScore":
|
|
11064
|
+
this._rawScoreDirty = false;
|
|
11065
|
+
break;
|
|
11066
|
+
case "minScore":
|
|
11067
|
+
this._minScoreDirty = false;
|
|
11068
|
+
break;
|
|
11069
|
+
case "maxScore":
|
|
11070
|
+
this._maxScoreDirty = false;
|
|
11071
|
+
break;
|
|
10791
11072
|
}
|
|
10792
11073
|
}
|
|
10793
11074
|
},
|
|
10794
11075
|
{
|
|
10795
|
-
|
|
11076
|
+
/**
|
|
11077
|
+
* Clear all write-map dirty flags for this objective.
|
|
11078
|
+
*
|
|
11079
|
+
* @spec SCORM 2004 4th Ed. SN 3.10.3 - objective mapInfo writes are field-specific
|
|
11080
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - score mapInfo writes are field-specific
|
|
11081
|
+
*/ key: "clearAllDirty",
|
|
10796
11082
|
value: function clearAllDirty() {
|
|
10797
11083
|
this._satisfiedStatusDirty = false;
|
|
10798
11084
|
this._normalizedMeasureDirty = false;
|
|
10799
11085
|
this._completionStatusDirty = false;
|
|
10800
11086
|
this._progressMeasureDirty = false;
|
|
11087
|
+
this._rawScoreDirty = false;
|
|
11088
|
+
this._minScoreDirty = false;
|
|
11089
|
+
this._maxScoreDirty = false;
|
|
10801
11090
|
}
|
|
10802
11091
|
},
|
|
10803
11092
|
{
|
|
@@ -10809,6 +11098,8 @@ this.Scorm2004API = (function () {
|
|
|
10809
11098
|
* @param satisfiedStatus - The satisfied status from CMI
|
|
10810
11099
|
* @param normalizedMeasure - The normalized measure from CMI
|
|
10811
11100
|
* @param measureStatus - Whether measure is valid
|
|
11101
|
+
*
|
|
11102
|
+
* @spec SCORM 2004 4th Ed. RTE-to-SN Data Transfer - objective satisfaction and measure transfer
|
|
10812
11103
|
*/ key: "initializeFromCMI",
|
|
10813
11104
|
value: function initializeFromCMI(satisfiedStatus, normalizedMeasure, measureStatus) {
|
|
10814
11105
|
this._satisfiedStatus = satisfiedStatus;
|
|
@@ -10819,12 +11110,86 @@ this.Scorm2004API = (function () {
|
|
|
10819
11110
|
}
|
|
10820
11111
|
},
|
|
10821
11112
|
{
|
|
10822
|
-
|
|
11113
|
+
/**
|
|
11114
|
+
* Initialize raw/min/max objective score values from RTE data transfer.
|
|
11115
|
+
*
|
|
11116
|
+
* @spec SCORM 2004 4th Ed. RTE-to-SN Data Transfer - objective score transfer
|
|
11117
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max score mapInfo writes
|
|
11118
|
+
*/ key: "initializeScoreFromCMI",
|
|
11119
|
+
value: function initializeScoreFromCMI(score) {
|
|
11120
|
+
if (score.rawScore !== void 0 && score.rawScore !== "") {
|
|
11121
|
+
this._rawScore = score.rawScore;
|
|
11122
|
+
this._rawScoreKnown = true;
|
|
11123
|
+
this._rawScoreDirty = true;
|
|
11124
|
+
}
|
|
11125
|
+
if (score.minScore !== void 0 && score.minScore !== "") {
|
|
11126
|
+
this._minScore = score.minScore;
|
|
11127
|
+
this._minScoreKnown = true;
|
|
11128
|
+
this._minScoreDirty = true;
|
|
11129
|
+
}
|
|
11130
|
+
if (score.maxScore !== void 0 && score.maxScore !== "") {
|
|
11131
|
+
this._maxScore = score.maxScore;
|
|
11132
|
+
this._maxScoreKnown = true;
|
|
11133
|
+
this._maxScoreDirty = true;
|
|
11134
|
+
}
|
|
11135
|
+
}
|
|
11136
|
+
},
|
|
11137
|
+
{
|
|
11138
|
+
/**
|
|
11139
|
+
* Apply read-mapped global objective state without marking the values dirty.
|
|
11140
|
+
*
|
|
11141
|
+
* @spec SCORM 2004 4th Ed. SN 3.10.3 - read maps provide access to global objective state
|
|
11142
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - score read maps are access-only
|
|
11143
|
+
*/ key: "applyReadMappedState",
|
|
11144
|
+
value: function applyReadMappedState(state) {
|
|
11145
|
+
if (state.satisfiedStatus !== void 0) {
|
|
11146
|
+
this._satisfiedStatus = state.satisfiedStatus;
|
|
11147
|
+
this._satisfiedStatusKnown = true;
|
|
11148
|
+
this._progressStatus = true;
|
|
11149
|
+
}
|
|
11150
|
+
if (state.normalizedMeasure !== void 0) {
|
|
11151
|
+
this._normalizedMeasure = state.normalizedMeasure;
|
|
11152
|
+
this._measureStatus = true;
|
|
11153
|
+
}
|
|
11154
|
+
if (state.completionStatus !== void 0) {
|
|
11155
|
+
this._completionStatus = state.completionStatus;
|
|
11156
|
+
}
|
|
11157
|
+
if (state.progressMeasure !== void 0) {
|
|
11158
|
+
this._progressMeasure = state.progressMeasure;
|
|
11159
|
+
this._progressMeasureStatus = true;
|
|
11160
|
+
}
|
|
11161
|
+
if (state.rawScore !== void 0) {
|
|
11162
|
+
this._rawScore = state.rawScore;
|
|
11163
|
+
this._rawScoreKnown = true;
|
|
11164
|
+
}
|
|
11165
|
+
if (state.minScore !== void 0) {
|
|
11166
|
+
this._minScore = state.minScore;
|
|
11167
|
+
this._minScoreKnown = true;
|
|
11168
|
+
}
|
|
11169
|
+
if (state.maxScore !== void 0) {
|
|
11170
|
+
this._maxScore = state.maxScore;
|
|
11171
|
+
this._maxScoreKnown = true;
|
|
11172
|
+
}
|
|
11173
|
+
}
|
|
11174
|
+
},
|
|
11175
|
+
{
|
|
11176
|
+
/**
|
|
11177
|
+
* Reset local objective state for a fresh activity attempt.
|
|
11178
|
+
*
|
|
11179
|
+
* @spec SCORM 2004 4th Ed. SN 3.10 Objective Description - unknown objective state before tracking data exists
|
|
11180
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - score map fields are unknown until transferred or read
|
|
11181
|
+
*/ key: "resetState",
|
|
10823
11182
|
value: function resetState() {
|
|
10824
11183
|
this._satisfiedStatus = false;
|
|
10825
11184
|
this._satisfiedStatusKnown = false;
|
|
10826
11185
|
this._measureStatus = false;
|
|
10827
11186
|
this._normalizedMeasure = 0;
|
|
11187
|
+
this._rawScore = "";
|
|
11188
|
+
this._rawScoreKnown = false;
|
|
11189
|
+
this._minScore = "";
|
|
11190
|
+
this._minScoreKnown = false;
|
|
11191
|
+
this._maxScore = "";
|
|
11192
|
+
this._maxScoreKnown = false;
|
|
10828
11193
|
this._progressMeasure = 0;
|
|
10829
11194
|
this._progressMeasureStatus = false;
|
|
10830
11195
|
this._completionStatus = CompletionStatus.UNKNOWN;
|
|
@@ -10833,7 +11198,11 @@ this.Scorm2004API = (function () {
|
|
|
10833
11198
|
}
|
|
10834
11199
|
},
|
|
10835
11200
|
{
|
|
10836
|
-
|
|
11201
|
+
/**
|
|
11202
|
+
* Copy primary activity objective state back into the primary objective model.
|
|
11203
|
+
*
|
|
11204
|
+
* @spec SCORM 2004 4th Ed. RTE-to-SN Data Transfer - primary objective state is available to sequencing
|
|
11205
|
+
*/ key: "updateFromActivity",
|
|
10837
11206
|
value: function updateFromActivity(activity) {
|
|
10838
11207
|
if (this._satisfiedStatus !== activity.objectiveSatisfiedStatus) {
|
|
10839
11208
|
this._satisfiedStatus = activity.objectiveSatisfiedStatus;
|
|
@@ -10857,12 +11226,16 @@ this.Scorm2004API = (function () {
|
|
|
10857
11226
|
}
|
|
10858
11227
|
},
|
|
10859
11228
|
{
|
|
10860
|
-
|
|
11229
|
+
/**
|
|
11230
|
+
* Apply primary objective state to the owning activity for sequencing rules and rollup.
|
|
11231
|
+
*
|
|
11232
|
+
* @spec SCORM 2004 4th Ed. SN 3.10 Objective Description - primary objective contributes activity state
|
|
11233
|
+
*/ key: "applyToActivity",
|
|
10861
11234
|
value: function applyToActivity(activity) {
|
|
10862
11235
|
if (!this._isPrimary) {
|
|
10863
11236
|
return;
|
|
10864
11237
|
}
|
|
10865
|
-
activity.setPrimaryObjectiveState(this._satisfiedStatus, this._measureStatus, this._normalizedMeasure, this._progressMeasure, this._progressMeasureStatus, this._completionStatus);
|
|
11238
|
+
activity.setPrimaryObjectiveState(this._satisfiedStatus, this._measureStatus, this._normalizedMeasure, this._progressMeasure, this._progressMeasureStatus, this._completionStatus, this._progressStatus || this._satisfiedStatusKnown);
|
|
10866
11239
|
}
|
|
10867
11240
|
}
|
|
10868
11241
|
]);
|
|
@@ -11214,7 +11587,7 @@ this.Scorm2004API = (function () {
|
|
|
11214
11587
|
(_this__children = this._children).splice.apply(_this__children, [
|
|
11215
11588
|
0,
|
|
11216
11589
|
this._children.length
|
|
11217
|
-
].concat(_to_consumable_array$
|
|
11590
|
+
].concat(_to_consumable_array$9(reordered)));
|
|
11218
11591
|
}
|
|
11219
11592
|
}
|
|
11220
11593
|
},
|
|
@@ -12099,7 +12472,7 @@ this.Scorm2004API = (function () {
|
|
|
12099
12472
|
set: /**
|
|
12100
12473
|
* Setter for primary objective
|
|
12101
12474
|
* @param {ActivityObjective | null} objective
|
|
12102
|
-
|
|
12475
|
+
*/ function set(objective) {
|
|
12103
12476
|
this._primaryObjective = objective;
|
|
12104
12477
|
if (this._primaryObjective) {
|
|
12105
12478
|
this._primaryObjective.isPrimary = true;
|
|
@@ -12127,8 +12500,8 @@ this.Scorm2004API = (function () {
|
|
|
12127
12500
|
set: /**
|
|
12128
12501
|
* Replace objectives collection
|
|
12129
12502
|
* @param {ActivityObjective[]} objectives
|
|
12130
|
-
|
|
12131
|
-
this._objectives = _to_consumable_array$
|
|
12503
|
+
*/ function set(objectives) {
|
|
12504
|
+
this._objectives = _to_consumable_array$9(objectives);
|
|
12132
12505
|
this.syncPrimaryObjectiveCollection();
|
|
12133
12506
|
}
|
|
12134
12507
|
},
|
|
@@ -12167,7 +12540,7 @@ this.Scorm2004API = (function () {
|
|
|
12167
12540
|
}
|
|
12168
12541
|
this._objectives = [
|
|
12169
12542
|
this._primaryObjective
|
|
12170
|
-
].concat(_to_consumable_array$
|
|
12543
|
+
].concat(_to_consumable_array$9(this._objectives));
|
|
12171
12544
|
}
|
|
12172
12545
|
},
|
|
12173
12546
|
{
|
|
@@ -12262,11 +12635,12 @@ this.Scorm2004API = (function () {
|
|
|
12262
12635
|
{
|
|
12263
12636
|
key: "setPrimaryObjectiveState",
|
|
12264
12637
|
value: function setPrimaryObjectiveState(satisfiedStatus, measureStatus, normalizedMeasure, progressMeasure, progressMeasureStatus, completionStatus) {
|
|
12638
|
+
var objectiveProgressStatus = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : true;
|
|
12265
12639
|
if (this._objectiveSatisfiedStatus !== satisfiedStatus) {
|
|
12266
12640
|
this._objectiveSatisfiedStatus = satisfiedStatus;
|
|
12267
12641
|
this._objectiveSatisfiedStatusDirty = true;
|
|
12268
12642
|
}
|
|
12269
|
-
this._objectiveSatisfiedStatusKnown =
|
|
12643
|
+
this._objectiveSatisfiedStatusKnown = objectiveProgressStatus;
|
|
12270
12644
|
if (this._objectiveMeasureStatus !== measureStatus) {
|
|
12271
12645
|
this._objectiveMeasureStatus = measureStatus;
|
|
12272
12646
|
this._objectiveMeasureStatusDirty = true;
|
|
@@ -12285,11 +12659,18 @@ this.Scorm2004API = (function () {
|
|
|
12285
12659
|
this._primaryObjective.progressMeasure = progressMeasure;
|
|
12286
12660
|
this._primaryObjective.progressMeasureStatus = progressMeasureStatus;
|
|
12287
12661
|
this._primaryObjective.completionStatus = completionStatus;
|
|
12662
|
+
this._primaryObjective.satisfiedStatusKnown = objectiveProgressStatus;
|
|
12663
|
+
this._primaryObjective.progressStatus = objectiveProgressStatus;
|
|
12288
12664
|
}
|
|
12289
12665
|
}
|
|
12290
12666
|
},
|
|
12291
12667
|
{
|
|
12292
|
-
|
|
12668
|
+
/**
|
|
12669
|
+
* Snapshot objective state for sequencing persistence.
|
|
12670
|
+
*
|
|
12671
|
+
* @spec SCORM 2004 4th Ed. SN 3.10 Objective Description - objective state persists across attempts
|
|
12672
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - score-map state persists with objective state
|
|
12673
|
+
*/ key: "getObjectiveStateSnapshot",
|
|
12293
12674
|
value: function getObjectiveStateSnapshot() {
|
|
12294
12675
|
var _this_progressMeasure;
|
|
12295
12676
|
var primarySnapshot = this._primaryObjective ? {
|
|
@@ -12297,6 +12678,12 @@ this.Scorm2004API = (function () {
|
|
|
12297
12678
|
satisfiedStatus: this.objectiveSatisfiedStatus,
|
|
12298
12679
|
measureStatus: this.objectiveMeasureStatus,
|
|
12299
12680
|
normalizedMeasure: this.objectiveNormalizedMeasure,
|
|
12681
|
+
rawScore: this._primaryObjective.rawScore,
|
|
12682
|
+
rawScoreKnown: this._primaryObjective.rawScoreKnown,
|
|
12683
|
+
minScore: this._primaryObjective.minScore,
|
|
12684
|
+
minScoreKnown: this._primaryObjective.minScoreKnown,
|
|
12685
|
+
maxScore: this._primaryObjective.maxScore,
|
|
12686
|
+
maxScoreKnown: this._primaryObjective.maxScoreKnown,
|
|
12300
12687
|
progressMeasure: (_this_progressMeasure = this.progressMeasure) !== null && _this_progressMeasure !== void 0 ? _this_progressMeasure : 0,
|
|
12301
12688
|
progressMeasureStatus: this.progressMeasureStatus,
|
|
12302
12689
|
progressStatus: this._primaryObjective.progressStatus,
|
|
@@ -12310,6 +12697,12 @@ this.Scorm2004API = (function () {
|
|
|
12310
12697
|
satisfiedStatus: objective.satisfiedStatus,
|
|
12311
12698
|
measureStatus: objective.measureStatus,
|
|
12312
12699
|
normalizedMeasure: objective.normalizedMeasure,
|
|
12700
|
+
rawScore: objective.rawScore,
|
|
12701
|
+
rawScoreKnown: objective.rawScoreKnown,
|
|
12702
|
+
minScore: objective.minScore,
|
|
12703
|
+
minScoreKnown: objective.minScoreKnown,
|
|
12704
|
+
maxScore: objective.maxScore,
|
|
12705
|
+
maxScoreKnown: objective.maxScoreKnown,
|
|
12313
12706
|
progressMeasure: objective.progressMeasure,
|
|
12314
12707
|
progressMeasureStatus: objective.progressMeasureStatus,
|
|
12315
12708
|
progressStatus: objective.progressStatus,
|
|
@@ -12325,7 +12718,12 @@ this.Scorm2004API = (function () {
|
|
|
12325
12718
|
}
|
|
12326
12719
|
},
|
|
12327
12720
|
{
|
|
12328
|
-
|
|
12721
|
+
/**
|
|
12722
|
+
* Restore objective state from a sequencing persistence snapshot.
|
|
12723
|
+
*
|
|
12724
|
+
* @spec SCORM 2004 4th Ed. SN 3.10 Objective Description - persisted objective state restores sequencing state
|
|
12725
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - persisted score-map state restores objective score fields
|
|
12726
|
+
*/ key: "applyObjectiveStateSnapshot",
|
|
12329
12727
|
value: function applyObjectiveStateSnapshot(snapshot) {
|
|
12330
12728
|
if (snapshot.primary) {
|
|
12331
12729
|
var primary = this.getObjectiveById(snapshot.primary.id);
|
|
@@ -12334,7 +12732,8 @@ this.Scorm2004API = (function () {
|
|
|
12334
12732
|
var state = snapshot.primary;
|
|
12335
12733
|
primary.objective.satisfiedByMeasure = (_state_satisfiedByMeasure = state.satisfiedByMeasure) !== null && _state_satisfiedByMeasure !== void 0 ? _state_satisfiedByMeasure : primary.objective.satisfiedByMeasure;
|
|
12336
12734
|
primary.objective.minNormalizedMeasure = state.minNormalizedMeasure !== void 0 ? state.minNormalizedMeasure : primary.objective.minNormalizedMeasure;
|
|
12337
|
-
this.setPrimaryObjectiveState(state.satisfiedStatus, state.measureStatus, state.normalizedMeasure, state.progressMeasure, state.progressMeasureStatus, state.completionStatus);
|
|
12735
|
+
this.setPrimaryObjectiveState(state.satisfiedStatus, state.measureStatus, state.normalizedMeasure, state.progressMeasure, state.progressMeasureStatus, state.completionStatus, state.progressStatus);
|
|
12736
|
+
this.applyObjectiveScoreSnapshot(primary.objective, state);
|
|
12338
12737
|
}
|
|
12339
12738
|
}
|
|
12340
12739
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
@@ -12351,6 +12750,7 @@ this.Scorm2004API = (function () {
|
|
|
12351
12750
|
objective.progressMeasure = state1.progressMeasure;
|
|
12352
12751
|
objective.progressMeasureStatus = state1.progressMeasureStatus;
|
|
12353
12752
|
objective.completionStatus = state1.completionStatus;
|
|
12753
|
+
this.applyObjectiveScoreSnapshot(objective, state1);
|
|
12354
12754
|
objective.satisfiedByMeasure = (_state_satisfiedByMeasure1 = state1.satisfiedByMeasure) !== null && _state_satisfiedByMeasure1 !== void 0 ? _state_satisfiedByMeasure1 : objective.satisfiedByMeasure;
|
|
12355
12755
|
objective.minNormalizedMeasure = state1.minNormalizedMeasure !== void 0 ? state1.minNormalizedMeasure : objective.minNormalizedMeasure;
|
|
12356
12756
|
}
|
|
@@ -12373,6 +12773,26 @@ this.Scorm2004API = (function () {
|
|
|
12373
12773
|
},
|
|
12374
12774
|
{
|
|
12375
12775
|
/**
|
|
12776
|
+
* Restore known raw/min/max score fields from an objective state snapshot.
|
|
12777
|
+
*
|
|
12778
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max score known flags restore independently
|
|
12779
|
+
*/ key: "applyObjectiveScoreSnapshot",
|
|
12780
|
+
value: function applyObjectiveScoreSnapshot(objective, state) {
|
|
12781
|
+
var scoreState = {};
|
|
12782
|
+
if (state.rawScoreKnown) {
|
|
12783
|
+
scoreState.rawScore = state.rawScore;
|
|
12784
|
+
}
|
|
12785
|
+
if (state.minScoreKnown) {
|
|
12786
|
+
scoreState.minScore = state.minScore;
|
|
12787
|
+
}
|
|
12788
|
+
if (state.maxScoreKnown) {
|
|
12789
|
+
scoreState.maxScore = state.maxScore;
|
|
12790
|
+
}
|
|
12791
|
+
objective.applyReadMappedState(scoreState);
|
|
12792
|
+
}
|
|
12793
|
+
},
|
|
12794
|
+
{
|
|
12795
|
+
/**
|
|
12376
12796
|
* Get available children with selection and randomization applied
|
|
12377
12797
|
* @return {Activity[]}
|
|
12378
12798
|
*/ key: "getAvailableChildren",
|
|
@@ -12733,7 +13153,7 @@ this.Scorm2004API = (function () {
|
|
|
12733
13153
|
minProgressMeasure: this._minProgressMeasure,
|
|
12734
13154
|
progressWeight: this._progressWeight,
|
|
12735
13155
|
attemptCompletionAmountStatus: this._attemptCompletionAmountStatus,
|
|
12736
|
-
hideLmsUi: _to_consumable_array$
|
|
13156
|
+
hideLmsUi: _to_consumable_array$9(this._hideLmsUi),
|
|
12737
13157
|
auxiliaryResources: this._auxiliaryResources.map(function(resource) {
|
|
12738
13158
|
return _object_spread$a({}, resource);
|
|
12739
13159
|
}),
|
|
@@ -12791,7 +13211,7 @@ this.Scorm2004API = (function () {
|
|
|
12791
13211
|
{
|
|
12792
13212
|
key: "addAuxiliaryResource",
|
|
12793
13213
|
value: function addAuxiliaryResource(resource) {
|
|
12794
|
-
this.auxiliaryResources = _to_consumable_array$
|
|
13214
|
+
this.auxiliaryResources = _to_consumable_array$9(this._auxiliaryResources).concat([
|
|
12795
13215
|
resource
|
|
12796
13216
|
]);
|
|
12797
13217
|
}
|
|
@@ -12819,7 +13239,7 @@ this.Scorm2004API = (function () {
|
|
|
12819
13239
|
* Getter for hideLmsUi directives
|
|
12820
13240
|
* @return {HideLmsUiItem[]}
|
|
12821
13241
|
*/ function get() {
|
|
12822
|
-
return _to_consumable_array$
|
|
13242
|
+
return _to_consumable_array$9(this._hideLmsUi);
|
|
12823
13243
|
},
|
|
12824
13244
|
set: /**
|
|
12825
13245
|
* Setter for hideLmsUi directives
|
|
@@ -14372,6 +14792,7 @@ this.Scorm2004API = (function () {
|
|
|
14372
14792
|
}
|
|
14373
14793
|
function _create_class$F(Constructor, protoProps, staticProps) {
|
|
14374
14794
|
if (protoProps) _defineProperties$F(Constructor.prototype, protoProps);
|
|
14795
|
+
if (staticProps) _defineProperties$F(Constructor, staticProps);
|
|
14375
14796
|
return Constructor;
|
|
14376
14797
|
}
|
|
14377
14798
|
function _instanceof$9(left, right) {
|
|
@@ -14519,8 +14940,14 @@ this.Scorm2004API = (function () {
|
|
|
14519
14940
|
*
|
|
14520
14941
|
* @param activity - The activity to process
|
|
14521
14942
|
* @param globalObjectives - Global objective map
|
|
14943
|
+
*
|
|
14944
|
+
* @spec SCORM 2004 4th Ed. SN 3.10.3 - write mapInfo transfers local objective state to global objectives
|
|
14945
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max score write maps
|
|
14522
14946
|
*/ key: "syncGlobalObjectivesWritePhase",
|
|
14523
14947
|
value: function syncGlobalObjectivesWritePhase(activity, globalObjectives) {
|
|
14948
|
+
if (!this.canWriteGlobalObjectives(activity)) {
|
|
14949
|
+
return;
|
|
14950
|
+
}
|
|
14524
14951
|
var objectives = activity.getAllObjectives();
|
|
14525
14952
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
14526
14953
|
try {
|
|
@@ -14529,38 +14956,54 @@ this.Scorm2004API = (function () {
|
|
|
14529
14956
|
var mapInfos = objective.mapInfo.length > 0 ? objective.mapInfo : [
|
|
14530
14957
|
this.createDefaultMapInfo(objective)
|
|
14531
14958
|
];
|
|
14959
|
+
var dirtyFieldsToClear = /* @__PURE__ */ new Set();
|
|
14532
14960
|
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
14533
14961
|
try {
|
|
14534
14962
|
for(var _iterator1 = mapInfos[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
14535
14963
|
var mapInfo = _step1.value;
|
|
14536
14964
|
var targetId = mapInfo.targetObjectiveID || objective.id;
|
|
14537
14965
|
var globalObjective = this.ensureGlobalObjectiveEntry(globalObjectives, targetId, objective);
|
|
14538
|
-
if (mapInfo.writeSatisfiedStatus && objective
|
|
14966
|
+
if (mapInfo.writeSatisfiedStatus && this.hasKnownSatisfiedStatus(objective) && objective.isDirty("satisfiedStatus")) {
|
|
14539
14967
|
globalObjective.satisfiedStatus = objective.satisfiedStatus;
|
|
14540
14968
|
globalObjective.satisfiedStatusKnown = true;
|
|
14541
|
-
|
|
14969
|
+
dirtyFieldsToClear.add("satisfiedStatus");
|
|
14542
14970
|
}
|
|
14543
14971
|
if (mapInfo.writeNormalizedMeasure && objective.measureStatus && objective.isDirty("normalizedMeasure")) {
|
|
14544
14972
|
globalObjective.normalizedMeasure = objective.normalizedMeasure;
|
|
14545
14973
|
globalObjective.normalizedMeasureKnown = true;
|
|
14546
|
-
|
|
14547
|
-
if (
|
|
14974
|
+
dirtyFieldsToClear.add("normalizedMeasure");
|
|
14975
|
+
if (mapInfo.writeSatisfiedStatus && objective.satisfiedByMeasure) {
|
|
14548
14976
|
var _ref, _objective_minNormalizedMeasure;
|
|
14549
14977
|
var threshold = (_ref = (_objective_minNormalizedMeasure = objective.minNormalizedMeasure) !== null && _objective_minNormalizedMeasure !== void 0 ? _objective_minNormalizedMeasure : activity.scaledPassingScore) !== null && _ref !== void 0 ? _ref : 0.7;
|
|
14550
14978
|
globalObjective.satisfiedStatus = objective.normalizedMeasure >= threshold;
|
|
14551
14979
|
globalObjective.satisfiedStatusKnown = true;
|
|
14552
|
-
|
|
14980
|
+
dirtyFieldsToClear.add("satisfiedStatus");
|
|
14553
14981
|
}
|
|
14554
14982
|
}
|
|
14555
14983
|
if (mapInfo.writeCompletionStatus && objective.completionStatus !== CompletionStatus.UNKNOWN && objective.isDirty("completionStatus")) {
|
|
14556
14984
|
globalObjective.completionStatus = objective.completionStatus;
|
|
14557
14985
|
globalObjective.completionStatusKnown = true;
|
|
14558
|
-
|
|
14986
|
+
dirtyFieldsToClear.add("completionStatus");
|
|
14987
|
+
}
|
|
14988
|
+
if (mapInfo.writeRawScore && objective.rawScoreKnown && objective.isDirty("rawScore")) {
|
|
14989
|
+
globalObjective.rawScore = objective.rawScore;
|
|
14990
|
+
globalObjective.rawScoreKnown = true;
|
|
14991
|
+
dirtyFieldsToClear.add("rawScore");
|
|
14992
|
+
}
|
|
14993
|
+
if (mapInfo.writeMinScore && objective.minScoreKnown && objective.isDirty("minScore")) {
|
|
14994
|
+
globalObjective.minScore = objective.minScore;
|
|
14995
|
+
globalObjective.minScoreKnown = true;
|
|
14996
|
+
dirtyFieldsToClear.add("minScore");
|
|
14997
|
+
}
|
|
14998
|
+
if (mapInfo.writeMaxScore && objective.maxScoreKnown && objective.isDirty("maxScore")) {
|
|
14999
|
+
globalObjective.maxScore = objective.maxScore;
|
|
15000
|
+
globalObjective.maxScoreKnown = true;
|
|
15001
|
+
dirtyFieldsToClear.add("maxScore");
|
|
14559
15002
|
}
|
|
14560
15003
|
if (mapInfo.writeProgressMeasure && objective.progressMeasureStatus && objective.isDirty("progressMeasure")) {
|
|
14561
15004
|
globalObjective.progressMeasure = objective.progressMeasure;
|
|
14562
15005
|
globalObjective.progressMeasureKnown = true;
|
|
14563
|
-
|
|
15006
|
+
dirtyFieldsToClear.add("progressMeasure");
|
|
14564
15007
|
}
|
|
14565
15008
|
if (mapInfo.updateAttemptData) {
|
|
14566
15009
|
this.updateActivityAttemptData(activity, globalObjective, objective);
|
|
@@ -14580,6 +15023,26 @@ this.Scorm2004API = (function () {
|
|
|
14580
15023
|
}
|
|
14581
15024
|
}
|
|
14582
15025
|
}
|
|
15026
|
+
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = undefined;
|
|
15027
|
+
try {
|
|
15028
|
+
for(var _iterator2 = dirtyFieldsToClear[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true){
|
|
15029
|
+
var property = _step2.value;
|
|
15030
|
+
objective.clearDirty(property);
|
|
15031
|
+
}
|
|
15032
|
+
} catch (err) {
|
|
15033
|
+
_didIteratorError2 = true;
|
|
15034
|
+
_iteratorError2 = err;
|
|
15035
|
+
} finally{
|
|
15036
|
+
try {
|
|
15037
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
|
|
15038
|
+
_iterator2.return();
|
|
15039
|
+
}
|
|
15040
|
+
} finally{
|
|
15041
|
+
if (_didIteratorError2) {
|
|
15042
|
+
throw _iteratorError2;
|
|
15043
|
+
}
|
|
15044
|
+
}
|
|
15045
|
+
}
|
|
14583
15046
|
}
|
|
14584
15047
|
} catch (err) {
|
|
14585
15048
|
_didIteratorError = true;
|
|
@@ -14603,6 +15066,9 @@ this.Scorm2004API = (function () {
|
|
|
14603
15066
|
*
|
|
14604
15067
|
* @param activity - The activity to process
|
|
14605
15068
|
* @param globalObjectives - Global objective map
|
|
15069
|
+
*
|
|
15070
|
+
* @spec SCORM 2004 4th Ed. SN 3.10.3 - read mapInfo transfers global objective state into the local view
|
|
15071
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max score read maps
|
|
14606
15072
|
*/ key: "syncGlobalObjectivesReadPhase",
|
|
14607
15073
|
value: function syncGlobalObjectivesReadPhase(activity, globalObjectives) {
|
|
14608
15074
|
var objectives = activity.getAllObjectives();
|
|
@@ -14622,26 +15088,8 @@ this.Scorm2004API = (function () {
|
|
|
14622
15088
|
var globalObjective = globalObjectives.get(targetId);
|
|
14623
15089
|
if (!globalObjective) continue;
|
|
14624
15090
|
var isPrimary = objective.isPrimary;
|
|
14625
|
-
|
|
14626
|
-
|
|
14627
|
-
objective.measureStatus = true;
|
|
14628
|
-
}
|
|
14629
|
-
if (mapInfo.readNormalizedMeasure && globalObjective.normalizedMeasureKnown) {
|
|
14630
|
-
objective.normalizedMeasure = globalObjective.normalizedMeasure;
|
|
14631
|
-
objective.measureStatus = true;
|
|
14632
|
-
if (globalObjective.satisfiedByMeasure || objective.satisfiedByMeasure) {
|
|
14633
|
-
var _ref, _objective_minNormalizedMeasure;
|
|
14634
|
-
var threshold = (_ref = (_objective_minNormalizedMeasure = objective.minNormalizedMeasure) !== null && _objective_minNormalizedMeasure !== void 0 ? _objective_minNormalizedMeasure : activity.scaledPassingScore) !== null && _ref !== void 0 ? _ref : 0.7;
|
|
14635
|
-
objective.satisfiedStatus = globalObjective.normalizedMeasure >= threshold;
|
|
14636
|
-
}
|
|
14637
|
-
}
|
|
14638
|
-
if (mapInfo.readProgressMeasure && globalObjective.progressMeasureKnown) {
|
|
14639
|
-
objective.progressMeasure = globalObjective.progressMeasure;
|
|
14640
|
-
objective.progressMeasureStatus = true;
|
|
14641
|
-
}
|
|
14642
|
-
if (mapInfo.readCompletionStatus && globalObjective.completionStatusKnown) {
|
|
14643
|
-
objective.completionStatus = globalObjective.completionStatus;
|
|
14644
|
-
}
|
|
15091
|
+
var readState = GlobalObjectiveSynchronizer.getGlobalObjectiveReadState(activity, objective, mapInfo, globalObjective);
|
|
15092
|
+
this.applyGlobalObjectiveReadState(objective, readState);
|
|
14645
15093
|
if (isPrimary) {
|
|
14646
15094
|
objective.applyToActivity(activity);
|
|
14647
15095
|
}
|
|
@@ -14748,59 +15196,58 @@ this.Scorm2004API = (function () {
|
|
|
14748
15196
|
* @param objective - The objective to sync
|
|
14749
15197
|
* @param mapInfo - Map info for this objective
|
|
14750
15198
|
* @param globalObjective - The global objective
|
|
15199
|
+
*
|
|
15200
|
+
* @spec SCORM 2004 4th Ed. SN 3.10.3 - objective mapInfo read/write synchronization
|
|
15201
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - score mapInfo synchronization
|
|
14751
15202
|
*/ key: "syncObjectiveState",
|
|
14752
15203
|
value: function syncObjectiveState(activity, objective, mapInfo, globalObjective) {
|
|
14753
15204
|
try {
|
|
14754
15205
|
var _this_eventCallback, _this;
|
|
14755
15206
|
var isPrimary = objective.isPrimary;
|
|
14756
15207
|
var localObjective = this.getLocalObjectiveState(activity, objective, isPrimary);
|
|
14757
|
-
|
|
14758
|
-
|
|
14759
|
-
objective.measureStatus = true;
|
|
14760
|
-
}
|
|
14761
|
-
if (mapInfo.readNormalizedMeasure && globalObjective.normalizedMeasureKnown) {
|
|
14762
|
-
objective.normalizedMeasure = globalObjective.normalizedMeasure;
|
|
14763
|
-
objective.measureStatus = true;
|
|
14764
|
-
if (globalObjective.satisfiedByMeasure || objective.satisfiedByMeasure) {
|
|
14765
|
-
var _ref, _objective_minNormalizedMeasure;
|
|
14766
|
-
var threshold = (_ref = (_objective_minNormalizedMeasure = objective.minNormalizedMeasure) !== null && _objective_minNormalizedMeasure !== void 0 ? _objective_minNormalizedMeasure : activity.scaledPassingScore) !== null && _ref !== void 0 ? _ref : 0.7;
|
|
14767
|
-
objective.satisfiedStatus = globalObjective.normalizedMeasure >= threshold;
|
|
14768
|
-
}
|
|
14769
|
-
}
|
|
14770
|
-
if (mapInfo.readProgressMeasure && globalObjective.progressMeasureKnown) {
|
|
14771
|
-
objective.progressMeasure = globalObjective.progressMeasure;
|
|
14772
|
-
objective.progressMeasureStatus = true;
|
|
14773
|
-
}
|
|
14774
|
-
if (mapInfo.readCompletionStatus && globalObjective.completionStatusKnown) {
|
|
14775
|
-
objective.completionStatus = globalObjective.completionStatus;
|
|
14776
|
-
}
|
|
15208
|
+
var readState = GlobalObjectiveSynchronizer.getGlobalObjectiveReadState(activity, objective, mapInfo, globalObjective);
|
|
15209
|
+
this.applyGlobalObjectiveReadState(objective, readState);
|
|
14777
15210
|
if (objective.isPrimary) {
|
|
14778
15211
|
objective.applyToActivity(activity);
|
|
14779
15212
|
}
|
|
14780
|
-
if (
|
|
14781
|
-
|
|
14782
|
-
|
|
14783
|
-
}
|
|
14784
|
-
if (mapInfo.writeNormalizedMeasure && objective.measureStatus) {
|
|
14785
|
-
globalObjective.normalizedMeasure = objective.normalizedMeasure;
|
|
14786
|
-
globalObjective.normalizedMeasureKnown = true;
|
|
14787
|
-
if (globalObjective.satisfiedByMeasure || objective.satisfiedByMeasure) {
|
|
14788
|
-
var _ref1, _objective_minNormalizedMeasure1;
|
|
14789
|
-
var threshold1 = (_ref1 = (_objective_minNormalizedMeasure1 = objective.minNormalizedMeasure) !== null && _objective_minNormalizedMeasure1 !== void 0 ? _objective_minNormalizedMeasure1 : activity.scaledPassingScore) !== null && _ref1 !== void 0 ? _ref1 : 0.7;
|
|
14790
|
-
globalObjective.satisfiedStatus = objective.normalizedMeasure >= threshold1;
|
|
15213
|
+
if (this.canWriteGlobalObjectives(activity)) {
|
|
15214
|
+
if (mapInfo.writeSatisfiedStatus && this.hasKnownSatisfiedStatus(objective)) {
|
|
15215
|
+
globalObjective.satisfiedStatus = objective.satisfiedStatus;
|
|
14791
15216
|
globalObjective.satisfiedStatusKnown = true;
|
|
14792
15217
|
}
|
|
14793
|
-
|
|
14794
|
-
|
|
14795
|
-
|
|
14796
|
-
|
|
14797
|
-
|
|
14798
|
-
|
|
14799
|
-
|
|
14800
|
-
|
|
14801
|
-
|
|
14802
|
-
|
|
14803
|
-
|
|
15218
|
+
if (mapInfo.writeNormalizedMeasure && objective.measureStatus) {
|
|
15219
|
+
globalObjective.normalizedMeasure = objective.normalizedMeasure;
|
|
15220
|
+
globalObjective.normalizedMeasureKnown = true;
|
|
15221
|
+
if (mapInfo.writeSatisfiedStatus && objective.satisfiedByMeasure) {
|
|
15222
|
+
var _ref, _objective_minNormalizedMeasure;
|
|
15223
|
+
var threshold = (_ref = (_objective_minNormalizedMeasure = objective.minNormalizedMeasure) !== null && _objective_minNormalizedMeasure !== void 0 ? _objective_minNormalizedMeasure : activity.scaledPassingScore) !== null && _ref !== void 0 ? _ref : 0.7;
|
|
15224
|
+
globalObjective.satisfiedStatus = objective.normalizedMeasure >= threshold;
|
|
15225
|
+
globalObjective.satisfiedStatusKnown = true;
|
|
15226
|
+
}
|
|
15227
|
+
}
|
|
15228
|
+
if (mapInfo.writeCompletionStatus && objective.completionStatus !== CompletionStatus.UNKNOWN) {
|
|
15229
|
+
globalObjective.completionStatus = objective.completionStatus;
|
|
15230
|
+
globalObjective.completionStatusKnown = true;
|
|
15231
|
+
}
|
|
15232
|
+
if (mapInfo.writeRawScore && objective.rawScoreKnown) {
|
|
15233
|
+
globalObjective.rawScore = objective.rawScore;
|
|
15234
|
+
globalObjective.rawScoreKnown = true;
|
|
15235
|
+
}
|
|
15236
|
+
if (mapInfo.writeMinScore && objective.minScoreKnown) {
|
|
15237
|
+
globalObjective.minScore = objective.minScore;
|
|
15238
|
+
globalObjective.minScoreKnown = true;
|
|
15239
|
+
}
|
|
15240
|
+
if (mapInfo.writeMaxScore && objective.maxScoreKnown) {
|
|
15241
|
+
globalObjective.maxScore = objective.maxScore;
|
|
15242
|
+
globalObjective.maxScoreKnown = true;
|
|
15243
|
+
}
|
|
15244
|
+
if (mapInfo.writeProgressMeasure && objective.progressMeasureStatus) {
|
|
15245
|
+
globalObjective.progressMeasure = objective.progressMeasure;
|
|
15246
|
+
globalObjective.progressMeasureKnown = true;
|
|
15247
|
+
}
|
|
15248
|
+
if (mapInfo.updateAttemptData) {
|
|
15249
|
+
this.updateActivityAttemptData(activity, globalObjective, objective);
|
|
15250
|
+
}
|
|
14804
15251
|
}
|
|
14805
15252
|
(_this_eventCallback = (_this = this).eventCallback) === null || _this_eventCallback === void 0 ? void 0 : _this_eventCallback.call(_this, "objective_synchronized", {
|
|
14806
15253
|
activityId: activity.id,
|
|
@@ -14822,25 +15269,47 @@ this.Scorm2004API = (function () {
|
|
|
14822
15269
|
},
|
|
14823
15270
|
{
|
|
14824
15271
|
/**
|
|
15272
|
+
* Apply read-mapped state to an objective without marking those fields dirty.
|
|
15273
|
+
*
|
|
15274
|
+
* @spec SCORM 2004 4th Ed. SN 3.10.3 - read maps are access to global state, not local writes
|
|
15275
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - score read maps do not imply score writes
|
|
15276
|
+
*/ key: "applyGlobalObjectiveReadState",
|
|
15277
|
+
value: function applyGlobalObjectiveReadState(objective, readState) {
|
|
15278
|
+
objective.applyReadMappedState(readState);
|
|
15279
|
+
}
|
|
15280
|
+
},
|
|
15281
|
+
{
|
|
15282
|
+
/**
|
|
14825
15283
|
* Ensure global objective entry exists
|
|
14826
15284
|
*
|
|
14827
15285
|
* @param globalObjectives - Global objectives map
|
|
14828
15286
|
* @param targetId - Target objective ID
|
|
14829
15287
|
* @param objective - Source objective
|
|
14830
15288
|
* @returns The global objective entry
|
|
15289
|
+
*
|
|
15290
|
+
* @spec SCORM 2004 4th Ed. SN 3.10.3 - global objective entries hold mapped objective state
|
|
15291
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - global entries hold score-map state
|
|
14831
15292
|
*/ key: "ensureGlobalObjectiveEntry",
|
|
14832
15293
|
value: function ensureGlobalObjectiveEntry(globalObjectives, targetId, objective) {
|
|
14833
15294
|
if (!globalObjectives.has(targetId)) {
|
|
14834
15295
|
globalObjectives.set(targetId, {
|
|
14835
15296
|
id: targetId,
|
|
14836
|
-
satisfiedStatus:
|
|
14837
|
-
satisfiedStatusKnown:
|
|
14838
|
-
normalizedMeasure:
|
|
14839
|
-
normalizedMeasureKnown:
|
|
14840
|
-
|
|
14841
|
-
|
|
14842
|
-
|
|
14843
|
-
|
|
15297
|
+
satisfiedStatus: false,
|
|
15298
|
+
satisfiedStatusKnown: false,
|
|
15299
|
+
normalizedMeasure: 0,
|
|
15300
|
+
normalizedMeasureKnown: false,
|
|
15301
|
+
// @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - score fields
|
|
15302
|
+
// remain unknown until their corresponding write map explicitly writes them.
|
|
15303
|
+
rawScore: "",
|
|
15304
|
+
rawScoreKnown: false,
|
|
15305
|
+
minScore: "",
|
|
15306
|
+
minScoreKnown: false,
|
|
15307
|
+
maxScore: "",
|
|
15308
|
+
maxScoreKnown: false,
|
|
15309
|
+
progressMeasure: 0,
|
|
15310
|
+
progressMeasureKnown: false,
|
|
15311
|
+
completionStatus: CompletionStatus.UNKNOWN,
|
|
15312
|
+
completionStatusKnown: false,
|
|
14844
15313
|
satisfiedByMeasure: objective.satisfiedByMeasure,
|
|
14845
15314
|
minNormalizedMeasure: objective.minNormalizedMeasure
|
|
14846
15315
|
});
|
|
@@ -14857,6 +15326,9 @@ this.Scorm2004API = (function () {
|
|
|
14857
15326
|
*
|
|
14858
15327
|
* @param objective - The objective to create default map info for
|
|
14859
15328
|
* @returns Default map info
|
|
15329
|
+
*
|
|
15330
|
+
* @spec SCORM 2004 4th Ed. SN 3.10.3 - mapInfo defaults are applied before objective synchronization
|
|
15331
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - score maps require explicit read/write flags
|
|
14860
15332
|
*/ key: "createDefaultMapInfo",
|
|
14861
15333
|
value: function createDefaultMapInfo(objective) {
|
|
14862
15334
|
return {
|
|
@@ -14869,18 +15341,50 @@ this.Scorm2004API = (function () {
|
|
|
14869
15341
|
writeCompletionStatus: true,
|
|
14870
15342
|
readProgressMeasure: false,
|
|
14871
15343
|
writeProgressMeasure: true,
|
|
15344
|
+
readRawScore: false,
|
|
15345
|
+
writeRawScore: false,
|
|
15346
|
+
readMinScore: false,
|
|
15347
|
+
writeMinScore: false,
|
|
15348
|
+
readMaxScore: false,
|
|
15349
|
+
writeMaxScore: false,
|
|
14872
15350
|
updateAttemptData: objective.isPrimary
|
|
14873
15351
|
};
|
|
14874
15352
|
}
|
|
14875
15353
|
},
|
|
14876
15354
|
{
|
|
14877
15355
|
/**
|
|
15356
|
+
* Return whether the local objective has known satisfaction state to write.
|
|
15357
|
+
*
|
|
15358
|
+
* @spec SCORM 2004 4th Ed. SN 4.2.1 Tracking Model - Objective Progress
|
|
15359
|
+
* Status identifies whether Objective Satisfied Status is known; Objective
|
|
15360
|
+
* Measure Status is independent measure knowledge.
|
|
15361
|
+
*/ key: "hasKnownSatisfiedStatus",
|
|
15362
|
+
value: function hasKnownSatisfiedStatus(objective) {
|
|
15363
|
+
return objective.progressStatus || objective.satisfiedStatusKnown;
|
|
15364
|
+
}
|
|
15365
|
+
},
|
|
15366
|
+
{
|
|
15367
|
+
/**
|
|
15368
|
+
* Return whether this activity is allowed to write tracked state to globals.
|
|
15369
|
+
*
|
|
15370
|
+
* @spec SCORM 2004 4th Ed. SN 3.13.1 Tracked - when False, the LMS
|
|
15371
|
+
* "does not initialize, manage or access any tracking status information".
|
|
15372
|
+
*/ key: "canWriteGlobalObjectives",
|
|
15373
|
+
value: function canWriteGlobalObjectives(activity) {
|
|
15374
|
+
return activity.sequencingControls.tracked !== false;
|
|
15375
|
+
}
|
|
15376
|
+
},
|
|
15377
|
+
{
|
|
15378
|
+
/**
|
|
14878
15379
|
* Get local objective state
|
|
14879
15380
|
*
|
|
14880
15381
|
* @param activity - The activity
|
|
14881
15382
|
* @param objective - The objective
|
|
14882
15383
|
* @param isPrimary - Whether this is the primary objective
|
|
14883
15384
|
* @returns Local objective state
|
|
15385
|
+
*
|
|
15386
|
+
* @spec SCORM 2004 4th Ed. SN 3.10 Objective Description - local objective state used for synchronization
|
|
15387
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - local score fields are part of mapped objective state
|
|
14884
15388
|
*/ key: "getLocalObjectiveState",
|
|
14885
15389
|
value: function getLocalObjectiveState(activity, objective, isPrimary) {
|
|
14886
15390
|
if (isPrimary) {
|
|
@@ -14889,6 +15393,12 @@ this.Scorm2004API = (function () {
|
|
|
14889
15393
|
satisfiedStatus: activity.objectiveSatisfiedStatus,
|
|
14890
15394
|
measureStatus: activity.objectiveMeasureStatus,
|
|
14891
15395
|
normalizedMeasure: activity.objectiveNormalizedMeasure,
|
|
15396
|
+
rawScore: objective.rawScore,
|
|
15397
|
+
rawScoreKnown: objective.rawScoreKnown,
|
|
15398
|
+
minScore: objective.minScore,
|
|
15399
|
+
minScoreKnown: objective.minScoreKnown,
|
|
15400
|
+
maxScore: objective.maxScore,
|
|
15401
|
+
maxScoreKnown: objective.maxScoreKnown,
|
|
14892
15402
|
progressMeasure: activity.progressMeasure,
|
|
14893
15403
|
progressMeasureStatus: activity.progressMeasureStatus,
|
|
14894
15404
|
completionStatus: activity.completionStatus,
|
|
@@ -14900,6 +15410,12 @@ this.Scorm2004API = (function () {
|
|
|
14900
15410
|
satisfiedStatus: objective.satisfiedStatus,
|
|
14901
15411
|
measureStatus: objective.measureStatus,
|
|
14902
15412
|
normalizedMeasure: objective.normalizedMeasure,
|
|
15413
|
+
rawScore: objective.rawScore,
|
|
15414
|
+
rawScoreKnown: objective.rawScoreKnown,
|
|
15415
|
+
minScore: objective.minScore,
|
|
15416
|
+
minScoreKnown: objective.minScoreKnown,
|
|
15417
|
+
maxScore: objective.maxScore,
|
|
15418
|
+
maxScoreKnown: objective.maxScoreKnown,
|
|
14903
15419
|
progressMeasure: objective.progressMeasure,
|
|
14904
15420
|
progressMeasureStatus: objective.progressMeasureStatus,
|
|
14905
15421
|
completionStatus: objective.completionStatus,
|
|
@@ -14924,7 +15440,7 @@ this.Scorm2004API = (function () {
|
|
|
14924
15440
|
return rule.action === "completed" || rule.action === "incomplete";
|
|
14925
15441
|
});
|
|
14926
15442
|
if (globalObjective.satisfiedStatusKnown && globalObjective.satisfiedStatus) {
|
|
14927
|
-
if (!hasCompletionRollupRules && (activity.completionStatus === CompletionStatus.UNKNOWN || activity.completionStatus === CompletionStatus.INCOMPLETE)) {
|
|
15443
|
+
if (!hasCompletionRollupRules && !activity.sequencingControls.completionSetByContent && !activity.attemptProgressStatus && (activity.completionStatus === CompletionStatus.UNKNOWN || activity.completionStatus === CompletionStatus.INCOMPLETE)) {
|
|
14928
15444
|
activity.completionStatus = CompletionStatus.COMPLETED;
|
|
14929
15445
|
}
|
|
14930
15446
|
if (activity.successStatus === "unknown") {
|
|
@@ -14965,17 +15481,56 @@ this.Scorm2004API = (function () {
|
|
|
14965
15481
|
}
|
|
14966
15482
|
}
|
|
14967
15483
|
}
|
|
15484
|
+
], [
|
|
15485
|
+
{
|
|
15486
|
+
key: "getGlobalObjectiveReadState",
|
|
15487
|
+
value: /**
|
|
15488
|
+
* Project a global objective through one local objective's read mapInfo.
|
|
15489
|
+
*
|
|
15490
|
+
* @spec SCORM 2004 4th Ed. SN 3.10.3 - read maps provide access to mapped global objective fields
|
|
15491
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max score read maps are independent fields
|
|
15492
|
+
*/ function getGlobalObjectiveReadState(activity, objective, mapInfo, globalObjective) {
|
|
15493
|
+
var readState = {};
|
|
15494
|
+
if (mapInfo.readSatisfiedStatus && globalObjective.satisfiedStatusKnown) {
|
|
15495
|
+
readState.satisfiedStatus = globalObjective.satisfiedStatus;
|
|
15496
|
+
}
|
|
15497
|
+
if (mapInfo.readNormalizedMeasure && globalObjective.normalizedMeasureKnown) {
|
|
15498
|
+
readState.normalizedMeasure = globalObjective.normalizedMeasure;
|
|
15499
|
+
if (objective.satisfiedByMeasure) {
|
|
15500
|
+
var _ref, _objective_minNormalizedMeasure;
|
|
15501
|
+
var threshold = (_ref = (_objective_minNormalizedMeasure = objective.minNormalizedMeasure) !== null && _objective_minNormalizedMeasure !== void 0 ? _objective_minNormalizedMeasure : activity.scaledPassingScore) !== null && _ref !== void 0 ? _ref : 0.7;
|
|
15502
|
+
readState.satisfiedStatus = globalObjective.normalizedMeasure >= threshold;
|
|
15503
|
+
}
|
|
15504
|
+
}
|
|
15505
|
+
if (mapInfo.readCompletionStatus && globalObjective.completionStatusKnown) {
|
|
15506
|
+
readState.completionStatus = globalObjective.completionStatus;
|
|
15507
|
+
}
|
|
15508
|
+
if (mapInfo.readProgressMeasure && globalObjective.progressMeasureKnown) {
|
|
15509
|
+
readState.progressMeasure = globalObjective.progressMeasure;
|
|
15510
|
+
}
|
|
15511
|
+
if (mapInfo.readRawScore && globalObjective.rawScoreKnown) {
|
|
15512
|
+
readState.rawScore = globalObjective.rawScore;
|
|
15513
|
+
}
|
|
15514
|
+
if (mapInfo.readMinScore && globalObjective.minScoreKnown) {
|
|
15515
|
+
readState.minScore = globalObjective.minScore;
|
|
15516
|
+
}
|
|
15517
|
+
if (mapInfo.readMaxScore && globalObjective.maxScoreKnown) {
|
|
15518
|
+
readState.maxScore = globalObjective.maxScore;
|
|
15519
|
+
}
|
|
15520
|
+
return readState;
|
|
15521
|
+
}
|
|
15522
|
+
}
|
|
14968
15523
|
]);
|
|
14969
15524
|
return GlobalObjectiveSynchronizer;
|
|
14970
15525
|
}();
|
|
14971
15526
|
|
|
14972
|
-
function _array_like_to_array$
|
|
15527
|
+
function _array_like_to_array$d(arr, len) {
|
|
14973
15528
|
if (len == null || len > arr.length) len = arr.length;
|
|
14974
15529
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
14975
15530
|
return arr2;
|
|
14976
15531
|
}
|
|
14977
|
-
function _array_without_holes$
|
|
14978
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
15532
|
+
function _array_without_holes$8(arr) {
|
|
15533
|
+
if (Array.isArray(arr)) return _array_like_to_array$d(arr);
|
|
14979
15534
|
}
|
|
14980
15535
|
function _class_call_check$E(instance, Constructor) {
|
|
14981
15536
|
if (!(instance instanceof Constructor)) {
|
|
@@ -15003,26 +15558,26 @@ this.Scorm2004API = (function () {
|
|
|
15003
15558
|
return left instanceof right;
|
|
15004
15559
|
}
|
|
15005
15560
|
}
|
|
15006
|
-
function _iterable_to_array$
|
|
15561
|
+
function _iterable_to_array$8(iter) {
|
|
15007
15562
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
15008
15563
|
}
|
|
15009
|
-
function _non_iterable_spread$
|
|
15564
|
+
function _non_iterable_spread$8() {
|
|
15010
15565
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
15011
15566
|
}
|
|
15012
|
-
function _to_consumable_array$
|
|
15013
|
-
return _array_without_holes$
|
|
15567
|
+
function _to_consumable_array$8(arr) {
|
|
15568
|
+
return _array_without_holes$8(arr) || _iterable_to_array$8(arr) || _unsupported_iterable_to_array$d(arr) || _non_iterable_spread$8();
|
|
15014
15569
|
}
|
|
15015
15570
|
function _type_of$B(obj) {
|
|
15016
15571
|
"@swc/helpers - typeof";
|
|
15017
15572
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
15018
15573
|
}
|
|
15019
|
-
function _unsupported_iterable_to_array$
|
|
15574
|
+
function _unsupported_iterable_to_array$d(o, minLen) {
|
|
15020
15575
|
if (!o) return;
|
|
15021
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
15576
|
+
if (typeof o === "string") return _array_like_to_array$d(o, minLen);
|
|
15022
15577
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
15023
15578
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
15024
15579
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
15025
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
15580
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$d(o, minLen);
|
|
15026
15581
|
}
|
|
15027
15582
|
var __defProp$B = Object.defineProperty;
|
|
15028
15583
|
var __defNormalProp$B = function __defNormalProp(obj, key, value) {
|
|
@@ -15173,7 +15728,7 @@ this.Scorm2004API = (function () {
|
|
|
15173
15728
|
* @returns Array of rollup state log entries
|
|
15174
15729
|
*/ key: "getRollupStateLog",
|
|
15175
15730
|
value: function getRollupStateLog() {
|
|
15176
|
-
return _to_consumable_array$
|
|
15731
|
+
return _to_consumable_array$8(this.rollupStateLog);
|
|
15177
15732
|
}
|
|
15178
15733
|
},
|
|
15179
15734
|
{
|
|
@@ -15541,6 +16096,9 @@ this.Scorm2004API = (function () {
|
|
|
15541
16096
|
* Transfer primary objective data from CMI to activity
|
|
15542
16097
|
* @param {Activity} activity - The activity to transfer data to
|
|
15543
16098
|
* @param {CMIDataForTransfer} cmiData - CMI data from runtime
|
|
16099
|
+
*
|
|
16100
|
+
* @spec SCORM 2004 4th Ed. RTE-to-SN Data Transfer - primary objective status and score data
|
|
16101
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max score write-map source data
|
|
15544
16102
|
*/ key: "transferPrimaryObjective",
|
|
15545
16103
|
value: function transferPrimaryObjective(activity, cmiData) {
|
|
15546
16104
|
var hasProgressMeasure = false;
|
|
@@ -15587,9 +16145,10 @@ this.Scorm2004API = (function () {
|
|
|
15587
16145
|
activity.objectiveSatisfiedStatus = successStatus;
|
|
15588
16146
|
activity.objectiveSatisfiedStatusKnown = true;
|
|
15589
16147
|
activity.successStatus = validatedSuccessStatus;
|
|
15590
|
-
activity.objectiveMeasureStatus = true;
|
|
15591
16148
|
}
|
|
15592
16149
|
if (cmiData.score) {
|
|
16150
|
+
var _activity_primaryObjective;
|
|
16151
|
+
(_activity_primaryObjective = activity.primaryObjective) === null || _activity_primaryObjective === void 0 ? void 0 : _activity_primaryObjective.initializeScoreFromCMI(this.getObjectiveScoreState(cmiData.score));
|
|
15593
16152
|
var normalized = this.normalizeScore(cmiData.score);
|
|
15594
16153
|
if (normalized !== null) {
|
|
15595
16154
|
normalizedScore = normalized;
|
|
@@ -15601,7 +16160,7 @@ this.Scorm2004API = (function () {
|
|
|
15601
16160
|
if (activity.primaryObjective && (hasSuccessStatus || hasNormalizedMeasure)) {
|
|
15602
16161
|
var finalStatus = hasSuccessStatus ? successStatus : activity.primaryObjective.satisfiedStatus;
|
|
15603
16162
|
var finalMeasure = hasNormalizedMeasure ? normalizedScore : activity.primaryObjective.normalizedMeasure;
|
|
15604
|
-
var measureStatus =
|
|
16163
|
+
var measureStatus = hasNormalizedMeasure;
|
|
15605
16164
|
activity.primaryObjective.initializeFromCMI(finalStatus, finalMeasure, measureStatus);
|
|
15606
16165
|
if (hasSuccessStatus) {
|
|
15607
16166
|
activity.primaryObjective.satisfiedStatusKnown = true;
|
|
@@ -15612,10 +16171,16 @@ this.Scorm2004API = (function () {
|
|
|
15612
16171
|
},
|
|
15613
16172
|
{
|
|
15614
16173
|
/**
|
|
15615
|
-
* Transfer
|
|
15616
|
-
* Only transfers changed values to protect global objectives
|
|
16174
|
+
* Transfer objective-array data from CMI to matching activity objectives.
|
|
16175
|
+
* Only transfers changed values to protect global objectives.
|
|
15617
16176
|
* @param {Activity} activity - The activity to transfer data to
|
|
15618
16177
|
* @param {CMIDataForTransfer} cmiData - CMI data from runtime
|
|
16178
|
+
*
|
|
16179
|
+
* @spec SCORM 2004 4th Ed. RTE 4.2.17 - cmi.objectives.n data, including
|
|
16180
|
+
* the primary objective entry, is part of the RTE objective data model.
|
|
16181
|
+
* @spec SCORM 2004 4th Ed. SN 3.10.3 and ADLSEQ objectives extension -
|
|
16182
|
+
* mapped objective status and raw/min/max score data transfer through
|
|
16183
|
+
* objective maps to sequencing state.
|
|
15619
16184
|
*/ key: "transferNonPrimaryObjectives",
|
|
15620
16185
|
value: function transferNonPrimaryObjectives(activity, cmiData) {
|
|
15621
16186
|
if (!cmiData.objectives || cmiData.objectives.length === 0) {
|
|
@@ -15629,14 +16194,17 @@ this.Scorm2004API = (function () {
|
|
|
15629
16194
|
continue;
|
|
15630
16195
|
}
|
|
15631
16196
|
var activityObjectiveMatch = activity.getObjectiveById(cmiObjective.id);
|
|
15632
|
-
if (!activityObjectiveMatch
|
|
16197
|
+
if (!activityObjectiveMatch) {
|
|
15633
16198
|
continue;
|
|
15634
16199
|
}
|
|
15635
16200
|
var activityObjective = activityObjectiveMatch.objective;
|
|
16201
|
+
var isPrimaryObjective = activityObjectiveMatch.isPrimary;
|
|
15636
16202
|
var hasSuccessStatus = false;
|
|
15637
16203
|
var successStatus = false;
|
|
15638
16204
|
var hasNormalizedMeasure = false;
|
|
15639
16205
|
var normalizedScore = 0;
|
|
16206
|
+
var hasCompletionStatus = false;
|
|
16207
|
+
var hasProgressMeasure = false;
|
|
15640
16208
|
var validatedObjSuccessStatus = validateSuccessStatus(cmiObjective.success_status);
|
|
15641
16209
|
if (validatedObjSuccessStatus && validatedObjSuccessStatus !== SuccessStatus.UNKNOWN) {
|
|
15642
16210
|
successStatus = validatedObjSuccessStatus === SuccessStatus.PASSED;
|
|
@@ -15646,8 +16214,10 @@ this.Scorm2004API = (function () {
|
|
|
15646
16214
|
var validatedObjCompletionStatus = validateCompletionStatus(cmiObjective.completion_status);
|
|
15647
16215
|
if (validatedObjCompletionStatus && validatedObjCompletionStatus !== CompletionStatus.UNKNOWN) {
|
|
15648
16216
|
activityObjective.completionStatus = validatedObjCompletionStatus;
|
|
16217
|
+
hasCompletionStatus = true;
|
|
15649
16218
|
}
|
|
15650
16219
|
if (cmiObjective.score) {
|
|
16220
|
+
activityObjective.initializeScoreFromCMI(this.getObjectiveScoreState(cmiObjective.score));
|
|
15651
16221
|
var normalized = this.normalizeScore(cmiObjective.score);
|
|
15652
16222
|
if (normalized !== null) {
|
|
15653
16223
|
normalizedScore = normalized;
|
|
@@ -15659,12 +16229,29 @@ this.Scorm2004API = (function () {
|
|
|
15659
16229
|
var finalMeasure = hasNormalizedMeasure ? normalizedScore : activityObjective.normalizedMeasure;
|
|
15660
16230
|
var measureStatus = hasNormalizedMeasure;
|
|
15661
16231
|
activityObjective.initializeFromCMI(finalStatus, finalMeasure, measureStatus);
|
|
16232
|
+
if (hasSuccessStatus) {
|
|
16233
|
+
activityObjective.satisfiedStatusKnown = true;
|
|
16234
|
+
}
|
|
15662
16235
|
}
|
|
15663
16236
|
if (cmiObjective.progress_measure && cmiObjective.progress_measure !== "") {
|
|
15664
16237
|
var progressMeasure = parseFloat(cmiObjective.progress_measure);
|
|
15665
16238
|
if (!isNaN(progressMeasure)) {
|
|
15666
16239
|
activityObjective.progressMeasure = progressMeasure;
|
|
15667
16240
|
activityObjective.progressMeasureStatus = true;
|
|
16241
|
+
hasProgressMeasure = true;
|
|
16242
|
+
}
|
|
16243
|
+
}
|
|
16244
|
+
if (isPrimaryObjective && (hasSuccessStatus || hasNormalizedMeasure || hasCompletionStatus || hasProgressMeasure)) {
|
|
16245
|
+
activityObjective.applyToActivity(activity);
|
|
16246
|
+
if (validatedObjSuccessStatus && validatedObjSuccessStatus !== SuccessStatus.UNKNOWN) {
|
|
16247
|
+
activity.successStatus = validatedObjSuccessStatus;
|
|
16248
|
+
}
|
|
16249
|
+
if (hasCompletionStatus) {
|
|
16250
|
+
activity.attemptProgressStatus = true;
|
|
16251
|
+
}
|
|
16252
|
+
if (hasProgressMeasure) {
|
|
16253
|
+
activity.attemptCompletionAmount = activityObjective.progressMeasure;
|
|
16254
|
+
activity.attemptCompletionAmountStatus = true;
|
|
15668
16255
|
}
|
|
15669
16256
|
}
|
|
15670
16257
|
}
|
|
@@ -15709,6 +16296,27 @@ this.Scorm2004API = (function () {
|
|
|
15709
16296
|
}
|
|
15710
16297
|
return null;
|
|
15711
16298
|
}
|
|
16299
|
+
},
|
|
16300
|
+
{
|
|
16301
|
+
/**
|
|
16302
|
+
* Convert RTE score data into objective score-map state without numeric reformatting.
|
|
16303
|
+
*
|
|
16304
|
+
* @spec SCORM 2004 4th Ed. RTE-to-SN Data Transfer - score values transfer from RTE to sequencing state
|
|
16305
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max score map fields are independent
|
|
16306
|
+
*/ key: "getObjectiveScoreState",
|
|
16307
|
+
value: function getObjectiveScoreState(score) {
|
|
16308
|
+
var scoreState = {};
|
|
16309
|
+
if (score.raw !== void 0) {
|
|
16310
|
+
scoreState.rawScore = score.raw;
|
|
16311
|
+
}
|
|
16312
|
+
if (score.min !== void 0) {
|
|
16313
|
+
scoreState.minScore = score.min;
|
|
16314
|
+
}
|
|
16315
|
+
if (score.max !== void 0) {
|
|
16316
|
+
scoreState.maxScore = score.max;
|
|
16317
|
+
}
|
|
16318
|
+
return scoreState;
|
|
16319
|
+
}
|
|
15712
16320
|
}
|
|
15713
16321
|
]);
|
|
15714
16322
|
return RteDataTransferService;
|
|
@@ -16171,17 +16779,7 @@ this.Scorm2004API = (function () {
|
|
|
16171
16779
|
try {
|
|
16172
16780
|
for(var _iterator = exitRules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
16173
16781
|
var rule = _step.value;
|
|
16174
|
-
|
|
16175
|
-
if (rule.conditionCombination === "all") {
|
|
16176
|
-
conditionsMet = rule.conditions.every(function(condition) {
|
|
16177
|
-
return condition.evaluate(activity);
|
|
16178
|
-
});
|
|
16179
|
-
} else {
|
|
16180
|
-
conditionsMet = rule.conditions.some(function(condition) {
|
|
16181
|
-
return condition.evaluate(activity);
|
|
16182
|
-
});
|
|
16183
|
-
}
|
|
16184
|
-
if (conditionsMet) {
|
|
16782
|
+
if (rule.evaluate(activity)) {
|
|
16185
16783
|
if (rule.action === RuleActionType.EXIT) {
|
|
16186
16784
|
return {
|
|
16187
16785
|
action: "EXIT",
|
|
@@ -16475,17 +17073,7 @@ this.Scorm2004API = (function () {
|
|
|
16475
17073
|
try {
|
|
16476
17074
|
for(var _iterator = exitRules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
16477
17075
|
var rule = _step.value;
|
|
16478
|
-
|
|
16479
|
-
if (rule.conditionCombination === "all") {
|
|
16480
|
-
conditionsMet = rule.conditions.every(function(condition) {
|
|
16481
|
-
return condition.evaluate(activity);
|
|
16482
|
-
});
|
|
16483
|
-
} else {
|
|
16484
|
-
conditionsMet = rule.conditions.some(function(condition) {
|
|
16485
|
-
return condition.evaluate(activity);
|
|
16486
|
-
});
|
|
16487
|
-
}
|
|
16488
|
-
if (conditionsMet) {
|
|
17076
|
+
if (rule.evaluate(activity)) {
|
|
16489
17077
|
if (rule.action === RuleActionType.EXIT) {
|
|
16490
17078
|
return "EXIT";
|
|
16491
17079
|
} else if (rule.action === RuleActionType.EXIT_PARENT) {
|
|
@@ -16619,13 +17207,13 @@ this.Scorm2004API = (function () {
|
|
|
16619
17207
|
return TerminationHandler;
|
|
16620
17208
|
}();
|
|
16621
17209
|
|
|
16622
|
-
function _array_like_to_array$
|
|
17210
|
+
function _array_like_to_array$c(arr, len) {
|
|
16623
17211
|
if (len == null || len > arr.length) len = arr.length;
|
|
16624
17212
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
16625
17213
|
return arr2;
|
|
16626
17214
|
}
|
|
16627
|
-
function _array_without_holes$
|
|
16628
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
17215
|
+
function _array_without_holes$7(arr) {
|
|
17216
|
+
if (Array.isArray(arr)) return _array_like_to_array$c(arr);
|
|
16629
17217
|
}
|
|
16630
17218
|
function _class_call_check$A(instance, Constructor) {
|
|
16631
17219
|
if (!(instance instanceof Constructor)) {
|
|
@@ -16658,10 +17246,10 @@ this.Scorm2004API = (function () {
|
|
|
16658
17246
|
}
|
|
16659
17247
|
return obj;
|
|
16660
17248
|
}
|
|
16661
|
-
function _iterable_to_array$
|
|
17249
|
+
function _iterable_to_array$7(iter) {
|
|
16662
17250
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
16663
17251
|
}
|
|
16664
|
-
function _non_iterable_spread$
|
|
17252
|
+
function _non_iterable_spread$7() {
|
|
16665
17253
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
16666
17254
|
}
|
|
16667
17255
|
function _object_spread$9(target) {
|
|
@@ -16679,20 +17267,20 @@ this.Scorm2004API = (function () {
|
|
|
16679
17267
|
}
|
|
16680
17268
|
return target;
|
|
16681
17269
|
}
|
|
16682
|
-
function _to_consumable_array$
|
|
16683
|
-
return _array_without_holes$
|
|
17270
|
+
function _to_consumable_array$7(arr) {
|
|
17271
|
+
return _array_without_holes$7(arr) || _iterable_to_array$7(arr) || _unsupported_iterable_to_array$c(arr) || _non_iterable_spread$7();
|
|
16684
17272
|
}
|
|
16685
17273
|
function _type_of$x(obj) {
|
|
16686
17274
|
"@swc/helpers - typeof";
|
|
16687
17275
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
16688
17276
|
}
|
|
16689
|
-
function _unsupported_iterable_to_array$
|
|
17277
|
+
function _unsupported_iterable_to_array$c(o, minLen) {
|
|
16690
17278
|
if (!o) return;
|
|
16691
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
17279
|
+
if (typeof o === "string") return _array_like_to_array$c(o, minLen);
|
|
16692
17280
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
16693
17281
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
16694
17282
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
16695
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
17283
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$c(o, minLen);
|
|
16696
17284
|
}
|
|
16697
17285
|
var __defProp$x = Object.defineProperty;
|
|
16698
17286
|
var __defNormalProp$x = function __defNormalProp(obj, key, value) {
|
|
@@ -16742,7 +17330,7 @@ this.Scorm2004API = (function () {
|
|
|
16742
17330
|
this.now = (options === null || options === void 0 ? void 0 : options.now) || function() {
|
|
16743
17331
|
return /* @__PURE__ */ new Date();
|
|
16744
17332
|
};
|
|
16745
|
-
this.defaultHideLmsUi = (options === null || options === void 0 ? void 0 : options.defaultHideLmsUi) ? _to_consumable_array$
|
|
17333
|
+
this.defaultHideLmsUi = (options === null || options === void 0 ? void 0 : options.defaultHideLmsUi) ? _to_consumable_array$7(options.defaultHideLmsUi) : [];
|
|
16746
17334
|
this.defaultAuxiliaryResources = (options === null || options === void 0 ? void 0 : options.defaultAuxiliaryResources) ? options.defaultAuxiliaryResources.map(function(resource) {
|
|
16747
17335
|
return _object_spread$9({}, resource);
|
|
16748
17336
|
}) : [];
|
|
@@ -17186,7 +17774,7 @@ this.Scorm2004API = (function () {
|
|
|
17186
17774
|
]);
|
|
17187
17775
|
return _DeliveryHandler;
|
|
17188
17776
|
}();
|
|
17189
|
-
__publicField$x(_DeliveryHandler, "HIDE_LMS_UI_ORDER", _to_consumable_array$
|
|
17777
|
+
__publicField$x(_DeliveryHandler, "HIDE_LMS_UI_ORDER", _to_consumable_array$7(HIDE_LMS_UI_TOKENS));
|
|
17190
17778
|
var DeliveryHandler = _DeliveryHandler;
|
|
17191
17779
|
|
|
17192
17780
|
function _class_call_check$z(instance, Constructor) {
|
|
@@ -18557,7 +19145,7 @@ this.Scorm2004API = (function () {
|
|
|
18557
19145
|
return NavigationValidityService;
|
|
18558
19146
|
}();
|
|
18559
19147
|
|
|
18560
|
-
function _array_like_to_array$
|
|
19148
|
+
function _array_like_to_array$b(arr, len) {
|
|
18561
19149
|
if (len == null || len > arr.length) len = arr.length;
|
|
18562
19150
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
18563
19151
|
return arr2;
|
|
@@ -18646,7 +19234,7 @@ this.Scorm2004API = (function () {
|
|
|
18646
19234
|
}
|
|
18647
19235
|
return target;
|
|
18648
19236
|
}
|
|
18649
|
-
function ownKeys$
|
|
19237
|
+
function ownKeys$2(object, enumerableOnly) {
|
|
18650
19238
|
var keys = Object.keys(object);
|
|
18651
19239
|
if (Object.getOwnPropertySymbols) {
|
|
18652
19240
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -18654,31 +19242,31 @@ this.Scorm2004API = (function () {
|
|
|
18654
19242
|
}
|
|
18655
19243
|
return keys;
|
|
18656
19244
|
}
|
|
18657
|
-
function _object_spread_props$
|
|
19245
|
+
function _object_spread_props$2(target, source) {
|
|
18658
19246
|
source = source != null ? source : {};
|
|
18659
19247
|
if (Object.getOwnPropertyDescriptors) {
|
|
18660
19248
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
18661
19249
|
} else {
|
|
18662
|
-
ownKeys$
|
|
19250
|
+
ownKeys$2(Object(source)).forEach(function(key) {
|
|
18663
19251
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
18664
19252
|
});
|
|
18665
19253
|
}
|
|
18666
19254
|
return target;
|
|
18667
19255
|
}
|
|
18668
19256
|
function _sliced_to_array$5(arr, i) {
|
|
18669
|
-
return _array_with_holes$5(arr) || _iterable_to_array_limit$5(arr, i) || _unsupported_iterable_to_array$
|
|
19257
|
+
return _array_with_holes$5(arr) || _iterable_to_array_limit$5(arr, i) || _unsupported_iterable_to_array$b(arr, i) || _non_iterable_rest$5();
|
|
18670
19258
|
}
|
|
18671
19259
|
function _type_of$u(obj) {
|
|
18672
19260
|
"@swc/helpers - typeof";
|
|
18673
19261
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
18674
19262
|
}
|
|
18675
|
-
function _unsupported_iterable_to_array$
|
|
19263
|
+
function _unsupported_iterable_to_array$b(o, minLen) {
|
|
18676
19264
|
if (!o) return;
|
|
18677
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
19265
|
+
if (typeof o === "string") return _array_like_to_array$b(o, minLen);
|
|
18678
19266
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
18679
19267
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
18680
19268
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
18681
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
19269
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$b(o, minLen);
|
|
18682
19270
|
}
|
|
18683
19271
|
var __defProp$u = Object.defineProperty;
|
|
18684
19272
|
var __defNormalProp$u = function __defNormalProp(obj, key, value) {
|
|
@@ -18729,6 +19317,9 @@ this.Scorm2004API = (function () {
|
|
|
18729
19317
|
* Collect Global Objectives
|
|
18730
19318
|
* Recursively collects global objectives from the activity tree
|
|
18731
19319
|
* @param {Activity} activity - Activity to collect objectives from
|
|
19320
|
+
*
|
|
19321
|
+
* @spec SCORM 2004 4th Ed. SN 3.10.3 - global objective map contains mapped objective state
|
|
19322
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max score fields are unknown until written
|
|
18732
19323
|
*/ key: "collectObjectives",
|
|
18733
19324
|
value: function collectObjectives(activity) {
|
|
18734
19325
|
var objectives = activity.getAllObjectives();
|
|
@@ -18738,9 +19329,15 @@ this.Scorm2004API = (function () {
|
|
|
18738
19329
|
this.globalObjectiveMap.set(defaultId, {
|
|
18739
19330
|
id: defaultId,
|
|
18740
19331
|
satisfiedStatus: activity.objectiveSatisfiedStatus,
|
|
18741
|
-
satisfiedStatusKnown: activity.
|
|
19332
|
+
satisfiedStatusKnown: activity.objectiveSatisfiedStatusKnown,
|
|
18742
19333
|
normalizedMeasure: activity.objectiveNormalizedMeasure,
|
|
18743
19334
|
normalizedMeasureKnown: activity.objectiveMeasureStatus,
|
|
19335
|
+
rawScore: "",
|
|
19336
|
+
rawScoreKnown: false,
|
|
19337
|
+
minScore: "",
|
|
19338
|
+
minScoreKnown: false,
|
|
19339
|
+
maxScore: "",
|
|
19340
|
+
maxScoreKnown: false,
|
|
18744
19341
|
progressMeasure: activity.progressMeasure,
|
|
18745
19342
|
progressMeasureKnown: activity.progressMeasureStatus,
|
|
18746
19343
|
completionStatus: activity.completionStatus,
|
|
@@ -18753,6 +19350,12 @@ this.Scorm2004API = (function () {
|
|
|
18753
19350
|
writeCompletionStatus: true,
|
|
18754
19351
|
readProgressMeasure: true,
|
|
18755
19352
|
writeProgressMeasure: true,
|
|
19353
|
+
readRawScore: false,
|
|
19354
|
+
writeRawScore: false,
|
|
19355
|
+
readMinScore: false,
|
|
19356
|
+
writeMinScore: false,
|
|
19357
|
+
readMaxScore: false,
|
|
19358
|
+
writeMaxScore: false,
|
|
18756
19359
|
satisfiedByMeasure: activity.scaledPassingScore !== null,
|
|
18757
19360
|
minNormalizedMeasure: activity.scaledPassingScore,
|
|
18758
19361
|
updateAttemptData: true
|
|
@@ -18787,9 +19390,15 @@ this.Scorm2004API = (function () {
|
|
|
18787
19390
|
this.globalObjectiveMap.set(targetId, {
|
|
18788
19391
|
id: targetId,
|
|
18789
19392
|
satisfiedStatus: objective.satisfiedStatus,
|
|
18790
|
-
satisfiedStatusKnown: objective.
|
|
19393
|
+
satisfiedStatusKnown: objective.satisfiedStatusKnown || objective.progressStatus,
|
|
18791
19394
|
normalizedMeasure: objective.normalizedMeasure,
|
|
18792
19395
|
normalizedMeasureKnown: objective.measureStatus,
|
|
19396
|
+
rawScore: "",
|
|
19397
|
+
rawScoreKnown: false,
|
|
19398
|
+
minScore: "",
|
|
19399
|
+
minScoreKnown: false,
|
|
19400
|
+
maxScore: "",
|
|
19401
|
+
maxScoreKnown: false,
|
|
18793
19402
|
progressMeasure: objective.progressMeasure,
|
|
18794
19403
|
progressMeasureKnown: objective.progressMeasureStatus,
|
|
18795
19404
|
completionStatus: objective.completionStatus,
|
|
@@ -18904,7 +19513,7 @@ this.Scorm2004API = (function () {
|
|
|
18904
19513
|
*/ key: "updateObjective",
|
|
18905
19514
|
value: function updateObjective(objectiveId, objectiveData) {
|
|
18906
19515
|
try {
|
|
18907
|
-
this.globalObjectiveMap.set(objectiveId, _object_spread_props$
|
|
19516
|
+
this.globalObjectiveMap.set(objectiveId, _object_spread_props$2(_object_spread$8({}, this.globalObjectiveMap.get(objectiveId), objectiveData), {
|
|
18908
19517
|
lastUpdated: /* @__PURE__ */ new Date().toISOString()
|
|
18909
19518
|
}));
|
|
18910
19519
|
this.fireEvent("onGlobalObjectiveUpdated", {
|
|
@@ -19557,13 +20166,13 @@ this.Scorm2004API = (function () {
|
|
|
19557
20166
|
return SequencingStateManager;
|
|
19558
20167
|
}();
|
|
19559
20168
|
|
|
19560
|
-
function _array_like_to_array$
|
|
20169
|
+
function _array_like_to_array$a(arr, len) {
|
|
19561
20170
|
if (len == null || len > arr.length) len = arr.length;
|
|
19562
20171
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
19563
20172
|
return arr2;
|
|
19564
20173
|
}
|
|
19565
|
-
function _array_without_holes$
|
|
19566
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
20174
|
+
function _array_without_holes$6(arr) {
|
|
20175
|
+
if (Array.isArray(arr)) return _array_like_to_array$a(arr);
|
|
19567
20176
|
}
|
|
19568
20177
|
function _class_call_check$v(instance, Constructor) {
|
|
19569
20178
|
if (!(instance instanceof Constructor)) {
|
|
@@ -19583,26 +20192,26 @@ this.Scorm2004API = (function () {
|
|
|
19583
20192
|
if (protoProps) _defineProperties$v(Constructor.prototype, protoProps);
|
|
19584
20193
|
return Constructor;
|
|
19585
20194
|
}
|
|
19586
|
-
function _iterable_to_array$
|
|
20195
|
+
function _iterable_to_array$6(iter) {
|
|
19587
20196
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
19588
20197
|
}
|
|
19589
|
-
function _non_iterable_spread$
|
|
20198
|
+
function _non_iterable_spread$6() {
|
|
19590
20199
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
19591
20200
|
}
|
|
19592
|
-
function _to_consumable_array$
|
|
19593
|
-
return _array_without_holes$
|
|
20201
|
+
function _to_consumable_array$6(arr) {
|
|
20202
|
+
return _array_without_holes$6(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$a(arr) || _non_iterable_spread$6();
|
|
19594
20203
|
}
|
|
19595
20204
|
function _type_of$s(obj) {
|
|
19596
20205
|
"@swc/helpers - typeof";
|
|
19597
20206
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
19598
20207
|
}
|
|
19599
|
-
function _unsupported_iterable_to_array$
|
|
20208
|
+
function _unsupported_iterable_to_array$a(o, minLen) {
|
|
19600
20209
|
if (!o) return;
|
|
19601
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
20210
|
+
if (typeof o === "string") return _array_like_to_array$a(o, minLen);
|
|
19602
20211
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
19603
20212
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
19604
20213
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
19605
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
20214
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$a(o, minLen);
|
|
19606
20215
|
}
|
|
19607
20216
|
var __defProp$s = Object.defineProperty;
|
|
19608
20217
|
var __defNormalProp$s = function __defNormalProp(obj, key, value) {
|
|
@@ -20200,7 +20809,7 @@ this.Scorm2004API = (function () {
|
|
|
20200
20809
|
}
|
|
20201
20810
|
if (activity.prerequisiteActivities) {
|
|
20202
20811
|
var _prerequisites;
|
|
20203
|
-
(_prerequisites = prerequisites).push.apply(_prerequisites, _to_consumable_array$
|
|
20812
|
+
(_prerequisites = prerequisites).push.apply(_prerequisites, _to_consumable_array$6(activity.prerequisiteActivities));
|
|
20204
20813
|
}
|
|
20205
20814
|
return Array.from(new Set(prerequisites));
|
|
20206
20815
|
}
|
|
@@ -20252,7 +20861,7 @@ this.Scorm2004API = (function () {
|
|
|
20252
20861
|
}
|
|
20253
20862
|
}
|
|
20254
20863
|
if (activity.sequencingRules) {
|
|
20255
|
-
var allRules = _to_consumable_array$
|
|
20864
|
+
var allRules = _to_consumable_array$6(activity.sequencingRules.preConditionRules || []).concat(_to_consumable_array$6(activity.sequencingRules.exitConditionRules || []), _to_consumable_array$6(activity.sequencingRules.postConditionRules || []));
|
|
20256
20865
|
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
20257
20866
|
try {
|
|
20258
20867
|
for(var _iterator1 = allRules[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
@@ -21069,13 +21678,13 @@ this.Scorm2004API = (function () {
|
|
|
21069
21678
|
return OverallSequencingProcess;
|
|
21070
21679
|
}();
|
|
21071
21680
|
|
|
21072
|
-
function _array_like_to_array$
|
|
21681
|
+
function _array_like_to_array$9(arr, len) {
|
|
21073
21682
|
if (len == null || len > arr.length) len = arr.length;
|
|
21074
21683
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
21075
21684
|
return arr2;
|
|
21076
21685
|
}
|
|
21077
|
-
function _array_without_holes$
|
|
21078
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
21686
|
+
function _array_without_holes$5(arr) {
|
|
21687
|
+
if (Array.isArray(arr)) return _array_like_to_array$9(arr);
|
|
21079
21688
|
}
|
|
21080
21689
|
function _class_call_check$t(instance, Constructor) {
|
|
21081
21690
|
if (!(instance instanceof Constructor)) {
|
|
@@ -21108,10 +21717,10 @@ this.Scorm2004API = (function () {
|
|
|
21108
21717
|
}
|
|
21109
21718
|
return obj;
|
|
21110
21719
|
}
|
|
21111
|
-
function _iterable_to_array$
|
|
21720
|
+
function _iterable_to_array$5(iter) {
|
|
21112
21721
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
21113
21722
|
}
|
|
21114
|
-
function _non_iterable_spread$
|
|
21723
|
+
function _non_iterable_spread$5() {
|
|
21115
21724
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
21116
21725
|
}
|
|
21117
21726
|
function _object_spread$7(target) {
|
|
@@ -21129,20 +21738,20 @@ this.Scorm2004API = (function () {
|
|
|
21129
21738
|
}
|
|
21130
21739
|
return target;
|
|
21131
21740
|
}
|
|
21132
|
-
function _to_consumable_array$
|
|
21133
|
-
return _array_without_holes$
|
|
21741
|
+
function _to_consumable_array$5(arr) {
|
|
21742
|
+
return _array_without_holes$5(arr) || _iterable_to_array$5(arr) || _unsupported_iterable_to_array$9(arr) || _non_iterable_spread$5();
|
|
21134
21743
|
}
|
|
21135
21744
|
function _type_of$q(obj) {
|
|
21136
21745
|
"@swc/helpers - typeof";
|
|
21137
21746
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
21138
21747
|
}
|
|
21139
|
-
function _unsupported_iterable_to_array$
|
|
21748
|
+
function _unsupported_iterable_to_array$9(o, minLen) {
|
|
21140
21749
|
if (!o) return;
|
|
21141
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
21750
|
+
if (typeof o === "string") return _array_like_to_array$9(o, minLen);
|
|
21142
21751
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
21143
21752
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
21144
21753
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
21145
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
21754
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$9(o, minLen);
|
|
21146
21755
|
}
|
|
21147
21756
|
var __defProp$q = Object.defineProperty;
|
|
21148
21757
|
var __defNormalProp$q = function __defNormalProp(obj, key, value) {
|
|
@@ -21234,7 +21843,7 @@ this.Scorm2004API = (function () {
|
|
|
21234
21843
|
this.sequencingProcess = new SequencingProcess(this.sequencing.activityTree, this.sequencing.sequencingRules, this.sequencing.sequencingControls, this.adl.nav, seqOptions);
|
|
21235
21844
|
var overallOptions = {};
|
|
21236
21845
|
if (this.configuration.now) overallOptions.now = this.configuration.now;
|
|
21237
|
-
overallOptions.defaultHideLmsUi = _to_consumable_array$
|
|
21846
|
+
overallOptions.defaultHideLmsUi = _to_consumable_array$5(this.sequencing.hideLmsUi);
|
|
21238
21847
|
if (this.sequencing.auxiliaryResources.length > 0) {
|
|
21239
21848
|
overallOptions.defaultAuxiliaryResources = this.sequencing.auxiliaryResources.map(function(resource) {
|
|
21240
21849
|
return {
|
|
@@ -21541,6 +22150,9 @@ this.Scorm2004API = (function () {
|
|
|
21541
22150
|
{
|
|
21542
22151
|
/**
|
|
21543
22152
|
* Update activity properties from current CMI values
|
|
22153
|
+
*
|
|
22154
|
+
* @spec SCORM 2004 4th Ed. RTE-to-SN Data Transfer - current CMI values update activity objective state
|
|
22155
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max scores are available to objective write maps
|
|
21544
22156
|
*/ key: "updateActivityFromCMI",
|
|
21545
22157
|
value: function updateActivityFromCMI(activity) {
|
|
21546
22158
|
var hasProgressMeasure = false;
|
|
@@ -21572,7 +22184,6 @@ this.Scorm2004API = (function () {
|
|
|
21572
22184
|
if (this.cmi.success_status !== "unknown") {
|
|
21573
22185
|
activity.successStatus = this.cmi.success_status;
|
|
21574
22186
|
activity.objectiveSatisfiedStatus = this.cmi.success_status === "passed";
|
|
21575
|
-
activity.objectiveMeasureStatus = true;
|
|
21576
22187
|
if (activity.primaryObjective) {
|
|
21577
22188
|
activity.primaryObjective.progressStatus = true;
|
|
21578
22189
|
}
|
|
@@ -21587,6 +22198,17 @@ this.Scorm2004API = (function () {
|
|
|
21587
22198
|
}
|
|
21588
22199
|
}
|
|
21589
22200
|
}
|
|
22201
|
+
if (activity.primaryObjective && this.cmi.score) {
|
|
22202
|
+
if (this.cmi.score.raw !== "") {
|
|
22203
|
+
activity.primaryObjective.rawScore = this.cmi.score.raw;
|
|
22204
|
+
}
|
|
22205
|
+
if (this.cmi.score.min !== "") {
|
|
22206
|
+
activity.primaryObjective.minScore = this.cmi.score.min;
|
|
22207
|
+
}
|
|
22208
|
+
if (this.cmi.score.max !== "") {
|
|
22209
|
+
activity.primaryObjective.maxScore = this.cmi.score.max;
|
|
22210
|
+
}
|
|
22211
|
+
}
|
|
21590
22212
|
if (activity.primaryObjective) {
|
|
21591
22213
|
activity.primaryObjective.updateFromActivity(activity);
|
|
21592
22214
|
}
|
|
@@ -21749,7 +22371,7 @@ this.Scorm2004API = (function () {
|
|
|
21749
22371
|
var listener = this.eventListeners[eventType];
|
|
21750
22372
|
if (listener && typeof listener === "function") {
|
|
21751
22373
|
try {
|
|
21752
|
-
listener.apply(void 0, _to_consumable_array$
|
|
22374
|
+
listener.apply(void 0, _to_consumable_array$5(args));
|
|
21753
22375
|
this.log("debug", "Internal listener for ".concat(eventType, " executed successfully"));
|
|
21754
22376
|
} catch (listenerError) {
|
|
21755
22377
|
this.log("error", "Internal listener for ".concat(eventType, " failed: ").concat(listenerError));
|
|
@@ -21760,7 +22382,7 @@ this.Scorm2004API = (function () {
|
|
|
21760
22382
|
(_this_eventService = this.eventService).processListeners.apply(_this_eventService, [
|
|
21761
22383
|
"Sequencing.".concat(eventType),
|
|
21762
22384
|
args[0]
|
|
21763
|
-
].concat(_to_consumable_array$
|
|
22385
|
+
].concat(_to_consumable_array$5(args.slice(1))));
|
|
21764
22386
|
this.log("debug", "Event service listeners for ".concat(eventType, " processed"));
|
|
21765
22387
|
} catch (eventServiceError) {
|
|
21766
22388
|
this.log("warn", "Event service failed for ".concat(eventType, ": ").concat(eventServiceError));
|
|
@@ -21770,7 +22392,7 @@ this.Scorm2004API = (function () {
|
|
|
21770
22392
|
var globalListeners = window.scormSequencingEvents;
|
|
21771
22393
|
if (globalListeners[eventType] && typeof globalListeners[eventType] === "function") {
|
|
21772
22394
|
var _globalListeners;
|
|
21773
|
-
(_globalListeners = globalListeners)[eventType].apply(_globalListeners, _to_consumable_array$
|
|
22395
|
+
(_globalListeners = globalListeners)[eventType].apply(_globalListeners, _to_consumable_array$5(args));
|
|
21774
22396
|
this.log("debug", "Global listener for ".concat(eventType, " executed"));
|
|
21775
22397
|
}
|
|
21776
22398
|
}
|
|
@@ -22208,7 +22830,7 @@ this.Scorm2004API = (function () {
|
|
|
22208
22830
|
return SerializationService;
|
|
22209
22831
|
}();
|
|
22210
22832
|
|
|
22211
|
-
function _array_like_to_array$
|
|
22833
|
+
function _array_like_to_array$8(arr, len) {
|
|
22212
22834
|
if (len == null || len > arr.length) len = arr.length;
|
|
22213
22835
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
22214
22836
|
return arr2;
|
|
@@ -22270,19 +22892,19 @@ this.Scorm2004API = (function () {
|
|
|
22270
22892
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
22271
22893
|
}
|
|
22272
22894
|
function _sliced_to_array$4(arr, i) {
|
|
22273
|
-
return _array_with_holes$4(arr) || _iterable_to_array_limit$4(arr, i) || _unsupported_iterable_to_array$
|
|
22895
|
+
return _array_with_holes$4(arr) || _iterable_to_array_limit$4(arr, i) || _unsupported_iterable_to_array$8(arr, i) || _non_iterable_rest$4();
|
|
22274
22896
|
}
|
|
22275
22897
|
function _type_of$p(obj) {
|
|
22276
22898
|
"@swc/helpers - typeof";
|
|
22277
22899
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
22278
22900
|
}
|
|
22279
|
-
function _unsupported_iterable_to_array$
|
|
22901
|
+
function _unsupported_iterable_to_array$8(o, minLen) {
|
|
22280
22902
|
if (!o) return;
|
|
22281
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
22903
|
+
if (typeof o === "string") return _array_like_to_array$8(o, minLen);
|
|
22282
22904
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
22283
22905
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
22284
22906
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
22285
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
22907
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$8(o, minLen);
|
|
22286
22908
|
}
|
|
22287
22909
|
var __defProp$p = Object.defineProperty;
|
|
22288
22910
|
var __defNormalProp$p = function __defNormalProp(obj, key, value) {
|
|
@@ -22551,13 +23173,13 @@ this.Scorm2004API = (function () {
|
|
|
22551
23173
|
}();
|
|
22552
23174
|
var validationService = new ValidationService();
|
|
22553
23175
|
|
|
22554
|
-
function _array_like_to_array$
|
|
23176
|
+
function _array_like_to_array$7(arr, len) {
|
|
22555
23177
|
if (len == null || len > arr.length) len = arr.length;
|
|
22556
23178
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
22557
23179
|
return arr2;
|
|
22558
23180
|
}
|
|
22559
|
-
function _array_without_holes$
|
|
22560
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
23181
|
+
function _array_without_holes$4(arr) {
|
|
23182
|
+
if (Array.isArray(arr)) return _array_like_to_array$7(arr);
|
|
22561
23183
|
}
|
|
22562
23184
|
function _class_call_check$p(instance, Constructor) {
|
|
22563
23185
|
if (!(instance instanceof Constructor)) {
|
|
@@ -22598,10 +23220,10 @@ this.Scorm2004API = (function () {
|
|
|
22598
23220
|
return left instanceof right;
|
|
22599
23221
|
}
|
|
22600
23222
|
}
|
|
22601
|
-
function _iterable_to_array$
|
|
23223
|
+
function _iterable_to_array$4(iter) {
|
|
22602
23224
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
22603
23225
|
}
|
|
22604
|
-
function _non_iterable_spread$
|
|
23226
|
+
function _non_iterable_spread$4() {
|
|
22605
23227
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
22606
23228
|
}
|
|
22607
23229
|
function _object_spread$6(target) {
|
|
@@ -22619,7 +23241,7 @@ this.Scorm2004API = (function () {
|
|
|
22619
23241
|
}
|
|
22620
23242
|
return target;
|
|
22621
23243
|
}
|
|
22622
|
-
function ownKeys(object, enumerableOnly) {
|
|
23244
|
+
function ownKeys$1(object, enumerableOnly) {
|
|
22623
23245
|
var keys = Object.keys(object);
|
|
22624
23246
|
if (Object.getOwnPropertySymbols) {
|
|
22625
23247
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -22627,31 +23249,31 @@ this.Scorm2004API = (function () {
|
|
|
22627
23249
|
}
|
|
22628
23250
|
return keys;
|
|
22629
23251
|
}
|
|
22630
|
-
function _object_spread_props(target, source) {
|
|
23252
|
+
function _object_spread_props$1(target, source) {
|
|
22631
23253
|
source = source != null ? source : {};
|
|
22632
23254
|
if (Object.getOwnPropertyDescriptors) {
|
|
22633
23255
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
22634
23256
|
} else {
|
|
22635
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
23257
|
+
ownKeys$1(Object(source)).forEach(function(key) {
|
|
22636
23258
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
22637
23259
|
});
|
|
22638
23260
|
}
|
|
22639
23261
|
return target;
|
|
22640
23262
|
}
|
|
22641
|
-
function _to_consumable_array$
|
|
22642
|
-
return _array_without_holes$
|
|
23263
|
+
function _to_consumable_array$4(arr) {
|
|
23264
|
+
return _array_without_holes$4(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$7(arr) || _non_iterable_spread$4();
|
|
22643
23265
|
}
|
|
22644
23266
|
function _type_of$o(obj) {
|
|
22645
23267
|
"@swc/helpers - typeof";
|
|
22646
23268
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
22647
23269
|
}
|
|
22648
|
-
function _unsupported_iterable_to_array$
|
|
23270
|
+
function _unsupported_iterable_to_array$7(o, minLen) {
|
|
22649
23271
|
if (!o) return;
|
|
22650
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
23272
|
+
if (typeof o === "string") return _array_like_to_array$7(o, minLen);
|
|
22651
23273
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
22652
23274
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
22653
23275
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
22654
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
23276
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
|
|
22655
23277
|
}
|
|
22656
23278
|
var __defProp$o = Object.defineProperty;
|
|
22657
23279
|
var __defNormalProp$o = function __defNormalProp(obj, key, value) {
|
|
@@ -23737,20 +24359,20 @@ this.Scorm2004API = (function () {
|
|
|
23737
24359
|
if (immediate && this.settings.terminateCommitPayloadField) {
|
|
23738
24360
|
var field = this.settings.terminateCommitPayloadField;
|
|
23739
24361
|
if (Array.isArray(finalParams)) {
|
|
23740
|
-
finalParams = _to_consumable_array$
|
|
24362
|
+
finalParams = _to_consumable_array$4(finalParams).concat([
|
|
23741
24363
|
"".concat(encodeURIComponent(field), "=true")
|
|
23742
24364
|
]);
|
|
23743
24365
|
} else if (finalParams && (typeof finalParams === "undefined" ? "undefined" : _type_of$o(finalParams)) === "object") {
|
|
23744
|
-
finalParams = _object_spread_props(_object_spread$6({}, finalParams), _define_property$6({}, field, true));
|
|
24366
|
+
finalParams = _object_spread_props$1(_object_spread$6({}, finalParams), _define_property$6({}, field, true));
|
|
23745
24367
|
}
|
|
23746
24368
|
}
|
|
23747
24369
|
if (this.settings.includeCommitSequence === true) {
|
|
23748
24370
|
if (Array.isArray(finalParams)) {
|
|
23749
|
-
finalParams = _to_consumable_array$
|
|
24371
|
+
finalParams = _to_consumable_array$4(finalParams).concat([
|
|
23750
24372
|
"commitSequence=".concat(sequence)
|
|
23751
24373
|
]);
|
|
23752
24374
|
} else if (finalParams && (typeof finalParams === "undefined" ? "undefined" : _type_of$o(finalParams)) === "object") {
|
|
23753
|
-
finalParams = _object_spread_props(_object_spread$6({}, finalParams), {
|
|
24375
|
+
finalParams = _object_spread_props$1(_object_spread$6({}, finalParams), {
|
|
23754
24376
|
commitSequence: sequence
|
|
23755
24377
|
});
|
|
23756
24378
|
}
|
|
@@ -24249,7 +24871,7 @@ this.Scorm2004API = (function () {
|
|
|
24249
24871
|
];
|
|
24250
24872
|
}
|
|
24251
24873
|
|
|
24252
|
-
function _array_like_to_array$
|
|
24874
|
+
function _array_like_to_array$6(arr, len) {
|
|
24253
24875
|
if (len == null || len > arr.length) len = arr.length;
|
|
24254
24876
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
24255
24877
|
return arr2;
|
|
@@ -24361,7 +24983,7 @@ this.Scorm2004API = (function () {
|
|
|
24361
24983
|
return _set_prototype_of$g(o, p);
|
|
24362
24984
|
}
|
|
24363
24985
|
function _sliced_to_array$3(arr, i) {
|
|
24364
|
-
return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$
|
|
24986
|
+
return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$6(arr, i) || _non_iterable_rest$3();
|
|
24365
24987
|
}
|
|
24366
24988
|
function _super_prop_base$6(object, property) {
|
|
24367
24989
|
while(!Object.prototype.hasOwnProperty.call(object, property)){
|
|
@@ -24374,13 +24996,13 @@ this.Scorm2004API = (function () {
|
|
|
24374
24996
|
"@swc/helpers - typeof";
|
|
24375
24997
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
24376
24998
|
}
|
|
24377
|
-
function _unsupported_iterable_to_array$
|
|
24999
|
+
function _unsupported_iterable_to_array$6(o, minLen) {
|
|
24378
25000
|
if (!o) return;
|
|
24379
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
25001
|
+
if (typeof o === "string") return _array_like_to_array$6(o, minLen);
|
|
24380
25002
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
24381
25003
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
24382
25004
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
24383
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
25005
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$6(o, minLen);
|
|
24384
25006
|
}
|
|
24385
25007
|
function _is_native_reflect_construct$g() {
|
|
24386
25008
|
try {
|
|
@@ -24705,7 +25327,7 @@ this.Scorm2004API = (function () {
|
|
|
24705
25327
|
if (this.initialized && this._id === "") {
|
|
24706
25328
|
throw new Scorm2004ValidationError(this._cmi_element + ".description", scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
24707
25329
|
} else {
|
|
24708
|
-
if (check2004ValidFormat(this._cmi_element + ".description", description, scorm2004_regex.
|
|
25330
|
+
if (check2004ValidFormat(this._cmi_element + ".description", description, scorm2004_regex.CMILangString, true)) {
|
|
24709
25331
|
this._description = description;
|
|
24710
25332
|
}
|
|
24711
25333
|
}
|
|
@@ -25984,7 +26606,7 @@ this.Scorm2004API = (function () {
|
|
|
25984
26606
|
if (this.initialized && this._id === "") {
|
|
25985
26607
|
throw new Scorm2004ValidationError(this._cmi_element + ".description", scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
|
|
25986
26608
|
} else {
|
|
25987
|
-
if (check2004ValidFormat(this._cmi_element + ".description", description, scorm2004_regex.
|
|
26609
|
+
if (check2004ValidFormat(this._cmi_element + ".description", description, scorm2004_regex.CMILangString, true)) {
|
|
25988
26610
|
this._description = description;
|
|
25989
26611
|
}
|
|
25990
26612
|
}
|
|
@@ -29226,13 +29848,13 @@ this.Scorm2004API = (function () {
|
|
|
29226
29848
|
return ActivityTree;
|
|
29227
29849
|
}(BaseCMI);
|
|
29228
29850
|
|
|
29229
|
-
function _array_like_to_array$
|
|
29851
|
+
function _array_like_to_array$5(arr, len) {
|
|
29230
29852
|
if (len == null || len > arr.length) len = arr.length;
|
|
29231
29853
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
29232
29854
|
return arr2;
|
|
29233
29855
|
}
|
|
29234
|
-
function _array_without_holes$
|
|
29235
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
29856
|
+
function _array_without_holes$3(arr) {
|
|
29857
|
+
if (Array.isArray(arr)) return _array_like_to_array$5(arr);
|
|
29236
29858
|
}
|
|
29237
29859
|
function _assert_this_initialized$1(self) {
|
|
29238
29860
|
if (self === void 0) {
|
|
@@ -29318,10 +29940,10 @@ this.Scorm2004API = (function () {
|
|
|
29318
29940
|
return left instanceof right;
|
|
29319
29941
|
}
|
|
29320
29942
|
}
|
|
29321
|
-
function _iterable_to_array$
|
|
29943
|
+
function _iterable_to_array$3(iter) {
|
|
29322
29944
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
29323
29945
|
}
|
|
29324
|
-
function _non_iterable_spread$
|
|
29946
|
+
function _non_iterable_spread$3() {
|
|
29325
29947
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
29326
29948
|
}
|
|
29327
29949
|
function _object_spread$4(target) {
|
|
@@ -29359,20 +29981,20 @@ this.Scorm2004API = (function () {
|
|
|
29359
29981
|
}
|
|
29360
29982
|
return object;
|
|
29361
29983
|
}
|
|
29362
|
-
function _to_consumable_array$
|
|
29363
|
-
return _array_without_holes$
|
|
29984
|
+
function _to_consumable_array$3(arr) {
|
|
29985
|
+
return _array_without_holes$3(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$5(arr) || _non_iterable_spread$3();
|
|
29364
29986
|
}
|
|
29365
29987
|
function _type_of$7(obj) {
|
|
29366
29988
|
"@swc/helpers - typeof";
|
|
29367
29989
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
29368
29990
|
}
|
|
29369
|
-
function _unsupported_iterable_to_array$
|
|
29991
|
+
function _unsupported_iterable_to_array$5(o, minLen) {
|
|
29370
29992
|
if (!o) return;
|
|
29371
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
29993
|
+
if (typeof o === "string") return _array_like_to_array$5(o, minLen);
|
|
29372
29994
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
29373
29995
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
29374
29996
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
29375
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
29997
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$5(o, minLen);
|
|
29376
29998
|
}
|
|
29377
29999
|
function _is_native_reflect_construct$1() {
|
|
29378
30000
|
try {
|
|
@@ -29500,10 +30122,10 @@ this.Scorm2004API = (function () {
|
|
|
29500
30122
|
{
|
|
29501
30123
|
key: "hideLmsUi",
|
|
29502
30124
|
get: function get() {
|
|
29503
|
-
return _to_consumable_array$
|
|
30125
|
+
return _to_consumable_array$3(this._hideLmsUi);
|
|
29504
30126
|
},
|
|
29505
30127
|
set: function set(items) {
|
|
29506
|
-
this._hideLmsUi = _to_consumable_array$
|
|
30128
|
+
this._hideLmsUi = _to_consumable_array$3(items);
|
|
29507
30129
|
}
|
|
29508
30130
|
},
|
|
29509
30131
|
{
|
|
@@ -30083,7 +30705,7 @@ this.Scorm2004API = (function () {
|
|
|
30083
30705
|
return Scorm2004CMIHandler;
|
|
30084
30706
|
}();
|
|
30085
30707
|
|
|
30086
|
-
function _array_like_to_array$
|
|
30708
|
+
function _array_like_to_array$4(arr, len) {
|
|
30087
30709
|
if (len == null || len > arr.length) len = arr.length;
|
|
30088
30710
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
30089
30711
|
return arr2;
|
|
@@ -30091,8 +30713,8 @@ this.Scorm2004API = (function () {
|
|
|
30091
30713
|
function _array_with_holes$2(arr) {
|
|
30092
30714
|
if (Array.isArray(arr)) return arr;
|
|
30093
30715
|
}
|
|
30094
|
-
function _array_without_holes$
|
|
30095
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
30716
|
+
function _array_without_holes$2(arr) {
|
|
30717
|
+
if (Array.isArray(arr)) return _array_like_to_array$4(arr);
|
|
30096
30718
|
}
|
|
30097
30719
|
function _class_call_check$5(instance, Constructor) {
|
|
30098
30720
|
if (!(instance instanceof Constructor)) {
|
|
@@ -30125,7 +30747,7 @@ this.Scorm2004API = (function () {
|
|
|
30125
30747
|
}
|
|
30126
30748
|
return obj;
|
|
30127
30749
|
}
|
|
30128
|
-
function _iterable_to_array$
|
|
30750
|
+
function _iterable_to_array$2(iter) {
|
|
30129
30751
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
30130
30752
|
}
|
|
30131
30753
|
function _iterable_to_array_limit$2(arr, i) {
|
|
@@ -30155,7 +30777,7 @@ this.Scorm2004API = (function () {
|
|
|
30155
30777
|
function _non_iterable_rest$2() {
|
|
30156
30778
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
30157
30779
|
}
|
|
30158
|
-
function _non_iterable_spread$
|
|
30780
|
+
function _non_iterable_spread$2() {
|
|
30159
30781
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
30160
30782
|
}
|
|
30161
30783
|
function _object_spread$3(target) {
|
|
@@ -30174,18 +30796,18 @@ this.Scorm2004API = (function () {
|
|
|
30174
30796
|
return target;
|
|
30175
30797
|
}
|
|
30176
30798
|
function _sliced_to_array$2(arr, i) {
|
|
30177
|
-
return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$
|
|
30799
|
+
return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$4(arr, i) || _non_iterable_rest$2();
|
|
30178
30800
|
}
|
|
30179
|
-
function _to_consumable_array$
|
|
30180
|
-
return _array_without_holes$
|
|
30801
|
+
function _to_consumable_array$2(arr) {
|
|
30802
|
+
return _array_without_holes$2(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$4(arr) || _non_iterable_spread$2();
|
|
30181
30803
|
}
|
|
30182
|
-
function _unsupported_iterable_to_array$
|
|
30804
|
+
function _unsupported_iterable_to_array$4(o, minLen) {
|
|
30183
30805
|
if (!o) return;
|
|
30184
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
30806
|
+
if (typeof o === "string") return _array_like_to_array$4(o, minLen);
|
|
30185
30807
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
30186
30808
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
30187
30809
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
30188
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
30810
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
|
|
30189
30811
|
}
|
|
30190
30812
|
var SequencingConfigurationBuilder = /*#__PURE__*/ function() {
|
|
30191
30813
|
function SequencingConfigurationBuilder() {
|
|
@@ -30264,6 +30886,9 @@ this.Scorm2004API = (function () {
|
|
|
30264
30886
|
if (settings.objectiveSetByContent !== void 0) {
|
|
30265
30887
|
target.objectiveSetByContent = settings.objectiveSetByContent;
|
|
30266
30888
|
}
|
|
30889
|
+
if (settings.tracked !== void 0) {
|
|
30890
|
+
target.tracked = settings.tracked;
|
|
30891
|
+
}
|
|
30267
30892
|
}
|
|
30268
30893
|
},
|
|
30269
30894
|
{
|
|
@@ -30723,7 +31348,7 @@ this.Scorm2004API = (function () {
|
|
|
30723
31348
|
if (!additional || additional.length === 0) {
|
|
30724
31349
|
return current;
|
|
30725
31350
|
}
|
|
30726
|
-
return this.sanitizeHideLmsUi(_to_consumable_array$
|
|
31351
|
+
return this.sanitizeHideLmsUi(_to_consumable_array$2(current).concat(_to_consumable_array$2(additional)));
|
|
30727
31352
|
}
|
|
30728
31353
|
},
|
|
30729
31354
|
{
|
|
@@ -30791,7 +31416,7 @@ this.Scorm2004API = (function () {
|
|
|
30791
31416
|
var seen = /* @__PURE__ */ new Set();
|
|
30792
31417
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
30793
31418
|
try {
|
|
30794
|
-
for(var _iterator = _to_consumable_array$
|
|
31419
|
+
for(var _iterator = _to_consumable_array$2(existing !== null && existing !== void 0 ? existing : []).concat(_to_consumable_array$2(additions !== null && additions !== void 0 ? additions : []))[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
30795
31420
|
var resource = _step.value;
|
|
30796
31421
|
if (!resource) {
|
|
30797
31422
|
continue;
|
|
@@ -30833,13 +31458,13 @@ this.Scorm2004API = (function () {
|
|
|
30833
31458
|
value: function cloneSelectionRandomizationState(state) {
|
|
30834
31459
|
var clone = {};
|
|
30835
31460
|
if (state.childOrder) {
|
|
30836
|
-
clone.childOrder = _to_consumable_array$
|
|
31461
|
+
clone.childOrder = _to_consumable_array$2(state.childOrder);
|
|
30837
31462
|
}
|
|
30838
31463
|
if (state.selectedChildIds) {
|
|
30839
|
-
clone.selectedChildIds = _to_consumable_array$
|
|
31464
|
+
clone.selectedChildIds = _to_consumable_array$2(state.selectedChildIds);
|
|
30840
31465
|
}
|
|
30841
31466
|
if (state.hiddenFromChoiceChildIds) {
|
|
30842
|
-
clone.hiddenFromChoiceChildIds = _to_consumable_array$
|
|
31467
|
+
clone.hiddenFromChoiceChildIds = _to_consumable_array$2(state.hiddenFromChoiceChildIds);
|
|
30843
31468
|
}
|
|
30844
31469
|
if (state.selectionCountStatus !== void 0) {
|
|
30845
31470
|
clone.selectionCountStatus = state.selectionCountStatus;
|
|
@@ -30920,13 +31545,13 @@ this.Scorm2004API = (function () {
|
|
|
30920
31545
|
return SequencingConfigurationBuilder;
|
|
30921
31546
|
}();
|
|
30922
31547
|
|
|
30923
|
-
function _array_like_to_array$
|
|
31548
|
+
function _array_like_to_array$3(arr, len) {
|
|
30924
31549
|
if (len == null || len > arr.length) len = arr.length;
|
|
30925
31550
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
30926
31551
|
return arr2;
|
|
30927
31552
|
}
|
|
30928
|
-
function _array_without_holes(arr) {
|
|
30929
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
31553
|
+
function _array_without_holes$1(arr) {
|
|
31554
|
+
if (Array.isArray(arr)) return _array_like_to_array$3(arr);
|
|
30930
31555
|
}
|
|
30931
31556
|
function _class_call_check$4(instance, Constructor) {
|
|
30932
31557
|
if (!(instance instanceof Constructor)) {
|
|
@@ -30946,26 +31571,26 @@ this.Scorm2004API = (function () {
|
|
|
30946
31571
|
if (protoProps) _defineProperties$4(Constructor.prototype, protoProps);
|
|
30947
31572
|
return Constructor;
|
|
30948
31573
|
}
|
|
30949
|
-
function _iterable_to_array(iter) {
|
|
31574
|
+
function _iterable_to_array$1(iter) {
|
|
30950
31575
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
30951
31576
|
}
|
|
30952
|
-
function _non_iterable_spread() {
|
|
31577
|
+
function _non_iterable_spread$1() {
|
|
30953
31578
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
30954
31579
|
}
|
|
30955
|
-
function _to_consumable_array(arr) {
|
|
30956
|
-
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array$
|
|
31580
|
+
function _to_consumable_array$1(arr) {
|
|
31581
|
+
return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$3(arr) || _non_iterable_spread$1();
|
|
30957
31582
|
}
|
|
30958
31583
|
function _type_of$4(obj) {
|
|
30959
31584
|
"@swc/helpers - typeof";
|
|
30960
31585
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
30961
31586
|
}
|
|
30962
|
-
function _unsupported_iterable_to_array$
|
|
31587
|
+
function _unsupported_iterable_to_array$3(o, minLen) {
|
|
30963
31588
|
if (!o) return;
|
|
30964
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
31589
|
+
if (typeof o === "string") return _array_like_to_array$3(o, minLen);
|
|
30965
31590
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
30966
31591
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
30967
31592
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
30968
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
31593
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
|
|
30969
31594
|
}
|
|
30970
31595
|
var __defProp$4 = Object.defineProperty;
|
|
30971
31596
|
var __defNormalProp$4 = function __defNormalProp(obj, key, value) {
|
|
@@ -31107,6 +31732,9 @@ this.Scorm2004API = (function () {
|
|
|
31107
31732
|
if (activitySettings.sequencingControls) {
|
|
31108
31733
|
this.sequencingConfigBuilder.applySequencingControlsSettings(activity.sequencingControls, activitySettings.sequencingControls);
|
|
31109
31734
|
}
|
|
31735
|
+
if (activitySettings.deliveryControls) {
|
|
31736
|
+
this.sequencingConfigBuilder.applySequencingControlsSettings(activity.sequencingControls, activitySettings.deliveryControls);
|
|
31737
|
+
}
|
|
31110
31738
|
if (activitySettings.sequencingRules) {
|
|
31111
31739
|
this.sequencingConfigBuilder.applySequencingRulesSettings(activity.sequencingRules, activitySettings.sequencingRules);
|
|
31112
31740
|
}
|
|
@@ -31207,7 +31835,7 @@ this.Scorm2004API = (function () {
|
|
|
31207
31835
|
for(var _iterator = activity.children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
31208
31836
|
var child = _step.value;
|
|
31209
31837
|
var _ids;
|
|
31210
|
-
(_ids = ids).push.apply(_ids, _to_consumable_array(this.extractActivityIds(child)));
|
|
31838
|
+
(_ids = ids).push.apply(_ids, _to_consumable_array$1(this.extractActivityIds(child)));
|
|
31211
31839
|
}
|
|
31212
31840
|
} catch (err) {
|
|
31213
31841
|
_didIteratorError = true;
|
|
@@ -31239,19 +31867,19 @@ this.Scorm2004API = (function () {
|
|
|
31239
31867
|
var _info_readSatisfiedStatus, _info_readNormalizedMeasure, _info_writeSatisfiedStatus, _info_writeNormalizedMeasure, _info_readCompletionStatus, _info_writeCompletionStatus, _info_readProgressMeasure, _info_writeProgressMeasure, _info_readRawScore, _info_writeRawScore, _info_readMinScore, _info_writeMinScore, _info_readMaxScore, _info_writeMaxScore, _info_updateAttemptData;
|
|
31240
31868
|
return {
|
|
31241
31869
|
targetObjectiveID: info.targetObjectiveID,
|
|
31242
|
-
readSatisfiedStatus: (_info_readSatisfiedStatus = info.readSatisfiedStatus) !== null && _info_readSatisfiedStatus !== void 0 ? _info_readSatisfiedStatus :
|
|
31243
|
-
readNormalizedMeasure: (_info_readNormalizedMeasure = info.readNormalizedMeasure) !== null && _info_readNormalizedMeasure !== void 0 ? _info_readNormalizedMeasure :
|
|
31870
|
+
readSatisfiedStatus: (_info_readSatisfiedStatus = info.readSatisfiedStatus) !== null && _info_readSatisfiedStatus !== void 0 ? _info_readSatisfiedStatus : true,
|
|
31871
|
+
readNormalizedMeasure: (_info_readNormalizedMeasure = info.readNormalizedMeasure) !== null && _info_readNormalizedMeasure !== void 0 ? _info_readNormalizedMeasure : true,
|
|
31244
31872
|
writeSatisfiedStatus: (_info_writeSatisfiedStatus = info.writeSatisfiedStatus) !== null && _info_writeSatisfiedStatus !== void 0 ? _info_writeSatisfiedStatus : false,
|
|
31245
31873
|
writeNormalizedMeasure: (_info_writeNormalizedMeasure = info.writeNormalizedMeasure) !== null && _info_writeNormalizedMeasure !== void 0 ? _info_writeNormalizedMeasure : false,
|
|
31246
|
-
readCompletionStatus: (_info_readCompletionStatus = info.readCompletionStatus) !== null && _info_readCompletionStatus !== void 0 ? _info_readCompletionStatus :
|
|
31874
|
+
readCompletionStatus: (_info_readCompletionStatus = info.readCompletionStatus) !== null && _info_readCompletionStatus !== void 0 ? _info_readCompletionStatus : true,
|
|
31247
31875
|
writeCompletionStatus: (_info_writeCompletionStatus = info.writeCompletionStatus) !== null && _info_writeCompletionStatus !== void 0 ? _info_writeCompletionStatus : false,
|
|
31248
|
-
readProgressMeasure: (_info_readProgressMeasure = info.readProgressMeasure) !== null && _info_readProgressMeasure !== void 0 ? _info_readProgressMeasure :
|
|
31876
|
+
readProgressMeasure: (_info_readProgressMeasure = info.readProgressMeasure) !== null && _info_readProgressMeasure !== void 0 ? _info_readProgressMeasure : true,
|
|
31249
31877
|
writeProgressMeasure: (_info_writeProgressMeasure = info.writeProgressMeasure) !== null && _info_writeProgressMeasure !== void 0 ? _info_writeProgressMeasure : false,
|
|
31250
|
-
readRawScore: (_info_readRawScore = info.readRawScore) !== null && _info_readRawScore !== void 0 ? _info_readRawScore :
|
|
31878
|
+
readRawScore: (_info_readRawScore = info.readRawScore) !== null && _info_readRawScore !== void 0 ? _info_readRawScore : true,
|
|
31251
31879
|
writeRawScore: (_info_writeRawScore = info.writeRawScore) !== null && _info_writeRawScore !== void 0 ? _info_writeRawScore : false,
|
|
31252
|
-
readMinScore: (_info_readMinScore = info.readMinScore) !== null && _info_readMinScore !== void 0 ? _info_readMinScore :
|
|
31880
|
+
readMinScore: (_info_readMinScore = info.readMinScore) !== null && _info_readMinScore !== void 0 ? _info_readMinScore : true,
|
|
31253
31881
|
writeMinScore: (_info_writeMinScore = info.writeMinScore) !== null && _info_writeMinScore !== void 0 ? _info_writeMinScore : false,
|
|
31254
|
-
readMaxScore: (_info_readMaxScore = info.readMaxScore) !== null && _info_readMaxScore !== void 0 ? _info_readMaxScore :
|
|
31882
|
+
readMaxScore: (_info_readMaxScore = info.readMaxScore) !== null && _info_readMaxScore !== void 0 ? _info_readMaxScore : true,
|
|
31255
31883
|
writeMaxScore: (_info_writeMaxScore = info.writeMaxScore) !== null && _info_writeMaxScore !== void 0 ? _info_writeMaxScore : false,
|
|
31256
31884
|
updateAttemptData: (_info_updateAttemptData = info.updateAttemptData) !== null && _info_updateAttemptData !== void 0 ? _info_updateAttemptData : false
|
|
31257
31885
|
};
|
|
@@ -31269,7 +31897,7 @@ this.Scorm2004API = (function () {
|
|
|
31269
31897
|
return ActivityTreeBuilder;
|
|
31270
31898
|
}();
|
|
31271
31899
|
|
|
31272
|
-
function _array_like_to_array$
|
|
31900
|
+
function _array_like_to_array$2(arr, len) {
|
|
31273
31901
|
if (len == null || len > arr.length) len = arr.length;
|
|
31274
31902
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
31275
31903
|
return arr2;
|
|
@@ -31351,19 +31979,19 @@ this.Scorm2004API = (function () {
|
|
|
31351
31979
|
return target;
|
|
31352
31980
|
}
|
|
31353
31981
|
function _sliced_to_array$1(arr, i) {
|
|
31354
|
-
return _array_with_holes$1(arr) || _iterable_to_array_limit$1(arr, i) || _unsupported_iterable_to_array$
|
|
31982
|
+
return _array_with_holes$1(arr) || _iterable_to_array_limit$1(arr, i) || _unsupported_iterable_to_array$2(arr, i) || _non_iterable_rest$1();
|
|
31355
31983
|
}
|
|
31356
31984
|
function _type_of$3(obj) {
|
|
31357
31985
|
"@swc/helpers - typeof";
|
|
31358
31986
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
31359
31987
|
}
|
|
31360
|
-
function _unsupported_iterable_to_array$
|
|
31988
|
+
function _unsupported_iterable_to_array$2(o, minLen) {
|
|
31361
31989
|
if (!o) return;
|
|
31362
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
31990
|
+
if (typeof o === "string") return _array_like_to_array$2(o, minLen);
|
|
31363
31991
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
31364
31992
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
31365
31993
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
31366
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
31994
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
|
|
31367
31995
|
}
|
|
31368
31996
|
var __defProp$3 = Object.defineProperty;
|
|
31369
31997
|
var __defNormalProp$3 = function __defNormalProp(obj, key, value) {
|
|
@@ -31510,9 +32138,12 @@ this.Scorm2004API = (function () {
|
|
|
31510
32138
|
*
|
|
31511
32139
|
* @param {string} objectiveId - The global objective ID
|
|
31512
32140
|
* @param {CMIObjectivesObject} objective - The CMI objective object with updated values
|
|
32141
|
+
*
|
|
32142
|
+
* @spec SCORM 2004 4th Ed. SN 3.10.3 - global objectives synchronize CMI objective data
|
|
32143
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max score fields synchronize independently
|
|
31513
32144
|
*/ key: "updateGlobalObjectiveFromCMI",
|
|
31514
32145
|
value: function updateGlobalObjectiveFromCMI(objectiveId, objective) {
|
|
31515
|
-
var _objective_score;
|
|
32146
|
+
var _objective_score, _objective_score1, _objective_score2, _objective_score3;
|
|
31516
32147
|
if (!objectiveId || !this.context.sequencingService) {
|
|
31517
32148
|
return;
|
|
31518
32149
|
}
|
|
@@ -31536,6 +32167,18 @@ this.Scorm2004API = (function () {
|
|
|
31536
32167
|
updatePayload.normalizedMeasure = normalizedMeasure;
|
|
31537
32168
|
updatePayload.normalizedMeasureKnown = true;
|
|
31538
32169
|
}
|
|
32170
|
+
if (((_objective_score1 = objective.score) === null || _objective_score1 === void 0 ? void 0 : _objective_score1.raw) !== void 0 && objective.score.raw !== "") {
|
|
32171
|
+
updatePayload.rawScore = objective.score.raw;
|
|
32172
|
+
updatePayload.rawScoreKnown = true;
|
|
32173
|
+
}
|
|
32174
|
+
if (((_objective_score2 = objective.score) === null || _objective_score2 === void 0 ? void 0 : _objective_score2.min) !== void 0 && objective.score.min !== "") {
|
|
32175
|
+
updatePayload.minScore = objective.score.min;
|
|
32176
|
+
updatePayload.minScoreKnown = true;
|
|
32177
|
+
}
|
|
32178
|
+
if (((_objective_score3 = objective.score) === null || _objective_score3 === void 0 ? void 0 : _objective_score3.max) !== void 0 && objective.score.max !== "") {
|
|
32179
|
+
updatePayload.maxScore = objective.score.max;
|
|
32180
|
+
updatePayload.maxScoreKnown = true;
|
|
32181
|
+
}
|
|
31539
32182
|
var progressMeasure = this.parseObjectiveNumber(objective.progress_measure);
|
|
31540
32183
|
if (progressMeasure !== null) {
|
|
31541
32184
|
updatePayload.progressMeasure = progressMeasure;
|
|
@@ -31557,13 +32200,22 @@ this.Scorm2004API = (function () {
|
|
|
31557
32200
|
*
|
|
31558
32201
|
* @param {CMIObjectivesObject} objective - The CMI objectives object containing data about a specific learning objective.
|
|
31559
32202
|
* @return {GlobalObjectiveMapEntry} An object containing mapped properties and their values based on the provided objective.
|
|
32203
|
+
*
|
|
32204
|
+
* @spec SCORM 2004 4th Ed. SN 3.10.3 - global objective map entries capture objective state
|
|
32205
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max score entries carry per-field known flags
|
|
31560
32206
|
*/ key: "buildObjectiveMapEntryFromCMI",
|
|
31561
32207
|
value: function buildObjectiveMapEntryFromCMI(objective) {
|
|
31562
|
-
var _objective_score;
|
|
32208
|
+
var _objective_score, _objective_score1, _objective_score2, _objective_score3;
|
|
31563
32209
|
var entry = {
|
|
31564
32210
|
id: objective.id,
|
|
31565
32211
|
satisfiedStatusKnown: false,
|
|
31566
32212
|
normalizedMeasureKnown: false,
|
|
32213
|
+
rawScore: "",
|
|
32214
|
+
rawScoreKnown: false,
|
|
32215
|
+
minScore: "",
|
|
32216
|
+
minScoreKnown: false,
|
|
32217
|
+
maxScore: "",
|
|
32218
|
+
maxScoreKnown: false,
|
|
31567
32219
|
progressMeasureKnown: false,
|
|
31568
32220
|
completionStatusKnown: false,
|
|
31569
32221
|
readSatisfiedStatus: true,
|
|
@@ -31573,7 +32225,13 @@ this.Scorm2004API = (function () {
|
|
|
31573
32225
|
readCompletionStatus: true,
|
|
31574
32226
|
writeCompletionStatus: true,
|
|
31575
32227
|
readProgressMeasure: true,
|
|
31576
|
-
writeProgressMeasure: true
|
|
32228
|
+
writeProgressMeasure: true,
|
|
32229
|
+
readRawScore: true,
|
|
32230
|
+
writeRawScore: true,
|
|
32231
|
+
readMinScore: true,
|
|
32232
|
+
writeMinScore: true,
|
|
32233
|
+
readMaxScore: true,
|
|
32234
|
+
writeMaxScore: true
|
|
31577
32235
|
};
|
|
31578
32236
|
if (objective.success_status && objective.success_status !== SuccessStatus.UNKNOWN) {
|
|
31579
32237
|
entry.satisfiedStatus = objective.success_status === SuccessStatus.PASSED;
|
|
@@ -31584,6 +32242,18 @@ this.Scorm2004API = (function () {
|
|
|
31584
32242
|
entry.normalizedMeasure = normalizedMeasure;
|
|
31585
32243
|
entry.normalizedMeasureKnown = true;
|
|
31586
32244
|
}
|
|
32245
|
+
if (((_objective_score1 = objective.score) === null || _objective_score1 === void 0 ? void 0 : _objective_score1.raw) !== void 0 && objective.score.raw !== "") {
|
|
32246
|
+
entry.rawScore = objective.score.raw;
|
|
32247
|
+
entry.rawScoreKnown = true;
|
|
32248
|
+
}
|
|
32249
|
+
if (((_objective_score2 = objective.score) === null || _objective_score2 === void 0 ? void 0 : _objective_score2.min) !== void 0 && objective.score.min !== "") {
|
|
32250
|
+
entry.minScore = objective.score.min;
|
|
32251
|
+
entry.minScoreKnown = true;
|
|
32252
|
+
}
|
|
32253
|
+
if (((_objective_score3 = objective.score) === null || _objective_score3 === void 0 ? void 0 : _objective_score3.max) !== void 0 && objective.score.max !== "") {
|
|
32254
|
+
entry.maxScore = objective.score.max;
|
|
32255
|
+
entry.maxScoreKnown = true;
|
|
32256
|
+
}
|
|
31587
32257
|
var progressMeasure = this.parseObjectiveNumber(objective.progress_measure);
|
|
31588
32258
|
if (progressMeasure !== null) {
|
|
31589
32259
|
entry.progressMeasure = progressMeasure;
|
|
@@ -31606,6 +32276,9 @@ this.Scorm2004API = (function () {
|
|
|
31606
32276
|
* @return {CMIObjectivesObject[]} An array of `CMIObjectivesObject` instances built
|
|
31607
32277
|
* from the provided snapshot map. Returns an empty array
|
|
31608
32278
|
* if the snapshot is invalid or no valid objectives can be created.
|
|
32279
|
+
*
|
|
32280
|
+
* @spec SCORM 2004 4th Ed. SN 3.10.3 - global objective snapshots restore CMI objective state
|
|
32281
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max score known fields restore independently
|
|
31609
32282
|
*/ key: "buildCMIObjectivesFromMap",
|
|
31610
32283
|
value: function buildCMIObjectivesFromMap(snapshot) {
|
|
31611
32284
|
var objectives = [];
|
|
@@ -31629,6 +32302,18 @@ this.Scorm2004API = (function () {
|
|
|
31629
32302
|
if (entry.normalizedMeasureKnown === true && normalizedMeasure !== null) {
|
|
31630
32303
|
objective.score.scaled = String(normalizedMeasure);
|
|
31631
32304
|
}
|
|
32305
|
+
if (entry.rawScoreKnown === true) {
|
|
32306
|
+
var _entry_rawScore;
|
|
32307
|
+
objective.score.raw = String((_entry_rawScore = entry.rawScore) !== null && _entry_rawScore !== void 0 ? _entry_rawScore : "");
|
|
32308
|
+
}
|
|
32309
|
+
if (entry.minScoreKnown === true) {
|
|
32310
|
+
var _entry_minScore;
|
|
32311
|
+
objective.score.min = String((_entry_minScore = entry.minScore) !== null && _entry_minScore !== void 0 ? _entry_minScore : "");
|
|
32312
|
+
}
|
|
32313
|
+
if (entry.maxScoreKnown === true) {
|
|
32314
|
+
var _entry_maxScore;
|
|
32315
|
+
objective.score.max = String((_entry_maxScore = entry.maxScore) !== null && _entry_maxScore !== void 0 ? _entry_maxScore : "");
|
|
32316
|
+
}
|
|
31632
32317
|
var progressMeasure = this.parseObjectiveNumber(entry.progressMeasure);
|
|
31633
32318
|
if (entry.progressMeasureKnown === true && progressMeasure !== null) {
|
|
31634
32319
|
objective.progress_measure = String(progressMeasure);
|
|
@@ -31797,6 +32482,9 @@ this.Scorm2004API = (function () {
|
|
|
31797
32482
|
* @param {CompletionStatus} completionStatus
|
|
31798
32483
|
* @param {SuccessStatus} successStatus
|
|
31799
32484
|
* @param {ScoreObject} scoreObject
|
|
32485
|
+
*
|
|
32486
|
+
* @spec SCORM 2004 4th Ed. RTE-to-SN Data Transfer - CMI score data updates the current primary objective
|
|
32487
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max score data is available for write maps
|
|
31800
32488
|
*/ key: "syncCmiToSequencingActivity",
|
|
31801
32489
|
value: function syncCmiToSequencingActivity(completionStatus, successStatus, scoreObject) {
|
|
31802
32490
|
if (!this.context.sequencing) {
|
|
@@ -31822,6 +32510,15 @@ this.Scorm2004API = (function () {
|
|
|
31822
32510
|
primaryObjective.normalizedMeasure = scoreObject.scaled;
|
|
31823
32511
|
primaryObjective.measureStatus = true;
|
|
31824
32512
|
}
|
|
32513
|
+
if ((scoreObject === null || scoreObject === void 0 ? void 0 : scoreObject.raw) !== void 0 && scoreObject.raw !== null) {
|
|
32514
|
+
primaryObjective.rawScore = String(scoreObject.raw);
|
|
32515
|
+
}
|
|
32516
|
+
if ((scoreObject === null || scoreObject === void 0 ? void 0 : scoreObject.min) !== void 0 && scoreObject.min !== null) {
|
|
32517
|
+
primaryObjective.minScore = String(scoreObject.min);
|
|
32518
|
+
}
|
|
32519
|
+
if ((scoreObject === null || scoreObject === void 0 ? void 0 : scoreObject.max) !== void 0 && scoreObject.max !== null) {
|
|
32520
|
+
primaryObjective.maxScore = String(scoreObject.max);
|
|
32521
|
+
}
|
|
31825
32522
|
}
|
|
31826
32523
|
},
|
|
31827
32524
|
{
|
|
@@ -32385,7 +33082,7 @@ this.Scorm2004API = (function () {
|
|
|
32385
33082
|
return SequencingStatePersistence;
|
|
32386
33083
|
}();
|
|
32387
33084
|
|
|
32388
|
-
function _array_like_to_array(arr, len) {
|
|
33085
|
+
function _array_like_to_array$1(arr, len) {
|
|
32389
33086
|
if (len == null || len > arr.length) len = arr.length;
|
|
32390
33087
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
32391
33088
|
return arr2;
|
|
@@ -32439,19 +33136,19 @@ this.Scorm2004API = (function () {
|
|
|
32439
33136
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
32440
33137
|
}
|
|
32441
33138
|
function _sliced_to_array(arr, i) {
|
|
32442
|
-
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
33139
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array$1(arr, i) || _non_iterable_rest();
|
|
32443
33140
|
}
|
|
32444
33141
|
function _type_of$1(obj) {
|
|
32445
33142
|
"@swc/helpers - typeof";
|
|
32446
33143
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
32447
33144
|
}
|
|
32448
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
33145
|
+
function _unsupported_iterable_to_array$1(o, minLen) {
|
|
32449
33146
|
if (!o) return;
|
|
32450
|
-
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
33147
|
+
if (typeof o === "string") return _array_like_to_array$1(o, minLen);
|
|
32451
33148
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
32452
33149
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
32453
33150
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
32454
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
33151
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
|
|
32455
33152
|
}
|
|
32456
33153
|
var __defProp$1 = Object.defineProperty;
|
|
32457
33154
|
var __defNormalProp$1 = function __defNormalProp(obj, key, value) {
|
|
@@ -32628,6 +33325,14 @@ this.Scorm2004API = (function () {
|
|
|
32628
33325
|
return Scorm2004DataSerializer;
|
|
32629
33326
|
}();
|
|
32630
33327
|
|
|
33328
|
+
function _array_like_to_array(arr, len) {
|
|
33329
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
33330
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
33331
|
+
return arr2;
|
|
33332
|
+
}
|
|
33333
|
+
function _array_without_holes(arr) {
|
|
33334
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
33335
|
+
}
|
|
32631
33336
|
function _assert_this_initialized(self) {
|
|
32632
33337
|
if (self === void 0) {
|
|
32633
33338
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
@@ -32725,6 +33430,12 @@ this.Scorm2004API = (function () {
|
|
|
32725
33430
|
return left instanceof right;
|
|
32726
33431
|
}
|
|
32727
33432
|
}
|
|
33433
|
+
function _iterable_to_array(iter) {
|
|
33434
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
33435
|
+
}
|
|
33436
|
+
function _non_iterable_spread() {
|
|
33437
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
33438
|
+
}
|
|
32728
33439
|
function _object_spread(target) {
|
|
32729
33440
|
for(var i = 1; i < arguments.length; i++){
|
|
32730
33441
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
@@ -32740,6 +33451,25 @@ this.Scorm2004API = (function () {
|
|
|
32740
33451
|
}
|
|
32741
33452
|
return target;
|
|
32742
33453
|
}
|
|
33454
|
+
function ownKeys(object, enumerableOnly) {
|
|
33455
|
+
var keys = Object.keys(object);
|
|
33456
|
+
if (Object.getOwnPropertySymbols) {
|
|
33457
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
33458
|
+
keys.push.apply(keys, symbols);
|
|
33459
|
+
}
|
|
33460
|
+
return keys;
|
|
33461
|
+
}
|
|
33462
|
+
function _object_spread_props(target, source) {
|
|
33463
|
+
source = source != null ? source : {};
|
|
33464
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
33465
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
33466
|
+
} else {
|
|
33467
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
33468
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
33469
|
+
});
|
|
33470
|
+
}
|
|
33471
|
+
return target;
|
|
33472
|
+
}
|
|
32743
33473
|
function _possible_constructor_return(self, call) {
|
|
32744
33474
|
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
32745
33475
|
return call;
|
|
@@ -32753,10 +33483,21 @@ this.Scorm2004API = (function () {
|
|
|
32753
33483
|
};
|
|
32754
33484
|
return _set_prototype_of(o, p);
|
|
32755
33485
|
}
|
|
33486
|
+
function _to_consumable_array(arr) {
|
|
33487
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
33488
|
+
}
|
|
32756
33489
|
function _type_of(obj) {
|
|
32757
33490
|
"@swc/helpers - typeof";
|
|
32758
33491
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
32759
33492
|
}
|
|
33493
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
33494
|
+
if (!o) return;
|
|
33495
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
33496
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
33497
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
33498
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
33499
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
33500
|
+
}
|
|
32760
33501
|
function _is_native_reflect_construct() {
|
|
32761
33502
|
try {
|
|
32762
33503
|
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
@@ -33027,18 +33768,240 @@ this.Scorm2004API = (function () {
|
|
|
33027
33768
|
/**
|
|
33028
33769
|
* Apply launch-static activity data to CMI while the new SCO is pre-initialize.
|
|
33029
33770
|
*
|
|
33030
|
-
* @spec SCORM 2004 4th Ed. RTE 4.2.
|
|
33771
|
+
* @spec SCORM 2004 4th Ed. RTE 4.2.5, Table 4.2.5a - cmi.completion_threshold
|
|
33772
|
+
* @spec SCORM 2004 4th Ed. RTE 4.2.17, Table 4.2.17a - cmi.objectives
|
|
33031
33773
|
*/ key: "applyCurrentActivityLaunchData",
|
|
33032
33774
|
value: function applyCurrentActivityLaunchData() {
|
|
33033
|
-
var
|
|
33034
|
-
var _this__sequencing, _this__sequencing_overallSequencingProcess, _currentActivity_completionThreshold;
|
|
33775
|
+
var _this__sequencing;
|
|
33035
33776
|
var currentActivity = (_this__sequencing = this._sequencing) === null || _this__sequencing === void 0 ? void 0 : _this__sequencing.getCurrentActivity();
|
|
33036
|
-
if (!
|
|
33777
|
+
if (!currentActivity) {
|
|
33778
|
+
return;
|
|
33779
|
+
}
|
|
33780
|
+
this.applyActivityLaunchData(currentActivity);
|
|
33781
|
+
}
|
|
33782
|
+
},
|
|
33783
|
+
{
|
|
33784
|
+
/**
|
|
33785
|
+
* Apply launch-static CMI data when sequencing delivers a new activity before SCO Initialize.
|
|
33786
|
+
*
|
|
33787
|
+
* @spec SCORM 2004 4th Ed. SN DB.2 - Content Delivery Environment Process establishes the delivered activity.
|
|
33788
|
+
* @spec SCORM 2004 4th Ed. RTE 4.2.5, Table 4.2.5a - cmi.completion_threshold is initialized before SCO access.
|
|
33789
|
+
* @spec SCORM 2004 4th Ed. RTE 4.2.17, Table 4.2.17a - cmi.objectives is initialized before SCO access.
|
|
33790
|
+
*/ key: "applyDeliveredActivityLaunchData",
|
|
33791
|
+
value: function applyDeliveredActivityLaunchData(activity) {
|
|
33792
|
+
if (!this.isNotInitialized()) {
|
|
33793
|
+
return;
|
|
33794
|
+
}
|
|
33795
|
+
this.applyActivityLaunchData(activity);
|
|
33796
|
+
}
|
|
33797
|
+
},
|
|
33798
|
+
{
|
|
33799
|
+
/**
|
|
33800
|
+
* Copy the delivered activity's static launch data into the fresh CMI model.
|
|
33801
|
+
*
|
|
33802
|
+
* @spec SCORM 2004 4th Ed. RTE 4.2.5, Table 4.2.5a - cmi.completion_threshold
|
|
33803
|
+
* @spec SCORM 2004 4th Ed. RTE 4.2.17, Table 4.2.17a - cmi.objectives
|
|
33804
|
+
*/ key: "applyActivityLaunchData",
|
|
33805
|
+
value: function applyActivityLaunchData(currentActivity) {
|
|
33806
|
+
var _ref, _ref1;
|
|
33807
|
+
var _this__sequencing_overallSequencingProcess, _currentActivity_completionThreshold;
|
|
33808
|
+
if (!this.cmi) {
|
|
33037
33809
|
return;
|
|
33038
33810
|
}
|
|
33039
33811
|
var contentActivityData = (_this__sequencing_overallSequencingProcess = this._sequencing.overallSequencingProcess) === null || _this__sequencing_overallSequencingProcess === void 0 ? void 0 : _this__sequencing_overallSequencingProcess.getContentActivityData(currentActivity);
|
|
33040
33812
|
var completionThreshold = (_ref = (_ref1 = contentActivityData === null || contentActivityData === void 0 ? void 0 : contentActivityData.completionThreshold) !== null && _ref1 !== void 0 ? _ref1 : (_currentActivity_completionThreshold = currentActivity.completionThreshold) === null || _currentActivity_completionThreshold === void 0 ? void 0 : _currentActivity_completionThreshold.toString()) !== null && _ref !== void 0 ? _ref : "";
|
|
33041
33813
|
this.cmi.completion_threshold = completionThreshold;
|
|
33814
|
+
this.seedCurrentActivityObjectives(currentActivity);
|
|
33815
|
+
}
|
|
33816
|
+
},
|
|
33817
|
+
{
|
|
33818
|
+
/**
|
|
33819
|
+
* Seed CMI objective ids after Initialize when automatic sequencing starts during Initialize.
|
|
33820
|
+
*
|
|
33821
|
+
* @spec SCORM 2004 4th Ed. RTE 4.2.17, Table 4.2.17a - cmi.objectives
|
|
33822
|
+
*/ key: "applyCurrentActivityObjectiveData",
|
|
33823
|
+
value: function applyCurrentActivityObjectiveData() {
|
|
33824
|
+
var _this__sequencing;
|
|
33825
|
+
var currentActivity = (_this__sequencing = this._sequencing) === null || _this__sequencing === void 0 ? void 0 : _this__sequencing.getCurrentActivity();
|
|
33826
|
+
if (!this.cmi || !currentActivity) {
|
|
33827
|
+
return;
|
|
33828
|
+
}
|
|
33829
|
+
this.seedCurrentActivityObjectives(currentActivity);
|
|
33830
|
+
}
|
|
33831
|
+
},
|
|
33832
|
+
{
|
|
33833
|
+
/**
|
|
33834
|
+
* Seed CMI objectives from primary and secondary activity objectives.
|
|
33835
|
+
*
|
|
33836
|
+
* @spec SCORM 2004 4th Ed. RTE 4.2.17 - Initialization of Run-Time Objectives from Sequencing Information
|
|
33837
|
+
* @spec SCORM 2004 4th Ed. RTE 4.2.17, Table 4.2.17a - cmi.objectives.n.id and success_status
|
|
33838
|
+
* @spec SCORM 2004 4th Ed. SN 3.10.3 / ADLSEQ objectives extension - objective read maps seed the RTE view
|
|
33839
|
+
*/ key: "seedCurrentActivityObjectives",
|
|
33840
|
+
value: function seedCurrentActivityObjectives(currentActivity) {
|
|
33841
|
+
var _activityObjectives;
|
|
33842
|
+
var activityObjectives = [];
|
|
33843
|
+
if (currentActivity.primaryObjective) {
|
|
33844
|
+
activityObjectives.push(currentActivity.primaryObjective);
|
|
33845
|
+
}
|
|
33846
|
+
(_activityObjectives = activityObjectives).push.apply(_activityObjectives, _to_consumable_array(currentActivity.objectives));
|
|
33847
|
+
var seededObjectiveIds = /* @__PURE__ */ new Set();
|
|
33848
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
33849
|
+
try {
|
|
33850
|
+
for(var _iterator = activityObjectives[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
33851
|
+
var activityObjective = _step.value;
|
|
33852
|
+
var objectiveId = this.getSeedableObjectiveId(activityObjective);
|
|
33853
|
+
if (!objectiveId || seededObjectiveIds.has(objectiveId)) {
|
|
33854
|
+
continue;
|
|
33855
|
+
}
|
|
33856
|
+
seededObjectiveIds.add(objectiveId);
|
|
33857
|
+
var index = this.findOrSeedCMIObjective(objectiveId);
|
|
33858
|
+
if (index === null) {
|
|
33859
|
+
continue;
|
|
33860
|
+
}
|
|
33861
|
+
var cmiObjective = this.cmi.objectives.findObjectiveByIndex(index);
|
|
33862
|
+
if (cmiObjective && this.cmi.objectives.initialized && !cmiObjective.initialized) {
|
|
33863
|
+
cmiObjective.initialize();
|
|
33864
|
+
}
|
|
33865
|
+
var successStatus = this.getActivityObjectiveSuccessStatus(activityObjective);
|
|
33866
|
+
if (successStatus) {
|
|
33867
|
+
this._commonSetCMIValue("SeedActivityObjective", true, "cmi.objectives.".concat(index, ".success_status"), successStatus);
|
|
33868
|
+
}
|
|
33869
|
+
this.seedObjectiveReadMapValues(currentActivity, activityObjective, index);
|
|
33870
|
+
}
|
|
33871
|
+
} catch (err) {
|
|
33872
|
+
_didIteratorError = true;
|
|
33873
|
+
_iteratorError = err;
|
|
33874
|
+
} finally{
|
|
33875
|
+
try {
|
|
33876
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
33877
|
+
_iterator.return();
|
|
33878
|
+
}
|
|
33879
|
+
} finally{
|
|
33880
|
+
if (_didIteratorError) {
|
|
33881
|
+
throw _iteratorError;
|
|
33882
|
+
}
|
|
33883
|
+
}
|
|
33884
|
+
}
|
|
33885
|
+
}
|
|
33886
|
+
},
|
|
33887
|
+
{
|
|
33888
|
+
/**
|
|
33889
|
+
* Seed CMI objective fields from this objective's read-mapped global objectives.
|
|
33890
|
+
*
|
|
33891
|
+
* @spec SCORM 2004 4th Ed. RTE 4.2.17 - Run-Time Objectives are initialized from sequencing information
|
|
33892
|
+
* @spec SCORM 2004 4th Ed. SN 3.10.3 - read mapInfo grants access to mapped global objective state
|
|
33893
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max score read maps seed RTE score fields
|
|
33894
|
+
*/ key: "seedObjectiveReadMapValues",
|
|
33895
|
+
value: function seedObjectiveReadMapValues(currentActivity, activityObjective, objectiveIndex) {
|
|
33896
|
+
var _this__sequencing_overallSequencingProcess;
|
|
33897
|
+
var globalObjectiveMap = (_this__sequencing_overallSequencingProcess = this._sequencing.overallSequencingProcess) === null || _this__sequencing_overallSequencingProcess === void 0 ? void 0 : _this__sequencing_overallSequencingProcess.getGlobalObjectiveMap();
|
|
33898
|
+
if (!globalObjectiveMap || activityObjective.mapInfo.length === 0) {
|
|
33899
|
+
return;
|
|
33900
|
+
}
|
|
33901
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
33902
|
+
try {
|
|
33903
|
+
for(var _iterator = activityObjective.mapInfo[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
33904
|
+
var mapInfo = _step.value;
|
|
33905
|
+
var targetObjectiveId = mapInfo.targetObjectiveID || activityObjective.id;
|
|
33906
|
+
var globalObjective = globalObjectiveMap.get(targetObjectiveId);
|
|
33907
|
+
if (!globalObjective) {
|
|
33908
|
+
continue;
|
|
33909
|
+
}
|
|
33910
|
+
var readState = GlobalObjectiveSynchronizer.getGlobalObjectiveReadState(currentActivity, activityObjective, mapInfo, globalObjective);
|
|
33911
|
+
this.applyObjectiveReadStateToCMI(objectiveIndex, readState);
|
|
33912
|
+
}
|
|
33913
|
+
} catch (err) {
|
|
33914
|
+
_didIteratorError = true;
|
|
33915
|
+
_iteratorError = err;
|
|
33916
|
+
} finally{
|
|
33917
|
+
try {
|
|
33918
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
33919
|
+
_iterator.return();
|
|
33920
|
+
}
|
|
33921
|
+
} finally{
|
|
33922
|
+
if (_didIteratorError) {
|
|
33923
|
+
throw _iteratorError;
|
|
33924
|
+
}
|
|
33925
|
+
}
|
|
33926
|
+
}
|
|
33927
|
+
}
|
|
33928
|
+
},
|
|
33929
|
+
{
|
|
33930
|
+
/**
|
|
33931
|
+
* Copy mapped global objective state into the seeded CMI objective entry.
|
|
33932
|
+
*
|
|
33933
|
+
* @spec SCORM 2004 4th Ed. RTE 4.2.17, Table 4.2.17a - cmi.objectives launch-time initialization
|
|
33934
|
+
* @spec SCORM 2004 4th Ed. SN 3.10.3 - read maps populate the RTE view without creating local writes
|
|
33935
|
+
* @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max score read maps populate CMI objective scores
|
|
33936
|
+
*/ key: "applyObjectiveReadStateToCMI",
|
|
33937
|
+
value: function applyObjectiveReadStateToCMI(objectiveIndex, readState) {
|
|
33938
|
+
if (readState.satisfiedStatus !== void 0) {
|
|
33939
|
+
this._commonSetCMIValue("SeedActivityObjectiveReadMap", true, "cmi.objectives.".concat(objectiveIndex, ".success_status"), readState.satisfiedStatus ? SuccessStatus.PASSED : SuccessStatus.FAILED);
|
|
33940
|
+
}
|
|
33941
|
+
if (readState.normalizedMeasure !== void 0) {
|
|
33942
|
+
this._commonSetCMIValue("SeedActivityObjectiveReadMap", true, "cmi.objectives.".concat(objectiveIndex, ".score.scaled"), String(readState.normalizedMeasure));
|
|
33943
|
+
}
|
|
33944
|
+
if (readState.completionStatus !== void 0) {
|
|
33945
|
+
this._commonSetCMIValue("SeedActivityObjectiveReadMap", true, "cmi.objectives.".concat(objectiveIndex, ".completion_status"), readState.completionStatus);
|
|
33946
|
+
}
|
|
33947
|
+
if (readState.progressMeasure !== void 0) {
|
|
33948
|
+
this._commonSetCMIValue("SeedActivityObjectiveReadMap", true, "cmi.objectives.".concat(objectiveIndex, ".progress_measure"), String(readState.progressMeasure));
|
|
33949
|
+
}
|
|
33950
|
+
if (readState.rawScore !== void 0) {
|
|
33951
|
+
this._commonSetCMIValue("SeedActivityObjectiveReadMap", true, "cmi.objectives.".concat(objectiveIndex, ".score.raw"), readState.rawScore);
|
|
33952
|
+
}
|
|
33953
|
+
if (readState.minScore !== void 0) {
|
|
33954
|
+
this._commonSetCMIValue("SeedActivityObjectiveReadMap", true, "cmi.objectives.".concat(objectiveIndex, ".score.min"), readState.minScore);
|
|
33955
|
+
}
|
|
33956
|
+
if (readState.maxScore !== void 0) {
|
|
33957
|
+
this._commonSetCMIValue("SeedActivityObjectiveReadMap", true, "cmi.objectives.".concat(objectiveIndex, ".score.max"), readState.maxScore);
|
|
33958
|
+
}
|
|
33959
|
+
}
|
|
33960
|
+
},
|
|
33961
|
+
{
|
|
33962
|
+
/**
|
|
33963
|
+
* Return a manifest-defined objective id that can initialize cmi.objectives.n.id.
|
|
33964
|
+
*
|
|
33965
|
+
* @spec SCORM 2004 4th Ed. RTE 4.2.17, Table 4.2.17a - cmi.objectives.n.id
|
|
33966
|
+
*/ key: "getSeedableObjectiveId",
|
|
33967
|
+
value: function getSeedableObjectiveId(activityObjective) {
|
|
33968
|
+
var objectiveId = activityObjective.id;
|
|
33969
|
+
if (typeof objectiveId !== "string" || objectiveId.trim() === "") {
|
|
33970
|
+
return null;
|
|
33971
|
+
}
|
|
33972
|
+
return objectiveId;
|
|
33973
|
+
}
|
|
33974
|
+
},
|
|
33975
|
+
{
|
|
33976
|
+
/**
|
|
33977
|
+
* Find an existing CMI objective id or create the next CMI objective array entry.
|
|
33978
|
+
*
|
|
33979
|
+
* @spec SCORM 2004 4th Ed. RTE 4.2.17, Table 4.2.17a - cmi.objectives._count
|
|
33980
|
+
* @spec SCORM 2004 4th Ed. RTE 4.2.17, Table 4.2.17a - cmi.objectives.n.id
|
|
33981
|
+
*/ key: "findOrSeedCMIObjective",
|
|
33982
|
+
value: function findOrSeedCMIObjective(objectiveId) {
|
|
33983
|
+
var existingIndex = this.cmi.objectives.childArray.findIndex(function(objective) {
|
|
33984
|
+
return objective.id === objectiveId;
|
|
33985
|
+
});
|
|
33986
|
+
if (existingIndex >= 0) {
|
|
33987
|
+
return existingIndex;
|
|
33988
|
+
}
|
|
33989
|
+
var index = this.cmi.objectives.childArray.length;
|
|
33990
|
+
var result = this._commonSetCMIValue("SeedActivityObjective", true, "cmi.objectives.".concat(index, ".id"), objectiveId);
|
|
33991
|
+
return result === global_constants.SCORM_TRUE ? index : null;
|
|
33992
|
+
}
|
|
33993
|
+
},
|
|
33994
|
+
{
|
|
33995
|
+
/**
|
|
33996
|
+
* Translate a known activity objective satisfied status to cmi.objectives.n.success_status.
|
|
33997
|
+
*
|
|
33998
|
+
* @spec SCORM 2004 4th Ed. RTE 4.2.17, Table 4.2.17a - cmi.objectives.n.success_status
|
|
33999
|
+
*/ key: "getActivityObjectiveSuccessStatus",
|
|
34000
|
+
value: function getActivityObjectiveSuccessStatus(activityObjective) {
|
|
34001
|
+
if (activityObjective.progressStatus || activityObjective.satisfiedStatusKnown) {
|
|
34002
|
+
return activityObjective.satisfiedStatus ? SuccessStatus.PASSED : SuccessStatus.FAILED;
|
|
34003
|
+
}
|
|
34004
|
+
return null;
|
|
33042
34005
|
}
|
|
33043
34006
|
},
|
|
33044
34007
|
{
|
|
@@ -33128,6 +34091,7 @@ this.Scorm2004API = (function () {
|
|
|
33128
34091
|
var result = this.initialize("Initialize", "LMS was already initialized!", "LMS is already finished!");
|
|
33129
34092
|
if (result === global_constants.SCORM_TRUE && this._sequencingService) {
|
|
33130
34093
|
this._sequencingService.initialize();
|
|
34094
|
+
this.applyCurrentActivityObjectiveData();
|
|
33131
34095
|
}
|
|
33132
34096
|
if (result === global_constants.SCORM_TRUE) {
|
|
33133
34097
|
this._globalObjectiveManager.restoreGlobalObjectivesToCMI();
|
|
@@ -33407,7 +34371,7 @@ this.Scorm2004API = (function () {
|
|
|
33407
34371
|
objective_id = objective ? objective.id : void 0;
|
|
33408
34372
|
}
|
|
33409
34373
|
var is_global = objective_id && ((_this_settings_globalObjectiveIds = this.settings.globalObjectiveIds) === null || _this_settings_globalObjectiveIds === void 0 ? void 0 : _this_settings_globalObjectiveIds.includes(objective_id));
|
|
33410
|
-
if (is_global) {
|
|
34374
|
+
if (is_global && this.currentActivityAllowsGlobalObjectiveWrites()) {
|
|
33411
34375
|
var _this__globalObjectiveManager_findOrCreateGlobalObjective = this._globalObjectiveManager.findOrCreateGlobalObjective(objective_id), global_index = _this__globalObjectiveManager_findOrCreateGlobalObjective.index;
|
|
33412
34376
|
var global_element = CMIElement.replace(element_base, "_globalObjectives.".concat(global_index));
|
|
33413
34377
|
this._commonSetCMIValue("SetGlobalObjectiveValue", true, global_element, value);
|
|
@@ -33422,6 +34386,18 @@ this.Scorm2004API = (function () {
|
|
|
33422
34386
|
},
|
|
33423
34387
|
{
|
|
33424
34388
|
/**
|
|
34389
|
+
* Return whether the current activity can update shared global objectives.
|
|
34390
|
+
*
|
|
34391
|
+
* @spec SCORM 2004 4th Ed. SN 3.13.1 Tracked - when False, the LMS
|
|
34392
|
+
* "does not initialize, manage or access any tracking status information".
|
|
34393
|
+
*/ key: "currentActivityAllowsGlobalObjectiveWrites",
|
|
34394
|
+
value: function currentActivityAllowsGlobalObjectiveWrites() {
|
|
34395
|
+
var _this__sequencing_getCurrentActivity, _this__sequencing;
|
|
34396
|
+
return ((_this__sequencing = this._sequencing) === null || _this__sequencing === void 0 ? void 0 : (_this__sequencing_getCurrentActivity = _this__sequencing.getCurrentActivity()) === null || _this__sequencing_getCurrentActivity === void 0 ? void 0 : _this__sequencing_getCurrentActivity.sequencingControls.tracked) !== false;
|
|
34397
|
+
}
|
|
34398
|
+
},
|
|
34399
|
+
{
|
|
34400
|
+
/**
|
|
33425
34401
|
* Gets or builds a new child element to add to the array
|
|
33426
34402
|
* @param {string} CMIElement
|
|
33427
34403
|
* @param {any} value
|
|
@@ -33763,9 +34739,7 @@ this.Scorm2004API = (function () {
|
|
|
33763
34739
|
logLevel: (_ref4 = settings === null || settings === void 0 ? void 0 : (_settings_sequencing4 = settings.sequencing) === null || _settings_sequencing4 === void 0 ? void 0 : _settings_sequencing4.logLevel) !== null && _ref4 !== void 0 ? _ref4 : "info"
|
|
33764
34740
|
};
|
|
33765
34741
|
this._sequencingService = new SequencingService(this._sequencing, this.cmi, this.adl, this.eventService || this, this.loggingService, sequencingConfig);
|
|
33766
|
-
|
|
33767
|
-
this._sequencingService.setEventListeners(settings.sequencing.eventListeners);
|
|
33768
|
-
}
|
|
34742
|
+
this._sequencingService.setEventListeners(this.buildSequencingEventListeners(settings === null || settings === void 0 ? void 0 : (_settings_sequencing5 = settings.sequencing) === null || _settings_sequencing5 === void 0 ? void 0 : _settings_sequencing5.eventListeners));
|
|
33769
34743
|
this._globalObjectiveManager.updateSequencingService(this._sequencingService);
|
|
33770
34744
|
this._dataSerializer.updateSequencingService(this._sequencingService);
|
|
33771
34745
|
if (settings === null || settings === void 0 ? void 0 : settings.sequencingStatePersistence) {
|
|
@@ -33790,6 +34764,25 @@ this.Scorm2004API = (function () {
|
|
|
33790
34764
|
},
|
|
33791
34765
|
{
|
|
33792
34766
|
/**
|
|
34767
|
+
* Wrap LMS-provided sequencing listeners with API-owned delivery bookkeeping.
|
|
34768
|
+
*
|
|
34769
|
+
* @spec SCORM 2004 4th Ed. SN DB.2 - Content Delivery Environment Process
|
|
34770
|
+
* @spec SCORM 2004 4th Ed. RTE 4.2.5, Table 4.2.5a - cmi.completion_threshold
|
|
34771
|
+
* @spec SCORM 2004 4th Ed. RTE 4.2.17, Table 4.2.17a - cmi.objectives
|
|
34772
|
+
*/ key: "buildSequencingEventListeners",
|
|
34773
|
+
value: function buildSequencingEventListeners(listeners) {
|
|
34774
|
+
var _this = this;
|
|
34775
|
+
return _object_spread_props(_object_spread({}, listeners), {
|
|
34776
|
+
onActivityDelivery: function onActivityDelivery(activity) {
|
|
34777
|
+
var _listeners_onActivityDelivery;
|
|
34778
|
+
_this.applyDeliveredActivityLaunchData(activity);
|
|
34779
|
+
listeners === null || listeners === void 0 ? void 0 : (_listeners_onActivityDelivery = listeners.onActivityDelivery) === null || _listeners_onActivityDelivery === void 0 ? void 0 : _listeners_onActivityDelivery.call(listeners, activity);
|
|
34780
|
+
}
|
|
34781
|
+
});
|
|
34782
|
+
}
|
|
34783
|
+
},
|
|
34784
|
+
{
|
|
34785
|
+
/**
|
|
33793
34786
|
* Get the sequencing service
|
|
33794
34787
|
* @return {SequencingService | null}
|
|
33795
34788
|
*/ key: "getSequencingService",
|
|
@@ -33801,10 +34794,13 @@ this.Scorm2004API = (function () {
|
|
|
33801
34794
|
/**
|
|
33802
34795
|
* Set sequencing event listeners
|
|
33803
34796
|
* @param {SequencingEventListeners} listeners
|
|
34797
|
+
*
|
|
34798
|
+
* @spec SCORM 2004 4th Ed. SN DB.2 - Content Delivery Environment Process
|
|
34799
|
+
* @spec SCORM 2004 4th Ed. RTE 4.2.5 / 4.2.17 - launch-static CMI data
|
|
33804
34800
|
*/ key: "setSequencingEventListeners",
|
|
33805
34801
|
value: function setSequencingEventListeners(listeners) {
|
|
33806
34802
|
if (this._sequencingService) {
|
|
33807
|
-
this._sequencingService.setEventListeners(listeners);
|
|
34803
|
+
this._sequencingService.setEventListeners(this.buildSequencingEventListeners(listeners));
|
|
33808
34804
|
}
|
|
33809
34805
|
}
|
|
33810
34806
|
},
|