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

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 (43) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +182 -182
  3. package/dist/base.d.ts +2 -2
  4. package/dist/{chunk-TSJGL6FI.js → chunk-2QF6T7FA.js} +2 -2
  5. package/dist/{chunk-KQ2LED4X.js → chunk-5JTQVUTU.js} +2 -2
  6. package/dist/{chunk-2A52V5TQ.js → chunk-7BJVE7IH.js} +2 -2
  7. package/dist/{chunk-HUM7ST4L.js → chunk-7ISPUOJG.js} +12 -2
  8. package/dist/chunk-7ISPUOJG.js.map +1 -0
  9. package/dist/{chunk-FP3KXADH.js → chunk-CGHYZJEV.js} +2 -2
  10. package/dist/{chunk-2NHZOI3W.js → chunk-H64MGZJL.js} +8 -6
  11. package/dist/{chunk-2NHZOI3W.js.map → chunk-H64MGZJL.js.map} +1 -1
  12. package/dist/{chunk-XWRZP2RM.js → chunk-LUHBGVAR.js} +2 -2
  13. package/dist/{chunk-DU6RX3TX.js → chunk-NBOEBR5K.js} +4 -4
  14. package/dist/{chunk-ZRORBAHB.js → chunk-QBIO62XN.js} +120 -51
  15. package/dist/chunk-QBIO62XN.js.map +1 -0
  16. package/dist/{chunk-H6DO5UHC.js → chunk-USZE6XSO.js} +2 -2
  17. package/dist/{computed.types.d-6qQNFbu1.d.ts → computed.types.d-DcAfzw8v.d.ts} +7 -0
  18. package/dist/corrections.d.ts +3 -3
  19. package/dist/corrections.js +6 -6
  20. package/dist/elements.js +3 -3
  21. package/dist/index.d.ts +4 -4
  22. package/dist/index.js +13 -10
  23. package/dist/item.js +3 -3
  24. package/dist/loader.js +2 -2
  25. package/dist/{qti-test-state-C71K8UNC.d.ts → qti-test-state-D-edVvB3.d.ts} +11 -2
  26. package/dist/{qti-test.d-DADK63uc.d.ts → qti-test.d-BKYGTOLJ.d.ts} +2 -2
  27. package/dist/{qti-transform-test.d-Bb9vnLzP.d.ts → qti-transform-test.d-aWMjo4ZA.d.ts} +1 -0
  28. package/dist/test-plugin-api.d.ts +2 -2
  29. package/dist/test-plugin-api.js +3 -1
  30. package/dist/test.d.ts +6 -6
  31. package/dist/test.js +8 -5
  32. package/dist/transformers.d.ts +1 -1
  33. package/dist/transformers.js +1 -1
  34. package/package.json +4 -4
  35. package/dist/chunk-HUM7ST4L.js.map +0 -1
  36. package/dist/chunk-ZRORBAHB.js.map +0 -1
  37. /package/dist/{chunk-TSJGL6FI.js.map → chunk-2QF6T7FA.js.map} +0 -0
  38. /package/dist/{chunk-KQ2LED4X.js.map → chunk-5JTQVUTU.js.map} +0 -0
  39. /package/dist/{chunk-2A52V5TQ.js.map → chunk-7BJVE7IH.js.map} +0 -0
  40. /package/dist/{chunk-FP3KXADH.js.map → chunk-CGHYZJEV.js.map} +0 -0
  41. /package/dist/{chunk-XWRZP2RM.js.map → chunk-LUHBGVAR.js.map} +0 -0
  42. /package/dist/{chunk-DU6RX3TX.js.map → chunk-NBOEBR5K.js.map} +0 -0
  43. /package/dist/{chunk-H6DO5UHC.js.map → chunk-USZE6XSO.js.map} +0 -0
package/dist/base.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { C as ComputedItemContext } from './session.context.d-9gRdGK4T.js';
2
2
  export { I as INITIAL_SESSION_CONTEXT, S as SessionContext, V as View, s as sessionContext } from './session.context.d-9gRdGK4T.js';
