@citolab/qti-components 8.0.1 → 8.1.0

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 (72) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +648 -816
  3. package/dist/base.d.ts +61 -4
  4. package/dist/base.js +7 -1
  5. package/dist/{chunk-V5G7X53Y.js → chunk-3IACYIU2.js} +2 -2
  6. package/dist/chunk-4DB4SC5K.js +100 -0
  7. package/dist/chunk-4DB4SC5K.js.map +1 -0
  8. package/dist/{chunk-F4BNJWYN.js → chunk-4XR2JHCP.js} +646 -677
  9. package/dist/chunk-4XR2JHCP.js.map +1 -0
  10. package/dist/{chunk-7V4HJFHW.js → chunk-6ITD55QE.js} +2 -2
  11. package/dist/{chunk-3AJOQCDU.js → chunk-6V3A7NQP.js} +2 -2
  12. package/dist/{chunk-WVVMNF74.js → chunk-6XJUP55A.js} +248 -234
  13. package/dist/chunk-6XJUP55A.js.map +1 -0
  14. package/dist/{chunk-XU7HNT4F.js → chunk-CF3DXJWM.js} +145 -119
  15. package/dist/{chunk-XU7HNT4F.js.map → chunk-CF3DXJWM.js.map} +1 -1
  16. package/dist/chunk-EKXZI26R.js +917 -0
  17. package/dist/chunk-EKXZI26R.js.map +1 -0
  18. package/dist/{chunk-IJD53WY6.js → chunk-HDEG6BAZ.js} +15 -15
  19. package/dist/{chunk-IJD53WY6.js.map → chunk-HDEG6BAZ.js.map} +1 -1
  20. package/dist/{chunk-LVBIQDPM.js → chunk-IXPDMYKH.js} +147 -101
  21. package/dist/chunk-IXPDMYKH.js.map +1 -0
  22. package/dist/chunk-IYC7LZV6.js +7 -0
  23. package/dist/chunk-IYC7LZV6.js.map +1 -0
  24. package/dist/{chunk-NA2N2WSG.js → chunk-MK2I3MQB.js} +244 -193
  25. package/dist/chunk-MK2I3MQB.js.map +1 -0
  26. package/dist/{chunk-CAO4JRLY.js → chunk-NZLW6EX7.js} +2 -2
  27. package/dist/{chunk-RXGDQDOV.js → chunk-Q52IJELT.js} +479 -393
  28. package/dist/chunk-Q52IJELT.js.map +1 -0
  29. package/dist/{chunk-QECOPVPO.js → chunk-TXIB3SKC.js} +60 -59
  30. package/dist/chunk-TXIB3SKC.js.map +1 -0
  31. package/dist/{computed.types.d-rKLSPvVG.d.ts → computed.types.d-DpKIYO6e.d.ts} +2 -0
  32. package/dist/corrections.d.ts +12 -29
  33. package/dist/corrections.js +9 -10
  34. package/dist/elements.d.ts +86 -87
  35. package/dist/elements.js +5 -6
  36. package/dist/index.d.ts +8 -39
  37. package/dist/index.js +29 -16
  38. package/dist/{interaction.d-D4MstYRz.d.ts → interaction.d-CJiMv8H7.d.ts} +13 -2
  39. package/dist/interactions.d.ts +11 -1299
  40. package/dist/interactions.js +4 -5
  41. package/dist/item.css +370 -532
  42. package/dist/item.d.ts +3 -3
  43. package/dist/item.js +6 -6
  44. package/dist/loader.js +2 -2
  45. package/dist/processing.d.ts +61 -11
  46. package/dist/processing.js +10 -2
  47. package/dist/qti-components-jsx.d.ts +293 -69
  48. package/dist/qti-test.d-_YAlhDbt.d.ts +702 -0
  49. package/dist/qti-text-entry-interaction.d-BGdfV9qG.d.ts +1567 -0
  50. package/dist/test.d.ts +11 -678
  51. package/dist/test.js +7 -8
  52. package/dist/transformers.d.ts +1 -1
  53. package/dist/transformers.js +1 -1
  54. package/package.json +11 -10
  55. package/dist/chunk-64XSIBGO.js +0 -241
  56. package/dist/chunk-64XSIBGO.js.map +0 -1
  57. package/dist/chunk-7HC5SMCU.js +0 -102
  58. package/dist/chunk-7HC5SMCU.js.map +0 -1
  59. package/dist/chunk-F4BNJWYN.js.map +0 -1
  60. package/dist/chunk-H3J7LFRO.js +0 -2243
  61. package/dist/chunk-H3J7LFRO.js.map +0 -1
  62. package/dist/chunk-LVBIQDPM.js.map +0 -1
  63. package/dist/chunk-NA2N2WSG.js.map +0 -1
  64. package/dist/chunk-QECOPVPO.js.map +0 -1
  65. package/dist/chunk-RXGDQDOV.js.map +0 -1
  66. package/dist/chunk-WVVMNF74.js.map +0 -1
  67. package/dist/chunk-X3E5HXG2.js +0 -20
  68. package/dist/chunk-X3E5HXG2.js.map +0 -1
  69. /package/dist/{chunk-V5G7X53Y.js.map → chunk-3IACYIU2.js.map} +0 -0
  70. /package/dist/{chunk-7V4HJFHW.js.map → chunk-6ITD55QE.js.map} +0 -0
  71. /package/dist/{chunk-3AJOQCDU.js.map → chunk-6V3A7NQP.js.map} +0 -0
  72. /package/dist/{chunk-CAO4JRLY.js.map → chunk-NZLW6EX7.js.map} +0 -0
