@citolab/qti-components 7.0.6-beta.0 → 7.0.6-beta.2

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 (198) hide show
  1. package/cdn/{chunk-QGKK4T2J.js → chunks/chunk-3V6LA7B3.js} +1 -1
  2. package/cdn/chunks/chunk-4UJBK6JO.js +1 -0
  3. package/cdn/chunks/chunk-4WXQYE2P.js +8 -0
  4. package/cdn/{chunk-L4TDHAKL.js → chunks/chunk-5BR5CJFH.js} +5 -5
  5. package/cdn/chunks/chunk-5GCSZ3CH.js +73 -0
  6. package/cdn/{chunk-BLKKKK6C.js → chunks/chunk-5P7CTN7Q.js} +1 -1
  7. package/cdn/{chunk-A536ZOJJ.js → chunks/chunk-6S4CDN3T.js} +1 -1
  8. package/cdn/chunks/chunk-7XYBFL7U.js +934 -0
  9. package/cdn/chunks/chunk-DZCKF45D.js +5 -0
  10. package/cdn/chunks/chunk-EHK76KRT.js +1 -0
  11. package/cdn/chunks/chunk-IAP2CEE7.js +1 -0
  12. package/cdn/chunks/chunk-IMJOPCFR.js +1 -0
  13. package/cdn/chunks/chunk-KWPDTFYH.js +1 -0
  14. package/cdn/{chunk-MFWSHIPH.js → chunks/chunk-L4CUWIE6.js} +1 -1
  15. package/cdn/{chunk-4DFVJE2A.js → chunks/chunk-LZZB4VGC.js} +1 -1
  16. package/cdn/{chunk-SQDSHH6N.js → chunks/chunk-MJMONWKB.js} +1 -1
  17. package/cdn/chunks/chunk-N5OHGRGG.js +8 -0
  18. package/cdn/chunks/chunk-NDHSIO2G.js +8 -0
  19. package/cdn/{chunk-ROXN2HIJ.js → chunks/chunk-PKT2SJQD.js} +1 -1
  20. package/cdn/chunks/chunk-QQCGUVEV.js +1 -0
  21. package/cdn/chunks/chunk-QV6I5NVQ.js +8 -0
  22. package/cdn/chunks/chunk-R33OODNX.js +1 -0
  23. package/cdn/chunks/chunk-RXKI3AO4.js +1 -0
  24. package/cdn/chunks/chunk-TQBDBMWL.js +5 -0
  25. package/cdn/chunks/chunk-X2KBNXRO.js +6 -0
  26. package/cdn/chunks/chunk-XUJ7TXHW.js +1 -0
  27. package/cdn/exports/expression-result.js +0 -0
  28. package/cdn/exports/interaction.interface.js +0 -0
  29. package/cdn/exports/interaction.js +1 -0
  30. package/cdn/exports/item.context.js +1 -0
  31. package/cdn/exports/qti-assessment-item.context.js +1 -0
  32. package/cdn/exports/qti-condition-expression.js +1 -0
  33. package/cdn/exports/qti-expression.js +1 -0
  34. package/cdn/exports/variables.js +0 -0
  35. package/cdn/index.global.js +7 -58
  36. package/cdn/index.js +1 -1
  37. package/cdn/qti-components/index.js +1 -1
  38. package/cdn/qti-item/core/index.js +1 -1
  39. package/cdn/qti-loader/index.js +1 -1
  40. package/cdn/qti-test/components/index.js +1 -1
  41. package/cdn/qti-test/components/styles.js +1 -1
  42. package/cdn/qti-test/components/test-component.abstract.js +1 -1
  43. package/cdn/qti-test/components/test-item-link.js +1 -1
  44. package/cdn/qti-test/components/test-next.js +1 -1
  45. package/cdn/qti-test/components/test-paging-buttons-stamp.js +1 -1
  46. package/cdn/qti-test/components/test-prev.js +1 -1
  47. package/cdn/qti-test/components/test-view.js +1 -1
  48. package/cdn/qti-test/core/index.js +1 -1
  49. package/cdn/qti-transformers/index.js +1 -1
  50. package/dist/{chunk-ANLIJZBL.js → chunks/chunk-3EU75IUF.js} +4 -4
  51. package/dist/chunks/chunk-3EU75IUF.js.map +1 -0
  52. package/dist/{chunk-CNQYM52B.js → chunks/chunk-4GNVYCBN.js} +65 -7
  53. package/dist/chunks/chunk-4GNVYCBN.js.map +1 -0
  54. package/dist/{chunk-UB5K44DB.js → chunks/chunk-4O5F7WV7.js} +1 -1
  55. package/dist/chunks/chunk-4O5F7WV7.js.map +1 -0
  56. package/dist/{chunk-OO6JSYLP.js → chunks/chunk-6JXR63MH.js} +4 -4
  57. package/dist/chunks/chunk-6JXR63MH.js.map +1 -0
  58. package/dist/{chunk-4FH7P7YI.js → chunks/chunk-7QMCKYDR.js} +4 -4
  59. package/dist/chunks/chunk-7QMCKYDR.js.map +1 -0
  60. package/dist/{chunk-3TFUBCJW.js → chunks/chunk-A24F75DB.js} +4 -4
  61. package/dist/chunks/chunk-A24F75DB.js.map +1 -0
  62. package/dist/chunks/chunk-BPHQLJWE.js +102 -0
  63. package/dist/chunks/chunk-BPHQLJWE.js.map +1 -0
  64. package/dist/chunks/chunk-D3RGDWKP.js +37 -0
  65. package/dist/chunks/chunk-D3RGDWKP.js.map +1 -0
  66. package/dist/chunks/chunk-DLUJN2FW.js +22 -0
  67. package/dist/chunks/chunk-DLUJN2FW.js.map +1 -0
  68. package/dist/{chunk-4YG2FPKK.js → chunks/chunk-ELDMXTUQ.js} +1 -1
  69. package/dist/chunks/chunk-ELDMXTUQ.js.map +1 -0
  70. package/dist/chunks/chunk-FV7HWK54.js +29 -0
  71. package/dist/chunks/chunk-FV7HWK54.js.map +1 -0
  72. package/dist/{chunk-6SG3NMKU.js → chunks/chunk-GSWZT6N2.js} +4 -4
  73. package/dist/chunks/chunk-GSWZT6N2.js.map +1 -0
  74. package/dist/chunks/chunk-H2JE6IVU.js +15 -0
  75. package/dist/{chunk-QYN5S4EM.js → chunks/chunk-HHVRU3AJ.js} +5 -5
  76. package/dist/chunks/chunk-HHVRU3AJ.js.map +1 -0
  77. package/dist/{chunk-2CHF3TMY.js → chunks/chunk-J2SHENRN.js} +1 -1
  78. package/dist/{chunk-UBZPSVSE.js → chunks/chunk-K6ATVWMP.js} +5131 -5341
  79. package/dist/chunks/chunk-K6ATVWMP.js.map +1 -0
  80. package/dist/chunks/chunk-KOEILLVS.js +8 -0
  81. package/dist/chunks/chunk-KOEILLVS.js.map +1 -0
  82. package/dist/{chunk-F7HTXGGH.js → chunks/chunk-KYAIMBP5.js} +3 -3
  83. package/dist/chunks/chunk-KYAIMBP5.js.map +1 -0
  84. package/dist/{chunk-F3NTI6TX.js → chunks/chunk-UFYWCLXF.js} +1 -1
  85. package/dist/chunks/chunk-UFYWCLXF.js.map +1 -0
  86. package/dist/chunks/chunk-UN2IFSGC.js +1 -0
  87. package/dist/{chunk-2OA7E3E7.js → chunks/chunk-XDMSEAYC.js} +1 -1
  88. package/dist/chunks/chunk-XDMSEAYC.js.map +1 -0
  89. package/dist/chunks/chunk-XSI6FXGD.js +19 -0
  90. package/dist/chunks/chunk-XSI6FXGD.js.map +1 -0
  91. package/dist/chunks/chunk-ZPNJ2HP5.js +71 -0
  92. package/dist/chunks/chunk-ZPNJ2HP5.js.map +1 -0
  93. package/dist/exports/expression-result.d.ts +19 -0
  94. package/dist/exports/expression-result.js +1 -0
  95. package/dist/exports/expression-result.js.map +1 -0
  96. package/dist/exports/interaction.d.ts +23 -0
  97. package/dist/exports/interaction.interface.d.ts +13 -0
  98. package/dist/exports/interaction.interface.js +1 -0
  99. package/dist/exports/interaction.interface.js.map +1 -0
  100. package/dist/exports/interaction.js +8 -0
  101. package/dist/exports/interaction.js.map +1 -0
  102. package/dist/exports/item.context.d.ts +12 -0
  103. package/dist/exports/item.context.js +8 -0
  104. package/dist/exports/item.context.js.map +1 -0
  105. package/dist/exports/qti-assessment-item.context.d.ts +10 -0
  106. package/dist/exports/qti-assessment-item.context.js +8 -0
  107. package/dist/exports/qti-assessment-item.context.js.map +1 -0
  108. package/dist/exports/qti-condition-expression.d.ts +13 -0
  109. package/dist/exports/qti-condition-expression.js +10 -0
  110. package/dist/exports/qti-condition-expression.js.map +1 -0
  111. package/dist/exports/qti-expression.d.ts +21 -0
  112. package/dist/exports/qti-expression.js +9 -0
  113. package/dist/exports/qti-expression.js.map +1 -0
  114. package/dist/exports/variables.d.ts +3 -0
  115. package/dist/exports/variables.js +1 -0
  116. package/dist/exports/variables.js.map +1 -0
  117. package/dist/index.d.ts +12 -3
  118. package/dist/index.js +35 -28
  119. package/dist/qti-components/index.d.ts +36 -9
  120. package/dist/qti-components/index.js +10 -16
  121. package/dist/qti-components-jsx.d.ts +328 -623
  122. package/dist/qti-item/core/index.js +5 -5
  123. package/dist/qti-loader/index.d.ts +7 -1
  124. package/dist/qti-loader/index.js +5 -23
  125. package/dist/qti-loader/index.js.map +1 -1
  126. package/dist/{qti-simple-choice-DxWcdKHi.d.ts → qti-response-declaration-DAeBp8HH.d.ts} +463 -613
  127. package/dist/qti-test/components/index.d.ts +8 -2
  128. package/dist/qti-test/components/index.js +12 -11
  129. package/dist/qti-test/components/styles.js +2 -2
  130. package/dist/qti-test/components/test-component.abstract.d.ts +8 -2
  131. package/dist/qti-test/components/test-component.abstract.js +5 -4
  132. package/dist/qti-test/components/test-item-link.d.ts +8 -2
  133. package/dist/qti-test/components/test-item-link.js +7 -6
  134. package/dist/qti-test/components/test-next.d.ts +8 -2
  135. package/dist/qti-test/components/test-next.js +7 -6
  136. package/dist/qti-test/components/test-paging-buttons-stamp.d.ts +8 -2
  137. package/dist/qti-test/components/test-paging-buttons-stamp.js +6 -5
  138. package/dist/qti-test/components/test-prev.d.ts +8 -2
  139. package/dist/qti-test/components/test-prev.js +7 -6
  140. package/dist/qti-test/components/test-view.d.ts +8 -2
  141. package/dist/qti-test/components/test-view.js +6 -5
  142. package/dist/qti-test/core/index.d.ts +15 -4
  143. package/dist/qti-test/core/index.js +6 -6
  144. package/dist/qti-transformers/index.js +2 -2
  145. package/dist/{test.context-DbSTxKk_.d.ts → test.context-CaENAJNk.d.ts} +4 -2
  146. package/dist/variables-cO3DzqJy.d.ts +33 -0
  147. package/dist/vscode.html-custom-data.json +208 -275
  148. package/package.json +14 -20
  149. package/cdn/chunk-4I75QSIL.js +0 -8
  150. package/cdn/chunk-5WCOPF7O.js +0 -73
  151. package/cdn/chunk-DC2R556M.js +0 -5
  152. package/cdn/chunk-GALSGMIP.js +0 -5
  153. package/cdn/chunk-KYOTSBCX.js +0 -1
  154. package/cdn/chunk-T4A5AZCI.js +0 -939
  155. package/cdn/chunk-VI2WKTN4.js +0 -1
  156. package/cdn/qti-components/index.global.js +0 -226
  157. package/cdn/qti-item/core/index.global.js +0 -149
  158. package/cdn/qti-loader/index.global.js +0 -1
  159. package/cdn/qti-test/components/index.global.js +0 -207
  160. package/cdn/qti-test/components/styles.global.js +0 -44
  161. package/cdn/qti-test/components/test-component.abstract.global.js +0 -170
  162. package/cdn/qti-test/components/test-item-link.global.js +0 -170
  163. package/cdn/qti-test/components/test-next.global.js +0 -170
  164. package/cdn/qti-test/components/test-next.spec.css +0 -1
  165. package/cdn/qti-test/components/test-next.spec.global.js +0 -64
  166. package/cdn/qti-test/components/test-next.spec.js +0 -713
  167. package/cdn/qti-test/components/test-paging-buttons-stamp.global.js +0 -207
  168. package/cdn/qti-test/components/test-prev.global.js +0 -170
  169. package/cdn/qti-test/components/test-view.global.js +0 -170
  170. package/cdn/qti-test/core/index.global.js +0 -205
  171. package/cdn/qti-transformers/index.global.js +0 -1
  172. package/dist/chunk-2OA7E3E7.js.map +0 -1
  173. package/dist/chunk-3TFUBCJW.js.map +0 -1
  174. package/dist/chunk-44VE5POH.js +0 -55
  175. package/dist/chunk-4FH7P7YI.js.map +0 -1
  176. package/dist/chunk-4YG2FPKK.js.map +0 -1
  177. package/dist/chunk-6SG3NMKU.js.map +0 -1
  178. package/dist/chunk-ANLIJZBL.js.map +0 -1
  179. package/dist/chunk-CNQYM52B.js.map +0 -1
  180. package/dist/chunk-F3NTI6TX.js.map +0 -1
  181. package/dist/chunk-F7HTXGGH.js.map +0 -1
  182. package/dist/chunk-MAC76UNI.js +0 -1
  183. package/dist/chunk-OO6JSYLP.js.map +0 -1
  184. package/dist/chunk-QYN5S4EM.js.map +0 -1
  185. package/dist/chunk-UB5K44DB.js.map +0 -1
  186. package/dist/chunk-UBZPSVSE.js.map +0 -1
  187. package/dist/qti-test/components/test-next.spec.css +0 -2481
  188. package/dist/qti-test/components/test-next.spec.css.map +0 -1
  189. package/dist/qti-test/components/test-next.spec.d.ts +0 -13
  190. package/dist/qti-test/components/test-next.spec.js +0 -45904
  191. package/dist/qti-test/components/test-next.spec.js.map +0 -1
  192. /package/cdn/{chunk-22HAPLRD.js → chunks/chunk-3GO57DNP.js} +0 -0
  193. /package/cdn/{chunk-LVW3MHTI.js → chunks/chunk-5FCXUJAG.js} +0 -0
  194. /package/cdn/{chunk-IXSX4SJX.js → chunks/chunk-6MCYE7P5.js} +0 -0
  195. /package/cdn/{chunk-M6AATWPS.js → chunks/chunk-FRS2J3OS.js} +0 -0
  196. /package/dist/{chunk-44VE5POH.js.map → chunks/chunk-H2JE6IVU.js.map} +0 -0
  197. /package/dist/{chunk-2CHF3TMY.js.map → chunks/chunk-J2SHENRN.js.map} +0 -0
  198. /package/dist/{chunk-MAC76UNI.js.map → chunks/chunk-UN2IFSGC.js.map} +0 -0
