@citolab/qti-components 10.0.0-next.23 → 10.0.0-next.25

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 (45) 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-ZRORBAHB.js → chunk-2GCQCSOR.js} +77 -7
  5. package/dist/chunk-2GCQCSOR.js.map +1 -0
  6. package/dist/{chunk-IJKHXJSM.js → chunk-3DBCO7ZD.js} +20 -7
  7. package/dist/chunk-3DBCO7ZD.js.map +1 -0
  8. package/dist/{chunk-2A52V5TQ.js → chunk-4BWV6P7P.js} +2 -2
  9. package/dist/{chunk-J6VX4N7M.js → chunk-7ISPUOJG.js} +14 -2
  10. package/dist/chunk-7ISPUOJG.js.map +1 -0
  11. package/dist/{chunk-H6DO5UHC.js → chunk-GGFX2IUD.js} +2 -2
  12. package/dist/{chunk-XWRZP2RM.js → chunk-GMLW5X4H.js} +2 -2
  13. package/dist/{chunk-DJQE4M7B.js → chunk-H6EDN5OK.js} +2 -2
  14. package/dist/{chunk-TSJGL6FI.js → chunk-IDHMEWR7.js} +2 -2
  15. package/dist/{chunk-ULJ22VKL.js → chunk-NUQLOK6X.js} +4 -4
  16. package/dist/{chunk-KQ2LED4X.js → chunk-WEJ4JRVR.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-components-jsx.d.ts +12 -0
  26. package/dist/{qti-test-state-C71K8UNC.d.ts → qti-test-state-D-edVvB3.d.ts} +11 -2
  27. package/dist/{qti-test.d-CN2JZwAz.d.ts → qti-test.d-BKYGTOLJ.d.ts} +8 -2
  28. package/dist/{qti-transform-test.d-Bb9vnLzP.d.ts → qti-transform-test.d-aWMjo4ZA.d.ts} +1 -0
  29. package/dist/test-plugin-api.d.ts +16 -7
  30. package/dist/test-plugin-api.js +3 -1
  31. package/dist/test.d.ts +6 -6
  32. package/dist/test.js +8 -5
  33. package/dist/transformers.d.ts +1 -1
  34. package/dist/transformers.js +1 -1
  35. package/package.json +5 -5
  36. package/dist/chunk-IJKHXJSM.js.map +0 -1
  37. package/dist/chunk-J6VX4N7M.js.map +0 -1
  38. package/dist/chunk-ZRORBAHB.js.map +0 -1
  39. /package/dist/{chunk-2A52V5TQ.js.map → chunk-4BWV6P7P.js.map} +0 -0
  40. /package/dist/{chunk-H6DO5UHC.js.map → chunk-GGFX2IUD.js.map} +0 -0
  41. /package/dist/{chunk-XWRZP2RM.js.map → chunk-GMLW5X4H.js.map} +0 -0
  42. /package/dist/{chunk-DJQE4M7B.js.map → chunk-H6EDN5OK.js.map} +0 -0
  43. /package/dist/{chunk-TSJGL6FI.js.map → chunk-IDHMEWR7.js.map} +0 -0
  44. /package/dist/{chunk-ULJ22VKL.js.map → chunk-NUQLOK6X.js.map} +0 -0
  45. /package/dist/{chunk-KQ2LED4X.js.map → chunk-WEJ4JRVR.js.map} +0 -0
@@ -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-2GCQCSOR.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-4BWV6P7P.js.map
@@ -21,6 +21,8 @@ var PUBLIC_EVENTS = {
21
21
  "qc-test-rendered": { kind: "notification", scope: "test", deprecated: "cito-test-rendered" },
22
22
  "qc-test-loaded": { kind: "notification", scope: "test", deprecated: "cito-test-loaded" },
23
23
  "qc-test-state-changed": { kind: "notification", scope: "test", deprecated: "cito-test-state-changed" },
24
+ // New in 10.0, so it has no cito- name.
25
+ "qc-test-state-refused": { kind: "notification", scope: "test" },
24
26
  "qc-test-items-skipped": { kind: "notification", scope: "test", deprecated: "cito-test-items-skipped" },
25
27
  "qc-test-end-reached": { kind: "notification", scope: "test", deprecated: "cito-test-end-reached" },
26
28
  "qc-item-ref-connected": { kind: "notification", scope: "item", deprecated: "cito-item-ref-connected" }
@@ -185,6 +187,15 @@ var buttonPrimary = css`
185
187
  }
186
188
  `;
187
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
+
188
199
  export {
189
200
  PUBLIC_EVENTS,
190
201
  dispatchPublic,
@@ -192,6 +203,7 @@ export {
192
203
  control,
193
204
  button,
194
205
  buttonPrimary,
195
- styles_exports
206
+ styles_exports,
207
+ itemsInOrder
196
208
  };
197
- //# sourceMappingURL=chunk-J6VX4N7M.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":";;;;;;;;;AAyEO,IAAM,gBAAiE;EAC5E,oBAAoB,EAAE,MAAM,WAAW,OAAO,QAAQ,YAAY,qBAAoB;EACtF,uBAAuB,EAAE,MAAM,WAAW,OAAO,QAAQ,YAAY,wBAAuB;EAC5F,kBAAkB,EAAE,MAAM,WAAW,OAAO,QAAQ,YAAY,mBAAkB;EAClF,0BAA0B,EAAE,MAAM,WAAW,OAAO,QAAQ,YAAY,2BAA0B;EAClG,+BAA+B,EAAE,MAAM,WAAW,OAAO,QAAQ,YAAY,gCAA+B;EAC5G,uBAAuB,EAAE,MAAM,WAAW,OAAO,QAAQ,YAAY,wBAAuB;EAC5F,qBAAqB,EAAE,MAAM,gBAAgB,OAAO,QAAQ,YAAY,sBAAqB;EAC7F,qBAAqB,EAAE,MAAM,gBAAgB,OAAO,QAAQ,YAAY,sBAAqB;EAC7F,8BAA8B,EAAE,MAAM,gBAAgB,OAAO,QAAQ,YAAY,+BAA8B;EAC/G,6BAA6B,EAAE,MAAM,gBAAgB,OAAO,QAAQ,YAAY,8BAA6B;EAC7G,oBAAoB,EAAE,MAAM,gBAAgB,OAAO,QAAQ,YAAY,qBAAoB;EAC3F,kBAAkB,EAAE,MAAM,gBAAgB,OAAO,QAAQ,YAAY,mBAAkB;EACvF,yBAAyB,EAAE,MAAM,gBAAgB,OAAO,QAAQ,YAAY,0BAAyB;;EAErG,yBAAyB,EAAE,MAAM,gBAAgB,OAAO,OAAM;EAC9D,yBAAyB,EAAE,MAAM,gBAAgB,OAAO,QAAQ,YAAY,0BAAyB;EACrG,uBAAuB,EAAE,MAAM,gBAAgB,OAAO,QAAQ,YAAY,wBAAuB;EACjG,yBAAyB,EAAE,MAAM,gBAAgB,OAAO,QAAQ,YAAY,0BAAyB;;AAWjG,SAAU,eACd,QACA,MACA,QAAkE;AAElE,mBAAiB,QAAQ,eAAe,MAAM,MAAM;AACtD;AAMM,SAAU,aACd,QACA,MACA,SAAuC;AAEvC,iBAAe,QAAQ,eAAe,MAAM,OAA6B;AAC3E;;;ACxHA;;;;;;;;;;;;;;;;;AACA,SAAS,KAAK,YAAY;AAoC1B,IAAM,UAAU;AAChB,IAAM,UAAU;AAChB,IAAM,UAAU;AAChB,IAAM,iBAAiB;AACvB,IAAM,SAAS;AACf,IAAM,cAAc;AAYb,IAAM,UAAU;;;;mBAIJ,MAAM;;AAIlB,IAAM,OAAO;;;;;;;;;;;;;mBAaD,MAAM;;AAGlB,IAAM,MAAM;IACf,IAAI;yFACiF,OAAO;;YAEpF,WAAW;;;oFAG6D,OAAO,SAAS,OAAO;;;AAKpG,IAAM,aAAa;yGAC+E,OAAO;wEACxC,cAAc;qGACe,OAAO;;AAIrG,IAAM,iBAAiB;;;oEAGsC,OAAO,KAAK,OAAO;;;AAIhF,IAAM,wBAAwB;;;;;4BAKT,OAAO,KAAK,cAAc;;;;AAM/C,IAAM,YAAY;;;qEAG4C,OAAO,KAAK,OAAO;;;AAIjF,IAAM,mBAAmB;;;;;4BAKJ,OAAO,KAAK,cAAc;;;;AAM/C,IAAM,YAAY;;;;AAKlB,IAAM,MAAM;;;;AAKZ,IAAM,MAAM;IACf,IAAI;YACI,WAAW;;AAIhB,IAAM,UAAU;AAMhB,IAAM,SAAS;;MAEhB,OAAO;;;MAGP,GAAG;;;;QAID,cAAc;;;;MAIhB,SAAS;;;;;;;;;;;;;MAaT,SAAS;;;MAGT,GAAG;;;;;;AAQF,IAAM,gBAAgB;;MAEvB,UAAU;;;;QAIR,qBAAqB;;;;MAIvB,gBAAgB;;;;;ACjMf,IAAM,eAAe,CAAC,aAAkE;AAC7F,QAAM,QAAQ,SAAS,SAAS,QAAQ,aAAW,QAAQ,KAAK;AAChE,MAAI,CAAC,SAAS;AAAW,WAAO;AAChC,QAAM,eAAe,IAAI,IAAI,MAAM,IAAI,UAAQ,CAAC,KAAK,YAAY,IAAI,CAAC,CAAC;AACvE,SAAO,SAAS,UAAU,QAAQ,gBAAc,aAAa,IAAI,UAAU,KAAK,CAAA,CAAE;AACpF;","names":[]}
@@ -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-2GCQCSOR.js";
10
10
  import {
11
11
  QtiExitResponseSignal,
12
12
  QtiFeedback,
@@ -1828,4 +1828,4 @@ export {
1828
1828
  QtiTemplateProcessing,
1829
1829
  qtiContentElements
1830
1830
  };
1831
- //# sourceMappingURL=chunk-H6DO5UHC.js.map
1831
+ //# sourceMappingURL=chunk-GGFX2IUD.js.map
@@ -2,7 +2,7 @@ import {
2
2
  qtiTransformItem,
3
3
  qtiTransformManifest,
4
4
  qtiTransformTest
5
- } from "./chunk-ZRORBAHB.js";
5
+ } from "./chunk-2GCQCSOR.js";
6
6
 
7
7
  // ../qti-loader/dist/qti-loader.js
8
8
  var getManifestInfo = async (manifestURL) => {
@@ -28,4 +28,4 @@ export {
28
28
  getManifestInfo,
29
29
  getItemByUri
30
30
  };
31
- //# sourceMappingURL=chunk-XWRZP2RM.js.map
31
+ //# sourceMappingURL=chunk-GMLW5X4H.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  qtiTestElements
3
- } from "./chunk-IJKHXJSM.js";
3
+ } from "./chunk-3DBCO7ZD.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-DJQE4M7B.js.map
11
+ //# sourceMappingURL=chunk-H6EDN5OK.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  qtiContentElements
3
- } from "./chunk-H6DO5UHC.js";
3
+ } from "./chunk-GGFX2IUD.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-IDHMEWR7.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  QtiTest,
3
3
  TestNavigation
