@citolab/qti-components 10.0.0-next.0 → 10.0.0-next.10

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 (64) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +1975 -361
  3. package/dist/base.d.ts +10 -10
  4. package/dist/base.js +7 -1
  5. package/dist/{chunk-F7R7GSWL.js → chunk-3TUGZHKB.js} +3 -3
  6. package/dist/{chunk-CNFVA3AA.js → chunk-AHULN3UB.js} +390 -243
  7. package/dist/chunk-AHULN3UB.js.map +1 -0
  8. package/dist/{chunk-GPNWMLLA.js → chunk-CQ3WU35R.js} +2 -2
  9. package/dist/{chunk-3BAQWO5C.js → chunk-LCGPLQLE.js} +40 -4
  10. package/dist/chunk-LCGPLQLE.js.map +1 -0
  11. package/dist/{chunk-ACRN7YJM.js → chunk-M7X6TWSX.js} +2 -2
  12. package/dist/{chunk-WNAOVXXN.js → chunk-Q3C7XFVS.js} +2 -2
  13. package/dist/chunk-QVZLJY75.js +7 -0
  14. package/dist/chunk-QVZLJY75.js.map +1 -0
  15. package/dist/{chunk-EUKU5QKV.js → chunk-RRMCWCSA.js} +2520 -2071
  16. package/dist/chunk-RRMCWCSA.js.map +1 -0
  17. package/dist/{chunk-SVYHZIJ7.js → chunk-RWMY7KRT.js} +2 -2
  18. package/dist/{chunk-R7MMMDP7.js → chunk-T7YSBBAA.js} +56 -2
  19. package/dist/chunk-T7YSBBAA.js.map +1 -0
  20. package/dist/{chunk-QD3Y6UK3.js → chunk-WPILS3CW.js} +2 -2
  21. package/dist/{chunk-AWTQKBC4.js → chunk-YOCOLMGB.js} +40 -5
  22. package/dist/{chunk-AWTQKBC4.js.map → chunk-YOCOLMGB.js.map} +1 -1
  23. package/dist/{chunk-EPSUZIWL.js → chunk-YYZCTIZY.js} +6 -6
  24. package/dist/{computed.types.d-gJrBeUMG.d.ts → computed.types.d-IXACuBr7.d.ts} +10 -1
  25. package/dist/corrections.d.ts +9 -9
  26. package/dist/corrections.js +8 -8
  27. package/dist/elements.d.ts +2 -2
  28. package/dist/elements.js +3 -3
  29. package/dist/index.d.ts +11 -11
  30. package/dist/index.js +41 -19
  31. package/dist/interactions.d.ts +4 -4
  32. package/dist/interactions.js +7 -3
  33. package/dist/item.css +2 -1
  34. package/dist/item.d.ts +4 -4
  35. package/dist/item.js +4 -4
  36. package/dist/{item.types.d-B55QkJ92.d.ts → item.types.d-DuVR0ZVK.d.ts} +7 -1
  37. package/dist/loader.d.ts +2 -2
  38. package/dist/processing.d.ts +10 -3
  39. package/dist/processing.js +3 -3
  40. package/dist/qti-components-jsx.d.ts +1065 -774
  41. package/dist/{qti-condition-expression.d-L7yb3Rzy.d.ts → qti-condition-expression.d-B-T1NNl0.d.ts} +1 -1
  42. package/dist/{qti-expression.d-CuaLjZ6g.d.ts → qti-expression.d-B-Cfbqlb.d.ts} +8 -1
  43. package/dist/{qti-feedback.d-wMYNVkkj.d.ts → qti-feedback.d-DbzPSJuK.d.ts} +1 -1
  44. package/dist/{qti-item.d-DgC1AQbY.d.ts → qti-item.d-B1gffYCL.d.ts} +1 -1
  45. package/dist/{qti-test.d-_THYXPzd.d.ts → qti-test.d-D-RYWphm.d.ts} +242 -99
  46. package/dist/{qti-text-entry-interaction.d-q8u5BiVK.d.ts → qti-text-entry-interaction.d-utFyp1DH.d.ts} +28 -18
  47. package/dist/{interaction.d-g6XG0T0Z.d.ts → record.d-wB9uYs-j.d.ts} +34 -2
  48. package/dist/{session.context.d-D5080LVx.d.ts → session.context.d-DW09Lrie.d.ts} +7 -1
  49. package/dist/test.d.ts +117 -9
  50. package/dist/test.js +23 -11
  51. package/package.json +9 -9
  52. package/dist/chunk-3BAQWO5C.js.map +0 -1
  53. package/dist/chunk-CNFVA3AA.js.map +0 -1
  54. package/dist/chunk-EUKU5QKV.js.map +0 -1
  55. package/dist/chunk-R7MMMDP7.js.map +0 -1
  56. package/dist/chunk-ZP6QQYSU.js +0 -7
  57. package/dist/chunk-ZP6QQYSU.js.map +0 -1
  58. /package/dist/{chunk-F7R7GSWL.js.map → chunk-3TUGZHKB.js.map} +0 -0
  59. /package/dist/{chunk-GPNWMLLA.js.map → chunk-CQ3WU35R.js.map} +0 -0
  60. /package/dist/{chunk-ACRN7YJM.js.map → chunk-M7X6TWSX.js.map} +0 -0
  61. /package/dist/{chunk-WNAOVXXN.js.map → chunk-Q3C7XFVS.js.map} +0 -0
  62. /package/dist/{chunk-SVYHZIJ7.js.map → chunk-RWMY7KRT.js.map} +0 -0
  63. /package/dist/{chunk-QD3Y6UK3.js.map → chunk-WPILS3CW.js.map} +0 -0
  64. /package/dist/{chunk-EPSUZIWL.js.map → chunk-YYZCTIZY.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- import { Q as QtiExpression } from './qti-expression.d-CuaLjZ6g.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 {
@@ -58,6 +58,13 @@ declare abstract class QtiExpression<T> extends LitElement implements QtiExpress
58
58
  * throwing, so callers degrade gracefully.
59
59
  */
60
60
  protected resolveVariable(identifier: string): VariableDeclaration<string | string[] | null> | null;
61
+ /**
62
+ * `ITEMREF.VAR`: a variable of an individual item session, looked up by prefixing the variable
63
+ * with the identifier the item ref gave the item (QTI 3 `qti-variable`), e.g. `Q01.SCORE`. An
64
+ * item that was never presented has no variables, which resolves to NULL. Instances of a cloned
65
+ * item (`Q01.2.SCORE`) are not supported: the item itself is used.
66
+ */
67
+ private resolveItemVariable;
61
68
  getVariables: () => ExpressionVariable[];
62
69
  }