@@ -1,77 +1,13 @@
1
1
  import * as lit_html from 'lit-html';
2
2
  import * as lit from 'lit';
3
- import { LitElement, CSSResultGroup, PropertyValueMap } from 'lit';
3
+ import { LitElement, PropertyValueMap, CSSResultGroup } from 'lit';
4
+ import { ResponseInteraction, Calculate, BaseType, Cardinality } from './exports/expression-result.js';
5
+ import { a as VariableValue, R as ResponseVariable, O as OutcomeVariable, V as VariableDeclaration } from './variables-cO3DzqJy.js';
6
+ import { IInteraction } from './exports/interaction.interface.js';
7
+ import { Interaction } from './exports/interaction.js';
4
8
  import * as lit_html_directives_ref_js from 'lit-html/directives/ref.js';
5
-
6
- interface directedPair {
7
- destination: string;
8
- source: string;
9
- }
10
- interface ResponseInteraction {
11
- responseIdentifier: string;
12
- response: string | string[];
13
- }
14
- interface Calculate {
15
- calculate: () => string | string[];
16
- }
17
- type float = number;
18
- type integer = number;
19
- type BaseType = 'boolean' | 'directedPair' | 'duration' | 'float' | 'integer' | 'string' | 'identifier' | 'pair';
20
- type Multiple = string | string[][];
21
- type Ordered = string | string[][];
22
- type Cardinality = 'multiple' | 'ordered' | 'single';
23
-
24
- interface OutcomeChangedDetails {
25
- item: string;
26
- outcomeIdentifier: string;
27
- value: Readonly<string | string[]>;
28
- }
29
- type InteractionChangedDetails = ResponseInteraction & {
30
- item: string;
31
- };
32
-
33
- type QtiInteractionChanged = CustomEvent<InteractionChangedDetails>;
34
- declare global {
35
- interface GlobalEventHandlersEventMap {
36
- 'qti-interaction-changed': QtiInteractionChanged;
37
- }
38
- }
39
-
40
- type QtiOutcomeChanged = CustomEvent<OutcomeChangedDetails>;
41
- declare global {
42
- interface GlobalEventHandlersEventMap {
43
- 'qti-outcome-changed': QtiOutcomeChanged;
44
- }
45
- }
46
-
47
- declare class QtiMapping extends LitElement {
48
- defaultValue: number;
49
- lowerBound: number;
50
- upperBound: number;
51
- get mapEntries(): {
52
- mapKey: string;
53
- mappedValue: number;
54
- }[];
55
- }
56
-
57
- interface VariableValue<T> {
58
- identifier: string;
59
- value: Readonly<T>;
60
- type: 'outcome' | 'response';
61
- }
62
- interface VariableDeclaration<T> extends VariableValue<T> {
63
- cardinality?: Cardinality;
64
- baseType?: BaseType;
65
- }
66
- interface OutcomeVariable extends VariableDeclaration<string | string[] | null> {
67
- interpolationTable?: Map<number, number>;
68
- externalScored?: 'human' | 'externalMachine' | null;
69
- }
70
- interface ResponseVariable extends VariableDeclaration<string | string[] | null> {
71
- candidateResponse?: string | string[] | null;
72
- mapping?: QtiMapping;
73
- correctResponse?: string | string[] | null;
74
- }
9
+ import { QtiExpression } from './exports/qti-expression.js';
10
+ import { ItemContext } from './exports/item.context.js';
75
11
 