4
- } from "./chunk-IJKHXJSM.js";
4
+ } from "./chunk-3DBCO7ZD.js";
5
5
  import {
6
6
  QtiAssessmentItem
7
- } from "./chunk-H6DO5UHC.js";
7
+ } from "./chunk-GGFX2IUD.js";
8
8
  import {
9
9
  QtiAssociateInteraction,
10
10
  QtiChoiceInteraction,
@@ -30,7 +30,7 @@ import {
30
30
  } from "./chunk-TZCOXFPB.js";
31
31
  import {
32
32
  QtiItem
33
- } from "./chunk-2A52V5TQ.js";
33
+ } from "./chunk-4BWV6P7P.js";
34
34
  import {
35
35
  watch
36
36
  } from "./chunk-4DB4SC5K.js";
@@ -1686,4 +1686,4 @@ export {
1686
1686
  TestNavigationCorrection,
1687
1687
  QtiTestCorrection
1688
1688
  };
1689
- //# sourceMappingURL=chunk-ULJ22VKL.js.map
1689
+ //# sourceMappingURL=chunk-NUQLOK6X.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  qtiItemElements
3
- } from "./chunk-2A52V5TQ.js";
3
+ } from "./chunk-4BWV6P7P.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-WEJ4JRVR.js.map
@@ -50,6 +50,13 @@ type ComputedContext = {
50
50
  navigationMode: 'linear' | 'nonlinear';
51
51
  submissionMode: 'individual' | 'simultaneous';
52
52
  allowSkipping?: boolean;
53
+ /**
54
+ * The item-ref identifiers of the part in the test's document order, info items included: the
55
+ * order a candidate takes them in. `sections` is depth first, so where a section's item-refs and
56
+ * subsections interleave, flattening `sections` gives another order; read the items in order with
57
+ * `itemsInOrder(testPart)` from `@qti-components/test`.
58
+ */
59
+ itemOrder?: string[];
53
60
  /**
54
61
  * Every section of the part once, nested ones included, depth first (a section before its
55
62
  * subsections), each with only its own item-refs, so every item is listed once. Where a
@@ -7,8 +7,8 @@ import { QtiAssessmentItem } from './elements.js';
7
7
  import { Q as QtiItem } from './qti-item.d-CxP6KtCH.js';
8
8
  import './public-events.d-3dGip9pd.js';
9
9
  import { V as View, C as ComputedItemContext } from './session.context.d-9gRdGK4T.js';
10
- import { l as QtiTest, r as TestNavigation } from './qti-test.d-CN2JZwAz.js';
11
- import { a as ComputedItem, C as ComputedContext } from './computed.types.d-6qQNFbu1.js';
10
+ import { l as QtiTest, r as TestNavigation } from './qti-test.d-BKYGTOLJ.js';
11
+ import { a as ComputedItem, C as ComputedContext } from './computed.types.d-DcAfzw8v.js';
12
12
  import './config.context.d-Dm11aAuw.js';
13
13
  import './interaction.interface.d-CvjHM2bi.js';
14
14
  import './variables.d-DWHlTszN.js';
@@ -17,7 +17,7 @@ import './qti.context.d-CejJMlfZ.js';
17
17
  import 'lit/directives/ref.js';
18
18
  import './qti-feedback.d-CT0W-8Gm.js';
19
19
  import './qti-rule-base.d-CeKP0Ooi.js';
20
- import './qti-transform-test.d-Bb9vnLzP.js';
20
+ import './qti-transform-test.d-aWMjo4ZA.js';
21
21
  import './qti-expression.d-iH3w6mqf.js';
22
22
  import '@heximal/templates';
23
23
  import './qti-test-state.d-D8Q89RzZ.js';
@@ -33,24 +33,24 @@ import {
33
33
  TestNavigationCorrection,
34
34
  TestShowCorrectResponse,
35
35
  correctionPart
36
- } from "./chunk-ULJ22VKL.js";
36
+ } from "./chunk-NUQLOK6X.js";
37
37
  import {
38
38
  qtiTestElements
39
- } from "./chunk-IJKHXJSM.js";
40
- import "./chunk-J6VX4N7M.js";
39
+ } from "./chunk-3DBCO7ZD.js";
40
+ import "./chunk-7ISPUOJG.js";
41
41
  import {
42
42
  qtiContentElements
43
- } from "./chunk-H6DO5UHC.js";
43
+ } from "./chunk-GGFX2IUD.js";
44
44
  import "./chunk-UCXLDQYA.js";
45
45
  import {
46
46
  qtiInteractionElements
47
47
  } from "./chunk-TZCOXFPB.js";
48
48
  import {
49
49
  qtiItemElements
50
- } from "./chunk-2A52V5TQ.js";
50
+ } from "./chunk-4BWV6P7P.js";
51
51
  import "./chunk-WWY2H2YO.js";
52
52
  import "./chunk-4DB4SC5K.js";
53
- import "./chunk-ZRORBAHB.js";
53
+ import "./chunk-2GCQCSOR.js";
54
54
  import {
55
55
  qtiProcessingElements
56
56
  } from "./chunk-LPYZVKHX.js";
package/dist/elements.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./chunk-TSJGL6FI.js";
1
+ import "./chunk-IDHMEWR7.js";
2
2
  import {
3
3
  QtiAssessmentItem,
4
4
  QtiAssessmentStimulus,
@@ -20,7 +20,7 @@ import {
20
20
  QtiTemplateConstraint,
21
21
  QtiTemplateDeclaration,
22
22
  QtiTemplateProcessing
23
- } from "./chunk-H6DO5UHC.js";
23
+ } from "./chunk-GGFX2IUD.js";
24
24
  import {
25
25
  PUBLIC_ITEM_EVENTS,
26
26
  dispatchDeclared,
@@ -29,7 +29,7 @@ import {
29
29
  listenPublic
30
30
  } from "./chunk-UCXLDQYA.js";
31
31
  import "./chunk-4DB4SC5K.js";
32
- import "./chunk-ZRORBAHB.js";
32
+ import "./chunk-2GCQCSOR.js";
33
33
  import "./chunk-GPC53O7P.js";
34
34
  import "./chunk-PZ5AY32C.js";
35
35
  export {
package/dist/index.d.ts CHANGED
@@ -1,18 +1,18 @@
1
- export { I as ITestNavigationMixin, a as ITestStateMixin, b as ItemRefTemplateModel, Q as QtiAssessmentItemRef, c as QtiAssessmentSection, d as QtiAssessmentTest, e as QtiBranchRule, f as QtiItemSessionControl, g as QtiNumberPresented, h as QtiNumberSelected, i as QtiOutcomeProcessing, j as QtiOutcomeProcessingProcessor, k as QtiPreCondition, l as QtiTest, m as QtiTestFeedback, n as QtiTestPart, o as QtiTestVariables, p as QtiTestVariablesExpression, T as TestContainer, q as TestEndAttempt, r as TestNavigation, s as TestNext, t as TestPrev, u as TestSubmit } from './qti-test.d-CN2JZwAz.js';
1
+ export { I as ITestNavigationMixin, a as ITestStateMixin, b as ItemRefTemplateModel, Q as QtiAssessmentItemRef, c as QtiAssessmentSection, d as QtiAssessmentTest, e as QtiBranchRule, f as QtiItemSessionControl, g as QtiNumberPresented, h as QtiNumberSelected, i as QtiOutcomeProcessing, j as QtiOutcomeProcessingProcessor, k as QtiPreCondition, l as QtiTest, m as QtiTestFeedback, n as QtiTestPart, o as QtiTestVariables, p as QtiTestVariablesExpression, T as TestContainer, q as TestEndAttempt, r as TestNavigation, s as TestNext, t as TestPrev, u as TestSubmit } from './qti-test.d-BKYGTOLJ.js';
2
2
  export { IMyQtiTest, IQtiTest, ITestProcessingMixin, StoredSessionContext, StoredTestContext, StoredVariable, pluginElements, stateFromContexts } from './test.js';
3
- export { Q as QTI_TEST_STATE_VERSION, a as QtiTestPluginState, b as QtiTestState, c as QtiTestStateItem, d as QtiTestStateSession, e as QtiTestStateValue, p as pluginState } from './qti-test-state-C71K8UNC.js';
3
+ export { Q as QTI_TEST_STATE_VERSION, a as QtiTestPluginState, b as QtiTestState, c as QtiTestStateItem, d as QtiTestStateSession, e as QtiTestStateValue, i as itemsInOrder, p as pluginState } from './qti-test-state-D-edVvB3.js';
4
4
  export { I as ItemContainer, a as ItemPrintVariables, Q as QtiItem } from './qti-item.d-CxP6KtCH.js';
5
5
  export { ItemViewMixin } from './item.js';
6
6
  export { F as FeedbackEventDetail, P as PUBLIC_ITEM_EVENTS, a as PublicEventDeclaration, b as PublicItemEventMap, c as PublicItemEventName, R as RubricPlacement, d as dispatchDeclared, e as dispatchPublic, l as listenDeclared, f as listenPublic } from './public-events.d-3dGip9pd.js';
7
7
  export { QtiAssessmentItem, QtiAssessmentStimulus, QtiAssessmentStimulusRef, QtiAssessmentStimulusRefConnectedEvent, QtiCompanionMaterialsInfo, QtiContentBody, QtiContextDeclaration, QtiCustomOperator, QtiFeedbackBlock, QtiFeedbackInline, QtiItemBody, QtiModalFeedback, QtiOutcomeDeclaration, QtiResponseDeclaration, QtiResponseProcessing, QtiRubricBlock, QtiStylesheet, QtiTemplateConstraint, QtiTemplateDeclaration, QtiTemplateProcessing } from './elements.js';
8
8
  export { QtiCustomInteraction, QtiEndAttemptInteraction, QtiMediaInteraction, QtiPositionObjectInteraction, QtiPositionObjectStage, QtiUploadInteraction, qtiInteractionElements } from './interactions.js';
9
9
  export { O as Orientation, Q as QtiAssociableHotspot, a as QtiAssociateInteraction, b as QtiChoiceInteraction, c as QtiExtendedTextInteraction, d as QtiGap, e as QtiGapImg, f as QtiGapMatchInteraction, g as QtiGapText, h as QtiGraphicAssociateInteraction, i as QtiGraphicGapMatchInteraction, j as QtiGraphicOrderInteraction, k as QtiHotspotChoice, l as QtiHotspotInteraction, m as QtiHottext, n as QtiHottextInteraction, o as QtiInlineChoice, p as QtiInlineChoiceInteraction, q as QtiMatchInteraction, r as QtiOrderInteraction, s as QtiPortableCustomInteraction, t as QtiPrompt, u as QtiSelectPointInteraction, v as QtiSimpleAssociableChoice, w as QtiSimpleChoice, x as QtiSliderInteraction, y as QtiTextEntryInteraction, z as inlineScriptText, A as inlineStyleText } from './qti-text-entry-interaction.d-m0EFv9no.js';
10
- export { M as ModuleResolutionConfig, q as qtiTransformItem, a as qtiTransformTest, t as transformItemApi, b as transformTestApi } from './qti-transform-test.d-Bb9vnLzP.js';
10
+ export { M as ModuleResolutionConfig, q as qtiTransformItem, a as qtiTransformTest, t as transformItemApi, b as transformTestApi } from './qti-transform-test.d-aWMjo4ZA.js';
11
11
  export { qtiTransformManifest } from './transformers.js';
12
12
  export { ManifestInfo, getItemByUri, getManifestInfo } from './loader.js';
13
13
  export { CustomOperator, CustomOperatorValue, CustomStateSetShim, CustomStateSupport, IsNullOrUndefined, STATE_ALIASES, ScoringHelper, boxSizing, classifyCustomStateSupport, computedContext, computedItemContext, convertNumberToUniversalFormat, decimalSeparator, dropRegion, getCustomOperator, hasState, installCustomStateSetFallback, itemContext, registerCustomOperator, removeDoubleSlashes, setState, unregisterCustomOperator, validationMessage } from './base.js';
14
14
  export { C as ComputedItemContext, I as INITIAL_SESSION_CONTEXT, S as SessionContext, V as View, s as sessionContext } from './session.context.d-9gRdGK4T.js';
15
- export { C as ComputedContext, a as ComputedItem, S as SessionControl } from './computed.types.d-6qQNFbu1.js';
15
+ export { C as ComputedContext, a as ComputedItem, S as SessionControl } from './computed.types.d-DcAfzw8v.js';
16
16
  export { C as ConfigContext, V as ValidationDisplayMode, c as configContext } from './config.context.d-Dm11aAuw.js';
17
17
  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';
18
18
  export { I as ItemContext, i as itemContextVariables } from './item.types.d-Zc6ZQDhu.js';
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./chunk-DJQE4M7B.js";
1
+ import "./chunk-H6EDN5OK.js";
2
2
  import {
3
3
  pluginState
4
4
  } from "./chunk-DJ7PB252.js";
@@ -37,7 +37,7 @@ import {
37
37
  TestNavigationCorrection,
38
38
  TestShowCorrectResponse,
39
39
  correctionPart
40
- } from "./chunk-ULJ22VKL.js";
40
+ } from "./chunk-NUQLOK6X.js";
41
41
  import {
42
42
  QTI_TEST_STATE_VERSION,
43
43
  QtiAssessmentItemRef,
@@ -63,9 +63,11 @@ import {
63
63
  TestSubmit,
64
64
  pluginElements,
65
65
  stateFromContexts
66
- } from "./chunk-IJKHXJSM.js";
67
- import "./chunk-J6VX4N7M.js";
68
- import "./chunk-TSJGL6FI.js";
66
+ } from "./chunk-3DBCO7ZD.js";
67
+ import {
68
+ itemsInOrder
69
+ } from "./chunk-7ISPUOJG.js";
70
+ import "./chunk-IDHMEWR7.js";
69
71
  import {
70
72
  QtiAssessmentItem,
71
73
  QtiAssessmentStimulus,
@@ -87,7 +89,7 @@ import {
87
89
  QtiTemplateConstraint,
88
90
  QtiTemplateDeclaration,
89
91
  QtiTemplateProcessing
90
- } from "./chunk-H6DO5UHC.js";
92
+ } from "./chunk-GGFX2IUD.js";
91
93
  import {
92
94
  PUBLIC_ITEM_EVENTS,
93
95
  dispatchDeclared,
@@ -133,24 +135,24 @@ import {
133
135
  inlineStyleText,
134
136
  qtiInteractionElements
135
137
  } from "./chunk-TZCOXFPB.js";
136
- import "./chunk-KQ2LED4X.js";
138
+ import "./chunk-WEJ4JRVR.js";
137
139
  import {
138
140
  ItemContainer,
139
141
  ItemPrintVariables,
140
142
  ItemViewMixin,
141
143
  QtiItem
142
- } from "./chunk-2A52V5TQ.js";
144
+ } from "./chunk-4BWV6P7P.js";
143
145
  import "./chunk-WWY2H2YO.js";
144
146
  import "./chunk-4DB4SC5K.js";
145
147
  import {
146
148
  getItemByUri,
147
149
  getManifestInfo
148
- } from "./chunk-XWRZP2RM.js";
150
+ } from "./chunk-GMLW5X4H.js";
149
151
  import {
150
152
  qtiTransformItem,
151
153
  qtiTransformManifest,
152
154
  qtiTransformTest
153
- } from "./chunk-ZRORBAHB.js";
155
+ } from "./chunk-2GCQCSOR.js";
154
156
  import "./chunk-5BP2A7BI.js";
155
157
  import {
156
158
  QtiAnd,
@@ -508,6 +510,7 @@ export {
508
510
  isSeed,
509
511
  itemContext,
510
512
  itemContextVariables,
513
+ itemsInOrder,
511
514
  iterResponseValues,
512
515
  listenDeclared,
513
516
  listenPublic,
package/dist/item.js CHANGED
@@ -1,13 +1,13 @@
1
- import "./chunk-KQ2LED4X.js";
1
+ import "./chunk-WEJ4JRVR.js";
2
2
  import {
3
3
  ItemContainer,
4
4
  ItemPrintVariables,
5
5
  ItemViewMixin,
6
6
  QtiItem
7
- } from "./chunk-2A52V5TQ.js";
7
+ } from "./chunk-4BWV6P7P.js";
8
8
  import "./chunk-WWY2H2YO.js";
9
9
  import "./chunk-4DB4SC5K.js";
10
- import "./chunk-ZRORBAHB.js";
10
+ import "./chunk-2GCQCSOR.js";
11
11
  import "./chunk-GPC53O7P.js";
12
12
  import "./chunk-PZ5AY32C.js";
13
13
  export {
package/dist/loader.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  getItemByUri,
3
3
  getManifestInfo
4
- } from "./chunk-XWRZP2RM.js";
5
- import "./chunk-ZRORBAHB.js";
4
+ } from "./chunk-GMLW5X4H.js";
5
+ import "./chunk-2GCQCSOR.js";
6
6
  import "./chunk-PZ5AY32C.js";
7
7
  export {
8
8
  getItemByUri,
@@ -4751,6 +4751,8 @@ object, do not mutate it: an in-place change does not notify the components insi
4751
4751
  "onqti-test-connected"?: ((e: CustomEvent) => void) | undefined;
4752
4752
  /** The candidate's persistable state changed. `detail` is a `QtiTestState`; assign it back to `state` to resume. */
4753
4753
  "onqc-test-state-changed"?: ((e: Event) => void) | undefined;
4754
+ /** A value assigned to `state` is not a version 1 `QtiTestState` and was ignored; the test goes on without it. `detail` is `{ message, state }`. Sent once the test has loaded. */
4755
+ "onqc-test-state-refused"?: ((e: Event) => void) | undefined;
4754
4756
  /** Deprecated: listen to `qc-test-state-changed` to persist a session. `detail` is the full test context, including declaration metadata and the answer key. Removed in the next major. */
4755
4757
  "onqti-test-context-updated"?: ((e: Event) => void) | undefined;
4756
4758
  };
