@citolab/qti-components 6.0.2-2 → 6.0.2

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,102 +0,0 @@
1
- import * as lit_html from 'lit-html';
2
- import { LitElement } from 'lit';
3
- import { C as Cardinality, B as BaseType, R as ResponseInteraction } from './ExpressionResult-b1ac7b27.js';
4
-
5
- interface VariableDeclaration<T> {
6
- identifier: string;
7
- cardinality: Cardinality;
8
- baseType: BaseType;
9
- value: T;
10
- }
11
-
12
- declare class QtiMapping extends LitElement {
13
- defaultValue: number;
14
- lowerBound: number;
15
- upperBound: number;
16
- get mapEntries(): {
17
- mapKey: string;
18
- mappedValue: number;
19
- }[];
20
- }
21
-
22
- declare class ResponseVariable implements VariableDeclaration<string | string[]> {
23
- private _candidateResponse;
24
- private _mapping;
25
- private _correctResponse;
26
- private _cardinality;
27
- private _identifier;
28
- private _basetype;
29
- private _qtiVariable;
30
- constructor({ mapping, correctResponse, cardinality, baseType, identifier, }: {
31
- mapping: QtiMapping;
32
- correctResponse: string | string[];
33
- cardinality: Cardinality;
34
- baseType: BaseType;
35
- identifier: string;
36
- });
37
- get mapping(): QtiMapping;
38
- get correctResponse(): string | string[];
39
- get cardinality(): Cardinality;
40
- get baseType(): BaseType;
41
- get identifier(): string;
42
- get value(): string | string[];
43
- set value(val: string | string[]);
44
- }
45
-
46
- declare class OutcomeVariable implements VariableDeclaration<number> {
47
- identifier: string;
48
- cardinality: Cardinality;
49
- baseType: BaseType;
50
- value: number;
51
- }
52
-
53
- /**
54
- * @summary The qti-assessment-item element contains all the other QTI 3 item structures.
55
- * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.dltnnj87l0yj
56
- * @status stable
57
- * @since 4.0
58
- *
59
- * @dependency qti-feedback
60
- * @dependency qti-responseprocessing
61
- *
62
- * @slot - The default slot where all the other QTI 3 item structures go.
63
- *
64
- * @event qti-interaction-changed - Emitted when an interaction is changed.
65
- * @event qti-outcome-changed - Emitted when the radio group receives user input.
66
- *
67
- */
68
- declare class QtiAssessmentItem extends LitElement {
69
- variables: VariableDeclaration<(string | string[]) | number>[];
70
- private feedbackElements;
71
- private interactionElements;
72
- disabled: boolean;
73
- readonly: boolean;
74
- title: string;
75
- identifier: string;
76
- render(): lit_html.TemplateResult<1>;
77
- _handleDisabledChange: (_: boolean, disabled: boolean) => void;
78
- _handleReadonlyChange: (_: boolean, readonly: boolean) => void;
79
- constructor();
80
- disconnectedCallback(): void;
81
- private _registerVariable;
82
- showCorrectResponse(): void;
83
- processResponse(): boolean;
84
- set responses(myResponses: ResponseInteraction[]);
85
- resetInteractions(): void;
86
- validateResponses(): boolean;
87
- getVariableValue(identifier: string): string | string[] | number | null;
88
- getResponse(identifier: string): ResponseVariable | null;
89
- getOutcome(identifier: string): OutcomeVariable | null;
90
- private registerFeedbackElement;
91
- private registerInteractionElement;
92
- private interactionResponse;
93
- private outcomeChanged;
94
- setOutcomeValue(identifier: string, value: number): void;
95
- }
96
- declare global {
97
- interface HTMLElementTagNameMap {
98
- 'qti-assessment-item': QtiAssessmentItem;
99
- }
100
- }
101
-
102
- export { OutcomeVariable as O, QtiAssessmentItem as Q, ResponseVariable as R, VariableDeclaration as V, QtiMapping as a };
@@ -1,22 +0,0 @@
1
- import React from 'react';
2
- import { R as ResponseInteraction } from '../ExpressionResult-b1ac7b27.js';
3
- import { O as OutcomeChangedDetails } from '../qti-rule-5c200a1b.js';
4
- import '../qti-assessment-item-219cef9e.js';
5
- import 'lit-html';
6
- import 'lit';
7
-
8
- interface QtiItemProps {
9
- ref?: any;
10
- className?: string;
11
- scales?: boolean;
12
- responses?: ResponseInteraction[];
13
- xml: string;
14
- qtioutcomechanged?: (e: CustomEvent<OutcomeChangedDetails>) => unknown;
15
- qtiinteractionchanged?: (e: CustomEvent<{
16
- item: string | null;
17
- interaction: string | string[];
18
- }>) => unknown;
19
- }
20
- declare const QtiItem: React.ForwardRefExoticComponent<QtiItemProps>;
21
-
22
- export { QtiItem };
@@ -1 +0,0 @@
1
- import{a as t}from"../chunk-M3YT56HW.js";import"../chunk-DLLHO3W2.js";import"../chunk-NMCIOGD2.js";import e from"react";import{createComponent as n}from"@lit-labs/react";var m=n({tagName:"qti-item",react:e,elementClass:t,events:{qtioutcomechanged:"qti-outcome-changed",qtiinteractionchanged:"qti-interaction-changed"}});export{m as QtiItem};
@@ -1,304 +0,0 @@
1
- import { R as ResponseInteraction } from './ExpressionResult-b1ac7b27.js';
2
- import { V as VariableDeclaration } from './qti-assessment-item-219cef9e.js';
3
- import * as lit_html from 'lit-html';
4
- import { LitElement, CSSResultGroup } from 'lit';
5
-
6
- interface OutcomeChangedDetails {
7
- item: string;
8
- outcomeIdentifier: string;
9
- value: number;
10
- }
11
- type InteractionChangedDetails = ResponseInteraction;
12
-
13
- type QtiOutcomeChanged = CustomEvent<{
14
- item: string;
15
- outcomeIdentifier: string;
16
- value: string | string[];
17
- }>;
18
- declare global {
19
- interface GlobalEventHandlersEventMap {
20
- 'qti-outcome-changed': QtiOutcomeChanged;
21
- }
22
- }
23
-
24
- declare namespace qtiOutcomeChanged {
25
- export {
26
- QtiOutcomeChanged as default,
27
- };
28
- }
29
-
30
- type QtiInteractionChanged = CustomEvent<{
31
- item: string | null;
32
- interaction: string | string[];
33
- }>;
34
- declare global {
35
- interface GlobalEventHandlersEventMap {
36
- "qti-interaction-changed": QtiInteractionChanged;
37
- }
38
- }
39
-
40
- declare namespace qtiInteractionChanged {
41
- export {
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 QtiHottext extends QtiChoice {
210
- }
211
- declare global {
212
- interface HTMLElementTagNameMap {
213
- 'qti-hottext': QtiHottext;
214
- }
215
- }
216
-
217
- declare abstract class Choices extends Interaction {
218
- protected _choiceElements: QtiChoice[];
219
- minChoices: number;
220
- maxChoices: number;
221
- _handleDisabledChange: (_: boolean, disabled: boolean) => void;
222
- _handleReadonlyChange: (_: boolean, readonly: boolean) => void;
223
- _handleMaxChoicesChange: () => void;
224
- constructor();
225
- reset(): void;
226
- validate(): boolean;
227
- set response(myResponse: ResponseType);
228
- connectedCallback(): void;
229
- disconnectedCallback(): void;
230
- private _registerChoiceElement;
231
- private _looseChoiceElement;
232
- private _determineInputType;
233
- private _setInputType;
234
- private _choiceElementSelectedHandler;
235
- private _choiceElementSelected;
236
- }
237
-
238
- /**
239
- * @summary The ChoiceInteraction.Type (qti-choice-interaction) interaction presents a collection of choices to the candidate.
240
- * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.j9nu1oa1tu3b
241
- * @status stable
242
- * @since 4.0
243
- *
244
- * @event qti-register-interaction - emitted when the interaction wants to register itself
245
- * @event qti-interaction-response - emitted when the interaction changes
246
- *
247
- * @slot - The default slot where <qti-simple-choice> must be placed.
248
- * @slot prompt - slot where the prompt is placed.
249
- */
250
- declare class QtiChoiceInteraction extends Choices {
251
- static styles: CSSResultGroup;
252
- /** orientation of choices */
253
- orientation: 'horizontal' | 'vertical';
254
- render: () => lit_html.TemplateResult<1>;
255
- }
256
- declare global {
257
- interface HTMLElementTagNameMap {
258
- 'qti-choice-interaction': QtiChoiceInteraction;
259
- }
260
- }
261
-
262
- /**
263
- * @summary Short summary of the component's intended use.
264
- * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.j9nu1oa1tu3b
265
- * @status stable
266
- * @since 4.0
267
- *
268
- * @event qti-choice-element-selected - Emitted when a choice is selected.
269
- * @event qti-register-choice - Emitted when an choice is added
270
- * @event qti-loose-choice - Emitted when a choice is removed
271
- *
272
- * @slot - The default slot.
273
- */
274
- declare class QtiSimpleChoice extends QtiChoice {
275
- }
276
- declare global {
277
- interface HTMLElementTagNameMap {
278
- 'qti-simple-choice': QtiSimpleChoice;
279
- }
280
- }
281
-
282
- declare class QtiResponseProcessing extends LitElement {
283
- render(): lit_html.TemplateResult<1>;
284
- static get observedAttributes(): string[];
285
- process(): void;
286
- private fragmentFromString;
287
- }
288
- declare global {
289
- interface HTMLElementTagNameMap {
290
- 'qti-response-processing': QtiResponseProcessing;
291
- }
292
- }
293
-
294
- declare class QtiRule extends LitElement {
295
- render(): lit_html.TemplateResult<1>;
296
- process(): void;
297
- }
298
- declare global {
299
- interface HTMLElementTagNameMap {
300
- 'qti-rule': QtiRule;
301
- }
302
- }
303
-
304
- 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, QtiHottext as k, QtiResponseProcessing as l, qtiOutcomeChanged as q };