@citolab/qti-components 9.5.0 → 9.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/index.global.js +1 -1
- package/cdn/index.js +1761 -204
- package/dist/base.d.ts +10 -10
- package/dist/base.js +7 -1
- package/dist/{chunk-SIE3E4FG.js → chunk-EAQOUBXA.js} +4 -4
- package/dist/{chunk-GBZNFSFY.js → chunk-H72OXVRF.js} +2 -2
- package/dist/{chunk-RU6332MD.js → chunk-I7ACMH74.js} +3 -3
- package/dist/{chunk-DAFB2E5H.js → chunk-LOKULHVY.js} +386 -241
- package/dist/chunk-LOKULHVY.js.map +1 -0
- package/dist/{chunk-MI7774NV.js → chunk-QOFGUIYE.js} +2 -2
- package/dist/{chunk-TDWJ6WZA.js → chunk-QUTM5TT6.js} +37 -1
- package/dist/chunk-QUTM5TT6.js.map +1 -0
- package/dist/chunk-QVZLJY75.js +7 -0
- package/dist/chunk-QVZLJY75.js.map +1 -0
- package/dist/{chunk-FD4AB6TM.js → chunk-RV7ADJ33.js} +2 -2
- package/dist/{chunk-OQDBARD5.js → chunk-TBJT7AGB.js} +2 -2
- package/dist/{chunk-SU63QGGD.js → chunk-TC4257SG.js} +6 -6
- package/dist/{chunk-6U3YPHXU.js → chunk-TFQAUWCM.js} +40 -5
- package/dist/{chunk-6U3YPHXU.js.map → chunk-TFQAUWCM.js.map} +1 -1
- package/dist/{chunk-6K3QWJHH.js → chunk-V3NKEAQY.js} +40 -4
- package/dist/chunk-V3NKEAQY.js.map +1 -0
- package/dist/{chunk-YZRODVYZ.js → chunk-YS6CBO45.js} +2 -2
- package/dist/{computed.types.d-gJrBeUMG.d.ts → computed.types.d-SsTm3ieP.d.ts} +1 -1
- package/dist/corrections.d.ts +9 -9
- package/dist/corrections.js +8 -8
- package/dist/elements.d.ts +2 -2
- package/dist/elements.js +3 -3
- package/dist/index.d.ts +10 -10
- package/dist/index.js +23 -13
- package/dist/interactions.d.ts +4 -4
- package/dist/interactions.js +7 -3
- package/dist/item.css +2 -1
- package/dist/item.d.ts +4 -4
- package/dist/item.js +4 -4
- package/dist/{item.types.d-B55QkJ92.d.ts → item.types.d-DuVR0ZVK.d.ts} +7 -1
- package/dist/loader.d.ts +2 -2
- package/dist/processing.d.ts +10 -3
- package/dist/processing.js +3 -3
- package/dist/qti-components-jsx.d.ts +46 -26
- package/dist/{qti-condition-expression.d-VJH6cWxf.d.ts → qti-condition-expression.d-B-T1NNl0.d.ts} +1 -1
- package/dist/{qti-expression.d-BPxEp8HU.d.ts → qti-expression.d-B-Cfbqlb.d.ts} +1 -1
- package/dist/{qti-feedback.d-wMYNVkkj.d.ts → qti-feedback.d-DbzPSJuK.d.ts} +1 -1
- package/dist/{qti-item.d-DgC1AQbY.d.ts → qti-item.d-DjWvKbfL.d.ts} +1 -1
- package/dist/{qti-test.d-86TlaMlI.d.ts → qti-test.d-DOWT6YNa.d.ts} +4 -4
- package/dist/{qti-text-entry-interaction.d-C4eixT-D.d.ts → qti-text-entry-interaction.d-h5UZ8Qvp.d.ts} +28 -18
- package/dist/{interaction.d-g6XG0T0Z.d.ts → record.d-wB9uYs-j.d.ts} +34 -2
- package/dist/{session.context.d-D5080LVx.d.ts → session.context.d-Cw8GcziG.d.ts} +1 -1
- package/dist/test.d.ts +7 -7
- package/dist/test.js +5 -5
- package/package.json +5 -5
- package/dist/chunk-6K3QWJHH.js.map +0 -1
- package/dist/chunk-DAFB2E5H.js.map +0 -1
- package/dist/chunk-TDWJ6WZA.js.map +0 -1
- package/dist/chunk-ZP6QQYSU.js +0 -7
- package/dist/chunk-ZP6QQYSU.js.map +0 -1
- /package/dist/{chunk-SIE3E4FG.js.map → chunk-EAQOUBXA.js.map} +0 -0
- /package/dist/{chunk-GBZNFSFY.js.map → chunk-H72OXVRF.js.map} +0 -0
- /package/dist/{chunk-RU6332MD.js.map → chunk-I7ACMH74.js.map} +0 -0
- /package/dist/{chunk-MI7774NV.js.map → chunk-QOFGUIYE.js.map} +0 -0
- /package/dist/{chunk-FD4AB6TM.js.map → chunk-RV7ADJ33.js.map} +0 -0
- /package/dist/{chunk-OQDBARD5.js.map → chunk-TBJT7AGB.js.map} +0 -0
- /package/dist/{chunk-SU63QGGD.js.map → chunk-TC4257SG.js.map} +0 -0
- /package/dist/{chunk-YZRODVYZ.js.map → chunk-YS6CBO45.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
qtiItemElements
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-I7ACMH74.js";
|
|
4
4
|
|
|
5
5
|
// ../qti-item/dist/register.js
|
|
6
6
|
for (const { tag, ctor } of qtiItemElements) {
|
|
@@ -8,4 +8,4 @@ for (const { tag, ctor } of qtiItemElements) {
|
|
|
8
8
|
customElements.define(tag, ctor);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
11
|
+
//# sourceMappingURL=chunk-RV7ADJ33.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
qtiTestElements
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EAQOUBXA.js";
|
|
4
4
|
|
|
5
5
|
// ../qti-test/dist/register.js
|
|
6
6
|
for (const { tag, ctor } of qtiTestElements) {
|
|
@@ -8,4 +8,4 @@ for (const { tag, ctor } of qtiTestElements) {
|
|
|
8
8
|
customElements.define(tag, ctor);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
11
|
+
//# sourceMappingURL=chunk-TBJT7AGB.js.map
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
QtiTest,
|
|
3
3
|
TestCheckItem,
|
|
4
4
|
TestNavigation
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-EAQOUBXA.js";
|
|
6
6
|
import {
|
|
7
7
|
QtiAssessmentItem
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-TFQAUWCM.js";
|
|
9
9
|
import {
|
|
10
10
|
QtiAssociateInteraction,
|
|
11
11
|
QtiChoiceInteraction,
|
|
@@ -28,10 +28,10 @@ import {
|
|
|
28
28
|
QtiSimpleChoice,
|
|
29
29
|
QtiSliderInteraction,
|
|
30
30
|
QtiTextEntryInteraction
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-LOKULHVY.js";
|
|
32
32
|
import {
|
|
33
33
|
QtiItem
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-I7ACMH74.js";
|
|
35
35
|
import {
|
|
36
36
|
watch
|
|
37
37
|
} from "./chunk-4DB4SC5K.js";
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
computedItemContext,
|
|
42
42
|
configContext,
|
|
43
43
|
responseAttributeConverter
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-QUTM5TT6.js";
|
|
45
45
|
|
|
46
46
|
// ../qti-corrections/dist/components/item-correct-response-mode/item-correct-response-mode.js
|
|
47
47
|
import { html, LitElement } from "lit";
|
|
@@ -1661,4 +1661,4 @@ export {
|
|
|
1661
1661
|
QtiTestCorrection,
|
|
1662
1662
|
TestCheckItemCorrection
|
|
1663
1663
|
};
|
|
1664
|
-
//# sourceMappingURL=chunk-
|
|
1664
|
+
//# sourceMappingURL=chunk-TC4257SG.js.map
|
|
@@ -10,8 +10,9 @@ import {
|
|
|
10
10
|
QtiVariableDeclaration,
|
|
11
11
|
getCustomOperator,
|
|
12
12
|
itemContext,
|
|
13
|
-
itemContextVariables
|
|
14
|
-
|
|
13
|
+
itemContextVariables,
|
|
14
|
+
readRecordFieldValues
|
|
15
|
+
} from "./chunk-QUTM5TT6.js";
|
|
15
16
|
|
|
16
17
|
// ../qti-elements/dist/public-events.js
|
|
17
18
|
var PUBLIC_ITEM_EVENTS = {
|
|
@@ -1135,11 +1136,13 @@ var QtiResponseDeclaration = class extends QtiVariableDeclaration {
|
|
|
1135
1136
|
}
|
|
1136
1137
|
connectedCallback() {
|
|
1137
1138
|
super.connectedCallback();
|
|
1138
|
-
const defaultValue = this.defaultValues(this.cardinality);
|
|
1139
|
+
const defaultValue = this.cardinality === "record" ? this.#recordDefaultValue : this.defaultValues(this.cardinality);
|
|
1140
|
+
const { correctResponse, fieldBaseTypes } = this.#readCorrectResponse();
|
|
1139
1141
|
const responseVariable = {
|
|
1140
1142
|
baseType: this.baseType,
|
|
1141
1143
|
identifier: this.identifier,
|
|
1142
|
-
correctResponse
|
|
1144
|
+
correctResponse,
|
|
1145
|
+
...fieldBaseTypes ? { fieldBaseTypes } : {},
|
|
1143
1146
|
cardinality: this.cardinality || "single",
|
|
1144
1147
|
mapping: this.#mapping,
|
|
1145
1148
|
defaultValue,
|
|
@@ -1155,6 +1158,38 @@ var QtiResponseDeclaration = class extends QtiVariableDeclaration {
|
|
|
1155
1158
|
detail: { variable: responseVariable }
|
|
1156
1159
|
}));
|
|
1157
1160
|
}
|
|
1161
|
+
/**
|
|
1162
|
+
* The correct response, and for `record` cardinality the declared base type of each field.
|
|
1163
|
+
*
|
|
1164
|
+
* A record's correct response is a field map, `{ time: '4.0', point: '460 245' }`, read from
|
|
1165
|
+
* `qti-value field-identifier="…" base-type="…"`. The field base types are kept beside it, since
|
|
1166
|
+
* the record declaration itself has no `base-type` to say how a field is to be compared.
|
|
1167
|
+
*/
|
|
1168
|
+
#readCorrectResponse() {
|
|
1169
|
+
if (this.cardinality !== "record") {
|
|
1170
|
+
return { correctResponse: this.#correctResponse };
|
|
1171
|
+
}
|
|
1172
|
+
const correctResponse = this.querySelector("qti-correct-response");
|
|
1173
|
+
if (!correctResponse) {
|
|
1174
|
+
return { correctResponse: void 0 };
|
|
1175
|
+
}
|
|
1176
|
+
const values = Array.from(correctResponse.querySelectorAll("qti-value"));
|
|
1177
|
+
const { value, baseTypes } = readRecordFieldValues(values);
|
|
1178
|
+
values.forEach((element) => element.remove());
|
|
1179
|
+
return {
|
|
1180
|
+
// The variable types hold string | string[]; a record is stored as its field map.
|
|
1181
|
+
correctResponse: Object.keys(value).length ? value : void 0,
|
|
1182
|
+
fieldBaseTypes: baseTypes
|
|
1183
|
+
};
|
|
1184
|
+
}
|
|
1185
|
+
/** A record's `qti-default-value`, as a field map like its correct response. */
|
|
1186
|
+
get #recordDefaultValue() {
|
|
1187
|
+
const values = this.querySelectorAll("qti-default-value > qti-value");
|
|
1188
|
+
if (values.length === 0)
|
|
1189
|
+
return null;
|
|
1190
|
+
const { value } = readRecordFieldValues(values);
|
|
1191
|
+
return Object.keys(value).length ? value : null;
|
|
1192
|
+
}
|
|
1158
1193
|
get #correctResponse() {
|
|
1159
1194
|
let result;
|
|
1160
1195
|
const correctResponse = this.querySelector("qti-correct-response");
|
|
@@ -1705,4 +1740,4 @@ export {
|
|
|
1705
1740
|
QtiTemplateProcessing,
|
|
1706
1741
|
qtiContentElements
|
|
1707
1742
|
};
|
|
1708
|
-
//# sourceMappingURL=chunk-
|
|
1743
|
+
//# sourceMappingURL=chunk-TFQAUWCM.js.map
|