@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.
- package/cdn/index.global.js +1 -1
- package/cdn/index.js +175 -175
- package/dist/{chunk-H64MGZJL.js → chunk-4IWT7GLA.js} +20 -6
- package/dist/chunk-4IWT7GLA.js.map +1 -0
- package/dist/{chunk-7BJVE7IH.js → chunk-566LB3G2.js} +2 -2
- package/dist/{chunk-2QF6T7FA.js → chunk-ADTCTKXS.js} +2 -2
- package/dist/{chunk-5JTQVUTU.js → chunk-BBP7QV32.js} +2 -2
- package/dist/{chunk-LUHBGVAR.js → chunk-CFTWXYBO.js} +2 -2
- package/dist/{chunk-NBOEBR5K.js → chunk-EECRJEZ3.js} +4 -4
- package/dist/{chunk-USZE6XSO.js → chunk-GAPMCYR5.js} +2 -2
- package/dist/{chunk-CGHYZJEV.js → chunk-HFLK46W3.js} +2 -2
- package/dist/{chunk-QBIO62XN.js → chunk-O2XRZPKA.js} +119 -13
- package/dist/chunk-O2XRZPKA.js.map +1 -0
- package/dist/corrections.d.ts +3 -3
- package/dist/corrections.js +5 -5
- package/dist/elements.js +3 -3
- package/dist/index.d.ts +4 -4
- package/dist/index.js +9 -9
- package/dist/item.js +3 -3
- package/dist/loader.js +2 -2
- package/dist/{qti-test-state-D-edVvB3.d.ts → qti-test-state-CzLBgPCW.d.ts} +6 -2
- package/dist/{qti-test-state.d-D8Q89RzZ.d.ts → qti-test-state.d-CjvdranT.d.ts} +5 -1
- package/dist/{qti-test.d-BKYGTOLJ.d.ts → qti-test.d-BPYBrsWS.d.ts} +2 -2
- package/dist/{qti-transform-test.d-aWMjo4ZA.d.ts → qti-transform-test.d-CtNaWJr8.d.ts} +7 -0
- package/dist/test-plugin-api.d.ts +2 -2
- package/dist/test.d.ts +6 -6
- package/dist/test.js +4 -4
- package/dist/transformers.d.ts +1 -1
- package/dist/transformers.js +1 -1
- package/package.json +4 -4
- package/dist/chunk-H64MGZJL.js.map +0 -1
- package/dist/chunk-QBIO62XN.js.map +0 -1
- /package/dist/{chunk-7BJVE7IH.js.map → chunk-566LB3G2.js.map} +0 -0
- /package/dist/{chunk-2QF6T7FA.js.map → chunk-ADTCTKXS.js.map} +0 -0
- /package/dist/{chunk-5JTQVUTU.js.map → chunk-BBP7QV32.js.map} +0 -0
- /package/dist/{chunk-LUHBGVAR.js.map → chunk-CFTWXYBO.js.map} +0 -0
- /package/dist/{chunk-NBOEBR5K.js.map → chunk-EECRJEZ3.js.map} +0 -0
- /package/dist/{chunk-USZE6XSO.js.map → chunk-GAPMCYR5.js.map} +0 -0
- /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-
|
|
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-
|
|
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-
|
|
4107
|
+
//# sourceMappingURL=chunk-4IWT7GLA.js.map
|