@citolab/qti-components 10.0.0-next.26 → 10.0.0-next.28

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 (39) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +175 -175
  3. package/dist/{chunk-H64MGZJL.js → chunk-4IWT7GLA.js} +20 -6
  4. package/dist/chunk-4IWT7GLA.js.map +1 -0
  5. package/dist/{chunk-7BJVE7IH.js → chunk-566LB3G2.js} +2 -2
  6. package/dist/{chunk-2QF6T7FA.js → chunk-ADTCTKXS.js} +2 -2
  7. package/dist/{chunk-5JTQVUTU.js → chunk-BBP7QV32.js} +2 -2
  8. package/dist/{chunk-LUHBGVAR.js → chunk-CFTWXYBO.js} +2 -2
  9. package/dist/{chunk-NBOEBR5K.js → chunk-EECRJEZ3.js} +4 -4
  10. package/dist/{chunk-USZE6XSO.js → chunk-GAPMCYR5.js} +2 -2
  11. package/dist/{chunk-CGHYZJEV.js → chunk-HFLK46W3.js} +2 -2
  12. package/dist/{chunk-QBIO62XN.js → chunk-O2XRZPKA.js} +119 -13
  13. package/dist/chunk-O2XRZPKA.js.map +1 -0
  14. package/dist/corrections.d.ts +3 -3
  15. package/dist/corrections.js +5 -5
  16. package/dist/elements.js +3 -3
  17. package/dist/index.d.ts +4 -4
  18. package/dist/index.js +9 -9
  19. package/dist/item.js +3 -3
  20. package/dist/loader.js +2 -2
  21. package/dist/{qti-test-state-D-edVvB3.d.ts → qti-test-state-CzLBgPCW.d.ts} +6 -2
  22. package/dist/{qti-test-state.d-D8Q89RzZ.d.ts → qti-test-state.d-CjvdranT.d.ts} +5 -1
  23. package/dist/{qti-test.d-BKYGTOLJ.d.ts → qti-test.d-BPYBrsWS.d.ts} +2 -2
  24. package/dist/{qti-transform-test.d-aWMjo4ZA.d.ts → qti-transform-test.d-CtNaWJr8.d.ts} +7 -0
  25. package/dist/test-plugin-api.d.ts +2 -2
  26. package/dist/test.d.ts +6 -6
  27. package/dist/test.js +4 -4
  28. package/dist/transformers.d.ts +1 -1
  29. package/dist/transformers.js +1 -1
  30. package/package.json +4 -4
  31. package/dist/chunk-H64MGZJL.js.map +0 -1
  32. package/dist/chunk-QBIO62XN.js.map +0 -1
  33. /package/dist/{chunk-7BJVE7IH.js.map → chunk-566LB3G2.js.map} +0 -0
  34. /package/dist/{chunk-2QF6T7FA.js.map → chunk-ADTCTKXS.js.map} +0 -0
  35. /package/dist/{chunk-5JTQVUTU.js.map → chunk-BBP7QV32.js.map} +0 -0
  36. /package/dist/{chunk-LUHBGVAR.js.map → chunk-CFTWXYBO.js.map} +0 -0
  37. /package/dist/{chunk-NBOEBR5K.js.map → chunk-EECRJEZ3.js.map} +0 -0
  38. /package/dist/{chunk-USZE6XSO.js.map → chunk-GAPMCYR5.js.map} +0 -0
  39. /package/dist/{chunk-CGHYZJEV.js.map → chunk-HFLK46W3.js.map} +0 -0
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-7ISPUOJG.js";
9
9
  import {
10
10
  QtiModalFeedback
11
- } from "./chunk-USZE6XSO.js";
11
+ } from "./chunk-GAPMCYR5.js";
12
12
  import {
13
13
  listenPublic
14
14
  } from "./chunk-UCXLDQYA.js";