76
12
  /**
77
13
  * @summary The qti-assessment-item element contains all the other QTI 3 item structures.
@@ -157,125 +93,6 @@ declare global {
157
93
  }
158
94
  }
159
95
 
160
- type Constructor$2<T = {}> = abstract new (...args: any[]) => T;
161
- interface ChoiceInterface {
162
- identifier: string;
163
- disabled: boolean;
164
- readonly: boolean;
165
- }
166
- /**
167
- * A mixin that adds choice functionality to a LitElement-based class.
168
- * It dispatches events with a custom `type` and handles selection logic.
169
- *
170
- * @param Base - The base class to extend.
171
- * @param type - The type of the choice, used in event names.
172
- * @returns A new class extending the base class with choice functionality.
173
- */
174
- interface ActiveElementMixinInterface {
175
- identifier: string;
176
- tabIndex: number;
177
- disabled: boolean;
178
- readonly: boolean;
179
- internals: ElementInternals;
180
- }
181
- declare function ActiveElementMixin<T extends Constructor$2<LitElement>>(Base: T, type: string): Constructor$2<ActiveElementMixinInterface> & T;
182
-
183
- /**
184
- * @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.
185
- * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.sphpo6lu6zqi
186
- * @status stable
187
- * @since 4.0
188
- *
189
- * @slot - item body content.
190
- * @slot qti-rubric-block - the qti rubric block is placed above the item
191
- *
192
- */
193
- declare class QtiItemBody extends LitElement {
194
- static styles: CSSResultGroup;
195
- render(): lit_html.TemplateResult<1>;
196
- }
197
- declare global {
198
- interface HTMLElementTagNameMap {
199
- 'qti-item-body': QtiItemBody;
200
- }
201
- }
202
-
203
- declare class QtiPrompt extends LitElement {
204
- render(): lit_html.TemplateResult<1>;
205
- connectedCallback(): void;
206
- }
207
- declare global {
208
- interface HTMLElementTagNameMap {
209
- 'qti-prompt': QtiPrompt;
210
- }
211
- }
212
-
213
- declare class QtiStylesheet extends LitElement {
214
- private styleElement;
215
- protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
216
- private minifyCss;
217
- disconnectedCallback(): void;
218
- }
219
- declare global {
220
- interface HTMLElementTagNameMap {
221
- 'qti-stylesheet': QtiStylesheet;
222
- }
223
- }
224
-
225
- interface ItemContext {
226
- href?: string;
227
- identifier: string;
228
- variables: ReadonlyArray<VariableDeclaration<string | string[]>>;
229
- }
230
- declare const itemContextVariables: VariableDeclaration<string | string[]>[];
231
- declare const itemContext: {
232
- __context__: ItemContext;
233
- };
234
-
235
- declare class QtiVariableDeclaration extends LitElement {
236
- render(): lit_html.TemplateResult<1>;
237
- protected defaultValues(variable: VariableDeclaration<string | string[] | null>): string | string[];
238
- }
239
- declare global {
240
- interface HTMLElementTagNameMap {
241
- 'qti-variabledeclaration': QtiVariableDeclaration;
242
- }
243
- }
244
-
245
- declare class QtiOutcomeDeclaration extends QtiVariableDeclaration {
246
- baseType: BaseType;
247
- externalScored: 'human' | 'externalMachine' | null;
248
- identifier: string;
249
- cardinality: Cardinality;
250
- itemContext?: ItemContext;
251
- static styles: lit.CSSResult[];
252
- render(): lit_html.TemplateResult<1>;
253
- get interpolationTable(): Map<number, number> | null;
254
- connectedCallback(): void;
255
- }
256
- declare global {
257
- interface HTMLElementTagNameMap {
258
- 'qti-outcome-declaration': QtiOutcomeDeclaration;
259
- }
260
- }
261
-
262
- declare class QtiResponseDeclaration extends QtiVariableDeclaration {
263
- baseType: BaseType;
264
- identifier: string;
265
- cardinality: Cardinality;
266
- itemContext?: ItemContext;
267
- static styles: lit.CSSResult[];
268
- render(): lit_html.TemplateResult<1>;
269
- connectedCallback(): void;
270
- private get correctResponse();
271
- private get mapping();
272
- }
273
- declare global {
274
- interface HTMLElementTagNameMap {
275
- 'qti-response-declaration': QtiResponseDeclaration;
276
- }
277
- }
278
-
279
96
  declare class QtiCompanionMaterialsInfo extends LitElement {
280
97
  }
281
98
  declare global {
@@ -284,28 +101,27 @@ declare global {
284
101
  }
285
102
  }
286
103
 
287
- declare class QtiContentBody extends LitElement {
288
- render(): lit_html.TemplateResult<1>;
289
- }
290
- declare global {
291
- interface HTMLElementTagNameMap {
292
- 'qti-content-body': QtiContentBody;
293
- }
294
- }
295
-
296
- declare class QtiRubricBlock extends LitElement {
297
- id: any;
298
- use: 'instructions' | 'scoring' | 'navigation';
299
- view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor';
300
- classNames: any;
301
- handleclassNamesChange(): void;
302
- static styles: lit.CSSResult;
104
+ /**
105
+ * https://www.imsglobal.org/spec/qti/v3p0/impl#h.fi29q8dubjgw
106
+ * <qti-custom-operator class="js.org">
107
+ <qti-base-value base-type="string"><![CDATA[
108
+ console.log(context.variables);
109
+ return 'B'
110
+ document.querySelector('qti-end-attempt-interaction').disabled = true;
111
+ ]]></qti-base-value>
112
+ </qti-custom-operator>
113
+ </qti-set-outcome-value>
114
+ */
115
+ declare class QtiCustomOperator extends LitElement implements Calculate {
116
+ private operatorFunction;
117
+ private _context?;
303
118
  render(): lit_html.TemplateResult<1>;
304
- connectedCallback(): void;
119
+ handleSlotChange(): void;
120
+ calculate(): any;
305
121
  }
306
122
  declare global {
307
123
  interface HTMLElementTagNameMap {
308
- 'qti-rubric-block': QtiRubricBlock;
124
+ 'qti-custom-operator': QtiCustomOperator;
309
125
  }
310
126
  }
311
127
 
@@ -355,86 +171,54 @@ declare global {
355
171
  }
356
172
  }
357
173
 
