@citolab/qti-components 7.3.16 → 7.3.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/chunks/chunk-2LJEUBOG.js +5 -0
- package/cdn/chunks/chunk-2M6EI7MI.js +1460 -0
- package/cdn/chunks/chunk-4PJRTAIR.js +1460 -0
- package/cdn/chunks/chunk-4VCDR5BV.js +1460 -0
- package/cdn/chunks/chunk-5RZUSJSN.js +5 -0
- package/cdn/chunks/chunk-ALSHUDQZ.js +5 -0
- package/cdn/chunks/chunk-AQJ4JQBU.js +5 -0
- package/cdn/chunks/chunk-CSEUTSSH.js +5 -0
- package/cdn/chunks/chunk-DG7XTM6Y.js +1460 -0
- package/cdn/chunks/chunk-GLMWZ45H.js +5 -0
- package/cdn/chunks/chunk-H2LVGFMN.js +5 -0
- package/cdn/chunks/chunk-IPYW2MV6.js +1460 -0
- package/cdn/chunks/chunk-ISBB3BFP.js +1460 -0
- package/cdn/chunks/chunk-JS2Y72PB.js +5 -0
- package/cdn/chunks/chunk-N223O4WD.js +5 -0
- package/cdn/chunks/chunk-OGVSHQLH.js +1460 -0
- package/cdn/chunks/chunk-Q4WUJXUN.js +1460 -0
- package/cdn/chunks/chunk-QNBLY7TQ.js +1460 -0
- package/cdn/chunks/chunk-RP3435WM.js +5 -0
- package/cdn/chunks/chunk-UYFLYVQK.js +5 -0
- package/cdn/chunks/chunk-UZZLQGLW.js +1460 -0
- package/cdn/exports/qti-test.js +0 -0
- package/cdn/index.global.js +1 -1
- package/cdn/index.js +1 -1
- package/cdn/qti-components/index.js +1 -1
- package/cdn/qti-test/components/index.js +1 -1
- package/cdn/qti-test/core/index.js +1 -1
- package/dist/chunks/chunk-4MTF6JXS.js +913 -0
- package/dist/chunks/chunk-4MTF6JXS.js.map +1 -0
- package/dist/chunks/chunk-5HOBUFR5.js +913 -0
- package/dist/chunks/chunk-5HOBUFR5.js.map +1 -0
- package/dist/chunks/chunk-5QP5YUXY.js +913 -0
- package/dist/chunks/chunk-5QP5YUXY.js.map +1 -0
- package/dist/chunks/chunk-5XONMCVB.js +8012 -0
- package/dist/chunks/chunk-5XONMCVB.js.map +1 -0
- package/dist/chunks/chunk-7PVT6ZVK.js +8003 -0
- package/dist/chunks/chunk-7PVT6ZVK.js.map +1 -0
- package/dist/chunks/chunk-B2VGV4M2.js +913 -0
- package/dist/chunks/chunk-B2VGV4M2.js.map +1 -0
- package/dist/chunks/chunk-BO6KBXLI.js +913 -0
- package/dist/chunks/chunk-BO6KBXLI.js.map +1 -0
- package/dist/chunks/chunk-EYVBI7LZ.js +8002 -0
- package/dist/chunks/chunk-EYVBI7LZ.js.map +1 -0
- package/dist/chunks/chunk-F4RFJRRC.js +8002 -0
- package/dist/chunks/chunk-F4RFJRRC.js.map +1 -0
- package/dist/chunks/chunk-FVSOTRH4.js +8003 -0
- package/dist/chunks/chunk-FVSOTRH4.js.map +1 -0
- package/dist/chunks/chunk-FXTXKTA7.js +913 -0
- package/dist/chunks/chunk-FXTXKTA7.js.map +1 -0
- package/dist/chunks/chunk-GU63TKJM.js +913 -0
- package/dist/chunks/chunk-GU63TKJM.js.map +1 -0
- package/dist/chunks/chunk-H2GDD7MM.js +8002 -0
- package/dist/chunks/chunk-H2GDD7MM.js.map +1 -0
- package/dist/chunks/chunk-KND43FZM.js +913 -0
- package/dist/chunks/chunk-KND43FZM.js.map +1 -0
- package/dist/chunks/chunk-NHJUBMZ4.js +913 -0
- package/dist/chunks/chunk-NHJUBMZ4.js.map +1 -0
- package/dist/chunks/chunk-OP5LKZIM.js +913 -0
- package/dist/chunks/chunk-OP5LKZIM.js.map +1 -0
- package/dist/chunks/chunk-PV7YR6CL.js +913 -0
- package/dist/chunks/chunk-PV7YR6CL.js.map +1 -0
- package/dist/chunks/chunk-QJK2ONRE.js +913 -0
- package/dist/chunks/chunk-QJK2ONRE.js.map +1 -0
- package/dist/chunks/chunk-R22TEK2I.js +8003 -0
- package/dist/chunks/chunk-R22TEK2I.js.map +1 -0
- package/dist/chunks/chunk-SA3X6RSE.js +8002 -0
- package/dist/chunks/chunk-SA3X6RSE.js.map +1 -0
- package/dist/chunks/chunk-VFPUMDJK.js +8002 -0
- package/dist/chunks/chunk-VFPUMDJK.js.map +1 -0
- package/dist/chunks/chunk-WOCRTIKW.js +8012 -0
- package/dist/chunks/chunk-WOCRTIKW.js.map +1 -0
- package/dist/chunks/chunk-Y5JPI5OZ.js +8003 -0
- package/dist/chunks/chunk-Y5JPI5OZ.js.map +1 -0
- package/dist/chunks/chunk-YRYQIUNT.js +913 -0
- package/dist/chunks/chunk-YRYQIUNT.js.map +1 -0
- package/dist/exports/computed-item.context.d.ts +1 -1
- package/dist/exports/computed.context.d.ts +2 -2
- package/dist/exports/interaction.d.ts +1 -1
- package/dist/exports/item.context.d.ts +1 -1
- package/dist/exports/qti-assessment-item.context.d.ts +1 -1
- package/dist/exports/qti-condition-expression.d.ts +1 -1
- package/dist/exports/qti-expression.d.ts +1 -1
- package/dist/exports/qti-test.d.ts +34 -0
- package/dist/exports/qti-test.js +1 -0
- package/dist/exports/qti-test.js.map +1 -0
- package/dist/exports/session.context.d.ts +2 -2
- package/dist/exports/test.context.d.ts +1 -1
- package/dist/exports/variables.d.ts +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +16 -16
- package/dist/qti-components/index.d.ts +2 -2
- package/dist/qti-components/index.js +2 -2
- package/dist/qti-item/components/item-show-correct-response.d.ts +1 -1
- package/dist/qti-item/components/print-item-variables.d.ts +1 -1
- package/dist/qti-item/core/index.d.ts +1 -1
- package/dist/qti-loader/index.d.ts +1 -1
- package/dist/qti-response-declaration-BSUPHx0G.d.ts +1358 -0
- package/dist/qti-response-declaration-Br3wU-dT.d.ts +1357 -0
- package/dist/qti-response-declaration-DNXsTvKe.d.ts +1358 -0
- package/dist/qti-response-declaration-q716ty5y.d.ts +1358 -0
- package/dist/qti-test/components/index.d.ts +2 -2
- package/dist/qti-test/components/test-navigation.d.ts +2 -2
- package/dist/qti-test/components/test-next.d.ts +2 -2
- package/dist/qti-test/components/test-prev.d.ts +2 -2
- package/dist/qti-test/components/test-print-context.d.ts +2 -2
- package/dist/qti-test/components/test-print-item-variables.d.ts +2 -2
- package/dist/qti-test/components/test-scoring-buttons.d.ts +2 -2
- package/dist/qti-test/components/test-scoring-feedback.d.ts +2 -2
- package/dist/qti-test/components/test-show-correct-response.d.ts +2 -2
- package/dist/qti-test/core/index.d.ts +5 -4
- package/dist/qti-test/core/index.js +3 -3
- package/dist/qti-test-feedback-D-vBFqJ5.d.ts +91 -0
- package/dist/qti-test-feedback-DTIDvsS-.d.ts +91 -0
- package/dist/qti-test-feedback-Dxie3GQ5.d.ts +90 -0
- package/dist/qti-test-feedback-hJuvW_Ei.d.ts +91 -0
- package/package.json +1 -1
|
@@ -0,0 +1,1358 @@
|
|
|
1
|
+
import * as lit_html from 'lit-html';
|
|
2
|
+
import * as lit from 'lit';
|
|
3
|
+
import { LitElement, CSSResultGroup, PropertyValueMap } from 'lit';
|
|
4
|
+
import { Cardinality, BaseType, ResponseInteraction, Calculate } from './exports/expression-result.js';
|
|
5
|
+
import { IInteraction } from './exports/interaction.interface.js';
|
|
6
|
+
import * as lit_html_directives_ref_js from 'lit-html/directives/ref.js';
|
|
7
|
+
|
|
8
|
+
interface VariableValue<T> {
|
|
9
|
+
identifier: string;
|
|
10
|
+
value: Readonly<T>;
|
|
11
|
+
type: 'outcome' | 'response';
|
|
12
|
+
}
|
|
13
|
+
interface VariableDeclaration<T> extends VariableValue<T> {
|
|
14
|
+
cardinality?: Cardinality;
|
|
15
|
+
baseType?: BaseType;
|
|
16
|
+
}
|
|
17
|
+
interface OutcomeVariable extends VariableDeclaration<string | string[] | null> {
|
|
18
|
+
interpolationTable?: Map<number, number>;
|
|
19
|
+
externalScored?: 'human' | 'externalMachine' | null;
|
|
20
|
+
}
|
|
21
|
+
interface ResponseVariable extends VariableDeclaration<string | string[] | null> {
|
|
22
|
+
candidateResponse?: string | string[] | null;
|
|
23
|
+
mapping?: QtiMapping;
|
|
24
|
+
areaMapping?: QtiAreaMapping;
|
|
25
|
+
correctResponse?: string | string[] | null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @summary The qti-assessment-item element contains all the other QTI 3 item structures.
|
|
30
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.dltnnj87l0yj
|
|
31
|
+
*
|
|
32
|
+
* @dependency qti-feedback
|
|
33
|
+
* @dependency qti-responseprocessing
|
|
34
|
+
*
|
|
35
|
+
* @event qti-item-context-updated - Emitted when through a user action the itemContext is updated,
|
|
36
|
+
* typically on interaction with the interactions, or calling response processing.
|
|
37
|
+
*/
|
|
38
|
+
declare class QtiAssessmentItem extends LitElement {
|
|
39
|
+
private _itemTitle;
|
|
40
|
+
identifier: string;
|
|
41
|
+
adaptive: 'true' | 'false';
|
|
42
|
+
timeDependent: 'true' | 'false' | null;
|
|
43
|
+
get title(): string;
|
|
44
|
+
set title(value: string);
|
|
45
|
+
disabled: boolean;
|
|
46
|
+
protected _handleDisabledChange: (_: boolean, disabled: boolean) => void;
|
|
47
|
+
readonly: boolean;
|
|
48
|
+
protected _handleReadonlyChange: (_: boolean, readonly: boolean) => void;
|
|
49
|
+
private _context;
|
|
50
|
+
/**
|
|
51
|
+
* Sets the identifier for the assessment item reference if this item is in a test.
|
|
52
|
+
*
|
|
53
|
+
* @param identifier - The identifier for the assessment item reference.
|
|
54
|
+
*/
|
|
55
|
+
set assessmentItemRefId(identifier: string);
|
|
56
|
+
get assessmentItemRefId(): string;
|
|
57
|
+
get variables(): VariableValue<string | string[] | null>[];
|
|
58
|
+
set variables(value: VariableValue<string | string[] | null>[]);
|
|
59
|
+
private _initialContext;
|
|
60
|
+
private _feedbackElements;
|
|
61
|
+
private _interactionElements;
|
|
62
|
+
/** @deprecated use variables property instead */
|
|
63
|
+
set responses(myResponses: ResponseInteraction[]);
|
|
64
|
+
render(): lit_html.TemplateResult<1>;
|
|
65
|
+
connectedCallback(): void;
|
|
66
|
+
disconnectedCallback(): void;
|
|
67
|
+
private _attachEventListeners;
|
|
68
|
+
private _removeEventListeners;
|
|
69
|
+
private _handleRegisterVariable;
|
|
70
|
+
private _handleRegisterFeedback;
|
|
71
|
+
private _handleRegisterInteraction;
|
|
72
|
+
private _handleEndAttempt;
|
|
73
|
+
private _handleSetOutcomeValue;
|
|
74
|
+
private _handleUpdateResponseVariable;
|
|
75
|
+
/**
|
|
76
|
+
* Toggles the display of correct responses for all interactions.
|
|
77
|
+
* @param show - A boolean indicating whether to show or hide correct responses.
|
|
78
|
+
*/
|
|
79
|
+
showCorrectResponse(show: boolean): void;
|
|
80
|
+
processResponse(countNumAttempts?: boolean, reportValidityAfterScoring?: boolean): boolean;
|
|
81
|
+
resetResponses(): void;
|
|
82
|
+
protected getResponse(identifier: string): Readonly<ResponseVariable>;
|
|
83
|
+
protected getOutcome(identifier: string): Readonly<OutcomeVariable>;
|
|
84
|
+
protected getVariable(identifier: string): Readonly<VariableDeclaration<string | string[] | null>>;
|
|
85
|
+
/**
|
|
86
|
+
* Updates the response variable with the specified identifier to the given value.
|
|
87
|
+
*
|
|
88
|
+
* @protected
|
|
89
|
+
*
|
|
90
|
+
* This method is intended for internal use within the class and subclasses.
|
|
91
|
+
* It should not be called externally by third parties.
|
|
92
|
+
*
|
|
93
|
+
* @param identifier - The identifier of the response variable to update.
|
|
94
|
+
* @param value - The new value for the response variable.
|
|
95
|
+
*/
|
|
96
|
+
updateResponseVariable(identifier: string, value: string | string[] | undefined): void;
|
|
97
|
+
setOutcomeVariable(identifier: string, value: string | string[] | undefined): void;
|
|
98
|
+
/**
|
|
99
|
+
* Updates the outcome variable with the specified identifier to the given value.
|
|
100
|
+
*
|
|
101
|
+
* @protected
|
|
102
|
+
*
|
|
103
|
+
* This method is intended for internal use within the class and subclasses.
|
|
104
|
+
* It should not be called externally by third parties.
|
|
105
|
+
*
|
|
106
|
+
* @param identifier - The identifier of the response variable to update.
|
|
107
|
+
* @param value - The new value for the response variable.
|
|
108
|
+
*/
|
|
109
|
+
updateOutcomeVariable(identifier: string, value: string | string[] | undefined): void;
|
|
110
|
+
validate(reportValidity?: boolean): boolean;
|
|
111
|
+
reportValidity(): void;
|
|
112
|
+
private _getCompletionStatus;
|
|
113
|
+
}
|
|
114
|
+
declare global {
|
|
115
|
+
interface HTMLElementTagNameMap {
|
|
116
|
+
'qti-assessment-item': QtiAssessmentItem;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Represents a custom element for referencing an assessment stimulus.
|
|
122
|
+
*/
|
|
123
|
+
declare class QtiAssessmentStimulusRef extends LitElement {
|
|
124
|
+
/**
|
|
125
|
+
* The identifier of the stimulus.
|
|
126
|
+
*/
|
|
127
|
+
identifier: string;
|
|
128
|
+
/**
|
|
129
|
+
* The href of the stimulus.
|
|
130
|
+
*/
|
|
131
|
+
href: string;
|
|
132
|
+
/**
|
|
133
|
+
* Lifecycle method called when the element is connected to the DOM.
|
|
134
|
+
* Loads and appends the stimulus if the 'qti-assessment-stimulus-ref-connected' event is not prevented.
|
|
135
|
+
*/
|
|
136
|
+
connectedCallback(): Promise<void>;
|
|
137
|
+
/**
|
|
138
|
+
* Loads and appends the stimulus to the specified element.
|
|
139
|
+
* @param stimulusRef - The element to which the stimulus will be appended.
|
|
140
|
+
*/
|
|
141
|
+
updateStimulusRef(stimulusRef: Element): Promise<void>;
|
|
142
|
+
}
|
|
143
|
+
declare global {
|
|
144
|
+
interface HTMLElementTagNameMap {
|
|
145
|
+
'qti-assessment-stimulus-ref': QtiAssessmentStimulusRef;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
declare class QtiCompanionMaterialsInfo extends LitElement {
|
|
150
|
+
}
|
|
151
|
+
declare global {
|
|
152
|
+
interface HTMLElementTagNameMap {
|
|
153
|
+
'qti-companion-materials-info': QtiCompanionMaterialsInfo;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* https://www.imsglobal.org/spec/qti/v3p0/impl#h.fi29q8dubjgw
|
|
159
|
+
* <qti-custom-operator class="js.org">
|
|
160
|
+
<qti-base-value base-type="string"><![CDATA[
|
|
161
|
+
console.log(context.variables);
|
|
162
|
+
return 'B'
|
|
163
|
+
document.querySelector('qti-end-attempt-interaction').disabled = true;
|
|
164
|
+
]]></qti-base-value>
|
|
165
|
+
</qti-custom-operator>
|
|
166
|
+
</qti-set-outcome-value>
|
|
167
|
+
*/
|
|
168
|
+
declare class QtiCustomOperator extends LitElement implements Calculate {
|
|
169
|
+
private operatorFunction;
|
|
170
|
+
private _context?;
|
|
171
|
+
render(): lit_html.TemplateResult<1>;
|
|
172
|
+
handleSlotChange(): void;
|
|
173
|
+
calculate(): any;
|
|
174
|
+
}
|
|
175
|
+
declare global {
|
|
176
|
+
interface HTMLElementTagNameMap {
|
|
177
|
+
'qti-custom-operator': QtiCustomOperator;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
declare abstract class QtiFeedback extends LitElement {
|
|
182
|
+
protected showHide: string;
|
|
183
|
+
outcomeIdentifier: string;
|
|
184
|
+
protected identifier: string;
|
|
185
|
+
showStatus: string;
|
|
186
|
+
private _context?;
|
|
187
|
+
connectedCallback(): void;
|
|
188
|
+
checkShowFeedback(outcomeIdentifier: string): void;
|
|
189
|
+
private showFeedback;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
declare class QtiFeedbackBlock extends QtiFeedback {
|
|
193
|
+
static styles: lit.CSSResult;
|
|
194
|
+
render(): lit_html.TemplateResult<1>;
|
|
195
|
+
connectedCallback(): void;
|
|
196
|
+
}
|
|
197
|
+
declare global {
|
|
198
|
+
interface HTMLElementTagNameMap {
|
|
199
|
+
'qti-feedback-block': QtiFeedbackBlock;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
declare class QtiFeedbackInline extends QtiFeedback {
|
|
204
|
+
static styles: lit.CSSResult;
|
|
205
|
+
render: () => lit_html.TemplateResult<1>;
|
|
206
|
+
connectedCallback(): void;
|
|
207
|
+
}
|
|
208
|
+
declare global {
|
|
209
|
+
interface HTMLElementTagNameMap {
|
|
210
|
+
'qti-feedback-inline': QtiFeedbackInline;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
declare class QtiModalFeedback extends QtiFeedback {
|
|
215
|
+
static styles: lit.CSSResult;
|
|
216
|
+
render(): lit_html.TemplateResult<1>;
|
|
217
|
+
openFeedback(): void;
|
|
218
|
+
closeFeedback(): void;
|
|
219
|
+
connectedCallback(): void;
|
|
220
|
+
protected updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
221
|
+
}
|
|
222
|
+
declare global {
|
|
223
|
+
interface HTMLElementTagNameMap {
|
|
224
|
+
'qti-modal-feedback': QtiModalFeedback;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
declare class QtiAssociableHotspot extends LitElement {
|
|
229
|
+
static styles: lit.CSSResult;
|
|
230
|
+
connectedCallback(): void;
|
|
231
|
+
render(): lit_html.TemplateResult<1>;
|
|
232
|
+
}
|
|
233
|
+
declare global {
|
|
234
|
+
interface HTMLElementTagNameMap {
|
|
235
|
+
'qti-associable-hotspot': QtiAssociableHotspot;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
declare abstract class Interaction extends LitElement implements IInteraction {
|
|
240
|
+
static formAssociated: boolean;
|
|
241
|
+
protected _internals: ElementInternals;
|
|
242
|
+
responseIdentifier: any;
|
|
243
|
+
disabled: boolean;
|
|
244
|
+
readonly: boolean;
|
|
245
|
+
protected _correctResponse: string | string[];
|
|
246
|
+
get correctResponse(): Readonly<string | string[]>;
|
|
247
|
+
set correctResponse(val: Readonly<string | string[]>);
|
|
248
|
+
toggleCorrectResponse(responseVariable: ResponseVariable, show: boolean): void;
|
|
249
|
+
constructor();
|
|
250
|
+
abstract validate(): boolean;
|
|
251
|
+
get value(): string | null;
|
|
252
|
+
set value(val: string | null);
|
|
253
|
+
abstract get response(): string | string[] | null;
|
|
254
|
+
abstract set response(val: string | string[] | null);
|
|
255
|
+
reportValidity(): boolean;
|
|
256
|
+
reset(): void;
|
|
257
|
+
connectedCallback(): void;
|
|
258
|
+
saveResponse(value: string | string[]): void;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
declare const QtiAssociateInteraction_base: (abstract new (...args: any[]) => IInteraction) & typeof Interaction;
|
|
262
|
+
declare class QtiAssociateInteraction extends QtiAssociateInteraction_base {
|
|
263
|
+
static styles: CSSResultGroup;
|
|
264
|
+
protected _childrenMap: Element[];
|
|
265
|
+
protected _registerChoiceHandler: (event: CustomEvent) => void;
|
|
266
|
+
constructor();
|
|
267
|
+
protected _registerChoice(event: CustomEvent): void;
|
|
268
|
+
render(): lit_html.TemplateResult<1>;
|
|
269
|
+
disconnectedCallback(): void;
|
|
270
|
+
}
|
|
271
|
+
declare global {
|
|
272
|
+
interface HTMLElementTagNameMap {
|
|
273
|
+
'qti-associate-interaction': QtiAssociateInteraction;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
interface ChoiceInterface {
|
|
278
|
+
identifier: string;
|
|
279
|
+
disabled: boolean;
|
|
280
|
+
readonly: boolean;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* A mixin that adds choice functionality to a LitElement-based class.
|
|
284
|
+
* It dispatches events with a custom `type` and handles selection logic.
|
|
285
|
+
*
|
|
286
|
+
* @param Base - The base class to extend.
|
|
287
|
+
* @param type - The type of the choice, used in event names.
|
|
288
|
+
* @returns A new class extending the base class with choice functionality.
|
|
289
|
+
*/
|
|
290
|
+
interface ActiveElementMixinInterface {
|
|
291
|
+
identifier: string;
|
|
292
|
+
tabIndex: number;
|
|
293
|
+
disabled: boolean;
|
|
294
|
+
readonly: boolean;
|
|
295
|
+
internals: ElementInternals;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
type Choice = HTMLElement & ChoiceInterface & {
|
|
299
|
+
internals: ElementInternals;
|
|
300
|
+
};
|
|
301
|
+
interface ChoicesInterface extends IInteraction {
|
|
302
|
+
minChoices: number;
|
|
303
|
+
maxChoices: number;
|
|
304
|
+
value: string | null;
|
|
305
|
+
response: string | string[] | null;
|
|
306
|
+
toggleCorrectResponse(responseVariable: ResponseVariable, show: boolean): void;
|
|
307
|
+
validate(): boolean;
|
|
308
|
+
reportValidity(): boolean;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
type Orientation = 'horizontal' | 'vertical' | undefined;
|
|
312
|
+
declare const QtiChoiceInteraction_base: (abstract new (...args: any[]) => {}) & (abstract new (...args: any[]) => ChoicesInterface) & typeof Interaction;
|
|
313
|
+
declare class QtiChoiceInteraction extends QtiChoiceInteraction_base implements ChoicesInterface {
|
|
314
|
+
static styles: CSSResultGroup;
|
|
315
|
+
/** @deprecated, use 'qti-orientation-horizontal' or 'qti-orientation-vertical' instead */
|
|
316
|
+
orientation: Orientation;
|
|
317
|
+
private _handleSlotChange;
|
|
318
|
+
render(): lit_html.TemplateResult<1>;
|
|
319
|
+
}
|
|
320
|
+
declare global {
|
|
321
|
+
interface HTMLElementTagNameMap {
|
|
322
|
+
'qti-choice-interaction': QtiChoiceInteraction;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
declare class QtiCustomInteraction extends Interaction {
|
|
327
|
+
private rawResponse;
|
|
328
|
+
constructor();
|
|
329
|
+
data: string;
|
|
330
|
+
baseItemUrl: string;
|
|
331
|
+
baseRefUrl: string;
|
|
332
|
+
id: string;
|
|
333
|
+
private _errorMessage;
|
|
334
|
+
manifest: {
|
|
335
|
+
script: string[];
|
|
336
|
+
style: string[];
|
|
337
|
+
media: string[];
|
|
338
|
+
};
|
|
339
|
+
connectedCallback(): void;
|
|
340
|
+
setupCES(): void;
|
|
341
|
+
private getIFrames;
|
|
342
|
+
private getInnerIFrames;
|
|
343
|
+
private postToWindowAndIframes;
|
|
344
|
+
handlePostMessage(event: MessageEvent): void;
|
|
345
|
+
validate(): boolean;
|
|
346
|
+
get response(): string | string[] | null;
|
|
347
|
+
set response(val: string | string[] | null);
|
|
348
|
+
disconnectedCallback(): void;
|
|
349
|
+
render(): lit_html.TemplateResult<1>;
|
|
350
|
+
}
|
|
351
|
+
declare global {
|
|
352
|
+
interface HTMLElementTagNameMap {
|
|
353
|
+
'qti-custom-interaction': QtiCustomInteraction;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
declare class QtiEndAttemptInteraction extends LitElement {
|
|
358
|
+
responseIdentifier: any;
|
|
359
|
+
disabled: boolean;
|
|
360
|
+
/** Defines the number of attempts that a user can make using the 'endAttemptInteraction' mechanism (this can be used to limit the number of hints, etc.). [More information](https://www.imsglobal.org/sites/default/files/spec/qti/v3/info/index.html#DataCharacteristic_EndAttemptInteraction.Attr_count-attempt) */
|
|
361
|
+
countAttempt: 'true' | 'false' | null;
|
|
362
|
+
title: string;
|
|
363
|
+
render(): lit_html.TemplateResult<1>;
|
|
364
|
+
endAttempt(_: Event): void;
|
|
365
|
+
}
|
|
366
|
+
declare global {
|
|
367
|
+
interface HTMLElementTagNameMap {
|
|
368
|
+
'qti-end-attempt-interaction': QtiEndAttemptInteraction;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
declare class QtiExtendedTextInteraction extends Interaction {
|
|
373
|
+
static styles: CSSResultGroup;
|
|
374
|
+
protected _rows: number;
|
|
375
|
+
/** expected length is mapped to the property maxlength on the textarea */
|
|
376
|
+
expectedLength: number;
|
|
377
|
+
patternMask: string;
|
|
378
|
+
/** text appearing in the extended-text-nteraction if it is empty */
|
|
379
|
+
placeholderText: string;
|
|
380
|
+
dataPatternmaskMessage: string;
|
|
381
|
+
classNames: any;
|
|
382
|
+
handleclassNamesChange(_: any, classes: string): void;
|
|
383
|
+
response: string | null;
|
|
384
|
+
protected _handleResponseChange: () => void;
|
|
385
|
+
get value(): string | null;
|
|
386
|
+
set value(val: string | null);
|
|
387
|
+
validate(): boolean;
|
|
388
|
+
reportValidity(): boolean;
|
|
389
|
+
render(): lit_html.TemplateResult<1>;
|
|
390
|
+
protected textChanged(event: Event): void;
|
|
391
|
+
protected setEmptyAttribute(text: string): void;
|
|
392
|
+
}
|
|
393
|
+
declare global {
|
|
394
|
+
interface HTMLElementTagNameMap {
|
|
395
|
+
'qti-extended-text-interaction': QtiExtendedTextInteraction;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
declare class QtiGapImg extends LitElement {
|
|
400
|
+
static styles: lit.CSSResult;
|
|
401
|
+
tabindex: number | undefined;
|
|
402
|
+
connectedCallback(): void;
|
|
403
|
+
}
|
|
404
|
+
declare global {
|
|
405
|
+
interface HTMLElementTagNameMap {
|
|
406
|
+
'qti-gap-img': QtiGapImg;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
declare const QtiGapMatchInteraction_base: (abstract new (...args: any[]) => IInteraction) & typeof Interaction;
|
|
411
|
+
declare class QtiGapMatchInteraction extends QtiGapMatchInteraction_base {
|
|
412
|
+
static styles: CSSResultGroup;
|
|
413
|
+
render(): lit_html.TemplateResult<1>;
|
|
414
|
+
toggleCorrectResponse(responseVariable: ResponseVariable, show: boolean): void;
|
|
415
|
+
}
|
|
416
|
+
declare global {
|
|
417
|
+
interface HTMLElementTagNameMap {
|
|
418
|
+
'qti-gap-match-interaction': QtiGapMatchInteraction;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
declare const QtiGapText_base: (abstract new (...args: any[]) => ActiveElementMixinInterface) & typeof LitElement;
|
|
423
|
+
declare class QtiGapText extends QtiGapText_base {
|
|
424
|
+
static styles: lit.CSSResult;
|
|
425
|
+
tabindex: number | undefined;
|
|
426
|
+
connectedCallback(): void;
|
|
427
|
+
render(): lit_html.TemplateResult<1>;
|
|
428
|
+
}
|
|
429
|
+
declare global {
|
|
430
|
+
interface HTMLElementTagNameMap {
|
|
431
|
+
'qti-gap-text': QtiGapText;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
declare class QtiGap extends LitElement {
|
|
436
|
+
static styles: lit.CSSResult;
|
|
437
|
+
tabindex: number | undefined;
|
|
438
|
+
render(): lit_html.TemplateResult<1>;
|
|
439
|
+
}
|
|
440
|
+
declare global {
|
|
441
|
+
interface HTMLElementTagNameMap {
|
|
442
|
+
'qti-gap': QtiGap;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
declare class QtiGraphicAssociateInteraction extends Interaction {
|
|
447
|
+
static styles: CSSResultGroup;
|
|
448
|
+
private hotspots;
|
|
449
|
+
private startPoint;
|
|
450
|
+
private endPoint;
|
|
451
|
+
private _correctLines;
|
|
452
|
+
private startCoord;
|
|
453
|
+
private mouseCoord;
|
|
454
|
+
private grImage;
|
|
455
|
+
private _response;
|
|
456
|
+
constructor();
|
|
457
|
+
reset(): void;
|
|
458
|
+
validate(): boolean;
|
|
459
|
+
set response(val: string[]);
|
|
460
|
+
get response(): string[];
|
|
461
|
+
toggleCorrectResponse(responseVariable: ResponseVariable, show: boolean): void;
|
|
462
|
+
render(): lit_html.TemplateResult<1>;
|
|
463
|
+
private positionHotspotOnRegister;
|
|
464
|
+
firstUpdated(): void;
|
|
465
|
+
disconnectedCallback(): void;
|
|
466
|
+
}
|
|
467
|
+
declare global {
|
|
468
|
+
interface HTMLElementTagNameMap {
|
|
469
|
+
'qti-graphic-associate-interaction': QtiGraphicAssociateInteraction;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
declare const QtiGraphicGapMatchInteraction_base: (abstract new (...args: any[]) => IInteraction) & typeof Interaction;
|
|
474
|
+
declare class QtiGraphicGapMatchInteraction extends QtiGraphicGapMatchInteraction_base {
|
|
475
|
+
static styles: CSSResultGroup;
|
|
476
|
+
render(): lit_html.TemplateResult<1>;
|
|
477
|
+
private positionHotspotOnRegister;
|
|
478
|
+
connectedCallback(): void;
|
|
479
|
+
disconnectedCallback(): void;
|
|
480
|
+
}
|
|
481
|
+
declare global {
|
|
482
|
+
interface HTMLElementTagNameMap {
|
|
483
|
+
'qti-graphic-gap-match-interaction': QtiGraphicGapMatchInteraction;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
declare const QtiGraphicOrderInteraction_base: (abstract new (...args: any[]) => ChoicesInterface) & typeof Interaction;
|
|
488
|
+
declare class QtiGraphicOrderInteraction extends QtiGraphicOrderInteraction_base {
|
|
489
|
+
static styles: CSSResultGroup;
|
|
490
|
+
protected choiceOrdering: boolean;
|
|
491
|
+
protected _choiceElements: Choice[];
|
|
492
|
+
render(): lit_html.TemplateResult<1>;
|
|
493
|
+
private setHotspotOrder;
|
|
494
|
+
toggleCorrectResponse(responseVariable: ResponseVariable, show: boolean): void;
|
|
495
|
+
private positionHotspotOnRegister;
|
|
496
|
+
connectedCallback(): void;
|
|
497
|
+
disconnectedCallback(): void;
|
|
498
|
+
}
|
|
499
|
+
declare global {
|
|
500
|
+
interface HTMLElementTagNameMap {
|
|
501
|
+
'qti-graphic-order-interaction': QtiGraphicOrderInteraction;
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
declare const QtiHotspotChoice_base: (abstract new (...args: any[]) => ActiveElementMixinInterface) & typeof LitElement;
|
|
506
|
+
declare class QtiHotspotChoice extends QtiHotspotChoice_base {
|
|
507
|
+
static styles: lit.CSSResult;
|
|
508
|
+
order: number;
|
|
509
|
+
orderCorrect: number;
|
|
510
|
+
}
|
|
511
|
+
declare global {
|
|
512
|
+
interface HTMLElementTagNameMap {
|
|
513
|
+
'qti-hotspot-choice': QtiHotspotChoice;
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
declare const QtiHotspotInteraction_base: (abstract new (...args: any[]) => ChoicesInterface) & typeof Interaction;
|
|
518
|
+
declare class QtiHotspotInteraction extends QtiHotspotInteraction_base {
|
|
519
|
+
static styles: CSSResultGroup;
|
|
520
|
+
render(): lit_html.TemplateResult<1>;
|
|
521
|
+
private positionHotspotOnRegister;
|
|
522
|
+
connectedCallback(): void;
|
|
523
|
+
disconnectedCallback(): void;
|
|
524
|
+
}
|
|
525
|
+
declare global {
|
|
526
|
+
interface HTMLElementTagNameMap {
|
|
527
|
+
'qti-hotspot-interaction': QtiHotspotInteraction;
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
declare const QtiHottextInteraction_base: (abstract new (...args: any[]) => ChoicesInterface) & typeof Interaction;
|
|
532
|
+
declare class QtiHottextInteraction extends QtiHottextInteraction_base {
|
|
533
|
+
render: () => lit_html.TemplateResult<1>;
|
|
534
|
+
}
|
|
535
|
+
declare global {
|
|
536
|
+
interface HTMLElementTagNameMap {
|
|
537
|
+
'qti-hottext-interaction': QtiHottextInteraction;
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
declare const QtiHottext_base: (abstract new (...args: any[]) => ActiveElementMixinInterface) & typeof LitElement;
|
|
542
|
+
declare class QtiHottext extends QtiHottext_base {
|
|
543
|
+
static styles: lit.CSSResult;
|
|
544
|
+
render(): lit_html.TemplateResult<1>;
|
|
545
|
+
}
|
|
546
|
+
declare global {
|
|
547
|
+
interface HTMLElementTagNameMap {
|
|
548
|
+
'qti-hottext': QtiHottext;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
interface OptionType {
|
|
553
|
+
textContent: string;
|
|
554
|
+
value: string;
|
|
555
|
+
selected: boolean;
|
|
556
|
+
}
|
|
557
|
+
declare class QtiInlineChoiceInteraction extends Interaction {
|
|
558
|
+
static get styles(): lit.CSSResult[];
|
|
559
|
+
static inputWidthClass: string[];
|
|
560
|
+
protected options: OptionType[];
|
|
561
|
+
protected correctOption: string;
|
|
562
|
+
dataPrompt: string;
|
|
563
|
+
render(): lit_html.TemplateResult<1>;
|
|
564
|
+
connectedCallback(): void;
|
|
565
|
+
disconnectedCallback(): void;
|
|
566
|
+
validate(): boolean;
|
|
567
|
+
reset(): void;
|
|
568
|
+
set response(value: string | null);
|
|
569
|
+
get response(): string | null;
|
|
570
|
+
toggleCorrectResponse(responseVariable: ResponseVariable, show: boolean): void;
|
|
571
|
+
protected choiceSelected(event: Event): void;
|
|
572
|
+
}
|
|
573
|
+
declare global {
|
|
574
|
+
interface HTMLElementTagNameMap {
|
|
575
|
+
'qti-inline-choice-interaction': QtiInlineChoiceInteraction;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
declare class QtiInlineChoice extends LitElement {
|
|
580
|
+
static get styles(): lit.CSSResult[];
|
|
581
|
+
identifier: string;
|
|
582
|
+
connectedCallback(): void;
|
|
583
|
+
disconnectedCallback(): void;
|
|
584
|
+
render(): lit_html.TemplateResult<1>;
|
|
585
|
+
private _onSelectInlineChoice;
|
|
586
|
+
}
|
|
587
|
+
declare global {
|
|
588
|
+
interface HTMLElementTagNameMap {
|
|
589
|
+
'qti-inline-choice': QtiInlineChoice;
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
declare const QtiSimpleAssociableChoice_base: (abstract new (...args: any[]) => ActiveElementMixinInterface) & typeof LitElement;
|
|
594
|
+
declare class QtiSimpleAssociableChoice extends QtiSimpleAssociableChoice_base {
|
|
595
|
+
static styles: lit.CSSResult;
|
|
596
|
+
/** the minimal number of selections a candidate must make */
|
|
597
|
+
matchMin: number;
|
|
598
|
+
/** the maximum number of selections a candidate must make, the other options will be disabled when max options is checked */
|
|
599
|
+
matchMax: number;
|
|
600
|
+
fixed: boolean;
|
|
601
|
+
connectedCallback(): void;
|
|
602
|
+
render(): lit_html.TemplateResult<1>;
|
|
603
|
+
}
|
|
604
|
+
declare global {
|
|
605
|
+
interface HTMLElementTagNameMap {
|
|
606
|
+
'qti-simple-associable-choice': QtiSimpleAssociableChoice;
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
declare const QtiMatchInteraction_base: (abstract new (...args: any[]) => IInteraction) & typeof Interaction;
|
|
611
|
+
declare class QtiMatchInteraction extends QtiMatchInteraction_base {
|
|
612
|
+
static styles: CSSResultGroup;
|
|
613
|
+
protected rows: QtiSimpleAssociableChoice[];
|
|
614
|
+
protected cols: QtiSimpleAssociableChoice[];
|
|
615
|
+
protected lastCheckedRadio: HTMLInputElement | null;
|
|
616
|
+
class: string;
|
|
617
|
+
protected _response: string | string[];
|
|
618
|
+
get response(): string[];
|
|
619
|
+
set response(val: string[]);
|
|
620
|
+
responseIdentifier: string;
|
|
621
|
+
protected correctOptions: {
|
|
622
|
+
text: string;
|
|
623
|
+
gap: string;
|
|
624
|
+
}[];
|
|
625
|
+
connectedCallback(): Promise<void>;
|
|
626
|
+
protected handleRadioClick: (e: any) => void;
|
|
627
|
+
protected handleRadioChange: (e: any) => void;
|
|
628
|
+
validate(): boolean;
|
|
629
|
+
toggleCorrectResponse(responseVariable: ResponseVariable, show: boolean): void;
|
|
630
|
+
render(): lit_html.TemplateResult<1>;
|
|
631
|
+
}
|
|
632
|
+
declare global {
|
|
633
|
+
interface HTMLElementTagNameMap {
|
|
634
|
+
'qti-match-interaction': QtiMatchInteraction;
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
declare class QtiMediaInteraction extends Interaction {
|
|
639
|
+
private _value;
|
|
640
|
+
reset(): void;
|
|
641
|
+
validate(): boolean;
|
|
642
|
+
get response(): string | null;
|
|
643
|
+
set response(val: string | null);
|
|
644
|
+
static get properties(): {
|
|
645
|
+
step: {
|
|
646
|
+
type: NumberConstructor;
|
|
647
|
+
attribute: string;
|
|
648
|
+
default: number;
|
|
649
|
+
};
|
|
650
|
+
};
|
|
651
|
+
static styles: lit.CSSResult[];
|
|
652
|
+
render(): lit_html.TemplateResult<1>;
|
|
653
|
+
constructor();
|
|
654
|
+
connectedCallback(): void;
|
|
655
|
+
}
|
|
656
|
+
declare global {
|
|
657
|
+
interface HTMLElementTagNameMap {
|
|
658
|
+
'qti-media-interaction': QtiMediaInteraction;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
declare const QtiOrderInteraction_base: (abstract new (...args: any[]) => IInteraction) & typeof Interaction;
|
|
663
|
+
declare class QtiOrderInteraction extends QtiOrderInteraction_base {
|
|
664
|
+
static styles: lit.CSSResult;
|
|
665
|
+
protected childrenMap: Element[];
|
|
666
|
+
protected nrChoices: number;
|
|
667
|
+
correctResponses: string[];
|
|
668
|
+
showCorrectResponses: boolean;
|
|
669
|
+
/** orientation of choices */
|
|
670
|
+
orientation: 'horizontal' | 'vertical';
|
|
671
|
+
render(): lit_html.TemplateResult<1>;
|
|
672
|
+
toggleCorrectResponse(responseVariable: ResponseVariable, show: boolean): void;
|
|
673
|
+
getValue(val: string[]): string[];
|
|
674
|
+
protected getResponse(): string[];
|
|
675
|
+
firstUpdated(changedProps: any): Promise<void>;
|
|
676
|
+
}
|
|
677
|
+
declare global {
|
|
678
|
+
interface HTMLElementTagNameMap {
|
|
679
|
+
'qti-order-interaction': QtiOrderInteraction;
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
interface ItemContext {
|
|
684
|
+
identifier?: string;
|
|
685
|
+
href?: string;
|
|
686
|
+
variables?: ReadonlyArray<VariableDeclaration<string | string[] | null>>;
|
|
687
|
+
}
|
|
688
|
+
declare const itemContextVariables: VariableDeclaration<string | string[]>[];
|
|
689
|
+
|
|
690
|
+
interface PciReadyPayload {
|
|
691
|
+
responseIdentifier: string;
|
|
692
|
+
status: 'interacting' | 'suspended' | 'closed' | 'solution' | 'review';
|
|
693
|
+
}
|
|
694
|
+
interface PciDonePayload {
|
|
695
|
+
responseIdentifier: string;
|
|
696
|
+
status: 'interacting' | 'suspended' | 'closed' | 'solution' | 'review';
|
|
697
|
+
outcome?: unknown;
|
|
698
|
+
}
|
|
699
|
+
interface ConfigProperties<T> {
|
|
700
|
+
properties: T;
|
|
701
|
+
templateVariables: Record<string, unknown>;
|
|
702
|
+
contextVariables: Record<string, unknown>;
|
|
703
|
+
boundTo: unknown;
|
|
704
|
+
responseIdentifier: string;
|
|
705
|
+
onready: (payload: PciReadyPayload) => void;
|
|
706
|
+
ondone?: (payload: PciDonePayload) => void;
|
|
707
|
+
status?: 'interacting' | 'suspended' | 'closed' | 'solution' | 'review';
|
|
708
|
+
}
|
|
709
|
+
interface IMSpci<T> {
|
|
710
|
+
typeIdentifier: string;
|
|
711
|
+
/** @access public
|
|
712
|
+
* @method getInstance Create a new instance of this portable custom interaction
|
|
713
|
+
* Will be called by the qtiCustomInteractionContext
|
|
714
|
+
* @param {DOM Element} dom - the DOM Element this PCI is being added to
|
|
715
|
+
* @param {Object} configuration - the configuration to apply to this PCI
|
|
716
|
+
* @param {String} state - a previous saved state to apply to this instance.
|
|
717
|
+
* This must have been obtained from a prior call to getState on an
|
|
718
|
+
* instance of this type (same typeIdentifier)
|
|
719
|
+
*/
|
|
720
|
+
getInstance: (dom: HTMLElement, configuration: Configuration<T>, state: string) => void;
|
|
721
|
+
/** @access public
|
|
722
|
+
* @method getResponse
|
|
723
|
+
* @return {Object} - the value to assign to the bound QTI response variable
|
|
724
|
+
*/
|
|
725
|
+
getResponse: () => QtiVariableJSON | undefined;
|
|
726
|
+
/** @access public
|
|
727
|
+
* @method setResponse
|
|
728
|
+
* @param {Object} value - the value to assign to the bound QTI response variable
|
|
729
|
+
* NOTE: This is not an official QTI method, so no guarantee it is implemented
|
|
730
|
+
* in all PCIs.
|
|
731
|
+
*/
|
|
732
|
+
setResponse: (value: QtiVariableJSON) => void;
|
|
733
|
+
/** @access public
|
|
734
|
+
* @method getState
|
|
735
|
+
* @return {String} The current state of this PCI. May be passed to
|
|
736
|
+
* getInstance to later restore this PCI instance.
|
|
737
|
+
*/
|
|
738
|
+
getState: () => string;
|
|
739
|
+
oncompleted?: () => void;
|
|
740
|
+
destroy?: () => void;
|
|
741
|
+
}
|
|
742
|
+
declare type Configuration<T> = {
|
|
743
|
+
onready: (pci: IMSpci<ConfigProperties<T>>, state?: string) => void;
|
|
744
|
+
properties: T;
|
|
745
|
+
};
|
|
746
|
+
type QtiFileData = {
|
|
747
|
+
data: string;
|
|
748
|
+
mime: string;
|
|
749
|
+
name?: string;
|
|
750
|
+
};
|
|
751
|
+
type QtiBaseBoolean = boolean;
|
|
752
|
+
type QtiBaseInteger = number;
|
|
753
|
+
type QtiBaseFloat = number;
|
|
754
|
+
type QtiBaseString = string;
|
|
755
|
+
type QtiBasePoint = [number, number];
|
|
756
|
+
type QtiBasePair = [string, string];
|
|
757
|
+
type QtiBaseDirectedPair = [string, string];
|
|
758
|
+
type QtiBaseDuration = string;
|
|
759
|
+
type QtiBaseFile = QtiFileData;
|
|
760
|
+
type QtiBaseUri = string;
|
|
761
|
+
type QtiBaseIntOrIdentifier = number | string;
|
|
762
|
+
type QtiBaseIdentifier = string;
|
|
763
|
+
type QtiRecordItem = {
|
|
764
|
+
name: string;
|
|
765
|
+
base?: QtiBaseTypeJSON | null;
|
|
766
|
+
list?: QtiListTypeJSON | null;
|
|
767
|
+
};
|
|
768
|
+
type ResponseVariableType = QtiVariableJSON;
|
|
769
|
+
type QtiBaseTypeJSON = {
|
|
770
|
+
boolean?: QtiBaseBoolean;
|
|
771
|
+
integer?: QtiBaseInteger;
|
|
772
|
+
float?: QtiBaseFloat;
|
|
773
|
+
string?: QtiBaseString;
|
|
774
|
+
point?: QtiBasePoint;
|
|
775
|
+
pair?: QtiBasePair;
|
|
776
|
+
directedPair?: QtiBaseDirectedPair;
|
|
777
|
+
duration?: QtiBaseDuration;
|
|
778
|
+
file?: QtiBaseFile;
|
|
779
|
+
uri?: QtiBaseUri;
|
|
780
|
+
intOrIdentifier?: QtiBaseIntOrIdentifier;
|
|
781
|
+
identifier?: QtiBaseIdentifier;
|
|
782
|
+
} | null;
|
|
783
|
+
type QtiListTypeJSON = {
|
|
784
|
+
boolean?: QtiBaseBoolean[];
|
|
785
|
+
integer?: QtiBaseInteger[];
|
|
786
|
+
float?: QtiBaseFloat[];
|
|
787
|
+
string?: QtiBaseString[];
|
|
788
|
+
point?: QtiBasePoint[];
|
|
789
|
+
pair?: QtiBasePair[];
|
|
790
|
+
directedPair?: QtiBaseDirectedPair[];
|
|
791
|
+
duration?: QtiBaseDuration[];
|
|
792
|
+
file?: QtiBaseFile[];
|
|
793
|
+
uri?: QtiBaseUri[];
|
|
794
|
+
intOrIdentifier?: QtiBaseIntOrIdentifier[];
|
|
795
|
+
identifier?: QtiBaseIdentifier[];
|
|
796
|
+
} | null;
|
|
797
|
+
declare type QtiVariableJSON = {
|
|
798
|
+
base?: QtiBaseTypeJSON;
|
|
799
|
+
list?: QtiListTypeJSON;
|
|
800
|
+
record?: QtiRecordItem[] | null;
|
|
801
|
+
};
|
|
802
|
+
interface ModuleResolutionConfig {
|
|
803
|
+
waitSeconds?: number;
|
|
804
|
+
context?: string;
|
|
805
|
+
catchError?: boolean;
|
|
806
|
+
paths: {
|
|
807
|
+
[key: string]: string | string[];
|
|
808
|
+
};
|
|
809
|
+
shim?: {
|
|
810
|
+
[key: string]: {
|
|
811
|
+
deps?: string[];
|
|
812
|
+
exports?: string;
|
|
813
|
+
};
|
|
814
|
+
};
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
declare class QtiPortableCustomInteraction extends Interaction {
|
|
818
|
+
private _value;
|
|
819
|
+
private pci;
|
|
820
|
+
protected _iframeLoaded: boolean;
|
|
821
|
+
protected _pendingMessages: Array<{
|
|
822
|
+
method: string;
|
|
823
|
+
params: any;
|
|
824
|
+
}>;
|
|
825
|
+
protected iframe: HTMLIFrameElement;
|
|
826
|
+
private _responseCheckInterval;
|
|
827
|
+
private _lastResponseStr;
|
|
828
|
+
static styles: CSSResultGroup;
|
|
829
|
+
module: string;
|
|
830
|
+
customInteractionTypeIdentifier: string;
|
|
831
|
+
requirePathsJson: string;
|
|
832
|
+
requireShimJson: string;
|
|
833
|
+
requireJsUrl: string;
|
|
834
|
+
baseUrl: string;
|
|
835
|
+
useIframe: boolean;
|
|
836
|
+
useDefaultShims: boolean;
|
|
837
|
+
useDefaultPaths: boolean;
|
|
838
|
+
private _errorMessage;
|
|
839
|
+
protected context?: ItemContext;
|
|
840
|
+
response: string | string[];
|
|
841
|
+
private dom;
|
|
842
|
+
private _parsedRequirePaths;
|
|
843
|
+
private _parsedRequireShim;
|
|
844
|
+
/**
|
|
845
|
+
* Parse the require paths JSON string into an object
|
|
846
|
+
*/
|
|
847
|
+
private getRequirePaths;
|
|
848
|
+
/**
|
|
849
|
+
* Parse the require shim JSON string into an object
|
|
850
|
+
*/
|
|
851
|
+
private getRequireShim;
|
|
852
|
+
/**
|
|
853
|
+
* Get the default require paths
|
|
854
|
+
*/
|
|
855
|
+
private getDefaultRequirePaths;
|
|
856
|
+
/**
|
|
857
|
+
* Get the default require shim
|
|
858
|
+
*/
|
|
859
|
+
private getDefaultRequireShim;
|
|
860
|
+
/**
|
|
861
|
+
* Get the final require paths by combining defaults with user-provided paths
|
|
862
|
+
*/
|
|
863
|
+
private getFinalRequirePaths;
|
|
864
|
+
/**
|
|
865
|
+
* Get the final require shim by combining defaults with user-provided shim
|
|
866
|
+
*/
|
|
867
|
+
private getFinalRequireShim;
|
|
868
|
+
/**
|
|
869
|
+
* Converts QtiVariableJSON to a string or string array
|
|
870
|
+
*/
|
|
871
|
+
private convertQtiVariableJSON;
|
|
872
|
+
/**
|
|
873
|
+
* Adds hyphenated versions of camelCase keys to properties object
|
|
874
|
+
*/
|
|
875
|
+
private addHyphenatedKeys;
|
|
876
|
+
/**
|
|
877
|
+
* Converts response variables to QtiVariableJSON
|
|
878
|
+
*/
|
|
879
|
+
protected responseVariablesToQtiVariableJSON(input: string | string[], cardinality: Cardinality, baseType: BaseType): QtiVariableJSON;
|
|
880
|
+
validate(): boolean;
|
|
881
|
+
set value(v: string | null);
|
|
882
|
+
get value(): string | null;
|
|
883
|
+
set boundTo(newValue: Record<string, ResponseVariableType>);
|
|
884
|
+
get boundTo(): Record<string, QtiVariableJSON>;
|
|
885
|
+
/**
|
|
886
|
+
* DIRECT MODE: Register PCI instance
|
|
887
|
+
*/
|
|
888
|
+
register(pci: IMSpci<ConfigProperties<unknown>>): void;
|
|
889
|
+
disconnectedCallback(): void;
|
|
890
|
+
/**
|
|
891
|
+
* IFRAME MODE: Send message to iframe
|
|
892
|
+
*/
|
|
893
|
+
protected sendMessageToIframe(method: string, params: any): void;
|
|
894
|
+
/**
|
|
895
|
+
* IFRAME MODE: Process pending messages
|
|
896
|
+
*/
|
|
897
|
+
private processPendingMessages;
|
|
898
|
+
/**
|
|
899
|
+
* IFRAME MODE: Handle iframe messages
|
|
900
|
+
*/
|
|
901
|
+
protected handleIframeMessage: (event: MessageEvent) => void;
|
|
902
|
+
/**
|
|
903
|
+
* IFRAME MODE: Create iframe element
|
|
904
|
+
*/
|
|
905
|
+
protected createIframe(): void;
|
|
906
|
+
/**
|
|
907
|
+
* IFRAME MODE: Send initialization data to iframe
|
|
908
|
+
*/
|
|
909
|
+
private sendIframeInitData;
|
|
910
|
+
/**
|
|
911
|
+
* IFRAME MODE: Get interaction modules from DOM
|
|
912
|
+
*/
|
|
913
|
+
private getInteractionModules;
|
|
914
|
+
/**
|
|
915
|
+
* IFRAME MODE: Add markup and properties to iframe
|
|
916
|
+
*/
|
|
917
|
+
private addMarkupToIframe;
|
|
918
|
+
/**
|
|
919
|
+
* IFRAME MODE: Initialize the interaction
|
|
920
|
+
*/
|
|
921
|
+
private initializeInteraction;
|
|
922
|
+
connectedCallback(): void;
|
|
923
|
+
/**
|
|
924
|
+
* Start checking for response changes at regular intervals
|
|
925
|
+
*/
|
|
926
|
+
private startResponseCheck;
|
|
927
|
+
/**
|
|
928
|
+
* Stop checking for response changes
|
|
929
|
+
*/
|
|
930
|
+
private stopResponseCheck;
|
|
931
|
+
private _onInteractionChanged;
|
|
932
|
+
/**
|
|
933
|
+
* DIRECT MODE: Build RequireJS configuration
|
|
934
|
+
*/
|
|
935
|
+
buildRequireConfig(): ModuleResolutionConfig;
|
|
936
|
+
/**
|
|
937
|
+
* DIRECT MODE: Helper method to combine require paths
|
|
938
|
+
*/
|
|
939
|
+
private combineRequireResolvePaths;
|
|
940
|
+
/**
|
|
941
|
+
* DIRECT MODE: Helper method to remove double slashes
|
|
942
|
+
*/
|
|
943
|
+
private removeDoubleSlashes;
|
|
944
|
+
/**
|
|
945
|
+
* DIRECT MODE: Load config from URL
|
|
946
|
+
*/
|
|
947
|
+
loadConfig: (url: string, baseUrl?: string) => Promise<ModuleResolutionConfig>;
|
|
948
|
+
/**
|
|
949
|
+
* DIRECT MODE: Helper method to get resolvable path string
|
|
950
|
+
*/
|
|
951
|
+
getResolvablePathString: (path: string, basePath?: string) => string;
|
|
952
|
+
/**
|
|
953
|
+
* DIRECT MODE: Helper method to get resolvable path
|
|
954
|
+
*/
|
|
955
|
+
getResolvablePath: (path: string | string[], basePath?: string) => string | string[];
|
|
956
|
+
/**
|
|
957
|
+
* IFRAME MODE: Generate iframe HTML content
|
|
958
|
+
*/
|
|
959
|
+
protected generateIframeContent(): string;
|
|
960
|
+
/**
|
|
961
|
+
* Toggle the display of the correct response
|
|
962
|
+
* @param responseVariable The response variable containing the correct response
|
|
963
|
+
* @param show Whether to show or hide the correct response
|
|
964
|
+
*/
|
|
965
|
+
toggleCorrectResponse(responseVariable: ResponseVariable, show: boolean): void;
|
|
966
|
+
/**
|
|
967
|
+
* Method to disable the PCI for review mode
|
|
968
|
+
* This can be used when showing the correct response
|
|
969
|
+
*/
|
|
970
|
+
disable(): void;
|
|
971
|
+
/**
|
|
972
|
+
* Method to enable the PCI for interactive mode
|
|
973
|
+
*/
|
|
974
|
+
enable(): void;
|
|
975
|
+
private _previousState;
|
|
976
|
+
render(): lit_html.TemplateResult<1>;
|
|
977
|
+
}
|
|
978
|
+
declare global {
|
|
979
|
+
interface HTMLElementTagNameMap {
|
|
980
|
+
'qti-portable-custom-interaction': QtiPortableCustomInteraction;
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
declare class QtiPositionObjectStage extends LitElement {
|
|
985
|
+
choiceOrdering: boolean;
|
|
986
|
+
startX: any;
|
|
987
|
+
startY: any;
|
|
988
|
+
dragElement: any;
|
|
989
|
+
render(): lit_html.TemplateResult<1>;
|
|
990
|
+
static styles: lit.CSSResult[];
|
|
991
|
+
constructor();
|
|
992
|
+
dragElementHandler(event: any): void;
|
|
993
|
+
firstUpdated(a: any): void;
|
|
994
|
+
removeMoveListener(): void;
|
|
995
|
+
disconnectedCallback(): void;
|
|
996
|
+
}
|
|
997
|
+
declare global {
|
|
998
|
+
interface HTMLElementTagNameMap {
|
|
999
|
+
'qti-position-object-stage': QtiPositionObjectStage;
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
declare class QtiSelectPointInteraction extends Interaction {
|
|
1004
|
+
static styles: lit.CSSResult[];
|
|
1005
|
+
maxChoices: number;
|
|
1006
|
+
minChoices: number;
|
|
1007
|
+
response: string[];
|
|
1008
|
+
private _correctAreas;
|
|
1009
|
+
private _imgElement;
|
|
1010
|
+
private _scaleX;
|
|
1011
|
+
private _scaleY;
|
|
1012
|
+
private _imageWidthOrginal;
|
|
1013
|
+
private _imageHeightOrginal;
|
|
1014
|
+
private _onImageClick;
|
|
1015
|
+
connectedCallback(): void;
|
|
1016
|
+
private _onResize;
|
|
1017
|
+
toggleCorrectResponse(responseVariable: ResponseVariable, show: boolean): any;
|
|
1018
|
+
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
1019
|
+
render(): lit_html.TemplateResult<1>;
|
|
1020
|
+
reset(): void;
|
|
1021
|
+
validate(): boolean;
|
|
1022
|
+
private calculateScale;
|
|
1023
|
+
firstUpdated(): void;
|
|
1024
|
+
disconnectedCallback(): void;
|
|
1025
|
+
}
|
|
1026
|
+
declare global {
|
|
1027
|
+
interface HTMLElementTagNameMap {
|
|
1028
|
+
'qti-select-point-interaction': QtiSelectPointInteraction;
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
declare const QtiSimpleChoice_base: (abstract new (...args: any[]) => ActiveElementMixinInterface) & typeof LitElement;
|
|
1033
|
+
/**
|
|
1034
|
+
* qti-order-interaction
|
|
1035
|
+
* qti-choice-interaction
|
|
1036
|
+
*/
|
|
1037
|
+
declare class QtiSimpleChoice extends QtiSimpleChoice_base {
|
|
1038
|
+
templateIdentifier: string | null;
|
|
1039
|
+
showHide: string | null;
|
|
1040
|
+
fixed: boolean;
|
|
1041
|
+
static styles: lit.CSSResult;
|
|
1042
|
+
marker: string;
|
|
1043
|
+
get checked(): boolean;
|
|
1044
|
+
render(): lit_html.TemplateResult<1>;
|
|
1045
|
+
}
|
|
1046
|
+
declare global {
|
|
1047
|
+
interface HTMLElementTagNameMap {
|
|
1048
|
+
'qti-simple-choice': QtiSimpleChoice;
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
declare class QtiSliderInteraction extends Interaction {
|
|
1053
|
+
static styles: CSSResultGroup;
|
|
1054
|
+
private _value;
|
|
1055
|
+
private _correctResponseNumber;
|
|
1056
|
+
private _rail;
|
|
1057
|
+
min: number;
|
|
1058
|
+
max: number;
|
|
1059
|
+
step: number;
|
|
1060
|
+
validate(): boolean;
|
|
1061
|
+
connectedCallback(): void;
|
|
1062
|
+
get response(): string;
|
|
1063
|
+
set response(val: string);
|
|
1064
|
+
toggleCorrectResponse(responseVariable: ResponseVariable, show: boolean): void;
|
|
1065
|
+
private _updateValue;
|
|
1066
|
+
render(): lit_html.TemplateResult<1>;
|
|
1067
|
+
private _onMouseDown;
|
|
1068
|
+
private _onTouchStart;
|
|
1069
|
+
private _startDrag;
|
|
1070
|
+
private _onDrag;
|
|
1071
|
+
private _onDragEnd;
|
|
1072
|
+
}
|
|
1073
|
+
declare global {
|
|
1074
|
+
interface HTMLElementTagNameMap {
|
|
1075
|
+
'qti-slider-interaction': QtiSliderInteraction;
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
declare class QtiTextEntryInteraction extends Interaction {
|
|
1080
|
+
static styles: CSSResultGroup;
|
|
1081
|
+
inputRef: lit_html_directives_ref_js.Ref<HTMLInputElement>;
|
|
1082
|
+
expectedLength: number;
|
|
1083
|
+
patternMask: string;
|
|
1084
|
+
placeholderText: string;
|
|
1085
|
+
dataPatternmaskMessage: string;
|
|
1086
|
+
response: string | null;
|
|
1087
|
+
private _input;
|
|
1088
|
+
protected _handleValueChange: () => void;
|
|
1089
|
+
get value(): string | null;
|
|
1090
|
+
set value(val: string | null);
|
|
1091
|
+
validate(): boolean;
|
|
1092
|
+
toggleCorrectResponse(responseVariable: ResponseVariable, show: boolean): void;
|
|
1093
|
+
render(): lit_html.TemplateResult<1>;
|
|
1094
|
+
protected textChanged(event: Event): void;
|
|
1095
|
+
reportValidity(): boolean;
|
|
1096
|
+
reset(): void;
|
|
1097
|
+
private setEmptyAttribute;
|
|
1098
|
+
}
|
|
1099
|
+
declare global {
|
|
1100
|
+
interface HTMLElementTagNameMap {
|
|
1101
|
+
'qti-text-entry-interaction': QtiTextEntryInteraction;
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
declare class QtiUploadInteraction extends Interaction {
|
|
1106
|
+
private _file;
|
|
1107
|
+
private _base64;
|
|
1108
|
+
reset(): void;
|
|
1109
|
+
validate(): boolean;
|
|
1110
|
+
get response(): string | null;
|
|
1111
|
+
set response(base64: string | null);
|
|
1112
|
+
static get properties(): {
|
|
1113
|
+
[key: string]: lit.PropertyDeclaration<unknown, unknown>;
|
|
1114
|
+
};
|
|
1115
|
+
static styles: lit.CSSResult[];
|
|
1116
|
+
render(): lit_html.TemplateResult<1>;
|
|
1117
|
+
private _onFileChange;
|
|
1118
|
+
private _convertToBase64;
|
|
1119
|
+
}
|
|
1120
|
+
declare global {
|
|
1121
|
+
interface HTMLElementTagNameMap {
|
|
1122
|
+
'qti-upload-interaction': QtiUploadInteraction;
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
/**
|
|
1127
|
+
* @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.
|
|
1128
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.sphpo6lu6zqi
|
|
1129
|
+
* @status stable
|
|
1130
|
+
* @since 4.0
|
|
1131
|
+
*
|
|
1132
|
+
* @slot - item body content.
|
|
1133
|
+
* @slot qti-rubric-block - the qti rubric block is placed above the item
|
|
1134
|
+
* @part qti-rubric-block - the qti rubric block part
|
|
1135
|
+
*/
|
|
1136
|
+
declare class QtiItemBody extends LitElement {
|
|
1137
|
+
static styles: CSSResultGroup;
|
|
1138
|
+
render(): lit_html.TemplateResult<1>;
|
|
1139
|
+
}
|
|
1140
|
+
declare global {
|
|
1141
|
+
interface HTMLElementTagNameMap {
|
|
1142
|
+
'qti-item-body': QtiItemBody;
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
declare class QtiOutcomeProcessing extends LitElement {
|
|
1147
|
+
static styles: lit.CSSResult[];
|
|
1148
|
+
render(): lit_html.TemplateResult<1>;
|
|
1149
|
+
process(): void;
|
|
1150
|
+
}
|
|
1151
|
+
declare global {
|
|
1152
|
+
interface HTMLElementTagNameMap {
|
|
1153
|
+
'qti-outcome-processing': QtiOutcomeProcessing;
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
declare class QtiOutcomeProcessingProcessor {
|
|
1157
|
+
process(rules: QtiRuleBase[]): void;
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
declare class QtiPrompt extends LitElement {
|
|
1161
|
+
render(): lit_html.TemplateResult<1>;
|
|
1162
|
+
connectedCallback(): void;
|
|
1163
|
+
}
|
|
1164
|
+
declare global {
|
|
1165
|
+
interface HTMLElementTagNameMap {
|
|
1166
|
+
'qti-prompt': QtiPrompt;
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
declare class QtiResponseProcessing extends LitElement {
|
|
1171
|
+
static styles: lit.CSSResult[];
|
|
1172
|
+
render(): lit_html.TemplateResult<1>;
|
|
1173
|
+
process(): void;
|
|
1174
|
+
firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
|
|
1175
|
+
private fragmentFromString;
|
|
1176
|
+
}
|
|
1177
|
+
declare global {
|
|
1178
|
+
interface HTMLElementTagNameMap {
|
|
1179
|
+
'qti-response-processing': QtiResponseProcessing;
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
declare class QtiRule extends LitElement implements QtiRuleBase {
|
|
1184
|
+
render(): lit_html.TemplateResult<1>;
|
|
1185
|
+
process(): void;
|
|
1186
|
+
}
|
|
1187
|
+
interface QtiRuleBase {
|
|
1188
|
+
process(): any;
|
|
1189
|
+
}
|
|
1190
|
+
declare global {
|
|
1191
|
+
interface HTMLElementTagNameMap {
|
|
1192
|
+
'qti-rule': QtiRule;
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
interface QtiExpressionBase<T> {
|
|
1197
|
+
calculate(): Readonly<T>;
|
|
1198
|
+
}
|
|
1199
|
+
declare abstract class QtiExpression<T> extends LitElement implements QtiExpressionBase<T> {
|
|
1200
|
+
protected result: any;
|
|
1201
|
+
static styles: lit.CSSResult;
|
|
1202
|
+
render(): lit_html.TemplateResult<1>;
|
|
1203
|
+
calculate(): Readonly<T>;
|
|
1204
|
+
protected getResult(): Readonly<T>;
|
|
1205
|
+
protected context?: ItemContext;
|
|
1206
|
+
getVariables: () => VariableDeclaration<number | string | (number | string)[] | null>[];
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
/**
|
|
1210
|
+
* The lookupOutcomeValue rule sets the value of an outcome variable to the value obtained
|
|
1211
|
+
* by looking up the value of the associated expression in the lookupTable associated
|
|
1212
|
+
* with the outcome's declaration.
|
|
1213
|
+
*/
|
|
1214
|
+
declare class QtiLookupOutcomeValue extends QtiRule {
|
|
1215
|
+
identifier: string;
|
|
1216
|
+
protected context?: ItemContext;
|
|
1217
|
+
get childExpression(): QtiExpression<string>;
|
|
1218
|
+
process(): number;
|
|
1219
|
+
}
|
|
1220
|
+
declare global {
|
|
1221
|
+
interface HTMLElementTagNameMap {
|
|
1222
|
+
'qti-lookup-outcome-value': QtiLookupOutcomeValue;
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
type QtiMapping = {
|
|
1227
|
+
defaultValue: number;
|
|
1228
|
+
lowerBound?: number;
|
|
1229
|
+
upperBound?: number;
|
|
1230
|
+
mapEntries: QtiMapEntry[];
|
|
1231
|
+
};
|
|
1232
|
+
type QtiMapEntry = {
|
|
1233
|
+
mapKey: string;
|
|
1234
|
+
mappedValue: number;
|
|
1235
|
+
caseSensitive: boolean;
|
|
1236
|
+
};
|
|
1237
|
+
|
|
1238
|
+
type QtiAreaMapping = {
|
|
1239
|
+
defaultValue: number;
|
|
1240
|
+
lowerBound?: number;
|
|
1241
|
+
upperBound?: number;
|
|
1242
|
+
areaMapEntries: QtiAreaMapEntry[];
|
|
1243
|
+
};
|
|
1244
|
+
type QtiAreaMapEntry = {
|
|
1245
|
+
shape: areaShape;
|
|
1246
|
+
coords: string;
|
|
1247
|
+
mappedValue: number;
|
|
1248
|
+
defaultValue: number;
|
|
1249
|
+
};
|
|
1250
|
+
type areaShape = 'default' | 'circle' | 'rect' | 'ellipse' | 'poly';
|
|
1251
|
+
|
|
1252
|
+
type Constructor<T> = new (...args: any[]) => T;
|
|
1253
|
+
declare const QtiSubtract_base: {
|
|
1254
|
+
new (...args: any[]): {
|
|
1255
|
+
calculateChildren(children: Array<MockQtiExpression<any>>): number;
|
|
1256
|
+
};
|
|
1257
|
+
} & Constructor<QtiExpression<number>>;
|
|
1258
|
+
declare class QtiSubtract extends QtiSubtract_base {
|
|
1259
|
+
getResult(): number;
|
|
1260
|
+
}
|
|
1261
|
+
type MockQtiExpression<T> = {
|
|
1262
|
+
calculate: () => T;
|
|
1263
|
+
};
|
|
1264
|
+
type MockConstructor = new (...args: any[]) => {};
|
|
1265
|
+
declare function qtiSubtractMixin<TBase extends MockConstructor>(Base: TBase): {
|
|
1266
|
+
new (...args: any[]): {
|
|
1267
|
+
calculateChildren(children: Array<MockQtiExpression<any>>): number;
|
|
1268
|
+
};
|
|
1269
|
+
} & TBase;
|
|
1270
|
+
|
|
1271
|
+
declare global {
|
|
1272
|
+
interface HTMLElementTagNameMap {
|
|
1273
|
+
'qti-subtract': QtiSubtract;
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
declare class QtiContentBody extends LitElement {
|
|
1278
|
+
render(): lit_html.TemplateResult<1>;
|
|
1279
|
+
}
|
|
1280
|
+
declare global {
|
|
1281
|
+
interface HTMLElementTagNameMap {
|
|
1282
|
+
'qti-content-body': QtiContentBody;
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
declare class QtiRubricBlock extends LitElement {
|
|
1287
|
+
id: any;
|
|
1288
|
+
use: 'instructions' | 'scoring' | 'navigation';
|
|
1289
|
+
view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor';
|
|
1290
|
+
classNames: any;
|
|
1291
|
+
handleclassNamesChange(): void;
|
|
1292
|
+
static styles: lit.CSSResult;
|
|
1293
|
+
render(): lit_html.TemplateResult<1>;
|
|
1294
|
+
}
|
|
1295
|
+
declare global {
|
|
1296
|
+
interface HTMLElementTagNameMap {
|
|
1297
|
+
'qti-rubric-block': QtiRubricBlock;
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
declare class QtiStylesheet extends LitElement {
|
|
1302
|
+
private styleElement;
|
|
1303
|
+
protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
|
|
1304
|
+
private minifyCss;
|
|
1305
|
+
disconnectedCallback(): void;
|
|
1306
|
+
}
|
|
1307
|
+
declare global {
|
|
1308
|
+
interface HTMLElementTagNameMap {
|
|
1309
|
+
'qti-stylesheet': QtiStylesheet;
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
declare class QtiVariableDeclaration extends LitElement {
|
|
1314
|
+
render(): lit_html.TemplateResult<1>;
|
|
1315
|
+
protected defaultValues(variable: VariableDeclaration<string | string[] | null>): string | string[];
|
|
1316
|
+
}
|
|
1317
|
+
declare global {
|
|
1318
|
+
interface HTMLElementTagNameMap {
|
|
1319
|
+
'qti-variabledeclaration': QtiVariableDeclaration;
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
declare class QtiOutcomeDeclaration extends QtiVariableDeclaration {
|
|
1324
|
+
baseType: BaseType;
|
|
1325
|
+
externalScored: 'human' | 'externalMachine' | null;
|
|
1326
|
+
identifier: string;
|
|
1327
|
+
cardinality: Cardinality;
|
|
1328
|
+
itemContext?: ItemContext;
|
|
1329
|
+
static styles: lit.CSSResult[];
|
|
1330
|
+
render(): lit_html.TemplateResult<1>;
|
|
1331
|
+
get interpolationTable(): Map<number, number> | null;
|
|
1332
|
+
connectedCallback(): void;
|
|
1333
|
+
}
|
|
1334
|
+
declare global {
|
|
1335
|
+
interface HTMLElementTagNameMap {
|
|
1336
|
+
'qti-outcome-declaration': QtiOutcomeDeclaration;
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
declare class QtiResponseDeclaration extends QtiVariableDeclaration {
|
|
1341
|
+
baseType: BaseType;
|
|
1342
|
+
identifier: string;
|
|
1343
|
+
cardinality: Cardinality;
|
|
1344
|
+
itemContext?: ItemContext;
|
|
1345
|
+
static styles: lit.CSSResult[];
|
|
1346
|
+
render(): lit_html.TemplateResult<1>;
|
|
1347
|
+
connectedCallback(): void;
|
|
1348
|
+
private get correctResponse();
|
|
1349
|
+
private get mapping();
|
|
1350
|
+
private get areaMapping();
|
|
1351
|
+
}
|
|
1352
|
+
declare global {
|
|
1353
|
+
interface HTMLElementTagNameMap {
|
|
1354
|
+
'qti-response-declaration': QtiResponseDeclaration;
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
export { QtiContentBody as $, QtiMediaInteraction as A, QtiOrderInteraction as B, QtiPortableCustomInteraction as C, QtiPositionObjectStage as D, QtiSelectPointInteraction as E, QtiSimpleAssociableChoice as F, QtiSimpleChoice as G, QtiSliderInteraction as H, QtiTextEntryInteraction as I, QtiUploadInteraction as J, QtiItemBody as K, QtiOutcomeProcessing as L, QtiOutcomeProcessingProcessor as M, QtiPrompt as N, type Orientation as O, QtiResponseProcessing as P, QtiAssessmentItem as Q, QtiLookupOutcomeValue as R, type QtiMapping as S, type QtiMapEntry as T, type QtiAreaMapping as U, type QtiAreaMapEntry as V, type areaShape as W, QtiSubtract as X, qtiSubtractMixin as Y, QtiRule as Z, type QtiRuleBase as _, QtiAssessmentStimulusRef as a, QtiRubricBlock as a0, QtiStylesheet as a1, QtiOutcomeDeclaration as a2, QtiResponseDeclaration as a3, type ItemContext as a4, type VariableValue as a5, type OutcomeVariable as a6, type VariableDeclaration as a7, QtiExpression as a8, type QtiExpressionBase as a9, type ResponseVariable as aa, Interaction as ab, itemContextVariables as ac, QtiCompanionMaterialsInfo as b, QtiCustomOperator as c, QtiFeedbackBlock as d, QtiFeedbackInline as e, QtiModalFeedback as f, QtiAssociableHotspot as g, QtiAssociateInteraction as h, QtiChoiceInteraction as i, QtiCustomInteraction as j, QtiEndAttemptInteraction as k, QtiExtendedTextInteraction as l, QtiGapImg as m, QtiGapMatchInteraction as n, QtiGapText as o, QtiGap as p, QtiGraphicAssociateInteraction as q, QtiGraphicGapMatchInteraction as r, QtiGraphicOrderInteraction as s, QtiHotspotChoice as t, QtiHotspotInteraction as u, QtiHottextInteraction as v, QtiHottext as w, QtiInlineChoiceInteraction as x, QtiInlineChoice as y, QtiMatchInteraction as z };
|