@citolab/qti-components 7.28.1 → 8.0.1
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 +6316 -2710
- package/dist/base.d.ts +100 -15
- package/dist/base.js +27 -6
- package/dist/chunk-3AJOQCDU.js +11 -0
- package/dist/chunk-3AJOQCDU.js.map +1 -0
- package/dist/chunk-64XSIBGO.js +241 -0
- package/dist/chunk-64XSIBGO.js.map +1 -0
- package/dist/chunk-7HC5SMCU.js +102 -0
- package/dist/chunk-7HC5SMCU.js.map +1 -0
- package/dist/{chunk-SP6S2WMG.js → chunk-7V4HJFHW.js} +3 -3
- package/dist/{chunk-SP6S2WMG.js.map → chunk-7V4HJFHW.js.map} +1 -1
- package/dist/chunk-CAO4JRLY.js +11 -0
- package/dist/chunk-CAO4JRLY.js.map +1 -0
- package/dist/{chunk-MPC7LIPC.js → chunk-F4BNJWYN.js} +4264 -3647
- package/dist/chunk-F4BNJWYN.js.map +1 -0
- package/dist/{chunk-3XV26R5M.js → chunk-H3J7LFRO.js} +829 -1005
- package/dist/chunk-H3J7LFRO.js.map +1 -0
- package/dist/{chunk-3WBG257S.js → chunk-IJD53WY6.js} +96 -74
- package/dist/chunk-IJD53WY6.js.map +1 -0
- package/dist/chunk-LVBIQDPM.js +1374 -0
- package/dist/chunk-LVBIQDPM.js.map +1 -0
- package/dist/{chunk-REI3AMCZ.js → chunk-NA2N2WSG.js} +1303 -1193
- package/dist/chunk-NA2N2WSG.js.map +1 -0
- package/dist/chunk-QECOPVPO.js +294 -0
- package/dist/chunk-QECOPVPO.js.map +1 -0
- package/dist/{chunk-HFCZFWSH.js → chunk-RXGDQDOV.js} +1993 -1764
- package/dist/chunk-RXGDQDOV.js.map +1 -0
- package/dist/chunk-V5G7X53Y.js +11 -0
- package/dist/chunk-V5G7X53Y.js.map +1 -0
- package/dist/{chunk-WDO2TRFM.js → chunk-WVVMNF74.js} +851 -925
- package/dist/chunk-WVVMNF74.js.map +1 -0
- package/dist/{chunk-FLJAKWXL.js → chunk-X3E5HXG2.js} +2 -2
- package/dist/chunk-XU7HNT4F.js +1608 -0
- package/dist/chunk-XU7HNT4F.js.map +1 -0
- package/dist/{computed-item.context-DfsW_96S.d.ts → computed-item.types.d-BKZdSLLJ.d.ts} +2 -5
- package/dist/{computed.context-DHbxad0N.d.ts → computed.types.d-rKLSPvVG.d.ts} +2 -5
- package/dist/config.context.d-BvU9r-Mg.d.ts +91 -0
- package/dist/corrections.d.ts +432 -0
- package/dist/corrections.js +84 -0
- package/dist/elements.d.ts +8 -14
- package/dist/elements.js +6 -5
- package/dist/index.d.ts +51 -16
- package/dist/index.js +193 -76
- package/dist/interaction.d-D4MstYRz.d.ts +115 -0
- package/dist/interaction.interface.d-CvjHM2bi.d.ts +46 -0
- package/dist/interactions.d.ts +1206 -552
- package/dist/interactions.js +19 -15
- package/dist/item.css +4228 -1656
- package/dist/item.d.ts +13 -55
- package/dist/item.js +6 -11
- package/dist/{variables-CMYcDbyW.d.ts → item.types.d-QU7LljEK.d.ts} +13 -1
- package/dist/loader.d.ts +4 -4
- package/dist/loader.js +2 -3
- package/dist/processing.d.ts +6 -7
- package/dist/processing.js +2 -3
- package/dist/qti-components-jsx.d.ts +5348 -2709
- package/dist/qti-components-jsx.js +1 -0
- package/dist/qti-condition-expression.d-aMvBvpc6.d.ts +8 -0
- package/dist/{qti-condition-expression-Dam-RER6.d.ts → qti-expression.d-BietT_8b.d.ts} +14 -9
- package/dist/{qti-feedback-ChmXhZuf.d.ts → qti-feedback.d-DZbad0RN.d.ts} +1 -1
- package/dist/{qti-transform-test-DoZaWItm.d.ts → qti-transform-test.d-BL7GGFJj.d.ts} +2 -2
- package/dist/response.d-_8y4kjGP.d.ts +106 -0
- package/dist/test.d.ts +199 -39
- package/dist/test.js +34 -11
- package/dist/transformers.d.ts +1 -1
- package/dist/transformers.js +1 -2
- package/package.json +24 -17
- package/custom-elements.json +0 -43251
- package/dist/chunk-3WBG257S.js.map +0 -1
- package/dist/chunk-3XV26R5M.js.map +0 -1
- package/dist/chunk-AQ5RJFM6.js +0 -3673
- package/dist/chunk-AQ5RJFM6.js.map +0 -1
- package/dist/chunk-HFCZFWSH.js.map +0 -1
- package/dist/chunk-MPC7LIPC.js.map +0 -1
- package/dist/chunk-QXBXORM3.js +0 -27
- package/dist/chunk-REI3AMCZ.js.map +0 -1
- package/dist/chunk-RLTYVS2I.js +0 -530
- package/dist/chunk-RLTYVS2I.js.map +0 -1
- package/dist/chunk-WDO2TRFM.js.map +0 -1
- package/dist/config.context-BjZ2bZSY.d.ts +0 -42
- package/dist/interaction-Bgzlw7Iu.d.ts +0 -110
- package/dist/item.context-CkUeDcaO.d.ts +0 -15
- package/dist/test.context-CByZZjkR.d.ts +0 -15
- /package/dist/{chunk-FLJAKWXL.js.map → chunk-X3E5HXG2.js.map} +0 -0
- /package/dist/{chunk-QXBXORM3.js.map → corrections.js.map} +0 -0
- /package/dist/{qti-rule-base-ajOnfGXY.d.ts → qti-rule-base.d-ajOnfGXY.d.ts} +0 -0
- /package/dist/{qti.context-CejJMlfZ.d.ts → qti.context.d-CejJMlfZ.d.ts} +0 -0
|
@@ -8,198 +8,17 @@ import {
|
|
|
8
8
|
convertNumberToUniversalFormat,
|
|
9
9
|
i2 as i,
|
|
10
10
|
itemContext,
|
|
11
|
-
n,
|
|
11
|
+
n2 as n,
|
|
12
12
|
r,
|
|
13
|
-
t,
|
|
14
13
|
testContext
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import {
|
|
17
|
-
__decorateClass,
|
|
18
|
-
__privateAdd,
|
|
19
|
-
__privateMethod
|
|
20
|
-
} from "./chunk-QXBXORM3.js";
|
|
21
|
-
|
|
22
|
-
// ../qti-processing/src/components/qti-rule/qti-rule.ts
|
|
23
|
-
var QtiRule = class extends i {
|
|
24
|
-
render() {
|
|
25
|
-
return T`<slot></slot>`;
|
|
26
|
-
}
|
|
27
|
-
process() {
|
|
28
|
-
throw new Error("Not implemented");
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
QtiRule = __decorateClass([
|
|
32
|
-
t("qti-rule")
|
|
33
|
-
], QtiRule);
|
|
34
|
-
|
|
35
|
-
// ../qti-processing/src/components/qti-lookup-outcome-value/qti-lookup-outcome-value.ts
|
|
36
|
-
var QtiLookupOutcomeValue = class extends QtiRule {
|
|
37
|
-
get childExpression() {
|
|
38
|
-
return this.firstElementChild;
|
|
39
|
-
}
|
|
40
|
-
process() {
|
|
41
|
-
const identifier = this.getAttribute("identifier");
|
|
42
|
-
const outcomeVariable = this.context.variables.find((v) => v.identifier === identifier) || null;
|
|
43
|
-
let value;
|
|
44
|
-
if (outcomeVariable.interpolationTable) {
|
|
45
|
-
value = outcomeVariable.interpolationTable.get(parseFloat(this.childExpression.calculate()));
|
|
46
|
-
}
|
|
47
|
-
if (value === null || value === void 0) {
|
|
48
|
-
console.warn("lookupOutcomeValue: value is null or undefined");
|
|
49
|
-
return 0;
|
|
50
|
-
}
|
|
51
|
-
this.dispatchEvent(
|
|
52
|
-
new CustomEvent("qti-set-outcome-value", {
|
|
53
|
-
bubbles: true,
|
|
54
|
-
composed: true,
|
|
55
|
-
detail: {
|
|
56
|
-
outcomeIdentifier: this.identifier,
|
|
57
|
-
value: convertNumberToUniversalFormat(value)
|
|
58
|
-
}
|
|
59
|
-
})
|
|
60
|
-
);
|
|
61
|
-
return value;
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
__decorateClass([
|
|
65
|
-
n({ type: String })
|
|
66
|
-
], QtiLookupOutcomeValue.prototype, "identifier", 2);
|
|
67
|
-
__decorateClass([
|
|
68
|
-
c({ context: itemContext, subscribe: true }),
|
|
69
|
-
r()
|
|
70
|
-
], QtiLookupOutcomeValue.prototype, "context", 2);
|
|
71
|
-
customElements.define("qti-lookup-outcome-value", QtiLookupOutcomeValue);
|
|
72
|
-
|
|
73
|
-
// ../qti-processing/src/components/qti-response-condition/qti-response-condition.ts
|
|
74
|
-
var QtiResponseCondition = class extends QtiRule {
|
|
75
|
-
render() {
|
|
76
|
-
return T`<slot></slot>`;
|
|
77
|
-
}
|
|
78
|
-
process() {
|
|
79
|
-
const branches = [...this.children];
|
|
80
|
-
for (let i2 = 0; i2 < branches.length; i2++) {
|
|
81
|
-
const branch = branches[i2];
|
|
82
|
-
if (branch.calculate()) {
|
|
83
|
-
branch.process();
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
customElements.define("qti-response-condition", QtiResponseCondition);
|
|
90
|
-
|
|
91
|
-
// ../qti-processing/src/components/qti-set-outcome-value/qti-set-outcome-value.ts
|
|
92
|
-
var QtiSetOutcomeValue = class extends QtiRule {
|
|
93
|
-
/**
|
|
94
|
-
* Processes the QTI rule and dispatches a custom event with the computed outcome value.
|
|
95
|
-
*/
|
|
96
|
-
process() {
|
|
97
|
-
const outcomeIdentifier = this.getAttribute("identifier");
|
|
98
|
-
if (!outcomeIdentifier) {
|
|
99
|
-
console.warn('QtiSetOutcomeValue: Missing "identifier" attribute.');
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
const expression = this.firstElementChild;
|
|
103
|
-
if (!expression) {
|
|
104
|
-
console.warn("QtiSetOutcomeValue: No expression found.");
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
const rule = new QtiSetOutcomeValueRule(expression);
|
|
108
|
-
const value = rule.process();
|
|
109
|
-
this.dispatchEvent(
|
|
110
|
-
new CustomEvent("qti-set-outcome-value", {
|
|
111
|
-
bubbles: true,
|
|
112
|
-
composed: true,
|
|
113
|
-
detail: {
|
|
114
|
-
outcomeIdentifier,
|
|
115
|
-
value: this.#formatValue(value)
|
|
116
|
-
}
|
|
117
|
-
})
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Formats the computed value before dispatching.
|
|
122
|
-
* Ensures numbers are converted to a universal format.
|
|
123
|
-
*/
|
|
124
|
-
#formatValue(value) {
|
|
125
|
-
if (Array.isArray(value)) {
|
|
126
|
-
return value.map(convertNumberToUniversalFormat);
|
|
127
|
-
}
|
|
128
|
-
return value !== null ? convertNumberToUniversalFormat(value) : null;
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
var QtiSetOutcomeValueRule = class {
|
|
132
|
-
constructor(expression) {
|
|
133
|
-
this.expression = expression;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Evaluates the expression and returns its value.
|
|
137
|
-
*/
|
|
138
|
-
process() {
|
|
139
|
-
const value = this.expression.calculate() ?? null;
|
|
140
|
-
if (value === null) {
|
|
141
|
-
console.warn("QtiSetOutcomeValueRule: Evaluated value is null.");
|
|
142
|
-
}
|
|
143
|
-
return Array.isArray(value) ? value.map((v) => v.value ? v.value : v) : value;
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
customElements.define("qti-set-outcome-value", QtiSetOutcomeValue);
|
|
147
|
-
|
|
148
|
-
// ../qti-processing/src/components/qti-response-else/qti-response-else.ts
|
|
149
|
-
var QtiResponseElse = class extends i {
|
|
150
|
-
render() {
|
|
151
|
-
return T`<slot></slot>`;
|
|
152
|
-
}
|
|
153
|
-
calculate() {
|
|
154
|
-
return true;
|
|
155
|
-
}
|
|
156
|
-
getSubRules() {
|
|
157
|
-
return [...this.children];
|
|
158
|
-
}
|
|
159
|
-
process() {
|
|
160
|
-
const subRules = this.getSubRules();
|
|
161
|
-
for (let i2 = 0; i2 < subRules.length; i2++) {
|
|
162
|
-
const subRule = subRules[i2];
|
|
163
|
-
subRule.process();
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
customElements.define("qti-response-else", QtiResponseElse);
|
|
168
|
-
|
|
169
|
-
// ../qti-processing/src/components/qti-response-if/qti-response-if.ts
|
|
170
|
-
var QtiResponseIf = class extends QtiResponseElse {
|
|
171
|
-
calculate() {
|
|
172
|
-
const expression = this.firstElementChild;
|
|
173
|
-
const result = expression.calculate();
|
|
174
|
-
return result;
|
|
175
|
-
}
|
|
176
|
-
getSubRules() {
|
|
177
|
-
const result = [];
|
|
178
|
-
for (let i2 = 1; i2 < this.children.length; i2++) {
|
|
179
|
-
result.push(this.children[i2]);
|
|
180
|
-
}
|
|
181
|
-
return result;
|
|
182
|
-
}
|
|
183
|
-
};
|
|
184
|
-
customElements.define("qti-response-if", QtiResponseIf);
|
|
185
|
-
|
|
186
|
-
// ../qti-processing/src/components/qti-response-else-if/qti-response-else-if.ts
|
|
187
|
-
var QtiResponseElseIf = class extends QtiResponseIf {
|
|
188
|
-
render() {
|
|
189
|
-
return T`${super.render()}`;
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
customElements.define("qti-response-else-if", QtiResponseElseIf);
|
|
14
|
+
} from "./chunk-H3J7LFRO.js";
|
|
193
15
|
|
|
194
|
-
// ../qti-processing/
|
|
16
|
+
// ../qti-processing/dist/components/qti-and/qti-and.js
|
|
195
17
|
var QtiAnd = class extends qtiAndMixin(QtiConditionExpression) {
|
|
196
18
|
calculate() {
|
|
197
19
|
return this.calculateChildren(Array.from(this.children));
|
|
198
20
|
}
|
|
199
21
|
};
|
|
200
|
-
QtiAnd = __decorateClass([
|
|
201
|
-
t("qti-and")
|
|
202
|
-
], QtiAnd);
|
|
203
22
|
function qtiAndMixin(Base) {
|
|
204
23
|
return class MockQtiAnd extends Base {
|
|
205
24
|
calculateChildren(children) {
|
|
@@ -234,7 +53,13 @@ function qtiAndMixin(Base) {
|
|
|
234
53
|
};
|
|
235
54
|
}
|
|
236
55
|
|
|
237
|
-
// ../qti-processing/
|
|
56
|
+
// ../qti-processing/dist/components/qti-any-n/qti-any-n.js
|
|
57
|
+
var __decorate = function(decorators, target, key, desc) {
|
|
58
|
+
var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
59
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc);
|
|
60
|
+
else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r2 = (c2 < 3 ? d(r2) : c2 > 3 ? d(target, key, r2) : d(target, key)) || r2;
|
|
61
|
+
return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2;
|
|
62
|
+
};
|
|
238
63
|
var QtiAnyN = class extends QtiExpression {
|
|
239
64
|
constructor() {
|
|
240
65
|
super(...arguments);
|
|
@@ -271,15 +96,20 @@ var QtiAnyN = class extends QtiExpression {
|
|
|
271
96
|
return trueCount >= this.min && trueCount <= this.max;
|
|
272
97
|
}
|
|
273
98
|
};
|
|
274
|
-
|
|
99
|
+
__decorate([
|
|
275
100
|
n({ type: Number })
|
|
276
|
-
], QtiAnyN.prototype, "min",
|
|
277
|
-
|
|
101
|
+
], QtiAnyN.prototype, "min", void 0);
|
|
102
|
+
__decorate([
|
|
278
103
|
n({ type: Number })
|
|
279
|
-
], QtiAnyN.prototype, "max",
|
|
280
|
-
customElements.define("qti-any-n", QtiAnyN);
|
|
104
|
+
], QtiAnyN.prototype, "max", void 0);
|
|
281
105
|
|
|
282
|
-
// ../qti-processing/
|
|
106
|
+
// ../qti-processing/dist/components/qti-basevalue/qti-basevalue.js
|
|
107
|
+
var __decorate2 = function(decorators, target, key, desc) {
|
|
108
|
+
var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
109
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc);
|
|
110
|
+
else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r2 = (c2 < 3 ? d(r2) : c2 > 3 ? d(target, key, r2) : d(target, key)) || r2;
|
|
111
|
+
return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2;
|
|
112
|
+
};
|
|
283
113
|
var QtiBaseValue = class extends QtiExpression {
|
|
284
114
|
constructor() {
|
|
285
115
|
super(...arguments);
|
|
@@ -290,12 +120,11 @@ var QtiBaseValue = class extends QtiExpression {
|
|
|
290
120
|
return value;
|
|
291
121
|
}
|
|
292
122
|
};
|
|
293
|
-
|
|
123
|
+
__decorate2([
|
|
294
124
|
n({ type: String, attribute: "base-type" })
|
|
295
|
-
], QtiBaseValue.prototype, "baseType",
|
|
296
|
-
customElements.define("qti-base-value", QtiBaseValue);
|
|
125
|
+
], QtiBaseValue.prototype, "baseType", void 0);
|
|
297
126
|
|
|
298
|
-
// ../qti-processing/
|
|
127
|
+
// ../qti-processing/dist/components/qti-container-size/qti-container-size.js
|
|
299
128
|
var QtiContainerSize = class extends QtiExpression {
|
|
300
129
|
getResult() {
|
|
301
130
|
if (this.children?.length !== 1) {
|
|
@@ -321,9 +150,8 @@ var QtiContainerSize = class extends QtiExpression {
|
|
|
321
150
|
return variable.value.length;
|
|
322
151
|
}
|
|
323
152
|
};
|
|
324
|
-
customElements.define("qti-container-size", QtiContainerSize);
|
|
325
153
|
|
|
326
|
-
// ../qti-processing/
|
|
154
|
+
// ../qti-processing/dist/components/qti-contains/qti-contains.js
|
|
327
155
|
var QtiContains = class extends QtiConditionExpression {
|
|
328
156
|
getResult() {
|
|
329
157
|
const values = this.getVariables();
|
|
@@ -341,9 +169,7 @@ var QtiContains = class extends QtiConditionExpression {
|
|
|
341
169
|
const projection2 = value2.value;
|
|
342
170
|
return projection2.includes(projection1);
|
|
343
171
|
} else {
|
|
344
|
-
console.error(
|
|
345
|
-
"unsupported baseType or cardinality in qti contains, only baseType: directedPair and cardinality: multiple is supported"
|
|
346
|
-
);
|
|
172
|
+
console.error("unsupported baseType or cardinality in qti contains, only baseType: directedPair and cardinality: multiple is supported");
|
|
347
173
|
}
|
|
348
174
|
} else {
|
|
349
175
|
console.error("unexpected number of children in qti contains");
|
|
@@ -351,9 +177,8 @@ var QtiContains = class extends QtiConditionExpression {
|
|
|
351
177
|
return false;
|
|
352
178
|
}
|
|
353
179
|
};
|
|
354
|
-
customElements.define("qti-contains", QtiContains);
|
|
355
180
|
|
|
356
|
-
// ../qti-processing/
|
|
181
|
+
// ../qti-processing/dist/components/qti-correct/qti-correct.js
|
|
357
182
|
var QtiCorrect = class extends QtiExpression {
|
|
358
183
|
get interpretation() {
|
|
359
184
|
return this.getAttribute("interpretation") || "";
|
|
@@ -368,9 +193,14 @@ var QtiCorrect = class extends QtiExpression {
|
|
|
368
193
|
}
|
|
369
194
|
}
|
|
370
195
|
};
|
|
371
|
-
customElements.define("qti-correct", QtiCorrect);
|
|
372
196
|
|
|
373
|
-
// ../qti-processing/
|
|
197
|
+
// ../qti-processing/dist/components/qti-default/qti-default.js
|
|
198
|
+
var __decorate3 = function(decorators, target, key, desc) {
|
|
199
|
+
var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
200
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc);
|
|
201
|
+
else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r2 = (c2 < 3 ? d(r2) : c2 > 3 ? d(target, key, r2) : d(target, key)) || r2;
|
|
202
|
+
return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2;
|
|
203
|
+
};
|
|
374
204
|
var QtiDefault = class extends QtiExpression {
|
|
375
205
|
constructor() {
|
|
376
206
|
super(...arguments);
|
|
@@ -419,226 +249,248 @@ var QtiDefault = class extends QtiExpression {
|
|
|
419
249
|
return variable.defaultValue || null;
|
|
420
250
|
}
|
|
421
251
|
};
|
|
422
|
-
|
|
252
|
+
__decorate3([
|
|
423
253
|
n({ type: String })
|
|
424
|
-
], QtiDefault.prototype, "identifier",
|
|
425
|
-
|
|
254
|
+
], QtiDefault.prototype, "identifier", void 0);
|
|
255
|
+
__decorate3([
|
|
426
256
|
c({ context: itemContext, subscribe: true }),
|
|
427
257
|
r()
|
|
428
|
-
], QtiDefault.prototype, "context",
|
|
429
|
-
|
|
258
|
+
], QtiDefault.prototype, "context", void 0);
|
|
259
|
+
__decorate3([
|
|
430
260
|
r(),
|
|
431
261
|
c({ context: testContext, subscribe: true })
|
|
432
|
-
], QtiDefault.prototype, "_testContext",
|
|
433
|
-
customElements.define("qti-default", QtiDefault);
|
|
262
|
+
], QtiDefault.prototype, "_testContext", void 0);
|
|
434
263
|
|
|
435
|
-
// ../qti-processing/
|
|
436
|
-
var
|
|
437
|
-
constructor() {
|
|
438
|
-
super(...arguments);
|
|
439
|
-
this.roundingMode = "significantFigures";
|
|
440
|
-
}
|
|
441
|
-
get figures() {
|
|
442
|
-
const attr = this.getAttribute("figures");
|
|
443
|
-
if (!attr) {
|
|
444
|
-
console.error("figures attribute is missing");
|
|
445
|
-
return null;
|
|
446
|
-
}
|
|
447
|
-
const figures = parseInt(this.getAttribute("figures") || "0");
|
|
448
|
-
if (isNaN(figures)) {
|
|
449
|
-
console.error("figures attribute is not a number");
|
|
450
|
-
return null;
|
|
451
|
-
}
|
|
452
|
-
if (figures < 0) {
|
|
453
|
-
console.error("figures attribute is negative");
|
|
454
|
-
return null;
|
|
455
|
-
}
|
|
456
|
-
if (figures < 1 && this.roundingMode === "significantFigures") {
|
|
457
|
-
console.error("figures cannot be smaller than 1 for RoundingMode significantFigures");
|
|
458
|
-
return null;
|
|
459
|
-
}
|
|
460
|
-
return figures;
|
|
461
|
-
}
|
|
264
|
+
// ../qti-processing/dist/components/qti-delete/qti-delete.js
|
|
265
|
+
var QtiDelete = class extends QtiExpression {
|
|
462
266
|
getResult() {
|
|
463
267
|
if (this.children.length === 2) {
|
|
464
268
|
const values = this.getVariables();
|
|
465
269
|
const value1 = values[0];
|
|
466
270
|
const value2 = values[1];
|
|
467
|
-
if (
|
|
468
|
-
return null;
|
|
469
|
-
}
|
|
470
|
-
if (value1.cardinality !== "single" || value2.cardinality !== "single" || Array.isArray(value1.value) || Array.isArray(value2.value)) {
|
|
271
|
+
if (value1.cardinality !== "single" || !Array.isArray(value2.value)) {
|
|
471
272
|
console.error("unexpected cardinality in qti equal");
|
|
472
|
-
return
|
|
273
|
+
return null;
|
|
473
274
|
}
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
const float1 = parseFloat(value1.value);
|
|
478
|
-
const float2 = parseFloat(value2.value);
|
|
479
|
-
if (!isNaN(float1) && !isNaN(float2)) {
|
|
480
|
-
if (this.roundingMode === "significantFigures") {
|
|
481
|
-
return float1.toPrecision(this.figures) === float2.toPrecision(this.figures);
|
|
482
|
-
} else {
|
|
483
|
-
return Math.round(float1 * Math.pow(10, this.figures)) / Math.pow(10, this.figures) === Math.round(float2 * Math.pow(10, this.figures)) / Math.pow(10, this.figures);
|
|
484
|
-
}
|
|
485
|
-
} else {
|
|
486
|
-
console.error(`value cannot be casted to numeric value in equalRounded operator: ${float1}, ${float2}`);
|
|
487
|
-
}
|
|
488
|
-
break;
|
|
489
|
-
}
|
|
490
|
-
default: {
|
|
491
|
-
console.error(`values other than float and int cannot be used in equalRounded operator.`);
|
|
492
|
-
break;
|
|
493
|
-
}
|
|
275
|
+
if (values[0].baseType !== values[1].baseType) {
|
|
276
|
+
console.error("The baseType of the two variables is different");
|
|
277
|
+
return null;
|
|
494
278
|
}
|
|
495
|
-
|
|
279
|
+
const filtered = value2.value.filter((v) => !value1.value.includes(v));
|
|
280
|
+
return filtered;
|
|
496
281
|
}
|
|
497
|
-
console.error("unexpected number of children in qti-equal-rounded");
|
|
498
282
|
return null;
|
|
499
283
|
}
|
|
500
284
|
};
|
|
501
|
-
__decorateClass([
|
|
502
|
-
n({ type: String })
|
|
503
|
-
], QtiEqualRounded.prototype, "roundingMode", 2);
|
|
504
|
-
customElements.define("qti-equal-rounded", QtiEqualRounded);
|
|
505
285
|
|
|
506
|
-
// ../qti-processing/
|
|
507
|
-
var
|
|
286
|
+
// ../qti-processing/dist/components/qti-divide/qti-divide.js
|
|
287
|
+
var QtiDivide = class extends QtiExpression {
|
|
508
288
|
getResult() {
|
|
509
|
-
|
|
510
|
-
|
|
289
|
+
const values = this.#collectNumericValues(this.getVariables());
|
|
290
|
+
if (values.length !== 2) {
|
|
291
|
+
console.warn("qti-divide: expected exactly 2 numeric values");
|
|
511
292
|
return null;
|
|
512
293
|
}
|
|
513
|
-
|
|
514
|
-
|
|
294
|
+
if (values[1] === 0) {
|
|
295
|
+
console.warn("qti-divide: division by zero");
|
|
515
296
|
return null;
|
|
516
297
|
}
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
298
|
+
return values[0] / values[1];
|
|
299
|
+
}
|
|
300
|
+
#collectNumericValues(variables) {
|
|
301
|
+
const values = [];
|
|
302
|
+
for (const variable of variables) {
|
|
303
|
+
if (!variable) {
|
|
304
|
+
continue;
|
|
305
|
+
}
|
|
306
|
+
const pushValue = (raw) => {
|
|
307
|
+
if (raw === null || raw === void 0) {
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
const numValue = parseFloat(raw.toString());
|
|
311
|
+
if (Number.isNaN(numValue)) {
|
|
312
|
+
console.warn("qti-divide: non-numeric value encountered");
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
values.push(numValue);
|
|
316
|
+
};
|
|
317
|
+
if (Array.isArray(variable.value)) {
|
|
318
|
+
variable.value.forEach((item) => pushValue(item));
|
|
319
|
+
continue;
|
|
320
|
+
}
|
|
321
|
+
pushValue(variable.value);
|
|
521
322
|
}
|
|
522
|
-
|
|
523
|
-
|
|
323
|
+
return values;
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
// ../qti-processing/dist/components/qti-duration-gte/qti-duration-gte.js
|
|
328
|
+
var QtiDurationGte = class extends QtiExpression {
|
|
329
|
+
getResult() {
|
|
330
|
+
const values = this.#getDurationValues();
|
|
331
|
+
if (!values) {
|
|
524
332
|
return null;
|
|
525
333
|
}
|
|
526
|
-
|
|
334
|
+
return values[0] >= values[1];
|
|
335
|
+
}
|
|
336
|
+
#getDurationValues() {
|
|
337
|
+
const variables = this.getVariables();
|
|
338
|
+
if (variables.length !== 2) {
|
|
339
|
+
console.error("qti-duration-gte requires exactly 2 duration expressions");
|
|
527
340
|
return null;
|
|
528
341
|
}
|
|
529
|
-
|
|
530
|
-
|
|
342
|
+
const values = variables.map((variable) => this.#parseDuration(variable));
|
|
343
|
+
if (values.some((value) => value === null)) {
|
|
531
344
|
return null;
|
|
532
345
|
}
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
346
|
+
return values;
|
|
347
|
+
}
|
|
348
|
+
#parseDuration(variable) {
|
|
349
|
+
if (variable.cardinality !== "single" || Array.isArray(variable.value)) {
|
|
350
|
+
console.error("qti-duration-gte requires single cardinality");
|
|
536
351
|
return null;
|
|
537
352
|
}
|
|
538
|
-
if (
|
|
539
|
-
|
|
540
|
-
return Infinity;
|
|
541
|
-
}
|
|
542
|
-
if (numericValue === -Infinity) {
|
|
543
|
-
return -Infinity;
|
|
544
|
-
}
|
|
353
|
+
if (variable.baseType !== "duration") {
|
|
354
|
+
console.error("qti-duration-gte requires duration base-type");
|
|
545
355
|
return null;
|
|
546
356
|
}
|
|
547
|
-
|
|
357
|
+
if (variable.value === null || variable.value === void 0) {
|
|
358
|
+
return null;
|
|
359
|
+
}
|
|
360
|
+
const value = Number.parseFloat(variable.value.toString());
|
|
361
|
+
if (Number.isNaN(value)) {
|
|
362
|
+
console.error(`qti-duration-gte requires duration values expressed in seconds, got "${variable.value.toString()}"`);
|
|
363
|
+
return null;
|
|
364
|
+
}
|
|
365
|
+
return value;
|
|
548
366
|
}
|
|
549
367
|
};
|
|
550
|
-
customElements.define("qti-round", QtiRound);
|
|
551
368
|
|
|
552
|
-
// ../qti-processing/
|
|
553
|
-
var
|
|
554
|
-
constructor() {
|
|
555
|
-
super(...arguments);
|
|
556
|
-
this.roundingMode = "significantFigures";
|
|
557
|
-
this.figures = 3;
|
|
558
|
-
}
|
|
369
|
+
// ../qti-processing/dist/components/qti-duration-lt/qti-duration-lt.js
|
|
370
|
+
var QtiDurationLt = class extends QtiExpression {
|
|
559
371
|
getResult() {
|
|
560
|
-
|
|
561
|
-
|
|
372
|
+
const values = this.#getDurationValues();
|
|
373
|
+
if (!values) {
|
|
562
374
|
return null;
|
|
563
375
|
}
|
|
376
|
+
return values[0] < values[1];
|
|
377
|
+
}
|
|
378
|
+
#getDurationValues() {
|
|
564
379
|
const variables = this.getVariables();
|
|
565
|
-
if (
|
|
380
|
+
if (variables.length !== 2) {
|
|
381
|
+
console.error("qti-duration-lt requires exactly 2 duration expressions");
|
|
566
382
|
return null;
|
|
567
383
|
}
|
|
568
|
-
const
|
|
569
|
-
if (
|
|
570
|
-
console.error("qti-round-to requires single cardinality");
|
|
384
|
+
const values = variables.map((variable) => this.#parseDuration(variable));
|
|
385
|
+
if (values.some((value) => value === null)) {
|
|
571
386
|
return null;
|
|
572
387
|
}
|
|
573
|
-
|
|
574
|
-
|
|
388
|
+
return values;
|
|
389
|
+
}
|
|
390
|
+
#parseDuration(variable) {
|
|
391
|
+
if (variable.cardinality !== "single" || Array.isArray(variable.value)) {
|
|
392
|
+
console.error("qti-duration-lt requires single cardinality");
|
|
575
393
|
return null;
|
|
576
394
|
}
|
|
577
|
-
if (variable.
|
|
395
|
+
if (variable.baseType !== "duration") {
|
|
396
|
+
console.error("qti-duration-lt requires duration base-type");
|
|
578
397
|
return null;
|
|
579
398
|
}
|
|
580
|
-
if (variable.
|
|
581
|
-
console.error("qti-round-to requires numerical base-type");
|
|
399
|
+
if (variable.value === null || variable.value === void 0) {
|
|
582
400
|
return null;
|
|
583
401
|
}
|
|
584
|
-
const
|
|
585
|
-
if (isNaN(
|
|
402
|
+
const value = Number.parseFloat(variable.value.toString());
|
|
403
|
+
if (Number.isNaN(value)) {
|
|
404
|
+
console.error(`qti-duration-lt requires duration values expressed in seconds, got "${variable.value.toString()}"`);
|
|
586
405
|
return null;
|
|
587
406
|
}
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
407
|
+
return value;
|
|
408
|
+
}
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
// ../qti-processing/dist/components/qti-equal-rounded/qti-equal-rounded.js
|
|
412
|
+
var __decorate4 = function(decorators, target, key, desc) {
|
|
413
|
+
var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
414
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc);
|
|
415
|
+
else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r2 = (c2 < 3 ? d(r2) : c2 > 3 ? d(target, key, r2) : d(target, key)) || r2;
|
|
416
|
+
return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2;
|
|
417
|
+
};
|
|
418
|
+
var QtiEqualRounded = class extends QtiExpression {
|
|
419
|
+
constructor() {
|
|
420
|
+
super(...arguments);
|
|
421
|
+
this.roundingMode = "significantFigures";
|
|
422
|
+
}
|
|
423
|
+
get figures() {
|
|
424
|
+
const attr = this.getAttribute("figures");
|
|
425
|
+
if (!attr) {
|
|
426
|
+
console.error("figures attribute is missing");
|
|
595
427
|
return null;
|
|
596
428
|
}
|
|
597
|
-
|
|
598
|
-
|
|
429
|
+
const figures = parseInt(this.getAttribute("figures") || "0");
|
|
430
|
+
if (isNaN(figures)) {
|
|
431
|
+
console.error("figures attribute is not a number");
|
|
599
432
|
return null;
|
|
600
433
|
}
|
|
601
|
-
if (
|
|
602
|
-
console.error("
|
|
434
|
+
if (figures < 0) {
|
|
435
|
+
console.error("figures attribute is negative");
|
|
603
436
|
return null;
|
|
604
437
|
}
|
|
605
|
-
if (this.roundingMode === "
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
return this.#roundToSignificantFigures(numericValue, this.figures);
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
/**
|
|
612
|
-
* Round to specified number of decimal places
|
|
613
|
-
*/
|
|
614
|
-
#roundToDecimalPlaces(value, decimalPlaces) {
|
|
615
|
-
if (value === 0) {
|
|
616
|
-
return 0;
|
|
438
|
+
if (figures < 1 && this.roundingMode === "significantFigures") {
|
|
439
|
+
console.error("figures cannot be smaller than 1 for RoundingMode significantFigures");
|
|
440
|
+
return null;
|
|
617
441
|
}
|
|
618
|
-
|
|
619
|
-
return Math.round(value * multiplier) / multiplier;
|
|
442
|
+
return figures;
|
|
620
443
|
}
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
444
|
+
getResult() {
|
|
445
|
+
if (this.children.length === 2) {
|
|
446
|
+
const values = this.getVariables();
|
|
447
|
+
const value1 = values[0];
|
|
448
|
+
const value2 = values[1];
|
|
449
|
+
if (this.roundingMode === null) {
|
|
450
|
+
return null;
|
|
451
|
+
}
|
|
452
|
+
if (value1.cardinality !== "single" || value2.cardinality !== "single" || Array.isArray(value1.value) || Array.isArray(value2.value)) {
|
|
453
|
+
console.error("unexpected cardinality in qti equal");
|
|
454
|
+
return false;
|
|
455
|
+
}
|
|
456
|
+
switch (values[0].baseType) {
|
|
457
|
+
case "integer":
|
|
458
|
+
case "float": {
|
|
459
|
+
const float1 = parseFloat(value1.value);
|
|
460
|
+
const float2 = parseFloat(value2.value);
|
|
461
|
+
if (!isNaN(float1) && !isNaN(float2)) {
|
|
462
|
+
if (this.roundingMode === "significantFigures") {
|
|
463
|
+
return float1.toPrecision(this.figures) === float2.toPrecision(this.figures);
|
|
464
|
+
} else {
|
|
465
|
+
return Math.round(float1 * Math.pow(10, this.figures)) / Math.pow(10, this.figures) === Math.round(float2 * Math.pow(10, this.figures)) / Math.pow(10, this.figures);
|
|
466
|
+
}
|
|
467
|
+
} else {
|
|
468
|
+
console.error(`value cannot be casted to numeric value in equalRounded operator: ${float1}, ${float2}`);
|
|
469
|
+
}
|
|
470
|
+
break;
|
|
471
|
+
}
|
|
472
|
+
default: {
|
|
473
|
+
console.error(`values other than float and int cannot be used in equalRounded operator.`);
|
|
474
|
+
break;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
return false;
|
|
627
478
|
}
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
return Math.round(value * multiplier) / multiplier;
|
|
479
|
+
console.error("unexpected number of children in qti-equal-rounded");
|
|
480
|
+
return null;
|
|
631
481
|
}
|
|
632
482
|
};
|
|
633
|
-
|
|
634
|
-
n({ type: String
|
|
635
|
-
],
|
|
636
|
-
__decorateClass([
|
|
637
|
-
n({ type: Number })
|
|
638
|
-
], QtiRoundTo.prototype, "figures", 2);
|
|
639
|
-
customElements.define("qti-round-to", QtiRoundTo);
|
|
483
|
+
__decorate4([
|
|
484
|
+
n({ type: String })
|
|
485
|
+
], QtiEqualRounded.prototype, "roundingMode", void 0);
|
|
640
486
|
|
|
641
|
-
// ../qti-processing/
|
|
487
|
+
// ../qti-processing/dist/components/qti-equal/qti-equal.js
|
|
488
|
+
var __decorate5 = function(decorators, target, key, desc) {
|
|
489
|
+
var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
490
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc);
|
|
491
|
+
else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r2 = (c2 < 3 ? d(r2) : c2 > 3 ? d(target, key, r2) : d(target, key)) || r2;
|
|
492
|
+
return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2;
|
|
493
|
+
};
|
|
642
494
|
var QtiEqual = class extends QtiExpression {
|
|
643
495
|
constructor() {
|
|
644
496
|
super(...arguments);
|
|
@@ -669,150 +521,42 @@ var QtiEqual = class extends QtiExpression {
|
|
|
669
521
|
return null;
|
|
670
522
|
}
|
|
671
523
|
};
|
|
672
|
-
|
|
524
|
+
__decorate5([
|
|
673
525
|
n({ type: String })
|
|
674
|
-
], QtiEqual.prototype, "toleranceMode",
|
|
675
|
-
customElements.define("qti-equal", QtiEqual);
|
|
526
|
+
], QtiEqual.prototype, "toleranceMode", void 0);
|
|
676
527
|
|
|
677
|
-
// ../qti-processing/
|
|
678
|
-
var
|
|
528
|
+
// ../qti-processing/dist/components/qti-field-value/qti-field-value.js
|
|
529
|
+
var QtiFieldValue = class extends QtiExpression {
|
|
679
530
|
getResult() {
|
|
680
|
-
const
|
|
681
|
-
if (
|
|
682
|
-
|
|
683
|
-
return null;
|
|
531
|
+
const fieldIdentifier = this.getAttribute("field-identifier");
|
|
532
|
+
if (!fieldIdentifier) {
|
|
533
|
+
throw new Error("field-identifier attribute is required");
|
|
684
534
|
}
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
535
|
+
const childElements = Array.from(this.children);
|
|
536
|
+
if (childElements.length !== 1) {
|
|
537
|
+
throw new Error("qti-field-value must have exactly one child expression");
|
|
688
538
|
}
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
const values = [];
|
|
693
|
-
for (const variable of variables) {
|
|
694
|
-
if (!variable) {
|
|
695
|
-
continue;
|
|
696
|
-
}
|
|
697
|
-
const pushValue = (raw) => {
|
|
698
|
-
if (raw === null || raw === void 0) {
|
|
699
|
-
return;
|
|
700
|
-
}
|
|
701
|
-
const numValue = parseFloat(raw.toString());
|
|
702
|
-
if (Number.isNaN(numValue)) {
|
|
703
|
-
console.warn("qti-divide: non-numeric value encountered");
|
|
704
|
-
return;
|
|
705
|
-
}
|
|
706
|
-
values.push(numValue);
|
|
707
|
-
};
|
|
708
|
-
if (Array.isArray(variable.value)) {
|
|
709
|
-
variable.value.forEach((item) => pushValue(item));
|
|
710
|
-
continue;
|
|
711
|
-
}
|
|
712
|
-
pushValue(variable.value);
|
|
539
|
+
const variable = this.getVariables()[0];
|
|
540
|
+
if (variable.baseType !== "record" || variable.value === null) {
|
|
541
|
+
throw new Error("qti-field-value child expression must return a record");
|
|
713
542
|
}
|
|
714
|
-
|
|
543
|
+
const fieldValue = variable.value[fieldIdentifier];
|
|
544
|
+
if (fieldValue === void 0) {
|
|
545
|
+
throw new Error(`Field "${fieldIdentifier}" not found in record`);
|
|
546
|
+
}
|
|
547
|
+
return fieldValue;
|
|
715
548
|
}
|
|
716
549
|
};
|
|
717
|
-
customElements.define("qti-divide", QtiDivide);
|
|
718
550
|
|
|
719
|
-
// ../qti-processing/
|
|
720
|
-
var
|
|
551
|
+
// ../qti-processing/dist/components/qti-gcd/qti.gcd.js
|
|
552
|
+
var QtiGcd = class extends QtiExpression {
|
|
721
553
|
getResult() {
|
|
722
|
-
|
|
723
|
-
|
|
554
|
+
if (this.children.length === 0) {
|
|
555
|
+
console.error("qti-gcd must have at least one child expression");
|
|
724
556
|
return null;
|
|
725
557
|
}
|
|
726
|
-
return values[0] >= values[1];
|
|
727
|
-
}
|
|
728
|
-
#getDurationValues() {
|
|
729
558
|
const variables = this.getVariables();
|
|
730
|
-
if (variables.length
|
|
731
|
-
console.error("qti-duration-gte requires exactly 2 duration expressions");
|
|
732
|
-
return null;
|
|
733
|
-
}
|
|
734
|
-
const values = variables.map((variable) => this.#parseDuration(variable));
|
|
735
|
-
if (values.some((value) => value === null)) {
|
|
736
|
-
return null;
|
|
737
|
-
}
|
|
738
|
-
return values;
|
|
739
|
-
}
|
|
740
|
-
#parseDuration(variable) {
|
|
741
|
-
if (variable.cardinality !== "single" || Array.isArray(variable.value)) {
|
|
742
|
-
console.error("qti-duration-gte requires single cardinality");
|
|
743
|
-
return null;
|
|
744
|
-
}
|
|
745
|
-
if (variable.baseType !== "duration") {
|
|
746
|
-
console.error("qti-duration-gte requires duration base-type");
|
|
747
|
-
return null;
|
|
748
|
-
}
|
|
749
|
-
if (variable.value === null || variable.value === void 0) {
|
|
750
|
-
return null;
|
|
751
|
-
}
|
|
752
|
-
const value = Number.parseFloat(variable.value.toString());
|
|
753
|
-
if (Number.isNaN(value)) {
|
|
754
|
-
console.error(
|
|
755
|
-
`qti-duration-gte requires duration values expressed in seconds, got "${variable.value.toString()}"`
|
|
756
|
-
);
|
|
757
|
-
return null;
|
|
758
|
-
}
|
|
759
|
-
return value;
|
|
760
|
-
}
|
|
761
|
-
};
|
|
762
|
-
customElements.define("qti-duration-gte", QtiDurationGte);
|
|
763
|
-
|
|
764
|
-
// ../qti-processing/src/components/qti-duration-lt/qti-duration-lt.ts
|
|
765
|
-
var QtiDurationLt = class extends QtiExpression {
|
|
766
|
-
getResult() {
|
|
767
|
-
const values = this.#getDurationValues();
|
|
768
|
-
if (!values) {
|
|
769
|
-
return null;
|
|
770
|
-
}
|
|
771
|
-
return values[0] < values[1];
|
|
772
|
-
}
|
|
773
|
-
#getDurationValues() {
|
|
774
|
-
const variables = this.getVariables();
|
|
775
|
-
if (variables.length !== 2) {
|
|
776
|
-
console.error("qti-duration-lt requires exactly 2 duration expressions");
|
|
777
|
-
return null;
|
|
778
|
-
}
|
|
779
|
-
const values = variables.map((variable) => this.#parseDuration(variable));
|
|
780
|
-
if (values.some((value) => value === null)) {
|
|
781
|
-
return null;
|
|
782
|
-
}
|
|
783
|
-
return values;
|
|
784
|
-
}
|
|
785
|
-
#parseDuration(variable) {
|
|
786
|
-
if (variable.cardinality !== "single" || Array.isArray(variable.value)) {
|
|
787
|
-
console.error("qti-duration-lt requires single cardinality");
|
|
788
|
-
return null;
|
|
789
|
-
}
|
|
790
|
-
if (variable.baseType !== "duration") {
|
|
791
|
-
console.error("qti-duration-lt requires duration base-type");
|
|
792
|
-
return null;
|
|
793
|
-
}
|
|
794
|
-
if (variable.value === null || variable.value === void 0) {
|
|
795
|
-
return null;
|
|
796
|
-
}
|
|
797
|
-
const value = Number.parseFloat(variable.value.toString());
|
|
798
|
-
if (Number.isNaN(value)) {
|
|
799
|
-
console.error(`qti-duration-lt requires duration values expressed in seconds, got "${variable.value.toString()}"`);
|
|
800
|
-
return null;
|
|
801
|
-
}
|
|
802
|
-
return value;
|
|
803
|
-
}
|
|
804
|
-
};
|
|
805
|
-
customElements.define("qti-duration-lt", QtiDurationLt);
|
|
806
|
-
|
|
807
|
-
// ../qti-processing/src/components/qti-gcd/qti.gcd.ts
|
|
808
|
-
var QtiGcd = class extends QtiExpression {
|
|
809
|
-
getResult() {
|
|
810
|
-
if (this.children.length === 0) {
|
|
811
|
-
console.error("qti-gcd must have at least one child expression");
|
|
812
|
-
return null;
|
|
813
|
-
}
|
|
814
|
-
const variables = this.getVariables();
|
|
815
|
-
if (!variables || variables.length === 0) {
|
|
559
|
+
if (!variables || variables.length === 0) {
|
|
816
560
|
return null;
|
|
817
561
|
}
|
|
818
562
|
const allValues = [];
|
|
@@ -901,9 +645,8 @@ var QtiGcd = class extends QtiExpression {
|
|
|
901
645
|
return a;
|
|
902
646
|
}
|
|
903
647
|
};
|
|
904
|
-
customElements.define("qti-gcd", QtiGcd);
|
|
905
648
|
|
|
906
|
-
// ../qti-processing/
|
|
649
|
+
// ../qti-processing/dist/components/qti-gt/qti-gt.js
|
|
907
650
|
var QtiGt = class extends QtiExpression {
|
|
908
651
|
getResult() {
|
|
909
652
|
if (this.children.length === 2) {
|
|
@@ -920,9 +663,8 @@ var QtiGt = class extends QtiExpression {
|
|
|
920
663
|
return null;
|
|
921
664
|
}
|
|
922
665
|
};
|
|
923
|
-
customElements.define("qti-gt", QtiGt);
|
|
924
666
|
|
|
925
|
-
// ../qti-processing/
|
|
667
|
+
// ../qti-processing/dist/components/qti-gte/qti-gte.js
|
|
926
668
|
var QtiGte = class extends QtiConditionExpression {
|
|
927
669
|
getResult() {
|
|
928
670
|
if (this.children.length === 2) {
|
|
@@ -940,9 +682,76 @@ var QtiGte = class extends QtiConditionExpression {
|
|
|
940
682
|
return null;
|
|
941
683
|
}
|
|
942
684
|
};
|
|
943
|
-
customElements.define("qti-gte", QtiGte);
|
|
944
685
|
|
|
945
|
-
// ../qti-processing/
|
|
686
|
+
// ../qti-processing/dist/components/qti-index/qti-index.js
|
|
687
|
+
var __decorate6 = function(decorators, target, key, desc) {
|
|
688
|
+
var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
689
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc);
|
|
690
|
+
else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r2 = (c2 < 3 ? d(r2) : c2 > 3 ? d(target, key, r2) : d(target, key)) || r2;
|
|
691
|
+
return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2;
|
|
692
|
+
};
|
|
693
|
+
var QtiIndex = class extends QtiExpression {
|
|
694
|
+
getResult() {
|
|
695
|
+
if (!this.n) {
|
|
696
|
+
console.error('qti-index: missing required attribute "n"');
|
|
697
|
+
return null;
|
|
698
|
+
}
|
|
699
|
+
if (this.children.length !== 1) {
|
|
700
|
+
console.error("qti-index: must have exactly one child container element");
|
|
701
|
+
return null;
|
|
702
|
+
}
|
|
703
|
+
const containerVariable = this.getVariables()[0];
|
|
704
|
+
if (!containerVariable) {
|
|
705
|
+
console.error("qti-index: missing container");
|
|
706
|
+
return null;
|
|
707
|
+
}
|
|
708
|
+
let index;
|
|
709
|
+
if (!isNaN(Number(this.n))) {
|
|
710
|
+
index = Number(this.n);
|
|
711
|
+
} else {
|
|
712
|
+
const variableValue = this.#lookupVariableValue(this.n);
|
|
713
|
+
if (variableValue === null) {
|
|
714
|
+
console.error(`qti-index: variable "${this.n}" is not a valid number`);
|
|
715
|
+
return null;
|
|
716
|
+
}
|
|
717
|
+
index = Number(variableValue);
|
|
718
|
+
}
|
|
719
|
+
if (index <= 0 || !Number.isInteger(index)) {
|
|
720
|
+
console.error("qti-index: index must be a positive integer");
|
|
721
|
+
return null;
|
|
722
|
+
}
|
|
723
|
+
if (containerVariable.cardinality === "ordered") {
|
|
724
|
+
const containerValues = Array.isArray(containerVariable.value) ? containerVariable.value : [containerVariable.value];
|
|
725
|
+
if (containerVariable.value === null || index > containerValues.length) {
|
|
726
|
+
return null;
|
|
727
|
+
}
|
|
728
|
+
return containerValues[index - 1];
|
|
729
|
+
} else {
|
|
730
|
+
console.error("qti-index: child must have ordered cardinality");
|
|
731
|
+
return null;
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
// Helper method to look up a variable value by identifier
|
|
735
|
+
// This would need to be implemented based on your actual QTI runtime environment
|
|
736
|
+
#lookupVariableValue(identifier) {
|
|
737
|
+
const value = this.context.variables.find((v) => v.identifier === identifier)?.value;
|
|
738
|
+
if (value === null || isNaN(Number(value))) {
|
|
739
|
+
return null;
|
|
740
|
+
}
|
|
741
|
+
return Number(value);
|
|
742
|
+
}
|
|
743
|
+
};
|
|
744
|
+
__decorate6([
|
|
745
|
+
n({ type: String })
|
|
746
|
+
], QtiIndex.prototype, "n", void 0);
|
|
747
|
+
|
|
748
|
+
// ../qti-processing/dist/components/qti-inside/qti-inside.js
|
|
749
|
+
var __decorate7 = function(decorators, target, key, desc) {
|
|
750
|
+
var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
751
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc);
|
|
752
|
+
else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r2 = (c2 < 3 ? d(r2) : c2 > 3 ? d(target, key, r2) : d(target, key)) || r2;
|
|
753
|
+
return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2;
|
|
754
|
+
};
|
|
946
755
|
var QtiInside = class extends QtiExpression {
|
|
947
756
|
constructor() {
|
|
948
757
|
super(...arguments);
|
|
@@ -1060,15 +869,14 @@ var QtiInside = class extends QtiExpression {
|
|
|
1060
869
|
return inside;
|
|
1061
870
|
}
|
|
1062
871
|
};
|
|
1063
|
-
|
|
872
|
+
__decorate7([
|
|
1064
873
|
n({ type: String })
|
|
1065
|
-
], QtiInside.prototype, "shape",
|
|
1066
|
-
|
|
874
|
+
], QtiInside.prototype, "shape", void 0);
|
|
875
|
+
__decorate7([
|
|
1067
876
|
n({ type: String })
|
|
1068
|
-
], QtiInside.prototype, "coords",
|
|
1069
|
-
customElements.define("qti-inside", QtiInside);
|
|
877
|
+
], QtiInside.prototype, "coords", void 0);
|
|
1070
878
|
|
|
1071
|
-
// ../qti-processing/
|
|
879
|
+
// ../qti-processing/dist/components/qti-integer-divide/qti-integer-divide.js
|
|
1072
880
|
var QtiIntegerDivide = class extends QtiExpression {
|
|
1073
881
|
getResult() {
|
|
1074
882
|
const values = this.#collectIntegerValues(this.getVariables());
|
|
@@ -1106,9 +914,8 @@ var QtiIntegerDivide = class extends QtiExpression {
|
|
|
1106
914
|
return values;
|
|
1107
915
|
}
|
|
1108
916
|
};
|
|
1109
|
-
customElements.define("qti-integer-divide", QtiIntegerDivide);
|
|
1110
917
|
|
|
1111
|
-
// ../qti-processing/
|
|
918
|
+
// ../qti-processing/dist/components/qti-integer-modulus/qti-integer-modulus.js
|
|
1112
919
|
var QtiIntegerModulus = class extends QtiExpression {
|
|
1113
920
|
getResult() {
|
|
1114
921
|
const values = this.#collectIntegerValues(this.getVariables());
|
|
@@ -1146,9 +953,8 @@ var QtiIntegerModulus = class extends QtiExpression {
|
|
|
1146
953
|
return values;
|
|
1147
954
|
}
|
|
1148
955
|
};
|
|
1149
|
-
customElements.define("qti-integer-modulus", QtiIntegerModulus);
|
|
1150
956
|
|
|
1151
|
-
// ../qti-processing/
|
|
957
|
+
// ../qti-processing/dist/components/qti-integer-to-float/qti-integer-to-float.js
|
|
1152
958
|
var QtiIntegerToFloat = class extends QtiExpression {
|
|
1153
959
|
getResult() {
|
|
1154
960
|
const variables = this.getVariables();
|
|
@@ -1176,9 +982,24 @@ var QtiIntegerToFloat = class extends QtiExpression {
|
|
|
1176
982
|
return value;
|
|
1177
983
|
}
|
|
1178
984
|
};
|
|
1179
|
-
customElements.define("qti-integer-to-float", QtiIntegerToFloat);
|
|
1180
985
|
|
|
1181
|
-
// ../qti-processing/
|
|
986
|
+
// ../qti-processing/dist/components/qti-is-null/qti-is-null.js
|
|
987
|
+
var QtiIsNull = class extends QtiExpression {
|
|
988
|
+
getResult() {
|
|
989
|
+
if (this.children.length === 1) {
|
|
990
|
+
const variables = this.getVariables();
|
|
991
|
+
if (!variables) {
|
|
992
|
+
return true;
|
|
993
|
+
}
|
|
994
|
+
const value = variables[0].value;
|
|
995
|
+
return value == null || value == void 0 || value === "";
|
|
996
|
+
}
|
|
997
|
+
console.error("unexpected number of children in qti Null");
|
|
998
|
+
return null;
|
|
999
|
+
}
|
|
1000
|
+
};
|
|
1001
|
+
|
|
1002
|
+
// ../qti-processing/dist/components/qti-lcm/qti-lcm.js
|
|
1182
1003
|
var QtiLcm = class extends QtiExpression {
|
|
1183
1004
|
getResult() {
|
|
1184
1005
|
const values = this.#collectIntegerValues(this.getVariables());
|
|
@@ -1247,58 +1068,59 @@ var QtiLcm = class extends QtiExpression {
|
|
|
1247
1068
|
return Math.abs(a * b / this.#gcd(a, b));
|
|
1248
1069
|
}
|
|
1249
1070
|
};
|
|
1250
|
-
customElements.define("qti-lcm", QtiLcm);
|
|
1251
1071
|
|
|
1252
|
-
// ../qti-processing/
|
|
1253
|
-
var
|
|
1254
|
-
|
|
1255
|
-
return
|
|
1072
|
+
// ../qti-processing/dist/components/qti-rule/qti-rule.js
|
|
1073
|
+
var QtiRule = class extends i {
|
|
1074
|
+
render() {
|
|
1075
|
+
return T`<slot></slot>`;
|
|
1256
1076
|
}
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
// ../qti-processing/src/components/qti-is-null/qti-is-null.ts
|
|
1261
|
-
var QtiIsNull = class extends QtiExpression {
|
|
1262
|
-
getResult() {
|
|
1263
|
-
if (this.children.length === 1) {
|
|
1264
|
-
const variables = this.getVariables();
|
|
1265
|
-
if (!variables) {
|
|
1266
|
-
return true;
|
|
1267
|
-
}
|
|
1268
|
-
const value = variables[0].value;
|
|
1269
|
-
return value == null || value == void 0 || value === "";
|
|
1270
|
-
}
|
|
1271
|
-
console.error("unexpected number of children in qti Null");
|
|
1272
|
-
return null;
|
|
1077
|
+
process() {
|
|
1078
|
+
throw new Error("Not implemented");
|
|
1273
1079
|
}
|
|
1274
1080
|
};
|
|
1275
|
-
customElements.define("qti-is-null", QtiIsNull);
|
|
1276
1081
|
|
|
1277
|
-
// ../qti-processing/
|
|
1278
|
-
var
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1082
|
+
// ../qti-processing/dist/components/qti-lookup-outcome-value/qti-lookup-outcome-value.js
|
|
1083
|
+
var __decorate8 = function(decorators, target, key, desc) {
|
|
1084
|
+
var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1085
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc);
|
|
1086
|
+
else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r2 = (c2 < 3 ? d(r2) : c2 > 3 ? d(target, key, r2) : d(target, key)) || r2;
|
|
1087
|
+
return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2;
|
|
1088
|
+
};
|
|
1089
|
+
var QtiLookupOutcomeValue = class extends QtiRule {
|
|
1090
|
+
get childExpression() {
|
|
1091
|
+
return this.firstElementChild;
|
|
1092
|
+
}
|
|
1093
|
+
process() {
|
|
1094
|
+
const identifier = this.getAttribute("identifier");
|
|
1095
|
+
const outcomeVariable = this.context.variables.find((v) => v.identifier === identifier) || null;
|
|
1096
|
+
let value;
|
|
1097
|
+
if (outcomeVariable.interpolationTable) {
|
|
1098
|
+
value = outcomeVariable.interpolationTable.get(parseFloat(this.childExpression.calculate()));
|
|
1291
1099
|
}
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1100
|
+
if (value === null || value === void 0) {
|
|
1101
|
+
console.warn("lookupOutcomeValue: value is null or undefined");
|
|
1102
|
+
return 0;
|
|
1295
1103
|
}
|
|
1296
|
-
|
|
1104
|
+
this.dispatchEvent(new CustomEvent("qti-set-outcome-value", {
|
|
1105
|
+
bubbles: true,
|
|
1106
|
+
composed: true,
|
|
1107
|
+
detail: {
|
|
1108
|
+
outcomeIdentifier: this.identifier,
|
|
1109
|
+
value: convertNumberToUniversalFormat(value)
|
|
1110
|
+
}
|
|
1111
|
+
}));
|
|
1112
|
+
return value;
|
|
1297
1113
|
}
|
|
1298
1114
|
};
|
|
1299
|
-
|
|
1115
|
+
__decorate8([
|
|
1116
|
+
n({ type: String })
|
|
1117
|
+
], QtiLookupOutcomeValue.prototype, "identifier", void 0);
|
|
1118
|
+
__decorate8([
|
|
1119
|
+
c({ context: itemContext, subscribe: true }),
|
|
1120
|
+
r()
|
|
1121
|
+
], QtiLookupOutcomeValue.prototype, "context", void 0);
|
|
1300
1122
|
|
|
1301
|
-
// ../qti-processing/
|
|
1123
|
+
// ../qti-processing/dist/components/qti-lt/qti-lt.js
|
|
1302
1124
|
var QtiLt = class extends QtiExpression {
|
|
1303
1125
|
getResult() {
|
|
1304
1126
|
if (this.children.length === 2) {
|
|
@@ -1315,9 +1137,8 @@ var QtiLt = class extends QtiExpression {
|
|
|
1315
1137
|
return null;
|
|
1316
1138
|
}
|
|
1317
1139
|
};
|
|
1318
|
-
customElements.define("qti-lt", QtiLt);
|
|
1319
1140
|
|
|
1320
|
-
// ../qti-processing/
|
|
1141
|
+
// ../qti-processing/dist/components/qti-lte/qti-lte.js
|
|
1321
1142
|
var QtiLte = class extends QtiConditionExpression {
|
|
1322
1143
|
getResult() {
|
|
1323
1144
|
if (this.children.length === 2) {
|
|
@@ -1335,57 +1156,14 @@ var QtiLte = class extends QtiConditionExpression {
|
|
|
1335
1156
|
return null;
|
|
1336
1157
|
}
|
|
1337
1158
|
};
|
|
1338
|
-
customElements.define("qti-lte", QtiLte);
|
|
1339
1159
|
|
|
1340
|
-
// ../qti-processing/
|
|
1341
|
-
var
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
return null;
|
|
1347
|
-
}
|
|
1348
|
-
const mapping = response.mapping;
|
|
1349
|
-
const candidateResponses = !Array.isArray(response.value) ? [response.value] : response.value;
|
|
1350
|
-
let result = 0;
|
|
1351
|
-
for (const candidateResponse of candidateResponses) {
|
|
1352
|
-
const mappedValues = mapping.mapEntries.filter((entry) => {
|
|
1353
|
-
if (response.baseType === "string" && !entry.caseSensitive) {
|
|
1354
|
-
return ScoringHelper.compareSingleValues(
|
|
1355
|
-
entry.mapKey.toLowerCase(),
|
|
1356
|
-
candidateResponse.toLowerCase(),
|
|
1357
|
-
response.baseType
|
|
1358
|
-
);
|
|
1359
|
-
} else {
|
|
1360
|
-
return ScoringHelper.compareSingleValues(entry.mapKey, candidateResponse, response.baseType);
|
|
1361
|
-
}
|
|
1362
|
-
});
|
|
1363
|
-
const mappedValue = mappedValues.reduce(
|
|
1364
|
-
(prev, current) => prev.mappedValue > current.mappedValue ? prev : current,
|
|
1365
|
-
mappedValues.length > 0 ? mappedValues[0] : { mapKey: null, mappedValue: null }
|
|
1366
|
-
// Use the first element instead of a manual initial value
|
|
1367
|
-
);
|
|
1368
|
-
if (!(mappedValue === null || mappedValue.mappedValue == void 0)) {
|
|
1369
|
-
result += mappedValue.mappedValue;
|
|
1370
|
-
} else {
|
|
1371
|
-
result += mapping.defaultValue;
|
|
1372
|
-
}
|
|
1373
|
-
}
|
|
1374
|
-
if (mapping?.lowerBound !== null && mapping?.lowerBound !== void 0) {
|
|
1375
|
-
result = Math.max(mapping.lowerBound, result);
|
|
1376
|
-
}
|
|
1377
|
-
if (mapping?.upperBound !== null && mapping?.upperBound !== void 0) {
|
|
1378
|
-
result = Math.min(mapping.upperBound, result);
|
|
1379
|
-
}
|
|
1380
|
-
return result;
|
|
1381
|
-
}
|
|
1160
|
+
// ../qti-processing/dist/components/qti-map-response-point/qti-map-response-point.js
|
|
1161
|
+
var __decorate9 = function(decorators, target, key, desc) {
|
|
1162
|
+
var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1163
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc);
|
|
1164
|
+
else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r2 = (c2 < 3 ? d(r2) : c2 > 3 ? d(target, key, r2) : d(target, key)) || r2;
|
|
1165
|
+
return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2;
|
|
1382
1166
|
};
|
|
1383
|
-
__decorateClass([
|
|
1384
|
-
n({ type: String })
|
|
1385
|
-
], QtiMapResponse.prototype, "identifier", 2);
|
|
1386
|
-
customElements.define("qti-map-response", QtiMapResponse);
|
|
1387
|
-
|
|
1388
|
-
// ../qti-processing/src/components/qti-map-response-point/qti-map-response-point.ts
|
|
1389
1167
|
var QtiMapResponsePoint = class extends QtiExpression {
|
|
1390
1168
|
getResult() {
|
|
1391
1169
|
const response = this.context.variables.find((r2) => r2.identifier === this.identifier);
|
|
@@ -1410,11 +1188,7 @@ var QtiMapResponsePoint = class extends QtiExpression {
|
|
|
1410
1188
|
if (mappedAreas.has(entry.coords)) {
|
|
1411
1189
|
continue;
|
|
1412
1190
|
}
|
|
1413
|
-
const isPointInArea = ScoringHelper.isPointInArea(
|
|
1414
|
-
candidateResponse,
|
|
1415
|
-
`${entry.shape},${entry.coords}`,
|
|
1416
|
-
response.baseType
|
|
1417
|
-
);
|
|
1191
|
+
const isPointInArea = ScoringHelper.isPointInArea(candidateResponse, `${entry.shape},${entry.coords}`, response.baseType);
|
|
1418
1192
|
if (isPointInArea) {
|
|
1419
1193
|
result += entry.mappedValue ?? 0;
|
|
1420
1194
|
mappedAreas.add(entry.coords);
|
|
@@ -1433,40 +1207,175 @@ var QtiMapResponsePoint = class extends QtiExpression {
|
|
|
1433
1207
|
return result;
|
|
1434
1208
|
}
|
|
1435
1209
|
};
|
|
1436
|
-
|
|
1210
|
+
__decorate9([
|
|
1437
1211
|
n({ type: String })
|
|
1438
|
-
], QtiMapResponsePoint.prototype, "identifier",
|
|
1439
|
-
customElements.define("qti-map-response-point", QtiMapResponsePoint);
|
|
1212
|
+
], QtiMapResponsePoint.prototype, "identifier", void 0);
|
|
1440
1213
|
|
|
1441
|
-
// ../qti-processing/
|
|
1442
|
-
var
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1214
|
+
// ../qti-processing/dist/components/qti-map-response/qti-map-response.js
|
|
1215
|
+
var __decorate10 = function(decorators, target, key, desc) {
|
|
1216
|
+
var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1217
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc);
|
|
1218
|
+
else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r2 = (c2 < 3 ? d(r2) : c2 > 3 ? d(target, key, r2) : d(target, key)) || r2;
|
|
1219
|
+
return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2;
|
|
1220
|
+
};
|
|
1221
|
+
var QtiMapResponse = class extends QtiExpression {
|
|
1447
1222
|
getResult() {
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
}
|
|
1452
|
-
const variables = this.getVariables();
|
|
1453
|
-
if (!variables || variables.length === 0) {
|
|
1223
|
+
const response = this.context.variables.find((r2) => r2.identifier === this.identifier);
|
|
1224
|
+
if (!response || !response.mapping) {
|
|
1225
|
+
console.error(`Response ${this.identifier} can not be found`);
|
|
1454
1226
|
return null;
|
|
1455
1227
|
}
|
|
1456
|
-
const
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1228
|
+
const mapping = response.mapping;
|
|
1229
|
+
const candidateResponses = !Array.isArray(response.value) ? [response.value] : response.value;
|
|
1230
|
+
let result = 0;
|
|
1231
|
+
for (const candidateResponse of candidateResponses) {
|
|
1232
|
+
const mappedValues = mapping.mapEntries.filter((entry) => {
|
|
1233
|
+
if (response.baseType === "string" && !entry.caseSensitive) {
|
|
1234
|
+
return ScoringHelper.compareSingleValues(entry.mapKey.toLowerCase(), candidateResponse.toLowerCase(), response.baseType);
|
|
1235
|
+
} else {
|
|
1236
|
+
return ScoringHelper.compareSingleValues(entry.mapKey, candidateResponse, response.baseType);
|
|
1237
|
+
}
|
|
1238
|
+
});
|
|
1239
|
+
const mappedValue = mappedValues.reduce(
|
|
1240
|
+
(prev, current) => prev.mappedValue > current.mappedValue ? prev : current,
|
|
1241
|
+
mappedValues.length > 0 ? mappedValues[0] : { mapKey: null, mappedValue: null }
|
|
1242
|
+
// Use the first element instead of a manual initial value
|
|
1243
|
+
);
|
|
1244
|
+
if (!(mappedValue === null || mappedValue.mappedValue == void 0)) {
|
|
1245
|
+
result += mappedValue.mappedValue;
|
|
1246
|
+
} else {
|
|
1247
|
+
result += mapping.defaultValue;
|
|
1468
1248
|
}
|
|
1469
|
-
|
|
1249
|
+
}
|
|
1250
|
+
if (mapping?.lowerBound !== null && mapping?.lowerBound !== void 0) {
|
|
1251
|
+
result = Math.max(mapping.lowerBound, result);
|
|
1252
|
+
}
|
|
1253
|
+
if (mapping?.upperBound !== null && mapping?.upperBound !== void 0) {
|
|
1254
|
+
result = Math.min(mapping.upperBound, result);
|
|
1255
|
+
}
|
|
1256
|
+
return result;
|
|
1257
|
+
}
|
|
1258
|
+
};
|
|
1259
|
+
__decorate10([
|
|
1260
|
+
n({ type: String })
|
|
1261
|
+
], QtiMapResponse.prototype, "identifier", void 0);
|
|
1262
|
+
|
|
1263
|
+
// ../qti-processing/dist/components/qti-match/qti-match.js
|
|
1264
|
+
var QtiMatch = class _QtiMatch extends QtiExpression {
|
|
1265
|
+
//PK : FIXME.
|
|
1266
|
+
// This was a little experiment if we could call the match function as a static function,
|
|
1267
|
+
// This can be used for all kind of things, but now especially for use in
|
|
1268
|
+
// qti-response-condition-script
|
|
1269
|
+
// in which we pass the expressions as pure functions, and hope for the best.
|
|
1270
|
+
// SADLY, the getVariables throws roet in de eten.. weet nog niet precies hoe deze werkt.
|
|
1271
|
+
// Maar ik ga erin duiken.
|
|
1272
|
+
getResult() {
|
|
1273
|
+
if (this.children.length === 2) {
|
|
1274
|
+
const values = this.getVariables();
|
|
1275
|
+
const valueToMap = values[0];
|
|
1276
|
+
const correctValueInfo = values[1];
|
|
1277
|
+
return _QtiMatch.match(valueToMap, correctValueInfo);
|
|
1278
|
+
}
|
|
1279
|
+
console.error("unexpected number of children in match");
|
|
1280
|
+
return null;
|
|
1281
|
+
}
|
|
1282
|
+
static match(valueToMap, correctValueInfo) {
|
|
1283
|
+
if (valueToMap.value === null)
|
|
1284
|
+
return false;
|
|
1285
|
+
switch (correctValueInfo.cardinality) {
|
|
1286
|
+
case "single": {
|
|
1287
|
+
if (Array.isArray(valueToMap.value) || Array.isArray(correctValueInfo.value)) {
|
|
1288
|
+
console.error("unexpected cardinality in qti match");
|
|
1289
|
+
return false;
|
|
1290
|
+
}
|
|
1291
|
+
return ScoringHelper.compareSingleValues(valueToMap.value?.toString(), correctValueInfo.value.toString(), correctValueInfo.baseType);
|
|
1292
|
+
}
|
|
1293
|
+
case "ordered": {
|
|
1294
|
+
if (!Array.isArray(valueToMap.value) || !Array.isArray(correctValueInfo.value)) {
|
|
1295
|
+
console.error("unexpected cardinality in qti match");
|
|
1296
|
+
return false;
|
|
1297
|
+
}
|
|
1298
|
+
if (valueToMap.value.length !== correctValueInfo.value.length) {
|
|
1299
|
+
return false;
|
|
1300
|
+
}
|
|
1301
|
+
for (let i2 = 0; i2 < valueToMap.value.length; i2++) {
|
|
1302
|
+
const result = ScoringHelper.compareSingleValues(correctValueInfo.value[i2], valueToMap.value[i2], correctValueInfo.baseType);
|
|
1303
|
+
if (!result) {
|
|
1304
|
+
return false;
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
return true;
|
|
1308
|
+
}
|
|
1309
|
+
case "multiple": {
|
|
1310
|
+
if (!Array.isArray(valueToMap.value) || !Array.isArray(correctValueInfo.value)) {
|
|
1311
|
+
console.error("unexpected cardinality in qti match");
|
|
1312
|
+
return false;
|
|
1313
|
+
}
|
|
1314
|
+
if (valueToMap.value.length !== correctValueInfo.value.length) {
|
|
1315
|
+
return false;
|
|
1316
|
+
}
|
|
1317
|
+
let answerIndex = 0;
|
|
1318
|
+
for (const correctAnswer of correctValueInfo.value) {
|
|
1319
|
+
let matchingValue = null;
|
|
1320
|
+
const arr = [...valueToMap.value];
|
|
1321
|
+
for (const mv of arr) {
|
|
1322
|
+
const result = ScoringHelper.compareSingleValues(correctAnswer, mv, correctValueInfo.baseType);
|
|
1323
|
+
if (result) {
|
|
1324
|
+
matchingValue = mv;
|
|
1325
|
+
break;
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
if (matchingValue !== null) {
|
|
1329
|
+
arr.splice(arr.indexOf(matchingValue), 1);
|
|
1330
|
+
} else {
|
|
1331
|
+
return false;
|
|
1332
|
+
}
|
|
1333
|
+
answerIndex++;
|
|
1334
|
+
}
|
|
1335
|
+
return true;
|
|
1336
|
+
}
|
|
1337
|
+
default:
|
|
1338
|
+
console.error("unexpected cardinality in qti match");
|
|
1339
|
+
return false;
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
};
|
|
1343
|
+
|
|
1344
|
+
// ../qti-processing/dist/components/qti-math-operator/qti-math-operator.js
|
|
1345
|
+
var __decorate11 = function(decorators, target, key, desc) {
|
|
1346
|
+
var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1347
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc);
|
|
1348
|
+
else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r2 = (c2 < 3 ? d(r2) : c2 > 3 ? d(target, key, r2) : d(target, key)) || r2;
|
|
1349
|
+
return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2;
|
|
1350
|
+
};
|
|
1351
|
+
var QtiMathOperator = class extends QtiExpression {
|
|
1352
|
+
constructor() {
|
|
1353
|
+
super(...arguments);
|
|
1354
|
+
this.name = "";
|
|
1355
|
+
}
|
|
1356
|
+
getResult() {
|
|
1357
|
+
if (!this.name) {
|
|
1358
|
+
console.error("qti-math-operator requires a name attribute");
|
|
1359
|
+
return null;
|
|
1360
|
+
}
|
|
1361
|
+
const variables = this.getVariables();
|
|
1362
|
+
if (!variables || variables.length === 0) {
|
|
1363
|
+
return null;
|
|
1364
|
+
}
|
|
1365
|
+
const values = [];
|
|
1366
|
+
for (const variable of variables) {
|
|
1367
|
+
if (variable.cardinality !== "single") {
|
|
1368
|
+
console.error("qti-math-operator requires single cardinality");
|
|
1369
|
+
return null;
|
|
1370
|
+
}
|
|
1371
|
+
if (Array.isArray(variable.value)) {
|
|
1372
|
+
console.error("qti-math-operator unexpected array value for single cardinality");
|
|
1373
|
+
return null;
|
|
1374
|
+
}
|
|
1375
|
+
if (variable.value === null || variable.value === void 0) {
|
|
1376
|
+
return null;
|
|
1377
|
+
}
|
|
1378
|
+
if (variable.baseType !== "integer" && variable.baseType !== "float") {
|
|
1470
1379
|
console.error("qti-math-operator requires numerical base-type");
|
|
1471
1380
|
return null;
|
|
1472
1381
|
}
|
|
@@ -1484,74 +1393,100 @@ var QtiMathOperator = class extends QtiExpression {
|
|
|
1484
1393
|
switch (operation.toLowerCase()) {
|
|
1485
1394
|
// Single argument functions
|
|
1486
1395
|
case "sin":
|
|
1487
|
-
if (values.length !== 1)
|
|
1396
|
+
if (values.length !== 1)
|
|
1397
|
+
return null;
|
|
1488
1398
|
return Math.sin(values[0]);
|
|
1489
1399
|
case "cos":
|
|
1490
|
-
if (values.length !== 1)
|
|
1400
|
+
if (values.length !== 1)
|
|
1401
|
+
return null;
|
|
1491
1402
|
return Math.cos(values[0]);
|
|
1492
1403
|
case "tan":
|
|
1493
|
-
if (values.length !== 1)
|
|
1404
|
+
if (values.length !== 1)
|
|
1405
|
+
return null;
|
|
1494
1406
|
return Math.tan(values[0]);
|
|
1495
1407
|
case "asin":
|
|
1496
|
-
if (values.length !== 1)
|
|
1497
|
-
|
|
1408
|
+
if (values.length !== 1)
|
|
1409
|
+
return null;
|
|
1410
|
+
if (values[0] < -1 || values[0] > 1)
|
|
1411
|
+
return null;
|
|
1498
1412
|
return Math.asin(values[0]);
|
|
1499
1413
|
case "acos":
|
|
1500
|
-
if (values.length !== 1)
|
|
1501
|
-
|
|
1414
|
+
if (values.length !== 1)
|
|
1415
|
+
return null;
|
|
1416
|
+
if (values[0] < -1 || values[0] > 1)
|
|
1417
|
+
return null;
|
|
1502
1418
|
return Math.acos(values[0]);
|
|
1503
1419
|
case "atan":
|
|
1504
|
-
if (values.length !== 1)
|
|
1420
|
+
if (values.length !== 1)
|
|
1421
|
+
return null;
|
|
1505
1422
|
return Math.atan(values[0]);
|
|
1506
1423
|
case "sinh":
|
|
1507
|
-
if (values.length !== 1)
|
|
1424
|
+
if (values.length !== 1)
|
|
1425
|
+
return null;
|
|
1508
1426
|
return Math.sinh(values[0]);
|
|
1509
1427
|
case "cosh":
|
|
1510
|
-
if (values.length !== 1)
|
|
1428
|
+
if (values.length !== 1)
|
|
1429
|
+
return null;
|
|
1511
1430
|
return Math.cosh(values[0]);
|
|
1512
1431
|
case "tanh":
|
|
1513
|
-
if (values.length !== 1)
|
|
1432
|
+
if (values.length !== 1)
|
|
1433
|
+
return null;
|
|
1514
1434
|
return Math.tanh(values[0]);
|
|
1515
1435
|
case "log":
|
|
1516
|
-
if (values.length !== 1)
|
|
1517
|
-
|
|
1436
|
+
if (values.length !== 1)
|
|
1437
|
+
return null;
|
|
1438
|
+
if (values[0] <= 0)
|
|
1439
|
+
return null;
|
|
1518
1440
|
return Math.log(values[0]);
|
|
1519
1441
|
case "ln":
|
|
1520
|
-
if (values.length !== 1)
|
|
1521
|
-
|
|
1442
|
+
if (values.length !== 1)
|
|
1443
|
+
return null;
|
|
1444
|
+
if (values[0] <= 0)
|
|
1445
|
+
return null;
|
|
1522
1446
|
return Math.log(values[0]);
|
|
1523
1447
|
case "log10":
|
|
1524
|
-
if (values.length !== 1)
|
|
1525
|
-
|
|
1448
|
+
if (values.length !== 1)
|
|
1449
|
+
return null;
|
|
1450
|
+
if (values[0] <= 0)
|
|
1451
|
+
return null;
|
|
1526
1452
|
return Math.log10(values[0]);
|
|
1527
1453
|
case "exp":
|
|
1528
|
-
if (values.length !== 1)
|
|
1454
|
+
if (values.length !== 1)
|
|
1455
|
+
return null;
|
|
1529
1456
|
return Math.exp(values[0]);
|
|
1530
1457
|
case "abs":
|
|
1531
|
-
if (values.length !== 1)
|
|
1458
|
+
if (values.length !== 1)
|
|
1459
|
+
return null;
|
|
1532
1460
|
return Math.abs(values[0]);
|
|
1533
1461
|
case "sqrt":
|
|
1534
|
-
if (values.length !== 1)
|
|
1535
|
-
|
|
1462
|
+
if (values.length !== 1)
|
|
1463
|
+
return null;
|
|
1464
|
+
if (values[0] < 0)
|
|
1465
|
+
return null;
|
|
1536
1466
|
return Math.sqrt(values[0]);
|
|
1537
1467
|
case "signum":
|
|
1538
|
-
if (values.length !== 1)
|
|
1468
|
+
if (values.length !== 1)
|
|
1469
|
+
return null;
|
|
1539
1470
|
return Math.sign(values[0]);
|
|
1540
1471
|
// Returns -1, 0, or 1 (integer)
|
|
1541
1472
|
case "floor":
|
|
1542
|
-
if (values.length !== 1)
|
|
1473
|
+
if (values.length !== 1)
|
|
1474
|
+
return null;
|
|
1543
1475
|
return Math.floor(values[0]);
|
|
1544
1476
|
// Returns integer
|
|
1545
1477
|
case "ceil":
|
|
1546
|
-
if (values.length !== 1)
|
|
1478
|
+
if (values.length !== 1)
|
|
1479
|
+
return null;
|
|
1547
1480
|
return Math.ceil(values[0]);
|
|
1548
1481
|
// Returns integer
|
|
1549
1482
|
case "round":
|
|
1550
|
-
if (values.length !== 1)
|
|
1483
|
+
if (values.length !== 1)
|
|
1484
|
+
return null;
|
|
1551
1485
|
return Math.round(values[0]);
|
|
1552
1486
|
// Two argument functions
|
|
1553
1487
|
case "atan2":
|
|
1554
|
-
if (values.length !== 2)
|
|
1488
|
+
if (values.length !== 2)
|
|
1489
|
+
return null;
|
|
1555
1490
|
return Math.atan2(values[0], values[1]);
|
|
1556
1491
|
case "pow": {
|
|
1557
1492
|
if (values.length !== 2) {
|
|
@@ -1559,8 +1494,10 @@ var QtiMathOperator = class extends QtiExpression {
|
|
|
1559
1494
|
}
|
|
1560
1495
|
const base = values[0];
|
|
1561
1496
|
const exponent = values[1];
|
|
1562
|
-
if (base === 0 && exponent <= 0)
|
|
1563
|
-
|
|
1497
|
+
if (base === 0 && exponent <= 0)
|
|
1498
|
+
return null;
|
|
1499
|
+
if (base < 0 && !Number.isInteger(exponent))
|
|
1500
|
+
return null;
|
|
1564
1501
|
return Math.pow(base, exponent);
|
|
1565
1502
|
}
|
|
1566
1503
|
case "log_base": {
|
|
@@ -1569,18 +1506,23 @@ var QtiMathOperator = class extends QtiExpression {
|
|
|
1569
1506
|
}
|
|
1570
1507
|
const value = values[0];
|
|
1571
1508
|
const base = values[1];
|
|
1572
|
-
if (value <= 0 || base <= 0 || base === 1)
|
|
1509
|
+
if (value <= 0 || base <= 0 || base === 1)
|
|
1510
|
+
return null;
|
|
1573
1511
|
return Math.log(value) / Math.log(base);
|
|
1574
1512
|
}
|
|
1575
1513
|
case "mod":
|
|
1576
|
-
if (values.length !== 2)
|
|
1577
|
-
|
|
1514
|
+
if (values.length !== 2)
|
|
1515
|
+
return null;
|
|
1516
|
+
if (values[1] === 0)
|
|
1517
|
+
return null;
|
|
1578
1518
|
return values[0] % values[1];
|
|
1579
1519
|
case "max":
|
|
1580
|
-
if (values.length < 1)
|
|
1520
|
+
if (values.length < 1)
|
|
1521
|
+
return null;
|
|
1581
1522
|
return Math.max(...values);
|
|
1582
1523
|
case "min":
|
|
1583
|
-
if (values.length < 1)
|
|
1524
|
+
if (values.length < 1)
|
|
1525
|
+
return null;
|
|
1584
1526
|
return Math.min(...values);
|
|
1585
1527
|
default:
|
|
1586
1528
|
console.error(`qti-math-operator: unknown operation "${operation}"`);
|
|
@@ -1592,101 +1534,11 @@ var QtiMathOperator = class extends QtiExpression {
|
|
|
1592
1534
|
}
|
|
1593
1535
|
}
|
|
1594
1536
|
};
|
|
1595
|
-
|
|
1537
|
+
__decorate11([
|
|
1596
1538
|
n({ type: String })
|
|
1597
|
-
], QtiMathOperator.prototype, "name",
|
|
1598
|
-
customElements.define("qti-math-operator", QtiMathOperator);
|
|
1599
|
-
|
|
1600
|
-
// ../qti-processing/src/components/qti-match/qti-match.ts
|
|
1601
|
-
var QtiMatch = class _QtiMatch extends QtiExpression {
|
|
1602
|
-
//PK : FIXME.
|
|
1603
|
-
// This was a little experiment if we could call the match function as a static function,
|
|
1604
|
-
// This can be used for all kind of things, but now especially for use in
|
|
1605
|
-
// qti-response-condition-script
|
|
1606
|
-
// in which we pass the expressions as pure functions, and hope for the best.
|
|
1607
|
-
// SADLY, the getVariables throws roet in de eten.. weet nog niet precies hoe deze werkt.
|
|
1608
|
-
// Maar ik ga erin duiken.
|
|
1609
|
-
getResult() {
|
|
1610
|
-
if (this.children.length === 2) {
|
|
1611
|
-
const values = this.getVariables();
|
|
1612
|
-
const valueToMap = values[0];
|
|
1613
|
-
const correctValueInfo = values[1];
|
|
1614
|
-
return _QtiMatch.match(valueToMap, correctValueInfo);
|
|
1615
|
-
}
|
|
1616
|
-
console.error("unexpected number of children in match");
|
|
1617
|
-
return null;
|
|
1618
|
-
}
|
|
1619
|
-
static match(valueToMap, correctValueInfo) {
|
|
1620
|
-
if (valueToMap.value === null) return false;
|
|
1621
|
-
switch (correctValueInfo.cardinality) {
|
|
1622
|
-
case "single": {
|
|
1623
|
-
if (Array.isArray(valueToMap.value) || Array.isArray(correctValueInfo.value)) {
|
|
1624
|
-
console.error("unexpected cardinality in qti match");
|
|
1625
|
-
return false;
|
|
1626
|
-
}
|
|
1627
|
-
return ScoringHelper.compareSingleValues(
|
|
1628
|
-
valueToMap.value?.toString(),
|
|
1629
|
-
correctValueInfo.value.toString(),
|
|
1630
|
-
correctValueInfo.baseType
|
|
1631
|
-
);
|
|
1632
|
-
}
|
|
1633
|
-
case "ordered": {
|
|
1634
|
-
if (!Array.isArray(valueToMap.value) || !Array.isArray(correctValueInfo.value)) {
|
|
1635
|
-
console.error("unexpected cardinality in qti match");
|
|
1636
|
-
return false;
|
|
1637
|
-
}
|
|
1638
|
-
if (valueToMap.value.length !== correctValueInfo.value.length) {
|
|
1639
|
-
return false;
|
|
1640
|
-
}
|
|
1641
|
-
for (let i2 = 0; i2 < valueToMap.value.length; i2++) {
|
|
1642
|
-
const result = ScoringHelper.compareSingleValues(
|
|
1643
|
-
correctValueInfo.value[i2],
|
|
1644
|
-
valueToMap.value[i2],
|
|
1645
|
-
correctValueInfo.baseType
|
|
1646
|
-
);
|
|
1647
|
-
if (!result) {
|
|
1648
|
-
return false;
|
|
1649
|
-
}
|
|
1650
|
-
}
|
|
1651
|
-
return true;
|
|
1652
|
-
}
|
|
1653
|
-
case "multiple": {
|
|
1654
|
-
if (!Array.isArray(valueToMap.value) || !Array.isArray(correctValueInfo.value)) {
|
|
1655
|
-
console.error("unexpected cardinality in qti match");
|
|
1656
|
-
return false;
|
|
1657
|
-
}
|
|
1658
|
-
if (valueToMap.value.length !== correctValueInfo.value.length) {
|
|
1659
|
-
return false;
|
|
1660
|
-
}
|
|
1661
|
-
let answerIndex = 0;
|
|
1662
|
-
for (const correctAnswer of correctValueInfo.value) {
|
|
1663
|
-
let matchingValue = null;
|
|
1664
|
-
const arr = [...valueToMap.value];
|
|
1665
|
-
for (const mv of arr) {
|
|
1666
|
-
const result = ScoringHelper.compareSingleValues(correctAnswer, mv, correctValueInfo.baseType);
|
|
1667
|
-
if (result) {
|
|
1668
|
-
matchingValue = mv;
|
|
1669
|
-
break;
|
|
1670
|
-
}
|
|
1671
|
-
}
|
|
1672
|
-
if (matchingValue !== null) {
|
|
1673
|
-
arr.splice(arr.indexOf(matchingValue), 1);
|
|
1674
|
-
} else {
|
|
1675
|
-
return false;
|
|
1676
|
-
}
|
|
1677
|
-
answerIndex++;
|
|
1678
|
-
}
|
|
1679
|
-
return true;
|
|
1680
|
-
}
|
|
1681
|
-
default:
|
|
1682
|
-
console.error("unexpected cardinality in qti match");
|
|
1683
|
-
return false;
|
|
1684
|
-
}
|
|
1685
|
-
}
|
|
1686
|
-
};
|
|
1687
|
-
customElements.define("qti-match", QtiMatch);
|
|
1539
|
+
], QtiMathOperator.prototype, "name", void 0);
|
|
1688
1540
|
|
|
1689
|
-
// ../qti-processing/
|
|
1541
|
+
// ../qti-processing/dist/components/qti-max/qti-max.js
|
|
1690
1542
|
var QtiMax = class extends QtiExpression {
|
|
1691
1543
|
getResult() {
|
|
1692
1544
|
const values = this.#collectNumericValues(this.getVariables());
|
|
@@ -1722,9 +1574,8 @@ var QtiMax = class extends QtiExpression {
|
|
|
1722
1574
|
return values;
|
|
1723
1575
|
}
|
|
1724
1576
|
};
|
|
1725
|
-
customElements.define("qti-max", QtiMax);
|
|
1726
1577
|
|
|
1727
|
-
// ../qti-processing/
|
|
1578
|
+
// ../qti-processing/dist/components/qti-member/qti-member.js
|
|
1728
1579
|
var QtiMember = class extends QtiExpression {
|
|
1729
1580
|
getResult() {
|
|
1730
1581
|
const values = this.getVariables();
|
|
@@ -1752,9 +1603,8 @@ var QtiMember = class extends QtiExpression {
|
|
|
1752
1603
|
return projection2.includes(projection1);
|
|
1753
1604
|
}
|
|
1754
1605
|
};
|
|
1755
|
-
customElements.define("qti-member", QtiMember);
|
|
1756
1606
|
|
|
1757
|
-
// ../qti-processing/
|
|
1607
|
+
// ../qti-processing/dist/components/qti-min/qti-min.js
|
|
1758
1608
|
var QtiMin = class extends QtiExpression {
|
|
1759
1609
|
getResult() {
|
|
1760
1610
|
const values = this.#collectNumericValues(this.getVariables());
|
|
@@ -1790,9 +1640,8 @@ var QtiMin = class extends QtiExpression {
|
|
|
1790
1640
|
return values;
|
|
1791
1641
|
}
|
|
1792
1642
|
};
|
|
1793
|
-
customElements.define("qti-min", QtiMin);
|
|
1794
1643
|
|
|
1795
|
-
// ../qti-processing/
|
|
1644
|
+
// ../qti-processing/dist/components/qti-multiple/qti-multiple.js
|
|
1796
1645
|
var QtiMultiple = class extends QtiExpression {
|
|
1797
1646
|
getResult() {
|
|
1798
1647
|
console.debug("qti-multiple getResult called", this.innerHTML);
|
|
@@ -1810,9 +1659,8 @@ var QtiMultiple = class extends QtiExpression {
|
|
|
1810
1659
|
return variables;
|
|
1811
1660
|
}
|
|
1812
1661
|
};
|
|
1813
|
-
customElements.define("qti-multiple", QtiMultiple);
|
|
1814
1662
|
|
|
1815
|
-
// ../qti-processing/
|
|
1663
|
+
// ../qti-processing/dist/components/qti-not/qti-not.js
|
|
1816
1664
|
var QtiNot = class extends QtiExpression {
|
|
1817
1665
|
render() {
|
|
1818
1666
|
return T`${super.render()}`;
|
|
@@ -1823,9 +1671,15 @@ var QtiNot = class extends QtiExpression {
|
|
|
1823
1671
|
return !result;
|
|
1824
1672
|
}
|
|
1825
1673
|
};
|
|
1826
|
-
customElements.define("qti-not", QtiNot);
|
|
1827
1674
|
|
|
1828
|
-
// ../qti-processing/
|
|
1675
|
+
// ../qti-processing/dist/components/qti-null/qti-null.js
|
|
1676
|
+
var QtiNull = class extends QtiExpression {
|
|
1677
|
+
getResult() {
|
|
1678
|
+
return null;
|
|
1679
|
+
}
|
|
1680
|
+
};
|
|
1681
|
+
|
|
1682
|
+
// ../qti-processing/dist/components/qti-or/qti-or.js
|
|
1829
1683
|
var QtiOr = class extends QtiConditionExpression {
|
|
1830
1684
|
getResult() {
|
|
1831
1685
|
const values = Array.from(this.children).map((c2) => {
|
|
@@ -1857,9 +1711,8 @@ var QtiOr = class extends QtiConditionExpression {
|
|
|
1857
1711
|
});
|
|
1858
1712
|
}
|
|
1859
1713
|
};
|
|
1860
|
-
customElements.define("qti-or", QtiOr);
|
|
1861
1714
|
|
|
1862
|
-
// ../qti-processing/
|
|
1715
|
+
// ../qti-processing/dist/components/qti-ordered/qti-ordered.js
|
|
1863
1716
|
var QtiOrdered = class extends QtiExpression {
|
|
1864
1717
|
getResult() {
|
|
1865
1718
|
const variables = this.getVariables();
|
|
@@ -1876,25 +1729,66 @@ var QtiOrdered = class extends QtiExpression {
|
|
|
1876
1729
|
return variables;
|
|
1877
1730
|
}
|
|
1878
1731
|
};
|
|
1879
|
-
customElements.define("qti-ordered", QtiOrdered);
|
|
1880
1732
|
|
|
1881
|
-
// ../qti-processing/
|
|
1882
|
-
var
|
|
1733
|
+
// ../qti-processing/dist/components/qti-pattern-match/qti-pattern-match.js
|
|
1734
|
+
var __decorate12 = function(decorators, target, key, desc) {
|
|
1735
|
+
var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1736
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc);
|
|
1737
|
+
else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r2 = (c2 < 3 ? d(r2) : c2 > 3 ? d(target, key, r2) : d(target, key)) || r2;
|
|
1738
|
+
return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2;
|
|
1739
|
+
};
|
|
1740
|
+
var QtiPatternMatch = class extends QtiExpression {
|
|
1741
|
+
constructor() {
|
|
1742
|
+
super(...arguments);
|
|
1743
|
+
this.pattern = "";
|
|
1744
|
+
}
|
|
1883
1745
|
getResult() {
|
|
1884
|
-
|
|
1885
|
-
|
|
1746
|
+
const variables = this.getVariables();
|
|
1747
|
+
if (variables.length !== 1) {
|
|
1748
|
+
console.error("qti-pattern-match requires exactly one child expression");
|
|
1886
1749
|
return null;
|
|
1887
1750
|
}
|
|
1888
|
-
|
|
1889
|
-
|
|
1751
|
+
if (!this.pattern) {
|
|
1752
|
+
console.error("qti-pattern-match requires a pattern attribute");
|
|
1890
1753
|
return null;
|
|
1891
1754
|
}
|
|
1892
|
-
const
|
|
1893
|
-
if (
|
|
1894
|
-
console.error("qti-
|
|
1755
|
+
const variable = variables[0];
|
|
1756
|
+
if (variable.cardinality !== "single" || Array.isArray(variable.value)) {
|
|
1757
|
+
console.error("qti-pattern-match requires single cardinality");
|
|
1895
1758
|
return null;
|
|
1896
1759
|
}
|
|
1897
|
-
if (
|
|
1760
|
+
if (variable.value === null || variable.value === void 0) {
|
|
1761
|
+
return null;
|
|
1762
|
+
}
|
|
1763
|
+
try {
|
|
1764
|
+
return new RegExp(this.pattern).test(variable.value.toString());
|
|
1765
|
+
} catch (error) {
|
|
1766
|
+
console.error("qti-pattern-match requires a valid regular expression", error);
|
|
1767
|
+
return null;
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
};
|
|
1771
|
+
__decorate12([
|
|
1772
|
+
n({ type: String })
|
|
1773
|
+
], QtiPatternMatch.prototype, "pattern", void 0);
|
|
1774
|
+
|
|
1775
|
+
// ../qti-processing/dist/components/qti-power/qti-power.js
|
|
1776
|
+
var QtiPower = class extends QtiExpression {
|
|
1777
|
+
getResult() {
|
|
1778
|
+
if (this.children.length !== 2) {
|
|
1779
|
+
console.error("qti-power must have exactly two child expressions");
|
|
1780
|
+
return null;
|
|
1781
|
+
}
|
|
1782
|
+
const variables = this.getVariables();
|
|
1783
|
+
if (!variables || variables.length !== 2) {
|
|
1784
|
+
return null;
|
|
1785
|
+
}
|
|
1786
|
+
const [base, exponent] = variables;
|
|
1787
|
+
if (base.cardinality !== "single" || exponent.cardinality !== "single") {
|
|
1788
|
+
console.error("qti-power requires single cardinality for both expressions");
|
|
1789
|
+
return null;
|
|
1790
|
+
}
|
|
1791
|
+
if (Array.isArray(base.value) || Array.isArray(exponent.value)) {
|
|
1898
1792
|
console.error("qti-power unexpected array value for single cardinality");
|
|
1899
1793
|
return null;
|
|
1900
1794
|
}
|
|
@@ -1948,46 +1842,14 @@ var QtiPower = class extends QtiExpression {
|
|
|
1948
1842
|
return result;
|
|
1949
1843
|
}
|
|
1950
1844
|
};
|
|
1951
|
-
customElements.define("qti-power", QtiPower);
|
|
1952
1845
|
|
|
1953
|
-
// ../qti-processing/
|
|
1954
|
-
var
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
getResult() {
|
|
1960
|
-
const variables = this.getVariables();
|
|
1961
|
-
if (variables.length !== 1) {
|
|
1962
|
-
console.error("qti-pattern-match requires exactly one child expression");
|
|
1963
|
-
return null;
|
|
1964
|
-
}
|
|
1965
|
-
if (!this.pattern) {
|
|
1966
|
-
console.error("qti-pattern-match requires a pattern attribute");
|
|
1967
|
-
return null;
|
|
1968
|
-
}
|
|
1969
|
-
const variable = variables[0];
|
|
1970
|
-
if (variable.cardinality !== "single" || Array.isArray(variable.value)) {
|
|
1971
|
-
console.error("qti-pattern-match requires single cardinality");
|
|
1972
|
-
return null;
|
|
1973
|
-
}
|
|
1974
|
-
if (variable.value === null || variable.value === void 0) {
|
|
1975
|
-
return null;
|
|
1976
|
-
}
|
|
1977
|
-
try {
|
|
1978
|
-
return new RegExp(this.pattern).test(variable.value.toString());
|
|
1979
|
-
} catch (error) {
|
|
1980
|
-
console.error("qti-pattern-match requires a valid regular expression", error);
|
|
1981
|
-
return null;
|
|
1982
|
-
}
|
|
1983
|
-
}
|
|
1846
|
+
// ../qti-processing/dist/components/qti-printed-variable/qti-printed-variable.js
|
|
1847
|
+
var __decorate13 = function(decorators, target, key, desc) {
|
|
1848
|
+
var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1849
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc);
|
|
1850
|
+
else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r2 = (c2 < 3 ? d(r2) : c2 > 3 ? d(target, key, r2) : d(target, key)) || r2;
|
|
1851
|
+
return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2;
|
|
1984
1852
|
};
|
|
1985
|
-
__decorateClass([
|
|
1986
|
-
n({ type: String })
|
|
1987
|
-
], QtiPatternMatch.prototype, "pattern", 2);
|
|
1988
|
-
customElements.define("qti-pattern-match", QtiPatternMatch);
|
|
1989
|
-
|
|
1990
|
-
// ../qti-processing/src/components/qti-printed-variable/qti-printed-variable.ts
|
|
1991
1853
|
var QtiPrintedVariable = class extends i {
|
|
1992
1854
|
render() {
|
|
1993
1855
|
const value = this.context?.variables.find((v) => v.identifier === this.identifier)?.value;
|
|
@@ -1998,16 +1860,15 @@ var QtiPrintedVariable = class extends i {
|
|
|
1998
1860
|
return result;
|
|
1999
1861
|
}
|
|
2000
1862
|
};
|
|
2001
|
-
|
|
1863
|
+
__decorate13([
|
|
2002
1864
|
n({ type: String })
|
|
2003
|
-
], QtiPrintedVariable.prototype, "identifier",
|
|
2004
|
-
|
|
1865
|
+
], QtiPrintedVariable.prototype, "identifier", void 0);
|
|
1866
|
+
__decorate13([
|
|
2005
1867
|
c({ context: itemContext, subscribe: true }),
|
|
2006
1868
|
r()
|
|
2007
|
-
], QtiPrintedVariable.prototype, "context",
|
|
2008
|
-
customElements.define("qti-printed-variable", QtiPrintedVariable);
|
|
1869
|
+
], QtiPrintedVariable.prototype, "context", void 0);
|
|
2009
1870
|
|
|
2010
|
-
// ../qti-processing/
|
|
1871
|
+
// ../qti-processing/dist/components/qti-product/qti-product.js
|
|
2011
1872
|
var QtiProduct = class extends QtiExpression {
|
|
2012
1873
|
getResult() {
|
|
2013
1874
|
const values = this.getVariables();
|
|
@@ -2026,107 +1887,401 @@ var QtiProduct = class extends QtiExpression {
|
|
|
2026
1887
|
return product;
|
|
2027
1888
|
}
|
|
2028
1889
|
};
|
|
2029
|
-
customElements.define("qti-product", QtiProduct);
|
|
2030
1890
|
|
|
2031
|
-
// ../qti-processing/
|
|
2032
|
-
var
|
|
1891
|
+
// ../qti-processing/dist/components/qti-random-integer/qti-random-integer.js
|
|
1892
|
+
var __decorate14 = function(decorators, target, key, desc) {
|
|
1893
|
+
var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1894
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc);
|
|
1895
|
+
else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r2 = (c2 < 3 ? d(r2) : c2 > 3 ? d(target, key, r2) : d(target, key)) || r2;
|
|
1896
|
+
return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2;
|
|
1897
|
+
};
|
|
1898
|
+
var QtiRandomInteger = class extends QtiExpression {
|
|
1899
|
+
constructor() {
|
|
1900
|
+
super(...arguments);
|
|
1901
|
+
this.min = 0;
|
|
1902
|
+
this.max = 10;
|
|
1903
|
+
this.step = 1;
|
|
1904
|
+
}
|
|
1905
|
+
getResult() {
|
|
1906
|
+
if (this.min > this.max) {
|
|
1907
|
+
console.error("qti-random-integer: min cannot be greater than max");
|
|
1908
|
+
return this.min;
|
|
1909
|
+
}
|
|
1910
|
+
if (this.step <= 0) {
|
|
1911
|
+
console.error("qti-random-integer: step must be positive");
|
|
1912
|
+
return this.min;
|
|
1913
|
+
}
|
|
1914
|
+
const possibleValues = [];
|
|
1915
|
+
let n2 = 0;
|
|
1916
|
+
while (true) {
|
|
1917
|
+
const value = this.min + this.step * n2;
|
|
1918
|
+
if (value > this.max) {
|
|
1919
|
+
break;
|
|
1920
|
+
}
|
|
1921
|
+
if (Number.isInteger(value)) {
|
|
1922
|
+
possibleValues.push(value);
|
|
1923
|
+
}
|
|
1924
|
+
n2++;
|
|
1925
|
+
}
|
|
1926
|
+
if (possibleValues.length === 0) {
|
|
1927
|
+
console.warn("qti-random-integer: no valid integer values in range");
|
|
1928
|
+
return Number.isInteger(this.min) ? this.min : Math.floor(this.min);
|
|
1929
|
+
}
|
|
1930
|
+
const randomIndex = Math.floor(Math.random() * possibleValues.length);
|
|
1931
|
+
return possibleValues[randomIndex];
|
|
1932
|
+
}
|
|
1933
|
+
/**
|
|
1934
|
+
* Get all possible values for testing purposes
|
|
1935
|
+
*/
|
|
1936
|
+
getPossibleValues() {
|
|
1937
|
+
const possibleValues = [];
|
|
1938
|
+
if (this.min > this.max || this.step <= 0) {
|
|
1939
|
+
return [Number.isInteger(this.min) ? this.min : Math.floor(this.min)];
|
|
1940
|
+
}
|
|
1941
|
+
let n2 = 0;
|
|
1942
|
+
while (true) {
|
|
1943
|
+
const value = this.min + this.step * n2;
|
|
1944
|
+
if (value > this.max) {
|
|
1945
|
+
break;
|
|
1946
|
+
}
|
|
1947
|
+
if (Number.isInteger(value)) {
|
|
1948
|
+
possibleValues.push(value);
|
|
1949
|
+
}
|
|
1950
|
+
n2++;
|
|
1951
|
+
}
|
|
1952
|
+
return possibleValues.length > 0 ? possibleValues : [Number.isInteger(this.min) ? this.min : Math.floor(this.min)];
|
|
1953
|
+
}
|
|
1954
|
+
};
|
|
1955
|
+
__decorate14([
|
|
1956
|
+
n({ type: Number })
|
|
1957
|
+
], QtiRandomInteger.prototype, "min", void 0);
|
|
1958
|
+
__decorate14([
|
|
1959
|
+
n({ type: Number })
|
|
1960
|
+
], QtiRandomInteger.prototype, "max", void 0);
|
|
1961
|
+
__decorate14([
|
|
1962
|
+
n({ type: Number })
|
|
1963
|
+
], QtiRandomInteger.prototype, "step", void 0);
|
|
1964
|
+
|
|
1965
|
+
// ../qti-processing/dist/components/qti-random/qti-random.js
|
|
1966
|
+
var QtiRandom = class extends QtiExpression {
|
|
1967
|
+
getResult() {
|
|
1968
|
+
const values = this.getVariables();
|
|
1969
|
+
if (values.length === 1) {
|
|
1970
|
+
const value = values[0].value;
|
|
1971
|
+
if (Array.isArray(value)) {
|
|
1972
|
+
const randomIndex = Math.floor(Math.random() * value.length);
|
|
1973
|
+
return value[randomIndex];
|
|
1974
|
+
}
|
|
1975
|
+
return value;
|
|
1976
|
+
}
|
|
1977
|
+
console.error("unexpected number of children in match");
|
|
1978
|
+
return null;
|
|
1979
|
+
}
|
|
1980
|
+
};
|
|
1981
|
+
|
|
1982
|
+
// ../qti-processing/dist/components/qti-repeat/qti-repeat.js
|
|
1983
|
+
var __decorate15 = function(decorators, target, key, desc) {
|
|
1984
|
+
var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1985
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc);
|
|
1986
|
+
else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r2 = (c2 < 3 ? d(r2) : c2 > 3 ? d(target, key, r2) : d(target, key)) || r2;
|
|
1987
|
+
return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2;
|
|
1988
|
+
};
|
|
1989
|
+
var QtiRepeat = class extends QtiExpression {
|
|
1990
|
+
constructor() {
|
|
1991
|
+
super(...arguments);
|
|
1992
|
+
this.numberRepeats = "";
|
|
1993
|
+
}
|
|
1994
|
+
getResult() {
|
|
1995
|
+
const count = this.#resolveRepeatCount();
|
|
1996
|
+
if (count <= 0) {
|
|
1997
|
+
return [];
|
|
1998
|
+
}
|
|
1999
|
+
const expression = this.firstElementChild;
|
|
2000
|
+
if (!expression) {
|
|
2001
|
+
console.warn("qti-repeat: missing child expression");
|
|
2002
|
+
return [];
|
|
2003
|
+
}
|
|
2004
|
+
const results = [];
|
|
2005
|
+
for (let i2 = 0; i2 < count; i2++) {
|
|
2006
|
+
const value = expression.calculate();
|
|
2007
|
+
const variable = this.#toResponseVariable(value);
|
|
2008
|
+
if (variable) {
|
|
2009
|
+
results.push(variable);
|
|
2010
|
+
}
|
|
2011
|
+
}
|
|
2012
|
+
return results;
|
|
2013
|
+
}
|
|
2014
|
+
#resolveRepeatCount() {
|
|
2015
|
+
if (!this.numberRepeats) {
|
|
2016
|
+
console.warn("qti-repeat: missing number-repeats attribute");
|
|
2017
|
+
return 0;
|
|
2018
|
+
}
|
|
2019
|
+
const numericCount = parseInt(this.numberRepeats, 10);
|
|
2020
|
+
if (!Number.isNaN(numericCount)) {
|
|
2021
|
+
return numericCount;
|
|
2022
|
+
}
|
|
2023
|
+
const identifier = this.numberRepeats;
|
|
2024
|
+
const variable = this.context?.variables?.find((v) => v.identifier === identifier);
|
|
2025
|
+
if (!variable) {
|
|
2026
|
+
console.warn(`qti-repeat: unknown identifier "${identifier}"`);
|
|
2027
|
+
return 0;
|
|
2028
|
+
}
|
|
2029
|
+
const rawValue = Array.isArray(variable.value) ? variable.value[0] : variable.value;
|
|
2030
|
+
const resolvedCount = parseInt(rawValue?.toString() ?? "", 10);
|
|
2031
|
+
if (Number.isNaN(resolvedCount)) {
|
|
2032
|
+
console.warn(`qti-repeat: invalid repeat count from "${identifier}"`);
|
|
2033
|
+
return 0;
|
|
2034
|
+
}
|
|
2035
|
+
return resolvedCount;
|
|
2036
|
+
}
|
|
2037
|
+
#toResponseVariable(value) {
|
|
2038
|
+
if (value === null || value === void 0) {
|
|
2039
|
+
return null;
|
|
2040
|
+
}
|
|
2041
|
+
if (typeof value === "number") {
|
|
2042
|
+
return {
|
|
2043
|
+
identifier: "",
|
|
2044
|
+
cardinality: "single",
|
|
2045
|
+
baseType: Number.isInteger(value) ? "integer" : "float",
|
|
2046
|
+
value: value.toString(),
|
|
2047
|
+
type: "response"
|
|
2048
|
+
};
|
|
2049
|
+
}
|
|
2050
|
+
if (typeof value === "string") {
|
|
2051
|
+
const numericValue = parseFloat(value);
|
|
2052
|
+
if (!Number.isNaN(numericValue)) {
|
|
2053
|
+
return {
|
|
2054
|
+
identifier: "",
|
|
2055
|
+
cardinality: "single",
|
|
2056
|
+
baseType: Number.isInteger(numericValue) ? "integer" : "float",
|
|
2057
|
+
value: value.toString(),
|
|
2058
|
+
type: "response"
|
|
2059
|
+
};
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
if (value && typeof value === "object" && "value" in value) {
|
|
2063
|
+
const responseValue = value.value;
|
|
2064
|
+
return {
|
|
2065
|
+
identifier: "",
|
|
2066
|
+
cardinality: "single",
|
|
2067
|
+
baseType: value.baseType ?? "string",
|
|
2068
|
+
value: responseValue !== null && responseValue !== void 0 ? responseValue.toString() : null,
|
|
2069
|
+
type: "response"
|
|
2070
|
+
};
|
|
2071
|
+
}
|
|
2072
|
+
return {
|
|
2073
|
+
identifier: "",
|
|
2074
|
+
cardinality: "single",
|
|
2075
|
+
baseType: "string",
|
|
2076
|
+
value: value.toString(),
|
|
2077
|
+
type: "response"
|
|
2078
|
+
};
|
|
2079
|
+
}
|
|
2080
|
+
};
|
|
2081
|
+
__decorate15([
|
|
2082
|
+
n({ type: String, attribute: "number-repeats" })
|
|
2083
|
+
], QtiRepeat.prototype, "numberRepeats", void 0);
|
|
2084
|
+
|
|
2085
|
+
// ../qti-processing/dist/components/qti-response-condition/qti-response-condition.js
|
|
2086
|
+
var QtiResponseCondition = class extends QtiRule {
|
|
2087
|
+
render() {
|
|
2088
|
+
return T`<slot></slot>`;
|
|
2089
|
+
}
|
|
2090
|
+
process() {
|
|
2091
|
+
const branches = [...this.children];
|
|
2092
|
+
for (let i2 = 0; i2 < branches.length; i2++) {
|
|
2093
|
+
const branch = branches[i2];
|
|
2094
|
+
if (branch.calculate()) {
|
|
2095
|
+
branch.process();
|
|
2096
|
+
return;
|
|
2097
|
+
}
|
|
2098
|
+
}
|
|
2099
|
+
}
|
|
2100
|
+
};
|
|
2101
|
+
|
|
2102
|
+
// ../qti-processing/dist/components/qti-response-else/qti-response-else.js
|
|
2103
|
+
var QtiResponseElse = class extends i {
|
|
2104
|
+
render() {
|
|
2105
|
+
return T`<slot></slot>`;
|
|
2106
|
+
}
|
|
2107
|
+
calculate() {
|
|
2108
|
+
return true;
|
|
2109
|
+
}
|
|
2110
|
+
getSubRules() {
|
|
2111
|
+
return [...this.children];
|
|
2112
|
+
}
|
|
2113
|
+
process() {
|
|
2114
|
+
const subRules = this.getSubRules();
|
|
2115
|
+
for (let i2 = 0; i2 < subRules.length; i2++) {
|
|
2116
|
+
const subRule = subRules[i2];
|
|
2117
|
+
subRule.process();
|
|
2118
|
+
}
|
|
2119
|
+
}
|
|
2120
|
+
};
|
|
2121
|
+
|
|
2122
|
+
// ../qti-processing/dist/components/qti-response-if/qti-response-if.js
|
|
2123
|
+
var QtiResponseIf = class extends QtiResponseElse {
|
|
2124
|
+
calculate() {
|
|
2125
|
+
const expression = this.firstElementChild;
|
|
2126
|
+
const result = expression.calculate();
|
|
2127
|
+
return result;
|
|
2128
|
+
}
|
|
2129
|
+
getSubRules() {
|
|
2130
|
+
const result = [];
|
|
2131
|
+
for (let i2 = 1; i2 < this.children.length; i2++) {
|
|
2132
|
+
result.push(this.children[i2]);
|
|
2133
|
+
}
|
|
2134
|
+
return result;
|
|
2135
|
+
}
|
|
2136
|
+
};
|
|
2137
|
+
|
|
2138
|
+
// ../qti-processing/dist/components/qti-response-else-if/qti-response-else-if.js
|
|
2139
|
+
var QtiResponseElseIf = class extends QtiResponseIf {
|
|
2140
|
+
render() {
|
|
2141
|
+
return T`${super.render()}`;
|
|
2142
|
+
}
|
|
2143
|
+
};
|
|
2144
|
+
|
|
2145
|
+
// ../qti-processing/dist/components/qti-round-to/qti-round-to.js
|
|
2146
|
+
var __decorate16 = function(decorators, target, key, desc) {
|
|
2147
|
+
var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2148
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc);
|
|
2149
|
+
else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r2 = (c2 < 3 ? d(r2) : c2 > 3 ? d(target, key, r2) : d(target, key)) || r2;
|
|
2150
|
+
return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2;
|
|
2151
|
+
};
|
|
2152
|
+
var QtiRoundTo = class extends QtiExpression {
|
|
2033
2153
|
constructor() {
|
|
2034
2154
|
super(...arguments);
|
|
2035
|
-
this.
|
|
2155
|
+
this.roundingMode = "significantFigures";
|
|
2156
|
+
this.figures = 3;
|
|
2036
2157
|
}
|
|
2037
2158
|
getResult() {
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
return
|
|
2159
|
+
if (this.children.length !== 1) {
|
|
2160
|
+
console.error("qti-round-to must have exactly one child expression");
|
|
2161
|
+
return null;
|
|
2041
2162
|
}
|
|
2042
|
-
const
|
|
2043
|
-
if (!
|
|
2044
|
-
|
|
2045
|
-
return [];
|
|
2163
|
+
const variables = this.getVariables();
|
|
2164
|
+
if (!variables || variables.length === 0) {
|
|
2165
|
+
return null;
|
|
2046
2166
|
}
|
|
2047
|
-
const
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2167
|
+
const variable = variables[0];
|
|
2168
|
+
if (variable.cardinality !== "single") {
|
|
2169
|
+
console.error("qti-round-to requires single cardinality");
|
|
2170
|
+
return null;
|
|
2171
|
+
}
|
|
2172
|
+
if (Array.isArray(variable.value)) {
|
|
2173
|
+
console.error("qti-round-to unexpected array value for single cardinality");
|
|
2174
|
+
return null;
|
|
2175
|
+
}
|
|
2176
|
+
if (variable.value === null || variable.value === void 0) {
|
|
2177
|
+
return null;
|
|
2178
|
+
}
|
|
2179
|
+
if (variable.baseType !== "integer" && variable.baseType !== "float") {
|
|
2180
|
+
console.error("qti-round-to requires numerical base-type");
|
|
2181
|
+
return null;
|
|
2182
|
+
}
|
|
2183
|
+
const numericValue = parseFloat(variable.value);
|
|
2184
|
+
if (isNaN(numericValue)) {
|
|
2185
|
+
return null;
|
|
2186
|
+
}
|
|
2187
|
+
if (!isFinite(numericValue)) {
|
|
2188
|
+
if (numericValue === Infinity) {
|
|
2189
|
+
return Infinity;
|
|
2053
2190
|
}
|
|
2191
|
+
if (numericValue === -Infinity) {
|
|
2192
|
+
return -Infinity;
|
|
2193
|
+
}
|
|
2194
|
+
return null;
|
|
2054
2195
|
}
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
if (!this.numberRepeats) {
|
|
2059
|
-
console.warn("qti-repeat: missing number-repeats attribute");
|
|
2060
|
-
return 0;
|
|
2196
|
+
if (this.figures < 0) {
|
|
2197
|
+
console.error("qti-round-to: figures must be non-negative");
|
|
2198
|
+
return null;
|
|
2061
2199
|
}
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
return
|
|
2200
|
+
if (this.roundingMode === "significantFigures" && this.figures < 1) {
|
|
2201
|
+
console.error("qti-round-to: figures must be at least 1 for significantFigures mode");
|
|
2202
|
+
return null;
|
|
2065
2203
|
}
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2204
|
+
if (this.roundingMode === "decimalPlaces") {
|
|
2205
|
+
return this.#roundToDecimalPlaces(numericValue, this.figures);
|
|
2206
|
+
} else {
|
|
2207
|
+
return this.#roundToSignificantFigures(numericValue, this.figures);
|
|
2208
|
+
}
|
|
2209
|
+
}
|
|
2210
|
+
/**
|
|
2211
|
+
* Round to specified number of decimal places
|
|
2212
|
+
*/
|
|
2213
|
+
#roundToDecimalPlaces(value, decimalPlaces) {
|
|
2214
|
+
if (value === 0) {
|
|
2070
2215
|
return 0;
|
|
2071
2216
|
}
|
|
2072
|
-
const
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2217
|
+
const multiplier = Math.pow(10, decimalPlaces);
|
|
2218
|
+
return Math.round(value * multiplier) / multiplier;
|
|
2219
|
+
}
|
|
2220
|
+
/**
|
|
2221
|
+
* Round to specified number of significant figures
|
|
2222
|
+
*/
|
|
2223
|
+
#roundToSignificantFigures(value, significantFigures) {
|
|
2224
|
+
if (value === 0) {
|
|
2076
2225
|
return 0;
|
|
2077
2226
|
}
|
|
2078
|
-
|
|
2227
|
+
const magnitude = Math.floor(Math.log10(Math.abs(value)));
|
|
2228
|
+
const multiplier = Math.pow(10, significantFigures - magnitude - 1);
|
|
2229
|
+
return Math.round(value * multiplier) / multiplier;
|
|
2079
2230
|
}
|
|
2080
|
-
|
|
2081
|
-
|
|
2231
|
+
};
|
|
2232
|
+
__decorate16([
|
|
2233
|
+
n({ type: String, attribute: "rounding-mode" })
|
|
2234
|
+
], QtiRoundTo.prototype, "roundingMode", void 0);
|
|
2235
|
+
__decorate16([
|
|
2236
|
+
n({ type: Number })
|
|
2237
|
+
], QtiRoundTo.prototype, "figures", void 0);
|
|
2238
|
+
|
|
2239
|
+
// ../qti-processing/dist/components/qti-round/qti-round.js
|
|
2240
|
+
var QtiRound = class extends QtiExpression {
|
|
2241
|
+
getResult() {
|
|
2242
|
+
if (this.children.length !== 1) {
|
|
2243
|
+
console.error("qti-round must have exactly one child expression");
|
|
2082
2244
|
return null;
|
|
2083
2245
|
}
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
cardinality: "single",
|
|
2088
|
-
baseType: Number.isInteger(value) ? "integer" : "float",
|
|
2089
|
-
value: value.toString(),
|
|
2090
|
-
type: "response"
|
|
2091
|
-
};
|
|
2246
|
+
const variables = this.getVariables();
|
|
2247
|
+
if (!variables || variables.length === 0) {
|
|
2248
|
+
return null;
|
|
2092
2249
|
}
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
identifier: "",
|
|
2098
|
-
cardinality: "single",
|
|
2099
|
-
baseType: Number.isInteger(numericValue) ? "integer" : "float",
|
|
2100
|
-
value: value.toString(),
|
|
2101
|
-
type: "response"
|
|
2102
|
-
};
|
|
2103
|
-
}
|
|
2250
|
+
const variable = variables[0];
|
|
2251
|
+
if (variable.cardinality !== "single") {
|
|
2252
|
+
console.error("qti-round requires single cardinality");
|
|
2253
|
+
return null;
|
|
2104
2254
|
}
|
|
2105
|
-
if (value
|
|
2106
|
-
|
|
2107
|
-
return
|
|
2108
|
-
identifier: "",
|
|
2109
|
-
cardinality: "single",
|
|
2110
|
-
baseType: value.baseType ?? "string",
|
|
2111
|
-
value: responseValue !== null && responseValue !== void 0 ? responseValue.toString() : null,
|
|
2112
|
-
type: "response"
|
|
2113
|
-
};
|
|
2255
|
+
if (Array.isArray(variable.value)) {
|
|
2256
|
+
console.error("qti-round unexpected array value for single cardinality");
|
|
2257
|
+
return null;
|
|
2114
2258
|
}
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
}
|
|
2259
|
+
if (variable.value === null || variable.value === void 0) {
|
|
2260
|
+
return null;
|
|
2261
|
+
}
|
|
2262
|
+
if (variable.baseType !== "integer" && variable.baseType !== "float") {
|
|
2263
|
+
console.error("qti-round requires numerical base-type (integer or float)");
|
|
2264
|
+
return null;
|
|
2265
|
+
}
|
|
2266
|
+
const numericValue = parseFloat(variable.value);
|
|
2267
|
+
if (isNaN(numericValue)) {
|
|
2268
|
+
console.warn("qti-round: NaN input results in NULL");
|
|
2269
|
+
return null;
|
|
2270
|
+
}
|
|
2271
|
+
if (!isFinite(numericValue)) {
|
|
2272
|
+
if (numericValue === Infinity) {
|
|
2273
|
+
return Infinity;
|
|
2274
|
+
}
|
|
2275
|
+
if (numericValue === -Infinity) {
|
|
2276
|
+
return -Infinity;
|
|
2277
|
+
}
|
|
2278
|
+
return null;
|
|
2279
|
+
}
|
|
2280
|
+
return Math.floor(numericValue + 0.5);
|
|
2122
2281
|
}
|
|
2123
2282
|
};
|
|
2124
|
-
__decorateClass([
|
|
2125
|
-
n({ type: String, attribute: "number-repeats" })
|
|
2126
|
-
], QtiRepeat.prototype, "numberRepeats", 2);
|
|
2127
|
-
customElements.define("qti-repeat", QtiRepeat);
|
|
2128
2283
|
|
|
2129
|
-
// ../qti-processing/
|
|
2284
|
+
// ../qti-processing/dist/components/qti-set-correct-response/qti-set-correct-response.js
|
|
2130
2285
|
var QtiSetCorrectResponse = class extends QtiRule {
|
|
2131
2286
|
/**
|
|
2132
2287
|
* Processes the QTI rule and dispatches a custom event with the computed correct response value.
|
|
@@ -2144,16 +2299,14 @@ var QtiSetCorrectResponse = class extends QtiRule {
|
|
|
2144
2299
|
}
|
|
2145
2300
|
const rule = new QtiSetCorrectResponseRule(expression);
|
|
2146
2301
|
const value = rule.process();
|
|
2147
|
-
this.dispatchEvent(
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
})
|
|
2156
|
-
);
|
|
2302
|
+
this.dispatchEvent(new CustomEvent("qti-set-correct-response", {
|
|
2303
|
+
bubbles: true,
|
|
2304
|
+
composed: true,
|
|
2305
|
+
detail: {
|
|
2306
|
+
responseIdentifier,
|
|
2307
|
+
value: this.#formatValue(value)
|
|
2308
|
+
}
|
|
2309
|
+
}));
|
|
2157
2310
|
}
|
|
2158
2311
|
#formatValue(value) {
|
|
2159
2312
|
if (value === null || value === void 0) {
|
|
@@ -2196,9 +2349,62 @@ var QtiSetCorrectResponseRule = class {
|
|
|
2196
2349
|
return value;
|
|
2197
2350
|
}
|
|
2198
2351
|
};
|
|
2199
|
-
customElements.define("qti-set-correct-response", QtiSetCorrectResponse);
|
|
2200
2352
|
|
|
2201
|
-
// ../qti-processing/
|
|
2353
|
+
// ../qti-processing/dist/components/qti-set-outcome-value/qti-set-outcome-value.js
|
|
2354
|
+
var QtiSetOutcomeValue = class extends QtiRule {
|
|
2355
|
+
/**
|
|
2356
|
+
* Processes the QTI rule and dispatches a custom event with the computed outcome value.
|
|
2357
|
+
*/
|
|
2358
|
+
process() {
|
|
2359
|
+
const outcomeIdentifier = this.getAttribute("identifier");
|
|
2360
|
+
if (!outcomeIdentifier) {
|
|
2361
|
+
console.warn('QtiSetOutcomeValue: Missing "identifier" attribute.');
|
|
2362
|
+
return;
|
|
2363
|
+
}
|
|
2364
|
+
const expression = this.firstElementChild;
|
|
2365
|
+
if (!expression) {
|
|
2366
|
+
console.warn("QtiSetOutcomeValue: No expression found.");
|
|
2367
|
+
return;
|
|
2368
|
+
}
|
|
2369
|
+
const rule = new QtiSetOutcomeValueRule(expression);
|
|
2370
|
+
const value = rule.process();
|
|
2371
|
+
this.dispatchEvent(new CustomEvent("qti-set-outcome-value", {
|
|
2372
|
+
bubbles: true,
|
|
2373
|
+
composed: true,
|
|
2374
|
+
detail: {
|
|
2375
|
+
outcomeIdentifier,
|
|
2376
|
+
value: this.#formatValue(value)
|
|
2377
|
+
}
|
|
2378
|
+
}));
|
|
2379
|
+
}
|
|
2380
|
+
/**
|
|
2381
|
+
* Formats the computed value before dispatching.
|
|
2382
|
+
* Ensures numbers are converted to a universal format.
|
|
2383
|
+
*/
|
|
2384
|
+
#formatValue(value) {
|
|
2385
|
+
if (Array.isArray(value)) {
|
|
2386
|
+
return value.map(convertNumberToUniversalFormat);
|
|
2387
|
+
}
|
|
2388
|
+
return value !== null ? convertNumberToUniversalFormat(value) : null;
|
|
2389
|
+
}
|
|
2390
|
+
};
|
|
2391
|
+
var QtiSetOutcomeValueRule = class {
|
|
2392
|
+
constructor(expression) {
|
|
2393
|
+
this.expression = expression;
|
|
2394
|
+
}
|
|
2395
|
+
/**
|
|
2396
|
+
* Evaluates the expression and returns its value.
|
|
2397
|
+
*/
|
|
2398
|
+
process() {
|
|
2399
|
+
const value = this.expression.calculate() ?? null;
|
|
2400
|
+
if (value === null) {
|
|
2401
|
+
console.warn("QtiSetOutcomeValueRule: Evaluated value is null.");
|
|
2402
|
+
}
|
|
2403
|
+
return Array.isArray(value) ? value.map((v) => v.value ? v.value : v) : value;
|
|
2404
|
+
}
|
|
2405
|
+
};
|
|
2406
|
+
|
|
2407
|
+
// ../qti-processing/dist/components/qti-set-template-value/qti-set-template-value.js
|
|
2202
2408
|
var QtiSetTemplateValue = class extends QtiRule {
|
|
2203
2409
|
/**
|
|
2204
2410
|
* Processes the QTI rule and dispatches a custom event with the computed template value.
|
|
@@ -2216,16 +2422,14 @@ var QtiSetTemplateValue = class extends QtiRule {
|
|
|
2216
2422
|
}
|
|
2217
2423
|
const rule = new QtiSetTemplateValueRule(expression);
|
|
2218
2424
|
const value = rule.process();
|
|
2219
|
-
this.dispatchEvent(
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
})
|
|
2228
|
-
);
|
|
2425
|
+
this.dispatchEvent(new CustomEvent("qti-set-template-value", {
|
|
2426
|
+
bubbles: true,
|
|
2427
|
+
composed: true,
|
|
2428
|
+
detail: {
|
|
2429
|
+
templateIdentifier,
|
|
2430
|
+
value: this.#formatValue(value)
|
|
2431
|
+
}
|
|
2432
|
+
}));
|
|
2229
2433
|
}
|
|
2230
2434
|
/**
|
|
2231
2435
|
* Formats the computed value before dispatching.
|
|
@@ -2272,9 +2476,14 @@ var QtiSetTemplateValueRule = class {
|
|
|
2272
2476
|
return value;
|
|
2273
2477
|
}
|
|
2274
2478
|
};
|
|
2275
|
-
customElements.define("qti-set-template-value", QtiSetTemplateValue);
|
|
2276
2479
|
|
|
2277
|
-
// ../qti-processing/
|
|
2480
|
+
// ../qti-processing/dist/components/qti-stats-operator/qti-stats-operator.js
|
|
2481
|
+
var __decorate17 = function(decorators, target, key, desc) {
|
|
2482
|
+
var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2483
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc);
|
|
2484
|
+
else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r2 = (c2 < 3 ? d(r2) : c2 > 3 ? d(target, key, r2) : d(target, key)) || r2;
|
|
2485
|
+
return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2;
|
|
2486
|
+
};
|
|
2278
2487
|
var QtiStatsOperator = class extends QtiExpression {
|
|
2279
2488
|
constructor() {
|
|
2280
2489
|
super(...arguments);
|
|
@@ -2331,43 +2540,50 @@ var QtiStatsOperator = class extends QtiExpression {
|
|
|
2331
2540
|
return values;
|
|
2332
2541
|
}
|
|
2333
2542
|
};
|
|
2334
|
-
|
|
2543
|
+
__decorate17([
|
|
2335
2544
|
n({ type: String })
|
|
2336
|
-
], QtiStatsOperator.prototype, "name",
|
|
2337
|
-
customElements.define("qti-stats-operator", QtiStatsOperator);
|
|
2545
|
+
], QtiStatsOperator.prototype, "name", void 0);
|
|
2338
2546
|
|
|
2339
|
-
// ../qti-processing/
|
|
2340
|
-
var
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2547
|
+
// ../qti-processing/dist/components/qti-string-match/qti-string-match.js
|
|
2548
|
+
var __decorate18 = function(decorators, target, key, desc) {
|
|
2549
|
+
var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2550
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc);
|
|
2551
|
+
else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r2 = (c2 < 3 ? d(r2) : c2 > 3 ? d(target, key, r2) : d(target, key)) || r2;
|
|
2552
|
+
return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2;
|
|
2345
2553
|
};
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
return Number(value);
|
|
2360
|
-
});
|
|
2361
|
-
if (values.some((value) => value === null)) {
|
|
2362
|
-
console.error("One or more child expressions returned invalid values");
|
|
2363
|
-
return 0;
|
|
2554
|
+
var QtiStringMatch = class extends QtiExpression {
|
|
2555
|
+
constructor() {
|
|
2556
|
+
super(...arguments);
|
|
2557
|
+
this.caseSensitive = "true";
|
|
2558
|
+
}
|
|
2559
|
+
getResult() {
|
|
2560
|
+
if (this.children.length === 2) {
|
|
2561
|
+
const values = this.getVariables();
|
|
2562
|
+
const value1 = values[0];
|
|
2563
|
+
const value2 = values[1];
|
|
2564
|
+
if (value1.cardinality !== "single" || value2.cardinality !== "single" || Array.isArray(value1.value) || Array.isArray(value2.value)) {
|
|
2565
|
+
console.error("unexpected cardinality in qti string-match");
|
|
2566
|
+
return false;
|
|
2364
2567
|
}
|
|
2365
|
-
|
|
2568
|
+
const v1 = this.caseSensitive === "true" ? value1.value : value1.value.toLowerCase();
|
|
2569
|
+
const v2 = this.caseSensitive === "true" ? value2.value : value2.value.toLowerCase();
|
|
2570
|
+
return ScoringHelper.compareSingleValues(v1, v2, value1.baseType);
|
|
2366
2571
|
}
|
|
2367
|
-
|
|
2368
|
-
|
|
2572
|
+
console.error("unexpected number of children in qti-string-match");
|
|
2573
|
+
return null;
|
|
2574
|
+
}
|
|
2575
|
+
};
|
|
2576
|
+
__decorate18([
|
|
2577
|
+
n({ type: String, attribute: "case-sensitive" })
|
|
2578
|
+
], QtiStringMatch.prototype, "caseSensitive", void 0);
|
|
2369
2579
|
|
|
2370
|
-
// ../qti-processing/
|
|
2580
|
+
// ../qti-processing/dist/components/qti-substring/qti-substring.js
|
|
2581
|
+
var __decorate19 = function(decorators, target, key, desc) {
|
|
2582
|
+
var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2583
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc);
|
|
2584
|
+
else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r2 = (c2 < 3 ? d(r2) : c2 > 3 ? d(target, key, r2) : d(target, key)) || r2;
|
|
2585
|
+
return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2;
|
|
2586
|
+
};
|
|
2371
2587
|
var QtiSubstring = class extends QtiExpression {
|
|
2372
2588
|
constructor() {
|
|
2373
2589
|
super(...arguments);
|
|
@@ -2395,40 +2611,42 @@ var QtiSubstring = class extends QtiExpression {
|
|
|
2395
2611
|
return right.includes(left);
|
|
2396
2612
|
}
|
|
2397
2613
|
};
|
|
2398
|
-
|
|
2614
|
+
__decorate19([
|
|
2399
2615
|
n({ type: String, attribute: "case-sensitive" })
|
|
2400
|
-
], QtiSubstring.prototype, "caseSensitive",
|
|
2401
|
-
customElements.define("qti-substring", QtiSubstring);
|
|
2616
|
+
], QtiSubstring.prototype, "caseSensitive", void 0);
|
|
2402
2617
|
|
|
2403
|
-
// ../qti-processing/
|
|
2404
|
-
var
|
|
2405
|
-
constructor() {
|
|
2406
|
-
super(...arguments);
|
|
2407
|
-
this.caseSensitive = "true";
|
|
2408
|
-
}
|
|
2618
|
+
// ../qti-processing/dist/components/qti-subtract/qti-subtract.js
|
|
2619
|
+
var QtiSubtract = class extends qtiSubtractMixin(QtiExpression) {
|
|
2409
2620
|
getResult() {
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
const value1 = values[0];
|
|
2413
|
-
const value2 = values[1];
|
|
2414
|
-
if (value1.cardinality !== "single" || value2.cardinality !== "single" || Array.isArray(value1.value) || Array.isArray(value2.value)) {
|
|
2415
|
-
console.error("unexpected cardinality in qti string-match");
|
|
2416
|
-
return false;
|
|
2417
|
-
}
|
|
2418
|
-
const v1 = this.caseSensitive === "true" ? value1.value : value1.value.toLowerCase();
|
|
2419
|
-
const v2 = this.caseSensitive === "true" ? value2.value : value2.value.toLowerCase();
|
|
2420
|
-
return ScoringHelper.compareSingleValues(v1, v2, value1.baseType);
|
|
2421
|
-
}
|
|
2422
|
-
console.error("unexpected number of children in qti-string-match");
|
|
2423
|
-
return null;
|
|
2621
|
+
const value = this.calculateChildren(Array.from(this.children));
|
|
2622
|
+
return value;
|
|
2424
2623
|
}
|
|
2425
2624
|
};
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2625
|
+
function qtiSubtractMixin(Base) {
|
|
2626
|
+
return class MockQtiSubtract extends Base {
|
|
2627
|
+
calculateChildren(children) {
|
|
2628
|
+
const values = children.map((expression) => {
|
|
2629
|
+
if (!expression.calculate) {
|
|
2630
|
+
console.error("Element doesn't implement QtiConditionExpression");
|
|
2631
|
+
return null;
|
|
2632
|
+
}
|
|
2633
|
+
const value = expression.calculate();
|
|
2634
|
+
if (Number.isNaN(value)) {
|
|
2635
|
+
console.error("Unexpected value in qti-subtract, expected number");
|
|
2636
|
+
return null;
|
|
2637
|
+
}
|
|
2638
|
+
return Number(value);
|
|
2639
|
+
});
|
|
2640
|
+
if (values.some((value) => value === null)) {
|
|
2641
|
+
console.error("One or more child expressions returned invalid values");
|
|
2642
|
+
return 0;
|
|
2643
|
+
}
|
|
2644
|
+
return values[0] - values[1];
|
|
2645
|
+
}
|
|
2646
|
+
};
|
|
2647
|
+
}
|
|
2430
2648
|
|
|
2431
|
-
// ../qti-processing/
|
|
2649
|
+
// ../qti-processing/dist/components/qti-sum/qti-sum.js
|
|
2432
2650
|
var QtiSum = class extends QtiExpression {
|
|
2433
2651
|
getResult() {
|
|
2434
2652
|
const expression = new QtiSumExpression(Array.from(this.children));
|
|
@@ -2456,9 +2674,8 @@ var QtiSumExpression = class {
|
|
|
2456
2674
|
return values.reduce((a, b) => a + b, 0);
|
|
2457
2675
|
}
|
|
2458
2676
|
};
|
|
2459
|
-
customElements.define("qti-sum", QtiSum);
|
|
2460
2677
|
|
|
2461
|
-
// ../qti-processing/
|
|
2678
|
+
// ../qti-processing/dist/components/qti-truncate/qti-truncate.js
|
|
2462
2679
|
var QtiTruncate = class extends QtiExpression {
|
|
2463
2680
|
getResult() {
|
|
2464
2681
|
const variables = this.getVariables();
|
|
@@ -2486,9 +2703,8 @@ var QtiTruncate = class extends QtiExpression {
|
|
|
2486
2703
|
return Math.trunc(value);
|
|
2487
2704
|
}
|
|
2488
2705
|
};
|
|
2489
|
-
customElements.define("qti-truncate", QtiTruncate);
|
|
2490
2706
|
|
|
2491
|
-
// ../qti-processing/
|
|
2707
|
+
// ../qti-processing/dist/components/qti-variable/qti-variable.js
|
|
2492
2708
|
var QtiVariable = class extends QtiExpression {
|
|
2493
2709
|
getResult() {
|
|
2494
2710
|
const identifier = this.getAttribute("identifier");
|
|
@@ -2496,195 +2712,82 @@ var QtiVariable = class extends QtiExpression {
|
|
|
2496
2712
|
return result;
|
|
2497
2713
|
}
|
|
2498
2714
|
};
|
|
2499
|
-
customElements.define("qti-variable", QtiVariable);
|
|
2500
|
-
|
|
2501
|
-
// ../qti-processing/src/components/qti-random-integer/qti-random-integer.ts
|
|
2502
|
-
var QtiRandomInteger = class extends QtiExpression {
|
|
2503
|
-
constructor() {
|
|
2504
|
-
super(...arguments);
|
|
2505
|
-
this.min = 0;
|
|
2506
|
-
this.max = 10;
|
|
2507
|
-
this.step = 1;
|
|
2508
|
-
}
|
|
2509
|
-
getResult() {
|
|
2510
|
-
if (this.min > this.max) {
|
|
2511
|
-
console.error("qti-random-integer: min cannot be greater than max");
|
|
2512
|
-
return this.min;
|
|
2513
|
-
}
|
|
2514
|
-
if (this.step <= 0) {
|
|
2515
|
-
console.error("qti-random-integer: step must be positive");
|
|
2516
|
-
return this.min;
|
|
2517
|
-
}
|
|
2518
|
-
const possibleValues = [];
|
|
2519
|
-
let n2 = 0;
|
|
2520
|
-
while (true) {
|
|
2521
|
-
const value = this.min + this.step * n2;
|
|
2522
|
-
if (value > this.max) {
|
|
2523
|
-
break;
|
|
2524
|
-
}
|
|
2525
|
-
if (Number.isInteger(value)) {
|
|
2526
|
-
possibleValues.push(value);
|
|
2527
|
-
}
|
|
2528
|
-
n2++;
|
|
2529
|
-
}
|
|
2530
|
-
if (possibleValues.length === 0) {
|
|
2531
|
-
console.warn("qti-random-integer: no valid integer values in range");
|
|
2532
|
-
return Number.isInteger(this.min) ? this.min : Math.floor(this.min);
|
|
2533
|
-
}
|
|
2534
|
-
const randomIndex = Math.floor(Math.random() * possibleValues.length);
|
|
2535
|
-
return possibleValues[randomIndex];
|
|
2536
|
-
}
|
|
2537
|
-
/**
|
|
2538
|
-
* Get all possible values for testing purposes
|
|
2539
|
-
*/
|
|
2540
|
-
getPossibleValues() {
|
|
2541
|
-
const possibleValues = [];
|
|
2542
|
-
if (this.min > this.max || this.step <= 0) {
|
|
2543
|
-
return [Number.isInteger(this.min) ? this.min : Math.floor(this.min)];
|
|
2544
|
-
}
|
|
2545
|
-
let n2 = 0;
|
|
2546
|
-
while (true) {
|
|
2547
|
-
const value = this.min + this.step * n2;
|
|
2548
|
-
if (value > this.max) {
|
|
2549
|
-
break;
|
|
2550
|
-
}
|
|
2551
|
-
if (Number.isInteger(value)) {
|
|
2552
|
-
possibleValues.push(value);
|
|
2553
|
-
}
|
|
2554
|
-
n2++;
|
|
2555
|
-
}
|
|
2556
|
-
return possibleValues.length > 0 ? possibleValues : [Number.isInteger(this.min) ? this.min : Math.floor(this.min)];
|
|
2557
|
-
}
|
|
2558
|
-
};
|
|
2559
|
-
__decorateClass([
|
|
2560
|
-
n({ type: Number })
|
|
2561
|
-
], QtiRandomInteger.prototype, "min", 2);
|
|
2562
|
-
__decorateClass([
|
|
2563
|
-
n({ type: Number })
|
|
2564
|
-
], QtiRandomInteger.prototype, "max", 2);
|
|
2565
|
-
__decorateClass([
|
|
2566
|
-
n({ type: Number })
|
|
2567
|
-
], QtiRandomInteger.prototype, "step", 2);
|
|
2568
|
-
customElements.define("qti-random-integer", QtiRandomInteger);
|
|
2569
|
-
|
|
2570
|
-
// ../qti-processing/src/components/qti-random/qti-random.ts
|
|
2571
|
-
var QtiRandom = class extends QtiExpression {
|
|
2572
|
-
getResult() {
|
|
2573
|
-
const values = this.getVariables();
|
|
2574
|
-
if (values.length === 1) {
|
|
2575
|
-
const value = values[0].value;
|
|
2576
|
-
if (Array.isArray(value)) {
|
|
2577
|
-
const randomIndex = Math.floor(Math.random() * value.length);
|
|
2578
|
-
return value[randomIndex];
|
|
2579
|
-
}
|
|
2580
|
-
return value;
|
|
2581
|
-
}
|
|
2582
|
-
console.error("unexpected number of children in match");
|
|
2583
|
-
return null;
|
|
2584
|
-
}
|
|
2585
|
-
};
|
|
2586
|
-
customElements.define("qti-random", QtiRandom);
|
|
2587
|
-
|
|
2588
|
-
// ../qti-processing/src/components/qti-delete/qti-delete.ts
|
|
2589
|
-
var QtiDelete = class extends QtiExpression {
|
|
2590
|
-
getResult() {
|
|
2591
|
-
if (this.children.length === 2) {
|
|
2592
|
-
const values = this.getVariables();
|
|
2593
|
-
const value1 = values[0];
|
|
2594
|
-
const value2 = values[1];
|
|
2595
|
-
if (value1.cardinality !== "single" || !Array.isArray(value2.value)) {
|
|
2596
|
-
console.error("unexpected cardinality in qti equal");
|
|
2597
|
-
return null;
|
|
2598
|
-
}
|
|
2599
|
-
if (values[0].baseType !== values[1].baseType) {
|
|
2600
|
-
console.error("The baseType of the two variables is different");
|
|
2601
|
-
return null;
|
|
2602
|
-
}
|
|
2603
|
-
const filtered = value2.value.filter((v) => !value1.value.includes(v));
|
|
2604
|
-
return filtered;
|
|
2605
|
-
}
|
|
2606
|
-
return null;
|
|
2607
|
-
}
|
|
2608
|
-
};
|
|
2609
|
-
customElements.define("qti-delete", QtiDelete);
|
|
2610
2715
|
|
|
2611
|
-
// ../qti-processing/
|
|
2612
|
-
var
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
}
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
}
|
|
2659
|
-
}
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2716
|
+
// ../qti-processing/dist/elements.js
|
|
2717
|
+
var qtiProcessingElements = [
|
|
2718
|
+
{ tag: "qti-and", ctor: QtiAnd },
|
|
2719
|
+
{ tag: "qti-any-n", ctor: QtiAnyN },
|
|
2720
|
+
{ tag: "qti-base-value", ctor: QtiBaseValue },
|
|
2721
|
+
{ tag: "qti-container-size", ctor: QtiContainerSize },
|
|
2722
|
+
{ tag: "qti-contains", ctor: QtiContains },
|
|
2723
|
+
{ tag: "qti-correct", ctor: QtiCorrect },
|
|
2724
|
+
{ tag: "qti-default", ctor: QtiDefault },
|
|
2725
|
+
{ tag: "qti-delete", ctor: QtiDelete },
|
|
2726
|
+
{ tag: "qti-divide", ctor: QtiDivide },
|
|
2727
|
+
{ tag: "qti-duration-gte", ctor: QtiDurationGte },
|
|
2728
|
+
{ tag: "qti-duration-lt", ctor: QtiDurationLt },
|
|
2729
|
+
{ tag: "qti-equal", ctor: QtiEqual },
|
|
2730
|
+
{ tag: "qti-equal-rounded", ctor: QtiEqualRounded },
|
|
2731
|
+
{ tag: "qti-field-value", ctor: QtiFieldValue },
|
|
2732
|
+
{ tag: "qti-gcd", ctor: QtiGcd },
|
|
2733
|
+
{ tag: "qti-gt", ctor: QtiGt },
|
|
2734
|
+
{ tag: "qti-gte", ctor: QtiGte },
|
|
2735
|
+
{ tag: "qti-index", ctor: QtiIndex },
|
|
2736
|
+
{ tag: "qti-inside", ctor: QtiInside },
|
|
2737
|
+
{ tag: "qti-integer-divide", ctor: QtiIntegerDivide },
|
|
2738
|
+
{ tag: "qti-integer-modulus", ctor: QtiIntegerModulus },
|
|
2739
|
+
{ tag: "qti-integer-to-float", ctor: QtiIntegerToFloat },
|
|
2740
|
+
{ tag: "qti-is-null", ctor: QtiIsNull },
|
|
2741
|
+
{ tag: "qti-lcm", ctor: QtiLcm },
|
|
2742
|
+
{ tag: "qti-lookup-outcome-value", ctor: QtiLookupOutcomeValue },
|
|
2743
|
+
{ tag: "qti-lt", ctor: QtiLt },
|
|
2744
|
+
{ tag: "qti-lte", ctor: QtiLte },
|
|
2745
|
+
{ tag: "qti-map-response", ctor: QtiMapResponse },
|
|
2746
|
+
{ tag: "qti-map-response-point", ctor: QtiMapResponsePoint },
|
|
2747
|
+
{ tag: "qti-match", ctor: QtiMatch },
|
|
2748
|
+
{ tag: "qti-math-operator", ctor: QtiMathOperator },
|
|
2749
|
+
{ tag: "qti-max", ctor: QtiMax },
|
|
2750
|
+
{ tag: "qti-member", ctor: QtiMember },
|
|
2751
|
+
{ tag: "qti-min", ctor: QtiMin },
|
|
2752
|
+
{ tag: "qti-multiple", ctor: QtiMultiple },
|
|
2753
|
+
{ tag: "qti-not", ctor: QtiNot },
|
|
2754
|
+
{ tag: "qti-null", ctor: QtiNull },
|
|
2755
|
+
{ tag: "qti-or", ctor: QtiOr },
|
|
2756
|
+
{ tag: "qti-ordered", ctor: QtiOrdered },
|
|
2757
|
+
{ tag: "qti-pattern-match", ctor: QtiPatternMatch },
|
|
2758
|
+
{ tag: "qti-power", ctor: QtiPower },
|
|
2759
|
+
{ tag: "qti-printed-variable", ctor: QtiPrintedVariable },
|
|
2760
|
+
{ tag: "qti-product", ctor: QtiProduct },
|
|
2761
|
+
{ tag: "qti-random", ctor: QtiRandom },
|
|
2762
|
+
{ tag: "qti-random-integer", ctor: QtiRandomInteger },
|
|
2763
|
+
{ tag: "qti-repeat", ctor: QtiRepeat },
|
|
2764
|
+
{ tag: "qti-response-condition", ctor: QtiResponseCondition },
|
|
2765
|
+
{ tag: "qti-response-else", ctor: QtiResponseElse },
|
|
2766
|
+
{ tag: "qti-response-else-if", ctor: QtiResponseElseIf },
|
|
2767
|
+
{ tag: "qti-response-if", ctor: QtiResponseIf },
|
|
2768
|
+
{ tag: "qti-round", ctor: QtiRound },
|
|
2769
|
+
{ tag: "qti-round-to", ctor: QtiRoundTo },
|
|
2770
|
+
{ tag: "qti-rule", ctor: QtiRule },
|
|
2771
|
+
{ tag: "qti-set-correct-response", ctor: QtiSetCorrectResponse },
|
|
2772
|
+
{ tag: "qti-set-outcome-value", ctor: QtiSetOutcomeValue },
|
|
2773
|
+
{ tag: "qti-set-template-value", ctor: QtiSetTemplateValue },
|
|
2774
|
+
{ tag: "qti-stats-operator", ctor: QtiStatsOperator },
|
|
2775
|
+
{ tag: "qti-string-match", ctor: QtiStringMatch },
|
|
2776
|
+
{ tag: "qti-substring", ctor: QtiSubstring },
|
|
2777
|
+
{ tag: "qti-subtract", ctor: QtiSubtract },
|
|
2778
|
+
{ tag: "qti-sum", ctor: QtiSum },
|
|
2779
|
+
{ tag: "qti-truncate", ctor: QtiTruncate },
|
|
2780
|
+
{ tag: "qti-variable", ctor: QtiVariable }
|
|
2781
|
+
];
|
|
2782
|
+
|
|
2783
|
+
// ../qti-processing/dist/register.js
|
|
2784
|
+
for (const { tag, ctor } of qtiProcessingElements) {
|
|
2785
|
+
if (!customElements.get(tag)) {
|
|
2786
|
+
customElements.define(tag, ctor);
|
|
2667
2787
|
}
|
|
2668
|
-
|
|
2669
|
-
};
|
|
2670
|
-
__decorateClass([
|
|
2671
|
-
n({ type: String })
|
|
2672
|
-
], QtiIndex.prototype, "n", 2);
|
|
2673
|
-
QtiIndex = __decorateClass([
|
|
2674
|
-
t("qti-index")
|
|
2675
|
-
], QtiIndex);
|
|
2676
|
-
|
|
2677
|
-
// ../qti-processing/src/components/qti-subtract/index.ts
|
|
2678
|
-
customElements.define("qti-subtract", QtiSubtract);
|
|
2788
|
+
}
|
|
2679
2789
|
|
|
2680
2790
|
export {
|
|
2681
|
-
QtiLookupOutcomeValue,
|
|
2682
|
-
QtiResponseCondition,
|
|
2683
|
-
QtiSetOutcomeValue,
|
|
2684
|
-
QtiSetOutcomeValueRule,
|
|
2685
|
-
QtiResponseElse,
|
|
2686
|
-
QtiResponseIf,
|
|
2687
|
-
QtiResponseElseIf,
|
|
2688
2791
|
QtiAnd,
|
|
2689
2792
|
qtiAndMixin,
|
|
2690
2793
|
QtiAnyN,
|
|
@@ -2693,58 +2796,65 @@ export {
|
|
|
2693
2796
|
QtiContains,
|
|
2694
2797
|
QtiCorrect,
|
|
2695
2798
|
QtiDefault,
|
|
2696
|
-
|
|
2697
|
-
QtiRound,
|
|
2698
|
-
QtiRoundTo,
|
|
2699
|
-
QtiEqual,
|
|
2799
|
+
QtiDelete,
|
|
2700
2800
|
QtiDivide,
|
|
2701
2801
|
QtiDurationGte,
|
|
2702
2802
|
QtiDurationLt,
|
|
2803
|
+
QtiEqualRounded,
|
|
2804
|
+
QtiEqual,
|
|
2805
|
+
QtiFieldValue,
|
|
2703
2806
|
QtiGcd,
|
|
2704
2807
|
QtiGt,
|
|
2705
2808
|
QtiGte,
|
|
2809
|
+
QtiIndex,
|
|
2706
2810
|
QtiInside,
|
|
2707
2811
|
QtiIntegerDivide,
|
|
2708
2812
|
QtiIntegerModulus,
|
|
2709
2813
|
QtiIntegerToFloat,
|
|
2710
|
-
QtiLcm,
|
|
2711
|
-
QtiNull,
|
|
2712
2814
|
QtiIsNull,
|
|
2713
|
-
|
|
2815
|
+
QtiLcm,
|
|
2816
|
+
QtiLookupOutcomeValue,
|
|
2714
2817
|
QtiLt,
|
|
2715
2818
|
QtiLte,
|
|
2716
|
-
QtiMapResponse,
|
|
2717
2819
|
QtiMapResponsePoint,
|
|
2718
|
-
|
|
2820
|
+
QtiMapResponse,
|
|
2719
2821
|
QtiMatch,
|
|
2822
|
+
QtiMathOperator,
|
|
2720
2823
|
QtiMax,
|
|
2721
2824
|
QtiMember,
|
|
2722
2825
|
QtiMin,
|
|
2723
2826
|
QtiMultiple,
|
|
2724
2827
|
QtiNot,
|
|
2828
|
+
QtiNull,
|
|
2725
2829
|
QtiOr,
|
|
2726
2830
|
QtiOrdered,
|
|
2727
|
-
QtiPower,
|
|
2728
2831
|
QtiPatternMatch,
|
|
2832
|
+
QtiPower,
|
|
2729
2833
|
QtiPrintedVariable,
|
|
2730
2834
|
QtiProduct,
|
|
2835
|
+
QtiRandomInteger,
|
|
2836
|
+
QtiRandom,
|
|
2731
2837
|
QtiRepeat,
|
|
2838
|
+
QtiResponseCondition,
|
|
2839
|
+
QtiResponseElse,
|
|
2840
|
+
QtiResponseIf,
|
|
2841
|
+
QtiResponseElseIf,
|
|
2842
|
+
QtiRoundTo,
|
|
2843
|
+
QtiRound,
|
|
2732
2844
|
QtiSetCorrectResponse,
|
|
2733
2845
|
QtiSetCorrectResponseRule,
|
|
2846
|
+
QtiSetOutcomeValue,
|
|
2847
|
+
QtiSetOutcomeValueRule,
|
|
2734
2848
|
QtiSetTemplateValue,
|
|
2735
2849
|
QtiSetTemplateValueRule,
|
|
2736
2850
|
QtiStatsOperator,
|
|
2851
|
+
QtiStringMatch,
|
|
2852
|
+
QtiSubstring,
|
|
2737
2853
|
QtiSubtract,
|
|
2738
2854
|
qtiSubtractMixin,
|
|
2739
|
-
QtiSubstring,
|
|
2740
|
-
QtiStringMatch,
|
|
2741
2855
|
QtiSum,
|
|
2742
2856
|
QtiSumExpression,
|
|
2743
2857
|
QtiTruncate,
|
|
2744
|
-
QtiVariable
|
|
2745
|
-
QtiRandomInteger,
|
|
2746
|
-
QtiRandom,
|
|
2747
|
-
QtiDelete,
|
|
2748
|
-
QtiIndex
|
|
2858
|
+
QtiVariable
|
|
2749
2859
|
};
|
|
2750
|
-
//# sourceMappingURL=chunk-
|
|
2860
|
+
//# sourceMappingURL=chunk-NA2N2WSG.js.map
|