@@ -4771,6 +4773,8 @@ object, do not mutate it: an in-place change does not notify the components insi
4771
4773
  "on:qti-test-connected"?: ((e: CustomEvent) => void) | undefined;
4772
4774
  /** The candidate's persistable state changed. `detail` is a `QtiTestState`; assign it back to `state` to resume. */
4773
4775
  "on:qc-test-state-changed"?: ((e: Event) => void) | undefined;
4776
+ /** A value assigned to `state` is not a version 1 `QtiTestState` and was ignored; the test goes on without it. `detail` is `{ message, state }`. Sent once the test has loaded. */
4777
+ "on:qc-test-state-refused"?: ((e: Event) => void) | undefined;
4774
4778
  /** Deprecated: listen to `qc-test-state-changed` to persist a session. `detail` is the full test context, including declaration metadata and the answer key. Removed in the next major. */
4775
4779
  "on:qti-test-context-updated"?: ((e: Event) => void) | undefined;
4776
4780
 
@@ -6250,6 +6254,8 @@ object, do not mutate it: an in-place change does not notify the components insi
6250
6254
  "onqti-test-connected"?: ((e: CustomEvent) => void) | undefined;
6251
6255
  /** The candidate's persistable state changed. `detail` is a `QtiTestState`; assign it back to `state` to resume. */
