@citolab/qti-components 6.0.23 → 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 (36) 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-EHTDKAYF.js → chunk-WFE4NR22.js} +3 -3
  6. package/dist/{chunk-VI35S4EM.cjs → chunk-XHNCXKJ6.cjs} +3 -3
  7. package/dist/custom-elements.json +680 -688
  8. package/dist/decorators/index.cjs +1 -1
  9. package/dist/decorators/index.js +1 -1
  10. package/dist/index.cjs +55 -55
  11. package/dist/index.d.cts +20 -29
  12. package/dist/index.d.ts +20 -29
  13. package/dist/index.js +47 -47
  14. package/dist/qti-components/index.cjs +15 -15
  15. package/dist/qti-components/index.d.cts +8 -9
  16. package/dist/qti-components/index.d.ts +8 -9
  17. package/dist/qti-components/index.js +23 -23
  18. package/dist/qti-item/index.cjs +1 -1
  19. package/dist/qti-item/index.d.cts +1 -2
  20. package/dist/qti-item/index.d.ts +1 -2
  21. package/dist/qti-item/index.js +1 -1
  22. package/dist/qti-item-395a9535.d.ts +19 -0
  23. package/dist/qti-item-react/index.cjs +1 -1
  24. package/dist/qti-item-react/index.d.cts +7 -15
  25. package/dist/qti-item-react/index.d.ts +7 -15
  26. package/dist/qti-item-react/index.js +1 -1
  27. package/dist/{qti-simple-choice-b4b79072.d.ts → qti-simple-choice-6d581309.d.ts} +109 -5
  28. package/dist/qti-transform/index.cjs +1 -17
  29. package/dist/qti-transform/index.js +1 -17
  30. package/package.json +1 -2
  31. package/dist/chunk-3O4URV5U.cjs +0 -1
  32. package/dist/chunk-6RJ7J4AE.cjs +0 -1
  33. package/dist/chunk-M7QOVOG6.js +0 -1
  34. package/dist/chunk-WFLR5TH7.js +0 -1
  35. package/dist/qti-assessment-item-e8a67444.d.ts +0 -109
  36. 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: 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,21 +189,21 @@ declare class QtiMapping extends LitElement {
189
189
  }[];
190
190
  }
191
191
 
