@citolab/qti-components 7.14.2 → 7.15.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 (147) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +4070 -4048
  3. package/custom-elements.json +10320 -25886
  4. package/dist/base.d.ts +8 -0
  5. package/dist/base.js +50 -0
  6. package/dist/{chunks/chunk-7567ZPN6.js → chunk-2DOYPVF5.js} +252 -136
  7. package/dist/chunk-2DOYPVF5.js.map +1 -0
  8. package/dist/chunk-2ZEJ3RR5.js +89 -0
  9. package/dist/chunk-2ZEJ3RR5.js.map +1 -0
  10. package/dist/{chunks/chunk-Z2FFXTKX.js → chunk-352OTVTY.js} +1483 -445
  11. package/dist/chunk-352OTVTY.js.map +1 -0
  12. package/dist/{chunks/chunk-2X2C5WI5.js → chunk-C2HQFI2C.js} +939 -3842
  13. package/dist/chunk-C2HQFI2C.js.map +1 -0
  14. package/dist/chunk-DWIRLYDS.js +20 -0
  15. package/dist/chunk-DWIRLYDS.js.map +1 -0
  16. package/dist/{chunks/chunk-H2JE6IVU.js → chunk-EUXUH3YW.js} +1 -1
  17. package/dist/chunk-F44CI35W.js +145 -0
  18. package/dist/chunk-F44CI35W.js.map +1 -0
  19. package/dist/{chunks/chunk-XBPO6E25.js → chunk-INKI27D5.js} +6 -5
  20. package/dist/chunk-INKI27D5.js.map +1 -0
  21. package/dist/chunk-JEUY3MYB.js +2010 -0
  22. package/dist/chunk-JEUY3MYB.js.map +1 -0
  23. package/dist/chunk-O4XIWHTF.js +1139 -0
  24. package/dist/chunk-O4XIWHTF.js.map +1 -0
  25. package/dist/chunk-RI47B4ZT.js +1753 -0
  26. package/dist/chunk-RI47B4ZT.js.map +1 -0
  27. package/dist/{qti-loader/index.js → chunk-VEV4DGPH.js} +6 -6
  28. package/dist/chunk-VEV4DGPH.js.map +1 -0
  29. package/dist/{chunks/chunk-PT5ASWGQ.js → chunk-W4SQRNWO.js} +105 -2
  30. package/dist/chunk-W4SQRNWO.js.map +1 -0
  31. package/dist/elements.d.ts +1 -0
  32. package/dist/elements.js +42 -0
  33. package/dist/index.d.ts +8 -24
  34. package/dist/index.js +118 -284
  35. package/dist/index.js.map +1 -1
  36. package/dist/interactions.d.ts +1 -0
  37. package/dist/interactions.js +72 -0
  38. package/dist/item.css +8 -0
  39. package/dist/item.d.ts +1 -0
  40. package/dist/item.js +23 -0
  41. package/dist/loader.d.ts +1 -0
  42. package/dist/loader.js +11 -0
  43. package/dist/processing.d.ts +1 -0
  44. package/dist/processing.js +103 -0
  45. package/dist/qti-components-jsx.d.ts +1540 -2452
  46. package/dist/test.d.ts +1 -0
  47. package/dist/{qti-test/index.js → test.js} +11 -19
  48. package/dist/transformers.d.ts +1 -0
  49. package/dist/{qti-transformers/index.js → transformers.js} +3 -3
  50. package/dist/vscode.html-custom-data.json +469 -631
  51. package/package.json +71 -167
  52. package/LICENSE.md +0 -674
  53. package/dist/chunks/chunk-2X2C5WI5.js.map +0 -1
  54. package/dist/chunks/chunk-4OGJBG35.js +0 -8
  55. package/dist/chunks/chunk-4OGJBG35.js.map +0 -1
  56. package/dist/chunks/chunk-7567ZPN6.js.map +0 -1
  57. package/dist/chunks/chunk-BHJSX3Q6.js +0 -8
  58. package/dist/chunks/chunk-BHJSX3Q6.js.map +0 -1
  59. package/dist/chunks/chunk-C5RLRG3L.js +0 -10
  60. package/dist/chunks/chunk-C5RLRG3L.js.map +0 -1
  61. package/dist/chunks/chunk-CJADUWEC.js +0 -10
  62. package/dist/chunks/chunk-CJADUWEC.js.map +0 -1
  63. package/dist/chunks/chunk-DVQQ7I6Y.js +0 -8
  64. package/dist/chunks/chunk-DVQQ7I6Y.js.map +0 -1
  65. package/dist/chunks/chunk-ELDMXTUQ.js +0 -31
  66. package/dist/chunks/chunk-ELDMXTUQ.js.map +0 -1
  67. package/dist/chunks/chunk-GAAFN7QF.js +0 -146
  68. package/dist/chunks/chunk-GAAFN7QF.js.map +0 -1
  69. package/dist/chunks/chunk-H6KHXSIO.js +0 -8
  70. package/dist/chunks/chunk-H6KHXSIO.js.map +0 -1
  71. package/dist/chunks/chunk-JQ6HWGRY.js +0 -22
  72. package/dist/chunks/chunk-JQ6HWGRY.js.map +0 -1
  73. package/dist/chunks/chunk-NJNQOQUU.js +0 -8
  74. package/dist/chunks/chunk-NJNQOQUU.js.map +0 -1
  75. package/dist/chunks/chunk-P4QBOVQ2.js +0 -206
  76. package/dist/chunks/chunk-P4QBOVQ2.js.map +0 -1
  77. package/dist/chunks/chunk-PT5ASWGQ.js.map +0 -1
  78. package/dist/chunks/chunk-SV4K25ZI.js +0 -19
  79. package/dist/chunks/chunk-SV4K25ZI.js.map +0 -1
  80. package/dist/chunks/chunk-XBPO6E25.js.map +0 -1
  81. package/dist/chunks/chunk-YD7FVKDP.js +0 -236
  82. package/dist/chunks/chunk-YD7FVKDP.js.map +0 -1
  83. package/dist/chunks/chunk-Z2FFXTKX.js.map +0 -1
  84. package/dist/exports/computed-item.context.d.ts +0 -23
  85. package/dist/exports/computed-item.context.js +0 -8
  86. package/dist/exports/computed.context.d.ts +0 -34
  87. package/dist/exports/computed.context.js +0 -8
  88. package/dist/exports/config.context.d.ts +0 -14
  89. package/dist/exports/config.context.js +0 -8
  90. package/dist/exports/expression-result.d.ts +0 -19
  91. package/dist/exports/expression-result.js +0 -1
  92. package/dist/exports/interaction.d.ts +0 -46
  93. package/dist/exports/interaction.interface.d.ts +0 -13
  94. package/dist/exports/interaction.interface.js +0 -1
  95. package/dist/exports/interaction.js +0 -12
  96. package/dist/exports/item.context.d.ts +0 -11
  97. package/dist/exports/item.context.js +0 -8
  98. package/dist/exports/qti-assessment-item.context.d.ts +0 -9
  99. package/dist/exports/qti-assessment-item.context.js +0 -8
  100. package/dist/exports/qti-condition-expression.d.ts +0 -14
  101. package/dist/exports/qti-condition-expression.js +0 -11
  102. package/dist/exports/qti-condition-expression.js.map +0 -1
  103. package/dist/exports/qti-expression.d.ts +0 -23
  104. package/dist/exports/qti-expression.js +0 -10
  105. package/dist/exports/qti-expression.js.map +0 -1
  106. package/dist/exports/qti-test.d.ts +0 -12
  107. package/dist/exports/qti-test.js +0 -1
  108. package/dist/exports/qti-test.js.map +0 -1
  109. package/dist/exports/qti.context.d.ts +0 -14
  110. package/dist/exports/qti.context.js +0 -8
  111. package/dist/exports/qti.context.js.map +0 -1
  112. package/dist/exports/session.context.d.ts +0 -15
  113. package/dist/exports/session.context.js +0 -10
  114. package/dist/exports/session.context.js.map +0 -1
  115. package/dist/exports/test.context.d.ts +0 -16
  116. package/dist/exports/test.context.js +0 -10
  117. package/dist/exports/test.context.js.map +0 -1
  118. package/dist/exports/variables.d.ts +0 -2
  119. package/dist/exports/variables.js +0 -1
  120. package/dist/exports/variables.js.map +0 -1
  121. package/dist/qti-assessment-item-l-mN3teH.d.ts +0 -105
  122. package/dist/qti-components/index.d.ts +0 -1522
  123. package/dist/qti-components/index.js +0 -214
  124. package/dist/qti-components/index.js.map +0 -1
  125. package/dist/qti-item/index.d.ts +0 -114
  126. package/dist/qti-item/index.js +0 -19
  127. package/dist/qti-item/index.js.map +0 -1
  128. package/dist/qti-loader/index.d.ts +0 -21
  129. package/dist/qti-loader/index.js.map +0 -1
  130. package/dist/qti-modal-feedback-PKbhO-3w.d.ts +0 -30
  131. package/dist/qti-test/index.d.ts +0 -480
  132. package/dist/qti-test/index.js.map +0 -1
  133. package/dist/qti-test-Db7oNIWY.d.ts +0 -120
  134. package/dist/qti-transform-test-Bz9A3hmD.d.ts +0 -63
  135. package/dist/qti-transformers/index.d.ts +0 -18
  136. package/dist/qti-transformers/index.js.map +0 -1
  137. package/dist/variables-BCkyLoXK.d.ts +0 -55
  138. package/readme.md +0 -59
  139. /package/dist/{chunks/chunk-H2JE6IVU.js.map → base.js.map} +0 -0
  140. /package/dist/{exports/computed-item.context.js.map → chunk-EUXUH3YW.js.map} +0 -0
  141. /package/dist/{exports/computed.context.js.map → elements.js.map} +0 -0
  142. /package/dist/{exports/config.context.js.map → interactions.js.map} +0 -0
  143. /package/dist/{exports/expression-result.js.map → item.js.map} +0 -0
  144. /package/dist/{exports/interaction.interface.js.map → loader.js.map} +0 -0
  145. /package/dist/{exports/interaction.js.map → processing.js.map} +0 -0
  146. /package/dist/{exports/item.context.js.map → test.js.map} +0 -0
  147. /package/dist/{exports/qti-assessment-item.context.js.map → transformers.js.map} +0 -0
