@citolab/qti-components 10.0.0-next.1 → 10.0.0-next.11

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 (65) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +3701 -765
  3. package/dist/base.d.ts +10 -10
  4. package/dist/base.js +7 -1
  5. package/dist/{chunk-FWR6HZQS.js → chunk-454ZDSKX.js} +16 -13
  6. package/dist/chunk-454ZDSKX.js.map +1 -0
  7. package/dist/{chunk-35WWWFS6.js → chunk-AJ5U5KXR.js} +2 -2
  8. package/dist/{chunk-FD4AB6TM.js → chunk-AVZRY5SQ.js} +2 -2
  9. package/dist/{chunk-CKJ7M7JQ.js → chunk-KYNLY2ET.js} +2340 -2032
  10. package/dist/chunk-KYNLY2ET.js.map +1 -0
  11. package/dist/{chunk-6K3QWJHH.js → chunk-LCGPLQLE.js} +40 -4
  12. package/dist/chunk-LCGPLQLE.js.map +1 -0
  13. package/dist/{chunk-MI7774NV.js → chunk-M7X6TWSX.js} +2 -2
  14. package/dist/{chunk-YYIS6FDP.js → chunk-N2CTFOIK.js} +2 -2
  15. package/dist/{chunk-RSMYGGQK.js → chunk-O76BOKAP.js} +496 -271
  16. package/dist/chunk-O76BOKAP.js.map +1 -0
  17. package/dist/{chunk-GBZNFSFY.js → chunk-RWMY7KRT.js} +2 -2
  18. package/dist/{chunk-TDWJ6WZA.js → chunk-T7YSBBAA.js} +37 -1
  19. package/dist/chunk-T7YSBBAA.js.map +1 -0
  20. package/dist/{chunk-RU6332MD.js → chunk-XXJAE6AP.js} +3 -3
  21. package/dist/chunk-YKXVAXSI.js +7 -0
  22. package/dist/chunk-YKXVAXSI.js.map +1 -0
  23. package/dist/{chunk-6U3YPHXU.js → chunk-YOCOLMGB.js} +40 -5
  24. package/dist/{chunk-6U3YPHXU.js.map → chunk-YOCOLMGB.js.map} +1 -1
  25. package/dist/{computed.types.d-gJrBeUMG.d.ts → computed.types.d-IXACuBr7.d.ts} +10 -1
  26. package/dist/corrections.d.ts +9 -9
  27. package/dist/corrections.js +8 -8
  28. package/dist/elements.d.ts +2 -2
  29. package/dist/elements.js +3 -3
  30. package/dist/index.d.ts +11 -11
  31. package/dist/index.js +37 -19
  32. package/dist/interactions.d.ts +4 -4
  33. package/dist/interactions.js +7 -3
  34. package/dist/item.css +1581 -387
  35. package/dist/item.d.ts +4 -4
  36. package/dist/item.js +4 -4
  37. package/dist/{item.types.d-B55QkJ92.d.ts → item.types.d-DuVR0ZVK.d.ts} +7 -1
  38. package/dist/loader.d.ts +2 -2
  39. package/dist/processing.d.ts +10 -3
  40. package/dist/processing.js +3 -3
  41. package/dist/qti-components-jsx.d.ts +934 -761
  42. package/dist/{qti-condition-expression.d-VJH6cWxf.d.ts → qti-condition-expression.d-B-T1NNl0.d.ts} +1 -1
  43. package/dist/{qti-expression.d-BPxEp8HU.d.ts → qti-expression.d-B-Cfbqlb.d.ts} +1 -1
  44. package/dist/{qti-feedback.d-wMYNVkkj.d.ts → qti-feedback.d-DbzPSJuK.d.ts} +1 -1
  45. package/dist/{qti-item.d-DgC1AQbY.d.ts → qti-item.d-B1gffYCL.d.ts} +1 -1
  46. package/dist/{qti-test.d-DkpBNcsv.d.ts → qti-test.d-D5C7W8Lg.d.ts} +185 -101
  47. package/dist/{qti-text-entry-interaction.d-q8u5BiVK.d.ts → qti-text-entry-interaction.d-CU-fAAD1.d.ts} +28 -19
  48. package/dist/{interaction.d-g6XG0T0Z.d.ts → record.d-wB9uYs-j.d.ts} +34 -2
  49. package/dist/{session.context.d-D5080LVx.d.ts → session.context.d-DW09Lrie.d.ts} +7 -1
  50. package/dist/test.d.ts +117 -9
  51. package/dist/test.js +19 -11
  52. package/package.json +9 -9
  53. package/dist/chunk-6K3QWJHH.js.map +0 -1
  54. package/dist/chunk-CKJ7M7JQ.js.map +0 -1
  55. package/dist/chunk-FWR6HZQS.js.map +0 -1
  56. package/dist/chunk-RSMYGGQK.js.map +0 -1
  57. package/dist/chunk-TDWJ6WZA.js.map +0 -1
  58. package/dist/chunk-ZP6QQYSU.js +0 -7
  59. package/dist/chunk-ZP6QQYSU.js.map +0 -1
  60. /package/dist/{chunk-35WWWFS6.js.map → chunk-AJ5U5KXR.js.map} +0 -0
  61. /package/dist/{chunk-FD4AB6TM.js.map → chunk-AVZRY5SQ.js.map} +0 -0
  62. /package/dist/{chunk-MI7774NV.js.map → chunk-M7X6TWSX.js.map} +0 -0
  63. /package/dist/{chunk-YYIS6FDP.js.map → chunk-N2CTFOIK.js.map} +0 -0
  64. /package/dist/{chunk-GBZNFSFY.js.map → chunk-RWMY7KRT.js.map} +0 -0
  65. /package/dist/{chunk-RU6332MD.js.map → chunk-XXJAE6AP.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- import { Q as QtiExpression } from './qti-expression.d-BPxEp8HU.js';
1
+ import { Q as QtiExpression } from './qti-expression.d-B-Cfbqlb.js';
2
2
 
3
3
  declare abstract class QtiConditionExpression extends QtiExpression<boolean> {
4
4
  calculate(): Readonly<boolean>;
@@ -1,6 +1,6 @@
1
1
  import * as lit from 'lit';
2
2
  import { LitElement } from 'lit';
3
- import { b as ItemContext, V as VariableDeclaration, g as ResponseVariable, B as BaseType } from './item.types.d-B55QkJ92.js';
3
+ import { b as ItemContext, V as VariableDeclaration, g as ResponseVariable, B as BaseType } from './item.types.d-DuVR0ZVK.js';
4
4
  import { a as QtiContextType, Q as QtiContext } from './qti.context.d-CejJMlfZ.js';
5
5
 
6
6
  interface TestContext {
@@ -1,6 +1,6 @@
1
1
  import * as lit from 'lit';
2
2
  import { LitElement } from 'lit';
3
- import { a as Cardinality } from './item.types.d-B55QkJ92.js';
3
+ import { a as Cardinality } from './item.types.d-DuVR0ZVK.js';
4
4
 
5
5
  declare abstract class QtiVariableDeclaration extends LitElement {
6
6
  render(): lit.TemplateResult<1>;
@@ -1,7 +1,7 @@
1
1
  import * as lit from 'lit';
2
2
  import { LitElement } from 'lit';
3
3
  import { Q as QtiContext } from './qti.context.d-CejJMlfZ.js';
4
- import { C as ComputedItemContext, V as View } from './session.context.d-D5080LVx.js';
4
+ import { C as ComputedItemContext, V as View } from './session.context.d-DW09Lrie.js';
5
5
  import { C as ConfigContext } from './config.context.d-BvU9r-Mg.js';
6
6
  import { QtiAssessmentItem } from './elements.js';
7
7
 
@@ -1,13 +1,13 @@
1
1
  import * as lit from 'lit';
2
2
  import { LitElement, PropertyValues, nothing } from 'lit';
3
3
  import { b as transformTestApi, t as transformItemApi } from './qti-transform-test.d-BL7GGFJj.js';
4
- import { C as ComputedContext, a as ComputedItem } from './computed.types.d-gJrBeUMG.js';
4
+ import { C as ComputedContext, a as ComputedItem } from './computed.types.d-IXACuBr7.js';
5
5
  import { QtiAssessmentItem, QtiModalFeedback } from './elements.js';
6
6
  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-BPxEp8HU.js';
7
+ import { T as TestContext, Q as QtiExpression, a as QtiExpressionBase } from './qti-expression.d-B-Cfbqlb.js';
8
8
  import { TemplateFunction } from '@heximal/templates';
9
- import { h as VariableValue, b as ItemContext, c as OutcomeVariable, V as VariableDeclaration } from './item.types.d-B55QkJ92.js';
10
- import { S as SessionContext, V as View } from './session.context.d-D5080LVx.js';
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-DW09Lrie.js';
11
11
  import { C as ConfigContext } from './config.context.d-BvU9r-Mg.js';
12
12
  import { b as QtiRuleBase } from './qti-rule-base.d-Bdzg8eGH.js';
13
13
 
@@ -184,6 +184,33 @@ declare global {
184
184
  }
185
185
  }
186
186
 
187
+ /**
188
+ * @summary The qti-number-presented expression counts the selected items that have been presented to the candidate.
189
+ * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.number-presented
190
+ *
191
+ * Outcome processing only. `section-identifier`, `include-category` and
192
+ * `exclude-category` narrow which item references are counted, the same way as
193
+ * for `qti-number-selected` and `qti-test-variables`.
194
+ *
195
+ * An item is presented once its `completionStatus` has left `not_attempted`:
196
+ * presenting an item starts its first attempt. An item a linear test part
197
+ * passed over (pre-condition, branch rule) or one the candidate has not reached
198
+ * keeps `not_attempted`. That makes this the count to use for a total over the
199
+ * candidate's own route, such as a maximum score of one point per presented item.
200
+ */
201
+ declare class QtiNumberPresented extends QtiExpression<number> {
202
+ #private;
203
+ _testContext?: TestContext;
204
+ constructor();
205
+ getResult(): number;
206
+ calculate(): number;
207
+ }
208
+ declare global {
209
+ interface HTMLElementTagNameMap {
210
+ 'qti-number-presented': QtiNumberPresented;
211
+ }
212
+ }
213
+
187
214
  /**
188
215
  * @summary The qti-number-selected expression counts the item refs selected for the test.
189
216
  * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.number-selected
@@ -247,8 +274,19 @@ declare class QtiOutcomeProcessingProcessor {
247
274
  process(rules: QtiRuleBase[]): void;
248
275
  }
249
276
 
277
+ /**
278
+ * Test-level feedback. It renders nothing where it is declared: where and when it appears is up to
279
+ * the host. After outcome processing, `qtiTest.getTestFeedback(access)` returns the ones that apply.
280
+ */
250
281
  declare class QtiTestFeedback extends QtiModalFeedback {
251
282
  static styles: lit.CSSResult;
283
+ /** When the feedback may be shown: at the end of the test (`atEnd`), or while it runs (`during`). */
284
+ access: 'atEnd' | 'during';
285
+ /**
286
+ * Whether this feedback applies for a value of its `outcome-identifier`: with `show-hide="show"`
287
+ * when the value is (or, for a container, holds) its `identifier`; with `hide` when it is not.
288
+ */
289
+ matches(value: string | readonly string[] | null | undefined): boolean;
252
290
  render(): lit.TemplateResult<1>;
253
291
  }
254
292
  declare global {
@@ -379,8 +417,19 @@ interface QtiTestStateValue {
379
417
  identifier: string;
380
418
  value: string | string[] | null;
381
419
  }
382
- /** Where the candidate is. */
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. */
383
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>;
384
433
  navPartId?: string | null;
385
434
  navSectionId?: string | null;
386
435
  navItemRefId?: string | null;
@@ -511,26 +560,6 @@ declare global {
511
560
  }
512
561
  }
513
562
 
514
- declare class TestView extends LitElement {
515
- #private;
516
- static DEFAULT_VIEW_OPTIONS: string[];
517
- private sessionContext;
518
- /** label accompanying the select view dropdown */
519
- label: string;
520
- /** The options to display in the dropdown, default: ['author', 'candidate', 'proctor', 'scorer', 'testConstructor', 'tutor'] */
521
- viewOptions: string;
522
- protected _handleViewOptionsChange: () => void;
523
- connectedCallback(): void;
524
- private _viewOptions;
525
- protected _switchView(view: string): void;
526
- render(): lit.TemplateResult<1>;
527
- }
528
- declare global {
529
- interface HTMLElementTagNameMap {
530
- 'test-view': TestView;
531
- }
532
- }
533
-
534
563
  declare class TestItemLink extends LitElement {
535
564
  static styles: lit.CSSResult;
536
565
  private itemId;
@@ -560,24 +589,6 @@ declare global {
560
589
  }
561
590
  }
562
591
 
563
- /**
564
- * @deprecated test-paging-buttons-stamp is deprecated and will be removed in the future.
565
- */
566
- declare class TestPagingButtonsStamp extends LitElement {
567
- #private;
568
- private computedContext;
569
- myTemplate: TemplateFunction;
570
- protected createRenderRoot(): HTMLElement | DocumentFragment;
571
- constructor();
572
- connectedCallback(): void;
573
- render(): lit.TemplateResult<1>;
574
- }
575
- declare global {
576
- interface HTMLElementTagNameMap {
577
- 'test-paging-buttons-stamp': TestPagingButtonsStamp;
578
- }
579
- }
580
-
581
592
  /**
582
593
  * `<test-container>` is a custom element designed for hosting the qti-assessment-item.
583
594
  * The `qti-assessment-test` will be placed inside the shadow DOM of this element.
@@ -617,45 +628,82 @@ declare global {
617
628
  }
618
629
  }
619
630
 
620
- declare class TestPrintVariables extends LitElement {
621
- computedContext?: ComputedContext;
631
+ declare class TestSectionLink extends LitElement {
632
+ #private;
622
633
  static styles: lit.CSSResult;
634
+ private sectionId;
635
+ constructor();
623
636
  render(): lit.TemplateResult<1>;
624
637
  }
625
638
  declare global {
626
639
  interface HTMLElementTagNameMap {
627
- 'test-print-item-variables': TestPrintVariables;
640
+ 'test-section-link': TestSectionLink;
628
641
  }
629
642
  }
630
643
 
644
+ declare module '../../types/qti-test-state' {
645
+ interface QtiTestPluginState {
646
+ /** Item-ref identifiers the candidate marked to come back to, in the order they were marked. */
647
+ bookmarks: string[];
648
+ }
649
+ }
650
+ /** The item-ref identifiers bookmarked so far. For a host's own navigation: mark these. */
651
+ declare const bookmarkedItems: (context: Pick<ComputedContext, "plugins"> | undefined) => string[];
631
652
  /**
632
- * @deprecated test-section-buttons-stamp is deprecated and will be removed in the future.
653
+ * A toggle that marks the item on screen to come back to. The marks live in the test's state under
654
+ * `bookmarks` (`session.plugins.bookmarks`), so a host that stores `state` stores them, and a
655
+ * reloaded test shows them again.
656
+ *
657
+ * Put it inside `<test-navigation>`, either in the toolbar, where it marks the item on screen, or in
658
+ * the `<template item-ref>`, where each item gets its own and it marks that item. It is a button
659
+ * (`role="button"`, `aria-pressed`) and reflects `bookmarked` on the host for styling; its content is
660
+ * the label. In the toolbar it is `disabled` while no item is on screen. A host's own navigation reads
661
+ * the marks with `bookmarkedItems(computedContext)`.
662
+ *
663
+ * Give it an `item` (an item-ref identifier) to mark that item instead, wherever the button sits: in a
664
+ * stamp template that lists the items of a section, `<test-bookmark item="{{ item.identifier }}">`
665
+ * puts a button next to each one.
666
+ *
667
+ * @slot - The label.
668
+ * @attr item - The item-ref identifier this button marks; without it, the item it is stamped into, or else the one on screen.
669
+ * @attr bookmarked - Reflected: the item on screen is bookmarked.
670
+ * @attr disabled - Reflected: there is no item on screen.
633
671
  */
634
- declare class TestSectionButtonsStamp extends LitElement {
672
+ declare class TestBookmark extends LitElement {
635
673
  #private;
636
- private computedContext;
637
- myTemplate: TemplateFunction;
638
- protected createRenderRoot(): HTMLElement | DocumentFragment;
674
+ protected computedContext?: ComputedContext;
675
+ item?: string;
676
+ bookmarked: boolean;
677
+ disabled: boolean;
678
+ static styles: lit.CSSResult;
639
679
  constructor();
640
680
  connectedCallback(): void;
681
+ protected willUpdate(): void;
682
+ protected updated(): void;
641
683
  render(): lit.TemplateResult<1>;
642
684
  }
643
685
  declare global {
644
686
  interface HTMLElementTagNameMap {
645
- 'test-section-buttons-stamp': TestSectionButtonsStamp;
687
+ 'test-bookmark': TestBookmark;
646
688
  }
647
689
  }
648
690
 
649
- declare class TestSectionLink extends LitElement {
650
- #private;
691
+ /**
692
+ * Ends the attempt on the current item and switches the test to `view` (default `scorer`), which
693
+ * reveals the `[view]` content for that view, such as a scorer's rubric. The view stays until
694
+ * something switches it back (`test-view-toggle`).
695
+ *
696
+ * @attr view - The view to switch to after the attempt ended.
697
+ */
698
+ declare class TestCheckItem extends LitElement {
699
+ view: View;
651
700
  static styles: lit.CSSResult;
652
- private sectionId;
653
701
  constructor();
654
702
  render(): lit.TemplateResult<1>;
655
703
  }
656
704
  declare global {
657
705
  interface HTMLElementTagNameMap {
658
- 'test-section-link': TestSectionLink;
706
+ 'test-check-item': TestCheckItem;
659
707
  }
660
708
  }
661
709
 
@@ -669,29 +717,14 @@ declare global {
669
717
  }
670
718
  }
671
719
 
672
- /**
673
- * A custom web component that renders a test stamp using the Lit framework.
674
- * This component is deprecated and will be removed in the future.
675
- * @customElement
676
- * @extends {LitElement}
677
- */
678
- declare class TestStamp extends LitElement {
679
- /**
680
- * Indicates whether the component is in debug mode.
681
- * When set to `true`, the available objects and properties (i.e.: stampContext) is displayed.
682
- */
683
- debug: boolean;
684
- private computedContext;
685
- private stampContext;
686
- myTemplate: TemplateFunction;
687
- protected createRenderRoot(): HTMLElement | DocumentFragment;
688
- connectedCallback(): void;
689
- protected willUpdate(_changedProperties: PropertyValues): void;
720
+ declare class TestPrintVariables extends LitElement {
721
+ computedContext?: ComputedContext;
722
+ static styles: lit.CSSResult;
690
723
  render(): lit.TemplateResult<1>;
691
724
  }
692
725
  declare global {
693
726
  interface HTMLElementTagNameMap {
694
- 'test-stamp': TestStamp;
727
+ 'test-print-item-variables': TestPrintVariables;
695
728
  }
696
729
  }
697
730
 
@@ -712,41 +745,92 @@ declare global {
712
745
  }
713
746
  }
714
747
 
715
- declare class TestViewToggle extends LitElement {
716
- myTemplate: any;
717
- protected createRenderRoot(): HTMLElement | DocumentFragment;
718
- private sessionContext;
719
- connectedCallback(): void;
720
- _switchView(view: string): void;
721
- protected firstUpdated(_changedProperties: PropertyValues): void;
748
+ declare class TestScoringFeedback extends LitElement {
749
+ protected computedContext?: ComputedContext;
750
+ view: View;
722
751
  render(): lit.TemplateResult<1>;
723
752
  }
724
753
  declare global {
725
754
  interface HTMLElementTagNameMap {
726
- 'test-view-toggle': TestViewToggle;
755
+ 'test-scoring-feedback': TestScoringFeedback;
727
756
  }
728
757
  }
729
758
 
730
- declare class TestScoringFeedback extends LitElement {
731
- protected computedContext?: ComputedContext;
732
- view: View;
759
+ /**
760
+ * The stamp plugin: renders its `<template>` child with the state of the test (`test`,
761
+ * `activeTestpart`, `activeSection`, `activeItem`, `view`), again on every change, so a player
762
+ * can show progress or numbered navigation without writing a component.
763
+ * @customElement
764
+ * @extends {LitElement}
765
+ */
766
+ declare class TestStamp extends LitElement {
767
+ /**
768
+ * Indicates whether the component is in debug mode.
769
+ * When set to `true`, the available objects and properties (i.e.: stampContext) is displayed.
770
+ */
771
+ debug: boolean;
772
+ private computedContext;
773
+ private stampContext;
774
+ myTemplate: TemplateFunction;
775
+ protected createRenderRoot(): HTMLElement | DocumentFragment;
776
+ connectedCallback(): void;
777
+ protected willUpdate(_changedProperties: PropertyValues): void;
733
778
  render(): lit.TemplateResult<1>;
734
779
  }
735
780
  declare global {
736
781
  interface HTMLElementTagNameMap {
737
- 'test-scoring-feedback': TestScoringFeedback;
782
+ 'test-stamp': TestStamp;
738
783
  }
739
784
  }
740
785
 
741
- declare class TestCheckItem extends LitElement {
742
- protected testHost?: TestHost;
786
+ /**
787
+ * Scores the test: on click the test resets its outcomes to their declared defaults, runs its
788
+ * outcome processing and dispatches `cito-test-submitted`, after which the host reads the outcomes.
789
+ * The host decides where it sits, for example on the last item or in a review view.
790
+ */
791
+ declare class TestSubmit extends LitElement {
743
792
  static styles: lit.CSSResult;
744
793
  constructor();
745
794
  render(): lit.TemplateResult<1>;
746
795
  }
747
796
  declare global {
748
797
  interface HTMLElementTagNameMap {
749
- 'test-check-item': TestCheckItem;
798
+ 'test-submit': TestSubmit;
799
+ }
800
+ }
801
+
802
+ declare class TestView extends LitElement {
803
+ #private;
804
+ static DEFAULT_VIEW_OPTIONS: string[];
805
+ private sessionContext;
806
+ /** label accompanying the select view dropdown */
807
+ label: string;
808
+ /** The options to display in the dropdown, default: ['author', 'candidate', 'proctor', 'scorer', 'testConstructor', 'tutor'] */
809
+ viewOptions: string;
810
+ protected _handleViewOptionsChange: () => void;
811
+ connectedCallback(): void;
812
+ private _viewOptions;
813
+ protected _switchView(view: string): void;
814
+ render(): lit.TemplateResult<1>;
815
+ }
816
+ declare global {
817
+ interface HTMLElementTagNameMap {
818
+ 'test-view': TestView;
819
+ }
820
+ }
821
+
822
+ declare class TestViewToggle extends LitElement {
823
+ myTemplate: any;
824
+ protected createRenderRoot(): HTMLElement | DocumentFragment;
825
+ private sessionContext;
826
+ connectedCallback(): void;
827
+ _switchView(view: string): void;
828
+ protected firstUpdated(_changedProperties: PropertyValues): void;
829
+ render(): lit.TemplateResult<1>;
830
+ }
831
+ declare global {
832
+ interface HTMLElementTagNameMap {
833
+ 'test-view-toggle': TestViewToggle;
750
834
  }
751
835
  }
752
836
 
@@ -769,9 +853,6 @@ interface TtsContext {
769
853
  togglePick(): void;
770
854
  }
771
855
 
772
- declare const ttsContext: {
773
- __context__: TtsContext;
774
- };
775
856
  /**
776
857
  * Base class shared by all TTS control elements. Consumes `ttsContext` and
777
858
  * mirrors the current speech state onto CSS custom states so each child can
@@ -840,10 +921,9 @@ declare abstract class TtsButtonBase extends LitElement {
840
921
  * 3. **Inside a `qti-assessment-item-ref`** — e.g. in a `<template item-ref>` on `<qti-test>`,
841
922
  * so every item gets a player of its own: the player reads that item, and only that item.
842
923
  * The navigation cursor is ignored; speech stops when the player leaves the page with its item.
843
- * 4. **Anywhere else** — a toolbar in the page chrome: the player follows the navigation cursor
844
- * and reads the item `navItemRefId` (session context) points at, found in any
845
- * `test-container` reachable from the player. Navigating stops speech and starts the next
846
- * item from the top.
924
+ * 4. **Anywhere else inside `<test-navigation>`** — e.g. a toolbar: the player follows the
925
+ * navigation cursor and reads the active item of the computed context. Navigating stops
926
+ * speech and starts the next item from the top.
847
927
  *
848
928
  * ```html
849
929
  * <!-- 1. a player for the shared reading text -->
@@ -899,9 +979,11 @@ declare class TestItemToSpeech extends LitElement {
899
979
  static styles: lit.CSSResult;
900
980
  /** Fallback language when neither the item content nor the document declares one. */
901
981
  language: string;
902
- protected _sessionContext?: SessionContext;
903
- /** The `qti-test` this player is in, across shadow roots. */
904
- protected testHost?: TestHost;
982
+ /**
983
+ * The test as `test-navigation` computes it: which item is active, and where it is rendered
984
+ * (`itemElement`). Updated on navigation and whenever an item is rendered.
985
+ */
986
+ protected _computedContext?: ComputedContext;
905
987
  _ttsContext: TtsContext;
906
988
  constructor();
907
989
  willUpdate(changed: PropertyValues): void;
@@ -1006,6 +1088,8 @@ declare const QtiTest_base: (abstract new (...args: any[]) => ITestNavigationMix
1006
1088
  getOutcome(identifier: string): Readonly<OutcomeVariable>;
1007
1089
  getVariable(identifier: string): Readonly<VariableDeclaration<string | string[] | null>>;
1008
1090
  outcomeProcessing(): boolean;
1091
+ submit(): boolean;
1092
+ getTestFeedback(access?: "atEnd" | "during"): QtiTestFeedback[];
1009
1093
  }) & (abstract new (...args: any[]) => ITestStateMixin) & (abstract new (...args: any[]) => TestBaseInterface) & typeof LitElement;
1010
1094
  /**
1011
1095
  * `<qti-test>` is a custom element designed for rendering and interacting with QTI (Question and Test Interoperability) tests.
@@ -1084,4 +1168,4 @@ declare global {
1084
1168
  }
1085
1169
  }
1086
1170
 
1087
- export { TestScoringFeedback as A, TestSectionButtonsStamp as B, TestSectionLink as C, TestStamp as D, TestTtsNext as E, TestTtsPause as F, TestTtsPick as G, TestTtsPlay as H, type ITestNavigationMixin as I, TestTtsPrev as J, TestTtsResume as K, TestTtsStop as L, TestView as M, TestViewToggle as N, type TtsContext as O, ttsContext as P, QtiAssessmentItemRef as Q, type ItemVariableValue as R, type SpeechState as S, TestCheckItem as T, type ITestStateMixin as a, type ItemRefTemplateModel as b, QtiAssessmentSection as c, QtiAssessmentTest as d, QtiBranchRule as e, QtiItemSessionControl as f, QtiNumberSelected as g, QtiOutcomeProcessing as h, QtiOutcomeProcessingProcessor as i, QtiPreCondition as j, QtiTest as k, QtiTestFeedback as l, QtiTestPart as m, QtiTestVariables as n, QtiTestVariablesExpression as o, TestContainer as p, TestEndAttempt as q, TestItemLink as r, TestItemToSpeech as s, TestNavigation as t, TestNext as u, TestPagingButtonsStamp as v, TestPrev as w, TestPrintContext as x, TestPrintVariables as y, TestScoringButtons as z };
1171
+ export { TestScoringButtons as A, TestScoringFeedback as B, TestSectionLink as C, TestStamp as D, TestSubmit as E, TestTtsNext as F, TestTtsPause as G, TestTtsPick as H, type ITestNavigationMixin as I, TestTtsPlay as J, TestTtsPrev as K, TestTtsResume as L, TestTtsStop as M, TestView as N, TestViewToggle as O, bookmarkedItems as P, QtiAssessmentItemRef as Q, type QtiTestPluginState as R, type ItemVariableValue as S, TestBookmark 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, 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, TestPrintVariables as z };
@@ -1,9 +1,9 @@
1
1
  import * as lit from 'lit';
2
2
  import { LitElement, CSSResultGroup, PropertyValues } from 'lit';
3
- import { I as Interaction } from './interaction.d-g6XG0T0Z.js';
3
+ import { I as Interaction, b as RecordValue } from './record.d-wB9uYs-j.js';
4
4
  import { V as ValidatableInteraction } from './interaction.interface.d-CvjHM2bi.js';
5
5
  import { C as ConfigContext } from './config.context.d-BvU9r-Mg.js';
6
- import { B as BaseType, a as Cardinality, b as ItemContext, Q as QtiAreaMapEntry } from './item.types.d-B55QkJ92.js';
6
+ import { B as BaseType, a as Cardinality, b as ItemContext, Q as QtiAreaMapEntry } from './item.types.d-DuVR0ZVK.js';
7
7
  import { Q as QtiContext } from './qti.context.d-CejJMlfZ.js';
8
8
  import * as lit_directives_ref_js from 'lit/directives/ref.js';
9
9
 
@@ -208,7 +208,6 @@ declare const QtiSimpleChoice_base: (abstract new (...args: any[]) => ActiveElem
208
208
  */
209
209
  declare class QtiSimpleChoice extends QtiSimpleChoice_base {
210
210
  static styles: CSSResultGroup;
211
- static shadowRootOptions: ShadowRootInit;
212
211
  templateIdentifier: string | null;
213
212
  showHide: string | null;
214
213
  fixed: boolean;
@@ -754,6 +753,20 @@ declare const QtiGraphicGapMatchInteraction_base: (abstract new (...args: any[])
754
753
  declare class QtiGraphicGapMatchInteraction extends QtiGraphicGapMatchInteraction_base {
755
754
  #private;
756
755
  static styles: CSSResultGroup;
756
+ /**
757
+ * A hotspot's box is its authored `coords`, always (CONFIGURABILITY.md §4). The measured
758
+ * `--qti-dropzone-min-*` reservation is a floor on the hotspot's `min-width`/`min-height`, and it
759
+ * beat the percentage box from `positionShapes` as soon as the graphic rendered narrower than its
760
+ * declared width: a 275px chip kept a 17% hotspot at 275px over a 482px map. Chips are sized to
761
+ * their hotspots through `--qti-graphic-scale` instead.
762
+ */
763
+ autoSizeDropzones: boolean;
764
+ /**
765
+ * Rendered width of the graphic over its declared width: the factor the drop areas are scaled by.
766
+ * Published as `--qti-graphic-scale` on both slots, so it reaches a chip in the bank and one placed
767
+ * in a hotspot (qti-gap-img.styles.ts), without writing to the light-DOM host.
768
+ */
769
+ private _graphicScale;
757
770
  render(): lit.TemplateResult<1>;
758
771
  shouldReturnToInventoryOnInventoryDrop(): boolean;
759
772
  connectedCallback(): void;
@@ -1111,10 +1124,11 @@ type PciInteractionStatus = 'interacting' | 'suspended' | 'closed' | 'solution'
1111
1124
  * Correct response of a response declaration, mirroring `qti-correct-response`.
1112
1125
  *
1113
1126
  * `value` holds the authored `qti-value` content: a single value for `single`
1114
- * cardinality, an array of values for every other cardinality.
1127
+ * cardinality, a field map (`{ time: '4.0', point: '460 245' }`) for `record`
1128
+ * cardinality, and an array of values for every other cardinality.
1115
1129
  */
1116
1130
  interface PciCorrectResponse {
1117
- value: string | string[];
1131
+ value: string | string[] | Record<string, string | string[] | null>;
1118
1132
  }
1119
1133
  /**
1120
1134
  * Response declaration passed into the `getInstance` configuration so a PCI can
@@ -1207,6 +1221,12 @@ declare type QtiVariableJSON = {
1207
1221
  record?: QtiRecordItem[] | null;
1208
1222
  };
1209
1223
 
1224
+ /** Text for an inline `<script>`: a `</script` inside it would end the element early. */
1225
+ declare const inlineScriptText: (text: string) => string;
1226
+ /** Text for an inline `<style>`: a `</style` inside it would end the element early. */
1227
+ declare const inlineStyleText: (text: string) => string;
1228
+ /** A response value as this interaction holds it: a record response is its field map. */
1229
+ type PciResponseValue = string | string[] | RecordValue;
1210
1230
  declare class QtiPortableCustomInteraction extends Interaction {
1211
1231
  #private;
1212
1232
  protected _iframeLoaded: boolean;
@@ -1222,6 +1242,7 @@ declare class QtiPortableCustomInteraction extends Interaction {
1222
1242
  customInteractionTypeIdentifier: string;
1223
1243
  requirePathsJson: string;
1224
1244
  requireShimJson: string;
1245
+ /** A RequireJS to load in the iframe instead of the inlined copy (src/vendor/require-js.ts). */
1225
1246
  requireJsUrl: string;
1226
1247
  baseUrl: string;
1227
1248
  useDefaultPaths: boolean;
@@ -1249,10 +1270,6 @@ declare class QtiPortableCustomInteraction extends Interaction {
1249
1270
  * Get direct child elements by tag name
1250
1271
  */
1251
1272
  private getDirectChildrenByTag;
1252
- /**
1253
- * Coerce a scalar value to the expected base-type when possible
1254
- */
1255
- private coerceBaseValue;
1256
1273
  /**
1257
1274
  * Normalize an input into a list form
1258
1275
  */
@@ -1261,14 +1278,6 @@ declare class QtiPortableCustomInteraction extends Interaction {
1261
1278
  * Convert a variable value to QtiVariableJSON
1262
1279
  */
1263
1280
  private variableToQtiVariableJSON;
1264
- /**
1265
- * Convert a record object into QtiVariableJSON
1266
- */
1267
- private recordToQtiVariableJSON;
1268
- /**
1269
- * Build a record entry from an arbitrary value
1270
- */
1271
- private recordEntryFromValue;
1272
1281
  /**
1273
1282
  * Extract default QTI_CONTEXT values from qti-context-declaration elements
1274
1283
  */
@@ -1288,7 +1297,7 @@ declare class QtiPortableCustomInteraction extends Interaction {
1288
1297
  /**
1289
1298
  * Converts response variables to QtiVariableJSON
1290
1299
  */
1291
- protected responseVariablesToQtiVariableJSON(input: string | string[], cardinality: Cardinality, baseType: BaseType): QtiVariableJSON;
1300
+ protected responseVariablesToQtiVariableJSON(input: PciResponseValue, cardinality: Cardinality, baseType: BaseType, fieldBaseTypes?: Record<string, BaseType>): QtiVariableJSON;
1292
1301
  validate(): boolean;
1293
1302
  set value(v: string | null);
1294
1303
  get value(): string | null;
@@ -1574,4 +1583,4 @@ declare global {
1574
1583
  }
1575
1584
  }
1576
1585
 
1577
- export { type Choice as C, type Orientation as O, QtiAssociableHotspot as Q, QtiAssociateInteraction as a, QtiChoiceInteraction as b, QtiExtendedTextInteraction as c, QtiGap as d, QtiGapImg as e, QtiGapMatchInteraction as f, QtiGapText as g, QtiGraphicAssociateInteraction as h, QtiGraphicGapMatchInteraction as i, QtiGraphicOrderInteraction as j, QtiHotspotChoice as k, QtiHotspotInteraction as l, QtiHottext as m, QtiHottextInteraction as n, QtiInlineChoice as o, QtiInlineChoiceInteraction as p, QtiMatchInteraction as q, QtiOrderInteraction as r, QtiPortableCustomInteraction as s, QtiPrompt as t, QtiSelectPointInteraction as u, QtiSimpleAssociableChoice as v, QtiSimpleChoice as w, QtiSliderInteraction as x, QtiTextEntryInteraction as y, QtiPortableCustomInteractionTest as z };
1586
+ export { inlineStyleText as A, QtiPortableCustomInteractionTest as B, type Choice as C, type Orientation as O, QtiAssociableHotspot as Q, QtiAssociateInteraction as a, QtiChoiceInteraction as b, QtiExtendedTextInteraction as c, QtiGap as d, QtiGapImg as e, QtiGapMatchInteraction as f, QtiGapText as g, QtiGraphicAssociateInteraction as h, QtiGraphicGapMatchInteraction as i, QtiGraphicOrderInteraction as j, QtiHotspotChoice as k, QtiHotspotInteraction as l, QtiHottext as m, QtiHottextInteraction as n, QtiInlineChoice as o, QtiInlineChoiceInteraction as p, QtiMatchInteraction as q, QtiOrderInteraction as r, QtiPortableCustomInteraction as s, QtiPrompt as t, QtiSelectPointInteraction as u, QtiSimpleAssociableChoice as v, QtiSimpleChoice as w, QtiSliderInteraction as x, QtiTextEntryInteraction as y, inlineScriptText as z };
@@ -1,7 +1,7 @@
1
1
  import { LitElement, PropertyValues } from 'lit';
2
2
  import { C as ConfigContext, V as ValidationDisplayMode } from './config.context.d-BvU9r-Mg.js';
3
3
  import { V as ValidatableInteraction } from './interaction.interface.d-CvjHM2bi.js';
4
- import { g as ResponseVariable } from './item.types.d-B55QkJ92.js';
4
+ import { g as ResponseVariable, B as BaseType } from './item.types.d-DuVR0ZVK.js';
5
5
 
6
6
  /**
7
7
  * What a choice element should render and behave as. The same element — `qti-simple-choice`,
@@ -123,4 +123,36 @@ declare abstract class Interaction extends LitElement implements ValidatableInte
123
123
  protected firstUpdated(_changedProperties?: PropertyValues): void;
124
124
  }
125
125
 
126
- export { type ChoiceRole as C, Interaction as I, type InteractionContext as a, interactionContext as i };
126
+ /**
127
+ * The value of a variable with `record` cardinality: its fields by field identifier.
128
+ *
129
+ * Field values are kept the way every other response value is kept, as QTI string literals — a
130
+ * float is `"4.12"`, a point is `"455 250"` — with a list-valued field as an array of them.
131
+ */
132
+ type RecordValue = Record<string, string | string[] | null>;
133
+ /** A record's field values with the base type each `qti-value` declared for its field. */
134
+ interface RecordFieldValues {
135
+ value: RecordValue;
136
+ baseTypes: Record<string, BaseType>;
137
+ }
138
+ /** Whether a variable value is a record: a plain object, not a list and not NULL. */
139
+ declare const isRecordValue: (value: unknown) => value is RecordValue;
140
+ /**
141
+ * Reads the field values of a record out of `qti-value field-identifier="…" base-type="…"`
142
+ * elements, as found in a `qti-correct-response` or `qti-default-value` of a record declaration.
143
+ *
144
+ * A value without a `field-identifier` is not a record field and is skipped. A field without a
145
+ * `base-type` gets no entry in `baseTypes`, so a reader can tell "declared string" from "unknown".
146
+ */
147
+ declare const readRecordFieldValues: (valueElements: Iterable<Element>) => RecordFieldValues;
148
+ /**
149
+ * A best guess at a record field's base type, for when the declaration does not say.
150
+ *
151
+ * A record field value carries no type of its own once it is stored, and a record response
152
+ * declaration has no `base-type`, so this is the fallback. A number is a float (or an integer
153
+ * when given as a whole JS number), two numbers separated by whitespace are a point, and
154
+ * anything else is a string.
155
+ */
156
+ declare const inferRecordFieldBaseType: (value: unknown) => BaseType;
157
+
158
+ export { type ChoiceRole as C, Interaction as I, type RecordFieldValues as R, type InteractionContext as a, type RecordValue as b, interactionContext as c, isRecordValue as d, inferRecordFieldBaseType as i, readRecordFieldValues as r };
@@ -1,4 +1,4 @@
1
- import { V as VariableDeclaration } from './item.types.d-B55QkJ92.js';
1
+ import { V as VariableDeclaration } from './item.types.d-DuVR0ZVK.js';
2
2
 
3
3
  type ComputedItemContext = {
4
4
  identifier: string;
@@ -26,6 +26,12 @@ interface SessionContext {
26
26
  /** @deprecated Never set by the library. Removed in the next major. */
27
27
  navTestLoading?: boolean;
28
28
  view?: View;
29
+ /**
30
+ * What test plugins keep, by plugin name: JSON the test stores and restores without reading it.
31
+ * Part of the persisted state (`QtiTestState.session.plugins`); written through the
32
+ * `cito-test-update-plugin-state` request.
33
+ */
34
+ plugins?: Readonly<Record<string, unknown>>;
29
35
  }
30
36
  declare const INITIAL_SESSION_CONTEXT: Readonly<SessionContext>;
31
37
  declare const sessionContext: {