@@ -0,0 +1,702 @@
1
+ import * as lit from 'lit';
2
+ import { LitElement, PropertyValues, nothing } from 'lit';
3
+ import { t as transformItemApi, b as transformTestApi } from './qti-transform-test.d-BL7GGFJj.js';
4
+ import { QtiAssessmentItem, QtiModalFeedback } from './elements.js';
5
+ import { TemplateFunction } from '@heximal/templates';
6
+ import { T as TestContext, Q as QtiExpression, a as QtiExpressionBase } from './qti-expression.d-BietT_8b.js';
7
+ import { g as VariableValue, b as OutcomeVariable, V as VariableDeclaration } from './item.types.d-QU7LljEK.js';
8
+ import { S as SessionContext, C as ComputedContext, a as ComputedItem, V as View } from './computed.types.d-DpKIYO6e.js';
9
+ import { C as ConfigContext } from './config.context.d-BvU9r-Mg.js';
10
+ import { Q as QtiRuleBase } from './qti-rule-base.d-ajOnfGXY.js';
11
+ import { Q as QtiContext } from './qti.context.d-CejJMlfZ.js';
12
+
13
+ declare class QtiAssessmentItemRef extends LitElement {
14
+ category?: string;
15
+ identifier?: string;
16
+ required?: boolean;
17
+ fixed?: boolean;
18
+ href?: string;
19
+ weigths: Map<string, number>;
20
+ xmlDoc: DocumentFragment;
21
+ protected createRenderRoot(): HTMLElement | DocumentFragment;
22
+ get assessmentItem(): QtiAssessmentItem | null;
23
+ myTemplate: TemplateFunction;
24
+ connectedCallback(): Promise<void>;
25
+ render(): unknown;
26
+ }
27
+ declare global {
28
+ interface HTMLElementTagNameMap {
29
+ 'qti-assessment-item-ref': QtiAssessmentItemRef;
30
+ }
31
+ }
32
+
33
+ declare class QtiAssessmentSection extends LitElement {
34
+ #private;
35
+ identifier: string;
36
+ required: string;
37
+ fixed: boolean;
38
+ get title(): string;
39
+ set title(value: string);
40
+ visible: boolean;
41
+ keepTogether: boolean;
42
+ navigationMode?: 'linear' | 'nonlinear';
43
+ submissionMode?: 'individual' | 'simultaneous';
44
+ _testContext?: TestContext;
45
+ connectedCallback(): Promise<void>;
46
+ render(): lit.TemplateResult<1>;
47
+ }
48
+ declare global {
49
+ interface HTMLElementTagNameMap {
50
+ 'qti-assessment-section': QtiAssessmentSection;
51
+ }
52
+ }
53
+
54
+ declare class QtiAssessmentTest extends LitElement {
55
+ #private;
56
+ identifier: string;
57
+ get title(): string;
58
+ set title(value: string);
59
+ _testContext?: TestContext;
60
+ connectedCallback(): Promise<void>;
61
+ render(): lit.TemplateResult<1>;
62
+ }
63
+ declare global {
64
+ interface HTMLElementTagNameMap {
65
+ 'qti-assessment-test': QtiAssessmentTest;
66
+ }
67
+ }
68
+
69
+ declare class QtiOutcomeProcessing extends LitElement {
70
+ static styles: lit.CSSResult[];
71
+ render(): lit.TemplateResult<1>;
72
+ process(): void;
73
+ }
74
+ declare global {
75
+ interface HTMLElementTagNameMap {
76
+ 'qti-outcome-processing': QtiOutcomeProcessing;
77
+ }
78
+ }
79
+ declare class QtiOutcomeProcessingProcessor {
80
+ process(rules: QtiRuleBase[]): void;
81
+ }
82
+
83
+ declare class QtiTestFeedback extends QtiModalFeedback {
84
+ static styles: lit.CSSResult;
85
+ render(): lit.TemplateResult<1>;
86
+ }
87
+ declare global {
88
+ interface HTMLElementTagNameMap {
89
+ 'qti-test-feedback': QtiTestFeedback;
90
+ }
91
+ }
92
+
93
+ declare class QtiTestPart extends LitElement {
94
+ #private;
95
+ identifier: string;
96
+ get title(): string;
97
+ set title(value: string);
98
+ class: string;
99
+ navigationMode: 'linear' | 'nonlinear';
100
+ submissionMode: 'individual' | 'simultaneous';
101
+ connectedCallback(): Promise<void>;
102
+ render(): lit.TemplateResult<1>;
103
+ }
104
+ declare global {
105
+ interface HTMLElementTagNameMap {
106
+ 'qti-test-part': QtiTestPart;
107
+ }
108
+ }
109
+
110
+ declare class QtiTestVariables extends QtiExpression<number> {
111
+ #private;
112
+ _testContext?: TestContext;
113
+ constructor();
114
+ getResult(): number;
115
+ calculate(): number;
116
+ }
117
+ declare class QtiTestVariablesExpression implements QtiExpressionBase<number> {
118
+ private testContext;
119
+ private itemVariable;
120
+ private includedItems;
121
+ constructor(testContext: TestContext, itemVariable: string, includedItems: {
122
+ item: string;
123
+ weight: number;
124
+ }[]);
125
+ calculate(): number;
126
+ }
127
+ declare global {
128
+ interface HTMLElementTagNameMap {
129
+ 'qti-test-variables': QtiTestVariables;
130
+ }
131
+ }
132
+
133
+ interface TestBaseInterface extends LitElement {
134
+ testContext: Readonly<TestContext>;
135
+ sessionContext: Readonly<SessionContext>;
136
+ configContext?: Readonly<ConfigContext>;
137
+ _testElement: QtiAssessmentTest;
138
+ updateItemVariables(itemRefID: string, variables: VariableValue<string | string[] | null>[]): void;
139
+ }
140
+
141
+ type PostLoadTransformCallback = (transformer: transformItemApi, itemRef: QtiAssessmentItemRef) => transformItemApi | Promise<transformItemApi>;
142
+ type PostLoadTestTransformCallback = (transformer: transformTestApi, testElement: QtiAssessmentTest) => transformTestApi | Promise<transformTestApi>;
143
+ /**
144
+ * Exactly what this mixin adds. `IQtiTest` composes it (see ../types/iqti-test, which
145
+ * re-exports it), and `TestNavigationClass` below `implements` it, so the interface and the
146
+ * class cannot drift apart.
147
+ *
148
+ * This was `declare class TestNavigationInterface {}` — EMPTY — so the returned
149
+ * `Constructor<TestNavigationInterface> & T` added nothing and every member the mixin
150
+ * contributes was erased from the public type. `QtiTest` looked as though it had no
151
+ * `navigate` or `postLoadTransformCallback`, and consumers had to intersect the class with
152
+ * `IQtiTest` by hand to describe one element.
153
+ *
154
+ * `showLoadingIndicators` and `retryNavigation` used to be listed on the `IQtiTest` side with
155
+ * no implementation anywhere in the repo, so calling `retryNavigation()` would have thrown.
156
+ * They are gone rather than stubbed: there was no behaviour to preserve.
157
+ */
158
+ interface ITestNavigationMixin {
159
+ navigate: 'item' | 'section' | null;
160
+ requestTimeout: number;
161
+ postLoadTransformCallback: PostLoadTransformCallback | null;
162
+ postLoadTestTransformCallback: PostLoadTestTransformCallback | null;
163
+ navigateTo(type: 'item' | 'section', id?: string): void;
164
+ getLoadingProgress(): {
165
+ expectedItems: number;
166
+ connectedItems: number;
167
+ expectedStimulus: number;
168
+ loadedStimulus: number;
169
+ isComplete: boolean;
170
+ };
171
+ }
172
+
173
+ type CustomEventMap = {
174
+ 'test-end-attempt': CustomEvent;
175
+ };
176
+ declare global {
177
+ interface GlobalEventHandlersEventMap extends CustomEventMap {
178
+ }
179
+ }
180
+ declare class TestNavigation extends LitElement {
181
+ #private;
182
+ identifier: string | undefined;
183
+ initContext: {
184
+ identifier: string;
185
+ [key: string]: any;
186
+ }[];
187
+ qtiContext: QtiContext;
188
+ configContext: ConfigContext;
189
+ protected _testContext?: TestContext;
190
+ protected _sessionContext?: SessionContext;
191
+ protected computedContext: ComputedContext;
192
+ autoScoreItems: boolean;
193
+ constructor();
194
+ /** The currently active assessment item, exposed for optional presentation extensions. */
195
+ protected get activeAssessmentItem(): QtiAssessmentItem | undefined;
196
+ render(): lit.TemplateResult<1>;
197
+ protected willUpdate(_changedProperties: PropertyValues): void;
198
+ }
199
+ declare global {
200
+ interface HTMLElementTagNameMap {
201
+ 'test-navigation': TestNavigation;
202
+ }
203
+ }
204
+
205
+ /**
206
+ * Represents a custom element for navigating to the next test item.
207
+ *
208
+ * @remarks
209
+ * This element provides functionality for navigating to the next test item.
210
+ *
211
+ * @example
212
+ * ```html
213
+ * <test-next></test-next>
214
+ * ```
215
+ */
216
+ declare class TestNext extends LitElement {
217
+ #private;
218
+ _internalDisabled: boolean;
219
+ protected computedContext: ComputedContext;
220
+ sectionItems: ComputedItem[];
221
+ itemIndex: number;
222
+ _handleTestElementChange(_oldValue: ComputedContext, newValue: ComputedContext): void;
223
+ static styles: lit.CSSResult;
224
+ constructor();
225
+ connectedCallback(): void;
226
+ willUpdate(_changedProperties: Map<string | number | symbol, unknown>): void;
227
+ checkDisabled(): void;
228
+ protected _requestItem(identifier: string): void;
229
+ render(): lit.TemplateResult<1>;
230
+ }
231
+ declare global {
232
+ interface HTMLElementTagNameMap {
233
+ 'test-next': TestNext;
234
+ }
235
+ }
236
+
237
+ /**
238
+ * Represents a custom element for navigating to the previous test item.
239
+ *
240
+ * @remarks
241
+ * This element provides functionality for navigating to the previous test item.
242
+ *
243
+ * @example
244
+ * ```html
245
+ * <test-prev></test-prev>
246
+ * ```
247
+ */
248
+ declare class TestPrev extends LitElement {
249
+ _internalDisabled: boolean;
250
+ private computedContext;
251
+ sectionItems: ComputedItem[];
252
+ itemIndex: number;
253
+ _handleTestElementChange(_oldValue: ComputedContext, newValue: ComputedContext): void;
254
+ static styles: lit.CSSResult;
255
+ constructor();
256
+ willUpdate(_changedProperties: Map<string | number | symbol, unknown>): void;
257
+ checkDisabled(): void;
258
+ protected _requestItem(identifier: string): void;
259
+ render(): lit.TemplateResult<1>;
260
+ }
261
+ declare global {
262
+ interface HTMLElementTagNameMap {
263
+ 'test-prev': TestPrev;
264
+ }
265
+ }
266
+
267
+ declare class TestView extends LitElement {
268
+ #private;
269
+ static DEFAULT_VIEW_OPTIONS: string[];
270
+ private sessionContext;
271
+ /** label accompanying the select view dropdown */
272
+ label: string;
273
+ /** The options to display in the dropdown, default: ['author', 'candidate', 'proctor', 'scorer', 'testConstructor', 'tutor'] */
274
+ viewOptions: string;
275
+ protected _handleViewOptionsChange: () => void;
276
+ connectedCallback(): void;
277
+ private _viewOptions;
278
+ protected _switchView(view: string): void;
279
+ render(): lit.TemplateResult<1>;
280
+ }
281
+ declare global {
282
+ interface HTMLElementTagNameMap {
283
+ 'test-view': TestView;
284
+ }
285
+ }
286
+
287
+ declare class TestItemLink extends LitElement {
288
+ static styles: lit.CSSResult;
289
+ private itemId;
290
+ constructor();
291
+ protected _requestItem(identifier: string): void;
292
+ render(): lit.TemplateResult<1>;
293
+ }
294
+ declare global {
295
+ interface HTMLElementTagNameMap {
296
+ 'test-item-link': TestItemLink;
297
+ }
298
+ }
299
+
300
+ declare class TestEndAttempt extends LitElement {
301
+ static styles: lit.CSSResult;
302
+ constructor();
303
+ render(): lit.TemplateResult<1>;
304
+ }
305
+ declare global {
306
+ interface HTMLElementTagNameMap {
307
+ 'test-end-attempt': TestEndAttempt;
308
+ }
309
+ }
310
+
311
+ /**
312
+ * @deprecated test-paging-buttons-stamp is deprecated and will be removed in the future.
313
+ */
314
+ declare class TestPagingButtonsStamp extends LitElement {
315
+ #private;
316
+ private computedContext;
317
+ myTemplate: TemplateFunction;
318
+ protected createRenderRoot(): HTMLElement | DocumentFragment;
319
+ constructor();
320
+ connectedCallback(): void;
321
+ render(): lit.TemplateResult<1>;
322
+ }
323
+ declare global {
324
+ interface HTMLElementTagNameMap {
325
+ 'test-paging-buttons-stamp': TestPagingButtonsStamp;
326
+ }
327
+ }
328
+
329
+ /**
330
+ * `<test-container>` is a custom element designed for hosting the qti-assessment-item.
331
+ * The `qti-assessment-test` will be placed inside the shadow DOM of this element.
332
+ * The element loads the test from the provided URL and renders it inside the shadow DOM.
333
+ *
334
+ * ```html
335
+ * <qti-test>
336
+ * <test-navigation>
337
+ * <test-container class="m-4 bg-white" test-url="./path/to/assessmenttest.xml"></test-container>
338
+ * </test-navigation>
339
+ * </qti-test>
340
+ * ```
341
+ */
342
+ declare class TestContainer extends LitElement {
343
+ #private;
344
+ /** Scoped registry used by the test shadow root. Must be set before connection. */
345
+ customElementRegistry: CustomElementRegistry | null;
346
+ /** URL of the item to load */
347
+ testURL: string | null;
348
+ /** A parsed HTML document */
349
+ testDoc: DocumentFragment | null;
350
+ /** The raw XML string */
351
+ testXML: string | null;
352
+ protected qtiContext: QtiContext;
353
+ protected createRenderRoot(): HTMLElement | DocumentFragment;
354
+ /** Callback function to transform the test after loading */
355
+ protected handleTestURLChange(): Promise<void>;
356
+ protected handleTestXMLChange(): void;
357
+ connectedCallback(): Promise<void>;
358
+ render(): lit.TemplateResult<1>;
359
+ }
360
+ declare global {
361
+ interface HTMLElementTagNameMap {
362
+ 'test-container': TestContainer;
363
+ }
364
+ }
365
+
366
+ declare class TestPrintVariables extends LitElement {
367
+ computedContext?: ComputedContext;
368
+ static styles: lit.CSSResult;
369
+ render(): lit.TemplateResult<1>;
370
+ }
371
+ declare global {
372
+ interface HTMLElementTagNameMap {
373
+ 'test-print-item-variables': TestPrintVariables;
374
+ }
375
+ }
376
+
377
+ /**
378
+ * @deprecated test-section-buttons-stamp is deprecated and will be removed in the future.
379
+ */
380
+ declare class TestSectionButtonsStamp extends LitElement {
381
+ #private;
382
+ private computedContext;
383
+ myTemplate: TemplateFunction;
384
+ protected createRenderRoot(): HTMLElement | DocumentFragment;
385
+ constructor();
386
+ connectedCallback(): void;
387
+ render(): lit.TemplateResult<1>;
388
+ }
389
+ declare global {
390
+ interface HTMLElementTagNameMap {
391
+ 'test-section-buttons-stamp': TestSectionButtonsStamp;
392
+ }
393
+ }
394
+
395
+ declare class TestSectionLink extends LitElement {
396
+ #private;
397
+ static styles: lit.CSSResult;
398
+ private sectionId;
399
+ constructor();
400
+ render(): lit.TemplateResult<1>;
401
+ }
402
+ declare global {
403
+ interface HTMLElementTagNameMap {
404
+ 'test-section-link': TestSectionLink;
405
+ }
406
+ }
407
+
408
+ declare class TestPrintContext extends LitElement {
409
+ computedContext?: ComputedContext;
410
+ render(): lit.TemplateResult<1>;
411
+ }
412
+ declare global {
413
+ interface HTMLElementTagNameMap {
414
+ 'test-print-context': TestPrintContext;
415
+ }
416
+ }
417
+
418
+ /**
419
+ * A custom web component that renders a test stamp using the Lit framework.
420
+ * This component is deprecated and will be removed in the future.
421
+ * @customElement
422
+ * @extends {LitElement}
423
+ */
424
+ declare class TestStamp extends LitElement {
425
+ /**
426
+ * Indicates whether the component is in debug mode.
427
+ * When set to `true`, the available objects and properties (i.e.: stampContext) is displayed.
428
+ */
429
+ debug: boolean;
430
+ private computedContext;
431
+ private stampContext;
432
+ myTemplate: TemplateFunction;
433
+ protected createRenderRoot(): HTMLElement | DocumentFragment;
434
+ connectedCallback(): void;
435
+ protected willUpdate(_changedProperties: PropertyValues): void;
436
+ render(): lit.TemplateResult<1>;
437
+ }
438
+ declare global {
439
+ interface HTMLElementTagNameMap {
440
+ 'test-stamp': TestStamp;
441
+ }
442
+ }
443
+
444
+ declare class TestScoringButtons extends LitElement {
445
+ #private;
446
+ view: string;
447
+ disabled: boolean;
448
+ myTemplate: TemplateFunction | null;
449
+ protected createRenderRoot(): HTMLElement | DocumentFragment;
450
+ connectedCallback(): void;
451
+ protected computedContext?: ComputedContext;
452
+ render(): lit.TemplateResult<1> | typeof nothing;
453
+ constructor();
454
+ }
455
+ declare global {
456
+ interface HTMLElementTagNameMap {
457
+ 'test-scoring-buttons': TestScoringButtons;
458
+ }
459
+ }
460
+
461
+ declare class TestViewToggle extends LitElement {
462
+ myTemplate: any;
463
+ protected createRenderRoot(): HTMLElement | DocumentFragment;
464
+ private sessionContext;
465
+ connectedCallback(): void;
466
+ _switchView(view: string): void;
467
+ protected firstUpdated(_changedProperties: PropertyValues): void;
468
+ render(): lit.TemplateResult<1>;
469
+ }
470
+ declare global {
471
+ interface HTMLElementTagNameMap {
472
+ 'test-view-toggle': TestViewToggle;
473
+ }
474
+ }
475
+
476
+ declare class TestScoringFeedback extends LitElement {
477
+ protected computedContext?: ComputedContext;
478
+ view: View;
479
+ render(): lit.TemplateResult<1>;
480
+ }
481
+ declare global {
482
+ interface HTMLElementTagNameMap {
483
+ 'test-scoring-feedback': TestScoringFeedback;
484
+ }
485
+ }
486
+
487
+ declare class TestCheckItem extends LitElement {
488
+ static styles: lit.CSSResult;
489
+ constructor();
490
+ render(): lit.TemplateResult<1>;
491
+ }
492
+ declare global {
493
+ interface HTMLElementTagNameMap {
494
+ 'test-check-item': TestCheckItem;
495
+ }
496
+ }
497
+
498
+ type SpeechState = 'idle' | 'playing' | 'paused';
499
+ interface TtsContext {
500
+ state: SpeechState;
501
+ /** Index of the currently highlighted reading element (0-based). */
502
+ currentElementIndex: number;
503
+ /** Total number of navigable reading elements in the current item. */
504
+ elementCount: number;
505
+ play(): void;
506
+ pause(): void;
507
+ resume(): void;
508
+ stop(): void;
509
+ prevElement(): void;
510
+ nextElement(): void;
511
+ }
512
+
513
+ declare const ttsContext: {
514
+ __context__: TtsContext;
515
+ };
516
+ /**
517
+ * Base class shared by all TTS control elements. Consumes `ttsContext` and
518
+ * mirrors the current speech state onto CSS custom states so each child can
519
+ * be styled with `:state(playing)`, `:state(paused)`, `:state(idle)`.
520
+ */
521
+ declare abstract class TtsButtonBase extends LitElement {
522
+ #private;
523
+ static styles: lit.CSSResult;
524
+ protected _tts?: TtsContext;
525
+ updated(changed: PropertyValues): void;
526
+ }
527
+ /**
528
+ * `<test-item-to-speech>` is the controller and context provider. It manages
529
+ * speech synthesis, word highlighting, and item element lookup. Compose your
530
+ * own player by placing control elements as children.
531
+ *
532
+ * @example
533
+ * ```html
534
+ * <test-item-to-speech language="nl-NL">
535
+ * <test-tts-play></test-tts-play>
536
+ * <test-tts-prev>◀◀</test-tts-prev>
537
+ * <test-tts-next>▶▶</test-tts-next>
538
+ * <test-tts-stop>■</test-tts-stop>
539
+ * </test-item-to-speech>
540
+ * ```
541
+ *
542
+ * @cssstate idle - No speech active
543
+ * @cssstate playing - Speech is playing
544
+ * @cssstate paused - Speech is paused
545
+ */
546
+ declare class TestItemToSpeech extends LitElement {
547
+ #private;
548
+ language: string;
549
+ protected _sessionContext?: SessionContext;
550
+ _ttsContext: TtsContext;
551
+ constructor();
552
+ willUpdate(changed: PropertyValues): void;
553
+ updated(_changed: PropertyValues): void;
554
+ connectedCallback(): void;
555
+ disconnectedCallback(): void;
556
+ render(): lit.TemplateResult<1>;
557
+ }
558
+ /**
559
+ * Play/pause/resume toggle button — always enabled, cycles through states.
560
+ * Use named slots `play` and `pause` to customise the icons/labels independently.
561
+ *
562
+ * @example
563
+ * ```html
564
+ * <test-tts-play>
565
+ * <span slot="play">▶ Play</span>
566
+ * <span slot="pause">⏸ Pause</span>
567
+ * </test-tts-play>
568
+ * ```
569
+ *
570
+ * @cssstate idle / playing / paused
571
+ * @csspart button
572
+ */
573
+ declare class TestTtsPlay extends TtsButtonBase {
574
+ #private;
575
+ render(): lit.TemplateResult<1>;
576
+ }
577
+ /**
578
+ * Pause button — enabled only when playing.
579
+ * @cssstate idle / playing / paused
580
+ * @csspart button
581
+ */
582
+ declare class TestTtsPause extends TtsButtonBase {
583
+ render(): lit.TemplateResult<1>;
584
+ }
585
+ /**
586
+ * Resume button — enabled only when paused.
587
+ * @cssstate idle / playing / paused
588
+ * @csspart button
589
+ */
590
+ declare class TestTtsResume extends TtsButtonBase {
591
+ render(): lit.TemplateResult<1>;
592
+ }
593
+ /**
594
+ * Stop button — enabled when playing or paused.
595
+ * @cssstate idle / playing / paused
596
+ * @csspart button
597
+ */
598
+ declare class TestTtsStop extends TtsButtonBase {
599
+ render(): lit.TemplateResult<1>;
600
+ }
601
+ /**
602
+ * Prev-element button — moves cursor to the previous reading element and pauses.
603
+ * Disabled at the first element or when no elements are loaded.
604
+ * @cssstate idle / playing / paused
605
+ * @csspart button
606
+ */
607
+ declare class TestTtsPrev extends TtsButtonBase {
608
+ render(): lit.TemplateResult<1>;
609
+ }
610
+ /**
611
+ * Next-element button — moves cursor to the next reading element and pauses.
612
+ * Disabled at the last element or when no elements are loaded.
613
+ * @cssstate idle / playing / paused
614
+ * @csspart button
615
+ */
616
+ declare class TestTtsNext extends TtsButtonBase {
617
+ render(): lit.TemplateResult<1>;
618
+ }
619
+ declare global {
620
+ interface HTMLElementTagNameMap {
621
+ 'test-item-to-speech': TestItemToSpeech;
622
+ 'test-tts-play': TestTtsPlay;
623
+ 'test-tts-pause': TestTtsPause;
624
+ 'test-tts-resume': TestTtsResume;
625
+ 'test-tts-stop': TestTtsStop;
626
+ 'test-tts-prev': TestTtsPrev;
627
+ 'test-tts-next': TestTtsNext;
628
+ }
629
+ }
630
+
631
+ declare const QtiTest_base: (abstract new (...args: any[]) => ITestNavigationMixin) & (abstract new (...args: any[]) => {
632
+ updateAssessmentItemView(assessmentItem: QtiAssessmentItem, view: View): void;
633
+ }) & (abstract new (...args: any[]) => {
634
+ updateOutcomeVariable(identifier: string, value: string | string[] | undefined): void;
635
+ getOutcome(identifier: string): Readonly<OutcomeVariable>;
636
+ getVariable(identifier: string): Readonly<VariableDeclaration<string | string[] | null>>;
637
+ outcomeProcessing(): boolean;
638
+ }) & (abstract new (...args: any[]) => TestBaseInterface) & typeof LitElement;
639
+ /**
640
+ * `<qti-test>` is a custom element designed for rendering and interacting with QTI (Question and Test Interoperability) tests.
641
+ *
642
+ * This component leverages several mixins to provide functionality for loading, navigating, processing, and displaying QTI test assessments.
643
+ *
644
+ * ### Example Usage
645
+ *
646
+ * Minimal example including navigation:
647
+ *
648
+ * ```html
649
+ * <qti-test>
650
+ * <test-navigation>
651
+ * <test-container test-url="./path/to/assessment.xml"></test-container>
652
+ * <nav class="flex">
653
+ * <test-prev></test-prev>
654
+ * <test-next></test-next>
655
+ * </nav>
656
+ * </test-navigation>
657
+ * </qti-test>
658
+ * ```
659
+ *
660
+ * Use the following file structure
661
+ * A qti-test loads a QTI3.0 assessmenttest.xml file from a package folder.
662
+ *
663
+ * ```plaintext
664
+ * Root/
665
+ * ├── index.html
666
+ * └── /assets/api/examples/
667
+ * ├── assessmenttest.xml
668
+ * └── imsmanifest.xml
669
+ *
670
+ * ```
671
+ *
672
+ * ### Test components
673
+ *
674
+ * Use test components inside the qti-test component for added functionality.
675
+ * ### Test next
676
+ * `<test-next> | TestNext`
677
+ *
678
+ * ### Test prev
679
+ *
680
+ * `<test-prev> | TestPrev`
681
+ * ### Test components
682
+ *
683
+ * You can use normal class names to style the elements.
684
+ * And you can use the `test-prev` and `test-next` elements to navigate through the test.
685
+ *
686
+ */
687
+ declare class QtiTest extends QtiTest_base {
688
+ configContext: ConfigContext;
689
+ /**
690
+ * Renders the component's template.
691
+ * Provides a default `<slot>` for content projection.
692
+ */
693
+ connectedCallback(): Promise<void>;
694
+ render(): lit.TemplateResult<1>;
695
+ }
696
+ declare global {
697
+ interface HTMLElementTagNameMap {
698
+ 'qti-test': QtiTest;
699
+ }
700
+ }
701
+
702
+ export { TestTtsPlay as A, TestTtsPrev as B, TestTtsResume as C, TestTtsStop as D, TestView as E, TestViewToggle as F, type TtsContext as G, ttsContext as H, type ITestNavigationMixin as I, QtiAssessmentItemRef as Q, type SpeechState as S, TestCheckItem as T, QtiAssessmentSection as a, QtiAssessmentTest as b, QtiOutcomeProcessing as c, QtiOutcomeProcessingProcessor as d, QtiTest as e, QtiTestFeedback as f, QtiTestPart as g, QtiTestVariables as h, QtiTestVariablesExpression as i, TestContainer as j, TestEndAttempt as k, TestItemLink as l, TestItemToSpeech as m, TestNavigation as n, TestNext as o, TestPagingButtonsStamp as p, TestPrev as q, TestPrintContext as r, TestPrintVariables as s, TestScoringButtons as t, TestScoringFeedback as u, TestSectionButtonsStamp as v, TestSectionLink as w, TestStamp as x, TestTtsNext as y, TestTtsPause as z };