@@ -1,1522 +0,0 @@
1
- import { Q as QtiAssessmentItem } from '../qti-assessment-item-l-mN3teH.js';
2
- import * as lit from 'lit';
3
- import { LitElement, CSSResultGroup, PropertyValues, PropertyValueMap, nothing } from 'lit';
4
- import * as lit_html from 'lit-html';
5
- import { Calculate, Cardinality, BaseType } from '../exports/expression-result.js';
6
- import { a as QtiFeedback } from '../qti-modal-feedback-PKbhO-3w.js';
7
- export { Q as QtiModalFeedback } from '../qti-modal-feedback-PKbhO-3w.js';
8
- import { IInteraction } from '../exports/interaction.interface.js';
9
- import { Interaction, Correctness } from '../exports/interaction.js';
10
- import { ConfigContext } from '../exports/config.context.js';
11
- import { ItemContext } from '../exports/item.context.js';
12
- import * as lit_html_directives_ref_js from 'lit-html/directives/ref.js';
13
- import { QtiExpression, QtiExpressionBase } from '../exports/qti-expression.js';
14
- import { QtiConditionExpression } from '../exports/qti-condition-expression.js';
15
- import { TestContext } from '../exports/test.context.js';
16
- import { R as ResponseVariable, V as VariableDeclaration } from '../variables-BCkyLoXK.js';
17
- export { c as QtiAreaMapEntry, b as QtiAreaMapping, a as QtiMapEntry, Q as QtiMapping, d as areaShape } from '../variables-BCkyLoXK.js';
18
- import '../exports/qti.context.js';
19
-
20
- declare class QtiAssessmentStimulusRefConnectedEvent extends Event {
21
- element: QtiAssessmentStimulusRef;
22
- item: QtiAssessmentItem;
23
- static eventName: string;
24
- constructor(element: QtiAssessmentStimulusRef, item: QtiAssessmentItem);
25
- }
26
- /**
27
- * Represents a custom element for referencing an assessment stimulus.
28
- */
29
- declare class QtiAssessmentStimulusRef extends LitElement {
30
- identifier: string;
31
- href: string;
32
- /**
33
- * Lifecycle method called when the element is connected to the DOM.
34
- * First checks if there's a data-stimulus-idref element. If found, loads the stimulus directly.
35
- * If not found, delegates to the delivery platform via an event.
36
- */
37
- connectedCallback(): Promise<void>;
38
- /**
39
- * Loads and appends the stimulus to the specified element.
40
- * @param stimulusRef - The element to which the stimulus will be appended.
41
- */
42
- updateStimulusRef(stimulusRef: Element): Promise<void>;
43
- }
44
- declare global {
45
- interface HTMLElementTagNameMap {
46
- 'qti-assessment-stimulus-ref': QtiAssessmentStimulusRef;
47
- }
48
- }
49
-
50
- declare class QtiCompanionMaterialsInfo extends LitElement {
51
- }
52
- declare global {
53
- interface HTMLElementTagNameMap {
54
- 'qti-companion-materials-info': QtiCompanionMaterialsInfo;
55
- }
56
- }
57
-
58
- /**
59
- * https://www.imsglobal.org/spec/qti/v3p0/impl#h.fi29q8dubjgw
60
- * <qti-custom-operator class="js.org">
61
- <qti-base-value base-type="string"><![CDATA[
62
- console.log(context.variables);
63
- return 'B'
64
- document.querySelector('qti-end-attempt-interaction').disabled = true;
65
- ]]></qti-base-value>
66
- </qti-custom-operator>
67
- </qti-set-outcome-value>
68
- */
69
- declare class QtiCustomOperator extends LitElement implements Calculate {
70
- private operatorFunction;
71
- private _context?;
72
- render(): lit_html.TemplateResult<1>;
73
- handleSlotChange(): void;
74
- calculate(): any;
75
- }
76
- declare global {
77
- interface HTMLElementTagNameMap {
78
- 'qti-custom-operator': QtiCustomOperator;
79
- }
80
- }
81
-
82
- declare class QtiFeedbackBlock extends QtiFeedback {
83
- static styles: lit.CSSResult;
84
- render(): lit_html.TemplateResult<1>;
85
- connectedCallback(): void;
86
- }
87
- declare global {
88
- interface HTMLElementTagNameMap {
89
- 'qti-feedback-block': QtiFeedbackBlock;
90
- }
91
- }
92
-
93
- declare class QtiFeedbackInline extends QtiFeedback {
94
- static styles: lit.CSSResult;
95
- render: () => lit_html.TemplateResult<1>;
96
- connectedCallback(): void;
97
- }
98
- declare global {
99
- interface HTMLElementTagNameMap {
100
- 'qti-feedback-inline': QtiFeedbackInline;
101
- }
102
- }
103
-
104
- declare class QtiAssociableHotspot extends LitElement {
105
- static styles: lit.CSSResult;
106
- connectedCallback(): void;
107
- render(): lit_html.TemplateResult<1>;
108
- }
109
- declare global {
110
- interface HTMLElementTagNameMap {
111
- 'qti-associable-hotspot': QtiAssociableHotspot;
112
- }
113
- }
114
-
115
- declare const QtiAssociateInteraction_base: (abstract new (...args: any[]) => IInteraction) & typeof Interaction;
116
- declare class QtiAssociateInteraction extends QtiAssociateInteraction_base {
117
- static styles: CSSResultGroup;
118
- protected _childrenMap: Element[];
119
- protected _registerChoiceHandler: (event: CustomEvent) => void;
120
- constructor();
121
- protected _registerChoice(event: CustomEvent): void;
122
- render(): lit_html.TemplateResult<1>;
123
- disconnectedCallback(): void;
124
- }
125
- declare global {
126
- interface HTMLElementTagNameMap {
127
- 'qti-associate-interaction': QtiAssociateInteraction;
128
- }
129
- }
130
-
131
- interface ChoiceInterface {
132
- identifier: string;
133
- disabled: boolean;
134
- readonly: boolean;
135
- }
136
- /**
137
- * A mixin that adds choice functionality to a LitElement-based class.
138
- * It dispatches events with a custom `type` and handles selection logic.
139
- *
140
- * @param Base - The base class to extend.
141
- * @param type - The type of the choice, used in event names.
142
- * @returns A new class extending the base class with choice functionality.
143
- */
144
- interface ActiveElementMixinInterface {
145
- identifier: string;
146
- tabIndex: number;
147
- disabled: boolean;
148
- readonly: boolean;
149
- internals: ElementInternals;
150
- }
151
-
152
- type Choice = HTMLElement & ChoiceInterface & {
153
- internals: ElementInternals;
154
- };
155
- interface ChoicesInterface extends IInteraction {
156
- minChoices: number;
157
- maxChoices: number;
158
- value: string | null;
159
- response: string | string[] | null;
160
- validate(): boolean;
161
- reportValidity(): boolean;
162
- }
163
-
164
- type Orientation = 'horizontal' | 'vertical' | undefined;
165
- declare const QtiChoiceInteraction_base: (abstract new (...args: any[]) => {}) & (abstract new (...args: any[]) => ChoicesInterface) & typeof Interaction;
166
- declare class QtiChoiceInteraction extends QtiChoiceInteraction_base implements ChoicesInterface {
167
- static styles: CSSResultGroup;
168
- /** @deprecated, use 'qti-orientation-horizontal' or 'qti-orientation-vertical' instead */
169
- orientation: Orientation;
170
- private _handleSlotChange;
171
- render(): lit_html.TemplateResult<1>;
172
- }
173
- declare global {
174
- interface HTMLElementTagNameMap {
175
- 'qti-choice-interaction': QtiChoiceInteraction;
176
- }
177
- }
178
-
179
- declare class QtiCustomInteraction extends Interaction {
180
- private rawResponse;
181
- constructor();
182
- data: string;
183
- baseItemUrl: string;
184
- baseRefUrl: string;
185
- id: string;
186
- private _errorMessage;
187
- manifest: {
188
- script: string[];
189
- style: string[];
190
- media: string[];
191
- };
192
- connectedCallback(): void;
193
- setupCES(): void;
194
- private getIFrames;
195
- private getInnerIFrames;
196
- private postToWindowAndIframes;
197
- handlePostMessage(event: MessageEvent): void;
198
- validate(): boolean;
199
- get response(): string | string[] | null;
200
- set response(val: string | string[] | null);
201
- disconnectedCallback(): void;
202
- render(): lit_html.TemplateResult<1>;
203
- }
204
- declare global {
205
- interface HTMLElementTagNameMap {
206
- 'qti-custom-interaction': QtiCustomInteraction;
207
- }
208
- }
209
-
210
- declare class QtiEndAttemptInteraction extends LitElement {
211
- responseIdentifier: any;
212
- disabled: boolean;
213
- /** Defines the number of attempts that a user can make using the 'endAttemptInteraction' mechanism (this can be used to limit the number of hints, etc.). [More information](https://www.imsglobal.org/sites/default/files/spec/qti/v3/info/index.html#DataCharacteristic_EndAttemptInteraction.Attr_count-attempt) */
214
- countAttempt: 'true' | 'false' | null;
215
- title: string;
216
- render(): lit_html.TemplateResult<1>;
217
- endAttempt(_: Event): void;
218
- }
219
- declare global {
220
- interface HTMLElementTagNameMap {
221
- 'qti-end-attempt-interaction': QtiEndAttemptInteraction;
222
- }
223
- }
224
-
225
- declare class QtiExtendedTextInteraction extends Interaction {
226
- static styles: CSSResultGroup;
227
- protected _rows: number;
228
- /** expected length is mapped to the property maxlength on the textarea */
229
- expectedLength: number;
230
- patternMask: string;
231
- /** text appearing in the extended-text-interaction if it is empty */
232
- placeholderText: string;
233
- dataPatternmaskMessage: string;
234
- classNames: any;
235
- handleclassNamesChange(_: any, classes: string): void;
236
- response: string | null;
237
- protected _handleResponseChange: () => void;
238
- get value(): string | null;
239
- set value(val: string | null);
240
- validate(): boolean;
241
- toggleCorrectResponse(): void;
242
- reportValidity(): boolean;
243
- render(): lit_html.TemplateResult<1>;
244
- protected textChanged(event: Event): void;
245
- protected setEmptyAttribute(text: string): void;
246
- }
247
- declare global {
248
- interface HTMLElementTagNameMap {
249
- 'qti-extended-text-interaction': QtiExtendedTextInteraction;
250
- }
251
- }
252
-
253
- declare class QtiGapImg extends LitElement {
254
- static styles: lit.CSSResult;
255
- tabindex: number | undefined;
256
- connectedCallback(): void;
257
- }
258
- declare global {
259
- interface HTMLElementTagNameMap {
260
- 'qti-gap-img': QtiGapImg;
261
- }
262
- }
263
-
264
- declare const QtiGapMatchInteraction_base: (abstract new (...args: any[]) => IInteraction) & typeof Interaction;
265
- declare class QtiGapMatchInteraction extends QtiGapMatchInteraction_base {
266
- static styles: CSSResultGroup;
267
- render(): lit_html.TemplateResult<1>;
268
- toggleCorrectResponse(show: boolean): void;
269
- }
270
- declare global {
271
- interface HTMLElementTagNameMap {
272
- 'qti-gap-match-interaction': QtiGapMatchInteraction;
273
- }
274
- }
275
-
276
- declare const QtiGapText_base: (abstract new (...args: any[]) => ActiveElementMixinInterface) & typeof LitElement;
277
- declare class QtiGapText extends QtiGapText_base {
278
- static styles: lit.CSSResult;
279
- tabindex: number | undefined;
280
- connectedCallback(): void;
281
- render(): lit_html.TemplateResult<1>;
282
- }
283
- declare global {
284
- interface HTMLElementTagNameMap {
285
- 'qti-gap-text': QtiGapText;
286
- }
287
- }
288
-
289
- declare class QtiGap extends LitElement {
290
- static styles: lit.CSSResult;
291
- tabindex: number | undefined;
292
- render(): lit_html.TemplateResult<1>;
293
- }
294
- declare global {
295
- interface HTMLElementTagNameMap {
296
- 'qti-gap': QtiGap;
297
- }
298
- }
299
-
300
- declare class QtiGraphicAssociateInteraction extends Interaction {
301
- static styles: CSSResultGroup;
302
- private hotspots;
303
- private startPoint;
304
- private endPoint;
305
- private _correctLines;
306
- private startCoord;
307
- private mouseCoord;
308
- private grImage;
309
- private _response;
310
- constructor();
311
- reset(): void;
312
- validate(): boolean;
313
- set response(val: string[]);
314
- get response(): string[];
315
- toggleInternalCorrectResponse(show: boolean): void;
316
- render(): lit_html.TemplateResult<1>;
317
- private positionHotspotOnRegister;
318
- firstUpdated(): void;
319
- disconnectedCallback(): void;
320
- }
321
- declare global {
322
- interface HTMLElementTagNameMap {
323
- 'qti-graphic-associate-interaction': QtiGraphicAssociateInteraction;
324
- }
325
- }
326
-
327
- declare const QtiGraphicGapMatchInteraction_base: (abstract new (...args: any[]) => IInteraction) & typeof Interaction;
328
- declare class QtiGraphicGapMatchInteraction extends QtiGraphicGapMatchInteraction_base {
329
- static styles: CSSResultGroup;
330
- render(): lit_html.TemplateResult<1>;
331
- private positionHotspotOnRegister;
332
- connectedCallback(): void;
333
- disconnectedCallback(): void;
334
- }
335
- declare global {
336
- interface HTMLElementTagNameMap {
337
- 'qti-graphic-gap-match-interaction': QtiGraphicGapMatchInteraction;
338
- }
339
- }
340
-
341
- declare const QtiGraphicOrderInteraction_base: (abstract new (...args: any[]) => ChoicesInterface) & typeof Interaction;
342
- declare class QtiGraphicOrderInteraction extends QtiGraphicOrderInteraction_base {
343
- static styles: CSSResultGroup;
344
- protected choiceOrdering: boolean;
345
- protected _choiceElements: Choice[];
346
- render(): lit_html.TemplateResult<1>;
347
- private setHotspotOrder;
348
- toggleCorrectResponse(show: boolean): void;
349
- private positionHotspotOnRegister;
350
- connectedCallback(): void;
351
- disconnectedCallback(): void;
352
- }
353
- declare global {
354
- interface HTMLElementTagNameMap {
355
- 'qti-graphic-order-interaction': QtiGraphicOrderInteraction;
356
- }
357
- }
358
-
359
- declare const QtiHotspotChoice_base: (abstract new (...args: any[]) => ActiveElementMixinInterface) & typeof LitElement;
360
- declare class QtiHotspotChoice extends QtiHotspotChoice_base {
361
- static styles: lit.CSSResult;
362
- order: number;
363
- orderCorrect: number;
364
- }
365
- declare global {
366
- interface HTMLElementTagNameMap {
367
- 'qti-hotspot-choice': QtiHotspotChoice;
368
- }
369
- }
370
-
371
- declare const QtiHotspotInteraction_base: (abstract new (...args: any[]) => ChoicesInterface) & typeof Interaction;
372
- declare class QtiHotspotInteraction extends QtiHotspotInteraction_base {
373
- static styles: CSSResultGroup;
374
- render(): lit_html.TemplateResult<1>;
375
- private imageLoadPromise;
376
- private getImageLoadPromise;
377
- private positionHotspotOnRegister;
378
- connectedCallback(): void;
379
- disconnectedCallback(): void;
380
- }
381
- declare global {
382
- interface HTMLElementTagNameMap {
383
- 'qti-hotspot-interaction': QtiHotspotInteraction;
384
- }
385
- }
386
-
387
- declare const QtiHottextInteraction_base: (abstract new (...args: any[]) => ChoicesInterface) & typeof Interaction;
388
- declare class QtiHottextInteraction extends QtiHottextInteraction_base {
389
- class: string;
390
- private get classObject();
391
- render: () => lit_html.TemplateResult<1>;
392
- connectedCallback(): void;
393
- updated(_changedProperties: PropertyValues): void;
394
- private updateHostClasses;
395
- }
396
-
397
- declare const QtiHottext_base: (abstract new (...args: any[]) => ActiveElementMixinInterface) & typeof LitElement;
398
- declare class QtiHottext extends QtiHottext_base {
399
- static styles: lit.CSSResult;
400
- render(): lit_html.TemplateResult<1>;
401
- }
402
- declare global {
403
- interface HTMLElementTagNameMap {
404
- 'qti-hottext': QtiHottext;
405
- }
406
- }
407
-
408
- interface OptionType {
409
- textContent: string;
410
- value: string;
411
- selected: boolean;
412
- }
413
- declare class QtiInlineChoiceInteraction extends Interaction {
414
- get isInline(): boolean;
415
- static get styles(): lit.CSSResult[];
416
- static inputWidthClass: string[];
417
- protected options: OptionType[];
418
- protected correctOption: string;
419
- dataPrompt: string;
420
- configContext: ConfigContext;
421
- render(): lit_html.TemplateResult<1>;
422
- connectedCallback(): void;
423
- disconnectedCallback(): void;
424
- willUpdate(changed: PropertyValues<this>): void;
425
- private _updateOptions;
426
- validate(): boolean;
427
- reset(): void;
428
- set response(value: string | null);
429
- get response(): string | null;
430
- toggleInternalCorrectResponse(show: boolean): void;
431
- protected choiceSelected(event: Event): void;
432
- }
433
- declare global {
434
- interface HTMLElementTagNameMap {
435
- 'qti-inline-choice-interaction': QtiInlineChoiceInteraction;
436
- }
437
- }
438
-
439
- declare class QtiInlineChoice extends LitElement {
440
- static get styles(): lit.CSSResult[];
441
- identifier: string;
442
- connectedCallback(): void;
443
- disconnectedCallback(): void;
444
- render(): lit_html.TemplateResult<1>;
445
- private _onSelectInlineChoice;
446
- }
447
- declare global {
448
- interface HTMLElementTagNameMap {
449
- 'qti-inline-choice': QtiInlineChoice;
450
- }
451
- }
452
-
453
- declare const QtiSimpleAssociableChoice_base: (abstract new (...args: any[]) => ActiveElementMixinInterface) & typeof LitElement;
454
- declare class QtiSimpleAssociableChoice extends QtiSimpleAssociableChoice_base {
455
- static styles: lit.CSSResult;
456
- /** the minimal number of selections a candidate must make */
457
- matchMin: number;
458
- /** the maximum number of selections a candidate must make, the other options will be disabled when max options is checked */
459
- matchMax: number;
460
- fixed: boolean;
461
- connectedCallback(): void;
462
- render(): lit_html.TemplateResult<1>;
463
- }
464
- declare global {
465
- interface HTMLElementTagNameMap {
466
- 'qti-simple-associable-choice': QtiSimpleAssociableChoice;
467
- }
468
- }
469
-
470
- declare const QtiMatchInteraction_base: (abstract new (...args: any[]) => IInteraction) & typeof Interaction;
471
- declare class QtiMatchInteraction extends QtiMatchInteraction_base {
472
- static styles: CSSResultGroup;
473
- protected sourceChoices: QtiSimpleAssociableChoice[];
474
- protected targetChoices: QtiSimpleAssociableChoice[];
475
- protected lastCheckedRadio: HTMLInputElement | null;
476
- class: string;
477
- protected _response: string | string[];
478
- get response(): string[];
479
- set response(val: string[]);
480
- responseIdentifier: string;
481
- protected correctOptions: {
482
- source: string;
483
- target: string;
484
- }[];
485
- connectedCallback(): Promise<void>;
486
- protected handleRadioClick: (e: any) => void;
487
- protected handleRadioChange: (e: any) => void;
488
- validate(): boolean;
489
- private getMatches;
490
- toggleInternalCorrectResponse(show: boolean): void;
491
- toggleCandidateCorrection(show: boolean): void;
492
- render(): lit_html.TemplateResult<1>;
493
- }
494
- declare global {
495
- interface HTMLElementTagNameMap {
496
- 'qti-match-interaction': QtiMatchInteraction;
497
- }
498
- }
499
-
500
- declare class QtiMediaInteraction extends Interaction {
501
- private _value;
502
- reset(): void;
503
- validate(): boolean;
504
- get response(): string | null;
505
- set response(val: string | null);
506
- static get properties(): {
507
- step: {
508
- type: NumberConstructor;
509
- attribute: string;
510
- default: number;
511
- };
512
- };
513
- static styles: lit.CSSResult[];
514
- render(): lit_html.TemplateResult<1>;
515
- constructor();
516
- connectedCallback(): void;
517
- }
518
- declare global {
519
- interface HTMLElementTagNameMap {
520
- 'qti-media-interaction': QtiMediaInteraction;
521
- }
522
- }
523
-
524
- declare const QtiOrderInteraction_base: (abstract new (...args: any[]) => IInteraction) & typeof Interaction;
525
- declare class QtiOrderInteraction extends QtiOrderInteraction_base {
526
- static styles: lit.CSSResult;
527
- protected childrenMap: Element[];
528
- protected nrChoices: number;
529
- correctResponses: string[];
530
- showCorrectResponses: boolean;
531
- /** orientation of choices */
532
- orientation: 'horizontal' | 'vertical';
533
- render(): lit_html.TemplateResult<1>;
534
- toggleCorrectResponse(show: boolean): void;
535
- getValue(val: string[]): string[];
536
- protected getResponse(): string[];
537
- firstUpdated(changedProps: any): Promise<void>;
538
- }
539
- declare global {
540
- interface HTMLElementTagNameMap {
541
- 'qti-order-interaction': QtiOrderInteraction;
542
- }
543
- }
544
-
545
- interface PciReadyPayload {
546
- responseIdentifier: string;
547
- status: 'interacting' | 'suspended' | 'closed' | 'solution' | 'review';
548
- }
549
- interface PciDonePayload {
550
- responseIdentifier: string;
551
- status: 'interacting' | 'suspended' | 'closed' | 'solution' | 'review';
552
- outcome?: unknown;
553
- }
554
- interface ConfigProperties<T> {
555
- properties: T;
556
- templateVariables: Record<string, unknown>;
557
- contextVariables: Record<string, unknown>;
558
- boundTo: unknown;
559
- responseIdentifier: string;
560
- onready: (payload: PciReadyPayload) => void;
561
- ondone?: (payload: PciDonePayload) => void;
562
- status?: 'interacting' | 'suspended' | 'closed' | 'solution' | 'review';
563
- }
564
- interface IMSpci<T> {
565
- typeIdentifier: string;
566
- /** @access public
567
- * @method getInstance Create a new instance of this portable custom interaction
568
- * Will be called by the qtiCustomInteractionContext
569
- * @param {DOM Element} dom - the DOM Element this PCI is being added to
570
- * @param {Object} configuration - the configuration to apply to this PCI
571
- * @param {String} state - a previous saved state to apply to this instance.
572
- * This must have been obtained from a prior call to getState on an
573
- * instance of this type (same typeIdentifier)
574
- */
575
- getInstance: (dom: HTMLElement, configuration: Configuration<T>, state: string) => void;
576
- /** @access public
577
- * @method getResponse
578
- * @return {Object} - the value to assign to the bound QTI response variable
579
- */
580
- getResponse: () => QtiVariableJSON | undefined;
581
- /** @access public
582
- * @method setResponse
583
- * @param {Object} value - the value to assign to the bound QTI response variable
584
- * NOTE: This is not an official QTI method, so no guarantee it is implemented
585
- * in all PCIs.
586
- */
587
- setResponse: (value: QtiVariableJSON) => void;
588
- /** @access public
589
- * @method getState
590
- * @return {String} The current state of this PCI. May be passed to
591
- * getInstance to later restore this PCI instance.
592
- */
593
- getState: () => string;
594
- oncompleted?: () => void;
595
- destroy?: () => void;
596
- }
597
- declare type Configuration<T> = {
598
- onready: (pci: IMSpci<ConfigProperties<T>>, state?: string) => void;
599
- properties: T;
600
- };
601
- type QtiFileData = {
602
- data: string;
603
- mime: string;
604
- name?: string;
605
- };
606
- type QtiBaseBoolean = boolean;
607
- type QtiBaseInteger = number;
608
- type QtiBaseFloat = number;
609
- type QtiBaseString = string;
610
- type QtiBasePoint = [number, number];
611
- type QtiBasePair = [string, string];
612
- type QtiBaseDirectedPair = [string, string];
613
- type QtiBaseDuration = string;
614
- type QtiBaseFile = QtiFileData;
615
- type QtiBaseUri = string;
616
- type QtiBaseIntOrIdentifier = number | string;
617
- type QtiBaseIdentifier = string;
618
- type QtiRecordItem = {
619
- name: string;
620
- base?: QtiBaseTypeJSON | null;
621
- list?: QtiListTypeJSON | null;
622
- };
623
- type ResponseVariableType = QtiVariableJSON;
624
- type QtiBaseTypeJSON = {
625
- boolean?: QtiBaseBoolean;
626
- integer?: QtiBaseInteger;
627
- float?: QtiBaseFloat;
628
- string?: QtiBaseString;
629
- point?: QtiBasePoint;
630
- pair?: QtiBasePair;
631
- directedPair?: QtiBaseDirectedPair;
632
- duration?: QtiBaseDuration;
633
- file?: QtiBaseFile;
634
- uri?: QtiBaseUri;
635
- intOrIdentifier?: QtiBaseIntOrIdentifier;
636
- identifier?: QtiBaseIdentifier;
637
- } | null;
638
- type QtiListTypeJSON = {
639
- boolean?: QtiBaseBoolean[];
640
- integer?: QtiBaseInteger[];
641
- float?: QtiBaseFloat[];
642
- string?: QtiBaseString[];
643
- point?: QtiBasePoint[];
644
- pair?: QtiBasePair[];
645
- directedPair?: QtiBaseDirectedPair[];
646
- duration?: QtiBaseDuration[];
647
- file?: QtiBaseFile[];
648
- uri?: QtiBaseUri[];
649
- intOrIdentifier?: QtiBaseIntOrIdentifier[];
650
- identifier?: QtiBaseIdentifier[];
651
- } | null;
652
- declare type QtiVariableJSON = {
653
- base?: QtiBaseTypeJSON;
654
- list?: QtiListTypeJSON;
655
- record?: QtiRecordItem[] | null;
656
- };
657
- interface ModuleResolutionConfig {
658
- waitSeconds?: number;
659
- context?: string;
660
- catchError?: boolean;
661
- paths: {
662
- [key: string]: string | string[];
663
- };
664
- shim?: {
665
- [key: string]: {
666
- deps?: string[];
667
- exports?: string;
668
- };
669
- };
670
- }
671
-
672
- declare class QtiPortableCustomInteraction extends Interaction {
673
- private _value;
674
- private pci;
675
- protected _iframeLoaded: boolean;
676
- protected _pendingMessages: Array<{
677
- method: string;
678
- params: any;
679
- }>;
680
- protected iframe: HTMLIFrameElement;
681
- private _responseCheckInterval;
682
- static styles: CSSResultGroup;
683
- module: string;
684
- customInteractionTypeIdentifier: string;
685
- requirePathsJson: string;
686
- requireShimJson: string;
687
- requireJsUrl: string;
688
- baseUrl: string;
689
- useIframe: boolean;
690
- useDefaultShims: boolean;
691
- useDefaultPaths: boolean;
692
- private _errorMessage;
693
- protected context?: ItemContext;
694
- response: string | string[];
695
- private dom;
696
- private _parsedRequirePaths;
697
- private _parsedRequireShim;
698
- /**
699
- * Parse the require paths JSON string into an object
700
- */
701
- private getRequirePaths;
702
- /**
703
- * Parse the require shim JSON string into an object
704
- */
705
- private getRequireShim;
706
- /**
707
- * Get the default require paths
708
- */
709
- private getDefaultRequirePaths;
710
- /**
711
- * Get the default require shim
712
- */
713
- private getDefaultRequireShim;
714
- /**
715
- * Get the final require paths by combining defaults with user-provided paths
716
- */
717
- private getFinalRequirePaths;
718
- /**
719
- * Get the final require shim by combining defaults with user-provided shim
720
- */
721
- private getFinalRequireShim;
722
- /**
723
- * Converts QtiVariableJSON to a string or string array
724
- */
725
- private convertQtiVariableJSON;
726
- /**
727
- * Adds hyphenated versions of camelCase keys to properties object
728
- */
729
- private addHyphenatedKeys;
730
- /**
731
- * Converts response variables to QtiVariableJSON
732
- */
733
- protected responseVariablesToQtiVariableJSON(input: string | string[], cardinality: Cardinality, baseType: BaseType): QtiVariableJSON;
734
- validate(): boolean;
735
- set value(v: string | null);
736
- get value(): string | null;
737
- set boundTo(newValue: Record<string, ResponseVariableType>);
738
- get boundTo(): Record<string, QtiVariableJSON>;
739
- /**
740
- * Unescape HTML entities in a string
741
- */
742
- private unescapeHtml;
743
- /**
744
- * Unescape HTML entities in all values of an object
745
- */
746
- private unescapeDataAttributes;
747
- /**
748
- * DIRECT MODE: Register PCI instance
749
- */
750
- register(pci: IMSpci<ConfigProperties<unknown>>): void;
751
- disconnectedCallback(): void;
752
- /**
753
- * IFRAME MODE: Send message to iframe
754
- */
755
- protected sendMessageToIframe(method: string, params: any): void;
756
- /**
757
- * IFRAME MODE: Process pending messages
758
- */
759
- private processPendingMessages;
760
- /**
761
- * IFRAME MODE: Handle iframe messages
762
- */
763
- protected handleIframeMessage: (event: MessageEvent) => void;
764
- /**
765
- * IFRAME MODE: Create iframe element
766
- */
767
- protected createIframe(): void;
768
- /**
769
- * IFRAME MODE: Send initialization data to iframe
770
- */
771
- private sendIframeInitData;
772
- /**
773
- * IFRAME MODE: Get interaction modules from DOM
774
- */
775
- private getInteractionModules;
776
- /**
777
- * IFRAME MODE: Add markup and properties to iframe
778
- */
779
- private addMarkupToIframe;
780
- /**
781
- * IFRAME MODE: Initialize the interaction
782
- */
783
- private initializeInteraction;
784
- connectedCallback(): void;
785
- /**
786
- * Stop checking for response changes
787
- */
788
- private stopResponseCheck;
789
- private _onInteractionChanged;
790
- /**
791
- * DIRECT MODE: Build RequireJS configuration
792
- */
793
- buildRequireConfig(): ModuleResolutionConfig;
794
- /**
795
- * DIRECT MODE: Helper method to combine require paths
796
- */
797
- private combineRequireResolvePaths;
798
- /**
799
- * DIRECT MODE: Helper method to remove double slashes
800
- */
801
- private removeDoubleSlashes;
802
- /**
803
- * DIRECT MODE: Load config from URL
804
- */
805
- loadConfig: (url: string, baseUrl?: string) => Promise<ModuleResolutionConfig>;
806
- /**
807
- * DIRECT MODE: Helper method to get resolvable path string
808
- */
809
- getResolvablePathString: (path: string, basePath?: string) => string;
810
- /**
811
- * DIRECT MODE: Helper method to get resolvable path
812
- */
813
- getResolvablePath: (path: string | string[], basePath?: string) => string | string[];
814
- /**
815
- * IFRAME MODE: Generate iframe HTML content
816
- */
817
- protected generateIframeContent(): string;
818
- /**
819
- * Toggle the display of the correct response
820
- * @param responseVariable The response variable containing the correct response
821
- * @param show Whether to show or hide the correct response
822
- */
823
- toggleInternalCorrectResponse(show: boolean): void;
824
- /**
825
- * Method to disable the PCI for review mode
826
- * This can be used when showing the correct response
827
- */
828
- disable(): void;
829
- /**
830
- * Method to enable the PCI for interactive mode
831
- */
832
- enable(): void;
833
- private _previousState;
834
- render(): lit_html.TemplateResult<1>;
835
- }
836
- declare global {
837
- interface HTMLElementTagNameMap {
838
- 'qti-portable-custom-interaction': QtiPortableCustomInteraction;
839
- }
840
- }
841
-
842
- declare class QtiPositionObjectInteraction extends LitElement {
843
- render(): lit_html.TemplateResult<1>;
844
- static styles: lit.CSSResult[];
845
- }
846
-
847
- declare class QtiPositionObjectStage extends LitElement {
848
- choiceOrdering: boolean;
849
- startX: any;
850
- startY: any;
851
- dragElement: any;
852
- render(): lit_html.TemplateResult<1>;
853
- static styles: lit.CSSResult[];
854
- constructor();
855
- dragElementHandler(event: any): void;
856
- firstUpdated(a: any): void;
857
- removeMoveListener(): void;
858
- disconnectedCallback(): void;
859
- }
860
- declare global {
861
- interface HTMLElementTagNameMap {
862
- 'qti-position-object-stage': QtiPositionObjectStage;
863
- }
864
- }
865
-
866
- declare class QtiSelectPointInteraction extends Interaction {
867
- static styles: lit.CSSResult[];
868
- maxChoices: number;
869
- minChoices: number;
870
- response: string[] | null;
871
- private _correctAreas;
872
- private _responseCorrection;
873
- private _imgElement;
874
- private _scaleX;
875
- private _scaleY;
876
- private _imageWidthOriginal;
877
- private _imageHeightOriginal;
878
- private _onImageClick;
879
- connectedCallback(): void;
880
- private _onResize;
881
- get responsePoints(): {
882
- x: number;
883
- y: number;
884
- }[];
885
- toggleCandidateCorrection(show: boolean): void;
886
- toggleCorrectResponse(show: boolean): any;
887
- updated(changedProperties: Map<string | number | symbol, unknown>): void;
888
- render(): lit_html.TemplateResult<1>;
889
- validate(): boolean;
890
- private calculateScale;
891
- firstUpdated(): void;
892
- disconnectedCallback(): void;
893
- }
894
- declare global {
895
- interface HTMLElementTagNameMap {
896
- 'qti-select-point-interaction': QtiSelectPointInteraction;
897
- }
898
- }
899
-
900
- declare const QtiSimpleChoice_base: (abstract new (...args: any[]) => ActiveElementMixinInterface) & typeof LitElement;
901
- /**
902
- * qti-order-interaction
903
- * qti-choice-interaction
904
- */
905
- declare class QtiSimpleChoice extends QtiSimpleChoice_base {
906
- templateIdentifier: string | null;
907
- showHide: string | null;
908
- fixed: boolean;
909
- static styles: lit.CSSResult;
910
- marker: string;
911
- get checked(): boolean;
912
- render(): lit_html.TemplateResult<1>;
913
- }
914
- declare global {
915
- interface HTMLElementTagNameMap {
916
- 'qti-simple-choice': QtiSimpleChoice;
917
- }
918
- }
919
-
920
- declare class QtiSliderInteraction extends Interaction {
921
- static styles: CSSResultGroup;
922
- private _value;
923
- private _correctResponseNumber;
924
- private _rail;
925
- min: number;
926
- max: number;
927
- step: number;
928
- validate(): boolean;
929
- connectedCallback(): void;
930
- get response(): string;
931
- set response(val: string);
932
- toggleCorrectResponse(show: boolean): void;
933
- private _updateValue;
934
- render(): lit_html.TemplateResult<1>;
935
- private _onMouseDown;
936
- private _onTouchStart;
937
- private _startDrag;
938
- private _onDrag;
939
- private _onDragEnd;
940
- }
941
- declare global {
942
- interface HTMLElementTagNameMap {
943
- 'qti-slider-interaction': QtiSliderInteraction;
944
- }
945
- }
946
-
947
- declare class QtiTextEntryInteraction extends Interaction {
948
- static styles: CSSResultGroup;
949
- inputRef: lit_html_directives_ref_js.Ref<HTMLInputElement>;
950
- expectedLength: number;
951
- patternMask: string;
952
- placeholderText: string;
953
- dataPatternmaskMessage: string;
954
- response: string | null;
955
- private _input;
956
- protected _handleValueChange: () => void;
957
- get value(): string | null;
958
- set value(val: string | null);
959
- get correctness(): Readonly<Correctness | null>;
960
- get isInline(): boolean;
961
- validate(): boolean;
962
- toggleInternalCorrectResponse(show: boolean): void;
963
- render(): lit_html.TemplateResult<1>;
964
- protected textChanged(event: Event): void;
965
- reportValidity(): boolean;
966
- reset(): void;
967
- private setEmptyAttribute;
968
- }
969
- declare global {
970
- interface HTMLElementTagNameMap {
971
- 'qti-text-entry-interaction': QtiTextEntryInteraction;
972
- }
973
- }
974
-
975
- declare class QtiUploadInteraction extends Interaction {
976
- private _file;
977
- private _base64;
978
- reset(): void;
979
- validate(): boolean;
980
- get response(): string | null;
981
- set response(base64: string | null);
982
- static get properties(): {
983
- [key: string]: lit.PropertyDeclaration<unknown, unknown>;
984
- };
985
- static styles: lit.CSSResult[];
986
- render(): lit_html.TemplateResult<1>;
987
- private _onFileChange;
988
- private _convertToBase64;
989
- }
990
- declare global {
991
- interface HTMLElementTagNameMap {
992
- 'qti-upload-interaction': QtiUploadInteraction;
993
- }
994
- }
995
-
996
- /**
997
- * @summary The qti-item-body node contains the text, graphics, media objects and interactions that describe the item's content and information about how it is structured.
998
- * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.sphpo6lu6zqi
999
- * @status stable
1000
- * @since 4.0
1001
- *
1002
- * @slot - item body content.
1003
- * @slot qti-rubric-block - the qti rubric block is placed above the item
1004
- * @part qti-rubric-block - the qti rubric block part
1005
- */
1006
- declare class QtiItemBody extends LitElement {
1007
- static styles: CSSResultGroup;
1008
- render(): lit_html.TemplateResult<1>;
1009
- }
1010
- declare global {
1011
- interface HTMLElementTagNameMap {
1012
- 'qti-item-body': QtiItemBody;
1013
- }
1014
- }
1015
-
1016
- declare class QtiRule extends LitElement implements QtiRuleBase {
1017
- render(): lit_html.TemplateResult<1>;
1018
- process(): void;
1019
- }
1020
- interface QtiRuleBase {
1021
- process(): any;
1022
- }
1023
- declare global {
1024
- interface HTMLElementTagNameMap {
1025
- 'qti-rule': QtiRule;
1026
- }
1027
- }
1028
-
1029
- declare class QtiOutcomeProcessing extends LitElement {
1030
- static styles: lit.CSSResult[];
1031
- render(): lit_html.TemplateResult<1>;
1032
- process(): void;
1033
- }
1034
- declare global {
1035
- interface HTMLElementTagNameMap {
1036
- 'qti-outcome-processing': QtiOutcomeProcessing;
1037
- }
1038
- }
1039
- declare class QtiOutcomeProcessingProcessor {
1040
- process(rules: QtiRuleBase[]): void;
1041
- }
1042
-
1043
- declare class QtiPrompt extends LitElement {
1044
- render(): lit_html.TemplateResult<1>;
1045
- connectedCallback(): void;
1046
- }
1047
- declare global {
1048
- interface HTMLElementTagNameMap {
1049
- 'qti-prompt': QtiPrompt;
1050
- }
1051
- }
1052
-
1053
- declare class QtiResponseProcessing extends LitElement {
1054
- static styles: lit.CSSResult[];
1055
- render(): lit_html.TemplateResult<1>;
1056
- process(): void;
1057
- firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
1058
- private fragmentFromString;
1059
- }
1060
- declare global {
1061
- interface HTMLElementTagNameMap {
1062
- 'qti-response-processing': QtiResponseProcessing;
1063
- }
1064
- }
1065
-
1066
- /**
1067
- * The lookupOutcomeValue rule sets the value of an outcome variable to the value obtained
1068
- * by looking up the value of the associated expression in the lookupTable associated
1069
- * with the outcome's declaration.
1070
- */
1071
- declare class QtiLookupOutcomeValue extends QtiRule {
1072
- identifier: string;
1073
- protected context?: ItemContext;
1074
- get childExpression(): QtiExpression<string>;
1075
- process(): number;
1076
- }
1077
- declare global {
1078
- interface HTMLElementTagNameMap {
1079
- 'qti-lookup-outcome-value': QtiLookupOutcomeValue;
1080
- }
1081
- }
1082
-
1083
- declare class QtiResponseCondition extends QtiRule {
1084
- render(): lit_html.TemplateResult<1>;
1085
- process(): void;
1086
- }
1087
-
1088
- /**
1089
- * Web component that processes `setOutcomeValue` in QTI.
1090
- */
1091
- declare class QtiSetOutcomeValue extends QtiRule {
1092
- /**
1093
- * Processes the QTI rule and dispatches a custom event with the computed outcome value.
1094
- */
1095
- process(): void;
1096
- /**
1097
- * Formats the computed value before dispatching.
1098
- * Ensures numbers are converted to a universal format.
1099
- */
1100
- private formatValue;
1101
- }
1102
- /**
1103
- * Encapsulates the logic for processing QTI setOutcomeValue expressions.
1104
- */
1105
- declare class QtiSetOutcomeValueRule<T> implements QtiRuleBase {
1106
- private expression;
1107
- constructor(expression: QtiExpressionBase<T>);
1108
- /**
1109
- * Evaluates the expression and returns its value.
1110
- */
1111
- process(): string | string[] | null;
1112
- }
1113
-
1114
- declare class QtiResponseElse extends LitElement {
1115
- render(): lit_html.TemplateResult<1>;
1116
- calculate(): boolean;
1117
- getSubRules(): QtiRule[];
1118
- process(): void;
1119
- }
1120
-
1121
- declare class QtiResponseIf extends QtiResponseElse {
1122
- calculate(): boolean;
1123
- getSubRules(): QtiRule[];
1124
- }
1125
-
1126
- declare class QtiResponseElseIf extends QtiResponseIf {
1127
- render(): lit_html.TemplateResult<1>;
1128
- }
1129
-
1130
- type Constructor$1<T> = new (...args: any[]) => T;
1131
- declare const QtiAnd_base: {
1132
- new (...args: any[]): {
1133
- calculateChildren(children: Array<MockQtiExpression$1<any>>): boolean;
1134
- };
1135
- } & Constructor$1<QtiConditionExpression>;
1136
- declare class QtiAnd extends QtiAnd_base {
1137
- calculate(): boolean;
1138
- }
1139
- type MockQtiExpression$1<T> = {
1140
- calculate: () => T;
1141
- };
1142
- type MockConstructor$1 = new (...args: any[]) => {};
1143
- declare function qtiAndMixin<TBase extends MockConstructor$1>(Base: TBase): {
1144
- new (...args: any[]): {
1145
- calculateChildren(children: Array<MockQtiExpression$1<any>>): boolean;
1146
- };
1147
- } & TBase;
1148
-
1149
- declare class QtiBaseValue extends QtiExpression<string> {
1150
- baseType: BaseType;
1151
- getResult(): string;
1152
- }
1153
-
1154
- /**
1155
- * @summary The qti-container-size operator returns the number of values in a container.
1156
- * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.container-size
1157
- *
1158
- * Takes a sub-expression with any base-type and either multiple or ordered cardinality.
1159
- * Returns an integer giving the number of values in the container.
1160
- * Returns 0 if the sub-expression is NULL.
1161
- */
1162
- declare class QtiContainerSize extends QtiExpression<number> {
1163
- getResult(): number;
1164
- }
1165
-
1166
- declare class QtiContains extends QtiConditionExpression {
1167
- getResult(): boolean;
1168
- }
1169
-
1170
- declare class QtiCorrect extends QtiExpression<string | string[]> {
1171
- get interpretation(): string;
1172
- getResult(): string | string[];
1173
- }
1174
-
1175
- /**
1176
- * @summary The qti-default expression returns the default value of a declared variable.
1177
- * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.default
1178
- *
1179
- * Looks up the declaration of an itemVariable and returns the associated defaultValue
1180
- * or NULL if no default value was declared. Supports item identifier prefixing
1181
- * for obtaining default values from individual items in outcomes processing.
1182
- */
1183
- declare class QtiDefault extends QtiExpression<any> {
1184
- identifier: string;
1185
- protected context?: ItemContext;
1186
- protected _testContext?: TestContext;
1187
- getResult(): any;
1188
- }
1189
-
1190
- declare class QtiEqualRounded extends QtiExpression<boolean> {
1191
- roundingMode: 'decimalPlaces' | 'significantFigures';
1192
- get figures(): number;
1193
- getResult(): boolean;
1194
- }
1195
-
1196
- /**
1197
- * @summary The qti-round operator rounds a numerical value to the nearest integer.
1198
- * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.round
1199
- *
1200
- * Takes a single sub-expression with single cardinality and numerical base-type.
1201
- * Returns an integer formed by rounding the value using the rule: n for all input
1202
- * values in the range [n-0.5, n+0.5). For example, 6.8 and 6.5 both round to 7,
1203
- * 6.49 rounds to 6, and -6.5 rounds to -6.
1204
- */
1205
- declare class QtiRound extends QtiExpression<number | null> {
1206
- getResult(): number | null;
1207
- }
1208
-
1209
- /**
1210
- * @summary The qti-round-to operator rounds a numerical value to specified precision.
1211
- * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.round-to
1212
- *
1213
- * Takes one sub-expression with single cardinality and numerical base-type.
1214
- * Returns a single float rounded by the specified method to the specified precision.
1215
- * Supports rounding to decimal places or significant figures.
1216
- */
1217
- declare class QtiRoundTo extends QtiExpression<number | null> {
1218
- roundingMode: 'decimalPlaces' | 'significantFigures';
1219
- figures: number;
1220
- getResult(): number | null;
1221
- /**
1222
- * Round to specified number of decimal places
1223
- */
1224
- private _roundToDecimalPlaces;
1225
- /**
1226
- * Round to specified number of significant figures
1227
- */
1228
- private _roundToSignificantFigures;
1229
- }
1230
-
1231
- declare class QtiEqual extends QtiExpression<boolean> {
1232
- toleranceMode: 'exact' | 'relative' | 'absolute';
1233
- getResult(): boolean;
1234
- }
1235
-
1236
- /**
1237
- * @summary The qti-gcd operator calculates the greatest common divisor of integer values.
1238
- * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.gcd
1239
- *
1240
- * Takes 1 or more sub-expressions with base-type integer and any cardinality.
1241
- * Returns a single integer equal to the greatest common divisor of all argument values.
1242
- * Special cases: gcd(0,0)=0, gcd(0,n)=n if n≠0, returns NULL if any argument is NULL or non-numerical.
1243
- */
1244
- declare class QtiGcd extends QtiExpression<number | null> {
1245
- getResult(): number | null;
1246
- /**
1247
- * Calculate the greatest common divisor of an array of integers
1248
- */
1249
- private _calculateGcd;
1250
- /**
1251
- * Calculate GCD of two numbers using Euclidean algorithm
1252
- */
1253
- private _gcdTwoNumbers;
1254
- }
1255
-
1256
- declare class QtiGt extends QtiExpression<boolean> {
1257
- getResult(): boolean;
1258
- }
1259
-
1260
- declare class QtiGte extends QtiConditionExpression {
1261
- getResult(): boolean;
1262
- }
1263
-
1264
- /**
1265
- * @summary The qti-null expression returns the NULL value.
1266
- * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.null
1267
- *
1268
- * A simple expression that returns the NULL value. The null value is treated
1269
- * as if it is of any desired base-type.
1270
- */
1271
- declare class QtiNull extends QtiExpression<null> {
1272
- getResult(): null;
1273
- }
1274
-
1275
- declare class QtiIsNull extends QtiExpression<boolean> {
1276
- getResult(): boolean;
1277
- }
1278
-
1279
- declare class QtiFieldValue extends QtiExpression<string | string[]> {
1280
- getResult(): any;
1281
- }
1282
-
1283
- declare class QtiLt extends QtiExpression<boolean> {
1284
- getResult(): boolean;
1285
- }
1286
-
1287
- declare class QtiLte extends QtiConditionExpression {
1288
- getResult(): boolean;
1289
- }
1290
-
1291
- declare class QtiMapResponse extends QtiExpression<number> {
1292
- identifier: string;
1293
- getResult(): number;
1294
- }
1295
-
1296
- declare class QtiMapResponsePoint extends QtiExpression<number> {
1297
- identifier: string;
1298
- getResult(): number;
1299
- }
1300
-
1301
- /**
1302
- * @summary The qti-math-operator performs mathematical operations on numerical values.
1303
- * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.math-operator
1304
- *
1305
- * Takes 1 or more sub-expressions with single cardinality and numerical base-types.
1306
- * The result is a single float, except for signum, floor and ceil which return integers.
1307
- * Returns NULL if any argument is NULL or falls outside the function's natural domain.
1308
- */
1309
- declare class QtiMathOperator extends QtiExpression<number | null> {
1310
- name: string;
1311
- getResult(): number | null;
1312
- private _performOperation;
1313
- }
1314
-
1315
- declare class QtiMatch extends QtiExpression<boolean> {
1316
- getResult(): boolean;
1317
- static match(valueToMap: ResponseVariable, correctValueInfo: ResponseVariable): boolean;
1318
- }
1319
-
1320
- declare class QtiMember extends QtiExpression<boolean | null> {
1321
- getResult(): boolean;
1322
- }
1323
-
1324
- declare class QtiMultiple extends QtiExpression<VariableDeclaration<string | string[]>[]> {
1325
- getResult(): ResponseVariable[];
1326
- }
1327
-
1328
- declare class QtiNot extends QtiExpression<boolean> {
1329
- render(): lit_html.TemplateResult<1>;
1330
- getResult(): boolean;
1331
- }
1332
-
1333
- declare class QtiOr extends QtiConditionExpression {
1334
- getResult(): boolean;
1335
- }
1336
-
1337
- declare class QtiOrdered extends QtiExpression<ResponseVariable[]> {
1338
- getResult(): ResponseVariable[];
1339
- }
1340
-
1341
- /**
1342
- * @summary The qti-power operator raises the first expression to the power of the second.
1343
- * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.power
1344
- *
1345
- * Takes 2 sub-expressions with single cardinality and numerical base-types.
1346
- * Returns a single float corresponding to the first expression raised to the power of the second.
1347
- * Returns NULL if either expression is NULL or if the result is outside the float value set.
1348
- */
1349
- declare class QtiPower extends QtiExpression<number | null> {
1350
- getResult(): number | null;
1351
- }
1352
-
1353
- declare class QtiPrintedVariable extends LitElement {
1354
- identifier: string;
1355
- protected context?: ItemContext;
1356
- render(): lit_html.TemplateResult<1> | typeof nothing;
1357
- calculate(): VariableDeclaration<string | string[]>;
1358
- }
1359
-
1360
- declare class QtiProduct extends QtiExpression<number> {
1361
- getResult(): number;
1362
- }
1363
-
1364
- type Constructor<T> = new (...args: any[]) => T;
1365
- declare const QtiSubtract_base: {
1366
- new (...args: any[]): {
1367
- calculateChildren(children: Array<MockQtiExpression<any>>): number;
1368
- };
1369
- } & Constructor<QtiExpression<number>>;
1370
- declare class QtiSubtract extends QtiSubtract_base {
1371
- getResult(): number;
1372
- }
1373
- type MockQtiExpression<T> = {
1374
- calculate: () => T;
1375
- };
1376
- type MockConstructor = new (...args: any[]) => {};
1377
- declare function qtiSubtractMixin<TBase extends MockConstructor>(Base: TBase): {
1378
- new (...args: any[]): {
1379
- calculateChildren(children: Array<MockQtiExpression<any>>): number;
1380
- };
1381
- } & TBase;
1382
-
1383
- declare global {
1384
- interface HTMLElementTagNameMap {
1385
- 'qti-subtract': QtiSubtract;
1386
- }
1387
- }
1388
-
1389
- declare class QtiStringMatch extends QtiExpression<boolean> {
1390
- caseSensitive: string;
1391
- getResult(): boolean;
1392
- }
1393
-
1394
- declare class QtiSum extends QtiExpression<number> {
1395
- private _expression;
1396
- constructor();
1397
- getResult(): number;
1398
- }
1399
- declare class QtiSumExpression implements QtiExpressionBase<number> {
1400
- private expressions;
1401
- constructor(expressions: QtiExpressionBase<number>[]);
1402
- calculate(): number;
1403
- }
1404
-
1405
- declare class QtiVariable extends QtiExpression<string | string[]> {
1406
- getResult(): Readonly<string | string[]>;
1407
- }
1408
-
1409
- /**
1410
- * @summary The qti-random-integer operator selects a random integer from a specified range.
1411
- * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.random-integer
1412
- *
1413
- * Selects a random integer from the range [min,max] satisfying min + step * n for some integer n.
1414
- * For example, with min=2, max=11 and step=3 the values {2,5,8,11} are possible.
1415
- */
1416
- declare class QtiRandomInteger extends QtiExpression<number> {
1417
- min: number;
1418
- max: number;
1419
- step: number;
1420
- getResult(): number;
1421
- /**
1422
- * Get all possible values for testing purposes
1423
- */
1424
- getPossibleValues(): number[];
1425
- }
1426
-
1427
- declare class QtiRandom extends QtiExpression<string> {
1428
- getResult(): any;
1429
- }
1430
-
1431
- declare class QtiDelete extends QtiExpression<string[] | null> {
1432
- getResult(): string[] | null;
1433
- }
1434
-
1435
- declare class QtiIndex extends QtiExpression<any> {
1436
- n: string;
1437
- getResult(): any;
1438
- private lookupVariableValue;
1439
- }
1440
-
1441
- declare class QtiContentBody extends LitElement {
1442
- render(): lit_html.TemplateResult<1>;
1443
- }
1444
- declare global {
1445
- interface HTMLElementTagNameMap {
1446
- 'qti-content-body': QtiContentBody;
1447
- }
1448
- }
1449
-
1450
- declare class QtiRubricBlock extends LitElement {
1451
- id: any;
1452
- use: 'instructions' | 'scoring' | 'navigation';
1453
- view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor';
1454
- classNames: any;
1455
- handleclassNamesChange(): void;
1456
- static styles: lit.CSSResult;
1457
- render(): lit_html.TemplateResult<1>;
1458
- }
1459
- declare global {
1460
- interface HTMLElementTagNameMap {
1461
- 'qti-rubric-block': QtiRubricBlock;
1462
- }
1463
- }
1464
-
1465
- declare class QtiStylesheet extends LitElement {
1466
- private styleElement;
1467
- protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
1468
- private minifyCss;
1469
- disconnectedCallback(): void;
1470
- }
1471
- declare global {
1472
- interface HTMLElementTagNameMap {
1473
- 'qti-stylesheet': QtiStylesheet;
1474
- }
1475
- }
1476
-
1477
- declare class QtiVariableDeclaration extends LitElement {
1478
- render(): lit_html.TemplateResult<1>;
1479
- protected defaultValues(cardinality: Cardinality): string | string[];
1480
- }
1481
- declare global {
1482
- interface HTMLElementTagNameMap {
1483
- 'qti-variabledeclaration': QtiVariableDeclaration;
1484
- }
1485
- }
1486
-
1487
- declare class QtiOutcomeDeclaration extends QtiVariableDeclaration {
1488
- baseType: BaseType;
1489
- externalScored: 'human' | 'externalMachine' | null;
1490
- identifier: string;
1491
- cardinality: Cardinality;
1492
- itemContext?: ItemContext;
1493
- static styles: lit.CSSResult[];
1494
- render(): lit_html.TemplateResult<1>;
1495
- get interpolationTable(): Map<number, number> | null;
1496
- connectedCallback(): void;
1497
- }
1498
- declare global {
1499
- interface HTMLElementTagNameMap {
1500
- 'qti-outcome-declaration': QtiOutcomeDeclaration;
1501
- }
1502
- }
1503
-
1504
- declare class QtiResponseDeclaration extends QtiVariableDeclaration {
1505
- baseType: BaseType;
1506
- identifier: string;
1507
- cardinality: Cardinality;
1508
- itemContext?: ItemContext;
1509
- static styles: lit.CSSResult[];
1510
- render(): lit_html.TemplateResult<1>;
1511
- connectedCallback(): void;
1512
- private get correctResponse();
1513
- private get mapping();
1514
- private get areaMapping();
1515
- }
1516
- declare global {
1517
- interface HTMLElementTagNameMap {
1518
- 'qti-response-declaration': QtiResponseDeclaration;
1519
- }
1520
- }
1521
-
1522
- export { type Orientation, QtiAnd, QtiAssessmentItem, QtiAssessmentStimulusRef, QtiAssessmentStimulusRefConnectedEvent, QtiAssociableHotspot, QtiAssociateInteraction, QtiBaseValue, QtiChoiceInteraction, QtiCompanionMaterialsInfo, QtiContainerSize, QtiContains, QtiContentBody, QtiCorrect, QtiCustomInteraction, QtiCustomOperator, QtiDefault, QtiDelete, QtiEndAttemptInteraction, QtiEqual, QtiEqualRounded, QtiExtendedTextInteraction, QtiFeedbackBlock, QtiFeedbackInline, QtiFieldValue, QtiGap, QtiGapImg, QtiGapMatchInteraction, QtiGapText, QtiGcd, QtiGraphicAssociateInteraction, QtiGraphicGapMatchInteraction, QtiGraphicOrderInteraction, QtiGt, QtiGte, QtiHotspotChoice, QtiHotspotInteraction, QtiHottext, QtiHottextInteraction, QtiIndex, QtiInlineChoice, QtiInlineChoiceInteraction, QtiIsNull, QtiItemBody, QtiLookupOutcomeValue, QtiLt, QtiLte, QtiMapResponse, QtiMapResponsePoint, QtiMatch, QtiMatchInteraction, QtiMathOperator, QtiMediaInteraction, QtiMember, QtiMultiple, QtiNot, QtiNull, QtiOr, QtiOrderInteraction, QtiOrdered, QtiOutcomeDeclaration, QtiOutcomeProcessing, QtiOutcomeProcessingProcessor, QtiPortableCustomInteraction, QtiPositionObjectInteraction, QtiPositionObjectStage, QtiPower, QtiPrintedVariable, QtiProduct, QtiPrompt, QtiRandom, QtiRandomInteger, QtiResponseCondition, QtiResponseDeclaration, QtiResponseElse, QtiResponseElseIf, QtiResponseIf, QtiResponseProcessing, QtiRound, QtiRoundTo, QtiRubricBlock, QtiRule, type QtiRuleBase, QtiSelectPointInteraction, QtiSetOutcomeValue, QtiSetOutcomeValueRule, QtiSimpleAssociableChoice, QtiSimpleChoice, QtiSliderInteraction, QtiStringMatch, QtiStylesheet, QtiSubtract, QtiSum, QtiSumExpression, QtiTextEntryInteraction, QtiUploadInteraction, QtiVariable, qtiAndMixin, qtiSubtractMixin };