@citolab/qti-components 3.0.83 → 6.0.0-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 (117) hide show
  1. package/dist/ExpressionResult-2192c3d8.d.ts +33 -0
  2. package/dist/chunk-DHKNFCXT.cjs +1 -0
  3. package/dist/chunk-HWADA6Q6.js +1 -0
  4. package/dist/chunk-JLKCCEGG.cjs +1 -0
  5. package/dist/chunk-L6436D6O.js +1 -0
  6. package/dist/chunk-QYAOZBP6.js +1 -0
  7. package/dist/chunk-TQLGNXF4.cjs +1 -0
  8. package/dist/qti-assessment-item-e9f437d6.d.ts +117 -0
  9. package/dist/qti-components/index.cjs +403 -0
  10. package/dist/qti-components/index.d.ts +786 -0
  11. package/dist/qti-components/index.js +403 -0
  12. package/dist/qti-convert/index.cjs +84 -0
  13. package/dist/qti-convert/index.d.ts +6 -0
  14. package/dist/qti-convert/index.js +84 -0
  15. package/dist/qti-item/index.cjs +17 -0
  16. package/dist/qti-item/index.d.ts +27 -0
  17. package/dist/qti-item/index.js +17 -0
  18. package/dist/qti-test/index.cjs +12 -0
  19. package/{lab/qti-test/qti-test.d.ts → dist/qti-test/index.d.ts} +10 -6
  20. package/dist/qti-test/index.js +12 -0
  21. package/dist/qti-transform/index.cjs +102 -0
  22. package/dist/qti-transform/index.d.ts +18 -0
  23. package/dist/qti-transform/index.js +102 -0
  24. package/package.json +72 -8
  25. package/readme.md +96 -0
  26. package/index.css +0 -2
  27. package/index.d.ts +0 -51
  28. package/index.js +0 -3655
  29. package/index.umd.cjs +0 -503
  30. package/lab/qti-custom-operator/qti-custom-operator-levenshtein.d.ts +0 -11
  31. package/lab/qti-custom-operator/qti-custom-operator-numeric-parse-nl.d.ts +0 -11
  32. package/lab/qti-custom-operator/qti-custom-operator-numeric.d.ts +0 -6
  33. package/lab/qti-custom-operator/qti-custom-operator-remove-spaces.d.ts +0 -6
  34. package/lab/qti-custom-operator/qti-custom-operator-trim.d.ts +0 -6
  35. package/lab/qti-item/qti-item.d.ts +0 -20
  36. package/lab/qti-manual-scoring/qti-manual-scoring.d.ts +0 -15
  37. package/lab/qti-test/index.d.ts +0 -2
  38. package/lib/qti-assessment-item/qti-assessment-item.d.ts +0 -44
  39. package/lib/qti-choice/qti-choice.d.ts +0 -34
  40. package/lib/qti-choice/qti-hottext/qti-hottext.d.ts +0 -8
  41. package/lib/qti-choice/qti-simple-choice/qti-simple-choice.d.ts +0 -8
  42. package/lib/qti-companion-materials-info/qti-companion-materials-info.d.ts +0 -3
  43. package/lib/qti-feedback/qti-feedback-inline/qti-feedback-inline.d.ts +0 -5
  44. package/lib/qti-feedback/qti-feedback.d.ts +0 -30
  45. package/lib/qti-feedback/qti-modal-feedback/qti-modal-feedback.d.ts +0 -4
  46. package/lib/qti-interaction/qti-associate-interaction/qti-associate-interaction.d.ts +0 -9
  47. package/lib/qti-interaction/qti-associate-interaction/qti-simple-associable-choice.d.ts +0 -5
  48. package/lib/qti-interaction/qti-choice-interaction/qti-choice-interaction.d.ts +0 -10
  49. package/lib/qti-interaction/qti-extended-text-interaction/qti-extended-text-interaction.d.ts +0 -18
  50. package/lib/qti-interaction/qti-gap-match-interaction/qti-gap-match-interaction.d.ts +0 -7
  51. package/lib/qti-interaction/qti-gap-match-interaction/qti-gap-text.d.ts +0 -5
  52. package/lib/qti-interaction/qti-gap-match-interaction/qti-gap.d.ts +0 -4
  53. package/lib/qti-interaction/qti-graphic-associate-interaction/qti-graphic-associate-interaction.d.ts +0 -9
  54. package/lib/qti-interaction/qti-graphic-gap-match-interaction/qti-graphic-gap-match-interaction.d.ts +0 -10
  55. package/lib/qti-interaction/qti-graphic-order-interaction/qti-graphic-order-interaction.d.ts +0 -10
  56. package/lib/qti-interaction/qti-hotspot-choice.d.ts +0 -5
  57. package/lib/qti-interaction/qti-hotspot-interaction/qti-hotspot-interaction.d.ts +0 -8
  58. package/lib/qti-interaction/qti-hottext-interaction/qti-hottext-interaction.d.ts +0 -5
  59. package/lib/qti-interaction/qti-inline-choice-interaction/qti-inline-choice-interaction.d.ts +0 -26
  60. package/lib/qti-interaction/qti-match-interaction/qti-match-interaction.d.ts +0 -7
  61. package/lib/qti-interaction/qti-media-interaction/qti-media-interaction.d.ts +0 -18
  62. package/lib/qti-interaction/qti-order-interaction/qti-order-interaction.d.ts +0 -22
  63. package/lib/qti-interaction/qti-portable-custom-interaction/qti-portable-custom-interaction.d.ts +0 -34
  64. package/lib/qti-interaction/qti-preview-badge.d.ts +0 -1
  65. package/lib/qti-interaction/qti-select-point-interaction/qti-select-point-interaction.d.ts +0 -9
  66. package/lib/qti-interaction/qti-slider-interaction/qti-slider-interaction.d.ts +0 -31
  67. package/lib/qti-interaction/qti-text-entry-interaction/qti-text-entry-interaction.d.ts +0 -33
  68. package/lib/qti-item-body/qti-item-body.d.ts +0 -5
  69. package/lib/qti-prompt/qti-prompt.d.ts +0 -5
  70. package/lib/qti-responseprocessing/index.d.ts +0 -18
  71. package/lib/qti-responseprocessing/qti-expression/qti-and/qti-and.d.ts +0 -7
  72. package/lib/qti-responseprocessing/qti-expression/qti-basevalue/qti-basevalue.d.ts +0 -6
  73. package/lib/qti-responseprocessing/qti-expression/qti-contains/qti-contains.d.ts +0 -6
  74. package/lib/qti-responseprocessing/qti-expression/qti-correct/qti-correct.d.ts +0 -6
  75. package/lib/qti-responseprocessing/qti-expression/qti-expression.d.ts +0 -6
  76. package/lib/qti-responseprocessing/qti-expression/qti-gte/qti-gte.d.ts +0 -6
  77. package/lib/qti-responseprocessing/qti-expression/qti-is-null/qti-is-null.d.ts +0 -6
  78. package/lib/qti-responseprocessing/qti-expression/qti-mapresponse/qti-mapresponse.d.ts +0 -4
  79. package/lib/qti-responseprocessing/qti-expression/qti-match/qti-match.d.ts +0 -4
  80. package/lib/qti-responseprocessing/qti-expression/qti-multiple/qti-multiple.d.ts +0 -4
  81. package/lib/qti-responseprocessing/qti-expression/qti-or/qti-or.d.ts +0 -7
  82. package/lib/qti-responseprocessing/qti-expression/qti-variable/qti-variable.d.ts +0 -6
  83. package/lib/qti-responseprocessing/qti-responseelse/qti-responseelse.d.ts +0 -15
  84. package/lib/qti-responseprocessing/qti-responseelse/qti-responseif/qti-responseelseif/qti-responseelseif.d.ts +0 -4
  85. package/lib/qti-responseprocessing/qti-responseelse/qti-responseif/qti-responseif.d.ts +0 -7
  86. package/lib/qti-responseprocessing/qti-responseprocessing/qti-responseprocessing.d.ts +0 -7
  87. package/lib/qti-responseprocessing/qti-rule/qti-responsecondition/qti-responsecondition.d.ts +0 -5
  88. package/lib/qti-responseprocessing/qti-rule/qti-rule.d.ts +0 -5
  89. package/lib/qti-responseprocessing/qti-rule/qti-setoutcomevalue/qti-setoutcomevalue.d.ts +0 -4
  90. package/lib/qti-rubric-block/qti-content-body.d.ts +0 -4
  91. package/lib/qti-rubric-block/qti-rubric-block.d.ts +0 -15
  92. package/lib/qti-stylesheet/qti-stylesheet.d.ts +0 -7
  93. package/lib/qti-utilities/EventStrings.d.ts +0 -19
  94. package/lib/qti-utilities/EventTypes.d.ts +0 -7
  95. package/lib/qti-utilities/ExpressionResult.d.ts +0 -43
  96. package/lib/qti-utilities/OutcomeVariable.d.ts +0 -8
  97. package/lib/qti-utilities/ResponseVariable.d.ts +0 -28
  98. package/lib/qti-utilities/TemplateStrings.d.ts +0 -3
  99. package/lib/qti-utilities/VariableDeclaration.d.ts +0 -7
  100. package/lib/qti-variabledeclaration/qti-outcomedeclaration/qti-outcomedeclaration.d.ts +0 -5
  101. package/lib/qti-variabledeclaration/qti-responsedeclaration/qti-responsedeclaration.d.ts +0 -9
  102. package/lib/qti-variabledeclaration/qti-variabledeclaration.d.ts +0 -4
  103. package/lib/utilities/choice/choices.d.ts +0 -23
  104. package/lib/utilities/context/context.d.ts +0 -7
  105. package/lib/utilities/decorators/liveQuery.d.ts +0 -10
  106. package/lib/utilities/decorators/watch.d.ts +0 -14
  107. package/lib/utilities/drag-drop/drag-drop-api.d.ts +0 -91
  108. package/lib/utilities/drag-drop/drag-drop-interaction-mixin.d.ts +0 -5
  109. package/lib/utilities/drag-drop/droppables-mixin.d.ts +0 -6
  110. package/lib/utilities/drag-drop/flippables-mixin.d.ts +0 -8
  111. package/lib/utilities/drag-drop/index.d.ts +0 -4
  112. package/lib/utilities/element/qti-element.d.ts +0 -6
  113. package/lib/utilities/hotspots/hotspot.d.ts +0 -2
  114. package/lib/utilities/interaction/interaction.d.ts +0 -14
  115. package/lib/utilities/interaction/interaction.interface.d.ts +0 -8
  116. package/lib/utilities/reset-styles/reset-shadowroot-styles.d.ts +0 -1
  117. package/lib/utilities/scale-to-fit/scale-to-fit.mixin.d.ts +0 -6
