@citolab/qti-components 6.0.34 → 6.1.0

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 (42) hide show
  1. package/dist/{chunk-GGEPFBR7.cjs → chunk-6YQCE7H6.cjs} +1 -1
  2. package/dist/chunk-AWSFYZS5.js +17 -0
  3. package/dist/chunk-CCQXZDO6.cjs +17 -0
  4. package/dist/chunk-DKGW23YB.js +1 -0
  5. package/dist/chunk-MTPOYN4D.js +0 -0
  6. package/dist/{chunk-UGSY24LD.cjs → chunk-OI3PY5MR.cjs} +2 -6
  7. package/dist/chunk-TEMU6PXC.cjs +1 -0
  8. package/dist/{chunk-X6JTBTZK.js → chunk-TSUFNGZN.js} +2 -6
  9. package/dist/context/index.cjs +1 -1
  10. package/dist/context/index.d.cts +3 -3
  11. package/dist/context/index.d.ts +3 -3
  12. package/dist/context/index.js +1 -1
  13. package/dist/custom-elements.json +2238 -1210
  14. package/dist/index.cjs +189 -108
  15. package/dist/index.d.cts +194 -63
  16. package/dist/index.d.ts +194 -63
  17. package/dist/index.js +189 -108
  18. package/dist/qti-components/index.cjs +51 -51
  19. package/dist/qti-components/index.d.cts +32 -11
  20. package/dist/qti-components/index.d.ts +32 -11
  21. package/dist/qti-components/index.js +77 -77
  22. package/dist/qti-item/index.cjs +1 -1
  23. package/dist/qti-item/index.d.cts +10 -8
  24. package/dist/qti-item/index.d.ts +10 -8
  25. package/dist/qti-item/index.js +1 -1
  26. package/dist/qti-item-react/index.cjs +1 -1
  27. package/dist/qti-item-react/index.d.cts +2 -1
  28. package/dist/qti-item-react/index.d.ts +2 -1
  29. package/dist/qti-item-react/index.js +1 -1
  30. package/dist/{qti-simple-choice-e2bc67b1.d.ts → qti-simple-choice-5902cb37.d.ts} +45 -48
  31. package/dist/qti-test/index.cjs +79 -0
  32. package/dist/qti-test/index.d.cts +120 -0
  33. package/dist/qti-test/index.d.ts +120 -0
  34. package/dist/qti-test/index.js +79 -0
  35. package/dist/qti-transform/index.cjs +1 -1
  36. package/dist/qti-transform/index.d.cts +1 -0
  37. package/dist/qti-transform/index.d.ts +1 -0
  38. package/dist/qti-transform/index.js +1 -1
  39. package/package.json +36 -30
  40. package/dist/chunk-5GG2XAUT.js +0 -1
  41. package/dist/chunk-G7BJTOY4.cjs +0 -17
  42. package/dist/chunk-UE4QJK43.js +0 -17
@@ -1,9 +1,9 @@
1
- import { V as VariableDeclaration, B as BaseType, C as Cardinality, a as Choices, b as Interaction, c as QtiRule, Q as QtiAssessmentItem, R as ResponseVariable, d as QtiChoice } from '../qti-simple-choice-e2bc67b1.js';
2
- export { g as Calculate, I as InteractionChangedDetails, M as Multiple, j as Ordered, O as OutcomeChangedDetails, u as OutcomeVariable, s as QtiChoiceElementSelected, x as QtiChoiceInteraction, w as QtiExtendedTextInteraction, A as QtiHottext, k as QtiInteractionChanged, r as QtiInteractionResponse, p as QtiLooseChoice, z as QtiMapping, q as QtiOutcomeChanged, n as QtiRegisterChoice, o as QtiRegisterHotspot, m as QtiRegisterInteraction, l as QtiRegisterVariable, y as QtiResponseProcessing, D as QtiSimpleChoice, v as QtiTextEntryInteraction, f as ResponseInteraction, t as ResultVariable, e as directedPair, h as float, i as integer } from '../qti-simple-choice-e2bc67b1.js';
1
+ import { V as VariableDeclaration, B as BaseType, C as Cardinality, b as Choices, c as Interaction, d as QtiRule, Q as QtiAssessmentItem, R as ResponseVariable, e as QtiChoice, f as Calculate, a as ItemContext } from '../qti-simple-choice-5902cb37.js';
2
+ export { I as InteractionChangedDetails, M as Multiple, k as Ordered, O as OutcomeChangedDetails, u as OutcomeVariable, t as QtiChoiceElementSelected, x as QtiChoiceInteraction, w as QtiExtendedTextInteraction, A as QtiHottext, l as QtiInteractionChanged, s as QtiInteractionResponse, r as QtiLooseChoice, z as QtiMapping, q as QtiOutcomeChanged, o as QtiRegisterChoice, p as QtiRegisterHotspot, n as QtiRegisterInteraction, m as QtiRegisterVariable, y as QtiResponseProcessing, D as QtiSimpleChoice, v as QtiTextEntryInteraction, h as ResponseInteraction, g as directedPair, i as float, j as integer, E as itemContext } from '../qti-simple-choice-5902cb37.js';
3
3
  import * as lit from 'lit';
