@citolab/qti-components 6.0.22 → 6.0.24

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.
Files changed (37) hide show
  1. package/dist/chunk-BVYXUE3V.js +1 -0
  2. package/dist/chunk-C4C24R3I.cjs +1 -0
  3. package/dist/chunk-NT6UB5QT.cjs +17 -0
  4. package/dist/chunk-RGNNQ7CN.js +17 -0
  5. package/dist/{chunk-YDFMBQT4.js → chunk-WFE4NR22.js} +28 -6
  6. package/dist/{chunk-GEVRCVN2.cjs → chunk-XHNCXKJ6.cjs} +28 -6
  7. package/dist/custom-elements.json +6817 -0
  8. package/dist/decorators/index.cjs +1 -1
  9. package/dist/decorators/index.js +1 -1
  10. package/dist/index.cjs +84 -62
  11. package/dist/index.css +2215 -0
  12. package/dist/index.d.cts +30 -50
  13. package/dist/index.d.ts +30 -50
  14. package/dist/index.js +76 -54
  15. package/dist/qti-components/index.cjs +21 -21
  16. package/dist/qti-components/index.d.cts +11 -11
  17. package/dist/qti-components/index.d.ts +11 -11
  18. package/dist/qti-components/index.js +57 -57
  19. package/dist/qti-item/index.cjs +1 -1
  20. package/dist/qti-item/index.d.cts +1 -2
  21. package/dist/qti-item/index.d.ts +1 -2
  22. package/dist/qti-item/index.js +1 -1
  23. package/dist/qti-item-395a9535.d.ts +19 -0
  24. package/dist/qti-item-react/index.cjs +1 -1
  25. package/dist/qti-item-react/index.d.cts +7 -15
  26. package/dist/qti-item-react/index.d.ts +7 -15
  27. package/dist/qti-item-react/index.js +1 -1
  28. package/dist/{qti-simple-choice-e28cfb34.d.ts → qti-simple-choice-6d581309.d.ts} +109 -5
  29. package/dist/qti-transform/index.cjs +1 -17
  30. package/dist/qti-transform/index.js +1 -17
  31. package/package.json +3 -4
  32. package/dist/chunk-3O4URV5U.cjs +0 -1
  33. package/dist/chunk-6RJ7J4AE.cjs +0 -1
  34. package/dist/chunk-M7QOVOG6.js +0 -1
  35. package/dist/chunk-WFLR5TH7.js +0 -1
  36. package/dist/qti-assessment-item-c1eb7de3.d.ts +0 -121
  37. package/dist/qti-item-e2edd87f.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: number | string | string[];
29
+ value: string | string[];
30
30
  }
31
31
  type InteractionChangedDetails = ResponseInteraction & {
32
32
  item: string;
@@ -70,11 +70,11 @@ interface VariableDeclaration<T> {
70
70
  }
71
71
 
72
72
  type QtiRegisterVariable = CustomEvent<{
73
- variable: VariableDeclaration<number | string | string[]>;
73
+ variable: VariableDeclaration<string | string[]>;
74
74
  }>;
75
75
  declare global {
76
76
  interface GlobalEventHandlersEventMap {
77
- "qti-register-variable": QtiRegisterVariable;
77
+ 'qti-register-variable': QtiRegisterVariable;
78
78
  }
79
79
  }
80
80
 
@@ -189,35 +189,21 @@ declare class QtiMapping extends LitElement {
189
189
  }[];
190
190
  }
191
191
 
