@citolab/qti-components 6.9.1-beta.5 → 6.9.1-beta.51

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