4
4
  import { LitElement, PropertyValueMap } from 'lit';
5
5
  import * as lit_html from 'lit-html';
6
- import { Audience } from '../context/index.cjs';
6
+ import { AudienceContext } from '../context/index.cjs';
7
7
  import { ContextConsumer } from '@lit-labs/context';
8
8
  import 'lit-html/directives/ref';
9
9
 
@@ -66,7 +66,7 @@ declare class qtiRubricBlock extends LitElement {
66
66
  handleclassNamesChange(old: any, disabled: boolean): void;
67
67
  static styles: lit.CSSResult;
68
68
  logger: ContextConsumer<{
69
- __context__: Audience;
69
+ __context__: AudienceContext;
70
70
  }, this>;
71
71
  render(): lit_html.TemplateResult<1>;
72
72
  connectedCallback(): void;
@@ -78,10 +78,9 @@ declare class qtiContentBody extends LitElement {
78
78
 
79
79
  declare abstract class QtiFeedback extends LitElement {
80
80
  protected showHide: string;
81
- protected outcomeIdentifier: string;
81
+ outcomeIdentifier: string;
82
82
  protected identifier: string;
83
83
  protected showStatus: string;
84
- constructor();
85
84
  connectedCallback(): void;
86
85
  checkShowFeedback(outcomeIdentifier: string): void;
87
86
  private showFeedback;
@@ -164,7 +163,7 @@ declare abstract class QtiExpression<T> extends LitElement {
164
163
  protected set error(val: string);
165
164
  static styles: lit.CSSResult;
166
165
  render(): lit_html.TemplateResult<1>;
167
- calculate(): T;
166
+ calculate(): Readonly<T>;
168
167
  protected get assessmentItem(): QtiAssessmentItem;
169
168
  protected getVariables: () => VariableDeclaration<number | string | (number | string)[] | null>[];
170
169
  }
@@ -259,7 +258,7 @@ declare class QtPrintedVariable extends LitElement {
259
258
  value: string | string[];
260
259
  render(): lit_html.TemplateResult<1>;
261
260
  constructor();
262
- calculate(): string | string[];
261
+ calculate(): Readonly<string | string[]>;
263
262
  }
264
263
 
265
264
  declare class QtiProduct extends QtiExpression<number> {
@@ -267,7 +266,7 @@ declare class QtiProduct extends QtiExpression<number> {
267
266
  }
268
267
 
269
268
  declare class QtiVariable extends QtiExpression<string | string[]> {
270
- calculate(): string | string[];
269
+ calculate(): Readonly<string | string[]>;
271
270
  }
272
271
 
273
272
  declare class QtiStringMatch extends QtiExpression<boolean> {
@@ -524,8 +523,11 @@ declare class QtiSliderInteraction extends Interaction {
524
523
  private getPositionFromEvent;
525
524
  }
526
525
 
527
- declare class QtiEndAttemptInteraction extends LitElement {
526
+ declare class QtiEndAttemptInteraction extends Interaction {
527
+ countAttempt: string;
528
528
  title: 'end attempt';
529
+ validate(): boolean;
530
+ set response(val: undefined);
529
531
  render(): lit_html.TemplateResult<1>;
530
532
  endAttempt(e: Event): void;
531
533
  }
@@ -560,4 +562,23 @@ declare class QtiHotspotChoice extends QtiChoice {
560
562
  declare class QtiInlineChoice extends LitElement {
561
563
  }
562
564
 
563
- export { BaseType, Cardinality, Events, Interaction, QtPrintedVariable, QtiAnd, QtiAssessmentItem, QtiAssociableHotspot, QtiAssociateInteraction, QtiBaseValue, QtiChoice, QtiCompanionMaterialsInfo, QtiConditionExpression, 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, QtiMember, QtiModalFeedback, QtiMultiple, QtiNot, QtiOr, QtiOrderInteraction, QtiOrdered, QtiOutcomeDeclaration, QtiPortableCustomInteraction, QtiPositionObjectStage, QtiProduct, QtiPrompt, QtiResponseCondition, QtiResponseDeclaration, QtiResponseElse, QtiResponseElseIf, QtiResponseIf, QtiRule, QtiSPositionObjectInteraction, QtiSelectPointInteraction, QtiSetOutcomeValue, QtiSimpleAssociableChoice, QtiSliderInteraction, QtiStringMatch, QtiStylesheet, QtiSum, QtiVariable, ResponseVariable, VariableDeclaration, qtiContentBody, qtiRubricBlock };
565
+ /**
566
+ * https://www.imsglobal.org/spec/qti/v3p0/impl#h.fi29q8dubjgw
567
+ * <qti-custom-operator class="js.org">
568
+ <qti-base-value base-type="string"><![CDATA[
569
+ console.log(context.variables);
570
+ return 'B'
571
+ document.querySelector('qti-end-attempt-interaction').disabled = true;
572
+ ]]></qti-base-value>
573
+ </qti-custom-operator>
574
+ </qti-set-outcome-value>
575
+ */
576
+ declare class QtiCustomOperator extends LitElement implements Calculate {
577
+ private operatorFunction;
578
+ context?: ItemContext;
579
+ render(): lit_html.TemplateResult<1>;
580
+ handleSlotChange(event: Event): void;
581
+ calculate(): any;
582
+ }
583
+
584
+ export { BaseType, Calculate, Cardinality, Events, Interaction, ItemContext, QtPrintedVariable, QtiAnd, QtiAssessmentItem, QtiAssociableHotspot, QtiAssociateInteraction, QtiBaseValue, QtiChoice, QtiCompanionMaterialsInfo, QtiConditionExpression, QtiContains, QtiCorrect, QtiCustomOperator, 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, QtiMember, QtiModalFeedback, QtiMultiple, QtiNot, QtiOr, QtiOrderInteraction, QtiOrdered, QtiOutcomeDeclaration, QtiPortableCustomInteraction, QtiPositionObjectStage, QtiProduct, QtiPrompt, QtiResponseCondition, QtiResponseDeclaration, QtiResponseElse, QtiResponseElseIf, QtiResponseIf, QtiRule, QtiSPositionObjectInteraction, QtiSelectPointInteraction, QtiSetOutcomeValue, QtiSimpleAssociableChoice, QtiSliderInteraction, QtiStringMatch, QtiStylesheet, QtiSum, QtiVariable, ResponseVariable, VariableDeclaration, qtiContentBody, qtiRubricBlock };
@@ -1,9 +1,9 @@
1
- import { V as VariableDeclaration, B as BaseType, C as Cardinality, a as Choices, b as Interaction, c as QtiRule, Q as QtiAssessmentItem, R as ResponseVariable, d as QtiChoice } from '../qti-simple-choice-e2bc67b1.js';
2
- export { g as Calculate, I as InteractionChangedDetails, M as Multiple, j as Ordered, O as OutcomeChangedDetails, u as OutcomeVariable, s as QtiChoiceElementSelected, x as QtiChoiceInteraction, w as QtiExtendedTextInteraction, A as QtiHottext, k as QtiInteractionChanged, r as QtiInteractionResponse, p as QtiLooseChoice, z as QtiMapping, q as QtiOutcomeChanged, n as QtiRegisterChoice, o as QtiRegisterHotspot, m as QtiRegisterInteraction, l as QtiRegisterVariable, y as QtiResponseProcessing, D as QtiSimpleChoice, v as QtiTextEntryInteraction, f as ResponseInteraction, t as ResultVariable, e as directedPair, h as float, i as integer } from '../qti-simple-choice-e2bc67b1.js';
1
+ import { V as VariableDeclaration, B as BaseType, C as Cardinality, b as Choices, c as Interaction, d as QtiRule, Q as QtiAssessmentItem, R as ResponseVariable, e as QtiChoice, f as Calculate, a as ItemContext } from '../qti-simple-choice-5902cb37.js';
2
+ export { I as InteractionChangedDetails, M as Multiple, k as Ordered, O as OutcomeChangedDetails, u as OutcomeVariable, t as QtiChoiceElementSelected, x as QtiChoiceInteraction, w as QtiExtendedTextInteraction, A as QtiHottext, l as QtiInteractionChanged, s as QtiInteractionResponse, r as QtiLooseChoice, z as QtiMapping, q as QtiOutcomeChanged, o as QtiRegisterChoice, p as QtiRegisterHotspot, n as QtiRegisterInteraction, m as QtiRegisterVariable, y as QtiResponseProcessing, D as QtiSimpleChoice, v as QtiTextEntryInteraction, h as ResponseInteraction, g as directedPair, i as float, j as integer, E as itemContext } from '../qti-simple-choice-5902cb37.js';
3
3
  import * as lit from 'lit';
4
4
  import { LitElement, PropertyValueMap } from 'lit';
5
5
  import * as lit_html from 'lit-html';
6
- import { Audience } from '../context/index.js';
6
+ import { AudienceContext } from '../context/index.js';
7
7
  import { ContextConsumer } from '@lit-labs/context';
8
8
  import 'lit-html/directives/ref';
9
9
 
@@ -66,7 +66,7 @@ declare class qtiRubricBlock extends LitElement {
66
66
  handleclassNamesChange(old: any, disabled: boolean): void;
67
67
  static styles: lit.CSSResult;
68
68
  logger: ContextConsumer<{
69
- __context__: Audience;
69
+ __context__: AudienceContext;
70
70
  }, this>;
71
71
  render(): lit_html.TemplateResult<1>;
72
72
  connectedCallback(): void;
@@ -78,10 +78,9 @@ declare class qtiContentBody extends LitElement {
78
78
 
79
79
  declare abstract class QtiFeedback extends LitElement {
80
80
  protected showHide: string;
81
- protected outcomeIdentifier: string;
81
+ outcomeIdentifier: string;
82
82
  protected identifier: string;
83
83
  protected showStatus: string;
84
- constructor();
85
84
  connectedCallback(): void;
86
85
  checkShowFeedback(outcomeIdentifier: string): void;
87
86
  private showFeedback;
@@ -164,7 +163,7 @@ declare abstract class QtiExpression<T> extends LitElement {
164
163
  protected set error(val: string);
165
164
  static styles: lit.CSSResult;
166
165
  render(): lit_html.TemplateResult<1>;
167
- calculate(): T;
166
+ calculate(): Readonly<T>;
168
167
  protected get assessmentItem(): QtiAssessmentItem;
169
168
  protected getVariables: () => VariableDeclaration<number | string | (number | string)[] | null>[];
170
169
  }
@@ -259,7 +258,7 @@ declare class QtPrintedVariable extends LitElement {
259
258
  value: string | string[];
260
259
  render(): lit_html.TemplateResult<1>;
261
260
  constructor();
262
- calculate(): string | string[];
261
+ calculate(): Readonly<string | string[]>;
263
262
  }
264
263
 
265
264
  declare class QtiProduct extends QtiExpression<number> {
@@ -267,7 +266,7 @@ declare class QtiProduct extends QtiExpression<number> {
267
266
  }
268
267
 
269
268
  declare class QtiVariable extends QtiExpression<string | string[]> {
270
- calculate(): string | string[];
269
+ calculate(): Readonly<string | string[]>;
271
270
  }
272
271
 
273
272
  declare class QtiStringMatch extends QtiExpression<boolean> {
@@ -524,8 +523,11 @@ declare class QtiSliderInteraction extends Interaction {
524
523
  private getPositionFromEvent;
525
524
  }
526
525
 
527
- declare class QtiEndAttemptInteraction extends LitElement {
526
+ declare class QtiEndAttemptInteraction extends Interaction {
527
+ countAttempt: string;
528
528
  title: 'end attempt';
529
+ validate(): boolean;
530
+ set response(val: undefined);
529
531
  render(): lit_html.TemplateResult<1>;
530
532
  endAttempt(e: Event): void;
531
533
  }
@@ -560,4 +562,23 @@ declare class QtiHotspotChoice extends QtiChoice {
560
562
  declare class QtiInlineChoice extends LitElement {
561
563
  }
562
564
 
563
- export { BaseType, Cardinality, Events, Interaction, QtPrintedVariable, QtiAnd, QtiAssessmentItem, QtiAssociableHotspot, QtiAssociateInteraction, QtiBaseValue, QtiChoice, QtiCompanionMaterialsInfo, QtiConditionExpression, 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, QtiMember, QtiModalFeedback, QtiMultiple, QtiNot, QtiOr, QtiOrderInteraction, QtiOrdered, QtiOutcomeDeclaration, QtiPortableCustomInteraction, QtiPositionObjectStage, QtiProduct, QtiPrompt, QtiResponseCondition, QtiResponseDeclaration, QtiResponseElse, QtiResponseElseIf, QtiResponseIf, QtiRule, QtiSPositionObjectInteraction, QtiSelectPointInteraction, QtiSetOutcomeValue, QtiSimpleAssociableChoice, QtiSliderInteraction, QtiStringMatch, QtiStylesheet, QtiSum, QtiVariable, ResponseVariable, VariableDeclaration, qtiContentBody, qtiRubricBlock };
565
+ /**
566
+ * https://www.imsglobal.org/spec/qti/v3p0/impl#h.fi29q8dubjgw
567
+ * <qti-custom-operator class="js.org">
568
+ <qti-base-value base-type="string"><![CDATA[
569
+ console.log(context.variables);
570
+ return 'B'
571
+ document.querySelector('qti-end-attempt-interaction').disabled = true;
572
+ ]]></qti-base-value>
573
+ </qti-custom-operator>
574
+ </qti-set-outcome-value>
575
+ */
576
+ declare class QtiCustomOperator extends LitElement implements Calculate {
577
+ private operatorFunction;
578
+ context?: ItemContext;
579
+ render(): lit_html.TemplateResult<1>;
580
+ handleSlotChange(event: Event): void;
581
+ calculate(): any;
582
+ }
583
+
584
+ export { BaseType, Calculate, Cardinality, Events, Interaction, ItemContext, QtPrintedVariable, QtiAnd, QtiAssessmentItem, QtiAssociableHotspot, QtiAssociateInteraction, QtiBaseValue, QtiChoice, QtiCompanionMaterialsInfo, QtiConditionExpression, QtiContains, QtiCorrect, QtiCustomOperator, 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, QtiMember, QtiModalFeedback, QtiMultiple, QtiNot, QtiOr, QtiOrderInteraction, QtiOrdered, QtiOutcomeDeclaration, QtiPortableCustomInteraction, QtiPositionObjectStage, QtiProduct, QtiPrompt, QtiResponseCondition, QtiResponseDeclaration, QtiResponseElse, QtiResponseElseIf, QtiResponseIf, QtiRule, QtiSPositionObjectInteraction, QtiSelectPointInteraction, QtiSetOutcomeValue, QtiSimpleAssociableChoice, QtiSliderInteraction, QtiStringMatch, QtiStylesheet, QtiSum, QtiVariable, ResponseVariable, VariableDeclaration, qtiContentBody, qtiRubricBlock };