3
- import { C as ComputedContext } from './computed.types.d-6qQNFbu1.js';
4
- export { a as ComputedItem, S as SessionControl } from './computed.types.d-6qQNFbu1.js';
3
+ import { C as ComputedContext } from './computed.types.d-DcAfzw8v.js';
4
+ export { a as ComputedItem, S as SessionControl } from './computed.types.d-DcAfzw8v.js';
5
5
  export { C as ConfigContext, V as ValidationDisplayMode, c as configContext } from './config.context.d-Dm11aAuw.js';
6
6
  export { C as ChoiceRole, I as Interaction, a as InteractionContext, R as RecordFieldValues, b as RecordValue, V as ValidityKind, c as ValidityTrigger, i as inferRecordFieldBaseType, d as interactionContext, e as isRecordValue, r as readRecordFieldValues } from './record.d-N1Bq7e1f.js';
7
7
  import { I as ItemContext } from './item.types.d-Zc6ZQDhu.js';
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  qtiContentElements
3
- } from "./chunk-H6DO5UHC.js";
3
+ } from "./chunk-USZE6XSO.js";
4
4
 
5
5
  // ../qti-elements/dist/register.js
6
6
  for (const { tag, ctor } of qtiContentElements) {
@@ -8,4 +8,4 @@ for (const { tag, ctor } of qtiContentElements) {
8
8
  customElements.define(tag, ctor);
9
9
  }
10
10
  }
11
- //# sourceMappingURL=chunk-TSJGL6FI.js.map
11
+ //# sourceMappingURL=chunk-2QF6T7FA.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  qtiItemElements
3
- } from "./chunk-2A52V5TQ.js";
3
+ } from "./chunk-7BJVE7IH.js";
4
4
 
5
5
  // ../qti-item/dist/register.js
6
6
  for (const { tag, ctor } of qtiItemElements) {
@@ -8,4 +8,4 @@ for (const { tag, ctor } of qtiItemElements) {
8
8
  customElements.define(tag, ctor);
9
9
  }
10
10
  }