6252
6256
  "onqc-test-state-changed"?: ((e: Event) => void) | undefined;
6257
+ /** A value assigned to `state` is not a version 1 `QtiTestState` and was ignored; the test goes on without it. `detail` is `{ message, state }`. Sent once the test has loaded. */
6258
+ "onqc-test-state-refused"?: ((e: Event) => void) | undefined;
6253
6259
  /** Deprecated: listen to `qc-test-state-changed` to persist a session. `detail` is the full test context, including declaration metadata and the answer key. Removed in the next major. */
6254
6260
  "onqti-test-context-updated"?: ((e: Event) => void) | undefined;
6255
6261
  };
@@ -6270,6 +6276,8 @@ object, do not mutate it: an in-place change does not notify the components insi
6270
6276
  "on:qti-test-connected"?: ((e: CustomEvent) => void) | undefined;
6271
6277
  /** The candidate's persistable state changed. `detail` is a `QtiTestState`; assign it back to `state` to resume. */
6272
6278
  "on:qc-test-state-changed"?: ((e: Event) => void) | undefined;
6279
+ /** A value assigned to `state` is not a version 1 `QtiTestState` and was ignored; the test goes on without it. `detail` is `{ message, state }`. Sent once the test has loaded. */
6280
+ "on:qc-test-state-refused"?: ((e: Event) => void) | undefined;
6273
6281
  /** Deprecated: listen to `qc-test-state-changed` to persist a session. `detail` is the full test context, including declaration metadata and the answer key. Removed in the next major. */
