@citolab/qti-components 10.0.0-next.16 → 10.0.0-next.18

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 (67) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +233 -459
  3. package/dist/base.d.ts +12 -10
  4. package/dist/base.js +1 -0
  5. package/dist/chunk-DJ7PB252.js +7 -0
  6. package/dist/chunk-DJ7PB252.js.map +1 -0
  7. package/dist/{chunk-7MYZHZWV.js → chunk-DUKQ53E7.js} +46 -3
  8. package/dist/chunk-DUKQ53E7.js.map +1 -0
  9. package/dist/chunk-J6VX4N7M.js +197 -0
  10. package/dist/chunk-J6VX4N7M.js.map +1 -0
  11. package/dist/{chunk-J3F3JSCW.js → chunk-N453PANH.js} +2 -2
  12. package/dist/chunk-PZ5AY32C.js +10 -0
  13. package/dist/chunk-PZ5AY32C.js.map +1 -0
  14. package/dist/{chunk-NWSDBYK7.js → chunk-QLGUI5VG.js} +2 -2
  15. package/dist/{chunk-H3Z3TMFB.js → chunk-SUPLA6QQ.js} +9 -19
  16. package/dist/chunk-SUPLA6QQ.js.map +1 -0
  17. package/dist/chunk-UCXLDQYA.js +56 -0
  18. package/dist/chunk-UCXLDQYA.js.map +1 -0
  19. package/dist/{chunk-LQ65RILE.js → chunk-UURHLJVM.js} +66 -1803
  20. package/dist/chunk-UURHLJVM.js.map +1 -0
  21. package/dist/{chunk-4DC5Z2LQ.js → chunk-V5GL7PTC.js} +2 -2
  22. package/dist/{chunk-M4TZIB3W.js → chunk-WGUQCB2Z.js} +4 -54
  23. package/dist/chunk-WGUQCB2Z.js.map +1 -0
  24. package/dist/{computed.types.d-n3K2VvB0.d.ts → computed.types.d-D4wskgi0.d.ts} +1 -1
  25. package/dist/corrections.d.ts +13 -14
  26. package/dist/corrections.js +7 -7
  27. package/dist/corrections.js.map +1 -1
  28. package/dist/elements.d.ts +5 -105
  29. package/dist/elements.js +7 -4
  30. package/dist/index.d.ts +17 -13
  31. package/dist/index.js +17 -57
  32. package/dist/interactions.d.ts +5 -4
  33. package/dist/interactions.js +3 -2
  34. package/dist/item.d.ts +6 -4
  35. package/dist/item.js +1 -0
  36. package/dist/item.types.d-Zc6ZQDhu.d.ts +25 -0
  37. package/dist/loader.d.ts +4 -2
  38. package/dist/loader.js +1 -0
  39. package/dist/processing.d.ts +4 -3
  40. package/dist/processing.js +1 -0
  41. package/dist/public-events.d-3dGip9pd.d.ts +105 -0
  42. package/dist/qti-components-jsx.d.ts +2686 -4046
  43. package/dist/{qti-condition-expression.d-B-T1NNl0.d.ts → qti-condition-expression.d-7Kd4LBxn.d.ts} +1 -1
  44. package/dist/{qti-expression.d-B-Cfbqlb.d.ts → qti-expression.d-iH3w6mqf.d.ts} +2 -1
  45. package/dist/{qti-feedback.d-1JL_qHjc.d.ts → qti-feedback.d-CT0W-8Gm.d.ts} +1 -1
  46. package/dist/{qti-item.d-DDMDjWIk.d.ts → qti-item.d-CLChmRvB.d.ts} +2 -1
  47. package/dist/qti-test-state-BAf5AmJ2.d.ts +68 -0
  48. package/dist/qti-test-state.d-D8Q89RzZ.d.ts +57 -0
  49. package/dist/{qti-test.d-CDdyCp6e.d.ts → qti-test.d-COzv7YZG.d.ts} +9 -546
  50. package/dist/{qti-text-entry-interaction.d-BTAKmr4b.d.ts → qti-text-entry-interaction.d-DsUyecBC.d.ts} +3 -2
  51. package/dist/{record.d-Bojj6_LW.d.ts → record.d-BfZhFr0L.d.ts} +1 -1
  52. package/dist/{session.context.d-BNxGeyh9.d.ts → session.context.d-9gRdGK4T.d.ts} +1 -1
  53. package/dist/test-plugin-api.d.ts +134 -0
  54. package/dist/test-plugin-api.js +19 -0
  55. package/dist/test-plugin-api.js.map +1 -0
  56. package/dist/test.d.ts +16 -158
  57. package/dist/test.js +11 -50
  58. package/dist/transformers.js +1 -0
  59. package/dist/{item.types.d-DuVR0ZVK.d.ts → variables.d-DWHlTszN.d.ts} +1 -23
  60. package/package.json +7 -3
  61. package/dist/chunk-7MYZHZWV.js.map +0 -1
  62. package/dist/chunk-H3Z3TMFB.js.map +0 -1
  63. package/dist/chunk-LQ65RILE.js.map +0 -1
  64. package/dist/chunk-M4TZIB3W.js.map +0 -1
  65. /package/dist/{chunk-J3F3JSCW.js.map → chunk-N453PANH.js.map} +0 -0
  66. /package/dist/{chunk-NWSDBYK7.js.map → chunk-QLGUI5VG.js.map} +0 -0
  67. /package/dist/{chunk-4DC5Z2LQ.js.map → chunk-V5GL7PTC.js.map} +0 -0