11
- //# sourceMappingURL=chunk-KQ2LED4X.js.map
11
+ //# sourceMappingURL=chunk-5JTQVUTU.js.map
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-4DB4SC5K.js";
7
7
  import {
8
8
  qtiTransformItem
9
- } from "./chunk-ZRORBAHB.js";
9
+ } from "./chunk-QBIO62XN.js";
10
10
  import {
11
11
  computedItemContext,
12
12
  configContext,
@@ -349,4 +349,4 @@ export {
349
349
  QtiItem,
350
350
  qtiItemElements
351
351
  };
352
- //# sourceMappingURL=chunk-2A52V5TQ.js.map
352
+ //# sourceMappingURL=chunk-7BJVE7IH.js.map
@@ -187,6 +187,15 @@ var buttonPrimary = css`
187
187
  }
188
188
  `;
189
189
 
190
+ // ../qti-test/dist/items-in-order.js
191
+ var itemsInOrder = (testPart) => {
192
+ const items = testPart.sections.flatMap((section) => section.items);
193
+ if (!testPart.itemOrder)
194
+ return items;
195
+ const byIdentifier = new Map(items.map((item) => [item.identifier, item]));
196
+ return testPart.itemOrder.flatMap((identifier) => byIdentifier.get(identifier) ?? []);
197
+ };
198
+
190
199
  export {
191
200
  PUBLIC_EVENTS,
192
201
  dispatchPublic,
@@ -194,6 +203,7 @@ export {
194
203
  control,
195
204
  button,
196
205
  buttonPrimary,
197
- styles_exports
206
+ styles_exports,
207
+ itemsInOrder
198
208
  };
199
- //# sourceMappingURL=chunk-HUM7ST4L.js.map
209
+ //# sourceMappingURL=chunk-7ISPUOJG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../qti-test/src/public-events.ts","../../qti-test/src/components/styles.ts","../../qti-test/src/items-in-order.ts"],"sourcesContent":["import { dispatchDeclared, listenDeclared } from '@qti-components/elements/public-events';\n\nimport type { View } from '@qti-components/base';\nimport type { PublicEventDeclaration } from '@qti-components/elements/public-events';\nimport type { QtiTestState } from './types/qti-test-state';\n\n/**\n * The public events of the test. The name tells you it is public: everything here starts with\n * `qc-`; every other event is internal plumbing and may change in any release.\n *\n * Requests are verbs (a host or plugin dispatches them at the test), notifications are past tense\n * (the test dispatches them). All bubble and are composed.\n *\n * `deprecated` is the `cito-` name this event had in 9.x; an event new in 10.0 has none. One helper\n * (`dispatchPublic`, `listenPublic`) sends or handles both names until the next major, then the field\n * goes. The 7.x names (`qti-request-navigation`, `test-end-attempt`, `on-test-switch-view`, …) are no\n * longer sent or handled.\n */\nexport interface NavigationTarget {\n type: 'item' | 'section';\n id: string;\n}\n\nexport interface NavigationFailure {\n message: string;\n details?: unknown;\n itemId?: string;\n sectionId?: string;\n}\n\n/** The detail of `qc-test-state-refused`. */\nexport interface StateRefusal {\n /** Why the state was not read. */\n message: string;\n /** The value that was assigned to `state`, as given. */\n state: unknown;\n}\n\nexport interface PublicEventMap {\n 'qc-test-navigate': CustomEvent<NavigationTarget>;\n /**\n * Ends an attempt: processes the response of the item-ref `itemId`, or, without it, of the item on\n * screen. `<test-end-attempt>` sends the `itemId` of the item it is stamped into or names.\n */\n 'qc-test-end-attempt': CustomEvent<{ itemId?: string }>;\n /** Scores the test: resets its outcomes to their defaults, runs outcome processing, then `qc-test-submitted`. */\n 'qc-test-submit': CustomEvent<Record<string, never>>;\n 'qc-test-update-outcome': CustomEvent<{\n assessmentItemRefId: string;\n outcomeVariableId: string;\n value: number | string;\n }>;\n 'qc-test-switch-view': CustomEvent<View>;\n /** `value` is JSON; `null` or `undefined` removes the plugin's entry. */\n 'qc-test-update-plugin-state': CustomEvent<{ plugin: string; value: unknown }>;\n /** Outcome processing ran after a submit: read the test outcomes now. */\n 'qc-test-submitted': CustomEvent<Record<string, never>>;\n 'qc-test-navigated': CustomEvent<NavigationTarget>;\n 'qc-test-navigation-started': CustomEvent<NavigationTarget>;\n 'qc-test-navigation-failed': CustomEvent<NavigationFailure>;\n 'qc-test-rendered': CustomEvent<{ identifier: string; element: Element }[]>;\n // `qc-test-loaded` (detail: the `QtiAssessmentTest`) is added by qti-assessment-test.ts, so this\n // module imports no element: that import would be a cycle.\n 'qc-test-state-changed': CustomEvent<QtiTestState>;\n /** A value assigned to `state` could not be read and was ignored: the test goes on without it. */\n 'qc-test-state-refused': CustomEvent<StateRefusal>;\n 'qc-test-items-skipped': CustomEvent<{ ids: string[] }>;\n 'qc-test-end-reached': CustomEvent<Record<string, never>>;\n 'qc-item-ref-connected': CustomEvent<{ identifier: string; href: string; category: string }>;\n}\n\nexport type PublicEventName = keyof PublicEventMap;\n\nexport const PUBLIC_EVENTS: Record<PublicEventName, PublicEventDeclaration> = {\n 'qc-test-navigate': { kind: 'request', scope: 'test', deprecated: 'cito-test-navigate' },\n 'qc-test-end-attempt': { kind: 'request', scope: 'test', deprecated: 'cito-test-end-attempt' },\n 'qc-test-submit': { kind: 'request', scope: 'test', deprecated: 'cito-test-submit' },\n 'qc-test-update-outcome': { kind: 'request', scope: 'test', deprecated: 'cito-test-update-outcome' },\n 'qc-test-update-plugin-state': { kind: 'request', scope: 'test', deprecated: 'cito-test-update-plugin-state' },\n 'qc-test-switch-view': { kind: 'request', scope: 'test', deprecated: 'cito-test-switch-view' },\n 'qc-test-submitted': { kind: 'notification', scope: 'test', deprecated: 'cito-test-submitted' },\n 'qc-test-navigated': { kind: 'notification', scope: 'test', deprecated: 'cito-test-navigated' },\n 'qc-test-navigation-started': { kind: 'notification', scope: 'test', deprecated: 'cito-test-navigation-started' },\n 'qc-test-navigation-failed': { kind: 'notification', scope: 'test', deprecated: 'cito-test-navigation-failed' },\n 'qc-test-rendered': { kind: 'notification', scope: 'test', deprecated: 'cito-test-rendered' },\n 'qc-test-loaded': { kind: 'notification', scope: 'test', deprecated: 'cito-test-loaded' },\n 'qc-test-state-changed': { kind: 'notification', scope: 'test', deprecated: 'cito-test-state-changed' },\n // New in 10.0, so it has no cito- name.\n 'qc-test-state-refused': { kind: 'notification', scope: 'test' },\n 'qc-test-items-skipped': { kind: 'notification', scope: 'test', deprecated: 'cito-test-items-skipped' },\n 'qc-test-end-reached': { kind: 'notification', scope: 'test', deprecated: 'cito-test-end-reached' },\n 'qc-item-ref-connected': { kind: 'notification', scope: 'item', deprecated: 'cito-item-ref-connected' }\n};\n\ndeclare global {\n interface HTMLElementEventMap extends PublicEventMap {}\n}\n\n/**\n * Dispatch a public event, and its deprecated name with the same `detail` object. The detail is\n * always an object so `listenPublic` can tell the two apart from one dispatch.\n */\nexport function dispatchPublic<K extends PublicEventName>(\n target: EventTarget,\n name: K,\n detail: PublicEventMap[K] extends CustomEvent<infer D> ? D : never\n): void {\n dispatchDeclared(target, PUBLIC_EVENTS, name, detail);\n}\n\n/**\n * Listen for a public event and its deprecated name; the handler runs once for a sender that\n * dispatched both. See `listenDeclared`.\n */\nexport function listenPublic<K extends PublicEventName>(\n target: EventTarget,\n name: K,\n handler: (e: PublicEventMap[K]) => void\n): void {\n listenDeclared(target, PUBLIC_EVENTS, name, handler as (e: Event) => void);\n}\n","// /* eslint-disable lit-plugin(no-invalid-css) */\nimport { css, html } from 'lit';\n\n/*\n * The resting look of the test controls (next, prev, item/section links, TTS buttons).\n *\n * Two looks, both plain: a neutral one (the page's surface, the theme's border, the surrounding text\n * colour) and a filled one that `test-next` wears, in the theme's neutral colour with its content\n * colour on top. No shadow, no glow, no transition, so the controls read as unbranded until a host\n * repaints them.\n *\n * Every colour is the theme's tier 1 (CONTRACT.md §8 in qti-theme): `--qc-*` first, the older\n * `--cito-*` name as its fallback for this major, and a CSS system colour behind both for a page\n * that loads no theme: Canvas and CanvasText follow the page's color-scheme, so the controls stay\n * legible in dark mode without the theme too. Hover and press mix the content colour into the\n * fill, by --qti-hover-mix and --qti-active-mix.\n *\n * Paint comes from the `--button-*` slots, the one button slot set the theme's `@mixin paint button`\n * reads too, so a host that repaints its buttons repaints the test controls, the end-attempt and the\n * upload button alike. The older `--test-button-*` names are aliases: each slot is read as\n * `var(--button-X, var(--test-button-X, <default>))`. Never the shared `--qti-component-*` tokens:\n * those also paint the items' own borders, and a change to how a button looks must not move an\n * interaction.\n *\n * --button-size, --button-border-radius the box\n * --button-background-color, --button-color, --button-border-color,\n * --button-hover-background-color, --button-active-background-color\n * the neutral look, and the filled look's slots\n * --button-primary-background-color, --button-primary-color,\n * --button-primary-hover-background-color, --button-primary-active-background-color\n * the filled look only\n * --button-selected-background-color, --button-selected-color\n * a toggle that is on (the host carries :state(selected))\n *\n * --test-button-<same> aliases of the names above\n */\n\nconst surface = css`var(--qti-color-base-100, var(--qc-color-base-100, var(--cito-color-base-100, Canvas)))`;\nconst content = css`var(--qti-color-base-content, var(--qc-color-base-content, var(--cito-color-base-content, CanvasText)))`;\nconst neutral = css`var(--qti-color-neutral, var(--qc-color-neutral, var(--cito-color-neutral, CanvasText)))`;\nconst neutralContent = css`var(--qti-color-neutral-content, var(--qc-color-neutral-content, var(--cito-color-neutral-content, Canvas)))`;\nconst radius = css`var(--button-border-radius, var(--test-button-border-radius, var(--qti-radius-field, var(--qc-radius-field, var(--cito-radius-field, 0.2rem)))))`;\nconst borderWidth = css`var(--qti-border-width, var(--qc-border-width, var(--cito-border-width, 1px)))`;\n\n/*\n * A test control is drawn on an inner element (`.control`, part \"button\"), never on its host.\n *\n * A page's reset, Tailwind's preflight for one (`*, ::before, ::after { margin: 0; padding: 0; border: 0 solid }`),\n * is a rule of the page, and a page rule beats the `:host` rules of a shadow root whatever its layer or its\n * specificity. A control that paints its padding and border on the host loses them to such a reset. The\n * inner element lives in the shadow tree, where the page's `*` does not reach, so the control looks the same with\n * or without a reset. The host keeps only what a reset leaves alone: its display, the radius its focus ring\n * follows, and the cursor.\n */\nexport const hostBox = css`\n display: inline-flex;\n cursor: pointer;\n user-select: none;\n border-radius: ${radius};\n`;\n\n/** The box of the control itself: the inner element. */\nexport const form = css`\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n justify-content: center;\n gap: 0.375em;\n box-sizing: border-box;\n min-block-size: var(--button-size, var(--test-button-size, 2.25rem));\n padding: 0 0.875rem;\n font: inherit;\n line-height: 1.25;\n cursor: pointer;\n user-select: none;\n border-radius: ${radius};\n`;\n\nexport const btn = css`\n ${form};\n background-color: var(--button-background-color, var(--test-button-background-color, ${surface}));\n color: var(--button-color, var(--test-button-color, inherit));\n border: ${borderWidth} solid\n var(\n --button-border-color,\n var(--test-button-border-color, var(--qti-border-color, color-mix(in oklab, ${content} 45%, ${surface})))\n );\n`;\n\n/** The filled look: the neutral colour, its content colour on top. Same box as `btn`, so the two sit level. */\nexport const btnPrimary = css`\n background-color: var(--button-primary-background-color, var(--test-button-primary-background-color, ${neutral}));\n color: var(--button-primary-color, var(--test-button-primary-color, ${neutralContent}));\n border-color: var(--button-primary-background-color, var(--test-button-primary-background-color, ${neutral}));\n`;\n\n/** Hover; paint only, so the box never moves. */\nexport const btnInteractive = css`\n background-color: var(\n --button-hover-background-color,\n var(--test-button-hover-background-color, color-mix(in oklab, ${surface}, ${content} var(--qti-hover-mix, 8%)))\n );\n`;\n\nexport const btnPrimaryInteractive = css`\n background-color: var(\n --button-primary-hover-background-color,\n var(\n --test-button-primary-hover-background-color,\n color-mix(in oklab, ${neutral}, ${neutralContent} var(--qti-hover-mix, 8%))\n )\n );\n`;\n\n/** Pressed: the same mix, twice as far. Paint only, so a click never moves the button. */\nexport const btnActive = css`\n background-color: var(\n --button-active-background-color,\n var(--test-button-active-background-color, color-mix(in oklab, ${surface}, ${content} var(--qti-active-mix, 16%)))\n );\n`;\n\nexport const btnPrimaryActive = css`\n background-color: var(\n --button-primary-active-background-color,\n var(\n --test-button-primary-active-background-color,\n color-mix(in oklab, ${neutral}, ${neutralContent} var(--qti-active-mix, 16%))\n )\n );\n`;\n\n/** The theme's one focus ring (qti-theme `@mixin foc`), so a page shows one kind of ring. */\nexport const focusRing = css`\n outline: var(--qti-focus-border-width, 2px) solid var(--qti-focus-color, Highlight);\n outline-offset: var(--qti-focus-offset, 2px);\n`;\n\nexport const dis = css`\n cursor: not-allowed;\n opacity: 0.45;\n`;\n\nexport const ind = css`\n ${form};\n border: ${borderWidth} solid var(--qti-border-color, GrayText);\n`;\n\n/** What a test control renders: the inner element that carries the look (see `hostBox`). */\nexport const control = html`<span class=\"control\" part=\"button\"><slot></slot></span>`;\n\n/**\n * The stylesheet of a neutral test control: the host box, the look on `.control`, and its hover, press,\n * focus and disabled states. A control with its own content (a bookmark's icon) adds to it.\n */\nexport const button = css`\n :host {\n ${hostBox};\n }\n .control {\n ${btn};\n }\n @media (hover: hover) and (pointer: fine) {\n :host(:hover:not([disabled])) .control {\n ${btnInteractive};\n }\n }\n :host(:active:not([disabled])) .control {\n ${btnActive};\n }\n /* The press the theme gives a choice (qti-motion.css), from the same knob: a touch smaller while\n the button is down, springing back on release; 0 motion means no press. */\n .control {\n transition:\n background-color calc(200ms * var(--qti-motion, 1)) cubic-bezier(0.2, 0, 0, 1),\n scale calc(200ms * var(--qti-motion, 1)) cubic-bezier(0.2, 0, 0, 1);\n }\n :host(:active:not([disabled])) .control {\n scale: calc(1 - 0.03 * var(--qti-motion, 1));\n }\n :host(:focus-visible) {\n ${focusRing};\n }\n :host([disabled]) {\n ${dis};\n }\n :host([disabled]) .control {\n cursor: not-allowed;\n }\n`;\n\n/** The filled look of `test-next`: add after `button`, so its rules win at equal specificity. */\nexport const buttonPrimary = css`\n .control {\n ${btnPrimary};\n }\n @media (hover: hover) and (pointer: fine) {\n :host(:hover:not([disabled])) .control {\n ${btnPrimaryInteractive};\n }\n }\n :host(:active:not([disabled])) .control {\n ${btnPrimaryActive};\n }\n`;\n","import type { ComputedContext, ComputedItem } from '@qti-components/base';\n\n/**\n * The items of a test part in the order the candidate takes them: the test's document order, info\n * items included. Flattening `testPart.sections` is not that order when a section's item-refs and\n * subsections interleave, since `sections` lists every section once, depth first.\n *\n * A part without `itemOrder` (a context built by hand) gives its sections' items as they are listed.\n */\nexport const itemsInOrder = (testPart: ComputedContext['testParts'][number]): ComputedItem[] => {\n const items = testPart.sections.flatMap(section => section.items);\n if (!testPart.itemOrder) return items;\n const byIdentifier = new Map(items.map(item => [item.identifier, item]));\n return testPart.itemOrder.flatMap(identifier => byIdentifier.get(identifier) ?? []);\n};\n"],"mappings":"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","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  qtiTestElements
3
- } from "./chunk-2NHZOI3W.js";
3
+ } from "./chunk-H64MGZJL.js";
4
4
 