@@ -0,0 +1,786 @@
1
+ import { R as ResponseType$1, a as ResponseInteraction, Q as QtiVariableJSON, B as BaseType, C as Cardinality } from '../ExpressionResult-2192c3d8.js';
2
+ export { c as Calculate, I as InputResponseFormat, M as Multiple, O as Ordered, b as ResponseItem, d as directedPair, f as float, i as integer } from '../ExpressionResult-2192c3d8.js';
3
+ import { V as VariableDeclaration, Q as QtiElement } from '../qti-assessment-item-e9f437d6.js';
4
+ export { O as OutcomeVariable, a as QtiAssessmentItem, R as ResponseVariable } from '../qti-assessment-item-e9f437d6.js';
5
+ import * as lit from 'lit';
6
+ import { LitElement, CSSResultGroup } from 'lit';
7
+ import * as lit_html from 'lit-html';
8
+ import { ContextConsumer } from '@lit-labs/context';
9
+ import * as lit_html_directives_ref from 'lit-html/directives/ref';
10
+
11
+ interface OutcomeChangedDetails {
12
+ item: string;
13
+ outcomeIdentifier: string;
14
+ value: ResponseType$1;
15
+ }
16
+ type InteractionChangedDetails = ResponseInteraction<QtiVariableJSON>;
17
+
18
+ type QtiOutcomeChanged = CustomEvent<{
19
+ item: string;
20
+ outcomeIdentifier: string;
21
+ value: ResponseType$1;
22
+ }>;
23
+ declare global {
24
+ interface GlobalEventHandlersEventMap {
25
+ 'qti-outcome-changed': QtiOutcomeChanged;
26
+ }
27
+ }
28
+
29
+ declare namespace qtiOutcomeChanged {
30
+ export {
31
+ QtiOutcomeChanged as default,
32
+ };
33
+ }
34
+
35
+ type QtiInteractionChanged = CustomEvent<{
36
+ item: string | null;
37
+ interaction: ResponseInteraction<QtiVariableJSON>;
38
+ }>;
39
+ declare global {
40
+ interface GlobalEventHandlersEventMap {
41
+ 'qti-interaction-changed': QtiInteractionChanged;
42
+ }
43
+ }
44
+
45
+ declare namespace qtiInteractionChanged {
46
+ export {
47
+ QtiInteractionChanged as default,
48
+ };
49
+ }
50
+
51
+ type QtiRegisterVariable = CustomEvent<{
52
+ variable: VariableDeclaration;
53
+ }>;
54
+ declare global {
55
+ interface GlobalEventHandlersEventMap {
56
+ 'qti-register-variable': QtiRegisterVariable;
57
+ }
58
+ }
59
+
60
+ declare namespace qtiRegisterVariable {
61
+ export {
62
+ QtiRegisterVariable as default,
63
+ };
64
+ }
65
+
66
+ type QtiRegisterInteraction = CustomEvent<Record<PropertyKey, never>>;
67
+ declare global {
68
+ interface GlobalEventHandlersEventMap {
69
+ 'qti-register-interaction': QtiRegisterInteraction;
70
+ }
71
+ }
72
+
73
+ declare namespace qtiRegisterInteraction {
74
+ export {
75
+ QtiRegisterInteraction as default,
76
+ };
77
+ }
78
+
79
+ type QtiRegisterChoice = CustomEvent<Record<PropertyKey, never>>;
80
+ declare global {
81
+ interface GlobalEventHandlersEventMap {
82
+ 'qti-register-choice': QtiRegisterChoice;
83
+ }
84
+ }
85
+
86
+ declare namespace qtiRegisterChoice {
87
+ export {
88
+ QtiRegisterChoice as default,
89
+ };
90
+ }
91
+
92
+ type QtiRegisterHotspot = CustomEvent<Record<PropertyKey, never>>;
93
+ declare global {
94
+ interface GlobalEventHandlersEventMap {
95
+ 'qti-register-hotspot': QtiRegisterHotspot;
96
+ }
97
+ }
98
+
99
+ declare namespace qtiRegisterHotspot {
100
+ export {
101
+ QtiRegisterHotspot as default,
102
+ };
103
+ }
104
+
105
+ type QtiLooseChoice = CustomEvent<Record<PropertyKey, never>>;
106
+ declare global {
107
+ interface GlobalEventHandlersEventMap {
108
+ 'qti-loose-choice': QtiLooseChoice;
109
+ }
110
+ }
111
+
112
+ declare namespace qtiLooseChoice {
113
+ export {
114
+ QtiLooseChoice as default,
115
+ };
116
+ }
117
+
118
+ type QtiInteractionResponse = CustomEvent<{
119
+ responseIdentifier: string;
120
+ responses: QtiVariableJSON;
121
+ }>;
122
+ declare global {
123
+ interface GlobalEventHandlersEventMap {
124
+ 'qti-interaction-response': QtiInteractionResponse;
125
+ }
126
+ }
127
+
128
+ declare namespace qtiInteractionResponse {
129
+ export {
130
+ QtiInteractionResponse as default,
131
+ };
132
+ }
133
+
134
+ type QtiChoiceElementSelected = CustomEvent<{
135
+ identifier: string;
136
+ checked: boolean;
137
+ }>;
138
+ declare global {
139
+ interface GlobalEventHandlersEventMap {
140
+ 'qti-choice-element-selected': QtiChoiceElementSelected;
141
+ }
142
+ }
143
+
144
+ declare namespace qtiChoiceElementSelected {
145
+ export {
146
+ QtiChoiceElementSelected as default,
147
+ };
148
+ }
149
+
150
+ declare const Events: {
151
+ ON_OUTCOME_CHANGED: string;
152
+ ON_INTERACTION_CHANGED: string;
153
+ ON_REGISTER_VARIABLE: string;
154
+ ON_REGISTER_FEEDBACK: string;
155
+ ON_REGISTER_INTERACTION: string;
156
+ ON_REGISTER_CHOICE: string;
157
+ ON_REGISTER_HOTSPOT: string;
158
+ ON_LOOSE_CHOICE: string;
159
+ ON_INTERACTION_RESPONSE: string;
160
+ ON_DROPDOWN_SELECTED: string;
161
+ ON_CHOICE_ELEMENT_SELECTED: string;
162
+ };
163
+
164
+ declare class QtiStylesheet extends LitElement {
165
+ private styleLink;
166
+ constructor();
167
+ connectedCallback(): void;
168
+ disconnectedCallback(): void;
169
+ }
170
+
171
+ /**
172
+ * @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.
173
+ * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.sphpo6lu6zqi
174
+ * @status stable
175
+ * @since 4.0
176
+ *
177
+ * @slot - item body content.
178
+ * @slot qti-rubric-block - the qti rubric block is placed above the item
179
+ *
180
+ */
181
+ declare class QtiItemBody extends LitElement {
182
+ static styles: CSSResultGroup;
183
+ render(): lit_html.TemplateResult<1>;
184
+ }
185
+ declare global {
186
+ interface HTMLElementTagNameMap {
187
+ 'qti-item-body': QtiItemBody;
188
+ }
189
+ }
190
+
191
+ declare class QtiPrompt extends LitElement {
192
+ render(): lit_html.TemplateResult<1>;
193
+ connectedCallback(): void;
194
+ }
195
+
196
+ /**
197
+ * @summary qti-choice is used by qti-simple-choice, qti-inline-choice, qti-hottext, qti-hotspot-choice.
198
+ *
199
+ * @since 1.0
200
+ * @status stable
201
+ *
202
+ * @event qti-register-choice - register itselves on a qti-choice-interaction element.
203
+ * @event qti-loose-choice - de-register itselves on a qti-choice-interaction element.
204
+ * @event qti-choice-element-selected - Emitted when the choice is selected.
205
+ *
206
+ * @slot - The choices slot element
207
+ */
208
+ declare abstract class QtiChoice extends QtiElement {
209
+ identifier: string;
210
+ tabindex: number | undefined;
211
+ disabled: boolean;
212
+ readonly: boolean;
213
+ checked: boolean;
214
+ handleDisabledChange(_: boolean, disabled: boolean): void;
215
+ connectedCallback(): void;
216
+ disconnectedCallback(): void;
217
+ reset(): void;
218
+ private _onKeyUp;
219
+ private _onClick;
220
+ private _toggleChecked;
221
+ validateAllProps(): boolean;
222
+ render(): lit_html.TemplateResult<2 | 1>;
223
+ }
224
+ declare global {
225
+ interface HTMLElementTagNameMap {
226
+ 'qti-choice': QtiChoice;
227
+ }
228
+ }
229
+
230
+ declare class QtiVariableDeclaration extends QtiElement {
231
+ render(): lit_html.TemplateResult<1>;
232
+ }
233
+
234
+ declare class QtiResponseDeclaration extends QtiVariableDeclaration {
235
+ baseType: BaseType;
236
+ identifier: string;
237
+ cardinality: Cardinality;
238
+ connectedCallback(): void;
239
+ private get correctResponse();
240
+ private get mapping();
241
+ }
242
+
243
+ declare class QtiOutcomeDeclaration extends QtiVariableDeclaration {
244
+ static get observedAttributes(): string[];
245
+ connectedCallback(): void;
246
+ }
247
+
248
+ declare class QtiCompanionMaterialsInfo extends QtiElement {
249
+ }
250
+
251
+ interface Logger {
252
+ view: string;
253
+ log: (msg: string) => void;
254
+ }
255
+
256
+ declare class qtiRubricBlock extends QtiElement {
257
+ id: any;
258
+ use: 'instructions' | 'scoring' | 'navigation';
259
+ view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor';
260
+ classNames: any;
261
+ handleclassNamesChange(old: any, disabled: boolean): void;
262
+ static styles: lit.CSSResult;
263
+ logger: ContextConsumer<{
264
+ __context__: Logger;
265
+ }, this>;
266
+ render(): lit_html.TemplateResult<1>;
267
+ connectedCallback(): void;
268
+ }
269
+
270
+ declare class qtiContentBody extends QtiElement {
271
+ render(): lit_html.TemplateResult<1>;
272
+ }
273
+
274
+ declare abstract class QtiFeedback extends LitElement {
275
+ protected showHide: string;
276
+ protected outcomeIdentifier: string;
277
+ protected identifier: string;
278
+ protected showStatus: string;
279
+ constructor();
280
+ connectedCallback(): void;
281
+ checkShowFeedback(outcomeIdentifier: string, outcomeValue: ResponseType$1): void;
282
+ private showFeedback;
283
+ }
284
+
285
+ declare class QtiFeedbackInline extends QtiFeedback {
286
+ static styles: lit.CSSResult;
287
+ render: () => lit_html.TemplateResult<1>;
288
+ }
289
+
290
+ declare class QtiModalFeedback extends QtiFeedback {
291
+ render(): lit_html.TemplateResult<1>;
292
+ }
293
+
294
+ declare abstract class Interaction extends QtiElement {
295
+ responseIdentifier: string;
296
+ /** disabled should be exposed to the attributes and accessible as property */
297
+ disabled: boolean;
298
+ /** readonly should be exposed to the attributes and accessible as property */
299
+ readonly: boolean;
300
+ abstract reset(): void;
301
+ abstract validate(): boolean;
302
+ abstract set response(val: ResponseType$1);
303
+ connectedCallback(): void;
304
+ saveResponse(value: QtiVariableJSON): void;
305
+ }
306
+
307
+ declare class QtiTextEntryInteraction extends Interaction {
308
+ static inputWidthClass: string[];
309
+ value: string;
310
+ expectedLength: any;
311
+ placeholderText: any;
312
+ patternMask: any;
313
+ static get properties(): {
314
+ expectedLength: {
315
+ type: NumberConstructor;
316
+ attribute: string;
317
+ };
318
+ patternMask: {
319
+ type: StringConstructor;
320
+ attribute: string;
321
+ };
322
+ placeholderText: {
323
+ type: StringConstructor;
324
+ attribute: string;
325
+ };
326
+ value: {
327
+ type: StringConstructor;
328
+ };
329
+ };
330
+ constructor();
331
+ set response(value: string | undefined);
332
+ validate(): boolean;
333
+ static get styles(): lit.CSSResult[];
334
+ render(): lit_html.TemplateResult<1>;
335
+ protected textChanged(event: Event): void;
336
+ reset(): void;
337
+ private setEmptyAttribute;
338
+ }
339
+
340
+ declare class QtiExtendedTextInteraction extends Interaction {
341
+ static rowHeightClass: string[];
342
+ textareaRef: lit_html_directives_ref.Ref<HTMLTextAreaElement>;
343
+ expectedLength: any;
344
+ patternMask: any;
345
+ placeholderText: any;
346
+ value: string;
347
+ classNames: any;
348
+ handleclassNamesChange(old: any, disabled: boolean): void;
349
+ set response(value: string);
350
+ validate(): boolean;
351
+ static get styles(): lit.CSSResult[];
352
+ render(): lit_html.TemplateResult<1>;
353
+ protected textChanged(event: Event): void;
354
+ reset(): void;
355
+ private setEmptyAttribute;
356
+ }
357
+
358
+ declare class QtiHottext extends QtiChoice {
359
+ }
360
+ declare global {
361
+ interface HTMLElementTagNameMap {
362
+ 'qti-hottext': QtiHottext;
363
+ }
364
+ }
365
+
366
+ declare abstract class Choices extends Interaction {
367
+ protected _choiceElements: QtiChoice[];
368
+ minChoices: number;
369
+ maxChoices: number;
370
+ _handleDisabledChange: (_: boolean, disabled: boolean) => void;
371
+ _handleReadonlyChange: (_: boolean, readonly: boolean) => void;
372
+ _handleMaxChoicesChange: () => void;
373
+ constructor();
374
+ reset(): void;
375
+ validate(): boolean;
376
+ set response(myResponse: ResponseType);
377
+ connectedCallback(): void;
378
+ disconnectedCallback(): void;
379
+ private _registerChoiceElement;
380
+ private _looseChoiceElement;
381
+ private _determineInputType;
382
+ private _setInputType;
383
+ private _choiceElementSelectedHandler;
384
+ private _choiceElementSelected;
385
+ }
386
+
387
+ declare class QtiHottextInteraction extends Choices {
388
+ connectedCallback(): void;
389
+ render: () => lit_html.TemplateResult<1>;
390
+ }
391
+
392
+ interface OptionType {
393
+ textContent: string;
394
+ value: string;
395
+ selected: boolean;
396
+ }
397
+ declare class QtiInlineChoiceInteraction extends Interaction {
398
+ options: OptionType[];
399
+ static inputWidthClass: string[];
400
+ static get properties(): {
401
+ options: {
402
+ type: ArrayConstructor;
403
+ value: any[];
404
+ attribute: boolean;
405
+ };
406
+ };
407
+ connectedCallback(): void;
408
+ static get styles(): lit.CSSResult[];
409
+ render(): lit_html.TemplateResult<1>;
410
+ constructor();
411
+ validate(): boolean;
412
+ reset(): void;
413
+ set response(value: string);
414
+ choiceSelected(event: Event): void;
415
+ }
416
+
417
+ /**
418
+ * @summary The ChoiceInteraction.Type (qti-choice-interaction) interaction presents a collection of choices to the candidate.
419
+ * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.j9nu1oa1tu3b
420
+ * @status stable
421
+ * @since 4.0
422
+ *
423
+ * @event qti-register-interaction - emitted when the interaction wants to register itself
424
+ * @event qti-interaction-response - emitted when the interaction changes
425
+ *
426
+ * @slot - The default slot where <qti-simple-choice> must be placed.
427
+ * @slot prompt - slot where the prompt is placed.
428
+ */
429
+ declare class QtiChoiceInteraction extends Choices {
430
+ static styles: CSSResultGroup;
431
+ /** orientation of choices */
432
+ orientation: 'horizontal' | 'vertical';
433
+ render: () => lit_html.TemplateResult<1>;
434
+ }
435
+ declare global {
436
+ interface HTMLElementTagNameMap {
437
+ 'qti-choice-interaction': QtiChoiceInteraction;
438
+ }
439
+ }
440
+
441
+ /**
442
+ * @summary Short summary of the component's intended use.
443
+ * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.j9nu1oa1tu3b
444
+ * @status stable
445
+ * @since 4.0
446
+ *
447
+ * @event qti-choice-element-selected - Emitted when a choice is selected.
448
+ * @event qti-register-choice - Emitted when an choice is added
449
+ * @event qti-loose-choice - Emitted when a choice is removed
450
+ *
451
+ * @slot - The default slot.
452
+ */
453
+ declare class QtiSimpleChoice extends QtiChoice {
454
+ static styles: CSSResultGroup;
455
+ }
456
+ declare global {
457
+ interface HTMLElementTagNameMap {
458
+ 'qti-simple-choice': QtiSimpleChoice;
459
+ }
460
+ }
461
+
462
+ declare class QtiResponseProcessing extends LitElement {
463
+ render(): lit_html.TemplateResult<1>;
464
+ static get observedAttributes(): string[];
465
+ process(): void;
466
+ private fragmentFromString;
467
+ }
468
+ declare global {
469
+ interface HTMLElementTagNameMap {
470
+ 'qti-response-processing': QtiResponseProcessing;
471
+ }
472
+ }
473
+
474
+ declare class QtiRule extends LitElement {
475
+ render(): lit_html.TemplateResult<1>;
476
+ process(): void;
477
+ }
478
+ declare global {
479
+ interface HTMLElementTagNameMap {
480
+ 'qti-rule': QtiRule;
481
+ }
482
+ }
483
+
484
+ declare class QtiPortableCustomInteraction extends QtiElement {
485
+ private responseIdentifier;
486
+ private module;
487
+ private customInteractionTypeIdentifier;
488
+ private baseUrl;
489
+ private _errorMessage;
490
+ static get properties(): {
491
+ responseIdentifier: {
492
+ type: StringConstructor;
493
+ attribute: string;
494
+ };
495
+ module: {
496
+ type: StringConstructor;
497
+ attribute: string;
498
+ };
499
+ customInteractionTypeIdentifier: {
500
+ type: StringConstructor;
501
+ attribute: string;
502
+ };
503
+ baseUrl: {
504
+ type: StringConstructor;
505
+ attribute: string;
506
+ };
507
+ _errorMessage: {
508
+ type: StringConstructor;
509
+ state: boolean;
510
+ };
511
+ };
512
+ getTAOConfig(node: any): {} | void;
513
+ register(item: any): void;
514
+ connectedCallback(): void;
515
+ render(): lit_html.TemplateResult<1>;
516
+ }
517
+
518
+ interface IInteraction {
519
+ disabled: boolean;
520
+ readonly: boolean;
521
+ response: ResponseType$1;
522
+ reset(): any;
523
+ validate(): boolean;
524
+ }
525
+
526
+ declare const QtiAssociateInteraction_base: (new (...args: any[]) => IInteraction) & typeof QtiElement;
527
+ declare class QtiAssociateInteraction extends QtiAssociateInteraction_base {
528
+ private _childrenMap;
529
+ static styles: lit.CSSResult;
530
+ render(): lit_html.TemplateResult<1>;
531
+ connectedCallback(): void;
532
+ }
533
+
534
+ declare class qtiSimpleAssociableChoice extends LitElement {
535
+ connectedCallback(): void;
536
+ render(): lit_html.TemplateResult<1>;
537
+ }
538
+
539
+ declare const QtiGapMatchInteraction_base: (new (...args: any[]) => IInteraction) & typeof LitElement;
540
+ declare class QtiGapMatchInteraction extends QtiGapMatchInteraction_base {
541
+ static styles: lit.CSSResult;
542
+ render(): lit_html.TemplateResult<1>;
543
+ }
544
+
545
+ declare class QtiGapText extends LitElement {
546
+ connectedCallback(): void;
547
+ render(): lit_html.TemplateResult<1>;
548
+ }
549
+
550
+ declare class QtiGap extends LitElement {
551
+ render(): lit_html.TemplateResult<1>;
552
+ }
553
+
554
+ declare class QtiGraphicAssociateInteraction extends Choices {
555
+ choiceOrdering: boolean;
556
+ static styles: lit.CSSResult[];
557
+ render(): lit_html.TemplateResult<1>;
558
+ private positionHotspotOnRegister;
559
+ connectedCallback(): void;
560
+ disconnectedCallback(): void;
561
+ }
562
+
563
+ declare const QtiGraphicGapMatchInteraction_base: (new (...args: any[]) => IInteraction) & typeof QtiElement;
564
+ declare class QtiGraphicGapMatchInteraction extends QtiGraphicGapMatchInteraction_base {
565
+ static styles: lit.CSSResult;
566
+ render(): lit_html.TemplateResult<1>;
567
+ private positionHotspotOnRegister;
568
+ connectedCallback(): void;
569
+ disconnectedCallback(): void;
570
+ }
571
+
572
+ declare class QtiGraphicOrderInteraction extends Choices {
573
+ choiceOrdering: boolean;
574
+ static styles: lit.CSSResult[];
575
+ render(): lit_html.TemplateResult<1>;
576
+ private setHotspotOrder;
577
+ private positionHotspotOnRegister;
578
+ connectedCallback(): void;
579
+ disconnectedCallback(): void;
580
+ }
581
+
582
+ declare class QtiHotspotInteraction extends Choices {
583
+ static styles: lit.CSSResult[];
584
+ render(): lit_html.TemplateResult<1>;
585
+ private positionHotspotOnRegister;
586
+ connectedCallback(): void;
587
+ disconnectedCallback(): void;
588
+ }
589
+
590
+ declare class QtiHotspotChoice extends QtiChoice {
591
+ order: number;
592
+ static styles: lit.CSSResult;
593
+ }
594
+
595
+ declare const QtiMatchInteraction_base: (new (...args: any[]) => IInteraction) & typeof LitElement;
596
+ declare class QtiMatchInteraction extends QtiMatchInteraction_base {
597
+ static styles: lit.CSSResult[];
598
+ render(): lit_html.TemplateResult<1>;
599
+ }
600
+
601
+ declare class QtiMediaInteraction extends Interaction {
602
+ value: number;
603
+ reset(): void;
604
+ validate(): boolean;
605
+ set response(val: undefined);
606
+ static get properties(): {
607
+ step: {
608
+ type: NumberConstructor;
609
+ attribute: string;
610
+ default: number;
611
+ };
612
+ };
613
+ static styles: lit.CSSResult[];
614
+ render(): lit_html.TemplateResult<1>;
615
+ constructor();
616
+ connectedCallback(): void;
617
+ }
618
+
619
+ declare const QtiOrderInteraction_base: (new (...args: any[]) => IInteraction) & typeof QtiElement;
620
+ declare class QtiOrderInteraction extends QtiOrderInteraction_base {
621
+ childrenMap: Element[];
622
+ private _classNames;
623
+ private _orientation;
624
+ static layoutClass: string[];
625
+ static get properties(): {
626
+ _classNames: {
627
+ type: StringConstructor;
628
+ attribute: string;
629
+ };
630
+ _orientation: {
631
+ type: StringConstructor;
632
+ attribute: string;
633
+ };
634
+ };
635
+ static styles: lit.CSSResult[];
636
+ render(): lit_html.TemplateResult<1>;
637
+ connectedCallback(): void;
638
+ }
639
+
640
+ declare class QtiSelectPointInteraction extends Choices {
641
+ static styles: lit.CSSResult[];
642
+ choiceOrdering: boolean;
643
+ render(): lit_html.TemplateResult<1>;
644
+ constructor();
645
+ connectedCallback(): void;
646
+ disconnectedCallback(): void;
647
+ }
648
+
649
+ declare class QtiSliderInteraction extends Interaction {
650
+ private _knob;
651
+ private _rail;
652
+ value: number;
653
+ stepLabel: boolean;
654
+ reverse: boolean;
655
+ private _min;
656
+ set min(value: number);
657
+ get min(): number;
658
+ private _max;
659
+ set max(value: number);
660
+ get max(): number;
661
+ private _step;
662
+ set step(value: number);
663
+ get step(): number;
664
+ _handleDisabledChange: (old: any, disabled: any) => void;
665
+ _handleReadonlyChange: (old: any, readonly: any) => void;
666
+ reset(): void;
667
+ validate(): boolean;
668
+ set response(myResponse: ResponseType$1);
669
+ static styles: lit.CSSResult[];
670
+ render(): lit_html.TemplateResult<1>;
671
+ connectedCallback(): void;
672
+ private _onTouchMove;
673
+ private _onMouseDown;
674
+ /** calculateValue gets x position and compares this with the total width in pixels */
675
+ private calculateValue;
676
+ private getPositionFromEvent;
677
+ }
678
+
679
+ /**
680
+ * Copyright (c) 2020 Jonas Jelonek <jonas.jelonek@protonmail.ch>
681
+ * https://github.com/jonasjelonek/TouchDragAndDrop
682
+ */
683
+ declare class TouchDragAndDrop {
684
+ _touchBegin: number;
685
+ _touchDown: any;
686
+ _lastClick: number;
687
+ _canDrag: boolean;
688
+ _dragSrc: any;
689
+ _dragCopy: any;
690
+ _touchEndCalled: boolean;
691
+ _dragRunning: boolean;
692
+ _dataTransfer: {
693
+ data: {};
694
+ setData: (type: any, val: any) => void;
695
+ getData: (type: any) => any;
696
+ effectAllowed: string;
697
+ };
698
+ _copyOffset: {
699
+ x: number;
700
+ y: number;
701
+ };
702
+ _lastTarget: any;
703
+ _currentDropContainer: any;
704
+ _handleClick: boolean;
705
+ _DBLCLICKDELAY: number;
706
+ _CONTEXTMENUDELAY: number;
707
+ _DRAGDELTA: number;
708
+ _COPYOPACITY: number;
709
+ static _instance: TouchDragAndDrop;
710
+ copyStylesDragClone: boolean;
711
+ dragOnClick: boolean;
712
+ constructor();
713
+ addDraggables(draggables: Element[]): void;
714
+ /**
715
+ * Callback for touchstart event listener.
716
+ * @param {TouchEvent} e
717
+ */
718
+ _touchStart(e: any): void;
719
+ /**
720
+ * Callback for touchmove event listener.
721
+ * @param {TouchEvent} e
722
+ */
723
+ _touchMove(e: any): void;
724
+ createDragCopy: (e: any, _touches: {
725
+ clientX: number;
726
+ clientY: number;
727
+ }) => void;
728
+ /**
729
+ * Callback for touchend event listener.
730
+ * @param {TouchEvent} e
731
+ */
732
+ _touchEnd(e: any): void;
733
+ /**
734
+ * Callback for touchcancel event listener, in case browser supports this.
735
+ * @param {TouchEvent} e
736
+ */
737
+ _touchCancel(e: any): void;
738
+ /**
739
+ * Determines the next droppable element at current point.
740
+ * @param {Object} pt
741
+ */
742
+ _findDroppable(event: any): any;
743
+ _getPoint(event: any, page?: any): {
744
+ x: any;
745
+ y: any;
746
+ };
747
+ /**
748
+ * Calculates the offset for displaying the drag copy to have a seamless dragging.
749
+ * @param {Touch} touch The current touch.
750
+ */
751
+ _calculateDragCopyPosition(touch: any): void;
752
+ /**
753
+ * Calculates the pixel delta between first touch and the current touch position.
754
+ * @param {Object} touch
755
+ */
756
+ _getDelta(touch: any): number;
757
+ /**
758
+ *
759
+ * @param {Element} e The event's target element.
760
+ * @param {string} eventType The type of the event.
761
+ * @param {bool} bubble Sets whether the event should bubble.
762
+ */
763
+ _dispatchEvent(e: any, eventType: any, bubble?: boolean): boolean;
764
+ /**
765
+ * Resets all variables and prepares for new Drag and Drop.
766
+ */
767
+ _reset(): void;
768
+ private getPositionFromEvent;
769
+ }
770
+
771
+ type Constructor$2<T> = new (...args: any[]) => T;
772
+ declare const DragDropInteractionMixin: <T extends Constructor$2<LitElement>>(superClass: T, draggablesSelector: string, droppablesInShadowRoot: boolean, droppablesSelector: string) => Constructor$2<IInteraction> & T;
773
+
774
+ type Constructor$1<T> = new (...args: any[]) => T;
775
+ declare class DroppablesInterface {
776
+ }
777
+ declare const DroppablesMixin: <T extends Constructor$1<LitElement>>(superClass: T, droppablesInShadowRoot: boolean, droppablesSelector: string) => Constructor$1<DroppablesInterface> & T;
778
+
779
+ type Constructor<T> = new (...args: any[]) => T;
780
+ declare class FlippablesInterface {
781
+ connectedCallback(): void;
782
+ disconnectedCallback(): void;
783
+ }
784
+ declare const FlippablesMixin: <T extends Constructor<LitElement>>(superClass: T, droppablesSel: string, draggablesSel: string) => Constructor<FlippablesInterface> & T;
785
+
786
+ export { BaseType, Cardinality, Choices, DragDropInteractionMixin, DroppablesMixin, Events, FlippablesInterface, FlippablesMixin, InteractionChangedDetails, OutcomeChangedDetails, QtiAssociateInteraction, QtiChoice, qtiChoiceElementSelected as QtiChoiceElementSelected, QtiCompanionMaterialsInfo, QtiExtendedTextInteraction, QtiFeedbackInline, QtiGap, QtiGapMatchInteraction, QtiGapText, QtiGraphicAssociateInteraction, QtiGraphicGapMatchInteraction, QtiGraphicOrderInteraction, QtiHotspotChoice, QtiHotspotInteraction, QtiHottext, QtiHottextInteraction, QtiInlineChoiceInteraction, qtiInteractionChanged as QtiInteractionChanged, qtiInteractionResponse as QtiInteractionResponse, qtiLooseChoice as QtiLooseChoice, QtiMatchInteraction, QtiMediaInteraction, QtiModalFeedback, QtiOrderInteraction, qtiOutcomeChanged as QtiOutcomeChanged, QtiOutcomeDeclaration, QtiPortableCustomInteraction, QtiPrompt, qtiRegisterChoice as QtiRegisterChoice, qtiRegisterHotspot as QtiRegisterHotspot, qtiRegisterInteraction as QtiRegisterInteraction, qtiRegisterVariable as QtiRegisterVariable, QtiResponseDeclaration, QtiResponseProcessing, QtiRule, QtiSelectPointInteraction, QtiSliderInteraction, QtiStylesheet, QtiTextEntryInteraction, QtiVariableJSON, ResponseInteraction, ResponseType$1 as ResponseType, TouchDragAndDrop, qtiContentBody, qtiRubricBlock, qtiSimpleAssociableChoice };