@citolab/qti-components 6.0.20 → 6.0.23

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 (47) hide show
  1. package/dist/audience-context-444478f4.d.ts +8 -0
  2. package/dist/chunk-3O4URV5U.cjs +1 -0
  3. package/dist/chunk-5GG2XAUT.js +1 -0
  4. package/dist/chunk-6RJ7J4AE.cjs +1 -0
  5. package/dist/{chunk-5RZQOWDC.js → chunk-EHTDKAYF.js} +27 -5
  6. package/dist/chunk-GGEPFBR7.cjs +1 -0
  7. package/dist/chunk-HOQW4KDA.cjs +1 -0
  8. package/dist/{chunk-AQI672QR.js → chunk-VI35S4EM.cjs} +28 -6
  9. package/dist/context/index.cjs +1 -0
  10. package/dist/context/index.d.cts +1 -0
  11. package/dist/context/index.d.ts +1 -1
  12. package/dist/context/index.js +1 -1
  13. package/dist/custom-elements.json +653 -600
  14. package/dist/decorators/index.cjs +1 -0
  15. package/dist/decorators/index.d.cts +37 -0
  16. package/dist/index.cjs +2911 -0
  17. package/dist/index.css +25 -3
  18. package/dist/index.d.cts +1052 -0
  19. package/dist/index.d.ts +38 -41
  20. package/dist/index.js +98 -66
  21. package/dist/{qti-assessment-item-f1fcf393.d.ts → qti-assessment-item-e8a67444.d.ts} +17 -28
  22. package/dist/qti-components/index.cjs +419 -0
  23. package/dist/qti-components/index.d.cts +561 -0
  24. package/dist/qti-components/index.d.ts +24 -14
  25. package/dist/qti-components/index.js +76 -66
  26. package/dist/qti-item/index.cjs +1 -0
  27. package/dist/qti-item/index.d.cts +4 -0
  28. package/dist/qti-item/index.d.ts +2 -2
  29. package/dist/qti-item/index.js +1 -1
  30. package/dist/{qti-item-8c26fa9e.d.ts → qti-item-77742afa.d.ts} +1 -1
  31. package/dist/qti-item-react/index.cjs +1 -0
  32. package/dist/qti-item-react/index.d.cts +30 -0
  33. package/dist/qti-item-react/index.d.ts +3 -3
  34. package/dist/qti-item-react/index.js +1 -1
  35. package/dist/{qti-simple-choice-3e910d03.d.ts → qti-simple-choice-b4b79072.d.ts} +2 -2
  36. package/dist/qti-transform/index.cjs +17 -0
  37. package/dist/qti-transform/index.d.cts +17 -0
  38. package/package.json +25 -15
  39. package/dist/chunk-FIJLDR56.js +0 -2204
  40. package/dist/chunk-HQKT4SJF.js +0 -1
  41. package/dist/chunk-RPGALUIV.js +0 -1
  42. package/dist/chunk-UD6XWG6V.js +0 -2205
  43. package/dist/context-a957e50e.d.ts +0 -9
  44. package/dist/qti-assessment-item-68bcc951.d.ts +0 -121
  45. package/dist/qti-item-e1fc6a70.d.ts +0 -30
  46. package/dist/qti-simple-choice-ca9b86db.d.ts +0 -352
  47. package/dist/qti-simple-choice-d1392d78.d.ts +0 -352
package/dist/index.d.ts CHANGED
@@ -18,7 +18,7 @@ interface Calculate {
18
18
  }
19
19
  type float = number;
20
20
  type integer = number;
21
- type BaseType = 'boolean' | 'directedPair' | 'float' | 'integer' | 'string' | 'identifier' | 'pair';
21
+ type BaseType = 'boolean' | 'directedPair' | 'duration' | 'float' | 'integer' | 'string' | 'identifier' | 'pair';
22
22
  type Multiple = string | string[][];
23
23
  type Ordered = string | string[][];
24
24
  type Cardinality = 'multiple' | 'ordered' | 'single';
@@ -26,7 +26,7 @@ type Cardinality = 'multiple' | 'ordered' | 'single';
26
26
  interface OutcomeChangedDetails {
27
27
  item: string;
28
28
  outcomeIdentifier: string;
29
- value: number;
29
+ value: number | string | string[];
30
30
  }
31
31
  type InteractionChangedDetails = ResponseInteraction & {
32
32
  item: string;
@@ -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[] | 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[];
214
200
  }
215
201
 
