@citolab/qti-components 8.0.2 → 8.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 (53) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +647 -815
  3. package/dist/base.d.ts +58 -1
  4. package/dist/base.js +7 -1
  5. package/dist/{chunk-NJQHUUTN.js → chunk-3IACYIU2.js} +2 -2
  6. package/dist/{chunk-TWPXES3S.js → chunk-4XR2JHCP.js} +6 -6
  7. package/dist/chunk-4XR2JHCP.js.map +1 -0
  8. package/dist/{chunk-7V4HJFHW.js → chunk-6ITD55QE.js} +2 -2
  9. package/dist/{chunk-ZII6M3SN.js → chunk-6V3A7NQP.js} +2 -2
  10. package/dist/{chunk-7AVWRQIS.js → chunk-6XJUP55A.js} +62 -76
  11. package/dist/{chunk-7AVWRQIS.js.map → chunk-6XJUP55A.js.map} +1 -1
  12. package/dist/{chunk-J5SQLKNP.js → chunk-CF3DXJWM.js} +6 -6
  13. package/dist/{chunk-HQESINXH.js → chunk-EKXZI26R.js} +84 -1
  14. package/dist/chunk-EKXZI26R.js.map +1 -0
  15. package/dist/{chunk-IJD53WY6.js → chunk-HDEG6BAZ.js} +15 -15
  16. package/dist/{chunk-IJD53WY6.js.map → chunk-HDEG6BAZ.js.map} +1 -1
  17. package/dist/{chunk-CK7AV2UJ.js → chunk-IXPDMYKH.js} +3 -3
  18. package/dist/chunk-IYC7LZV6.js +7 -0
  19. package/dist/chunk-IYC7LZV6.js.map +1 -0
  20. package/dist/{chunk-VAE6HBKR.js → chunk-MK2I3MQB.js} +86 -59
  21. package/dist/chunk-MK2I3MQB.js.map +1 -0
  22. package/dist/{chunk-BQFWCZFH.js → chunk-NZLW6EX7.js} +2 -2
  23. package/dist/{chunk-HBSWJC3B.js → chunk-Q52IJELT.js} +5 -5
  24. package/dist/{chunk-RSVRS5AK.js → chunk-TXIB3SKC.js} +4 -4
  25. package/dist/corrections.js +8 -8
  26. package/dist/elements.d.ts +0 -1
  27. package/dist/elements.js +4 -4
  28. package/dist/index.d.ts +2 -2
  29. package/dist/index.js +28 -14
  30. package/dist/interactions.js +3 -3
  31. package/dist/item.css +370 -532
  32. package/dist/item.js +5 -5
  33. package/dist/loader.js +2 -2
  34. package/dist/processing.d.ts +61 -11
  35. package/dist/processing.js +10 -2
  36. package/dist/qti-components-jsx.d.ts +756 -552
  37. package/dist/test.js +6 -6
  38. package/dist/transformers.d.ts +1 -1
  39. package/dist/transformers.js +1 -1
  40. package/package.json +8 -8
  41. package/dist/chunk-G6GFQDVN.js +0 -7
  42. package/dist/chunk-G6GFQDVN.js.map +0 -1
  43. package/dist/chunk-HQESINXH.js.map +0 -1
  44. package/dist/chunk-TWPXES3S.js.map +0 -1
  45. package/dist/chunk-VAE6HBKR.js.map +0 -1
  46. /package/dist/{chunk-NJQHUUTN.js.map → chunk-3IACYIU2.js.map} +0 -0
  47. /package/dist/{chunk-7V4HJFHW.js.map → chunk-6ITD55QE.js.map} +0 -0
  48. /package/dist/{chunk-ZII6M3SN.js.map → chunk-6V3A7NQP.js.map} +0 -0
  49. /package/dist/{chunk-J5SQLKNP.js.map → chunk-CF3DXJWM.js.map} +0 -0
  50. /package/dist/{chunk-CK7AV2UJ.js.map → chunk-IXPDMYKH.js.map} +0 -0
  51. /package/dist/{chunk-BQFWCZFH.js.map → chunk-NZLW6EX7.js.map} +0 -0
  52. /package/dist/{chunk-HBSWJC3B.js.map → chunk-Q52IJELT.js.map} +0 -0
  53. /package/dist/{chunk-RSVRS5AK.js.map → chunk-TXIB3SKC.js.map} +0 -0
package/dist/item.js CHANGED
@@ -1,13 +1,13 @@
1
- import "./chunk-ZII6M3SN.js";
1
+ import "./chunk-6V3A7NQP.js";
2
2
  import {
3
3
  ItemContainer,
4
4
  ItemPrintVariables,
5
5
  QtiItem
6
- } from "./chunk-RSVRS5AK.js";
7
- import "./chunk-G6GFQDVN.js";
6
+ } from "./chunk-TXIB3SKC.js";
7
+ import "./chunk-IYC7LZV6.js";
8
8
  import "./chunk-4DB4SC5K.js";