@@ -1,14 +1,17 @@
1
1
  import * as lit from 'lit';
2
- import { LitElement, PropertyValues, TemplateResult, nothing } from 'lit';
2
+ import { LitElement, PropertyValues } from 'lit';
3
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-n3K2VvB0.js';
4
+ import { C as ComputedContext, a as ComputedItem } from './computed.types.d-D4wskgi0.js';
5
+ import './public-events.d-3dGip9pd.js';
5
6
  import { QtiAssessmentItem, QtiModalFeedback } from './elements.js';
6
7
  import { Q as QtiContext } from './qti.context.d-CejJMlfZ.js';
7
- import { T as TestContext, Q as QtiExpression, a as QtiExpressionBase } from './qti-expression.d-B-Cfbqlb.js';
8
+ import { T as TestContext, Q as QtiExpression, a as QtiExpressionBase } from './qti-expression.d-iH3w6mqf.js';
8
9
  import { TemplateFunction } from '@heximal/templates';
9
- import { h as VariableValue, b as ItemContext, c as OutcomeVariable, V as VariableDeclaration } from './item.types.d-DuVR0ZVK.js';
10
- import { S as SessionContext, V as View } from './session.context.d-BNxGeyh9.js';
10
+ import { g as VariableValue, b as OutcomeVariable, V as VariableDeclaration } from './variables.d-DWHlTszN.js';
11
+ import { S as SessionContext, V as View } from './session.context.d-9gRdGK4T.js';
11
12
  import { C as ConfigContext } from './config.context.d-CCqlJXpE.js';
13
+ import { I as ItemContext } from './item.types.d-Zc6ZQDhu.js';
14
+ import { Q as QtiTestState } from './qti-test-state.d-D8Q89RzZ.js';
12
15
  import { b as QtiRuleBase } from './qti-rule-base.d-CeKP0Ooi.js';
13
16
 
14
17
  declare class QtiAssessmentTest extends LitElement {
@@ -379,62 +382,6 @@ interface ITestNavigationMixin {
379
382
  };
380
383
  }
381
384
 
