@citolab/qti-components 6.0.17 → 6.0.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.
@@ -1,352 +0,0 @@
1
- import { a as ResponseInteraction, V as VariableDeclaration } from './qti-assessment-item-f1fcf393.js';
2
- import * as lit_html from 'lit-html';
3
- import * as lit from 'lit';
4
- import { LitElement, CSSResultGroup } from 'lit';
5
- import * as lit_html_directives_ref from 'lit-html/directives/ref';
6
-
7
- interface OutcomeChangedDetails {
8
- item: string;
9
- outcomeIdentifier: string;
10
- value: number;
11
- }
12
- type InteractionChangedDetails = ResponseInteraction & {
13
- item: string;
14
- };
15
-
16
- type QtiOutcomeChanged = CustomEvent<OutcomeChangedDetails>;
17
- declare global {
18
- interface GlobalEventHandlersEventMap {
19
- 'qti-outcome-changed': QtiOutcomeChanged;
20
- }
21
- }
22
-
23
- type qtiOutcomeChanged_QtiOutcomeChanged = QtiOutcomeChanged;
24
- declare namespace qtiOutcomeChanged {
25
- export {
26
- qtiOutcomeChanged_QtiOutcomeChanged as QtiOutcomeChanged,
27
- QtiOutcomeChanged as default,
28
- };
29
- }
30
-
31
- type QtiInteractionChanged = CustomEvent<InteractionChangedDetails>;
32
- declare global {
33
- interface GlobalEventHandlersEventMap {
34
- "qti-interaction-changed": QtiInteractionChanged;
35
- }
36
- }
37
-
38
- type qtiInteractionChanged_QtiInteractionChanged = QtiInteractionChanged;
39
- declare namespace qtiInteractionChanged {
40
- export {
41
- qtiInteractionChanged_QtiInteractionChanged as QtiInteractionChanged,
42
- QtiInteractionChanged as default,
43
- };
44
- }
45
-
46
- type QtiRegisterVariable = CustomEvent<{
47
- variable: VariableDeclaration<number | string | string[]>;
48
- }>;
49
- declare global {
50
- interface GlobalEventHandlersEventMap {
51
- "qti-register-variable": QtiRegisterVariable;
52
- }
53
- }
54
-
55
- declare namespace qtiRegisterVariable {
56
- export {
57
- QtiRegisterVariable as default,
58
- };
59
- }
60
-
61
- type QtiRegisterInteraction = CustomEvent<Record<PropertyKey, never>>;
62
- declare global {
63
- interface GlobalEventHandlersEventMap {
64
- 'qti-register-interaction': QtiRegisterInteraction;
65
- }
66
- }
67
-
68
- declare namespace qtiRegisterInteraction {
69
- export {
70
- QtiRegisterInteraction as default,
71
- };
72
- }
73
-
74
- type QtiRegisterChoice = CustomEvent<Record<PropertyKey, never>>;
75
- declare global {
76
- interface GlobalEventHandlersEventMap {
77
- 'qti-register-choice': QtiRegisterChoice;
78
- }
79
- }
80
-
81
- declare namespace qtiRegisterChoice {
82
- export {
83
- QtiRegisterChoice as default,
84
- };
85
- }
86
-
87
- type QtiRegisterHotspot = CustomEvent<Record<PropertyKey, never>>;
88
- declare global {
89
- interface GlobalEventHandlersEventMap {
90
- 'qti-register-hotspot': QtiRegisterHotspot;
91
- }
92
- }
93
-
94
- declare namespace qtiRegisterHotspot {
95
- export {
96
- QtiRegisterHotspot as default,
97
- };
98
- }
99
-
100
- type QtiLooseChoice = CustomEvent<Record<PropertyKey, never>>;
101
- declare global {
102
- interface GlobalEventHandlersEventMap {
103
- 'qti-loose-choice': QtiLooseChoice;
104
- }
105
- }
106
-
107
- declare namespace qtiLooseChoice {
108
- export {
109
- QtiLooseChoice as default,
110
- };
111
- }
112
-
113
- type QtiInteractionResponse = CustomEvent<ResponseInteraction>;
114
- declare global {
115
- interface GlobalEventHandlersEventMap {
116
- 'qti-interaction-response': QtiInteractionResponse;
117
- }
118
- }
119
-
120
- declare namespace qtiInteractionResponse {
121
- export {
122
- QtiInteractionResponse as default,
123
- };
124
- }
125
-
126
- type QtiChoiceElementSelected = CustomEvent<{
127
- identifier: string;
128
- checked: boolean;
129
- }>;
130
- declare global {
131
- interface GlobalEventHandlersEventMap {
132
- 'qti-choice-element-selected': QtiChoiceElementSelected;
133
- }
134
- }
135
-
136
- declare namespace qtiChoiceElementSelected {
137
- export {
138
- QtiChoiceElementSelected as default,
139
- };
140
- }
141
-
142
- /**
143
- * @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.
144
- * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.sphpo6lu6zqi
145
- * @status stable
146
- * @since 4.0
147
- *
148
- * @slot - item body content.
149
- * @slot qti-rubric-block - the qti rubric block is placed above the item
150
- *
151
- */
152
- declare class QtiItemBody extends LitElement {
153
- static styles: CSSResultGroup;
154
- render(): lit_html.TemplateResult<1>;
155
- }
156
- declare global {
157
- interface HTMLElementTagNameMap {
158
- 'qti-item-body': QtiItemBody;
159
- }
160
- }
161
-
162
- /**
163
- * @summary qti-choice is used by qti-simple-choice, qti-inline-choice, qti-hottext, qti-hotspot-choice.
164
- *
165
- * @since 1.0
166
- * @status stable
167
- *
168
- * @event qti-register-choice - register itselves on a qti-choice-interaction element.
169
- * @event qti-loose-choice - de-register itselves on a qti-choice-interaction element.
170
- * @event qti-choice-element-selected - Emitted when the choice is selected.
171
- *
172
- * @slot - The choices slot element
173
- */
174
- declare abstract class QtiChoice extends LitElement {
175
- identifier: string;
176
- tabindex: number | undefined;
177
- disabled: boolean;
178
- readonly: boolean;
179
- checked: boolean;
180
- handleDisabledChange(_: boolean, disabled: boolean): void;
181
- connectedCallback(): void;
182
- disconnectedCallback(): void;
183
- reset(): void;
184
- private _onKeyUp;
185
- private _onClick;
186
- private _toggleChecked;
187
- validateAllProps(): boolean;
188
- render(): lit_html.TemplateResult<1 | 2>;
189
- }
190
- declare global {
191
- interface HTMLElementTagNameMap {
192
- 'qti-choice': QtiChoice;
193
- }
194
- }
195
-
196
- declare abstract class Interaction extends LitElement {
197
- responseIdentifier: string;
198
- /** disabled should be exposed to the attributes and accessible as property */
199
- disabled: boolean;
200
- /** readonly should be exposed to the attributes and accessible as property */
201
- readonly: boolean;
202
- abstract reset(): void;
203
- abstract validate(): boolean;
204
- abstract set response(val: string | string[]);
205
- connectedCallback(): void;
206
- saveResponse(value: string | string[]): void;
207
- }
208
-
209
- declare class QtiTextEntryInteraction extends Interaction {
210
- expectedLength: number;
211
- patternMask: string;
212
- placeholderText: string;
213
- private _value;
214
- classNames: any;
215
- set response(value: string | undefined);
216
- validate(): boolean;
217
- static get styles(): lit.CSSResult[];
218
- render(): lit_html.TemplateResult<1>;
219
- protected textChanged(event: Event): void;
220
- reset(): void;
221
- private setEmptyAttribute;
222
- }
223
- declare global {
224
- interface HTMLElementTagNameMap {
225
- 'qti-text-entry-interaction': QtiTextEntryInteraction;
226
- }
227
- }
228
-
229
- declare class QtiExtendedTextInteraction extends Interaction {
230
- textareaRef: lit_html_directives_ref.Ref<HTMLTextAreaElement>;
231
- /** expected length is mapped to the property maxlength on the textarea */
232
- expectedLength: number;
233
- patternMask: string;
234
- /** text appearing in the extended-text-nteraction if it is empty */
235
- placeholderText: string;
236
- private _value;
237
- classNames: any;
238
- handleclassNamesChange(old: any, disabled: boolean): void;
239
- set response(value: string);
240
- validate(): boolean;
241
- static get styles(): lit.CSSResult[];
242
- render(): lit_html.TemplateResult<1>;
243
- protected textChanged(event: Event): void;
244
- reset(): void;
245
- private setEmptyAttribute;
246
- }
247
- declare global {
248
- interface HTMLElementTagNameMap {
249
- 'qti-extended-text-interaction': QtiExtendedTextInteraction;
250
- }
251
- }
252
-
253
- declare abstract class Choices extends Interaction {
254
- protected _choiceElements: QtiChoice[];
255
- /** the minimal number of selections a candidate must make */
256
- minChoices: number;
257
- /** the maximum number of selections a candidate must make, the other options will be disabled when max options is checked */
258
- maxChoices: number;
259
- _handleDisabledChange: (_: boolean, disabled: boolean) => void;
260
- _handleReadonlyChange: (_: boolean, readonly: boolean) => void;
261
- _handleMaxChoicesChange: () => void;
262
- constructor();
263
- reset(): void;
264
- validate(): boolean;
265
- set response(myResponse: ResponseType);
266
- connectedCallback(): void;
267
- disconnectedCallback(): void;
268
- private _registerChoiceElement;
269
- private _looseChoiceElement;
270
- private _determineInputType;
271
- private _setInputType;
272
- private _choiceElementSelectedHandler;
273
- private _choiceElementSelected;
274
- }
275
-
276
- /**
277
- * @summary The ChoiceInteraction.Type (qti-choice-interaction) interaction presents a collection of choices to the candidate.
278
- * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.j9nu1oa1tu3b
279
- * @status stable
280
- * @since 6.0
281
- *
282
- * @event qti-register-interaction - emitted when the interaction wants to register itself
283
- * @event qti-interaction-response - emitted when the interaction changes
284
- *
285
- * @slot - The default slot where <qti-simple-choice> must be placed.
286
- * @slot prompt - slot where the prompt is placed.
287
- */
288
- declare class QtiChoiceInteraction extends Choices {
289
- static styles: CSSResultGroup;
290
- /** orientation of choices */
291
- orientation: 'horizontal' | 'vertical';
292
- render: () => lit_html.TemplateResult<1>;
293
- }
294
- declare global {
295
- interface HTMLElementTagNameMap {
296
- 'qti-choice-interaction': QtiChoiceInteraction;
297
- }
298
- }
299
-
300
- declare class QtiResponseProcessing extends LitElement {
301
- render(): lit_html.TemplateResult<1>;
302
- static get observedAttributes(): string[];
303
- process(): void;
304
- private fragmentFromString;
305
- }
306
- declare global {
307
- interface HTMLElementTagNameMap {
308
- 'qti-response-processing': QtiResponseProcessing;
309
- }
310
- }
311
-
312
- declare class QtiRule extends LitElement {
313
- render(): lit_html.TemplateResult<1>;
314
- process(): void;
315
- }
316
- declare global {
317
- interface HTMLElementTagNameMap {
318
- 'qti-rule': QtiRule;
319
- }
320
- }
321
-
322
- declare class QtiHottext extends QtiChoice {
323
- render(): lit_html.TemplateResult<1>;
324
- }
325
- declare global {
326
- interface HTMLElementTagNameMap {
327
- 'qti-hottext': QtiHottext;
328
- }
329
- }
330
-
331
- /**
332
- * @summary Short summary of the component's intended use.
333
- * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.j9nu1oa1tu3b
334
- * @status stable
335
- * @since 4.0
336
- *
337
- * @event qti-choice-element-selected - Emitted when a choice is selected.
338
- * @event qti-register-choice - Emitted when an choice is added
339
- * @event qti-loose-choice - Emitted when a choice is removed
340
- *
341
- * @slot - The default slot.
342
- */
343
- declare class QtiSimpleChoice extends QtiChoice {
344
- render(): lit_html.TemplateResult<1>;
345
- }
346
- declare global {
347
- interface HTMLElementTagNameMap {
348
- 'qti-simple-choice': QtiSimpleChoice;
349
- }
350
- }
351
-
352
- export { Choices as C, Interaction as I, OutcomeChangedDetails as O, QtiRule as Q, QtiChoice as a, InteractionChangedDetails as b, qtiInteractionChanged as c, qtiRegisterVariable as d, qtiRegisterInteraction as e, qtiRegisterChoice as f, qtiRegisterHotspot as g, qtiLooseChoice as h, qtiInteractionResponse as i, qtiChoiceElementSelected as j, QtiTextEntryInteraction as k, QtiExtendedTextInteraction as l, QtiResponseProcessing as m, QtiHottext as n, qtiOutcomeChanged as q };