9
- import "./chunk-IJD53WY6.js";
10
- import "./chunk-HQESINXH.js";
9
+ import "./chunk-HDEG6BAZ.js";
10
+ import "./chunk-EKXZI26R.js";
11
11
  export {
12
12
  ItemContainer,
13
13
  ItemPrintVariables,
package/dist/loader.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  getItemByUri,
3
3
  getManifestInfo
4
- } from "./chunk-7V4HJFHW.js";
5
- import "./chunk-IJD53WY6.js";
4
+ } from "./chunk-6ITD55QE.js";
5
+ import "./chunk-HDEG6BAZ.js";
6
6
  export {
7
7
  getItemByUri,
8
8
  getManifestInfo
@@ -33,11 +33,56 @@ declare global {
33
33
  }
34
34
  }
35
35
 
36
- declare class QtiResponseCondition extends QtiRule {
36
+ /**
37
+ * Shared logic for the QTI `responseCondition` / `outcomeCondition` family.
38
+ *
39
+ * Both conditions are structurally identical: a container that walks its
40
+ * branches (if / else-if / else) in order and processes the sub-rules of the
41
+ * first branch whose `shouldProcess()` returns true. The only difference
42
+ * between response- and outcome- variants is the custom element tag name, so
43
+ * the behaviour lives here and the concrete classes are empty subclasses that
44
+ * `elements.ts` maps onto their tags.
45
+ */
46
+ /**
47
+ * A single branch of a condition (if / else-if / else). It owns the sub-rule
48
+ * processing; subclasses decide whether the branch applies (`shouldProcess`)
49
+ * and which of its children are sub-rules (`getSubRules`).
50
+ */
51
+ declare abstract class QtiConditionBranchBase extends LitElement {
52
+ render(): lit.TemplateResult<1>;
53
+ /** Whether this branch's sub-rules should be processed. */
54
+ abstract shouldProcess(): boolean;
55
+ /** The sub-rules to process when this branch applies. */
56
+ abstract getSubRules(): QtiRule[];
57
+ process(): void;
58
+ }
59
+ /**
60
+ * The `else` branch: no condition (always applies), every child is a sub-rule.
61
+ */
62
+ declare abstract class QtiConditionElseBase extends QtiConditionBranchBase {
63
+ shouldProcess(): boolean;
64
+ getSubRules(): QtiRule[];
65
+ }
66
+ /**
67
+ * The `if` / `else-if` branch: first child is the boolean expression, the
68
+ * remaining children are the sub-rules processed when it evaluates to true.
69
+ */
70
+ declare abstract class QtiConditionIfBase extends QtiConditionBranchBase {
71
+ shouldProcess(): Readonly<boolean>;
72
+ getSubRules(): QtiRule[];
73
+ }
74
+ /**
75
+ * The condition container: walk branches in order, process the first whose
76
+ * `shouldProcess()` is true, then stop.
77
+ */
78
+ declare abstract class QtiConditionBase extends QtiRule {
37
79
  render(): lit.TemplateResult<1>;
38
80
  process(): void;
39
81
  }
40
82
 
83
+ declare class QtiResponseCondition extends QtiConditionBase {
84
+ }
85
+
41
86
  /**
42
87
  * Web component that processes `setOutcomeValue` in QTI.
43
88
  */
@@ -60,20 +105,25 @@ declare class QtiSetOutcomeValueRule<T> implements QtiRuleBase {
60
105
  process(): string | string[] | null;
61
106
  }
62
107
 
63
- declare class QtiResponseElse extends LitElement {
64
- render(): lit.TemplateResult<1>;
65
- calculate(): boolean;
66
- getSubRules(): QtiRule[];
67
- process(): void;
108
+ declare class QtiResponseElse extends QtiConditionElseBase {
68
109
  }
69
110
 
70
- declare class QtiResponseIf extends QtiResponseElse {
71
- calculate(): boolean;
72
- getSubRules(): QtiRule[];
111
+ declare class QtiResponseIf extends QtiConditionIfBase {
73
112
  }
74
113
 
75
114
  declare class QtiResponseElseIf extends QtiResponseIf {
76
- render(): lit.TemplateResult<1>;
115
+ }
116
+
117
+ declare class QtiOutcomeCondition extends QtiConditionBase {
118
+ }
119
+
120
+ declare class QtiOutcomeElse extends QtiConditionElseBase {
121
+ }
122
+
123
+ declare class QtiOutcomeIf extends QtiConditionIfBase {
124
+ }
125
+
126
+ declare class QtiOutcomeElseIf extends QtiOutcomeIf {
77
127
  }
78
128
 
79
129
  type Constructor$1<T> = new (...args: any[]) => T;
@@ -727,4 +777,4 @@ declare class QtiIndex extends QtiExpression<any> {
727
777
  getResult(): any;
728
778
  }
729
779
 
730
- export { QtiAnd, QtiAnyN, QtiBaseValue, QtiContainerSize, QtiContains, QtiCorrect, QtiDefault, QtiDelete, QtiDivide, QtiDurationGte, QtiDurationLt, QtiEqual, QtiEqualRounded, QtiFieldValue, QtiGcd, QtiGt, QtiGte, QtiIndex, QtiInside, QtiIntegerDivide, QtiIntegerModulus, QtiIntegerToFloat, QtiIsNull, QtiLcm, QtiLookupOutcomeValue, QtiLt, QtiLte, QtiMapResponse, QtiMapResponsePoint, QtiMatch, QtiMathOperator, QtiMax, QtiMember, QtiMin, QtiMultiple, QtiNot, QtiNull, QtiOr, QtiOrdered, QtiPatternMatch, QtiPower, QtiPrintedVariable, QtiProduct, QtiRandom, QtiRandomInteger, QtiRepeat, QtiResponseCondition, QtiResponseElse, QtiResponseElseIf, QtiResponseIf, QtiRound, QtiRoundTo, QtiSetCorrectResponse, QtiSetCorrectResponseRule, QtiSetOutcomeValue, QtiSetOutcomeValueRule, QtiSetTemplateValue, QtiSetTemplateValueRule, QtiStatsOperator, QtiStringMatch, QtiSubstring, QtiSubtract, QtiSum, QtiSumExpression, QtiTruncate, QtiVariable, qtiAndMixin, qtiSubtractMixin };
780
+ export { QtiAnd, QtiAnyN, QtiBaseValue, QtiContainerSize, QtiContains, QtiCorrect, QtiDefault, QtiDelete, QtiDivide, QtiDurationGte, QtiDurationLt, QtiEqual, QtiEqualRounded, QtiFieldValue, QtiGcd, QtiGt, QtiGte, QtiIndex, QtiInside, QtiIntegerDivide, QtiIntegerModulus, QtiIntegerToFloat, QtiIsNull, QtiLcm, QtiLookupOutcomeValue, QtiLt, QtiLte, QtiMapResponse, QtiMapResponsePoint, QtiMatch, QtiMathOperator, QtiMax, QtiMember, QtiMin, QtiMultiple, QtiNot, QtiNull, QtiOr, QtiOrdered, QtiOutcomeCondition, QtiOutcomeElse, QtiOutcomeElseIf, QtiOutcomeIf, QtiPatternMatch, QtiPower, QtiPrintedVariable, QtiProduct, QtiRandom, QtiRandomInteger, QtiRepeat, QtiResponseCondition, QtiResponseElse, QtiResponseElseIf, QtiResponseIf, QtiRound, QtiRoundTo, QtiSetCorrectResponse, QtiSetCorrectResponseRule, QtiSetOutcomeValue, QtiSetOutcomeValueRule, QtiSetTemplateValue, QtiSetTemplateValueRule, QtiStatsOperator, QtiStringMatch, QtiSubstring, QtiSubtract, QtiSum, QtiSumExpression, QtiTruncate, QtiVariable, qtiAndMixin, qtiSubtractMixin };
@@ -38,6 +38,10 @@ import {
38
38
  QtiNull,
39
39
  QtiOr,
40
40
  QtiOrdered,
41
+ QtiOutcomeCondition,
42
+ QtiOutcomeElse,
43
+ QtiOutcomeElseIf,
44
+ QtiOutcomeIf,
41
45
  QtiPatternMatch,
42
46
  QtiPower,
43
47
  QtiPrintedVariable,
@@ -67,8 +71,8 @@ import {
67
71
  QtiVariable,
68
72
  qtiAndMixin,
69
73
  qtiSubtractMixin
70
- } from "./chunk-VAE6HBKR.js";
71
- import "./chunk-HQESINXH.js";
74
+ } from "./chunk-MK2I3MQB.js";
75
+ import "./chunk-EKXZI26R.js";
72
76
  export {
73
77
  QtiAnd,
74
78
  QtiAnyN,
@@ -109,6 +113,10 @@ export {
109
113
  QtiNull,
110
114
  QtiOr,
111
115
  QtiOrdered,
116
+ QtiOutcomeCondition,
117
+ QtiOutcomeElse,
118
+ QtiOutcomeElseIf,
119
+ QtiOutcomeIf,
112
120
  QtiPatternMatch,
113
121
  QtiPower,
114
122
  QtiPrintedVariable,