@citolab/qti-components 6.0.18 → 6.0.19
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/dist/chunk-UD6XWG6V.js +2205 -0
- package/dist/custom-elements.json +815 -528
- package/dist/index.css +1 -0
- package/dist/index.d.ts +35 -5
- package/dist/index.js +85 -72
- package/dist/qti-assessment-item-68bcc951.d.ts +121 -0
- package/dist/qti-components/index.d.ts +36 -7
- package/dist/qti-components/index.js +77 -65
- package/dist/qti-item/index.d.ts +2 -2
- package/dist/qti-item/index.js +1 -1
- package/dist/qti-item-e1fc6a70.d.ts +30 -0
- package/dist/qti-item-react/index.d.ts +3 -3
- package/dist/qti-item-react/index.js +1 -1
- package/dist/qti-simple-choice-d1392d78.d.ts +352 -0
- package/package.json +2 -2
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import * as lit_html from 'lit-html';
|
|
2
|
+
import { LitElement } from 'lit';
|
|
3
|
+
|
|
4
|
+
interface directedPair {
|
|
5
|
+
destination: string;
|
|
6
|
+
source: string;
|
|
7
|
+
}
|
|
8
|
+
interface ResponseInteraction {
|
|
9
|
+
responseIdentifier: string;
|
|
10
|
+
response: string | string[];
|
|
11
|
+
}
|
|
12
|
+
interface Calculate {
|
|
13
|
+
calculate: () => string | string[];
|
|
14
|
+
}
|
|
15
|
+
type float = number;
|
|
16
|
+
type integer = number;
|
|
17
|
+
type BaseType = 'boolean' | 'directedPair' | 'float' | 'integer' | 'string' | 'identifier' | 'pair';
|
|
18
|
+
type Multiple = string | string[][];
|
|
19
|
+
type Ordered = string | string[][];
|
|
20
|
+
type Cardinality = 'multiple' | 'ordered' | 'single';
|
|
21
|
+
|
|
22
|
+
interface VariableDeclaration<T> {
|
|
23
|
+
identifier: string;
|
|
24
|
+
cardinality: Cardinality;
|
|
25
|
+
baseType: BaseType;
|
|
26
|
+
value: T;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare class QtiMapping extends LitElement {
|
|
30
|
+
defaultValue: number;
|
|
31
|
+
lowerBound: number;
|
|
32
|
+
upperBound: number;
|
|
33
|
+
get mapEntries(): {
|
|
34
|
+
mapKey: string;
|
|
35
|
+
mappedValue: number;
|
|
36
|
+
}[];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare class ResponseVariable implements VariableDeclaration<string | string[]> {
|
|
40
|
+
private _candidateResponse;
|
|
41
|
+
private _mapping;
|
|
42
|
+
private _correctResponse;
|
|
43
|
+
private _cardinality;
|
|
44
|
+
private _identifier;
|
|
45
|
+
private _basetype;
|
|
46
|
+
private _qtiVariable;
|
|
47
|
+
constructor({ mapping, correctResponse, cardinality, baseType, identifier, }: {
|
|
48
|
+
mapping: QtiMapping;
|
|
49
|
+
correctResponse: string | string[];
|
|
50
|
+
cardinality: Cardinality;
|
|
51
|
+
baseType: BaseType;
|
|
52
|
+
identifier: string;
|
|
53
|
+
});
|
|
54
|
+
get mapping(): QtiMapping;
|
|
55
|
+
get correctResponse(): string | string[];
|
|
56
|
+
get cardinality(): Cardinality;
|
|
57
|
+
get baseType(): BaseType;
|
|
58
|
+
get identifier(): string;
|
|
59
|
+
get value(): string | string[];
|
|
60
|
+
set value(val: string | string[]);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
declare class OutcomeVariable implements VariableDeclaration<number | string | undefined> {
|
|
64
|
+
identifier: string;
|
|
65
|
+
cardinality: Cardinality;
|
|
66
|
+
baseType: BaseType;
|
|
67
|
+
value: number | string | undefined;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @summary The qti-assessment-item element contains all the other QTI 3 item structures.
|
|
72
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.dltnnj87l0yj
|
|
73
|
+
* @status stable
|
|
74
|
+
* @since 4.0
|
|
75
|
+
*
|
|
76
|
+
* @dependency qti-feedback
|
|
77
|
+
* @dependency qti-responseprocessing
|
|
78
|
+
*
|
|
79
|
+
* @slot - The default slot where all the other QTI 3 item structures go.
|
|
80
|
+
*
|
|
81
|
+
* @event qti-interaction-changed - Emitted when an interaction is changed.
|
|
82
|
+
* @event qti-outcome-changed - Emitted when the radio group receives user input.
|
|
83
|
+
*
|
|
84
|
+
*/
|
|
85
|
+
declare class QtiAssessmentItem extends LitElement {
|
|
86
|
+
variables: VariableDeclaration<(string | string[]) | number>[];
|
|
87
|
+
private feedbackElements;
|
|
88
|
+
private interactionElements;
|
|
89
|
+
disabled: boolean;
|
|
90
|
+
readonly: boolean;
|
|
91
|
+
title: string;
|
|
92
|
+
identifier: string;
|
|
93
|
+
render(): lit_html.TemplateResult<1>;
|
|
94
|
+
_handleDisabledChange: (_: boolean, disabled: boolean) => void;
|
|
95
|
+
_handleReadonlyChange: (_: boolean, readonly: boolean) => void;
|
|
96
|
+
constructor();
|
|
97
|
+
connectedCallback(): void;
|
|
98
|
+
disconnectedCallback(): void;
|
|
99
|
+
private _registerVariable;
|
|
100
|
+
showCorrectResponse(): void;
|
|
101
|
+
processResponse(): boolean;
|
|
102
|
+
set responses(myResponses: ResponseInteraction[]);
|
|
103
|
+
resetInteractions(): void;
|
|
104
|
+
validateResponses(): boolean;
|
|
105
|
+
getVariableValue(identifier: string): string | string[] | number | null;
|
|
106
|
+
getResponse(identifier: string): ResponseVariable | null;
|
|
107
|
+
getOutcome(identifier: string): OutcomeVariable | null;
|
|
108
|
+
private registerFeedbackElement;
|
|
109
|
+
private registerInteractionElement;
|
|
110
|
+
private interactionResponse;
|
|
111
|
+
private outcomeChanged;
|
|
112
|
+
private showFeedback;
|
|
113
|
+
setOutcomeValue(identifier: string, value: number): void;
|
|
114
|
+
}
|
|
115
|
+
declare global {
|
|
116
|
+
interface HTMLElementTagNameMap {
|
|
117
|
+
'qti-assessment-item': QtiAssessmentItem;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export { BaseType as B, Cardinality as C, Multiple as M, Ordered as O, QtiAssessmentItem as Q, ResponseVariable as R, VariableDeclaration as V, ResponseInteraction as a, Calculate as b, OutcomeVariable as c, directedPair as d, QtiMapping as e, float as f, integer as i };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { B as BaseType, C as Cardinality, Q as QtiAssessmentItem, R as ResponseVariable } from '../qti-assessment-item-
|
|
2
|
-
export { b as Calculate, M as Multiple, O as Ordered, c as OutcomeVariable, e as QtiMapping, a as ResponseInteraction, d as directedPair, f as float, i as integer } from '../qti-assessment-item-
|
|
3
|
-
import { C as Choices, I as Interaction, Q as QtiRule, a as QtiChoice } from '../qti-simple-choice-
|
|
4
|
-
export { b as InteractionChangedDetails, O as OutcomeChangedDetails, j as QtiChoiceElementSelected, l as QtiExtendedTextInteraction, n as QtiHottext, c as QtiInteractionChanged, i as QtiInteractionResponse, h as QtiLooseChoice, q as QtiOutcomeChanged, f as QtiRegisterChoice, g as QtiRegisterHotspot, e as QtiRegisterInteraction, d as QtiRegisterVariable, m as QtiResponseProcessing, k as QtiTextEntryInteraction } from '../qti-simple-choice-
|
|
1
|
+
import { B as BaseType, C as Cardinality, Q as QtiAssessmentItem, R as ResponseVariable } from '../qti-assessment-item-68bcc951.js';
|
|
2
|
+
export { b as Calculate, M as Multiple, O as Ordered, c as OutcomeVariable, e as QtiMapping, a as ResponseInteraction, d as directedPair, f as float, i as integer } from '../qti-assessment-item-68bcc951.js';
|
|
3
|
+
import { C as Choices, I as Interaction, Q as QtiRule, a as QtiChoice } from '../qti-simple-choice-d1392d78.js';
|
|
4
|
+
export { b as InteractionChangedDetails, O as OutcomeChangedDetails, j as QtiChoiceElementSelected, l as QtiExtendedTextInteraction, n as QtiHottext, c as QtiInteractionChanged, i as QtiInteractionResponse, h as QtiLooseChoice, q as QtiOutcomeChanged, f as QtiRegisterChoice, g as QtiRegisterHotspot, e as QtiRegisterInteraction, d as QtiRegisterVariable, m as QtiResponseProcessing, k as QtiTextEntryInteraction } from '../qti-simple-choice-d1392d78.js';
|
|
5
5
|
import * as lit from 'lit';
|
|
6
|
-
import { LitElement } from 'lit';
|
|
6
|
+
import { LitElement, PropertyValueMap } from 'lit';
|
|
7
7
|
import * as lit_html from 'lit-html';
|
|
8
8
|
import { L as Logger } from '../context-a957e50e.js';
|
|
9
9
|
import { ContextConsumer } from '@lit-labs/context';
|
|
@@ -82,7 +82,7 @@ declare abstract class QtiFeedback extends LitElement {
|
|
|
82
82
|
protected showStatus: string;
|
|
83
83
|
constructor();
|
|
84
84
|
connectedCallback(): void;
|
|
85
|
-
checkShowFeedback(outcomeIdentifier: string
|
|
85
|
+
checkShowFeedback(outcomeIdentifier: string): void;
|
|
86
86
|
private showFeedback;
|
|
87
87
|
}
|
|
88
88
|
|
|
@@ -95,6 +95,11 @@ declare class QtiModalFeedback extends QtiFeedback {
|
|
|
95
95
|
render(): lit_html.TemplateResult<1>;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
declare class QtiFeedbackBlock extends QtiFeedback {
|
|
99
|
+
render(): lit_html.TemplateResult<1>;
|
|
100
|
+
protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
|
|
101
|
+
}
|
|
102
|
+
|
|
98
103
|
declare class QtiHottextInteraction extends Choices {
|
|
99
104
|
connectedCallback(): void;
|
|
100
105
|
render: () => lit_html.TemplateResult<1>;
|
|
@@ -189,6 +194,12 @@ declare class QtiAnd extends QtiConditionExpression {
|
|
|
189
194
|
calculate(): boolean;
|
|
190
195
|
}
|
|
191
196
|
|
|
197
|
+
declare class QtiProduct extends QtiExpression<number> {
|
|
198
|
+
mult: number;
|
|
199
|
+
render: () => lit_html.TemplateResult<1>;
|
|
200
|
+
calculate(): number;
|
|
201
|
+
}
|
|
202
|
+
|
|
192
203
|
declare class QtiOr extends QtiConditionExpression {
|
|
193
204
|
render(): lit_html.TemplateResult<1>;
|
|
194
205
|
calculate(): boolean;
|
|
@@ -224,6 +235,11 @@ declare class QtiIsNull extends QtiExpression<boolean> {
|
|
|
224
235
|
calculate(): boolean;
|
|
225
236
|
}
|
|
226
237
|
|
|
238
|
+
declare class QtiNot extends QtiExpression<boolean> {
|
|
239
|
+
render(): lit_html.TemplateResult<1>;
|
|
240
|
+
calculate(): boolean;
|
|
241
|
+
}
|
|
242
|
+
|
|
227
243
|
declare class QtiMapResponse extends QtiExpression<number> {
|
|
228
244
|
identifier: string;
|
|
229
245
|
calculate(): number;
|
|
@@ -246,6 +262,13 @@ declare class QtiOrdered extends QtiExpression<ResponseVariable[]> {
|
|
|
246
262
|
calculate(): ResponseVariable[];
|
|
247
263
|
}
|
|
248
264
|
|
|
265
|
+
declare class QtPrintedVariable extends LitElement {
|
|
266
|
+
value: string;
|
|
267
|
+
render(): lit_html.TemplateResult<1>;
|
|
268
|
+
constructor();
|
|
269
|
+
calculate(): string | number | string[];
|
|
270
|
+
}
|
|
271
|
+
|
|
249
272
|
declare class QtiPortableCustomInteraction extends LitElement {
|
|
250
273
|
private responseIdentifier;
|
|
251
274
|
private module;
|
|
@@ -489,6 +512,12 @@ declare class QtiSliderInteraction extends Interaction {
|
|
|
489
512
|
private getPositionFromEvent;
|
|
490
513
|
}
|
|
491
514
|
|
|
515
|
+
declare class QtiEndAttemptInteraction extends LitElement {
|
|
516
|
+
title: 'end attempt';
|
|
517
|
+
render(): lit_html.TemplateResult<1>;
|
|
518
|
+
endAttempt(e: Event): void;
|
|
519
|
+
}
|
|
520
|
+
|
|
492
521
|
declare class QtiAssociableHotspot extends LitElement {
|
|
493
522
|
connectedCallback(): void;
|
|
494
523
|
static styles: lit.CSSResult;
|
|
@@ -519,4 +548,4 @@ declare class QtiHotspotChoice extends QtiChoice {
|
|
|
519
548
|
declare class QtiInlineChoice extends LitElement {
|
|
520
549
|
}
|
|
521
550
|
|
|
522
|
-
export { BaseType, Cardinality, Events, QtiAnd, QtiAssessmentItem, QtiAssociableHotspot, QtiAssociateInteraction, QtiBaseValue, QtiChoice, QtiCompanionMaterialsInfo, QtiContains, QtiCorrect, QtiEqual, QtiEqualRounded, QtiExpression, QtiFeedbackInline, QtiGap, QtiGapImg, QtiGapMatchInteraction, QtiGapText, QtiGraphicAssociateInteraction, QtiGraphicGapMatchInteraction, QtiGraphicOrderInteraction, QtiGt, QtiGte, QtiHotspotChoice, QtiHotspotInteraction, QtiHottextInteraction, QtiInlineChoice, QtiInlineChoiceInteraction, QtiIsNull, QtiLt, QtiLte, QtiMapResponse, QtiMatch, QtiMatchInteraction, QtiMediaInteraction, QtiModalFeedback, QtiMultiple, QtiOr, QtiOrderInteraction, QtiOrdered, QtiOutcomeDeclaration, QtiPortableCustomInteraction, QtiPositionObjectStage, QtiPrompt, QtiResponseCondition, QtiResponseDeclaration, QtiResponseElse, QtiResponseElseIf, QtiResponseIf, QtiRule, QtiSPositionObjectInteraction, QtiSelectPointInteraction, QtiSetOutcomeValue, QtiSimpleAssociableChoice, QtiSliderInteraction, QtiStylesheet, QtiVariable, ResponseVariable, qtiContentBody, qtiRubricBlock };
|
|
551
|
+
export { BaseType, Cardinality, Events, QtPrintedVariable, QtiAnd, QtiAssessmentItem, QtiAssociableHotspot, QtiAssociateInteraction, QtiBaseValue, QtiChoice, QtiCompanionMaterialsInfo, QtiContains, QtiCorrect, QtiEndAttemptInteraction, QtiEqual, QtiEqualRounded, QtiExpression, QtiFeedbackBlock, QtiFeedbackInline, QtiGap, QtiGapImg, QtiGapMatchInteraction, QtiGapText, QtiGraphicAssociateInteraction, QtiGraphicGapMatchInteraction, QtiGraphicOrderInteraction, QtiGt, QtiGte, QtiHotspotChoice, QtiHotspotInteraction, QtiHottextInteraction, QtiInlineChoice, QtiInlineChoiceInteraction, QtiIsNull, QtiLt, QtiLte, QtiMapResponse, QtiMatch, QtiMatchInteraction, QtiMediaInteraction, QtiModalFeedback, QtiMultiple, QtiNot, QtiOr, QtiOrderInteraction, QtiOrdered, QtiOutcomeDeclaration, QtiPortableCustomInteraction, QtiPositionObjectStage, QtiProduct, QtiPrompt, QtiResponseCondition, QtiResponseDeclaration, QtiResponseElse, QtiResponseElseIf, QtiResponseIf, QtiRule, QtiSPositionObjectInteraction, QtiSelectPointInteraction, QtiSetOutcomeValue, QtiSimpleAssociableChoice, QtiSliderInteraction, QtiStylesheet, QtiVariable, ResponseVariable, qtiContentBody, qtiRubricBlock };
|