216
- declare class OutcomeVariable implements VariableDeclaration<number | string | undefined> {
202
+ declare class OutcomeVariable implements VariableDeclaration<number | string | string[] | undefined> {
217
203
  identifier: string;
218
204
  cardinality: Cardinality;
219
205
  baseType: BaseType;
220
- value: number | string | undefined;
206
+ value: number | string | string[] | undefined;
221
207
  }
222
208
 
223
209
  /**
@@ -232,7 +218,8 @@ declare class OutcomeVariable implements VariableDeclaration<number | string | u
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 {
@@ -243,6 +230,7 @@ declare class QtiAssessmentItem extends LitElement {
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
- getVariableValue(identifier: string): string | string[] | number | null;
246
+ getVariable(identifier: string): VariableDeclaration<number | 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: number): void;
254
+ setOutcomeValue(identifier: string, value: string | number): void;
267
255
  }
268
256
  declare global {
269
257
  interface HTMLElementTagNameMap {
@@ -351,7 +339,9 @@ declare class QtiResponseDeclaration extends QtiVariableDeclaration {
351
339
  }
352
340
 
353
341
  declare class QtiOutcomeDeclaration extends QtiVariableDeclaration {
354
- static get observedAttributes(): string[];
342
+ baseType: BaseType;
343
+ identifier: string;
344
+ cardinality: Cardinality;
355
345
  get interpolationTable(): any;
356
346
  connectedCallback(): void;
357
347
  }
@@ -359,9 +349,8 @@ declare class QtiOutcomeDeclaration extends QtiVariableDeclaration {
359
349
  declare class QtiCompanionMaterialsInfo extends LitElement {
360
350
  }
361
351
 
362
- interface Logger {
363
- view: string;
364
- log: (msg: string) => void;
352
+ interface Audience {
353
+ view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor';
365
354
  }
366
355
 
367
356
  declare class qtiRubricBlock extends LitElement {
@@ -372,7 +361,7 @@ declare class qtiRubricBlock extends LitElement {
372
361
  handleclassNamesChange(old: any, disabled: boolean): void;
373
362
  static styles: lit.CSSResult;
374
363
  logger: ContextConsumer<{
375
- __context__: Logger;
364
+ __context__: Audience;
376
365
  }, this>;
377
366
  render(): lit_html.TemplateResult<1>;
378
367
  connectedCallback(): void;
@@ -597,11 +586,14 @@ declare class QtiResponseElseIf extends QtiResponseIf {
597
586
  render(): lit_html.TemplateResult<1>;
598
587
  }
599
588
 
600
- declare class QtiExpression<T> extends LitElement {
589
+ declare abstract class QtiExpression<T> extends LitElement {
590
+ protected _error: any[];
591
+ protected set error(val: string);
592
+ static styles: lit.CSSResult;
601
593
  render(): lit_html.TemplateResult<1>;
602
594
  calculate(): T;
603
595
  protected get assessmentItem(): QtiAssessmentItem;
604
- protected getVariables: () => ResponseVariable[];
596
+ protected getVariables: () => VariableDeclaration<number | string | string[] | undefined>[];
605
597
  }
606
598
 
607
599
  declare class QtiGt extends QtiExpression<boolean> {
@@ -647,7 +639,7 @@ declare class QtiEqual extends QtiExpression<boolean> {
647
639
  }
648
640
 
649
641
  declare class QtiEqualRounded extends QtiExpression<boolean> {
650
- roundingMode: "decimalPlaces" | "significantFigures";
642
+ roundingMode: 'decimalPlaces' | 'significantFigures';
651
643
  get figures(): number;
652
644
  calculate(): boolean;
653
645
  }
@@ -690,7 +682,7 @@ declare class QtiVariable extends QtiExpression<number | string | string[]> {
690
682
  calculate(): string | number | string[];
691
683
  }
692
684
 
693
- declare class QtiMultiple extends QtiExpression<ResponseVariable[]> {
685
+ declare class QtiMultiple extends QtiExpression<VariableDeclaration<string | string[]>[]> {
694
686
  calculate(): ResponseVariable[];
695
687
  }
696
688
 
@@ -699,10 +691,15 @@ declare class QtiOrdered extends QtiExpression<ResponseVariable[]> {
699
691
  }
700
692
 
701
693
  declare class QtPrintedVariable extends LitElement {
702
- value: string;
694
+ identifier: string;
695
+ value: string | string[] | number;
703
696
  render(): lit_html.TemplateResult<1>;
704
697
  constructor();
705
- calculate(): string | number | string[];
698
+ calculate(): string | string[] | number;
699
+ }
700
+
701
+ declare class QtiMember extends QtiExpression<boolean | null> {
702
+ calculate(): boolean;
706
703
  }
707
704
 
708
705
  declare class QtiPortableCustomInteraction extends LitElement {
@@ -1052,4 +1049,4 @@ declare const qtiTransform: (xmlValue: string) => {
1052
1049
  xml(): string;
1053
1050
  };
1054
1051
 
1055
- 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, 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 };
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 };