@yungu-fed/question-editor 0.1.5 → 0.1.7
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/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1270 -1248
- package/dist/index.mjs +1010 -982
- package/dist/model/classification.d.ts +2 -2
- package/dist/model/classification.d.ts.map +1 -1
- package/dist/model/line-connect.d.ts +3 -3
- package/dist/model/line-connect.d.ts.map +1 -1
- package/dist/model/matching.d.ts +3 -3
- package/dist/model/matching.d.ts.map +1 -1
- package/dist/model/question-element-specs.d.ts.map +1 -1
- package/dist/model/question-structure.d.ts +12 -0
- package/dist/model/question-structure.d.ts.map +1 -1
- package/dist/model/types.d.ts +11 -12
- package/dist/model/types.d.ts.map +1 -1
- package/dist/question/content-editor/QuestionContentFillTextEditor.d.ts.map +1 -1
- package/dist/question/content-editor/helpers.d.ts +7 -7
- package/dist/question/content-editor/helpers.d.ts.map +1 -1
- package/dist/question/content-editor/i18n.d.ts.map +1 -1
- package/dist/question/content-editor/structure.d.ts.map +1 -1
- package/dist/question/content-editor/types.d.ts +12 -78
- package/dist/question/content-editor/types.d.ts.map +1 -1
- package/dist/question/i18n/messages.d.ts +3 -3
- package/dist/question/i18n/messages.d.ts.map +1 -1
- package/dist/question/player/QuestionFillTextCandidateButton.d.ts +3 -3
- package/dist/question/player/QuestionFillTextCandidateButton.d.ts.map +1 -1
- package/dist/question/player/QuestionFillTextContentPlayer.d.ts +1 -1
- package/dist/question/player/QuestionFillTextContentPlayer.d.ts.map +1 -1
- package/dist/question/player/helpers.d.ts +1 -1
- package/dist/question/player/helpers.d.ts.map +1 -1
- package/dist/question/renderers/helpers.d.ts +3 -3
- package/dist/question/renderers/helpers.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -287,7 +287,7 @@ function Ce(e) {
|
|
|
287
287
|
var we = 2, Te = 4;
|
|
288
288
|
function Ee(e) {
|
|
289
289
|
return {
|
|
290
|
-
|
|
290
|
+
answers: {},
|
|
291
291
|
categories: Me(),
|
|
292
292
|
elementId: e.id,
|
|
293
293
|
items: Ne(),
|
|
@@ -298,7 +298,7 @@ function De(e, t) {
|
|
|
298
298
|
if ((t == null ? void 0 : t.type) !== "classification") return Ee(e);
|
|
299
299
|
let n = Ae(t.categories), r = je(t.items);
|
|
300
300
|
return {
|
|
301
|
-
|
|
301
|
+
answers: Oe(t.answers, n, r),
|
|
302
302
|
categories: n,
|
|
303
303
|
elementId: e.id,
|
|
304
304
|
items: r,
|
|
@@ -409,7 +409,7 @@ var Ve = 2, He = ["number", "upperAlpha"], Ue = [
|
|
|
409
409
|
function Ke(e) {
|
|
410
410
|
let t = et(e.config.columns);
|
|
411
411
|
return {
|
|
412
|
-
|
|
412
|
+
answers: at(t),
|
|
413
413
|
columns: t,
|
|
414
414
|
elementId: e.id,
|
|
415
415
|
type: "lineConnect"
|
|
@@ -419,7 +419,7 @@ function qe(e, t) {
|
|
|
419
419
|
if ((t == null ? void 0 : t.type) !== "lineConnect") return Ke(e);
|
|
420
420
|
let n = tt(t.columns, e.config.columns);
|
|
421
421
|
return {
|
|
422
|
-
|
|
422
|
+
answers: Je(t.answers, n),
|
|
423
423
|
columns: n,
|
|
424
424
|
elementId: e.id,
|
|
425
425
|
type: "lineConnect"
|
|
@@ -541,7 +541,7 @@ var mt = 2, ht = ["number", "upperAlpha"];
|
|
|
541
541
|
function gt(e) {
|
|
542
542
|
let t = wt(e.config.columns);
|
|
543
543
|
return {
|
|
544
|
-
|
|
544
|
+
answers: kt(t),
|
|
545
545
|
columns: t,
|
|
546
546
|
elementId: e.id,
|
|
547
547
|
type: "matching"
|
|
@@ -551,7 +551,7 @@ function _t(e, t) {
|
|
|
551
551
|
if ((t == null ? void 0 : t.type) !== "matching") return gt(e);
|
|
552
552
|
let n = Tt(t.columns, e.config.columns);
|
|
553
553
|
return {
|
|
554
|
-
|
|
554
|
+
answers: vt(t.answers, n),
|
|
555
555
|
columns: n,
|
|
556
556
|
elementId: e.id,
|
|
557
557
|
type: "matching"
|
|
@@ -800,8 +800,8 @@ var Qt = ["true", "false"], $t = {
|
|
|
800
800
|
createDataElement: (e) => bn(e),
|
|
801
801
|
createTypeElement: (e, t) => ({
|
|
802
802
|
config: {
|
|
803
|
-
|
|
804
|
-
|
|
803
|
+
allowCandidateReuse: !1,
|
|
804
|
+
candidateMode: "none"
|
|
805
805
|
},
|
|
806
806
|
id: e,
|
|
807
807
|
name: "\u9898\u5e72\u5185\u586b\u7a7a",
|
|
@@ -830,7 +830,7 @@ var Qt = ["true", "false"], $t = {
|
|
|
830
830
|
judgement: {
|
|
831
831
|
createDataElement: (e) => Hn(e),
|
|
832
832
|
createTypeElement: (e, t) => ({
|
|
833
|
-
config: {
|
|
833
|
+
config: { judgeAnswerMode: "correctWrong" },
|
|
834
834
|
id: e,
|
|
835
835
|
name: "\u5224\u65ad",
|
|
836
836
|
type: "judgement",
|
|
@@ -934,7 +934,7 @@ function rn(e, t) {
|
|
|
934
934
|
}
|
|
935
935
|
function an(e) {
|
|
936
936
|
return {
|
|
937
|
-
|
|
937
|
+
answers: [],
|
|
938
938
|
content: Rt(""),
|
|
939
939
|
elementId: e.id,
|
|
940
940
|
markers: [],
|
|
@@ -945,7 +945,7 @@ function on(e, t) {
|
|
|
945
945
|
if ((t == null ? void 0 : t.type) !== "textMarker") return an(e);
|
|
946
946
|
let n = zt(t.content), r = er(t.markers, n.json);
|
|
947
947
|
return {
|
|
948
|
-
|
|
948
|
+
answers: tr(t.answers, r),
|
|
949
949
|
content: n,
|
|
950
950
|
elementId: e.id,
|
|
951
951
|
markers: r,
|
|
@@ -974,7 +974,7 @@ function ln(e, t) {
|
|
|
974
974
|
function un(e) {
|
|
975
975
|
let t = hn();
|
|
976
976
|
return {
|
|
977
|
-
|
|
977
|
+
answers: t.map((e) => e.id),
|
|
978
978
|
elementId: e.id,
|
|
979
979
|
sortOptions: t,
|
|
980
980
|
type: "ordering"
|
|
@@ -984,7 +984,7 @@ function dn(e, t) {
|
|
|
984
984
|
if ((t == null ? void 0 : t.type) !== "ordering") return un(e);
|
|
985
985
|
let n = pn(t.sortOptions);
|
|
986
986
|
return {
|
|
987
|
-
|
|
987
|
+
answers: mn(t.answers, n),
|
|
988
988
|
elementId: e.id,
|
|
989
989
|
sortOptions: n,
|
|
990
990
|
type: "ordering"
|
|
@@ -1033,7 +1033,7 @@ function _n(e, t) {
|
|
|
1033
1033
|
function vn(e) {
|
|
1034
1034
|
return {
|
|
1035
1035
|
answers: [{
|
|
1036
|
-
|
|
1036
|
+
answerPools: [v("")],
|
|
1037
1037
|
blankIds: ["blank-1"]
|
|
1038
1038
|
}],
|
|
1039
1039
|
blanks: [{
|
|
@@ -1062,7 +1062,7 @@ function bn(e) {
|
|
|
1062
1062
|
return {
|
|
1063
1063
|
answers: [{
|
|
1064
1064
|
allowReuse: !1,
|
|
1065
|
-
|
|
1065
|
+
answers: { "inline-blank-1": [v("")] },
|
|
1066
1066
|
blankIds: ["inline-blank-1"],
|
|
1067
1067
|
options: []
|
|
1068
1068
|
}],
|
|
@@ -1076,7 +1076,7 @@ function xn(e, t) {
|
|
|
1076
1076
|
if ((t == null ? void 0 : t.type) !== "inlineFill") return bn(e);
|
|
1077
1077
|
let n = wn(t.blanks, "inline-blank"), r = jn(e.config.candidateMode);
|
|
1078
1078
|
return {
|
|
1079
|
-
answers: Mn(t.answers, n, r, e.config.
|
|
1079
|
+
answers: Mn(t.answers, n, r, e.config.allowCandidateReuse),
|
|
1080
1080
|
blanks: n,
|
|
1081
1081
|
content: b(t.content, n),
|
|
1082
1082
|
elementId: e.id,
|
|
@@ -1085,7 +1085,7 @@ function xn(e, t) {
|
|
|
1085
1085
|
}
|
|
1086
1086
|
function Sn(e) {
|
|
1087
1087
|
return {
|
|
1088
|
-
|
|
1088
|
+
answers: { blank_0: "" },
|
|
1089
1089
|
blanks: ["blank_0"],
|
|
1090
1090
|
candidateOptions: Dn(e),
|
|
1091
1091
|
content: b(v("\u8bf7\u5728____\u5904\u4f5c\u7b54\u3002"), [{
|
|
@@ -1100,7 +1100,7 @@ function Cn(e, t) {
|
|
|
1100
1100
|
if ((t == null ? void 0 : t.type) !== "wordBuilder") return Sn(e);
|
|
1101
1101
|
let n = Tn(t.blanks);
|
|
1102
1102
|
return {
|
|
1103
|
-
|
|
1103
|
+
answers: On(t.answers, n),
|
|
1104
1104
|
blanks: n,
|
|
1105
1105
|
candidateOptions: En(t.candidateOptions, e),
|
|
1106
1106
|
content: y(t.content),
|
|
@@ -1143,10 +1143,10 @@ function On(e, t) {
|
|
|
1143
1143
|
}
|
|
1144
1144
|
function kn(e, t) {
|
|
1145
1145
|
let n = new Set(t.map((e) => e.id)), r = (e == null ? [] : e).map((e) => ({
|
|
1146
|
-
|
|
1146
|
+
answerPools: An(e.answerPools),
|
|
1147
1147
|
blankIds: e.blankIds.filter((e, t, r) => n.has(e) && r.indexOf(e) === t)
|
|
1148
1148
|
})).filter((e) => e.blankIds.length > 0), i = new Set(r.reduce((e, t) => [...e, ...t.blankIds], [])), a = t.filter((e) => !i.has(e.id)).map((e) => ({
|
|
1149
|
-
|
|
1149
|
+
answerPools: [v("")],
|
|
1150
1150
|
blankIds: [e.id]
|
|
1151
1151
|
}));
|
|
1152
1152
|
return [...r, ...a];
|
|
@@ -1166,8 +1166,8 @@ function Nn(e, t, n, r) {
|
|
|
1166
1166
|
var i;
|
|
1167
1167
|
let a = e.filter((e) => e.blankIds.some((e) => t.includes(e))), o = n === "none" ? [] : In((i = a.find((e) => e.options.length > 0)) == null ? void 0 : i.options), s = new Set(o.map((e) => e.id));
|
|
1168
1168
|
return {
|
|
1169
|
-
allowReuse:
|
|
1170
|
-
|
|
1169
|
+
allowReuse: n === "sharedPool" && r,
|
|
1170
|
+
answers: Ln(t, (e) => Rn(Pn(a, e), n, s)),
|
|
1171
1171
|
blankIds: t,
|
|
1172
1172
|
options: o
|
|
1173
1173
|
};
|
|
@@ -1175,7 +1175,7 @@ function Nn(e, t, n, r) {
|
|
|
1175
1175
|
function Pn(e, t) {
|
|
1176
1176
|
return e.map((e) => {
|
|
1177
1177
|
var n;
|
|
1178
|
-
return (n = Object.entries(e.
|
|
1178
|
+
return (n = Object.entries(e.answers).find(([e]) => e === t)) == null ? void 0 : n[1];
|
|
1179
1179
|
}).find((e) => !!e);
|
|
1180
1180
|
}
|
|
1181
1181
|
function Fn(e, t) {
|
|
@@ -1184,7 +1184,7 @@ function Fn(e, t) {
|
|
|
1184
1184
|
let i = t.blankIds.filter((e, t, i) => !n.has(e) || i.indexOf(e) !== t || r.has(e) ? !1 : (r.add(e), !0));
|
|
1185
1185
|
return i.length > 0 ? [...e, {
|
|
1186
1186
|
allowReuse: !!t.allowReuse,
|
|
1187
|
-
|
|
1187
|
+
answers: t.answers,
|
|
1188
1188
|
blankIds: i,
|
|
1189
1189
|
options: t.options
|
|
1190
1190
|
}] : e;
|
|
@@ -1200,14 +1200,14 @@ function In(e) {
|
|
|
1200
1200
|
function Ln(e, t) {
|
|
1201
1201
|
return e.reduce((e, n) => k(k({}, e), {}, { [n]: t(n) }), {});
|
|
1202
1202
|
}
|
|
1203
|
-
function Rn(e, t, n
|
|
1204
|
-
var
|
|
1203
|
+
function Rn(e, t, n) {
|
|
1204
|
+
var r;
|
|
1205
1205
|
if (t === "none") {
|
|
1206
1206
|
let t = (e == null ? [] : e).filter(zn).map((e) => y(e));
|
|
1207
1207
|
return t.length > 0 ? t : [v("")];
|
|
1208
1208
|
}
|
|
1209
|
-
let
|
|
1210
|
-
return
|
|
1209
|
+
let i = (e == null ? [] : e).filter((e) => typeof e == "string").filter((e, t, r) => n.has(e) && r.indexOf(e) === t), a = t === "perBlankOptions" ? i.slice(0, 1) : i;
|
|
1210
|
+
return a.length > 0 ? a : [(r = n.values().next().value) == null ? "" : r].filter(Boolean);
|
|
1211
1211
|
}
|
|
1212
1212
|
function zn(e) {
|
|
1213
1213
|
return !!(e && typeof e == "object");
|
|
@@ -1263,19 +1263,19 @@ function Kn(e, t, n) {
|
|
|
1263
1263
|
function qn(e, t, n) {
|
|
1264
1264
|
let r = (t == null ? void 0 : t.type) === "inlineFill" ? t : bn(e);
|
|
1265
1265
|
return {
|
|
1266
|
-
answers: Jn((n == null ? void 0 : n.type) === "inlineFill" ? n.answers : void 0, r, jn(e.config.candidateMode)
|
|
1266
|
+
answers: Jn((n == null ? void 0 : n.type) === "inlineFill" ? n.answers : void 0, r, jn(e.config.candidateMode)),
|
|
1267
1267
|
elementId: e.id,
|
|
1268
1268
|
type: "inlineFill"
|
|
1269
1269
|
};
|
|
1270
1270
|
}
|
|
1271
|
-
function Jn(e, t, n
|
|
1272
|
-
let
|
|
1273
|
-
return (e == null ? [] : e).filter((e) =>
|
|
1274
|
-
var
|
|
1275
|
-
let
|
|
1271
|
+
function Jn(e, t, n) {
|
|
1272
|
+
let r = new Set(t.blanks.map((e) => e.id));
|
|
1273
|
+
return (e == null ? [] : e).filter((e) => r.has(e.blankId)).map((e) => {
|
|
1274
|
+
var r;
|
|
1275
|
+
let i = t.answers.find((t) => t.blankIds.includes(e.blankId)), a = new Set((r = i == null ? void 0 : i.options.map((e) => e.id)) == null ? [] : r);
|
|
1276
1276
|
return {
|
|
1277
1277
|
blankId: e.blankId,
|
|
1278
|
-
values: Rn(e.values, n,
|
|
1278
|
+
values: Rn(e.values, n, a)
|
|
1279
1279
|
};
|
|
1280
1280
|
});
|
|
1281
1281
|
}
|
|
@@ -1327,7 +1327,7 @@ function tr(e, t) {
|
|
|
1327
1327
|
}
|
|
1328
1328
|
var nr = [
|
|
1329
1329
|
"none",
|
|
1330
|
-
"
|
|
1330
|
+
"perBlankOptions",
|
|
1331
1331
|
"sharedPool"
|
|
1332
1332
|
];
|
|
1333
1333
|
//#endregion
|
|
@@ -1579,13 +1579,14 @@ function Lr(e, t = []) {
|
|
|
1579
1579
|
return {
|
|
1580
1580
|
clientId: Zr(),
|
|
1581
1581
|
enName: Yr(e),
|
|
1582
|
+
extraKey: Qr(e),
|
|
1582
1583
|
name: Jr(e),
|
|
1583
1584
|
type: e
|
|
1584
1585
|
};
|
|
1585
1586
|
}
|
|
1586
1587
|
function Rr(e, t = []) {
|
|
1587
1588
|
let n = Zr();
|
|
1588
|
-
return e === "classification" || e === "fill" || e === "richText" || e === "textMarker" || e === "ordering" ?
|
|
1589
|
+
return e === "classification" || e === "fill" || e === "richText" || e === "textMarker" || e === "ordering" ? $r(e, n) : zr(e, n);
|
|
1589
1590
|
}
|
|
1590
1591
|
function zr(e, t) {
|
|
1591
1592
|
switch (e) {
|
|
@@ -1595,6 +1596,7 @@ function zr(e, t) {
|
|
|
1595
1596
|
allowCandidateReuse: !1,
|
|
1596
1597
|
candidateMode: "none"
|
|
1597
1598
|
},
|
|
1599
|
+
elementKey: t,
|
|
1598
1600
|
enName: j(e),
|
|
1599
1601
|
name: A(e),
|
|
1600
1602
|
type: e
|
|
@@ -1602,6 +1604,7 @@ function zr(e, t) {
|
|
|
1602
1604
|
case "wordBuilder": return {
|
|
1603
1605
|
clientId: t,
|
|
1604
1606
|
config: { builderMode: "spelling" },
|
|
1607
|
+
elementKey: t,
|
|
1605
1608
|
enName: j(e),
|
|
1606
1609
|
name: A(e),
|
|
1607
1610
|
type: e
|
|
@@ -1609,6 +1612,7 @@ function zr(e, t) {
|
|
|
1609
1612
|
case "judgement": return {
|
|
1610
1613
|
clientId: t,
|
|
1611
1614
|
config: { judgeAnswerMode: "correctWrong" },
|
|
1615
|
+
elementKey: t,
|
|
1612
1616
|
enName: j(e),
|
|
1613
1617
|
name: A(e),
|
|
1614
1618
|
type: e
|
|
@@ -1620,6 +1624,7 @@ function zr(e, t) {
|
|
|
1620
1624
|
renderer: "standard",
|
|
1621
1625
|
selectionType: "single"
|
|
1622
1626
|
},
|
|
1627
|
+
elementKey: t,
|
|
1623
1628
|
enName: j(e),
|
|
1624
1629
|
name: A(e),
|
|
1625
1630
|
type: e
|
|
@@ -1632,6 +1637,7 @@ function Br(e, t) {
|
|
|
1632
1637
|
return {
|
|
1633
1638
|
clientId: t,
|
|
1634
1639
|
config: { columns: [{ labelStyle: "number" }, { labelStyle: "upperAlpha" }] },
|
|
1640
|
+
elementKey: t,
|
|
1635
1641
|
enName: j(e),
|
|
1636
1642
|
name: A(e),
|
|
1637
1643
|
type: e
|
|
@@ -1646,7 +1652,7 @@ function Hr(e, t) {
|
|
|
1646
1652
|
function Ur(e, t, n) {
|
|
1647
1653
|
let r = e.elements.findIndex((e) => e.clientId === t), i = r + n;
|
|
1648
1654
|
if (r < 0 || i < 0 || i >= e.elements.length) return e;
|
|
1649
|
-
let a =
|
|
1655
|
+
let a = ei(e.elements, r), o = ei(e.elements, i);
|
|
1650
1656
|
return !a || !o ? e : k(k({}, e), {}, { elements: e.elements.map((e, t) => t === r ? o : t === i ? a : e) });
|
|
1651
1657
|
}
|
|
1652
1658
|
function Wr(e, t, n) {
|
|
@@ -1680,21 +1686,25 @@ function Xr(e, t) {
|
|
|
1680
1686
|
function Zr() {
|
|
1681
1687
|
return kr();
|
|
1682
1688
|
}
|
|
1683
|
-
function Qr(e
|
|
1689
|
+
function Qr(e) {
|
|
1690
|
+
return `extra-${e}`;
|
|
1691
|
+
}
|
|
1692
|
+
function $r(e, t) {
|
|
1684
1693
|
return {
|
|
1685
1694
|
clientId: t,
|
|
1686
1695
|
config: {},
|
|
1696
|
+
elementKey: t,
|
|
1687
1697
|
enName: j(e),
|
|
1688
1698
|
name: A(e),
|
|
1689
1699
|
type: e
|
|
1690
1700
|
};
|
|
1691
1701
|
}
|
|
1692
|
-
function
|
|
1702
|
+
function ei(e, t) {
|
|
1693
1703
|
return e.find((e, n) => n === t);
|
|
1694
1704
|
}
|
|
1695
1705
|
//#endregion
|
|
1696
1706
|
//#region src/question/elements/fill/inline-fill-plugin.module.css
|
|
1697
|
-
var
|
|
1707
|
+
var ti = { "blank-underline": "_blank-underline_1wnlx_1" }, ni = { nodes: [{
|
|
1698
1708
|
codecs: {
|
|
1699
1709
|
html: {
|
|
1700
1710
|
deserialize: ({ element: e }) => {
|
|
@@ -1706,111 +1716,111 @@ var ei = { "blank-underline": "_blank-underline_1wnlx_1" }, ti = { nodes: [{
|
|
|
1706
1716
|
type: "blank"
|
|
1707
1717
|
} : null;
|
|
1708
1718
|
},
|
|
1709
|
-
serialize: ({ node: e }) => e.type === "blank" ? `<span data-rte-node="blank" data-blank-id="${
|
|
1719
|
+
serialize: ({ node: e }) => e.type === "blank" ? `<span data-rte-node="blank" data-blank-id="${oi(e.blankId)}" data-label="${oi(e.label)}"></span>` : null
|
|
1710
1720
|
},
|
|
1711
1721
|
json: {
|
|
1712
|
-
deserialize: ({ input: e }) =>
|
|
1713
|
-
blankId:
|
|
1714
|
-
label:
|
|
1722
|
+
deserialize: ({ input: e }) => ri(e) ? {
|
|
1723
|
+
blankId: oi(e.blankId),
|
|
1724
|
+
label: oi(e.label),
|
|
1715
1725
|
children: [{ text: "" }],
|
|
1716
1726
|
type: "blank"
|
|
1717
1727
|
} : null,
|
|
1718
1728
|
serialize: ({ node: e }) => e.type === "blank" ? {
|
|
1719
|
-
blankId:
|
|
1720
|
-
label:
|
|
1729
|
+
blankId: oi(e.blankId),
|
|
1730
|
+
label: oi(e.label),
|
|
1721
1731
|
type: "blank"
|
|
1722
1732
|
} : null
|
|
1723
1733
|
}
|
|
1724
1734
|
},
|
|
1725
1735
|
commands: { insert: ({ payload: e }) => ({
|
|
1726
|
-
blankId:
|
|
1727
|
-
label:
|
|
1736
|
+
blankId: ii(e),
|
|
1737
|
+
label: ai(e),
|
|
1728
1738
|
type: "blank"
|
|
1729
1739
|
}) },
|
|
1730
1740
|
object: {
|
|
1731
1741
|
inline: !0,
|
|
1732
1742
|
markable: !0,
|
|
1733
1743
|
render: ({ element: e, selected: t }) => /* @__PURE__ */ a("span", {
|
|
1734
|
-
className:
|
|
1744
|
+
className: ti["blank-underline"],
|
|
1735
1745
|
"data-selected": t ? "true" : void 0,
|
|
1736
|
-
children:
|
|
1746
|
+
children: oi(e.label) || oi(e.blankId) || "Blank"
|
|
1737
1747
|
})
|
|
1738
1748
|
},
|
|
1739
1749
|
type: "blank"
|
|
1740
1750
|
}] };
|
|
1741
|
-
function ni(e) {
|
|
1742
|
-
return !!(e && typeof e == "object" && "type" in e && e.type === "blank");
|
|
1743
|
-
}
|
|
1744
1751
|
function ri(e) {
|
|
1745
|
-
return e && typeof e == "object" && "
|
|
1752
|
+
return !!(e && typeof e == "object" && "type" in e && e.type === "blank");
|
|
1746
1753
|
}
|
|
1747
1754
|
function ii(e) {
|
|
1748
|
-
return e && typeof e == "object" && "
|
|
1755
|
+
return e && typeof e == "object" && "blankId" in e ? oi(e.blankId) : "";
|
|
1749
1756
|
}
|
|
1750
1757
|
function ai(e) {
|
|
1758
|
+
return e && typeof e == "object" && "label" in e ? oi(e.label) : "";
|
|
1759
|
+
}
|
|
1760
|
+
function oi(e) {
|
|
1751
1761
|
return typeof e == "string" ? e : "";
|
|
1752
1762
|
}
|
|
1753
1763
|
//#endregion
|
|
1754
1764
|
//#region src/question/content-editor/helpers.ts
|
|
1755
|
-
var
|
|
1765
|
+
var si = 1, ci = 4, li = "composite", ui = 2, di = 4, fi = 2, pi = {
|
|
1756
1766
|
lowerAlpha: (e) => String.fromCharCode(97 + e),
|
|
1757
1767
|
number: (e) => String(e + 1),
|
|
1758
1768
|
upperAlpha: (e) => String.fromCharCode(65 + e)
|
|
1759
1769
|
};
|
|
1760
|
-
function
|
|
1761
|
-
return e.systemQuestionType ===
|
|
1770
|
+
function mi(e) {
|
|
1771
|
+
return e.systemQuestionType === li;
|
|
1762
1772
|
}
|
|
1763
|
-
function
|
|
1773
|
+
function hi(e, t = null) {
|
|
1764
1774
|
return {
|
|
1765
1775
|
questionTypeKey: t,
|
|
1766
1776
|
children: [],
|
|
1767
|
-
elements: e.elements.map((t) =>
|
|
1768
|
-
extras: e.extras.map(
|
|
1777
|
+
elements: e.elements.map((t) => Za(t, e.hasAnswer)),
|
|
1778
|
+
extras: e.extras.map(eo),
|
|
1769
1779
|
id: null,
|
|
1770
1780
|
version: ""
|
|
1771
1781
|
};
|
|
1772
1782
|
}
|
|
1773
1783
|
function M(e = "", t) {
|
|
1774
|
-
return
|
|
1784
|
+
return gi(t == null ? zo(e) : t);
|
|
1775
1785
|
}
|
|
1776
|
-
function
|
|
1777
|
-
let n =
|
|
1786
|
+
function gi(e, t = [ni]) {
|
|
1787
|
+
let n = qo(e, t);
|
|
1778
1788
|
return {
|
|
1779
1789
|
html: r(n, { plugins: t }),
|
|
1780
1790
|
json: n,
|
|
1781
|
-
text:
|
|
1791
|
+
text: Bo(n)
|
|
1782
1792
|
};
|
|
1783
1793
|
}
|
|
1784
|
-
function
|
|
1785
|
-
return
|
|
1786
|
-
}
|
|
1787
|
-
function _i(e, n, r) {
|
|
1788
|
-
return n && Go(n) ? n : r ? t(r, { plugins: [It] }) : Ro(e);
|
|
1794
|
+
function _i(e = "", t, n = "") {
|
|
1795
|
+
return gi(vi(e, t, n), [It]);
|
|
1789
1796
|
}
|
|
1790
|
-
function vi(e) {
|
|
1791
|
-
return
|
|
1797
|
+
function vi(e, n, r) {
|
|
1798
|
+
return n && Ko(n) ? n : r ? t(r, { plugins: [It] }) : zo(e);
|
|
1792
1799
|
}
|
|
1793
1800
|
function yi(e) {
|
|
1794
|
-
return
|
|
1801
|
+
return Vt(e.content.json).filter((t) => e.answers.includes(t.markerId)).map((e) => e.text.trim()).filter(Boolean).join(" / ");
|
|
1795
1802
|
}
|
|
1796
|
-
function bi(e
|
|
1797
|
-
|
|
1798
|
-
return (r = e.elements.find((e) => e.elementKey === t.elementKey)) == null ? Xa(t, n) : r;
|
|
1803
|
+
function bi(e) {
|
|
1804
|
+
return Ko(e.json) ? e.json : zo(e.text);
|
|
1799
1805
|
}
|
|
1800
|
-
function xi(e, t) {
|
|
1801
|
-
var
|
|
1802
|
-
return (
|
|
1806
|
+
function xi(e, t, n) {
|
|
1807
|
+
var r;
|
|
1808
|
+
return (r = e.elements.find((e) => e.elementKey === t.elementKey)) == null ? Za(t, n) : r;
|
|
1803
1809
|
}
|
|
1804
1810
|
function Si(e, t) {
|
|
1805
|
-
|
|
1811
|
+
var n;
|
|
1812
|
+
return (n = e.extras.find((e) => e.extraKey === t.extraKey)) == null ? eo(t) : n;
|
|
1806
1813
|
}
|
|
1807
1814
|
function Ci(e, t) {
|
|
1808
|
-
return
|
|
1815
|
+
return pi[e](t);
|
|
1809
1816
|
}
|
|
1810
1817
|
function wi(e, t) {
|
|
1818
|
+
return $e(e, t);
|
|
1819
|
+
}
|
|
1820
|
+
function Ti(e, t) {
|
|
1811
1821
|
return Ct(e, t);
|
|
1812
1822
|
}
|
|
1813
|
-
function
|
|
1823
|
+
function Ei(e) {
|
|
1814
1824
|
switch (e) {
|
|
1815
1825
|
case "checkCross": return ["\u2713", "\u2715"];
|
|
1816
1826
|
case "correctWrong": return ["\u6b63\u786e", "\u9519\u8bef"];
|
|
@@ -1820,139 +1830,139 @@ function Ti(e) {
|
|
|
1820
1830
|
case "yesNo": return ["\u662f", "\u5426"];
|
|
1821
1831
|
}
|
|
1822
1832
|
}
|
|
1823
|
-
function Ei(e, t) {
|
|
1824
|
-
return e.options.map((e, n) => _a(e, n, t));
|
|
1825
|
-
}
|
|
1826
1833
|
function Di(e, t) {
|
|
1827
|
-
|
|
1828
|
-
|
|
1834
|
+
return e.options.map((e, n) => va(e, n, t));
|
|
1835
|
+
}
|
|
1836
|
+
function Oi(e, t) {
|
|
1837
|
+
let n = Di(e, t);
|
|
1838
|
+
return e.answers.optionIds.reduce((e, t) => {
|
|
1829
1839
|
let r = n.find((e) => e.optionId === t);
|
|
1830
1840
|
return r ? [...e, r] : e;
|
|
1831
1841
|
}, []);
|
|
1832
1842
|
}
|
|
1833
|
-
function Oi(e) {
|
|
1834
|
-
return e.elements.every(qo) && e.extras.every((e) => N(e.content)) && e.children.every(Oi);
|
|
1835
|
-
}
|
|
1836
1843
|
function ki(e) {
|
|
1844
|
+
return e.elements.every(Jo) && e.extras.every((e) => N(e.content)) && e.children.every(ki);
|
|
1845
|
+
}
|
|
1846
|
+
function Ai(e) {
|
|
1837
1847
|
return {
|
|
1838
1848
|
questionTypeKey: e.questionTypeKey,
|
|
1839
|
-
children: e.children.map(
|
|
1840
|
-
elements: e.elements.map(
|
|
1849
|
+
children: e.children.map(Ai),
|
|
1850
|
+
elements: e.elements.map(ss),
|
|
1841
1851
|
extras: e.extras.map(hs),
|
|
1842
1852
|
id: e.id,
|
|
1843
1853
|
version: e.version
|
|
1844
1854
|
};
|
|
1845
1855
|
}
|
|
1846
|
-
function
|
|
1856
|
+
function ji(e, t) {
|
|
1847
1857
|
var n, r, i;
|
|
1848
1858
|
let a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
|
|
1849
1859
|
return {
|
|
1850
1860
|
questionTypeKey: (n = t.questionTypeKey) == null ? null : n,
|
|
1851
1861
|
children: (r = t.children) == null ? [] : r,
|
|
1852
1862
|
elements: e.elements.map((n) => {
|
|
1853
|
-
let r = t.elements.findIndex((e, t) => !a.has(t) && e.
|
|
1854
|
-
return r < 0 ?
|
|
1863
|
+
let r = t.elements.findIndex((e, t) => !a.has(t) && e.elementKey === n.elementKey);
|
|
1864
|
+
return r < 0 ? Za(n, e.hasAnswer) : (a.add(r), ls(t.elements.slice(r, r + 1)[0], n, e.hasAnswer));
|
|
1855
1865
|
}),
|
|
1856
1866
|
extras: e.extras.map((e) => {
|
|
1857
1867
|
var n, r;
|
|
1858
|
-
let i = (n = (r = t.extras) == null ? void 0 : r.findIndex((t, n) => !o.has(n) && t.
|
|
1859
|
-
return i < 0 || !t.extras ?
|
|
1868
|
+
let i = (n = (r = t.extras) == null ? void 0 : r.findIndex((t, n) => !o.has(n) && t.extraKey === e.extraKey)) == null ? -1 : n;
|
|
1869
|
+
return i < 0 || !t.extras ? eo(e) : (o.add(i), t.extras.slice(i, i + 1)[0]);
|
|
1860
1870
|
}),
|
|
1861
1871
|
id: (i = t.id) == null ? null : i,
|
|
1862
1872
|
version: t.version
|
|
1863
1873
|
};
|
|
1864
1874
|
}
|
|
1865
|
-
function
|
|
1875
|
+
function Mi(e, t) {
|
|
1866
1876
|
let n = e.elements.some((e) => e.elementKey === t.elementKey);
|
|
1867
1877
|
return k(k({}, e), {}, { elements: n ? e.elements.map((e) => e.elementKey === t.elementKey ? t : e) : [...e.elements, t] });
|
|
1868
1878
|
}
|
|
1869
|
-
function
|
|
1879
|
+
function Ni(e, t) {
|
|
1870
1880
|
let n = e.extras.some((e) => e.extraKey === t.extraKey);
|
|
1871
1881
|
return k(k({}, e), {}, { extras: n ? e.extras.map((e) => e.extraKey === t.extraKey ? t : e) : [...e.extras, t] });
|
|
1872
1882
|
}
|
|
1873
|
-
function
|
|
1883
|
+
function Pi(e) {
|
|
1874
1884
|
let t = [];
|
|
1875
|
-
return
|
|
1876
|
-
if (!
|
|
1877
|
-
let n =
|
|
1885
|
+
return Ho(e, (e) => {
|
|
1886
|
+
if (!Wo(e) || e.type !== "blank") return;
|
|
1887
|
+
let n = Uo(e, "blankId");
|
|
1878
1888
|
n && !t.includes(n) && t.push(n);
|
|
1879
1889
|
}), t;
|
|
1880
1890
|
}
|
|
1881
|
-
function
|
|
1882
|
-
return
|
|
1891
|
+
function Fi(e) {
|
|
1892
|
+
return Ro(e);
|
|
1883
1893
|
}
|
|
1884
|
-
function
|
|
1885
|
-
let i =
|
|
1886
|
-
return
|
|
1894
|
+
function Ii(e, t, n, r) {
|
|
1895
|
+
let i = Pi(t.json);
|
|
1896
|
+
return Bi(k(k({}, e), {}, {
|
|
1887
1897
|
blanks: i,
|
|
1888
1898
|
content: t
|
|
1889
1899
|
}), r, n);
|
|
1890
1900
|
}
|
|
1891
|
-
function
|
|
1892
|
-
let i =
|
|
1893
|
-
return
|
|
1901
|
+
function Li(e, t, n, r) {
|
|
1902
|
+
let i = Pi(t.json);
|
|
1903
|
+
return zi(k(k({}, e), {}, {
|
|
1894
1904
|
blanks: i,
|
|
1895
1905
|
content: t
|
|
1896
1906
|
}), n, r);
|
|
1897
1907
|
}
|
|
1898
|
-
function
|
|
1899
|
-
let r =
|
|
1908
|
+
function Ri(e, t, n) {
|
|
1909
|
+
let r = _i(t.text, t.json, t.html), i = Bt(r.json);
|
|
1900
1910
|
return k(k({}, e), {}, {
|
|
1901
|
-
|
|
1911
|
+
answers: n ? So(e.answers, i) : [],
|
|
1902
1912
|
content: r,
|
|
1903
1913
|
markers: i
|
|
1904
1914
|
});
|
|
1905
1915
|
}
|
|
1906
|
-
function
|
|
1907
|
-
let r =
|
|
1916
|
+
function zi(e, t, n) {
|
|
1917
|
+
let r = Gi(e.blanks);
|
|
1908
1918
|
return k(k({}, e), {}, {
|
|
1909
|
-
|
|
1919
|
+
answers: t ? Ki(e.answers, r) : {},
|
|
1910
1920
|
blanks: r,
|
|
1911
|
-
candidateOptions:
|
|
1921
|
+
candidateOptions: Ui(e.candidateOptions, n.config.builderMode)
|
|
1912
1922
|
});
|
|
1913
1923
|
}
|
|
1914
|
-
function
|
|
1924
|
+
function Bi(e, t, n) {
|
|
1915
1925
|
if (t.config.candidateMode === "sharedPool") {
|
|
1916
|
-
let r =
|
|
1926
|
+
let r = Hi(e.candidateOptions, "option_");
|
|
1917
1927
|
return k(k({}, e), {}, {
|
|
1918
|
-
|
|
1928
|
+
answers: n ? Zi(e.answers, e.blanks, r.map((e) => e.optionId), t.config.allowCandidateReuse) : [],
|
|
1919
1929
|
blankOptionGroups: void 0,
|
|
1920
1930
|
candidateOptions: r
|
|
1921
1931
|
});
|
|
1922
1932
|
}
|
|
1923
1933
|
if (t.config.candidateMode === "perBlankOptions") {
|
|
1924
|
-
let t =
|
|
1934
|
+
let t = Yi(e.blankOptionGroups, e.blanks), r = new Map(t.map((e) => [e.blankId, e.options.map((e) => e.optionId)]));
|
|
1925
1935
|
return k(k({}, e), {}, {
|
|
1926
|
-
|
|
1936
|
+
answers: n ? Qi(e.answers, e.blanks, r) : [],
|
|
1927
1937
|
blankOptionGroups: t,
|
|
1928
1938
|
candidateOptions: void 0
|
|
1929
1939
|
});
|
|
1930
1940
|
}
|
|
1931
1941
|
return k(k({}, e), {}, {
|
|
1932
|
-
|
|
1942
|
+
answers: n ? ta(e.answers, e.blanks) : [],
|
|
1933
1943
|
blankOptionGroups: void 0,
|
|
1934
1944
|
candidateOptions: void 0
|
|
1935
1945
|
});
|
|
1936
1946
|
}
|
|
1937
|
-
function
|
|
1947
|
+
function Vi(e, t = M()) {
|
|
1938
1948
|
return {
|
|
1939
1949
|
content: t,
|
|
1940
1950
|
optionId: e
|
|
1941
1951
|
};
|
|
1942
1952
|
}
|
|
1943
|
-
function
|
|
1953
|
+
function Hi(e, t = "option_", n = 1) {
|
|
1944
1954
|
var r;
|
|
1945
1955
|
let i = /* @__PURE__ */ new Set(), a = (r = e == null ? void 0 : e.map((e, n) => {
|
|
1946
|
-
let r = e.optionId ||
|
|
1947
|
-
return i.has(r) ?
|
|
1956
|
+
let r = e.optionId || Lo(n, t);
|
|
1957
|
+
return i.has(r) ? Vi(Lo(n, t), e.content) : (i.add(r), Vi(r, e.content));
|
|
1948
1958
|
}).filter((e) => e.optionId.length > 0)) == null ? [] : r;
|
|
1949
|
-
return a.length ? a : Array.from({ length: n }, (e, r) =>
|
|
1959
|
+
return a.length ? a : Array.from({ length: n }, (e, r) => Vi(Lo(r, t), n === ci ? M(`\u9009\u9879 ${Ci("upperAlpha", r)}`) : M()));
|
|
1950
1960
|
}
|
|
1951
|
-
function
|
|
1961
|
+
function Ui(e, t) {
|
|
1952
1962
|
let n = (e == null ? [] : e).map((e) => e.trim()).filter((e) => e.length > 0);
|
|
1953
|
-
return n.length > 0 ? n :
|
|
1963
|
+
return n.length > 0 ? n : Wi(t);
|
|
1954
1964
|
}
|
|
1955
|
-
function
|
|
1965
|
+
function Wi(e) {
|
|
1956
1966
|
return e === "sentence" ? ["This helped them save time."] : [
|
|
1957
1967
|
"c",
|
|
1958
1968
|
"l",
|
|
@@ -1961,17 +1971,17 @@ function Ui(e) {
|
|
|
1961
1971
|
"n"
|
|
1962
1972
|
];
|
|
1963
1973
|
}
|
|
1964
|
-
function
|
|
1965
|
-
return e.map((e, t) => e.trim() ||
|
|
1974
|
+
function Gi(e) {
|
|
1975
|
+
return e.map((e, t) => e.trim() || Io(t)).filter((e, t, n) => e.length > 0 && n.indexOf(e) === t);
|
|
1966
1976
|
}
|
|
1967
|
-
function
|
|
1977
|
+
function Ki(e, t) {
|
|
1968
1978
|
return t.reduce((t, n) => {
|
|
1969
1979
|
var r;
|
|
1970
1980
|
return k(k({}, t), {}, { [n]: (r = e[n]) == null ? "" : r });
|
|
1971
1981
|
}, {});
|
|
1972
1982
|
}
|
|
1973
|
-
function
|
|
1974
|
-
return
|
|
1983
|
+
function qi() {
|
|
1984
|
+
return gi([{
|
|
1975
1985
|
children: [{ text: "Complete: " }, {
|
|
1976
1986
|
blankId: "blank_0",
|
|
1977
1987
|
children: [{ text: "" }],
|
|
@@ -1981,25 +1991,25 @@ function Ki() {
|
|
|
1981
1991
|
type: "paragraph"
|
|
1982
1992
|
}]);
|
|
1983
1993
|
}
|
|
1984
|
-
function
|
|
1994
|
+
function Ji(e, t) {
|
|
1985
1995
|
return {
|
|
1986
1996
|
blankId: t,
|
|
1987
|
-
options:
|
|
1997
|
+
options: Hi(e == null ? void 0 : e.options, `${t}_option_`, ci)
|
|
1988
1998
|
};
|
|
1989
1999
|
}
|
|
1990
|
-
function
|
|
2000
|
+
function Yi(e, t) {
|
|
1991
2001
|
let n = new Map((e == null ? [] : e).map((e) => [e.blankId, e]));
|
|
1992
|
-
return t.map((e) => k({},
|
|
2002
|
+
return t.map((e) => k({}, Ji(n.get(e), e)));
|
|
1993
2003
|
}
|
|
1994
|
-
function
|
|
2004
|
+
function Xi(e) {
|
|
1995
2005
|
return e && "answerOptionIds" in e ? e.answerOptionIds : [];
|
|
1996
2006
|
}
|
|
1997
|
-
function
|
|
2007
|
+
function Zi(e, t, n, r) {
|
|
1998
2008
|
let i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), o = new Set(n);
|
|
1999
2009
|
return [...e.filter((e) => "answerOptionIds" in e).map((e) => {
|
|
2000
2010
|
let n = e.blankIds.filter((e) => !t.includes(e) || i.has(e) ? !1 : (i.add(e), !0));
|
|
2001
2011
|
return {
|
|
2002
|
-
answerOptionIds:
|
|
2012
|
+
answerOptionIds: Xi(e).filter((e) => !o.has(e) || !r && a.has(e) ? !1 : (a.add(e), !0)),
|
|
2003
2013
|
blankIds: n
|
|
2004
2014
|
};
|
|
2005
2015
|
}).filter((e) => e.blankIds.length > 0), ...t.filter((e) => !i.has(e)).map((e) => ({
|
|
@@ -2007,7 +2017,7 @@ function Xi(e, t, n, r) {
|
|
|
2007
2017
|
blankIds: [e]
|
|
2008
2018
|
}))];
|
|
2009
2019
|
}
|
|
2010
|
-
function
|
|
2020
|
+
function Qi(e, t, n) {
|
|
2011
2021
|
let r = new Map(e.filter((e) => "answerOptionId" in e).map((e) => [e.blankId, e.answerOptionId]));
|
|
2012
2022
|
return t.map((e) => {
|
|
2013
2023
|
var t, i;
|
|
@@ -2018,30 +2028,30 @@ function Zi(e, t, n) {
|
|
|
2018
2028
|
};
|
|
2019
2029
|
});
|
|
2020
2030
|
}
|
|
2021
|
-
function
|
|
2022
|
-
let t =
|
|
2031
|
+
function $i(e) {
|
|
2032
|
+
let t = Ro(e.blanks), n = [...e.blanks, t];
|
|
2023
2033
|
return k(k({}, e), {}, {
|
|
2024
|
-
|
|
2034
|
+
answers: ta([...e.answers, {
|
|
2025
2035
|
answerPools: [M()],
|
|
2026
2036
|
blankIds: [t]
|
|
2027
2037
|
}], n),
|
|
2028
2038
|
blanks: n
|
|
2029
2039
|
});
|
|
2030
2040
|
}
|
|
2031
|
-
function
|
|
2041
|
+
function ea(e, t) {
|
|
2032
2042
|
if (e.blanks.length <= 1) return e;
|
|
2033
|
-
let n = e.blanks.filter((e) => e !== t), r =
|
|
2043
|
+
let n = e.blanks.filter((e) => e !== t), r = ta(e.answers.map((e) => k(k({}, e), {}, { blankIds: e.blankIds.filter((e) => e !== t) })).filter((e) => e.blankIds.length > 0), n);
|
|
2034
2044
|
return k(k({}, e), {}, {
|
|
2035
|
-
|
|
2045
|
+
answers: r,
|
|
2036
2046
|
blanks: n.length ? n : e.blanks
|
|
2037
2047
|
});
|
|
2038
2048
|
}
|
|
2039
|
-
function
|
|
2049
|
+
function ta(e, t) {
|
|
2040
2050
|
let n = /* @__PURE__ */ new Set();
|
|
2041
2051
|
return [...e.filter((e) => "answerPools" in e).map((e) => {
|
|
2042
2052
|
let r = e.blankIds.filter((e) => !t.includes(e) || n.has(e) ? !1 : (n.add(e), !0));
|
|
2043
2053
|
return {
|
|
2044
|
-
answerPools:
|
|
2054
|
+
answerPools: os("answerPools" in e ? e.answerPools : []),
|
|
2045
2055
|
blankIds: r
|
|
2046
2056
|
};
|
|
2047
2057
|
}).filter((e) => e.blankIds.length > 0), ...t.filter((e) => !n.has(e)).map((e) => ({
|
|
@@ -2049,332 +2059,332 @@ function ea(e, t) {
|
|
|
2049
2059
|
blankIds: [e]
|
|
2050
2060
|
}))];
|
|
2051
2061
|
}
|
|
2052
|
-
function
|
|
2062
|
+
function na(e) {
|
|
2053
2063
|
return e.reduce((e, t, n) => (t.blankIds.length >= 2 && e.push({
|
|
2054
2064
|
group: t,
|
|
2055
2065
|
groupIndex: n
|
|
2056
2066
|
}), e), []);
|
|
2057
2067
|
}
|
|
2058
|
-
function
|
|
2059
|
-
let r = e.
|
|
2060
|
-
return !i || i.blankIds.length < 2 || i.blankIds.includes(t) ? e : k(k({}, e), {}, {
|
|
2061
|
-
answerPools:
|
|
2068
|
+
function ra(e, t, n) {
|
|
2069
|
+
let r = e.answers.find((e) => e.blankIds.includes(t)), i = e.answers.slice(n, n + 1)[0];
|
|
2070
|
+
return !i || i.blankIds.length < 2 || i.blankIds.includes(t) ? e : k(k({}, e), {}, { answers: ta(e.answers.map((e, r) => r === n ? k(k({}, e), {}, {
|
|
2071
|
+
answerPools: os(e.answerPools),
|
|
2062
2072
|
blankIds: [...e.blankIds, t]
|
|
2063
2073
|
}) : k(k({}, e), {}, {
|
|
2064
|
-
answerPools:
|
|
2074
|
+
answerPools: os(e.answerPools),
|
|
2065
2075
|
blankIds: e.blankIds.filter((e) => e !== t)
|
|
2066
2076
|
})), e.blanks).map((e) => {
|
|
2067
2077
|
var n;
|
|
2068
|
-
return e.blankIds.includes(t) && e.blankIds.length > 1 ? k(k({}, e), {}, { answerPools: i.answerPools.length > 0 ?
|
|
2078
|
+
return e.blankIds.includes(t) && e.blankIds.length > 1 ? k(k({}, e), {}, { answerPools: i.answerPools.length > 0 ? os(i.answerPools) : os((n = r == null ? void 0 : r.answerPools) == null ? [] : n) }) : e;
|
|
2069
2079
|
}) });
|
|
2070
2080
|
}
|
|
2071
|
-
function
|
|
2081
|
+
function ia(e, t, n) {
|
|
2072
2082
|
var r;
|
|
2073
2083
|
if (t === n || !e.blanks.includes(t) || !e.blanks.includes(n)) return e;
|
|
2074
|
-
let i = e.
|
|
2075
|
-
return k(k({}, e), {}, {
|
|
2076
|
-
answerPools:
|
|
2084
|
+
let i = e.answers.find((e) => e.blankIds.includes(t));
|
|
2085
|
+
return k(k({}, e), {}, { answers: ta([...e.answers.map((e) => k(k({}, e), {}, { blankIds: e.blankIds.filter((e) => e !== t && e !== n) })), {
|
|
2086
|
+
answerPools: os((r = i == null ? void 0 : i.answerPools) == null ? [] : r),
|
|
2077
2087
|
blankIds: [t, n]
|
|
2078
2088
|
}], e.blanks) });
|
|
2079
2089
|
}
|
|
2080
|
-
function
|
|
2090
|
+
function aa(e, t) {
|
|
2081
2091
|
var n;
|
|
2082
|
-
let r = e.
|
|
2083
|
-
return k(k({}, e), {}, {
|
|
2084
|
-
answerPools:
|
|
2092
|
+
let r = e.answers.find((e) => e.blankIds.includes(t));
|
|
2093
|
+
return k(k({}, e), {}, { answers: ta([...e.answers.map((e) => k(k({}, e), {}, { blankIds: e.blankIds.filter((e) => e !== t) })), {
|
|
2094
|
+
answerPools: os((n = r == null ? void 0 : r.answerPools) == null ? [] : n),
|
|
2085
2095
|
blankIds: [t]
|
|
2086
2096
|
}], e.blanks) });
|
|
2087
2097
|
}
|
|
2088
|
-
function
|
|
2089
|
-
return k(k({}, e), {}, {
|
|
2098
|
+
function oa(e, t, n) {
|
|
2099
|
+
return k(k({}, e), {}, { answers: ta(e.answers.map((e, r) => r === t ? k(k({}, e), {}, { answerPools: os(n) }) : e), e.blanks) });
|
|
2090
2100
|
}
|
|
2091
|
-
function
|
|
2092
|
-
return
|
|
2101
|
+
function sa(e) {
|
|
2102
|
+
return ba(e);
|
|
2093
2103
|
}
|
|
2094
|
-
function
|
|
2104
|
+
function ca(e, t, n) {
|
|
2095
2105
|
return k(k({}, e), {}, { options: e.options.map((e, r) => r === t ? k(k({}, e), {}, { cells: e.cells.map((e, t) => t === 0 ? n : e) }) : e) });
|
|
2096
2106
|
}
|
|
2097
|
-
function
|
|
2107
|
+
function la(e, t) {
|
|
2098
2108
|
if (!e.options[t] || e.options.length <= 1) return e;
|
|
2099
2109
|
let n = e.options.filter((e, n) => n !== t);
|
|
2100
2110
|
return k(k({}, e), {}, {
|
|
2101
|
-
|
|
2111
|
+
answers: ge(e.answers, n, "multiple"),
|
|
2102
2112
|
options: n
|
|
2103
2113
|
});
|
|
2104
2114
|
}
|
|
2105
|
-
function
|
|
2115
|
+
function ua(e, t, n) {
|
|
2106
2116
|
return ue(e, t, n);
|
|
2107
2117
|
}
|
|
2108
|
-
function
|
|
2118
|
+
function da(e) {
|
|
2109
2119
|
let t = [...e.columns, _e(e.columns)];
|
|
2110
2120
|
return k(k({}, e), {}, {
|
|
2111
2121
|
columns: t,
|
|
2112
2122
|
options: e.options.map((e) => k(k({}, e), {}, { cells: [...e.cells, M()] }))
|
|
2113
2123
|
});
|
|
2114
2124
|
}
|
|
2115
|
-
function
|
|
2125
|
+
function fa(e, t) {
|
|
2116
2126
|
return le(e, t);
|
|
2117
2127
|
}
|
|
2118
|
-
function
|
|
2119
|
-
return
|
|
2128
|
+
function pa(e) {
|
|
2129
|
+
return ba(e);
|
|
2120
2130
|
}
|
|
2121
|
-
function
|
|
2131
|
+
function ma(e, t) {
|
|
2122
2132
|
if (!e.options[t] || e.options.length <= 1) return e;
|
|
2123
2133
|
let n = e.options.filter((e, n) => n !== t);
|
|
2124
2134
|
return k(k({}, e), {}, {
|
|
2125
|
-
|
|
2135
|
+
answers: ge(e.answers, n, "multiple"),
|
|
2126
2136
|
options: n
|
|
2127
2137
|
});
|
|
2128
2138
|
}
|
|
2129
|
-
function
|
|
2139
|
+
function ha(e, t, n, r) {
|
|
2130
2140
|
return k(k({}, e), {}, { options: e.options.map((e, i) => i === t ? k(k({}, e), {}, { cells: e.cells.map((e, t) => t === n ? r : e) }) : e) });
|
|
2131
2141
|
}
|
|
2132
|
-
function
|
|
2142
|
+
function ga(e, t, n) {
|
|
2133
2143
|
return k(k({}, e), {}, { columns: e.columns.map((e, r) => r === t ? k(k({}, e), {}, { content: n }) : e) });
|
|
2134
2144
|
}
|
|
2135
|
-
function
|
|
2136
|
-
|
|
2145
|
+
function _a(e, t, n) {
|
|
2146
|
+
ya(e);
|
|
2137
2147
|
let r = fe(e.columns, t.config.renderer), i = he(e.options, r);
|
|
2138
2148
|
return k(k({}, e), {}, {
|
|
2139
|
-
|
|
2149
|
+
answers: n ? ge(e.answers, i, t.config.selectionType) : { optionIds: [] },
|
|
2140
2150
|
columns: r,
|
|
2141
2151
|
options: i
|
|
2142
2152
|
});
|
|
2143
2153
|
}
|
|
2144
|
-
function
|
|
2154
|
+
function va(e, t, n) {
|
|
2145
2155
|
var r;
|
|
2146
2156
|
return {
|
|
2147
2157
|
cells: e.cells,
|
|
2148
|
-
marker:
|
|
2158
|
+
marker: Ci(n, t),
|
|
2149
2159
|
option: e,
|
|
2150
2160
|
optionId: e.id,
|
|
2151
2161
|
optionIndex: t,
|
|
2152
2162
|
standardContent: (r = e.cells[0]) == null ? M() : r
|
|
2153
2163
|
};
|
|
2154
2164
|
}
|
|
2155
|
-
function
|
|
2156
|
-
let t = e, n = t.
|
|
2165
|
+
function ya(e) {
|
|
2166
|
+
let t = e, n = t.answers;
|
|
2157
2167
|
if (!n || !Array.isArray(n.optionIds) || !Array.isArray(t.columns) || !Array.isArray(t.options)) throw Error("Invalid choice content shape. Expected columns, options, and answer.optionIds.");
|
|
2158
2168
|
}
|
|
2159
|
-
function
|
|
2169
|
+
function ba(e) {
|
|
2160
2170
|
return k(k({}, e), {}, { options: [...e.options, me(e.options, e.columns)] });
|
|
2161
2171
|
}
|
|
2162
|
-
function
|
|
2163
|
-
let r =
|
|
2172
|
+
function xa(e, t, n) {
|
|
2173
|
+
let r = lo(e.columns, t);
|
|
2164
2174
|
return k(k({}, e), {}, {
|
|
2165
|
-
|
|
2175
|
+
answers: n ? _o(e.answers, r) : {},
|
|
2166
2176
|
columns: r
|
|
2167
2177
|
});
|
|
2168
2178
|
}
|
|
2169
|
-
function
|
|
2179
|
+
function Sa(e) {
|
|
2170
2180
|
if (e.columns.length >= Re.max) return e;
|
|
2171
2181
|
let t = e.columns.length;
|
|
2172
|
-
return k(k({}, e), {}, { columns: [...e.columns,
|
|
2182
|
+
return k(k({}, e), {}, { columns: [...e.columns, ho(t, po(t))] });
|
|
2173
2183
|
}
|
|
2174
|
-
function
|
|
2184
|
+
function Ca(e, t) {
|
|
2175
2185
|
if (e.columns.length <= Re.min) return e;
|
|
2176
2186
|
let n = e.columns.filter((e) => e.columnId !== t);
|
|
2177
2187
|
return k(k({}, e), {}, {
|
|
2178
|
-
|
|
2188
|
+
answers: _o(e.answers, n),
|
|
2179
2189
|
columns: n
|
|
2180
2190
|
});
|
|
2181
2191
|
}
|
|
2182
|
-
function
|
|
2183
|
-
return
|
|
2192
|
+
function wa(e, t, n) {
|
|
2193
|
+
return Fa(e, t, n);
|
|
2184
2194
|
}
|
|
2185
|
-
function
|
|
2195
|
+
function Ta(e, t) {
|
|
2186
2196
|
return k(k({}, e), {}, { columns: e.columns.map((n, r) => n.columnId === t ? k(k({}, n), {}, { items: [...n.items, {
|
|
2187
2197
|
content: M(),
|
|
2188
|
-
itemId:
|
|
2198
|
+
itemId: Ao(No(r, n.items.length), new Set(jo(e.columns)))
|
|
2189
2199
|
}] }) : n) });
|
|
2190
2200
|
}
|
|
2191
|
-
function
|
|
2201
|
+
function Ea(e, t) {
|
|
2192
2202
|
let n = e.columns.map((e) => e.items.length <= 1 ? e : k(k({}, e), {}, { items: e.items.filter((e) => e.itemId !== t) }));
|
|
2193
2203
|
return k(k({}, e), {}, {
|
|
2194
|
-
|
|
2204
|
+
answers: _o(e.answers, n),
|
|
2195
2205
|
columns: n
|
|
2196
2206
|
});
|
|
2197
2207
|
}
|
|
2198
|
-
function Ea(e, t, n) {
|
|
2199
|
-
return Fa(e, t, n);
|
|
2200
|
-
}
|
|
2201
2208
|
function Da(e, t, n) {
|
|
2202
|
-
return
|
|
2209
|
+
return Ia(e, t, n);
|
|
2203
2210
|
}
|
|
2204
2211
|
function Oa(e, t, n) {
|
|
2205
|
-
|
|
2212
|
+
return Xe(e, t, n);
|
|
2213
|
+
}
|
|
2214
|
+
function ka(e, t, n) {
|
|
2215
|
+
let r = vo(e.columns, t);
|
|
2206
2216
|
return k(k({}, e), {}, {
|
|
2207
|
-
|
|
2217
|
+
answers: n ? xo(e.answers, r) : {},
|
|
2208
2218
|
columns: r
|
|
2209
2219
|
});
|
|
2210
2220
|
}
|
|
2211
|
-
function
|
|
2212
|
-
return
|
|
2221
|
+
function Aa(e, t, n) {
|
|
2222
|
+
return Fa(e, t, n);
|
|
2213
2223
|
}
|
|
2214
|
-
function
|
|
2224
|
+
function ja(e, t) {
|
|
2215
2225
|
return k(k({}, e), {}, { columns: e.columns.map((n, r) => n.columnId === t ? k(k({}, n), {}, { items: [...n.items, {
|
|
2216
2226
|
content: M(),
|
|
2217
|
-
itemId:
|
|
2227
|
+
itemId: Ao(Fo(r, n.items.length), new Set(jo(e.columns)))
|
|
2218
2228
|
}] }) : n) });
|
|
2219
2229
|
}
|
|
2220
|
-
function
|
|
2230
|
+
function Ma(e, t) {
|
|
2221
2231
|
let n = e.columns.map((e) => e.items.length <= 1 ? e : k(k({}, e), {}, { items: e.items.filter((e) => e.itemId !== t) }));
|
|
2222
2232
|
return k(k({}, e), {}, {
|
|
2223
|
-
|
|
2233
|
+
answers: xo(e.answers, n),
|
|
2224
2234
|
columns: n
|
|
2225
2235
|
});
|
|
2226
2236
|
}
|
|
2227
|
-
function Ma(e, t, n) {
|
|
2228
|
-
return Fa(e, t, n);
|
|
2229
|
-
}
|
|
2230
2237
|
function Na(e, t, n) {
|
|
2231
|
-
return
|
|
2238
|
+
return Ia(e, t, n);
|
|
2232
2239
|
}
|
|
2233
2240
|
function Pa(e, t, n) {
|
|
2234
|
-
return
|
|
2241
|
+
return bt(e, t, n);
|
|
2235
2242
|
}
|
|
2236
2243
|
function Fa(e, t, n) {
|
|
2244
|
+
return k(k({}, e), {}, { columns: e.columns.map((e) => e.columnId === t ? k(k({}, e), {}, { labelStyle: n }) : e) });
|
|
2245
|
+
}
|
|
2246
|
+
function Ia(e, t, n) {
|
|
2237
2247
|
return k(k({}, e), {}, { columns: e.columns.map((e) => k(k({}, e), {}, { items: e.items.map((e) => e.itemId === t ? k(k({}, e), {}, { content: n }) : e) })) });
|
|
2238
2248
|
}
|
|
2239
|
-
function
|
|
2240
|
-
let n =
|
|
2249
|
+
function La(e, t) {
|
|
2250
|
+
let n = no(e.categories), r = ro(e.items);
|
|
2241
2251
|
return k(k({}, e), {}, {
|
|
2242
|
-
|
|
2252
|
+
answers: t ? Oe(e.answers, n, r) : {},
|
|
2243
2253
|
categories: n,
|
|
2244
2254
|
items: r
|
|
2245
2255
|
});
|
|
2246
2256
|
}
|
|
2247
|
-
function
|
|
2248
|
-
return k(k({}, e), {}, { categories: [...e.categories,
|
|
2257
|
+
function Ra(e) {
|
|
2258
|
+
return k(k({}, e), {}, { categories: [...e.categories, io(e.categories.length, new Set(e.categories.map((e) => e.id)))] });
|
|
2249
2259
|
}
|
|
2250
|
-
function
|
|
2260
|
+
function za(e, t) {
|
|
2251
2261
|
if (e.categories.length <= 1) return e;
|
|
2252
2262
|
let n = e.categories.filter((e) => e.id !== t);
|
|
2253
2263
|
return k(k({}, e), {}, {
|
|
2254
|
-
|
|
2264
|
+
answers: Oe(e.answers, n, e.items),
|
|
2255
2265
|
categories: n
|
|
2256
2266
|
});
|
|
2257
2267
|
}
|
|
2258
|
-
function
|
|
2268
|
+
function Ba(e, t, n) {
|
|
2259
2269
|
return k(k({}, e), {}, { categories: e.categories.map((e) => e.id === t ? k(k({}, e), {}, { content: n }) : e) });
|
|
2260
2270
|
}
|
|
2261
|
-
function
|
|
2262
|
-
return k(k({}, e), {}, { items: [...e.items,
|
|
2271
|
+
function Va(e) {
|
|
2272
|
+
return k(k({}, e), {}, { items: [...e.items, ao(e.items.length, new Set(e.items.map((e) => e.id)))] });
|
|
2263
2273
|
}
|
|
2264
|
-
function
|
|
2274
|
+
function Ha(e, t) {
|
|
2265
2275
|
if (e.items.length <= 1) return e;
|
|
2266
2276
|
let n = e.items.filter((e) => e.id !== t);
|
|
2267
2277
|
return k(k({}, e), {}, {
|
|
2268
|
-
|
|
2278
|
+
answers: Oe(e.answers, e.categories, n),
|
|
2269
2279
|
items: n
|
|
2270
2280
|
});
|
|
2271
2281
|
}
|
|
2272
|
-
function
|
|
2282
|
+
function Ua(e, t, n) {
|
|
2273
2283
|
return k(k({}, e), {}, { items: e.items.map((e) => e.id === t ? k(k({}, e), {}, { content: n }) : e) });
|
|
2274
2284
|
}
|
|
2275
|
-
function
|
|
2285
|
+
function Wa(e, t, n) {
|
|
2276
2286
|
return ke(e, t, n);
|
|
2277
2287
|
}
|
|
2278
|
-
function
|
|
2279
|
-
let n =
|
|
2288
|
+
function Ga(e, t) {
|
|
2289
|
+
let n = Co(e.sortOptions);
|
|
2280
2290
|
return k(k({}, e), {}, {
|
|
2281
|
-
|
|
2291
|
+
answers: t ? wo(e.answers, n) : [],
|
|
2282
2292
|
sortOptions: n
|
|
2283
2293
|
});
|
|
2284
2294
|
}
|
|
2285
|
-
function
|
|
2286
|
-
let n = new Set(e.sortOptions.map((e) => e.id)), r =
|
|
2287
|
-
return
|
|
2288
|
-
|
|
2295
|
+
function Ka(e, t) {
|
|
2296
|
+
let n = new Set(e.sortOptions.map((e) => e.id)), r = To(Oo(Do(e.sortOptions.length), n));
|
|
2297
|
+
return Ga(k(k({}, e), {}, {
|
|
2298
|
+
answers: [...e.answers, r.id],
|
|
2289
2299
|
sortOptions: [...e.sortOptions, r]
|
|
2290
2300
|
}), t);
|
|
2291
2301
|
}
|
|
2292
|
-
function
|
|
2293
|
-
return e.sortOptions.length <= 1 ? e :
|
|
2294
|
-
|
|
2302
|
+
function qa(e, t, n) {
|
|
2303
|
+
return e.sortOptions.length <= 1 ? e : Ga(k(k({}, e), {}, {
|
|
2304
|
+
answers: e.answers.filter((e) => e !== t),
|
|
2295
2305
|
sortOptions: e.sortOptions.filter((e) => e.id !== t)
|
|
2296
2306
|
}), n);
|
|
2297
2307
|
}
|
|
2298
|
-
function qa(e, t, n, r) {
|
|
2299
|
-
return Wa(k(k({}, e), {}, { sortOptions: e.sortOptions.map((e) => e.id === t ? k(k({}, e), {}, { content: n }) : e) }), r);
|
|
2300
|
-
}
|
|
2301
2308
|
function Ja(e, t, n, r) {
|
|
2302
|
-
|
|
2309
|
+
return Ga(k(k({}, e), {}, { sortOptions: e.sortOptions.map((e) => e.id === t ? k(k({}, e), {}, { content: n }) : e) }), r);
|
|
2310
|
+
}
|
|
2311
|
+
function Ya(e, t, n, r) {
|
|
2312
|
+
let i = wo(e.answers, e.sortOptions), a = i.indexOf(t), o = a + n;
|
|
2303
2313
|
if (a < 0 || o < 0 || o >= i.length) return e;
|
|
2304
2314
|
let s = [...i], [c] = s.splice(a, 1);
|
|
2305
|
-
return s.splice(o, 0, c),
|
|
2315
|
+
return s.splice(o, 0, c), Ga(k(k({}, e), {}, { answers: s }), r);
|
|
2306
2316
|
}
|
|
2307
|
-
function
|
|
2308
|
-
let i =
|
|
2317
|
+
function Xa(e, t, n, r) {
|
|
2318
|
+
let i = wo(e, t), a = i.indexOf(n), o = a + r;
|
|
2309
2319
|
if (a < 0 || o < 0 || o >= i.length) return i;
|
|
2310
2320
|
let s = [...i], [c] = s.splice(a, 1);
|
|
2311
2321
|
return s.splice(o, 0, c), s;
|
|
2312
2322
|
}
|
|
2313
|
-
function
|
|
2323
|
+
function Za(e, t) {
|
|
2314
2324
|
return e.type === "richText" ? {
|
|
2315
2325
|
content: M(),
|
|
2316
2326
|
elementKey: e.elementKey,
|
|
2317
2327
|
type: "richText"
|
|
2318
2328
|
} : e.type === "textMarker" ? {
|
|
2319
|
-
|
|
2320
|
-
content:
|
|
2329
|
+
answers: [],
|
|
2330
|
+
content: _i(),
|
|
2321
2331
|
elementKey: e.elementKey,
|
|
2322
2332
|
markers: [],
|
|
2323
2333
|
type: "textMarker"
|
|
2324
|
-
} : e.type === "ordering" ?
|
|
2325
|
-
|
|
2334
|
+
} : e.type === "ordering" ? Ga({
|
|
2335
|
+
answers: [],
|
|
2326
2336
|
elementKey: e.elementKey,
|
|
2327
2337
|
sortOptions: [],
|
|
2328
2338
|
type: "ordering"
|
|
2329
|
-
}, t) : e.type === "classification" ?
|
|
2330
|
-
|
|
2339
|
+
}, t) : e.type === "classification" ? La({
|
|
2340
|
+
answers: {},
|
|
2331
2341
|
categories: [],
|
|
2332
2342
|
elementKey: e.elementKey,
|
|
2333
2343
|
items: [],
|
|
2334
2344
|
type: "classification"
|
|
2335
|
-
}, t) : e.type === "fill" ?
|
|
2345
|
+
}, t) : e.type === "fill" ? $a(e.elementKey, t) : Qa(e, t);
|
|
2336
2346
|
}
|
|
2337
|
-
function
|
|
2347
|
+
function Qa(e, t) {
|
|
2338
2348
|
switch (e.type) {
|
|
2339
|
-
case "inlineFill": return
|
|
2340
|
-
|
|
2349
|
+
case "inlineFill": return Bi({
|
|
2350
|
+
answers: [],
|
|
2341
2351
|
blanks: [],
|
|
2342
2352
|
content: M(),
|
|
2343
2353
|
elementKey: e.elementKey,
|
|
2344
2354
|
type: "inlineFill"
|
|
2345
2355
|
}, e, t);
|
|
2346
|
-
case "wordBuilder": return
|
|
2347
|
-
|
|
2356
|
+
case "wordBuilder": return zi({
|
|
2357
|
+
answers: {},
|
|
2348
2358
|
blanks: ["blank_0"],
|
|
2349
|
-
candidateOptions:
|
|
2350
|
-
content:
|
|
2359
|
+
candidateOptions: Wi(e.config.builderMode),
|
|
2360
|
+
content: qi(),
|
|
2351
2361
|
elementKey: e.elementKey,
|
|
2352
2362
|
type: "wordBuilder"
|
|
2353
2363
|
}, t, e);
|
|
2354
|
-
case "choice": return
|
|
2364
|
+
case "choice": return to(e);
|
|
2355
2365
|
case "judgement": return {
|
|
2356
|
-
|
|
2366
|
+
answers: [],
|
|
2357
2367
|
elementKey: e.elementKey,
|
|
2358
2368
|
type: "judgement"
|
|
2359
2369
|
};
|
|
2360
|
-
case "lineConnect": return
|
|
2361
|
-
|
|
2370
|
+
case "lineConnect": return xa({
|
|
2371
|
+
answers: {},
|
|
2362
2372
|
columns: [],
|
|
2363
2373
|
elementKey: e.elementKey,
|
|
2364
2374
|
type: "lineConnect"
|
|
2365
2375
|
}, e, t);
|
|
2366
|
-
case "matching": return
|
|
2367
|
-
|
|
2376
|
+
case "matching": return ka({
|
|
2377
|
+
answers: {},
|
|
2368
2378
|
columns: [],
|
|
2369
2379
|
elementKey: e.elementKey,
|
|
2370
2380
|
type: "matching"
|
|
2371
2381
|
}, e, t);
|
|
2372
2382
|
}
|
|
2373
2383
|
}
|
|
2374
|
-
function
|
|
2375
|
-
let n = Array.from({ length:
|
|
2384
|
+
function $a(e, t) {
|
|
2385
|
+
let n = Array.from({ length: si }, (e, t) => Io(t));
|
|
2376
2386
|
return {
|
|
2377
|
-
|
|
2387
|
+
answers: t ? [{
|
|
2378
2388
|
answerPools: [M()],
|
|
2379
2389
|
blankIds: n
|
|
2380
2390
|
}] : [],
|
|
@@ -2383,197 +2393,197 @@ function Qa(e, t) {
|
|
|
2383
2393
|
type: "fill"
|
|
2384
2394
|
};
|
|
2385
2395
|
}
|
|
2386
|
-
function
|
|
2396
|
+
function eo(e) {
|
|
2387
2397
|
return {
|
|
2388
2398
|
content: M(),
|
|
2389
2399
|
extraKey: e.extraKey,
|
|
2390
2400
|
type: e.type
|
|
2391
2401
|
};
|
|
2392
2402
|
}
|
|
2393
|
-
function
|
|
2403
|
+
function to(e) {
|
|
2394
2404
|
let t = de(e.config.renderer), n = pe(t);
|
|
2395
2405
|
return {
|
|
2396
|
-
|
|
2406
|
+
answers: { optionIds: [] },
|
|
2397
2407
|
columns: t,
|
|
2398
2408
|
elementKey: e.elementKey,
|
|
2399
2409
|
options: n,
|
|
2400
2410
|
type: "choice"
|
|
2401
2411
|
};
|
|
2402
2412
|
}
|
|
2403
|
-
function
|
|
2413
|
+
function no(e) {
|
|
2404
2414
|
let t = /* @__PURE__ */ new Set(), n = e.map((e, n) => ({
|
|
2405
2415
|
content: e.content,
|
|
2406
|
-
id:
|
|
2416
|
+
id: oo(e.id, so(n), t)
|
|
2407
2417
|
}));
|
|
2408
|
-
return n.length > 0 ? n : Array.from({ length:
|
|
2418
|
+
return n.length > 0 ? n : Array.from({ length: ui }, (e, n) => io(n, t));
|
|
2409
2419
|
}
|
|
2410
|
-
function
|
|
2420
|
+
function ro(e) {
|
|
2411
2421
|
let t = /* @__PURE__ */ new Set(), n = e.map((e, n) => ({
|
|
2412
2422
|
content: e.content,
|
|
2413
|
-
id:
|
|
2423
|
+
id: oo(e.id, co(n), t)
|
|
2414
2424
|
}));
|
|
2415
|
-
return n.length > 0 ? n : Array.from({ length:
|
|
2425
|
+
return n.length > 0 ? n : Array.from({ length: di }, (e, n) => ao(n, t));
|
|
2416
2426
|
}
|
|
2417
|
-
function
|
|
2427
|
+
function io(e, t) {
|
|
2418
2428
|
return {
|
|
2419
2429
|
content: M(`\u5206\u7c7b ${e + 1}`),
|
|
2420
|
-
id:
|
|
2430
|
+
id: oo("", so(e), t)
|
|
2421
2431
|
};
|
|
2422
2432
|
}
|
|
2423
|
-
function
|
|
2433
|
+
function ao(e, t) {
|
|
2424
2434
|
return {
|
|
2425
2435
|
content: M(`\u5361\u7247 ${e + 1}`),
|
|
2426
|
-
id:
|
|
2436
|
+
id: oo("", co(e), t)
|
|
2427
2437
|
};
|
|
2428
2438
|
}
|
|
2429
|
-
function
|
|
2439
|
+
function oo(e, t, n) {
|
|
2430
2440
|
let r = e || t, i = r, a = 2;
|
|
2431
2441
|
for (; n.has(i);) i = `${r}_${a}`, a += 1;
|
|
2432
2442
|
return n.add(i), i;
|
|
2433
2443
|
}
|
|
2434
|
-
function
|
|
2444
|
+
function so(e) {
|
|
2435
2445
|
return `category_${e + 1}`;
|
|
2436
2446
|
}
|
|
2437
|
-
function
|
|
2447
|
+
function co(e) {
|
|
2438
2448
|
return `item_${e + 1}`;
|
|
2439
2449
|
}
|
|
2440
|
-
function
|
|
2441
|
-
let n = e.length > 0 ? e :
|
|
2450
|
+
function lo(e, t) {
|
|
2451
|
+
let n = e.length > 0 ? e : uo(t), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = fo(t);
|
|
2442
2452
|
return n.slice(0, Re.max).map((e, t) => {
|
|
2443
2453
|
var n, o;
|
|
2444
2454
|
return {
|
|
2445
|
-
columnId:
|
|
2446
|
-
items:
|
|
2455
|
+
columnId: Ao(e.columnId, r),
|
|
2456
|
+
items: mo(e.items, t, i),
|
|
2447
2457
|
labelStyle: st(e.labelStyle, (n = (o = a[t]) == null ? void 0 : o.labelStyle) == null ? "number" : n)
|
|
2448
2458
|
};
|
|
2449
2459
|
});
|
|
2450
2460
|
}
|
|
2451
|
-
function lo(e) {
|
|
2452
|
-
return uo(e).map((e, t) => mo(t, e.labelStyle));
|
|
2453
|
-
}
|
|
2454
2461
|
function uo(e) {
|
|
2455
|
-
return
|
|
2462
|
+
return fo(e).map((e, t) => ho(t, e.labelStyle));
|
|
2456
2463
|
}
|
|
2457
2464
|
function fo(e) {
|
|
2465
|
+
return Ze(e.config.columns);
|
|
2466
|
+
}
|
|
2467
|
+
function po(e) {
|
|
2458
2468
|
var t, n;
|
|
2459
2469
|
return (t = (n = Ze([])[e]) == null ? void 0 : n.labelStyle) == null ? "number" : t;
|
|
2460
2470
|
}
|
|
2461
|
-
function
|
|
2471
|
+
function mo(e, t, n) {
|
|
2462
2472
|
let r = e.map((e, r) => ({
|
|
2463
2473
|
content: e.content,
|
|
2464
|
-
itemId:
|
|
2474
|
+
itemId: Ao(e.itemId || No(t, r), n)
|
|
2465
2475
|
}));
|
|
2466
|
-
return r.length > 0 ? r :
|
|
2476
|
+
return r.length > 0 ? r : go(t, n);
|
|
2467
2477
|
}
|
|
2468
|
-
function
|
|
2478
|
+
function ho(e, t) {
|
|
2469
2479
|
let n = /* @__PURE__ */ new Set();
|
|
2470
2480
|
return {
|
|
2471
|
-
columnId:
|
|
2472
|
-
items:
|
|
2481
|
+
columnId: Mo(e),
|
|
2482
|
+
items: go(e, n),
|
|
2473
2483
|
labelStyle: t
|
|
2474
2484
|
};
|
|
2475
2485
|
}
|
|
2476
|
-
function
|
|
2477
|
-
return Array.from({ length:
|
|
2486
|
+
function go(e, t) {
|
|
2487
|
+
return Array.from({ length: fi }, (n, r) => ({
|
|
2478
2488
|
content: M(`\u8fde\u7ebf\u9879 ${r + 1}`),
|
|
2479
|
-
itemId:
|
|
2489
|
+
itemId: Ao(No(e, r), t)
|
|
2480
2490
|
}));
|
|
2481
2491
|
}
|
|
2482
|
-
function go(e, t) {
|
|
2483
|
-
return Ye(e, Oo(t));
|
|
2484
|
-
}
|
|
2485
2492
|
function _o(e, t) {
|
|
2486
|
-
|
|
2493
|
+
return Ye(e, ko(t));
|
|
2494
|
+
}
|
|
2495
|
+
function vo(e, t) {
|
|
2496
|
+
let n = e.length > 0 ? e : yo(t), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = xt(t.config.columns);
|
|
2487
2497
|
return n.slice(0, dt.max).map((e, t) => {
|
|
2488
2498
|
var n, o;
|
|
2489
2499
|
return {
|
|
2490
|
-
columnId:
|
|
2491
|
-
items:
|
|
2500
|
+
columnId: Ao(e.columnId || Po(t), r),
|
|
2501
|
+
items: mo(e.items, t, i),
|
|
2492
2502
|
labelStyle: st(e.labelStyle, (n = (o = a[t]) == null ? void 0 : o.labelStyle) == null ? "number" : n)
|
|
2493
2503
|
};
|
|
2494
2504
|
});
|
|
2495
2505
|
}
|
|
2496
|
-
function
|
|
2497
|
-
return xt(e.config.columns).map((e, t) =>
|
|
2506
|
+
function yo(e) {
|
|
2507
|
+
return xt(e.config.columns).map((e, t) => bo(t, e.labelStyle));
|
|
2498
2508
|
}
|
|
2499
|
-
function
|
|
2509
|
+
function bo(e, t) {
|
|
2500
2510
|
let n = /* @__PURE__ */ new Set();
|
|
2501
2511
|
return {
|
|
2502
|
-
columnId:
|
|
2503
|
-
items: Array.from({ length:
|
|
2512
|
+
columnId: Po(e),
|
|
2513
|
+
items: Array.from({ length: fi }, (t, r) => ({
|
|
2504
2514
|
content: M(`\u5339\u914d\u9879 ${r + 1}`),
|
|
2505
|
-
itemId:
|
|
2515
|
+
itemId: Ao(Fo(e, r), n)
|
|
2506
2516
|
})),
|
|
2507
2517
|
labelStyle: t
|
|
2508
2518
|
};
|
|
2509
2519
|
}
|
|
2510
|
-
function bo(e, t) {
|
|
2511
|
-
return yt(e, Oo(t));
|
|
2512
|
-
}
|
|
2513
2520
|
function xo(e, t) {
|
|
2521
|
+
return yt(e, ko(t));
|
|
2522
|
+
}
|
|
2523
|
+
function So(e, t) {
|
|
2514
2524
|
let n = new Set(t);
|
|
2515
2525
|
return e.filter((e, t, r) => n.has(e) && r.indexOf(e) === t);
|
|
2516
2526
|
}
|
|
2517
|
-
function
|
|
2518
|
-
let t = /* @__PURE__ */ new Set(), n = (e == null ? [] : e).map((e, n) =>
|
|
2519
|
-
return n.length > 0 ? n :
|
|
2527
|
+
function Co(e) {
|
|
2528
|
+
let t = /* @__PURE__ */ new Set(), n = (e == null ? [] : e).map((e, n) => To(Oo(e.id || Do(n), t), e.content)).filter((e) => e.id.length > 0);
|
|
2529
|
+
return n.length > 0 ? n : Eo();
|
|
2520
2530
|
}
|
|
2521
|
-
function
|
|
2531
|
+
function wo(e, t) {
|
|
2522
2532
|
let n = t.map((e) => e.id), r = new Set(n), i = e.filter((e, t, n) => r.has(e) && n.indexOf(e) === t);
|
|
2523
2533
|
return [...i, ...n.filter((e) => !i.includes(e))];
|
|
2524
2534
|
}
|
|
2525
|
-
function
|
|
2535
|
+
function To(e, t = M()) {
|
|
2526
2536
|
return {
|
|
2527
2537
|
content: t,
|
|
2528
2538
|
id: e
|
|
2529
2539
|
};
|
|
2530
2540
|
}
|
|
2531
|
-
function
|
|
2541
|
+
function Eo() {
|
|
2532
2542
|
return [
|
|
2533
2543
|
"\u6b65\u9aa4\u4e00",
|
|
2534
2544
|
"\u6b65\u9aa4\u4e8c",
|
|
2535
2545
|
"\u6b65\u9aa4\u4e09"
|
|
2536
|
-
].map((e, t) =>
|
|
2546
|
+
].map((e, t) => To(Do(t), M(e)));
|
|
2537
2547
|
}
|
|
2538
|
-
function
|
|
2548
|
+
function Do(e) {
|
|
2539
2549
|
return `option_${e + 1}`;
|
|
2540
2550
|
}
|
|
2541
|
-
function
|
|
2551
|
+
function Oo(e, t) {
|
|
2542
2552
|
let n = e, r = 2;
|
|
2543
2553
|
for (; t.has(n);) n = `${e}_${r}`, r += 1;
|
|
2544
2554
|
return t.add(n), n;
|
|
2545
2555
|
}
|
|
2546
|
-
function
|
|
2556
|
+
function ko(e) {
|
|
2547
2557
|
return e.reduce((e, t, n) => (t.items.forEach((t) => e.set(t.itemId, n)), e), /* @__PURE__ */ new Map());
|
|
2548
2558
|
}
|
|
2549
|
-
function
|
|
2559
|
+
function Ao(e, t) {
|
|
2550
2560
|
let n = e || "line_connect_item", r = n, i = 2;
|
|
2551
2561
|
for (; t.has(r);) r = `${n}_${i}`, i += 1;
|
|
2552
2562
|
return t.add(r), r;
|
|
2553
2563
|
}
|
|
2554
|
-
function
|
|
2564
|
+
function jo(e) {
|
|
2555
2565
|
return e.reduce((e, t) => [...e, ...t.items.map((e) => e.itemId)], []);
|
|
2556
2566
|
}
|
|
2557
|
-
function
|
|
2567
|
+
function Mo(e) {
|
|
2558
2568
|
return `column_${e + 1}`;
|
|
2559
2569
|
}
|
|
2560
|
-
function
|
|
2570
|
+
function No(e, t) {
|
|
2561
2571
|
return `column_${e + 1}_item_${t + 1}`;
|
|
2562
2572
|
}
|
|
2563
|
-
function
|
|
2573
|
+
function Po(e) {
|
|
2564
2574
|
return e === 0 ? "left" : "right";
|
|
2565
2575
|
}
|
|
2566
|
-
function
|
|
2567
|
-
return `${
|
|
2576
|
+
function Fo(e, t) {
|
|
2577
|
+
return `${Po(e)}_${t + 1}`;
|
|
2568
2578
|
}
|
|
2569
|
-
function
|
|
2579
|
+
function Io(e) {
|
|
2570
2580
|
return `blank_${e}`;
|
|
2571
2581
|
}
|
|
2572
|
-
function
|
|
2582
|
+
function Lo(e, t) {
|
|
2573
2583
|
return `${t}${e + 1}`;
|
|
2574
2584
|
}
|
|
2575
|
-
function
|
|
2576
|
-
return
|
|
2585
|
+
function Ro(e) {
|
|
2586
|
+
return Io(e.reduce((e, t) => {
|
|
2577
2587
|
let n = (/* @__PURE__ */ RegExp("^blank_(\\d+)$", "u")).exec(t), r = n != null && n[1] ? Number(n[1]) : -1;
|
|
2578
2588
|
return Math.max(e, r);
|
|
2579
2589
|
}, -1) + 1);
|
|
@@ -2581,185 +2591,193 @@ function Lo(e) {
|
|
|
2581
2591
|
function N(e) {
|
|
2582
2592
|
return e.text.trim() === "";
|
|
2583
2593
|
}
|
|
2584
|
-
function
|
|
2594
|
+
function zo(e) {
|
|
2585
2595
|
return [{
|
|
2586
2596
|
children: [{ text: e }],
|
|
2587
2597
|
type: "paragraph"
|
|
2588
2598
|
}];
|
|
2589
2599
|
}
|
|
2590
|
-
function zo(e) {
|
|
2591
|
-
return e.map((e) => Bo(e)).filter((e) => e.length > 0).join("\n");
|
|
2592
|
-
}
|
|
2593
2600
|
function Bo(e) {
|
|
2594
|
-
return
|
|
2601
|
+
return e.map((e) => Vo(e)).filter((e) => e.length > 0).join("\n");
|
|
2602
|
+
}
|
|
2603
|
+
function Vo(e) {
|
|
2604
|
+
return Go(e) ? e.text : Wo(e) ? e.type === "blank" ? `[${Uo(e, "label") || Uo(e, "blankId") || "Blank"}]` : e.children.map((e) => Vo(e)).join("") : "";
|
|
2595
2605
|
}
|
|
2596
|
-
function
|
|
2606
|
+
function Ho(e, t) {
|
|
2597
2607
|
e.forEach((e) => {
|
|
2598
|
-
t(e),
|
|
2608
|
+
t(e), Wo(e) && Ho(e.children, t);
|
|
2599
2609
|
});
|
|
2600
2610
|
}
|
|
2601
|
-
function
|
|
2611
|
+
function Uo(e, t) {
|
|
2602
2612
|
let n = t === "blankId" ? e.blankId : e.label;
|
|
2603
2613
|
return typeof n == "string" ? n : "";
|
|
2604
2614
|
}
|
|
2605
|
-
function
|
|
2615
|
+
function Wo(e) {
|
|
2606
2616
|
return typeof e == "object" && !!e && "type" in e && typeof e.type == "string" && "children" in e && Array.isArray(e.children);
|
|
2607
2617
|
}
|
|
2608
|
-
function
|
|
2618
|
+
function Go(e) {
|
|
2609
2619
|
return typeof e == "object" && !!e && "text" in e && typeof e.text == "string";
|
|
2610
2620
|
}
|
|
2611
|
-
function
|
|
2621
|
+
function Ko(e) {
|
|
2612
2622
|
return Array.isArray(e) && e.length > 0;
|
|
2613
2623
|
}
|
|
2614
|
-
function
|
|
2615
|
-
return
|
|
2616
|
-
}
|
|
2617
|
-
function qo(e) {
|
|
2618
|
-
return e.type === "richText" ? N(e.content) : e.type === "textMarker" ? N(e.content) && e.markers.length === 0 : e.type === "classification" ? es(e) : e.type === "fill" ? e.answer.every(Zo) : Jo(e);
|
|
2624
|
+
function qo(e, t = [ni]) {
|
|
2625
|
+
return Ko(e) ? n(e, { plugins: t }) : zo("");
|
|
2619
2626
|
}
|
|
2620
2627
|
function Jo(e) {
|
|
2621
|
-
|
|
2622
|
-
case "inlineFill": return Yo(e);
|
|
2623
|
-
case "wordBuilder": return Xo(e);
|
|
2624
|
-
case "choice": return $o(e);
|
|
2625
|
-
case "judgement": return e.answer.length === 0;
|
|
2626
|
-
case "lineConnect": return ts(e);
|
|
2627
|
-
case "matching": return rs(e);
|
|
2628
|
-
case "ordering": return is(e);
|
|
2629
|
-
}
|
|
2628
|
+
return e.type === "richText" ? N(e.content) : e.type === "textMarker" ? N(e.content) && e.markers.length === 0 : e.type === "classification" ? ts(e) : e.type === "fill" ? e.answers.every(Qo) : Yo(e);
|
|
2630
2629
|
}
|
|
2631
2630
|
function Yo(e) {
|
|
2632
|
-
|
|
2633
|
-
|
|
2631
|
+
switch (e.type) {
|
|
2632
|
+
case "inlineFill": return Xo(e);
|
|
2633
|
+
case "wordBuilder": return Zo(e);
|
|
2634
|
+
case "choice": return es(e);
|
|
2635
|
+
case "judgement": return e.answers.length === 0;
|
|
2636
|
+
case "lineConnect": return ns(e);
|
|
2637
|
+
case "matching": return is(e);
|
|
2638
|
+
case "ordering": return as(e);
|
|
2639
|
+
}
|
|
2634
2640
|
}
|
|
2635
2641
|
function Xo(e) {
|
|
2636
|
-
|
|
2642
|
+
var t, n, r, i;
|
|
2643
|
+
return N(e.content) && e.answers.every(Qo) && ((t = (n = e.candidateOptions) == null ? void 0 : n.every((e) => N(e.content))) == null ? !0 : t) && ((r = (i = e.blankOptionGroups) == null ? void 0 : i.every($o)) == null ? !0 : r);
|
|
2637
2644
|
}
|
|
2638
2645
|
function Zo(e) {
|
|
2639
|
-
return
|
|
2646
|
+
return N(e.content) && e.candidateOptions.every((e) => e.trim() === "") && Object.values(e.answers).every((e) => e.trim() === "");
|
|
2640
2647
|
}
|
|
2641
2648
|
function Qo(e) {
|
|
2642
|
-
|
|
2643
|
-
return (t = e == null ? void 0 : e.options.every((e) => N(e.content))) == null ? !0 : t;
|
|
2649
|
+
return "answerOptionIds" in e ? e.answerOptionIds.length === 0 : "answerOptionId" in e ? e.answerOptionId.length === 0 : e.answerPools.every(N);
|
|
2644
2650
|
}
|
|
2645
2651
|
function $o(e) {
|
|
2646
|
-
|
|
2652
|
+
var t;
|
|
2653
|
+
return (t = e == null ? void 0 : e.options.every((e) => N(e.content))) == null ? !0 : t;
|
|
2647
2654
|
}
|
|
2648
2655
|
function es(e) {
|
|
2649
|
-
return
|
|
2656
|
+
return e.answers.optionIds.length === 0 && e.options.every((e) => e.cells.every(N));
|
|
2650
2657
|
}
|
|
2651
2658
|
function ts(e) {
|
|
2652
|
-
return
|
|
2659
|
+
return Object.keys(e.answers).length === 0 && e.categories.every((e) => N(e.content)) && e.items.every((e) => N(e.content));
|
|
2653
2660
|
}
|
|
2654
2661
|
function ns(e) {
|
|
2655
|
-
return
|
|
2662
|
+
return rs(e);
|
|
2656
2663
|
}
|
|
2657
2664
|
function rs(e) {
|
|
2658
|
-
return
|
|
2665
|
+
return Object.keys(e.answers).length === 0 && e.columns.every((e) => e.items.every((e) => N(e.content)));
|
|
2659
2666
|
}
|
|
2660
2667
|
function is(e) {
|
|
2661
|
-
return
|
|
2668
|
+
return rs(e);
|
|
2662
2669
|
}
|
|
2663
2670
|
function as(e) {
|
|
2664
|
-
return e.length
|
|
2671
|
+
return e.answers.length === 0 && e.sortOptions.every((e) => N(e.content));
|
|
2665
2672
|
}
|
|
2666
2673
|
function os(e) {
|
|
2674
|
+
return e.length ? e : [M()];
|
|
2675
|
+
}
|
|
2676
|
+
function ss(e) {
|
|
2667
2677
|
return e.type === "richText" ? {
|
|
2668
2678
|
content: e.content,
|
|
2679
|
+
elementKey: e.elementKey,
|
|
2669
2680
|
type: "richText"
|
|
2670
2681
|
} : e.type === "ordering" ? {
|
|
2671
|
-
|
|
2672
|
-
|
|
2682
|
+
answers: wo(e.answers, e.sortOptions),
|
|
2683
|
+
elementKey: e.elementKey,
|
|
2684
|
+
sortOptions: Co(e.sortOptions),
|
|
2673
2685
|
type: "ordering"
|
|
2674
2686
|
} : e.type === "classification" ? {
|
|
2675
|
-
|
|
2687
|
+
answers: e.answers,
|
|
2676
2688
|
categories: e.categories,
|
|
2689
|
+
elementKey: e.elementKey,
|
|
2677
2690
|
items: e.items,
|
|
2678
2691
|
type: "classification"
|
|
2679
2692
|
} : e.type === "fill" ? {
|
|
2680
|
-
|
|
2693
|
+
answers: e.answers,
|
|
2681
2694
|
blanks: e.blanks,
|
|
2695
|
+
elementKey: e.elementKey,
|
|
2682
2696
|
type: "fill"
|
|
2683
|
-
} :
|
|
2697
|
+
} : cs(e);
|
|
2684
2698
|
}
|
|
2685
|
-
function
|
|
2699
|
+
function cs(e) {
|
|
2686
2700
|
switch (e.type) {
|
|
2687
2701
|
case "inlineFill": return gs(e);
|
|
2688
2702
|
case "wordBuilder": return {
|
|
2689
|
-
|
|
2703
|
+
answers: e.answers,
|
|
2690
2704
|
blanks: e.blanks,
|
|
2691
2705
|
candidateOptions: e.candidateOptions,
|
|
2692
2706
|
content: e.content,
|
|
2707
|
+
elementKey: e.elementKey,
|
|
2693
2708
|
type: "wordBuilder"
|
|
2694
2709
|
};
|
|
2695
2710
|
case "choice": return _s(e);
|
|
2696
2711
|
case "judgement": return {
|
|
2697
|
-
|
|
2712
|
+
answers: e.answers,
|
|
2713
|
+
elementKey: e.elementKey,
|
|
2698
2714
|
type: "judgement"
|
|
2699
2715
|
};
|
|
2700
2716
|
case "lineConnect": return {
|
|
2701
|
-
|
|
2717
|
+
answers: e.answers,
|
|
2702
2718
|
columns: e.columns,
|
|
2719
|
+
elementKey: e.elementKey,
|
|
2703
2720
|
type: "lineConnect"
|
|
2704
2721
|
};
|
|
2705
2722
|
case "matching": return {
|
|
2706
|
-
|
|
2723
|
+
answers: e.answers,
|
|
2707
2724
|
columns: e.columns,
|
|
2725
|
+
elementKey: e.elementKey,
|
|
2708
2726
|
type: "matching"
|
|
2709
2727
|
};
|
|
2710
2728
|
case "textMarker": return {
|
|
2711
|
-
|
|
2712
|
-
content:
|
|
2729
|
+
answers: So(e.answers, e.markers),
|
|
2730
|
+
content: _i(e.content.text, e.content.json, e.content.html),
|
|
2731
|
+
elementKey: e.elementKey,
|
|
2713
2732
|
markers: e.markers,
|
|
2714
2733
|
type: "textMarker"
|
|
2715
2734
|
};
|
|
2716
2735
|
}
|
|
2717
2736
|
}
|
|
2718
|
-
function cs(e, t, n) {
|
|
2719
|
-
let r = k(k({}, e), {}, { elementKey: t.elementKey });
|
|
2720
|
-
switch (r.type) {
|
|
2721
|
-
case "choice": return ls(r, t, n);
|
|
2722
|
-
case "wordBuilder": return us(r, t, n);
|
|
2723
|
-
case "textMarker": return ds(r, t, n);
|
|
2724
|
-
case "ordering": return fs(r, t, n);
|
|
2725
|
-
case "classification": return ps(r, t, n);
|
|
2726
|
-
default: return r;
|
|
2727
|
-
}
|
|
2728
|
-
}
|
|
2729
2737
|
function ls(e, t, n) {
|
|
2730
|
-
|
|
2738
|
+
switch (e.type) {
|
|
2739
|
+
case "choice": return us(e, t, n);
|
|
2740
|
+
case "wordBuilder": return ds(e, t, n);
|
|
2741
|
+
case "textMarker": return fs(e, t, n);
|
|
2742
|
+
case "ordering": return ps(e, t, n);
|
|
2743
|
+
case "classification": return ms(e, t, n);
|
|
2744
|
+
default: return e;
|
|
2745
|
+
}
|
|
2731
2746
|
}
|
|
2732
2747
|
function us(e, t, n) {
|
|
2733
|
-
return t.type === "
|
|
2748
|
+
return t.type === "choice" ? _a(e, t, n) : e;
|
|
2734
2749
|
}
|
|
2735
2750
|
function ds(e, t, n) {
|
|
2736
|
-
return t.type === "
|
|
2751
|
+
return t.type === "wordBuilder" ? zi(e, n, t) : e;
|
|
2737
2752
|
}
|
|
2738
2753
|
function fs(e, t, n) {
|
|
2739
|
-
return t.type === "
|
|
2754
|
+
return t.type === "textMarker" ? Ri(e, e.content, n) : e;
|
|
2740
2755
|
}
|
|
2741
2756
|
function ps(e, t, n) {
|
|
2742
|
-
return t.type === "
|
|
2757
|
+
return t.type === "ordering" ? Ga(e, n) : e;
|
|
2743
2758
|
}
|
|
2744
|
-
function ms(e, t) {
|
|
2745
|
-
return
|
|
2759
|
+
function ms(e, t, n) {
|
|
2760
|
+
return t.type === "classification" ? La(e, n) : e;
|
|
2746
2761
|
}
|
|
2747
2762
|
function hs(e) {
|
|
2748
2763
|
return {
|
|
2749
2764
|
content: e.content,
|
|
2765
|
+
extraKey: e.extraKey,
|
|
2750
2766
|
type: e.type
|
|
2751
2767
|
};
|
|
2752
2768
|
}
|
|
2753
2769
|
function gs(e) {
|
|
2754
|
-
return k(k(k({
|
|
2770
|
+
return k(k(k({ answers: e.answers }, e.blankOptionGroups ? { blankOptionGroups: e.blankOptionGroups } : {}), {}, { blanks: e.blanks }, e.candidateOptions ? { candidateOptions: e.candidateOptions } : {}), {}, {
|
|
2755
2771
|
content: e.content,
|
|
2772
|
+
elementKey: e.elementKey,
|
|
2756
2773
|
type: "inlineFill"
|
|
2757
2774
|
});
|
|
2758
2775
|
}
|
|
2759
2776
|
function _s(e) {
|
|
2760
2777
|
return {
|
|
2761
|
-
|
|
2778
|
+
answers: e.answers,
|
|
2762
2779
|
columns: e.columns,
|
|
2780
|
+
elementKey: e.elementKey,
|
|
2763
2781
|
options: e.options,
|
|
2764
2782
|
type: "choice"
|
|
2765
2783
|
};
|
|
@@ -2804,6 +2822,7 @@ var Cs = {
|
|
|
2804
2822
|
},
|
|
2805
2823
|
blank: {
|
|
2806
2824
|
answer: "Answer",
|
|
2825
|
+
answers: "Answers",
|
|
2807
2826
|
answerAssignmentAria: "Blank {{index}} answer group",
|
|
2808
2827
|
answerGroup: "Answer Group {{index}}",
|
|
2809
2828
|
answerPool: "Group {{groupIndex}} answer {{poolIndex}}",
|
|
@@ -2818,7 +2837,7 @@ var Cs = {
|
|
|
2818
2837
|
label: "Blank {{index}}",
|
|
2819
2838
|
memberDetach: "Blank {{index}} Detach",
|
|
2820
2839
|
newAnswerGroup: "New Answer Group",
|
|
2821
|
-
|
|
2840
|
+
perBlankOptionsTitle: "Option Groups",
|
|
2822
2841
|
sharedAnswer: "Shared Answer",
|
|
2823
2842
|
shortLabel: "Blank {{index}}",
|
|
2824
2843
|
singleAnswer: "Single Answer"
|
|
@@ -2988,6 +3007,7 @@ var Cs = {
|
|
|
2988
3007
|
},
|
|
2989
3008
|
blank: {
|
|
2990
3009
|
answer: "\u7b54\u6848",
|
|
3010
|
+
answers: "\u7b54\u6848",
|
|
2991
3011
|
answerAssignmentAria: "\u7a7a {{index}} \u7b54\u6848\u7ec4",
|
|
2992
3012
|
answerGroup: "\u7b54\u6848\u7ec4 {{index}}",
|
|
2993
3013
|
answerPool: "\u7b2c {{groupIndex}} \u7ec4\u7b54\u6848 {{poolIndex}}",
|
|
@@ -3002,7 +3022,7 @@ var Cs = {
|
|
|
3002
3022
|
label: "\u7b2c {{index}} \u7a7a",
|
|
3003
3023
|
memberDetach: "\u7b2c {{index}} \u7a7a \u62c6\u51fa",
|
|
3004
3024
|
newAnswerGroup: "\u65b0\u5efa\u7b54\u6848\u7ec4",
|
|
3005
|
-
|
|
3025
|
+
perBlankOptionsTitle: "\u9009\u9879\u7ec4",
|
|
3006
3026
|
sharedAnswer: "\u5171\u7528\u7b54\u6848",
|
|
3007
3027
|
shortLabel: "\u7a7a {{index}}",
|
|
3008
3028
|
singleAnswer: "\u5355\u72ec\u7b54\u6848"
|
|
@@ -3509,25 +3529,25 @@ function R({ controls: e, disabled: t, editorRef: n, label: r, onChange: i, plac
|
|
|
3509
3529
|
//#endregion
|
|
3510
3530
|
//#region src/question/content-editor/QuestionContentBlankGroupEditor.tsx
|
|
3511
3531
|
function Js({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls: s, translator: c }) {
|
|
3512
|
-
let { t: l } = c, [u, d] = m(null), [f, p] = m(null), h = t ?
|
|
3532
|
+
let { t: l } = c, [u, d] = m(null), [f, p] = m(null), h = t ? ta(n.answers, n.blanks) : [], g = na(h);
|
|
3513
3533
|
function _(e) {
|
|
3514
|
-
r(k(k({}, e), {}, {
|
|
3534
|
+
r(k(k({}, e), {}, { answers: t ? ta(e.answers, e.blanks) : [] }));
|
|
3515
3535
|
}
|
|
3516
3536
|
function v(e, t, r) {
|
|
3517
3537
|
let i = Ys(h, e);
|
|
3518
|
-
i && _(
|
|
3538
|
+
i && _(oa(k(k({}, n), {}, { answers: h }), e, i.answerPools.map((e, n) => n === t ? r : e)));
|
|
3519
3539
|
}
|
|
3520
3540
|
function y(e) {
|
|
3521
3541
|
let t = Ys(h, e);
|
|
3522
|
-
t && _(
|
|
3542
|
+
t && _(oa(k(k({}, n), {}, { answers: h }), e, [...t.answerPools, M()]));
|
|
3523
3543
|
}
|
|
3524
3544
|
function b(e, t) {
|
|
3525
3545
|
let r = Ys(h, e);
|
|
3526
|
-
r && _(
|
|
3546
|
+
r && _(oa(k(k({}, n), {}, { answers: h }), e, r.answerPools.filter((e, n) => n !== t)));
|
|
3527
3547
|
}
|
|
3528
3548
|
function x(e, t) {
|
|
3529
3549
|
if (t === "__single__") {
|
|
3530
|
-
_(
|
|
3550
|
+
_(aa(k(k({}, n), {}, { answers: h }), e));
|
|
3531
3551
|
return;
|
|
3532
3552
|
}
|
|
3533
3553
|
if (t === "__new__") {
|
|
@@ -3535,7 +3555,7 @@ function Js({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
3535
3555
|
return;
|
|
3536
3556
|
}
|
|
3537
3557
|
let r = Number(t.replace("group:", ""));
|
|
3538
|
-
Number.isNaN(r) || _(
|
|
3558
|
+
Number.isNaN(r) || _(ra(k(k({}, n), {}, { answers: h }), e, r));
|
|
3539
3559
|
}
|
|
3540
3560
|
function S(e) {
|
|
3541
3561
|
return h.filter((e) => e.blankIds.length === 1).map((e) => e.blankIds[0]).filter((t) => !!t && t !== e);
|
|
@@ -3548,7 +3568,7 @@ function Js({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
3548
3568
|
d(null), p(null);
|
|
3549
3569
|
}
|
|
3550
3570
|
function T() {
|
|
3551
|
-
!u || !f || (_(
|
|
3571
|
+
!u || !f || (_(ia(k(k({}, n), {}, { answers: h }), u, f)), w());
|
|
3552
3572
|
}
|
|
3553
3573
|
function ee(t, n) {
|
|
3554
3574
|
return /* @__PURE__ */ o("div", {
|
|
@@ -3598,7 +3618,7 @@ function Js({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
3598
3618
|
}),
|
|
3599
3619
|
/* @__PURE__ */ o("label", {
|
|
3600
3620
|
className: "flex min-w-0 items-center gap-2",
|
|
3601
|
-
children: [/* @__PURE__ */ a(I.Text, { children: l("questionContentEditor.blank.
|
|
3621
|
+
children: [/* @__PURE__ */ a(I.Text, { children: l("questionContentEditor.blank.answers") }), /* @__PURE__ */ a(Ms, {
|
|
3602
3622
|
"aria-label": l("questionContentEditor.blank.answerSelectAria", { index: r + 1 }),
|
|
3603
3623
|
className: "w-48",
|
|
3604
3624
|
disabled: e,
|
|
@@ -3628,7 +3648,7 @@ function Js({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
3628
3648
|
"aria-label": l("questionContentEditor.actions.deleteBlank", { index: r + 1 }),
|
|
3629
3649
|
danger: !0,
|
|
3630
3650
|
disabled: e || n.blanks.length <= 1,
|
|
3631
|
-
onClick: () => _(
|
|
3651
|
+
onClick: () => _(ea(k(k({}, n), {}, { answers: h }), t)),
|
|
3632
3652
|
children: l("questionContentEditor.actions.deleteBlank", { index: r + 1 })
|
|
3633
3653
|
})
|
|
3634
3654
|
]
|
|
@@ -3646,7 +3666,7 @@ function Js({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
3646
3666
|
children: l("questionContentEditor.blank.answerGroup", { index: i + 1 })
|
|
3647
3667
|
}), t.blankIds.map((t) => /* @__PURE__ */ a(F, {
|
|
3648
3668
|
disabled: e,
|
|
3649
|
-
onClick: () => _(
|
|
3669
|
+
onClick: () => _(aa(k(k({}, n), {}, { answers: h }), t)),
|
|
3650
3670
|
size: "small",
|
|
3651
3671
|
children: l("questionContentEditor.blank.memberDetach", { index: n.blanks.indexOf(t) + 1 })
|
|
3652
3672
|
}, t))]
|
|
@@ -3734,18 +3754,18 @@ var z = {
|
|
|
3734
3754
|
//#endregion
|
|
3735
3755
|
//#region src/question/content-editor/QuestionContentClassificationEditor.tsx
|
|
3736
3756
|
function Xs({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls: i, translator: s }) {
|
|
3737
|
-
let { t: c } = s, l =
|
|
3757
|
+
let { t: c } = s, l = La(n, t);
|
|
3738
3758
|
function u(e) {
|
|
3739
|
-
r(
|
|
3759
|
+
r(La(e, t));
|
|
3740
3760
|
}
|
|
3741
3761
|
function d(e, t) {
|
|
3742
|
-
u(
|
|
3762
|
+
u(Ba(l, e, t));
|
|
3743
3763
|
}
|
|
3744
3764
|
function f(e, t) {
|
|
3745
|
-
u(
|
|
3765
|
+
u(Ua(l, e, t));
|
|
3746
3766
|
}
|
|
3747
3767
|
function p(e, t) {
|
|
3748
|
-
u(k(k({}, l), {}, {
|
|
3768
|
+
u(k(k({}, l), {}, { answers: Wa(l.answers, e, t == null ? "" : t) }));
|
|
3749
3769
|
}
|
|
3750
3770
|
return /* @__PURE__ */ o("div", {
|
|
3751
3771
|
className: z.board,
|
|
@@ -3767,7 +3787,7 @@ function Xs({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
3767
3787
|
className: z["primary-action"],
|
|
3768
3788
|
disabled: e,
|
|
3769
3789
|
icon: "+",
|
|
3770
|
-
onClick: () => u(
|
|
3790
|
+
onClick: () => u(Ra(l)),
|
|
3771
3791
|
children: c("questionContentEditor.classification.addCategory")
|
|
3772
3792
|
})]
|
|
3773
3793
|
}), /* @__PURE__ */ a("div", {
|
|
@@ -3795,7 +3815,7 @@ function Xs({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
3795
3815
|
Zs({
|
|
3796
3816
|
ariaLabel: c("questionContentEditor.classification.deleteCategory", { index: n + 1 }),
|
|
3797
3817
|
disabled: e || l.categories.length <= 1,
|
|
3798
|
-
onClick: () => u(
|
|
3818
|
+
onClick: () => u(za(l, t.id))
|
|
3799
3819
|
})
|
|
3800
3820
|
]
|
|
3801
3821
|
})
|
|
@@ -3819,14 +3839,14 @@ function Xs({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
3819
3839
|
className: z["primary-action"],
|
|
3820
3840
|
disabled: e,
|
|
3821
3841
|
icon: "+",
|
|
3822
|
-
onClick: () => u(
|
|
3842
|
+
onClick: () => u(Va(l)),
|
|
3823
3843
|
children: c("questionContentEditor.classification.addCard")
|
|
3824
3844
|
})]
|
|
3825
3845
|
}), /* @__PURE__ */ a("div", {
|
|
3826
3846
|
className: z["card-grid"],
|
|
3827
3847
|
children: l.items.map((n, r) => {
|
|
3828
3848
|
var s;
|
|
3829
|
-
let d = (s = l.
|
|
3849
|
+
let d = (s = l.answers[n.id]) == null ? "" : s;
|
|
3830
3850
|
return /* @__PURE__ */ o("article", {
|
|
3831
3851
|
className: z["content-card"],
|
|
3832
3852
|
children: [/* @__PURE__ */ o("div", {
|
|
@@ -3844,7 +3864,7 @@ function Xs({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
3844
3864
|
}), Zs({
|
|
3845
3865
|
ariaLabel: c("questionContentEditor.classification.deleteCard", { index: r + 1 }),
|
|
3846
3866
|
disabled: e || l.items.length <= 1,
|
|
3847
|
-
onClick: () => u(
|
|
3867
|
+
onClick: () => u(Ha(l, n.id))
|
|
3848
3868
|
})]
|
|
3849
3869
|
}), t ? /* @__PURE__ */ o("label", {
|
|
3850
3870
|
className: z["field-stack"],
|
|
@@ -3889,44 +3909,44 @@ function Zs({ ariaLabel: e, disabled: t, onClick: n }) {
|
|
|
3889
3909
|
//#endregion
|
|
3890
3910
|
//#region src/question/content-editor/QuestionContentFillTextEditor.tsx
|
|
3891
3911
|
function Qs({ disabled: e, element: t, hasAnswer: n, item: r, onChange: s, richTextControls: c, title: l, translator: u }) {
|
|
3892
|
-
let { t: d } = u, f = p(null), [h, g] = m({}), [_, v] = m(null), [y, b] = m(null), x =
|
|
3893
|
-
|
|
3912
|
+
let { t: d } = u, f = p(null), [h, g] = m({}), [_, v] = m(null), [y, b] = m(null), x = Bi(r, t, n), S = {
|
|
3913
|
+
answers: x.answers.filter((e) => "answerPools" in e),
|
|
3894
3914
|
blanks: x.blanks,
|
|
3895
3915
|
elementKey: x.elementKey,
|
|
3896
3916
|
type: "fill"
|
|
3897
3917
|
};
|
|
3898
3918
|
function C() {
|
|
3899
3919
|
var e;
|
|
3900
|
-
let t =
|
|
3920
|
+
let t = Fi(r.blanks);
|
|
3901
3921
|
(e = f.current) == null || e.insertNode("blank", {
|
|
3902
3922
|
blankId: t,
|
|
3903
3923
|
label: d("questionContentEditor.blank.shortLabel", { index: r.blanks.length + 1 })
|
|
3904
3924
|
});
|
|
3905
3925
|
}
|
|
3906
3926
|
function w(e) {
|
|
3907
|
-
s(
|
|
3927
|
+
s(Bi(e, t, n));
|
|
3908
3928
|
}
|
|
3909
3929
|
function T(e) {
|
|
3910
3930
|
e.type === "fill" && w(k(k({}, x), {}, {
|
|
3911
|
-
|
|
3931
|
+
answers: n ? e.answers : [],
|
|
3912
3932
|
blanks: e.blanks
|
|
3913
3933
|
}));
|
|
3914
3934
|
}
|
|
3915
3935
|
function ee(e) {
|
|
3916
|
-
w(k(k({}, x), {}, { candidateOptions:
|
|
3936
|
+
w(k(k({}, x), {}, { candidateOptions: Hi(e, "option_") }));
|
|
3917
3937
|
}
|
|
3918
3938
|
function E(e, t) {
|
|
3919
|
-
let n =
|
|
3939
|
+
let n = Yi(x.blankOptionGroups, x.blanks).map((n) => n.blankId === e ? k(k({}, t), {}, { blankId: e }) : n);
|
|
3920
3940
|
w(k(k({}, x), {}, { blankOptionGroups: n }));
|
|
3921
3941
|
}
|
|
3922
3942
|
function D() {
|
|
3923
|
-
return x.
|
|
3943
|
+
return x.answers.filter((e) => "answerOptionIds" in e);
|
|
3924
3944
|
}
|
|
3925
3945
|
function te(e) {
|
|
3926
3946
|
return e.blankIds.join("__");
|
|
3927
3947
|
}
|
|
3928
3948
|
function O(e) {
|
|
3929
|
-
w(k(k({}, x), {}, {
|
|
3949
|
+
w(k(k({}, x), {}, { answers: e }));
|
|
3930
3950
|
}
|
|
3931
3951
|
function ne(e, t, n) {
|
|
3932
3952
|
let r = D(), i = r.slice(e, e + 1)[0];
|
|
@@ -3935,7 +3955,7 @@ function Qs({ disabled: e, element: t, hasAnswer: n, item: r, onChange: s, richT
|
|
|
3935
3955
|
t >= i.answerOptionIds.length && n && g((e) => k(k({}, e), {}, { [a]: Math.max(0, $s(e, a) - 1) })), O(r.map((t, n) => n === e ? k(k({}, t), {}, { answerOptionIds: o }) : t));
|
|
3936
3956
|
}
|
|
3937
3957
|
function re(e) {
|
|
3938
|
-
let t =
|
|
3958
|
+
let t = Yi(x.blankOptionGroups, x.blanks).find((t) => t.blankId === e);
|
|
3939
3959
|
if (!t) throw Error(`Missing option group for blank ${e}.`);
|
|
3940
3960
|
return t;
|
|
3941
3961
|
}
|
|
@@ -4032,7 +4052,7 @@ function Qs({ disabled: e, element: t, hasAnswer: n, item: r, onChange: s, richT
|
|
|
4032
4052
|
return /* @__PURE__ */ a("div", {
|
|
4033
4053
|
className: "flex min-w-0 flex-col gap-2",
|
|
4034
4054
|
children: t.map((r, i) => {
|
|
4035
|
-
let s =
|
|
4055
|
+
let s = Ci("upperAlpha", i);
|
|
4036
4056
|
return /* @__PURE__ */ o("div", {
|
|
4037
4057
|
className: "grid min-w-0 grid-cols-[2rem_minmax(0,1fr)_auto] items-center gap-2",
|
|
4038
4058
|
children: [
|
|
@@ -4074,7 +4094,7 @@ function Qs({ disabled: e, element: t, hasAnswer: n, item: r, onChange: s, richT
|
|
|
4074
4094
|
}), /* @__PURE__ */ a(F, {
|
|
4075
4095
|
disabled: e,
|
|
4076
4096
|
icon: "+",
|
|
4077
|
-
onClick: () => n([...t,
|
|
4097
|
+
onClick: () => n([...t, Vi(ve(t, i))]),
|
|
4078
4098
|
size: "small",
|
|
4079
4099
|
children: d("questionContentEditor.actions.addCandidateOption")
|
|
4080
4100
|
})]
|
|
@@ -4091,8 +4111,8 @@ function Qs({ disabled: e, element: t, hasAnswer: n, item: r, onChange: s, richT
|
|
|
4091
4111
|
return new Set(D().filter((e) => e.blankIds.every((e) => !n.has(e))).reduce((e, t) => [...e, ...t.answerOptionIds], []));
|
|
4092
4112
|
}
|
|
4093
4113
|
function Ce(t, n) {
|
|
4094
|
-
let r = te(t), i =
|
|
4095
|
-
let n =
|
|
4114
|
+
let r = te(t), i = Xi(t), s = i.length ? [...i, ...Array.from({ length: $s(h, r) }, () => "")] : Array.from({ length: $s(h, r) + 1 }, () => ""), c = Se(t), l = xe().map((e, t) => {
|
|
4115
|
+
let n = Ci("upperAlpha", t), r = i.includes(e.optionId);
|
|
4096
4116
|
return {
|
|
4097
4117
|
disabled: c.has(e.optionId) && !r,
|
|
4098
4118
|
label: `${n}. ${e.content.text || d("questionContentEditor.fields.candidateOption", { index: t + 1 })}`,
|
|
@@ -4196,14 +4216,14 @@ function Qs({ disabled: e, element: t, hasAnswer: n, item: r, onChange: s, richT
|
|
|
4196
4216
|
}
|
|
4197
4217
|
function ke(e) {
|
|
4198
4218
|
var t, n;
|
|
4199
|
-
let r = x.
|
|
4219
|
+
let r = x.answers.find((t) => "answerOptionId" in t && t.blankId === e), i = (t = (n = re(e).options[0]) == null ? void 0 : n.optionId) == null ? "" : t;
|
|
4200
4220
|
return {
|
|
4201
4221
|
answerOptionId: (r == null ? void 0 : r.answerOptionId) || i,
|
|
4202
4222
|
blankId: e
|
|
4203
4223
|
};
|
|
4204
4224
|
}
|
|
4205
4225
|
function Ae(e, t) {
|
|
4206
|
-
w(k(k({}, x), {}, {
|
|
4226
|
+
w(k(k({}, x), {}, { answers: x.answers.map((n) => "answerOptionId" in n && n.blankId === e ? k(k({}, n), {}, { answerOptionId: t }) : n) }));
|
|
4207
4227
|
}
|
|
4208
4228
|
function je(e, t) {
|
|
4209
4229
|
E(e, {
|
|
@@ -4213,7 +4233,7 @@ function Qs({ disabled: e, element: t, hasAnswer: n, item: r, onChange: s, richT
|
|
|
4213
4233
|
}
|
|
4214
4234
|
function Me(t, r) {
|
|
4215
4235
|
let i = ke(t.blankId), s = t.options.map((e, t) => ({
|
|
4216
|
-
label: `${
|
|
4236
|
+
label: `${Ci("upperAlpha", t)}. ${e.content.text || d("questionContentEditor.fields.candidateOption", { index: t + 1 })}`,
|
|
4217
4237
|
value: e.optionId
|
|
4218
4238
|
}));
|
|
4219
4239
|
return /* @__PURE__ */ o("section", {
|
|
@@ -4240,7 +4260,7 @@ function Qs({ disabled: e, element: t, hasAnswer: n, item: r, onChange: s, richT
|
|
|
4240
4260
|
})]
|
|
4241
4261
|
}) : null, /* @__PURE__ */ a(F, {
|
|
4242
4262
|
disabled: e,
|
|
4243
|
-
onClick: () => je(t.blankId, [...t.options,
|
|
4263
|
+
onClick: () => je(t.blankId, [...t.options, Vi(ve(t.options, `${t.blankId}_option_`))]),
|
|
4244
4264
|
size: "small",
|
|
4245
4265
|
children: d("questionContentEditor.actions.addBlankOption")
|
|
4246
4266
|
})]
|
|
@@ -4253,12 +4273,12 @@ function Qs({ disabled: e, element: t, hasAnswer: n, item: r, onChange: s, richT
|
|
|
4253
4273
|
var e;
|
|
4254
4274
|
return /* @__PURE__ */ o(i, { children: [be((e = x.candidateOptions) == null ? [] : e, ee, d("questionContentEditor.fields.candidateOptions"), "option_"), n ? Oe() : null] });
|
|
4255
4275
|
}
|
|
4256
|
-
let r =
|
|
4276
|
+
let r = Yi(x.blankOptionGroups, x.blanks);
|
|
4257
4277
|
return /* @__PURE__ */ o("div", {
|
|
4258
4278
|
className: "flex min-w-0 flex-col gap-3",
|
|
4259
4279
|
children: [/* @__PURE__ */ a(I.Text, {
|
|
4260
4280
|
strong: !0,
|
|
4261
|
-
children: d("questionContentEditor.blank.
|
|
4281
|
+
children: d("questionContentEditor.blank.perBlankOptionsTitle")
|
|
4262
4282
|
}), r.map(Me)]
|
|
4263
4283
|
});
|
|
4264
4284
|
}
|
|
@@ -4285,7 +4305,7 @@ function Qs({ disabled: e, element: t, hasAnswer: n, item: r, onChange: s, richT
|
|
|
4285
4305
|
editorRef: f,
|
|
4286
4306
|
label: d("questionContentEditor.fields.fillTextContent"),
|
|
4287
4307
|
onChange: (e) => {
|
|
4288
|
-
s(
|
|
4308
|
+
s(Ii(x, e, n, t));
|
|
4289
4309
|
},
|
|
4290
4310
|
placeholder: d("questionContentEditor.placeholders.fillTextContent"),
|
|
4291
4311
|
value: x.content
|
|
@@ -4329,9 +4349,9 @@ function $s(e, t) {
|
|
|
4329
4349
|
//#endregion
|
|
4330
4350
|
//#region src/question/content-editor/QuestionContentJudgementGroupEditor.tsx
|
|
4331
4351
|
function ec({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, translator: o }) {
|
|
4332
|
-
let { t: s } = o, c =
|
|
4352
|
+
let { t: s } = o, c = Ei(t.config.judgeAnswerMode), l = n ? r.answers.filter((e) => c.includes(e)).slice(0, 1) : [];
|
|
4333
4353
|
function u(e) {
|
|
4334
|
-
i(k(k({}, r), {}, {
|
|
4354
|
+
i(k(k({}, r), {}, { answers: l.includes(e) ? [] : [e] }));
|
|
4335
4355
|
}
|
|
4336
4356
|
return /* @__PURE__ */ a("div", {
|
|
4337
4357
|
className: "flex min-w-0 flex-col gap-3",
|
|
@@ -4435,10 +4455,10 @@ var B = {
|
|
|
4435
4455
|
"none"
|
|
4436
4456
|
];
|
|
4437
4457
|
function pc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richTextControls: s, translator: c }) {
|
|
4438
|
-
let { t: u } = c, [h, g] = m(null), [_, v] = m(null), y = p(null), b = p(/* @__PURE__ */ new Map()), x =
|
|
4439
|
-
|
|
4458
|
+
let { t: u } = c, [h, g] = m(null), [_, v] = m(null), y = p(null), b = p(/* @__PURE__ */ new Map()), x = xa(r, t, n), S = { gridTemplateColumns: `repeat(${x.columns.length}, minmax(16rem, 1fr))` }, C = f(() => JSON.stringify({
|
|
4459
|
+
answers: x.answers,
|
|
4440
4460
|
columns: x.columns.map((e) => e.items.map((e) => e.itemId))
|
|
4441
|
-
}), [x.
|
|
4461
|
+
}), [x.answers, x.columns]), w = f(() => n ? ic(x, x.answers) : [], [n, x]), T = l(() => {
|
|
4442
4462
|
let e = y.current;
|
|
4443
4463
|
if (!n || !e || w.length === 0) {
|
|
4444
4464
|
v(null);
|
|
@@ -4485,13 +4505,13 @@ function pc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4485
4505
|
};
|
|
4486
4506
|
}
|
|
4487
4507
|
function E(e) {
|
|
4488
|
-
i(
|
|
4508
|
+
i(xa(e, t, n));
|
|
4489
4509
|
}
|
|
4490
4510
|
function D(e, t) {
|
|
4491
|
-
E(
|
|
4511
|
+
E(Da(x, e, t));
|
|
4492
4512
|
}
|
|
4493
4513
|
function te(e, t) {
|
|
4494
|
-
E(k(k({}, x), {}, {
|
|
4514
|
+
E(k(k({}, x), {}, { answers: Oa(x.answers, e, t) }));
|
|
4495
4515
|
}
|
|
4496
4516
|
function O(t, r, i) {
|
|
4497
4517
|
if (e || !n) return;
|
|
@@ -4527,7 +4547,7 @@ function pc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4527
4547
|
children: [/* @__PURE__ */ a(Ms, {
|
|
4528
4548
|
"aria-label": u("questionContentEditor.lineConnect.labelStyle", { index: n + 1 }),
|
|
4529
4549
|
disabled: e,
|
|
4530
|
-
onChange: (e) => e ? E(
|
|
4550
|
+
onChange: (e) => e ? E(wa(x, t.columnId, e)) : void 0,
|
|
4531
4551
|
options: fc.map((e) => ({
|
|
4532
4552
|
label: u(`questionContentEditor.lineConnect.labels.${e}`),
|
|
4533
4553
|
value: e
|
|
@@ -4538,7 +4558,7 @@ function pc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4538
4558
|
danger: !0,
|
|
4539
4559
|
disabled: e || x.columns.length <= 2,
|
|
4540
4560
|
icon: "\u00d7",
|
|
4541
|
-
onClick: () => E(
|
|
4561
|
+
onClick: () => E(Ca(x, t.columnId)),
|
|
4542
4562
|
size: "small"
|
|
4543
4563
|
})]
|
|
4544
4564
|
})]
|
|
@@ -4551,7 +4571,7 @@ function pc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4551
4571
|
"aria-label": u("questionContentEditor.lineConnect.addItem", { index: n + 1 }),
|
|
4552
4572
|
disabled: e,
|
|
4553
4573
|
icon: "+",
|
|
4554
|
-
onClick: () => E(
|
|
4574
|
+
onClick: () => E(Ta(x, t.columnId)),
|
|
4555
4575
|
size: "small",
|
|
4556
4576
|
children: u("questionContentEditor.lineConnect.addItem", { index: n + 1 })
|
|
4557
4577
|
})
|
|
@@ -4559,7 +4579,7 @@ function pc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4559
4579
|
}, t.columnId);
|
|
4560
4580
|
}
|
|
4561
4581
|
function ie(t, r, i, c) {
|
|
4562
|
-
let l =
|
|
4582
|
+
let l = wi(t.labelStyle, c), d = l ? `${l}. ${i.content.text}` : i.content.text, f = (h == null ? void 0 : h.itemId) === i.itemId, p = mc(x, i.itemId), m = hc(x, i.itemId), g = gc(p, m), _ = _c(n);
|
|
4563
4583
|
return /* @__PURE__ */ o("div", {
|
|
4564
4584
|
className: vc(f, g),
|
|
4565
4585
|
"data-testid": `line-connect-item-${i.itemId}`,
|
|
@@ -4586,7 +4606,7 @@ function pc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4586
4606
|
danger: !0,
|
|
4587
4607
|
disabled: e || t.items.length <= 1,
|
|
4588
4608
|
icon: "\u00d7",
|
|
4589
|
-
onClick: () => E(
|
|
4609
|
+
onClick: () => E(Ea(x, i.itemId)),
|
|
4590
4610
|
size: "small"
|
|
4591
4611
|
}),
|
|
4592
4612
|
oe(r, i, c, d, f, m)
|
|
@@ -4671,18 +4691,18 @@ function pc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4671
4691
|
"aria-label": u("questionContentEditor.lineConnect.addColumn"),
|
|
4672
4692
|
disabled: e || x.columns.length >= 5,
|
|
4673
4693
|
icon: "+",
|
|
4674
|
-
onClick: () => E(
|
|
4694
|
+
onClick: () => E(Sa(x)),
|
|
4675
4695
|
children: u("questionContentEditor.lineConnect.addColumn")
|
|
4676
4696
|
})
|
|
4677
4697
|
]
|
|
4678
4698
|
});
|
|
4679
4699
|
}
|
|
4680
4700
|
function mc(e, t) {
|
|
4681
|
-
return Object.values(e.
|
|
4701
|
+
return Object.values(e.answers).some((e) => e.includes(t));
|
|
4682
4702
|
}
|
|
4683
4703
|
function hc(e, t) {
|
|
4684
4704
|
var n;
|
|
4685
|
-
return ((n = e.
|
|
4705
|
+
return ((n = e.answers[t]) == null ? [] : n).length > 0;
|
|
4686
4706
|
}
|
|
4687
4707
|
function gc(e, t) {
|
|
4688
4708
|
return e || t;
|
|
@@ -4715,10 +4735,10 @@ var bc = {
|
|
|
4715
4735
|
"none"
|
|
4716
4736
|
];
|
|
4717
4737
|
function Sc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richTextControls: s, translator: c }) {
|
|
4718
|
-
let { t: u } = c, [h, g] = m(null), [_, v] = m(null), y = p(null), b = p(/* @__PURE__ */ new Map()), x =
|
|
4719
|
-
|
|
4738
|
+
let { t: u } = c, [h, g] = m(null), [_, v] = m(null), y = p(null), b = p(/* @__PURE__ */ new Map()), x = ka(r, t, n), S = { gridTemplateColumns: `repeat(${x.columns.length}, minmax(16rem, 1fr))` }, C = f(() => n ? ic(x, x.answers, ft) : [], [n, x]), w = f(() => JSON.stringify({
|
|
4739
|
+
answers: x.answers,
|
|
4720
4740
|
columns: x.columns.map((e) => e.items.map((e) => e.itemId))
|
|
4721
|
-
}), [x.
|
|
4741
|
+
}), [x.answers, x.columns]), T = l(() => {
|
|
4722
4742
|
let e = y.current;
|
|
4723
4743
|
if (!n || !e || C.length === 0) {
|
|
4724
4744
|
v(null);
|
|
@@ -4765,10 +4785,10 @@ function Sc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4765
4785
|
};
|
|
4766
4786
|
}
|
|
4767
4787
|
function E(e) {
|
|
4768
|
-
i(
|
|
4788
|
+
i(ka(e, t, n));
|
|
4769
4789
|
}
|
|
4770
4790
|
function D(e, t) {
|
|
4771
|
-
E(
|
|
4791
|
+
E(Na(x, e, t));
|
|
4772
4792
|
}
|
|
4773
4793
|
function te(t, r, i) {
|
|
4774
4794
|
if (e || !n) return;
|
|
@@ -4778,7 +4798,7 @@ function Sc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4778
4798
|
label: i
|
|
4779
4799
|
}, o = h ? pt(h, a) : null;
|
|
4780
4800
|
if (o) {
|
|
4781
|
-
E(k(k({}, x), {}, {
|
|
4801
|
+
E(k(k({}, x), {}, { answers: Pa(x.answers, o.fromItemId, o.toItemId) })), g(null);
|
|
4782
4802
|
return;
|
|
4783
4803
|
}
|
|
4784
4804
|
g(a);
|
|
@@ -4792,7 +4812,7 @@ function Sc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4792
4812
|
children: /* @__PURE__ */ a(Ms, {
|
|
4793
4813
|
"aria-label": u("questionContentEditor.matching.labelStyle", { index: n + 1 }),
|
|
4794
4814
|
disabled: e,
|
|
4795
|
-
onChange: (e) => e ? E(
|
|
4815
|
+
onChange: (e) => e ? E(Aa(x, t.columnId, e)) : void 0,
|
|
4796
4816
|
options: xc.map((e) => ({
|
|
4797
4817
|
label: u(`questionContentEditor.matching.labels.${e}`),
|
|
4798
4818
|
value: e
|
|
@@ -4808,7 +4828,7 @@ function Sc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4808
4828
|
"aria-label": u("questionContentEditor.matching.addItem", { index: n + 1 }),
|
|
4809
4829
|
disabled: e,
|
|
4810
4830
|
icon: "+",
|
|
4811
|
-
onClick: () => E(
|
|
4831
|
+
onClick: () => E(ja(x, t.columnId)),
|
|
4812
4832
|
size: "small",
|
|
4813
4833
|
children: u("questionContentEditor.matching.addItemButton")
|
|
4814
4834
|
})
|
|
@@ -4816,7 +4836,7 @@ function Sc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4816
4836
|
}, t.columnId);
|
|
4817
4837
|
}
|
|
4818
4838
|
function ne(t, r, i, c) {
|
|
4819
|
-
let l =
|
|
4839
|
+
let l = Ti(t.labelStyle, c), d = (h == null ? void 0 : h.itemId) === i.itemId, f = Cc(x, i.itemId), p = wc(x, i.itemId), m = f || p, g = l ? `${l}. ${i.content.text}` : i.content.text, _ = Tc(n);
|
|
4820
4840
|
return /* @__PURE__ */ o("div", {
|
|
4821
4841
|
className: tc(bc.item, d ? bc.selected : "", m ? bc.matched : ""),
|
|
4822
4842
|
"data-testid": `matching-editor-item-${i.itemId}`,
|
|
@@ -4843,7 +4863,7 @@ function Sc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4843
4863
|
danger: !0,
|
|
4844
4864
|
disabled: e || t.items.length <= 1,
|
|
4845
4865
|
icon: "\u00d7",
|
|
4846
|
-
onClick: () => E(
|
|
4866
|
+
onClick: () => E(Ma(x, i.itemId)),
|
|
4847
4867
|
size: "small"
|
|
4848
4868
|
}),
|
|
4849
4869
|
ie(r, i, c, g, d, p)
|
|
@@ -4928,11 +4948,11 @@ function Sc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4928
4948
|
});
|
|
4929
4949
|
}
|
|
4930
4950
|
function Cc(e, t) {
|
|
4931
|
-
return Object.values(e.
|
|
4951
|
+
return Object.values(e.answers).some((e) => e.includes(t));
|
|
4932
4952
|
}
|
|
4933
4953
|
function wc(e, t) {
|
|
4934
4954
|
var n;
|
|
4935
|
-
return ((n = e.
|
|
4955
|
+
return ((n = e.answers[t]) == null ? [] : n).length > 0;
|
|
4936
4956
|
}
|
|
4937
4957
|
function Tc(e) {
|
|
4938
4958
|
return { gridTemplateColumns: e ? "2rem minmax(0, 1fr) auto auto" : "2rem minmax(0, 1fr) auto" };
|
|
@@ -4943,21 +4963,21 @@ function Ec(e, t) {
|
|
|
4943
4963
|
//#endregion
|
|
4944
4964
|
//#region src/question/content-editor/QuestionContentOptionGroupEditor.tsx
|
|
4945
4965
|
function Dc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richTextControls: s, translator: c }) {
|
|
4946
|
-
let { t: l } = c, u = n ? r.
|
|
4966
|
+
let { t: l } = c, u = n ? r.answers.optionIds : [], d = t.config.renderer === "table", f = Di(r, t.config.optionLabelStyle);
|
|
4947
4967
|
function p(e) {
|
|
4948
|
-
i(k(k({}, e), {}, {
|
|
4968
|
+
i(k(k({}, e), {}, { answers: n ? e.answers : { optionIds: [] } }));
|
|
4949
4969
|
}
|
|
4950
4970
|
function m(e, t) {
|
|
4951
|
-
p(
|
|
4971
|
+
p(ca(r, e, t));
|
|
4952
4972
|
}
|
|
4953
4973
|
function h(e, t, n) {
|
|
4954
|
-
p(
|
|
4974
|
+
p(ha(r, e, t, n));
|
|
4955
4975
|
}
|
|
4956
4976
|
function g(e, t) {
|
|
4957
|
-
p(
|
|
4977
|
+
p(ga(r, e, t));
|
|
4958
4978
|
}
|
|
4959
4979
|
function _(e) {
|
|
4960
|
-
p(k(k({}, r), {}, {
|
|
4980
|
+
p(k(k({}, r), {}, { answers: { optionIds: ua(u, e, t.config.selectionType) } }));
|
|
4961
4981
|
}
|
|
4962
4982
|
function v(t, n, r, i) {
|
|
4963
4983
|
let a = u.includes(t);
|
|
@@ -5005,7 +5025,7 @@ function Dc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
5005
5025
|
danger: !0,
|
|
5006
5026
|
disabled: e || r.options.length <= 1,
|
|
5007
5027
|
icon: "\u00d7",
|
|
5008
|
-
onClick: () => p(
|
|
5028
|
+
onClick: () => p(la(r, n)),
|
|
5009
5029
|
size: "small"
|
|
5010
5030
|
})
|
|
5011
5031
|
]
|
|
@@ -5015,7 +5035,7 @@ function Dc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
5015
5035
|
"aria-label": l("questionContentEditor.actions.addOption"),
|
|
5016
5036
|
disabled: e,
|
|
5017
5037
|
icon: "+",
|
|
5018
|
-
onClick: () => p(
|
|
5038
|
+
onClick: () => p(sa(r)),
|
|
5019
5039
|
children: l("questionContentEditor.actions.addOption")
|
|
5020
5040
|
})]
|
|
5021
5041
|
});
|
|
@@ -5044,14 +5064,14 @@ function Dc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
5044
5064
|
"aria-label": l("questionContentEditor.actions.addTableColumn"),
|
|
5045
5065
|
disabled: e,
|
|
5046
5066
|
icon: "+",
|
|
5047
|
-
onClick: () => p(
|
|
5067
|
+
onClick: () => p(da(r)),
|
|
5048
5068
|
size: "small",
|
|
5049
5069
|
children: l("questionContentEditor.actions.addTableColumn")
|
|
5050
5070
|
}), /* @__PURE__ */ a(F, {
|
|
5051
5071
|
"aria-label": l("questionContentEditor.actions.addTableRow"),
|
|
5052
5072
|
disabled: e,
|
|
5053
5073
|
icon: "+",
|
|
5054
|
-
onClick: () => p(
|
|
5074
|
+
onClick: () => p(pa(r)),
|
|
5055
5075
|
size: "small",
|
|
5056
5076
|
children: l("questionContentEditor.actions.addTableRow")
|
|
5057
5077
|
})]
|
|
@@ -5090,7 +5110,7 @@ function Dc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
5090
5110
|
"aria-label": l("questionContentEditor.actions.deleteTableColumn"),
|
|
5091
5111
|
danger: !0,
|
|
5092
5112
|
disabled: e || r.columns.length <= 1,
|
|
5093
|
-
onClick: () => p(
|
|
5113
|
+
onClick: () => p(fa(r, n)),
|
|
5094
5114
|
children: l("questionContentEditor.actions.deleteTableColumn")
|
|
5095
5115
|
})]
|
|
5096
5116
|
}),
|
|
@@ -5103,7 +5123,7 @@ function Dc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
5103
5123
|
"aria-label": l("questionContentEditor.actions.deleteTableRow"),
|
|
5104
5124
|
danger: !0,
|
|
5105
5125
|
disabled: e || r.options.length <= 1,
|
|
5106
|
-
onClick: () => p(
|
|
5126
|
+
onClick: () => p(ma(r, n.view.optionIndex)),
|
|
5107
5127
|
size: "small",
|
|
5108
5128
|
children: l("questionContentEditor.actions.deleteTableRow")
|
|
5109
5129
|
}),
|
|
@@ -5160,12 +5180,12 @@ function Dc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
5160
5180
|
//#endregion
|
|
5161
5181
|
//#region src/question/content-editor/QuestionContentOrderingEditor.tsx
|
|
5162
5182
|
function Oc({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls: i, translator: s }) {
|
|
5163
|
-
let { t: c } = s, l =
|
|
5183
|
+
let { t: c } = s, l = Ga(n, t), u = new Map(l.sortOptions.map((e) => [e.id, e]));
|
|
5164
5184
|
function d(e) {
|
|
5165
|
-
r(
|
|
5185
|
+
r(Ga(e, t));
|
|
5166
5186
|
}
|
|
5167
5187
|
function f(e, n) {
|
|
5168
|
-
d(
|
|
5188
|
+
d(Ja(l, e, n, t));
|
|
5169
5189
|
}
|
|
5170
5190
|
return /* @__PURE__ */ o("div", {
|
|
5171
5191
|
className: "flex min-w-0 flex-col gap-3",
|
|
@@ -5194,7 +5214,7 @@ function Oc({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
5194
5214
|
danger: !0,
|
|
5195
5215
|
disabled: e || l.sortOptions.length <= 1,
|
|
5196
5216
|
icon: "\u00d7",
|
|
5197
|
-
onClick: () => d(
|
|
5217
|
+
onClick: () => d(qa(l, n.id, t)),
|
|
5198
5218
|
size: "small"
|
|
5199
5219
|
})
|
|
5200
5220
|
]
|
|
@@ -5204,7 +5224,7 @@ function Oc({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
5204
5224
|
"aria-label": c("questionContentEditor.ordering.addOption"),
|
|
5205
5225
|
disabled: e,
|
|
5206
5226
|
icon: "+",
|
|
5207
|
-
onClick: () => d(
|
|
5227
|
+
onClick: () => d(Ka(l, t)),
|
|
5208
5228
|
children: c("questionContentEditor.ordering.addOption")
|
|
5209
5229
|
}),
|
|
5210
5230
|
t ? /* @__PURE__ */ o("section", {
|
|
@@ -5212,7 +5232,7 @@ function Oc({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
5212
5232
|
children: [/* @__PURE__ */ a(I.Text, {
|
|
5213
5233
|
strong: !0,
|
|
5214
5234
|
children: c("questionContentEditor.ordering.answerTitle")
|
|
5215
|
-
}), l.
|
|
5235
|
+
}), l.answers.map((n, r) => {
|
|
5216
5236
|
let i = u.get(n);
|
|
5217
5237
|
return i ? /* @__PURE__ */ o("div", {
|
|
5218
5238
|
className: "grid min-w-0 grid-cols-[2rem_minmax(0,1fr)_auto] items-center gap-2 rounded-md border border-slate-200 bg-white p-2",
|
|
@@ -5229,13 +5249,13 @@ function Oc({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
5229
5249
|
"aria-label": c("questionContentEditor.ordering.moveUp", { index: r + 1 }),
|
|
5230
5250
|
disabled: e || r === 0,
|
|
5231
5251
|
icon: "\u2191",
|
|
5232
|
-
onClick: () => d(
|
|
5252
|
+
onClick: () => d(Ya(l, n, -1, t)),
|
|
5233
5253
|
size: "small"
|
|
5234
5254
|
}), /* @__PURE__ */ a(F, {
|
|
5235
5255
|
"aria-label": c("questionContentEditor.ordering.moveDown", { index: r + 1 }),
|
|
5236
|
-
disabled: e || r === l.
|
|
5256
|
+
disabled: e || r === l.answers.length - 1,
|
|
5237
5257
|
icon: "\u2193",
|
|
5238
|
-
onClick: () => d(
|
|
5258
|
+
onClick: () => d(Ya(l, n, 1, t)),
|
|
5239
5259
|
size: "small"
|
|
5240
5260
|
})]
|
|
5241
5261
|
})
|
|
@@ -5273,7 +5293,7 @@ var Ac = {
|
|
|
5273
5293
|
function jc({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls: i, translator: s }) {
|
|
5274
5294
|
let c = p(null), { t: l } = s, u = Vt(n.content.json);
|
|
5275
5295
|
function d(e) {
|
|
5276
|
-
r(
|
|
5296
|
+
r(Ri(e, e.content, t));
|
|
5277
5297
|
}
|
|
5278
5298
|
function f() {
|
|
5279
5299
|
var e;
|
|
@@ -5284,8 +5304,8 @@ function jc({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
5284
5304
|
});
|
|
5285
5305
|
}
|
|
5286
5306
|
function m(e, t) {
|
|
5287
|
-
let r = t ? [...n.
|
|
5288
|
-
d(k(k({}, n), {}, {
|
|
5307
|
+
let r = t ? [...n.answers, e] : n.answers.filter((t) => t !== e);
|
|
5308
|
+
d(k(k({}, n), {}, { answers: r }));
|
|
5289
5309
|
}
|
|
5290
5310
|
return /* @__PURE__ */ o("div", {
|
|
5291
5311
|
className: Ac.stack,
|
|
@@ -5308,7 +5328,7 @@ function jc({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
5308
5328
|
disabled: e,
|
|
5309
5329
|
editorRef: c,
|
|
5310
5330
|
label: l("questionContentEditor.fields.textMarkerContent"),
|
|
5311
|
-
onChange: (e) => d(k(k({}, n), {}, { content:
|
|
5331
|
+
onChange: (e) => d(k(k({}, n), {}, { content: _i(e.text, e.json) })),
|
|
5312
5332
|
placeholder: l("questionContentEditor.placeholders.textMarkerContent"),
|
|
5313
5333
|
value: n.content
|
|
5314
5334
|
}),
|
|
@@ -5329,7 +5349,7 @@ function jc({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
5329
5349
|
className: Ac["answer-toggle"],
|
|
5330
5350
|
children: [/* @__PURE__ */ a("input", {
|
|
5331
5351
|
"aria-label": l("questionContentEditor.textMarker.answerAria", { marker: r.text }),
|
|
5332
|
-
checked: n.
|
|
5352
|
+
checked: n.answers.includes(r.markerId),
|
|
5333
5353
|
disabled: e || !t,
|
|
5334
5354
|
onChange: (e) => m(r.markerId, e.target.checked),
|
|
5335
5355
|
type: "checkbox"
|
|
@@ -5352,13 +5372,13 @@ var H = {
|
|
|
5352
5372
|
//#endregion
|
|
5353
5373
|
//#region src/question/content-editor/QuestionContentWordBuilderEditor.tsx
|
|
5354
5374
|
function Mc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richTextControls: s, title: c, translator: l }) {
|
|
5355
|
-
let { t: u } = l, d = p(null), f =
|
|
5375
|
+
let { t: u } = l, d = p(null), f = zi(r, n, t);
|
|
5356
5376
|
function m(e) {
|
|
5357
|
-
i(
|
|
5377
|
+
i(zi(e, n, t));
|
|
5358
5378
|
}
|
|
5359
5379
|
function h() {
|
|
5360
5380
|
var e;
|
|
5361
|
-
let t =
|
|
5381
|
+
let t = Fi(f.blanks);
|
|
5362
5382
|
(e = d.current) == null || e.insertNode("blank", {
|
|
5363
5383
|
blankId: t,
|
|
5364
5384
|
label: u("questionContentEditor.blank.shortLabel", { index: f.blanks.length + 1 })
|
|
@@ -5374,7 +5394,7 @@ function Mc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
5374
5394
|
m(k(k({}, f), {}, { candidateOptions: f.candidateOptions.filter((t, n) => n !== e) }));
|
|
5375
5395
|
}
|
|
5376
5396
|
function y(e, t) {
|
|
5377
|
-
m(k(k({}, f), {}, {
|
|
5397
|
+
m(k(k({}, f), {}, { answers: k(k({}, f.answers), {}, { [e]: t.target.value }) }));
|
|
5378
5398
|
}
|
|
5379
5399
|
return /* @__PURE__ */ o("div", {
|
|
5380
5400
|
className: H.root,
|
|
@@ -5398,7 +5418,7 @@ function Mc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
5398
5418
|
disabled: e,
|
|
5399
5419
|
editorRef: d,
|
|
5400
5420
|
label: u("questionContentEditor.fields.wordBuilderContent"),
|
|
5401
|
-
onChange: (e) => i(
|
|
5421
|
+
onChange: (e) => i(Li(f, e, n, t)),
|
|
5402
5422
|
placeholder: u("questionContentEditor.placeholders.wordBuilderContent"),
|
|
5403
5423
|
value: f.content
|
|
5404
5424
|
}),
|
|
@@ -5454,7 +5474,7 @@ function Mc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
5454
5474
|
disabled: e,
|
|
5455
5475
|
onChange: (e) => y(t, e),
|
|
5456
5476
|
placeholder: u("questionContentEditor.placeholders.blankAnswer"),
|
|
5457
|
-
value: (r = f.
|
|
5477
|
+
value: (r = f.answers[t]) == null ? "" : r
|
|
5458
5478
|
})
|
|
5459
5479
|
}, t);
|
|
5460
5480
|
})
|
|
@@ -5592,13 +5612,13 @@ function Fc(e, t, n) {
|
|
|
5592
5612
|
});
|
|
5593
5613
|
}
|
|
5594
5614
|
function Ic(e, t) {
|
|
5595
|
-
let n =
|
|
5596
|
-
return t ? n : k(k({}, n), {}, {
|
|
5615
|
+
let n = $i(e);
|
|
5616
|
+
return t ? n : k(k({}, n), {}, { answers: [] });
|
|
5597
5617
|
}
|
|
5598
5618
|
//#endregion
|
|
5599
5619
|
//#region src/question/content-editor/subquestion-group-editor-helpers.ts
|
|
5600
5620
|
function Lc(e, t) {
|
|
5601
|
-
return
|
|
5621
|
+
return hi(zc(e.structure, t), e.questionTypeKey);
|
|
5602
5622
|
}
|
|
5603
5623
|
function Rc(e) {
|
|
5604
5624
|
return e;
|
|
@@ -5659,10 +5679,10 @@ function Hc(e) {
|
|
|
5659
5679
|
function Uc({ child: e, disabled: t, onChange: n, richTextControls: r, structure: i, translator: s }) {
|
|
5660
5680
|
let { t: c } = s;
|
|
5661
5681
|
function l(t) {
|
|
5662
|
-
n(k(k({}, e),
|
|
5682
|
+
n(k(k({}, e), Mi(e, t)));
|
|
5663
5683
|
}
|
|
5664
5684
|
function u(t) {
|
|
5665
|
-
n(k(k({}, e),
|
|
5685
|
+
n(k(k({}, e), Ni(e, t)));
|
|
5666
5686
|
}
|
|
5667
5687
|
return i.elements.length === 0 && i.extras.length === 0 ? /* @__PURE__ */ a(Is, { description: c("questionContentEditor.subquestion.emptyTemplate") }) : /* @__PURE__ */ o("div", {
|
|
5668
5688
|
className: "flex min-w-0 flex-col",
|
|
@@ -5672,14 +5692,14 @@ function Uc({ child: e, disabled: t, onChange: n, richTextControls: r, structure
|
|
|
5672
5692
|
disabled: t,
|
|
5673
5693
|
element: n,
|
|
5674
5694
|
hasAnswer: i.hasAnswer,
|
|
5675
|
-
item:
|
|
5695
|
+
item: xi(e, n, i.hasAnswer),
|
|
5676
5696
|
onChange: l,
|
|
5677
5697
|
richTextControls: r,
|
|
5678
5698
|
title: n.name || c(`questionContentEditor.elementType.${n.type}`),
|
|
5679
5699
|
translator: s
|
|
5680
5700
|
})
|
|
5681
5701
|
}, n.elementKey)), i.extras.map((n) => {
|
|
5682
|
-
let o =
|
|
5702
|
+
let o = Si(e, n);
|
|
5683
5703
|
return /* @__PURE__ */ a("section", {
|
|
5684
5704
|
className: "flex min-w-0 flex-col gap-3 border-t border-slate-100 py-3 first:border-t-0 first:pt-0 last:pb-0",
|
|
5685
5705
|
children: /* @__PURE__ */ a(Nc, {
|
|
@@ -5726,7 +5746,7 @@ function qc(e, t) {
|
|
|
5726
5746
|
//#endregion
|
|
5727
5747
|
//#region src/question/content-editor/QuestionContentSubquestionChildEditor.tsx
|
|
5728
5748
|
function Jc({ child: e, childIndex: t, disabled: n, hasAnswer: r, numberPath: i, onChange: s, onDelete: c, onMove: l, richTextControls: u, siblingCount: d, subquestionTemplates: f, translator: p }) {
|
|
5729
|
-
let { t: m } = p, h = i == null ? [t] : i, g = Hc(h), _ = Yc(e, f), v = Xc(_, r), y =
|
|
5749
|
+
let { t: m } = p, h = i == null ? [t] : i, g = Hc(h), _ = Yc(e, f), v = Xc(_, r), y = mi(v), b = k(k(k({}, e), ji(v, e)), {}, { children: e.children });
|
|
5730
5750
|
function x(e) {
|
|
5731
5751
|
s(k(k({}, b), {}, { children: [...b.children, e] }));
|
|
5732
5752
|
}
|
|
@@ -5916,17 +5936,17 @@ function el({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
5916
5936
|
//#region src/question/content-editor/QuestionContentEditor.tsx
|
|
5917
5937
|
function tl({ disabled: t = !1, locale: n = "zh-CN", onChange: r, structure: i, subquestionTemplates: s = [], uploadImage: c, value: l }) {
|
|
5918
5938
|
let u = ws(n), { t: d } = u, p = f(() => ({
|
|
5919
|
-
plugins: [
|
|
5939
|
+
plugins: [ni, ys],
|
|
5920
5940
|
uploadImage: c
|
|
5921
5941
|
}), [c]);
|
|
5922
5942
|
function m(e) {
|
|
5923
|
-
r(
|
|
5943
|
+
r(Mi(l, e));
|
|
5924
5944
|
}
|
|
5925
5945
|
function h(e) {
|
|
5926
|
-
r(
|
|
5946
|
+
r(Ni(l, e));
|
|
5927
5947
|
}
|
|
5928
5948
|
function g(e) {
|
|
5929
|
-
let n =
|
|
5949
|
+
let n = xi(l, e, i.hasAnswer);
|
|
5930
5950
|
return /* @__PURE__ */ a(Nc, {
|
|
5931
5951
|
disabled: t,
|
|
5932
5952
|
element: e,
|
|
@@ -5939,7 +5959,7 @@ function tl({ disabled: t = !1, locale: n = "zh-CN", onChange: r, structure: i,
|
|
|
5939
5959
|
});
|
|
5940
5960
|
}
|
|
5941
5961
|
function _(e) {
|
|
5942
|
-
let n =
|
|
5962
|
+
let n = Si(l, e);
|
|
5943
5963
|
return /* @__PURE__ */ a(Nc, {
|
|
5944
5964
|
disabled: t,
|
|
5945
5965
|
element: nl(e),
|
|
@@ -5955,7 +5975,7 @@ function tl({ disabled: t = !1, locale: n = "zh-CN", onChange: r, structure: i,
|
|
|
5955
5975
|
translator: u
|
|
5956
5976
|
});
|
|
5957
5977
|
}
|
|
5958
|
-
let v =
|
|
5978
|
+
let v = mi(i) ? /* @__PURE__ */ a(el, {
|
|
5959
5979
|
disabled: t,
|
|
5960
5980
|
hasAnswer: i.hasAnswer,
|
|
5961
5981
|
item: k(k({}, l), {}, { elements: [] }),
|
|
@@ -6011,7 +6031,7 @@ function il(e, t) {
|
|
|
6011
6031
|
return {
|
|
6012
6032
|
elements: e.elements.map((e) => hl(e, t)),
|
|
6013
6033
|
extras: e.extras.map((e) => ({
|
|
6014
|
-
extraKey: e.
|
|
6034
|
+
extraKey: e.extraKey,
|
|
6015
6035
|
name: _l(e, Jr(e.type), Yr(e.type), t),
|
|
6016
6036
|
type: e.type
|
|
6017
6037
|
})),
|
|
@@ -6020,7 +6040,7 @@ function il(e, t) {
|
|
|
6020
6040
|
};
|
|
6021
6041
|
}
|
|
6022
6042
|
function al(e, t, n) {
|
|
6023
|
-
return !e || !t ? null : k(k({},
|
|
6043
|
+
return !e || !t ? null : k(k({}, ji(t, cl(e))), {}, { children: e.children.map((e) => {
|
|
6024
6044
|
let t = qc(n, e.questionTypeKey);
|
|
6025
6045
|
return t ? al(e, t.structure, n) : null;
|
|
6026
6046
|
}).filter((e) => !!e) });
|
|
@@ -6051,13 +6071,13 @@ function cl(e) {
|
|
|
6051
6071
|
function ll(e, t) {
|
|
6052
6072
|
return e.some((e, n) => {
|
|
6053
6073
|
let r = t.slice(n, n + 1)[0];
|
|
6054
|
-
return !r || e.clientId !== r.clientId || e.type !== r.type || JSON.stringify(e.config) !== JSON.stringify(r.config);
|
|
6074
|
+
return !r || e.clientId !== r.clientId || e.elementKey !== r.elementKey || e.type !== r.type || JSON.stringify(e.config) !== JSON.stringify(r.config);
|
|
6055
6075
|
});
|
|
6056
6076
|
}
|
|
6057
6077
|
function ul(e, t) {
|
|
6058
6078
|
return e.some((e, n) => {
|
|
6059
6079
|
let r = t.slice(n, n + 1)[0];
|
|
6060
|
-
return !r || e.clientId !== r.clientId || e.type !== r.type;
|
|
6080
|
+
return !r || e.clientId !== r.clientId || e.extraKey !== r.extraKey || e.type !== r.type;
|
|
6061
6081
|
});
|
|
6062
6082
|
}
|
|
6063
6083
|
function dl(e) {
|
|
@@ -6067,36 +6087,42 @@ function fl(e) {
|
|
|
6067
6087
|
switch (e.type) {
|
|
6068
6088
|
case "inlineFill": return {
|
|
6069
6089
|
config: k({}, e.config),
|
|
6090
|
+
elementKey: e.elementKey,
|
|
6070
6091
|
enName: e.enName,
|
|
6071
6092
|
name: e.name,
|
|
6072
6093
|
type: "inlineFill"
|
|
6073
6094
|
};
|
|
6074
6095
|
case "wordBuilder": return {
|
|
6075
6096
|
config: k({}, e.config),
|
|
6097
|
+
elementKey: e.elementKey,
|
|
6076
6098
|
enName: e.enName,
|
|
6077
6099
|
name: e.name,
|
|
6078
6100
|
type: "wordBuilder"
|
|
6079
6101
|
};
|
|
6080
6102
|
case "judgement": return {
|
|
6081
6103
|
config: k({}, e.config),
|
|
6104
|
+
elementKey: e.elementKey,
|
|
6082
6105
|
enName: e.enName,
|
|
6083
6106
|
name: e.name,
|
|
6084
6107
|
type: "judgement"
|
|
6085
6108
|
};
|
|
6086
6109
|
case "choice": return {
|
|
6087
6110
|
config: k({}, e.config),
|
|
6111
|
+
elementKey: e.elementKey,
|
|
6088
6112
|
enName: e.enName,
|
|
6089
6113
|
name: e.name,
|
|
6090
6114
|
type: "choice"
|
|
6091
6115
|
};
|
|
6092
6116
|
case "lineConnect": return {
|
|
6093
6117
|
config: k({}, e.config),
|
|
6118
|
+
elementKey: e.elementKey,
|
|
6094
6119
|
enName: e.enName,
|
|
6095
6120
|
name: e.name,
|
|
6096
6121
|
type: "lineConnect"
|
|
6097
6122
|
};
|
|
6098
6123
|
case "matching": return {
|
|
6099
6124
|
config: k({}, e.config),
|
|
6125
|
+
elementKey: e.elementKey,
|
|
6100
6126
|
enName: e.enName,
|
|
6101
6127
|
name: e.name,
|
|
6102
6128
|
type: "matching"
|
|
@@ -6106,6 +6132,7 @@ function fl(e) {
|
|
|
6106
6132
|
function pl(e) {
|
|
6107
6133
|
return {
|
|
6108
6134
|
config: {},
|
|
6135
|
+
elementKey: e.elementKey,
|
|
6109
6136
|
enName: e.enName,
|
|
6110
6137
|
name: e.name,
|
|
6111
6138
|
type: e.type
|
|
@@ -6114,6 +6141,7 @@ function pl(e) {
|
|
|
6114
6141
|
function ml(e) {
|
|
6115
6142
|
return {
|
|
6116
6143
|
enName: e.enName,
|
|
6144
|
+
extraKey: e.extraKey,
|
|
6117
6145
|
name: e.name,
|
|
6118
6146
|
type: e.type
|
|
6119
6147
|
};
|
|
@@ -6121,7 +6149,7 @@ function ml(e) {
|
|
|
6121
6149
|
function hl(e, t) {
|
|
6122
6150
|
return e.type === "fill" || e.type === "classification" || e.type === "ordering" || e.type === "richText" || e.type === "textMarker" ? {
|
|
6123
6151
|
config: {},
|
|
6124
|
-
elementKey: e.
|
|
6152
|
+
elementKey: e.elementKey,
|
|
6125
6153
|
name: _l(e, A(e.type), j(e.type), t),
|
|
6126
6154
|
type: e.type
|
|
6127
6155
|
} : gl(e, t);
|
|
@@ -6133,19 +6161,19 @@ function gl(e, t) {
|
|
|
6133
6161
|
allowCandidateReuse: !!e.config.allowCandidateReuse,
|
|
6134
6162
|
candidateMode: e.config.candidateMode
|
|
6135
6163
|
},
|
|
6136
|
-
elementKey: e.
|
|
6164
|
+
elementKey: e.elementKey,
|
|
6137
6165
|
name: _l(e, A("inlineFill"), j("inlineFill"), t),
|
|
6138
6166
|
type: "inlineFill"
|
|
6139
6167
|
};
|
|
6140
6168
|
case "wordBuilder": return {
|
|
6141
6169
|
config: { builderMode: e.config.builderMode },
|
|
6142
|
-
elementKey: e.
|
|
6170
|
+
elementKey: e.elementKey,
|
|
6143
6171
|
name: _l(e, A("wordBuilder"), j("wordBuilder"), t),
|
|
6144
6172
|
type: "wordBuilder"
|
|
6145
6173
|
};
|
|
6146
6174
|
case "judgement": return {
|
|
6147
6175
|
config: { judgeAnswerMode: e.config.judgeAnswerMode },
|
|
6148
|
-
elementKey: e.
|
|
6176
|
+
elementKey: e.elementKey,
|
|
6149
6177
|
name: _l(e, A("judgement"), j("judgement"), t),
|
|
6150
6178
|
type: "judgement"
|
|
6151
6179
|
};
|
|
@@ -6155,19 +6183,19 @@ function gl(e, t) {
|
|
|
6155
6183
|
renderer: e.config.renderer,
|
|
6156
6184
|
selectionType: e.config.selectionType
|
|
6157
6185
|
},
|
|
6158
|
-
elementKey: e.
|
|
6186
|
+
elementKey: e.elementKey,
|
|
6159
6187
|
name: _l(e, A("choice"), j("choice"), t),
|
|
6160
6188
|
type: "choice"
|
|
6161
6189
|
};
|
|
6162
6190
|
case "lineConnect": return {
|
|
6163
6191
|
config: { columns: e.config.columns.map((e) => k({}, e)) },
|
|
6164
|
-
elementKey: e.
|
|
6192
|
+
elementKey: e.elementKey,
|
|
6165
6193
|
name: _l(e, A("lineConnect"), j("lineConnect"), t),
|
|
6166
6194
|
type: "lineConnect"
|
|
6167
6195
|
};
|
|
6168
6196
|
case "matching": return {
|
|
6169
6197
|
config: { columns: e.config.columns.map((e) => k({}, e)) },
|
|
6170
|
-
elementKey: e.
|
|
6198
|
+
elementKey: e.elementKey,
|
|
6171
6199
|
name: _l(e, A("matching"), j("matching"), t),
|
|
6172
6200
|
type: "matching"
|
|
6173
6201
|
};
|
|
@@ -6184,13 +6212,13 @@ function _l(e, t, n, r) {
|
|
|
6184
6212
|
//#endregion
|
|
6185
6213
|
//#region src/question/player/helpers.ts
|
|
6186
6214
|
function vl(e, t, n = []) {
|
|
6187
|
-
let r =
|
|
6215
|
+
let r = mi(t);
|
|
6188
6216
|
return {
|
|
6189
6217
|
questionTypeKey: e.questionTypeKey,
|
|
6190
6218
|
children: e.children.map((e) => Rl(e, n)),
|
|
6191
6219
|
id: e.id,
|
|
6192
6220
|
items: r ? [] : t.elements.reduce((n, r) => {
|
|
6193
|
-
let i = zl(r,
|
|
6221
|
+
let i = zl(r, xi(e, r, t.hasAnswer));
|
|
6194
6222
|
return i ? [...n, i] : n;
|
|
6195
6223
|
}, []),
|
|
6196
6224
|
version: e.version
|
|
@@ -6302,7 +6330,7 @@ function Fl(e, t, n) {
|
|
|
6302
6330
|
return ke(e, t, n);
|
|
6303
6331
|
}
|
|
6304
6332
|
function Il(e, t, n, r) {
|
|
6305
|
-
return
|
|
6333
|
+
return Xa(e, t.sortOptions, n, r);
|
|
6306
6334
|
}
|
|
6307
6335
|
function Ll(e, t) {
|
|
6308
6336
|
return e.includes(t) ? e.filter((e) => e !== t) : [...e, t];
|
|
@@ -6430,7 +6458,7 @@ var tu = {
|
|
|
6430
6458
|
addOption: "Add option",
|
|
6431
6459
|
addSubquestion: "Add subquestion",
|
|
6432
6460
|
addTableColumn: "Add column",
|
|
6433
|
-
|
|
6461
|
+
answers: "Answer",
|
|
6434
6462
|
answerGroup: "Answer group",
|
|
6435
6463
|
answerSettings: "Answer settings",
|
|
6436
6464
|
blankAnswer: "Single answer",
|
|
@@ -6453,11 +6481,11 @@ var tu = {
|
|
|
6453
6481
|
explanation: "Explanation",
|
|
6454
6482
|
falseLabel: "False",
|
|
6455
6483
|
inspector: "Inspector",
|
|
6456
|
-
|
|
6484
|
+
judgeAnswerMode: "Judgement mode",
|
|
6457
6485
|
multipleChoice: "Multiple choice",
|
|
6458
6486
|
noCandidates: "None",
|
|
6459
6487
|
option: "Option",
|
|
6460
|
-
|
|
6488
|
+
perBlankOptions: "Option groups",
|
|
6461
6489
|
optionLabelStyle: "Labels",
|
|
6462
6490
|
questionArrangement: "Type arrangement",
|
|
6463
6491
|
questionContent: "Question content",
|
|
@@ -6494,7 +6522,7 @@ var tu = {
|
|
|
6494
6522
|
addOption: "\u6dfb\u52a0\u9009\u9879",
|
|
6495
6523
|
addSubquestion: "\u6dfb\u52a0\u5b50\u9898",
|
|
6496
6524
|
addTableColumn: "\u6dfb\u52a0\u5217",
|
|
6497
|
-
|
|
6525
|
+
answers: "\u7b54\u6848",
|
|
6498
6526
|
answerGroup: "\u7b54\u6848\u7ec4",
|
|
6499
6527
|
answerSettings: "\u7b54\u6848\u8bbe\u7f6e",
|
|
6500
6528
|
blankAnswer: "\u5355\u72ec\u7b54\u6848",
|
|
@@ -6517,11 +6545,11 @@ var tu = {
|
|
|
6517
6545
|
explanation: "\u89e3\u6790",
|
|
6518
6546
|
falseLabel: "\u9519\u8bef",
|
|
6519
6547
|
inspector: "\u7ed3\u6784\u8bbe\u7f6e",
|
|
6520
|
-
|
|
6548
|
+
judgeAnswerMode: "\u5224\u65ad\u6a21\u5f0f",
|
|
6521
6549
|
multipleChoice: "\u591a\u9009",
|
|
6522
6550
|
noCandidates: "\u4e0d\u4f7f\u7528",
|
|
6523
6551
|
option: "\u9009\u9879",
|
|
6524
|
-
|
|
6552
|
+
perBlankOptions: "\u9009\u9879\u7ec4",
|
|
6525
6553
|
optionLabelStyle: "\u9009\u9879\u6807\u53f7",
|
|
6526
6554
|
questionArrangement: "\u9898\u578b\u7f16\u6392",
|
|
6527
6555
|
questionContent: "\u9898\u76ee\u5185\u5bb9",
|
|
@@ -6559,45 +6587,45 @@ function nu(e = "zh-CN") {
|
|
|
6559
6587
|
}
|
|
6560
6588
|
//#endregion
|
|
6561
6589
|
//#region src/question/renderers/helpers.ts
|
|
6562
|
-
function
|
|
6590
|
+
function ru(...e) {
|
|
6563
6591
|
return e.filter(Boolean).join(" ");
|
|
6564
6592
|
}
|
|
6565
|
-
function
|
|
6593
|
+
function iu(e, t, n) {
|
|
6566
6594
|
return e.map((e) => t.indexOf(e) + 1).filter((e) => e > 0).map((e) => `${n}${e}`).join(" ");
|
|
6567
6595
|
}
|
|
6568
|
-
function
|
|
6596
|
+
function au(e) {
|
|
6569
6597
|
return "answerPools" in e;
|
|
6570
6598
|
}
|
|
6571
|
-
function
|
|
6599
|
+
function ou(e) {
|
|
6572
6600
|
return "answerOptionId" in e;
|
|
6573
6601
|
}
|
|
6574
|
-
function
|
|
6602
|
+
function su(e) {
|
|
6575
6603
|
return "answerOptionIds" in e;
|
|
6576
6604
|
}
|
|
6577
|
-
function
|
|
6605
|
+
function cu(e, t) {
|
|
6578
6606
|
var n, r;
|
|
6579
6607
|
return (n = e == null || (r = e.find((e) => e.optionId === t)) == null ? void 0 : r.content) == null ? null : n;
|
|
6580
6608
|
}
|
|
6581
|
-
function
|
|
6609
|
+
function lu(e, t, n) {
|
|
6582
6610
|
var r, i;
|
|
6583
6611
|
return (r = e == null || (i = e.find((e) => e.blankId === t)) == null || (i = i.options.find((e) => e.optionId === n)) == null ? void 0 : i.content) == null ? null : r;
|
|
6584
6612
|
}
|
|
6585
|
-
function
|
|
6586
|
-
return e.
|
|
6587
|
-
if (
|
|
6613
|
+
function uu(e) {
|
|
6614
|
+
return e.answers.reduce((t, n) => {
|
|
6615
|
+
if (au(n)) return du(t, {
|
|
6588
6616
|
blankIds: n.blankIds,
|
|
6589
6617
|
contents: n.answerPools
|
|
6590
6618
|
});
|
|
6591
|
-
if (
|
|
6592
|
-
let r =
|
|
6593
|
-
return
|
|
6619
|
+
if (ou(n)) {
|
|
6620
|
+
let r = lu(e.blankOptionGroups, n.blankId, n.answerOptionId);
|
|
6621
|
+
return du(t, {
|
|
6594
6622
|
blankIds: [n.blankId],
|
|
6595
6623
|
contents: r ? [r] : []
|
|
6596
6624
|
});
|
|
6597
6625
|
}
|
|
6598
|
-
if (
|
|
6599
|
-
let r = n.answerOptionIds.map((t) =>
|
|
6600
|
-
return
|
|
6626
|
+
if (su(n)) {
|
|
6627
|
+
let r = n.answerOptionIds.map((t) => cu(e.candidateOptions, t)).filter((e) => !!e);
|
|
6628
|
+
return du(t, {
|
|
6601
6629
|
blankIds: n.blankIds,
|
|
6602
6630
|
contents: r
|
|
6603
6631
|
});
|
|
@@ -6605,14 +6633,14 @@ function lu(e) {
|
|
|
6605
6633
|
return t;
|
|
6606
6634
|
}, []);
|
|
6607
6635
|
}
|
|
6608
|
-
function
|
|
6636
|
+
function du(e, t) {
|
|
6609
6637
|
let n = t.contents.filter((e) => e.text.trim() !== "");
|
|
6610
6638
|
return n.length > 0 ? [...e, {
|
|
6611
6639
|
blankIds: t.blankIds,
|
|
6612
6640
|
contents: n
|
|
6613
6641
|
}] : e;
|
|
6614
6642
|
}
|
|
6615
|
-
var
|
|
6643
|
+
var U = {
|
|
6616
6644
|
root: "_root_16zbu_1",
|
|
6617
6645
|
"element-list": "_element-list_16zbu_20",
|
|
6618
6646
|
children: "_children_16zbu_21",
|
|
@@ -6629,32 +6657,32 @@ var W = {
|
|
|
6629
6657
|
};
|
|
6630
6658
|
//#endregion
|
|
6631
6659
|
//#region src/question/player/QuestionPlayerComposite.tsx
|
|
6632
|
-
function
|
|
6660
|
+
function fu({ messages: e, numberPath: t = [], onChildResponseChange: n, renderChild: r, response: i, subquestionTemplates: s, value: c }) {
|
|
6633
6661
|
return c.children.length === 0 ? /* @__PURE__ */ a("div", {
|
|
6634
|
-
className:
|
|
6662
|
+
className: U.empty,
|
|
6635
6663
|
children: e.previewEmpty
|
|
6636
6664
|
}) : /* @__PURE__ */ a("div", {
|
|
6637
|
-
className:
|
|
6665
|
+
className: U.children,
|
|
6638
6666
|
children: c.children.map((c, l) => {
|
|
6639
6667
|
let u = [...t, l], d = qc(s, c.questionTypeKey), f = i.children.slice(l, l + 1)[0];
|
|
6640
6668
|
return /* @__PURE__ */ o("section", {
|
|
6641
|
-
className:
|
|
6669
|
+
className: U.child,
|
|
6642
6670
|
children: [/* @__PURE__ */ o("div", {
|
|
6643
|
-
className:
|
|
6671
|
+
className: U["child-title"],
|
|
6644
6672
|
children: [
|
|
6645
6673
|
e.subquestion,
|
|
6646
6674
|
" ",
|
|
6647
6675
|
Hc(u)
|
|
6648
6676
|
]
|
|
6649
6677
|
}), d && f ? r(c, f, d.structure, (e) => n(l, e), u) : /* @__PURE__ */ a("div", {
|
|
6650
|
-
className:
|
|
6678
|
+
className: U.empty,
|
|
6651
6679
|
children: e.missingSubquestionTemplate
|
|
6652
6680
|
})]
|
|
6653
6681
|
}, c.id || l);
|
|
6654
6682
|
})
|
|
6655
6683
|
});
|
|
6656
6684
|
}
|
|
6657
|
-
var
|
|
6685
|
+
var W = {
|
|
6658
6686
|
"rich-content": "_rich-content_aqc4q_1",
|
|
6659
6687
|
element: "_element_aqc4q_52",
|
|
6660
6688
|
"option-list": "_option-list_aqc4q_54",
|
|
@@ -6671,16 +6699,16 @@ var G = {
|
|
|
6671
6699
|
};
|
|
6672
6700
|
//#endregion
|
|
6673
6701
|
//#region src/question/renderers/QuestionRichContentView.tsx
|
|
6674
|
-
function
|
|
6675
|
-
let n = t.html || r(
|
|
6702
|
+
function G({ className: e, content: t }) {
|
|
6703
|
+
let n = t.html || r(bi(t), { plugins: [ni] });
|
|
6676
6704
|
return /* @__PURE__ */ a("div", {
|
|
6677
|
-
className: e ? `${
|
|
6705
|
+
className: e ? `${W["rich-content"]} ${e}` : W["rich-content"],
|
|
6678
6706
|
dangerouslySetInnerHTML: { __html: n }
|
|
6679
6707
|
});
|
|
6680
6708
|
}
|
|
6681
6709
|
//#endregion
|
|
6682
6710
|
//#region src/question/renderers/QuestionStandardAnswerPanel.module.css
|
|
6683
|
-
var
|
|
6711
|
+
var pu = {
|
|
6684
6712
|
"answer-panel": "_answer-panel_1a0m0_1",
|
|
6685
6713
|
"answer-title": "_answer-title_1a0m0_12",
|
|
6686
6714
|
"answer-list": "_answer-list_1a0m0_30",
|
|
@@ -6691,25 +6719,25 @@ var fu = {
|
|
|
6691
6719
|
};
|
|
6692
6720
|
//#endregion
|
|
6693
6721
|
//#region src/question/renderers/QuestionStandardAnswerPanel.tsx
|
|
6694
|
-
function
|
|
6722
|
+
function K({ groups: e, title: t }) {
|
|
6695
6723
|
let n = e.filter((e) => e.contents.length > 0);
|
|
6696
6724
|
return n.length === 0 ? null : /* @__PURE__ */ o("section", {
|
|
6697
6725
|
"aria-label": t,
|
|
6698
|
-
className:
|
|
6726
|
+
className: pu["answer-panel"],
|
|
6699
6727
|
children: [/* @__PURE__ */ a("span", {
|
|
6700
|
-
className:
|
|
6728
|
+
className: pu["answer-title"],
|
|
6701
6729
|
children: t
|
|
6702
6730
|
}), /* @__PURE__ */ a("ol", {
|
|
6703
|
-
className:
|
|
6731
|
+
className: pu["answer-list"],
|
|
6704
6732
|
children: n.map((e, t) => /* @__PURE__ */ o("li", {
|
|
6705
|
-
className:
|
|
6733
|
+
className: pu["answer-row"],
|
|
6706
6734
|
children: [e.marker ? /* @__PURE__ */ a("span", {
|
|
6707
|
-
className:
|
|
6735
|
+
className: pu["answer-marker"],
|
|
6708
6736
|
children: e.marker
|
|
6709
6737
|
}) : null, /* @__PURE__ */ a("div", {
|
|
6710
|
-
className:
|
|
6738
|
+
className: pu["answer-content-list"],
|
|
6711
6739
|
children: e.contents.map((e, t) => /* @__PURE__ */ a("div", {
|
|
6712
|
-
className:
|
|
6740
|
+
className: pu["answer-value"],
|
|
6713
6741
|
children: e
|
|
6714
6742
|
}, `answer-${t}`))
|
|
6715
6743
|
})]
|
|
@@ -6719,53 +6747,53 @@ function q({ groups: e, title: t }) {
|
|
|
6719
6747
|
}
|
|
6720
6748
|
//#endregion
|
|
6721
6749
|
//#region src/question/player/QuestionBlankGroupPlayer.tsx
|
|
6722
|
-
function
|
|
6723
|
-
let c = bl(i, t.elementKey, t.blanks), l =
|
|
6724
|
-
contents: e.answerPools.map((e, t) => /* @__PURE__ */ a(
|
|
6725
|
-
marker:
|
|
6750
|
+
function mu({ disabled: e, item: t, messages: n, onChange: r, response: i, showAnswer: s }) {
|
|
6751
|
+
let c = bl(i, t.elementKey, t.blanks), l = ta(t.answers, t.blanks).map((e, r) => ({
|
|
6752
|
+
contents: e.answerPools.map((e, t) => /* @__PURE__ */ a(G, { content: e }, `group-${r}-answer-${t}`)),
|
|
6753
|
+
marker: iu(e.blankIds, t.blanks, n.blankLabel)
|
|
6726
6754
|
}));
|
|
6727
6755
|
function u(e, t) {
|
|
6728
6756
|
r(k(k({}, c), {}, { answers: k(k({}, c.answers), {}, { [e]: t }) }));
|
|
6729
6757
|
}
|
|
6730
6758
|
return /* @__PURE__ */ o("div", {
|
|
6731
|
-
className:
|
|
6759
|
+
className: U["control-list"],
|
|
6732
6760
|
children: [t.blanks.map((t, r) => /* @__PURE__ */ o("label", {
|
|
6733
|
-
className:
|
|
6761
|
+
className: U.field,
|
|
6734
6762
|
children: [/* @__PURE__ */ o("span", {
|
|
6735
|
-
className:
|
|
6763
|
+
className: U["field-label"],
|
|
6736
6764
|
children: [
|
|
6737
6765
|
n.blankLabel,
|
|
6738
6766
|
" ",
|
|
6739
6767
|
r + 1
|
|
6740
6768
|
]
|
|
6741
6769
|
}), /* @__PURE__ */ a("input", {
|
|
6742
|
-
className:
|
|
6770
|
+
className: U.input,
|
|
6743
6771
|
disabled: e,
|
|
6744
6772
|
onChange: (e) => u(t, e.target.value),
|
|
6745
|
-
value:
|
|
6773
|
+
value: gu(c.answers, t)
|
|
6746
6774
|
})]
|
|
6747
|
-
},
|
|
6775
|
+
}, hu(t, r))), s ? /* @__PURE__ */ a(K, {
|
|
6748
6776
|
groups: l,
|
|
6749
6777
|
title: n.standardAnswer
|
|
6750
6778
|
}) : null]
|
|
6751
6779
|
});
|
|
6752
6780
|
}
|
|
6753
|
-
function
|
|
6781
|
+
function hu(e, t) {
|
|
6754
6782
|
return e || `blank-${t + 1}`;
|
|
6755
6783
|
}
|
|
6756
|
-
function
|
|
6784
|
+
function gu(e, t) {
|
|
6757
6785
|
var n, r;
|
|
6758
6786
|
return (n = (r = Object.entries(e).find(([e]) => e === t)) == null ? void 0 : r[1]) == null ? "" : n;
|
|
6759
6787
|
}
|
|
6760
6788
|
//#endregion
|
|
6761
6789
|
//#region src/question/renderers/classificationAnswers.tsx
|
|
6762
|
-
function
|
|
6790
|
+
function _u(e) {
|
|
6763
6791
|
return e.categories.map((t) => ({
|
|
6764
|
-
contents: e.items.filter((n) => e.
|
|
6792
|
+
contents: e.items.filter((n) => e.answers[n.id] === t.id).map((e) => /* @__PURE__ */ a(G, { content: e.content }, `${t.id}-${e.id}`)),
|
|
6765
6793
|
marker: t.content.text || t.id
|
|
6766
6794
|
}));
|
|
6767
6795
|
}
|
|
6768
|
-
var
|
|
6796
|
+
var q = {
|
|
6769
6797
|
board: "_board_1f76b_1",
|
|
6770
6798
|
pool: "_pool_1f76b_6",
|
|
6771
6799
|
zones: "_zones_1f76b_13",
|
|
@@ -6780,10 +6808,10 @@ var J = {
|
|
|
6780
6808
|
};
|
|
6781
6809
|
//#endregion
|
|
6782
6810
|
//#region src/question/player/QuestionClassificationPlayer.tsx
|
|
6783
|
-
function
|
|
6784
|
-
let [c, l] = m(""), u = wl(i, t.elementKey), d =
|
|
6811
|
+
function vu({ disabled: e, item: t, messages: n, onChange: r, response: i, showAnswer: s }) {
|
|
6812
|
+
let [c, l] = m(""), u = wl(i, t.elementKey), d = bu(u.placements, t), f = t.items.find((e) => e.id === c);
|
|
6785
6813
|
function p(e, n) {
|
|
6786
|
-
r(k(k({}, u), {}, { placements:
|
|
6814
|
+
r(k(k({}, u), {}, { placements: bu(Fl(d, e, n), t) })), l("");
|
|
6787
6815
|
}
|
|
6788
6816
|
function h(t, n) {
|
|
6789
6817
|
t.preventDefault();
|
|
@@ -6791,10 +6819,10 @@ function _u({ disabled: e, item: t, messages: n, onChange: r, response: i, showA
|
|
|
6791
6819
|
!e && r && p(r, n);
|
|
6792
6820
|
}
|
|
6793
6821
|
function g(n) {
|
|
6794
|
-
let r = c === n.id, i =
|
|
6822
|
+
let r = c === n.id, i = yu(n.id, d, t, s);
|
|
6795
6823
|
return /* @__PURE__ */ a("button", {
|
|
6796
6824
|
"aria-pressed": r,
|
|
6797
|
-
className:
|
|
6825
|
+
className: ru(q.item, r && q.selected, i === "correct" && q.correct, i === "incorrect" && q.incorrect, i === "unanswered" && q.unanswered),
|
|
6798
6826
|
"data-status": i,
|
|
6799
6827
|
"data-testid": `classification-player-item-${n.id}`,
|
|
6800
6828
|
disabled: e,
|
|
@@ -6806,97 +6834,97 @@ function _u({ disabled: e, item: t, messages: n, onChange: r, response: i, showA
|
|
|
6806
6834
|
e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("question/classification-item", n.id);
|
|
6807
6835
|
},
|
|
6808
6836
|
type: "button",
|
|
6809
|
-
children: /* @__PURE__ */ a(
|
|
6837
|
+
children: /* @__PURE__ */ a(G, { content: n.content })
|
|
6810
6838
|
}, n.id);
|
|
6811
6839
|
}
|
|
6812
6840
|
return /* @__PURE__ */ o("div", {
|
|
6813
|
-
className:
|
|
6841
|
+
className: W.element,
|
|
6814
6842
|
children: [/* @__PURE__ */ o("div", {
|
|
6815
|
-
className:
|
|
6843
|
+
className: q.board,
|
|
6816
6844
|
children: [/* @__PURE__ */ a("div", {
|
|
6817
|
-
className:
|
|
6845
|
+
className: q.zones,
|
|
6818
6846
|
"data-testid": "classification-zones",
|
|
6819
6847
|
children: t.categories.map((e) => {
|
|
6820
6848
|
let r = t.items.filter((t) => d[t.id] === e.id);
|
|
6821
6849
|
return /* @__PURE__ */ o("section", {
|
|
6822
|
-
className:
|
|
6850
|
+
className: q.zone,
|
|
6823
6851
|
onClick: () => f ? p(f.id, e.id) : void 0,
|
|
6824
6852
|
onDragOver: (e) => e.preventDefault(),
|
|
6825
6853
|
onDrop: (t) => h(t, e.id),
|
|
6826
6854
|
children: [/* @__PURE__ */ a("div", {
|
|
6827
|
-
className:
|
|
6828
|
-
children: /* @__PURE__ */ a(
|
|
6855
|
+
className: q["zone-title"],
|
|
6856
|
+
children: /* @__PURE__ */ a(G, { content: e.content })
|
|
6829
6857
|
}), r.length > 0 ? r.map((e) => g(e)) : /* @__PURE__ */ a("span", {
|
|
6830
|
-
className:
|
|
6858
|
+
className: q.empty,
|
|
6831
6859
|
children: n.unassigned
|
|
6832
6860
|
})]
|
|
6833
6861
|
}, e.id);
|
|
6834
6862
|
})
|
|
6835
6863
|
}), /* @__PURE__ */ a("section", {
|
|
6836
|
-
className:
|
|
6864
|
+
className: q.pool,
|
|
6837
6865
|
"data-testid": "classification-pool",
|
|
6838
6866
|
onClick: () => f ? p(f.id, "") : void 0,
|
|
6839
6867
|
onDragOver: (e) => e.preventDefault(),
|
|
6840
6868
|
onDrop: (e) => h(e, ""),
|
|
6841
6869
|
children: t.items.filter((e) => !d[e.id]).map((e) => g(e))
|
|
6842
6870
|
})]
|
|
6843
|
-
}), s ? /* @__PURE__ */ a(
|
|
6844
|
-
groups:
|
|
6871
|
+
}), s ? /* @__PURE__ */ a(K, {
|
|
6872
|
+
groups: _u(t),
|
|
6845
6873
|
title: n.standardAnswer
|
|
6846
6874
|
}) : null]
|
|
6847
6875
|
});
|
|
6848
6876
|
}
|
|
6849
|
-
function
|
|
6877
|
+
function yu(e, t, n, r) {
|
|
6850
6878
|
var i, a;
|
|
6851
|
-
let o = (i = t[e]) == null ? "" : i, s = (a = n.
|
|
6879
|
+
let o = (i = t[e]) == null ? "" : i, s = (a = n.answers[e]) == null ? "" : a;
|
|
6852
6880
|
if (!(!r || !s)) return o ? s === o ? "correct" : "incorrect" : "unanswered";
|
|
6853
6881
|
}
|
|
6854
|
-
function
|
|
6882
|
+
function bu(e, t) {
|
|
6855
6883
|
return Oe(e, t.categories, t.items);
|
|
6856
6884
|
}
|
|
6857
6885
|
//#endregion
|
|
6858
6886
|
//#region src/question/renderers/QuestionRichContentWithBlankView.tsx
|
|
6859
|
-
function
|
|
6887
|
+
function xu({ className: e, content: t, renderBlank: n }) {
|
|
6860
6888
|
let r = /* @__PURE__ */ new Map();
|
|
6861
6889
|
return /* @__PURE__ */ a("div", {
|
|
6862
|
-
className: [
|
|
6863
|
-
children: t.json.map((e, t) =>
|
|
6890
|
+
className: [W["rich-content"], e == null ? "" : e].filter(Boolean).join(" "),
|
|
6891
|
+
children: t.json.map((e, t) => Su(e, {
|
|
6864
6892
|
blankIndexes: r,
|
|
6865
6893
|
key: `node-${t}`,
|
|
6866
6894
|
renderBlank: n
|
|
6867
6895
|
}))
|
|
6868
6896
|
});
|
|
6869
6897
|
}
|
|
6870
|
-
function
|
|
6898
|
+
function Su(e, t) {
|
|
6871
6899
|
if (typeof e.text == "string") return /* @__PURE__ */ a(s, { children: e.text }, t.key);
|
|
6872
|
-
if (e.type === "blank") return /* @__PURE__ */ a(s, { children:
|
|
6873
|
-
let n =
|
|
6900
|
+
if (e.type === "blank") return /* @__PURE__ */ a(s, { children: Cu(e, t) }, t.key);
|
|
6901
|
+
let n = Tu(e.children, t);
|
|
6874
6902
|
switch (e.type) {
|
|
6875
|
-
case "heading": return
|
|
6903
|
+
case "heading": return Eu(e, n, t.key);
|
|
6876
6904
|
case "table": return /* @__PURE__ */ a("table", { children: n }, t.key);
|
|
6877
6905
|
case "table-row": return /* @__PURE__ */ a("tr", { children: n }, t.key);
|
|
6878
6906
|
case "table-cell": return /* @__PURE__ */ a("td", { children: n }, t.key);
|
|
6879
6907
|
default: return /* @__PURE__ */ a("p", { children: n }, t.key);
|
|
6880
6908
|
}
|
|
6881
6909
|
}
|
|
6882
|
-
function
|
|
6883
|
-
let n =
|
|
6910
|
+
function Cu(e, t) {
|
|
6911
|
+
let n = Du(e.blankId), r = wu(t.blankIndexes, n);
|
|
6884
6912
|
return t.renderBlank({
|
|
6885
6913
|
blankId: n,
|
|
6886
6914
|
index: r,
|
|
6887
|
-
label:
|
|
6915
|
+
label: Du(e.label)
|
|
6888
6916
|
});
|
|
6889
6917
|
}
|
|
6890
|
-
function
|
|
6918
|
+
function wu(e, t) {
|
|
6891
6919
|
let n = e.get(t);
|
|
6892
6920
|
if (n !== void 0) return n;
|
|
6893
6921
|
let r = e.size;
|
|
6894
6922
|
return e.set(t, r), r;
|
|
6895
6923
|
}
|
|
6896
|
-
function
|
|
6897
|
-
return (e == null ? [] : e).map((e, n) =>
|
|
6924
|
+
function Tu(e, t) {
|
|
6925
|
+
return (e == null ? [] : e).map((e, n) => Su(e, k(k({}, t), {}, { key: `${t.key}-${n}` })));
|
|
6898
6926
|
}
|
|
6899
|
-
function
|
|
6927
|
+
function Eu(e, t, n) {
|
|
6900
6928
|
switch (e.level) {
|
|
6901
6929
|
case 1: return /* @__PURE__ */ a("h1", { children: t }, n);
|
|
6902
6930
|
case 2: return /* @__PURE__ */ a("h2", { children: t }, n);
|
|
@@ -6904,10 +6932,10 @@ function Tu(e, t, n) {
|
|
|
6904
6932
|
default: return /* @__PURE__ */ a("p", { children: t }, n);
|
|
6905
6933
|
}
|
|
6906
6934
|
}
|
|
6907
|
-
function
|
|
6935
|
+
function Du(e) {
|
|
6908
6936
|
return typeof e == "string" ? e : "";
|
|
6909
6937
|
}
|
|
6910
|
-
var
|
|
6938
|
+
var J = {
|
|
6911
6939
|
"inline-input": "_inline-input_2je8q_1",
|
|
6912
6940
|
"inline-select": "_inline-select_2je8q_19",
|
|
6913
6941
|
"inline-blank-underline": "_inline-blank-underline_2je8q_43",
|
|
@@ -6925,10 +6953,10 @@ var Y = {
|
|
|
6925
6953
|
};
|
|
6926
6954
|
//#endregion
|
|
6927
6955
|
//#region src/question/player/QuestionFillTextContentPlayer.tsx
|
|
6928
|
-
function
|
|
6929
|
-
return /* @__PURE__ */ a(
|
|
6956
|
+
function Ou({ answers: e, disabled: t, item: n, messages: r, onAnswerChange: i, structure: o }) {
|
|
6957
|
+
return /* @__PURE__ */ a(xu, {
|
|
6930
6958
|
content: n.content,
|
|
6931
|
-
renderBlank: (a) =>
|
|
6959
|
+
renderBlank: (a) => ku(a, {
|
|
6932
6960
|
answers: e,
|
|
6933
6961
|
blankLabel: r.blankLabel,
|
|
6934
6962
|
disabled: t,
|
|
@@ -6938,13 +6966,13 @@ function Du({ answers: e, disabled: t, item: n, messages: r, onAnswerChange: i,
|
|
|
6938
6966
|
})
|
|
6939
6967
|
});
|
|
6940
6968
|
}
|
|
6941
|
-
function
|
|
6942
|
-
let { blankId: n } = e, r = t.item.blanks.indexOf(n), i =
|
|
6969
|
+
function ku(e, t) {
|
|
6970
|
+
let { blankId: n } = e, r = t.item.blanks.indexOf(n), i = Fu(e.label, t.blankLabel, r);
|
|
6943
6971
|
if (t.structure.config.candidateMode === "none") {
|
|
6944
|
-
let e =
|
|
6972
|
+
let e = ju(t.answers, n);
|
|
6945
6973
|
return /* @__PURE__ */ a("input", {
|
|
6946
6974
|
"aria-label": i,
|
|
6947
|
-
className:
|
|
6975
|
+
className: J["inline-input"],
|
|
6948
6976
|
disabled: t.disabled,
|
|
6949
6977
|
onChange: (e) => t.onAnswerChange(n, {
|
|
6950
6978
|
kind: "text",
|
|
@@ -6953,23 +6981,23 @@ function Ou(e, t) {
|
|
|
6953
6981
|
value: (e == null ? void 0 : e.kind) === "text" ? e.value : ""
|
|
6954
6982
|
});
|
|
6955
6983
|
}
|
|
6956
|
-
if (t.structure.config.candidateMode === "sharedPool") return
|
|
6957
|
-
let o =
|
|
6984
|
+
if (t.structure.config.candidateMode === "sharedPool") return Au(n, i, t);
|
|
6985
|
+
let o = ju(t.answers, n), s = Nu(t.item, n, t.structure.config.candidateMode, o);
|
|
6958
6986
|
return /* @__PURE__ */ a("span", {
|
|
6959
6987
|
"aria-label": i,
|
|
6960
|
-
className:
|
|
6961
|
-
children: s ? /* @__PURE__ */ a(
|
|
6962
|
-
className:
|
|
6988
|
+
className: J["inline-blank-underline"],
|
|
6989
|
+
children: s ? /* @__PURE__ */ a(G, {
|
|
6990
|
+
className: J["inline-blank-content"],
|
|
6963
6991
|
content: s.content
|
|
6964
6992
|
}) : i
|
|
6965
6993
|
});
|
|
6966
6994
|
}
|
|
6967
|
-
function
|
|
6995
|
+
function Au(e, t, n) {
|
|
6968
6996
|
var r, i;
|
|
6969
|
-
let s =
|
|
6997
|
+
let s = ju(n.answers, e), c = (r = ((s == null ? void 0 : s.kind) === "option" ? s.optionIds : []).slice(0, 1)[0]) == null ? "" : r, l = Pu(n.answers, e);
|
|
6970
6998
|
return /* @__PURE__ */ o("select", {
|
|
6971
6999
|
"aria-label": t,
|
|
6972
|
-
className:
|
|
7000
|
+
className: J["inline-select"],
|
|
6973
7001
|
disabled: n.disabled,
|
|
6974
7002
|
onChange: (t) => n.onAnswerChange(e, {
|
|
6975
7003
|
kind: "option",
|
|
@@ -6986,11 +7014,11 @@ function ku(e, t, n) {
|
|
|
6986
7014
|
}, e.optionId))]
|
|
6987
7015
|
});
|
|
6988
7016
|
}
|
|
6989
|
-
function
|
|
7017
|
+
function ju(e, t) {
|
|
6990
7018
|
var n;
|
|
6991
7019
|
return (n = Object.entries(e).find(([e]) => e === t)) == null ? void 0 : n[1];
|
|
6992
7020
|
}
|
|
6993
|
-
function
|
|
7021
|
+
function Mu(e, t, n) {
|
|
6994
7022
|
var r, i;
|
|
6995
7023
|
if (n === "sharedPool") {
|
|
6996
7024
|
var a;
|
|
@@ -6998,32 +7026,32 @@ function ju(e, t, n) {
|
|
|
6998
7026
|
}
|
|
6999
7027
|
return (r = (i = e.blankOptionGroups) == null || (i = i.find((e) => e.blankId === t)) == null ? void 0 : i.options) == null ? [] : r;
|
|
7000
7028
|
}
|
|
7001
|
-
function
|
|
7029
|
+
function Nu(e, t, n, r) {
|
|
7002
7030
|
let i = (r == null ? void 0 : r.kind) === "option" ? r.optionIds[0] : void 0;
|
|
7003
|
-
if (i) return
|
|
7031
|
+
if (i) return Mu(e, t, n).find((e) => e.optionId === i);
|
|
7004
7032
|
}
|
|
7005
|
-
function
|
|
7033
|
+
function Pu(e, t) {
|
|
7006
7034
|
let n = /* @__PURE__ */ new Set(), r = Object.entries(e);
|
|
7007
7035
|
for (let [e, i] of r) if (e !== t && i.kind === "option") for (let e of i.optionIds) n.add(e);
|
|
7008
7036
|
return n;
|
|
7009
7037
|
}
|
|
7010
|
-
function
|
|
7038
|
+
function Fu(e, t, n) {
|
|
7011
7039
|
return e || `${t} ${n + 1}`;
|
|
7012
7040
|
}
|
|
7013
7041
|
//#endregion
|
|
7014
7042
|
//#region src/question/player/QuestionFillTextPlayer.tsx
|
|
7015
|
-
function
|
|
7016
|
-
let l =
|
|
7017
|
-
contents: e.contents.map((e, n) => /* @__PURE__ */ a(
|
|
7018
|
-
marker:
|
|
7043
|
+
function Iu({ disabled: e, element: t, item: n, messages: r, onChange: i, response: s, showAnswer: c }) {
|
|
7044
|
+
let l = Bi(n, t, !0), u = uu(l), d = xl(s, t, l.blanks), f = u.map((e, t) => ({
|
|
7045
|
+
contents: e.contents.map((e, n) => /* @__PURE__ */ a(G, { content: e }, `group-${t}-answer-${n}`)),
|
|
7046
|
+
marker: iu(e.blankIds, l.blanks, r.blankLabel)
|
|
7019
7047
|
}));
|
|
7020
7048
|
function p(e, t) {
|
|
7021
7049
|
i(k(k({}, d), {}, { answers: k(k({}, d.answers), {}, { [e]: t }) }));
|
|
7022
7050
|
}
|
|
7023
7051
|
return /* @__PURE__ */ o("div", {
|
|
7024
|
-
className:
|
|
7052
|
+
className: U["fill-text"],
|
|
7025
7053
|
children: [
|
|
7026
|
-
/* @__PURE__ */ a(
|
|
7054
|
+
/* @__PURE__ */ a(Ou, {
|
|
7027
7055
|
answers: d.answers,
|
|
7028
7056
|
disabled: e,
|
|
7029
7057
|
item: l,
|
|
@@ -7031,41 +7059,41 @@ function Fu({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7031
7059
|
onAnswerChange: p,
|
|
7032
7060
|
structure: t
|
|
7033
7061
|
}),
|
|
7034
|
-
|
|
7035
|
-
|
|
7062
|
+
Lu(l, t.config.candidateMode, r.candidateOptions),
|
|
7063
|
+
Ru({
|
|
7036
7064
|
disabled: e,
|
|
7037
7065
|
item: l,
|
|
7038
7066
|
onAnswerChange: p,
|
|
7039
7067
|
responseItem: d
|
|
7040
7068
|
}),
|
|
7041
|
-
c ? /* @__PURE__ */ a(
|
|
7069
|
+
c ? /* @__PURE__ */ a(K, {
|
|
7042
7070
|
groups: f,
|
|
7043
7071
|
title: r.standardAnswer
|
|
7044
7072
|
}) : null
|
|
7045
7073
|
]
|
|
7046
7074
|
});
|
|
7047
7075
|
}
|
|
7048
|
-
function
|
|
7076
|
+
function Lu(e, t, n) {
|
|
7049
7077
|
var r;
|
|
7050
7078
|
let i = (r = e.candidateOptions) == null ? [] : r;
|
|
7051
7079
|
return t !== "sharedPool" || i.length === 0 ? null : /* @__PURE__ */ o("div", {
|
|
7052
|
-
className:
|
|
7080
|
+
className: J["shared-candidate-section"],
|
|
7053
7081
|
children: [/* @__PURE__ */ a("span", {
|
|
7054
|
-
className:
|
|
7082
|
+
className: J["shared-candidate-title"],
|
|
7055
7083
|
children: n
|
|
7056
7084
|
}), /* @__PURE__ */ a("ol", {
|
|
7057
|
-
className:
|
|
7085
|
+
className: J["shared-candidate-list"],
|
|
7058
7086
|
children: i.map((e) => /* @__PURE__ */ a("li", {
|
|
7059
|
-
className:
|
|
7060
|
-
children: /* @__PURE__ */ a(
|
|
7061
|
-
className:
|
|
7087
|
+
className: J["shared-candidate-item"],
|
|
7088
|
+
children: /* @__PURE__ */ a(G, {
|
|
7089
|
+
className: J["shared-candidate-content"],
|
|
7062
7090
|
content: e.content
|
|
7063
7091
|
})
|
|
7064
7092
|
}, e.optionId))
|
|
7065
7093
|
})]
|
|
7066
7094
|
});
|
|
7067
7095
|
}
|
|
7068
|
-
function
|
|
7096
|
+
function Ru({ disabled: e, item: t, onAnswerChange: n, responseItem: r }) {
|
|
7069
7097
|
let i = t.blanks.reduce((e, n, r) => {
|
|
7070
7098
|
var i;
|
|
7071
7099
|
let a = (i = t.blankOptionGroups) == null ? void 0 : i.find((e) => e.blankId === n);
|
|
@@ -7075,8 +7103,8 @@ function Lu({ disabled: e, item: t, onAnswerChange: n, responseItem: r }) {
|
|
|
7075
7103
|
}] : e;
|
|
7076
7104
|
}, []);
|
|
7077
7105
|
return i.length === 0 ? null : /* @__PURE__ */ a("div", {
|
|
7078
|
-
className:
|
|
7079
|
-
children: i.map(({ group: t, marker: i }) =>
|
|
7106
|
+
className: J["per-blank-candidate-options"],
|
|
7107
|
+
children: i.map(({ group: t, marker: i }) => zu({
|
|
7080
7108
|
disabled: e,
|
|
7081
7109
|
group: t,
|
|
7082
7110
|
marker: i,
|
|
@@ -7085,17 +7113,17 @@ function Lu({ disabled: e, item: t, onAnswerChange: n, responseItem: r }) {
|
|
|
7085
7113
|
}))
|
|
7086
7114
|
});
|
|
7087
7115
|
}
|
|
7088
|
-
function
|
|
7116
|
+
function zu({ disabled: e, group: t, marker: n, onAnswerChange: r, responseItem: i }) {
|
|
7089
7117
|
let s = i.answers[t.blankId];
|
|
7090
7118
|
return /* @__PURE__ */ o("section", {
|
|
7091
7119
|
"aria-label": n,
|
|
7092
|
-
className:
|
|
7120
|
+
className: J["per-blank-candidate-group"],
|
|
7093
7121
|
children: [/* @__PURE__ */ a("span", {
|
|
7094
|
-
className:
|
|
7122
|
+
className: J["per-blank-candidate-title"],
|
|
7095
7123
|
children: n
|
|
7096
7124
|
}), /* @__PURE__ */ a("div", {
|
|
7097
|
-
className:
|
|
7098
|
-
children: t.options.map((n) =>
|
|
7125
|
+
className: J["per-blank-candidate-list"],
|
|
7126
|
+
children: t.options.map((n) => Bu({
|
|
7099
7127
|
activeAnswer: s,
|
|
7100
7128
|
blankId: t.blankId,
|
|
7101
7129
|
disabled: e,
|
|
@@ -7105,19 +7133,19 @@ function Ru({ disabled: e, group: t, marker: n, onAnswerChange: r, responseItem:
|
|
|
7105
7133
|
})]
|
|
7106
7134
|
}, t.blankId);
|
|
7107
7135
|
}
|
|
7108
|
-
function
|
|
7136
|
+
function Bu({ activeAnswer: e, blankId: t, disabled: n, onAnswerChange: r, option: i }) {
|
|
7109
7137
|
let o = (e == null ? void 0 : e.kind) === "option" && e.optionIds.includes(i.optionId);
|
|
7110
7138
|
return /* @__PURE__ */ a("button", {
|
|
7111
7139
|
"aria-pressed": o,
|
|
7112
|
-
className: o ?
|
|
7140
|
+
className: o ? J.selected : void 0,
|
|
7113
7141
|
"data-selected": o ? "true" : void 0,
|
|
7114
7142
|
disabled: n,
|
|
7115
7143
|
onClick: () => r(t, Ml(e, i.optionId, "single")),
|
|
7116
7144
|
type: "button",
|
|
7117
|
-
children: /* @__PURE__ */ a(
|
|
7145
|
+
children: /* @__PURE__ */ a(G, { content: i.content })
|
|
7118
7146
|
}, i.optionId);
|
|
7119
7147
|
}
|
|
7120
|
-
var
|
|
7148
|
+
var Y = {
|
|
7121
7149
|
"choice-button": "_choice-button_zwndo_1",
|
|
7122
7150
|
"table-row-button": "_table-row-button_zwndo_2",
|
|
7123
7151
|
"judgement-button": "_judgement-button_zwndo_26",
|
|
@@ -7133,26 +7161,26 @@ var X = {
|
|
|
7133
7161
|
};
|
|
7134
7162
|
//#endregion
|
|
7135
7163
|
//#region src/question/player/QuestionJudgementGroupPlayer.tsx
|
|
7136
|
-
function
|
|
7137
|
-
let l = Cl(s, t.elementKey), u =
|
|
7138
|
-
contents: n.
|
|
7164
|
+
function Vu({ disabled: e, element: t, item: n, messages: r, onChange: i, response: s, showAnswer: c }) {
|
|
7165
|
+
let l = Cl(s, t.elementKey), u = Ei(t.config.judgeAnswerMode), d = [{
|
|
7166
|
+
contents: n.answers.filter((e) => e.trim() !== ""),
|
|
7139
7167
|
marker: ""
|
|
7140
7168
|
}];
|
|
7141
7169
|
function f(e) {
|
|
7142
7170
|
i(k(k({}, l), {}, { selectedValues: l.selectedValues.includes(e) ? [] : [e] }));
|
|
7143
7171
|
}
|
|
7144
7172
|
return /* @__PURE__ */ o("div", {
|
|
7145
|
-
className:
|
|
7173
|
+
className: W.element,
|
|
7146
7174
|
children: [/* @__PURE__ */ a("ol", {
|
|
7147
|
-
className:
|
|
7175
|
+
className: ru(W["judgement-list"], Y["judgement-list"]),
|
|
7148
7176
|
children: u.map((t) => {
|
|
7149
7177
|
let n = l.selectedValues.includes(t);
|
|
7150
7178
|
return /* @__PURE__ */ a("li", {
|
|
7151
|
-
className:
|
|
7179
|
+
className: ru(W["judgement-item"], Y["judgement-option"], n && Y.selected),
|
|
7152
7180
|
"data-selected": n ? "true" : void 0,
|
|
7153
7181
|
children: /* @__PURE__ */ a("button", {
|
|
7154
7182
|
"aria-pressed": n,
|
|
7155
|
-
className:
|
|
7183
|
+
className: Y["judgement-button"],
|
|
7156
7184
|
disabled: e,
|
|
7157
7185
|
onClick: () => f(t),
|
|
7158
7186
|
type: "button",
|
|
@@ -7160,7 +7188,7 @@ function Bu({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7160
7188
|
})
|
|
7161
7189
|
}, t);
|
|
7162
7190
|
})
|
|
7163
|
-
}), c ? /* @__PURE__ */ a(
|
|
7191
|
+
}), c ? /* @__PURE__ */ a(K, {
|
|
7164
7192
|
groups: d,
|
|
7165
7193
|
title: r.standardAnswer
|
|
7166
7194
|
}) : null]
|
|
@@ -7168,23 +7196,23 @@ function Bu({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7168
7196
|
}
|
|
7169
7197
|
//#endregion
|
|
7170
7198
|
//#region src/question/renderers/lineConnectAnswers.tsx
|
|
7171
|
-
function
|
|
7172
|
-
let t =
|
|
7199
|
+
function Hu(e) {
|
|
7200
|
+
let t = Uu(e);
|
|
7173
7201
|
return e.columns.reduce((n, r, i) => {
|
|
7174
7202
|
let o = r.items.map((n, o) => {
|
|
7175
7203
|
var s;
|
|
7176
7204
|
return {
|
|
7177
|
-
contents: ((s = e.
|
|
7205
|
+
contents: ((s = e.answers[n.itemId]) == null ? [] : s).map((e) => {
|
|
7178
7206
|
let n = t.get(e);
|
|
7179
7207
|
return n && ze(i, n.columnIndex) ? n.item : void 0;
|
|
7180
|
-
}).filter((e) => !!e).map((e, t) => /* @__PURE__ */ a(
|
|
7181
|
-
marker:
|
|
7208
|
+
}).filter((e) => !!e).map((e, t) => /* @__PURE__ */ a(G, { content: e.content }, `${n.itemId}-${e.itemId}-${t}`)),
|
|
7209
|
+
marker: wi(r.labelStyle, o)
|
|
7182
7210
|
};
|
|
7183
7211
|
});
|
|
7184
7212
|
return [...n, ...o];
|
|
7185
7213
|
}, []);
|
|
7186
7214
|
}
|
|
7187
|
-
function
|
|
7215
|
+
function Uu(e) {
|
|
7188
7216
|
return e.columns.reduce((e, t, n) => (t.items.forEach((t) => e.set(t.itemId, {
|
|
7189
7217
|
columnIndex: n,
|
|
7190
7218
|
item: t
|
|
@@ -7192,7 +7220,7 @@ function Hu(e) {
|
|
|
7192
7220
|
}
|
|
7193
7221
|
//#endregion
|
|
7194
7222
|
//#region src/question/player/QuestionLineConnectPlayer.tsx
|
|
7195
|
-
function
|
|
7223
|
+
function Wu({ disabled: e, item: t, messages: n, onChange: r, response: i, showAnswer: s }) {
|
|
7196
7224
|
let [c, u] = m(null), [h, g] = m(null), _ = p(null), v = p(/* @__PURE__ */ new Map()), y = Tl(i, t.elementKey), b = { gridTemplateColumns: `repeat(${t.columns.length}, minmax(12rem, 1fr))` }, x = f(() => ic(t, y.connections), [t, y.connections]), S = f(() => JSON.stringify({
|
|
7197
7225
|
columns: t.columns.map((e) => e.items.map((e) => e.itemId)),
|
|
7198
7226
|
connections: y.connections
|
|
@@ -7253,7 +7281,7 @@ function Uu({ disabled: e, item: t, messages: n, onChange: r, response: i, showA
|
|
|
7253
7281
|
});
|
|
7254
7282
|
}
|
|
7255
7283
|
return /* @__PURE__ */ o("div", {
|
|
7256
|
-
className:
|
|
7284
|
+
className: W.element,
|
|
7257
7285
|
children: [/* @__PURE__ */ o("div", {
|
|
7258
7286
|
className: B.board,
|
|
7259
7287
|
"data-testid": "line-connect-player-board",
|
|
@@ -7287,9 +7315,9 @@ function Uu({ disabled: e, item: t, messages: n, onChange: r, response: i, showA
|
|
|
7287
7315
|
r + 1
|
|
7288
7316
|
]
|
|
7289
7317
|
}), t.items.map((n, i) => {
|
|
7290
|
-
let s =
|
|
7318
|
+
let s = wi(t.labelStyle, i), l = (c == null ? void 0 : c.itemId) === n.itemId;
|
|
7291
7319
|
return /* @__PURE__ */ a("div", {
|
|
7292
|
-
className:
|
|
7320
|
+
className: ru(B.item, l && B.selected),
|
|
7293
7321
|
"data-selected": l ? "true" : void 0,
|
|
7294
7322
|
"data-testid": `line-connect-player-item-${n.itemId}`,
|
|
7295
7323
|
ref: w(n.itemId),
|
|
@@ -7302,35 +7330,35 @@ function Uu({ disabled: e, item: t, messages: n, onChange: r, response: i, showA
|
|
|
7302
7330
|
children: [s ? /* @__PURE__ */ a("span", {
|
|
7303
7331
|
className: B.marker,
|
|
7304
7332
|
children: s
|
|
7305
|
-
}) : null, /* @__PURE__ */ a(
|
|
7333
|
+
}) : null, /* @__PURE__ */ a(G, { content: n.content })]
|
|
7306
7334
|
})
|
|
7307
7335
|
}, n.itemId);
|
|
7308
7336
|
})]
|
|
7309
7337
|
}, t.columnId))
|
|
7310
7338
|
})]
|
|
7311
|
-
}), s ? /* @__PURE__ */ a(
|
|
7312
|
-
groups:
|
|
7339
|
+
}), s ? /* @__PURE__ */ a(K, {
|
|
7340
|
+
groups: Hu(t),
|
|
7313
7341
|
title: n.standardAnswer
|
|
7314
7342
|
}) : null]
|
|
7315
7343
|
});
|
|
7316
7344
|
}
|
|
7317
7345
|
//#endregion
|
|
7318
7346
|
//#region src/question/renderers/matchingAnswers.tsx
|
|
7319
|
-
function
|
|
7347
|
+
function Gu(e) {
|
|
7320
7348
|
var t, n;
|
|
7321
7349
|
let r = e.columns[0], i = e.columns[1], o = new Map((t = i == null ? void 0 : i.items.map((e) => [e.itemId, e])) == null ? [] : t);
|
|
7322
7350
|
return ((n = r == null ? void 0 : r.items) == null ? [] : n).map((t, n) => {
|
|
7323
7351
|
var i, s;
|
|
7324
7352
|
return {
|
|
7325
|
-
contents: ((i = e.
|
|
7353
|
+
contents: ((i = e.answers[t.itemId]) == null ? [] : i).reduce((e, t) => {
|
|
7326
7354
|
let n = o.get(t);
|
|
7327
7355
|
return n ? [...e, n] : e;
|
|
7328
|
-
}, []).map((e, n) => /* @__PURE__ */ a(
|
|
7329
|
-
marker:
|
|
7356
|
+
}, []).map((e, n) => /* @__PURE__ */ a(G, { content: e.content }, `${t.itemId}-${e.itemId}-${n}`)),
|
|
7357
|
+
marker: Ti((s = r == null ? void 0 : r.labelStyle) == null ? "number" : s, n)
|
|
7330
7358
|
};
|
|
7331
7359
|
});
|
|
7332
7360
|
}
|
|
7333
|
-
var
|
|
7361
|
+
var Ku = {
|
|
7334
7362
|
board: "_board_1q6ar_1",
|
|
7335
7363
|
"matched-rows": "_matched-rows_1q6ar_6",
|
|
7336
7364
|
"matched-row": "_matched-row_1q6ar_6",
|
|
@@ -7343,8 +7371,8 @@ var Gu = {
|
|
|
7343
7371
|
};
|
|
7344
7372
|
//#endregion
|
|
7345
7373
|
//#region src/question/player/QuestionMatchingPlayer.tsx
|
|
7346
|
-
function
|
|
7347
|
-
let [c, l] = m(null), u = El(i, t.elementKey), d =
|
|
7374
|
+
function qu({ disabled: e, item: t, messages: n, onChange: r, response: i, showAnswer: s }) {
|
|
7375
|
+
let [c, l] = m(null), u = El(i, t.elementKey), d = Ju(t, u.connections);
|
|
7348
7376
|
function f(t, n) {
|
|
7349
7377
|
if (e) return;
|
|
7350
7378
|
let i = c ? pt(c, {
|
|
@@ -7364,50 +7392,50 @@ function Ku({ disabled: e, item: t, messages: n, onChange: r, response: i, showA
|
|
|
7364
7392
|
let r = (c == null ? void 0 : c.itemId) === t.item.itemId;
|
|
7365
7393
|
return /* @__PURE__ */ o("button", {
|
|
7366
7394
|
"aria-pressed": r,
|
|
7367
|
-
className:
|
|
7395
|
+
className: ru(Ku.item, r && Ku.selected, n && Ku.matched),
|
|
7368
7396
|
"data-testid": `matching-player-item-${t.item.itemId}`,
|
|
7369
7397
|
disabled: e,
|
|
7370
7398
|
onClick: () => f(t.columnIndex, t.item.itemId),
|
|
7371
7399
|
type: "button",
|
|
7372
7400
|
children: [t.marker ? /* @__PURE__ */ a("span", {
|
|
7373
|
-
className:
|
|
7401
|
+
className: Ku.marker,
|
|
7374
7402
|
children: t.marker
|
|
7375
|
-
}) : null, /* @__PURE__ */ a(
|
|
7403
|
+
}) : null, /* @__PURE__ */ a(G, { content: t.item.content })]
|
|
7376
7404
|
}, t.item.itemId);
|
|
7377
7405
|
}
|
|
7378
7406
|
return /* @__PURE__ */ o("div", {
|
|
7379
|
-
className:
|
|
7407
|
+
className: W.element,
|
|
7380
7408
|
children: [/* @__PURE__ */ o("div", {
|
|
7381
|
-
className:
|
|
7409
|
+
className: Ku.board,
|
|
7382
7410
|
children: [d.rows.length > 0 ? /* @__PURE__ */ a("div", {
|
|
7383
|
-
className:
|
|
7411
|
+
className: Ku["matched-rows"],
|
|
7384
7412
|
children: d.rows.map((e) => /* @__PURE__ */ o("div", {
|
|
7385
|
-
className:
|
|
7413
|
+
className: Ku["matched-row"],
|
|
7386
7414
|
"data-testid": `matching-player-row-${e.from.item.itemId}-${e.to.item.itemId}`,
|
|
7387
7415
|
children: [p(e.from, !0), p(e.to, !0)]
|
|
7388
7416
|
}, `${e.from.item.itemId}-${e.to.item.itemId}`))
|
|
7389
7417
|
}) : null, d.unmatchedColumns.some((e) => e.length > 0) ? /* @__PURE__ */ a("div", {
|
|
7390
|
-
className:
|
|
7418
|
+
className: Ku.columns,
|
|
7391
7419
|
children: d.unmatchedColumns.map((e, n) => {
|
|
7392
7420
|
var r, i;
|
|
7393
7421
|
return /* @__PURE__ */ a("section", {
|
|
7394
|
-
className:
|
|
7422
|
+
className: Ku.column,
|
|
7395
7423
|
children: e.map((e) => p(e, !1))
|
|
7396
7424
|
}, (r = (i = t.columns[n]) == null ? void 0 : i.columnId) == null ? n : r);
|
|
7397
7425
|
})
|
|
7398
7426
|
}) : null]
|
|
7399
|
-
}), s ? /* @__PURE__ */ a(
|
|
7400
|
-
groups:
|
|
7427
|
+
}), s ? /* @__PURE__ */ a(K, {
|
|
7428
|
+
groups: Gu(t),
|
|
7401
7429
|
title: n.standardAnswer
|
|
7402
7430
|
}) : null]
|
|
7403
7431
|
});
|
|
7404
7432
|
}
|
|
7405
|
-
function
|
|
7433
|
+
function Ju(e, t) {
|
|
7406
7434
|
var n;
|
|
7407
7435
|
let r = e.columns.map((e, t) => e.items.map((n, r) => ({
|
|
7408
7436
|
columnIndex: t,
|
|
7409
7437
|
item: n,
|
|
7410
|
-
marker:
|
|
7438
|
+
marker: Ti(e.labelStyle, r)
|
|
7411
7439
|
}))), i = r.reduce((e, t) => (t.forEach((t) => e.set(t.item.itemId, t)), e), /* @__PURE__ */ new Map()), a = /* @__PURE__ */ new Set(), o = ((n = r[0]) == null ? [] : n).reduce((e, n) => {
|
|
7412
7440
|
var r;
|
|
7413
7441
|
let o = (r = t[n.item.itemId]) == null ? void 0 : r[0], s = o ? i.get(o) : void 0;
|
|
@@ -7423,17 +7451,17 @@ function qu(e, t) {
|
|
|
7423
7451
|
}
|
|
7424
7452
|
//#endregion
|
|
7425
7453
|
//#region src/question/renderers/optionGroupAnswers.tsx
|
|
7426
|
-
function
|
|
7427
|
-
let n =
|
|
7454
|
+
function Yu(e, t) {
|
|
7455
|
+
let n = Oi(t, e.config.optionLabelStyle);
|
|
7428
7456
|
return e.config.renderer === "table" ? n.map((e) => ({
|
|
7429
|
-
contents: e.cells.map((t, n) => /* @__PURE__ */ a(
|
|
7457
|
+
contents: e.cells.map((t, n) => /* @__PURE__ */ a(G, { content: t }, `${e.optionId}-cell-${n}`)),
|
|
7430
7458
|
marker: e.marker
|
|
7431
7459
|
})) : n.map((e) => ({
|
|
7432
|
-
contents: [/* @__PURE__ */ a(
|
|
7460
|
+
contents: [/* @__PURE__ */ a(G, { content: e.standardContent }, `answer-${e.optionId}`)],
|
|
7433
7461
|
marker: e.marker
|
|
7434
7462
|
}));
|
|
7435
7463
|
}
|
|
7436
|
-
var
|
|
7464
|
+
var Xu = {
|
|
7437
7465
|
"table-wrap": "_table-wrap_n67ah_1",
|
|
7438
7466
|
table: "_table_n67ah_1",
|
|
7439
7467
|
"table-option-column": "_table-option-column_n67ah_17",
|
|
@@ -7441,81 +7469,81 @@ var Yu = {
|
|
|
7441
7469
|
};
|
|
7442
7470
|
//#endregion
|
|
7443
7471
|
//#region src/question/player/QuestionOptionGroupPlayer.tsx
|
|
7444
|
-
function
|
|
7445
|
-
let l = yl(s, t.elementKey), u =
|
|
7472
|
+
function Zu({ disabled: e, element: t, item: n, messages: r, onChange: i, response: s, showAnswer: c }) {
|
|
7473
|
+
let l = yl(s, t.elementKey), u = Di(n, t.config.optionLabelStyle);
|
|
7446
7474
|
function d(e) {
|
|
7447
7475
|
i(k(k({}, l), {}, { selectedOptionIds: jl(l.selectedOptionIds, e, t.config.selectionType) }));
|
|
7448
7476
|
}
|
|
7449
7477
|
if (t.config.renderer === "table") {
|
|
7450
|
-
let i =
|
|
7478
|
+
let i = Yu(t, n);
|
|
7451
7479
|
return /* @__PURE__ */ o("div", {
|
|
7452
|
-
className:
|
|
7480
|
+
className: W.element,
|
|
7453
7481
|
children: [/* @__PURE__ */ a("div", {
|
|
7454
|
-
className:
|
|
7482
|
+
className: Xu["table-wrap"],
|
|
7455
7483
|
children: /* @__PURE__ */ o("table", {
|
|
7456
|
-
className:
|
|
7484
|
+
className: Xu.table,
|
|
7457
7485
|
children: [
|
|
7458
|
-
/* @__PURE__ */ o("colgroup", { children: [/* @__PURE__ */ a("col", { className:
|
|
7459
|
-
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ o("tr", { children: [/* @__PURE__ */ a("th", { children: r.option }), n.columns.map((e) => /* @__PURE__ */ a("th", { children: /* @__PURE__ */ a(
|
|
7486
|
+
/* @__PURE__ */ o("colgroup", { children: [/* @__PURE__ */ a("col", { className: Xu["table-option-column"] }), n.columns.map((e) => /* @__PURE__ */ a("col", {}, e.id))] }),
|
|
7487
|
+
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ o("tr", { children: [/* @__PURE__ */ a("th", { children: r.option }), n.columns.map((e) => /* @__PURE__ */ a("th", { children: /* @__PURE__ */ a(G, { content: e.content }) }, e.id))] }) }),
|
|
7460
7488
|
/* @__PURE__ */ a("tbody", { children: u.map((t) => {
|
|
7461
7489
|
let n = l.selectedOptionIds.includes(t.optionId);
|
|
7462
7490
|
return /* @__PURE__ */ o("tr", {
|
|
7463
|
-
className:
|
|
7491
|
+
className: Y["table-choice-row"],
|
|
7464
7492
|
"data-selected": n ? "true" : void 0,
|
|
7465
7493
|
children: [/* @__PURE__ */ a("td", { children: /* @__PURE__ */ a("button", {
|
|
7466
|
-
className:
|
|
7494
|
+
className: Y["table-row-button"],
|
|
7467
7495
|
disabled: e,
|
|
7468
7496
|
"aria-pressed": n,
|
|
7469
7497
|
onClick: () => d(t.optionId),
|
|
7470
7498
|
type: "button",
|
|
7471
7499
|
children: /* @__PURE__ */ a("span", {
|
|
7472
|
-
className:
|
|
7500
|
+
className: ru(W.marker, Y["table-option-marker"]),
|
|
7473
7501
|
"data-selected": n ? "true" : void 0,
|
|
7474
7502
|
children: t.marker
|
|
7475
7503
|
})
|
|
7476
7504
|
}) }), t.cells.map((r, i) => /* @__PURE__ */ a("td", { children: /* @__PURE__ */ a("button", {
|
|
7477
|
-
className:
|
|
7505
|
+
className: Y["table-row-button"],
|
|
7478
7506
|
disabled: e,
|
|
7479
7507
|
"aria-pressed": n,
|
|
7480
7508
|
onClick: () => d(t.optionId),
|
|
7481
7509
|
type: "button",
|
|
7482
|
-
children: /* @__PURE__ */ a(
|
|
7510
|
+
children: /* @__PURE__ */ a(G, { content: r })
|
|
7483
7511
|
}) }, `${t.optionId}-cell-${i}`))]
|
|
7484
7512
|
}, t.optionId);
|
|
7485
7513
|
}) })
|
|
7486
7514
|
]
|
|
7487
7515
|
})
|
|
7488
|
-
}), c ? /* @__PURE__ */ a(
|
|
7516
|
+
}), c ? /* @__PURE__ */ a(K, {
|
|
7489
7517
|
groups: i,
|
|
7490
7518
|
title: r.standardAnswer
|
|
7491
7519
|
}) : null]
|
|
7492
7520
|
});
|
|
7493
7521
|
}
|
|
7494
|
-
let f =
|
|
7522
|
+
let f = Yu(t, n);
|
|
7495
7523
|
return /* @__PURE__ */ o("div", {
|
|
7496
|
-
className:
|
|
7524
|
+
className: W.element,
|
|
7497
7525
|
children: [/* @__PURE__ */ a("ol", {
|
|
7498
|
-
className:
|
|
7526
|
+
className: W["option-list"],
|
|
7499
7527
|
children: u.map((t) => {
|
|
7500
7528
|
let n = l.selectedOptionIds.includes(t.optionId);
|
|
7501
7529
|
return /* @__PURE__ */ a("li", {
|
|
7502
|
-
className:
|
|
7530
|
+
className: ru(W["option-item"], Y["choice-option"], n && Y.selected),
|
|
7503
7531
|
"data-selected": n ? "true" : void 0,
|
|
7504
7532
|
children: /* @__PURE__ */ o("button", {
|
|
7505
|
-
className:
|
|
7533
|
+
className: Y["choice-button"],
|
|
7506
7534
|
disabled: e,
|
|
7507
7535
|
"aria-pressed": n,
|
|
7508
7536
|
onClick: () => d(t.optionId),
|
|
7509
7537
|
type: "button",
|
|
7510
7538
|
children: [/* @__PURE__ */ a("span", {
|
|
7511
|
-
className:
|
|
7539
|
+
className: ru(W.marker, Y["option-marker"]),
|
|
7512
7540
|
"data-selected": n ? "true" : void 0,
|
|
7513
7541
|
children: t.marker
|
|
7514
|
-
}), /* @__PURE__ */ a(
|
|
7542
|
+
}), /* @__PURE__ */ a(G, { content: t.standardContent })]
|
|
7515
7543
|
})
|
|
7516
7544
|
}, t.optionId);
|
|
7517
7545
|
})
|
|
7518
|
-
}), c ? /* @__PURE__ */ a(
|
|
7546
|
+
}), c ? /* @__PURE__ */ a(K, {
|
|
7519
7547
|
groups: f,
|
|
7520
7548
|
title: r.standardAnswer
|
|
7521
7549
|
}) : null]
|
|
@@ -7523,47 +7551,47 @@ function Xu({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7523
7551
|
}
|
|
7524
7552
|
//#endregion
|
|
7525
7553
|
//#region src/question/renderers/orderingAnswerGroups.tsx
|
|
7526
|
-
function
|
|
7554
|
+
function Qu(e) {
|
|
7527
7555
|
let t = new Map(e.sortOptions.map((e) => [e.id, e]));
|
|
7528
|
-
return e.
|
|
7556
|
+
return e.answers.map((e, n) => {
|
|
7529
7557
|
let r = t.get(e);
|
|
7530
7558
|
return {
|
|
7531
|
-
contents: r ? [/* @__PURE__ */ a(
|
|
7559
|
+
contents: r ? [/* @__PURE__ */ a(G, { content: r.content }, e)] : [],
|
|
7532
7560
|
marker: String(n + 1)
|
|
7533
7561
|
};
|
|
7534
7562
|
});
|
|
7535
7563
|
}
|
|
7536
7564
|
//#endregion
|
|
7537
7565
|
//#region src/question/player/QuestionOrderingPlayer.tsx
|
|
7538
|
-
function
|
|
7566
|
+
function $u({ disabled: e, item: t, messages: n, onChange: r, response: i, showAnswer: s }) {
|
|
7539
7567
|
let c = Dl(i, t), l = new Map(t.sortOptions.map((e) => [e.id, e])), u = c.orderedOptionIds.map((e) => l.get(e)).filter((e) => !!e);
|
|
7540
7568
|
function d(e, n) {
|
|
7541
7569
|
r(k(k({}, c), {}, { orderedOptionIds: Il(c.orderedOptionIds, t, e, n) }));
|
|
7542
7570
|
}
|
|
7543
7571
|
return /* @__PURE__ */ o("div", {
|
|
7544
|
-
className:
|
|
7572
|
+
className: W.element,
|
|
7545
7573
|
children: [/* @__PURE__ */ a("ol", {
|
|
7546
|
-
className:
|
|
7574
|
+
className: W["option-list"],
|
|
7547
7575
|
children: u.map((t, r) => /* @__PURE__ */ o("li", {
|
|
7548
|
-
className:
|
|
7576
|
+
className: ru(W["option-item"], Y["choice-option"]),
|
|
7549
7577
|
children: [
|
|
7550
7578
|
/* @__PURE__ */ a("span", {
|
|
7551
|
-
className:
|
|
7579
|
+
className: W.marker,
|
|
7552
7580
|
children: r + 1
|
|
7553
7581
|
}),
|
|
7554
|
-
/* @__PURE__ */ a(
|
|
7582
|
+
/* @__PURE__ */ a(G, { content: t.content }),
|
|
7555
7583
|
/* @__PURE__ */ o("span", {
|
|
7556
|
-
className:
|
|
7584
|
+
className: Y["ordering-controls"],
|
|
7557
7585
|
children: [/* @__PURE__ */ a("button", {
|
|
7558
7586
|
"aria-label": `${n.moveUp} ${r + 1}`,
|
|
7559
|
-
className:
|
|
7587
|
+
className: Y["ordering-button"],
|
|
7560
7588
|
disabled: e || r === 0,
|
|
7561
7589
|
onClick: () => d(t.id, -1),
|
|
7562
7590
|
type: "button",
|
|
7563
7591
|
children: "\u2191"
|
|
7564
7592
|
}), /* @__PURE__ */ a("button", {
|
|
7565
7593
|
"aria-label": `${n.moveDown} ${r + 1}`,
|
|
7566
|
-
className:
|
|
7594
|
+
className: Y["ordering-button"],
|
|
7567
7595
|
disabled: e || r === u.length - 1,
|
|
7568
7596
|
onClick: () => d(t.id, 1),
|
|
7569
7597
|
type: "button",
|
|
@@ -7572,13 +7600,13 @@ function Qu({ disabled: e, item: t, messages: n, onChange: r, response: i, showA
|
|
|
7572
7600
|
})
|
|
7573
7601
|
]
|
|
7574
7602
|
}, t.id))
|
|
7575
|
-
}), s ? /* @__PURE__ */ a(
|
|
7576
|
-
groups:
|
|
7603
|
+
}), s ? /* @__PURE__ */ a(K, {
|
|
7604
|
+
groups: Qu(t),
|
|
7577
7605
|
title: n.standardAnswer
|
|
7578
7606
|
}) : null]
|
|
7579
7607
|
});
|
|
7580
7608
|
}
|
|
7581
|
-
var
|
|
7609
|
+
var ed = {
|
|
7582
7610
|
content: "_content_63948_1",
|
|
7583
7611
|
paragraph: "_paragraph_63948_10",
|
|
7584
7612
|
marker: "_marker_63948_14",
|
|
@@ -7588,21 +7616,21 @@ var $u = {
|
|
|
7588
7616
|
};
|
|
7589
7617
|
//#endregion
|
|
7590
7618
|
//#region src/question/renderers/QuestionTextMarkerContent.tsx
|
|
7591
|
-
function
|
|
7619
|
+
function td({ answerMarkers: e = [], content: t, disabled: n = !1, onMarkerClick: r, selectedMarkers: i = [], showAnswer: o = !1 }) {
|
|
7592
7620
|
let c = t.json.length ? t.json : [{
|
|
7593
7621
|
children: [{ text: t.text }],
|
|
7594
7622
|
type: "paragraph"
|
|
7595
7623
|
}];
|
|
7596
7624
|
return /* @__PURE__ */ a("div", {
|
|
7597
|
-
className:
|
|
7625
|
+
className: ed.content,
|
|
7598
7626
|
children: c.map((e, t) => l(e, `node-${t}`))
|
|
7599
7627
|
});
|
|
7600
7628
|
function l(e, t) {
|
|
7601
|
-
if (
|
|
7602
|
-
if (!
|
|
7629
|
+
if (rd(e)) return u(e, t);
|
|
7630
|
+
if (!nd(e)) return null;
|
|
7603
7631
|
let n = e.children.map((e, n) => l(e, `${t}-${n}`));
|
|
7604
7632
|
return e.type === "paragraph" ? /* @__PURE__ */ a("p", {
|
|
7605
|
-
className:
|
|
7633
|
+
className: ed.paragraph,
|
|
7606
7634
|
children: n
|
|
7607
7635
|
}, t) : /* @__PURE__ */ a("span", { children: n }, t);
|
|
7608
7636
|
}
|
|
@@ -7616,7 +7644,7 @@ function ed({ answerMarkers: e = [], content: t, disabled: n = !1, onMarkerClick
|
|
|
7616
7644
|
let n = i.includes(t), a = o && e.includes(t);
|
|
7617
7645
|
return {
|
|
7618
7646
|
answer: a,
|
|
7619
|
-
className: tc(
|
|
7647
|
+
className: tc(ed.marker, r ? ed["marker-button"] : "", n ? ed["marker-selected"] : "", a ? ed["marker-answer"] : ""),
|
|
7620
7648
|
selected: n
|
|
7621
7649
|
};
|
|
7622
7650
|
}
|
|
@@ -7642,21 +7670,21 @@ function ed({ answerMarkers: e = [], content: t, disabled: n = !1, onMarkerClick
|
|
|
7642
7670
|
}, n);
|
|
7643
7671
|
}
|
|
7644
7672
|
}
|
|
7645
|
-
function
|
|
7673
|
+
function nd(e) {
|
|
7646
7674
|
return !!(e && typeof e == "object" && "children" in e && Array.isArray(e.children));
|
|
7647
7675
|
}
|
|
7648
|
-
function
|
|
7676
|
+
function rd(e) {
|
|
7649
7677
|
return !!(e && typeof e == "object" && "text" in e && typeof e.text == "string");
|
|
7650
7678
|
}
|
|
7651
7679
|
//#endregion
|
|
7652
7680
|
//#region src/question/renderers/QuestionTextMarkerView.tsx
|
|
7653
|
-
function
|
|
7654
|
-
let r = Vt(e.content.json).filter((t) => e.
|
|
7655
|
-
return /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(
|
|
7656
|
-
answerMarkers: e.
|
|
7681
|
+
function id({ item: e, messages: t, showAnswer: n }) {
|
|
7682
|
+
let r = Vt(e.content.json).filter((t) => e.answers.includes(t.markerId)).map((e) => e.text);
|
|
7683
|
+
return /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(td, {
|
|
7684
|
+
answerMarkers: e.answers,
|
|
7657
7685
|
content: e.content,
|
|
7658
7686
|
showAnswer: n
|
|
7659
|
-
}), n ? /* @__PURE__ */ a(
|
|
7687
|
+
}), n ? /* @__PURE__ */ a(K, {
|
|
7660
7688
|
groups: [{
|
|
7661
7689
|
contents: r,
|
|
7662
7690
|
marker: t.standardAnswer
|
|
@@ -7666,14 +7694,14 @@ function rd({ item: e, messages: t, showAnswer: n }) {
|
|
|
7666
7694
|
}
|
|
7667
7695
|
//#endregion
|
|
7668
7696
|
//#region src/question/player/QuestionTextMarkerPlayer.tsx
|
|
7669
|
-
function
|
|
7697
|
+
function ad({ disabled: e, item: t, messages: n, onChange: r, response: i, showAnswer: o }) {
|
|
7670
7698
|
let s = Ol(i, t.elementKey);
|
|
7671
|
-
return o ? /* @__PURE__ */ a(
|
|
7699
|
+
return o ? /* @__PURE__ */ a(id, {
|
|
7672
7700
|
item: t,
|
|
7673
7701
|
messages: n,
|
|
7674
7702
|
showAnswer: o
|
|
7675
|
-
}) : /* @__PURE__ */ a(
|
|
7676
|
-
answerMarkers: t.
|
|
7703
|
+
}) : /* @__PURE__ */ a(td, {
|
|
7704
|
+
answerMarkers: t.answers,
|
|
7677
7705
|
content: t.content,
|
|
7678
7706
|
disabled: e,
|
|
7679
7707
|
onMarkerClick: (e) => r(k(k({}, s), {}, { selectedMarkers: Ll(s.selectedMarkers, e) })),
|
|
@@ -7682,26 +7710,26 @@ function id({ disabled: e, item: t, messages: n, onChange: r, response: i, showA
|
|
|
7682
7710
|
}
|
|
7683
7711
|
//#endregion
|
|
7684
7712
|
//#region src/question/renderers/wordBuilderAnswers.tsx
|
|
7685
|
-
function
|
|
7713
|
+
function od(e, t) {
|
|
7686
7714
|
return e.blanks.reduce((n, r) => {
|
|
7687
7715
|
var i;
|
|
7688
|
-
let o = (i = e.
|
|
7716
|
+
let o = (i = e.answers[r]) == null ? void 0 : i.trim();
|
|
7689
7717
|
return o ? [...n, {
|
|
7690
|
-
contents: [/* @__PURE__ */ a(
|
|
7691
|
-
marker:
|
|
7718
|
+
contents: [/* @__PURE__ */ a(G, { content: M(o) }, `${r}-answer`)],
|
|
7719
|
+
marker: iu([r], e.blanks, t)
|
|
7692
7720
|
}] : n;
|
|
7693
7721
|
}, []);
|
|
7694
7722
|
}
|
|
7695
7723
|
//#endregion
|
|
7696
7724
|
//#region src/question/player/QuestionPlayerWordBuilder.module.css
|
|
7697
|
-
var
|
|
7725
|
+
var sd = {
|
|
7698
7726
|
"word-builder-blank": "_word-builder-blank_ftw6q_1",
|
|
7699
7727
|
"word-builder-candidate-list": "_word-builder-candidate-list_ftw6q_30"
|
|
7700
7728
|
};
|
|
7701
7729
|
//#endregion
|
|
7702
7730
|
//#region src/question/player/QuestionWordBuilderPlayer.tsx
|
|
7703
|
-
function
|
|
7704
|
-
let l =
|
|
7731
|
+
function cd({ disabled: e, element: t, item: n, messages: r, onChange: i, response: s, showAnswer: c }) {
|
|
7732
|
+
let l = zi(n, !0, t), u = Sl(s, t.elementKey, l.blanks), d = od(l, r.blankLabel);
|
|
7705
7733
|
function f(e, t) {
|
|
7706
7734
|
i(k(k({}, u), {}, { answers: k(k({}, u.answers), {}, { [e]: t }) }));
|
|
7707
7735
|
}
|
|
@@ -7727,14 +7755,14 @@ function sd({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7727
7755
|
r && m(n, r);
|
|
7728
7756
|
}
|
|
7729
7757
|
return /* @__PURE__ */ o("div", {
|
|
7730
|
-
className:
|
|
7758
|
+
className: U["fill-text"],
|
|
7731
7759
|
children: [
|
|
7732
|
-
/* @__PURE__ */ a(
|
|
7760
|
+
/* @__PURE__ */ a(xu, {
|
|
7733
7761
|
content: l.content,
|
|
7734
7762
|
renderBlank: ({ blankId: t, index: n, label: i }) => {
|
|
7735
7763
|
var o, s;
|
|
7736
|
-
let c = (o = u.answers[t]) == null ? "" : o, l =
|
|
7737
|
-
|
|
7764
|
+
let c = (o = u.answers[t]) == null ? "" : o, l = ld({
|
|
7765
|
+
answers: c,
|
|
7738
7766
|
blankLabel: r.blankLabel,
|
|
7739
7767
|
canClear: !e && !!c.trim(),
|
|
7740
7768
|
index: n,
|
|
@@ -7742,7 +7770,7 @@ function sd({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7742
7770
|
});
|
|
7743
7771
|
return /* @__PURE__ */ a("button", {
|
|
7744
7772
|
"aria-label": l,
|
|
7745
|
-
className:
|
|
7773
|
+
className: sd["word-builder-blank"],
|
|
7746
7774
|
disabled: e,
|
|
7747
7775
|
onClick: () => p(t),
|
|
7748
7776
|
onDragOver: (e) => e.preventDefault(),
|
|
@@ -7754,7 +7782,7 @@ function sd({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7754
7782
|
}
|
|
7755
7783
|
}),
|
|
7756
7784
|
/* @__PURE__ */ a("div", {
|
|
7757
|
-
className:
|
|
7785
|
+
className: sd["word-builder-candidate-list"],
|
|
7758
7786
|
children: l.candidateOptions.map((t, n) => /* @__PURE__ */ a("button", {
|
|
7759
7787
|
disabled: e,
|
|
7760
7788
|
draggable: !e,
|
|
@@ -7766,42 +7794,42 @@ function sd({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7766
7794
|
children: t
|
|
7767
7795
|
}, `${t}-${n}`))
|
|
7768
7796
|
}),
|
|
7769
|
-
c ? /* @__PURE__ */ a(
|
|
7797
|
+
c ? /* @__PURE__ */ a(K, {
|
|
7770
7798
|
groups: d,
|
|
7771
7799
|
title: r.standardAnswer
|
|
7772
7800
|
}) : null
|
|
7773
7801
|
]
|
|
7774
7802
|
});
|
|
7775
7803
|
}
|
|
7776
|
-
function
|
|
7804
|
+
function ld({ answers: e, blankLabel: t, canClear: n, index: r, label: i }) {
|
|
7777
7805
|
let a = i || `${t}${r + 1}`;
|
|
7778
7806
|
return !n || !e.trim() ? a : t === "\u7a7a" ? `${a}\uff0c\u70b9\u51fb\u6e05\u7a7a` : `${a}, click to clear`;
|
|
7779
7807
|
}
|
|
7780
7808
|
//#endregion
|
|
7781
7809
|
//#region src/question/player/QuestionPlayerElement.tsx
|
|
7782
|
-
function
|
|
7783
|
-
return t.type === n.type ? t.type === "richText" ? /* @__PURE__ */ a(
|
|
7810
|
+
function ud({ disabled: e, element: t, item: n, messages: r, onResponseItemChange: i, response: o, showAnswer: s }) {
|
|
7811
|
+
return t.type === n.type ? t.type === "richText" ? /* @__PURE__ */ a(G, { content: n.content }) : t.type === "ordering" ? /* @__PURE__ */ a($u, {
|
|
7784
7812
|
disabled: e,
|
|
7785
7813
|
item: n,
|
|
7786
7814
|
messages: r,
|
|
7787
7815
|
onChange: i,
|
|
7788
7816
|
response: o,
|
|
7789
7817
|
showAnswer: s
|
|
7790
|
-
}) : t.type === "classification" ? /* @__PURE__ */ a(
|
|
7818
|
+
}) : t.type === "classification" ? /* @__PURE__ */ a(vu, {
|
|
7791
7819
|
disabled: e,
|
|
7792
7820
|
item: n,
|
|
7793
7821
|
messages: r,
|
|
7794
7822
|
onChange: i,
|
|
7795
7823
|
response: o,
|
|
7796
7824
|
showAnswer: s
|
|
7797
|
-
}) : t.type === "textMarker" ? /* @__PURE__ */ a(
|
|
7825
|
+
}) : t.type === "textMarker" ? /* @__PURE__ */ a(ad, {
|
|
7798
7826
|
disabled: e,
|
|
7799
7827
|
item: n,
|
|
7800
7828
|
messages: r,
|
|
7801
7829
|
onChange: i,
|
|
7802
7830
|
response: o,
|
|
7803
7831
|
showAnswer: s
|
|
7804
|
-
}) :
|
|
7832
|
+
}) : dd({
|
|
7805
7833
|
disabled: e,
|
|
7806
7834
|
element: t,
|
|
7807
7835
|
item: n,
|
|
@@ -7811,9 +7839,9 @@ function ld({ disabled: e, element: t, item: n, messages: r, onResponseItemChang
|
|
|
7811
7839
|
showAnswer: s
|
|
7812
7840
|
}) : null;
|
|
7813
7841
|
}
|
|
7814
|
-
function
|
|
7842
|
+
function dd({ disabled: e, element: t, item: n, messages: r, onResponseItemChange: i, response: o, showAnswer: s }) {
|
|
7815
7843
|
switch (t.type) {
|
|
7816
|
-
case "choice": return /* @__PURE__ */ a(
|
|
7844
|
+
case "choice": return /* @__PURE__ */ a(Zu, {
|
|
7817
7845
|
disabled: e,
|
|
7818
7846
|
element: t,
|
|
7819
7847
|
item: n,
|
|
@@ -7822,7 +7850,7 @@ function ud({ disabled: e, element: t, item: n, messages: r, onResponseItemChang
|
|
|
7822
7850
|
response: o,
|
|
7823
7851
|
showAnswer: s
|
|
7824
7852
|
});
|
|
7825
|
-
case "fill": return /* @__PURE__ */ a(
|
|
7853
|
+
case "fill": return /* @__PURE__ */ a(mu, {
|
|
7826
7854
|
disabled: e,
|
|
7827
7855
|
item: n,
|
|
7828
7856
|
messages: r,
|
|
@@ -7830,7 +7858,7 @@ function ud({ disabled: e, element: t, item: n, messages: r, onResponseItemChang
|
|
|
7830
7858
|
response: o,
|
|
7831
7859
|
showAnswer: s
|
|
7832
7860
|
});
|
|
7833
|
-
case "inlineFill": return /* @__PURE__ */ a(
|
|
7861
|
+
case "inlineFill": return /* @__PURE__ */ a(Iu, {
|
|
7834
7862
|
disabled: e,
|
|
7835
7863
|
element: t,
|
|
7836
7864
|
item: n,
|
|
@@ -7839,7 +7867,7 @@ function ud({ disabled: e, element: t, item: n, messages: r, onResponseItemChang
|
|
|
7839
7867
|
response: o,
|
|
7840
7868
|
showAnswer: s
|
|
7841
7869
|
});
|
|
7842
|
-
case "wordBuilder": return /* @__PURE__ */ a(
|
|
7870
|
+
case "wordBuilder": return /* @__PURE__ */ a(cd, {
|
|
7843
7871
|
disabled: e,
|
|
7844
7872
|
element: t,
|
|
7845
7873
|
item: n,
|
|
@@ -7848,7 +7876,7 @@ function ud({ disabled: e, element: t, item: n, messages: r, onResponseItemChang
|
|
|
7848
7876
|
response: o,
|
|
7849
7877
|
showAnswer: s
|
|
7850
7878
|
});
|
|
7851
|
-
case "judgement": return /* @__PURE__ */ a(
|
|
7879
|
+
case "judgement": return /* @__PURE__ */ a(Vu, {
|
|
7852
7880
|
disabled: e,
|
|
7853
7881
|
element: t,
|
|
7854
7882
|
item: n,
|
|
@@ -7857,7 +7885,7 @@ function ud({ disabled: e, element: t, item: n, messages: r, onResponseItemChang
|
|
|
7857
7885
|
response: o,
|
|
7858
7886
|
showAnswer: s
|
|
7859
7887
|
});
|
|
7860
|
-
case "lineConnect": return /* @__PURE__ */ a(
|
|
7888
|
+
case "lineConnect": return /* @__PURE__ */ a(Wu, {
|
|
7861
7889
|
disabled: e,
|
|
7862
7890
|
item: n,
|
|
7863
7891
|
messages: r,
|
|
@@ -7865,7 +7893,7 @@ function ud({ disabled: e, element: t, item: n, messages: r, onResponseItemChang
|
|
|
7865
7893
|
response: o,
|
|
7866
7894
|
showAnswer: s
|
|
7867
7895
|
});
|
|
7868
|
-
case "matching": return /* @__PURE__ */ a(
|
|
7896
|
+
case "matching": return /* @__PURE__ */ a(qu, {
|
|
7869
7897
|
disabled: e,
|
|
7870
7898
|
item: n,
|
|
7871
7899
|
messages: r,
|
|
@@ -7877,16 +7905,16 @@ function ud({ disabled: e, element: t, item: n, messages: r, onResponseItemChang
|
|
|
7877
7905
|
}
|
|
7878
7906
|
//#endregion
|
|
7879
7907
|
//#region src/question/player/QuestionPlayer.tsx
|
|
7880
|
-
var
|
|
7881
|
-
function
|
|
7908
|
+
var fd = ["locale"];
|
|
7909
|
+
function pd(e) {
|
|
7882
7910
|
let { locale: t = "zh-CN" } = e;
|
|
7883
|
-
return /* @__PURE__ */ a(
|
|
7911
|
+
return /* @__PURE__ */ a(md, k(k({}, As(e, fd)), {}, {
|
|
7884
7912
|
messages: nu(t),
|
|
7885
7913
|
numberPath: []
|
|
7886
7914
|
}));
|
|
7887
7915
|
}
|
|
7888
|
-
function
|
|
7889
|
-
let f =
|
|
7916
|
+
function md({ className: e, disabled: t = !1, messages: n, numberPath: r, onResponseChange: i, response: o, showAnswer: s = !1, showExtraAttributes: c = !1, structure: l, subquestionTemplates: u = [], value: d }) {
|
|
7917
|
+
let f = hd({
|
|
7890
7918
|
disabled: t,
|
|
7891
7919
|
messages: n,
|
|
7892
7920
|
numberPath: r,
|
|
@@ -7899,24 +7927,24 @@ function pd({ className: e, disabled: t = !1, messages: n, numberPath: r, onResp
|
|
|
7899
7927
|
value: d
|
|
7900
7928
|
});
|
|
7901
7929
|
return /* @__PURE__ */ a("div", {
|
|
7902
|
-
className: U
|
|
7903
|
-
children:
|
|
7904
|
-
className:
|
|
7930
|
+
className: ru(U.root, e),
|
|
7931
|
+
children: vd(l, d) ? /* @__PURE__ */ a("div", {
|
|
7932
|
+
className: U.empty,
|
|
7905
7933
|
children: n.previewEmpty
|
|
7906
7934
|
}) : f
|
|
7907
7935
|
});
|
|
7908
7936
|
}
|
|
7909
|
-
function
|
|
7910
|
-
return /* @__PURE__ */ o(i, { children: [
|
|
7937
|
+
function hd(e) {
|
|
7938
|
+
return /* @__PURE__ */ o(i, { children: [gd(e), _d(e)] });
|
|
7911
7939
|
}
|
|
7912
|
-
function
|
|
7913
|
-
return
|
|
7914
|
-
className:
|
|
7940
|
+
function gd({ disabled: e, messages: t, onResponseChange: n, response: r, showAnswer: i, showExtraAttributes: s, structure: c, value: l }) {
|
|
7941
|
+
return mi(c) ? null : /* @__PURE__ */ o("div", {
|
|
7942
|
+
className: U["element-list"],
|
|
7915
7943
|
children: [c.elements.map((o) => {
|
|
7916
|
-
let s =
|
|
7944
|
+
let s = xi(l, o, c.hasAnswer);
|
|
7917
7945
|
return /* @__PURE__ */ a("section", {
|
|
7918
|
-
className:
|
|
7919
|
-
children: /* @__PURE__ */ a(
|
|
7946
|
+
className: U.element,
|
|
7947
|
+
children: /* @__PURE__ */ a(ud, {
|
|
7920
7948
|
disabled: e,
|
|
7921
7949
|
element: o,
|
|
7922
7950
|
item: s,
|
|
@@ -7927,16 +7955,16 @@ function hd({ disabled: e, messages: t, onResponseChange: n, response: r, showAn
|
|
|
7927
7955
|
})
|
|
7928
7956
|
}, o.elementKey);
|
|
7929
7957
|
}), s ? c.extras.map((n) => {
|
|
7930
|
-
let i =
|
|
7958
|
+
let i = Si(l, n);
|
|
7931
7959
|
return /* @__PURE__ */ o("section", {
|
|
7932
|
-
className:
|
|
7960
|
+
className: U.element,
|
|
7933
7961
|
children: [/* @__PURE__ */ a("h3", {
|
|
7934
|
-
className:
|
|
7962
|
+
className: U["section-title"],
|
|
7935
7963
|
children: n.name
|
|
7936
|
-
}), /* @__PURE__ */ a(
|
|
7964
|
+
}), /* @__PURE__ */ a(ud, {
|
|
7937
7965
|
disabled: e,
|
|
7938
|
-
element:
|
|
7939
|
-
item:
|
|
7966
|
+
element: yd(n),
|
|
7967
|
+
item: bd(i),
|
|
7940
7968
|
messages: t,
|
|
7941
7969
|
onResponseItemChange: () => void 0,
|
|
7942
7970
|
response: r,
|
|
@@ -7946,14 +7974,14 @@ function hd({ disabled: e, messages: t, onResponseChange: n, response: r, showAn
|
|
|
7946
7974
|
}) : null]
|
|
7947
7975
|
});
|
|
7948
7976
|
}
|
|
7949
|
-
function
|
|
7950
|
-
return l.children.length === 0 ? null : /* @__PURE__ */ a(
|
|
7977
|
+
function _d({ disabled: e, messages: t, numberPath: n, onResponseChange: r, response: i, showAnswer: o, showExtraAttributes: s, subquestionTemplates: c = [], value: l }) {
|
|
7978
|
+
return l.children.length === 0 ? null : /* @__PURE__ */ a(fu, {
|
|
7951
7979
|
disabled: e,
|
|
7952
7980
|
messages: t,
|
|
7953
7981
|
numberPath: n,
|
|
7954
7982
|
onChildResponseChange: (e, t) => r(Al(i, e, t)),
|
|
7955
7983
|
response: i,
|
|
7956
|
-
renderChild: (n, r, i, l, u) => /* @__PURE__ */ a(
|
|
7984
|
+
renderChild: (n, r, i, l, u) => /* @__PURE__ */ a(md, {
|
|
7957
7985
|
disabled: e,
|
|
7958
7986
|
messages: t,
|
|
7959
7987
|
numberPath: u,
|
|
@@ -7969,10 +7997,10 @@ function gd({ disabled: e, messages: t, numberPath: n, onResponseChange: r, resp
|
|
|
7969
7997
|
value: l
|
|
7970
7998
|
});
|
|
7971
7999
|
}
|
|
7972
|
-
function
|
|
7973
|
-
return
|
|
8000
|
+
function vd(e, t) {
|
|
8001
|
+
return mi(e) && t.children.length === 0;
|
|
7974
8002
|
}
|
|
7975
|
-
function
|
|
8003
|
+
function yd(e) {
|
|
7976
8004
|
return {
|
|
7977
8005
|
config: {},
|
|
7978
8006
|
elementKey: e.extraKey,
|
|
@@ -7980,7 +8008,7 @@ function vd(e) {
|
|
|
7980
8008
|
type: "richText"
|
|
7981
8009
|
};
|
|
7982
8010
|
}
|
|
7983
|
-
function
|
|
8011
|
+
function bd(e) {
|
|
7984
8012
|
return {
|
|
7985
8013
|
content: e.content,
|
|
7986
8014
|
elementKey: e.extraKey,
|
|
@@ -7989,129 +8017,129 @@ function yd(e) {
|
|
|
7989
8017
|
}
|
|
7990
8018
|
//#endregion
|
|
7991
8019
|
//#region src/question/renderers/QuestionBlankGroupView.module.css
|
|
7992
|
-
var
|
|
8020
|
+
var xd = {
|
|
7993
8021
|
"blank-list": "_blank-list_12ccp_1",
|
|
7994
8022
|
"blank-item": "_blank-item_12ccp_11",
|
|
7995
8023
|
"blank-field": "_blank-field_12ccp_17"
|
|
7996
8024
|
};
|
|
7997
8025
|
//#endregion
|
|
7998
8026
|
//#region src/question/renderers/QuestionBlankGroupView.tsx
|
|
7999
|
-
function
|
|
8000
|
-
let r =
|
|
8001
|
-
contents: n.answerPools.map((e, t) => /* @__PURE__ */ a(
|
|
8002
|
-
marker:
|
|
8027
|
+
function Sd({ item: e, messages: t, showAnswer: n }) {
|
|
8028
|
+
let r = ta(e.answers, e.blanks).map((n, r) => ({
|
|
8029
|
+
contents: n.answerPools.map((e, t) => /* @__PURE__ */ a(G, { content: e }, `group-${r}-answer-${t}`)),
|
|
8030
|
+
marker: iu(n.blankIds, e.blanks, t.blankLabel)
|
|
8003
8031
|
}));
|
|
8004
8032
|
return /* @__PURE__ */ o("div", {
|
|
8005
|
-
className:
|
|
8033
|
+
className: W.element,
|
|
8006
8034
|
children: [/* @__PURE__ */ a("ol", {
|
|
8007
|
-
className:
|
|
8035
|
+
className: xd["blank-list"],
|
|
8008
8036
|
children: e.blanks.map((e, n) => /* @__PURE__ */ a("li", {
|
|
8009
|
-
className:
|
|
8037
|
+
className: xd["blank-item"],
|
|
8010
8038
|
children: /* @__PURE__ */ o("span", {
|
|
8011
|
-
className:
|
|
8039
|
+
className: xd["blank-field"],
|
|
8012
8040
|
children: [
|
|
8013
8041
|
t.blankLabel,
|
|
8014
8042
|
" ",
|
|
8015
8043
|
n + 1
|
|
8016
8044
|
]
|
|
8017
8045
|
})
|
|
8018
|
-
},
|
|
8019
|
-
}), n ? /* @__PURE__ */ a(
|
|
8046
|
+
}, Cd(e, n)))
|
|
8047
|
+
}), n ? /* @__PURE__ */ a(K, {
|
|
8020
8048
|
groups: r,
|
|
8021
8049
|
title: t.standardAnswer
|
|
8022
8050
|
}) : null]
|
|
8023
8051
|
});
|
|
8024
8052
|
}
|
|
8025
|
-
function
|
|
8053
|
+
function Cd(e, t) {
|
|
8026
8054
|
return e || `blank-${t + 1}`;
|
|
8027
8055
|
}
|
|
8028
8056
|
//#endregion
|
|
8029
8057
|
//#region src/question/renderers/QuestionClassificationView.tsx
|
|
8030
|
-
function
|
|
8058
|
+
function wd({ item: e, messages: t, showAnswer: n }) {
|
|
8031
8059
|
return /* @__PURE__ */ o("div", {
|
|
8032
|
-
className:
|
|
8060
|
+
className: W.element,
|
|
8033
8061
|
children: [/* @__PURE__ */ o("div", {
|
|
8034
|
-
className:
|
|
8062
|
+
className: q.board,
|
|
8035
8063
|
children: [/* @__PURE__ */ a("div", {
|
|
8036
|
-
className:
|
|
8064
|
+
className: q.zones,
|
|
8037
8065
|
children: e.categories.map((e) => /* @__PURE__ */ o("section", {
|
|
8038
|
-
className:
|
|
8066
|
+
className: q.zone,
|
|
8039
8067
|
children: [/* @__PURE__ */ a("div", {
|
|
8040
|
-
className:
|
|
8041
|
-
children: /* @__PURE__ */ a(
|
|
8068
|
+
className: q["zone-title"],
|
|
8069
|
+
children: /* @__PURE__ */ a(G, { content: e.content })
|
|
8042
8070
|
}), /* @__PURE__ */ a("span", {
|
|
8043
|
-
className:
|
|
8071
|
+
className: q.empty,
|
|
8044
8072
|
children: t.unassigned
|
|
8045
8073
|
})]
|
|
8046
8074
|
}, e.id))
|
|
8047
8075
|
}), /* @__PURE__ */ a("section", {
|
|
8048
|
-
className:
|
|
8076
|
+
className: q.pool,
|
|
8049
8077
|
children: e.items.map((e) => /* @__PURE__ */ a("div", {
|
|
8050
|
-
className:
|
|
8051
|
-
children: /* @__PURE__ */ a(
|
|
8078
|
+
className: q.item,
|
|
8079
|
+
children: /* @__PURE__ */ a(G, { content: e.content })
|
|
8052
8080
|
}, e.id))
|
|
8053
8081
|
})]
|
|
8054
|
-
}), n ? /* @__PURE__ */ a(
|
|
8055
|
-
groups:
|
|
8082
|
+
}), n ? /* @__PURE__ */ a(K, {
|
|
8083
|
+
groups: _u(e),
|
|
8056
8084
|
title: t.standardAnswer
|
|
8057
8085
|
}) : null]
|
|
8058
8086
|
});
|
|
8059
8087
|
}
|
|
8060
8088
|
//#endregion
|
|
8061
8089
|
//#region src/question/renderers/QuestionFillTextView.tsx
|
|
8062
|
-
function
|
|
8063
|
-
let i =
|
|
8064
|
-
contents: e.contents.map((e, n) => /* @__PURE__ */ a(
|
|
8065
|
-
marker:
|
|
8090
|
+
function Td({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
8091
|
+
let i = Bi(t, e, !0), s = uu(i).map((e, t) => ({
|
|
8092
|
+
contents: e.contents.map((e, n) => /* @__PURE__ */ a(G, { content: e }, `group-${t}-answer-${n}`)),
|
|
8093
|
+
marker: iu(e.blankIds, i.blanks, n.blankLabel)
|
|
8066
8094
|
}));
|
|
8067
8095
|
return /* @__PURE__ */ o("div", {
|
|
8068
|
-
className:
|
|
8096
|
+
className: W.element,
|
|
8069
8097
|
children: [
|
|
8070
|
-
/* @__PURE__ */ a(
|
|
8071
|
-
|
|
8072
|
-
r ? /* @__PURE__ */ a(
|
|
8098
|
+
/* @__PURE__ */ a(G, { content: i.content }),
|
|
8099
|
+
Ed(i, n.candidateOptions),
|
|
8100
|
+
r ? /* @__PURE__ */ a(K, {
|
|
8073
8101
|
groups: s,
|
|
8074
8102
|
title: n.standardAnswer
|
|
8075
8103
|
}) : null
|
|
8076
8104
|
]
|
|
8077
8105
|
});
|
|
8078
8106
|
}
|
|
8079
|
-
function
|
|
8107
|
+
function Ed(e, t) {
|
|
8080
8108
|
var n, r;
|
|
8081
8109
|
let i = (n = e.candidateOptions) == null ? [] : n, s = (r = e.blankOptionGroups) == null ? [] : r;
|
|
8082
8110
|
return !i.length && !s.length ? null : /* @__PURE__ */ o("div", {
|
|
8083
|
-
className:
|
|
8111
|
+
className: W["candidate-section"],
|
|
8084
8112
|
children: [/* @__PURE__ */ a("span", {
|
|
8085
|
-
className:
|
|
8113
|
+
className: W["section-title"],
|
|
8086
8114
|
children: t
|
|
8087
8115
|
}), /* @__PURE__ */ o("ol", {
|
|
8088
|
-
className:
|
|
8116
|
+
className: W["candidate-list"],
|
|
8089
8117
|
children: [i.map((e) => /* @__PURE__ */ a("li", {
|
|
8090
|
-
className:
|
|
8091
|
-
children: /* @__PURE__ */ a(
|
|
8118
|
+
className: W["candidate-item"],
|
|
8119
|
+
children: /* @__PURE__ */ a(G, { content: e.content })
|
|
8092
8120
|
}, e.optionId)), s.reduce((e, t) => [...e, ...t.options.map((e) => /* @__PURE__ */ a("li", {
|
|
8093
|
-
className:
|
|
8094
|
-
children: /* @__PURE__ */ a(
|
|
8121
|
+
className: W["candidate-item"],
|
|
8122
|
+
children: /* @__PURE__ */ a(G, { content: e.content })
|
|
8095
8123
|
}, `${t.blankId}-${e.optionId}`))], [])]
|
|
8096
8124
|
})]
|
|
8097
8125
|
});
|
|
8098
8126
|
}
|
|
8099
8127
|
//#endregion
|
|
8100
8128
|
//#region src/question/renderers/QuestionJudgementGroupView.tsx
|
|
8101
|
-
function
|
|
8102
|
-
let i =
|
|
8103
|
-
contents: t.
|
|
8129
|
+
function Dd({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
8130
|
+
let i = Ei(e.config.judgeAnswerMode), s = [{
|
|
8131
|
+
contents: t.answers.filter((e) => e.trim() !== ""),
|
|
8104
8132
|
marker: ""
|
|
8105
8133
|
}];
|
|
8106
8134
|
return /* @__PURE__ */ o("div", {
|
|
8107
|
-
className:
|
|
8135
|
+
className: W.element,
|
|
8108
8136
|
children: [/* @__PURE__ */ a("ol", {
|
|
8109
|
-
className:
|
|
8137
|
+
className: W["judgement-list"],
|
|
8110
8138
|
children: i.map((e) => /* @__PURE__ */ a("li", {
|
|
8111
|
-
className:
|
|
8139
|
+
className: W["judgement-item"],
|
|
8112
8140
|
children: e
|
|
8113
8141
|
}, e))
|
|
8114
|
-
}), r ? /* @__PURE__ */ a(
|
|
8142
|
+
}), r ? /* @__PURE__ */ a(K, {
|
|
8115
8143
|
groups: s,
|
|
8116
8144
|
title: n.standardAnswer
|
|
8117
8145
|
}) : null]
|
|
@@ -8119,10 +8147,10 @@ function Ed({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
|
8119
8147
|
}
|
|
8120
8148
|
//#endregion
|
|
8121
8149
|
//#region src/question/renderers/QuestionLineConnectView.tsx
|
|
8122
|
-
function
|
|
8150
|
+
function Od({ item: e, messages: t, showAnswer: n }) {
|
|
8123
8151
|
let r = { gridTemplateColumns: `repeat(${e.columns.length}, minmax(12rem, 1fr))` };
|
|
8124
8152
|
return /* @__PURE__ */ o("div", {
|
|
8125
|
-
className:
|
|
8153
|
+
className: W.element,
|
|
8126
8154
|
children: [/* @__PURE__ */ a("div", {
|
|
8127
8155
|
className: B.board,
|
|
8128
8156
|
children: /* @__PURE__ */ a("div", {
|
|
@@ -8138,24 +8166,24 @@ function Dd({ item: e, messages: t, showAnswer: n }) {
|
|
|
8138
8166
|
n + 1
|
|
8139
8167
|
]
|
|
8140
8168
|
}), e.items.map((t, n) => {
|
|
8141
|
-
let r =
|
|
8169
|
+
let r = wi(e.labelStyle, n);
|
|
8142
8170
|
return /* @__PURE__ */ o("div", {
|
|
8143
8171
|
className: B.item,
|
|
8144
8172
|
children: [r ? /* @__PURE__ */ a("span", {
|
|
8145
8173
|
className: B.marker,
|
|
8146
8174
|
children: r
|
|
8147
|
-
}) : null, /* @__PURE__ */ a(
|
|
8175
|
+
}) : null, /* @__PURE__ */ a(G, { content: t.content })]
|
|
8148
8176
|
}, t.itemId);
|
|
8149
8177
|
})]
|
|
8150
8178
|
}, e.columnId))
|
|
8151
8179
|
})
|
|
8152
|
-
}), n ? /* @__PURE__ */ a(
|
|
8153
|
-
groups:
|
|
8180
|
+
}), n ? /* @__PURE__ */ a(K, {
|
|
8181
|
+
groups: Hu(e),
|
|
8154
8182
|
title: t.standardAnswer
|
|
8155
8183
|
}) : null]
|
|
8156
8184
|
});
|
|
8157
8185
|
}
|
|
8158
|
-
var
|
|
8186
|
+
var kd = {
|
|
8159
8187
|
board: "_board_5xarh_1",
|
|
8160
8188
|
columns: "_columns_5xarh_6",
|
|
8161
8189
|
column: "_column_5xarh_6",
|
|
@@ -8164,73 +8192,73 @@ var Od = {
|
|
|
8164
8192
|
};
|
|
8165
8193
|
//#endregion
|
|
8166
8194
|
//#region src/question/renderers/QuestionMatchingView.tsx
|
|
8167
|
-
function
|
|
8195
|
+
function Ad({ item: e, messages: t, showAnswer: n }) {
|
|
8168
8196
|
return /* @__PURE__ */ o("div", {
|
|
8169
|
-
className:
|
|
8197
|
+
className: W.element,
|
|
8170
8198
|
children: [/* @__PURE__ */ a("div", {
|
|
8171
|
-
className:
|
|
8199
|
+
className: kd.board,
|
|
8172
8200
|
children: /* @__PURE__ */ a("div", {
|
|
8173
|
-
className:
|
|
8201
|
+
className: kd.columns,
|
|
8174
8202
|
children: e.columns.map((e) => /* @__PURE__ */ a("section", {
|
|
8175
|
-
className:
|
|
8203
|
+
className: kd.column,
|
|
8176
8204
|
children: e.items.map((t, n) => {
|
|
8177
|
-
let r =
|
|
8205
|
+
let r = Ti(e.labelStyle, n);
|
|
8178
8206
|
return /* @__PURE__ */ o("div", {
|
|
8179
|
-
className:
|
|
8207
|
+
className: kd.item,
|
|
8180
8208
|
children: [r ? /* @__PURE__ */ a("span", {
|
|
8181
|
-
className:
|
|
8209
|
+
className: kd.marker,
|
|
8182
8210
|
children: r
|
|
8183
|
-
}) : null, /* @__PURE__ */ a(
|
|
8211
|
+
}) : null, /* @__PURE__ */ a(G, { content: t.content })]
|
|
8184
8212
|
}, t.itemId);
|
|
8185
8213
|
})
|
|
8186
8214
|
}, e.columnId))
|
|
8187
8215
|
})
|
|
8188
|
-
}), n ? /* @__PURE__ */ a(
|
|
8189
|
-
groups:
|
|
8216
|
+
}), n ? /* @__PURE__ */ a(K, {
|
|
8217
|
+
groups: Gu(e),
|
|
8190
8218
|
title: t.standardAnswer
|
|
8191
8219
|
}) : null]
|
|
8192
8220
|
});
|
|
8193
8221
|
}
|
|
8194
8222
|
//#endregion
|
|
8195
8223
|
//#region src/question/renderers/QuestionOptionGroupView.tsx
|
|
8196
|
-
function
|
|
8197
|
-
let i =
|
|
8224
|
+
function jd({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
8225
|
+
let i = Di(t, e.config.optionLabelStyle);
|
|
8198
8226
|
if (e.config.renderer === "table") {
|
|
8199
|
-
let s =
|
|
8227
|
+
let s = Yu(e, t);
|
|
8200
8228
|
return /* @__PURE__ */ o("div", {
|
|
8201
|
-
className:
|
|
8229
|
+
className: W.element,
|
|
8202
8230
|
children: [/* @__PURE__ */ a("div", {
|
|
8203
|
-
className:
|
|
8231
|
+
className: Xu["table-wrap"],
|
|
8204
8232
|
children: /* @__PURE__ */ o("table", {
|
|
8205
|
-
className:
|
|
8233
|
+
className: Xu.table,
|
|
8206
8234
|
children: [
|
|
8207
|
-
/* @__PURE__ */ o("colgroup", { children: [/* @__PURE__ */ a("col", { className:
|
|
8208
|
-
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ o("tr", { children: [/* @__PURE__ */ a("th", { children: n.option }), t.columns.map((e) => /* @__PURE__ */ a("th", { children: /* @__PURE__ */ a(
|
|
8235
|
+
/* @__PURE__ */ o("colgroup", { children: [/* @__PURE__ */ a("col", { className: Xu["table-option-column"] }), t.columns.map((e) => /* @__PURE__ */ a("col", {}, e.id))] }),
|
|
8236
|
+
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ o("tr", { children: [/* @__PURE__ */ a("th", { children: n.option }), t.columns.map((e) => /* @__PURE__ */ a("th", { children: /* @__PURE__ */ a(G, { content: e.content }) }, e.id))] }) }),
|
|
8209
8237
|
/* @__PURE__ */ a("tbody", { children: i.map((e) => /* @__PURE__ */ o("tr", { children: [/* @__PURE__ */ a("td", { children: /* @__PURE__ */ a("span", {
|
|
8210
|
-
className:
|
|
8238
|
+
className: Xu["table-option-marker"],
|
|
8211
8239
|
children: e.marker
|
|
8212
|
-
}) }), e.cells.map((t, n) => /* @__PURE__ */ a("td", { children: /* @__PURE__ */ a(
|
|
8240
|
+
}) }), e.cells.map((t, n) => /* @__PURE__ */ a("td", { children: /* @__PURE__ */ a(G, { content: t }) }, `${e.optionId}-cell-${n}`))] }, e.optionId)) })
|
|
8213
8241
|
]
|
|
8214
8242
|
})
|
|
8215
|
-
}), r ? /* @__PURE__ */ a(
|
|
8243
|
+
}), r ? /* @__PURE__ */ a(K, {
|
|
8216
8244
|
groups: s,
|
|
8217
8245
|
title: n.standardAnswer
|
|
8218
8246
|
}) : null]
|
|
8219
8247
|
});
|
|
8220
8248
|
}
|
|
8221
|
-
let s =
|
|
8249
|
+
let s = Yu(e, t);
|
|
8222
8250
|
return /* @__PURE__ */ o("div", {
|
|
8223
|
-
className:
|
|
8251
|
+
className: W.element,
|
|
8224
8252
|
children: [/* @__PURE__ */ a("ol", {
|
|
8225
|
-
className:
|
|
8253
|
+
className: W["option-list"],
|
|
8226
8254
|
children: i.map((e) => /* @__PURE__ */ o("li", {
|
|
8227
|
-
className:
|
|
8255
|
+
className: W["option-item"],
|
|
8228
8256
|
children: [/* @__PURE__ */ a("span", {
|
|
8229
|
-
className:
|
|
8257
|
+
className: W.marker,
|
|
8230
8258
|
children: e.marker
|
|
8231
|
-
}), /* @__PURE__ */ a(
|
|
8259
|
+
}), /* @__PURE__ */ a(G, { content: e.standardContent })]
|
|
8232
8260
|
}, e.optionId))
|
|
8233
|
-
}), r ? /* @__PURE__ */ a(
|
|
8261
|
+
}), r ? /* @__PURE__ */ a(K, {
|
|
8234
8262
|
groups: s,
|
|
8235
8263
|
title: n.standardAnswer
|
|
8236
8264
|
}) : null]
|
|
@@ -8238,53 +8266,53 @@ function Ad({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
|
8238
8266
|
}
|
|
8239
8267
|
//#endregion
|
|
8240
8268
|
//#region src/question/renderers/QuestionOrderingView.tsx
|
|
8241
|
-
function
|
|
8269
|
+
function Md({ item: e, messages: t, showAnswer: n }) {
|
|
8242
8270
|
return /* @__PURE__ */ o("div", {
|
|
8243
|
-
className:
|
|
8271
|
+
className: W.element,
|
|
8244
8272
|
children: [/* @__PURE__ */ a("ol", {
|
|
8245
|
-
className:
|
|
8273
|
+
className: W["option-list"],
|
|
8246
8274
|
children: e.sortOptions.map((e, t) => /* @__PURE__ */ o("li", {
|
|
8247
|
-
className:
|
|
8275
|
+
className: W["option-item"],
|
|
8248
8276
|
children: [/* @__PURE__ */ a("span", {
|
|
8249
|
-
className:
|
|
8277
|
+
className: W.marker,
|
|
8250
8278
|
children: t + 1
|
|
8251
|
-
}), /* @__PURE__ */ a(
|
|
8279
|
+
}), /* @__PURE__ */ a(G, { content: e.content })]
|
|
8252
8280
|
}, e.id))
|
|
8253
|
-
}), n ? /* @__PURE__ */ a(
|
|
8254
|
-
groups:
|
|
8281
|
+
}), n ? /* @__PURE__ */ a(K, {
|
|
8282
|
+
groups: Qu(e),
|
|
8255
8283
|
title: t.standardAnswer
|
|
8256
8284
|
}) : null]
|
|
8257
8285
|
});
|
|
8258
8286
|
}
|
|
8259
8287
|
//#endregion
|
|
8260
8288
|
//#region src/question/renderers/QuestionWordBuilderView.tsx
|
|
8261
|
-
function
|
|
8262
|
-
let i =
|
|
8289
|
+
function Nd({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
8290
|
+
let i = zi(t, !0, e), s = od(i, n.blankLabel);
|
|
8263
8291
|
return /* @__PURE__ */ o("div", {
|
|
8264
|
-
className:
|
|
8292
|
+
className: W.element,
|
|
8265
8293
|
children: [
|
|
8266
|
-
/* @__PURE__ */ a(
|
|
8294
|
+
/* @__PURE__ */ a(xu, {
|
|
8267
8295
|
content: i.content,
|
|
8268
8296
|
renderBlank: ({ blankId: e, index: t, label: r }) => /* @__PURE__ */ a("span", {
|
|
8269
8297
|
"aria-label": r || `${n.blankLabel}${t + 1}`,
|
|
8270
|
-
className:
|
|
8298
|
+
className: W["word-builder-blank"],
|
|
8271
8299
|
"data-blank-id": e
|
|
8272
8300
|
})
|
|
8273
8301
|
}),
|
|
8274
8302
|
/* @__PURE__ */ o("div", {
|
|
8275
|
-
className:
|
|
8303
|
+
className: W["candidate-section"],
|
|
8276
8304
|
children: [/* @__PURE__ */ a("span", {
|
|
8277
|
-
className:
|
|
8305
|
+
className: W["section-title"],
|
|
8278
8306
|
children: n.candidateOptions
|
|
8279
8307
|
}), /* @__PURE__ */ a("ol", {
|
|
8280
|
-
className:
|
|
8308
|
+
className: W["word-builder-candidate-list"],
|
|
8281
8309
|
children: i.candidateOptions.map((e, t) => /* @__PURE__ */ a("li", {
|
|
8282
|
-
className:
|
|
8310
|
+
className: W["candidate-item"],
|
|
8283
8311
|
children: e
|
|
8284
8312
|
}, `${e}-${t}`))
|
|
8285
8313
|
})]
|
|
8286
8314
|
}),
|
|
8287
|
-
r ? /* @__PURE__ */ a(
|
|
8315
|
+
r ? /* @__PURE__ */ a(K, {
|
|
8288
8316
|
groups: s,
|
|
8289
8317
|
title: n.standardAnswer
|
|
8290
8318
|
}) : null
|
|
@@ -8293,70 +8321,70 @@ function Md({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
|
8293
8321
|
}
|
|
8294
8322
|
//#endregion
|
|
8295
8323
|
//#region src/question/renderers/QuestionContentElementView.tsx
|
|
8296
|
-
function
|
|
8297
|
-
return e.type === t.type ? e.type === "richText" ? /* @__PURE__ */ a(
|
|
8324
|
+
function Pd({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
8325
|
+
return e.type === t.type ? e.type === "richText" ? /* @__PURE__ */ a(G, { content: t.content }) : e.type === "ordering" ? /* @__PURE__ */ a(Md, {
|
|
8298
8326
|
item: t,
|
|
8299
8327
|
messages: n,
|
|
8300
8328
|
showAnswer: r
|
|
8301
|
-
}) : e.type === "classification" ? /* @__PURE__ */ a(
|
|
8329
|
+
}) : e.type === "classification" ? /* @__PURE__ */ a(wd, {
|
|
8302
8330
|
item: t,
|
|
8303
8331
|
messages: n,
|
|
8304
8332
|
showAnswer: r
|
|
8305
|
-
}) : e.type === "textMarker" ? /* @__PURE__ */ a(
|
|
8333
|
+
}) : e.type === "textMarker" ? /* @__PURE__ */ a(id, {
|
|
8306
8334
|
item: t,
|
|
8307
8335
|
messages: n,
|
|
8308
8336
|
showAnswer: r
|
|
8309
|
-
}) :
|
|
8337
|
+
}) : Fd({
|
|
8310
8338
|
element: e,
|
|
8311
8339
|
item: t,
|
|
8312
8340
|
messages: n,
|
|
8313
8341
|
showAnswer: r
|
|
8314
8342
|
}) : null;
|
|
8315
8343
|
}
|
|
8316
|
-
function
|
|
8344
|
+
function Fd({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
8317
8345
|
switch (e.type) {
|
|
8318
|
-
case "choice": return /* @__PURE__ */ a(
|
|
8346
|
+
case "choice": return /* @__PURE__ */ a(jd, {
|
|
8319
8347
|
element: e,
|
|
8320
8348
|
item: t,
|
|
8321
8349
|
messages: n,
|
|
8322
8350
|
showAnswer: r
|
|
8323
8351
|
});
|
|
8324
|
-
case "fill": return /* @__PURE__ */ a(
|
|
8352
|
+
case "fill": return /* @__PURE__ */ a(Sd, {
|
|
8325
8353
|
item: t,
|
|
8326
8354
|
messages: n,
|
|
8327
8355
|
showAnswer: r
|
|
8328
8356
|
});
|
|
8329
|
-
case "inlineFill": return /* @__PURE__ */ a(
|
|
8357
|
+
case "inlineFill": return /* @__PURE__ */ a(Td, {
|
|
8330
8358
|
element: e,
|
|
8331
8359
|
item: t,
|
|
8332
8360
|
messages: n,
|
|
8333
8361
|
showAnswer: r
|
|
8334
8362
|
});
|
|
8335
|
-
case "wordBuilder": return /* @__PURE__ */ a(
|
|
8363
|
+
case "wordBuilder": return /* @__PURE__ */ a(Nd, {
|
|
8336
8364
|
element: e,
|
|
8337
8365
|
item: t,
|
|
8338
8366
|
messages: n,
|
|
8339
8367
|
showAnswer: r
|
|
8340
8368
|
});
|
|
8341
|
-
case "judgement": return /* @__PURE__ */ a(
|
|
8369
|
+
case "judgement": return /* @__PURE__ */ a(Dd, {
|
|
8342
8370
|
element: e,
|
|
8343
8371
|
item: t,
|
|
8344
8372
|
messages: n,
|
|
8345
8373
|
showAnswer: r
|
|
8346
8374
|
});
|
|
8347
|
-
case "lineConnect": return /* @__PURE__ */ a(
|
|
8375
|
+
case "lineConnect": return /* @__PURE__ */ a(Od, {
|
|
8348
8376
|
item: t,
|
|
8349
8377
|
messages: n,
|
|
8350
8378
|
showAnswer: r
|
|
8351
8379
|
});
|
|
8352
|
-
case "matching": return /* @__PURE__ */ a(
|
|
8380
|
+
case "matching": return /* @__PURE__ */ a(Ad, {
|
|
8353
8381
|
item: t,
|
|
8354
8382
|
messages: n,
|
|
8355
8383
|
showAnswer: r
|
|
8356
8384
|
});
|
|
8357
8385
|
}
|
|
8358
8386
|
}
|
|
8359
|
-
var
|
|
8387
|
+
var X = {
|
|
8360
8388
|
root: "_root_oqlnl_1",
|
|
8361
8389
|
empty: "_empty_oqlnl_19",
|
|
8362
8390
|
"element-list": "_element-list_oqlnl_31",
|
|
@@ -8370,23 +8398,23 @@ var Fd = {
|
|
|
8370
8398
|
//#region src/question/preview/QuestionCompositePreview.tsx
|
|
8371
8399
|
function Id({ messages: e, numberPath: t = [], renderChild: n, subquestionTemplates: r, value: i }) {
|
|
8372
8400
|
return i.children.length === 0 ? /* @__PURE__ */ a("div", {
|
|
8373
|
-
className:
|
|
8401
|
+
className: X.empty,
|
|
8374
8402
|
children: e.previewEmpty
|
|
8375
8403
|
}) : /* @__PURE__ */ a("div", {
|
|
8376
|
-
className:
|
|
8404
|
+
className: X.children,
|
|
8377
8405
|
children: i.children.map((i, s) => {
|
|
8378
8406
|
let c = [...t, s], l = qc(r, i.questionTypeKey);
|
|
8379
8407
|
return /* @__PURE__ */ o("section", {
|
|
8380
|
-
className:
|
|
8408
|
+
className: X.child,
|
|
8381
8409
|
children: [/* @__PURE__ */ o("div", {
|
|
8382
|
-
className:
|
|
8410
|
+
className: X["child-title"],
|
|
8383
8411
|
children: [
|
|
8384
8412
|
e.subquestion,
|
|
8385
8413
|
" ",
|
|
8386
8414
|
Hc(c)
|
|
8387
8415
|
]
|
|
8388
8416
|
}), l ? n(i, l.structure, c) : /* @__PURE__ */ a("div", {
|
|
8389
|
-
className:
|
|
8417
|
+
className: X.empty,
|
|
8390
8418
|
children: e.missingSubquestionTemplate
|
|
8391
8419
|
})]
|
|
8392
8420
|
}, i.id || s);
|
|
@@ -8404,13 +8432,13 @@ function Rd(e) {
|
|
|
8404
8432
|
}));
|
|
8405
8433
|
}
|
|
8406
8434
|
function zd({ className: e, messages: t, numberPath: n, showAnswer: r = !1, showExtraAttributes: s = !1, structure: c, subquestionTemplates: l = [], value: u }) {
|
|
8407
|
-
let d = /* @__PURE__ */ o(i, { children: [
|
|
8408
|
-
className:
|
|
8435
|
+
let d = /* @__PURE__ */ o(i, { children: [mi(c) ? null : /* @__PURE__ */ o("div", {
|
|
8436
|
+
className: X["element-list"],
|
|
8409
8437
|
children: [c.elements.map((e) => {
|
|
8410
|
-
let n =
|
|
8438
|
+
let n = xi(u, e, c.hasAnswer);
|
|
8411
8439
|
return /* @__PURE__ */ a("section", {
|
|
8412
|
-
className:
|
|
8413
|
-
children: /* @__PURE__ */ a(
|
|
8440
|
+
className: X.element,
|
|
8441
|
+
children: /* @__PURE__ */ a(Pd, {
|
|
8414
8442
|
element: e,
|
|
8415
8443
|
item: n,
|
|
8416
8444
|
messages: t,
|
|
@@ -8418,13 +8446,13 @@ function zd({ className: e, messages: t, numberPath: n, showAnswer: r = !1, show
|
|
|
8418
8446
|
})
|
|
8419
8447
|
}, e.elementKey);
|
|
8420
8448
|
}), s ? c.extras.map((e) => {
|
|
8421
|
-
let n =
|
|
8449
|
+
let n = Si(u, e);
|
|
8422
8450
|
return /* @__PURE__ */ o("section", {
|
|
8423
|
-
className:
|
|
8451
|
+
className: X.element,
|
|
8424
8452
|
children: [/* @__PURE__ */ a("h3", {
|
|
8425
|
-
className:
|
|
8453
|
+
className: X["section-title"],
|
|
8426
8454
|
children: e.name
|
|
8427
|
-
}), /* @__PURE__ */ a(
|
|
8455
|
+
}), /* @__PURE__ */ a(Pd, {
|
|
8428
8456
|
element: Vd(e),
|
|
8429
8457
|
item: Hd(n),
|
|
8430
8458
|
messages: t,
|
|
@@ -8448,15 +8476,15 @@ function zd({ className: e, messages: t, numberPath: n, showAnswer: r = !1, show
|
|
|
8448
8476
|
value: u
|
|
8449
8477
|
})] });
|
|
8450
8478
|
return /* @__PURE__ */ a("div", {
|
|
8451
|
-
className:
|
|
8479
|
+
className: ru(X.root, e),
|
|
8452
8480
|
children: Bd(c, u) ? /* @__PURE__ */ a("div", {
|
|
8453
|
-
className:
|
|
8481
|
+
className: X.empty,
|
|
8454
8482
|
children: t.previewEmpty
|
|
8455
8483
|
}) : d
|
|
8456
8484
|
});
|
|
8457
8485
|
}
|
|
8458
8486
|
function Bd(e, t) {
|
|
8459
|
-
return
|
|
8487
|
+
return mi(e) && t.children.length === 0;
|
|
8460
8488
|
}
|
|
8461
8489
|
function Vd(e) {
|
|
8462
8490
|
return {
|
|
@@ -9384,4 +9412,4 @@ function Ef(e) {
|
|
|
9384
9412
|
return (t = (n = (r = e.elements[0]) == null ? void 0 : r.clientId) == null ? (i = e.extras[0]) == null ? void 0 : i.clientId : n) == null ? null : t;
|
|
9385
9413
|
}
|
|
9386
9414
|
//#endregion
|
|
9387
|
-
export { tl as QuestionContentEditor,
|
|
9415
|
+
export { tl as QuestionContentEditor, pd as QuestionPlayer, Rd as QuestionPreview, G as QuestionRichContentView, wf as QuestionStructureEditor, $i as addBlankToGroup, ra as assignBlankToAnswerGroup, tc as cn, ia as createBlankAnswerGroupWithBlank, hi as createEmptyQuestionContentDraft, rr as createEmptyQuestionData, vl as createEmptyQuestionPlayerResponse, ar as createEmptyQuestionResponse, Ir as createEmptyQuestionStructureDraft, ji as createQuestionContentDraftFromSerialized, il as createQuestionContentStructureFromDraft, al as createQuestionPreviewDraft, Rr as createQuestionStructureElement, Lr as createQuestionStructureExtra, M as createRichContentValue, gi as createRichContentValueFromDocument, v as createRichTextContent, ea as deleteBlankFromGroup, Hr as deleteQuestionStructureElement, Vr as deleteQuestionStructureExtra, aa as detachBlankFromAnswerGroup, qc as findQuestionContentSubquestionTemplate, Si as getQuestionContentExtraItem, xi as getQuestionContentItem, Ei as getQuestionContentJudgementOptions, Ci as getQuestionContentOptionMarker, yi as getQuestionContentTextMarkerAnswerText, sl as getQuestionStructureDraftChangeKind, j as getQuestionStructureElementDefaultEnName, A as getQuestionStructureElementDefaultName, Yr as getQuestionStructureExtraDefaultEnName, Jr as getQuestionStructureExtraDefaultName, bi as getRichContentDocument, na as getSharedBlankAnswerGroups, mi as isCompositeQuestionContentStructure, sr as isCompositeQuestionType, ki as isQuestionContentDraftEmpty, Kc as isQuestionContentSubquestionTemplateMatch, Ur as moveQuestionStructureElement, Bi as normalizeFillTextCandidateState, ir as normalizeQuestionData, or as normalizeQuestionResponse, y as normalizeRichTextContent, Ar as questionStructureElementTypes, jr as questionStructureExtraKeys, Ai as serializeQuestionContentDraft, ol as serializeQuestionStructureDraft, Ni as updateQuestionContentExtraItem, Mi as updateQuestionContentItem, Gr as updateQuestionStructureElement, Wr as updateQuestionStructureExtra, Kr as updateQuestionStructureGlobalConfig, qr as updateQuestionStructureMetadata, ur as validateQuestionDataElementAlignment };
|