382
- /**
383
- * Everything a host needs to persist to resume a candidate's test session, and nothing else.
384
- *
385
- * Read it from `qtiTest.state` or the `qc-test-state-changed` event, store it wherever you like —
386
- * a database, `localStorage`, `sessionStorage` — and assign it back to `qtiTest.state` to resume.
387
- *
388
- * Deliberately not here:
389
- * - declaration metadata (`baseType`, `cardinality`, `correctResponse`, `mapping`, …): it comes
390
- * from the item XML on every load, and persisting the answer key with the candidate's data is
391
- * both bloat and a leak;
392
- * - `configContext` and `qtiContext`: inputs the host supplies on every load, not session state.
393
- * The shuffle `seed` in particular must be passed in again, or the restored order changes;
394
- * - `view`: a role the host decides, not something the candidate produced;
395
- * - anything computed — scores per section, `done`, `active` — which is rederived from this.
396
- */
397
- interface QtiTestState {
398
- /** Bumped on any incompatible change to this shape. A state with another version is ignored. */
399
- version: 1;
400
- test: {
401
- items: QtiTestStateItem[];
402
- /** Test-level outcome values. Only outcomes the test declares are restored. */
403
- outcomes: QtiTestStateValue[];
404
- };
405
- session: QtiTestStateSession;
406
- }
407
- interface QtiTestStateItem {
408
- /** The `qti-assessment-item-ref` identifier. */
409
- identifier: string;
410
- variables: (QtiTestStateValue & {
411
- type?: 'response' | 'outcome' | 'template' | 'context';
412
- })[];
413
- /** Opaque per-interaction state keyed by response identifier, e.g. a PCI's `getState()`. */
414
- state?: Record<string, string | null>;
415
- }
416
- interface QtiTestStateValue {
417
- identifier: string;
418
- value: string | string[] | null;
419
- }
420
- /**
421
- * What each plugin keeps in the state, by plugin name. Empty here: a plugin adds its own entry by
422
- * augmenting this interface (`declare module` on the module that declares it, with
423
- * `interface QtiTestPluginState { bookmarks: string[] }`), and reads it with
424
- * `pluginState(computedContext, 'bookmarks')`. The test never reads an entry; it
425
- * stores and restores it, so a value must survive `JSON.stringify`.
426
- */
427
- interface QtiTestPluginState {
428
- }
429
- /** Where the candidate is, and what plugins keep. */
430
- interface QtiTestStateSession {
431
- /** Plugin entries by plugin name. Entries of plugins that are not loaded are kept as they are. */
432
- plugins?: Partial<QtiTestPluginState> & Record<string, unknown>;
433
- navPartId?: string | null;
434
- navSectionId?: string | null;
435
- navItemRefId?: string | null;
436
- }
437
-
438
385
  interface ITestStateMixin {
439
386
  /**
440
387
  * The candidate's persistable state: what they answered and where they are.
@@ -556,19 +503,6 @@ declare global {
556
503
  }
557
504
  }
558
505
 
559
- declare class TestItemLink extends LitElement {
560
- static styles: lit.CSSResult;
561
- private itemId;
562
- constructor();
563
- protected _requestItem(identifier: string): void;
564
- render(): lit.TemplateResult<1>;
565
- }
566
- declare global {
567
- interface HTMLElementTagNameMap {
568
- 'test-item-link': TestItemLink;
569
- }
570
- }
571
-
572
506
  /**
573
507
  * A button that ends the attempt of an item: its response is processed, `numAttempts` goes up and
574
508
  * feedback is shown as the item's session control allows. It dispatches `qc-test-end-attempt`,
@@ -649,187 +583,6 @@ declare global {
649
583
  }
650
584
  }
651
585
 
652
- declare class TestSectionLink extends LitElement {
653
- #private;
654
- static styles: lit.CSSResult;
655
- private sectionId;
656
- constructor();
657
- render(): lit.TemplateResult<1>;
658
- }
659
- declare global {
660
- interface HTMLElementTagNameMap {
661
- 'test-section-link': TestSectionLink;
662
- }
663
- }
664
-
665
- declare module '../../types/qti-test-state' {
666
- interface QtiTestPluginState {
667
- /** Item-ref identifiers the candidate marked to come back to, in the order they were marked. */
668
- bookmarks: string[];
669
- }
670
- }
671
- /** The item-ref identifiers bookmarked so far. For a host's own navigation: mark these. */
672
- declare const bookmarkedItems: (context: Pick<ComputedContext, "plugins"> | undefined) => string[];
673
- /**
674
- * A toggle that marks the item on screen to come back to. The marks live in the test's state under
675
- * `bookmarks` (`session.plugins.bookmarks`), so a host that stores `state` stores them, and a
676
- * reloaded test shows them again.
677
- *
678
- * Put it inside `<test-navigation>`, either in the toolbar, where it marks the item on screen, or in
679
- * the `<template item-ref>`, where each item gets its own and it marks that item. It is a button
680
- * (`role="button"`, `aria-pressed`) and reflects `bookmarked` on the host for styling; its content is
681
- * the label. In the toolbar it is `disabled` while no item is on screen. A host's own navigation reads
682
- * the marks with `bookmarkedItems(computedContext)`.
683
- *
684
- * Give it an `item` (an item-ref identifier) to mark that item instead, wherever the button sits: in a
685
- * stamp template that lists the items of a section, `<test-bookmark item="{{ item.identifier }}">`
686
- * puts a button next to each one.
687
- *
688
- * @slot - The label.
689
- * @attr item - The item-ref identifier this button marks; without it, the item it is stamped into, or else the one on screen.
690
- * @attr bookmarked - Reflected: the item on screen is bookmarked.
691
- * @attr disabled - Reflected: there is no item on screen.
692
- */
693
- declare class TestBookmark extends LitElement {
694
- #private;
695
- protected computedContext?: ComputedContext;
696
- item?: string;
697
- bookmarked: boolean;
698
- disabled: boolean;
699
- static styles: lit.CSSResult[];
700
- constructor();
701
- connectedCallback(): void;
702
- protected willUpdate(): void;
703
- protected updated(): void;
704
- render(): lit.TemplateResult<1>;
705
- }
706
- declare global {
707
- interface HTMLElementTagNameMap {
708
- 'test-bookmark': TestBookmark;
709
- }
710
- }
711
-
712
- /**
713
- * Ends the attempt on the current item and switches the test to `view` (default `scorer`), which
714
- * reveals the `[view]` content for that view, such as a scorer's rubric. The view stays until
715
- * something switches it back (`test-view-toggle`).
716
- *
717
- * @attr view - The view to switch to after the attempt ended.
718
- */
719
- declare class TestCheckItem extends LitElement {
720
- view: View;
721
- static styles: lit.CSSResult;
722
- constructor();
723
- render(): lit.TemplateResult<1>;
724
- }
725
- declare global {
726
- interface HTMLElementTagNameMap {
727
- 'test-check-item': TestCheckItem;
728
- }
729
- }
730
-
731
- declare class TestPrintContext extends LitElement {
732
- computedContext?: ComputedContext;
733
- render(): lit.TemplateResult<1>;
734
- }
735
- declare global {
736
- interface HTMLElementTagNameMap {
737
- 'test-print-context': TestPrintContext;
738
- }
739
- }
740
-
741
- declare class TestPrintVariables extends LitElement {
742
- computedContext?: ComputedContext;
743
- static styles: lit.CSSResult;
744
- render(): lit.TemplateResult<1>;
745
- }
746
- declare global {
747
- interface HTMLElementTagNameMap {
748
- 'test-print-item-variables': TestPrintVariables;
749
- }
750
- }
751
-
752
- /**
753
- * Shows the test's state (`qtiTest.state`) as a tree you can fold open and shut, and keeps it current
754
- * on every `qc-test-state-changed`. A debug helper: drop it anywhere inside `<qti-test>`.
755
- *
756
- * The first two levels start open. A list entry with an `identifier` (an item, a variable) is labelled
757
- * by it. The element only lays out the tree; give it a font, colour and height from the page.
758
- *
759
- * @customElement test-print-state
760
- * @csspart key - the name of a field, or the label of a list entry
761
- * @csspart value - a value that is not an object or a list
762
- * @csspart count - the number of entries of a folded object or list
763
- */
764
- declare class TestPrintState extends LitElement {
765
- #private;
766
- private testState?;
767
- static styles: lit.CSSResult;
768
- connectedCallback(): void;
769
- disconnectedCallback(): void;
770
- render(): TemplateResult<1> | typeof nothing;
771
- }
772
- declare global {
773
- interface HTMLElementTagNameMap {
774
- 'test-print-state': TestPrintState;
775
- }
776
- }
777
-
778
- declare class TestScoringButtons extends LitElement {
779
- #private;
780
- view: string;
781
- disabled: boolean;
782
- myTemplate: TemplateFunction | null;
783
- protected createRenderRoot(): HTMLElement | DocumentFragment;
784
- connectedCallback(): void;
785
- protected computedContext?: ComputedContext;
786
- render(): lit.TemplateResult<1> | typeof nothing;
787
- constructor();
788
- }
789
- declare global {
790
- interface HTMLElementTagNameMap {
791
- 'test-scoring-buttons': TestScoringButtons;
792
- }
793
- }
794
-
795
- declare class TestScoringFeedback extends LitElement {
796
- protected computedContext?: ComputedContext;
797
- view: View;
798
- render(): lit.TemplateResult<1>;
799
- }
800
- declare global {
801
- interface HTMLElementTagNameMap {
802
- 'test-scoring-feedback': TestScoringFeedback;
803
- }
804
- }
805
-
806
- /**
807
- * The stamp plugin: renders its `<template>` child with the state of the test (`test`,
808
- * `activeTestpart`, `activeSection`, `activeItem`, `view`), again on every change, so a player
809
- * can show progress or numbered navigation without writing a component.
810
- * @customElement
811
- * @extends {LitElement}
812
- */
813
- declare class TestStamp extends LitElement {
814
- /**
815
- * Indicates whether the component is in debug mode.
816
- * When set to `true`, the available objects and properties (i.e.: stampContext) is displayed.
817
- */
818
- debug: boolean;
819
- private computedContext;
820
- private stampContext;
821
- myTemplate: TemplateFunction;
822
- protected createRenderRoot(): HTMLElement | DocumentFragment;
823
- connectedCallback(): void;
824
- protected willUpdate(_changedProperties: PropertyValues): void;
825
- render(): lit.TemplateResult<1>;
826
- }
827
- declare global {
828
- interface HTMLElementTagNameMap {
829
- 'test-stamp': TestStamp;
830
- }
831
- }
832
-
833
586
  /**
834
587
  * Scores the test: on click the test resets its outcomes to their declared defaults, runs its
835
588
  * outcome processing and dispatches `qc-test-submitted`, after which the host reads the outcomes.
@@ -846,296 +599,6 @@ declare global {
846
599
  }
847
600
  }
848
601
 
849
- declare class TestView extends LitElement {
850
- #private;
851
- static DEFAULT_VIEW_OPTIONS: string[];
852
- private sessionContext;
853
- /** label accompanying the select view dropdown */
854
- label: string;
855
- /** The options to display in the dropdown, default: ['author', 'candidate', 'proctor', 'scorer', 'testConstructor', 'tutor'] */
856
- viewOptions: string;
857
- protected _handleViewOptionsChange: () => void;
858
- connectedCallback(): void;
859
- private _viewOptions;
860
- protected _switchView(view: string): void;
861
- render(): lit.TemplateResult<1>;
862
- }
863
- declare global {
864
- interface HTMLElementTagNameMap {
865
- 'test-view': TestView;
866
- }
867
- }
868
-
869
- declare class TestViewToggle extends LitElement {
870
- myTemplate: any;
871
- protected createRenderRoot(): HTMLElement | DocumentFragment;
872
- private sessionContext;
873
- connectedCallback(): void;
874
- _switchView(view: string): void;
875
- protected firstUpdated(_changedProperties: PropertyValues): void;
876
- render(): lit.TemplateResult<1>;
877
- }
878
- declare global {
879
- interface HTMLElementTagNameMap {
880
- 'test-view-toggle': TestViewToggle;
881
- }
882
- }
883
-
884
- type SpeechState = 'idle' | 'playing' | 'paused';
885
- interface TtsContext {
886
- state: SpeechState;
887
- /** True while every reading element is highlighted and a click on one starts reading there. */
888
- picking: boolean;
889
- /** Index of the currently highlighted reading element (0-based). */
890
- currentElementIndex: number;
891
- /** Total number of navigable reading elements in the current item. */
892
- elementCount: number;
893
- play(): void;
894
- pause(): void;
895
- resume(): void;
896
- stop(): void;
897
- prevElement(): void;
898
- nextElement(): void;
899
- /** Toggle pick mode: highlight all reading elements, then read from the one that is clicked. */
900
- togglePick(): void;
901
- }
902
-
903
- /**
904
- * Base class shared by all TTS control elements. Consumes `ttsContext` and
905
- * mirrors the current speech state onto CSS custom states so each child can
906
- * be styled with `:state(playing)`, `:state(paused)`, `:state(idle)`.
907
- */
908
- declare abstract class TtsButtonBase extends LitElement {
909
- #private;
910
- static styles: lit.CSSResult;
911
- /**
912
- * Accessible name of the button. Without it the default icon carries an English name, and
913
- * slotted content names the button by its text; set it when you slot an icon of your own,
914
- * which has no text to be named by.
915
- */
916
- label?: string;
917
- protected _tts?: TtsContext;
918
- /** Whether this control is a toggle that is on; mirrored as `:state(selected)`. A plain button never is. */
919
- protected get selected(): boolean;
920
- updated(_changed: PropertyValues): void;
921
- }
922
- /**
923
- * `<test-item-to-speech>` is the controller and context provider. It manages
924
- * speech synthesis, word highlighting, and item element lookup. Compose your
925
- * own player by placing control elements as children.
926
- *
927
- * @example
928
- * ```html
929
- * <test-item-to-speech language="nl-NL">
930
- * <test-tts-play></test-tts-play>
931
- * <test-tts-prev></test-tts-prev>
932
- * <test-tts-next></test-tts-next>
933
- * <test-tts-stop></test-tts-stop>
934
- * </test-item-to-speech>
935
- * ```
936
- *
937
- * The controller lays its controls out as a wrapping row; each control draws an icon button,
938
- * and slotted content replaces the icon — a slotted `<svg>` is sized like the default one. Give a
939
- * control with a slotted icon a `label`, since an icon has no text to name the button by. Buttons read the qti-theme tokens (with the theme's
940
- * defaults as fallbacks), are painted through the `--button-*` slots every button in the theme shares
941
- * (`--test-button-*` still works as an alias), and can be sized with `--button-size` and
942
- * `--test-tts-icon-size`.
943
- *
944
- * ### Language resolution
945
- *
946
- * Each reading element is spoken in the language of the nearest `lang` attribute:
947
- *
948
- * 1. `lang` (or `xml:lang`) on the element itself
949
- * 2. `lang` on the closest ancestor — including `<qti-assessment-item xml:lang>` and, across
950
- * shadow roots, anything wrapping the test
951
- * 3. `lang` on the document's `<html>` element
952
- * 4. the `language` attribute on `<test-item-to-speech>`
953
- *
954
- * The transformer copies `xml:lang` over as a plain `lang` attribute, so QTI authored with
955
- * `xml:lang="en-GB"` on a `<p>` or on the item root is honoured without further work.
956
- *
957
- * ### What is read
958
- *
959
- * Decided once per connect, by where the player is placed. The first rule that matches wins:
960
- *
961
- * 1. **Next to a stimulus placeholder** — the player shares its parent with a
962
- * `[data-stimulus-idref]` element, e.g. in a reading-text panel beside the questions: the
963
- * player reads that stimulus (its `qti-stimulus-body`), and only that. Not inside the
964
- * placeholder: loading a stimulus replaces the placeholder's content. Items and navigation
965
- * are ignored; when the stimulus is (re)loaded or the placeholder swapped, the player starts
966
- * over on the new content.
967
- * 2. **Next to `[data-tts-content]`** — the player shares its parent with an element marked
968
- * `data-tts-content`: any HTML, not QTI, e.g. a start screen rendered by React. The marker goes
969
- * on one container; the player reads the readable elements inside it. Navigation is ignored.
970
- * The reading list is rebuilt when the player starts from the top, and when an element in it
971
- * has left the page — so a re-render of the content never interrupts speech.
972
- * 3. **Inside a `qti-assessment-item-ref`** — e.g. in a `<template item-ref>` on `<qti-test>`,
973
- * so every item gets a player of its own: the player reads that item, and only that item.
974
- * The navigation cursor is ignored; speech stops when the player leaves the page with its item.
975
- * 4. **Anywhere else inside `<test-navigation>`** — e.g. a toolbar: the player follows the
976
- * navigation cursor and reads the active item of the computed context. Navigating stops
977
- * speech and starts the next item from the top.
978
- *
979
- * ```html
980
- * <!-- 1. a player for the shared reading text -->
981
- * <aside>
982
- * <test-item-to-speech>…</test-item-to-speech>
983
- * <div data-stimulus-idref="Stimulus1"></div>
984
- * </aside>
985
- *
986
- * <!-- 2. a player for any other HTML -->
987
- * <div>
988
- * <test-item-to-speech>…</test-item-to-speech>
989
- * <section data-tts-content lang="nl-NL">…</section>
990
- * </div>
991
- *
992
- * <!-- 3. one player per item -->
993
- * <qti-test>
994
- * <template item-ref>
995
- * <test-item-to-speech>…</test-item-to-speech>
996
- * {{ xmlDoc }}
997
- * </template>
998
- * …
999
- * </qti-test>
1000
- *
1001
- * <!-- 4. one player in the toolbar, following navigation -->
1002
- * <test-navigation>
1003
- * <header><test-item-to-speech>…</test-item-to-speech></header>
1004
- * <test-container test-url="…"></test-container>
1005
- * </test-navigation>
1006
- * ```
1007
- *
1008
- * In modes 3 and 4 the item re-rendering (navigating to the item already shown) restarts the
1009
- * player on the fresh content. An item player reads the item body as rendered: a stimulus
1010
- * placed inside the item is read with it, one placed outside (mode 1) is not. Only one player
1011
- * can speak at a time; starting one stops any other.
1012
- *
1013
- * Read are `p`, `h1`–`h6`, `li`, `dt`, `dd`, `th`, `td`, `caption`, `blockquote`, `figcaption`,
1014
- * `qti-prompt` and `qti-simple-choice` — the innermost match only — unless hidden (`display: none`)
1015
- * or inside `aria-hidden="true"`.
1016
- *
1017
- * ### Starting somewhere in the middle
1018
- *
1019
- * `<test-tts-pick>` switches the player into pick mode: every reading element gets the blue
1020
- * cursor highlight, and the first click on one of them leaves pick mode and starts reading
1021
- * from that element. Pressing the button again leaves pick mode without reading.
1022
- *
1023
- * @cssstate idle - No speech active
1024
- * @cssstate picking - Pick mode: all reading elements highlighted, waiting for a click
1025
- * @cssstate playing - Speech is playing
1026
- * @cssstate paused - Speech is paused
1027
- */
1028
- declare class TestItemToSpeech extends LitElement {
1029
- #private;
1030
- static styles: lit.CSSResult;
1031
- /** Fallback language when neither the item content nor the document declares one. */
1032
- language: string;
1033
- /**
1034
- * The test as `test-navigation` computes it: which item is active, and where it is rendered
1035
- * (`itemElement`). Updated on navigation and whenever an item is rendered.
1036
- */
1037
- protected _computedContext?: ComputedContext;
1038
- _ttsContext: TtsContext;
1039
- constructor();
1040
- willUpdate(changed: PropertyValues): void;
1041
- connectedCallback(): void;
1042
- disconnectedCallback(): void;
1043
- render(): lit.TemplateResult<1>;
1044
- }
1045
- /**
1046
- * Play/pause/resume toggle button — always enabled, cycles through states.
1047
- * Use named slots `play` and `pause` to customise the icons/labels independently; `label` and
1048
- * `pause-label` name the button in each state (set them when the slotted content is an icon).
1049
- *
1050
- * @example
1051
- * ```html
1052
- * <test-tts-play>
1053
- * <span slot="play">Voorlezen</span>
1054
- * <span slot="pause">Pauzeren</span>
1055
- * </test-tts-play>
1056
- * ```
1057
- *
1058
- * @cssstate idle / playing / paused
1059
- * @csspart button
1060
- */
1061
- declare class TestTtsPlay extends TtsButtonBase {
1062
- #private;
1063
- /** Accessible name of the button while speech is playing; see `label`. */
1064
- pauseLabel?: string;
1065
- render(): lit.TemplateResult<1>;
1066
- }
1067
- /**
1068
- * Pause button — enabled only when playing.
1069
- * @cssstate idle / playing / paused
1070
- * @csspart button
1071
- */
1072
- declare class TestTtsPause extends TtsButtonBase {
1073
- render(): lit.TemplateResult<1>;
1074
- }
1075
- /**
1076
- * Resume button — enabled only when paused.
1077
- * @cssstate idle / playing / paused
1078
- * @csspart button
1079
- */
1080
- declare class TestTtsResume extends TtsButtonBase {
1081
- render(): lit.TemplateResult<1>;
1082
- }
1083
- /**
1084
- * Stop button — enabled when playing, paused, or in pick mode (where it leaves pick mode).
1085
- * @cssstate idle / playing / paused
1086
- * @csspart button
1087
- */
1088
- declare class TestTtsStop extends TtsButtonBase {
1089
- render(): lit.TemplateResult<1>;
1090
- }
1091
- /**
1092
- * Prev-element button — moves cursor to the previous reading element and pauses.
1093
- * Disabled at the first element. Reading elements are collected lazily, so an element count
1094
- * of 0 means "not looked yet" rather than "nothing to read": the button stays enabled and the
1095
- * first click collects them.
1096
- * @cssstate idle / playing / paused
1097
- * @csspart button
1098
- */
1099
- declare class TestTtsPrev extends TtsButtonBase {
1100
- render(): lit.TemplateResult<1>;
1101
- }
1102
- /**
1103
- * Next-element button — moves cursor to the next reading element and pauses.
1104
- * Disabled at the last element; enabled while the elements have not been collected yet
1105
- * (see `TestTtsPrev`).
1106
- * @cssstate idle / playing / paused
1107
- * @csspart button
1108
- */
1109
- declare class TestTtsNext extends TtsButtonBase {
1110
- render(): lit.TemplateResult<1>;
1111
- }
1112
- /**
1113
- * Pick button — toggles pick mode on the controller: every reading element is highlighted and
1114
- * a click on one of them starts reading from there. Reflects the mode as `:state(picking)`, and,
1115
- * being the toggle that switched it on, as `:state(selected)`, painted through
1116
- * `--button-selected-background-color` / `--button-selected-color`.
1117
- * @cssstate idle / playing / paused
1118
- * @cssstate picking
1119
- * @cssstate selected - This toggle is on: pick mode is active
1120
- * @csspart button
1121
- */
1122
- declare class TestTtsPick extends TtsButtonBase {
1123
- protected get selected(): boolean;
1124
- render(): lit.TemplateResult<1>;
1125
- }
1126
- declare global {
1127
- interface HTMLElementTagNameMap {
1128
- 'test-item-to-speech': TestItemToSpeech;
1129
- 'test-tts-play': TestTtsPlay;
1130
- 'test-tts-pause': TestTtsPause;
1131
- 'test-tts-resume': TestTtsResume;
1132
- 'test-tts-stop': TestTtsStop;
1133
- 'test-tts-prev': TestTtsPrev;
1134
- 'test-tts-next': TestTtsNext;
1135
- 'test-tts-pick': TestTtsPick;
1136
- }
1137
- }
1138
-
1139
602
  declare const QtiTest_base: (abstract new (...args: any[]) => ITestNavigationMixin) & (abstract new (...args: any[]) => {
1140
603
  updateAssessmentItemView(assessmentItem: QtiAssessmentItem, view: View): void;
1141
604
  }) & (abstract new (...args: any[]) => {
@@ -1223,4 +686,4 @@ declare global {
1223
686
  }
1224
687
  }
1225
688
 
1226
- export { TestPrintVariables as A, TestScoringButtons as B, TestScoringFeedback as C, TestSectionLink as D, TestStamp as E, TestSubmit as F, TestTtsNext as G, TestTtsPause as H, type ITestNavigationMixin as I, TestTtsPick as J, TestTtsPlay as K, TestTtsPrev as L, TestTtsResume as M, TestTtsStop as N, TestView as O, TestViewToggle as P, QtiAssessmentItemRef as Q, bookmarkedItems as R, type QtiTestPluginState as S, TestBookmark as T, type ItemVariableValue as U, type ITestStateMixin as a, type ItemRefTemplateModel as b, QtiAssessmentSection as c, QtiAssessmentTest as d, QtiBranchRule as e, QtiItemSessionControl as f, QtiNumberPresented as g, QtiNumberSelected as h, QtiOutcomeProcessing as i, QtiOutcomeProcessingProcessor as j, QtiPreCondition as k, QtiTest as l, QtiTestFeedback as m, QtiTestPart as n, QtiTestVariables as o, QtiTestVariablesExpression as p, TestCheckItem as q, TestContainer as r, TestEndAttempt as s, TestItemLink as t, TestItemToSpeech as u, TestNavigation as v, TestNext as w, TestPrev as x, TestPrintContext as y, TestPrintState as z };
689
+ export { type ITestNavigationMixin as I, QtiAssessmentItemRef as Q, TestContainer as T, type ITestStateMixin as a, type ItemRefTemplateModel as b, QtiAssessmentSection as c, QtiAssessmentTest as d, QtiBranchRule as e, QtiItemSessionControl as f, QtiNumberPresented as g, QtiNumberSelected as h, QtiOutcomeProcessing as i, QtiOutcomeProcessingProcessor as j, QtiPreCondition as k, QtiTest as l, QtiTestFeedback as m, QtiTestPart as n, QtiTestVariables as o, QtiTestVariablesExpression as p, TestEndAttempt as q, TestNavigation as r, TestNext as s, TestPrev as t, TestSubmit as u, type ItemVariableValue as v };
@@ -1,9 +1,10 @@
1
1
  import * as lit from 'lit';
2
2
  import { LitElement, CSSResultGroup, PropertyValues } from 'lit';
3
- import { I as Interaction, c as ValidityTrigger, b as RecordValue } from './record.d-Bojj6_LW.js';
3
+ import { I as Interaction, c as ValidityTrigger, b as RecordValue } from './record.d-BfZhFr0L.js';
4
4
  import { V as ValidatableInteraction } from './interaction.interface.d-CvjHM2bi.js';
5
5
  import { C as ConfigContext } from './config.context.d-CCqlJXpE.js';
6
- import { B as BaseType, a as Cardinality, b as ItemContext, Q as QtiAreaMapEntry } from './item.types.d-DuVR0ZVK.js';
6
+ import { B as BaseType, a as Cardinality, Q as QtiAreaMapEntry } from './variables.d-DWHlTszN.js';
7
+ import { I as ItemContext } from './item.types.d-Zc6ZQDhu.js';
7
8
  import { Q as QtiContext } from './qti.context.d-CejJMlfZ.js';
8
9
  import * as lit_directives_ref_js from 'lit/directives/ref.js';
9
10
 
@@ -1,7 +1,7 @@
1
1
  import { LitElement, PropertyValues } from 'lit';
2
2
  import { C as ConfigContext, V as ValidationDisplayMode } from './config.context.d-CCqlJXpE.js';
3
3
  import { V as ValidatableInteraction } from './interaction.interface.d-CvjHM2bi.js';
4
- import { g as ResponseVariable, B as BaseType } from './item.types.d-DuVR0ZVK.js';
4
+ import { f as ResponseVariable, B as BaseType } from './variables.d-DWHlTszN.js';
5
5
 
6
6
  /**
7
7
  * What a choice element should render and behave as. The same element — `qti-simple-choice`,
@@ -1,4 +1,4 @@
1
- import { V as VariableDeclaration } from './item.types.d-DuVR0ZVK.js';
1
+ import { V as VariableDeclaration } from './variables.d-DWHlTszN.js';
2
2
 
3
3
  type ComputedItemContext = {
4
4
  identifier: string;