@citolab/qti-components 6.0.19 → 6.0.22

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 (46) hide show
  1. package/dist/audience-context-444478f4.d.ts +8 -0
  2. package/dist/chunk-3O4URV5U.cjs +1 -0
  3. package/dist/chunk-5GG2XAUT.js +1 -0
  4. package/dist/chunk-6RJ7J4AE.cjs +1 -0
  5. package/dist/{chunk-UD6XWG6V.js → chunk-GEVRCVN2.cjs} +7 -14
  6. package/dist/chunk-GGEPFBR7.cjs +1 -0
  7. package/dist/chunk-HOQW4KDA.cjs +1 -0
  8. package/dist/chunk-M7QOVOG6.js +1 -0
  9. package/dist/{chunk-FIJLDR56.js → chunk-YDFMBQT4.js} +6 -12
  10. package/dist/context/index.cjs +1 -0
  11. package/dist/context/index.d.cts +1 -0
  12. package/dist/context/index.d.ts +1 -1
  13. package/dist/context/index.js +1 -1
  14. package/dist/decorators/index.cjs +1 -0
  15. package/dist/decorators/index.d.cts +37 -0
  16. package/dist/decorators/index.js +1 -1
  17. package/dist/index.cjs +2889 -0
  18. package/dist/index.d.cts +1063 -0
  19. package/dist/index.d.ts +27 -16
  20. package/dist/index.js +79 -80
  21. package/dist/{qti-assessment-item-68bcc951.d.ts → qti-assessment-item-c1eb7de3.d.ts} +5 -5
  22. package/dist/qti-components/index.cjs +419 -0
  23. package/dist/qti-components/index.d.cts +560 -0
  24. package/dist/qti-components/index.d.ts +21 -12
  25. package/dist/qti-components/index.js +74 -68
  26. package/dist/qti-item/index.cjs +1 -0
  27. package/dist/qti-item/index.d.cts +4 -0
  28. package/dist/qti-item/index.d.ts +2 -2
  29. package/dist/qti-item/index.js +1 -1
  30. package/dist/{qti-item-8c26fa9e.d.ts → qti-item-e2edd87f.d.ts} +1 -1
  31. package/dist/qti-item-react/index.cjs +1 -0
  32. package/dist/qti-item-react/index.d.cts +30 -0
  33. package/dist/qti-item-react/index.d.ts +3 -3
  34. package/dist/qti-item-react/index.js +1 -1
  35. package/dist/{qti-simple-choice-ca9b86db.d.ts → qti-simple-choice-e28cfb34.d.ts} +6 -3
  36. package/dist/qti-transform/index.cjs +17 -0
  37. package/dist/qti-transform/index.d.cts +17 -0
  38. package/package.json +25 -15
  39. package/dist/chunk-HQKT4SJF.js +0 -1
  40. package/dist/chunk-RPGALUIV.js +0 -1
  41. package/dist/context-a957e50e.d.ts +0 -9
  42. package/dist/custom-elements.json +0 -6766
  43. package/dist/index.css +0 -2200
  44. package/dist/qti-assessment-item-f1fcf393.d.ts +0 -120
  45. package/dist/qti-item-e1fc6a70.d.ts +0 -30
  46. package/dist/qti-simple-choice-d1392d78.d.ts +0 -352