5
5
  // ../qti-test/dist/register.js
6
6
  for (const { tag, ctor } of qtiTestElements) {
@@ -8,4 +8,4 @@ for (const { tag, ctor } of qtiTestElements) {
8
8
  customElements.define(tag, ctor);
9
9
  }
10
10
  }
11
- //# sourceMappingURL=chunk-FP3KXADH.js.map
11
+ //# sourceMappingURL=chunk-CGHYZJEV.js.map
@@ -3,11 +3,12 @@ import {
3
3
  buttonPrimary,
4
4
  control,
5
5
  dispatchPublic,
6
+ itemsInOrder,
6
7
  listenPublic as listenPublic2
7
- } from "./chunk-HUM7ST4L.js";
8
+ } from "./chunk-7ISPUOJG.js";
8
9
  import {
9
10
  QtiModalFeedback
10
- } from "./chunk-H6DO5UHC.js";
11
+ } from "./chunk-USZE6XSO.js";
11
12
  import {
12
13
  listenPublic
13
14
  } from "./chunk-UCXLDQYA.js";
@@ -20,7 +21,7 @@ import {
20
21
  import {
21
22
  qtiTransformItem,
22
23
  qtiTransformTest
23
- } from "./chunk-ZRORBAHB.js";
24
+ } from "./chunk-QBIO62XN.js";
24
25
  import {
25
26
  INITIAL_SESSION_CONTEXT,
26
27
  INITIAL_TEST_CONTEXT,
@@ -3528,6 +3529,7 @@ var TestNavigation = class extends LitElement13 {
3528
3529
  navigationMode: testPart.navigationMode,
3529
3530
  submissionMode: testPart.submissionMode,
3530
3531
  allowSkipping: testPart.sessionControl.allowSkipping,
3532
+ itemOrder: itemRefsInOrder(testPart.sections).map((item) => item.identifier),
3531
3533
  // Flat, depth first: every section once, each with only its own item-refs, so every item is
3532
3534
  // listed once. Where a section's item-refs and subsections interleave, this list is not in
3533
3535
  // document order; `index` is.
@@ -3919,7 +3921,7 @@ var TestNext = class extends LitElement14 {
3919
3921
  const testPart = this.computedContext?.testParts.find((testPart2) => testPart2.active);
3920
3922
  if (!testPart)
3921
3923
  return;
3922
- this.sectionItems = testPart.sections.flatMap((section) => section.items);
3924
+ this.sectionItems = itemsInOrder(testPart);
3923
3925
  this.itemIndex = this.sectionItems.findIndex((item) => item.active);
3924
3926
  this.checkDisabled();
3925
3927
  }
@@ -3982,7 +3984,7 @@ var TestPrev = class extends LitElement15 {
3982
3984
  const testPart = this.computedContext?.testParts.find((testPart2) => testPart2.active);
3983
3985
  if (!testPart)
3984
3986
  return;
3985
- this.sectionItems = testPart.sections.flatMap((section) => section.items);
3987
+ this.sectionItems = itemsInOrder(testPart);
3986
3988
  this.itemIndex = this.sectionItems.findIndex((item) => item.active);
3987
3989
  this.checkDisabled();
3988
3990
  }
@@ -4088,4 +4090,4 @@ export {
4088
4090
  * Portions Copyright (c) 2013, the Dart project authors.
4089
4091
  *)
4090
4092
  */
4091
- //# sourceMappingURL=chunk-2NHZOI3W.js.map
4093
+ //# sourceMappingURL=chunk-H64MGZJL.js.map