358
- interface IInteraction {
359
- correctResponse: Readonly<string | string[]>;
360
- value: string | string[];
361
- responseIdentifier: string;
362
- disabled: boolean;
363
- readonly: boolean;
364
- validate(): boolean;
365
- reportValidity(): boolean;
366
- reset(): void;
367
- saveResponse(value: string | string[]): void;
368
- }
369
-
370
- declare abstract class Interaction extends LitElement implements IInteraction {
371
- static formAssociated: boolean;
372
- responseIdentifier: any;
373
- disabled: boolean;
374
- readonly: boolean;
375
- protected _correctResponse: string | string[];
376
- protected _internals: ElementInternals;
377
- constructor();
378
- abstract validate(): boolean;
379
- reportValidity(): boolean;
380
- reset(): void;
381
- abstract get value(): string | string[];
382
- abstract set value(val: string | string[]);
383
- get correctResponse(): string | string[];
384
- set correctResponse(value: string | string[]);
174
+ declare class QtiAssociableHotspot extends LitElement {
175
+ static styles: lit.CSSResult;
385
176
  connectedCallback(): void;
386
- saveResponse(value: string | string[]): void;
387
- }
388
-
389
- declare class QtiExtendedTextInteraction extends Interaction {
390
- static styles: CSSResultGroup;
391
- protected _rows: number;
392
- /** expected length is mapped to the property maxlength on the textarea */
393
- expectedLength: number;
394
- patternMask: string;
395
- /** text appearing in the extended-text-nteraction if it is empty */
396
- placeholderText: string;
397
- dataPatternmaskMessage: string;
398
- protected _value: string;
399
- classNames: any;
400
- handleclassNamesChange(_: any, classes: string): void;
401
- get value(): string | string[];
402
- set value(val: string | string[]);
403
- validate(): boolean;
404
- reportValidity(): boolean;
405
177
  render(): lit_html.TemplateResult<1>;
406
- protected textChanged(event: Event): void;
407
- protected setEmptyAttribute(text: string): void;
408
178
  }
409
179
  declare global {
410
180
  interface HTMLElementTagNameMap {
411
- 'qti-extended-text-interaction': QtiExtendedTextInteraction;
181
+ 'qti-associable-hotspot': QtiAssociableHotspot;
412
182
  }
413
183
  }
414
184
 
415
- declare class QtiTextEntryInteraction extends Interaction {
185
+ declare const QtiAssociateInteraction_base: (abstract new (...args: any[]) => IInteraction) & typeof Interaction;
186
+ declare class QtiAssociateInteraction extends QtiAssociateInteraction_base {
416
187
  static styles: CSSResultGroup;
417
- expectedLength: number;
418
- patternMask: string;
419
- placeholderText: string;
420
- dataPatternmaskMessage: string;
421
- private _value;
422
- inputRef: lit_html_directives_ref_js.Ref<HTMLInputElement>;
423
- get value(): string | string[];
424
- set value(val: string | string[]);
425
- validate(): boolean;
188
+ protected _childrenMap: Element[];
189
+ protected _registerChoiceHandler: (event: CustomEvent) => void;
190
+ constructor();
191
+ protected _registerChoice(event: CustomEvent): void;
426
192
  render(): lit_html.TemplateResult<1>;
427
- protected textChanged(event: Event): void;
428
- reportValidity(): boolean;
429
- reset(): void;
430
- private setEmptyAttribute;
193
+ disconnectedCallback(): void;
431
194
  }
432
195
  declare global {
433
196
  interface HTMLElementTagNameMap {
434
- 'qti-text-entry-interaction': QtiTextEntryInteraction;
197
+ 'qti-associate-interaction': QtiAssociateInteraction;
435
198
  }
436
199
  }
437
200
 
201
+ interface ChoiceInterface {
202
+ identifier: string;
203
+ disabled: boolean;
204
+ readonly: boolean;
205
+ }
206
+ /**
207
+ * A mixin that adds choice functionality to a LitElement-based class.
208
+ * It dispatches events with a custom `type` and handles selection logic.
209
+ *
210
+ * @param Base - The base class to extend.
211
+ * @param type - The type of the choice, used in event names.
212
+ * @returns A new class extending the base class with choice functionality.
213
+ */
214
+ interface ActiveElementMixinInterface {
215
+ identifier: string;
216
+ tabIndex: number;
217
+ disabled: boolean;
218
+ readonly: boolean;
219
+ internals: ElementInternals;
220
+ }
221
+
438
222
  type Choice = HTMLElement & ChoiceInterface & {
439
223
  internals: ElementInternals;
440
224
  };
@@ -442,43 +226,6 @@ interface ChoicesInterface extends IInteraction {
442
226
  correctResponse: string | string[];
443
227
  }
444
228
 
445
- declare const QtiHottextInteraction_base: (abstract new (...args: any[]) => ChoicesInterface) & typeof Interaction;
446
- declare class QtiHottextInteraction extends QtiHottextInteraction_base {
447
- render: () => lit_html.TemplateResult<1>;
448
- }
449
- declare global {
450
- interface HTMLElementTagNameMap {
451
- 'qti-hottext-interaction': QtiHottextInteraction;
452
- }
453
- }
454
-
455
- interface OptionType {
456
- textContent: string;
457
- value: string;
458
- selected: boolean;
459
- }
460
- declare class QtiInlineChoiceInteraction extends Interaction {
461
- static get styles(): lit.CSSResult[];
462
- static inputWidthClass: string[];
463
- protected options: OptionType[];
464
- protected correctOption: string;
465
- dataPrompt: string;
466
- render(): lit_html.TemplateResult<1>;
467
- connectedCallback(): void;
468
- disconnectedCallback(): void;
469
- validate(): boolean;
470
- reset(): void;
471
- set value(value: string);
472
- get value(): string;
473
- set correctResponse(value: string | string[]);
474
- protected choiceSelected(event: Event): void;
475
- }
476
- declare global {
477
- interface HTMLElementTagNameMap {
478
- 'qti-inline-choice-interaction': QtiInlineChoiceInteraction;
479
- }
480
- }
481
-
482
229
  type Orientation = 'horizontal' | 'vertical' | undefined;
483
230
  declare const QtiChoiceInteraction_base: (abstract new (...args: any[]) => {}) & (abstract new (...args: any[]) => {}) & (abstract new (...args: any[]) => ChoicesInterface) & typeof Interaction;
484
231
  /**
@@ -510,248 +257,6 @@ declare global {
510
257
  }
511
258
  }
512
259
 
513
- declare class QtiUploadInteraction extends Interaction {
514
- private _file;
515
- private _base64;
516
- reset(): void;
517
- validate(): boolean;
518
- get value(): string | string[] | null;
519
- set value(base64: string | null);
520
- static get properties(): {
521
- [x: string]: lit.PropertyDeclaration<unknown, unknown>;
522
- };
523
- static styles: lit.CSSResult[];
524
- render(): lit_html.TemplateResult<1>;
525
- private _onFileChange;
526
- private _convertToBase64;
527
- }
528
- declare global {
529
- interface HTMLElementTagNameMap {
530
- 'qti-upload-interaction': QtiUploadInteraction;
531
- }
532
- }
533
-
534
- declare class QtiOutcomeProcessing extends LitElement {
535
- static styles: lit.CSSResult[];
536
- render(): lit_html.TemplateResult<1>;
537
- process(): void;
538
- }
539
- declare global {
540
- interface HTMLElementTagNameMap {
541
- 'qti-outcome-processing': QtiOutcomeProcessing;
542
- }
543
- }
544
- declare class QtiOutcomeProcessingProcessor {
545
- process(rules: QtiRuleBase[]): void;
546
- }
547
-
548
- declare class QtiResponseProcessing extends LitElement {
549
- static styles: lit.CSSResult[];
550
- render(): lit_html.TemplateResult<1>;
551
- process(): void;
552
- firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
553
- private fragmentFromString;
554
- }
555
- declare global {
556
- interface HTMLElementTagNameMap {
557
- 'qti-response-processing': QtiResponseProcessing;
558
- }
559
- }
560
-
561
- interface QtiExpressionBase<T> {
562
- calculate(): Readonly<T>;
563
- }
564
- declare abstract class QtiExpression<T> extends LitElement implements QtiExpressionBase<T> {
565
- protected result: any;
566
- static styles: lit.CSSResult;
567
- render(): lit_html.TemplateResult<1>;
568
- calculate(): Readonly<T>;
569
- protected getResult(): Readonly<T>;
570
- protected context?: ItemContext;
571
- getVariables: () => VariableDeclaration<number | string | (number | string)[] | null>[];
572
- }
573
-
574
- declare class QtiRule extends LitElement implements QtiRuleBase {
575
- render(): lit_html.TemplateResult<1>;
576
- process(): void;
577
- }
578
- interface QtiRuleBase {
579
- process(): any;
580
- }
581
- declare global {
582
- interface HTMLElementTagNameMap {
583
- 'qti-rule': QtiRule;
584
- }
585
- }
586
-
587
- /**
588
- * The lookupOutcomeValue rule sets the value of an outcome variable to the value obtained
589
- * by looking up the value of the associated expression in the lookupTable associated
590
- * with the outcome's declaration.
591
- */
592
- declare class QtiLookupOutcomeValue extends QtiRule {
593
- identifier: string;
594
- get childExpression(): QtiExpression<string>;
595
- process(): number;
596
- }
597
- declare global {
598
- interface HTMLElementTagNameMap {
599
- 'qti-lookup-outcome-value': QtiLookupOutcomeValue;
600
- }
601
- }
602
-
603
- declare abstract class QtiConditionExpression extends QtiExpression<boolean> {
604
- calculate(): Readonly<boolean>;
605
- getResult(): Readonly<boolean>;
606
- }
607
-
608
- type Constructor$1<T> = new (...args: any[]) => T;
609
- declare const QtiAnd_base: {
610
- new (...args: any[]): {
611
- calculateChildren(children: Array<MockQtiExpression$1<any>>): boolean;
612
- };
613
- } & Constructor$1<QtiConditionExpression>;
614
- declare class QtiAnd extends QtiAnd_base {
615
- calculate(): boolean;
616
- }
617
- type MockQtiExpression$1<T> = {
618
- calculate: () => T;
619
- };
620
- type MockConstructor$1 = new (...args: any[]) => {};
621
- declare function qtiAndMixin<TBase extends MockConstructor$1>(Base: TBase): {
622
- new (...args: any[]): {
623
- calculateChildren(children: Array<MockQtiExpression$1<any>>): boolean;
624
- };
625
- } & TBase;
626
-
627
- declare global {
628
- interface HTMLElementTagNameMap {
629
- 'qti-and': QtiAnd;
630
- }
631
- }
632
-
633
- type Constructor<T> = new (...args: any[]) => T;
634
- declare const QtiSubtract_base: {
635
- new (...args: any[]): {
636
- calculateChildren(children: Array<MockQtiExpression<any>>): number;
637
- };
638
- } & Constructor<QtiExpression<number>>;
639
- declare class QtiSubtract extends QtiSubtract_base {
640
- getResult(): number;
641
- }
642
- type MockQtiExpression<T> = {
643
- calculate: () => T;
644
- };
645
- type MockConstructor = new (...args: any[]) => {};
646
- declare function qtiSubtractMixin<TBase extends MockConstructor>(Base: TBase): {
647
- new (...args: any[]): {
648
- calculateChildren(children: Array<MockQtiExpression<any>>): number;
649
- };
650
- } & TBase;
651
-
652
- declare global {
653
- interface HTMLElementTagNameMap {
654
- 'qti-subtract': QtiSubtract;
655
- }
656
- }
657
-
658
- interface IMSpci<ConfigProperties> {
659
- typeIdentifier: string;
660
- /** @access public
661
- * @method getInstance Create a new instance of this portable custom interaction
662
- * Will be called by the qtiCustomInteractionContext
663
- * @param {DOM Element} dom - the DOM Element this PCI is being added to
664
- * @param {Object} configuration - the configuration to apply to this PCI
665
- * @param {String} state - a previous saved state to apply to this instance.
666
- * This must have been obtained from a prior call to getState on an
667
- * instance of this type (same typeIdentifier)
668
- */
669
- getInstance: (dom: HTMLElement, configuration: Configuration<ConfigProperties>, state: string) => void;
670
- /** @access public
671
- * @method getResponse
672
- * @return {Object} - the value to assign to the bound QTI response variable
673
- */
674
- getResponse: () => QtiVariableJSON;
675
- /** @access public
676
- * @method getState
677
- * @return {String} The current state of this PCI. May be passed to
678
- * getInstance to later restore this PCI instance.
679
- */
680
- getState: () => string;
681
- oncompleted?: () => void;
682
- destroy?: () => void;
683
- }
684
- declare type Configuration<T> = {
685
- onready: (pci: IMSpci<T>, state?: string) => void;
686
- properties: T;
687
- };
688
- declare type QtiVariableJSON = {
689
- [K in 'list' | 'base']?: {
690
- [Ka in 'boolean' | 'integer' | 'float' | 'string' | 'pair' | 'directedPair' | 'identifier']?: ResponseType;
691
- };
692
- };
693
- interface ModuleResolutionConfig {
694
- waitSeconds?: number;
695
- context?: string;
696
- catchError?: boolean;
697
- paths: {
698
- [key: string]: string | string[];
699
- };
700
- shim?: {
701
- [key: string]: {
702
- deps?: string[];
703
- exports?: string;
704
- };
705
- };
706
- }
707
-
708
- declare class QtiPortableCustomInteraction extends Interaction {
709
- private intervalId;
710
- private rawResponse;
711
- private pci;
712
- module: string;
713
- customInteractionTypeIdentifier: string;
714
- private _errorMessage;
715
- private convertQtiVariableJSON;
716
- private startChecking;
717
- private stopChecking;
718
- validate(): boolean;
719
- set value(_: string | string[]);
720
- get value(): string | string[];
721
- getTAOConfig(node: any): {};
722
- register(pci: IMSpci<unknown>): void;
723
- connectedCallback(): void;
724
- disconnectedCallback(): void;
725
- buildRequireConfig(): ModuleResolutionConfig;
726
- private combineRequireResolvePaths;
727
- private removeDoubleSlashes;
728
- loadConfig: (url: string, baseUrl?: string) => Promise<ModuleResolutionConfig>;
729
- getResolvablePathString: (path: string, basePath?: string) => string;
730
- getResolvablePath: (path: string | string[], basePath?: string) => string | string[];
731
- render(): lit_html.TemplateResult<1>;
732
- }
733
- declare global {
734
- interface HTMLElementTagNameMap {
735
- 'qti-portable-custom-interaction': QtiPortableCustomInteraction;
736
- }
737
- }
738
-
739
- declare const QtiAssociateInteraction_base: (abstract new (...args: any[]) => IInteraction) & typeof Interaction;
740
- declare class QtiAssociateInteraction extends QtiAssociateInteraction_base {
741
- static styles: CSSResultGroup;
742
- protected _childrenMap: Element[];
743
- protected _registerChoiceHandler: (event: CustomEvent) => void;
744
- constructor();
745
- protected _registerChoice(event: CustomEvent): void;
746
- render(): lit_html.TemplateResult<1>;
747
- disconnectedCallback(): void;
748
- }
749
- declare global {
750
- interface HTMLElementTagNameMap {
751
- 'qti-associate-interaction': QtiAssociateInteraction;
752
- }
753
- }
754
-
755
260
  declare class QtiCustomInteraction extends Interaction {
756
261
  private rawResponse;
757
262
  constructor();
@@ -798,6 +303,43 @@ declare global {
798
303
  }
799
304
  }
800
305
 
306
+ declare class QtiExtendedTextInteraction extends Interaction {
307
+ static styles: CSSResultGroup;
308
+ protected _rows: number;
309
+ /** expected length is mapped to the property maxlength on the textarea */
310
+ expectedLength: number;
311
+ patternMask: string;
312
+ /** text appearing in the extended-text-nteraction if it is empty */
313
+ placeholderText: string;
314
+ dataPatternmaskMessage: string;
315
+ protected _value: string;
316
+ classNames: any;
317
+ handleclassNamesChange(_: any, classes: string): void;
318
+ get value(): string | string[] | null;
319
+ set value(val: string | string[] | null);
320
+ validate(): boolean;
321
+ reportValidity(): boolean;
322
+ render(): lit_html.TemplateResult<1>;
323
+ protected textChanged(event: Event): void;
324
+ protected setEmptyAttribute(text: string): void;
325
+ }
326
+ declare global {
327
+ interface HTMLElementTagNameMap {
328
+ 'qti-extended-text-interaction': QtiExtendedTextInteraction;
329
+ }
330
+ }
331
+
332
+ declare class QtiGapImg extends LitElement {
333
+ static styles: lit.CSSResult;
334
+ tabindex: number | undefined;
335
+ connectedCallback(): void;
336
+ }
337
+ declare global {
338
+ interface HTMLElementTagNameMap {
339
+ 'qti-gap-img': QtiGapImg;
340
+ }
341
+ }
342
+
801
343
  declare const QtiGapMatchInteraction_base: (abstract new (...args: any[]) => IInteraction) & typeof Interaction;
802
344
  declare class QtiGapMatchInteraction extends QtiGapMatchInteraction_base {
803
345
  static styles: CSSResultGroup;
@@ -810,6 +352,30 @@ declare global {
810
352
  }
811
353
  }
812
354
 
355
+ declare const QtiGapText_base: (abstract new (...args: any[]) => ActiveElementMixinInterface) & typeof LitElement;
356
+ declare class QtiGapText extends QtiGapText_base {
357
+ static styles: lit.CSSResult;
358
+ tabindex: number | undefined;
359
+ connectedCallback(): void;
360
+ render(): lit_html.TemplateResult<1>;
361
+ }
362
+ declare global {
363
+ interface HTMLElementTagNameMap {
364
+ 'qti-gap-text': QtiGapText;
365
+ }
366
+ }
367
+
368
+ declare class QtiGap extends LitElement {
369
+ static styles: lit.CSSResult;
370
+ tabindex: number | undefined;
371
+ render(): lit_html.TemplateResult<1>;
372
+ }
373
+ declare global {
374
+ interface HTMLElementTagNameMap {
375
+ 'qti-gap': QtiGap;
376
+ }
377
+ }
378
+
813
379
  declare class QtiGraphicAssociateInteraction extends Interaction {
814
380
  static styles: CSSResultGroup;
815
381
  private hotspots;
@@ -866,6 +432,17 @@ declare global {
866
432
  }
867
433
  }
868
434
 
435
+ declare const QtiHotspotChoice_base: (abstract new (...args: any[]) => ActiveElementMixinInterface) & typeof LitElement;
436
+ declare class QtiHotspotChoice extends QtiHotspotChoice_base {
437
+ static styles: lit.CSSResult;
438
+ order: number;
439
+ }
440
+ declare global {
441
+ interface HTMLElementTagNameMap {
442
+ 'qti-hotspot-choice': QtiHotspotChoice;
443
+ }
444
+ }
445
+
869
446
  declare const QtiHotspotInteraction_base: (abstract new (...args: any[]) => ChoicesInterface) & typeof Interaction;
870
447
  declare class QtiHotspotInteraction extends QtiHotspotInteraction_base {
871
448
  static styles: CSSResultGroup;
@@ -880,6 +457,68 @@ declare global {
880
457
  }
881
458
  }
882
459
 
460
+ declare const QtiHottextInteraction_base: (abstract new (...args: any[]) => ChoicesInterface) & typeof Interaction;
461
+ declare class QtiHottextInteraction extends QtiHottextInteraction_base {
462
+ render: () => lit_html.TemplateResult<1>;
463
+ }
464
+ declare global {
465
+ interface HTMLElementTagNameMap {
466
+ 'qti-hottext-interaction': QtiHottextInteraction;
467
+ }
468
+ }
469
+
470
+ declare const QtiHottext_base: (abstract new (...args: any[]) => ActiveElementMixinInterface) & typeof LitElement;
471
+ declare class QtiHottext extends QtiHottext_base {
472
+ static styles: lit.CSSResult;
473
+ render(): lit_html.TemplateResult<1>;
474
+ }
475
+ declare global {
476
+ interface HTMLElementTagNameMap {
477
+ 'qti-hottext': QtiHottext;
478
+ }
479
+ }
480
+
481
+ interface OptionType {
482
+ textContent: string;
483
+ value: string;
484
+ selected: boolean;
485
+ }
486
+ declare class QtiInlineChoiceInteraction extends Interaction {
487
+ static get styles(): lit.CSSResult[];
488
+ static inputWidthClass: string[];
489
+ protected options: OptionType[];
490
+ protected correctOption: string;
491
+ dataPrompt: string;
492
+ render(): lit_html.TemplateResult<1>;
493
+ connectedCallback(): void;
494
+ disconnectedCallback(): void;
495
+ validate(): boolean;
496
+ reset(): void;
497
+ set value(value: string | null);
498
+ get value(): string | null;
499
+ set correctResponse(value: string | string[]);
500
+ protected choiceSelected(event: Event): void;
501
+ }
502
+ declare global {
503
+ interface HTMLElementTagNameMap {
504
+ 'qti-inline-choice-interaction': QtiInlineChoiceInteraction;
505
+ }
506
+ }
507
+
508
+ declare class QtiInlineChoice extends LitElement {
509
+ static get styles(): lit.CSSResult[];
510
+ identifier: string;
511
+ connectedCallback(): void;
512
+ disconnectedCallback(): void;
513
+ render(): lit_html.TemplateResult<1>;
514
+ private _onSelectInlineChoice;
515
+ }
516
+ declare global {
517
+ interface HTMLElementTagNameMap {
518
+ 'qti-inline-choice': QtiInlineChoice;
519
+ }
520
+ }
521
+
883
522
  declare const QtiSimpleAssociableChoice_base: (abstract new (...args: any[]) => ActiveElementMixinInterface) & typeof LitElement;
884
523
  declare class QtiSimpleAssociableChoice extends QtiSimpleAssociableChoice_base {
885
524
  static styles: lit.CSSResult;
@@ -955,13 +594,94 @@ declare class QtiOrderInteraction extends QtiOrderInteraction_base {
955
594
  /** orientation of choices */
956
595
  orientation: 'horizontal' | 'vertical';
957
596
  render(): lit_html.TemplateResult<1>;
958
- set correctResponse(value: string | string[]);
959
- protected getResponse(): string[];
960
- firstUpdated(changedProps: any): Promise<void>;
597
+ set correctResponse(value: string | string[]);
598
+ protected getResponse(): string[];
599
+ firstUpdated(changedProps: any): Promise<void>;
600
+ }
601
+ declare global {
602
+ interface HTMLElementTagNameMap {
603
+ 'qti-order-interaction': QtiOrderInteraction;
604
+ }
605
+ }
606
+
607
+ interface IMSpci<ConfigProperties> {
608
+ typeIdentifier: string;
609
+ /** @access public
610
+ * @method getInstance Create a new instance of this portable custom interaction
611
+ * Will be called by the qtiCustomInteractionContext
612
+ * @param {DOM Element} dom - the DOM Element this PCI is being added to
613
+ * @param {Object} configuration - the configuration to apply to this PCI
614
+ * @param {String} state - a previous saved state to apply to this instance.
615
+ * This must have been obtained from a prior call to getState on an
616
+ * instance of this type (same typeIdentifier)
617
+ */
618
+ getInstance: (dom: HTMLElement, configuration: Configuration<ConfigProperties>, state: string) => void;
619
+ /** @access public
620
+ * @method getResponse
621
+ * @return {Object} - the value to assign to the bound QTI response variable
622
+ */
623
+ getResponse: () => QtiVariableJSON;
624
+ /** @access public
625
+ * @method getState
626
+ * @return {String} The current state of this PCI. May be passed to
627
+ * getInstance to later restore this PCI instance.
628
+ */
629
+ getState: () => string;
630
+ oncompleted?: () => void;
631
+ destroy?: () => void;
632
+ }
633
+ declare type Configuration<T> = {
634
+ onready: (pci: IMSpci<T>, state?: string) => void;
635
+ properties: T;
636
+ };
637
+ declare type QtiVariableJSON = {
638
+ [K in 'list' | 'base']?: {
639
+ [Ka in 'boolean' | 'integer' | 'float' | 'string' | 'pair' | 'directedPair' | 'identifier']?: ResponseType;
640
+ };
641
+ };
642
+ interface ModuleResolutionConfig {
643
+ waitSeconds?: number;
644
+ context?: string;
645
+ catchError?: boolean;
646
+ paths: {
647
+ [key: string]: string | string[];
648
+ };
649
+ shim?: {
650
+ [key: string]: {
651
+ deps?: string[];
652
+ exports?: string;
653
+ };
654
+ };
655
+ }
656
+
657
+ declare class QtiPortableCustomInteraction extends Interaction {
658
+ private intervalId;
659
+ private rawResponse;
660
+ private pci;
661
+ module: string;
662
+ customInteractionTypeIdentifier: string;
663
+ private _errorMessage;
664
+ private convertQtiVariableJSON;
665
+ private startChecking;
666
+ private stopChecking;
667
+ validate(): boolean;
668
+ set value(_: string | string[]);
669
+ get value(): string | string[];
670
+ getTAOConfig(node: any): {};
671
+ register(pci: IMSpci<unknown>): void;
672
+ connectedCallback(): void;
673
+ disconnectedCallback(): void;
674
+ buildRequireConfig(): ModuleResolutionConfig;
675
+ private combineRequireResolvePaths;
676
+ private removeDoubleSlashes;
677
+ loadConfig: (url: string, baseUrl?: string) => Promise<ModuleResolutionConfig>;
678
+ getResolvablePathString: (path: string, basePath?: string) => string;
679
+ getResolvablePath: (path: string | string[], basePath?: string) => string | string[];
680
+ render(): lit_html.TemplateResult<1>;
961
681
  }
962
682
  declare global {
963
683
  interface HTMLElementTagNameMap {
964
- 'qti-order-interaction': QtiOrderInteraction;
684
+ 'qti-portable-custom-interaction': QtiPortableCustomInteraction;
965
685
  }
966
686
  }
967
687
 
@@ -1005,6 +725,23 @@ declare global {
1005
725
  }
1006
726
  }
1007
727
 
728
+ declare const QtiSimpleChoice_base: (abstract new (...args: any[]) => ActiveElementMixinInterface) & typeof LitElement;
729
+ /**
730
+ * qti-order-interaction
731
+ * qti-choice-interaction
732
+ */
733
+ declare class QtiSimpleChoice extends QtiSimpleChoice_base {
734
+ static styles: lit.CSSResult;
735
+ marker: string;
736
+ get checked(): boolean;
737
+ render(): lit_html.TemplateResult<1>;
738
+ }
739
+ declare global {
740
+ interface HTMLElementTagNameMap {
741
+ 'qti-simple-choice': QtiSimpleChoice;
742
+ }
743
+ }
744
+
1008
745
  declare class QtiSliderInteraction extends LitElement {
1009
746
  static formAssociated: boolean;
1010
747
  static styles: CSSResultGroup;
@@ -1032,127 +769,240 @@ declare global {
1032
769
  }
1033
770
  }
1034
771
 
772
+ declare class QtiTextEntryInteraction extends Interaction {
773
+ static styles: CSSResultGroup;
774
+ expectedLength: number;
775
+ patternMask: string;
776
+ placeholderText: string;
777
+ dataPatternmaskMessage: string;
778
+ private _value;
779
+ inputRef: lit_html_directives_ref_js.Ref<HTMLInputElement>;
780
+ get value(): string | string[] | null;
781
+ set value(val: string | string[] | null);
782
+ validate(): boolean;
783
+ render(): lit_html.TemplateResult<1>;
784
+ protected textChanged(event: Event): void;
785
+ reportValidity(): boolean;
786
+ reset(): void;
787
+ private setEmptyAttribute;
788
+ }
789
+ declare global {
790
+ interface HTMLElementTagNameMap {
791
+ 'qti-text-entry-interaction': QtiTextEntryInteraction;
792
+ }
793
+ }
794
+
795
+ declare class QtiUploadInteraction extends Interaction {
796
+ private _file;
797
+ private _base64;
798
+ reset(): void;
799
+ validate(): boolean;
800
+ get value(): string | string[] | null;
801
+ set value(base64: string | null);
802
+ static get properties(): {
803
+ [x: string]: lit.PropertyDeclaration<unknown, unknown>;
804
+ };
805
+ static styles: lit.CSSResult[];
806
+ render(): lit_html.TemplateResult<1>;
807
+ private _onFileChange;
808
+ private _convertToBase64;
809
+ }
810
+ declare global {
811
+ interface HTMLElementTagNameMap {
812
+ 'qti-upload-interaction': QtiUploadInteraction;
813
+ }
814
+ }
815
+
1035
816
  /**
1036
- * https://www.imsglobal.org/spec/qti/v3p0/impl#h.fi29q8dubjgw
1037
- * <qti-custom-operator class="js.org">
1038
- <qti-base-value base-type="string"><![CDATA[
1039
- console.log(context.variables);
1040
- return 'B'
1041
- document.querySelector('qti-end-attempt-interaction').disabled = true;
1042
- ]]></qti-base-value>
1043
- </qti-custom-operator>
1044
- </qti-set-outcome-value>
817
+ * @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.
818
+ * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.sphpo6lu6zqi
819
+ * @status stable
820
+ * @since 4.0
821
+ *
822
+ * @slot - item body content.
823
+ * @slot qti-rubric-block - the qti rubric block is placed above the item
824
+ *
1045
825
  */
1046
- declare class QtiCustomOperator extends LitElement implements Calculate {
1047
- private operatorFunction;
1048
- private _context?;
826
+ declare class QtiItemBody extends LitElement {
827
+ static styles: CSSResultGroup;
1049
828
  render(): lit_html.TemplateResult<1>;
1050
- handleSlotChange(): void;
1051
- calculate(): any;
1052
829
  }
1053
830
  declare global {
1054
831
  interface HTMLElementTagNameMap {
1055
- 'qti-custom-operator': QtiCustomOperator;
832
+ 'qti-item-body': QtiItemBody;
1056
833
  }
1057
834
  }
1058
835
 
1059
- declare class QtiAssociableHotspot extends LitElement {
1060
- static styles: lit.CSSResult;
836
+ declare class QtiOutcomeProcessing extends LitElement {
837
+ static styles: lit.CSSResult[];
838
+ render(): lit_html.TemplateResult<1>;
839
+ process(): void;
840
+ }
841
+ declare global {
842
+ interface HTMLElementTagNameMap {
843
+ 'qti-outcome-processing': QtiOutcomeProcessing;
844
+ }
845
+ }
846
+ declare class QtiOutcomeProcessingProcessor {
847
+ process(rules: QtiRuleBase[]): void;
848
+ }
849
+
850
+ declare class QtiPrompt extends LitElement {
851
+ render(): lit_html.TemplateResult<1>;
1061
852
  connectedCallback(): void;
853
+ }
854
+ declare global {
855
+ interface HTMLElementTagNameMap {
856
+ 'qti-prompt': QtiPrompt;
857
+ }
858
+ }
859
+
860
+ declare class QtiResponseProcessing extends LitElement {
861
+ static styles: lit.CSSResult[];
1062
862
  render(): lit_html.TemplateResult<1>;
863
+ process(): void;
864
+ firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
865
+ private fragmentFromString;
1063
866
  }
1064
867
  declare global {
1065
868
  interface HTMLElementTagNameMap {
1066
- 'qti-associable-hotspot': QtiAssociableHotspot;
869
+ 'qti-response-processing': QtiResponseProcessing;
1067
870
  }
1068
871
  }
1069
872
 
1070
- declare class QtiGap extends LitElement {
1071
- static styles: lit.CSSResult;
1072
- tabindex: number | undefined;
873
+ declare class QtiRule extends LitElement implements QtiRuleBase {
1073
874
  render(): lit_html.TemplateResult<1>;
875
+ process(): void;
876
+ }
877
+ interface QtiRuleBase {
878
+ process(): any;
1074
879
  }
1075
880
  declare global {
1076
881
  interface HTMLElementTagNameMap {
1077
- 'qti-gap': QtiGap;
882
+ 'qti-rule': QtiRule;
1078
883
  }
1079
884
  }
1080
885
 
1081
- declare class QtiGapImg extends LitElement {
1082
- static styles: lit.CSSResult;
1083
- tabindex: number | undefined;
1084
- connectedCallback(): void;
886
+ /**
887
+ * The lookupOutcomeValue rule sets the value of an outcome variable to the value obtained
888
+ * by looking up the value of the associated expression in the lookupTable associated
889
+ * with the outcome's declaration.
890
+ */
891
+ declare class QtiLookupOutcomeValue extends QtiRule {
892
+ identifier: string;
893
+ get childExpression(): QtiExpression<string>;
894
+ process(): number;
1085
895
  }
1086
896
  declare global {
1087
897
  interface HTMLElementTagNameMap {
1088
- 'qti-gap-img': QtiGapImg;
898
+ 'qti-lookup-outcome-value': QtiLookupOutcomeValue;
1089
899
  }
1090
900
  }
1091
901
 
1092
- declare const QtiGapText_base: (abstract new (...args: any[]) => ActiveElementMixinInterface) & typeof LitElement;
1093
- declare class QtiGapText extends QtiGapText_base {
1094
- static styles: lit.CSSResult;
1095
- tabindex: number | undefined;
1096
- connectedCallback(): void;
902
+ type Constructor<T> = new (...args: any[]) => T;
903
+ declare const QtiSubtract_base: {
904
+ new (...args: any[]): {
905
+ calculateChildren(children: Array<MockQtiExpression<any>>): number;
906
+ };
907
+ } & Constructor<QtiExpression<number>>;
908
+ declare class QtiSubtract extends QtiSubtract_base {
909
+ getResult(): number;
910
+ }
911
+ type MockQtiExpression<T> = {
912
+ calculate: () => T;
913
+ };
914
+ type MockConstructor = new (...args: any[]) => {};
915
+ declare function qtiSubtractMixin<TBase extends MockConstructor>(Base: TBase): {
916
+ new (...args: any[]): {
917
+ calculateChildren(children: Array<MockQtiExpression<any>>): number;
918
+ };
919
+ } & TBase;
920
+
921
+ declare global {
922
+ interface HTMLElementTagNameMap {
923
+ 'qti-subtract': QtiSubtract;
924
+ }
925
+ }
926
+
927
+ declare class QtiContentBody extends LitElement {
1097
928
  render(): lit_html.TemplateResult<1>;
1098
929
  }
1099
930
  declare global {
1100
931
  interface HTMLElementTagNameMap {
1101
- 'qti-gap-text': QtiGapText;
932
+ 'qti-content-body': QtiContentBody;
1102
933
  }
1103
934
  }
1104
935
 
1105
- declare const QtiHotspotChoice_base: (abstract new (...args: any[]) => ActiveElementMixinInterface) & typeof LitElement;
1106
- declare class QtiHotspotChoice extends QtiHotspotChoice_base {
936
+ declare class QtiRubricBlock extends LitElement {
937
+ id: any;
938
+ use: 'instructions' | 'scoring' | 'navigation';
939
+ view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor';
940
+ classNames: any;
941
+ handleclassNamesChange(): void;
1107
942
  static styles: lit.CSSResult;
1108
- order: number;
943
+ render(): lit_html.TemplateResult<1>;
944
+ connectedCallback(): void;
1109
945
  }
1110
946
  declare global {
1111
947
  interface HTMLElementTagNameMap {
1112
- 'qti-hotspot-choice': QtiHotspotChoice;
948
+ 'qti-rubric-block': QtiRubricBlock;
1113
949
  }
1114
950
  }
1115
951
 
1116
- declare const QtiHottext_base: (abstract new (...args: any[]) => ActiveElementMixinInterface) & typeof LitElement;
1117
- declare class QtiHottext extends QtiHottext_base {
1118
- static styles: lit.CSSResult;
952
+ declare class QtiStylesheet extends LitElement {
953
+ private styleElement;
954
+ protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
955
+ private minifyCss;
956
+ disconnectedCallback(): void;
957
+ }
958
+ declare global {
959
+ interface HTMLElementTagNameMap {
960
+ 'qti-stylesheet': QtiStylesheet;
961
+ }
962
+ }
963
+
964
+ declare class QtiVariableDeclaration extends LitElement {
1119
965
  render(): lit_html.TemplateResult<1>;
966
+ protected defaultValues(variable: VariableDeclaration<string | string[] | null>): string | string[];
1120
967
  }
1121
968
  declare global {
1122
969
  interface HTMLElementTagNameMap {
1123
- 'qti-hottext': QtiHottext;
970
+ 'qti-variabledeclaration': QtiVariableDeclaration;
1124
971
  }
1125
972
  }
1126
973
 
1127
- declare class QtiInlineChoice extends LitElement {
1128
- static get styles(): lit.CSSResult[];
974
+ declare class QtiOutcomeDeclaration extends QtiVariableDeclaration {
975
+ baseType: BaseType;
976
+ externalScored: 'human' | 'externalMachine' | null;
1129
977
  identifier: string;
1130
- connectedCallback(): void;
1131
- disconnectedCallback(): void;
978
+ cardinality: Cardinality;
979
+ itemContext?: ItemContext;
980
+ static styles: lit.CSSResult[];
1132
981
  render(): lit_html.TemplateResult<1>;
1133
- private _onSelectInlineChoice;
982
+ get interpolationTable(): Map<number, number> | null;
983
+ connectedCallback(): void;
1134
984
  }
1135
985
  declare global {
1136
986
  interface HTMLElementTagNameMap {
1137
- 'qti-inline-choice': QtiInlineChoice;
987
+ 'qti-outcome-declaration': QtiOutcomeDeclaration;
1138
988
  }
1139
989
  }
1140
990
 
1141
- declare const QtiSimpleChoice_base: (abstract new (...args: any[]) => ActiveElementMixinInterface) & typeof LitElement;
1142
- /**
1143
- * qti-order-interaction
1144
- * qti-choice-interaction
1145
- */
1146
- declare class QtiSimpleChoice extends QtiSimpleChoice_base {
1147
- static styles: lit.CSSResult;
1148
- marker: string;
1149
- get checked(): boolean;
991
+ declare class QtiResponseDeclaration extends QtiVariableDeclaration {
992
+ baseType: BaseType;
993
+ identifier: string;
994
+ cardinality: Cardinality;
995
+ itemContext?: ItemContext;
996
+ static styles: lit.CSSResult[];
1150
997
  render(): lit_html.TemplateResult<1>;
998
+ connectedCallback(): void;
999
+ private get correctResponse();
1000
+ private get mapping();
1151
1001
  }
1152
1002
  declare global {
1153
1003
  interface HTMLElementTagNameMap {
1154
- 'qti-simple-choice': QtiSimpleChoice;
1004
+ 'qti-response-declaration': QtiResponseDeclaration;
1155
1005
  }
1156
1006
  }
1157
1007
 
1158
- export { type QtiRuleBase as $, type ActiveElementMixinInterface as A, type BaseType as B, type Calculate as C, QtiHottextInteraction as D, QtiInlineChoiceInteraction as E, type Orientation as F, QtiChoiceInteraction as G, QtiUploadInteraction as H, type InteractionChangedDetails as I, QtiOutcomeProcessing as J, QtiOutcomeProcessingProcessor as K, QtiResponseProcessing as L, type Multiple as M, QtiLookupOutcomeValue as N, type OutcomeChangedDetails as O, QtiAnd as P, type QtiInteractionChanged as Q, type ResponseInteraction as R, qtiAndMixin as S, QtiConditionExpression as T, type QtiExpressionBase as U, type VariableValue as V, QtiExpression as W, QtiMapping as X, QtiSubtract as Y, qtiSubtractMixin as Z, QtiRule as _, type QtiOutcomeChanged as a, QtiPortableCustomInteraction as a0, QtiAssociateInteraction as a1, QtiCustomInteraction as a2, QtiEndAttemptInteraction as a3, QtiGapMatchInteraction as a4, QtiGraphicAssociateInteraction as a5, QtiGraphicGapMatchInteraction as a6, QtiGraphicOrderInteraction as a7, QtiHotspotInteraction as a8, QtiMatchInteraction as a9, QtiMediaInteraction as aa, QtiOrderInteraction as ab, QtiPositionObjectStage as ac, QtiSelectPointInteraction as ad, QtiSliderInteraction as ae, type ItemContext as af, itemContextVariables as ag, itemContext as ah, QtiCustomOperator as ai, Interaction as aj, QtiAssociableHotspot as ak, QtiGap as al, QtiGapImg as am, QtiGapText as an, QtiHotspotChoice as ao, QtiHottext as ap, QtiInlineChoice as aq, QtiSimpleAssociableChoice as ar, QtiSimpleChoice as as, type Ordered as b, type Cardinality as c, type directedPair as d, type VariableDeclaration as e, type float as f, type OutcomeVariable as g, type ResponseVariable as h, type integer as i, QtiAssessmentItem as j, QtiAssessmentStimulusRef as k, type ChoiceInterface as l, ActiveElementMixin as m, QtiItemBody as n, QtiPrompt as o, QtiStylesheet as p, QtiOutcomeDeclaration as q, QtiResponseDeclaration as r, QtiCompanionMaterialsInfo as s, QtiContentBody as t, QtiRubricBlock as u, QtiFeedbackBlock as v, QtiFeedbackInline as w, QtiModalFeedback as x, QtiExtendedTextInteraction as y, QtiTextEntryInteraction as z };
1008
+ export { QtiMediaInteraction as A, QtiOrderInteraction as B, QtiPortableCustomInteraction as C, QtiPositionObjectStage as D, QtiSelectPointInteraction as E, QtiSimpleAssociableChoice as F, QtiSimpleChoice as G, QtiSliderInteraction as H, QtiTextEntryInteraction as I, QtiUploadInteraction as J, QtiItemBody as K, QtiOutcomeProcessing as L, QtiOutcomeProcessingProcessor as M, QtiPrompt as N, type Orientation as O, QtiResponseProcessing as P, QtiAssessmentItem as Q, QtiLookupOutcomeValue as R, QtiSubtract as S, qtiSubtractMixin as T, QtiRule as U, type QtiRuleBase as V, QtiContentBody as W, QtiRubricBlock as X, QtiStylesheet as Y, QtiOutcomeDeclaration as Z, QtiResponseDeclaration as _, QtiAssessmentStimulusRef as a, QtiCompanionMaterialsInfo as b, QtiCustomOperator as c, QtiFeedbackBlock as d, QtiFeedbackInline as e, QtiModalFeedback as f, QtiAssociableHotspot as g, QtiAssociateInteraction as h, QtiChoiceInteraction as i, QtiCustomInteraction as j, QtiEndAttemptInteraction as k, QtiExtendedTextInteraction as l, QtiGapImg as m, QtiGapMatchInteraction as n, QtiGapText as o, QtiGap as p, QtiGraphicAssociateInteraction as q, QtiGraphicGapMatchInteraction as r, QtiGraphicOrderInteraction as s, QtiHotspotChoice as t, QtiHotspotInteraction as u, QtiHottextInteraction as v, QtiHottext as w, QtiInlineChoiceInteraction as x, QtiInlineChoice as y, QtiMatchInteraction as z };