6274
6282
  "on:qti-test-context-updated"?: ((e: Event) => void) | undefined;
6275
6283
 
@@ -9826,6 +9834,7 @@ export type CustomElements = {
9826
9834
  *
9827
9835
  * - `qti-test-connected`: undefined
9828
9836
  * - `qc-test-state-changed`: The candidate's persistable state changed. `detail` is a `QtiTestState`; assign it back to `state` to resume.
9837
+ * - `qc-test-state-refused`: A value assigned to `state` is not a version 1 `QtiTestState` and was ignored; the test goes on without it. `detail` is `{ message, state }`. Sent once the test has loaded.
9829
9838
  * - `qti-test-context-updated`: Deprecated: listen to `qc-test-state-changed` to persist a session. `detail` is the full test context, including declaration metadata and the answer key. Removed in the next major.
9830
9839
  */
9831
9840
  "qti-test": Partial<QtiTestProps & BaseProps<QtiTest> & BaseEvents>;
@@ -12058,6 +12067,7 @@ export type CustomElements = {
12058
12067
  *
12059
12068
  * - `qti-test-connected`: undefined
12060
12069
  * - `qc-test-state-changed`: The candidate's persistable state changed. `detail` is a `QtiTestState`; assign it back to `state` to resume.
12070
+ * - `qc-test-state-refused`: A value assigned to `state` is not a version 1 `QtiTestState` and was ignored; the test goes on without it. `detail` is `{ message, state }`. Sent once the test has loaded.
12061
12071
  * - `qti-test-context-updated`: Deprecated: listen to `qc-test-state-changed` to persist a session. `detail` is the full test context, including declaration metadata and the answer key. Removed in the next major.
12062
12072
  *
12063
12073
  * ## Methods
@@ -15720,6 +15730,7 @@ export type CustomElementsSolidJs = {
15720
15730
  *
15721
15731
  * - `qti-test-connected`: undefined
15722
15732
  * - `qc-test-state-changed`: The candidate's persistable state changed. `detail` is a `QtiTestState`; assign it back to `state` to resume.
15733
+ * - `qc-test-state-refused`: A value assigned to `state` is not a version 1 `QtiTestState` and was ignored; the test goes on without it. `detail` is `{ message, state }`. Sent once the test has loaded.
15723
15734
  * - `qti-test-context-updated`: Deprecated: listen to `qc-test-state-changed` to persist a session. `detail` is the full test context, including declaration metadata and the answer key. Removed in the next major.
15724
15735
  */
15725
15736
  "qti-test": Partial<
@@ -18168,6 +18179,7 @@ export type CustomElementsSolidJs = {
18168
18179
  *
18169
18180
  * - `qti-test-connected`: undefined
18170
18181
  * - `qc-test-state-changed`: The candidate's persistable state changed. `detail` is a `QtiTestState`; assign it back to `state` to resume.
18182
+ * - `qc-test-state-refused`: A value assigned to `state` is not a version 1 `QtiTestState` and was ignored; the test goes on without it. `detail` is `{ message, state }`. Sent once the test has loaded.
18171
18183
  * - `qti-test-context-updated`: Deprecated: listen to `qc-test-state-changed` to persist a session. `detail` is the full test context, including declaration metadata and the answer key. Removed in the next major.
18172
18184
  *
18173
18185
  * ## Methods
@@ -1,4 +1,4 @@
1
- import { C as ComputedContext } from './computed.types.d-6qQNFbu1.js';
1
+ import { C as ComputedContext, a as ComputedItem } from './computed.types.d-DcAfzw8v.js';
2
2
  import { a as QtiTestPluginState$1 } from './qti-test-state.d-D8Q89RzZ.js';
3
3
 
4
4
  /**
@@ -8,6 +8,15 @@ import { a as QtiTestPluginState$1 } from './qti-test-state.d-D8Q89RzZ.js';
8
8
  */
9
9
  declare const pluginState: <K extends keyof QtiTestPluginState$1 & string>(context: Pick<ComputedContext, "plugins"> | undefined, plugin: K) => QtiTestPluginState$1[K] | undefined;
10
10
 
11
+ /**
12
+ * The items of a test part in the order the candidate takes them: the test's document order, info
13
+ * items included. Flattening `testPart.sections` is not that order when a section's item-refs and
14
+ * subsections interleave, since `sections` lists every section once, depth first.
15
+ *
16
+ * A part without `itemOrder` (a context built by hand) gives its sections' items as they are listed.
17
+ */
18
+ declare const itemsInOrder: (testPart: ComputedContext["testParts"][number]) => ComputedItem[];
19
+
11
20
  /**
12
21
  * Everything a host needs to persist to resume a candidate's test session, and nothing else.
13
22
  *
@@ -65,4 +74,4 @@ interface QtiTestStateSession {
65
74
  }
66
75
  declare const QTI_TEST_STATE_VERSION = 1;
67
76
 
68
- export { QTI_TEST_STATE_VERSION as Q, type QtiTestPluginState as a, type QtiTestState as b, type QtiTestStateItem as c, type QtiTestStateSession as d, type QtiTestStateValue as e, pluginState as p };
77
+ export { QTI_TEST_STATE_VERSION as Q, type QtiTestPluginState as a, type QtiTestState as b, type QtiTestStateItem as c, type QtiTestStateSession as d, type QtiTestStateValue as e, itemsInOrder as i, pluginState as p };
@@ -1,7 +1,7 @@
1
1
  import * as lit from 'lit';
2
2
  import { LitElement, PropertyValues } from 'lit';
3
- import { b as transformTestApi, t as transformItemApi } from './qti-transform-test.d-Bb9vnLzP.js';
4
- import { C as ComputedContext, a as ComputedItem } from './computed.types.d-6qQNFbu1.js';
3
+ import { b as transformTestApi, t as transformItemApi } from './qti-transform-test.d-aWMjo4ZA.js';
4
+ import { C as ComputedContext, a as ComputedItem } from './computed.types.d-DcAfzw8v.js';
5
5
  import './public-events.d-3dGip9pd.js';
6
6
  import { QtiAssessmentItem, QtiModalFeedback } from './elements.js';
7
7
  import { Q as QtiContext } from './qti.context.d-CejJMlfZ.js';
@@ -392,6 +392,11 @@ interface ITestStateMixin {
392
392
  * Items are matched by item-ref identifier; items the state does not mention start fresh, and
393
393
  * stored items, test outcomes or a position the test no longer has are ignored. Restoring is a
394
394
  * resume, so linear-mode navigation restrictions do not apply.
395
+ *
396
+ * A value that is not a version 1 `QtiTestState` is ignored and reported with
397
+ * `qc-test-state-refused`: at once when the test has loaded, or when it does if it was assigned
398
+ * before. A state assigned earlier that could be read stays in effect. A stored 9.x
399
+ * `testContext` is turned into a state with `stateFromContexts`.
395
400
  */
396
401
  state: QtiTestState;
397
402
  }
@@ -692,6 +697,7 @@ declare const QtiTest_base: (abstract new (...args: any[]) => ITestNavigationMix
692
697
  * And you can use the `test-prev` and `test-next` elements to navigate through the test.
693
698
  *
694
699
  * @event qc-test-state-changed - The candidate's persistable state changed. `detail` is a `QtiTestState`; assign it back to `state` to resume.
700
+ * @event qc-test-state-refused - A value assigned to `state` is not a version 1 `QtiTestState` and was ignored; the test goes on without it. `detail` is `{ message, state }`. Sent once the test has loaded.
695
701
  * @event qti-test-context-updated - Deprecated: listen to `qc-test-state-changed` to persist a session. `detail` is the full test context, including declaration metadata and the answer key. Removed in the next major.
696
702
  */
697
703
  declare class QtiTest extends QtiTest_base {
@@ -46,6 +46,7 @@ declare const qtiTransformItem: () => transformItemApi;
46
46
  * const xml = qtiTransformer.xml();
47
47
  */
48
48
  type transformTestApi = {
49
+ /** Fetches the test, includes every `qti-assessment-section-ref`'s section, and makes URLs absolute. */
49
50
  load: (uri: string, signal?: AbortSignal) => Promise<transformTestApi>;
50
51
  parse: (xmlString: string) => transformTestApi;
51
52
  path: (location: string) => transformTestApi;
@@ -1,10 +1,10 @@
1
1
  import { V as View } from './session.context.d-9gRdGK4T.js';
2
2
  import { a as PublicEventDeclaration } from './public-events.d-3dGip9pd.js';
3
3
  import { Q as QtiTestState } from './qti-test-state.d-D8Q89RzZ.js';
4
- export { a as QtiTestPluginState, b as QtiTestState, p as pluginState } from './qti-test-state-C71K8UNC.js';
4
+ export { a as QtiTestPluginState, b as QtiTestState, i as itemsInOrder, p as pluginState } from './qti-test-state-D-edVvB3.js';
5
5
  import * as lit from 'lit';
6
6
  import './variables.d-DWHlTszN.js';
7
- import './computed.types.d-6qQNFbu1.js';
7
+ import './computed.types.d-DcAfzw8v.js';
8
8
 
9
9
  /**
10
10
  * The public events of the test. The name tells you it is public: everything here starts with
@@ -13,10 +13,10 @@ import './computed.types.d-6qQNFbu1.js';
13
13
  * Requests are verbs (a host or plugin dispatches them at the test), notifications are past tense
14
14
  * (the test dispatches them). All bubble and are composed.
15
15
  *
16
- * `deprecated` is the `cito-` name this event had in 9.x. One helper (`dispatchPublic`,
17
- * `listenPublic`) sends or handles both names until the next major, then the field goes. The 7.x
18
- * names (`qti-request-navigation`, `test-end-attempt`, `on-test-switch-view`, …) are no longer sent
19
- * or handled.
16
+ * `deprecated` is the `cito-` name this event had in 9.x; an event new in 10.0 has none. One helper
17
+ * (`dispatchPublic`, `listenPublic`) sends or handles both names until the next major, then the field
18
+ * goes. The 7.x names (`qti-request-navigation`, `test-end-attempt`, `on-test-switch-view`, …) are no
19
+ * longer sent or handled.
20
20
  */
21
21
  interface NavigationTarget {
22
22
  type: 'item' | 'section';
@@ -28,6 +28,13 @@ interface NavigationFailure {
28
28
  itemId?: string;
29
29
  sectionId?: string;
30
30
  }
31
+ /** The detail of `qc-test-state-refused`. */
32
+ interface StateRefusal {
33
+ /** Why the state was not read. */
34
+ message: string;
35
+ /** The value that was assigned to `state`, as given. */
36
+ state: unknown;
37
+ }
31
38
  interface PublicEventMap {
32
39
  'qc-test-navigate': CustomEvent<NavigationTarget>;
33
40
  /**
@@ -60,6 +67,8 @@ interface PublicEventMap {
60
67
  element: Element;
61
68
  }[]>;
62
69
  'qc-test-state-changed': CustomEvent<QtiTestState>;
70
+ /** A value assigned to `state` could not be read and was ignored: the test goes on without it. */
71
+ 'qc-test-state-refused': CustomEvent<StateRefusal>;
63
72
  'qc-test-items-skipped': CustomEvent<{
64
73
  ids: string[];
65
74
  }>;
@@ -131,4 +140,4 @@ declare namespace styles {
131
140
  export { styles_btn as btn, styles_btnActive as btnActive, styles_btnInteractive as btnInteractive, styles_btnPrimary as btnPrimary, styles_btnPrimaryActive as btnPrimaryActive, styles_btnPrimaryInteractive as btnPrimaryInteractive, styles_button as button, styles_buttonPrimary as buttonPrimary, styles_control as control, styles_dis as dis, styles_focusRing as focusRing, styles_form as form, styles_hostBox as hostBox, styles_ind as ind };
132
141
  }
133
142
 
134
- export { type NavigationFailure, type NavigationTarget, PUBLIC_EVENTS, type PublicEventMap, type PublicEventName, styles as controlStyles, dispatchPublic, listenPublic };
143
+ export { type NavigationFailure, type NavigationTarget, PUBLIC_EVENTS, type PublicEventMap, type PublicEventName, type StateRefusal, styles as controlStyles, dispatchPublic, listenPublic };
@@ -4,15 +4,17 @@ import {
4
4
  import {
5
5
  PUBLIC_EVENTS,
6
6
  dispatchPublic,
7
+ itemsInOrder,
7
8
  listenPublic,
8
9
  styles_exports
9
- } from "./chunk-J6VX4N7M.js";
10
+ } from "./chunk-7ISPUOJG.js";
10
11
  import "./chunk-UCXLDQYA.js";
11
12
  import "./chunk-PZ5AY32C.js";
12
13
  export {
13
14
  PUBLIC_EVENTS,
14
15
  styles_exports as controlStyles,
15
16
  dispatchPublic,
17
+ itemsInOrder,
16
18
  listenPublic,
17
19
  pluginState
18
20
  };