@@ -0,0 +1,1063 @@
1
+ import * as lit from 'lit';
2
+ import { LitElement, CSSResultGroup, PropertyValueMap } from 'lit';
3
+ import * as lit_html from 'lit-html';
4
+ import { ContextConsumer } from '@lit-labs/context';
5
+ import * as lit_html_directives_ref from 'lit-html/directives/ref';
6
+ import * as cheerio from 'cheerio';
7
+
8
+ interface directedPair {
9
+ destination: string;
10
+ source: string;
11
+ }
12
+ interface ResponseInteraction {
13
+ responseIdentifier: string;
14
+ response: string | string[];
15
+ }
16
+ interface Calculate {
17
+ calculate: () => string | string[];
18
+ }
19
+ type float = number;
20
+ type integer = number;
21
+ type BaseType = 'boolean' | 'directedPair' | 'duration' | 'float' | 'integer' | 'string' | 'identifier' | 'pair';
22
+ type Multiple = string | string[][];
23
+ type Ordered = string | string[][];
24
+ type Cardinality = 'multiple' | 'ordered' | 'single';
25
+
26
+ interface OutcomeChangedDetails {
27
+ item: string;
28
+ outcomeIdentifier: string;
29
+ value: number | string | string[];
30
+ }
31
+ type InteractionChangedDetails = ResponseInteraction & {
32
+ item: string;
33
+ };
34
+
35
+ type QtiOutcomeChanged = CustomEvent<OutcomeChangedDetails>;
36
+ declare global {
37
+ interface GlobalEventHandlersEventMap {
38
+ 'qti-outcome-changed': QtiOutcomeChanged;
39
+ }
40
+ }
41
+
42
+ type qtiOutcomeChanged_QtiOutcomeChanged = QtiOutcomeChanged;
43
+ declare namespace qtiOutcomeChanged {
44
+ export {
45
+ qtiOutcomeChanged_QtiOutcomeChanged as QtiOutcomeChanged,
46
+ QtiOutcomeChanged as default,
47
+ };
48
+ }
49
+
50
+ type QtiInteractionChanged = CustomEvent<InteractionChangedDetails>;
51
+ declare global {
52
+ interface GlobalEventHandlersEventMap {
53
+ "qti-interaction-changed": QtiInteractionChanged;
54
+ }
55
+ }
56
+
57
+ type qtiInteractionChanged_QtiInteractionChanged = QtiInteractionChanged;
58
+ declare namespace qtiInteractionChanged {
59
+ export {
60
+ qtiInteractionChanged_QtiInteractionChanged as QtiInteractionChanged,
61
+ QtiInteractionChanged as default,
62
+ };
63
+ }
64
+
65
+ interface VariableDeclaration<T> {
66
+ identifier: string;
67
+ cardinality: Cardinality;
68
+ baseType: BaseType;
69
+ value: T;
70
+ }
71
+
72
+ type QtiRegisterVariable = CustomEvent<{
73
+ variable: VariableDeclaration<number | string | string[]>;
74
+ }>;
75
+ declare global {
76
+ interface GlobalEventHandlersEventMap {
77
+ "qti-register-variable": QtiRegisterVariable;
78
+ }
79
+ }
80
+
81
+ declare namespace qtiRegisterVariable {
82
+ export {
83
+ QtiRegisterVariable as default,
84
+ };
85
+ }
86
+
87
+ type QtiRegisterInteraction = CustomEvent<Record<PropertyKey, never>>;
88
+ declare global {
89
+ interface GlobalEventHandlersEventMap {
90
+ 'qti-register-interaction': QtiRegisterInteraction;
91
+ }
92
+ }
93
+
94
+ declare namespace qtiRegisterInteraction {
95
+ export {
96
+ QtiRegisterInteraction as default,
97
+ };
98
+ }
99
+
100
+ type QtiRegisterChoice = CustomEvent<Record<PropertyKey, never>>;
101
+ declare global {
102
+ interface GlobalEventHandlersEventMap {
103
+ 'qti-register-choice': QtiRegisterChoice;
104
+ }
105
+ }
106
+
107
+ declare namespace qtiRegisterChoice {
108
+ export {
109
+ QtiRegisterChoice as default,
110
+ };
111
+ }
112
+
113
+ type QtiRegisterHotspot = CustomEvent<Record<PropertyKey, never>>;
114
+ declare global {
115
+ interface GlobalEventHandlersEventMap {
116
+ 'qti-register-hotspot': QtiRegisterHotspot;
117
+ }
118
+ }
119
+
120
+ declare namespace qtiRegisterHotspot {
121
+ export {
122
+ QtiRegisterHotspot as default,
123
+ };
124
+ }
125
+
126
+ type QtiLooseChoice = CustomEvent<Record<PropertyKey, never>>;
127
+ declare global {
128
+ interface GlobalEventHandlersEventMap {
129
+ 'qti-loose-choice': QtiLooseChoice;
130
+ }
131
+ }
132
+
133
+ declare namespace qtiLooseChoice {
134
+ export {
135
+ QtiLooseChoice as default,
136
+ };
137
+ }
138
+
139
+ type QtiInteractionResponse = CustomEvent<ResponseInteraction>;
140
+ declare global {
141
+ interface GlobalEventHandlersEventMap {
142
+ 'qti-interaction-response': QtiInteractionResponse;
143
+ }
144
+ }
145
+
146
+ declare namespace qtiInteractionResponse {
147
+ export {
148
+ QtiInteractionResponse as default,
149
+ };
150
+ }
151
+
152
+ type QtiChoiceElementSelected = CustomEvent<{
153
+ identifier: string;
154
+ checked: boolean;
155
+ }>;
156
+ declare global {
157
+ interface GlobalEventHandlersEventMap {
158
+ 'qti-choice-element-selected': QtiChoiceElementSelected;
159
+ }
160
+ }
161
+
162
+ declare namespace qtiChoiceElementSelected {
163
+ export {
164
+ QtiChoiceElementSelected as default,
165
+ };
166
+ }
167
+
168
+ declare const Events: {
169
+ ON_OUTCOME_CHANGED: string;
170
+ ON_INTERACTION_CHANGED: string;
171
+ ON_REGISTER_VARIABLE: string;
172
+ ON_REGISTER_FEEDBACK: string;
173
+ ON_REGISTER_INTERACTION: string;
174
+ ON_REGISTER_CHOICE: string;
175
+ ON_REGISTER_HOTSPOT: string;
176
+ ON_LOOSE_CHOICE: string;
177
+ ON_INTERACTION_RESPONSE: string;
178
+ ON_DROPDOWN_SELECTED: string;
179
+ ON_CHOICE_ELEMENT_SELECTED: string;
180
+ };
181
+
182
+ declare class QtiMapping extends LitElement {
183
+ defaultValue: number;
184
+ lowerBound: number;
185
+ upperBound: number;
186
+ get mapEntries(): {
187
+ mapKey: string;
188
+ mappedValue: number;
189
+ }[];
190
+ }
191
+
192
+ declare class ResponseVariable implements VariableDeclaration<string | string[]> {
193
+ private _candidateResponse;
194
+ private _mapping;
195
+ private _correctResponse;
196
+ private _cardinality;
197
+ private _identifier;
198
+ private _basetype;
199
+ private _qtiVariable;
200
+ constructor({ mapping, correctResponse, cardinality, baseType, identifier, }: {
201
+ mapping: QtiMapping;
202
+ correctResponse: string | string[];
203
+ cardinality: Cardinality;
204
+ baseType: BaseType;
205
+ identifier: string;
206
+ });
207
+ get mapping(): QtiMapping;
208
+ get correctResponse(): string | string[];
209
+ get cardinality(): Cardinality;
210
+ get baseType(): BaseType;
211
+ get identifier(): string;
212
+ get value(): string | string[];
213
+ set value(val: string | string[]);
214
+ }
215
+
216
+ declare class OutcomeVariable implements VariableDeclaration<number | string | string[] | undefined> {
217
+ identifier: string;
218
+ cardinality: Cardinality;
219
+ baseType: BaseType;
220
+ value: number | string | string[] | undefined;
221
+ }
222
+
223
+ /**
224
+ * @summary The qti-assessment-item element contains all the other QTI 3 item structures.
225
+ * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.dltnnj87l0yj
226
+ * @status stable
227
+ * @since 4.0
228
+ *
229
+ * @dependency qti-feedback
230
+ * @dependency qti-responseprocessing
231
+ *
232
+ * @slot - The default slot where all the other QTI 3 item structures go.
233
+ *
234
+ * @event qti-interaction-changed - Emitted when an interaction is changed.
235
+ * @event qti-outcome-changed - Emitted when the radio group receives user input.
236
+ *
237
+ */
238
+ declare class QtiAssessmentItem extends LitElement {
239
+ variables: VariableDeclaration<(string | string[]) | number>[];
240
+ private feedbackElements;
241
+ private interactionElements;
242
+ disabled: boolean;
243
+ readonly: boolean;
244
+ title: string;
245
+ identifier: string;
246
+ render(): lit_html.TemplateResult<1>;
247
+ _handleDisabledChange: (_: boolean, disabled: boolean) => void;
248
+ _handleReadonlyChange: (_: boolean, readonly: boolean) => void;
249
+ constructor();
250
+ connectedCallback(): void;
251
+ disconnectedCallback(): void;
252
+ private _registerVariable;
253
+ showCorrectResponse(): void;
254
+ processResponse(): boolean;
255
+ set responses(myResponses: ResponseInteraction[]);
256
+ resetInteractions(): void;
257
+ validateResponses(): boolean;
258
+ getVariable(identifier: string): VariableDeclaration<any>;
259
+ getResponse(identifier: string): ResponseVariable | null;
260
+ getOutcome(identifier: string): OutcomeVariable | null;
261
+ private registerFeedbackElement;
262
+ private registerInteractionElement;
263
+ private interactionResponse;
264
+ private outcomeChanged;
265
+ private showFeedback;
266
+ setOutcomeValue(identifier: string, value: string | number): void;
267
+ }
268
+ declare global {
269
+ interface HTMLElementTagNameMap {
270
+ 'qti-assessment-item': QtiAssessmentItem;
271
+ }
272
+ }
273
+
274
+ declare class QtiStylesheet extends LitElement {
275
+ private styleLink;
276
+ constructor();
277
+ connectedCallback(): void;
278
+ disconnectedCallback(): void;
279
+ }
280
+
281
+ /**
282
+ * @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.
283
+ * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.sphpo6lu6zqi
284
+ * @status stable
285
+ * @since 4.0
286
+ *
287
+ * @slot - item body content.
288
+ * @slot qti-rubric-block - the qti rubric block is placed above the item
289
+ *
290
+ */
291
+ declare class QtiItemBody extends LitElement {
292
+ static styles: CSSResultGroup;
293
+ render(): lit_html.TemplateResult<1>;
294
+ }
295
+ declare global {
296
+ interface HTMLElementTagNameMap {
297
+ 'qti-item-body': QtiItemBody;
298
+ }
299
+ }
300
+
301
+ declare class QtiPrompt extends LitElement {
302
+ render(): lit_html.TemplateResult<1>;
303
+ connectedCallback(): void;
304
+ }
305
+
306
+ /**
307
+ * @summary qti-choice is used by qti-simple-choice, qti-inline-choice, qti-hottext, qti-hotspot-choice.
308
+ *
309
+ * @since 1.0
310
+ * @status stable
311
+ *
312
+ * @event qti-register-choice - register itselves on a qti-choice-interaction element.
313
+ * @event qti-loose-choice - de-register itselves on a qti-choice-interaction element.
314
+ * @event qti-choice-element-selected - Emitted when the choice is selected.
315
+ *
316
+ * @slot - The choices slot element
317
+ */
318
+ declare abstract class QtiChoice extends LitElement {
319
+ identifier: string;
320
+ tabindex: number | undefined;
321
+ disabled: boolean;
322
+ readonly: boolean;
323
+ checked: boolean;
324
+ handleDisabledChange(_: boolean, disabled: boolean): void;
325
+ connectedCallback(): void;
326
+ disconnectedCallback(): void;
327
+ reset(): void;
328
+ private _onKeyUp;
329
+ private _onClick;
330
+ private _toggleChecked;
331
+ validateAllProps(): boolean;
332
+ render(): lit_html.TemplateResult;
333
+ }
334
+ declare global {
335
+ interface HTMLElementTagNameMap {
336
+ 'qti-choice': QtiChoice;
337
+ }
338
+ }
339
+
340
+ declare class QtiVariableDeclaration extends LitElement {
341
+ render(): lit_html.TemplateResult<1>;
342
+ }
343
+
344
+ declare class QtiResponseDeclaration extends QtiVariableDeclaration {
345
+ baseType: BaseType;
346
+ identifier: string;
347
+ cardinality: Cardinality;
348
+ connectedCallback(): void;
349
+ private get correctResponse();
350
+ private get mapping();
351
+ }
352
+
353
+ declare class QtiOutcomeDeclaration extends QtiVariableDeclaration {
354
+ baseType: BaseType;
355
+ identifier: string;
356
+ cardinality: Cardinality;
357
+ get interpolationTable(): any;
358
+ connectedCallback(): void;
359
+ }
360
+
361
+ declare class QtiCompanionMaterialsInfo extends LitElement {
362
+ }
363
+
364
+ interface Audience {
365
+ view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor';
366
+ }
367
+
368
+ declare class qtiRubricBlock extends LitElement {
369
+ id: any;
370
+ use: 'instructions' | 'scoring' | 'navigation';
371
+ view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor';
372
+ classNames: any;
373
+ handleclassNamesChange(old: any, disabled: boolean): void;
374
+ static styles: lit.CSSResult;
375
+ logger: ContextConsumer<{
376
+ __context__: Audience;
377
+ }, this>;
378
+ render(): lit_html.TemplateResult<1>;
379
+ connectedCallback(): void;
380
+ }
381
+
382
+ declare class qtiContentBody extends LitElement {
383
+ render(): lit_html.TemplateResult<1>;
384
+ }
385
+
386
+ declare abstract class QtiFeedback extends LitElement {
387
+ protected showHide: string;
388
+ protected outcomeIdentifier: string;
389
+ protected identifier: string;
390
+ protected showStatus: string;
391
+ constructor();
392
+ connectedCallback(): void;
393
+ checkShowFeedback(outcomeIdentifier: string): void;
394
+ private showFeedback;
395
+ }
396
+
397
+ declare class QtiFeedbackInline extends QtiFeedback {
398
+ static styles: lit.CSSResult;
399
+ render: () => lit_html.TemplateResult<1>;
400
+ }
401
+
402
+ declare class QtiModalFeedback extends QtiFeedback {
403
+ render(): lit_html.TemplateResult<1>;
404
+ }
405
+
406
+ declare class QtiFeedbackBlock extends QtiFeedback {
407
+ render(): lit_html.TemplateResult<1>;
408
+ protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
409
+ }
410
+
411
+ declare abstract class Interaction extends LitElement {
412
+ responseIdentifier: string;
413
+ /** disabled should be exposed to the attributes and accessible as property */
414
+ disabled: boolean;
415
+ /** readonly should be exposed to the attributes and accessible as property */
416
+ readonly: boolean;
417
+ abstract reset(): void;
418
+ abstract validate(): boolean;
419
+ abstract set response(val: string | string[]);
420
+ connectedCallback(): void;
421
+ saveResponse(value: string | string[]): void;
422
+ }
423
+
424
+ declare class QtiTextEntryInteraction extends Interaction {
425
+ expectedLength: number;
426
+ patternMask: string;
427
+ placeholderText: string;
428
+ private _value;
429
+ private _size;
430
+ inputRef: lit_html_directives_ref.Ref<HTMLInputElement>;
431
+ classNames: any;
432
+ handleclassNamesChange(old: any, classes: string): void;
433
+ set response(value: string | undefined);
434
+ validate(): boolean;
435
+ static get styles(): lit.CSSResult[];
436
+ render(): lit_html.TemplateResult<1>;
437
+ protected textChanged(event: Event): void;
438
+ reset(): void;
439
+ private setEmptyAttribute;
440
+ }
441
+ declare global {
442
+ interface HTMLElementTagNameMap {
443
+ 'qti-text-entry-interaction': QtiTextEntryInteraction;
444
+ }
445
+ }
446
+
447
+ declare class QtiExtendedTextInteraction extends Interaction {
448
+ textareaRef: lit_html_directives_ref.Ref<HTMLTextAreaElement>;
449
+ /** expected length is mapped to the property maxlength on the textarea */
450
+ expectedLength: number;
451
+ patternMask: string;
452
+ /** text appearing in the extended-text-nteraction if it is empty */
453
+ placeholderText: string;
454
+ private _value;
455
+ classNames: any;
456
+ handleclassNamesChange(old: any, disabled: boolean): void;
457
+ set response(value: string);
458
+ validate(): boolean;
459
+ static get styles(): lit.CSSResult[];
460
+ render(): lit_html.TemplateResult<1>;
461
+ protected textChanged(event: Event): void;
462
+ reset(): void;
463
+ private setEmptyAttribute;
464
+ }
465
+ declare global {
466
+ interface HTMLElementTagNameMap {
467
+ 'qti-extended-text-interaction': QtiExtendedTextInteraction;
468
+ }
469
+ }
470
+
471
+ declare abstract class Choices extends Interaction {
472
+ protected _choiceElements: QtiChoice[];
473
+ /** the minimal number of selections a candidate must make */
474
+ minChoices: number;
475
+ /** the maximum number of selections a candidate must make, the other options will be disabled when max options is checked */
476
+ maxChoices: number;
477
+ _handleDisabledChange: (_: boolean, disabled: boolean) => void;
478
+ _handleReadonlyChange: (_: boolean, readonly: boolean) => void;
479
+ _handleMaxChoicesChange: () => void;
480
+ constructor();
481
+ reset(): void;
482
+ validate(): boolean;
483
+ set response(myResponse: ResponseType);
484
+ connectedCallback(): void;
485
+ disconnectedCallback(): void;
486
+ private _registerChoiceElement;
487
+ private _looseChoiceElement;
488
+ private _determineInputType;
489
+ private _setInputType;
490
+ private _choiceElementSelectedHandler;
491
+ private _choiceElementSelected;
492
+ }
493
+
494
+ declare class QtiHottextInteraction extends Choices {
495
+ connectedCallback(): void;
496
+ render: () => lit_html.TemplateResult<1>;
497
+ }
498
+
499
+ interface OptionType {
500
+ textContent: string;
501
+ value: string;
502
+ selected: boolean;
503
+ }
504
+ declare class QtiInlineChoiceInteraction extends Interaction {
505
+ options: OptionType[];
506
+ static inputWidthClass: string[];
507
+ static get properties(): {
508
+ options: {
509
+ type: ArrayConstructor;
510
+ value: any[];
511
+ attribute: boolean;
512
+ };
513
+ };
514
+ connectedCallback(): void;
515
+ static get styles(): lit.CSSResult[];
516
+ render(): lit_html.TemplateResult<1>;
517
+ constructor();
518
+ validate(): boolean;
519
+ reset(): void;
520
+ set response(value: string);
521
+ choiceSelected(event: Event): void;
522
+ }
523
+
524
+ /**
525
+ * @summary The ChoiceInteraction.Type (qti-choice-interaction) interaction presents a collection of choices to the candidate.
526
+ * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.j9nu1oa1tu3b
527
+ * @status stable
528
+ * @since 6.0
529
+ *
530
+ * @event qti-register-interaction - emitted when the interaction wants to register itself
531
+ * @event qti-interaction-response - emitted when the interaction changes
532
+ *
533
+ * @slot - The default slot where <qti-simple-choice> must be placed.
534
+ * @slot prompt - slot where the prompt is placed.
535
+ */
536
+ declare class QtiChoiceInteraction extends Choices {
537
+ static styles: CSSResultGroup;
538
+ /** orientation of choices */
539
+ orientation: 'horizontal' | 'vertical';
540
+ render: () => lit_html.TemplateResult<1>;
541
+ }
542
+ declare global {
543
+ interface HTMLElementTagNameMap {
544
+ 'qti-choice-interaction': QtiChoiceInteraction;
545
+ }
546
+ }
547
+
548
+ declare class QtiResponseProcessing extends LitElement {
549
+ render(): lit_html.TemplateResult<1>;
550
+ static get observedAttributes(): string[];
551
+ process(): void;
552
+ private fragmentFromString;
553
+ }
554
+ declare global {
555
+ interface HTMLElementTagNameMap {
556
+ 'qti-response-processing': QtiResponseProcessing;
557
+ }
558
+ }
559
+
560
+ declare class QtiRule extends LitElement {
561
+ render(): lit_html.TemplateResult<1>;
562
+ process(): void;
563
+ }
564
+ declare global {
565
+ interface HTMLElementTagNameMap {
566
+ 'qti-rule': QtiRule;
567
+ }
568
+ }
569
+
570
+ declare class QtiResponseCondition extends QtiRule {
571
+ render(): lit_html.TemplateResult<1>;
572
+ process(): void;
573
+ }
574
+
575
+ declare class QtiSetOutcomeValue extends QtiRule {
576
+ process(): void;
577
+ }
578
+
579
+ declare class QtiResponseElse extends LitElement {
580
+ static get properties(): {
581
+ debugCalculateResult: {
582
+ type: ObjectConstructor;
583
+ };
584
+ };
585
+ render(): lit_html.TemplateResult<1>;
586
+ calculate(): boolean;
587
+ getSubRules(): QtiRule[];
588
+ process(): void;
589
+ }
590
+
591
+ declare class QtiResponseIf extends QtiResponseElse {
592
+ render(): lit_html.TemplateResult<1>;
593
+ calculate(): boolean;
594
+ getSubRules(): QtiRule[];
595
+ }
596
+
597
+ declare class QtiResponseElseIf extends QtiResponseIf {
598
+ render(): lit_html.TemplateResult<1>;
599
+ }
600
+
601
+ declare class QtiExpression<T> extends LitElement {
602
+ protected _error: any[];
603
+ protected set error(val: string);
604
+ static styles: lit.CSSResult;
605
+ render(): lit_html.TemplateResult<1>;
606
+ calculate(): T;
607
+ protected get assessmentItem(): QtiAssessmentItem;
608
+ protected getVariables: () => VariableDeclaration<string | string[]>[];
609
+ }
610
+
611
+ declare class QtiGt extends QtiExpression<boolean> {
612
+ calculate(): boolean;
613
+ }
614
+
615
+ declare class QtiConditionExpression extends QtiExpression<boolean> {
616
+ render(): lit_html.TemplateResult<1>;
617
+ calculate(): boolean;
618
+ }
619
+
620
+ declare class QtiGte extends QtiConditionExpression {
621
+ calculate(): boolean;
622
+ }
623
+
624
+ declare class QtiLt extends QtiExpression<boolean> {
625
+ calculate(): boolean;
626
+ }
627
+
628
+ declare class QtiLte extends QtiConditionExpression {
629
+ calculate(): boolean;
630
+ }
631
+
632
+ declare class QtiAnd extends QtiConditionExpression {
633
+ render(): lit_html.TemplateResult<1>;
634
+ calculate(): boolean;
635
+ }
636
+
637
+ declare class QtiProduct extends QtiExpression<number> {
638
+ mult: number;
639
+ render: () => lit_html.TemplateResult<1>;
640
+ calculate(): number;
641
+ }
642
+
643
+ declare class QtiOr extends QtiConditionExpression {
644
+ render(): lit_html.TemplateResult<1>;
645
+ calculate(): boolean;
646
+ }
647
+
648
+ declare class QtiEqual extends QtiExpression<boolean> {
649
+ toleranceMode: 'exact' | 'relative' | 'absolute';
650
+ calculate(): boolean;
651
+ }
652
+
653
+ declare class QtiEqualRounded extends QtiExpression<boolean> {
654
+ roundingMode: 'decimalPlaces' | 'significantFigures';
655
+ get figures(): number;
656
+ calculate(): boolean;
657
+ }
658
+
659
+ declare class QtiBaseValue extends QtiExpression<string> {
660
+ baseType: BaseType;
661
+ calculate(): string;
662
+ }
663
+
664
+ declare class QtiContains extends QtiExpression<boolean> {
665
+ calculate(): boolean;
666
+ }
667
+
668
+ declare class QtiCorrect extends QtiExpression<string | string[]> {
669
+ render(): lit_html.TemplateResult<1>;
670
+ get interpretation(): string;
671
+ calculate(): string | string[];
672
+ }
673
+
674
+ declare class QtiIsNull extends QtiExpression<boolean> {
675
+ calculate(): boolean;
676
+ }
677
+
678
+ declare class QtiNot extends QtiExpression<boolean> {
679
+ render(): lit_html.TemplateResult<1>;
680
+ calculate(): boolean;
681
+ }
682
+
683
+ declare class QtiMapResponse extends QtiExpression<number> {
684
+ identifier: string;
685
+ calculate(): number;
686
+ }
687
+
688
+ declare class QtiMatch extends QtiExpression<boolean> {
689
+ calculate(): boolean;
690
+ }
691
+
692
+ declare class QtiVariable extends QtiExpression<number | string | string[]> {
693
+ render(): lit_html.TemplateResult<1>;
694
+ calculate(): any;
695
+ }
696
+
697
+ declare class QtiMultiple extends QtiExpression<ResponseVariable[]> {
698
+ calculate(): ResponseVariable[];
699
+ }
700
+
701
+ declare class QtiOrdered extends QtiExpression<ResponseVariable[]> {
702
+ calculate(): ResponseVariable[];
703
+ }
704
+
705
+ declare class QtPrintedVariable extends LitElement {
706
+ value: string;
707
+ render(): lit_html.TemplateResult<1>;
708
+ constructor();
709
+ calculate(): any;
710
+ }
711
+
712
+ declare class QtiMember extends QtiExpression<boolean | null> {
713
+ calculate(): boolean;
714
+ }
715
+
716
+ declare class QtiPortableCustomInteraction extends LitElement {
717
+ private responseIdentifier;
718
+ private module;
719
+ private customInteractionTypeIdentifier;
720
+ private baseUrl;
721
+ private _errorMessage;
722
+ static get properties(): {
723
+ responseIdentifier: {
724
+ type: StringConstructor;
725
+ attribute: string;
726
+ };
727
+ module: {
728
+ type: StringConstructor;
729
+ attribute: string;
730
+ };
731
+ customInteractionTypeIdentifier: {
732
+ type: StringConstructor;
733
+ attribute: string;
734
+ };
735
+ baseUrl: {
736
+ type: StringConstructor;
737
+ attribute: string;
738
+ };
739
+ _errorMessage: {
740
+ type: StringConstructor;
741
+ state: boolean;
742
+ };
743
+ };
744
+ getTAOConfig(node: any): {} | void;
745
+ register(item: any): void;
746
+ connectedCallback(): void;
747
+ render(): lit_html.TemplateResult<1>;
748
+ }
749
+
750
+ interface IInteraction {
751
+ disabled: boolean;
752
+ readonly: boolean;
753
+ response: string | string[];
754
+ reset(): any;
755
+ validate(): boolean;
756
+ }
757
+
758
+ declare const QtiAssociateInteraction_base: (new (...args: any[]) => IInteraction) & typeof LitElement;
759
+ declare class QtiAssociateInteraction extends QtiAssociateInteraction_base {
760
+ private _childrenMap;
761
+ static styles: lit.CSSResult;
762
+ render(): lit_html.TemplateResult<1>;
763
+ connectedCallback(): void;
764
+ }
765
+
766
+ declare const QtiGapMatchInteraction_base: (new (...args: any[]) => IInteraction) & typeof LitElement;
767
+ declare class QtiGapMatchInteraction extends QtiGapMatchInteraction_base {
768
+ static styles: lit.CSSResult[];
769
+ render(): lit_html.TemplateResult<1>;
770
+ }
771
+
772
+ declare class QtiGraphicAssociateInteraction extends Interaction {
773
+ choiceOrdering: boolean;
774
+ hotspots: any;
775
+ startPoint: any;
776
+ endPoint: any;
777
+ _lines: any[];
778
+ startCoord: {
779
+ x: any;
780
+ y: any;
781
+ };
782
+ mouseCoord: {
783
+ x: number;
784
+ y: number;
785
+ };
786
+ svgContainer: any;
787
+ grImage: any;
788
+ static styles: lit.CSSResult[];
789
+ svg: SVGSVGElement;
790
+ constructor();
791
+ reset(): void;
792
+ validate(): boolean;
793
+ set response(val: string | string[]);
794
+ render(): lit_html.TemplateResult<1>;
795
+ private positionHotspotOnRegister;
796
+ firstUpdated(e: any): void;
797
+ disconnectedCallback(): void;
798
+ }
799
+
800
+ declare const QtiGraphicGapMatchInteraction_base: (new (...args: any[]) => IInteraction) & typeof LitElement;
801
+ declare class QtiGraphicGapMatchInteraction extends QtiGraphicGapMatchInteraction_base {
802
+ static styles: lit.CSSResult;
803
+ render(): lit_html.TemplateResult<1>;
804
+ private positionHotspotOnRegister;
805
+ connectedCallback(): void;
806
+ disconnectedCallback(): void;
807
+ }
808
+
809
+ declare class QtiGraphicOrderInteraction extends Choices {
810
+ choiceOrdering: boolean;
811
+ static styles: lit.CSSResult[];
812
+ render(): lit_html.TemplateResult<1>;
813
+ private setHotspotOrder;
814
+ private positionHotspotOnRegister;
815
+ connectedCallback(): void;
816
+ disconnectedCallback(): void;
817
+ }
818
+
819
+ declare class QtiHotspotInteraction extends Choices {
820
+ static styles: lit.CSSResult[];
821
+ render(): lit_html.TemplateResult<1>;
822
+ private positionHotspotOnRegister;
823
+ connectedCallback(): void;
824
+ disconnectedCallback(): void;
825
+ }
826
+
827
+ declare class QtiSimpleAssociableChoice extends LitElement {
828
+ connectedCallback(): void;
829
+ render(): lit_html.TemplateResult<1>;
830
+ }
831
+
832
+ declare const QtiMatchInteraction_base: (new (...args: any[]) => IInteraction) & typeof LitElement;
833
+ declare class QtiMatchInteraction extends QtiMatchInteraction_base {
834
+ static styles: any[];
835
+ rows: Element[];
836
+ cols: Element[];
837
+ connectedCallback(): void;
838
+ render(): lit_html.TemplateResult<1>;
839
+ }
840
+
841
+ declare class QtiMediaInteraction extends Interaction {
842
+ value: number;
843
+ reset(): void;
844
+ validate(): boolean;
845
+ set response(val: undefined);
846
+ static get properties(): {
847
+ step: {
848
+ type: NumberConstructor;
849
+ attribute: string;
850
+ default: number;
851
+ };
852
+ };
853
+ static styles: lit.CSSResult[];
854
+ render(): lit_html.TemplateResult<1>;
855
+ constructor();
856
+ connectedCallback(): void;
857
+ }
858
+
859
+ declare const QtiOrderInteraction_base: (new (...args: any[]) => IInteraction) & typeof LitElement;
860
+ declare class QtiOrderInteraction extends QtiOrderInteraction_base {
861
+ childrenMap: Element[];
862
+ private _classNames;
863
+ private _orientation;
864
+ static layoutClass: string[];
865
+ /** orientation of choices */
866
+ orientation: 'horizontal' | 'vertical';
867
+ static styles: lit.CSSResult[];
868
+ render(): lit_html.TemplateResult<1>;
869
+ connectedCallback(): void;
870
+ }
871
+
872
+ declare class QtiSPositionObjectInteraction extends LitElement {
873
+ render(): lit_html.TemplateResult<1>;
874
+ static styles: lit.CSSResult[];
875
+ }
876
+
877
+ declare class QtiPositionObjectStage extends LitElement {
878
+ choiceOrdering: boolean;
879
+ startX: any;
880
+ startY: any;
881
+ dragElement: any;
882
+ render(): lit_html.TemplateResult<1>;
883
+ static styles: lit.CSSResult[];
884
+ constructor();
885
+ dragElementHandler(event: any): void;
886
+ connectedCallback(): void;
887
+ removeMoveListener(event: any): void;
888
+ disconnectedCallback(): void;
889
+ }
890
+
891
+ declare class QtiSelectPointInteraction extends Interaction {
892
+ maxChoices: number;
893
+ minChoices: number;
894
+ private _points;
895
+ render(): lit_html.TemplateResult<1>;
896
+ static styles: lit.CSSResult[];
897
+ reset(): void;
898
+ validate(): boolean;
899
+ set response(val: string | string[]);
900
+ connectedCallback(): void;
901
+ disconnectedCallback(): void;
902
+ }
903
+
904
+ /**
905
+ * @summary The SliderInteraction.Type (qti-slider-interaction) presents the candidate with a control for selecting a numerical value between a lower and upper bound.
906
+ * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.s61xcrj4qcyj
907
+ * @status stable
908
+ * @since 6.0
909
+ *
910
+ * @event qti-register-interaction - emitted when the interaction wants to register itself
911
+ * @event qti-interaction-response - emitted when the interaction changes
912
+ *
913
+ * @cssprop --show-value - shows the current value while sliding
914
+ * @cssprop --show-ticks - shows the ticks according to steps
915
+ * @cssprop --show-bounds - shows value for lower and upper boundary
916
+ *
917
+ * @csspart slider -- slider inluding, bounds and ticks and value, use it for paddings and margins
918
+ * @csspart bounds -- div for bounds, containing two divs for with min, and max bounds value
919
+ * @csspart ticks -- div for ticks, use lineair gradient and exposed css variables for styling
920
+ * @csspart rail -- div for rail, style according to needs
921
+ * @csspart knob -- div, should be relative or absolute
922
+ * @csspart value -- div, containing value
923
+ *
924
+ * @slot - The default slot where <qti-simple-choice> must be placed.
925
+ * @slot prompt - slot where the prompt is placed.
926
+ */
927
+ declare class QtiSliderInteraction extends Interaction {
928
+ csLive: CSSStyleDeclaration;
929
+ private _knob;
930
+ private _rail;
931
+ value: number;
932
+ stepLabel: boolean;
933
+ reverse: boolean;
934
+ private _min;
935
+ set min(value: number);
936
+ get min(): number;
937
+ private _max;
938
+ set max(value: number);
939
+ get max(): number;
940
+ private _step;
941
+ set step(value: number);
942
+ get step(): number;
943
+ _handleDisabledChange: (old: any, disabled: any) => void;
944
+ _handleReadonlyChange: (old: any, readonly: any) => void;
945
+ reset(): void;
946
+ validate(): boolean;
947
+ constructor();
948
+ set response(myResponse: string | string[]);
949
+ static styles: lit.CSSResult[];
950
+ render(): lit_html.TemplateResult<1>;
951
+ connectedCallback(): void;
952
+ private _onTouchMove;
953
+ private _onMouseDown;
954
+ /** calculateValue gets x position and compares this with the total width in pixels */
955
+ private calculateValue;
956
+ private getPositionFromEvent;
957
+ }
958
+
959
+ declare class QtiEndAttemptInteraction extends LitElement {
960
+ title: 'end attempt';
961
+ render(): lit_html.TemplateResult<1>;
962
+ endAttempt(e: Event): void;
963
+ }
964
+
965
+ declare class QtiAssociableHotspot extends LitElement {
966
+ connectedCallback(): void;
967
+ static styles: lit.CSSResult;
968
+ render(): lit_html.TemplateResult<1>;
969
+ }
970
+
971
+ declare class QtiGapImg extends LitElement {
972
+ tabindex: number | undefined;
973
+ connectedCallback(): void;
974
+ }
975
+
976
+ declare class QtiGapText extends LitElement {
977
+ tabindex: number | undefined;
978
+ connectedCallback(): void;
979
+ render(): lit_html.TemplateResult<1>;
980
+ }
981
+
982
+ declare class QtiGap extends LitElement {
983
+ tabindex: number | undefined;
984
+ render(): lit_html.TemplateResult<1>;
985
+ }
986
+
987
+ declare class QtiHotspotChoice extends QtiChoice {
988
+ order: number;
989
+ static styles: lit.CSSResult;
990
+ }
991
+
992
+ declare class QtiHottext extends QtiChoice {
993
+ render(): lit_html.TemplateResult<1>;
994
+ }
995
+ declare global {
996
+ interface HTMLElementTagNameMap {
997
+ 'qti-hottext': QtiHottext;
998
+ }
999
+ }
1000
+
1001
+ declare class QtiInlineChoice extends LitElement {
1002
+ }
1003
+
1004
+ /**
1005
+ * @summary Short summary of the component's intended use.
1006
+ * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.j9nu1oa1tu3b
1007
+ * @status stable
1008
+ * @since 4.0
1009
+ *
1010
+ * @event qti-choice-element-selected - Emitted when a choice is selected.
1011
+ * @event qti-register-choice - Emitted when an choice is added
1012
+ * @event qti-loose-choice - Emitted when a choice is removed
1013
+ *
1014
+ * @slot - The default slot.
1015
+ */
1016
+ declare class QtiSimpleChoice extends QtiChoice {
1017
+ render(): lit_html.TemplateResult<1>;
1018
+ }
1019
+ declare global {
1020
+ interface HTMLElementTagNameMap {
1021
+ 'qti-simple-choice': QtiSimpleChoice;
1022
+ }
1023
+ }
1024
+
1025
+ declare class QtiItem extends LitElement {
1026
+ disabled: boolean;
1027
+ handleDisabledChange(old: any, disabled: boolean): void;
1028
+ readonly: boolean;
1029
+ handleReadonlyChange(old: any, readonly: boolean): void;
1030
+ responses: ResponseInteraction[];
1031
+ handleResponsesChange(old: any, responses: ResponseInteraction[]): void;
1032
+ set qtiContext(context: {
1033
+ view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor';
1034
+ });
1035
+ private provider;
1036
+ get _item(): QtiAssessmentItem;
1037
+ private _xml;
1038
+ set xml(val: string);
1039
+ get xml(): string;
1040
+ static styles: lit.CSSResult;
1041
+ processResponse: () => boolean;
1042
+ showCorrectResponse: () => void;
1043
+ validateResponses: () => boolean;
1044
+ resetInteractions: () => void;
1045
+ connectedCallback(): void;
1046
+ render: () => lit_html.TemplateResult<1>;
1047
+ }
1048
+
1049
+ declare const qtiTransform: (xmlValue: string) => {
1050
+ mathml(): any;
1051
+ removeNamesSpaces(): any;
1052
+ pciHooks(uri: string): any;
1053
+ assetsLocation(uri: string, attributes?: string[]): any;
1054
+ customTypes(): any;
1055
+ suffix(elements: string[], suffix: string): any;
1056
+ fn(fn: (xmlString: string) => string): any;
1057
+ fnCh(fn: (xmlString: cheerio.CheerioAPI) => void): any;
1058
+ elementNameAttributes(elements: string[]): any;
1059
+ print(): any;
1060
+ xml(): string;
1061
+ };
1062
+
1063
+ export { BaseType, Calculate, Cardinality, Events, InteractionChangedDetails, Multiple, Ordered, OutcomeChangedDetails, OutcomeVariable, QtPrintedVariable, QtiAnd, QtiAssessmentItem, QtiAssociableHotspot, QtiAssociateInteraction, QtiBaseValue, QtiChoice, qtiChoiceElementSelected as QtiChoiceElementSelected, QtiChoiceInteraction, QtiCompanionMaterialsInfo, QtiContains, QtiCorrect, QtiEndAttemptInteraction, QtiEqual, QtiEqualRounded, QtiExpression, QtiExtendedTextInteraction, QtiFeedbackBlock, QtiFeedbackInline, QtiGap, QtiGapImg, QtiGapMatchInteraction, QtiGapText, QtiGraphicAssociateInteraction, QtiGraphicGapMatchInteraction, QtiGraphicOrderInteraction, QtiGt, QtiGte, QtiHotspotChoice, QtiHotspotInteraction, QtiHottext, QtiHottextInteraction, QtiInlineChoice, QtiInlineChoiceInteraction, qtiInteractionChanged as QtiInteractionChanged, qtiInteractionResponse as QtiInteractionResponse, QtiIsNull, QtiItem, qtiLooseChoice as QtiLooseChoice, QtiLt, QtiLte, QtiMapResponse, QtiMapping, QtiMatch, QtiMatchInteraction, QtiMediaInteraction, QtiMember, QtiModalFeedback, QtiMultiple, QtiNot, QtiOr, QtiOrderInteraction, QtiOrdered, qtiOutcomeChanged as QtiOutcomeChanged, QtiOutcomeDeclaration, QtiPortableCustomInteraction, QtiPositionObjectStage, QtiProduct, QtiPrompt, qtiRegisterChoice as QtiRegisterChoice, qtiRegisterHotspot as QtiRegisterHotspot, qtiRegisterInteraction as QtiRegisterInteraction, qtiRegisterVariable as QtiRegisterVariable, QtiResponseCondition, QtiResponseDeclaration, QtiResponseElse, QtiResponseElseIf, QtiResponseIf, QtiResponseProcessing, QtiRule, QtiSPositionObjectInteraction, QtiSelectPointInteraction, QtiSetOutcomeValue, QtiSimpleAssociableChoice, QtiSimpleChoice, QtiSliderInteraction, QtiStylesheet, QtiTextEntryInteraction, QtiVariable, ResponseInteraction, ResponseVariable, directedPair, float, integer, qtiContentBody, qtiRubricBlock, qtiTransform };