@citolab/qti-components 7.0.3 → 7.0.4

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