@citolab/qti-components 6.0.23 → 6.0.25
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-BVYXUE3V.js +1 -0
- package/dist/chunk-C4C24R3I.cjs +1 -0
- package/dist/chunk-OO5TITDR.js +17 -0
- package/dist/{chunk-EHTDKAYF.js → chunk-VBLA6PHI.cjs} +3 -3
- package/dist/{chunk-VI35S4EM.cjs → chunk-YFSV2M2E.js} +3 -3
- package/dist/chunk-Z2P5ZMVD.cjs +17 -0
- package/dist/custom-elements.json +612 -616
- package/dist/decorators/index.cjs +1 -1
- package/dist/decorators/index.js +1 -1
- package/dist/index.cjs +85 -81
- package/dist/index.d.cts +83 -91
- package/dist/index.d.ts +83 -91
- package/dist/index.js +80 -76
- package/dist/qti-components/index.cjs +34 -30
- package/dist/qti-components/index.d.cts +45 -49
- package/dist/qti-components/index.d.ts +45 -49
- package/dist/qti-components/index.js +63 -59
- package/dist/qti-item/index.cjs +1 -1
- package/dist/qti-item/index.d.cts +1 -2
- package/dist/qti-item/index.d.ts +1 -2
- package/dist/qti-item/index.js +1 -1
- package/dist/qti-item-395a9535.d.ts +19 -0
- package/dist/qti-item-react/index.cjs +1 -1
- package/dist/qti-item-react/index.d.cts +7 -15
- package/dist/qti-item-react/index.d.ts +7 -15
- package/dist/qti-item-react/index.js +1 -1
- package/dist/{qti-simple-choice-b4b79072.d.ts → qti-simple-choice-f19f8469.d.ts} +112 -5
- package/dist/qti-transform/index.cjs +1 -17
- package/dist/qti-transform/index.d.cts +1 -0
- package/dist/qti-transform/index.d.ts +1 -0
- package/dist/qti-transform/index.js +1 -17
- package/package.json +6 -7
- package/dist/chunk-3O4URV5U.cjs +0 -1
- package/dist/chunk-6RJ7J4AE.cjs +0 -1
- package/dist/chunk-M7QOVOG6.js +0 -1
- package/dist/chunk-WFLR5TH7.js +0 -1
- package/dist/qti-assessment-item-e8a67444.d.ts +0 -109
- package/dist/qti-item-77742afa.d.ts +0 -30
package/dist/index.d.cts
CHANGED
|
@@ -26,7 +26,7 @@ type Cardinality = 'multiple' | 'ordered' | 'single';
|
|
|
26
26
|
interface OutcomeChangedDetails {
|
|
27
27
|
item: string;
|
|
28
28
|
outcomeIdentifier: string;
|
|
29
|
-
value:
|
|
29
|
+
value: string | string[];
|
|
30
30
|
}
|
|
31
31
|
type InteractionChangedDetails = ResponseInteraction & {
|
|
32
32
|
item: string;
|
|
@@ -62,19 +62,49 @@ declare namespace qtiInteractionChanged {
|
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
declare class QtiMapping extends LitElement {
|
|
66
|
+
defaultValue: number;
|
|
67
|
+
lowerBound: number;
|
|
68
|
+
upperBound: number;
|
|
69
|
+
get mapEntries(): {
|
|
70
|
+
mapKey: string;
|
|
71
|
+
mappedValue: number;
|
|
72
|
+
}[];
|
|
73
|
+
}
|
|
74
|
+
|
|
65
75
|
interface VariableDeclaration<T> {
|
|
66
76
|
identifier: string;
|
|
67
77
|
cardinality: Cardinality;
|
|
68
78
|
baseType: BaseType;
|
|
69
79
|
value: T;
|
|
70
80
|
}
|
|
81
|
+
interface ResultVariable {
|
|
82
|
+
cardinality: Cardinality;
|
|
83
|
+
baseType: BaseType;
|
|
84
|
+
result: number | boolean | string | (number | boolean | string)[];
|
|
85
|
+
}
|
|
86
|
+
declare class OutcomeVariable implements VariableDeclaration<string | string[] | null> {
|
|
87
|
+
identifier: string;
|
|
88
|
+
cardinality: Cardinality;
|
|
89
|
+
baseType: BaseType;
|
|
90
|
+
value: string | string[] | null;
|
|
91
|
+
}
|
|
92
|
+
declare class ResponseVariable implements VariableDeclaration<string | string[] | null> {
|
|
93
|
+
identifier: string;
|
|
94
|
+
cardinality: Cardinality;
|
|
95
|
+
baseType: BaseType;
|
|
96
|
+
value: string | string[] | null;
|
|
97
|
+
candidateResponse: string | string[] | null;
|
|
98
|
+
mapping: QtiMapping;
|
|
99
|
+
correctResponse: string | string[] | null;
|
|
100
|
+
}
|
|
71
101
|
|
|
72
102
|
type QtiRegisterVariable = CustomEvent<{
|
|
73
|
-
variable: VariableDeclaration<
|
|
103
|
+
variable: VariableDeclaration<string | string[]>;
|
|
74
104
|
}>;
|
|
75
105
|
declare global {
|
|
76
106
|
interface GlobalEventHandlersEventMap {
|
|
77
|
-
|
|
107
|
+
'qti-register-variable': QtiRegisterVariable;
|
|
78
108
|
}
|
|
79
109
|
}
|
|
80
110
|
|
|
@@ -179,33 +209,6 @@ declare const Events: {
|
|
|
179
209
|
ON_CHOICE_ELEMENT_SELECTED: string;
|
|
180
210
|
};
|
|
181
211
|
|
|
182
|
-
declare class QtiMapping extends LitElement {
|
|
183
|
-
defaultValue: number;
|
|
184
|
-
lowerBound: number;
|
|
185
|
-
upperBound: number;
|
|
186
|
-
get mapEntries(): {
|
|
187
|
-
mapKey: string;
|
|
188
|
-
mappedValue: number;
|
|
189
|
-
}[];
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
declare class ResponseVariable implements VariableDeclaration<string | string[] | undefined> {
|
|
193
|
-
identifier: string;
|
|
194
|
-
cardinality: Cardinality;
|
|
195
|
-
baseType: BaseType;
|
|
196
|
-
value: string | string[] | undefined;
|
|
197
|
-
candidateResponse: string | string[];
|
|
198
|
-
mapping: QtiMapping;
|
|
199
|
-
correctResponse: string | string[];
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
declare class OutcomeVariable implements VariableDeclaration<number | string | string[] | undefined> {
|
|
203
|
-
identifier: string;
|
|
204
|
-
cardinality: Cardinality;
|
|
205
|
-
baseType: BaseType;
|
|
206
|
-
value: number | string | string[] | undefined;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
212
|
/**
|
|
210
213
|
* @summary The qti-assessment-item element contains all the other QTI 3 item structures.
|
|
211
214
|
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.dltnnj87l0yj
|
|
@@ -223,7 +226,7 @@ declare class OutcomeVariable implements VariableDeclaration<number | string | s
|
|
|
223
226
|
*
|
|
224
227
|
*/
|
|
225
228
|
declare class QtiAssessmentItem extends LitElement {
|
|
226
|
-
variables: VariableDeclaration<
|
|
229
|
+
variables: VariableDeclaration<string | string[]>[];
|
|
227
230
|
private feedbackElements;
|
|
228
231
|
private interactionElements;
|
|
229
232
|
disabled: boolean;
|
|
@@ -235,7 +238,7 @@ declare class QtiAssessmentItem extends LitElement {
|
|
|
235
238
|
_handleDisabledChange: (_: boolean, disabled: boolean) => void;
|
|
236
239
|
_handleReadonlyChange: (_: boolean, readonly: boolean) => void;
|
|
237
240
|
constructor();
|
|
238
|
-
|
|
241
|
+
firstUpdated(val: any): void;
|
|
239
242
|
disconnectedCallback(): void;
|
|
240
243
|
private _registerVariable;
|
|
241
244
|
showCorrectResponse(): void;
|
|
@@ -243,7 +246,7 @@ declare class QtiAssessmentItem extends LitElement {
|
|
|
243
246
|
set responses(myResponses: ResponseInteraction[]);
|
|
244
247
|
resetInteractions(): void;
|
|
245
248
|
validateResponses(): boolean;
|
|
246
|
-
getVariable(identifier: string): VariableDeclaration<
|
|
249
|
+
getVariable(identifier: string): VariableDeclaration<string | string[] | undefined>;
|
|
247
250
|
getResponse(identifier: string): ResponseVariable | null;
|
|
248
251
|
getOutcome(identifier: string): OutcomeVariable | null;
|
|
249
252
|
private registerFeedbackElement;
|
|
@@ -251,7 +254,7 @@ declare class QtiAssessmentItem extends LitElement {
|
|
|
251
254
|
private interactionResponse;
|
|
252
255
|
private outcomeChanged;
|
|
253
256
|
private showFeedback;
|
|
254
|
-
setOutcomeValue(identifier: string, value: string
|
|
257
|
+
setOutcomeValue(identifier: string, value: string): void;
|
|
255
258
|
}
|
|
256
259
|
declare global {
|
|
257
260
|
interface HTMLElementTagNameMap {
|
|
@@ -327,6 +330,7 @@ declare global {
|
|
|
327
330
|
|
|
328
331
|
declare class QtiVariableDeclaration extends LitElement {
|
|
329
332
|
render(): lit_html.TemplateResult<1>;
|
|
333
|
+
protected defaultValues(variable: VariableDeclaration<string | string[] | null>): string | string[];
|
|
330
334
|
}
|
|
331
335
|
|
|
332
336
|
declare class QtiResponseDeclaration extends QtiVariableDeclaration {
|
|
@@ -587,50 +591,37 @@ declare class QtiResponseElseIf extends QtiResponseIf {
|
|
|
587
591
|
}
|
|
588
592
|
|
|
589
593
|
declare abstract class QtiExpression<T> extends LitElement {
|
|
594
|
+
protected _result: any;
|
|
590
595
|
protected _error: any[];
|
|
596
|
+
private _debug;
|
|
591
597
|
protected set error(val: string);
|
|
592
598
|
static styles: lit.CSSResult;
|
|
593
599
|
render(): lit_html.TemplateResult<1>;
|
|
594
600
|
calculate(): T;
|
|
595
601
|
protected get assessmentItem(): QtiAssessmentItem;
|
|
596
|
-
protected getVariables: () => VariableDeclaration<number | string | string[] |
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
declare class QtiGt extends QtiExpression<boolean> {
|
|
600
|
-
calculate(): boolean;
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
declare class QtiConditionExpression extends QtiExpression<boolean> {
|
|
604
|
-
render(): lit_html.TemplateResult<1>;
|
|
605
|
-
calculate(): boolean;
|
|
602
|
+
protected getVariables: () => VariableDeclaration<number | string | (number | string)[] | null>[];
|
|
606
603
|
}
|
|
607
604
|
|
|
608
|
-
declare class
|
|
605
|
+
declare abstract class QtiConditionExpression extends QtiExpression<boolean> {
|
|
609
606
|
calculate(): boolean;
|
|
610
607
|
}
|
|
611
608
|
|
|
612
|
-
declare class
|
|
609
|
+
declare class QtiAnd extends QtiConditionExpression {
|
|
613
610
|
calculate(): boolean;
|
|
614
611
|
}
|
|
615
612
|
|
|
616
|
-
declare class
|
|
617
|
-
|
|
613
|
+
declare class QtiBaseValue extends QtiExpression<string> {
|
|
614
|
+
baseType: BaseType;
|
|
615
|
+
calculate(): string;
|
|
618
616
|
}
|
|
619
617
|
|
|
620
|
-
declare class
|
|
621
|
-
render(): lit_html.TemplateResult<1>;
|
|
618
|
+
declare class QtiContains extends QtiConditionExpression {
|
|
622
619
|
calculate(): boolean;
|
|
623
620
|
}
|
|
624
621
|
|
|
625
|
-
declare class
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
calculate(): number;
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
declare class QtiOr extends QtiConditionExpression {
|
|
632
|
-
render(): lit_html.TemplateResult<1>;
|
|
633
|
-
calculate(): boolean;
|
|
622
|
+
declare class QtiCorrect extends QtiExpression<string | string[]> {
|
|
623
|
+
get interpretation(): string;
|
|
624
|
+
calculate(): string | string[];
|
|
634
625
|
}
|
|
635
626
|
|
|
636
627
|
declare class QtiEqual extends QtiExpression<boolean> {
|
|
@@ -644,27 +635,23 @@ declare class QtiEqualRounded extends QtiExpression<boolean> {
|
|
|
644
635
|
calculate(): boolean;
|
|
645
636
|
}
|
|
646
637
|
|
|
647
|
-
declare class
|
|
648
|
-
|
|
649
|
-
calculate(): string;
|
|
638
|
+
declare class QtiGt extends QtiExpression<boolean> {
|
|
639
|
+
calculate(): boolean;
|
|
650
640
|
}
|
|
651
641
|
|
|
652
|
-
declare class
|
|
642
|
+
declare class QtiGte extends QtiConditionExpression {
|
|
653
643
|
calculate(): boolean;
|
|
654
644
|
}
|
|
655
645
|
|
|
656
|
-
declare class
|
|
657
|
-
|
|
658
|
-
get interpretation(): string;
|
|
659
|
-
calculate(): string | string[];
|
|
646
|
+
declare class QtiIsNull extends QtiExpression<boolean> {
|
|
647
|
+
calculate(): boolean;
|
|
660
648
|
}
|
|
661
649
|
|
|
662
|
-
declare class
|
|
650
|
+
declare class QtiLt extends QtiExpression<boolean> {
|
|
663
651
|
calculate(): boolean;
|
|
664
652
|
}
|
|
665
653
|
|
|
666
|
-
declare class
|
|
667
|
-
render(): lit_html.TemplateResult<1>;
|
|
654
|
+
declare class QtiLte extends QtiConditionExpression {
|
|
668
655
|
calculate(): boolean;
|
|
669
656
|
}
|
|
670
657
|
|
|
@@ -674,32 +661,46 @@ declare class QtiMapResponse extends QtiExpression<number> {
|
|
|
674
661
|
}
|
|
675
662
|
|
|
676
663
|
declare class QtiMatch extends QtiExpression<boolean> {
|
|
677
|
-
calculate():
|
|
664
|
+
calculate(): any;
|
|
665
|
+
static match(valueToMap: ResponseVariable, correctValueInfo: ResponseVariable): boolean;
|
|
678
666
|
}
|
|
679
667
|
|
|
680
|
-
declare class
|
|
681
|
-
|
|
682
|
-
calculate(): string | number | string[];
|
|
668
|
+
declare class QtiMember extends QtiExpression<boolean | null> {
|
|
669
|
+
calculate(): boolean;
|
|
683
670
|
}
|
|
684
671
|
|
|
685
672
|
declare class QtiMultiple extends QtiExpression<VariableDeclaration<string | string[]>[]> {
|
|
686
673
|
calculate(): ResponseVariable[];
|
|
687
674
|
}
|
|
688
675
|
|
|
676
|
+
declare class QtiNot extends QtiExpression<boolean> {
|
|
677
|
+
render(): lit_html.TemplateResult<1>;
|
|
678
|
+
calculate(): boolean;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
declare class QtiOr extends QtiConditionExpression {
|
|
682
|
+
render(): lit_html.TemplateResult<1>;
|
|
683
|
+
calculate(): boolean;
|
|
684
|
+
}
|
|
685
|
+
|
|
689
686
|
declare class QtiOrdered extends QtiExpression<ResponseVariable[]> {
|
|
690
687
|
calculate(): ResponseVariable[];
|
|
691
688
|
}
|
|
692
689
|
|
|
693
690
|
declare class QtPrintedVariable extends LitElement {
|
|
694
691
|
identifier: string;
|
|
695
|
-
value: string | string[]
|
|
692
|
+
value: string | string[];
|
|
696
693
|
render(): lit_html.TemplateResult<1>;
|
|
697
694
|
constructor();
|
|
698
|
-
calculate(): string | string[]
|
|
695
|
+
calculate(): string | string[];
|
|
699
696
|
}
|
|
700
697
|
|
|
701
|
-
declare class
|
|
702
|
-
calculate():
|
|
698
|
+
declare class QtiProduct extends QtiExpression<number> {
|
|
699
|
+
calculate(): number;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
declare class QtiVariable extends QtiExpression<string | string[]> {
|
|
703
|
+
calculate(): string | string[];
|
|
703
704
|
}
|
|
704
705
|
|
|
705
706
|
declare class QtiPortableCustomInteraction extends LitElement {
|
|
@@ -1012,25 +1013,15 @@ declare global {
|
|
|
1012
1013
|
}
|
|
1013
1014
|
|
|
1014
1015
|
declare class QtiItem extends LitElement {
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
readonly: boolean;
|
|
1018
|
-
handleReadonlyChange(old: any, readonly: boolean): void;
|
|
1019
|
-
responses: ResponseInteraction[];
|
|
1020
|
-
handleResponsesChange(old: any, responses: ResponseInteraction[]): void;
|
|
1021
|
-
set qtiContext(context: {
|
|
1016
|
+
itemLocation: string;
|
|
1017
|
+
set audienceContext(context: {
|
|
1022
1018
|
view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor';
|
|
1023
1019
|
});
|
|
1024
1020
|
private provider;
|
|
1025
|
-
get _item(): QtiAssessmentItem;
|
|
1026
1021
|
private _xml;
|
|
1027
1022
|
set xml(val: string);
|
|
1028
1023
|
get xml(): string;
|
|
1029
1024
|
static styles: lit.CSSResult;
|
|
1030
|
-
processResponse: () => boolean;
|
|
1031
|
-
showCorrectResponse: () => void;
|
|
1032
|
-
validateResponses: () => boolean;
|
|
1033
|
-
resetInteractions: () => void;
|
|
1034
1025
|
connectedCallback(): void;
|
|
1035
1026
|
render: () => lit_html.TemplateResult<1>;
|
|
1036
1027
|
}
|
|
@@ -1041,6 +1032,7 @@ declare const qtiTransform: (xmlValue: string) => {
|
|
|
1041
1032
|
pciHooks(uri: string): any;
|
|
1042
1033
|
assetsLocation(uri: string, attributes?: string[]): any;
|
|
1043
1034
|
customTypes(): any;
|
|
1035
|
+
customDefinition(): any;
|
|
1044
1036
|
suffix(elements: string[], suffix: string): any;
|
|
1045
1037
|
fn(fn: (xmlString: string) => string): any;
|
|
1046
1038
|
fnCh(fn: (xmlString: cheerio.CheerioAPI) => void): any;
|
|
@@ -1049,4 +1041,4 @@ declare const qtiTransform: (xmlValue: string) => {
|
|
|
1049
1041
|
xml(): string;
|
|
1050
1042
|
};
|
|
1051
1043
|
|
|
1052
|
-
export { BaseType, Calculate, Cardinality, Events, InteractionChangedDetails, Multiple, Ordered, OutcomeChangedDetails, OutcomeVariable, QtPrintedVariable, QtiAnd, QtiAssessmentItem, QtiAssociableHotspot, QtiAssociateInteraction, QtiBaseValue, QtiChoice, qtiChoiceElementSelected as QtiChoiceElementSelected, QtiChoiceInteraction, QtiCompanionMaterialsInfo, QtiContains, QtiCorrect, QtiEndAttemptInteraction, QtiEqual, QtiEqualRounded, QtiExpression, QtiExtendedTextInteraction, QtiFeedbackBlock, QtiFeedbackInline, QtiGap, QtiGapImg, QtiGapMatchInteraction, QtiGapText, QtiGraphicAssociateInteraction, QtiGraphicGapMatchInteraction, QtiGraphicOrderInteraction, QtiGt, QtiGte, QtiHotspotChoice, QtiHotspotInteraction, QtiHottext, QtiHottextInteraction, QtiInlineChoice, QtiInlineChoiceInteraction, qtiInteractionChanged as QtiInteractionChanged, qtiInteractionResponse as QtiInteractionResponse, QtiIsNull, QtiItem, qtiLooseChoice as QtiLooseChoice, QtiLt, QtiLte, QtiMapResponse, QtiMapping, QtiMatch, QtiMatchInteraction, QtiMediaInteraction, QtiMember, QtiModalFeedback, QtiMultiple, QtiNot, QtiOr, QtiOrderInteraction, QtiOrdered, qtiOutcomeChanged as QtiOutcomeChanged, QtiOutcomeDeclaration, QtiPortableCustomInteraction, QtiPositionObjectStage, QtiProduct, QtiPrompt, qtiRegisterChoice as QtiRegisterChoice, qtiRegisterHotspot as QtiRegisterHotspot, qtiRegisterInteraction as QtiRegisterInteraction, qtiRegisterVariable as QtiRegisterVariable, QtiResponseCondition, QtiResponseDeclaration, QtiResponseElse, QtiResponseElseIf, QtiResponseIf, QtiResponseProcessing, QtiRule, QtiSPositionObjectInteraction, QtiSelectPointInteraction, QtiSetOutcomeValue, QtiSimpleAssociableChoice, QtiSimpleChoice, QtiSliderInteraction, QtiStylesheet, QtiTextEntryInteraction, QtiVariable, ResponseInteraction, ResponseVariable, directedPair, float, integer, qtiContentBody, qtiRubricBlock, qtiTransform };
|
|
1044
|
+
export { BaseType, Calculate, Cardinality, Events, InteractionChangedDetails, Multiple, Ordered, OutcomeChangedDetails, OutcomeVariable, QtPrintedVariable, QtiAnd, QtiAssessmentItem, QtiAssociableHotspot, QtiAssociateInteraction, QtiBaseValue, QtiChoice, qtiChoiceElementSelected as QtiChoiceElementSelected, QtiChoiceInteraction, QtiCompanionMaterialsInfo, QtiConditionExpression, QtiContains, QtiCorrect, QtiEndAttemptInteraction, QtiEqual, QtiEqualRounded, QtiExpression, QtiExtendedTextInteraction, QtiFeedbackBlock, QtiFeedbackInline, QtiGap, QtiGapImg, QtiGapMatchInteraction, QtiGapText, QtiGraphicAssociateInteraction, QtiGraphicGapMatchInteraction, QtiGraphicOrderInteraction, QtiGt, QtiGte, QtiHotspotChoice, QtiHotspotInteraction, QtiHottext, QtiHottextInteraction, QtiInlineChoice, QtiInlineChoiceInteraction, qtiInteractionChanged as QtiInteractionChanged, qtiInteractionResponse as QtiInteractionResponse, QtiIsNull, QtiItem, qtiLooseChoice as QtiLooseChoice, QtiLt, QtiLte, QtiMapResponse, QtiMapping, QtiMatch, QtiMatchInteraction, QtiMediaInteraction, QtiMember, QtiModalFeedback, QtiMultiple, QtiNot, QtiOr, QtiOrderInteraction, QtiOrdered, qtiOutcomeChanged as QtiOutcomeChanged, QtiOutcomeDeclaration, QtiPortableCustomInteraction, QtiPositionObjectStage, QtiProduct, QtiPrompt, qtiRegisterChoice as QtiRegisterChoice, qtiRegisterHotspot as QtiRegisterHotspot, qtiRegisterInteraction as QtiRegisterInteraction, qtiRegisterVariable as QtiRegisterVariable, QtiResponseCondition, QtiResponseDeclaration, QtiResponseElse, QtiResponseElseIf, QtiResponseIf, QtiResponseProcessing, QtiRule, QtiSPositionObjectInteraction, QtiSelectPointInteraction, QtiSetOutcomeValue, QtiSimpleAssociableChoice, QtiSimpleChoice, QtiSliderInteraction, QtiStylesheet, QtiTextEntryInteraction, QtiVariable, ResponseInteraction, ResponseVariable, ResultVariable, VariableDeclaration, directedPair, float, integer, qtiContentBody, qtiRubricBlock, qtiTransform };
|
package/dist/index.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ type Cardinality = 'multiple' | 'ordered' | 'single';
|
|
|
26
26
|
interface OutcomeChangedDetails {
|
|
27
27
|
item: string;
|
|
28
28
|
outcomeIdentifier: string;
|
|
29
|
-
value:
|
|
29
|
+
value: string | string[];
|
|
30
30
|
}
|
|
31
31
|
type InteractionChangedDetails = ResponseInteraction & {
|
|
32
32
|
item: string;
|
|
@@ -62,19 +62,49 @@ declare namespace qtiInteractionChanged {
|
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
declare class QtiMapping extends LitElement {
|
|
66
|
+
defaultValue: number;
|
|
67
|
+
lowerBound: number;
|
|
68
|
+
upperBound: number;
|
|
69
|
+
get mapEntries(): {
|
|
70
|
+
mapKey: string;
|
|
71
|
+
mappedValue: number;
|
|
72
|
+
}[];
|
|
73
|
+
}
|
|
74
|
+
|
|
65
75
|
interface VariableDeclaration<T> {
|
|
66
76
|
identifier: string;
|
|
67
77
|
cardinality: Cardinality;
|
|
68
78
|
baseType: BaseType;
|
|
69
79
|
value: T;
|
|
70
80
|
}
|
|
81
|
+
interface ResultVariable {
|
|
82
|
+
cardinality: Cardinality;
|
|
83
|
+
baseType: BaseType;
|
|
84
|
+
result: number | boolean | string | (number | boolean | string)[];
|
|
85
|
+
}
|
|
86
|
+
declare class OutcomeVariable implements VariableDeclaration<string | string[] | null> {
|
|
87
|
+
identifier: string;
|
|
88
|
+
cardinality: Cardinality;
|
|
89
|
+
baseType: BaseType;
|
|
90
|
+
value: string | string[] | null;
|
|
91
|
+
}
|
|
92
|
+
declare class ResponseVariable implements VariableDeclaration<string | string[] | null> {
|
|
93
|
+
identifier: string;
|
|
94
|
+
cardinality: Cardinality;
|
|
95
|
+
baseType: BaseType;
|
|
96
|
+
value: string | string[] | null;
|
|
97
|
+
candidateResponse: string | string[] | null;
|
|
98
|
+
mapping: QtiMapping;
|
|
99
|
+
correctResponse: string | string[] | null;
|
|
100
|
+
}
|
|
71
101
|
|
|
72
102
|
type QtiRegisterVariable = CustomEvent<{
|
|
73
|
-
variable: VariableDeclaration<
|
|
103
|
+
variable: VariableDeclaration<string | string[]>;
|
|
74
104
|
}>;
|
|
75
105
|
declare global {
|
|
76
106
|
interface GlobalEventHandlersEventMap {
|
|
77
|
-
|
|
107
|
+
'qti-register-variable': QtiRegisterVariable;
|
|
78
108
|
}
|
|
79
109
|
}
|
|
80
110
|
|
|
@@ -179,33 +209,6 @@ declare const Events: {
|
|
|
179
209
|
ON_CHOICE_ELEMENT_SELECTED: string;
|
|
180
210
|
};
|
|
181
211
|
|
|
182
|
-
declare class QtiMapping extends LitElement {
|
|
183
|
-
defaultValue: number;
|
|
184
|
-
lowerBound: number;
|
|
185
|
-
upperBound: number;
|
|
186
|
-
get mapEntries(): {
|
|
187
|
-
mapKey: string;
|
|
188
|
-
mappedValue: number;
|
|
189
|
-
}[];
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
declare class ResponseVariable implements VariableDeclaration<string | string[] | undefined> {
|
|
193
|
-
identifier: string;
|
|
194
|
-
cardinality: Cardinality;
|
|
195
|
-
baseType: BaseType;
|
|
196
|
-
value: string | string[] | undefined;
|
|
197
|
-
candidateResponse: string | string[];
|
|
198
|
-
mapping: QtiMapping;
|
|
199
|
-
correctResponse: string | string[];
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
declare class OutcomeVariable implements VariableDeclaration<number | string | string[] | undefined> {
|
|
203
|
-
identifier: string;
|
|
204
|
-
cardinality: Cardinality;
|
|
205
|
-
baseType: BaseType;
|
|
206
|
-
value: number | string | string[] | undefined;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
212
|
/**
|
|
210
213
|
* @summary The qti-assessment-item element contains all the other QTI 3 item structures.
|
|
211
214
|
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.dltnnj87l0yj
|
|
@@ -223,7 +226,7 @@ declare class OutcomeVariable implements VariableDeclaration<number | string | s
|
|
|
223
226
|
*
|
|
224
227
|
*/
|
|
225
228
|
declare class QtiAssessmentItem extends LitElement {
|
|
226
|
-
variables: VariableDeclaration<
|
|
229
|
+
variables: VariableDeclaration<string | string[]>[];
|
|
227
230
|
private feedbackElements;
|
|
228
231
|
private interactionElements;
|
|
229
232
|
disabled: boolean;
|
|
@@ -235,7 +238,7 @@ declare class QtiAssessmentItem extends LitElement {
|
|
|
235
238
|
_handleDisabledChange: (_: boolean, disabled: boolean) => void;
|
|
236
239
|
_handleReadonlyChange: (_: boolean, readonly: boolean) => void;
|
|
237
240
|
constructor();
|
|
238
|
-
|
|
241
|
+
firstUpdated(val: any): void;
|
|
239
242
|
disconnectedCallback(): void;
|
|
240
243
|
private _registerVariable;
|
|
241
244
|
showCorrectResponse(): void;
|
|
@@ -243,7 +246,7 @@ declare class QtiAssessmentItem extends LitElement {
|
|
|
243
246
|
set responses(myResponses: ResponseInteraction[]);
|
|
244
247
|
resetInteractions(): void;
|
|
245
248
|
validateResponses(): boolean;
|
|
246
|
-
getVariable(identifier: string): VariableDeclaration<
|
|
249
|
+
getVariable(identifier: string): VariableDeclaration<string | string[] | undefined>;
|
|
247
250
|
getResponse(identifier: string): ResponseVariable | null;
|
|
248
251
|
getOutcome(identifier: string): OutcomeVariable | null;
|
|
249
252
|
private registerFeedbackElement;
|
|
@@ -251,7 +254,7 @@ declare class QtiAssessmentItem extends LitElement {
|
|
|
251
254
|
private interactionResponse;
|
|
252
255
|
private outcomeChanged;
|
|
253
256
|
private showFeedback;
|
|
254
|
-
setOutcomeValue(identifier: string, value: string
|
|
257
|
+
setOutcomeValue(identifier: string, value: string): void;
|
|
255
258
|
}
|
|
256
259
|
declare global {
|
|
257
260
|
interface HTMLElementTagNameMap {
|
|
@@ -327,6 +330,7 @@ declare global {
|
|
|
327
330
|
|
|
328
331
|
declare class QtiVariableDeclaration extends LitElement {
|
|
329
332
|
render(): lit_html.TemplateResult<1>;
|
|
333
|
+
protected defaultValues(variable: VariableDeclaration<string | string[] | null>): string | string[];
|
|
330
334
|
}
|
|
331
335
|
|
|
332
336
|
declare class QtiResponseDeclaration extends QtiVariableDeclaration {
|
|
@@ -587,50 +591,37 @@ declare class QtiResponseElseIf extends QtiResponseIf {
|
|
|
587
591
|
}
|
|
588
592
|
|
|
589
593
|
declare abstract class QtiExpression<T> extends LitElement {
|
|
594
|
+
protected _result: any;
|
|
590
595
|
protected _error: any[];
|
|
596
|
+
private _debug;
|
|
591
597
|
protected set error(val: string);
|
|
592
598
|
static styles: lit.CSSResult;
|
|
593
599
|
render(): lit_html.TemplateResult<1>;
|
|
594
600
|
calculate(): T;
|
|
595
601
|
protected get assessmentItem(): QtiAssessmentItem;
|
|
596
|
-
protected getVariables: () => VariableDeclaration<number | string | string[] |
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
declare class QtiGt extends QtiExpression<boolean> {
|
|
600
|
-
calculate(): boolean;
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
declare class QtiConditionExpression extends QtiExpression<boolean> {
|
|
604
|
-
render(): lit_html.TemplateResult<1>;
|
|
605
|
-
calculate(): boolean;
|
|
602
|
+
protected getVariables: () => VariableDeclaration<number | string | (number | string)[] | null>[];
|
|
606
603
|
}
|
|
607
604
|
|
|
608
|
-
declare class
|
|
605
|
+
declare abstract class QtiConditionExpression extends QtiExpression<boolean> {
|
|
609
606
|
calculate(): boolean;
|
|
610
607
|
}
|
|
611
608
|
|
|
612
|
-
declare class
|
|
609
|
+
declare class QtiAnd extends QtiConditionExpression {
|
|
613
610
|
calculate(): boolean;
|
|
614
611
|
}
|
|
615
612
|
|
|
616
|
-
declare class
|
|
617
|
-
|
|
613
|
+
declare class QtiBaseValue extends QtiExpression<string> {
|
|
614
|
+
baseType: BaseType;
|
|
615
|
+
calculate(): string;
|
|
618
616
|
}
|
|
619
617
|
|
|
620
|
-
declare class
|
|
621
|
-
render(): lit_html.TemplateResult<1>;
|
|
618
|
+
declare class QtiContains extends QtiConditionExpression {
|
|
622
619
|
calculate(): boolean;
|
|
623
620
|
}
|
|
624
621
|
|
|
625
|
-
declare class
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
calculate(): number;
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
declare class QtiOr extends QtiConditionExpression {
|
|
632
|
-
render(): lit_html.TemplateResult<1>;
|
|
633
|
-
calculate(): boolean;
|
|
622
|
+
declare class QtiCorrect extends QtiExpression<string | string[]> {
|
|
623
|
+
get interpretation(): string;
|
|
624
|
+
calculate(): string | string[];
|
|
634
625
|
}
|
|
635
626
|
|
|
636
627
|
declare class QtiEqual extends QtiExpression<boolean> {
|
|
@@ -644,27 +635,23 @@ declare class QtiEqualRounded extends QtiExpression<boolean> {
|
|
|
644
635
|
calculate(): boolean;
|
|
645
636
|
}
|
|
646
637
|
|
|
647
|
-
declare class
|
|
648
|
-
|
|
649
|
-
calculate(): string;
|
|
638
|
+
declare class QtiGt extends QtiExpression<boolean> {
|
|
639
|
+
calculate(): boolean;
|
|
650
640
|
}
|
|
651
641
|
|
|
652
|
-
declare class
|
|
642
|
+
declare class QtiGte extends QtiConditionExpression {
|
|
653
643
|
calculate(): boolean;
|
|
654
644
|
}
|
|
655
645
|
|
|
656
|
-
declare class
|
|
657
|
-
|
|
658
|
-
get interpretation(): string;
|
|
659
|
-
calculate(): string | string[];
|
|
646
|
+
declare class QtiIsNull extends QtiExpression<boolean> {
|
|
647
|
+
calculate(): boolean;
|
|
660
648
|
}
|
|
661
649
|
|
|
662
|
-
declare class
|
|
650
|
+
declare class QtiLt extends QtiExpression<boolean> {
|
|
663
651
|
calculate(): boolean;
|
|
664
652
|
}
|
|
665
653
|
|
|
666
|
-
declare class
|
|
667
|
-
render(): lit_html.TemplateResult<1>;
|
|
654
|
+
declare class QtiLte extends QtiConditionExpression {
|
|
668
655
|
calculate(): boolean;
|
|
669
656
|
}
|
|
670
657
|
|
|
@@ -674,32 +661,46 @@ declare class QtiMapResponse extends QtiExpression<number> {
|
|
|
674
661
|
}
|
|
675
662
|
|
|
676
663
|
declare class QtiMatch extends QtiExpression<boolean> {
|
|
677
|
-
calculate():
|
|
664
|
+
calculate(): any;
|
|
665
|
+
static match(valueToMap: ResponseVariable, correctValueInfo: ResponseVariable): boolean;
|
|
678
666
|
}
|
|
679
667
|
|
|
680
|
-
declare class
|
|
681
|
-
|
|
682
|
-
calculate(): string | number | string[];
|
|
668
|
+
declare class QtiMember extends QtiExpression<boolean | null> {
|
|
669
|
+
calculate(): boolean;
|
|
683
670
|
}
|
|
684
671
|
|
|
685
672
|
declare class QtiMultiple extends QtiExpression<VariableDeclaration<string | string[]>[]> {
|
|
686
673
|
calculate(): ResponseVariable[];
|
|
687
674
|
}
|
|
688
675
|
|
|
676
|
+
declare class QtiNot extends QtiExpression<boolean> {
|
|
677
|
+
render(): lit_html.TemplateResult<1>;
|
|
678
|
+
calculate(): boolean;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
declare class QtiOr extends QtiConditionExpression {
|
|
682
|
+
render(): lit_html.TemplateResult<1>;
|
|
683
|
+
calculate(): boolean;
|
|
684
|
+
}
|
|
685
|
+
|
|
689
686
|
declare class QtiOrdered extends QtiExpression<ResponseVariable[]> {
|
|
690
687
|
calculate(): ResponseVariable[];
|
|
691
688
|
}
|
|
692
689
|
|
|
693
690
|
declare class QtPrintedVariable extends LitElement {
|
|
694
691
|
identifier: string;
|
|
695
|
-
value: string | string[]
|
|
692
|
+
value: string | string[];
|
|
696
693
|
render(): lit_html.TemplateResult<1>;
|
|
697
694
|
constructor();
|
|
698
|
-
calculate(): string | string[]
|
|
695
|
+
calculate(): string | string[];
|
|
699
696
|
}
|
|
700
697
|
|
|
701
|
-
declare class
|
|
702
|
-
calculate():
|
|
698
|
+
declare class QtiProduct extends QtiExpression<number> {
|
|
699
|
+
calculate(): number;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
declare class QtiVariable extends QtiExpression<string | string[]> {
|
|
703
|
+
calculate(): string | string[];
|
|
703
704
|
}
|
|
704
705
|
|
|
705
706
|
declare class QtiPortableCustomInteraction extends LitElement {
|
|
@@ -1012,25 +1013,15 @@ declare global {
|
|
|
1012
1013
|
}
|
|
1013
1014
|
|
|
1014
1015
|
declare class QtiItem extends LitElement {
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
readonly: boolean;
|
|
1018
|
-
handleReadonlyChange(old: any, readonly: boolean): void;
|
|
1019
|
-
responses: ResponseInteraction[];
|
|
1020
|
-
handleResponsesChange(old: any, responses: ResponseInteraction[]): void;
|
|
1021
|
-
set qtiContext(context: {
|
|
1016
|
+
itemLocation: string;
|
|
1017
|
+
set audienceContext(context: {
|
|
1022
1018
|
view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor';
|
|
1023
1019
|
});
|
|
1024
1020
|
private provider;
|
|
1025
|
-
get _item(): QtiAssessmentItem;
|
|
1026
1021
|
private _xml;
|
|
1027
1022
|
set xml(val: string);
|
|
1028
1023
|
get xml(): string;
|
|
1029
1024
|
static styles: lit.CSSResult;
|
|
1030
|
-
processResponse: () => boolean;
|
|
1031
|
-
showCorrectResponse: () => void;
|
|
1032
|
-
validateResponses: () => boolean;
|
|
1033
|
-
resetInteractions: () => void;
|
|
1034
1025
|
connectedCallback(): void;
|
|
1035
1026
|
render: () => lit_html.TemplateResult<1>;
|
|
1036
1027
|
}
|
|
@@ -1041,6 +1032,7 @@ declare const qtiTransform: (xmlValue: string) => {
|
|
|
1041
1032
|
pciHooks(uri: string): any;
|
|
1042
1033
|
assetsLocation(uri: string, attributes?: string[]): any;
|
|
1043
1034
|
customTypes(): any;
|
|
1035
|
+
customDefinition(): any;
|
|
1044
1036
|
suffix(elements: string[], suffix: string): any;
|
|
1045
1037
|
fn(fn: (xmlString: string) => string): any;
|
|
1046
1038
|
fnCh(fn: (xmlString: cheerio.CheerioAPI) => void): any;
|
|
@@ -1049,4 +1041,4 @@ declare const qtiTransform: (xmlValue: string) => {
|
|
|
1049
1041
|
xml(): string;
|
|
1050
1042
|
};
|
|
1051
1043
|
|
|
1052
|
-
export { BaseType, Calculate, Cardinality, Events, InteractionChangedDetails, Multiple, Ordered, OutcomeChangedDetails, OutcomeVariable, QtPrintedVariable, QtiAnd, QtiAssessmentItem, QtiAssociableHotspot, QtiAssociateInteraction, QtiBaseValue, QtiChoice, qtiChoiceElementSelected as QtiChoiceElementSelected, QtiChoiceInteraction, QtiCompanionMaterialsInfo, QtiContains, QtiCorrect, QtiEndAttemptInteraction, QtiEqual, QtiEqualRounded, QtiExpression, QtiExtendedTextInteraction, QtiFeedbackBlock, QtiFeedbackInline, QtiGap, QtiGapImg, QtiGapMatchInteraction, QtiGapText, QtiGraphicAssociateInteraction, QtiGraphicGapMatchInteraction, QtiGraphicOrderInteraction, QtiGt, QtiGte, QtiHotspotChoice, QtiHotspotInteraction, QtiHottext, QtiHottextInteraction, QtiInlineChoice, QtiInlineChoiceInteraction, qtiInteractionChanged as QtiInteractionChanged, qtiInteractionResponse as QtiInteractionResponse, QtiIsNull, QtiItem, qtiLooseChoice as QtiLooseChoice, QtiLt, QtiLte, QtiMapResponse, QtiMapping, QtiMatch, QtiMatchInteraction, QtiMediaInteraction, QtiMember, QtiModalFeedback, QtiMultiple, QtiNot, QtiOr, QtiOrderInteraction, QtiOrdered, qtiOutcomeChanged as QtiOutcomeChanged, QtiOutcomeDeclaration, QtiPortableCustomInteraction, QtiPositionObjectStage, QtiProduct, QtiPrompt, qtiRegisterChoice as QtiRegisterChoice, qtiRegisterHotspot as QtiRegisterHotspot, qtiRegisterInteraction as QtiRegisterInteraction, qtiRegisterVariable as QtiRegisterVariable, QtiResponseCondition, QtiResponseDeclaration, QtiResponseElse, QtiResponseElseIf, QtiResponseIf, QtiResponseProcessing, QtiRule, QtiSPositionObjectInteraction, QtiSelectPointInteraction, QtiSetOutcomeValue, QtiSimpleAssociableChoice, QtiSimpleChoice, QtiSliderInteraction, QtiStylesheet, QtiTextEntryInteraction, QtiVariable, ResponseInteraction, ResponseVariable, directedPair, float, integer, qtiContentBody, qtiRubricBlock, qtiTransform };
|
|
1044
|
+
export { BaseType, Calculate, Cardinality, Events, InteractionChangedDetails, Multiple, Ordered, OutcomeChangedDetails, OutcomeVariable, QtPrintedVariable, QtiAnd, QtiAssessmentItem, QtiAssociableHotspot, QtiAssociateInteraction, QtiBaseValue, QtiChoice, qtiChoiceElementSelected as QtiChoiceElementSelected, QtiChoiceInteraction, QtiCompanionMaterialsInfo, QtiConditionExpression, QtiContains, QtiCorrect, QtiEndAttemptInteraction, QtiEqual, QtiEqualRounded, QtiExpression, QtiExtendedTextInteraction, QtiFeedbackBlock, QtiFeedbackInline, QtiGap, QtiGapImg, QtiGapMatchInteraction, QtiGapText, QtiGraphicAssociateInteraction, QtiGraphicGapMatchInteraction, QtiGraphicOrderInteraction, QtiGt, QtiGte, QtiHotspotChoice, QtiHotspotInteraction, QtiHottext, QtiHottextInteraction, QtiInlineChoice, QtiInlineChoiceInteraction, qtiInteractionChanged as QtiInteractionChanged, qtiInteractionResponse as QtiInteractionResponse, QtiIsNull, QtiItem, qtiLooseChoice as QtiLooseChoice, QtiLt, QtiLte, QtiMapResponse, QtiMapping, QtiMatch, QtiMatchInteraction, QtiMediaInteraction, QtiMember, QtiModalFeedback, QtiMultiple, QtiNot, QtiOr, QtiOrderInteraction, QtiOrdered, qtiOutcomeChanged as QtiOutcomeChanged, QtiOutcomeDeclaration, QtiPortableCustomInteraction, QtiPositionObjectStage, QtiProduct, QtiPrompt, qtiRegisterChoice as QtiRegisterChoice, qtiRegisterHotspot as QtiRegisterHotspot, qtiRegisterInteraction as QtiRegisterInteraction, qtiRegisterVariable as QtiRegisterVariable, QtiResponseCondition, QtiResponseDeclaration, QtiResponseElse, QtiResponseElseIf, QtiResponseIf, QtiResponseProcessing, QtiRule, QtiSPositionObjectInteraction, QtiSelectPointInteraction, QtiSetOutcomeValue, QtiSimpleAssociableChoice, QtiSimpleChoice, QtiSliderInteraction, QtiStylesheet, QtiTextEntryInteraction, QtiVariable, ResponseInteraction, ResponseVariable, ResultVariable, VariableDeclaration, directedPair, float, integer, qtiContentBody, qtiRubricBlock, qtiTransform };
|