@citolab/qti-components 6.6.1-15 → 6.6.1-18

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