@citolab/qti-components 6.9.1-beta.8 → 6.9.1-beta.80

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