192
- declare class ResponseVariable implements VariableDeclaration<string | string[]> {
193
- private _candidateResponse;
194
- private _mapping;
195
- private _correctResponse;
196
- private _cardinality;
197
- private _identifier;
198
- private _basetype;
199
- private _qtiVariable;
200
- constructor({ mapping, correctResponse, cardinality, baseType, identifier, }: {
201
- mapping: QtiMapping;
202
- correctResponse: string | string[];
203
- cardinality: Cardinality;
204
- baseType: BaseType;
205
- identifier: string;
206
- });
207
- get mapping(): QtiMapping;
208
- get correctResponse(): string | string[];
209
- get cardinality(): Cardinality;
210
- get baseType(): BaseType;
211
- get identifier(): string;
212
- get value(): string | string[];
213
- set value(val: string | string[]);
192
+ declare class ResponseVariable implements VariableDeclaration<string | string[] | null> {
193
+ identifier: string;
194
+ cardinality: Cardinality;
195
+ baseType: BaseType;
196
+ value: string | string[] | null;
197
+ candidateResponse: string | string[] | null;
198
+ mapping: QtiMapping;
199
+ correctResponse: string | string[] | null;
214
200
  }
215
201
 
216
- declare class OutcomeVariable implements VariableDeclaration<number | string | string[] | undefined> {
202
+ declare class OutcomeVariable implements VariableDeclaration<string | string[] | null> {
217
203
  identifier: string;
218
204
  cardinality: Cardinality;
219
205
  baseType: BaseType;
220
- value: number | string | string[] | undefined;
206
+ value: string | string[] | null;
221
207
  }
222
208
 
223
209
  /**
@@ -232,17 +218,19 @@ declare class OutcomeVariable implements VariableDeclaration<number | string | s
232
218
  * @slot - The default slot where all the other QTI 3 item structures go.
233
219
  *
234
220
  * @event qti-interaction-changed - Emitted when an interaction is changed.
235
- * @event qti-outcome-changed - Emitted when the radio group receives user input.
221
+ * @event qti-outcome-changed - Emitted when an outcome has changed.
222
+ * @event qti-response-processing - Emitted when response-processing is called.
236
223
  *
237
224
  */
238
225
  declare class QtiAssessmentItem extends LitElement {
239
- variables: VariableDeclaration<(string | string[]) | number>[];
226
+ variables: VariableDeclaration<string | string[]>[];
240
227
  private feedbackElements;
241
228
  private interactionElements;
242
229
  disabled: boolean;
243
230
  readonly: boolean;
244
231
  title: string;
245
232
  identifier: string;
233
+ private _numAttempts;
246
234
  render(): lit_html.TemplateResult<1>;
247
235
  _handleDisabledChange: (_: boolean, disabled: boolean) => void;
248
236
  _handleReadonlyChange: (_: boolean, readonly: boolean) => void;
@@ -255,7 +243,7 @@ declare class QtiAssessmentItem extends LitElement {
255
243
  set responses(myResponses: ResponseInteraction[]);
256
244
  resetInteractions(): void;
257
245
  validateResponses(): boolean;
258
- getVariable(identifier: string): VariableDeclaration<any>;
246
+ getVariable(identifier: string): VariableDeclaration<string | string[] | undefined>;
259
247
  getResponse(identifier: string): ResponseVariable | null;
260
248
  getOutcome(identifier: string): OutcomeVariable | null;
261
249
  private registerFeedbackElement;
@@ -263,7 +251,7 @@ declare class QtiAssessmentItem extends LitElement {
263
251
  private interactionResponse;
264
252
  private outcomeChanged;
265
253
  private showFeedback;
266
- setOutcomeValue(identifier: string, value: string | number): void;
254
+ setOutcomeValue(identifier: string, value: string): void;
267
255
  }
268
256
  declare global {
269
257
  interface HTMLElementTagNameMap {
@@ -339,6 +327,7 @@ declare global {
339
327
 
340
328
  declare class QtiVariableDeclaration extends LitElement {
341
329
  render(): lit_html.TemplateResult<1>;
330
+ protected defaultValues(variable: VariableDeclaration<string | string[] | null>): string | string[];
342
331
  }
343
332
 
344
333
  declare class QtiResponseDeclaration extends QtiVariableDeclaration {
@@ -598,14 +587,14 @@ declare class QtiResponseElseIf extends QtiResponseIf {
598
587
  render(): lit_html.TemplateResult<1>;
599
588
  }
600
589
 
601
- declare class QtiExpression<T> extends LitElement {
590
+ declare abstract class QtiExpression<T> extends LitElement {
602
591
  protected _error: any[];
603
592
  protected set error(val: string);
604
593
  static styles: lit.CSSResult;
605
594
  render(): lit_html.TemplateResult<1>;
606
595
  calculate(): T;
607
596
  protected get assessmentItem(): QtiAssessmentItem;
608
- protected getVariables: () => VariableDeclaration<string | string[]>[];
597
+ protected getVariables: () => VariableDeclaration<number | string | (number | string)[] | undefined>[];
609
598
  }
610
599
 
611
600
  declare class QtiGt extends QtiExpression<boolean> {
@@ -689,12 +678,12 @@ declare class QtiMatch extends QtiExpression<boolean> {
689
678
  calculate(): boolean;
690
679
  }
691
680
 
692
- declare class QtiVariable extends QtiExpression<number | string | string[]> {
681
+ declare class QtiVariable extends QtiExpression<string | string[]> {
693
682
  render(): lit_html.TemplateResult<1>;
694
- calculate(): any;
683
+ calculate(): string | string[];
695
684
  }
696
685
 
697
- declare class QtiMultiple extends QtiExpression<ResponseVariable[]> {
686
+ declare class QtiMultiple extends QtiExpression<VariableDeclaration<string | string[]>[]> {
698
687
  calculate(): ResponseVariable[];
699
688
  }
700
689
 
@@ -703,10 +692,11 @@ declare class QtiOrdered extends QtiExpression<ResponseVariable[]> {
703
692
  }
704
693
 
705
694
  declare class QtPrintedVariable extends LitElement {
706
- value: string;
695
+ identifier: string;
696
+ value: string | string[];
707
697
  render(): lit_html.TemplateResult<1>;
708
698
  constructor();
709
- calculate(): any;
699
+ calculate(): string | string[];
710
700
  }
711
701
 
712
702
  declare class QtiMember extends QtiExpression<boolean | null> {
@@ -1023,25 +1013,15 @@ declare global {
1023
1013
  }
1024
1014
 
1025
1015
  declare class QtiItem extends LitElement {
1026
- disabled: boolean;
1027
- handleDisabledChange(old: any, disabled: boolean): void;
1028
- readonly: boolean;
1029
- handleReadonlyChange(old: any, readonly: boolean): void;
1030
- responses: ResponseInteraction[];
1031
- handleResponsesChange(old: any, responses: ResponseInteraction[]): void;
1032
- set qtiContext(context: {
1016
+ itemLocation: string;
1017
+ set audienceContext(context: {
1033
1018
  view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor';
1034
1019
  });
1035
1020
  private provider;
1036
- get _item(): QtiAssessmentItem;
1037
1021
  private _xml;
1038
1022
  set xml(val: string);
1039
1023
  get xml(): string;
1040
1024
  static styles: lit.CSSResult;
1041
- processResponse: () => boolean;
1042
- showCorrectResponse: () => void;
1043
- validateResponses: () => boolean;
1044
- resetInteractions: () => void;
1045
1025
  connectedCallback(): void;
1046
1026
  render: () => lit_html.TemplateResult<1>;
1047
1027
  }
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: number | string | string[];
29
+ value: string | string[];
30
30
  }
31
31
  type InteractionChangedDetails = ResponseInteraction & {
32
32
  item: string;
@@ -70,11 +70,11 @@ interface VariableDeclaration<T> {
70
70
  }
71
71
 
72
72
  type QtiRegisterVariable = CustomEvent<{
73
- variable: VariableDeclaration<number | string | string[]>;
73
+ variable: VariableDeclaration<string | string[]>;
74
74
  }>;
75
75
  declare global {
76
76
  interface GlobalEventHandlersEventMap {
77
- "qti-register-variable": QtiRegisterVariable;
77
+ 'qti-register-variable': QtiRegisterVariable;
78
78
  }
79
79
  }
80
80
 
@@ -189,35 +189,21 @@ declare class QtiMapping extends LitElement {
189
189
  }[];
190
190
  }
191
191
 
192
- declare class ResponseVariable implements VariableDeclaration<string | string[]> {
193
- private _candidateResponse;
194
- private _mapping;
195
- private _correctResponse;
196
- private _cardinality;
197
- private _identifier;
198
- private _basetype;
199
- private _qtiVariable;
200
- constructor({ mapping, correctResponse, cardinality, baseType, identifier, }: {
201
- mapping: QtiMapping;
202
- correctResponse: string | string[];
203
- cardinality: Cardinality;
204
- baseType: BaseType;
205
- identifier: string;
206
- });
207
- get mapping(): QtiMapping;
208
- get correctResponse(): string | string[];
209
- get cardinality(): Cardinality;
210
- get baseType(): BaseType;
211
- get identifier(): string;
212
- get value(): string | string[];
213
- set value(val: string | string[]);
192
+ declare class ResponseVariable implements VariableDeclaration<string | string[] | null> {
193
+ identifier: string;
194
+ cardinality: Cardinality;
195
+ baseType: BaseType;
196
+ value: string | string[] | null;
197
+ candidateResponse: string | string[] | null;
198
+ mapping: QtiMapping;
199
+ correctResponse: string | string[] | null;
214
200
  }
215
201
 
216
- declare class OutcomeVariable implements VariableDeclaration<number | string | string[] | undefined> {
202
+ declare class OutcomeVariable implements VariableDeclaration<string | string[] | null> {
217
203
  identifier: string;
218
204
  cardinality: Cardinality;
219
205
  baseType: BaseType;
220
- value: number | string | string[] | undefined;
206
+ value: string | string[] | null;
221
207
  }
222
208
 
223
209
  /**
@@ -232,17 +218,19 @@ declare class OutcomeVariable implements VariableDeclaration<number | string | s
232
218
  * @slot - The default slot where all the other QTI 3 item structures go.
233
219
  *
234
220
  * @event qti-interaction-changed - Emitted when an interaction is changed.
235
- * @event qti-outcome-changed - Emitted when the radio group receives user input.
221
+ * @event qti-outcome-changed - Emitted when an outcome has changed.
222
+ * @event qti-response-processing - Emitted when response-processing is called.
236
223
  *
237
224
  */
238
225
  declare class QtiAssessmentItem extends LitElement {
239
- variables: VariableDeclaration<(string | string[]) | number>[];
226
+ variables: VariableDeclaration<string | string[]>[];
240
227
  private feedbackElements;
241
228
  private interactionElements;
242
229
  disabled: boolean;
243
230
  readonly: boolean;
244
231
  title: string;
245
232
  identifier: string;
233
+ private _numAttempts;
246
234
  render(): lit_html.TemplateResult<1>;
247
235
  _handleDisabledChange: (_: boolean, disabled: boolean) => void;
248
236
  _handleReadonlyChange: (_: boolean, readonly: boolean) => void;
@@ -255,7 +243,7 @@ declare class QtiAssessmentItem extends LitElement {
255
243
  set responses(myResponses: ResponseInteraction[]);
256
244
  resetInteractions(): void;
257
245
  validateResponses(): boolean;
258
- getVariable(identifier: string): VariableDeclaration<any>;
246
+ getVariable(identifier: string): VariableDeclaration<string | string[] | undefined>;
259
247
  getResponse(identifier: string): ResponseVariable | null;
260
248
  getOutcome(identifier: string): OutcomeVariable | null;
261
249
  private registerFeedbackElement;
@@ -263,7 +251,7 @@ declare class QtiAssessmentItem extends LitElement {
263
251
  private interactionResponse;
264
252
  private outcomeChanged;
265
253
  private showFeedback;
266
- setOutcomeValue(identifier: string, value: string | number): void;
254
+ setOutcomeValue(identifier: string, value: string): void;
267
255
  }
268
256
  declare global {
269
257
  interface HTMLElementTagNameMap {
@@ -339,6 +327,7 @@ declare global {
339
327
 
340
328
  declare class QtiVariableDeclaration extends LitElement {
341
329
  render(): lit_html.TemplateResult<1>;
330
+ protected defaultValues(variable: VariableDeclaration<string | string[] | null>): string | string[];
342
331
  }
343
332
 
344
333
  declare class QtiResponseDeclaration extends QtiVariableDeclaration {
@@ -598,14 +587,14 @@ declare class QtiResponseElseIf extends QtiResponseIf {
598
587
  render(): lit_html.TemplateResult<1>;
599
588
  }
600
589
 
601
- declare class QtiExpression<T> extends LitElement {
590
+ declare abstract class QtiExpression<T> extends LitElement {
602
591
  protected _error: any[];
603
592
  protected set error(val: string);
604
593
  static styles: lit.CSSResult;
605
594
  render(): lit_html.TemplateResult<1>;
606
595
  calculate(): T;
607
596
  protected get assessmentItem(): QtiAssessmentItem;
608
- protected getVariables: () => VariableDeclaration<string | string[]>[];
597
+ protected getVariables: () => VariableDeclaration<number | string | (number | string)[] | undefined>[];
609
598
  }
610
599
 
611
600
  declare class QtiGt extends QtiExpression<boolean> {
@@ -689,12 +678,12 @@ declare class QtiMatch extends QtiExpression<boolean> {
689
678
  calculate(): boolean;
690
679
  }
691
680
 
692
- declare class QtiVariable extends QtiExpression<number | string | string[]> {
681
+ declare class QtiVariable extends QtiExpression<string | string[]> {
693
682
  render(): lit_html.TemplateResult<1>;
694
- calculate(): any;
683
+ calculate(): string | string[];
695
684
  }
696
685
 
697
- declare class QtiMultiple extends QtiExpression<ResponseVariable[]> {
686
+ declare class QtiMultiple extends QtiExpression<VariableDeclaration<string | string[]>[]> {
698
687
  calculate(): ResponseVariable[];
699
688
  }
700
689
 
@@ -703,10 +692,11 @@ declare class QtiOrdered extends QtiExpression<ResponseVariable[]> {
703
692
  }
704
693
 
705
694
  declare class QtPrintedVariable extends LitElement {
706
- value: string;
695
+ identifier: string;
696
+ value: string | string[];
707
697
  render(): lit_html.TemplateResult<1>;
708
698
  constructor();
709
- calculate(): any;
699
+ calculate(): string | string[];
710
700
  }
711
701
 
712
702
  declare class QtiMember extends QtiExpression<boolean | null> {
@@ -1023,25 +1013,15 @@ declare global {
1023
1013
  }
1024
1014
 
1025
1015
  declare class QtiItem extends LitElement {
1026
- disabled: boolean;
1027
- handleDisabledChange(old: any, disabled: boolean): void;
1028
- readonly: boolean;
1029
- handleReadonlyChange(old: any, readonly: boolean): void;
1030
- responses: ResponseInteraction[];
1031
- handleResponsesChange(old: any, responses: ResponseInteraction[]): void;
1032
- set qtiContext(context: {
1016
+ itemLocation: string;
1017
+ set audienceContext(context: {
1033
1018
  view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor';
1034
1019
  });
1035
1020
  private provider;
1036
- get _item(): QtiAssessmentItem;
1037
1021
  private _xml;
1038
1022
  set xml(val: string);
1039
1023
  get xml(): string;
1040
1024
  static styles: lit.CSSResult;
1041
- processResponse: () => boolean;
1042
- showCorrectResponse: () => void;
1043
- validateResponses: () => boolean;
1044
- resetInteractions: () => void;
1045
1025
  connectedCallback(): void;
1046
1026
  render: () => lit_html.TemplateResult<1>;
1047
1027
  }