@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.
- package/cdn/index.global.js +1 -1
- package/cdn/index.js +647 -815
- package/dist/base.d.ts +58 -1
- package/dist/base.js +7 -1
- package/dist/{chunk-NJQHUUTN.js → chunk-3IACYIU2.js} +2 -2
- package/dist/{chunk-TWPXES3S.js → chunk-4XR2JHCP.js} +6 -6
- package/dist/chunk-4XR2JHCP.js.map +1 -0
- package/dist/{chunk-7V4HJFHW.js → chunk-6ITD55QE.js} +2 -2
- package/dist/{chunk-ZII6M3SN.js → chunk-6V3A7NQP.js} +2 -2
- package/dist/{chunk-7AVWRQIS.js → chunk-6XJUP55A.js} +62 -76
- package/dist/{chunk-7AVWRQIS.js.map → chunk-6XJUP55A.js.map} +1 -1
- package/dist/{chunk-J5SQLKNP.js → chunk-CF3DXJWM.js} +6 -6
- package/dist/{chunk-HQESINXH.js → chunk-EKXZI26R.js} +84 -1
- package/dist/chunk-EKXZI26R.js.map +1 -0
- package/dist/{chunk-IJD53WY6.js → chunk-HDEG6BAZ.js} +15 -15
- package/dist/{chunk-IJD53WY6.js.map → chunk-HDEG6BAZ.js.map} +1 -1
- package/dist/{chunk-CK7AV2UJ.js → chunk-IXPDMYKH.js} +3 -3
- package/dist/chunk-IYC7LZV6.js +7 -0
- package/dist/chunk-IYC7LZV6.js.map +1 -0
- package/dist/{chunk-VAE6HBKR.js → chunk-MK2I3MQB.js} +86 -59
- package/dist/chunk-MK2I3MQB.js.map +1 -0
- package/dist/{chunk-BQFWCZFH.js → chunk-NZLW6EX7.js} +2 -2
- package/dist/{chunk-HBSWJC3B.js → chunk-Q52IJELT.js} +5 -5
- package/dist/{chunk-RSVRS5AK.js → chunk-TXIB3SKC.js} +4 -4
- package/dist/corrections.js +8 -8
- package/dist/elements.d.ts +0 -1
- package/dist/elements.js +4 -4
- package/dist/index.d.ts +2 -2
- package/dist/index.js +28 -14
- package/dist/interactions.js +3 -3
- package/dist/item.css +370 -532
- package/dist/item.js +5 -5
- package/dist/loader.js +2 -2
- package/dist/processing.d.ts +61 -11
- package/dist/processing.js +10 -2
- package/dist/qti-components-jsx.d.ts +756 -552
- package/dist/test.js +6 -6
- package/dist/transformers.d.ts +1 -1
- package/dist/transformers.js +1 -1
- package/package.json +8 -8
- package/dist/chunk-G6GFQDVN.js +0 -7
- package/dist/chunk-G6GFQDVN.js.map +0 -1
- package/dist/chunk-HQESINXH.js.map +0 -1
- package/dist/chunk-TWPXES3S.js.map +0 -1
- package/dist/chunk-VAE6HBKR.js.map +0 -1
- /package/dist/{chunk-NJQHUUTN.js.map → chunk-3IACYIU2.js.map} +0 -0
- /package/dist/{chunk-7V4HJFHW.js.map → chunk-6ITD55QE.js.map} +0 -0
- /package/dist/{chunk-ZII6M3SN.js.map → chunk-6V3A7NQP.js.map} +0 -0
- /package/dist/{chunk-J5SQLKNP.js.map → chunk-CF3DXJWM.js.map} +0 -0
- /package/dist/{chunk-CK7AV2UJ.js.map → chunk-IXPDMYKH.js.map} +0 -0
- /package/dist/{chunk-BQFWCZFH.js.map → chunk-NZLW6EX7.js.map} +0 -0
- /package/dist/{chunk-HBSWJC3B.js.map → chunk-Q52IJELT.js.map} +0 -0
- /package/dist/{chunk-RSVRS5AK.js.map → chunk-TXIB3SKC.js.map} +0 -0
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
convertNumberToUniversalFormat,
|
|
6
6
|
itemContext,
|
|
7
7
|
testContext
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-EKXZI26R.js";
|
|
9
9
|
|
|
10
10
|
// ../qti-processing/dist/components/qti-and/qti-and.js
|
|
11
11
|
var QtiAnd = class extends qtiAndMixin(QtiConditionExpression) {
|
|
@@ -1741,6 +1741,72 @@ var QtiOrdered = class extends QtiExpression {
|
|
|
1741
1741
|
}
|
|
1742
1742
|
};
|
|
1743
1743
|
|
|
1744
|
+
// ../qti-processing/dist/components/qti-condition/qti-condition-base.js
|
|
1745
|
+
import { LitElement as LitElement2, html as html3 } from "lit";
|
|
1746
|
+
var QtiConditionBranchBase = class extends LitElement2 {
|
|
1747
|
+
render() {
|
|
1748
|
+
return html3`<slot></slot>`;
|
|
1749
|
+
}
|
|
1750
|
+
process() {
|
|
1751
|
+
const subRules = this.getSubRules();
|
|
1752
|
+
for (let i = 0; i < subRules.length; i++) {
|
|
1753
|
+
const subRule = subRules[i];
|
|
1754
|
+
subRule.process();
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
};
|
|
1758
|
+
var QtiConditionElseBase = class extends QtiConditionBranchBase {
|
|
1759
|
+
shouldProcess() {
|
|
1760
|
+
return true;
|
|
1761
|
+
}
|
|
1762
|
+
getSubRules() {
|
|
1763
|
+
return [...this.children];
|
|
1764
|
+
}
|
|
1765
|
+
};
|
|
1766
|
+
var QtiConditionIfBase = class extends QtiConditionBranchBase {
|
|
1767
|
+
shouldProcess() {
|
|
1768
|
+
const expression = this.firstElementChild;
|
|
1769
|
+
return expression.calculate();
|
|
1770
|
+
}
|
|
1771
|
+
getSubRules() {
|
|
1772
|
+
const result = [];
|
|
1773
|
+
for (let i = 1; i < this.children.length; i++) {
|
|
1774
|
+
result.push(this.children[i]);
|
|
1775
|
+
}
|
|
1776
|
+
return result;
|
|
1777
|
+
}
|
|
1778
|
+
};
|
|
1779
|
+
var QtiConditionBase = class extends QtiRule {
|
|
1780
|
+
render() {
|
|
1781
|
+
return html3`<slot></slot>`;
|
|
1782
|
+
}
|
|
1783
|
+
process() {
|
|
1784
|
+
const branches = [...this.children];
|
|
1785
|
+
for (const branch of branches) {
|
|
1786
|
+
if (branch.shouldProcess()) {
|
|
1787
|
+
branch.process();
|
|
1788
|
+
return;
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
1792
|
+
};
|
|
1793
|
+
|
|
1794
|
+
// ../qti-processing/dist/components/qti-outcome-condition/qti-outcome-condition.js
|
|
1795
|
+
var QtiOutcomeCondition = class extends QtiConditionBase {
|
|
1796
|
+
};
|
|
1797
|
+
|
|
1798
|
+
// ../qti-processing/dist/components/qti-outcome-if/qti-outcome-if.js
|
|
1799
|
+
var QtiOutcomeIf = class extends QtiConditionIfBase {
|
|
1800
|
+
};
|
|
1801
|
+
|
|
1802
|
+
// ../qti-processing/dist/components/qti-outcome-else-if/qti-outcome-else-if.js
|
|
1803
|
+
var QtiOutcomeElseIf = class extends QtiOutcomeIf {
|
|
1804
|
+
};
|
|
1805
|
+
|
|
1806
|
+
// ../qti-processing/dist/components/qti-outcome-else/qti-outcome-else.js
|
|
1807
|
+
var QtiOutcomeElse = class extends QtiConditionElseBase {
|
|
1808
|
+
};
|
|
1809
|
+
|
|
1744
1810
|
// ../qti-processing/dist/components/qti-pattern-match/qti-pattern-match.js
|
|
1745
1811
|
import { property as property12 } from "lit/decorators.js";
|
|
1746
1812
|
var __decorate12 = function(decorators, target, key, desc) {
|
|
@@ -1857,7 +1923,7 @@ var QtiPower = class extends QtiExpression {
|
|
|
1857
1923
|
|
|
1858
1924
|
// ../qti-processing/dist/components/qti-printed-variable/qti-printed-variable.js
|
|
1859
1925
|
import { consume as consume3 } from "@lit/context";
|
|
1860
|
-
import { LitElement as
|
|
1926
|
+
import { LitElement as LitElement3, html as html4, nothing } from "lit";
|
|
1861
1927
|
import { property as property13, state as state3 } from "lit/decorators.js";
|
|
1862
1928
|
var __decorate13 = function(decorators, target, key, desc) {
|
|
1863
1929
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -1865,10 +1931,10 @@ var __decorate13 = function(decorators, target, key, desc) {
|
|
|
1865
1931
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1866
1932
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1867
1933
|
};
|
|
1868
|
-
var QtiPrintedVariable = class extends
|
|
1934
|
+
var QtiPrintedVariable = class extends LitElement3 {
|
|
1869
1935
|
render() {
|
|
1870
1936
|
const value = this.context?.variables.find((v) => v.identifier === this.identifier)?.value;
|
|
1871
|
-
return value === null ? nothing :
|
|
1937
|
+
return value === null ? nothing : html4`${JSON.stringify(value, null, 2)}`;
|
|
1872
1938
|
}
|
|
1873
1939
|
calculate() {
|
|
1874
1940
|
const result = this.context.variables.find((v) => v.identifier === this.identifier) || null;
|
|
@@ -2100,66 +2166,19 @@ __decorate15([
|
|
|
2100
2166
|
], QtiRepeat.prototype, "numberRepeats", void 0);
|
|
2101
2167
|
|
|
2102
2168
|
// ../qti-processing/dist/components/qti-response-condition/qti-response-condition.js
|
|
2103
|
-
|
|
2104
|
-
var QtiResponseCondition = class extends QtiRule {
|
|
2105
|
-
render() {
|
|
2106
|
-
return html4`<slot></slot>`;
|
|
2107
|
-
}
|
|
2108
|
-
process() {
|
|
2109
|
-
const branches = [...this.children];
|
|
2110
|
-
for (let i = 0; i < branches.length; i++) {
|
|
2111
|
-
const branch = branches[i];
|
|
2112
|
-
if (branch.calculate()) {
|
|
2113
|
-
branch.process();
|
|
2114
|
-
return;
|
|
2115
|
-
}
|
|
2116
|
-
}
|
|
2117
|
-
}
|
|
2118
|
-
};
|
|
2119
|
-
|
|
2120
|
-
// ../qti-processing/dist/components/qti-response-else/qti-response-else.js
|
|
2121
|
-
import { LitElement as LitElement3, html as html5 } from "lit";
|
|
2122
|
-
var QtiResponseElse = class extends LitElement3 {
|
|
2123
|
-
render() {
|
|
2124
|
-
return html5`<slot></slot>`;
|
|
2125
|
-
}
|
|
2126
|
-
calculate() {
|
|
2127
|
-
return true;
|
|
2128
|
-
}
|
|
2129
|
-
getSubRules() {
|
|
2130
|
-
return [...this.children];
|
|
2131
|
-
}
|
|
2132
|
-
process() {
|
|
2133
|
-
const subRules = this.getSubRules();
|
|
2134
|
-
for (let i = 0; i < subRules.length; i++) {
|
|
2135
|
-
const subRule = subRules[i];
|
|
2136
|
-
subRule.process();
|
|
2137
|
-
}
|
|
2138
|
-
}
|
|
2169
|
+
var QtiResponseCondition = class extends QtiConditionBase {
|
|
2139
2170
|
};
|
|
2140
2171
|
|
|
2141
2172
|
// ../qti-processing/dist/components/qti-response-if/qti-response-if.js
|
|
2142
|
-
var QtiResponseIf = class extends
|
|
2143
|
-
calculate() {
|
|
2144
|
-
const expression = this.firstElementChild;
|
|
2145
|
-
const result = expression.calculate();
|
|
2146
|
-
return result;
|
|
2147
|
-
}
|
|
2148
|
-
getSubRules() {
|
|
2149
|
-
const result = [];
|
|
2150
|
-
for (let i = 1; i < this.children.length; i++) {
|
|
2151
|
-
result.push(this.children[i]);
|
|
2152
|
-
}
|
|
2153
|
-
return result;
|
|
2154
|
-
}
|
|
2173
|
+
var QtiResponseIf = class extends QtiConditionIfBase {
|
|
2155
2174
|
};
|
|
2156
2175
|
|
|
2157
2176
|
// ../qti-processing/dist/components/qti-response-else-if/qti-response-else-if.js
|
|
2158
|
-
import { html as html6 } from "lit";
|
|
2159
2177
|
var QtiResponseElseIf = class extends QtiResponseIf {
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2178
|
+
};
|
|
2179
|
+
|
|
2180
|
+
// ../qti-processing/dist/components/qti-response-else/qti-response-else.js
|
|
2181
|
+
var QtiResponseElse = class extends QtiConditionElseBase {
|
|
2163
2182
|
};
|
|
2164
2183
|
|
|
2165
2184
|
// ../qti-processing/dist/components/qti-round-to/qti-round-to.js
|
|
@@ -2778,6 +2797,10 @@ var qtiProcessingElements = [
|
|
|
2778
2797
|
{ tag: "qti-null", ctor: QtiNull },
|
|
2779
2798
|
{ tag: "qti-or", ctor: QtiOr },
|
|
2780
2799
|
{ tag: "qti-ordered", ctor: QtiOrdered },
|
|
2800
|
+
{ tag: "qti-outcome-condition", ctor: QtiOutcomeCondition },
|
|
2801
|
+
{ tag: "qti-outcome-else", ctor: QtiOutcomeElse },
|
|
2802
|
+
{ tag: "qti-outcome-else-if", ctor: QtiOutcomeElseIf },
|
|
2803
|
+
{ tag: "qti-outcome-if", ctor: QtiOutcomeIf },
|
|
2781
2804
|
{ tag: "qti-pattern-match", ctor: QtiPatternMatch },
|
|
2782
2805
|
{ tag: "qti-power", ctor: QtiPower },
|
|
2783
2806
|
{ tag: "qti-printed-variable", ctor: QtiPrintedVariable },
|
|
@@ -2852,6 +2875,10 @@ export {
|
|
|
2852
2875
|
QtiNull,
|
|
2853
2876
|
QtiOr,
|
|
2854
2877
|
QtiOrdered,
|
|
2878
|
+
QtiOutcomeCondition,
|
|
2879
|
+
QtiOutcomeIf,
|
|
2880
|
+
QtiOutcomeElseIf,
|
|
2881
|
+
QtiOutcomeElse,
|
|
2855
2882
|
QtiPatternMatch,
|
|
2856
2883
|
QtiPower,
|
|
2857
2884
|
QtiPrintedVariable,
|
|
@@ -2860,9 +2887,9 @@ export {
|
|
|
2860
2887
|
QtiRandom,
|
|
2861
2888
|
QtiRepeat,
|
|
2862
2889
|
QtiResponseCondition,
|
|
2863
|
-
QtiResponseElse,
|
|
2864
2890
|
QtiResponseIf,
|
|
2865
2891
|
QtiResponseElseIf,
|
|
2892
|
+
QtiResponseElse,
|
|
2866
2893
|
QtiRoundTo,
|
|
2867
2894
|
QtiRound,
|
|
2868
2895
|
QtiSetCorrectResponse,
|
|
@@ -2881,4 +2908,4 @@ export {
|
|
|
2881
2908
|
QtiTruncate,
|
|
2882
2909
|
QtiVariable
|
|
2883
2910
|
};
|
|
2884
|
-
//# sourceMappingURL=chunk-
|
|
2911
|
+
//# sourceMappingURL=chunk-MK2I3MQB.js.map
|