192
- declare class ResponseVariable implements VariableDeclaration<string | string[] | undefined> {
192
+ declare class ResponseVariable implements VariableDeclaration<string | string[] | null> {
193
193
  identifier: string;
194
194
  cardinality: Cardinality;
195
195
  baseType: BaseType;
196
- value: string | string[] | undefined;
197
- candidateResponse: string | string[];
196
+ value: string | string[] | null;
197
+ candidateResponse: string | string[] | null;
198
198
  mapping: QtiMapping;
199
- correctResponse: string | string[];
199
+ correctResponse: string | string[] | null;
200
200
  }
201
201
 
202
- declare class OutcomeVariable implements VariableDeclaration<number | string | string[] | undefined> {
202
+ declare class OutcomeVariable implements VariableDeclaration<string | string[] | null> {
203
203
  identifier: string;
204
204
  cardinality: Cardinality;
205
205
  baseType: BaseType;
206
- value: number | string | string[] | undefined;
206
+ value: string | string[] | null;
207
207
  }
208
208
 
209
209
  /**
@@ -223,7 +223,7 @@ declare class OutcomeVariable implements VariableDeclaration<number | string | s
223
223
  *
224
224
  */
225
225
  declare class QtiAssessmentItem extends LitElement {
226
- variables: VariableDeclaration<(string | string[]) | number>[];
226
+ variables: VariableDeclaration<string | string[]>[];
227
227
  private feedbackElements;
228
228
  private interactionElements;
229
229
  disabled: boolean;
@@ -243,7 +243,7 @@ declare class QtiAssessmentItem extends LitElement {
243
243
  set responses(myResponses: ResponseInteraction[]);
244
244
  resetInteractions(): void;
245
245
  validateResponses(): boolean;
246
- getVariable(identifier: string): VariableDeclaration<number | string | string[] | undefined>;
246
+ getVariable(identifier: string): VariableDeclaration<string | string[] | undefined>;
247
247
  getResponse(identifier: string): ResponseVariable | null;
248
248
  getOutcome(identifier: string): OutcomeVariable | null;
249
249
  private registerFeedbackElement;
@@ -251,7 +251,7 @@ declare class QtiAssessmentItem extends LitElement {
251
251
  private interactionResponse;
252
252
  private outcomeChanged;
253
253
  private showFeedback;
254
- setOutcomeValue(identifier: string, value: string | number): void;
254
+ setOutcomeValue(identifier: string, value: string): void;
255
255
  }
256
256
  declare global {
257
257
  interface HTMLElementTagNameMap {
@@ -327,6 +327,7 @@ declare global {
327
327
 
328
328
  declare class QtiVariableDeclaration extends LitElement {
329
329
  render(): lit_html.TemplateResult<1>;
330
+ protected defaultValues(variable: VariableDeclaration<string | string[] | null>): string | string[];
330
331
  }
331
332
 
332
333
  declare class QtiResponseDeclaration extends QtiVariableDeclaration {
@@ -593,7 +594,7 @@ declare abstract class QtiExpression<T> extends LitElement {
593
594
  render(): lit_html.TemplateResult<1>;
594
595
  calculate(): T;
595
596
  protected get assessmentItem(): QtiAssessmentItem;
596
- protected getVariables: () => VariableDeclaration<number | string | string[] | undefined>[];
597
+ protected getVariables: () => VariableDeclaration<number | string | (number | string)[] | undefined>[];
597
598
  }
598
599
 
599
600
  declare class QtiGt extends QtiExpression<boolean> {
@@ -677,9 +678,9 @@ declare class QtiMatch extends QtiExpression<boolean> {
677
678
  calculate(): boolean;
678
679
  }
679
680
 
680
- declare class QtiVariable extends QtiExpression<number | string | string[]> {
681
+ declare class QtiVariable extends QtiExpression<string | string[]> {
681
682
  render(): lit_html.TemplateResult<1>;
682
- calculate(): string | number | string[];
683
+ calculate(): string | string[];
683
684
  }
684
685
 
685
686
  declare class QtiMultiple extends QtiExpression<VariableDeclaration<string | string[]>[]> {
@@ -692,10 +693,10 @@ declare class QtiOrdered extends QtiExpression<ResponseVariable[]> {
692
693
 
693
694
  declare class QtPrintedVariable extends LitElement {
694
695
  identifier: string;
695
- value: string | string[] | number;
696
+ value: string | string[];
696
697
  render(): lit_html.TemplateResult<1>;
697
698
  constructor();
698
- calculate(): string | string[] | number;
699
+ calculate(): string | string[];
699
700
  }
700
701
 
701
702
  declare class QtiMember extends QtiExpression<boolean | null> {
@@ -1012,25 +1013,15 @@ declare global {
1012
1013
  }
1013
1014
 
1014
1015
  declare class QtiItem extends LitElement {
1015
- disabled: boolean;
1016
- handleDisabledChange(old: any, disabled: boolean): void;
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
  }
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,21 +189,21 @@ declare class QtiMapping extends LitElement {
189
189
  }[];
190
190
  }
191
191
 
192
- declare class ResponseVariable implements VariableDeclaration<string | string[] | undefined> {
192
+ declare class ResponseVariable implements VariableDeclaration<string | string[] | null> {
193
193
  identifier: string;
194
194
  cardinality: Cardinality;
195
195
  baseType: BaseType;
196
- value: string | string[] | undefined;
197
- candidateResponse: string | string[];
196
+ value: string | string[] | null;
197
+ candidateResponse: string | string[] | null;
198
198
  mapping: QtiMapping;
199
- correctResponse: string | string[];
199
+ correctResponse: string | string[] | null;
200
200
  }
201
201
 
202
- declare class OutcomeVariable implements VariableDeclaration<number | string | string[] | undefined> {
202
+ declare class OutcomeVariable implements VariableDeclaration<string | string[] | null> {
203
203
  identifier: string;
204
204
  cardinality: Cardinality;
205
205
  baseType: BaseType;
206
- value: number | string | string[] | undefined;
206
+ value: string | string[] | null;
207
207
  }
208
208
 
209
209
  /**
@@ -223,7 +223,7 @@ declare class OutcomeVariable implements VariableDeclaration<number | string | s
223
223
  *
224
224
  */
225
225
  declare class QtiAssessmentItem extends LitElement {
226
- variables: VariableDeclaration<(string | string[]) | number>[];
226
+ variables: VariableDeclaration<string | string[]>[];
227
227
  private feedbackElements;
228
228
  private interactionElements;
229
229
  disabled: boolean;
@@ -243,7 +243,7 @@ declare class QtiAssessmentItem extends LitElement {
243
243
  set responses(myResponses: ResponseInteraction[]);
244
244
  resetInteractions(): void;
245
245
  validateResponses(): boolean;
246
- getVariable(identifier: string): VariableDeclaration<number | string | string[] | undefined>;
246
+ getVariable(identifier: string): VariableDeclaration<string | string[] | undefined>;
247
247
  getResponse(identifier: string): ResponseVariable | null;
248
248
  getOutcome(identifier: string): OutcomeVariable | null;
249
249
  private registerFeedbackElement;
@@ -251,7 +251,7 @@ declare class QtiAssessmentItem extends LitElement {
251
251
  private interactionResponse;
252
252
  private outcomeChanged;
253
253
  private showFeedback;
254
- setOutcomeValue(identifier: string, value: string | number): void;
254
+ setOutcomeValue(identifier: string, value: string): void;
255
255
  }
256
256
  declare global {
257
257
  interface HTMLElementTagNameMap {
@@ -327,6 +327,7 @@ declare global {
327
327
 
328
328
  declare class QtiVariableDeclaration extends LitElement {
329
329
  render(): lit_html.TemplateResult<1>;
330
+ protected defaultValues(variable: VariableDeclaration<string | string[] | null>): string | string[];
330
331
  }
331
332
 
332
333
  declare class QtiResponseDeclaration extends QtiVariableDeclaration {
@@ -593,7 +594,7 @@ declare abstract class QtiExpression<T> extends LitElement {
593
594
  render(): lit_html.TemplateResult<1>;
594
595
  calculate(): T;
595
596
  protected get assessmentItem(): QtiAssessmentItem;
596
- protected getVariables: () => VariableDeclaration<number | string | string[] | undefined>[];
597
+ protected getVariables: () => VariableDeclaration<number | string | (number | string)[] | undefined>[];
597
598
  }
598
599
 
599
600
  declare class QtiGt extends QtiExpression<boolean> {
@@ -677,9 +678,9 @@ declare class QtiMatch extends QtiExpression<boolean> {
677
678
  calculate(): boolean;
678
679
  }
679
680
 
680
- declare class QtiVariable extends QtiExpression<number | string | string[]> {
681
+ declare class QtiVariable extends QtiExpression<string | string[]> {
681
682
  render(): lit_html.TemplateResult<1>;
682
- calculate(): string | number | string[];
683
+ calculate(): string | string[];
683
684
  }
684
685
 
685
686
  declare class QtiMultiple extends QtiExpression<VariableDeclaration<string | string[]>[]> {
@@ -692,10 +693,10 @@ declare class QtiOrdered extends QtiExpression<ResponseVariable[]> {
692
693
 
693
694
  declare class QtPrintedVariable extends LitElement {
694
695
  identifier: string;
695
- value: string | string[] | number;
696
+ value: string | string[];
696
697
  render(): lit_html.TemplateResult<1>;
697
698
  constructor();
698
- calculate(): string | string[] | number;
699
+ calculate(): string | string[];
699
700
  }
700
701
 
701
702
  declare class QtiMember extends QtiExpression<boolean | null> {
@@ -1012,25 +1013,15 @@ declare global {
1012
1013
  }
1013
1014
 
1014
1015
  declare class QtiItem extends LitElement {
1015
- disabled: boolean;
1016
- handleDisabledChange(old: any, disabled: boolean): void;
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
  }