@yungu-fed/question-editor 0.1.5 → 0.1.6
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.js +146 -144
- package/dist/index.mjs +144 -142
- 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/types.d.ts +8 -8
- package/dist/model/types.d.ts.map +1 -1
- package/dist/question/content-editor/helpers.d.ts +4 -4
- 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/types.d.ts +20 -20
- package/dist/question/content-editor/types.d.ts.map +1 -1
- package/dist/question/i18n/messages.d.ts +1 -1
- 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"
|
|
@@ -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
|
}],
|
|
@@ -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];
|
|
@@ -1167,7 +1167,7 @@ function Nn(e, t, n, r) {
|
|
|
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
1169
|
allowReuse: a.some((e) => e.allowReuse),
|
|
1170
|
-
|
|
1170
|
+
answers: Ln(t, (e) => Rn(Pn(a, e), n, s, r)),
|
|
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;
|
|
@@ -1788,7 +1788,7 @@ function _i(e, n, r) {
|
|
|
1788
1788
|
return n && Go(n) ? n : r ? t(r, { plugins: [It] }) : Ro(e);
|
|
1789
1789
|
}
|
|
1790
1790
|
function vi(e) {
|
|
1791
|
-
return Vt(e.content.json).filter((t) => e.
|
|
1791
|
+
return Vt(e.content.json).filter((t) => e.answers.includes(t.markerId)).map((e) => e.text.trim()).filter(Boolean).join(" / ");
|
|
1792
1792
|
}
|
|
1793
1793
|
function yi(e) {
|
|
1794
1794
|
return Go(e.json) ? e.json : Ro(e.text);
|
|
@@ -1825,7 +1825,7 @@ function Ei(e, t) {
|
|
|
1825
1825
|
}
|
|
1826
1826
|
function Di(e, t) {
|
|
1827
1827
|
let n = Ei(e, t);
|
|
1828
|
-
return e.
|
|
1828
|
+
return e.answers.optionIds.reduce((e, t) => {
|
|
1829
1829
|
let r = n.find((e) => e.optionId === t);
|
|
1830
1830
|
return r ? [...e, r] : e;
|
|
1831
1831
|
}, []);
|
|
@@ -1898,7 +1898,7 @@ function Ii(e, t, n, r) {
|
|
|
1898
1898
|
function Li(e, t, n) {
|
|
1899
1899
|
let r = gi(t.text, t.json, t.html), i = Bt(r.json);
|
|
1900
1900
|
return k(k({}, e), {}, {
|
|
1901
|
-
|
|
1901
|
+
answers: n ? xo(e.answers, i) : [],
|
|
1902
1902
|
content: r,
|
|
1903
1903
|
markers: i
|
|
1904
1904
|
});
|
|
@@ -1906,7 +1906,7 @@ function Li(e, t, n) {
|
|
|
1906
1906
|
function Ri(e, t, n) {
|
|
1907
1907
|
let r = Wi(e.blanks);
|
|
1908
1908
|
return k(k({}, e), {}, {
|
|
1909
|
-
|
|
1909
|
+
answers: t ? Gi(e.answers, r) : {},
|
|
1910
1910
|
blanks: r,
|
|
1911
1911
|
candidateOptions: Hi(e.candidateOptions, n.config.builderMode)
|
|
1912
1912
|
});
|
|
@@ -1915,7 +1915,7 @@ function zi(e, t, n) {
|
|
|
1915
1915
|
if (t.config.candidateMode === "sharedPool") {
|
|
1916
1916
|
let r = Vi(e.candidateOptions, "option_");
|
|
1917
1917
|
return k(k({}, e), {}, {
|
|
1918
|
-
|
|
1918
|
+
answers: n ? Xi(e.answers, e.blanks, r.map((e) => e.optionId), t.config.allowCandidateReuse) : [],
|
|
1919
1919
|
blankOptionGroups: void 0,
|
|
1920
1920
|
candidateOptions: r
|
|
1921
1921
|
});
|
|
@@ -1923,13 +1923,13 @@ function zi(e, t, n) {
|
|
|
1923
1923
|
if (t.config.candidateMode === "perBlankOptions") {
|
|
1924
1924
|
let t = Ji(e.blankOptionGroups, e.blanks), r = new Map(t.map((e) => [e.blankId, e.options.map((e) => e.optionId)]));
|
|
1925
1925
|
return k(k({}, e), {}, {
|
|
1926
|
-
|
|
1926
|
+
answers: n ? Zi(e.answers, e.blanks, r) : [],
|
|
1927
1927
|
blankOptionGroups: t,
|
|
1928
1928
|
candidateOptions: void 0
|
|
1929
1929
|
});
|
|
1930
1930
|
}
|
|
1931
1931
|
return k(k({}, e), {}, {
|
|
1932
|
-
|
|
1932
|
+
answers: n ? ea(e.answers, e.blanks) : [],
|
|
1933
1933
|
blankOptionGroups: void 0,
|
|
1934
1934
|
candidateOptions: void 0
|
|
1935
1935
|
});
|
|
@@ -2021,7 +2021,7 @@ function Zi(e, t, n) {
|
|
|
2021
2021
|
function Qi(e) {
|
|
2022
2022
|
let t = Lo(e.blanks), n = [...e.blanks, t];
|
|
2023
2023
|
return k(k({}, e), {}, {
|
|
2024
|
-
|
|
2024
|
+
answers: ea([...e.answers, {
|
|
2025
2025
|
answerPools: [M()],
|
|
2026
2026
|
blankIds: [t]
|
|
2027
2027
|
}], n),
|
|
@@ -2030,9 +2030,9 @@ function Qi(e) {
|
|
|
2030
2030
|
}
|
|
2031
2031
|
function $i(e, t) {
|
|
2032
2032
|
if (e.blanks.length <= 1) return e;
|
|
2033
|
-
let n = e.blanks.filter((e) => e !== t), r = ea(e.
|
|
2033
|
+
let n = e.blanks.filter((e) => e !== t), r = ea(e.answers.map((e) => k(k({}, e), {}, { blankIds: e.blankIds.filter((e) => e !== t) })).filter((e) => e.blankIds.length > 0), n);
|
|
2034
2034
|
return k(k({}, e), {}, {
|
|
2035
|
-
|
|
2035
|
+
answers: r,
|
|
2036
2036
|
blanks: n.length ? n : e.blanks
|
|
2037
2037
|
});
|
|
2038
2038
|
}
|
|
@@ -2056,8 +2056,8 @@ function ta(e) {
|
|
|
2056
2056
|
}), e), []);
|
|
2057
2057
|
}
|
|
2058
2058
|
function na(e, t, n) {
|
|
2059
|
-
let r = e.
|
|
2060
|
-
return !i || i.blankIds.length < 2 || i.blankIds.includes(t) ? e : k(k({}, e), {}, {
|
|
2059
|
+
let r = e.answers.find((e) => e.blankIds.includes(t)), i = e.answers.slice(n, n + 1)[0];
|
|
2060
|
+
return !i || i.blankIds.length < 2 || i.blankIds.includes(t) ? e : k(k({}, e), {}, { answers: ea(e.answers.map((e, r) => r === n ? k(k({}, e), {}, {
|
|
2061
2061
|
answerPools: as(e.answerPools),
|
|
2062
2062
|
blankIds: [...e.blankIds, t]
|
|
2063
2063
|
}) : k(k({}, e), {}, {
|
|
@@ -2071,22 +2071,22 @@ function na(e, t, n) {
|
|
|
2071
2071
|
function ra(e, t, n) {
|
|
2072
2072
|
var r;
|
|
2073
2073
|
if (t === n || !e.blanks.includes(t) || !e.blanks.includes(n)) return e;
|
|
2074
|
-
let i = e.
|
|
2075
|
-
return k(k({}, e), {}, {
|
|
2074
|
+
let i = e.answers.find((e) => e.blankIds.includes(t));
|
|
2075
|
+
return k(k({}, e), {}, { answers: ea([...e.answers.map((e) => k(k({}, e), {}, { blankIds: e.blankIds.filter((e) => e !== t && e !== n) })), {
|
|
2076
2076
|
answerPools: as((r = i == null ? void 0 : i.answerPools) == null ? [] : r),
|
|
2077
2077
|
blankIds: [t, n]
|
|
2078
2078
|
}], e.blanks) });
|
|
2079
2079
|
}
|
|
2080
2080
|
function ia(e, t) {
|
|
2081
2081
|
var n;
|
|
2082
|
-
let r = e.
|
|
2083
|
-
return k(k({}, e), {}, {
|
|
2082
|
+
let r = e.answers.find((e) => e.blankIds.includes(t));
|
|
2083
|
+
return k(k({}, e), {}, { answers: ea([...e.answers.map((e) => k(k({}, e), {}, { blankIds: e.blankIds.filter((e) => e !== t) })), {
|
|
2084
2084
|
answerPools: as((n = r == null ? void 0 : r.answerPools) == null ? [] : n),
|
|
2085
2085
|
blankIds: [t]
|
|
2086
2086
|
}], e.blanks) });
|
|
2087
2087
|
}
|
|
2088
2088
|
function aa(e, t, n) {
|
|
2089
|
-
return k(k({}, e), {}, {
|
|
2089
|
+
return k(k({}, e), {}, { answers: ea(e.answers.map((e, r) => r === t ? k(k({}, e), {}, { answerPools: as(n) }) : e), e.blanks) });
|
|
2090
2090
|
}
|
|
2091
2091
|
function oa(e) {
|
|
2092
2092
|
return ya(e);
|
|
@@ -2098,7 +2098,7 @@ function ca(e, t) {
|
|
|
2098
2098
|
if (!e.options[t] || e.options.length <= 1) return e;
|
|
2099
2099
|
let n = e.options.filter((e, n) => n !== t);
|
|
2100
2100
|
return k(k({}, e), {}, {
|
|
2101
|
-
|
|
2101
|
+
answers: ge(e.answers, n, "multiple"),
|
|
2102
2102
|
options: n
|
|
2103
2103
|
});
|
|
2104
2104
|
}
|
|
@@ -2122,7 +2122,7 @@ function pa(e, t) {
|
|
|
2122
2122
|
if (!e.options[t] || e.options.length <= 1) return e;
|
|
2123
2123
|
let n = e.options.filter((e, n) => n !== t);
|
|
2124
2124
|
return k(k({}, e), {}, {
|
|
2125
|
-
|
|
2125
|
+
answers: ge(e.answers, n, "multiple"),
|
|
2126
2126
|
options: n
|
|
2127
2127
|
});
|
|
2128
2128
|
}
|
|
@@ -2136,7 +2136,7 @@ function ga(e, t, n) {
|
|
|
2136
2136
|
va(e);
|
|
2137
2137
|
let r = fe(e.columns, t.config.renderer), i = he(e.options, r);
|
|
2138
2138
|
return k(k({}, e), {}, {
|
|
2139
|
-
|
|
2139
|
+
answers: n ? ge(e.answers, i, t.config.selectionType) : { optionIds: [] },
|
|
2140
2140
|
columns: r,
|
|
2141
2141
|
options: i
|
|
2142
2142
|
});
|
|
@@ -2153,7 +2153,7 @@ function _a(e, t, n) {
|
|
|
2153
2153
|
};
|
|
2154
2154
|
}
|
|
2155
2155
|
function va(e) {
|
|
2156
|
-
let t = e, n = t.
|
|
2156
|
+
let t = e, n = t.answers;
|
|
2157
2157
|
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
2158
|
}
|
|
2159
2159
|
function ya(e) {
|
|
@@ -2162,7 +2162,7 @@ function ya(e) {
|
|
|
2162
2162
|
function ba(e, t, n) {
|
|
2163
2163
|
let r = co(e.columns, t);
|
|
2164
2164
|
return k(k({}, e), {}, {
|
|
2165
|
-
|
|
2165
|
+
answers: n ? go(e.answers, r) : {},
|
|
2166
2166
|
columns: r
|
|
2167
2167
|
});
|
|
2168
2168
|
}
|
|
@@ -2175,7 +2175,7 @@ function Sa(e, t) {
|
|
|
2175
2175
|
if (e.columns.length <= Re.min) return e;
|
|
2176
2176
|
let n = e.columns.filter((e) => e.columnId !== t);
|
|
2177
2177
|
return k(k({}, e), {}, {
|
|
2178
|
-
|
|
2178
|
+
answers: go(e.answers, n),
|
|
2179
2179
|
columns: n
|
|
2180
2180
|
});
|
|
2181
2181
|
}
|
|
@@ -2191,7 +2191,7 @@ function wa(e, t) {
|
|
|
2191
2191
|
function Ta(e, t) {
|
|
2192
2192
|
let n = e.columns.map((e) => e.items.length <= 1 ? e : k(k({}, e), {}, { items: e.items.filter((e) => e.itemId !== t) }));
|
|
2193
2193
|
return k(k({}, e), {}, {
|
|
2194
|
-
|
|
2194
|
+
answers: go(e.answers, n),
|
|
2195
2195
|
columns: n
|
|
2196
2196
|
});
|
|
2197
2197
|
}
|
|
@@ -2204,7 +2204,7 @@ function Da(e, t, n) {
|
|
|
2204
2204
|
function Oa(e, t, n) {
|
|
2205
2205
|
let r = _o(e.columns, t);
|
|
2206
2206
|
return k(k({}, e), {}, {
|
|
2207
|
-
|
|
2207
|
+
answers: n ? bo(e.answers, r) : {},
|
|
2208
2208
|
columns: r
|
|
2209
2209
|
});
|
|
2210
2210
|
}
|
|
@@ -2220,7 +2220,7 @@ function Aa(e, t) {
|
|
|
2220
2220
|
function ja(e, t) {
|
|
2221
2221
|
let n = e.columns.map((e) => e.items.length <= 1 ? e : k(k({}, e), {}, { items: e.items.filter((e) => e.itemId !== t) }));
|
|
2222
2222
|
return k(k({}, e), {}, {
|
|
2223
|
-
|
|
2223
|
+
answers: bo(e.answers, n),
|
|
2224
2224
|
columns: n
|
|
2225
2225
|
});
|
|
2226
2226
|
}
|
|
@@ -2239,7 +2239,7 @@ function Fa(e, t, n) {
|
|
|
2239
2239
|
function Ia(e, t) {
|
|
2240
2240
|
let n = to(e.categories), r = no(e.items);
|
|
2241
2241
|
return k(k({}, e), {}, {
|
|
2242
|
-
|
|
2242
|
+
answers: t ? Oe(e.answers, n, r) : {},
|
|
2243
2243
|
categories: n,
|
|
2244
2244
|
items: r
|
|
2245
2245
|
});
|
|
@@ -2251,7 +2251,7 @@ function Ra(e, t) {
|
|
|
2251
2251
|
if (e.categories.length <= 1) return e;
|
|
2252
2252
|
let n = e.categories.filter((e) => e.id !== t);
|
|
2253
2253
|
return k(k({}, e), {}, {
|
|
2254
|
-
|
|
2254
|
+
answers: Oe(e.answers, n, e.items),
|
|
2255
2255
|
categories: n
|
|
2256
2256
|
});
|
|
2257
2257
|
}
|
|
@@ -2265,7 +2265,7 @@ function Va(e, t) {
|
|
|
2265
2265
|
if (e.items.length <= 1) return e;
|
|
2266
2266
|
let n = e.items.filter((e) => e.id !== t);
|
|
2267
2267
|
return k(k({}, e), {}, {
|
|
2268
|
-
|
|
2268
|
+
answers: Oe(e.answers, e.categories, n),
|
|
2269
2269
|
items: n
|
|
2270
2270
|
});
|
|
2271
2271
|
}
|
|
@@ -2278,20 +2278,20 @@ function Ua(e, t, n) {
|
|
|
2278
2278
|
function Wa(e, t) {
|
|
2279
2279
|
let n = So(e.sortOptions);
|
|
2280
2280
|
return k(k({}, e), {}, {
|
|
2281
|
-
|
|
2281
|
+
answers: t ? Co(e.answers, n) : [],
|
|
2282
2282
|
sortOptions: n
|
|
2283
2283
|
});
|
|
2284
2284
|
}
|
|
2285
2285
|
function Ga(e, t) {
|
|
2286
2286
|
let n = new Set(e.sortOptions.map((e) => e.id)), r = wo(Do(Eo(e.sortOptions.length), n));
|
|
2287
2287
|
return Wa(k(k({}, e), {}, {
|
|
2288
|
-
|
|
2288
|
+
answers: [...e.answers, r.id],
|
|
2289
2289
|
sortOptions: [...e.sortOptions, r]
|
|
2290
2290
|
}), t);
|
|
2291
2291
|
}
|
|
2292
2292
|
function Ka(e, t, n) {
|
|
2293
2293
|
return e.sortOptions.length <= 1 ? e : Wa(k(k({}, e), {}, {
|
|
2294
|
-
|
|
2294
|
+
answers: e.answers.filter((e) => e !== t),
|
|
2295
2295
|
sortOptions: e.sortOptions.filter((e) => e.id !== t)
|
|
2296
2296
|
}), n);
|
|
2297
2297
|
}
|
|
@@ -2299,10 +2299,10 @@ function qa(e, t, n, r) {
|
|
|
2299
2299
|
return Wa(k(k({}, e), {}, { sortOptions: e.sortOptions.map((e) => e.id === t ? k(k({}, e), {}, { content: n }) : e) }), r);
|
|
2300
2300
|
}
|
|
2301
2301
|
function Ja(e, t, n, r) {
|
|
2302
|
-
let i = Co(e.
|
|
2302
|
+
let i = Co(e.answers, e.sortOptions), a = i.indexOf(t), o = a + n;
|
|
2303
2303
|
if (a < 0 || o < 0 || o >= i.length) return e;
|
|
2304
2304
|
let s = [...i], [c] = s.splice(a, 1);
|
|
2305
|
-
return s.splice(o, 0, c), Wa(k(k({}, e), {}, {
|
|
2305
|
+
return s.splice(o, 0, c), Wa(k(k({}, e), {}, { answers: s }), r);
|
|
2306
2306
|
}
|
|
2307
2307
|
function Ya(e, t, n, r) {
|
|
2308
2308
|
let i = Co(e, t), a = i.indexOf(n), o = a + r;
|
|
@@ -2316,18 +2316,18 @@ function Xa(e, t) {
|
|
|
2316
2316
|
elementKey: e.elementKey,
|
|
2317
2317
|
type: "richText"
|
|
2318
2318
|
} : e.type === "textMarker" ? {
|
|
2319
|
-
|
|
2319
|
+
answers: [],
|
|
2320
2320
|
content: gi(),
|
|
2321
2321
|
elementKey: e.elementKey,
|
|
2322
2322
|
markers: [],
|
|
2323
2323
|
type: "textMarker"
|
|
2324
2324
|
} : e.type === "ordering" ? Wa({
|
|
2325
|
-
|
|
2325
|
+
answers: [],
|
|
2326
2326
|
elementKey: e.elementKey,
|
|
2327
2327
|
sortOptions: [],
|
|
2328
2328
|
type: "ordering"
|
|
2329
2329
|
}, t) : e.type === "classification" ? Ia({
|
|
2330
|
-
|
|
2330
|
+
answers: {},
|
|
2331
2331
|
categories: [],
|
|
2332
2332
|
elementKey: e.elementKey,
|
|
2333
2333
|
items: [],
|
|
@@ -2337,14 +2337,14 @@ function Xa(e, t) {
|
|
|
2337
2337
|
function Za(e, t) {
|
|
2338
2338
|
switch (e.type) {
|
|
2339
2339
|
case "inlineFill": return zi({
|
|
2340
|
-
|
|
2340
|
+
answers: [],
|
|
2341
2341
|
blanks: [],
|
|
2342
2342
|
content: M(),
|
|
2343
2343
|
elementKey: e.elementKey,
|
|
2344
2344
|
type: "inlineFill"
|
|
2345
2345
|
}, e, t);
|
|
2346
2346
|
case "wordBuilder": return Ri({
|
|
2347
|
-
|
|
2347
|
+
answers: {},
|
|
2348
2348
|
blanks: ["blank_0"],
|
|
2349
2349
|
candidateOptions: Ui(e.config.builderMode),
|
|
2350
2350
|
content: Ki(),
|
|
@@ -2353,18 +2353,18 @@ function Za(e, t) {
|
|
|
2353
2353
|
}, t, e);
|
|
2354
2354
|
case "choice": return eo(e);
|
|
2355
2355
|
case "judgement": return {
|
|
2356
|
-
|
|
2356
|
+
answers: [],
|
|
2357
2357
|
elementKey: e.elementKey,
|
|
2358
2358
|
type: "judgement"
|
|
2359
2359
|
};
|
|
2360
2360
|
case "lineConnect": return ba({
|
|
2361
|
-
|
|
2361
|
+
answers: {},
|
|
2362
2362
|
columns: [],
|
|
2363
2363
|
elementKey: e.elementKey,
|
|
2364
2364
|
type: "lineConnect"
|
|
2365
2365
|
}, e, t);
|
|
2366
2366
|
case "matching": return Oa({
|
|
2367
|
-
|
|
2367
|
+
answers: {},
|
|
2368
2368
|
columns: [],
|
|
2369
2369
|
elementKey: e.elementKey,
|
|
2370
2370
|
type: "matching"
|
|
@@ -2374,7 +2374,7 @@ function Za(e, t) {
|
|
|
2374
2374
|
function Qa(e, t) {
|
|
2375
2375
|
let n = Array.from({ length: oi }, (e, t) => Fo(t));
|
|
2376
2376
|
return {
|
|
2377
|
-
|
|
2377
|
+
answers: t ? [{
|
|
2378
2378
|
answerPools: [M()],
|
|
2379
2379
|
blankIds: n
|
|
2380
2380
|
}] : [],
|
|
@@ -2393,7 +2393,7 @@ function $a(e) {
|
|
|
2393
2393
|
function eo(e) {
|
|
2394
2394
|
let t = de(e.config.renderer), n = pe(t);
|
|
2395
2395
|
return {
|
|
2396
|
-
|
|
2396
|
+
answers: { optionIds: [] },
|
|
2397
2397
|
columns: t,
|
|
2398
2398
|
elementKey: e.elementKey,
|
|
2399
2399
|
options: n,
|
|
@@ -2615,14 +2615,14 @@ function Ko(e, t = [ti]) {
|
|
|
2615
2615
|
return Go(e) ? n(e, { plugins: t }) : Ro("");
|
|
2616
2616
|
}
|
|
2617
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.
|
|
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.answers.every(Zo) : Jo(e);
|
|
2619
2619
|
}
|
|
2620
2620
|
function Jo(e) {
|
|
2621
2621
|
switch (e.type) {
|
|
2622
2622
|
case "inlineFill": return Yo(e);
|
|
2623
2623
|
case "wordBuilder": return Xo(e);
|
|
2624
2624
|
case "choice": return $o(e);
|
|
2625
|
-
case "judgement": return e.
|
|
2625
|
+
case "judgement": return e.answers.length === 0;
|
|
2626
2626
|
case "lineConnect": return ts(e);
|
|
2627
2627
|
case "matching": return rs(e);
|
|
2628
2628
|
case "ordering": return is(e);
|
|
@@ -2630,10 +2630,10 @@ function Jo(e) {
|
|
|
2630
2630
|
}
|
|
2631
2631
|
function Yo(e) {
|
|
2632
2632
|
var t, n, r, i;
|
|
2633
|
-
return N(e.content) && e.
|
|
2633
|
+
return N(e.content) && e.answers.every(Zo) && ((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(Qo)) == null ? !0 : r);
|
|
2634
2634
|
}
|
|
2635
2635
|
function Xo(e) {
|
|
2636
|
-
return N(e.content) && e.candidateOptions.every((e) => e.trim() === "") && Object.values(e.
|
|
2636
|
+
return N(e.content) && e.candidateOptions.every((e) => e.trim() === "") && Object.values(e.answers).every((e) => e.trim() === "");
|
|
2637
2637
|
}
|
|
2638
2638
|
function Zo(e) {
|
|
2639
2639
|
return "answerOptionIds" in e ? e.answerOptionIds.length === 0 : "answerOptionId" in e ? e.answerOptionId.length === 0 : e.answerPools.every(N);
|
|
@@ -2643,22 +2643,22 @@ function Qo(e) {
|
|
|
2643
2643
|
return (t = e == null ? void 0 : e.options.every((e) => N(e.content))) == null ? !0 : t;
|
|
2644
2644
|
}
|
|
2645
2645
|
function $o(e) {
|
|
2646
|
-
return e.
|
|
2646
|
+
return e.answers.optionIds.length === 0 && e.options.every((e) => e.cells.every(N));
|
|
2647
2647
|
}
|
|
2648
2648
|
function es(e) {
|
|
2649
|
-
return Object.keys(e.
|
|
2649
|
+
return Object.keys(e.answers).length === 0 && e.categories.every((e) => N(e.content)) && e.items.every((e) => N(e.content));
|
|
2650
2650
|
}
|
|
2651
2651
|
function ts(e) {
|
|
2652
2652
|
return ns(e);
|
|
2653
2653
|
}
|
|
2654
2654
|
function ns(e) {
|
|
2655
|
-
return Object.keys(e.
|
|
2655
|
+
return Object.keys(e.answers).length === 0 && e.columns.every((e) => e.items.every((e) => N(e.content)));
|
|
2656
2656
|
}
|
|
2657
2657
|
function rs(e) {
|
|
2658
2658
|
return ns(e);
|
|
2659
2659
|
}
|
|
2660
2660
|
function is(e) {
|
|
2661
|
-
return e.
|
|
2661
|
+
return e.answers.length === 0 && e.sortOptions.every((e) => N(e.content));
|
|
2662
2662
|
}
|
|
2663
2663
|
function as(e) {
|
|
2664
2664
|
return e.length ? e : [M()];
|
|
@@ -2668,16 +2668,16 @@ function os(e) {
|
|
|
2668
2668
|
content: e.content,
|
|
2669
2669
|
type: "richText"
|
|
2670
2670
|
} : e.type === "ordering" ? {
|
|
2671
|
-
|
|
2671
|
+
answers: Co(e.answers, e.sortOptions),
|
|
2672
2672
|
sortOptions: So(e.sortOptions),
|
|
2673
2673
|
type: "ordering"
|
|
2674
2674
|
} : e.type === "classification" ? {
|
|
2675
|
-
|
|
2675
|
+
answers: e.answers,
|
|
2676
2676
|
categories: e.categories,
|
|
2677
2677
|
items: e.items,
|
|
2678
2678
|
type: "classification"
|
|
2679
2679
|
} : e.type === "fill" ? {
|
|
2680
|
-
|
|
2680
|
+
answers: e.answers,
|
|
2681
2681
|
blanks: e.blanks,
|
|
2682
2682
|
type: "fill"
|
|
2683
2683
|
} : ss(e);
|
|
@@ -2686,7 +2686,7 @@ function ss(e) {
|
|
|
2686
2686
|
switch (e.type) {
|
|
2687
2687
|
case "inlineFill": return gs(e);
|
|
2688
2688
|
case "wordBuilder": return {
|
|
2689
|
-
|
|
2689
|
+
answers: e.answers,
|
|
2690
2690
|
blanks: e.blanks,
|
|
2691
2691
|
candidateOptions: e.candidateOptions,
|
|
2692
2692
|
content: e.content,
|
|
@@ -2694,21 +2694,21 @@ function ss(e) {
|
|
|
2694
2694
|
};
|
|
2695
2695
|
case "choice": return _s(e);
|
|
2696
2696
|
case "judgement": return {
|
|
2697
|
-
|
|
2697
|
+
answers: e.answers,
|
|
2698
2698
|
type: "judgement"
|
|
2699
2699
|
};
|
|
2700
2700
|
case "lineConnect": return {
|
|
2701
|
-
|
|
2701
|
+
answers: e.answers,
|
|
2702
2702
|
columns: e.columns,
|
|
2703
2703
|
type: "lineConnect"
|
|
2704
2704
|
};
|
|
2705
2705
|
case "matching": return {
|
|
2706
|
-
|
|
2706
|
+
answers: e.answers,
|
|
2707
2707
|
columns: e.columns,
|
|
2708
2708
|
type: "matching"
|
|
2709
2709
|
};
|
|
2710
2710
|
case "textMarker": return {
|
|
2711
|
-
|
|
2711
|
+
answers: xo(e.answers, e.markers),
|
|
2712
2712
|
content: gi(e.content.text, e.content.json, e.content.html),
|
|
2713
2713
|
markers: e.markers,
|
|
2714
2714
|
type: "textMarker"
|
|
@@ -2751,14 +2751,14 @@ function hs(e) {
|
|
|
2751
2751
|
};
|
|
2752
2752
|
}
|
|
2753
2753
|
function gs(e) {
|
|
2754
|
-
return k(k(k({
|
|
2754
|
+
return k(k(k({ answers: e.answers }, e.blankOptionGroups ? { blankOptionGroups: e.blankOptionGroups } : {}), {}, { blanks: e.blanks }, e.candidateOptions ? { candidateOptions: e.candidateOptions } : {}), {}, {
|
|
2755
2755
|
content: e.content,
|
|
2756
2756
|
type: "inlineFill"
|
|
2757
2757
|
});
|
|
2758
2758
|
}
|
|
2759
2759
|
function _s(e) {
|
|
2760
2760
|
return {
|
|
2761
|
-
|
|
2761
|
+
answers: e.answers,
|
|
2762
2762
|
columns: e.columns,
|
|
2763
2763
|
options: e.options,
|
|
2764
2764
|
type: "choice"
|
|
@@ -2804,6 +2804,7 @@ var Cs = {
|
|
|
2804
2804
|
},
|
|
2805
2805
|
blank: {
|
|
2806
2806
|
answer: "Answer",
|
|
2807
|
+
answers: "Answers",
|
|
2807
2808
|
answerAssignmentAria: "Blank {{index}} answer group",
|
|
2808
2809
|
answerGroup: "Answer Group {{index}}",
|
|
2809
2810
|
answerPool: "Group {{groupIndex}} answer {{poolIndex}}",
|
|
@@ -2988,6 +2989,7 @@ var Cs = {
|
|
|
2988
2989
|
},
|
|
2989
2990
|
blank: {
|
|
2990
2991
|
answer: "\u7b54\u6848",
|
|
2992
|
+
answers: "\u7b54\u6848",
|
|
2991
2993
|
answerAssignmentAria: "\u7a7a {{index}} \u7b54\u6848\u7ec4",
|
|
2992
2994
|
answerGroup: "\u7b54\u6848\u7ec4 {{index}}",
|
|
2993
2995
|
answerPool: "\u7b2c {{groupIndex}} \u7ec4\u7b54\u6848 {{poolIndex}}",
|
|
@@ -3509,25 +3511,25 @@ function R({ controls: e, disabled: t, editorRef: n, label: r, onChange: i, plac
|
|
|
3509
3511
|
//#endregion
|
|
3510
3512
|
//#region src/question/content-editor/QuestionContentBlankGroupEditor.tsx
|
|
3511
3513
|
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 ? ea(n.
|
|
3514
|
+
let { t: l } = c, [u, d] = m(null), [f, p] = m(null), h = t ? ea(n.answers, n.blanks) : [], g = ta(h);
|
|
3513
3515
|
function _(e) {
|
|
3514
|
-
r(k(k({}, e), {}, {
|
|
3516
|
+
r(k(k({}, e), {}, { answers: t ? ea(e.answers, e.blanks) : [] }));
|
|
3515
3517
|
}
|
|
3516
3518
|
function v(e, t, r) {
|
|
3517
3519
|
let i = Ys(h, e);
|
|
3518
|
-
i && _(aa(k(k({}, n), {}, {
|
|
3520
|
+
i && _(aa(k(k({}, n), {}, { answers: h }), e, i.answerPools.map((e, n) => n === t ? r : e)));
|
|
3519
3521
|
}
|
|
3520
3522
|
function y(e) {
|
|
3521
3523
|
let t = Ys(h, e);
|
|
3522
|
-
t && _(aa(k(k({}, n), {}, {
|
|
3524
|
+
t && _(aa(k(k({}, n), {}, { answers: h }), e, [...t.answerPools, M()]));
|
|
3523
3525
|
}
|
|
3524
3526
|
function b(e, t) {
|
|
3525
3527
|
let r = Ys(h, e);
|
|
3526
|
-
r && _(aa(k(k({}, n), {}, {
|
|
3528
|
+
r && _(aa(k(k({}, n), {}, { answers: h }), e, r.answerPools.filter((e, n) => n !== t)));
|
|
3527
3529
|
}
|
|
3528
3530
|
function x(e, t) {
|
|
3529
3531
|
if (t === "__single__") {
|
|
3530
|
-
_(ia(k(k({}, n), {}, {
|
|
3532
|
+
_(ia(k(k({}, n), {}, { answers: h }), e));
|
|
3531
3533
|
return;
|
|
3532
3534
|
}
|
|
3533
3535
|
if (t === "__new__") {
|
|
@@ -3535,7 +3537,7 @@ function Js({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
3535
3537
|
return;
|
|
3536
3538
|
}
|
|
3537
3539
|
let r = Number(t.replace("group:", ""));
|
|
3538
|
-
Number.isNaN(r) || _(na(k(k({}, n), {}, {
|
|
3540
|
+
Number.isNaN(r) || _(na(k(k({}, n), {}, { answers: h }), e, r));
|
|
3539
3541
|
}
|
|
3540
3542
|
function S(e) {
|
|
3541
3543
|
return h.filter((e) => e.blankIds.length === 1).map((e) => e.blankIds[0]).filter((t) => !!t && t !== e);
|
|
@@ -3548,7 +3550,7 @@ function Js({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
3548
3550
|
d(null), p(null);
|
|
3549
3551
|
}
|
|
3550
3552
|
function T() {
|
|
3551
|
-
!u || !f || (_(ra(k(k({}, n), {}, {
|
|
3553
|
+
!u || !f || (_(ra(k(k({}, n), {}, { answers: h }), u, f)), w());
|
|
3552
3554
|
}
|
|
3553
3555
|
function ee(t, n) {
|
|
3554
3556
|
return /* @__PURE__ */ o("div", {
|
|
@@ -3598,7 +3600,7 @@ function Js({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
3598
3600
|
}),
|
|
3599
3601
|
/* @__PURE__ */ o("label", {
|
|
3600
3602
|
className: "flex min-w-0 items-center gap-2",
|
|
3601
|
-
children: [/* @__PURE__ */ a(I.Text, { children: l("questionContentEditor.blank.
|
|
3603
|
+
children: [/* @__PURE__ */ a(I.Text, { children: l("questionContentEditor.blank.answers") }), /* @__PURE__ */ a(Ms, {
|
|
3602
3604
|
"aria-label": l("questionContentEditor.blank.answerSelectAria", { index: r + 1 }),
|
|
3603
3605
|
className: "w-48",
|
|
3604
3606
|
disabled: e,
|
|
@@ -3628,7 +3630,7 @@ function Js({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
3628
3630
|
"aria-label": l("questionContentEditor.actions.deleteBlank", { index: r + 1 }),
|
|
3629
3631
|
danger: !0,
|
|
3630
3632
|
disabled: e || n.blanks.length <= 1,
|
|
3631
|
-
onClick: () => _($i(k(k({}, n), {}, {
|
|
3633
|
+
onClick: () => _($i(k(k({}, n), {}, { answers: h }), t)),
|
|
3632
3634
|
children: l("questionContentEditor.actions.deleteBlank", { index: r + 1 })
|
|
3633
3635
|
})
|
|
3634
3636
|
]
|
|
@@ -3646,7 +3648,7 @@ function Js({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
3646
3648
|
children: l("questionContentEditor.blank.answerGroup", { index: i + 1 })
|
|
3647
3649
|
}), t.blankIds.map((t) => /* @__PURE__ */ a(F, {
|
|
3648
3650
|
disabled: e,
|
|
3649
|
-
onClick: () => _(ia(k(k({}, n), {}, {
|
|
3651
|
+
onClick: () => _(ia(k(k({}, n), {}, { answers: h }), t)),
|
|
3650
3652
|
size: "small",
|
|
3651
3653
|
children: l("questionContentEditor.blank.memberDetach", { index: n.blanks.indexOf(t) + 1 })
|
|
3652
3654
|
}, t))]
|
|
@@ -3745,7 +3747,7 @@ function Xs({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
3745
3747
|
u(Ha(l, e, t));
|
|
3746
3748
|
}
|
|
3747
3749
|
function p(e, t) {
|
|
3748
|
-
u(k(k({}, l), {}, {
|
|
3750
|
+
u(k(k({}, l), {}, { answers: Ua(l.answers, e, t == null ? "" : t) }));
|
|
3749
3751
|
}
|
|
3750
3752
|
return /* @__PURE__ */ o("div", {
|
|
3751
3753
|
className: z.board,
|
|
@@ -3826,7 +3828,7 @@ function Xs({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
3826
3828
|
className: z["card-grid"],
|
|
3827
3829
|
children: l.items.map((n, r) => {
|
|
3828
3830
|
var s;
|
|
3829
|
-
let d = (s = l.
|
|
3831
|
+
let d = (s = l.answers[n.id]) == null ? "" : s;
|
|
3830
3832
|
return /* @__PURE__ */ o("article", {
|
|
3831
3833
|
className: z["content-card"],
|
|
3832
3834
|
children: [/* @__PURE__ */ o("div", {
|
|
@@ -3890,7 +3892,7 @@ function Zs({ ariaLabel: e, disabled: t, onClick: n }) {
|
|
|
3890
3892
|
//#region src/question/content-editor/QuestionContentFillTextEditor.tsx
|
|
3891
3893
|
function Qs({ disabled: e, element: t, hasAnswer: n, item: r, onChange: s, richTextControls: c, title: l, translator: u }) {
|
|
3892
3894
|
let { t: d } = u, f = p(null), [h, g] = m({}), [_, v] = m(null), [y, b] = m(null), x = zi(r, t, n), S = {
|
|
3893
|
-
|
|
3895
|
+
answers: x.answers.filter((e) => "answerPools" in e),
|
|
3894
3896
|
blanks: x.blanks,
|
|
3895
3897
|
elementKey: x.elementKey,
|
|
3896
3898
|
type: "fill"
|
|
@@ -3908,7 +3910,7 @@ function Qs({ disabled: e, element: t, hasAnswer: n, item: r, onChange: s, richT
|
|
|
3908
3910
|
}
|
|
3909
3911
|
function T(e) {
|
|
3910
3912
|
e.type === "fill" && w(k(k({}, x), {}, {
|
|
3911
|
-
|
|
3913
|
+
answers: n ? e.answers : [],
|
|
3912
3914
|
blanks: e.blanks
|
|
3913
3915
|
}));
|
|
3914
3916
|
}
|
|
@@ -3920,13 +3922,13 @@ function Qs({ disabled: e, element: t, hasAnswer: n, item: r, onChange: s, richT
|
|
|
3920
3922
|
w(k(k({}, x), {}, { blankOptionGroups: n }));
|
|
3921
3923
|
}
|
|
3922
3924
|
function D() {
|
|
3923
|
-
return x.
|
|
3925
|
+
return x.answers.filter((e) => "answerOptionIds" in e);
|
|
3924
3926
|
}
|
|
3925
3927
|
function te(e) {
|
|
3926
3928
|
return e.blankIds.join("__");
|
|
3927
3929
|
}
|
|
3928
3930
|
function O(e) {
|
|
3929
|
-
w(k(k({}, x), {}, {
|
|
3931
|
+
w(k(k({}, x), {}, { answers: e }));
|
|
3930
3932
|
}
|
|
3931
3933
|
function ne(e, t, n) {
|
|
3932
3934
|
let r = D(), i = r.slice(e, e + 1)[0];
|
|
@@ -4196,14 +4198,14 @@ function Qs({ disabled: e, element: t, hasAnswer: n, item: r, onChange: s, richT
|
|
|
4196
4198
|
}
|
|
4197
4199
|
function ke(e) {
|
|
4198
4200
|
var t, n;
|
|
4199
|
-
let r = x.
|
|
4201
|
+
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
4202
|
return {
|
|
4201
4203
|
answerOptionId: (r == null ? void 0 : r.answerOptionId) || i,
|
|
4202
4204
|
blankId: e
|
|
4203
4205
|
};
|
|
4204
4206
|
}
|
|
4205
4207
|
function Ae(e, t) {
|
|
4206
|
-
w(k(k({}, x), {}, {
|
|
4208
|
+
w(k(k({}, x), {}, { answers: x.answers.map((n) => "answerOptionId" in n && n.blankId === e ? k(k({}, n), {}, { answerOptionId: t }) : n) }));
|
|
4207
4209
|
}
|
|
4208
4210
|
function je(e, t) {
|
|
4209
4211
|
E(e, {
|
|
@@ -4329,9 +4331,9 @@ function $s(e, t) {
|
|
|
4329
4331
|
//#endregion
|
|
4330
4332
|
//#region src/question/content-editor/QuestionContentJudgementGroupEditor.tsx
|
|
4331
4333
|
function ec({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, translator: o }) {
|
|
4332
|
-
let { t: s } = o, c = Ti(t.config.judgeAnswerMode), l = n ? r.
|
|
4334
|
+
let { t: s } = o, c = Ti(t.config.judgeAnswerMode), l = n ? r.answers.filter((e) => c.includes(e)).slice(0, 1) : [];
|
|
4333
4335
|
function u(e) {
|
|
4334
|
-
i(k(k({}, r), {}, {
|
|
4336
|
+
i(k(k({}, r), {}, { answers: l.includes(e) ? [] : [e] }));
|
|
4335
4337
|
}
|
|
4336
4338
|
return /* @__PURE__ */ a("div", {
|
|
4337
4339
|
className: "flex min-w-0 flex-col gap-3",
|
|
@@ -4436,9 +4438,9 @@ var B = {
|
|
|
4436
4438
|
];
|
|
4437
4439
|
function pc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richTextControls: s, translator: c }) {
|
|
4438
4440
|
let { t: u } = c, [h, g] = m(null), [_, v] = m(null), y = p(null), b = p(/* @__PURE__ */ new Map()), x = ba(r, t, n), S = { gridTemplateColumns: `repeat(${x.columns.length}, minmax(16rem, 1fr))` }, C = f(() => JSON.stringify({
|
|
4439
|
-
|
|
4441
|
+
answers: x.answers,
|
|
4440
4442
|
columns: x.columns.map((e) => e.items.map((e) => e.itemId))
|
|
4441
|
-
}), [x.
|
|
4443
|
+
}), [x.answers, x.columns]), w = f(() => n ? ic(x, x.answers) : [], [n, x]), T = l(() => {
|
|
4442
4444
|
let e = y.current;
|
|
4443
4445
|
if (!n || !e || w.length === 0) {
|
|
4444
4446
|
v(null);
|
|
@@ -4491,7 +4493,7 @@ function pc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4491
4493
|
E(Ea(x, e, t));
|
|
4492
4494
|
}
|
|
4493
4495
|
function te(e, t) {
|
|
4494
|
-
E(k(k({}, x), {}, {
|
|
4496
|
+
E(k(k({}, x), {}, { answers: Da(x.answers, e, t) }));
|
|
4495
4497
|
}
|
|
4496
4498
|
function O(t, r, i) {
|
|
4497
4499
|
if (e || !n) return;
|
|
@@ -4678,11 +4680,11 @@ function pc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4678
4680
|
});
|
|
4679
4681
|
}
|
|
4680
4682
|
function mc(e, t) {
|
|
4681
|
-
return Object.values(e.
|
|
4683
|
+
return Object.values(e.answers).some((e) => e.includes(t));
|
|
4682
4684
|
}
|
|
4683
4685
|
function hc(e, t) {
|
|
4684
4686
|
var n;
|
|
4685
|
-
return ((n = e.
|
|
4687
|
+
return ((n = e.answers[t]) == null ? [] : n).length > 0;
|
|
4686
4688
|
}
|
|
4687
4689
|
function gc(e, t) {
|
|
4688
4690
|
return e || t;
|
|
@@ -4715,10 +4717,10 @@ var bc = {
|
|
|
4715
4717
|
"none"
|
|
4716
4718
|
];
|
|
4717
4719
|
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 = Oa(r, t, n), S = { gridTemplateColumns: `repeat(${x.columns.length}, minmax(16rem, 1fr))` }, C = f(() => n ? ic(x, x.
|
|
4719
|
-
|
|
4720
|
+
let { t: u } = c, [h, g] = m(null), [_, v] = m(null), y = p(null), b = p(/* @__PURE__ */ new Map()), x = Oa(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({
|
|
4721
|
+
answers: x.answers,
|
|
4720
4722
|
columns: x.columns.map((e) => e.items.map((e) => e.itemId))
|
|
4721
|
-
}), [x.
|
|
4723
|
+
}), [x.answers, x.columns]), T = l(() => {
|
|
4722
4724
|
let e = y.current;
|
|
4723
4725
|
if (!n || !e || C.length === 0) {
|
|
4724
4726
|
v(null);
|
|
@@ -4778,7 +4780,7 @@ function Sc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4778
4780
|
label: i
|
|
4779
4781
|
}, o = h ? pt(h, a) : null;
|
|
4780
4782
|
if (o) {
|
|
4781
|
-
E(k(k({}, x), {}, {
|
|
4783
|
+
E(k(k({}, x), {}, { answers: Na(x.answers, o.fromItemId, o.toItemId) })), g(null);
|
|
4782
4784
|
return;
|
|
4783
4785
|
}
|
|
4784
4786
|
g(a);
|
|
@@ -4928,11 +4930,11 @@ function Sc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4928
4930
|
});
|
|
4929
4931
|
}
|
|
4930
4932
|
function Cc(e, t) {
|
|
4931
|
-
return Object.values(e.
|
|
4933
|
+
return Object.values(e.answers).some((e) => e.includes(t));
|
|
4932
4934
|
}
|
|
4933
4935
|
function wc(e, t) {
|
|
4934
4936
|
var n;
|
|
4935
|
-
return ((n = e.
|
|
4937
|
+
return ((n = e.answers[t]) == null ? [] : n).length > 0;
|
|
4936
4938
|
}
|
|
4937
4939
|
function Tc(e) {
|
|
4938
4940
|
return { gridTemplateColumns: e ? "2rem minmax(0, 1fr) auto auto" : "2rem minmax(0, 1fr) auto" };
|
|
@@ -4943,9 +4945,9 @@ function Ec(e, t) {
|
|
|
4943
4945
|
//#endregion
|
|
4944
4946
|
//#region src/question/content-editor/QuestionContentOptionGroupEditor.tsx
|
|
4945
4947
|
function Dc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richTextControls: s, translator: c }) {
|
|
4946
|
-
let { t: l } = c, u = n ? r.
|
|
4948
|
+
let { t: l } = c, u = n ? r.answers.optionIds : [], d = t.config.renderer === "table", f = Ei(r, t.config.optionLabelStyle);
|
|
4947
4949
|
function p(e) {
|
|
4948
|
-
i(k(k({}, e), {}, {
|
|
4950
|
+
i(k(k({}, e), {}, { answers: n ? e.answers : { optionIds: [] } }));
|
|
4949
4951
|
}
|
|
4950
4952
|
function m(e, t) {
|
|
4951
4953
|
p(sa(r, e, t));
|
|
@@ -4957,7 +4959,7 @@ function Dc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4957
4959
|
p(ha(r, e, t));
|
|
4958
4960
|
}
|
|
4959
4961
|
function _(e) {
|
|
4960
|
-
p(k(k({}, r), {}, {
|
|
4962
|
+
p(k(k({}, r), {}, { answers: { optionIds: la(u, e, t.config.selectionType) } }));
|
|
4961
4963
|
}
|
|
4962
4964
|
function v(t, n, r, i) {
|
|
4963
4965
|
let a = u.includes(t);
|
|
@@ -5212,7 +5214,7 @@ function Oc({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
5212
5214
|
children: [/* @__PURE__ */ a(I.Text, {
|
|
5213
5215
|
strong: !0,
|
|
5214
5216
|
children: c("questionContentEditor.ordering.answerTitle")
|
|
5215
|
-
}), l.
|
|
5217
|
+
}), l.answers.map((n, r) => {
|
|
5216
5218
|
let i = u.get(n);
|
|
5217
5219
|
return i ? /* @__PURE__ */ o("div", {
|
|
5218
5220
|
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",
|
|
@@ -5233,7 +5235,7 @@ function Oc({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
5233
5235
|
size: "small"
|
|
5234
5236
|
}), /* @__PURE__ */ a(F, {
|
|
5235
5237
|
"aria-label": c("questionContentEditor.ordering.moveDown", { index: r + 1 }),
|
|
5236
|
-
disabled: e || r === l.
|
|
5238
|
+
disabled: e || r === l.answers.length - 1,
|
|
5237
5239
|
icon: "\u2193",
|
|
5238
5240
|
onClick: () => d(Ja(l, n, 1, t)),
|
|
5239
5241
|
size: "small"
|
|
@@ -5284,8 +5286,8 @@ function jc({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
5284
5286
|
});
|
|
5285
5287
|
}
|
|
5286
5288
|
function m(e, t) {
|
|
5287
|
-
let r = t ? [...n.
|
|
5288
|
-
d(k(k({}, n), {}, {
|
|
5289
|
+
let r = t ? [...n.answers, e] : n.answers.filter((t) => t !== e);
|
|
5290
|
+
d(k(k({}, n), {}, { answers: r }));
|
|
5289
5291
|
}
|
|
5290
5292
|
return /* @__PURE__ */ o("div", {
|
|
5291
5293
|
className: Ac.stack,
|
|
@@ -5329,7 +5331,7 @@ function jc({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
5329
5331
|
className: Ac["answer-toggle"],
|
|
5330
5332
|
children: [/* @__PURE__ */ a("input", {
|
|
5331
5333
|
"aria-label": l("questionContentEditor.textMarker.answerAria", { marker: r.text }),
|
|
5332
|
-
checked: n.
|
|
5334
|
+
checked: n.answers.includes(r.markerId),
|
|
5333
5335
|
disabled: e || !t,
|
|
5334
5336
|
onChange: (e) => m(r.markerId, e.target.checked),
|
|
5335
5337
|
type: "checkbox"
|
|
@@ -5374,7 +5376,7 @@ function Mc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
5374
5376
|
m(k(k({}, f), {}, { candidateOptions: f.candidateOptions.filter((t, n) => n !== e) }));
|
|
5375
5377
|
}
|
|
5376
5378
|
function y(e, t) {
|
|
5377
|
-
m(k(k({}, f), {}, {
|
|
5379
|
+
m(k(k({}, f), {}, { answers: k(k({}, f.answers), {}, { [e]: t.target.value }) }));
|
|
5378
5380
|
}
|
|
5379
5381
|
return /* @__PURE__ */ o("div", {
|
|
5380
5382
|
className: H.root,
|
|
@@ -5454,7 +5456,7 @@ function Mc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
5454
5456
|
disabled: e,
|
|
5455
5457
|
onChange: (e) => y(t, e),
|
|
5456
5458
|
placeholder: u("questionContentEditor.placeholders.blankAnswer"),
|
|
5457
|
-
value: (r = f.
|
|
5459
|
+
value: (r = f.answers[t]) == null ? "" : r
|
|
5458
5460
|
})
|
|
5459
5461
|
}, t);
|
|
5460
5462
|
})
|
|
@@ -5593,7 +5595,7 @@ function Fc(e, t, n) {
|
|
|
5593
5595
|
}
|
|
5594
5596
|
function Ic(e, t) {
|
|
5595
5597
|
let n = Qi(e);
|
|
5596
|
-
return t ? n : k(k({}, n), {}, {
|
|
5598
|
+
return t ? n : k(k({}, n), {}, { answers: [] });
|
|
5597
5599
|
}
|
|
5598
5600
|
//#endregion
|
|
5599
5601
|
//#region src/question/content-editor/subquestion-group-editor-helpers.ts
|
|
@@ -6430,7 +6432,7 @@ var tu = {
|
|
|
6430
6432
|
addOption: "Add option",
|
|
6431
6433
|
addSubquestion: "Add subquestion",
|
|
6432
6434
|
addTableColumn: "Add column",
|
|
6433
|
-
|
|
6435
|
+
answers: "Answer",
|
|
6434
6436
|
answerGroup: "Answer group",
|
|
6435
6437
|
answerSettings: "Answer settings",
|
|
6436
6438
|
blankAnswer: "Single answer",
|
|
@@ -6494,7 +6496,7 @@ var tu = {
|
|
|
6494
6496
|
addOption: "\u6dfb\u52a0\u9009\u9879",
|
|
6495
6497
|
addSubquestion: "\u6dfb\u52a0\u5b50\u9898",
|
|
6496
6498
|
addTableColumn: "\u6dfb\u52a0\u5217",
|
|
6497
|
-
|
|
6499
|
+
answers: "\u7b54\u6848",
|
|
6498
6500
|
answerGroup: "\u7b54\u6848\u7ec4",
|
|
6499
6501
|
answerSettings: "\u7b54\u6848\u8bbe\u7f6e",
|
|
6500
6502
|
blankAnswer: "\u5355\u72ec\u7b54\u6848",
|
|
@@ -6583,7 +6585,7 @@ function cu(e, t, n) {
|
|
|
6583
6585
|
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
6586
|
}
|
|
6585
6587
|
function lu(e) {
|
|
6586
|
-
return e.
|
|
6588
|
+
return e.answers.reduce((t, n) => {
|
|
6587
6589
|
if (iu(n)) return uu(t, {
|
|
6588
6590
|
blankIds: n.blankIds,
|
|
6589
6591
|
contents: n.answerPools
|
|
@@ -6720,7 +6722,7 @@ function q({ groups: e, title: t }) {
|
|
|
6720
6722
|
//#endregion
|
|
6721
6723
|
//#region src/question/player/QuestionBlankGroupPlayer.tsx
|
|
6722
6724
|
function pu({ disabled: e, item: t, messages: n, onChange: r, response: i, showAnswer: s }) {
|
|
6723
|
-
let c = bl(i, t.elementKey, t.blanks), l = ea(t.
|
|
6725
|
+
let c = bl(i, t.elementKey, t.blanks), l = ea(t.answers, t.blanks).map((e, r) => ({
|
|
6724
6726
|
contents: e.answerPools.map((e, t) => /* @__PURE__ */ a(K, { content: e }, `group-${r}-answer-${t}`)),
|
|
6725
6727
|
marker: ru(e.blankIds, t.blanks, n.blankLabel)
|
|
6726
6728
|
}));
|
|
@@ -6761,7 +6763,7 @@ function hu(e, t) {
|
|
|
6761
6763
|
//#region src/question/renderers/classificationAnswers.tsx
|
|
6762
6764
|
function gu(e) {
|
|
6763
6765
|
return e.categories.map((t) => ({
|
|
6764
|
-
contents: e.items.filter((n) => e.
|
|
6766
|
+
contents: e.items.filter((n) => e.answers[n.id] === t.id).map((e) => /* @__PURE__ */ a(K, { content: e.content }, `${t.id}-${e.id}`)),
|
|
6765
6767
|
marker: t.content.text || t.id
|
|
6766
6768
|
}));
|
|
6767
6769
|
}
|
|
@@ -6848,7 +6850,7 @@ function _u({ disabled: e, item: t, messages: n, onChange: r, response: i, showA
|
|
|
6848
6850
|
}
|
|
6849
6851
|
function vu(e, t, n, r) {
|
|
6850
6852
|
var i, a;
|
|
6851
|
-
let o = (i = t[e]) == null ? "" : i, s = (a = n.
|
|
6853
|
+
let o = (i = t[e]) == null ? "" : i, s = (a = n.answers[e]) == null ? "" : a;
|
|
6852
6854
|
if (!(!r || !s)) return o ? s === o ? "correct" : "incorrect" : "unanswered";
|
|
6853
6855
|
}
|
|
6854
6856
|
function yu(e, t) {
|
|
@@ -7135,7 +7137,7 @@ var X = {
|
|
|
7135
7137
|
//#region src/question/player/QuestionJudgementGroupPlayer.tsx
|
|
7136
7138
|
function Bu({ disabled: e, element: t, item: n, messages: r, onChange: i, response: s, showAnswer: c }) {
|
|
7137
7139
|
let l = Cl(s, t.elementKey), u = Ti(t.config.judgeAnswerMode), d = [{
|
|
7138
|
-
contents: n.
|
|
7140
|
+
contents: n.answers.filter((e) => e.trim() !== ""),
|
|
7139
7141
|
marker: ""
|
|
7140
7142
|
}];
|
|
7141
7143
|
function f(e) {
|
|
@@ -7174,7 +7176,7 @@ function Vu(e) {
|
|
|
7174
7176
|
let o = r.items.map((n, o) => {
|
|
7175
7177
|
var s;
|
|
7176
7178
|
return {
|
|
7177
|
-
contents: ((s = e.
|
|
7179
|
+
contents: ((s = e.answers[n.itemId]) == null ? [] : s).map((e) => {
|
|
7178
7180
|
let n = t.get(e);
|
|
7179
7181
|
return n && ze(i, n.columnIndex) ? n.item : void 0;
|
|
7180
7182
|
}).filter((e) => !!e).map((e, t) => /* @__PURE__ */ a(K, { content: e.content }, `${n.itemId}-${e.itemId}-${t}`)),
|
|
@@ -7322,7 +7324,7 @@ function Wu(e) {
|
|
|
7322
7324
|
return ((n = r == null ? void 0 : r.items) == null ? [] : n).map((t, n) => {
|
|
7323
7325
|
var i, s;
|
|
7324
7326
|
return {
|
|
7325
|
-
contents: ((i = e.
|
|
7327
|
+
contents: ((i = e.answers[t.itemId]) == null ? [] : i).reduce((e, t) => {
|
|
7326
7328
|
let n = o.get(t);
|
|
7327
7329
|
return n ? [...e, n] : e;
|
|
7328
7330
|
}, []).map((e, n) => /* @__PURE__ */ a(K, { content: e.content }, `${t.itemId}-${e.itemId}-${n}`)),
|
|
@@ -7525,7 +7527,7 @@ function Xu({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7525
7527
|
//#region src/question/renderers/orderingAnswerGroups.tsx
|
|
7526
7528
|
function Zu(e) {
|
|
7527
7529
|
let t = new Map(e.sortOptions.map((e) => [e.id, e]));
|
|
7528
|
-
return e.
|
|
7530
|
+
return e.answers.map((e, n) => {
|
|
7529
7531
|
let r = t.get(e);
|
|
7530
7532
|
return {
|
|
7531
7533
|
contents: r ? [/* @__PURE__ */ a(K, { content: r.content }, e)] : [],
|
|
@@ -7651,9 +7653,9 @@ function nd(e) {
|
|
|
7651
7653
|
//#endregion
|
|
7652
7654
|
//#region src/question/renderers/QuestionTextMarkerView.tsx
|
|
7653
7655
|
function rd({ item: e, messages: t, showAnswer: n }) {
|
|
7654
|
-
let r = Vt(e.content.json).filter((t) => e.
|
|
7656
|
+
let r = Vt(e.content.json).filter((t) => e.answers.includes(t.markerId)).map((e) => e.text);
|
|
7655
7657
|
return /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(ed, {
|
|
7656
|
-
answerMarkers: e.
|
|
7658
|
+
answerMarkers: e.answers,
|
|
7657
7659
|
content: e.content,
|
|
7658
7660
|
showAnswer: n
|
|
7659
7661
|
}), n ? /* @__PURE__ */ a(q, {
|
|
@@ -7673,7 +7675,7 @@ function id({ disabled: e, item: t, messages: n, onChange: r, response: i, showA
|
|
|
7673
7675
|
messages: n,
|
|
7674
7676
|
showAnswer: o
|
|
7675
7677
|
}) : /* @__PURE__ */ a(ed, {
|
|
7676
|
-
answerMarkers: t.
|
|
7678
|
+
answerMarkers: t.answers,
|
|
7677
7679
|
content: t.content,
|
|
7678
7680
|
disabled: e,
|
|
7679
7681
|
onMarkerClick: (e) => r(k(k({}, s), {}, { selectedMarkers: Ll(s.selectedMarkers, e) })),
|
|
@@ -7685,7 +7687,7 @@ function id({ disabled: e, item: t, messages: n, onChange: r, response: i, showA
|
|
|
7685
7687
|
function ad(e, t) {
|
|
7686
7688
|
return e.blanks.reduce((n, r) => {
|
|
7687
7689
|
var i;
|
|
7688
|
-
let o = (i = e.
|
|
7690
|
+
let o = (i = e.answers[r]) == null ? void 0 : i.trim();
|
|
7689
7691
|
return o ? [...n, {
|
|
7690
7692
|
contents: [/* @__PURE__ */ a(K, { content: M(o) }, `${r}-answer`)],
|
|
7691
7693
|
marker: ru([r], e.blanks, t)
|
|
@@ -7734,7 +7736,7 @@ function sd({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7734
7736
|
renderBlank: ({ blankId: t, index: n, label: i }) => {
|
|
7735
7737
|
var o, s;
|
|
7736
7738
|
let c = (o = u.answers[t]) == null ? "" : o, l = cd({
|
|
7737
|
-
|
|
7739
|
+
answers: c,
|
|
7738
7740
|
blankLabel: r.blankLabel,
|
|
7739
7741
|
canClear: !e && !!c.trim(),
|
|
7740
7742
|
index: n,
|
|
@@ -7773,7 +7775,7 @@ function sd({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7773
7775
|
]
|
|
7774
7776
|
});
|
|
7775
7777
|
}
|
|
7776
|
-
function cd({
|
|
7778
|
+
function cd({ answers: e, blankLabel: t, canClear: n, index: r, label: i }) {
|
|
7777
7779
|
let a = i || `${t}${r + 1}`;
|
|
7778
7780
|
return !n || !e.trim() ? a : t === "\u7a7a" ? `${a}\uff0c\u70b9\u51fb\u6e05\u7a7a` : `${a}, click to clear`;
|
|
7779
7781
|
}
|
|
@@ -7997,7 +7999,7 @@ var bd = {
|
|
|
7997
7999
|
//#endregion
|
|
7998
8000
|
//#region src/question/renderers/QuestionBlankGroupView.tsx
|
|
7999
8001
|
function xd({ item: e, messages: t, showAnswer: n }) {
|
|
8000
|
-
let r = ea(e.
|
|
8002
|
+
let r = ea(e.answers, e.blanks).map((n, r) => ({
|
|
8001
8003
|
contents: n.answerPools.map((e, t) => /* @__PURE__ */ a(K, { content: e }, `group-${r}-answer-${t}`)),
|
|
8002
8004
|
marker: ru(n.blankIds, e.blanks, t.blankLabel)
|
|
8003
8005
|
}));
|
|
@@ -8100,7 +8102,7 @@ function Td(e, t) {
|
|
|
8100
8102
|
//#region src/question/renderers/QuestionJudgementGroupView.tsx
|
|
8101
8103
|
function Ed({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
8102
8104
|
let i = Ti(e.config.judgeAnswerMode), s = [{
|
|
8103
|
-
contents: t.
|
|
8105
|
+
contents: t.answers.filter((e) => e.trim() !== ""),
|
|
8104
8106
|
marker: ""
|
|
8105
8107
|
}];
|
|
8106
8108
|
return /* @__PURE__ */ o("div", {
|