@citolab/qti-components 10.0.0-next.25 → 10.0.0-next.27
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-NUQLOK6X.js → chunk-EA7UK4NL.js} +4 -4
- package/dist/{chunk-WEJ4JRVR.js → chunk-EGN2SVIN.js} +2 -2
- package/dist/{chunk-GMLW5X4H.js → chunk-EWX4R46G.js} +2 -2
- package/dist/{chunk-2GCQCSOR.js → chunk-FEWA5I3V.js} +160 -55
- package/dist/chunk-FEWA5I3V.js.map +1 -0
- package/dist/{chunk-H6EDN5OK.js → chunk-GYWC44CE.js} +2 -2
- package/dist/{chunk-GGFX2IUD.js → chunk-HZCPYU53.js} +2 -2
- package/dist/{chunk-IDHMEWR7.js → chunk-I2UB2NOX.js} +2 -2
- package/dist/{chunk-3DBCO7ZD.js → chunk-THV42AHU.js} +18 -5
- package/dist/{chunk-3DBCO7ZD.js.map → chunk-THV42AHU.js.map} +1 -1
- package/dist/{chunk-4BWV6P7P.js → chunk-U5HL4SF3.js} +2 -2
- package/dist/corrections.d.ts +2 -2
- package/dist/corrections.js +5 -5
- package/dist/elements.js +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +9 -9
- package/dist/item.js +3 -3
- package/dist/loader.js +2 -2
- package/dist/{qti-test.d-BKYGTOLJ.d.ts → qti-test.d-0fARwLm2.d.ts} +1 -1
- package/dist/{qti-transform-test.d-aWMjo4ZA.d.ts → qti-transform-test.d-CtNaWJr8.d.ts} +7 -0
- package/dist/test.d.ts +3 -3
- 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-2GCQCSOR.js.map +0 -1
- /package/dist/{chunk-NUQLOK6X.js.map → chunk-EA7UK4NL.js.map} +0 -0
- /package/dist/{chunk-WEJ4JRVR.js.map → chunk-EGN2SVIN.js.map} +0 -0
- /package/dist/{chunk-GMLW5X4H.js.map → chunk-EWX4R46G.js.map} +0 -0
- /package/dist/{chunk-H6EDN5OK.js.map → chunk-GYWC44CE.js.map} +0 -0
- /package/dist/{chunk-GGFX2IUD.js.map → chunk-HZCPYU53.js.map} +0 -0
- /package/dist/{chunk-IDHMEWR7.js.map → chunk-I2UB2NOX.js.map} +0 -0
- /package/dist/{chunk-4BWV6P7P.js.map → chunk-U5HL4SF3.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-HZCPYU53.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-FEWA5I3V.js";
|
|
25
25
|
import {
|
|
26
26
|
INITIAL_SESSION_CONTEXT,
|
|
27
27
|
INITIAL_TEST_CONTEXT,
|
|
@@ -2915,6 +2915,7 @@ var TestStateMixin = (superClass) => {
|
|
|
2915
2915
|
#apply(state6) {
|
|
2916
2916
|
for (const saved of state6.test.items)
|
|
2917
2917
|
this.updateItemVariables(saved.identifier, saved.variables, saved.state);
|
|
2918
|
+
this.#warnLeftOut(state6);
|
|
2918
2919
|
const savedOutcomes = new Map(state6.test.outcomes.map((outcome) => [outcome.identifier, outcome.value]));
|
|
2919
2920
|
this.testContext = {
|
|
2920
2921
|
...this.testContext,
|
|
@@ -2926,6 +2927,18 @@ var TestStateMixin = (superClass) => {
|
|
|
2926
2927
|
plugins: state6.session.plugins && typeof state6.session.plugins === "object" ? { ...state6.session.plugins } : {}
|
|
2927
2928
|
};
|
|
2928
2929
|
}
|
|
2930
|
+
/**
|
|
2931
|
+
* Answers for items this test does not present are not restored, and the next state leaves them
|
|
2932
|
+
* out: a selection (`qti-selection`) that leaves an item out, or a revised test. Said, not silent
|
|
2933
|
+
* (roadmap 1 T4, `plans/host-api.md` → Decided).
|
|
2934
|
+
*/
|
|
2935
|
+
#warnLeftOut(state6) {
|
|
2936
|
+
const presented = new Set(this.testContext.items.map((item) => item.identifier));
|
|
2937
|
+
const leftOut = state6.test.items.map((item) => item.identifier).filter((identifier) => !presented.has(identifier));
|
|
2938
|
+
if (leftOut.length === 0)
|
|
2939
|
+
return;
|
|
2940
|
+
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(", ")}.`);
|
|
2941
|
+
}
|
|
2929
2942
|
/** A stored position may point at an item or section a revised test no longer has. */
|
|
2930
2943
|
#validSession(session) {
|
|
2931
2944
|
const exists = (selector, id) => !!id && !!this._testElement?.querySelector(`${selector}[identifier="${CSS.escape(id)}"]`);
|
|
@@ -3110,7 +3123,7 @@ var TestContainer = class extends LitElement11 {
|
|
|
3110
3123
|
return;
|
|
3111
3124
|
try {
|
|
3112
3125
|
const explicitSeed = this.qtiContext?.QTI_CONTEXT?.seed;
|
|
3113
|
-
let api = (await qtiTransformTest().load(this.testURL)).shuffleOrdering(explicitSeed);
|
|
3126
|
+
let api = (await qtiTransformTest().load(this.testURL)).applySelection(explicitSeed).shuffleOrdering(explicitSeed);
|
|
3114
3127
|
const qtiTest = this.testHost;
|
|
3115
3128
|
if (qtiTest?.postLoadTestTransformCallback) {
|
|
3116
3129
|
const tempDoc = api.htmlDoc(this.#resolvedCustomElementRegistry ?? void 0);
|
|
@@ -3146,7 +3159,7 @@ var TestContainer = class extends LitElement11 {
|
|
|
3146
3159
|
return;
|
|
3147
3160
|
try {
|
|
3148
3161
|
const explicitSeed = this.qtiContext?.QTI_CONTEXT?.seed;
|
|
3149
|
-
this.#setTestDoc(qtiTransformTest().parse(this.testXML).shuffleOrdering(explicitSeed).htmlDoc(this.#resolvedCustomElementRegistry ?? void 0));
|
|
3162
|
+
this.#setTestDoc(qtiTransformTest().parse(this.testXML).applySelection(explicitSeed).shuffleOrdering(explicitSeed).htmlDoc(this.#resolvedCustomElementRegistry ?? void 0));
|
|
3150
3163
|
} catch (error) {
|
|
3151
3164
|
console.error("Error parsing XML:", error);
|
|
3152
3165
|
}
|
|
@@ -4090,4 +4103,4 @@ export {
|
|
|
4090
4103
|
* Portions Copyright (c) 2013, the Dart project authors.
|
|
4091
4104
|
*)
|
|
4092
4105
|
*/
|
|
4093
|
-
//# sourceMappingURL=chunk-
|
|
4106
|
+
//# sourceMappingURL=chunk-THV42AHU.js.map
|