63
70
 
@@ -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-CuaLjZ6g.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
 
@@ -128,6 +128,41 @@ declare global {
128
128
  }
129
129
  }
130
130
 
131
+ /** An element that evaluates to a boolean: a `qti-pre-condition` or `qti-branch-rule`. */
132
+ interface Condition extends Element {
133
+ evaluate(): boolean;
134
+ }
135
+
136
+ /**
137
+ * @summary The qti-branch-rule element jumps the test forward to `target` when its expression is true.
138
+ * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.branch-rule
139
+ *
140
+ * A child of `qti-test-part`, `qti-assessment-section` or `qti-assessment-item-ref`. It is
141
+ * evaluated after the parent has been presented; the first rule whose expression is true wins.
142
+ * Branch rules only apply in linear navigation mode. An expression that cannot be evaluated does
143
+ * not branch.
144
+ *
145
+ * @attr {string} target - Required. The identifier of an item ref, section or test part ahead of
146
+ * the parent, or one of the reserved targets `EXIT_SECTION`, `EXIT_TESTPART`, `EXIT_TEST`.
147
+ *
148
+ * @slot - The boolean expression.
149
+ */
150
+ declare class QtiBranchRule extends LitElement implements Condition {
151
+ static readonly EXIT_SECTION = "EXIT_SECTION";
152
+ static readonly EXIT_TESTPART = "EXIT_TESTPART";
153
+ static readonly EXIT_TEST = "EXIT_TEST";
154
+ static styles: lit.CSSResult;
155
+ target: string;
156
+ /** `true` when the test should jump to `target`. */
157
+ evaluate(): boolean;
158
+ render(): lit.TemplateResult<1>;
159
+ }
160
+ declare global {
161
+ interface HTMLElementTagNameMap {
162
+ 'qti-branch-rule': QtiBranchRule;
163
+ }
164
+ }
165
+
131
166
  /**
132
167
  * @summary The qti-item-session-control element contains configurations relating to flow of test sessions.
133
168
  * @documentation https://www.imsglobal.org/sites/default/files/spec/qti/v3/info/imsqti_asi_v3p0p1_infomodel_v1p0.html#Derived_ItemSessionControl
@@ -149,6 +184,33 @@ declare global {
149
184
  }
150
185
  }
151
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
+
152
214
  /**
153
215
  * @summary The qti-number-selected expression counts the item refs selected for the test.
154
216
  * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.number-selected
@@ -173,6 +235,31 @@ declare global {
173
235
  }
174
236
  }
175
237
 
238
+ /**
239
+ * @summary The qti-pre-condition element holds one boolean expression that decides whether its parent is presented.
240
+ * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.pre-condition
241
+ *
242
+ * A child of `qti-test-part`, `qti-assessment-section` or `qti-assessment-item-ref`. When the test
243
+ * is about to present the parent and the expression is false (or NULL), the parent is skipped.
244
+ * Pre-conditions only apply in linear navigation mode; in nonlinear mode they are ignored.
245
+ *
246
+ * Evaluation is pull-based, like every expression: the test calls `evaluate()` when it needs the
247
+ * answer. An expression that cannot be evaluated fails open, so the parent is shown.
248
+ *
249
+ * @slot - The boolean expression.
250
+ */
251
+ declare class QtiPreCondition extends LitElement implements Condition {
252
+ static styles: lit.CSSResult;
253
+ /** `true` when the parent may be presented. */
254
+ evaluate(): boolean;
255
+ render(): lit.TemplateResult<1>;
256
+ }
257
+ declare global {
258
+ interface HTMLElementTagNameMap {
259
+ 'qti-pre-condition': QtiPreCondition;
260
+ }
261
+ }
262
+
176
263
  declare class QtiOutcomeProcessing extends LitElement {
177
264
  static styles: lit.CSSResult[];
178
265
  render(): lit.TemplateResult<1>;
@@ -187,8 +274,19 @@ declare class QtiOutcomeProcessingProcessor {
187
274
  process(rules: QtiRuleBase[]): void;
188
275
  }
189
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
+ */
190
281
  declare class QtiTestFeedback extends QtiModalFeedback {
191
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;
192
290
  render(): lit.TemplateResult<1>;
193
291
  }
194
292
  declare global {
@@ -319,8 +417,19 @@ interface QtiTestStateValue {
319
417
  identifier: string;
320
418
  value: string | string[] | null;
321
419
  }
322
- /** 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. */
323
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>;
324
433
  navPartId?: string | null;
325
434
  navSectionId?: string | null;
326
435
  navItemRefId?: string | null;
@@ -451,26 +560,6 @@ declare global {
451
560
  }
452
561
  }
453
562
 
454
- declare class TestView extends LitElement {
455
- #private;
456
- static DEFAULT_VIEW_OPTIONS: string[];
457
- private sessionContext;
458
- /** label accompanying the select view dropdown */
459
- label: string;
460
- /** The options to display in the dropdown, default: ['author', 'candidate', 'proctor', 'scorer', 'testConstructor', 'tutor'] */
461
- viewOptions: string;
462
- protected _handleViewOptionsChange: () => void;
463
- connectedCallback(): void;
464
- private _viewOptions;
465
- protected _switchView(view: string): void;
466
- render(): lit.TemplateResult<1>;
467
- }
468
- declare global {
469
- interface HTMLElementTagNameMap {
470
- 'test-view': TestView;
471
- }
472
- }
473
-
474
563
  declare class TestItemLink extends LitElement {
475
564
  static styles: lit.CSSResult;
476
565
  private itemId;
@@ -500,24 +589,6 @@ declare global {
500
589
  }
501
590
  }
502
591
 
503
- /**
504
- * @deprecated test-paging-buttons-stamp is deprecated and will be removed in the future.
505
- */
506
- declare class TestPagingButtonsStamp extends LitElement {
507
- #private;
508
- private computedContext;
509
- myTemplate: TemplateFunction;
510
- protected createRenderRoot(): HTMLElement | DocumentFragment;
511
- constructor();
512
- connectedCallback(): void;
513
- render(): lit.TemplateResult<1>;
514
- }
515
- declare global {
516
- interface HTMLElementTagNameMap {
517
- 'test-paging-buttons-stamp': TestPagingButtonsStamp;
518
- }
519
- }
520
-
521
592
  /**
522
593
  * `<test-container>` is a custom element designed for hosting the qti-assessment-item.
523
594
  * The `qti-assessment-test` will be placed inside the shadow DOM of this element.
@@ -557,45 +628,82 @@ declare global {
557
628
  }
558
629
  }
559
630
 
560
- declare class TestPrintVariables extends LitElement {
561
- computedContext?: ComputedContext;
631
+ declare class TestSectionLink extends LitElement {
632
+ #private;
562
633
  static styles: lit.CSSResult;
634
+ private sectionId;
635
+ constructor();
563
636
  render(): lit.TemplateResult<1>;
564
637
  }
565
638
  declare global {
566
639
  interface HTMLElementTagNameMap {
567
- 'test-print-item-variables': TestPrintVariables;
640
+ 'test-section-link': TestSectionLink;
568
641
  }
569
642
  }
570
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[];
571
652
  /**
572
- * @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.
573
671
  */
574
- declare class TestSectionButtonsStamp extends LitElement {
672
+ declare class TestBookmark extends LitElement {
575
673
  #private;
576
- private computedContext;
577
- myTemplate: TemplateFunction;
578
- protected createRenderRoot(): HTMLElement | DocumentFragment;
674
+ protected computedContext?: ComputedContext;
675
+ item?: string;
676
+ bookmarked: boolean;
677
+ disabled: boolean;
678
+ static styles: lit.CSSResult;
579
679
  constructor();
580
680
  connectedCallback(): void;
681
+ protected willUpdate(): void;
682
+ protected updated(): void;
581
683
  render(): lit.TemplateResult<1>;
582
684
  }
583
685
  declare global {
584
686
  interface HTMLElementTagNameMap {
585
- 'test-section-buttons-stamp': TestSectionButtonsStamp;
687
+ 'test-bookmark': TestBookmark;
586
688
  }
587
689
  }
588
690
 
589
- declare class TestSectionLink extends LitElement {
590
- #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;
591
700
  static styles: lit.CSSResult;
592
- private sectionId;
593
701
  constructor();
594
702
  render(): lit.TemplateResult<1>;
595
703
  }
596
704
  declare global {
597
705
  interface HTMLElementTagNameMap {
598
- 'test-section-link': TestSectionLink;
706
+ 'test-check-item': TestCheckItem;
599
707
  }
600
708
  }
601
709
 
@@ -609,6 +717,45 @@ declare global {
609
717
  }
610
718
  }
611
719
 
720
+ declare class TestPrintVariables extends LitElement {
721
+ computedContext?: ComputedContext;
722
+ static styles: lit.CSSResult;
723
+ render(): lit.TemplateResult<1>;
724
+ }
725
+ declare global {
726
+ interface HTMLElementTagNameMap {
727
+ 'test-print-item-variables': TestPrintVariables;
728
+ }
729
+ }
730
+
731
+ declare class TestScoringButtons extends LitElement {
732
+ #private;
733
+ view: string;
734
+ disabled: boolean;
735
+ myTemplate: TemplateFunction | null;
736
+ protected createRenderRoot(): HTMLElement | DocumentFragment;
737
+ connectedCallback(): void;
738
+ protected computedContext?: ComputedContext;
739
+ render(): lit.TemplateResult<1> | typeof nothing;
740
+ constructor();
741
+ }
742
+ declare global {
743
+ interface HTMLElementTagNameMap {
744
+ 'test-scoring-buttons': TestScoringButtons;
745
+ }
746
+ }
747
+
748
+ declare class TestScoringFeedback extends LitElement {
749
+ protected computedContext?: ComputedContext;
750
+ view: View;
751
+ render(): lit.TemplateResult<1>;
752
+ }
753
+ declare global {
754
+ interface HTMLElementTagNameMap {
755
+ 'test-scoring-feedback': TestScoringFeedback;
756
+ }
757
+ }
758
+
612
759
  /**
613
760
  * A custom web component that renders a test stamp using the Lit framework.
614
761
  * This component is deprecated and will be removed in the future.
@@ -635,58 +782,54 @@ declare global {
635
782
  }
636
783
  }
637
784
 
638
- declare class TestScoringButtons extends LitElement {
639
- #private;
640
- view: string;
641
- disabled: boolean;
642
- myTemplate: TemplateFunction | null;
643
- protected createRenderRoot(): HTMLElement | DocumentFragment;
644
- connectedCallback(): void;
645
- protected computedContext?: ComputedContext;
646
- render(): lit.TemplateResult<1> | typeof nothing;
785
+ /**
786
+ * Scores the test: on click the test resets its outcomes to their declared defaults, runs its
787
+ * outcome processing and dispatches `cito-test-submitted`, after which the host reads the outcomes.
788
+ * The host decides where it sits, for example on the last item or in a review view.
789
+ */
790
+ declare class TestSubmit extends LitElement {
791
+ static styles: lit.CSSResult;
647
792
  constructor();
793
+ render(): lit.TemplateResult<1>;
648
794
  }
649
795
  declare global {
650
796
  interface HTMLElementTagNameMap {
651
- 'test-scoring-buttons': TestScoringButtons;
797
+ 'test-submit': TestSubmit;
652
798
  }
653
799
  }
654
800
 
655
- declare class TestViewToggle extends LitElement {
656
- myTemplate: any;
657
- protected createRenderRoot(): HTMLElement | DocumentFragment;
801
+ declare class TestView extends LitElement {
802
+ #private;
803
+ static DEFAULT_VIEW_OPTIONS: string[];
658
804
  private sessionContext;
805
+ /** label accompanying the select view dropdown */
806
+ label: string;
807
+ /** The options to display in the dropdown, default: ['author', 'candidate', 'proctor', 'scorer', 'testConstructor', 'tutor'] */
808
+ viewOptions: string;
809
+ protected _handleViewOptionsChange: () => void;
659
810
  connectedCallback(): void;
660
- _switchView(view: string): void;
661
- protected firstUpdated(_changedProperties: PropertyValues): void;
662
- render(): lit.TemplateResult<1>;
663
- }
664
- declare global {
665
- interface HTMLElementTagNameMap {
666
- 'test-view-toggle': TestViewToggle;
667
- }
668
- }
669
-
670
- declare class TestScoringFeedback extends LitElement {
671
- protected computedContext?: ComputedContext;
672
- view: View;
811
+ private _viewOptions;
812
+ protected _switchView(view: string): void;
673
813
  render(): lit.TemplateResult<1>;
674
814
  }
675
815
  declare global {
676
816
  interface HTMLElementTagNameMap {
677
- 'test-scoring-feedback': TestScoringFeedback;
817
+ 'test-view': TestView;
678
818
  }
679
819
  }
680
820
 
681
- declare class TestCheckItem extends LitElement {
682
- protected testHost?: TestHost;
683
- static styles: lit.CSSResult;
684
- constructor();
821
+ declare class TestViewToggle extends LitElement {
822
+ myTemplate: any;
823
+ protected createRenderRoot(): HTMLElement | DocumentFragment;
824
+ private sessionContext;
825
+ connectedCallback(): void;
826
+ _switchView(view: string): void;
827
+ protected firstUpdated(_changedProperties: PropertyValues): void;
685
828
  render(): lit.TemplateResult<1>;
686
829
  }
687
830
  declare global {
688
831
  interface HTMLElementTagNameMap {
689
- 'test-check-item': TestCheckItem;
832
+ 'test-view-toggle': TestViewToggle;
690
833
  }
691
834
  }
692
835
 
@@ -709,9 +852,6 @@ interface TtsContext {
709
852
  togglePick(): void;
710
853
  }
711
854
 
712
- declare const ttsContext: {
713
- __context__: TtsContext;
714
- };
715
855
  /**
716
856
  * Base class shared by all TTS control elements. Consumes `ttsContext` and
717
857
  * mirrors the current speech state onto CSS custom states so each child can
@@ -780,10 +920,9 @@ declare abstract class TtsButtonBase extends LitElement {
780
920
  * 3. **Inside a `qti-assessment-item-ref`** — e.g. in a `<template item-ref>` on `<qti-test>`,
781
921
  * so every item gets a player of its own: the player reads that item, and only that item.
782
922
  * The navigation cursor is ignored; speech stops when the player leaves the page with its item.
783
- * 4. **Anywhere else** — a toolbar in the page chrome: the player follows the navigation cursor
784
- * and reads the item `navItemRefId` (session context) points at, found in any
785
- * `test-container` reachable from the player. Navigating stops speech and starts the next
786
- * item from the top.
923
+ * 4. **Anywhere else inside `<test-navigation>`** — e.g. a toolbar: the player follows the
924
+ * navigation cursor and reads the active item of the computed context. Navigating stops
925
+ * speech and starts the next item from the top.
787
926
  *
788
927
  * ```html
789
928
  * <!-- 1. a player for the shared reading text -->
@@ -839,9 +978,11 @@ declare class TestItemToSpeech extends LitElement {
839
978
  static styles: lit.CSSResult;
840
979
  /** Fallback language when neither the item content nor the document declares one. */
841
980
  language: string;
842
- protected _sessionContext?: SessionContext;
843
- /** The `qti-test` this player is in, across shadow roots. */
844
- protected testHost?: TestHost;
981
+ /**
982
+ * The test as `test-navigation` computes it: which item is active, and where it is rendered
983
+ * (`itemElement`). Updated on navigation and whenever an item is rendered.
984
+ */
985
+ protected _computedContext?: ComputedContext;
845
986
  _ttsContext: TtsContext;
846
987
  constructor();
847
988
  willUpdate(changed: PropertyValues): void;
@@ -946,6 +1087,8 @@ declare const QtiTest_base: (abstract new (...args: any[]) => ITestNavigationMix
946
1087
  getOutcome(identifier: string): Readonly<OutcomeVariable>;
947
1088
  getVariable(identifier: string): Readonly<VariableDeclaration<string | string[] | null>>;
948
1089
  outcomeProcessing(): boolean;
1090
+ submit(): boolean;
1091
+ getTestFeedback(access?: "atEnd" | "during"): QtiTestFeedback[];
949
1092
  }) & (abstract new (...args: any[]) => ITestStateMixin) & (abstract new (...args: any[]) => TestBaseInterface) & typeof LitElement;
950
1093
  /**
951
1094
  * `<qti-test>` is a custom element designed for rendering and interacting with QTI (Question and Test Interoperability) tests.
@@ -1024,4 +1167,4 @@ declare global {
1024
1167
  }
1025
1168
  }
1026
1169
 
1027
- export { TestSectionLink as A, TestStamp as B, TestTtsNext as C, TestTtsPause as D, TestTtsPick as E, TestTtsPlay as F, TestTtsPrev as G, TestTtsResume as H, type ITestNavigationMixin as I, TestTtsStop as J, TestView as K, TestViewToggle as L, type TtsContext as M, ttsContext as N, type ItemVariableValue as O, QtiAssessmentItemRef as Q, type SpeechState as S, TestCheckItem as T, type ITestStateMixin as a, type ItemRefTemplateModel as b, QtiAssessmentSection as c, QtiAssessmentTest as d, QtiItemSessionControl as e, QtiNumberSelected as f, QtiOutcomeProcessing as g, QtiOutcomeProcessingProcessor as h, QtiTest as i, QtiTestFeedback as j, QtiTestPart as k, QtiTestVariables as l, QtiTestVariablesExpression as m, TestContainer as n, TestEndAttempt as o, TestItemLink as p, TestItemToSpeech as q, TestNavigation as r, TestNext as s, TestPagingButtonsStamp as t, TestPrev as u, TestPrintContext as v, TestPrintVariables as w, TestScoringButtons as x, TestScoringFeedback as y, TestSectionButtonsStamp as z };
1170
+ 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
 
@@ -754,6 +754,20 @@ declare const QtiGraphicGapMatchInteraction_base: (abstract new (...args: any[])
754
754
  declare class QtiGraphicGapMatchInteraction extends QtiGraphicGapMatchInteraction_base {
755
755
  #private;
756
756
  static styles: CSSResultGroup;
757
+ /**
758
+ * A hotspot's box is its authored `coords`, always (CONFIGURABILITY.md §4). The measured
759
+ * `--qti-dropzone-min-*` reservation is a floor on the hotspot's `min-width`/`min-height`, and it
760
+ * beat the percentage box from `positionShapes` as soon as the graphic rendered narrower than its
761
+ * declared width: a 275px chip kept a 17% hotspot at 275px over a 482px map. Chips are sized to
762
+ * their hotspots through `--qti-graphic-scale` instead.
763
+ */
764
+ autoSizeDropzones: boolean;
765
+ /**
766
+ * Rendered width of the graphic over its declared width: the factor the drop areas are scaled by.
767
+ * Published as `--qti-graphic-scale` on both slots, so it reaches a chip in the bank and one placed
768
+ * in a hotspot (qti-gap-img.styles.ts), without writing to the light-DOM host.
769
+ */
770
+ private _graphicScale;
757
771
  render(): lit.TemplateResult<1>;
758
772
  shouldReturnToInventoryOnInventoryDrop(): boolean;
759
773
  connectedCallback(): void;
@@ -1111,10 +1125,11 @@ type PciInteractionStatus = 'interacting' | 'suspended' | 'closed' | 'solution'
1111
1125
  * Correct response of a response declaration, mirroring `qti-correct-response`.
1112
1126
  *
1113
1127
  * `value` holds the authored `qti-value` content: a single value for `single`
1114
- * cardinality, an array of values for every other cardinality.
1128
+ * cardinality, a field map (`{ time: '4.0', point: '460 245' }`) for `record`
1129
+ * cardinality, and an array of values for every other cardinality.
1115
1130
  */
1116
1131
  interface PciCorrectResponse {
1117
- value: string | string[];
1132
+ value: string | string[] | Record<string, string | string[] | null>;
1118
1133
  }
1119
1134
  /**
1120
1135
  * Response declaration passed into the `getInstance` configuration so a PCI can
@@ -1207,6 +1222,12 @@ declare type QtiVariableJSON = {
1207
1222
  record?: QtiRecordItem[] | null;
1208
1223
  };
1209
1224
 
1225
+ /** Text for an inline `<script>`: a `</script` inside it would end the element early. */
1226
+ declare const inlineScriptText: (text: string) => string;
1227
+ /** Text for an inline `<style>`: a `</style` inside it would end the element early. */
1228
+ declare const inlineStyleText: (text: string) => string;
1229
+ /** A response value as this interaction holds it: a record response is its field map. */
1230
+ type PciResponseValue = string | string[] | RecordValue;
1210
1231
  declare class QtiPortableCustomInteraction extends Interaction {
1211
1232
  #private;
1212
1233
  protected _iframeLoaded: boolean;
@@ -1222,6 +1243,7 @@ declare class QtiPortableCustomInteraction extends Interaction {
1222
1243
  customInteractionTypeIdentifier: string;
1223
1244
  requirePathsJson: string;
1224
1245
  requireShimJson: string;
1246
+ /** A RequireJS to load in the iframe instead of the inlined copy (src/vendor/require-js.ts). */
1225
1247
  requireJsUrl: string;
1226
1248
  baseUrl: string;
1227
1249
  useDefaultPaths: boolean;
@@ -1249,10 +1271,6 @@ declare class QtiPortableCustomInteraction extends Interaction {
1249
1271
  * Get direct child elements by tag name
1250
1272
  */
1251
1273
  private getDirectChildrenByTag;
1252
- /**
1253
- * Coerce a scalar value to the expected base-type when possible
1254
- */
1255
- private coerceBaseValue;
1256
1274
  /**
1257
1275
  * Normalize an input into a list form
1258
1276
  */
@@ -1261,14 +1279,6 @@ declare class QtiPortableCustomInteraction extends Interaction {
1261
1279
  * Convert a variable value to QtiVariableJSON
1262
1280
  */
1263
1281
  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
1282
  /**
1273
1283
  * Extract default QTI_CONTEXT values from qti-context-declaration elements
1274
1284
  */
@@ -1288,7 +1298,7 @@ declare class QtiPortableCustomInteraction extends Interaction {
1288
1298
  /**
1289
1299
  * Converts response variables to QtiVariableJSON
1290
1300
  */
1291
- protected responseVariablesToQtiVariableJSON(input: string | string[], cardinality: Cardinality, baseType: BaseType): QtiVariableJSON;
1301
+ protected responseVariablesToQtiVariableJSON(input: PciResponseValue, cardinality: Cardinality, baseType: BaseType, fieldBaseTypes?: Record<string, BaseType>): QtiVariableJSON;
1292
1302
  validate(): boolean;
1293
1303
  set value(v: string | null);
1294
1304
  get value(): string | null;
@@ -1574,4 +1584,4 @@ declare global {
1574
1584
  }
1575
1585
  }
1576
1586
 
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 };
1587
+ 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 };