scorm-again 3.1.3 → 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.
Files changed (34) hide show
  1. package/dist/esm/scorm-again.js +1257 -236
  2. package/dist/esm/scorm-again.js.map +1 -1
  3. package/dist/esm/scorm-again.min.js +1 -1
  4. package/dist/esm/scorm-again.min.js.map +1 -1
  5. package/dist/esm/scorm12.js +14 -3
  6. package/dist/esm/scorm12.js.map +1 -1
  7. package/dist/esm/scorm12.min.js +1 -1
  8. package/dist/esm/scorm12.min.js.map +1 -1
  9. package/dist/esm/scorm2004.js +1257 -236
  10. package/dist/esm/scorm2004.js.map +1 -1
  11. package/dist/esm/scorm2004.min.js +1 -1
  12. package/dist/esm/scorm2004.min.js.map +1 -1
  13. package/dist/scorm-again.js +1619 -449
  14. package/dist/scorm-again.js.map +1 -1
  15. package/dist/scorm-again.min.js +1 -1
  16. package/dist/scorm12.js +54 -14
  17. package/dist/scorm12.js.map +1 -1
  18. package/dist/scorm12.min.js +1 -1
  19. package/dist/scorm2004.js +1614 -444
  20. package/dist/scorm2004.js.map +1 -1
  21. package/dist/scorm2004.min.js +1 -1
  22. package/dist/types/Scorm2004API.d.ts +12 -0
  23. package/dist/types/cmi/scorm2004/completion_status_evaluation.d.ts +7 -0
  24. package/dist/types/cmi/scorm2004/sequencing/activity.d.ts +47 -5
  25. package/dist/types/cmi/scorm2004/sequencing/handlers/rte_data_transfer.d.ts +1 -0
  26. package/dist/types/cmi/scorm2004/sequencing/handlers/termination_handler.d.ts +1 -0
  27. package/dist/types/cmi/scorm2004/sequencing/objectives/global_objective_synchronizer.d.ts +17 -1
  28. package/dist/types/cmi/scorm2004/sequencing/sequencing_rules.d.ts +6 -1
  29. package/dist/types/cmi/scorm2004/sequencing/traversal/flow_traversal_service.d.ts +5 -2
  30. package/dist/types/constants/regex.d.ts +1 -0
  31. package/dist/types/types/api_types.d.ts +12 -0
  32. package/dist/types/types/sequencing_types.d.ts +13 -0
  33. package/dist/types/utilities/core.d.ts +4 -1
  34. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  (function () {
2
2
  'use strict';
3
3
 
4
- function _array_like_to_array$g(arr, len) {
4
+ function _array_like_to_array$h(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 @@
9
9
  function _array_with_holes$7(arr) {
10
10
  if (Array.isArray(arr)) return arr;
11
11
  }
12
- function _array_without_holes$a(arr) {
13
- if (Array.isArray(arr)) return _array_like_to_array$g(arr);
12
+ function _array_without_holes$b(arr) {
13
+ if (Array.isArray(arr)) return _array_like_to_array$h(arr);
14
14
  }
15
- function _iterable_to_array$a(iter) {
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$7(arr, i) {
@@ -42,22 +42,22 @@
42
42
  function _non_iterable_rest$7() {
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$a() {
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$7(arr, i) {
49
- return _array_with_holes$7(arr) || _iterable_to_array_limit$7(arr, i) || _unsupported_iterable_to_array$g(arr, i) || _non_iterable_rest$7();
49
+ return _array_with_holes$7(arr) || _iterable_to_array_limit$7(arr, i) || _unsupported_iterable_to_array$h(arr, i) || _non_iterable_rest$7();
50
50
  }
51
- function _to_consumable_array$a(arr) {
52
- return _array_without_holes$a(arr) || _iterable_to_array$a(arr) || _unsupported_iterable_to_array$g(arr) || _non_iterable_spread$a();
51
+ function _to_consumable_array$b(arr) {
52
+ return _array_without_holes$b(arr) || _iterable_to_array$b(arr) || _unsupported_iterable_to_array$h(arr) || _non_iterable_spread$b();
53
53
  }
54
- function _unsupported_iterable_to_array$g(o, minLen) {
54
+ function _unsupported_iterable_to_array$h(o, minLen) {
55
55
  if (!o) return;
56
- if (typeof o === "string") return _array_like_to_array$g(o, minLen);
56
+ if (typeof o === "string") return _array_like_to_array$h(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$g(o, minLen);
60
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$h(o, minLen);
61
61
  }
62
62
  var SECONDS_PER_SECOND = 1;
63
63
  var SECONDS_PER_MINUTE = 60;
@@ -267,15 +267,21 @@
267
267
  }
268
268
  return new RegExp(tester).test(str);
269
269
  }
270
- function memoize(fn, keyFn) {
270
+ function memoize(fn, keyFn, options) {
271
271
  var cache = /* @__PURE__ */ new Map();
272
272
  return function() {
273
273
  for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
274
274
  args[_key] = arguments[_key];
275
275
  }
276
- var key = keyFn ? keyFn.apply(void 0, _to_consumable_array$a(args)) : JSON.stringify(args);
276
+ var key = keyFn ? keyFn.apply(void 0, _to_consumable_array$b(args)) : JSON.stringify(args);
277
+ if ((options === null || options === void 0 ? void 0 : options.maxKeyLength) !== void 0 && key.length > options.maxKeyLength) {
278
+ return fn.apply(void 0, _to_consumable_array$b(args));
279
+ }
277
280
  return cache.has(key) ? cache.get(key) : function() {
278
- var result = fn.apply(void 0, _to_consumable_array$a(args));
281
+ var result = fn.apply(void 0, _to_consumable_array$b(args));
282
+ if ((options === null || options === void 0 ? void 0 : options.maxEntries) !== void 0 && cache.size >= options.maxEntries) {
283
+ cache.delete(cache.keys().next().value);
284
+ }
279
285
  cache.set(key, result);
280
286
  return result;
281
287
  }();
@@ -1096,7 +1102,7 @@
1096
1102
  }
1097
1103
  return target;
1098
1104
  }
1099
- function ownKeys$4(object, enumerableOnly) {
1105
+ function ownKeys$5(object, enumerableOnly) {
1100
1106
  var keys = Object.keys(object);
1101
1107
  if (Object.getOwnPropertySymbols) {
1102
1108
  var symbols = Object.getOwnPropertySymbols(object);
@@ -1104,12 +1110,12 @@
1104
1110
  }
1105
1111
  return keys;
1106
1112
  }
1107
- function _object_spread_props$4(target, source) {
1113
+ function _object_spread_props$5(target, source) {
1108
1114
  source = source != null ? source : {};
1109
1115
  if (Object.getOwnPropertyDescriptors) {
1110
1116
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
1111
1117
  } else {
1112
- ownKeys$4(Object(source)).forEach(function(key) {
1118
+ ownKeys$5(Object(source)).forEach(function(key) {
1113
1119
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1114
1120
  });
1115
1121
  }
@@ -1145,7 +1151,7 @@
1145
1151
  VALUE_OUT_OF_RANGE: 101,
1146
1152
  DEPENDENCY_NOT_ESTABLISHED: 101
1147
1153
  };
1148
- var scorm12_errors = _object_spread_props$4(_object_spread$g({}, global_errors), {
1154
+ var scorm12_errors = _object_spread_props$5(_object_spread$g({}, global_errors), {
1149
1155
  RETRIEVE_BEFORE_INIT: 301,
1150
1156
  STORE_BEFORE_INIT: 301,
1151
1157
  COMMIT_BEFORE_INIT: 301,
@@ -1165,7 +1171,7 @@
1165
1171
  VALUE_OUT_OF_RANGE: 405,
1166
1172
  DEPENDENCY_NOT_ESTABLISHED: 408
1167
1173
  });
1168
- var scorm2004_errors = _object_spread_props$4(_object_spread$g({}, global_errors), {
1174
+ var scorm2004_errors = _object_spread_props$5(_object_spread$g({}, global_errors), {
1169
1175
  INITIALIZATION_FAILED: 102,
1170
1176
  INITIALIZED: 103,
1171
1177
  TERMINATED: 104,
@@ -1855,6 +1861,7 @@
1855
1861
  * Subtag: 2-8 alphanumeric characters
1856
1862
  */ CMILang: "^([a-zA-Z]{1,8}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",
1857
1863
  /** 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}$)?$",
1864
+ /** 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})?})?((?!{.*$).*$)?$",
1858
1865
  /** CMILangcr - Language tag pattern with content */ CMILangcr: "^(({lang=([a-zA-Z]{1,8}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",
1859
1866
  /** 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})?)?$",
1860
1867
  /** 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}$)?$",
@@ -2890,12 +2897,6 @@
2890
2897
  var __publicField$19 = function __publicField(obj, key, value) {
2891
2898
  return __defNormalProp$19(obj, (typeof key === "undefined" ? "undefined" : _type_of$1a(key)) !== "symbol" ? key + "" : key, value);
2892
2899
  };
2893
- var RuleConditionOperator = /* @__PURE__ */ function(RuleConditionOperator2) {
2894
- RuleConditionOperator2["NOT"] = "not";
2895
- RuleConditionOperator2["AND"] = "and";
2896
- RuleConditionOperator2["OR"] = "or";
2897
- return RuleConditionOperator2;
2898
- }(RuleConditionOperator || {});
2899
2900
  var RuleActionType = /* @__PURE__ */ function(RuleActionType2) {
2900
2901
  RuleActionType2["SKIP"] = "skip";
2901
2902
  RuleActionType2["DISABLED"] = "disabled";
@@ -2910,6 +2911,82 @@
2910
2911
  RuleActionType2["EXIT"] = "exit";
2911
2912
  return RuleActionType2;
2912
2913
  }(RuleActionType || {});
2914
+ function kleeneNot(value) {
2915
+ if (value === "unknown") {
2916
+ return "unknown";
2917
+ }
2918
+ return !value;
2919
+ }
2920
+ function kleeneAnd(values) {
2921
+ var hasUnknown = false;
2922
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
2923
+ try {
2924
+ for(var _iterator = values[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
2925
+ var value = _step.value;
2926
+ if (value === false) {
2927
+ return false;
2928
+ }
2929
+ if (value === "unknown") {
2930
+ hasUnknown = true;
2931
+ }
2932
+ }
2933
+ } catch (err) {
2934
+ _didIteratorError = true;
2935
+ _iteratorError = err;
2936
+ } finally{
2937
+ try {
2938
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
2939
+ _iterator.return();
2940
+ }
2941
+ } finally{
2942
+ if (_didIteratorError) {
2943
+ throw _iteratorError;
2944
+ }
2945
+ }
2946
+ }
2947
+ return hasUnknown ? "unknown" : true;
2948
+ }
2949
+ function kleeneOr(values) {
2950
+ var hasUnknown = false;
2951
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
2952
+ try {
2953
+ for(var _iterator = values[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
2954
+ var value = _step.value;
2955
+ if (value === true) {
2956
+ return true;
2957
+ }
2958
+ if (value === "unknown") {
2959
+ hasUnknown = true;
2960
+ }
2961
+ }
2962
+ } catch (err) {
2963
+ _didIteratorError = true;
2964
+ _iteratorError = err;
2965
+ } finally{
2966
+ try {
2967
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
2968
+ _iterator.return();
2969
+ }
2970
+ } finally{
2971
+ if (_didIteratorError) {
2972
+ throw _iteratorError;
2973
+ }
2974
+ }
2975
+ }
2976
+ return hasUnknown ? "unknown" : false;
2977
+ }
2978
+ function combineRuleConditionResults(values, conditionCombination) {
2979
+ if (values.length === 0) {
2980
+ return false;
2981
+ }
2982
+ if (conditionCombination === "all" || conditionCombination === "and" /* AND */ ) {
2983
+ return kleeneAnd(values);
2984
+ }
2985
+ if (conditionCombination === "any" || conditionCombination === "or" /* OR */ ) {
2986
+ return kleeneOr(values);
2987
+ }
2988
+ return false;
2989
+ }
2913
2990
  var _RuleCondition = /*#__PURE__*/ function(BaseCMI) {
2914
2991
  _inherits$t(_RuleCondition, BaseCMI);
2915
2992
  function _RuleCondition() {
@@ -3015,53 +3092,74 @@
3015
3092
  /**
3016
3093
  * Evaluate the condition for an activity
3017
3094
  * @param {Activity} activity - The activity to evaluate the condition for
3018
- * @return {boolean} - True if the condition is met, false otherwise
3095
+ * @return {RuleConditionEvaluation} - True, false, or unknown per SCORM 2004 4th Ed.
3019
3096
  */ key: "evaluate",
3020
3097
  value: function evaluate(activity) {
3021
3098
  var result;
3099
+ var hasReferencedObjective = this._referencedObjective !== null;
3022
3100
  var referencedObjective = this.resolveReferencedObjective(activity);
3023
3101
  switch(this._condition){
3024
3102
  case "satisfied" /* SATISFIED */ :
3025
3103
  case "objectiveSatisfied" /* OBJECTIVE_SATISFIED */ :
3026
- if (referencedObjective) {
3027
- result = referencedObjective.satisfiedStatus === true;
3104
+ if (hasReferencedObjective && !referencedObjective) {
3105
+ result = false;
3106
+ } else if (referencedObjective) {
3107
+ result = referencedObjective.satisfiedStatusKnown || referencedObjective.progressStatus ? referencedObjective.satisfiedStatus === true : "unknown";
3108
+ } else if (activity.objectiveSatisfiedStatusKnown) {
3109
+ result = activity.objectiveSatisfiedStatus === true;
3110
+ } else if (activity.successStatus !== SuccessStatus.UNKNOWN) {
3111
+ result = activity.successStatus === SuccessStatus.PASSED;
3028
3112
  } else {
3029
- result = activity.successStatus === SuccessStatus.PASSED || activity.objectiveSatisfiedStatus === true;
3113
+ result = "unknown";
3030
3114
  }
3031
3115
  break;
3032
3116
  case "objectiveStatusKnown" /* OBJECTIVE_STATUS_KNOWN */ :
3033
- result = referencedObjective ? !!referencedObjective.measureStatus : !!activity.objectiveMeasureStatus;
3117
+ result = hasReferencedObjective && !referencedObjective ? false : referencedObjective ? !!referencedObjective.satisfiedStatusKnown : !!activity.objectiveSatisfiedStatusKnown;
3034
3118
  break;
3035
3119
  case "objectiveMeasureKnown" /* OBJECTIVE_MEASURE_KNOWN */ :
3036
- result = referencedObjective ? !!referencedObjective.measureStatus : !!activity.objectiveMeasureStatus;
3120
+ result = hasReferencedObjective && !referencedObjective ? false : referencedObjective ? !!referencedObjective.measureStatus : !!activity.objectiveMeasureStatus;
3037
3121
  break;
3038
3122
  case "objectiveMeasureGreaterThan" /* OBJECTIVE_MEASURE_GREATER_THAN */ :
3039
3123
  {
3124
+ if (hasReferencedObjective && !referencedObjective) {
3125
+ result = false;
3126
+ break;
3127
+ }
3040
3128
  var greaterThanValue = this._parameters.get("threshold") || 0;
3041
3129
  var measureStatus = referencedObjective ? referencedObjective.measureStatus : activity.objectiveMeasureStatus;
3042
3130
  var measureValue = referencedObjective ? referencedObjective.normalizedMeasure : activity.objectiveNormalizedMeasure;
3043
- result = !!measureStatus && measureValue > greaterThanValue;
3131
+ result = measureStatus ? measureValue > greaterThanValue : "unknown";
3044
3132
  break;
3045
3133
  }
3046
3134
  case "objectiveMeasureLessThan" /* OBJECTIVE_MEASURE_LESS_THAN */ :
3047
3135
  {
3136
+ if (hasReferencedObjective && !referencedObjective) {
3137
+ result = false;
3138
+ break;
3139
+ }
3048
3140
  var lessThanValue = this._parameters.get("threshold") || 0;
3049
3141
  var measureStatus1 = referencedObjective ? referencedObjective.measureStatus : activity.objectiveMeasureStatus;
3050
3142
  var measureValue1 = referencedObjective ? referencedObjective.normalizedMeasure : activity.objectiveNormalizedMeasure;
3051
- result = !!measureStatus1 && measureValue1 < lessThanValue;
3143
+ result = measureStatus1 ? measureValue1 < lessThanValue : "unknown";
3052
3144
  break;
3053
3145
  }
3054
3146
  case "completed" /* COMPLETED */ :
3055
3147
  case "activityCompleted" /* ACTIVITY_COMPLETED */ :
3056
- if (referencedObjective) {
3057
- result = referencedObjective.completionStatus === CompletionStatus.COMPLETED;
3148
+ if (hasReferencedObjective && !referencedObjective) {
3149
+ result = false;
3150
+ } else if (referencedObjective) {
3151
+ result = referencedObjective.completionStatus === CompletionStatus.UNKNOWN ? "unknown" : referencedObjective.completionStatus === CompletionStatus.COMPLETED;
3152
+ } else if (activity.completionStatus === CompletionStatus.UNKNOWN) {
3153
+ result = "unknown";
3058
3154
  } else {
3059
- result = activity.isCompleted;
3155
+ result = activity.completionStatus === CompletionStatus.COMPLETED;
3060
3156
  }
3061
3157
  break;
3062
3158
  case "progressKnown" /* PROGRESS_KNOWN */ :
3063
3159
  case "activityProgressKnown" /* ACTIVITY_PROGRESS_KNOWN */ :
3064
- if (referencedObjective) {
3160
+ if (hasReferencedObjective && !referencedObjective) {
3161
+ result = false;
3162
+ } else if (referencedObjective) {
3065
3163
  result = referencedObjective.completionStatus !== CompletionStatus.UNKNOWN;
3066
3164
  } else {
3067
3165
  result = activity.completionStatus !== "unknown";
@@ -3090,7 +3188,7 @@
3090
3188
  break;
3091
3189
  }
3092
3190
  if (this._operator === "not" /* NOT */ ) {
3093
- result = !result;
3191
+ result = kleeneNot(result);
3094
3192
  }
3095
3193
  return result;
3096
3194
  }
@@ -3339,19 +3437,9 @@
3339
3437
  * @return {boolean} - True if the rule conditions are met, false otherwise
3340
3438
  */ key: "evaluate",
3341
3439
  value: function evaluate(activity) {
3342
- if (this._conditions.length === 0) {
3343
- return true;
3344
- }
3345
- if (this._conditionCombination === "all" || this._conditionCombination === "and" /* AND */ ) {
3346
- return this._conditions.every(function(condition) {
3347
- return condition.evaluate(activity);
3348
- });
3349
- } else if (this._conditionCombination === "any" || this._conditionCombination === "or" /* OR */ ) {
3350
- return this._conditions.some(function(condition) {
3351
- return condition.evaluate(activity);
3352
- });
3353
- }
3354
- return false;
3440
+ return combineRuleConditionResults(this._conditions.map(function(condition) {
3441
+ return condition.evaluate(activity);
3442
+ }), this._conditionCombination) === true;
3355
3443
  }
3356
3444
  },
3357
3445
  {
@@ -4585,23 +4673,10 @@
4585
4673
  * Evaluates individual sequencing rule conditions
4586
4674
  * @param {Activity} activity - The activity to evaluate the rule for
4587
4675
  * @param {SequencingRule} rule - The rule to evaluate
4588
- * @return {boolean} - True if all rule conditions are met
4676
+ * @return {boolean} - True only when the rule evaluates to definite true
4589
4677
  */ key: "checkRuleSubprocess",
4590
4678
  value: function checkRuleSubprocess(activity, rule) {
4591
- if (rule.conditions.length === 0) {
4592
- return true;
4593
- }
4594
- var conditionCombination = rule.conditionCombination;
4595
- if (conditionCombination === "all" || conditionCombination === RuleConditionOperator.AND) {
4596
- return rule.conditions.every(function(condition) {
4597
- return condition.evaluate(activity);
4598
- });
4599
- } else if (conditionCombination === "any" || conditionCombination === RuleConditionOperator.OR) {
4600
- return rule.conditions.some(function(condition) {
4601
- return condition.evaluate(activity);
4602
- });
4603
- }
4604
- return false;
4679
+ return rule.evaluate(activity);
4605
4680
  }
4606
4681
  },
4607
4682
  {
@@ -5442,13 +5517,13 @@
5442
5517
  return SequencingControls;
5443
5518
  }(BaseCMI);
5444
5519
 
5445
- function _array_like_to_array$f(arr, len) {
5520
+ function _array_like_to_array$g(arr, len) {
5446
5521
  if (len == null || len > arr.length) len = arr.length;
5447
5522
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
5448
5523
  return arr2;
5449
5524
  }
5450
- function _array_without_holes$9(arr) {
5451
- if (Array.isArray(arr)) return _array_like_to_array$f(arr);
5525
+ function _array_without_holes$a(arr) {
5526
+ if (Array.isArray(arr)) return _array_like_to_array$g(arr);
5452
5527
  }
5453
5528
  function _class_call_check$18(instance, Constructor) {
5454
5529
  if (!(instance instanceof Constructor)) {
@@ -5468,22 +5543,22 @@
5468
5543
  if (staticProps) _defineProperties$18(Constructor, staticProps);
5469
5544
  return Constructor;
5470
5545
  }
5471
- function _iterable_to_array$9(iter) {
5546
+ function _iterable_to_array$a(iter) {
5472
5547
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
5473
5548
  }
5474
- function _non_iterable_spread$9() {
5549
+ function _non_iterable_spread$a() {
5475
5550
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5476
5551
  }
5477
- function _to_consumable_array$9(arr) {
5478
- return _array_without_holes$9(arr) || _iterable_to_array$9(arr) || _unsupported_iterable_to_array$f(arr) || _non_iterable_spread$9();
5552
+ function _to_consumable_array$a(arr) {
5553
+ return _array_without_holes$a(arr) || _iterable_to_array$a(arr) || _unsupported_iterable_to_array$g(arr) || _non_iterable_spread$a();
5479
5554
  }
5480
- function _unsupported_iterable_to_array$f(o, minLen) {
5555
+ function _unsupported_iterable_to_array$g(o, minLen) {
5481
5556
  if (!o) return;
5482
- if (typeof o === "string") return _array_like_to_array$f(o, minLen);
5557
+ if (typeof o === "string") return _array_like_to_array$g(o, minLen);
5483
5558
  var n = Object.prototype.toString.call(o).slice(8, -1);
5484
5559
  if (n === "Object" && o.constructor) n = o.constructor.name;
5485
5560
  if (n === "Map" || n === "Set") return Array.from(n);
5486
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$f(o, minLen);
5561
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$g(o, minLen);
5487
5562
  }
5488
5563
  var SelectionRandomization = /*#__PURE__*/ function() {
5489
5564
  function SelectionRandomization() {
@@ -5499,7 +5574,7 @@
5499
5574
  * @return {Activity[]} - The selected child activities
5500
5575
  */ function selectChildrenProcess(activity) {
5501
5576
  var controls = activity.sequencingControls;
5502
- var children = _to_consumable_array$9(activity.children);
5577
+ var children = _to_consumable_array$a(activity.children);
5503
5578
  if (controls.selectionTiming === SelectionTiming.NEVER) {
5504
5579
  return children;
5505
5580
  }
@@ -5568,7 +5643,7 @@
5568
5643
  */ function randomizeChildrenProcess(activity) {
5569
5644
  var _activity_children;
5570
5645
  var controls = activity.sequencingControls;
5571
- var children = _to_consumable_array$9(activity.children);
5646
+ var children = _to_consumable_array$a(activity.children);
5572
5647
  if (controls.randomizationTiming === RandomizationTiming.NEVER) {
5573
5648
  return children;
5574
5649
  }
@@ -5578,7 +5653,7 @@
5578
5653
  if (!controls.randomizeChildren) {
5579
5654
  return children;
5580
5655
  }
5581
- var randomizedChildren = _to_consumable_array$9(children);
5656
+ var randomizedChildren = _to_consumable_array$a(children);
5582
5657
  for(var i = randomizedChildren.length - 1; i > 0; i--){
5583
5658
  var j = Math.floor(Math.random() * (i + 1));
5584
5659
  var tempI = randomizedChildren[i];
@@ -5592,7 +5667,7 @@
5592
5667
  controls.reorderChildren = true;
5593
5668
  }
5594
5669
  activity.children.length = 0;
5595
- (_activity_children = activity.children).push.apply(_activity_children, _to_consumable_array$9(randomizedChildren));
5670
+ (_activity_children = activity.children).push.apply(_activity_children, _to_consumable_array$a(randomizedChildren));
5596
5671
  return randomizedChildren;
5597
5672
  }
5598
5673
  },
@@ -5727,13 +5802,17 @@
5727
5802
  * @param {Activity} fromActivity - The activity to flow from
5728
5803
  * @param {FlowSubprocessMode} direction - The flow direction
5729
5804
  * @return {FlowSubprocessResult} - Result containing the deliverable activity
5805
+ * @spec SN Book: SB.2.3 (Flow Subprocess) - preserves the SB.2.1 effective traversal direction for SB.2.2.
5806
+ * @spec SN Book: SB.2.2 (Flow Activity Traversal Subprocess) - evaluates candidates using the effective direction returned by SB.2.1.
5730
5807
  */ key: "flowSubprocess",
5731
5808
  value: function flowSubprocess(fromActivity, direction) {
5732
5809
  var candidateActivity = fromActivity;
5733
5810
  var firstIteration = true;
5734
5811
  var lastCandidateHadNoChildren = false;
5812
+ var currentDirection = direction;
5813
+ var forwardOnlyCluster = null;
5735
5814
  while(candidateActivity){
5736
- var traversalResult = this.flowTreeTraversalSubprocess(candidateActivity, direction, firstIteration);
5815
+ var traversalResult = this.flowTreeTraversalSubprocess(candidateActivity, currentDirection, firstIteration, forwardOnlyCluster);
5737
5816
  if (!traversalResult.activity) {
5738
5817
  var exceptionCode = null;
5739
5818
  if (traversalResult.exception) {
@@ -5745,12 +5824,17 @@
5745
5824
  }
5746
5825
  return new FlowSubprocessResult(candidateActivity, false, exceptionCode, traversalResult.endSequencingSession);
5747
5826
  }
5827
+ var effectiveDirection = traversalResult.direction || currentDirection;
5828
+ if (traversalResult.forwardOnlyCluster) {
5829
+ forwardOnlyCluster = traversalResult.forwardOnlyCluster;
5830
+ }
5748
5831
  lastCandidateHadNoChildren = traversalResult.activity.children.length > 0 && traversalResult.activity.getAvailableChildren().length === 0;
5749
- var deliverable = this.flowActivityTraversalSubprocess(traversalResult.activity, direction === FlowSubprocessMode.FORWARD, true, direction);
5832
+ var deliverable = this.flowActivityTraversalSubprocess(traversalResult.activity, effectiveDirection === FlowSubprocessMode.FORWARD, true, effectiveDirection);
5750
5833
  if (deliverable) {
5751
5834
  return new FlowSubprocessResult(deliverable, true, null, false);
5752
5835
  }
5753
5836
  candidateActivity = traversalResult.activity;
5837
+ currentDirection = effectiveDirection;
5754
5838
  firstIteration = false;
5755
5839
  }
5756
5840
  return new FlowSubprocessResult(null, false, null, false);
@@ -5763,12 +5847,14 @@
5763
5847
  * @param {Activity} fromActivity - The activity to traverse from
5764
5848
  * @param {FlowSubprocessMode} direction - The traversal direction
5765
5849
  * @param {boolean} skipChildren - Whether to skip checking children
5850
+ * @param {Activity | null} forwardTraversalBoundary - Cluster boundary for an SB.2.1 forwardOnly direction reversal
5766
5851
  * @return {FlowTreeTraversalResult} - The next activity and flags
5852
+ * @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.
5767
5853
  */ key: "flowTreeTraversalSubprocess",
5768
5854
  value: function flowTreeTraversalSubprocess(fromActivity, direction) {
5769
- var skipChildren = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
5855
+ var skipChildren = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false, forwardTraversalBoundary = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null;
5770
5856
  if (direction === FlowSubprocessMode.FORWARD) {
5771
- return this.traverseForward(fromActivity, skipChildren);
5857
+ return this.traverseForward(fromActivity, skipChildren, forwardTraversalBoundary);
5772
5858
  } else {
5773
5859
  return this.traverseBackward(fromActivity);
5774
5860
  }
@@ -5779,10 +5865,19 @@
5779
5865
  * Traverse forward in the activity tree
5780
5866
  * @param {Activity} fromActivity - Starting activity
5781
5867
  * @param {boolean} skipChildren - Whether to skip children
5868
+ * @param {Activity | null} forwardTraversalBoundary - Cluster boundary for an SB.2.1 forwardOnly direction reversal
5782
5869
  * @return {FlowTreeTraversalResult}
5870
+ * @spec SN Book: SB.2.1 (Flow Tree Traversal Subprocess) - a reversed Forward traversal from a forwardOnly cluster remains within that cluster.
5783
5871
  */ key: "traverseForward",
5784
5872
  value: function traverseForward(fromActivity, skipChildren) {
5785
- if (skipChildren && this.isActivityLastOverall(fromActivity)) {
5873
+ var forwardTraversalBoundary = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
5874
+ if (forwardTraversalBoundary && !this.isDescendantOfOrSelf(fromActivity, forwardTraversalBoundary)) {
5875
+ return {
5876
+ activity: null,
5877
+ endSequencingSession: false
5878
+ };
5879
+ }
5880
+ if (!forwardTraversalBoundary && skipChildren && this.isActivityLastOverall(fromActivity)) {
5786
5881
  if (this.activityTree.root) {
5787
5882
  this.terminateDescendentAttempts(this.activityTree.root);
5788
5883
  }
@@ -5810,6 +5905,12 @@
5810
5905
  endSequencingSession: false
5811
5906
  };
5812
5907
  }
5908
+ if (forwardTraversalBoundary && (current === forwardTraversalBoundary || current.parent === forwardTraversalBoundary)) {
5909
+ return {
5910
+ activity: null,
5911
+ endSequencingSession: false
5912
+ };
5913
+ }
5813
5914
  current = current.parent;
5814
5915
  }
5815
5916
  if (this.activityTree.root) {
@@ -5826,6 +5927,7 @@
5826
5927
  * Traverse backward in the activity tree
5827
5928
  * @param {Activity} fromActivity - Starting activity
5828
5929
  * @return {FlowTreeTraversalResult}
5930
+ * @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.
5829
5931
  */ key: "traverseBackward",
5830
5932
  value: function traverseBackward(fromActivity) {
5831
5933
  if (fromActivity.parent && fromActivity.parent.sequencingControls.forwardOnly) {
@@ -5837,10 +5939,7 @@
5837
5939
  }
5838
5940
  var previousSibling = this.activityTree.getPreviousSibling(fromActivity);
5839
5941
  if (previousSibling) {
5840
- return {
5841
- activity: this.getLastDescendant(previousSibling),
5842
- endSequencingSession: false
5843
- };
5942
+ return this.getBackwardTraversalEntry(previousSibling);
5844
5943
  }
5845
5944
  var current = fromActivity;
5846
5945
  var ancestorIterations = 0;
@@ -5851,10 +5950,7 @@
5851
5950
  }
5852
5951
  var parentPreviousSibling = this.activityTree.getPreviousSibling(current.parent);
5853
5952
  if (parentPreviousSibling) {
5854
- return {
5855
- activity: this.getLastDescendant(parentPreviousSibling),
5856
- endSequencingSession: false
5857
- };
5953
+ return this.getBackwardTraversalEntry(parentPreviousSibling);
5858
5954
  }
5859
5955
  current = current.parent;
5860
5956
  }
@@ -5866,28 +5962,59 @@
5866
5962
  },
5867
5963
  {
5868
5964
  /**
5869
- * Get the last descendant of an activity
5965
+ * Get the activity entered by backward traversal.
5870
5966
  * @param {Activity} activity - The activity
5871
- * @return {Activity} - The last descendant
5872
- */ key: "getLastDescendant",
5873
- value: function getLastDescendant(activity) {
5874
- var lastDescendant = activity;
5967
+ * @return {FlowTreeTraversalResult} - The entered activity and effective direction
5968
+ * @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.
5969
+ */ key: "getBackwardTraversalEntry",
5970
+ value: function getBackwardTraversalEntry(activity) {
5971
+ var enteredActivity = activity;
5875
5972
  var iterations = 0;
5876
5973
  var maxIterations = 1e4;
5877
5974
  while(true){
5878
5975
  if (++iterations > maxIterations) {
5879
- throw new Error("Infinite loop detected while getting last descendant");
5976
+ throw new Error("Infinite loop detected while getting backward traversal entry");
5880
5977
  }
5881
- this.ensureSelectionAndRandomization(lastDescendant);
5882
- var children = lastDescendant.getAvailableChildren();
5978
+ this.ensureSelectionAndRandomization(enteredActivity);
5979
+ var children = enteredActivity.getAvailableChildren();
5883
5980
  if (children.length === 0) {
5884
5981
  break;
5885
5982
  }
5983
+ if (enteredActivity.sequencingControls.forwardOnly) {
5984
+ return {
5985
+ activity: children[0] || null,
5986
+ endSequencingSession: false,
5987
+ direction: FlowSubprocessMode.FORWARD,
5988
+ forwardOnlyCluster: enteredActivity
5989
+ };
5990
+ }
5886
5991
  var lastChild = children[children.length - 1];
5887
5992
  if (!lastChild) break;
5888
- lastDescendant = lastChild;
5993
+ enteredActivity = lastChild;
5994
+ }
5995
+ return {
5996
+ activity: enteredActivity,
5997
+ endSequencingSession: false
5998
+ };
5999
+ }
6000
+ },
6001
+ {
6002
+ /**
6003
+ * Check whether an activity is the same as or beneath an ancestor.
6004
+ * @param {Activity} activity - The activity to check
6005
+ * @param {Activity} ancestor - The expected ancestor
6006
+ * @return {boolean} - True when activity is within ancestor
6007
+ * @spec SN Book: SB.2.1 (Flow Tree Traversal Subprocess) - bounds Forward traversal after a forwardOnly direction reversal to the entered cluster.
6008
+ */ key: "isDescendantOfOrSelf",
6009
+ value: function isDescendantOfOrSelf(activity, ancestor) {
6010
+ var current = activity;
6011
+ while(current){
6012
+ if (current === ancestor) {
6013
+ return true;
6014
+ }
6015
+ current = current.parent;
5889
6016
  }
5890
- return lastDescendant;
6017
+ return false;
5891
6018
  }
5892
6019
  },
5893
6020
  {
@@ -7529,7 +7656,7 @@
7529
7656
  }
7530
7657
  return target;
7531
7658
  }
7532
- function ownKeys$3(object, enumerableOnly) {
7659
+ function ownKeys$4(object, enumerableOnly) {
7533
7660
  var keys = Object.keys(object);
7534
7661
  if (Object.getOwnPropertySymbols) {
7535
7662
  var symbols = Object.getOwnPropertySymbols(object);
@@ -7537,12 +7664,12 @@
7537
7664
  }
7538
7665
  return keys;
7539
7666
  }
7540
- function _object_spread_props$3(target, source) {
7667
+ function _object_spread_props$4(target, source) {
7541
7668
  source = source != null ? source : {};
7542
7669
  if (Object.getOwnPropertyDescriptors) {
7543
7670
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
7544
7671
  } else {
7545
- ownKeys$3(Object(source)).forEach(function(key) {
7672
+ ownKeys$4(Object(source)).forEach(function(key) {
7546
7673
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
7547
7674
  });
7548
7675
  }
@@ -7826,7 +7953,7 @@
7826
7953
  method: "POST",
7827
7954
  mode: this.settings.fetchMode,
7828
7955
  body: body,
7829
- headers: _object_spread_props$3(_object_spread$d({}, this.settings.xhrHeaders), {
7956
+ headers: _object_spread_props$4(_object_spread$d({}, this.settings.xhrHeaders), {
7830
7957
  "Content-Type": contentType
7831
7958
  }),
7832
7959
  keepalive: true
@@ -9227,7 +9354,7 @@
9227
9354
  }
9228
9355
  return target;
9229
9356
  }
9230
- function ownKeys$2(object, enumerableOnly) {
9357
+ function ownKeys$3(object, enumerableOnly) {
9231
9358
  var keys = Object.keys(object);
9232
9359
  if (Object.getOwnPropertySymbols) {
9233
9360
  var symbols = Object.getOwnPropertySymbols(object);
@@ -9235,12 +9362,12 @@
9235
9362
  }
9236
9363
  return keys;
9237
9364
  }
9238
- function _object_spread_props$2(target, source) {
9365
+ function _object_spread_props$3(target, source) {
9239
9366
  source = source != null ? source : {};
9240
9367
  if (Object.getOwnPropertyDescriptors) {
9241
9368
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
9242
9369
  } else {
9243
- ownKeys$2(Object(source)).forEach(function(key) {
9370
+ ownKeys$3(Object(source)).forEach(function(key) {
9244
9371
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
9245
9372
  });
9246
9373
  }
@@ -9713,7 +9840,7 @@
9713
9840
  method: "POST",
9714
9841
  mode: this.settings.fetchMode,
9715
9842
  body: JSON.stringify(processedData),
9716
- headers: _object_spread_props$2(_object_spread$c({}, this.settings.xhrHeaders), {
9843
+ headers: _object_spread_props$3(_object_spread$c({}, this.settings.xhrHeaders), {
9717
9844
  "Content-Type": this.settings.commitRequestDataType
9718
9845
  })
9719
9846
  };
@@ -9902,6 +10029,10 @@
9902
10029
  function(CMIElement, value, regexPattern, errorCode, _errorClass, allowEmptyString) {
9903
10030
  var valueKey = typeof value === "string" ? value : "[".concat(typeof value === "undefined" ? "undefined" : _type_of$T(value), "]");
9904
10031
  return "".concat(CMIElement, ":").concat(valueKey, ":").concat(regexPattern, ":").concat(errorCode, ":").concat(allowEmptyString || false);
10032
+ }, // Normal capped CMI values and regexes fit within 2000 characters; large uncapped values bypass caching.
10033
+ {
10034
+ maxEntries: 1e3,
10035
+ maxKeyLength: 2e3
9905
10036
  });
9906
10037
  var checkValidRange = memoize(function(CMIElement, value, rangePattern, errorCode, errorClass) {
9907
10038
  var ranges = rangePattern.split("#");
@@ -9924,6 +10055,8 @@
9924
10055
  // since it can't be stringified and doesn't affect the validation result
9925
10056
  function(CMIElement, value, rangePattern, errorCode, _errorClass) {
9926
10057
  return "".concat(CMIElement, ":").concat(value, ":").concat(rangePattern, ":").concat(errorCode);
10058
+ }, {
10059
+ maxEntries: 1e3
9927
10060
  });
9928
10061
 
9929
10062
  function check2004ValidFormat(CMIElement, value, regexPattern, allowEmptyString) {
@@ -10592,13 +10725,13 @@
10592
10725
  return RollupRules;
10593
10726
  }(BaseCMI);
10594
10727
 
10595
- function _array_like_to_array$e(arr, len) {
10728
+ function _array_like_to_array$f(arr, len) {
10596
10729
  if (len == null || len > arr.length) len = arr.length;
10597
10730
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
10598
10731
  return arr2;
10599
10732
  }
10600
- function _array_without_holes$8(arr) {
10601
- if (Array.isArray(arr)) return _array_like_to_array$e(arr);
10733
+ function _array_without_holes$9(arr) {
10734
+ if (Array.isArray(arr)) return _array_like_to_array$f(arr);
10602
10735
  }
10603
10736
  function _assert_this_initialized$q(self) {
10604
10737
  if (self === void 0) {
@@ -10685,10 +10818,10 @@
10685
10818
  return left instanceof right;
10686
10819
  }
10687
10820
  }
10688
- function _iterable_to_array$8(iter) {
10821
+ function _iterable_to_array$9(iter) {
10689
10822
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
10690
10823
  }
10691
- function _non_iterable_spread$8() {
10824
+ function _non_iterable_spread$9() {
10692
10825
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
10693
10826
  }
10694
10827
  function _object_spread$b(target) {
@@ -10726,20 +10859,20 @@
10726
10859
  }
10727
10860
  return object;
10728
10861
  }
10729
- function _to_consumable_array$8(arr) {
10730
- return _array_without_holes$8(arr) || _iterable_to_array$8(arr) || _unsupported_iterable_to_array$e(arr) || _non_iterable_spread$8();
10862
+ function _to_consumable_array$9(arr) {
10863
+ return _array_without_holes$9(arr) || _iterable_to_array$9(arr) || _unsupported_iterable_to_array$f(arr) || _non_iterable_spread$9();
10731
10864
  }
10732
10865
  function _type_of$R(obj) {
10733
10866
  "@swc/helpers - typeof";
10734
10867
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
10735
10868
  }
10736
- function _unsupported_iterable_to_array$e(o, minLen) {
10869
+ function _unsupported_iterable_to_array$f(o, minLen) {
10737
10870
  if (!o) return;
10738
- if (typeof o === "string") return _array_like_to_array$e(o, minLen);
10871
+ if (typeof o === "string") return _array_like_to_array$f(o, minLen);
10739
10872
  var n = Object.prototype.toString.call(o).slice(8, -1);
10740
10873
  if (n === "Object" && o.constructor) n = o.constructor.name;
10741
10874
  if (n === "Map" || n === "Set") return Array.from(n);
10742
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$e(o, minLen);
10875
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$f(o, minLen);
10743
10876
  }
10744
10877
  function _is_native_reflect_construct$q() {
10745
10878
  try {
@@ -10778,6 +10911,12 @@
10778
10911
  // objectives. It serves as a validity gate for other synced properties.
10779
10912
  __publicField$R(this, "_measureStatus", false);
10780
10913
  __publicField$R(this, "_normalizedMeasure", 0);
10914
+ __publicField$R(this, "_rawScore", "");
10915
+ __publicField$R(this, "_rawScoreKnown", false);
10916
+ __publicField$R(this, "_minScore", "");
10917
+ __publicField$R(this, "_minScoreKnown", false);
10918
+ __publicField$R(this, "_maxScore", "");
10919
+ __publicField$R(this, "_maxScoreKnown", false);
10781
10920
  __publicField$R(this, "_progressMeasure", 0);
10782
10921
  __publicField$R(this, "_progressMeasureStatus", false);
10783
10922
  __publicField$R(this, "_completionStatus", CompletionStatus.UNKNOWN);
@@ -10787,11 +10926,14 @@
10787
10926
  __publicField$R(this, "_normalizedMeasureDirty", false);
10788
10927
  __publicField$R(this, "_completionStatusDirty", false);
10789
10928
  __publicField$R(this, "_progressMeasureDirty", false);
10929
+ __publicField$R(this, "_rawScoreDirty", false);
10930
+ __publicField$R(this, "_minScoreDirty", false);
10931
+ __publicField$R(this, "_maxScoreDirty", false);
10790
10932
  this._id = id;
10791
10933
  this._description = (_options_description = options.description) !== null && _options_description !== void 0 ? _options_description : null;
10792
10934
  this._satisfiedByMeasure = (_options_satisfiedByMeasure = options.satisfiedByMeasure) !== null && _options_satisfiedByMeasure !== void 0 ? _options_satisfiedByMeasure : false;
10793
10935
  this._minNormalizedMeasure = (_options_minNormalizedMeasure = options.minNormalizedMeasure) !== null && _options_minNormalizedMeasure !== void 0 ? _options_minNormalizedMeasure : null;
10794
- this._mapInfo = options.mapInfo ? _to_consumable_array$8(options.mapInfo) : [];
10936
+ this._mapInfo = options.mapInfo ? _to_consumable_array$9(options.mapInfo) : [];
10795
10937
  this._isPrimary = (_options_isPrimary = options.isPrimary) !== null && _options_isPrimary !== void 0 ? _options_isPrimary : false;
10796
10938
  }
10797
10939
  _create_class$V(ActivityObjective, [
@@ -10831,7 +10973,7 @@
10831
10973
  return this._mapInfo;
10832
10974
  },
10833
10975
  set: function set(mapInfo) {
10834
- this._mapInfo = _to_consumable_array$8(mapInfo);
10976
+ this._mapInfo = _to_consumable_array$9(mapInfo);
10835
10977
  }
10836
10978
  },
10837
10979
  {
@@ -10852,6 +10994,8 @@
10852
10994
  if (this._satisfiedStatus !== value) {
10853
10995
  this._satisfiedStatus = value;
10854
10996
  this._satisfiedStatusDirty = true;
10997
+ this._satisfiedStatusKnown = true;
10998
+ this._progressStatus = true;
10855
10999
  }
10856
11000
  }
10857
11001
  },
@@ -10885,6 +11029,120 @@
10885
11029
  }
10886
11030
  }
10887
11031
  },
11032
+ {
11033
+ key: "rawScore",
11034
+ get: /**
11035
+ * Return the known raw score value held for ADLSEQ objective score mapping.
11036
+ *
11037
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw score mapInfo
11038
+ */ function get() {
11039
+ return this._rawScore;
11040
+ },
11041
+ set: /**
11042
+ * Store the RTE raw score associated with this objective.
11043
+ *
11044
+ * @spec SCORM 2004 4th Ed. SN 3.10.3 / ADLSEQ objectives extension - raw score mapInfo
11045
+ */ function set(value) {
11046
+ if (this._rawScore !== value) {
11047
+ this._rawScore = value;
11048
+ this._rawScoreDirty = true;
11049
+ }
11050
+ this._rawScoreKnown = value !== "";
11051
+ }
11052
+ },
11053
+ {
11054
+ key: "rawScoreKnown",
11055
+ get: /**
11056
+ * Return whether this objective's raw score is known.
11057
+ *
11058
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw score known state
11059
+ */ function get() {
11060
+ return this._rawScoreKnown;
11061
+ },
11062
+ set: /**
11063
+ * Set whether this objective's raw score is known.
11064
+ *
11065
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw score known state
11066
+ */ function set(value) {
11067
+ this._rawScoreKnown = value;
11068
+ }
11069
+ },
11070
+ {
11071
+ key: "minScore",
11072
+ get: /**
11073
+ * Return the known minimum score value held for ADLSEQ objective score mapping.
11074
+ *
11075
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - min score mapInfo
11076
+ */ function get() {
11077
+ return this._minScore;
11078
+ },
11079
+ set: /**
11080
+ * Store the RTE minimum score associated with this objective.
11081
+ *
11082
+ * @spec SCORM 2004 4th Ed. SN 3.10.3 / ADLSEQ objectives extension - min score mapInfo
11083
+ */ function set(value) {
11084
+ if (this._minScore !== value) {
11085
+ this._minScore = value;
11086
+ this._minScoreDirty = true;
11087
+ }
11088
+ this._minScoreKnown = value !== "";
11089
+ }
11090
+ },
11091
+ {
11092
+ key: "minScoreKnown",
11093
+ get: /**
11094
+ * Return whether this objective's minimum score is known.
11095
+ *
11096
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - min score known state
11097
+ */ function get() {
11098
+ return this._minScoreKnown;
11099
+ },
11100
+ set: /**
11101
+ * Set whether this objective's minimum score is known.
11102
+ *
11103
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - min score known state
11104
+ */ function set(value) {
11105
+ this._minScoreKnown = value;
11106
+ }
11107
+ },
11108
+ {
11109
+ key: "maxScore",
11110
+ get: /**
11111
+ * Return the known maximum score value held for ADLSEQ objective score mapping.
11112
+ *
11113
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - max score mapInfo
11114
+ */ function get() {
11115
+ return this._maxScore;
11116
+ },
11117
+ set: /**
11118
+ * Store the RTE maximum score associated with this objective.
11119
+ *
11120
+ * @spec SCORM 2004 4th Ed. SN 3.10.3 / ADLSEQ objectives extension - max score mapInfo
11121
+ */ function set(value) {
11122
+ if (this._maxScore !== value) {
11123
+ this._maxScore = value;
11124
+ this._maxScoreDirty = true;
11125
+ }
11126
+ this._maxScoreKnown = value !== "";
11127
+ }
11128
+ },
11129
+ {
11130
+ key: "maxScoreKnown",
11131
+ get: /**
11132
+ * Return whether this objective's maximum score is known.
11133
+ *
11134
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - max score known state
11135
+ */ function get() {
11136
+ return this._maxScoreKnown;
11137
+ },
11138
+ set: /**
11139
+ * Set whether this objective's maximum score is known.
11140
+ *
11141
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - max score known state
11142
+ */ function set(value) {
11143
+ this._maxScoreKnown = value;
11144
+ }
11145
+ },
10888
11146
  {
10889
11147
  key: "progressMeasure",
10890
11148
  get: function get() {
@@ -10928,7 +11186,11 @@
10928
11186
  }
10929
11187
  },
10930
11188
  {
10931
- key: "isDirty",
11189
+ /**
11190
+ * Report whether a local objective field has changed since the last global write.
11191
+ *
11192
+ * @spec SCORM 2004 4th Ed. SN 3.10.3 / ADLSEQ objectives extension - write maps use known local objective data
11193
+ */ key: "isDirty",
10932
11194
  value: function isDirty(property) {
10933
11195
  switch(property){
10934
11196
  case "satisfiedStatus":
@@ -10939,11 +11201,21 @@
10939
11201
  return this._completionStatusDirty;
10940
11202
  case "progressMeasure":
10941
11203
  return this._progressMeasureDirty;
11204
+ case "rawScore":
11205
+ return this._rawScoreDirty;
11206
+ case "minScore":
11207
+ return this._minScoreDirty;
11208
+ case "maxScore":
11209
+ return this._maxScoreDirty;
10942
11210
  }
10943
11211
  }
10944
11212
  },
10945
11213
  {
10946
- key: "clearDirty",
11214
+ /**
11215
+ * Clear a local objective dirty flag after a successful global write.
11216
+ *
11217
+ * @spec SCORM 2004 4th Ed. SN 3.10.3 / ADLSEQ objectives extension - write maps update global objective state
11218
+ */ key: "clearDirty",
10947
11219
  value: function clearDirty(property) {
10948
11220
  switch(property){
10949
11221
  case "satisfiedStatus":
@@ -10958,16 +11230,33 @@
10958
11230
  case "progressMeasure":
10959
11231
  this._progressMeasureDirty = false;
10960
11232
  break;
11233
+ case "rawScore":
11234
+ this._rawScoreDirty = false;
11235
+ break;
11236
+ case "minScore":
11237
+ this._minScoreDirty = false;
11238
+ break;
11239
+ case "maxScore":
11240
+ this._maxScoreDirty = false;
11241
+ break;
10961
11242
  }
10962
11243
  }
10963
11244
  },
10964
11245
  {
10965
- key: "clearAllDirty",
11246
+ /**
11247
+ * Clear all write-map dirty flags for this objective.
11248
+ *
11249
+ * @spec SCORM 2004 4th Ed. SN 3.10.3 - objective mapInfo writes are field-specific
11250
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - score mapInfo writes are field-specific
11251
+ */ key: "clearAllDirty",
10966
11252
  value: function clearAllDirty() {
10967
11253
  this._satisfiedStatusDirty = false;
10968
11254
  this._normalizedMeasureDirty = false;
10969
11255
  this._completionStatusDirty = false;
10970
11256
  this._progressMeasureDirty = false;
11257
+ this._rawScoreDirty = false;
11258
+ this._minScoreDirty = false;
11259
+ this._maxScoreDirty = false;
10971
11260
  }
10972
11261
  },
10973
11262
  {
@@ -10979,6 +11268,8 @@
10979
11268
  * @param satisfiedStatus - The satisfied status from CMI
10980
11269
  * @param normalizedMeasure - The normalized measure from CMI
10981
11270
  * @param measureStatus - Whether measure is valid
11271
+ *
11272
+ * @spec SCORM 2004 4th Ed. RTE-to-SN Data Transfer - objective satisfaction and measure transfer
10982
11273
  */ key: "initializeFromCMI",
10983
11274
  value: function initializeFromCMI(satisfiedStatus, normalizedMeasure, measureStatus) {
10984
11275
  this._satisfiedStatus = satisfiedStatus;
@@ -10989,12 +11280,86 @@
10989
11280
  }
10990
11281
  },
10991
11282
  {
10992
- key: "resetState",
11283
+ /**
11284
+ * Initialize raw/min/max objective score values from RTE data transfer.
11285
+ *
11286
+ * @spec SCORM 2004 4th Ed. RTE-to-SN Data Transfer - objective score transfer
11287
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max score mapInfo writes
11288
+ */ key: "initializeScoreFromCMI",
11289
+ value: function initializeScoreFromCMI(score) {
11290
+ if (score.rawScore !== void 0 && score.rawScore !== "") {
11291
+ this._rawScore = score.rawScore;
11292
+ this._rawScoreKnown = true;
11293
+ this._rawScoreDirty = true;
11294
+ }
11295
+ if (score.minScore !== void 0 && score.minScore !== "") {
11296
+ this._minScore = score.minScore;
11297
+ this._minScoreKnown = true;
11298
+ this._minScoreDirty = true;
11299
+ }
11300
+ if (score.maxScore !== void 0 && score.maxScore !== "") {
11301
+ this._maxScore = score.maxScore;
11302
+ this._maxScoreKnown = true;
11303
+ this._maxScoreDirty = true;
11304
+ }
11305
+ }
11306
+ },
11307
+ {
11308
+ /**
11309
+ * Apply read-mapped global objective state without marking the values dirty.
11310
+ *
11311
+ * @spec SCORM 2004 4th Ed. SN 3.10.3 - read maps provide access to global objective state
11312
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - score read maps are access-only
11313
+ */ key: "applyReadMappedState",
11314
+ value: function applyReadMappedState(state) {
11315
+ if (state.satisfiedStatus !== void 0) {
11316
+ this._satisfiedStatus = state.satisfiedStatus;
11317
+ this._satisfiedStatusKnown = true;
11318
+ this._progressStatus = true;
11319
+ }
11320
+ if (state.normalizedMeasure !== void 0) {
11321
+ this._normalizedMeasure = state.normalizedMeasure;
11322
+ this._measureStatus = true;
11323
+ }
11324
+ if (state.completionStatus !== void 0) {
11325
+ this._completionStatus = state.completionStatus;
11326
+ }
11327
+ if (state.progressMeasure !== void 0) {
11328
+ this._progressMeasure = state.progressMeasure;
11329
+ this._progressMeasureStatus = true;
11330
+ }
11331
+ if (state.rawScore !== void 0) {
11332
+ this._rawScore = state.rawScore;
11333
+ this._rawScoreKnown = true;
11334
+ }
11335
+ if (state.minScore !== void 0) {
11336
+ this._minScore = state.minScore;
11337
+ this._minScoreKnown = true;
11338
+ }
11339
+ if (state.maxScore !== void 0) {
11340
+ this._maxScore = state.maxScore;
11341
+ this._maxScoreKnown = true;
11342
+ }
11343
+ }
11344
+ },
11345
+ {
11346
+ /**
11347
+ * Reset local objective state for a fresh activity attempt.
11348
+ *
11349
+ * @spec SCORM 2004 4th Ed. SN 3.10 Objective Description - unknown objective state before tracking data exists
11350
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - score map fields are unknown until transferred or read
11351
+ */ key: "resetState",
10993
11352
  value: function resetState() {
10994
11353
  this._satisfiedStatus = false;
10995
11354
  this._satisfiedStatusKnown = false;
10996
11355
  this._measureStatus = false;
10997
11356
  this._normalizedMeasure = 0;
11357
+ this._rawScore = "";
11358
+ this._rawScoreKnown = false;
11359
+ this._minScore = "";
11360
+ this._minScoreKnown = false;
11361
+ this._maxScore = "";
11362
+ this._maxScoreKnown = false;
10998
11363
  this._progressMeasure = 0;
10999
11364
  this._progressMeasureStatus = false;
11000
11365
  this._completionStatus = CompletionStatus.UNKNOWN;
@@ -11003,7 +11368,11 @@
11003
11368
  }
11004
11369
  },
11005
11370
  {
11006
- key: "updateFromActivity",
11371
+ /**
11372
+ * Copy primary activity objective state back into the primary objective model.
11373
+ *
11374
+ * @spec SCORM 2004 4th Ed. RTE-to-SN Data Transfer - primary objective state is available to sequencing
11375
+ */ key: "updateFromActivity",
11007
11376
  value: function updateFromActivity(activity) {
11008
11377
  if (this._satisfiedStatus !== activity.objectiveSatisfiedStatus) {
11009
11378
  this._satisfiedStatus = activity.objectiveSatisfiedStatus;
@@ -11027,12 +11396,16 @@
11027
11396
  }
11028
11397
  },
11029
11398
  {
11030
- key: "applyToActivity",
11399
+ /**
11400
+ * Apply primary objective state to the owning activity for sequencing rules and rollup.
11401
+ *
11402
+ * @spec SCORM 2004 4th Ed. SN 3.10 Objective Description - primary objective contributes activity state
11403
+ */ key: "applyToActivity",
11031
11404
  value: function applyToActivity(activity) {
11032
11405
  if (!this._isPrimary) {
11033
11406
  return;
11034
11407
  }
11035
- activity.setPrimaryObjectiveState(this._satisfiedStatus, this._measureStatus, this._normalizedMeasure, this._progressMeasure, this._progressMeasureStatus, this._completionStatus);
11408
+ activity.setPrimaryObjectiveState(this._satisfiedStatus, this._measureStatus, this._normalizedMeasure, this._progressMeasure, this._progressMeasureStatus, this._completionStatus, this._progressStatus || this._satisfiedStatusKnown);
11036
11409
  }
11037
11410
  }
11038
11411
  ]);
@@ -11384,7 +11757,7 @@
11384
11757
  (_this__children = this._children).splice.apply(_this__children, [
11385
11758
  0,
11386
11759
  this._children.length
11387
- ].concat(_to_consumable_array$8(reordered)));
11760
+ ].concat(_to_consumable_array$9(reordered)));
11388
11761
  }
11389
11762
  }
11390
11763
  },
@@ -12269,7 +12642,7 @@
12269
12642
  set: /**
12270
12643
  * Setter for primary objective
12271
12644
  * @param {ActivityObjective | null} objective
12272
- */ function set(objective) {
12645
+ */ function set(objective) {
12273
12646
  this._primaryObjective = objective;
12274
12647
  if (this._primaryObjective) {
12275
12648
  this._primaryObjective.isPrimary = true;
@@ -12297,8 +12670,8 @@
12297
12670
  set: /**
12298
12671
  * Replace objectives collection
12299
12672
  * @param {ActivityObjective[]} objectives
12300
- */ function set(objectives) {
12301
- this._objectives = _to_consumable_array$8(objectives);
12673
+ */ function set(objectives) {
12674
+ this._objectives = _to_consumable_array$9(objectives);
12302
12675
  this.syncPrimaryObjectiveCollection();
12303
12676
  }
12304
12677
  },
@@ -12337,7 +12710,7 @@
12337
12710
  }
12338
12711
  this._objectives = [
12339
12712
  this._primaryObjective
12340
- ].concat(_to_consumable_array$8(this._objectives));
12713
+ ].concat(_to_consumable_array$9(this._objectives));
12341
12714
  }
12342
12715
  },
12343
12716
  {
@@ -12432,11 +12805,12 @@
12432
12805
  {
12433
12806
  key: "setPrimaryObjectiveState",
12434
12807
  value: function setPrimaryObjectiveState(satisfiedStatus, measureStatus, normalizedMeasure, progressMeasure, progressMeasureStatus, completionStatus) {
12808
+ var objectiveProgressStatus = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : true;
12435
12809
  if (this._objectiveSatisfiedStatus !== satisfiedStatus) {
12436
12810
  this._objectiveSatisfiedStatus = satisfiedStatus;
12437
12811
  this._objectiveSatisfiedStatusDirty = true;
12438
12812
  }
12439
- this._objectiveSatisfiedStatusKnown = true;
12813
+ this._objectiveSatisfiedStatusKnown = objectiveProgressStatus;
12440
12814
  if (this._objectiveMeasureStatus !== measureStatus) {
12441
12815
  this._objectiveMeasureStatus = measureStatus;
12442
12816
  this._objectiveMeasureStatusDirty = true;
@@ -12455,11 +12829,18 @@
12455
12829
  this._primaryObjective.progressMeasure = progressMeasure;
12456
12830
  this._primaryObjective.progressMeasureStatus = progressMeasureStatus;
12457
12831
  this._primaryObjective.completionStatus = completionStatus;
12832
+ this._primaryObjective.satisfiedStatusKnown = objectiveProgressStatus;
12833
+ this._primaryObjective.progressStatus = objectiveProgressStatus;
12458
12834
  }
12459
12835
  }
12460
12836
  },
12461
12837
  {
12462
- key: "getObjectiveStateSnapshot",
12838
+ /**
12839
+ * Snapshot objective state for sequencing persistence.
12840
+ *
12841
+ * @spec SCORM 2004 4th Ed. SN 3.10 Objective Description - objective state persists across attempts
12842
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - score-map state persists with objective state
12843
+ */ key: "getObjectiveStateSnapshot",
12463
12844
  value: function getObjectiveStateSnapshot() {
12464
12845
  var _this_progressMeasure;
12465
12846
  var primarySnapshot = this._primaryObjective ? {
@@ -12467,6 +12848,12 @@
12467
12848
  satisfiedStatus: this.objectiveSatisfiedStatus,
12468
12849
  measureStatus: this.objectiveMeasureStatus,
12469
12850
  normalizedMeasure: this.objectiveNormalizedMeasure,
12851
+ rawScore: this._primaryObjective.rawScore,
12852
+ rawScoreKnown: this._primaryObjective.rawScoreKnown,
12853
+ minScore: this._primaryObjective.minScore,
12854
+ minScoreKnown: this._primaryObjective.minScoreKnown,
12855
+ maxScore: this._primaryObjective.maxScore,
12856
+ maxScoreKnown: this._primaryObjective.maxScoreKnown,
12470
12857
  progressMeasure: (_this_progressMeasure = this.progressMeasure) !== null && _this_progressMeasure !== void 0 ? _this_progressMeasure : 0,
12471
12858
  progressMeasureStatus: this.progressMeasureStatus,
12472
12859
  progressStatus: this._primaryObjective.progressStatus,
@@ -12480,6 +12867,12 @@
12480
12867
  satisfiedStatus: objective.satisfiedStatus,
12481
12868
  measureStatus: objective.measureStatus,
12482
12869
  normalizedMeasure: objective.normalizedMeasure,
12870
+ rawScore: objective.rawScore,
12871
+ rawScoreKnown: objective.rawScoreKnown,
12872
+ minScore: objective.minScore,
12873
+ minScoreKnown: objective.minScoreKnown,
12874
+ maxScore: objective.maxScore,
12875
+ maxScoreKnown: objective.maxScoreKnown,
12483
12876
  progressMeasure: objective.progressMeasure,
12484
12877
  progressMeasureStatus: objective.progressMeasureStatus,
12485
12878
  progressStatus: objective.progressStatus,
@@ -12495,7 +12888,12 @@
12495
12888
  }
12496
12889
  },
12497
12890
  {
12498
- key: "applyObjectiveStateSnapshot",
12891
+ /**
12892
+ * Restore objective state from a sequencing persistence snapshot.
12893
+ *
12894
+ * @spec SCORM 2004 4th Ed. SN 3.10 Objective Description - persisted objective state restores sequencing state
12895
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - persisted score-map state restores objective score fields
12896
+ */ key: "applyObjectiveStateSnapshot",
12499
12897
  value: function applyObjectiveStateSnapshot(snapshot) {
12500
12898
  if (snapshot.primary) {
12501
12899
  var primary = this.getObjectiveById(snapshot.primary.id);
@@ -12504,7 +12902,8 @@
12504
12902
  var state = snapshot.primary;
12505
12903
  primary.objective.satisfiedByMeasure = (_state_satisfiedByMeasure = state.satisfiedByMeasure) !== null && _state_satisfiedByMeasure !== void 0 ? _state_satisfiedByMeasure : primary.objective.satisfiedByMeasure;
12506
12904
  primary.objective.minNormalizedMeasure = state.minNormalizedMeasure !== void 0 ? state.minNormalizedMeasure : primary.objective.minNormalizedMeasure;
12507
- this.setPrimaryObjectiveState(state.satisfiedStatus, state.measureStatus, state.normalizedMeasure, state.progressMeasure, state.progressMeasureStatus, state.completionStatus);
12905
+ this.setPrimaryObjectiveState(state.satisfiedStatus, state.measureStatus, state.normalizedMeasure, state.progressMeasure, state.progressMeasureStatus, state.completionStatus, state.progressStatus);
12906
+ this.applyObjectiveScoreSnapshot(primary.objective, state);
12508
12907
  }
12509
12908
  }
12510
12909
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
@@ -12521,6 +12920,7 @@
12521
12920
  objective.progressMeasure = state1.progressMeasure;
12522
12921
  objective.progressMeasureStatus = state1.progressMeasureStatus;
12523
12922
  objective.completionStatus = state1.completionStatus;
12923
+ this.applyObjectiveScoreSnapshot(objective, state1);
12524
12924
  objective.satisfiedByMeasure = (_state_satisfiedByMeasure1 = state1.satisfiedByMeasure) !== null && _state_satisfiedByMeasure1 !== void 0 ? _state_satisfiedByMeasure1 : objective.satisfiedByMeasure;
12525
12925
  objective.minNormalizedMeasure = state1.minNormalizedMeasure !== void 0 ? state1.minNormalizedMeasure : objective.minNormalizedMeasure;
12526
12926
  }
@@ -12543,6 +12943,26 @@
12543
12943
  },
12544
12944
  {
12545
12945
  /**
12946
+ * Restore known raw/min/max score fields from an objective state snapshot.
12947
+ *
12948
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max score known flags restore independently
12949
+ */ key: "applyObjectiveScoreSnapshot",
12950
+ value: function applyObjectiveScoreSnapshot(objective, state) {
12951
+ var scoreState = {};
12952
+ if (state.rawScoreKnown) {
12953
+ scoreState.rawScore = state.rawScore;
12954
+ }
12955
+ if (state.minScoreKnown) {
12956
+ scoreState.minScore = state.minScore;
12957
+ }
12958
+ if (state.maxScoreKnown) {
12959
+ scoreState.maxScore = state.maxScore;
12960
+ }
12961
+ objective.applyReadMappedState(scoreState);
12962
+ }
12963
+ },
12964
+ {
12965
+ /**
12546
12966
  * Get available children with selection and randomization applied
12547
12967
  * @return {Activity[]}
12548
12968
  */ key: "getAvailableChildren",
@@ -12903,7 +13323,7 @@
12903
13323
  minProgressMeasure: this._minProgressMeasure,
12904
13324
  progressWeight: this._progressWeight,
12905
13325
  attemptCompletionAmountStatus: this._attemptCompletionAmountStatus,
12906
- hideLmsUi: _to_consumable_array$8(this._hideLmsUi),
13326
+ hideLmsUi: _to_consumable_array$9(this._hideLmsUi),
12907
13327
  auxiliaryResources: this._auxiliaryResources.map(function(resource) {
12908
13328
  return _object_spread$b({}, resource);
12909
13329
  }),
@@ -12961,7 +13381,7 @@
12961
13381
  {
12962
13382
  key: "addAuxiliaryResource",
12963
13383
  value: function addAuxiliaryResource(resource) {
12964
- this.auxiliaryResources = _to_consumable_array$8(this._auxiliaryResources).concat([
13384
+ this.auxiliaryResources = _to_consumable_array$9(this._auxiliaryResources).concat([
12965
13385
  resource
12966
13386
  ]);
12967
13387
  }
@@ -12989,7 +13409,7 @@
12989
13409
  * Getter for hideLmsUi directives
12990
13410
  * @return {HideLmsUiItem[]}
12991
13411
  */ function get() {
12992
- return _to_consumable_array$8(this._hideLmsUi);
13412
+ return _to_consumable_array$9(this._hideLmsUi);
12993
13413
  },
12994
13414
  set: /**
12995
13415
  * Setter for hideLmsUi directives
@@ -14542,6 +14962,7 @@
14542
14962
  }
14543
14963
  function _create_class$N(Constructor, protoProps, staticProps) {
14544
14964
  if (protoProps) _defineProperties$N(Constructor.prototype, protoProps);
14965
+ if (staticProps) _defineProperties$N(Constructor, staticProps);
14545
14966
  return Constructor;
14546
14967
  }
14547
14968
  function _instanceof$9(left, right) {
@@ -14689,8 +15110,14 @@
14689
15110
  *
14690
15111
  * @param activity - The activity to process
14691
15112
  * @param globalObjectives - Global objective map
15113
+ *
15114
+ * @spec SCORM 2004 4th Ed. SN 3.10.3 - write mapInfo transfers local objective state to global objectives
15115
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max score write maps
14692
15116
  */ key: "syncGlobalObjectivesWritePhase",
14693
15117
  value: function syncGlobalObjectivesWritePhase(activity, globalObjectives) {
15118
+ if (!this.canWriteGlobalObjectives(activity)) {
15119
+ return;
15120
+ }
14694
15121
  var objectives = activity.getAllObjectives();
14695
15122
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
14696
15123
  try {
@@ -14699,38 +15126,54 @@
14699
15126
  var mapInfos = objective.mapInfo.length > 0 ? objective.mapInfo : [
14700
15127
  this.createDefaultMapInfo(objective)
14701
15128
  ];
15129
+ var dirtyFieldsToClear = /* @__PURE__ */ new Set();
14702
15130
  var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
14703
15131
  try {
14704
15132
  for(var _iterator1 = mapInfos[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
14705
15133
  var mapInfo = _step1.value;
14706
15134
  var targetId = mapInfo.targetObjectiveID || objective.id;
14707
15135
  var globalObjective = this.ensureGlobalObjectiveEntry(globalObjectives, targetId, objective);
14708
- if (mapInfo.writeSatisfiedStatus && objective.measureStatus && objective.isDirty("satisfiedStatus")) {
15136
+ if (mapInfo.writeSatisfiedStatus && this.hasKnownSatisfiedStatus(objective) && objective.isDirty("satisfiedStatus")) {
14709
15137
  globalObjective.satisfiedStatus = objective.satisfiedStatus;
14710
15138
  globalObjective.satisfiedStatusKnown = true;
14711
- objective.clearDirty("satisfiedStatus");
15139
+ dirtyFieldsToClear.add("satisfiedStatus");
14712
15140
  }
14713
15141
  if (mapInfo.writeNormalizedMeasure && objective.measureStatus && objective.isDirty("normalizedMeasure")) {
14714
15142
  globalObjective.normalizedMeasure = objective.normalizedMeasure;
14715
15143
  globalObjective.normalizedMeasureKnown = true;
14716
- objective.clearDirty("normalizedMeasure");
14717
- if (globalObjective.satisfiedByMeasure || objective.satisfiedByMeasure) {
15144
+ dirtyFieldsToClear.add("normalizedMeasure");
15145
+ if (mapInfo.writeSatisfiedStatus && objective.satisfiedByMeasure) {
14718
15146
  var _ref, _objective_minNormalizedMeasure;
14719
15147
  var threshold = (_ref = (_objective_minNormalizedMeasure = objective.minNormalizedMeasure) !== null && _objective_minNormalizedMeasure !== void 0 ? _objective_minNormalizedMeasure : activity.scaledPassingScore) !== null && _ref !== void 0 ? _ref : 0.7;
14720
15148
  globalObjective.satisfiedStatus = objective.normalizedMeasure >= threshold;
14721
15149
  globalObjective.satisfiedStatusKnown = true;
14722
- objective.clearDirty("satisfiedStatus");
15150
+ dirtyFieldsToClear.add("satisfiedStatus");
14723
15151
  }
14724
15152
  }
14725
15153
  if (mapInfo.writeCompletionStatus && objective.completionStatus !== CompletionStatus.UNKNOWN && objective.isDirty("completionStatus")) {
14726
15154
  globalObjective.completionStatus = objective.completionStatus;
14727
15155
  globalObjective.completionStatusKnown = true;
14728
- objective.clearDirty("completionStatus");
15156
+ dirtyFieldsToClear.add("completionStatus");
15157
+ }
15158
+ if (mapInfo.writeRawScore && objective.rawScoreKnown && objective.isDirty("rawScore")) {
15159
+ globalObjective.rawScore = objective.rawScore;
15160
+ globalObjective.rawScoreKnown = true;
15161
+ dirtyFieldsToClear.add("rawScore");
15162
+ }
15163
+ if (mapInfo.writeMinScore && objective.minScoreKnown && objective.isDirty("minScore")) {
15164
+ globalObjective.minScore = objective.minScore;
15165
+ globalObjective.minScoreKnown = true;
15166
+ dirtyFieldsToClear.add("minScore");
15167
+ }
15168
+ if (mapInfo.writeMaxScore && objective.maxScoreKnown && objective.isDirty("maxScore")) {
15169
+ globalObjective.maxScore = objective.maxScore;
15170
+ globalObjective.maxScoreKnown = true;
15171
+ dirtyFieldsToClear.add("maxScore");
14729
15172
  }
14730
15173
  if (mapInfo.writeProgressMeasure && objective.progressMeasureStatus && objective.isDirty("progressMeasure")) {
14731
15174
  globalObjective.progressMeasure = objective.progressMeasure;
14732
15175
  globalObjective.progressMeasureKnown = true;
14733
- objective.clearDirty("progressMeasure");
15176
+ dirtyFieldsToClear.add("progressMeasure");
14734
15177
  }
14735
15178
  if (mapInfo.updateAttemptData) {
14736
15179
  this.updateActivityAttemptData(activity, globalObjective, objective);
@@ -14750,6 +15193,26 @@
14750
15193
  }
14751
15194
  }
14752
15195
  }
15196
+ var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = undefined;
15197
+ try {
15198
+ for(var _iterator2 = dirtyFieldsToClear[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true){
15199
+ var property = _step2.value;
15200
+ objective.clearDirty(property);
15201
+ }
15202
+ } catch (err) {
15203
+ _didIteratorError2 = true;
15204
+ _iteratorError2 = err;
15205
+ } finally{
15206
+ try {
15207
+ if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
15208
+ _iterator2.return();
15209
+ }
15210
+ } finally{
15211
+ if (_didIteratorError2) {
15212
+ throw _iteratorError2;
15213
+ }
15214
+ }
15215
+ }
14753
15216
  }
14754
15217
  } catch (err) {
14755
15218
  _didIteratorError = true;
@@ -14773,6 +15236,9 @@
14773
15236
  *
14774
15237
  * @param activity - The activity to process
14775
15238
  * @param globalObjectives - Global objective map
15239
+ *
15240
+ * @spec SCORM 2004 4th Ed. SN 3.10.3 - read mapInfo transfers global objective state into the local view
15241
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max score read maps
14776
15242
  */ key: "syncGlobalObjectivesReadPhase",
14777
15243
  value: function syncGlobalObjectivesReadPhase(activity, globalObjectives) {
14778
15244
  var objectives = activity.getAllObjectives();
@@ -14792,26 +15258,8 @@
14792
15258
  var globalObjective = globalObjectives.get(targetId);
14793
15259
  if (!globalObjective) continue;
14794
15260
  var isPrimary = objective.isPrimary;
14795
- if (mapInfo.readSatisfiedStatus && globalObjective.satisfiedStatusKnown) {
14796
- objective.satisfiedStatus = globalObjective.satisfiedStatus;
14797
- objective.measureStatus = true;
14798
- }
14799
- if (mapInfo.readNormalizedMeasure && globalObjective.normalizedMeasureKnown) {
14800
- objective.normalizedMeasure = globalObjective.normalizedMeasure;
14801
- objective.measureStatus = true;
14802
- if (globalObjective.satisfiedByMeasure || objective.satisfiedByMeasure) {
14803
- var _ref, _objective_minNormalizedMeasure;
14804
- var threshold = (_ref = (_objective_minNormalizedMeasure = objective.minNormalizedMeasure) !== null && _objective_minNormalizedMeasure !== void 0 ? _objective_minNormalizedMeasure : activity.scaledPassingScore) !== null && _ref !== void 0 ? _ref : 0.7;
14805
- objective.satisfiedStatus = globalObjective.normalizedMeasure >= threshold;
14806
- }
14807
- }
14808
- if (mapInfo.readProgressMeasure && globalObjective.progressMeasureKnown) {
14809
- objective.progressMeasure = globalObjective.progressMeasure;
14810
- objective.progressMeasureStatus = true;
14811
- }
14812
- if (mapInfo.readCompletionStatus && globalObjective.completionStatusKnown) {
14813
- objective.completionStatus = globalObjective.completionStatus;
14814
- }
15261
+ var readState = GlobalObjectiveSynchronizer.getGlobalObjectiveReadState(activity, objective, mapInfo, globalObjective);
15262
+ this.applyGlobalObjectiveReadState(objective, readState);
14815
15263
  if (isPrimary) {
14816
15264
  objective.applyToActivity(activity);
14817
15265
  }
@@ -14918,59 +15366,58 @@
14918
15366
  * @param objective - The objective to sync
14919
15367
  * @param mapInfo - Map info for this objective
14920
15368
  * @param globalObjective - The global objective
15369
+ *
15370
+ * @spec SCORM 2004 4th Ed. SN 3.10.3 - objective mapInfo read/write synchronization
15371
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - score mapInfo synchronization
14921
15372
  */ key: "syncObjectiveState",
14922
15373
  value: function syncObjectiveState(activity, objective, mapInfo, globalObjective) {
14923
15374
  try {
14924
15375
  var _this_eventCallback, _this;
14925
15376
  var isPrimary = objective.isPrimary;
14926
15377
  var localObjective = this.getLocalObjectiveState(activity, objective, isPrimary);
14927
- if (mapInfo.readSatisfiedStatus && globalObjective.satisfiedStatusKnown) {
14928
- objective.satisfiedStatus = globalObjective.satisfiedStatus;
14929
- objective.measureStatus = true;
14930
- }
14931
- if (mapInfo.readNormalizedMeasure && globalObjective.normalizedMeasureKnown) {
14932
- objective.normalizedMeasure = globalObjective.normalizedMeasure;
14933
- objective.measureStatus = true;
14934
- if (globalObjective.satisfiedByMeasure || objective.satisfiedByMeasure) {
14935
- var _ref, _objective_minNormalizedMeasure;
14936
- var threshold = (_ref = (_objective_minNormalizedMeasure = objective.minNormalizedMeasure) !== null && _objective_minNormalizedMeasure !== void 0 ? _objective_minNormalizedMeasure : activity.scaledPassingScore) !== null && _ref !== void 0 ? _ref : 0.7;
14937
- objective.satisfiedStatus = globalObjective.normalizedMeasure >= threshold;
14938
- }
14939
- }
14940
- if (mapInfo.readProgressMeasure && globalObjective.progressMeasureKnown) {
14941
- objective.progressMeasure = globalObjective.progressMeasure;
14942
- objective.progressMeasureStatus = true;
14943
- }
14944
- if (mapInfo.readCompletionStatus && globalObjective.completionStatusKnown) {
14945
- objective.completionStatus = globalObjective.completionStatus;
14946
- }
15378
+ var readState = GlobalObjectiveSynchronizer.getGlobalObjectiveReadState(activity, objective, mapInfo, globalObjective);
15379
+ this.applyGlobalObjectiveReadState(objective, readState);
14947
15380
  if (objective.isPrimary) {
14948
15381
  objective.applyToActivity(activity);
14949
15382
  }
14950
- if (mapInfo.writeSatisfiedStatus && objective.measureStatus) {
14951
- globalObjective.satisfiedStatus = objective.satisfiedStatus;
14952
- globalObjective.satisfiedStatusKnown = true;
14953
- }
14954
- if (mapInfo.writeNormalizedMeasure && objective.measureStatus) {
14955
- globalObjective.normalizedMeasure = objective.normalizedMeasure;
14956
- globalObjective.normalizedMeasureKnown = true;
14957
- if (globalObjective.satisfiedByMeasure || objective.satisfiedByMeasure) {
14958
- var _ref1, _objective_minNormalizedMeasure1;
14959
- var threshold1 = (_ref1 = (_objective_minNormalizedMeasure1 = objective.minNormalizedMeasure) !== null && _objective_minNormalizedMeasure1 !== void 0 ? _objective_minNormalizedMeasure1 : activity.scaledPassingScore) !== null && _ref1 !== void 0 ? _ref1 : 0.7;
14960
- globalObjective.satisfiedStatus = objective.normalizedMeasure >= threshold1;
15383
+ if (this.canWriteGlobalObjectives(activity)) {
15384
+ if (mapInfo.writeSatisfiedStatus && this.hasKnownSatisfiedStatus(objective)) {
15385
+ globalObjective.satisfiedStatus = objective.satisfiedStatus;
14961
15386
  globalObjective.satisfiedStatusKnown = true;
14962
15387
  }
14963
- }
14964
- if (mapInfo.writeCompletionStatus && objective.completionStatus !== CompletionStatus.UNKNOWN) {
14965
- globalObjective.completionStatus = objective.completionStatus;
14966
- globalObjective.completionStatusKnown = true;
14967
- }
14968
- if (mapInfo.writeProgressMeasure && objective.progressMeasureStatus) {
14969
- globalObjective.progressMeasure = objective.progressMeasure;
14970
- globalObjective.progressMeasureKnown = true;
14971
- }
14972
- if (mapInfo.updateAttemptData) {
14973
- this.updateActivityAttemptData(activity, globalObjective, objective);
15388
+ if (mapInfo.writeNormalizedMeasure && objective.measureStatus) {
15389
+ globalObjective.normalizedMeasure = objective.normalizedMeasure;
15390
+ globalObjective.normalizedMeasureKnown = true;
15391
+ if (mapInfo.writeSatisfiedStatus && objective.satisfiedByMeasure) {
15392
+ var _ref, _objective_minNormalizedMeasure;
15393
+ var threshold = (_ref = (_objective_minNormalizedMeasure = objective.minNormalizedMeasure) !== null && _objective_minNormalizedMeasure !== void 0 ? _objective_minNormalizedMeasure : activity.scaledPassingScore) !== null && _ref !== void 0 ? _ref : 0.7;
15394
+ globalObjective.satisfiedStatus = objective.normalizedMeasure >= threshold;
15395
+ globalObjective.satisfiedStatusKnown = true;
15396
+ }
15397
+ }
15398
+ if (mapInfo.writeCompletionStatus && objective.completionStatus !== CompletionStatus.UNKNOWN) {
15399
+ globalObjective.completionStatus = objective.completionStatus;
15400
+ globalObjective.completionStatusKnown = true;
15401
+ }
15402
+ if (mapInfo.writeRawScore && objective.rawScoreKnown) {
15403
+ globalObjective.rawScore = objective.rawScore;
15404
+ globalObjective.rawScoreKnown = true;
15405
+ }
15406
+ if (mapInfo.writeMinScore && objective.minScoreKnown) {
15407
+ globalObjective.minScore = objective.minScore;
15408
+ globalObjective.minScoreKnown = true;
15409
+ }
15410
+ if (mapInfo.writeMaxScore && objective.maxScoreKnown) {
15411
+ globalObjective.maxScore = objective.maxScore;
15412
+ globalObjective.maxScoreKnown = true;
15413
+ }
15414
+ if (mapInfo.writeProgressMeasure && objective.progressMeasureStatus) {
15415
+ globalObjective.progressMeasure = objective.progressMeasure;
15416
+ globalObjective.progressMeasureKnown = true;
15417
+ }
15418
+ if (mapInfo.updateAttemptData) {
15419
+ this.updateActivityAttemptData(activity, globalObjective, objective);
15420
+ }
14974
15421
  }
14975
15422
  (_this_eventCallback = (_this = this).eventCallback) === null || _this_eventCallback === void 0 ? void 0 : _this_eventCallback.call(_this, "objective_synchronized", {
14976
15423
  activityId: activity.id,
@@ -14992,25 +15439,47 @@
14992
15439
  },
14993
15440
  {
14994
15441
  /**
15442
+ * Apply read-mapped state to an objective without marking those fields dirty.
15443
+ *
15444
+ * @spec SCORM 2004 4th Ed. SN 3.10.3 - read maps are access to global state, not local writes
15445
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - score read maps do not imply score writes
15446
+ */ key: "applyGlobalObjectiveReadState",
15447
+ value: function applyGlobalObjectiveReadState(objective, readState) {
15448
+ objective.applyReadMappedState(readState);
15449
+ }
15450
+ },
15451
+ {
15452
+ /**
14995
15453
  * Ensure global objective entry exists
14996
15454
  *
14997
15455
  * @param globalObjectives - Global objectives map
14998
15456
  * @param targetId - Target objective ID
14999
15457
  * @param objective - Source objective
15000
15458
  * @returns The global objective entry
15459
+ *
15460
+ * @spec SCORM 2004 4th Ed. SN 3.10.3 - global objective entries hold mapped objective state
15461
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - global entries hold score-map state
15001
15462
  */ key: "ensureGlobalObjectiveEntry",
15002
15463
  value: function ensureGlobalObjectiveEntry(globalObjectives, targetId, objective) {
15003
15464
  if (!globalObjectives.has(targetId)) {
15004
15465
  globalObjectives.set(targetId, {
15005
15466
  id: targetId,
15006
- satisfiedStatus: objective.satisfiedStatus,
15007
- satisfiedStatusKnown: objective.satisfiedStatusKnown,
15008
- normalizedMeasure: objective.normalizedMeasure,
15009
- normalizedMeasureKnown: objective.measureStatus,
15010
- progressMeasure: objective.progressMeasure,
15011
- progressMeasureKnown: objective.progressMeasureStatus,
15012
- completionStatus: objective.completionStatus,
15013
- completionStatusKnown: objective.completionStatus !== CompletionStatus.UNKNOWN,
15467
+ satisfiedStatus: false,
15468
+ satisfiedStatusKnown: false,
15469
+ normalizedMeasure: 0,
15470
+ normalizedMeasureKnown: false,
15471
+ // @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - score fields
15472
+ // remain unknown until their corresponding write map explicitly writes them.
15473
+ rawScore: "",
15474
+ rawScoreKnown: false,
15475
+ minScore: "",
15476
+ minScoreKnown: false,
15477
+ maxScore: "",
15478
+ maxScoreKnown: false,
15479
+ progressMeasure: 0,
15480
+ progressMeasureKnown: false,
15481
+ completionStatus: CompletionStatus.UNKNOWN,
15482
+ completionStatusKnown: false,
15014
15483
  satisfiedByMeasure: objective.satisfiedByMeasure,
15015
15484
  minNormalizedMeasure: objective.minNormalizedMeasure
15016
15485
  });
@@ -15027,6 +15496,9 @@
15027
15496
  *
15028
15497
  * @param objective - The objective to create default map info for
15029
15498
  * @returns Default map info
15499
+ *
15500
+ * @spec SCORM 2004 4th Ed. SN 3.10.3 - mapInfo defaults are applied before objective synchronization
15501
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - score maps require explicit read/write flags
15030
15502
  */ key: "createDefaultMapInfo",
15031
15503
  value: function createDefaultMapInfo(objective) {
15032
15504
  return {
@@ -15039,18 +15511,50 @@
15039
15511
  writeCompletionStatus: true,
15040
15512
  readProgressMeasure: false,
15041
15513
  writeProgressMeasure: true,
15514
+ readRawScore: false,
15515
+ writeRawScore: false,
15516
+ readMinScore: false,
15517
+ writeMinScore: false,
15518
+ readMaxScore: false,
15519
+ writeMaxScore: false,
15042
15520
  updateAttemptData: objective.isPrimary
15043
15521
  };
15044
15522
  }
15045
15523
  },
15046
15524
  {
15047
15525
  /**
15526
+ * Return whether the local objective has known satisfaction state to write.
15527
+ *
15528
+ * @spec SCORM 2004 4th Ed. SN 4.2.1 Tracking Model - Objective Progress
15529
+ * Status identifies whether Objective Satisfied Status is known; Objective
15530
+ * Measure Status is independent measure knowledge.
15531
+ */ key: "hasKnownSatisfiedStatus",
15532
+ value: function hasKnownSatisfiedStatus(objective) {
15533
+ return objective.progressStatus || objective.satisfiedStatusKnown;
15534
+ }
15535
+ },
15536
+ {
15537
+ /**
15538
+ * Return whether this activity is allowed to write tracked state to globals.
15539
+ *
15540
+ * @spec SCORM 2004 4th Ed. SN 3.13.1 Tracked - when False, the LMS
15541
+ * "does not initialize, manage or access any tracking status information".
15542
+ */ key: "canWriteGlobalObjectives",
15543
+ value: function canWriteGlobalObjectives(activity) {
15544
+ return activity.sequencingControls.tracked !== false;
15545
+ }
15546
+ },
15547
+ {
15548
+ /**
15048
15549
  * Get local objective state
15049
15550
  *
15050
15551
  * @param activity - The activity
15051
15552
  * @param objective - The objective
15052
15553
  * @param isPrimary - Whether this is the primary objective
15053
15554
  * @returns Local objective state
15555
+ *
15556
+ * @spec SCORM 2004 4th Ed. SN 3.10 Objective Description - local objective state used for synchronization
15557
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - local score fields are part of mapped objective state
15054
15558
  */ key: "getLocalObjectiveState",
15055
15559
  value: function getLocalObjectiveState(activity, objective, isPrimary) {
15056
15560
  if (isPrimary) {
@@ -15059,6 +15563,12 @@
15059
15563
  satisfiedStatus: activity.objectiveSatisfiedStatus,
15060
15564
  measureStatus: activity.objectiveMeasureStatus,
15061
15565
  normalizedMeasure: activity.objectiveNormalizedMeasure,
15566
+ rawScore: objective.rawScore,
15567
+ rawScoreKnown: objective.rawScoreKnown,
15568
+ minScore: objective.minScore,
15569
+ minScoreKnown: objective.minScoreKnown,
15570
+ maxScore: objective.maxScore,
15571
+ maxScoreKnown: objective.maxScoreKnown,
15062
15572
  progressMeasure: activity.progressMeasure,
15063
15573
  progressMeasureStatus: activity.progressMeasureStatus,
15064
15574
  completionStatus: activity.completionStatus,
@@ -15070,6 +15580,12 @@
15070
15580
  satisfiedStatus: objective.satisfiedStatus,
15071
15581
  measureStatus: objective.measureStatus,
15072
15582
  normalizedMeasure: objective.normalizedMeasure,
15583
+ rawScore: objective.rawScore,
15584
+ rawScoreKnown: objective.rawScoreKnown,
15585
+ minScore: objective.minScore,
15586
+ minScoreKnown: objective.minScoreKnown,
15587
+ maxScore: objective.maxScore,
15588
+ maxScoreKnown: objective.maxScoreKnown,
15073
15589
  progressMeasure: objective.progressMeasure,
15074
15590
  progressMeasureStatus: objective.progressMeasureStatus,
15075
15591
  completionStatus: objective.completionStatus,
@@ -15094,7 +15610,7 @@
15094
15610
  return rule.action === "completed" || rule.action === "incomplete";
15095
15611
  });
15096
15612
  if (globalObjective.satisfiedStatusKnown && globalObjective.satisfiedStatus) {
15097
- if (!hasCompletionRollupRules && (activity.completionStatus === CompletionStatus.UNKNOWN || activity.completionStatus === CompletionStatus.INCOMPLETE)) {
15613
+ if (!hasCompletionRollupRules && !activity.sequencingControls.completionSetByContent && !activity.attemptProgressStatus && (activity.completionStatus === CompletionStatus.UNKNOWN || activity.completionStatus === CompletionStatus.INCOMPLETE)) {
15098
15614
  activity.completionStatus = CompletionStatus.COMPLETED;
15099
15615
  }
15100
15616
  if (activity.successStatus === "unknown") {
@@ -15135,17 +15651,56 @@
15135
15651
  }
15136
15652
  }
15137
15653
  }
15654
+ ], [
15655
+ {
15656
+ key: "getGlobalObjectiveReadState",
15657
+ value: /**
15658
+ * Project a global objective through one local objective's read mapInfo.
15659
+ *
15660
+ * @spec SCORM 2004 4th Ed. SN 3.10.3 - read maps provide access to mapped global objective fields
15661
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max score read maps are independent fields
15662
+ */ function getGlobalObjectiveReadState(activity, objective, mapInfo, globalObjective) {
15663
+ var readState = {};
15664
+ if (mapInfo.readSatisfiedStatus && globalObjective.satisfiedStatusKnown) {
15665
+ readState.satisfiedStatus = globalObjective.satisfiedStatus;
15666
+ }
15667
+ if (mapInfo.readNormalizedMeasure && globalObjective.normalizedMeasureKnown) {
15668
+ readState.normalizedMeasure = globalObjective.normalizedMeasure;
15669
+ if (objective.satisfiedByMeasure) {
15670
+ var _ref, _objective_minNormalizedMeasure;
15671
+ var threshold = (_ref = (_objective_minNormalizedMeasure = objective.minNormalizedMeasure) !== null && _objective_minNormalizedMeasure !== void 0 ? _objective_minNormalizedMeasure : activity.scaledPassingScore) !== null && _ref !== void 0 ? _ref : 0.7;
15672
+ readState.satisfiedStatus = globalObjective.normalizedMeasure >= threshold;
15673
+ }
15674
+ }
15675
+ if (mapInfo.readCompletionStatus && globalObjective.completionStatusKnown) {
15676
+ readState.completionStatus = globalObjective.completionStatus;
15677
+ }
15678
+ if (mapInfo.readProgressMeasure && globalObjective.progressMeasureKnown) {
15679
+ readState.progressMeasure = globalObjective.progressMeasure;
15680
+ }
15681
+ if (mapInfo.readRawScore && globalObjective.rawScoreKnown) {
15682
+ readState.rawScore = globalObjective.rawScore;
15683
+ }
15684
+ if (mapInfo.readMinScore && globalObjective.minScoreKnown) {
15685
+ readState.minScore = globalObjective.minScore;
15686
+ }
15687
+ if (mapInfo.readMaxScore && globalObjective.maxScoreKnown) {
15688
+ readState.maxScore = globalObjective.maxScore;
15689
+ }
15690
+ return readState;
15691
+ }
15692
+ }
15138
15693
  ]);
15139
15694
  return GlobalObjectiveSynchronizer;
15140
15695
  }();
15141
15696
 
15142
- function _array_like_to_array$d(arr, len) {
15697
+ function _array_like_to_array$e(arr, len) {
15143
15698
  if (len == null || len > arr.length) len = arr.length;
15144
15699
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
15145
15700
  return arr2;
15146
15701
  }
15147
- function _array_without_holes$7(arr) {
15148
- if (Array.isArray(arr)) return _array_like_to_array$d(arr);
15702
+ function _array_without_holes$8(arr) {
15703
+ if (Array.isArray(arr)) return _array_like_to_array$e(arr);
15149
15704
  }
15150
15705
  function _class_call_check$M(instance, Constructor) {
15151
15706
  if (!(instance instanceof Constructor)) {
@@ -15173,26 +15728,26 @@
15173
15728
  return left instanceof right;
15174
15729
  }
15175
15730
  }
15176
- function _iterable_to_array$7(iter) {
15731
+ function _iterable_to_array$8(iter) {
15177
15732
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
15178
15733
  }
15179
- function _non_iterable_spread$7() {
15734
+ function _non_iterable_spread$8() {
15180
15735
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
15181
15736
  }
15182
- function _to_consumable_array$7(arr) {
15183
- return _array_without_holes$7(arr) || _iterable_to_array$7(arr) || _unsupported_iterable_to_array$d(arr) || _non_iterable_spread$7();
15737
+ function _to_consumable_array$8(arr) {
15738
+ return _array_without_holes$8(arr) || _iterable_to_array$8(arr) || _unsupported_iterable_to_array$e(arr) || _non_iterable_spread$8();
15184
15739
  }
15185
15740
  function _type_of$J(obj) {
15186
15741
  "@swc/helpers - typeof";
15187
15742
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
15188
15743
  }
15189
- function _unsupported_iterable_to_array$d(o, minLen) {
15744
+ function _unsupported_iterable_to_array$e(o, minLen) {
15190
15745
  if (!o) return;
15191
- if (typeof o === "string") return _array_like_to_array$d(o, minLen);
15746
+ if (typeof o === "string") return _array_like_to_array$e(o, minLen);
15192
15747
  var n = Object.prototype.toString.call(o).slice(8, -1);
15193
15748
  if (n === "Object" && o.constructor) n = o.constructor.name;
15194
15749
  if (n === "Map" || n === "Set") return Array.from(n);
15195
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$d(o, minLen);
15750
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$e(o, minLen);
15196
15751
  }
15197
15752
  var __defProp$J = Object.defineProperty;
15198
15753
  var __defNormalProp$J = function __defNormalProp(obj, key, value) {
@@ -15343,7 +15898,7 @@
15343
15898
  * @returns Array of rollup state log entries
15344
15899
  */ key: "getRollupStateLog",
15345
15900
  value: function getRollupStateLog() {
15346
- return _to_consumable_array$7(this.rollupStateLog);
15901
+ return _to_consumable_array$8(this.rollupStateLog);
15347
15902
  }
15348
15903
  },
15349
15904
  {
@@ -15603,6 +16158,23 @@
15603
16158
  return RollupProcess;
15604
16159
  }();
15605
16160
 
16161
+ function evaluateCompletionStatusFromThreshold(param) {
16162
+ var completionThreshold = param.completionThreshold, progressMeasure = param.progressMeasure, storedCompletionStatus = param.storedCompletionStatus;
16163
+ if (completionThreshold !== "" && completionThreshold !== null && completionThreshold !== void 0) {
16164
+ var thresholdValue = parseFloat(String(completionThreshold));
16165
+ if (!isNaN(thresholdValue)) {
16166
+ if (progressMeasure !== "" && progressMeasure !== null && progressMeasure !== void 0) {
16167
+ var progressValue = parseFloat(String(progressMeasure));
16168
+ if (!isNaN(progressValue)) {
16169
+ return progressValue >= thresholdValue ? CompletionStatus.COMPLETED : CompletionStatus.INCOMPLETE;
16170
+ }
16171
+ }
16172
+ return CompletionStatus.UNKNOWN;
16173
+ }
16174
+ }
16175
+ return storedCompletionStatus || CompletionStatus.UNKNOWN;
16176
+ }
16177
+
15606
16178
  function _class_call_check$K(instance, Constructor) {
15607
16179
  if (!(instance instanceof Constructor)) {
15608
16180
  throw new TypeError("Cannot call a class as a function");
@@ -15694,12 +16266,43 @@
15694
16266
  * Transfer primary objective data from CMI to activity
15695
16267
  * @param {Activity} activity - The activity to transfer data to
15696
16268
  * @param {CMIDataForTransfer} cmiData - CMI data from runtime
16269
+ *
16270
+ * @spec SCORM 2004 4th Ed. RTE-to-SN Data Transfer - primary objective status and score data
16271
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max score write-map source data
15697
16272
  */ key: "transferPrimaryObjective",
15698
16273
  value: function transferPrimaryObjective(activity, cmiData) {
15699
- var validatedCompletionStatus = validateCompletionStatus(cmiData.completion_status);
15700
- if (validatedCompletionStatus && validatedCompletionStatus !== CompletionStatus.UNKNOWN) {
15701
- activity.completionStatus = validatedCompletionStatus;
15702
- activity.attemptProgressStatus = true;
16274
+ var hasProgressMeasure = false;
16275
+ if (cmiData.progress_measure && cmiData.progress_measure !== "") {
16276
+ var progressMeasure = parseFloat(cmiData.progress_measure);
16277
+ if (!isNaN(progressMeasure)) {
16278
+ hasProgressMeasure = true;
16279
+ activity.progressMeasure = progressMeasure;
16280
+ activity.progressMeasureStatus = true;
16281
+ activity.attemptCompletionAmount = progressMeasure;
16282
+ activity.attemptCompletionAmountStatus = true;
16283
+ if (activity.primaryObjective) {
16284
+ activity.primaryObjective.progressMeasure = progressMeasure;
16285
+ activity.primaryObjective.progressMeasureStatus = true;
16286
+ }
16287
+ }
16288
+ }
16289
+ if (!hasProgressMeasure) {
16290
+ activity.attemptCompletionAmountStatus = false;
16291
+ }
16292
+ if (activity.completedByMeasure) {
16293
+ var completionStatus = evaluateCompletionStatusFromThreshold({
16294
+ completionThreshold: activity.minProgressMeasure,
16295
+ progressMeasure: cmiData.progress_measure,
16296
+ storedCompletionStatus: CompletionStatus.UNKNOWN
16297
+ });
16298
+ activity.completionStatus = completionStatus;
16299
+ activity.attemptProgressStatus = completionStatus !== CompletionStatus.UNKNOWN;
16300
+ } else {
16301
+ var validatedCompletionStatus = validateCompletionStatus(cmiData.completion_status);
16302
+ if (validatedCompletionStatus && validatedCompletionStatus !== CompletionStatus.UNKNOWN) {
16303
+ activity.completionStatus = validatedCompletionStatus;
16304
+ activity.attemptProgressStatus = true;
16305
+ }
15703
16306
  }
15704
16307
  var hasSuccessStatus = false;
15705
16308
  var successStatus = false;
@@ -15712,9 +16315,10 @@
15712
16315
  activity.objectiveSatisfiedStatus = successStatus;
15713
16316
  activity.objectiveSatisfiedStatusKnown = true;
15714
16317
  activity.successStatus = validatedSuccessStatus;
15715
- activity.objectiveMeasureStatus = true;
15716
16318
  }
15717
16319
  if (cmiData.score) {
16320
+ var _activity_primaryObjective;
16321
+ (_activity_primaryObjective = activity.primaryObjective) === null || _activity_primaryObjective === void 0 ? void 0 : _activity_primaryObjective.initializeScoreFromCMI(this.getObjectiveScoreState(cmiData.score));
15718
16322
  var normalized = this.normalizeScore(cmiData.score);
15719
16323
  if (normalized !== null) {
15720
16324
  normalizedScore = normalized;
@@ -15726,32 +16330,27 @@
15726
16330
  if (activity.primaryObjective && (hasSuccessStatus || hasNormalizedMeasure)) {
15727
16331
  var finalStatus = hasSuccessStatus ? successStatus : activity.primaryObjective.satisfiedStatus;
15728
16332
  var finalMeasure = hasNormalizedMeasure ? normalizedScore : activity.primaryObjective.normalizedMeasure;
15729
- var measureStatus = hasSuccessStatus || hasNormalizedMeasure;
16333
+ var measureStatus = hasNormalizedMeasure;
15730
16334
  activity.primaryObjective.initializeFromCMI(finalStatus, finalMeasure, measureStatus);
15731
16335
  if (hasSuccessStatus) {
15732
16336
  activity.primaryObjective.satisfiedStatusKnown = true;
15733
16337
  activity.primaryObjective.progressStatus = true;
15734
16338
  }
15735
16339
  }
15736
- if (cmiData.progress_measure && cmiData.progress_measure !== "") {
15737
- var progressMeasure = parseFloat(cmiData.progress_measure);
15738
- if (!isNaN(progressMeasure)) {
15739
- activity.progressMeasure = progressMeasure;
15740
- activity.progressMeasureStatus = true;
15741
- if (activity.primaryObjective) {
15742
- activity.primaryObjective.progressMeasure = progressMeasure;
15743
- activity.primaryObjective.progressMeasureStatus = true;
15744
- }
15745
- }
15746
- }
15747
16340
  }
15748
16341
  },
15749
16342
  {
15750
16343
  /**
15751
- * Transfer non-primary objective data from CMI to activity objectives
15752
- * Only transfers changed values to protect global objectives
16344
+ * Transfer objective-array data from CMI to matching activity objectives.
16345
+ * Only transfers changed values to protect global objectives.
15753
16346
  * @param {Activity} activity - The activity to transfer data to
15754
16347
  * @param {CMIDataForTransfer} cmiData - CMI data from runtime
16348
+ *
16349
+ * @spec SCORM 2004 4th Ed. RTE 4.2.17 - cmi.objectives.n data, including
16350
+ * the primary objective entry, is part of the RTE objective data model.
16351
+ * @spec SCORM 2004 4th Ed. SN 3.10.3 and ADLSEQ objectives extension -
16352
+ * mapped objective status and raw/min/max score data transfer through
16353
+ * objective maps to sequencing state.
15755
16354
  */ key: "transferNonPrimaryObjectives",
15756
16355
  value: function transferNonPrimaryObjectives(activity, cmiData) {
15757
16356
  if (!cmiData.objectives || cmiData.objectives.length === 0) {
@@ -15765,14 +16364,17 @@
15765
16364
  continue;
15766
16365
  }
15767
16366
  var activityObjectiveMatch = activity.getObjectiveById(cmiObjective.id);
15768
- if (!activityObjectiveMatch || activityObjectiveMatch.isPrimary) {
16367
+ if (!activityObjectiveMatch) {
15769
16368
  continue;
15770
16369
  }
15771
16370
  var activityObjective = activityObjectiveMatch.objective;
16371
+ var isPrimaryObjective = activityObjectiveMatch.isPrimary;
15772
16372
  var hasSuccessStatus = false;
15773
16373
  var successStatus = false;
15774
16374
  var hasNormalizedMeasure = false;
15775
16375
  var normalizedScore = 0;
16376
+ var hasCompletionStatus = false;
16377
+ var hasProgressMeasure = false;
15776
16378
  var validatedObjSuccessStatus = validateSuccessStatus(cmiObjective.success_status);
15777
16379
  if (validatedObjSuccessStatus && validatedObjSuccessStatus !== SuccessStatus.UNKNOWN) {
15778
16380
  successStatus = validatedObjSuccessStatus === SuccessStatus.PASSED;
@@ -15782,8 +16384,10 @@
15782
16384
  var validatedObjCompletionStatus = validateCompletionStatus(cmiObjective.completion_status);
15783
16385
  if (validatedObjCompletionStatus && validatedObjCompletionStatus !== CompletionStatus.UNKNOWN) {
15784
16386
  activityObjective.completionStatus = validatedObjCompletionStatus;
16387
+ hasCompletionStatus = true;
15785
16388
  }
15786
16389
  if (cmiObjective.score) {
16390
+ activityObjective.initializeScoreFromCMI(this.getObjectiveScoreState(cmiObjective.score));
15787
16391
  var normalized = this.normalizeScore(cmiObjective.score);
15788
16392
  if (normalized !== null) {
15789
16393
  normalizedScore = normalized;
@@ -15795,12 +16399,29 @@
15795
16399
  var finalMeasure = hasNormalizedMeasure ? normalizedScore : activityObjective.normalizedMeasure;
15796
16400
  var measureStatus = hasNormalizedMeasure;
15797
16401
  activityObjective.initializeFromCMI(finalStatus, finalMeasure, measureStatus);
16402
+ if (hasSuccessStatus) {
16403
+ activityObjective.satisfiedStatusKnown = true;
16404
+ }
15798
16405
  }
15799
16406
  if (cmiObjective.progress_measure && cmiObjective.progress_measure !== "") {
15800
16407
  var progressMeasure = parseFloat(cmiObjective.progress_measure);
15801
16408
  if (!isNaN(progressMeasure)) {
15802
16409
  activityObjective.progressMeasure = progressMeasure;
15803
16410
  activityObjective.progressMeasureStatus = true;
16411
+ hasProgressMeasure = true;
16412
+ }
16413
+ }
16414
+ if (isPrimaryObjective && (hasSuccessStatus || hasNormalizedMeasure || hasCompletionStatus || hasProgressMeasure)) {
16415
+ activityObjective.applyToActivity(activity);
16416
+ if (validatedObjSuccessStatus && validatedObjSuccessStatus !== SuccessStatus.UNKNOWN) {
16417
+ activity.successStatus = validatedObjSuccessStatus;
16418
+ }
16419
+ if (hasCompletionStatus) {
16420
+ activity.attemptProgressStatus = true;
16421
+ }
16422
+ if (hasProgressMeasure) {
16423
+ activity.attemptCompletionAmount = activityObjective.progressMeasure;
16424
+ activity.attemptCompletionAmountStatus = true;
15804
16425
  }
15805
16426
  }
15806
16427
  }
@@ -15845,6 +16466,27 @@
15845
16466
  }
15846
16467
  return null;
15847
16468
  }
16469
+ },
16470
+ {
16471
+ /**
16472
+ * Convert RTE score data into objective score-map state without numeric reformatting.
16473
+ *
16474
+ * @spec SCORM 2004 4th Ed. RTE-to-SN Data Transfer - score values transfer from RTE to sequencing state
16475
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max score map fields are independent
16476
+ */ key: "getObjectiveScoreState",
16477
+ value: function getObjectiveScoreState(score) {
16478
+ var scoreState = {};
16479
+ if (score.raw !== void 0) {
16480
+ scoreState.rawScore = score.raw;
16481
+ }
16482
+ if (score.min !== void 0) {
16483
+ scoreState.minScore = score.min;
16484
+ }
16485
+ if (score.max !== void 0) {
16486
+ scoreState.maxScore = score.max;
16487
+ }
16488
+ return scoreState;
16489
+ }
15848
16490
  }
15849
16491
  ]);
15850
16492
  return RteDataTransferService;
@@ -16020,6 +16662,18 @@
16020
16662
  this.endAttempt(this.activityTree.currentActivity);
16021
16663
  }
16022
16664
  }
16665
+ var ancestorExitResult = this.applyAncestorExitActionRules(currentActivity);
16666
+ if (ancestorExitResult.action === "EXIT_ALL") {
16667
+ return this.handleExitAll(ancestorExitResult.activity || currentActivity);
16668
+ }
16669
+ if (ancestorExitResult.exception) {
16670
+ return {
16671
+ terminationRequest: SequencingRequestType.EXIT,
16672
+ sequencingRequest: null,
16673
+ exception: ancestorExitResult.exception,
16674
+ valid: false
16675
+ };
16676
+ }
16023
16677
  var processedExit;
16024
16678
  var postConditionResult;
16025
16679
  do {
@@ -16295,18 +16949,13 @@
16295
16949
  try {
16296
16950
  for(var _iterator = exitRules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
16297
16951
  var rule = _step.value;
16298
- var conditionsMet = void 0;
16299
- if (rule.conditionCombination === "all") {
16300
- conditionsMet = rule.conditions.every(function(condition) {
16301
- return condition.evaluate(activity);
16302
- });
16303
- } else {
16304
- conditionsMet = rule.conditions.some(function(condition) {
16305
- return condition.evaluate(activity);
16306
- });
16307
- }
16308
- if (conditionsMet) {
16309
- if (rule.action === RuleActionType.EXIT_PARENT) {
16952
+ if (rule.evaluate(activity)) {
16953
+ if (rule.action === RuleActionType.EXIT) {
16954
+ return {
16955
+ action: "EXIT",
16956
+ recursionDepth: recursionDepth
16957
+ };
16958
+ } else if (rule.action === RuleActionType.EXIT_PARENT) {
16310
16959
  return {
16311
16960
  action: "EXIT_PARENT",
16312
16961
  recursionDepth: recursionDepth
@@ -16370,6 +17019,89 @@
16370
17019
  },
16371
17020
  {
16372
17021
  /**
17022
+ * Sequencing Exit Action Rules Subprocess (TB.2.1) ancestor walk
17023
+ * @spec SN Book: TB.2.1 (Sequencing Exit Action Rules Subprocess)
17024
+ * @param {Activity} terminatingActivity - The activity whose attempt just ended
17025
+ * @return {{action: string | null, activity?: Activity, exception?: string}}
17026
+ */ key: "applyAncestorExitActionRules",
17027
+ value: function applyAncestorExitActionRules(terminatingActivity) {
17028
+ var activityPath = [];
17029
+ var current = terminatingActivity.parent;
17030
+ while(current){
17031
+ activityPath.unshift(current);
17032
+ current = current.parent;
17033
+ }
17034
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
17035
+ try {
17036
+ for(var _iterator = activityPath[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
17037
+ var activity = _step.value;
17038
+ var exitAction = this.exitActionRulesSubprocess(activity);
17039
+ if (exitAction === "EXIT_ALL") {
17040
+ this.fireEvent("onAncestorExitAction", {
17041
+ activity: activity.id,
17042
+ action: exitAction
17043
+ });
17044
+ return {
17045
+ action: "EXIT_ALL",
17046
+ activity: activity
17047
+ };
17048
+ }
17049
+ if (exitAction === "EXIT_PARENT") {
17050
+ if (!activity.parent) {
17051
+ return {
17052
+ action: "EXIT_PARENT",
17053
+ activity: activity,
17054
+ exception: "TB.2.3-4"
17055
+ };
17056
+ }
17057
+ this.terminateDescendants(activity.parent);
17058
+ this.activityTree.currentActivity = activity.parent;
17059
+ this.endAttempt(activity.parent);
17060
+ this.fireEvent("onAncestorExitAction", {
17061
+ activity: activity.id,
17062
+ action: exitAction,
17063
+ currentActivity: activity.parent.id
17064
+ });
17065
+ return {
17066
+ action: "EXIT_PARENT",
17067
+ activity: activity.parent
17068
+ };
17069
+ }
17070
+ if (exitAction === "EXIT") {
17071
+ this.terminateDescendants(activity);
17072
+ this.activityTree.currentActivity = activity;
17073
+ this.endAttempt(activity);
17074
+ this.fireEvent("onAncestorExitAction", {
17075
+ activity: activity.id,
17076
+ action: exitAction
17077
+ });
17078
+ return {
17079
+ action: "EXIT",
17080
+ activity: activity
17081
+ };
17082
+ }
17083
+ }
17084
+ } catch (err) {
17085
+ _didIteratorError = true;
17086
+ _iteratorError = err;
17087
+ } finally{
17088
+ try {
17089
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
17090
+ _iterator.return();
17091
+ }
17092
+ } finally{
17093
+ if (_didIteratorError) {
17094
+ throw _iteratorError;
17095
+ }
17096
+ }
17097
+ }
17098
+ return {
17099
+ action: null
17100
+ };
17101
+ }
17102
+ },
17103
+ {
17104
+ /**
16373
17105
  * Process exit actions at specific level
16374
17106
  * @param {Activity} activity - Activity to process
16375
17107
  * @param {number} level - Current level in hierarchy
@@ -16511,18 +17243,10 @@
16511
17243
  try {
16512
17244
  for(var _iterator = exitRules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
16513
17245
  var rule = _step.value;
16514
- var conditionsMet = void 0;
16515
- if (rule.conditionCombination === "all") {
16516
- conditionsMet = rule.conditions.every(function(condition) {
16517
- return condition.evaluate(activity);
16518
- });
16519
- } else {
16520
- conditionsMet = rule.conditions.some(function(condition) {
16521
- return condition.evaluate(activity);
16522
- });
16523
- }
16524
- if (conditionsMet) {
16525
- if (rule.action === RuleActionType.EXIT_PARENT) {
17246
+ if (rule.evaluate(activity)) {
17247
+ if (rule.action === RuleActionType.EXIT) {
17248
+ return "EXIT";
17249
+ } else if (rule.action === RuleActionType.EXIT_PARENT) {
16526
17250
  return "EXIT_PARENT";
16527
17251
  } else if (rule.action === RuleActionType.EXIT_ALL) {
16528
17252
  return "EXIT_ALL";
@@ -16653,13 +17377,13 @@
16653
17377
  return TerminationHandler;
16654
17378
  }();
16655
17379
 
16656
- function _array_like_to_array$c(arr, len) {
17380
+ function _array_like_to_array$d(arr, len) {
16657
17381
  if (len == null || len > arr.length) len = arr.length;
16658
17382
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
16659
17383
  return arr2;
16660
17384
  }
16661
- function _array_without_holes$6(arr) {
16662
- if (Array.isArray(arr)) return _array_like_to_array$c(arr);
17385
+ function _array_without_holes$7(arr) {
17386
+ if (Array.isArray(arr)) return _array_like_to_array$d(arr);
16663
17387
  }
16664
17388
  function _class_call_check$I(instance, Constructor) {
16665
17389
  if (!(instance instanceof Constructor)) {
@@ -16692,10 +17416,10 @@
16692
17416
  }
16693
17417
  return obj;
16694
17418
  }
16695
- function _iterable_to_array$6(iter) {
17419
+ function _iterable_to_array$7(iter) {
16696
17420
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
16697
17421
  }
16698
- function _non_iterable_spread$6() {
17422
+ function _non_iterable_spread$7() {
16699
17423
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
16700
17424
  }
16701
17425
  function _object_spread$a(target) {
@@ -16713,20 +17437,20 @@
16713
17437
  }
16714
17438
  return target;
16715
17439
  }
16716
- function _to_consumable_array$6(arr) {
16717
- return _array_without_holes$6(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$c(arr) || _non_iterable_spread$6();
17440
+ function _to_consumable_array$7(arr) {
17441
+ return _array_without_holes$7(arr) || _iterable_to_array$7(arr) || _unsupported_iterable_to_array$d(arr) || _non_iterable_spread$7();
16718
17442
  }
16719
17443
  function _type_of$F(obj) {
16720
17444
  "@swc/helpers - typeof";
16721
17445
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
16722
17446
  }
16723
- function _unsupported_iterable_to_array$c(o, minLen) {
17447
+ function _unsupported_iterable_to_array$d(o, minLen) {
16724
17448
  if (!o) return;
16725
- if (typeof o === "string") return _array_like_to_array$c(o, minLen);
17449
+ if (typeof o === "string") return _array_like_to_array$d(o, minLen);
16726
17450
  var n = Object.prototype.toString.call(o).slice(8, -1);
16727
17451
  if (n === "Object" && o.constructor) n = o.constructor.name;
16728
17452
  if (n === "Map" || n === "Set") return Array.from(n);
16729
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$c(o, minLen);
17453
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$d(o, minLen);
16730
17454
  }
16731
17455
  var __defProp$F = Object.defineProperty;
16732
17456
  var __defNormalProp$F = function __defNormalProp(obj, key, value) {
@@ -16776,7 +17500,7 @@
16776
17500
  this.now = (options === null || options === void 0 ? void 0 : options.now) || function() {
16777
17501
  return /* @__PURE__ */ new Date();
16778
17502
  };
16779
- this.defaultHideLmsUi = (options === null || options === void 0 ? void 0 : options.defaultHideLmsUi) ? _to_consumable_array$6(options.defaultHideLmsUi) : [];
17503
+ this.defaultHideLmsUi = (options === null || options === void 0 ? void 0 : options.defaultHideLmsUi) ? _to_consumable_array$7(options.defaultHideLmsUi) : [];
16780
17504
  this.defaultAuxiliaryResources = (options === null || options === void 0 ? void 0 : options.defaultAuxiliaryResources) ? options.defaultAuxiliaryResources.map(function(resource) {
16781
17505
  return _object_spread$a({}, resource);
16782
17506
  }) : [];
@@ -17220,7 +17944,7 @@
17220
17944
  ]);
17221
17945
  return _DeliveryHandler;
17222
17946
  }();
17223
- __publicField$F(_DeliveryHandler, "HIDE_LMS_UI_ORDER", _to_consumable_array$6(HIDE_LMS_UI_TOKENS));
17947
+ __publicField$F(_DeliveryHandler, "HIDE_LMS_UI_ORDER", _to_consumable_array$7(HIDE_LMS_UI_TOKENS));
17224
17948
  var DeliveryHandler = _DeliveryHandler;
17225
17949
 
17226
17950
  function _class_call_check$H(instance, Constructor) {
@@ -18591,7 +19315,7 @@
18591
19315
  return NavigationValidityService;
18592
19316
  }();
18593
19317
 
18594
- function _array_like_to_array$b(arr, len) {
19318
+ function _array_like_to_array$c(arr, len) {
18595
19319
  if (len == null || len > arr.length) len = arr.length;
18596
19320
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
18597
19321
  return arr2;
@@ -18680,7 +19404,7 @@
18680
19404
  }
18681
19405
  return target;
18682
19406
  }
18683
- function ownKeys$1(object, enumerableOnly) {
19407
+ function ownKeys$2(object, enumerableOnly) {
18684
19408
  var keys = Object.keys(object);
18685
19409
  if (Object.getOwnPropertySymbols) {
18686
19410
  var symbols = Object.getOwnPropertySymbols(object);
@@ -18688,31 +19412,31 @@
18688
19412
  }
18689
19413
  return keys;
18690
19414
  }
18691
- function _object_spread_props$1(target, source) {
19415
+ function _object_spread_props$2(target, source) {
18692
19416
  source = source != null ? source : {};
18693
19417
  if (Object.getOwnPropertyDescriptors) {
18694
19418
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
18695
19419
  } else {
18696
- ownKeys$1(Object(source)).forEach(function(key) {
19420
+ ownKeys$2(Object(source)).forEach(function(key) {
18697
19421
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
18698
19422
  });
18699
19423
  }
18700
19424
  return target;
18701
19425
  }
18702
19426
  function _sliced_to_array$6(arr, i) {
18703
- return _array_with_holes$6(arr) || _iterable_to_array_limit$6(arr, i) || _unsupported_iterable_to_array$b(arr, i) || _non_iterable_rest$6();
19427
+ return _array_with_holes$6(arr) || _iterable_to_array_limit$6(arr, i) || _unsupported_iterable_to_array$c(arr, i) || _non_iterable_rest$6();
18704
19428
  }
18705
19429
  function _type_of$C(obj) {
18706
19430
  "@swc/helpers - typeof";
18707
19431
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
18708
19432
  }
18709
- function _unsupported_iterable_to_array$b(o, minLen) {
19433
+ function _unsupported_iterable_to_array$c(o, minLen) {
18710
19434
  if (!o) return;
18711
- if (typeof o === "string") return _array_like_to_array$b(o, minLen);
19435
+ if (typeof o === "string") return _array_like_to_array$c(o, minLen);
18712
19436
  var n = Object.prototype.toString.call(o).slice(8, -1);
18713
19437
  if (n === "Object" && o.constructor) n = o.constructor.name;
18714
19438
  if (n === "Map" || n === "Set") return Array.from(n);
18715
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$b(o, minLen);
19439
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$c(o, minLen);
18716
19440
  }
18717
19441
  var __defProp$C = Object.defineProperty;
18718
19442
  var __defNormalProp$C = function __defNormalProp(obj, key, value) {
@@ -18763,6 +19487,9 @@
18763
19487
  * Collect Global Objectives
18764
19488
  * Recursively collects global objectives from the activity tree
18765
19489
  * @param {Activity} activity - Activity to collect objectives from
19490
+ *
19491
+ * @spec SCORM 2004 4th Ed. SN 3.10.3 - global objective map contains mapped objective state
19492
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max score fields are unknown until written
18766
19493
  */ key: "collectObjectives",
18767
19494
  value: function collectObjectives(activity) {
18768
19495
  var objectives = activity.getAllObjectives();
@@ -18772,9 +19499,15 @@
18772
19499
  this.globalObjectiveMap.set(defaultId, {
18773
19500
  id: defaultId,
18774
19501
  satisfiedStatus: activity.objectiveSatisfiedStatus,
18775
- satisfiedStatusKnown: activity.objectiveMeasureStatus,
19502
+ satisfiedStatusKnown: activity.objectiveSatisfiedStatusKnown,
18776
19503
  normalizedMeasure: activity.objectiveNormalizedMeasure,
18777
19504
  normalizedMeasureKnown: activity.objectiveMeasureStatus,
19505
+ rawScore: "",
19506
+ rawScoreKnown: false,
19507
+ minScore: "",
19508
+ minScoreKnown: false,
19509
+ maxScore: "",
19510
+ maxScoreKnown: false,
18778
19511
  progressMeasure: activity.progressMeasure,
18779
19512
  progressMeasureKnown: activity.progressMeasureStatus,
18780
19513
  completionStatus: activity.completionStatus,
@@ -18787,6 +19520,12 @@
18787
19520
  writeCompletionStatus: true,
18788
19521
  readProgressMeasure: true,
18789
19522
  writeProgressMeasure: true,
19523
+ readRawScore: false,
19524
+ writeRawScore: false,
19525
+ readMinScore: false,
19526
+ writeMinScore: false,
19527
+ readMaxScore: false,
19528
+ writeMaxScore: false,
18790
19529
  satisfiedByMeasure: activity.scaledPassingScore !== null,
18791
19530
  minNormalizedMeasure: activity.scaledPassingScore,
18792
19531
  updateAttemptData: true
@@ -18821,9 +19560,15 @@
18821
19560
  this.globalObjectiveMap.set(targetId, {
18822
19561
  id: targetId,
18823
19562
  satisfiedStatus: objective.satisfiedStatus,
18824
- satisfiedStatusKnown: objective.measureStatus,
19563
+ satisfiedStatusKnown: objective.satisfiedStatusKnown || objective.progressStatus,
18825
19564
  normalizedMeasure: objective.normalizedMeasure,
18826
19565
  normalizedMeasureKnown: objective.measureStatus,
19566
+ rawScore: "",
19567
+ rawScoreKnown: false,
19568
+ minScore: "",
19569
+ minScoreKnown: false,
19570
+ maxScore: "",
19571
+ maxScoreKnown: false,
18827
19572
  progressMeasure: objective.progressMeasure,
18828
19573
  progressMeasureKnown: objective.progressMeasureStatus,
18829
19574
  completionStatus: objective.completionStatus,
@@ -18938,7 +19683,7 @@
18938
19683
  */ key: "updateObjective",
18939
19684
  value: function updateObjective(objectiveId, objectiveData) {
18940
19685
  try {
18941
- this.globalObjectiveMap.set(objectiveId, _object_spread_props$1(_object_spread$9({}, this.globalObjectiveMap.get(objectiveId), objectiveData), {
19686
+ this.globalObjectiveMap.set(objectiveId, _object_spread_props$2(_object_spread$9({}, this.globalObjectiveMap.get(objectiveId), objectiveData), {
18942
19687
  lastUpdated: /* @__PURE__ */ new Date().toISOString()
18943
19688
  }));
18944
19689
  this.fireEvent("onGlobalObjectiveUpdated", {
@@ -19591,13 +20336,13 @@
19591
20336
  return SequencingStateManager;
19592
20337
  }();
19593
20338
 
19594
- function _array_like_to_array$a(arr, len) {
20339
+ function _array_like_to_array$b(arr, len) {
19595
20340
  if (len == null || len > arr.length) len = arr.length;
19596
20341
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
19597
20342
  return arr2;
19598
20343
  }
19599
- function _array_without_holes$5(arr) {
19600
- if (Array.isArray(arr)) return _array_like_to_array$a(arr);
20344
+ function _array_without_holes$6(arr) {
20345
+ if (Array.isArray(arr)) return _array_like_to_array$b(arr);
19601
20346
  }
19602
20347
  function _class_call_check$D(instance, Constructor) {
19603
20348
  if (!(instance instanceof Constructor)) {
@@ -19617,26 +20362,26 @@
19617
20362
  if (protoProps) _defineProperties$D(Constructor.prototype, protoProps);
19618
20363
  return Constructor;
19619
20364
  }
19620
- function _iterable_to_array$5(iter) {
20365
+ function _iterable_to_array$6(iter) {
19621
20366
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
19622
20367
  }
19623
- function _non_iterable_spread$5() {
20368
+ function _non_iterable_spread$6() {
19624
20369
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
19625
20370
  }
19626
- function _to_consumable_array$5(arr) {
19627
- return _array_without_holes$5(arr) || _iterable_to_array$5(arr) || _unsupported_iterable_to_array$a(arr) || _non_iterable_spread$5();
20371
+ function _to_consumable_array$6(arr) {
20372
+ return _array_without_holes$6(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$b(arr) || _non_iterable_spread$6();
19628
20373
  }
19629
20374
  function _type_of$A(obj) {
19630
20375
  "@swc/helpers - typeof";
19631
20376
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
19632
20377
  }
19633
- function _unsupported_iterable_to_array$a(o, minLen) {
20378
+ function _unsupported_iterable_to_array$b(o, minLen) {
19634
20379
  if (!o) return;
19635
- if (typeof o === "string") return _array_like_to_array$a(o, minLen);
20380
+ if (typeof o === "string") return _array_like_to_array$b(o, minLen);
19636
20381
  var n = Object.prototype.toString.call(o).slice(8, -1);
19637
20382
  if (n === "Object" && o.constructor) n = o.constructor.name;
19638
20383
  if (n === "Map" || n === "Set") return Array.from(n);
19639
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$a(o, minLen);
20384
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$b(o, minLen);
19640
20385
  }
19641
20386
  var __defProp$A = Object.defineProperty;
19642
20387
  var __defNormalProp$A = function __defNormalProp(obj, key, value) {
@@ -20234,7 +20979,7 @@
20234
20979
  }
20235
20980
  if (activity.prerequisiteActivities) {
20236
20981
  var _prerequisites;
20237
- (_prerequisites = prerequisites).push.apply(_prerequisites, _to_consumable_array$5(activity.prerequisiteActivities));
20982
+ (_prerequisites = prerequisites).push.apply(_prerequisites, _to_consumable_array$6(activity.prerequisiteActivities));
20238
20983
  }
20239
20984
  return Array.from(new Set(prerequisites));
20240
20985
  }
@@ -20286,7 +21031,7 @@
20286
21031
  }
20287
21032
  }
20288
21033
  if (activity.sequencingRules) {
20289
- var allRules = _to_consumable_array$5(activity.sequencingRules.preConditionRules || []).concat(_to_consumable_array$5(activity.sequencingRules.exitConditionRules || []), _to_consumable_array$5(activity.sequencingRules.postConditionRules || []));
21034
+ var allRules = _to_consumable_array$6(activity.sequencingRules.preConditionRules || []).concat(_to_consumable_array$6(activity.sequencingRules.exitConditionRules || []), _to_consumable_array$6(activity.sequencingRules.postConditionRules || []));
20290
21035
  var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
20291
21036
  try {
20292
21037
  for(var _iterator1 = allRules[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
@@ -21103,13 +21848,13 @@
21103
21848
  return OverallSequencingProcess;
21104
21849
  }();
21105
21850
 
21106
- function _array_like_to_array$9(arr, len) {
21851
+ function _array_like_to_array$a(arr, len) {
21107
21852
  if (len == null || len > arr.length) len = arr.length;
21108
21853
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
21109
21854
  return arr2;
21110
21855
  }
21111
- function _array_without_holes$4(arr) {
21112
- if (Array.isArray(arr)) return _array_like_to_array$9(arr);
21856
+ function _array_without_holes$5(arr) {
21857
+ if (Array.isArray(arr)) return _array_like_to_array$a(arr);
21113
21858
  }
21114
21859
  function _class_call_check$B(instance, Constructor) {
21115
21860
  if (!(instance instanceof Constructor)) {
@@ -21142,10 +21887,10 @@
21142
21887
  }
21143
21888
  return obj;
21144
21889
  }
21145
- function _iterable_to_array$4(iter) {
21890
+ function _iterable_to_array$5(iter) {
21146
21891
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
21147
21892
  }
21148
- function _non_iterable_spread$4() {
21893
+ function _non_iterable_spread$5() {
21149
21894
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
21150
21895
  }
21151
21896
  function _object_spread$8(target) {
@@ -21163,20 +21908,20 @@
21163
21908
  }
21164
21909
  return target;
21165
21910
  }
21166
- function _to_consumable_array$4(arr) {
21167
- return _array_without_holes$4(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$9(arr) || _non_iterable_spread$4();
21911
+ function _to_consumable_array$5(arr) {
21912
+ return _array_without_holes$5(arr) || _iterable_to_array$5(arr) || _unsupported_iterable_to_array$a(arr) || _non_iterable_spread$5();
21168
21913
  }
21169
21914
  function _type_of$y(obj) {
21170
21915
  "@swc/helpers - typeof";
21171
21916
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
21172
21917
  }
21173
- function _unsupported_iterable_to_array$9(o, minLen) {
21918
+ function _unsupported_iterable_to_array$a(o, minLen) {
21174
21919
  if (!o) return;
21175
- if (typeof o === "string") return _array_like_to_array$9(o, minLen);
21920
+ if (typeof o === "string") return _array_like_to_array$a(o, minLen);
21176
21921
  var n = Object.prototype.toString.call(o).slice(8, -1);
21177
21922
  if (n === "Object" && o.constructor) n = o.constructor.name;
21178
21923
  if (n === "Map" || n === "Set") return Array.from(n);
21179
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$9(o, minLen);
21924
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$a(o, minLen);
21180
21925
  }
21181
21926
  var __defProp$y = Object.defineProperty;
21182
21927
  var __defNormalProp$y = function __defNormalProp(obj, key, value) {
@@ -21268,7 +22013,7 @@
21268
22013
  this.sequencingProcess = new SequencingProcess(this.sequencing.activityTree, this.sequencing.sequencingRules, this.sequencing.sequencingControls, this.adl.nav, seqOptions);
21269
22014
  var overallOptions = {};
21270
22015
  if (this.configuration.now) overallOptions.now = this.configuration.now;
21271
- overallOptions.defaultHideLmsUi = _to_consumable_array$4(this.sequencing.hideLmsUi);
22016
+ overallOptions.defaultHideLmsUi = _to_consumable_array$5(this.sequencing.hideLmsUi);
21272
22017
  if (this.sequencing.auxiliaryResources.length > 0) {
21273
22018
  overallOptions.defaultAuxiliaryResources = this.sequencing.auxiliaryResources.map(function(resource) {
21274
22019
  return {
@@ -21575,27 +22320,44 @@
21575
22320
  {
21576
22321
  /**
21577
22322
  * Update activity properties from current CMI values
22323
+ *
22324
+ * @spec SCORM 2004 4th Ed. RTE-to-SN Data Transfer - current CMI values update activity objective state
22325
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max scores are available to objective write maps
21578
22326
  */ key: "updateActivityFromCMI",
21579
22327
  value: function updateActivityFromCMI(activity) {
21580
- if (this.cmi.completion_status !== "unknown") {
22328
+ var hasProgressMeasure = false;
22329
+ if (this.cmi.progress_measure !== "") {
22330
+ var progressMeasure = parseFloat(this.cmi.progress_measure);
22331
+ if (!isNaN(progressMeasure)) {
22332
+ hasProgressMeasure = true;
22333
+ activity.progressMeasure = progressMeasure;
22334
+ activity.progressMeasureStatus = true;
22335
+ activity.attemptCompletionAmount = progressMeasure;
22336
+ activity.attemptCompletionAmountStatus = true;
22337
+ }
22338
+ }
22339
+ if (!hasProgressMeasure) {
22340
+ activity.attemptCompletionAmountStatus = false;
22341
+ }
22342
+ if (activity.completedByMeasure) {
22343
+ var completionStatus = evaluateCompletionStatusFromThreshold({
22344
+ completionThreshold: activity.minProgressMeasure,
22345
+ progressMeasure: this.cmi.progress_measure,
22346
+ storedCompletionStatus: CompletionStatus.UNKNOWN
22347
+ });
22348
+ activity.completionStatus = completionStatus;
22349
+ activity.attemptProgressStatus = completionStatus !== CompletionStatus.UNKNOWN;
22350
+ } else if (this.cmi.completion_status !== "unknown") {
21581
22351
  activity.completionStatus = this.cmi.completion_status;
21582
22352
  activity.attemptProgressStatus = true;
21583
22353
  }
21584
22354
  if (this.cmi.success_status !== "unknown") {
21585
22355
  activity.successStatus = this.cmi.success_status;
21586
22356
  activity.objectiveSatisfiedStatus = this.cmi.success_status === "passed";
21587
- activity.objectiveMeasureStatus = true;
21588
22357
  if (activity.primaryObjective) {
21589
22358
  activity.primaryObjective.progressStatus = true;
21590
22359
  }
21591
22360
  }
21592
- if (this.cmi.progress_measure !== "") {
21593
- var progressMeasure = parseFloat(this.cmi.progress_measure);
21594
- if (!isNaN(progressMeasure)) {
21595
- activity.progressMeasure = progressMeasure;
21596
- activity.progressMeasureStatus = true;
21597
- }
21598
- }
21599
22361
  if (this.cmi.score && this.cmi.score.scaled !== "") {
21600
22362
  var scaledScore = parseFloat(this.cmi.score.scaled);
21601
22363
  if (!isNaN(scaledScore)) {
@@ -21606,6 +22368,17 @@
21606
22368
  }
21607
22369
  }
21608
22370
  }
22371
+ if (activity.primaryObjective && this.cmi.score) {
22372
+ if (this.cmi.score.raw !== "") {
22373
+ activity.primaryObjective.rawScore = this.cmi.score.raw;
22374
+ }
22375
+ if (this.cmi.score.min !== "") {
22376
+ activity.primaryObjective.minScore = this.cmi.score.min;
22377
+ }
22378
+ if (this.cmi.score.max !== "") {
22379
+ activity.primaryObjective.maxScore = this.cmi.score.max;
22380
+ }
22381
+ }
21609
22382
  if (activity.primaryObjective) {
21610
22383
  activity.primaryObjective.updateFromActivity(activity);
21611
22384
  }
@@ -21768,7 +22541,7 @@
21768
22541
  var listener = this.eventListeners[eventType];
21769
22542
  if (listener && typeof listener === "function") {
21770
22543
  try {
21771
- listener.apply(void 0, _to_consumable_array$4(args));
22544
+ listener.apply(void 0, _to_consumable_array$5(args));
21772
22545
  this.log("debug", "Internal listener for ".concat(eventType, " executed successfully"));
21773
22546
  } catch (listenerError) {
21774
22547
  this.log("error", "Internal listener for ".concat(eventType, " failed: ").concat(listenerError));
@@ -21779,7 +22552,7 @@
21779
22552
  (_this_eventService = this.eventService).processListeners.apply(_this_eventService, [
21780
22553
  "Sequencing.".concat(eventType),
21781
22554
  args[0]
21782
- ].concat(_to_consumable_array$4(args.slice(1))));
22555
+ ].concat(_to_consumable_array$5(args.slice(1))));
21783
22556
  this.log("debug", "Event service listeners for ".concat(eventType, " processed"));
21784
22557
  } catch (eventServiceError) {
21785
22558
  this.log("warn", "Event service failed for ".concat(eventType, ": ").concat(eventServiceError));
@@ -21789,7 +22562,7 @@
21789
22562
  var globalListeners = window.scormSequencingEvents;
21790
22563
  if (globalListeners[eventType] && typeof globalListeners[eventType] === "function") {
21791
22564
  var _globalListeners;
21792
- (_globalListeners = globalListeners)[eventType].apply(_globalListeners, _to_consumable_array$4(args));
22565
+ (_globalListeners = globalListeners)[eventType].apply(_globalListeners, _to_consumable_array$5(args));
21793
22566
  this.log("debug", "Global listener for ".concat(eventType, " executed"));
21794
22567
  }
21795
22568
  }
@@ -22227,7 +23000,7 @@
22227
23000
  return SerializationService;
22228
23001
  }();
22229
23002
 
22230
- function _array_like_to_array$8(arr, len) {
23003
+ function _array_like_to_array$9(arr, len) {
22231
23004
  if (len == null || len > arr.length) len = arr.length;
22232
23005
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
22233
23006
  return arr2;
@@ -22289,19 +23062,19 @@
22289
23062
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
22290
23063
  }
22291
23064
  function _sliced_to_array$5(arr, i) {
22292
- return _array_with_holes$5(arr) || _iterable_to_array_limit$5(arr, i) || _unsupported_iterable_to_array$8(arr, i) || _non_iterable_rest$5();
23065
+ return _array_with_holes$5(arr) || _iterable_to_array_limit$5(arr, i) || _unsupported_iterable_to_array$9(arr, i) || _non_iterable_rest$5();
22293
23066
  }
22294
23067
  function _type_of$x(obj) {
22295
23068
  "@swc/helpers - typeof";
22296
23069
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
22297
23070
  }
22298
- function _unsupported_iterable_to_array$8(o, minLen) {
23071
+ function _unsupported_iterable_to_array$9(o, minLen) {
22299
23072
  if (!o) return;
22300
- if (typeof o === "string") return _array_like_to_array$8(o, minLen);
23073
+ if (typeof o === "string") return _array_like_to_array$9(o, minLen);
22301
23074
  var n = Object.prototype.toString.call(o).slice(8, -1);
22302
23075
  if (n === "Object" && o.constructor) n = o.constructor.name;
22303
23076
  if (n === "Map" || n === "Set") return Array.from(n);
22304
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$8(o, minLen);
23077
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$9(o, minLen);
22305
23078
  }
22306
23079
  var __defProp$x = Object.defineProperty;
22307
23080
  var __defNormalProp$x = function __defNormalProp(obj, key, value) {
@@ -22570,13 +23343,13 @@
22570
23343
  }();
22571
23344
  var validationService = new ValidationService();
22572
23345
 
22573
- function _array_like_to_array$7(arr, len) {
23346
+ function _array_like_to_array$8(arr, len) {
22574
23347
  if (len == null || len > arr.length) len = arr.length;
22575
23348
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
22576
23349
  return arr2;
22577
23350
  }
22578
- function _array_without_holes$3(arr) {
22579
- if (Array.isArray(arr)) return _array_like_to_array$7(arr);
23351
+ function _array_without_holes$4(arr) {
23352
+ if (Array.isArray(arr)) return _array_like_to_array$8(arr);
22580
23353
  }
22581
23354
  function _class_call_check$x(instance, Constructor) {
22582
23355
  if (!(instance instanceof Constructor)) {
@@ -22617,10 +23390,10 @@
22617
23390
  return left instanceof right;
22618
23391
  }
22619
23392
  }
22620
- function _iterable_to_array$3(iter) {
23393
+ function _iterable_to_array$4(iter) {
22621
23394
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
22622
23395
  }
22623
- function _non_iterable_spread$3() {
23396
+ function _non_iterable_spread$4() {
22624
23397
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
22625
23398
  }
22626
23399
  function _object_spread$7(target) {
@@ -22638,7 +23411,7 @@
22638
23411
  }
22639
23412
  return target;
22640
23413
  }
22641
- function ownKeys(object, enumerableOnly) {
23414
+ function ownKeys$1(object, enumerableOnly) {
22642
23415
  var keys = Object.keys(object);
22643
23416
  if (Object.getOwnPropertySymbols) {
22644
23417
  var symbols = Object.getOwnPropertySymbols(object);
@@ -22646,31 +23419,31 @@
22646
23419
  }
22647
23420
  return keys;
22648
23421
  }
22649
- function _object_spread_props(target, source) {
23422
+ function _object_spread_props$1(target, source) {
22650
23423
  source = source != null ? source : {};
22651
23424
  if (Object.getOwnPropertyDescriptors) {
22652
23425
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
22653
23426
  } else {
22654
- ownKeys(Object(source)).forEach(function(key) {
23427
+ ownKeys$1(Object(source)).forEach(function(key) {
22655
23428
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
22656
23429
  });
22657
23430
  }
22658
23431
  return target;
22659
23432
  }
22660
- function _to_consumable_array$3(arr) {
22661
- return _array_without_holes$3(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$7(arr) || _non_iterable_spread$3();
23433
+ function _to_consumable_array$4(arr) {
23434
+ return _array_without_holes$4(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$8(arr) || _non_iterable_spread$4();
22662
23435
  }
22663
23436
  function _type_of$w(obj) {
22664
23437
  "@swc/helpers - typeof";
22665
23438
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
22666
23439
  }
22667
- function _unsupported_iterable_to_array$7(o, minLen) {
23440
+ function _unsupported_iterable_to_array$8(o, minLen) {
22668
23441
  if (!o) return;
22669
- if (typeof o === "string") return _array_like_to_array$7(o, minLen);
23442
+ if (typeof o === "string") return _array_like_to_array$8(o, minLen);
22670
23443
  var n = Object.prototype.toString.call(o).slice(8, -1);
22671
23444
  if (n === "Object" && o.constructor) n = o.constructor.name;
22672
23445
  if (n === "Map" || n === "Set") return Array.from(n);
22673
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
23446
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$8(o, minLen);
22674
23447
  }
22675
23448
  var __defProp$w = Object.defineProperty;
22676
23449
  var __defNormalProp$w = function __defNormalProp(obj, key, value) {
@@ -23756,20 +24529,20 @@
23756
24529
  if (immediate && this.settings.terminateCommitPayloadField) {
23757
24530
  var field = this.settings.terminateCommitPayloadField;
23758
24531
  if (Array.isArray(finalParams)) {
23759
- finalParams = _to_consumable_array$3(finalParams).concat([
24532
+ finalParams = _to_consumable_array$4(finalParams).concat([
23760
24533
  "".concat(encodeURIComponent(field), "=true")
23761
24534
  ]);
23762
24535
  } else if (finalParams && (typeof finalParams === "undefined" ? "undefined" : _type_of$w(finalParams)) === "object") {
23763
- finalParams = _object_spread_props(_object_spread$7({}, finalParams), _define_property$7({}, field, true));
24536
+ finalParams = _object_spread_props$1(_object_spread$7({}, finalParams), _define_property$7({}, field, true));
23764
24537
  }
23765
24538
  }
23766
24539
  if (this.settings.includeCommitSequence === true) {
23767
24540
  if (Array.isArray(finalParams)) {
23768
- finalParams = _to_consumable_array$3(finalParams).concat([
24541
+ finalParams = _to_consumable_array$4(finalParams).concat([
23769
24542
  "commitSequence=".concat(sequence)
23770
24543
  ]);
23771
24544
  } else if (finalParams && (typeof finalParams === "undefined" ? "undefined" : _type_of$w(finalParams)) === "object") {
23772
- finalParams = _object_spread_props(_object_spread$7({}, finalParams), {
24545
+ finalParams = _object_spread_props$1(_object_spread$7({}, finalParams), {
23773
24546
  commitSequence: sequence
23774
24547
  });
23775
24548
  }
@@ -26385,7 +27158,7 @@
26385
27158
  return NAV;
26386
27159
  }(BaseCMI);
26387
27160
 
26388
- function _array_like_to_array$6(arr, len) {
27161
+ function _array_like_to_array$7(arr, len) {
26389
27162
  if (len == null || len > arr.length) len = arr.length;
26390
27163
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
26391
27164
  return arr2;
@@ -26510,19 +27283,19 @@
26510
27283
  return _set_prototype_of$h(o, p);
26511
27284
  }
26512
27285
  function _sliced_to_array$4(arr, i) {
26513
- return _array_with_holes$4(arr) || _iterable_to_array_limit$4(arr, i) || _unsupported_iterable_to_array$6(arr, i) || _non_iterable_rest$4();
27286
+ return _array_with_holes$4(arr) || _iterable_to_array_limit$4(arr, i) || _unsupported_iterable_to_array$7(arr, i) || _non_iterable_rest$4();
26514
27287
  }
26515
27288
  function _type_of$n(obj) {
26516
27289
  "@swc/helpers - typeof";
26517
27290
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
26518
27291
  }
26519
- function _unsupported_iterable_to_array$6(o, minLen) {
27292
+ function _unsupported_iterable_to_array$7(o, minLen) {
26520
27293
  if (!o) return;
26521
- if (typeof o === "string") return _array_like_to_array$6(o, minLen);
27294
+ if (typeof o === "string") return _array_like_to_array$7(o, minLen);
26522
27295
  var n = Object.prototype.toString.call(o).slice(8, -1);
26523
27296
  if (n === "Object" && o.constructor) n = o.constructor.name;
26524
27297
  if (n === "Map" || n === "Set") return Array.from(n);
26525
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$6(o, minLen);
27298
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
26526
27299
  }
26527
27300
  function _is_native_reflect_construct$h() {
26528
27301
  try {
@@ -27367,7 +28140,7 @@
27367
28140
  ];
27368
28141
  }
27369
28142
 
27370
- function _array_like_to_array$5(arr, len) {
28143
+ function _array_like_to_array$6(arr, len) {
27371
28144
  if (len == null || len > arr.length) len = arr.length;
27372
28145
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
27373
28146
  return arr2;
@@ -27479,7 +28252,7 @@
27479
28252
  return _set_prototype_of$f(o, p);
27480
28253
  }
27481
28254
  function _sliced_to_array$3(arr, i) {
27482
- return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$5(arr, i) || _non_iterable_rest$3();
28255
+ return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$6(arr, i) || _non_iterable_rest$3();
27483
28256
  }
27484
28257
  function _super_prop_base$6(object, property) {
27485
28258
  while(!Object.prototype.hasOwnProperty.call(object, property)){
@@ -27492,13 +28265,13 @@
27492
28265
  "@swc/helpers - typeof";
27493
28266
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
27494
28267
  }
27495
- function _unsupported_iterable_to_array$5(o, minLen) {
28268
+ function _unsupported_iterable_to_array$6(o, minLen) {
27496
28269
  if (!o) return;
27497
- if (typeof o === "string") return _array_like_to_array$5(o, minLen);
28270
+ if (typeof o === "string") return _array_like_to_array$6(o, minLen);
27498
28271
  var n = Object.prototype.toString.call(o).slice(8, -1);
27499
28272
  if (n === "Object" && o.constructor) n = o.constructor.name;
27500
28273
  if (n === "Map" || n === "Set") return Array.from(n);
27501
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$5(o, minLen);
28274
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$6(o, minLen);
27502
28275
  }
27503
28276
  function _is_native_reflect_construct$f() {
27504
28277
  try {
@@ -27823,7 +28596,7 @@
27823
28596
  if (this.initialized && this._id === "") {
27824
28597
  throw new Scorm2004ValidationError(this._cmi_element + ".description", scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
27825
28598
  } else {
27826
- if (check2004ValidFormat(this._cmi_element + ".description", description, scorm2004_regex.CMILangString250, true)) {
28599
+ if (check2004ValidFormat(this._cmi_element + ".description", description, scorm2004_regex.CMILangString, true)) {
27827
28600
  this._description = description;
27828
28601
  }
27829
28602
  }
@@ -28854,7 +29627,7 @@
28854
29627
  if (this.initialized && this._id === "") {
28855
29628
  throw new Scorm2004ValidationError(this._cmi_element + ".description", scorm2004_errors.DEPENDENCY_NOT_ESTABLISHED);
28856
29629
  } else {
28857
- if (check2004ValidFormat(this._cmi_element + ".description", description, scorm2004_regex.CMILangString250, true)) {
29630
+ if (check2004ValidFormat(this._cmi_element + ".description", description, scorm2004_regex.CMILangString, true)) {
28858
29631
  this._description = description;
28859
29632
  }
28860
29633
  }
@@ -32096,13 +32869,13 @@
32096
32869
  return ActivityTree;
32097
32870
  }(BaseCMI);
32098
32871
 
32099
- function _array_like_to_array$4(arr, len) {
32872
+ function _array_like_to_array$5(arr, len) {
32100
32873
  if (len == null || len > arr.length) len = arr.length;
32101
32874
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
32102
32875
  return arr2;
32103
32876
  }
32104
- function _array_without_holes$2(arr) {
32105
- if (Array.isArray(arr)) return _array_like_to_array$4(arr);
32877
+ function _array_without_holes$3(arr) {
32878
+ if (Array.isArray(arr)) return _array_like_to_array$5(arr);
32106
32879
  }
32107
32880
  function _assert_this_initialized$1(self) {
32108
32881
  if (self === void 0) {
@@ -32188,10 +32961,10 @@
32188
32961
  return left instanceof right;
32189
32962
  }
32190
32963
  }
32191
- function _iterable_to_array$2(iter) {
32964
+ function _iterable_to_array$3(iter) {
32192
32965
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
32193
32966
  }
32194
- function _non_iterable_spread$2() {
32967
+ function _non_iterable_spread$3() {
32195
32968
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
32196
32969
  }
32197
32970
  function _object_spread$4(target) {
@@ -32229,20 +33002,20 @@
32229
33002
  }
32230
33003
  return object;
32231
33004
  }
32232
- function _to_consumable_array$2(arr) {
32233
- return _array_without_holes$2(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$4(arr) || _non_iterable_spread$2();
33005
+ function _to_consumable_array$3(arr) {
33006
+ return _array_without_holes$3(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$5(arr) || _non_iterable_spread$3();
32234
33007
  }
32235
33008
  function _type_of$7(obj) {
32236
33009
  "@swc/helpers - typeof";
32237
33010
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
32238
33011
  }
32239
- function _unsupported_iterable_to_array$4(o, minLen) {
33012
+ function _unsupported_iterable_to_array$5(o, minLen) {
32240
33013
  if (!o) return;
32241
- if (typeof o === "string") return _array_like_to_array$4(o, minLen);
33014
+ if (typeof o === "string") return _array_like_to_array$5(o, minLen);
32242
33015
  var n = Object.prototype.toString.call(o).slice(8, -1);
32243
33016
  if (n === "Object" && o.constructor) n = o.constructor.name;
32244
33017
  if (n === "Map" || n === "Set") return Array.from(n);
32245
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
33018
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$5(o, minLen);
32246
33019
  }
32247
33020
  function _is_native_reflect_construct$1() {
32248
33021
  try {
@@ -32370,10 +33143,10 @@
32370
33143
  {
32371
33144
  key: "hideLmsUi",
32372
33145
  get: function get() {
32373
- return _to_consumable_array$2(this._hideLmsUi);
33146
+ return _to_consumable_array$3(this._hideLmsUi);
32374
33147
  },
32375
33148
  set: function set(items) {
32376
- this._hideLmsUi = _to_consumable_array$2(items);
33149
+ this._hideLmsUi = _to_consumable_array$3(items);
32377
33150
  }
32378
33151
  },
32379
33152
  {
@@ -32908,22 +33681,11 @@
32908
33681
  * @returns {string} The evaluated completion status
32909
33682
  */ key: "evaluateCompletionStatus",
32910
33683
  value: function evaluateCompletionStatus() {
32911
- var threshold = this.context.cmi.completion_threshold;
32912
- var progressMeasure = this.context.cmi.progress_measure;
32913
- var storedStatus = this.context.cmi.completion_status;
32914
- if (threshold !== "" && threshold !== null && threshold !== void 0) {
32915
- var thresholdValue = parseFloat(String(threshold));
32916
- if (!isNaN(thresholdValue)) {
32917
- if (progressMeasure !== "" && progressMeasure !== null && progressMeasure !== void 0) {
32918
- var progressValue = parseFloat(String(progressMeasure));
32919
- if (!isNaN(progressValue)) {
32920
- return progressValue >= thresholdValue ? CompletionStatus.COMPLETED : CompletionStatus.INCOMPLETE;
32921
- }
32922
- }
32923
- return CompletionStatus.UNKNOWN;
32924
- }
32925
- }
32926
- return storedStatus || CompletionStatus.UNKNOWN;
33684
+ return evaluateCompletionStatusFromThreshold({
33685
+ completionThreshold: this.context.cmi.completion_threshold,
33686
+ progressMeasure: this.context.cmi.progress_measure,
33687
+ storedCompletionStatus: this.context.cmi.completion_status
33688
+ });
32927
33689
  }
32928
33690
  },
32929
33691
  {
@@ -32964,7 +33726,7 @@
32964
33726
  return Scorm2004CMIHandler;
32965
33727
  }();
32966
33728
 
32967
- function _array_like_to_array$3(arr, len) {
33729
+ function _array_like_to_array$4(arr, len) {
32968
33730
  if (len == null || len > arr.length) len = arr.length;
32969
33731
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
32970
33732
  return arr2;
@@ -32972,8 +33734,8 @@
32972
33734
  function _array_with_holes$2(arr) {
32973
33735
  if (Array.isArray(arr)) return arr;
32974
33736
  }
32975
- function _array_without_holes$1(arr) {
32976
- if (Array.isArray(arr)) return _array_like_to_array$3(arr);
33737
+ function _array_without_holes$2(arr) {
33738
+ if (Array.isArray(arr)) return _array_like_to_array$4(arr);
32977
33739
  }
32978
33740
  function _class_call_check$5(instance, Constructor) {
32979
33741
  if (!(instance instanceof Constructor)) {
@@ -33006,7 +33768,7 @@
33006
33768
  }
33007
33769
  return obj;
33008
33770
  }
33009
- function _iterable_to_array$1(iter) {
33771
+ function _iterable_to_array$2(iter) {
33010
33772
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
33011
33773
  }
33012
33774
  function _iterable_to_array_limit$2(arr, i) {
@@ -33036,7 +33798,7 @@
33036
33798
  function _non_iterable_rest$2() {
33037
33799
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
33038
33800
  }
33039
- function _non_iterable_spread$1() {
33801
+ function _non_iterable_spread$2() {
33040
33802
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
33041
33803
  }
33042
33804
  function _object_spread$3(target) {
@@ -33055,18 +33817,18 @@
33055
33817
  return target;
33056
33818
  }
33057
33819
  function _sliced_to_array$2(arr, i) {
33058
- return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$3(arr, i) || _non_iterable_rest$2();
33820
+ return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$4(arr, i) || _non_iterable_rest$2();
33059
33821
  }
33060
- function _to_consumable_array$1(arr) {
33061
- return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$3(arr) || _non_iterable_spread$1();
33822
+ function _to_consumable_array$2(arr) {
33823
+ return _array_without_holes$2(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$4(arr) || _non_iterable_spread$2();
33062
33824
  }
33063
- function _unsupported_iterable_to_array$3(o, minLen) {
33825
+ function _unsupported_iterable_to_array$4(o, minLen) {
33064
33826
  if (!o) return;
33065
- if (typeof o === "string") return _array_like_to_array$3(o, minLen);
33827
+ if (typeof o === "string") return _array_like_to_array$4(o, minLen);
33066
33828
  var n = Object.prototype.toString.call(o).slice(8, -1);
33067
33829
  if (n === "Object" && o.constructor) n = o.constructor.name;
33068
33830
  if (n === "Map" || n === "Set") return Array.from(n);
33069
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
33831
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
33070
33832
  }
33071
33833
  var SequencingConfigurationBuilder = /*#__PURE__*/ function() {
33072
33834
  function SequencingConfigurationBuilder() {
@@ -33145,6 +33907,9 @@
33145
33907
  if (settings.objectiveSetByContent !== void 0) {
33146
33908
  target.objectiveSetByContent = settings.objectiveSetByContent;
33147
33909
  }
33910
+ if (settings.tracked !== void 0) {
33911
+ target.tracked = settings.tracked;
33912
+ }
33148
33913
  }
33149
33914
  },
33150
33915
  {
@@ -33604,7 +34369,7 @@
33604
34369
  if (!additional || additional.length === 0) {
33605
34370
  return current;
33606
34371
  }
33607
- return this.sanitizeHideLmsUi(_to_consumable_array$1(current).concat(_to_consumable_array$1(additional)));
34372
+ return this.sanitizeHideLmsUi(_to_consumable_array$2(current).concat(_to_consumable_array$2(additional)));
33608
34373
  }
33609
34374
  },
33610
34375
  {
@@ -33672,7 +34437,7 @@
33672
34437
  var seen = /* @__PURE__ */ new Set();
33673
34438
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
33674
34439
  try {
33675
- for(var _iterator = _to_consumable_array$1(existing !== null && existing !== void 0 ? existing : []).concat(_to_consumable_array$1(additions !== null && additions !== void 0 ? additions : []))[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
34440
+ 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){
33676
34441
  var resource = _step.value;
33677
34442
  if (!resource) {
33678
34443
  continue;
@@ -33714,13 +34479,13 @@
33714
34479
  value: function cloneSelectionRandomizationState(state) {
33715
34480
  var clone = {};
33716
34481
  if (state.childOrder) {
33717
- clone.childOrder = _to_consumable_array$1(state.childOrder);
34482
+ clone.childOrder = _to_consumable_array$2(state.childOrder);
33718
34483
  }
33719
34484
  if (state.selectedChildIds) {
33720
- clone.selectedChildIds = _to_consumable_array$1(state.selectedChildIds);
34485
+ clone.selectedChildIds = _to_consumable_array$2(state.selectedChildIds);
33721
34486
  }
33722
34487
  if (state.hiddenFromChoiceChildIds) {
33723
- clone.hiddenFromChoiceChildIds = _to_consumable_array$1(state.hiddenFromChoiceChildIds);
34488
+ clone.hiddenFromChoiceChildIds = _to_consumable_array$2(state.hiddenFromChoiceChildIds);
33724
34489
  }
33725
34490
  if (state.selectionCountStatus !== void 0) {
33726
34491
  clone.selectionCountStatus = state.selectionCountStatus;
@@ -33801,13 +34566,13 @@
33801
34566
  return SequencingConfigurationBuilder;
33802
34567
  }();
33803
34568
 
33804
- function _array_like_to_array$2(arr, len) {
34569
+ function _array_like_to_array$3(arr, len) {
33805
34570
  if (len == null || len > arr.length) len = arr.length;
33806
34571
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
33807
34572
  return arr2;
33808
34573
  }
33809
- function _array_without_holes(arr) {
33810
- if (Array.isArray(arr)) return _array_like_to_array$2(arr);
34574
+ function _array_without_holes$1(arr) {
34575
+ if (Array.isArray(arr)) return _array_like_to_array$3(arr);
33811
34576
  }
33812
34577
  function _class_call_check$4(instance, Constructor) {
33813
34578
  if (!(instance instanceof Constructor)) {
@@ -33827,26 +34592,26 @@
33827
34592
  if (protoProps) _defineProperties$4(Constructor.prototype, protoProps);
33828
34593
  return Constructor;
33829
34594
  }
33830
- function _iterable_to_array(iter) {
34595
+ function _iterable_to_array$1(iter) {
33831
34596
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
33832
34597
  }
33833
- function _non_iterable_spread() {
34598
+ function _non_iterable_spread$1() {
33834
34599
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
33835
34600
  }
33836
- function _to_consumable_array(arr) {
33837
- return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array$2(arr) || _non_iterable_spread();
34601
+ function _to_consumable_array$1(arr) {
34602
+ return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$3(arr) || _non_iterable_spread$1();
33838
34603
  }
33839
34604
  function _type_of$4(obj) {
33840
34605
  "@swc/helpers - typeof";
33841
34606
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
33842
34607
  }
33843
- function _unsupported_iterable_to_array$2(o, minLen) {
34608
+ function _unsupported_iterable_to_array$3(o, minLen) {
33844
34609
  if (!o) return;
33845
- if (typeof o === "string") return _array_like_to_array$2(o, minLen);
34610
+ if (typeof o === "string") return _array_like_to_array$3(o, minLen);
33846
34611
  var n = Object.prototype.toString.call(o).slice(8, -1);
33847
34612
  if (n === "Object" && o.constructor) n = o.constructor.name;
33848
34613
  if (n === "Map" || n === "Set") return Array.from(n);
33849
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
34614
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
33850
34615
  }
33851
34616
  var __defProp$4 = Object.defineProperty;
33852
34617
  var __defNormalProp$4 = function __defNormalProp(obj, key, value) {
@@ -33988,6 +34753,9 @@
33988
34753
  if (activitySettings.sequencingControls) {
33989
34754
  this.sequencingConfigBuilder.applySequencingControlsSettings(activity.sequencingControls, activitySettings.sequencingControls);
33990
34755
  }
34756
+ if (activitySettings.deliveryControls) {
34757
+ this.sequencingConfigBuilder.applySequencingControlsSettings(activity.sequencingControls, activitySettings.deliveryControls);
34758
+ }
33991
34759
  if (activitySettings.sequencingRules) {
33992
34760
  this.sequencingConfigBuilder.applySequencingRulesSettings(activity.sequencingRules, activitySettings.sequencingRules);
33993
34761
  }
@@ -33997,6 +34765,21 @@
33997
34765
  if (activitySettings.rollupConsiderations) {
33998
34766
  activity.applyRollupConsiderations(activitySettings.rollupConsiderations);
33999
34767
  }
34768
+ if (activitySettings.completionThreshold) {
34769
+ var threshold = activitySettings.completionThreshold;
34770
+ if (threshold.completedByMeasure !== void 0) {
34771
+ activity.completedByMeasure = threshold.completedByMeasure;
34772
+ }
34773
+ if (threshold.minProgressMeasure !== void 0) {
34774
+ activity.minProgressMeasure = threshold.minProgressMeasure;
34775
+ activity.completionThreshold = threshold.minProgressMeasure.toString();
34776
+ } else if (threshold.completedByMeasure) {
34777
+ activity.completionThreshold = activity.minProgressMeasure.toString();
34778
+ }
34779
+ if (threshold.progressWeight !== void 0) {
34780
+ activity.progressWeight = threshold.progressWeight;
34781
+ }
34782
+ }
34000
34783
  if (activitySettings.hideLmsUi) {
34001
34784
  var mergedHide = this.sequencingConfigBuilder.mergeHideLmsUi(activity.hideLmsUi, activitySettings.hideLmsUi);
34002
34785
  if (mergedHide.length > 0) {
@@ -34073,7 +34856,7 @@
34073
34856
  for(var _iterator = activity.children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
34074
34857
  var child = _step.value;
34075
34858
  var _ids;
34076
- (_ids = ids).push.apply(_ids, _to_consumable_array(this.extractActivityIds(child)));
34859
+ (_ids = ids).push.apply(_ids, _to_consumable_array$1(this.extractActivityIds(child)));
34077
34860
  }
34078
34861
  } catch (err) {
34079
34862
  _didIteratorError = true;
@@ -34105,19 +34888,19 @@
34105
34888
  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;
34106
34889
  return {
34107
34890
  targetObjectiveID: info.targetObjectiveID,
34108
- readSatisfiedStatus: (_info_readSatisfiedStatus = info.readSatisfiedStatus) !== null && _info_readSatisfiedStatus !== void 0 ? _info_readSatisfiedStatus : false,
34109
- readNormalizedMeasure: (_info_readNormalizedMeasure = info.readNormalizedMeasure) !== null && _info_readNormalizedMeasure !== void 0 ? _info_readNormalizedMeasure : false,
34891
+ readSatisfiedStatus: (_info_readSatisfiedStatus = info.readSatisfiedStatus) !== null && _info_readSatisfiedStatus !== void 0 ? _info_readSatisfiedStatus : true,
34892
+ readNormalizedMeasure: (_info_readNormalizedMeasure = info.readNormalizedMeasure) !== null && _info_readNormalizedMeasure !== void 0 ? _info_readNormalizedMeasure : true,
34110
34893
  writeSatisfiedStatus: (_info_writeSatisfiedStatus = info.writeSatisfiedStatus) !== null && _info_writeSatisfiedStatus !== void 0 ? _info_writeSatisfiedStatus : false,
34111
34894
  writeNormalizedMeasure: (_info_writeNormalizedMeasure = info.writeNormalizedMeasure) !== null && _info_writeNormalizedMeasure !== void 0 ? _info_writeNormalizedMeasure : false,
34112
- readCompletionStatus: (_info_readCompletionStatus = info.readCompletionStatus) !== null && _info_readCompletionStatus !== void 0 ? _info_readCompletionStatus : false,
34895
+ readCompletionStatus: (_info_readCompletionStatus = info.readCompletionStatus) !== null && _info_readCompletionStatus !== void 0 ? _info_readCompletionStatus : true,
34113
34896
  writeCompletionStatus: (_info_writeCompletionStatus = info.writeCompletionStatus) !== null && _info_writeCompletionStatus !== void 0 ? _info_writeCompletionStatus : false,
34114
- readProgressMeasure: (_info_readProgressMeasure = info.readProgressMeasure) !== null && _info_readProgressMeasure !== void 0 ? _info_readProgressMeasure : false,
34897
+ readProgressMeasure: (_info_readProgressMeasure = info.readProgressMeasure) !== null && _info_readProgressMeasure !== void 0 ? _info_readProgressMeasure : true,
34115
34898
  writeProgressMeasure: (_info_writeProgressMeasure = info.writeProgressMeasure) !== null && _info_writeProgressMeasure !== void 0 ? _info_writeProgressMeasure : false,
34116
- readRawScore: (_info_readRawScore = info.readRawScore) !== null && _info_readRawScore !== void 0 ? _info_readRawScore : false,
34899
+ readRawScore: (_info_readRawScore = info.readRawScore) !== null && _info_readRawScore !== void 0 ? _info_readRawScore : true,
34117
34900
  writeRawScore: (_info_writeRawScore = info.writeRawScore) !== null && _info_writeRawScore !== void 0 ? _info_writeRawScore : false,
34118
- readMinScore: (_info_readMinScore = info.readMinScore) !== null && _info_readMinScore !== void 0 ? _info_readMinScore : false,
34901
+ readMinScore: (_info_readMinScore = info.readMinScore) !== null && _info_readMinScore !== void 0 ? _info_readMinScore : true,
34119
34902
  writeMinScore: (_info_writeMinScore = info.writeMinScore) !== null && _info_writeMinScore !== void 0 ? _info_writeMinScore : false,
34120
- readMaxScore: (_info_readMaxScore = info.readMaxScore) !== null && _info_readMaxScore !== void 0 ? _info_readMaxScore : false,
34903
+ readMaxScore: (_info_readMaxScore = info.readMaxScore) !== null && _info_readMaxScore !== void 0 ? _info_readMaxScore : true,
34121
34904
  writeMaxScore: (_info_writeMaxScore = info.writeMaxScore) !== null && _info_writeMaxScore !== void 0 ? _info_writeMaxScore : false,
34122
34905
  updateAttemptData: (_info_updateAttemptData = info.updateAttemptData) !== null && _info_updateAttemptData !== void 0 ? _info_updateAttemptData : false
34123
34906
  };
@@ -34135,7 +34918,7 @@
34135
34918
  return ActivityTreeBuilder;
34136
34919
  }();
34137
34920
 
34138
- function _array_like_to_array$1(arr, len) {
34921
+ function _array_like_to_array$2(arr, len) {
34139
34922
  if (len == null || len > arr.length) len = arr.length;
34140
34923
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
34141
34924
  return arr2;
@@ -34217,19 +35000,19 @@
34217
35000
  return target;
34218
35001
  }
34219
35002
  function _sliced_to_array$1(arr, i) {
34220
- return _array_with_holes$1(arr) || _iterable_to_array_limit$1(arr, i) || _unsupported_iterable_to_array$1(arr, i) || _non_iterable_rest$1();
35003
+ return _array_with_holes$1(arr) || _iterable_to_array_limit$1(arr, i) || _unsupported_iterable_to_array$2(arr, i) || _non_iterable_rest$1();
34221
35004
  }
34222
35005
  function _type_of$3(obj) {
34223
35006
  "@swc/helpers - typeof";
34224
35007
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
34225
35008
  }
34226
- function _unsupported_iterable_to_array$1(o, minLen) {
35009
+ function _unsupported_iterable_to_array$2(o, minLen) {
34227
35010
  if (!o) return;
34228
- if (typeof o === "string") return _array_like_to_array$1(o, minLen);
35011
+ if (typeof o === "string") return _array_like_to_array$2(o, minLen);
34229
35012
  var n = Object.prototype.toString.call(o).slice(8, -1);
34230
35013
  if (n === "Object" && o.constructor) n = o.constructor.name;
34231
35014
  if (n === "Map" || n === "Set") return Array.from(n);
34232
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
35015
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
34233
35016
  }
34234
35017
  var __defProp$3 = Object.defineProperty;
34235
35018
  var __defNormalProp$3 = function __defNormalProp(obj, key, value) {
@@ -34376,9 +35159,12 @@
34376
35159
  *
34377
35160
  * @param {string} objectiveId - The global objective ID
34378
35161
  * @param {CMIObjectivesObject} objective - The CMI objective object with updated values
35162
+ *
35163
+ * @spec SCORM 2004 4th Ed. SN 3.10.3 - global objectives synchronize CMI objective data
35164
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max score fields synchronize independently
34379
35165
  */ key: "updateGlobalObjectiveFromCMI",
34380
35166
  value: function updateGlobalObjectiveFromCMI(objectiveId, objective) {
34381
- var _objective_score;
35167
+ var _objective_score, _objective_score1, _objective_score2, _objective_score3;
34382
35168
  if (!objectiveId || !this.context.sequencingService) {
34383
35169
  return;
34384
35170
  }
@@ -34402,6 +35188,18 @@
34402
35188
  updatePayload.normalizedMeasure = normalizedMeasure;
34403
35189
  updatePayload.normalizedMeasureKnown = true;
34404
35190
  }
35191
+ if (((_objective_score1 = objective.score) === null || _objective_score1 === void 0 ? void 0 : _objective_score1.raw) !== void 0 && objective.score.raw !== "") {
35192
+ updatePayload.rawScore = objective.score.raw;
35193
+ updatePayload.rawScoreKnown = true;
35194
+ }
35195
+ if (((_objective_score2 = objective.score) === null || _objective_score2 === void 0 ? void 0 : _objective_score2.min) !== void 0 && objective.score.min !== "") {
35196
+ updatePayload.minScore = objective.score.min;
35197
+ updatePayload.minScoreKnown = true;
35198
+ }
35199
+ if (((_objective_score3 = objective.score) === null || _objective_score3 === void 0 ? void 0 : _objective_score3.max) !== void 0 && objective.score.max !== "") {
35200
+ updatePayload.maxScore = objective.score.max;
35201
+ updatePayload.maxScoreKnown = true;
35202
+ }
34405
35203
  var progressMeasure = this.parseObjectiveNumber(objective.progress_measure);
34406
35204
  if (progressMeasure !== null) {
34407
35205
  updatePayload.progressMeasure = progressMeasure;
@@ -34423,13 +35221,22 @@
34423
35221
  *
34424
35222
  * @param {CMIObjectivesObject} objective - The CMI objectives object containing data about a specific learning objective.
34425
35223
  * @return {GlobalObjectiveMapEntry} An object containing mapped properties and their values based on the provided objective.
35224
+ *
35225
+ * @spec SCORM 2004 4th Ed. SN 3.10.3 - global objective map entries capture objective state
35226
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max score entries carry per-field known flags
34426
35227
  */ key: "buildObjectiveMapEntryFromCMI",
34427
35228
  value: function buildObjectiveMapEntryFromCMI(objective) {
34428
- var _objective_score;
35229
+ var _objective_score, _objective_score1, _objective_score2, _objective_score3;
34429
35230
  var entry = {
34430
35231
  id: objective.id,
34431
35232
  satisfiedStatusKnown: false,
34432
35233
  normalizedMeasureKnown: false,
35234
+ rawScore: "",
35235
+ rawScoreKnown: false,
35236
+ minScore: "",
35237
+ minScoreKnown: false,
35238
+ maxScore: "",
35239
+ maxScoreKnown: false,
34433
35240
  progressMeasureKnown: false,
34434
35241
  completionStatusKnown: false,
34435
35242
  readSatisfiedStatus: true,
@@ -34439,7 +35246,13 @@
34439
35246
  readCompletionStatus: true,
34440
35247
  writeCompletionStatus: true,
34441
35248
  readProgressMeasure: true,
34442
- writeProgressMeasure: true
35249
+ writeProgressMeasure: true,
35250
+ readRawScore: true,
35251
+ writeRawScore: true,
35252
+ readMinScore: true,
35253
+ writeMinScore: true,
35254
+ readMaxScore: true,
35255
+ writeMaxScore: true
34443
35256
  };
34444
35257
  if (objective.success_status && objective.success_status !== SuccessStatus.UNKNOWN) {
34445
35258
  entry.satisfiedStatus = objective.success_status === SuccessStatus.PASSED;
@@ -34450,6 +35263,18 @@
34450
35263
  entry.normalizedMeasure = normalizedMeasure;
34451
35264
  entry.normalizedMeasureKnown = true;
34452
35265
  }
35266
+ if (((_objective_score1 = objective.score) === null || _objective_score1 === void 0 ? void 0 : _objective_score1.raw) !== void 0 && objective.score.raw !== "") {
35267
+ entry.rawScore = objective.score.raw;
35268
+ entry.rawScoreKnown = true;
35269
+ }
35270
+ if (((_objective_score2 = objective.score) === null || _objective_score2 === void 0 ? void 0 : _objective_score2.min) !== void 0 && objective.score.min !== "") {
35271
+ entry.minScore = objective.score.min;
35272
+ entry.minScoreKnown = true;
35273
+ }
35274
+ if (((_objective_score3 = objective.score) === null || _objective_score3 === void 0 ? void 0 : _objective_score3.max) !== void 0 && objective.score.max !== "") {
35275
+ entry.maxScore = objective.score.max;
35276
+ entry.maxScoreKnown = true;
35277
+ }
34453
35278
  var progressMeasure = this.parseObjectiveNumber(objective.progress_measure);
34454
35279
  if (progressMeasure !== null) {
34455
35280
  entry.progressMeasure = progressMeasure;
@@ -34472,6 +35297,9 @@
34472
35297
  * @return {CMIObjectivesObject[]} An array of `CMIObjectivesObject` instances built
34473
35298
  * from the provided snapshot map. Returns an empty array
34474
35299
  * if the snapshot is invalid or no valid objectives can be created.
35300
+ *
35301
+ * @spec SCORM 2004 4th Ed. SN 3.10.3 - global objective snapshots restore CMI objective state
35302
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max score known fields restore independently
34475
35303
  */ key: "buildCMIObjectivesFromMap",
34476
35304
  value: function buildCMIObjectivesFromMap(snapshot) {
34477
35305
  var objectives = [];
@@ -34495,6 +35323,18 @@
34495
35323
  if (entry.normalizedMeasureKnown === true && normalizedMeasure !== null) {
34496
35324
  objective.score.scaled = String(normalizedMeasure);
34497
35325
  }
35326
+ if (entry.rawScoreKnown === true) {
35327
+ var _entry_rawScore;
35328
+ objective.score.raw = String((_entry_rawScore = entry.rawScore) !== null && _entry_rawScore !== void 0 ? _entry_rawScore : "");
35329
+ }
35330
+ if (entry.minScoreKnown === true) {
35331
+ var _entry_minScore;
35332
+ objective.score.min = String((_entry_minScore = entry.minScore) !== null && _entry_minScore !== void 0 ? _entry_minScore : "");
35333
+ }
35334
+ if (entry.maxScoreKnown === true) {
35335
+ var _entry_maxScore;
35336
+ objective.score.max = String((_entry_maxScore = entry.maxScore) !== null && _entry_maxScore !== void 0 ? _entry_maxScore : "");
35337
+ }
34498
35338
  var progressMeasure = this.parseObjectiveNumber(entry.progressMeasure);
34499
35339
  if (entry.progressMeasureKnown === true && progressMeasure !== null) {
34500
35340
  objective.progress_measure = String(progressMeasure);
@@ -34663,6 +35503,9 @@
34663
35503
  * @param {CompletionStatus} completionStatus
34664
35504
  * @param {SuccessStatus} successStatus
34665
35505
  * @param {ScoreObject} scoreObject
35506
+ *
35507
+ * @spec SCORM 2004 4th Ed. RTE-to-SN Data Transfer - CMI score data updates the current primary objective
35508
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max score data is available for write maps
34666
35509
  */ key: "syncCmiToSequencingActivity",
34667
35510
  value: function syncCmiToSequencingActivity(completionStatus, successStatus, scoreObject) {
34668
35511
  if (!this.context.sequencing) {
@@ -34688,6 +35531,15 @@
34688
35531
  primaryObjective.normalizedMeasure = scoreObject.scaled;
34689
35532
  primaryObjective.measureStatus = true;
34690
35533
  }
35534
+ if ((scoreObject === null || scoreObject === void 0 ? void 0 : scoreObject.raw) !== void 0 && scoreObject.raw !== null) {
35535
+ primaryObjective.rawScore = String(scoreObject.raw);
35536
+ }
35537
+ if ((scoreObject === null || scoreObject === void 0 ? void 0 : scoreObject.min) !== void 0 && scoreObject.min !== null) {
35538
+ primaryObjective.minScore = String(scoreObject.min);
35539
+ }
35540
+ if ((scoreObject === null || scoreObject === void 0 ? void 0 : scoreObject.max) !== void 0 && scoreObject.max !== null) {
35541
+ primaryObjective.maxScore = String(scoreObject.max);
35542
+ }
34691
35543
  }
34692
35544
  },
34693
35545
  {
@@ -35251,7 +36103,7 @@
35251
36103
  return SequencingStatePersistence;
35252
36104
  }();
35253
36105
 
35254
- function _array_like_to_array(arr, len) {
36106
+ function _array_like_to_array$1(arr, len) {
35255
36107
  if (len == null || len > arr.length) len = arr.length;
35256
36108
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
35257
36109
  return arr2;
@@ -35305,19 +36157,19 @@
35305
36157
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
35306
36158
  }
35307
36159
  function _sliced_to_array(arr, i) {
35308
- return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
36160
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array$1(arr, i) || _non_iterable_rest();
35309
36161
  }
35310
36162
  function _type_of$1(obj) {
35311
36163
  "@swc/helpers - typeof";
35312
36164
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
35313
36165
  }
35314
- function _unsupported_iterable_to_array(o, minLen) {
36166
+ function _unsupported_iterable_to_array$1(o, minLen) {
35315
36167
  if (!o) return;
35316
- if (typeof o === "string") return _array_like_to_array(o, minLen);
36168
+ if (typeof o === "string") return _array_like_to_array$1(o, minLen);
35317
36169
  var n = Object.prototype.toString.call(o).slice(8, -1);
35318
36170
  if (n === "Object" && o.constructor) n = o.constructor.name;
35319
36171
  if (n === "Map" || n === "Set") return Array.from(n);
35320
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
36172
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
35321
36173
  }
35322
36174
  var __defProp$1 = Object.defineProperty;
35323
36175
  var __defNormalProp$1 = function __defNormalProp(obj, key, value) {
@@ -35494,6 +36346,14 @@
35494
36346
  return Scorm2004DataSerializer;
35495
36347
  }();
35496
36348
 
36349
+ function _array_like_to_array(arr, len) {
36350
+ if (len == null || len > arr.length) len = arr.length;
36351
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
36352
+ return arr2;
36353
+ }
36354
+ function _array_without_holes(arr) {
36355
+ if (Array.isArray(arr)) return _array_like_to_array(arr);
36356
+ }
35497
36357
  function _assert_this_initialized(self) {
35498
36358
  if (self === void 0) {
35499
36359
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
@@ -35591,6 +36451,12 @@
35591
36451
  return left instanceof right;
35592
36452
  }
35593
36453
  }
36454
+ function _iterable_to_array(iter) {
36455
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
36456
+ }
36457
+ function _non_iterable_spread() {
36458
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
36459
+ }
35594
36460
  function _object_spread(target) {
35595
36461
  for(var i = 1; i < arguments.length; i++){
35596
36462
  var source = arguments[i] != null ? arguments[i] : {};
@@ -35606,6 +36472,25 @@
35606
36472
  }
35607
36473
  return target;
35608
36474
  }
36475
+ function ownKeys(object, enumerableOnly) {
36476
+ var keys = Object.keys(object);
36477
+ if (Object.getOwnPropertySymbols) {
36478
+ var symbols = Object.getOwnPropertySymbols(object);
36479
+ keys.push.apply(keys, symbols);
36480
+ }
36481
+ return keys;
36482
+ }
36483
+ function _object_spread_props(target, source) {
36484
+ source = source != null ? source : {};
36485
+ if (Object.getOwnPropertyDescriptors) {
36486
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
36487
+ } else {
36488
+ ownKeys(Object(source)).forEach(function(key) {
36489
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
36490
+ });
36491
+ }
36492
+ return target;
36493
+ }
35609
36494
  function _possible_constructor_return(self, call) {
35610
36495
  if (call && (_type_of(call) === "object" || typeof call === "function")) {
35611
36496
  return call;
@@ -35619,10 +36504,21 @@
35619
36504
  };
35620
36505
  return _set_prototype_of(o, p);
35621
36506
  }
36507
+ function _to_consumable_array(arr) {
36508
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
36509
+ }
35622
36510
  function _type_of(obj) {
35623
36511
  "@swc/helpers - typeof";
35624
36512
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
35625
36513
  }
36514
+ function _unsupported_iterable_to_array(o, minLen) {
36515
+ if (!o) return;
36516
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
36517
+ var n = Object.prototype.toString.call(o).slice(8, -1);
36518
+ if (n === "Object" && o.constructor) n = o.constructor.name;
36519
+ if (n === "Map" || n === "Set") return Array.from(n);
36520
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
36521
+ }
35626
36522
  function _is_native_reflect_construct() {
35627
36523
  try {
35628
36524
  var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
@@ -35885,9 +36781,250 @@
35885
36781
  var _this_cmi, _this_adl;
35886
36782
  this.commonReset(settings);
35887
36783
  (_this_cmi = this.cmi) === null || _this_cmi === void 0 ? void 0 : _this_cmi.reset();
36784
+ this.applyCurrentActivityLaunchData();
35888
36785
  (_this_adl = this.adl) === null || _this_adl === void 0 ? void 0 : _this_adl.reset();
35889
36786
  }
35890
36787
  },
36788
+ {
36789
+ /**
36790
+ * Apply launch-static activity data to CMI while the new SCO is pre-initialize.
36791
+ *
36792
+ * @spec SCORM 2004 4th Ed. RTE 4.2.5, Table 4.2.5a - cmi.completion_threshold
36793
+ * @spec SCORM 2004 4th Ed. RTE 4.2.17, Table 4.2.17a - cmi.objectives
36794
+ */ key: "applyCurrentActivityLaunchData",
36795
+ value: function applyCurrentActivityLaunchData() {
36796
+ var _this__sequencing;
36797
+ var currentActivity = (_this__sequencing = this._sequencing) === null || _this__sequencing === void 0 ? void 0 : _this__sequencing.getCurrentActivity();
36798
+ if (!currentActivity) {
36799
+ return;
36800
+ }
36801
+ this.applyActivityLaunchData(currentActivity);
36802
+ }
36803
+ },
36804
+ {
36805
+ /**
36806
+ * Apply launch-static CMI data when sequencing delivers a new activity before SCO Initialize.
36807
+ *
36808
+ * @spec SCORM 2004 4th Ed. SN DB.2 - Content Delivery Environment Process establishes the delivered activity.
36809
+ * @spec SCORM 2004 4th Ed. RTE 4.2.5, Table 4.2.5a - cmi.completion_threshold is initialized before SCO access.
36810
+ * @spec SCORM 2004 4th Ed. RTE 4.2.17, Table 4.2.17a - cmi.objectives is initialized before SCO access.
36811
+ */ key: "applyDeliveredActivityLaunchData",
36812
+ value: function applyDeliveredActivityLaunchData(activity) {
36813
+ if (!this.isNotInitialized()) {
36814
+ return;
36815
+ }
36816
+ this.applyActivityLaunchData(activity);
36817
+ }
36818
+ },
36819
+ {
36820
+ /**
36821
+ * Copy the delivered activity's static launch data into the fresh CMI model.
36822
+ *
36823
+ * @spec SCORM 2004 4th Ed. RTE 4.2.5, Table 4.2.5a - cmi.completion_threshold
36824
+ * @spec SCORM 2004 4th Ed. RTE 4.2.17, Table 4.2.17a - cmi.objectives
36825
+ */ key: "applyActivityLaunchData",
36826
+ value: function applyActivityLaunchData(currentActivity) {
36827
+ var _ref, _ref1;
36828
+ var _this__sequencing_overallSequencingProcess, _currentActivity_completionThreshold;
36829
+ if (!this.cmi) {
36830
+ return;
36831
+ }
36832
+ var contentActivityData = (_this__sequencing_overallSequencingProcess = this._sequencing.overallSequencingProcess) === null || _this__sequencing_overallSequencingProcess === void 0 ? void 0 : _this__sequencing_overallSequencingProcess.getContentActivityData(currentActivity);
36833
+ 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 : "";
36834
+ this.cmi.completion_threshold = completionThreshold;
36835
+ this.seedCurrentActivityObjectives(currentActivity);
36836
+ }
36837
+ },
36838
+ {
36839
+ /**
36840
+ * Seed CMI objective ids after Initialize when automatic sequencing starts during Initialize.
36841
+ *
36842
+ * @spec SCORM 2004 4th Ed. RTE 4.2.17, Table 4.2.17a - cmi.objectives
36843
+ */ key: "applyCurrentActivityObjectiveData",
36844
+ value: function applyCurrentActivityObjectiveData() {
36845
+ var _this__sequencing;
36846
+ var currentActivity = (_this__sequencing = this._sequencing) === null || _this__sequencing === void 0 ? void 0 : _this__sequencing.getCurrentActivity();
36847
+ if (!this.cmi || !currentActivity) {
36848
+ return;
36849
+ }
36850
+ this.seedCurrentActivityObjectives(currentActivity);
36851
+ }
36852
+ },
36853
+ {
36854
+ /**
36855
+ * Seed CMI objectives from primary and secondary activity objectives.
36856
+ *
36857
+ * @spec SCORM 2004 4th Ed. RTE 4.2.17 - Initialization of Run-Time Objectives from Sequencing Information
36858
+ * @spec SCORM 2004 4th Ed. RTE 4.2.17, Table 4.2.17a - cmi.objectives.n.id and success_status
36859
+ * @spec SCORM 2004 4th Ed. SN 3.10.3 / ADLSEQ objectives extension - objective read maps seed the RTE view
36860
+ */ key: "seedCurrentActivityObjectives",
36861
+ value: function seedCurrentActivityObjectives(currentActivity) {
36862
+ var _activityObjectives;
36863
+ var activityObjectives = [];
36864
+ if (currentActivity.primaryObjective) {
36865
+ activityObjectives.push(currentActivity.primaryObjective);
36866
+ }
36867
+ (_activityObjectives = activityObjectives).push.apply(_activityObjectives, _to_consumable_array(currentActivity.objectives));
36868
+ var seededObjectiveIds = /* @__PURE__ */ new Set();
36869
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
36870
+ try {
36871
+ for(var _iterator = activityObjectives[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
36872
+ var activityObjective = _step.value;
36873
+ var objectiveId = this.getSeedableObjectiveId(activityObjective);
36874
+ if (!objectiveId || seededObjectiveIds.has(objectiveId)) {
36875
+ continue;
36876
+ }
36877
+ seededObjectiveIds.add(objectiveId);
36878
+ var index = this.findOrSeedCMIObjective(objectiveId);
36879
+ if (index === null) {
36880
+ continue;
36881
+ }
36882
+ var cmiObjective = this.cmi.objectives.findObjectiveByIndex(index);
36883
+ if (cmiObjective && this.cmi.objectives.initialized && !cmiObjective.initialized) {
36884
+ cmiObjective.initialize();
36885
+ }
36886
+ var successStatus = this.getActivityObjectiveSuccessStatus(activityObjective);
36887
+ if (successStatus) {
36888
+ this._commonSetCMIValue("SeedActivityObjective", true, "cmi.objectives.".concat(index, ".success_status"), successStatus);
36889
+ }
36890
+ this.seedObjectiveReadMapValues(currentActivity, activityObjective, index);
36891
+ }
36892
+ } catch (err) {
36893
+ _didIteratorError = true;
36894
+ _iteratorError = err;
36895
+ } finally{
36896
+ try {
36897
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
36898
+ _iterator.return();
36899
+ }
36900
+ } finally{
36901
+ if (_didIteratorError) {
36902
+ throw _iteratorError;
36903
+ }
36904
+ }
36905
+ }
36906
+ }
36907
+ },
36908
+ {
36909
+ /**
36910
+ * Seed CMI objective fields from this objective's read-mapped global objectives.
36911
+ *
36912
+ * @spec SCORM 2004 4th Ed. RTE 4.2.17 - Run-Time Objectives are initialized from sequencing information
36913
+ * @spec SCORM 2004 4th Ed. SN 3.10.3 - read mapInfo grants access to mapped global objective state
36914
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max score read maps seed RTE score fields
36915
+ */ key: "seedObjectiveReadMapValues",
36916
+ value: function seedObjectiveReadMapValues(currentActivity, activityObjective, objectiveIndex) {
36917
+ var _this__sequencing_overallSequencingProcess;
36918
+ var globalObjectiveMap = (_this__sequencing_overallSequencingProcess = this._sequencing.overallSequencingProcess) === null || _this__sequencing_overallSequencingProcess === void 0 ? void 0 : _this__sequencing_overallSequencingProcess.getGlobalObjectiveMap();
36919
+ if (!globalObjectiveMap || activityObjective.mapInfo.length === 0) {
36920
+ return;
36921
+ }
36922
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
36923
+ try {
36924
+ for(var _iterator = activityObjective.mapInfo[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
36925
+ var mapInfo = _step.value;
36926
+ var targetObjectiveId = mapInfo.targetObjectiveID || activityObjective.id;
36927
+ var globalObjective = globalObjectiveMap.get(targetObjectiveId);
36928
+ if (!globalObjective) {
36929
+ continue;
36930
+ }
36931
+ var readState = GlobalObjectiveSynchronizer.getGlobalObjectiveReadState(currentActivity, activityObjective, mapInfo, globalObjective);
36932
+ this.applyObjectiveReadStateToCMI(objectiveIndex, readState);
36933
+ }
36934
+ } catch (err) {
36935
+ _didIteratorError = true;
36936
+ _iteratorError = err;
36937
+ } finally{
36938
+ try {
36939
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
36940
+ _iterator.return();
36941
+ }
36942
+ } finally{
36943
+ if (_didIteratorError) {
36944
+ throw _iteratorError;
36945
+ }
36946
+ }
36947
+ }
36948
+ }
36949
+ },
36950
+ {
36951
+ /**
36952
+ * Copy mapped global objective state into the seeded CMI objective entry.
36953
+ *
36954
+ * @spec SCORM 2004 4th Ed. RTE 4.2.17, Table 4.2.17a - cmi.objectives launch-time initialization
36955
+ * @spec SCORM 2004 4th Ed. SN 3.10.3 - read maps populate the RTE view without creating local writes
36956
+ * @spec SCORM 2004 4th Ed. ADLSEQ objectives extension - raw/min/max score read maps populate CMI objective scores
36957
+ */ key: "applyObjectiveReadStateToCMI",
36958
+ value: function applyObjectiveReadStateToCMI(objectiveIndex, readState) {
36959
+ if (readState.satisfiedStatus !== void 0) {
36960
+ this._commonSetCMIValue("SeedActivityObjectiveReadMap", true, "cmi.objectives.".concat(objectiveIndex, ".success_status"), readState.satisfiedStatus ? SuccessStatus.PASSED : SuccessStatus.FAILED);
36961
+ }
36962
+ if (readState.normalizedMeasure !== void 0) {
36963
+ this._commonSetCMIValue("SeedActivityObjectiveReadMap", true, "cmi.objectives.".concat(objectiveIndex, ".score.scaled"), String(readState.normalizedMeasure));
36964
+ }
36965
+ if (readState.completionStatus !== void 0) {
36966
+ this._commonSetCMIValue("SeedActivityObjectiveReadMap", true, "cmi.objectives.".concat(objectiveIndex, ".completion_status"), readState.completionStatus);
36967
+ }
36968
+ if (readState.progressMeasure !== void 0) {
36969
+ this._commonSetCMIValue("SeedActivityObjectiveReadMap", true, "cmi.objectives.".concat(objectiveIndex, ".progress_measure"), String(readState.progressMeasure));
36970
+ }
36971
+ if (readState.rawScore !== void 0) {
36972
+ this._commonSetCMIValue("SeedActivityObjectiveReadMap", true, "cmi.objectives.".concat(objectiveIndex, ".score.raw"), readState.rawScore);
36973
+ }
36974
+ if (readState.minScore !== void 0) {
36975
+ this._commonSetCMIValue("SeedActivityObjectiveReadMap", true, "cmi.objectives.".concat(objectiveIndex, ".score.min"), readState.minScore);
36976
+ }
36977
+ if (readState.maxScore !== void 0) {
36978
+ this._commonSetCMIValue("SeedActivityObjectiveReadMap", true, "cmi.objectives.".concat(objectiveIndex, ".score.max"), readState.maxScore);
36979
+ }
36980
+ }
36981
+ },
36982
+ {
36983
+ /**
36984
+ * Return a manifest-defined objective id that can initialize cmi.objectives.n.id.
36985
+ *
36986
+ * @spec SCORM 2004 4th Ed. RTE 4.2.17, Table 4.2.17a - cmi.objectives.n.id
36987
+ */ key: "getSeedableObjectiveId",
36988
+ value: function getSeedableObjectiveId(activityObjective) {
36989
+ var objectiveId = activityObjective.id;
36990
+ if (typeof objectiveId !== "string" || objectiveId.trim() === "") {
36991
+ return null;
36992
+ }
36993
+ return objectiveId;
36994
+ }
36995
+ },
36996
+ {
36997
+ /**
36998
+ * Find an existing CMI objective id or create the next CMI objective array entry.
36999
+ *
37000
+ * @spec SCORM 2004 4th Ed. RTE 4.2.17, Table 4.2.17a - cmi.objectives._count
37001
+ * @spec SCORM 2004 4th Ed. RTE 4.2.17, Table 4.2.17a - cmi.objectives.n.id
37002
+ */ key: "findOrSeedCMIObjective",
37003
+ value: function findOrSeedCMIObjective(objectiveId) {
37004
+ var existingIndex = this.cmi.objectives.childArray.findIndex(function(objective) {
37005
+ return objective.id === objectiveId;
37006
+ });
37007
+ if (existingIndex >= 0) {
37008
+ return existingIndex;
37009
+ }
37010
+ var index = this.cmi.objectives.childArray.length;
37011
+ var result = this._commonSetCMIValue("SeedActivityObjective", true, "cmi.objectives.".concat(index, ".id"), objectiveId);
37012
+ return result === global_constants.SCORM_TRUE ? index : null;
37013
+ }
37014
+ },
37015
+ {
37016
+ /**
37017
+ * Translate a known activity objective satisfied status to cmi.objectives.n.success_status.
37018
+ *
37019
+ * @spec SCORM 2004 4th Ed. RTE 4.2.17, Table 4.2.17a - cmi.objectives.n.success_status
37020
+ */ key: "getActivityObjectiveSuccessStatus",
37021
+ value: function getActivityObjectiveSuccessStatus(activityObjective) {
37022
+ if (activityObjective.progressStatus || activityObjective.satisfiedStatusKnown) {
37023
+ return activityObjective.satisfiedStatus ? SuccessStatus.PASSED : SuccessStatus.FAILED;
37024
+ }
37025
+ return null;
37026
+ }
37027
+ },
35891
37028
  {
35892
37029
  key: "version",
35893
37030
  get: /**
@@ -35975,6 +37112,7 @@
35975
37112
  var result = this.initialize("Initialize", "LMS was already initialized!", "LMS is already finished!");
35976
37113
  if (result === global_constants.SCORM_TRUE && this._sequencingService) {
35977
37114
  this._sequencingService.initialize();
37115
+ this.applyCurrentActivityObjectiveData();
35978
37116
  }
35979
37117
  if (result === global_constants.SCORM_TRUE) {
35980
37118
  this._globalObjectiveManager.restoreGlobalObjectivesToCMI();
@@ -36254,7 +37392,7 @@
36254
37392
  objective_id = objective ? objective.id : void 0;
36255
37393
  }
36256
37394
  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));
36257
- if (is_global) {
37395
+ if (is_global && this.currentActivityAllowsGlobalObjectiveWrites()) {
36258
37396
  var _this__globalObjectiveManager_findOrCreateGlobalObjective = this._globalObjectiveManager.findOrCreateGlobalObjective(objective_id), global_index = _this__globalObjectiveManager_findOrCreateGlobalObjective.index;
36259
37397
  var global_element = CMIElement.replace(element_base, "_globalObjectives.".concat(global_index));
36260
37398
  this._commonSetCMIValue("SetGlobalObjectiveValue", true, global_element, value);
@@ -36269,6 +37407,18 @@
36269
37407
  },
36270
37408
  {
36271
37409
  /**
37410
+ * Return whether the current activity can update shared global objectives.
37411
+ *
37412
+ * @spec SCORM 2004 4th Ed. SN 3.13.1 Tracked - when False, the LMS
37413
+ * "does not initialize, manage or access any tracking status information".
37414
+ */ key: "currentActivityAllowsGlobalObjectiveWrites",
37415
+ value: function currentActivityAllowsGlobalObjectiveWrites() {
37416
+ var _this__sequencing_getCurrentActivity, _this__sequencing;
37417
+ 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;
37418
+ }
37419
+ },
37420
+ {
37421
+ /**
36272
37422
  * Gets or builds a new child element to add to the array
36273
37423
  * @param {string} CMIElement
36274
37424
  * @param {any} value
@@ -36448,14 +37598,14 @@
36448
37598
  if (this.cmi.mode === "normal") {
36449
37599
  if (this.cmi.credit === "credit") {
36450
37600
  if (this.cmi.completion_threshold && this.cmi.progress_measure) {
36451
- if (this.cmi.progress_measure >= this.cmi.completion_threshold) {
37601
+ if (parseFloat(this.cmi.progress_measure) >= parseFloat(this.cmi.completion_threshold)) {
36452
37602
  this.cmi.completion_status = "completed";
36453
37603
  } else {
36454
37604
  this.cmi.completion_status = "incomplete";
36455
37605
  }
36456
37606
  }
36457
37607
  if (this.cmi.scaled_passing_score && this.cmi.score.scaled) {
36458
- if (this.cmi.score.scaled >= this.cmi.scaled_passing_score) {
37608
+ if (parseFloat(this.cmi.score.scaled) >= parseFloat(this.cmi.scaled_passing_score)) {
36459
37609
  this.cmi.success_status = "passed";
36460
37610
  } else {
36461
37611
  this.cmi.success_status = "failed";
@@ -36610,9 +37760,7 @@
36610
37760
  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"
36611
37761
  };
36612
37762
  this._sequencingService = new SequencingService(this._sequencing, this.cmi, this.adl, this.eventService || this, this.loggingService, sequencingConfig);
36613
- if (settings === null || settings === void 0 ? void 0 : (_settings_sequencing5 = settings.sequencing) === null || _settings_sequencing5 === void 0 ? void 0 : _settings_sequencing5.eventListeners) {
36614
- this._sequencingService.setEventListeners(settings.sequencing.eventListeners);
36615
- }
37763
+ 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));
36616
37764
  this._globalObjectiveManager.updateSequencingService(this._sequencingService);
36617
37765
  this._dataSerializer.updateSequencingService(this._sequencingService);
36618
37766
  if (settings === null || settings === void 0 ? void 0 : settings.sequencingStatePersistence) {
@@ -36637,6 +37785,25 @@
36637
37785
  },
36638
37786
  {
36639
37787
  /**
37788
+ * Wrap LMS-provided sequencing listeners with API-owned delivery bookkeeping.
37789
+ *
37790
+ * @spec SCORM 2004 4th Ed. SN DB.2 - Content Delivery Environment Process
37791
+ * @spec SCORM 2004 4th Ed. RTE 4.2.5, Table 4.2.5a - cmi.completion_threshold
37792
+ * @spec SCORM 2004 4th Ed. RTE 4.2.17, Table 4.2.17a - cmi.objectives
37793
+ */ key: "buildSequencingEventListeners",
37794
+ value: function buildSequencingEventListeners(listeners) {
37795
+ var _this = this;
37796
+ return _object_spread_props(_object_spread({}, listeners), {
37797
+ onActivityDelivery: function onActivityDelivery(activity) {
37798
+ var _listeners_onActivityDelivery;
37799
+ _this.applyDeliveredActivityLaunchData(activity);
37800
+ listeners === null || listeners === void 0 ? void 0 : (_listeners_onActivityDelivery = listeners.onActivityDelivery) === null || _listeners_onActivityDelivery === void 0 ? void 0 : _listeners_onActivityDelivery.call(listeners, activity);
37801
+ }
37802
+ });
37803
+ }
37804
+ },
37805
+ {
37806
+ /**
36640
37807
  * Get the sequencing service
36641
37808
  * @return {SequencingService | null}
36642
37809
  */ key: "getSequencingService",
@@ -36648,10 +37815,13 @@
36648
37815
  /**
36649
37816
  * Set sequencing event listeners
36650
37817
  * @param {SequencingEventListeners} listeners
37818
+ *
37819
+ * @spec SCORM 2004 4th Ed. SN DB.2 - Content Delivery Environment Process
37820
+ * @spec SCORM 2004 4th Ed. RTE 4.2.5 / 4.2.17 - launch-static CMI data
36651
37821
  */ key: "setSequencingEventListeners",
36652
37822
  value: function setSequencingEventListeners(listeners) {
36653
37823
  if (this._sequencingService) {
36654
- this._sequencingService.setEventListeners(listeners);
37824
+ this._sequencingService.setEventListeners(this.buildSequencingEventListeners(listeners));
36655
37825
  }
36656
37826
  }
36657
37827
  },