@@ -21,7 +21,7 @@ import {
21
21
  import {
22
22
  qtiTransformItem,
23
23
  qtiTransformTest
24
- } from "./chunk-QBIO62XN.js";
24
+ } from "./chunk-O2XRZPKA.js";
25
25
  import {
26
26
  INITIAL_SESSION_CONTEXT,
27
27
  INITIAL_TEST_CONTEXT,
@@ -2701,7 +2701,8 @@ var TestBaseMixin = (superClass) => {
2701
2701
  * The test context is replaced rather than changed in place, so its consumers update and
2702
2702
  * `qc-test-state-changed` fires.
2703
2703
  *
2704
- * @param itemRefID The `qti-assessment-item-ref` identifier, not the item's own identifier.
2704
+ * @param itemRefID The `qti-assessment-item-ref` identifier, not the item's own identifier; a
2705
+ * `with-replacement` clone's instance id (`item-3#2`).
2705
2706
  * @param state Opaque per-interaction state keyed by response identifier, e.g. a PCI's `getState()`.
2706
2707
  */
2707
2708
  updateItemVariables(itemRefID, values, state6) {
@@ -2915,6 +2916,7 @@ var TestStateMixin = (superClass) => {
2915
2916
  #apply(state6) {
2916
2917
  for (const saved of state6.test.items)
2917
2918
  this.updateItemVariables(saved.identifier, saved.variables, saved.state);
2919
+ this.#warnLeftOut(state6);
2918
2920
  const savedOutcomes = new Map(state6.test.outcomes.map((outcome) => [outcome.identifier, outcome.value]));
2919
2921
  this.testContext = {
2920
2922
  ...this.testContext,
@@ -2926,6 +2928,18 @@ var TestStateMixin = (superClass) => {
2926
2928
  plugins: state6.session.plugins && typeof state6.session.plugins === "object" ? { ...state6.session.plugins } : {}
2927
2929
  };
2928
2930
  }
2931
+ /**
2932
+ * Answers for items this test does not present are not restored, and the next state leaves them
2933
+ * out: a selection (`qti-selection`) that leaves an item out, or a revised test. Said, not silent
2934
+ * (roadmap 1 T4, `plans/host-api.md` → Decided).
2935
+ */
2936
+ #warnLeftOut(state6) {
2937
+ const presented = new Set(this.testContext.items.map((item) => item.identifier));
2938
+ const leftOut = state6.test.items.map((item) => item.identifier).filter((identifier) => !presented.has(identifier));
2939
+ if (leftOut.length === 0)
2940
+ return;
2941
+ console.warn(`[qti-test] The state has answers for items this test does not present (not selected, or no longer in it); they are not restored: ${leftOut.join(", ")}.`);
2942
+ }
2929
2943
  /** A stored position may point at an item or section a revised test no longer has. */
2930
2944
  #validSession(session) {
2931
2945
  const exists = (selector, id) => !!id && !!this._testElement?.querySelector(`${selector}[identifier="${CSS.escape(id)}"]`);
@@ -3110,7 +3124,7 @@ var TestContainer = class extends LitElement11 {
3110
3124
  return;
3111
3125
  try {
3112
3126
  const explicitSeed = this.qtiContext?.QTI_CONTEXT?.seed;
3113
- let api = (await qtiTransformTest().load(this.testURL)).shuffleOrdering(explicitSeed);
3127
+ let api = (await qtiTransformTest().load(this.testURL)).applySelection(explicitSeed).shuffleOrdering(explicitSeed);
3114
3128
  const qtiTest = this.testHost;
3115
3129
  if (qtiTest?.postLoadTestTransformCallback) {
3116
3130
  const tempDoc = api.htmlDoc(this.#resolvedCustomElementRegistry ?? void 0);
@@ -3146,7 +3160,7 @@ var TestContainer = class extends LitElement11 {
3146
3160
  return;
3147
3161
  try {
3148
3162
  const explicitSeed = this.qtiContext?.QTI_CONTEXT?.seed;
3149
- this.#setTestDoc(qtiTransformTest().parse(this.testXML).shuffleOrdering(explicitSeed).htmlDoc(this.#resolvedCustomElementRegistry ?? void 0));
3163
+ this.#setTestDoc(qtiTransformTest().parse(this.testXML).applySelection(explicitSeed).shuffleOrdering(explicitSeed).htmlDoc(this.#resolvedCustomElementRegistry ?? void 0));
3150
3164
  } catch (error) {
3151
3165
  console.error("Error parsing XML:", error);
3152
3166
  }
@@ -4090,4 +4104,4 @@ export {
4090
4104
  * Portions Copyright (c) 2013, the Dart project authors.
4091
4105
  *)
4092
4106
  */
4093
- //# sourceMappingURL=chunk-H64MGZJL.js.map
4107
+ //# sourceMappingURL=chunk-4IWT7GLA.js.map