@yungu-fed/question-editor 0.4.7 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2757 -2415
- package/dist/index.mjs +1238 -1010
- package/dist/question/content-editor/helpers.d.ts.map +1 -1
- package/dist/question/player/QuestionBlankGroupPlayer.d.ts +3 -1
- package/dist/question/player/QuestionBlankGroupPlayer.d.ts.map +1 -1
- package/dist/question/player/QuestionClassificationPlayer.d.ts +3 -1
- package/dist/question/player/QuestionClassificationPlayer.d.ts.map +1 -1
- package/dist/question/player/QuestionFillTextContentPlayer.d.ts +3 -1
- package/dist/question/player/QuestionFillTextContentPlayer.d.ts.map +1 -1
- package/dist/question/player/QuestionFillTextPlayer.d.ts +3 -1
- package/dist/question/player/QuestionFillTextPlayer.d.ts.map +1 -1
- package/dist/question/player/QuestionGradingMark.d.ts +8 -0
- package/dist/question/player/QuestionGradingMark.d.ts.map +1 -0
- package/dist/question/player/QuestionJudgementGroupPlayer.d.ts +3 -1
- package/dist/question/player/QuestionJudgementGroupPlayer.d.ts.map +1 -1
- package/dist/question/player/QuestionLineConnectPlayer.d.ts +3 -1
- package/dist/question/player/QuestionLineConnectPlayer.d.ts.map +1 -1
- package/dist/question/player/QuestionMatchingPlayer.d.ts +3 -1
- package/dist/question/player/QuestionMatchingPlayer.d.ts.map +1 -1
- package/dist/question/player/QuestionOptionGroupPlayer.d.ts +3 -1
- package/dist/question/player/QuestionOptionGroupPlayer.d.ts.map +1 -1
- package/dist/question/player/QuestionOrderingPlayer.d.ts +3 -1
- package/dist/question/player/QuestionOrderingPlayer.d.ts.map +1 -1
- package/dist/question/player/QuestionPlayer.d.ts.map +1 -1
- package/dist/question/player/QuestionPlayerElement.d.ts +3 -1
- package/dist/question/player/QuestionPlayerElement.d.ts.map +1 -1
- package/dist/question/player/QuestionPlayerInner.d.ts +15 -0
- package/dist/question/player/QuestionPlayerInner.d.ts.map +1 -0
- package/dist/question/player/QuestionTextMarkerPlayer.d.ts +3 -1
- package/dist/question/player/QuestionTextMarkerPlayer.d.ts.map +1 -1
- package/dist/question/player/QuestionWordBuilderPlayer.d.ts +3 -1
- package/dist/question/player/QuestionWordBuilderPlayer.d.ts.map +1 -1
- package/dist/question/player/grading-contract.d.ts +9 -0
- package/dist/question/player/grading-contract.d.ts.map +1 -0
- package/dist/question/player/grading-presentation.d.ts +25 -0
- package/dist/question/player/grading-presentation.d.ts.map +1 -0
- package/dist/question/player/grading-types.d.ts +53 -0
- package/dist/question/player/grading-types.d.ts.map +1 -0
- package/dist/question/player/types.d.ts +2 -0
- package/dist/question/player/types.d.ts.map +1 -1
- package/dist/question/renderers/QuestionTextMarkerContent.d.ts +2 -1
- package/dist/question/renderers/QuestionTextMarkerContent.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1039,8 +1039,7 @@ function Mn(e, t = 1) {
|
|
|
1039
1039
|
return i.length ? i : Array.from({ length: t }, (e, n) => jn(A(void 0, r), t === Kt ? P(`\u9009\u9879 ${un("upperAlpha", n)}`) : P()));
|
|
1040
1040
|
}
|
|
1041
1041
|
function Nn(e, t) {
|
|
1042
|
-
|
|
1043
|
-
return n.length > 0 ? n : Pn(t);
|
|
1042
|
+
return e && e.length > 0 ? [...e] : Pn(t);
|
|
1044
1043
|
}
|
|
1045
1044
|
function Pn(e) {
|
|
1046
1045
|
return e === "sentence" ? ["This helped them save time."] : [
|
|
@@ -3642,16 +3641,17 @@ function mo(e, t) {
|
|
|
3642
3641
|
return t !== void 0 && e.key === t.key && e.x1 === t.x1 && e.x2 === t.x2 && e.y1 === t.y1 && e.y2 === t.y2;
|
|
3643
3642
|
}
|
|
3644
3643
|
var V = {
|
|
3645
|
-
board: "
|
|
3646
|
-
columns: "
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3644
|
+
board: "_board_1fmpc_1",
|
|
3645
|
+
columns: "_columns_1fmpc_9",
|
|
3646
|
+
"player-columns": "_player-columns_1fmpc_15",
|
|
3647
|
+
column: "_column_1fmpc_9",
|
|
3648
|
+
"column-title": "_column-title_1fmpc_26",
|
|
3649
|
+
item: "_item_1fmpc_32",
|
|
3650
|
+
button: "_button_1fmpc_45",
|
|
3651
|
+
selected: "_selected_1fmpc_70",
|
|
3652
|
+
marker: "_marker_1fmpc_75",
|
|
3653
|
+
lines: "_lines_1fmpc_96",
|
|
3654
|
+
line: "_line_1fmpc_96"
|
|
3655
3655
|
}, H = {
|
|
3656
3656
|
"connect-handle": "_connect-handle_1cqr2_1",
|
|
3657
3657
|
marker: "_marker_1cqr2_19",
|
|
@@ -4647,7 +4647,7 @@ function Io({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4647
4647
|
onClick: () => v(n),
|
|
4648
4648
|
size: "small"
|
|
4649
4649
|
})]
|
|
4650
|
-
},
|
|
4650
|
+
}, n))
|
|
4651
4651
|
})]
|
|
4652
4652
|
}),
|
|
4653
4653
|
n ? /* @__PURE__ */ o("section", {
|
|
@@ -6041,46 +6041,160 @@ function Bc(e = "zh-CN") {
|
|
|
6041
6041
|
}
|
|
6042
6042
|
}
|
|
6043
6043
|
//#endregion
|
|
6044
|
+
//#region src/question/player/grading-contract.ts
|
|
6045
|
+
var Vc = new Set([
|
|
6046
|
+
"correct",
|
|
6047
|
+
"incorrect",
|
|
6048
|
+
"partial",
|
|
6049
|
+
"unanswered"
|
|
6050
|
+
]);
|
|
6051
|
+
function Hc(e, t, n, r) {
|
|
6052
|
+
if (!e) throw TypeError(`${t}: expected ${n}, actual ${JSON.stringify(r)}`);
|
|
6053
|
+
}
|
|
6054
|
+
function Uc(e, t, n = "gradingResult") {
|
|
6055
|
+
Hc(!!e && typeof e == "object", n, "grading result object", e);
|
|
6056
|
+
for (let r of [
|
|
6057
|
+
"id",
|
|
6058
|
+
"questionTypeKey",
|
|
6059
|
+
"version"
|
|
6060
|
+
]) Hc(e[r] === t[r], `${n}.${r}`, JSON.stringify(t[r]), e[r]);
|
|
6061
|
+
let r = t.elements.filter((e) => e.type !== "richText");
|
|
6062
|
+
Wc(e.elementResults, r.length, `${n}.elementResults`), Wc(e.children, t.children.length, `${n}.children`), e.elementResults.forEach((e, t) => {
|
|
6063
|
+
e !== null && Gc(e, r[t], `${n}.elementResults[${t}]`);
|
|
6064
|
+
}), e.children.forEach((e, r) => Uc(e, t.children[r], `${n}.children[${r}]`));
|
|
6065
|
+
}
|
|
6066
|
+
function Wc(e, t, n) {
|
|
6067
|
+
Hc(Array.isArray(e), n, "array", e), Hc(e.length === t, n, `length ${t}`, e.length);
|
|
6068
|
+
}
|
|
6069
|
+
function Gc(e, t, n) {
|
|
6070
|
+
switch (Hc(!!e && typeof e == "object", n, "element result or null", e), Hc(e.type === t.type, `${n}.type`, t.type, e.type), Hc(t.type !== "richText" && t.type !== "textResponse", `${n}.type`, "gradable element type", e.type), e.type) {
|
|
6071
|
+
case "choice":
|
|
6072
|
+
Jc(e.optionResults, ["optionId"], t.options.map((e) => [e.id]), `${n}.optionResults`);
|
|
6073
|
+
return;
|
|
6074
|
+
case "ordering":
|
|
6075
|
+
Jc(e.optionResults, ["optionId"], t.sortOptions.map((e) => [e.id]), `${n}.optionResults`);
|
|
6076
|
+
return;
|
|
6077
|
+
case "fill":
|
|
6078
|
+
case "inlineFill":
|
|
6079
|
+
case "wordBuilder":
|
|
6080
|
+
Jc(e.blankResults, ["blankId"], t.blanks.map((e) => [e]), `${n}.blankResults`);
|
|
6081
|
+
return;
|
|
6082
|
+
default: Kc(e, t, n);
|
|
6083
|
+
}
|
|
6084
|
+
}
|
|
6085
|
+
function Kc(e, t, n) {
|
|
6086
|
+
switch (e.type) {
|
|
6087
|
+
case "judgement":
|
|
6088
|
+
Jc(e.optionResults, ["value"], [[!0], [!1]], `${n}.optionResults`);
|
|
6089
|
+
return;
|
|
6090
|
+
case "classification":
|
|
6091
|
+
Jc(e.itemResults, ["itemId"], t.items.map((e) => [e.id]), `${n}.itemResults`);
|
|
6092
|
+
return;
|
|
6093
|
+
case "textMarker":
|
|
6094
|
+
Jc(e.markerResults, ["markerId"], t.markers.map((e) => [e]), `${n}.markerResults`);
|
|
6095
|
+
return;
|
|
6096
|
+
case "lineConnect":
|
|
6097
|
+
case "matching":
|
|
6098
|
+
qc(e, t, n);
|
|
6099
|
+
return;
|
|
6100
|
+
}
|
|
6101
|
+
}
|
|
6102
|
+
function qc(e, t, n) {
|
|
6103
|
+
let r = [], i = [];
|
|
6104
|
+
for (let [e, n] of t.columns.entries()) for (let a of n.items) {
|
|
6105
|
+
r.push([a.itemId]);
|
|
6106
|
+
for (let n of t.columns.slice(e + 1)) for (let e of n.items) i.push([a.itemId, e.itemId]);
|
|
6107
|
+
}
|
|
6108
|
+
Jc(e.itemResults, ["itemId"], r, `${n}.itemResults`), Jc(e.connectionResults, ["fromItemId", "toItemId"], i, `${n}.connectionResults`);
|
|
6109
|
+
}
|
|
6110
|
+
function Jc(e, t, n, r) {
|
|
6111
|
+
Hc(Array.isArray(e), r, "array", e);
|
|
6112
|
+
let i = new Set(n.map((e) => JSON.stringify(e))), a = /* @__PURE__ */ new Set();
|
|
6113
|
+
e.forEach((e, n) => {
|
|
6114
|
+
Hc(!!e && typeof e == "object", `${r}[${n}]`, "result object", e);
|
|
6115
|
+
let o = new Map(Object.entries(e)), s = t.map((e) => o.get(e)), c = JSON.stringify(s);
|
|
6116
|
+
Hc(i.has(c), `${r}[${n}]`, `existing ${t.join(" + ")}`, s), Hc(!a.has(c), `${r}[${n}]`, "unique target", s);
|
|
6117
|
+
let l = o.get("status");
|
|
6118
|
+
Hc(typeof l == "string" && Vc.has(l), `${r}[${n}].status`, [...Vc].join(" | "), o.get("status")), a.add(c);
|
|
6119
|
+
});
|
|
6120
|
+
}
|
|
6121
|
+
function Yc(e, t) {
|
|
6122
|
+
return (e == null ? void 0 : e.type) === t ? e : void 0;
|
|
6123
|
+
}
|
|
6124
|
+
var Xc = {
|
|
6125
|
+
target: "_target_18t8h_1",
|
|
6126
|
+
correct: "_correct_18t8h_1",
|
|
6127
|
+
incorrect: "_incorrect_18t8h_7",
|
|
6128
|
+
partial: "_partial_18t8h_13",
|
|
6129
|
+
unanswered: "_unanswered_18t8h_19",
|
|
6130
|
+
mark: "_mark_18t8h_49",
|
|
6131
|
+
icon: "_icon_18t8h_64",
|
|
6132
|
+
line: "_line_18t8h_83",
|
|
6133
|
+
"unanswered-warning": "_unanswered-warning_18t8h_90"
|
|
6134
|
+
}, Zc = l("zh-CN");
|
|
6135
|
+
function Qc(e) {
|
|
6136
|
+
return e ? `${Xc.target} ${Xc[e]}` : "";
|
|
6137
|
+
}
|
|
6138
|
+
var $c = {
|
|
6139
|
+
"zh-CN": {
|
|
6140
|
+
correct: "\u6b63\u786e",
|
|
6141
|
+
incorrect: "\u9519\u8bef",
|
|
6142
|
+
partial: "\u534a\u5bf9",
|
|
6143
|
+
unanswered: "\u672a\u4f5c\u7b54"
|
|
6144
|
+
},
|
|
6145
|
+
"en-US": {
|
|
6146
|
+
correct: "Correct",
|
|
6147
|
+
incorrect: "Incorrect",
|
|
6148
|
+
partial: "Partially correct",
|
|
6149
|
+
unanswered: "Unanswered"
|
|
6150
|
+
}
|
|
6151
|
+
}, el = {
|
|
6152
|
+
correct: "m7.5 12 3 3 6-6",
|
|
6153
|
+
incorrect: "m9 9 6 6m0-6-6 6",
|
|
6154
|
+
partial: "m7.5 12 3 3 6-6m-4.5 0 5 5",
|
|
6155
|
+
unanswered: "M9 9a3 3 0 0 1 6 0c0 2-3 2-3 4m0 3h.01"
|
|
6156
|
+
};
|
|
6157
|
+
//#endregion
|
|
6044
6158
|
//#region src/question/renderers/helpers.ts
|
|
6045
6159
|
function U(...e) {
|
|
6046
6160
|
return e.filter(Boolean).join(" ");
|
|
6047
6161
|
}
|
|
6048
|
-
function
|
|
6162
|
+
function tl(e, t, n) {
|
|
6049
6163
|
return e.map((e) => t.indexOf(e) + 1).filter((e) => e > 0).map((e) => `${n}${e}`).join(" ");
|
|
6050
6164
|
}
|
|
6051
|
-
function
|
|
6165
|
+
function nl(e) {
|
|
6052
6166
|
return "answerPools" in e;
|
|
6053
6167
|
}
|
|
6054
|
-
function
|
|
6168
|
+
function rl(e) {
|
|
6055
6169
|
return "answerOptionId" in e;
|
|
6056
6170
|
}
|
|
6057
|
-
function
|
|
6171
|
+
function il(e) {
|
|
6058
6172
|
return "answerOptionIds" in e;
|
|
6059
6173
|
}
|
|
6060
|
-
function
|
|
6174
|
+
function al(e, t) {
|
|
6061
6175
|
var n, r;
|
|
6062
6176
|
return (n = e == null || (r = e.find((e) => e.optionId === t)) == null ? void 0 : r.content) == null ? null : n;
|
|
6063
6177
|
}
|
|
6064
|
-
function
|
|
6178
|
+
function ol(e, t, n) {
|
|
6065
6179
|
var r, i;
|
|
6066
6180
|
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;
|
|
6067
6181
|
}
|
|
6068
|
-
function
|
|
6182
|
+
function sl(e) {
|
|
6069
6183
|
return e.answers.reduce((t, n) => {
|
|
6070
|
-
if (
|
|
6184
|
+
if (nl(n)) return cl(t, {
|
|
6071
6185
|
blankIds: n.blankIds,
|
|
6072
6186
|
contents: n.answerPools
|
|
6073
6187
|
});
|
|
6074
|
-
if (
|
|
6075
|
-
let r =
|
|
6076
|
-
return
|
|
6188
|
+
if (rl(n)) {
|
|
6189
|
+
let r = ol(e.blankOptionGroups, n.blankId, n.answerOptionId);
|
|
6190
|
+
return cl(t, {
|
|
6077
6191
|
blankIds: [n.blankId],
|
|
6078
6192
|
contents: r ? [r] : []
|
|
6079
6193
|
});
|
|
6080
6194
|
}
|
|
6081
|
-
if (
|
|
6082
|
-
let r = n.answerOptionIds.map((t) =>
|
|
6083
|
-
return
|
|
6195
|
+
if (il(n)) {
|
|
6196
|
+
let r = n.answerOptionIds.map((t) => al(e.candidateOptions, t)).filter((e) => !!e);
|
|
6197
|
+
return cl(t, {
|
|
6084
6198
|
blankIds: n.blankIds,
|
|
6085
6199
|
contents: r
|
|
6086
6200
|
});
|
|
@@ -6088,7 +6202,7 @@ function qc(e) {
|
|
|
6088
6202
|
return t;
|
|
6089
6203
|
}, []);
|
|
6090
6204
|
}
|
|
6091
|
-
function
|
|
6205
|
+
function cl(e, t) {
|
|
6092
6206
|
let n = t.contents.filter((e) => e.text.trim() !== "");
|
|
6093
6207
|
return n.length > 0 ? [...e, {
|
|
6094
6208
|
blankIds: t.blankIds,
|
|
@@ -6097,7 +6211,7 @@ function Jc(e, t) {
|
|
|
6097
6211
|
}
|
|
6098
6212
|
//#endregion
|
|
6099
6213
|
//#region src/question/shared/blank-numbering.ts
|
|
6100
|
-
var
|
|
6214
|
+
var ll = [
|
|
6101
6215
|
"\u96f6",
|
|
6102
6216
|
"\u4e00",
|
|
6103
6217
|
"\u4e8c",
|
|
@@ -6108,17 +6222,17 @@ var Yc = [
|
|
|
6108
6222
|
"\u4e03",
|
|
6109
6223
|
"\u516b",
|
|
6110
6224
|
"\u4e5d"
|
|
6111
|
-
],
|
|
6225
|
+
], ul = [
|
|
6112
6226
|
"",
|
|
6113
6227
|
"\u5341",
|
|
6114
6228
|
"\u767e",
|
|
6115
6229
|
"\u5343"
|
|
6116
|
-
],
|
|
6230
|
+
], dl = [
|
|
6117
6231
|
"",
|
|
6118
6232
|
"\u4e07",
|
|
6119
6233
|
"\u4ebf",
|
|
6120
6234
|
"\u5146"
|
|
6121
|
-
],
|
|
6235
|
+
], fl = new Intl.PluralRules("en-US", { type: "ordinal" }), pl = {
|
|
6122
6236
|
few: "rd",
|
|
6123
6237
|
many: "th",
|
|
6124
6238
|
one: "st",
|
|
@@ -6126,15 +6240,15 @@ var Yc = [
|
|
|
6126
6240
|
two: "nd",
|
|
6127
6241
|
zero: "th"
|
|
6128
6242
|
};
|
|
6129
|
-
function
|
|
6130
|
-
return t === "zh-CN" ? `\u7b2c${
|
|
6243
|
+
function ml(e, t) {
|
|
6244
|
+
return t === "zh-CN" ? `\u7b2c${gl(e)}\u7a7a` : `${e}${pl[fl.select(e)]} blank`;
|
|
6131
6245
|
}
|
|
6132
|
-
function
|
|
6133
|
-
let r = [...e].sort((e, n) => t.indexOf(e) - t.indexOf(n)).map((e) => t.indexOf(e) + 1).filter((e) => e > 0).map((e) =>
|
|
6246
|
+
function hl(e, t, n) {
|
|
6247
|
+
let r = [...e].sort((e, n) => t.indexOf(e) - t.indexOf(n)).map((e) => t.indexOf(e) + 1).filter((e) => e > 0).map((e) => ml(e, n));
|
|
6134
6248
|
return n === "zh-CN" ? `${r.join("\u3001")}\uff1a` : `${r.join(", ")}:`;
|
|
6135
6249
|
}
|
|
6136
|
-
function
|
|
6137
|
-
let t =
|
|
6250
|
+
function gl(e) {
|
|
6251
|
+
let t = _l(e), n = "", r = !1;
|
|
6138
6252
|
for (let e = t.length - 1; e >= 0; --e) {
|
|
6139
6253
|
var i;
|
|
6140
6254
|
let a = (i = t[e]) == null ? 0 : i;
|
|
@@ -6142,16 +6256,16 @@ function nl(e) {
|
|
|
6142
6256
|
r = n.length > 0;
|
|
6143
6257
|
continue;
|
|
6144
6258
|
}
|
|
6145
|
-
n.length > 0 && (r || a < 1e3) && (n +=
|
|
6259
|
+
n.length > 0 && (r || a < 1e3) && (n += ll[0]), n += `${vl(a)}${dl[e]}`, r = !1;
|
|
6146
6260
|
}
|
|
6147
6261
|
return n.startsWith("\u4e00\u5341") ? n.slice(1) : n;
|
|
6148
6262
|
}
|
|
6149
|
-
function
|
|
6263
|
+
function _l(e) {
|
|
6150
6264
|
let t = [], n = e;
|
|
6151
6265
|
for (; n > 0;) t.push(n % 1e4), n = Math.floor(n / 1e4);
|
|
6152
6266
|
return t;
|
|
6153
6267
|
}
|
|
6154
|
-
function
|
|
6268
|
+
function vl(e) {
|
|
6155
6269
|
let t = "", n = !1;
|
|
6156
6270
|
for (let r = 3; r >= 0; --r) {
|
|
6157
6271
|
let i = Math.pow(10, r), a = Math.floor(e / i) % 10;
|
|
@@ -6159,15 +6273,15 @@ function il(e) {
|
|
|
6159
6273
|
n = t.length > 0 && e % i > 0;
|
|
6160
6274
|
continue;
|
|
6161
6275
|
}
|
|
6162
|
-
n && (t +=
|
|
6276
|
+
n && (t += ll[0]), t += `${ll[a]}${ul[r]}`, n = !1;
|
|
6163
6277
|
}
|
|
6164
6278
|
return t;
|
|
6165
6279
|
}
|
|
6166
6280
|
//#endregion
|
|
6167
6281
|
//#region src/question/renderers/question-renderer-behavior.ts
|
|
6168
|
-
var
|
|
6282
|
+
var yl = {
|
|
6169
6283
|
answerGroupLayout: "flow",
|
|
6170
|
-
blankAnswerMarker: (e, t, n, r) =>
|
|
6284
|
+
blankAnswerMarker: (e, t, n, r) => tl(e, t, r),
|
|
6171
6285
|
blankPlaceholder: "labeled-field",
|
|
6172
6286
|
candidateLayout: "plain-list",
|
|
6173
6287
|
columnLayout: "css",
|
|
@@ -6179,9 +6293,9 @@ var al = {
|
|
|
6179
6293
|
showEmptyAnswerGroups: !1,
|
|
6180
6294
|
systemListMarkup: "native",
|
|
6181
6295
|
textResponseVisibility: "hidden"
|
|
6182
|
-
},
|
|
6296
|
+
}, bl = {
|
|
6183
6297
|
answerGroupLayout: "rows",
|
|
6184
|
-
blankAnswerMarker: (e, t, n) =>
|
|
6298
|
+
blankAnswerMarker: (e, t, n) => hl(e, t, n),
|
|
6185
6299
|
blankPlaceholder: "answer-line",
|
|
6186
6300
|
candidateLayout: "labeled-groups",
|
|
6187
6301
|
columnLayout: "document-table",
|
|
@@ -6193,30 +6307,28 @@ var al = {
|
|
|
6193
6307
|
showEmptyAnswerGroups: !0,
|
|
6194
6308
|
systemListMarkup: "explicit",
|
|
6195
6309
|
textResponseVisibility: "accessible-only"
|
|
6196
|
-
},
|
|
6310
|
+
}, xl = l(yl), Sl = l("zh-CN");
|
|
6197
6311
|
function W() {
|
|
6198
|
-
return d(
|
|
6312
|
+
return d(xl);
|
|
6199
6313
|
}
|
|
6200
|
-
function
|
|
6201
|
-
return d(
|
|
6314
|
+
function Cl() {
|
|
6315
|
+
return d(Sl);
|
|
6202
6316
|
}
|
|
6203
|
-
var
|
|
6317
|
+
var wl = { placeholder: "_placeholder_np8ps_1" }, Tl = {
|
|
6204
6318
|
"blank-list": "_blank-list_12ccp_1",
|
|
6205
6319
|
"blank-item": "_blank-item_12ccp_11",
|
|
6206
6320
|
"blank-field": "_blank-field_12ccp_17"
|
|
6207
|
-
},
|
|
6208
|
-
board: "
|
|
6209
|
-
pool: "
|
|
6210
|
-
zones: "
|
|
6211
|
-
zone: "
|
|
6212
|
-
"zone-title": "_zone-
|
|
6213
|
-
item: "
|
|
6214
|
-
empty: "
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
unanswered: "_unanswered_1f76b_85"
|
|
6219
|
-
}, pl = {
|
|
6321
|
+
}, El = {
|
|
6322
|
+
board: "_board_5m701_1",
|
|
6323
|
+
pool: "_pool_5m701_6",
|
|
6324
|
+
zones: "_zones_5m701_13",
|
|
6325
|
+
zone: "_zone_5m701_13",
|
|
6326
|
+
"zone-title": "_zone-title_5m701_30",
|
|
6327
|
+
item: "_item_5m701_37",
|
|
6328
|
+
empty: "_empty_5m701_52",
|
|
6329
|
+
"unanswered-item": "_unanswered-item_5m701_72",
|
|
6330
|
+
selected: "_selected_5m701_83"
|
|
6331
|
+
}, Dl = {
|
|
6220
6332
|
board: "_board_5xarh_1",
|
|
6221
6333
|
columns: "_columns_5xarh_6",
|
|
6222
6334
|
column: "_column_5xarh_6",
|
|
@@ -6238,12 +6350,12 @@ var ul = { placeholder: "_placeholder_np8ps_1" }, dl = {
|
|
|
6238
6350
|
"section-title": "_section-title_1aumw_125",
|
|
6239
6351
|
"word-builder-blank": "_word-builder-blank_1aumw_131",
|
|
6240
6352
|
"word-builder-candidate-list": "_word-builder-candidate-list_1aumw_147"
|
|
6241
|
-
},
|
|
6353
|
+
}, Ol = {
|
|
6242
6354
|
"table-wrap": "_table-wrap_n67ah_1",
|
|
6243
6355
|
table: "_table_n67ah_1",
|
|
6244
6356
|
"table-option-column": "_table-option-column_n67ah_17",
|
|
6245
6357
|
"table-option-marker": "_table-option-marker_n67ah_45"
|
|
6246
|
-
},
|
|
6358
|
+
}, kl = l({
|
|
6247
6359
|
answer: {
|
|
6248
6360
|
"answer-panel": "_answer-panel_1bkkd_1",
|
|
6249
6361
|
"answer-list": "_answer-list_1bkkd_8",
|
|
@@ -6253,13 +6365,13 @@ var ul = { placeholder: "_placeholder_np8ps_1" }, dl = {
|
|
|
6253
6365
|
"answer-content-list": "_answer-content-list_1bkkd_46",
|
|
6254
6366
|
"answer-value": "_answer-value_1bkkd_55"
|
|
6255
6367
|
},
|
|
6256
|
-
blankGroup:
|
|
6257
|
-
classification:
|
|
6368
|
+
blankGroup: Tl,
|
|
6369
|
+
classification: El,
|
|
6258
6370
|
lineConnect: V,
|
|
6259
|
-
matching:
|
|
6371
|
+
matching: Dl,
|
|
6260
6372
|
renderer: G,
|
|
6261
6373
|
sectionTitle: { title: "_title_hrc5o_1" },
|
|
6262
|
-
table:
|
|
6374
|
+
table: Ol,
|
|
6263
6375
|
textMarker: {
|
|
6264
6376
|
content: "_content_63948_1",
|
|
6265
6377
|
paragraph: "_paragraph_63948_10",
|
|
@@ -6268,37 +6380,38 @@ var ul = { placeholder: "_placeholder_np8ps_1" }, dl = {
|
|
|
6268
6380
|
"marker-selected": "_marker-selected_63948_31",
|
|
6269
6381
|
"marker-answer": "_marker-answer_63948_37"
|
|
6270
6382
|
},
|
|
6271
|
-
textResponse:
|
|
6383
|
+
textResponse: wl
|
|
6272
6384
|
});
|
|
6273
6385
|
function K() {
|
|
6274
|
-
return d(
|
|
6386
|
+
return d(kl);
|
|
6275
6387
|
}
|
|
6276
6388
|
//#endregion
|
|
6277
6389
|
//#region src/question/renderers/QuestionSectionTitle.tsx
|
|
6278
|
-
function
|
|
6279
|
-
let { sectionTitleSuffix: t } = W(), n =
|
|
6390
|
+
function Al({ children: e }) {
|
|
6391
|
+
let { sectionTitleSuffix: t } = W(), n = Cl(), { sectionTitle: r } = K();
|
|
6280
6392
|
return /* @__PURE__ */ o("h3", {
|
|
6281
6393
|
className: r.title,
|
|
6282
6394
|
children: [e, t(n)]
|
|
6283
6395
|
});
|
|
6284
6396
|
}
|
|
6285
6397
|
var q = {
|
|
6286
|
-
root: "
|
|
6287
|
-
"element-list": "_element-
|
|
6288
|
-
children: "
|
|
6289
|
-
"control-list": "_control-
|
|
6290
|
-
"fill-text": "_fill-
|
|
6291
|
-
element: "
|
|
6292
|
-
extra: "
|
|
6293
|
-
child: "
|
|
6294
|
-
"field-label": "_field-
|
|
6295
|
-
empty: "
|
|
6296
|
-
input: "
|
|
6297
|
-
field: "
|
|
6398
|
+
root: "_root_odzjk_1",
|
|
6399
|
+
"element-list": "_element-list_odzjk_18",
|
|
6400
|
+
children: "_children_odzjk_19",
|
|
6401
|
+
"control-list": "_control-list_odzjk_20",
|
|
6402
|
+
"fill-text": "_fill-text_odzjk_21",
|
|
6403
|
+
element: "_element_odzjk_18",
|
|
6404
|
+
extra: "_extra_odzjk_31",
|
|
6405
|
+
child: "_child_odzjk_19",
|
|
6406
|
+
"field-label": "_field-label_odzjk_43",
|
|
6407
|
+
empty: "_empty_odzjk_49",
|
|
6408
|
+
input: "_input_odzjk_61",
|
|
6409
|
+
field: "_field_odzjk_43",
|
|
6410
|
+
"blank-field": "_blank-field_odzjk_91"
|
|
6298
6411
|
};
|
|
6299
6412
|
//#endregion
|
|
6300
6413
|
//#region src/question/player/QuestionPlayerComposite.tsx
|
|
6301
|
-
function
|
|
6414
|
+
function jl({ childIndexPath: e = [], messages: t, onChildResponseChange: n, renderChild: r, response: i, rootQuestionNumber: o, value: s }) {
|
|
6302
6415
|
return s.children.length === 0 ? /* @__PURE__ */ a("div", {
|
|
6303
6416
|
className: q.empty,
|
|
6304
6417
|
children: t.previewEmpty
|
|
@@ -6331,7 +6444,7 @@ function J({ className: e, content: t }) {
|
|
|
6331
6444
|
}
|
|
6332
6445
|
//#endregion
|
|
6333
6446
|
//#region src/question/renderers/QuestionSystemList.tsx
|
|
6334
|
-
function
|
|
6447
|
+
function Ml({ children: e, className: t, dataCandidateLayout: n }) {
|
|
6335
6448
|
let { systemListMarkup: r } = W();
|
|
6336
6449
|
return r === "native" ? /* @__PURE__ */ a("ol", {
|
|
6337
6450
|
className: t,
|
|
@@ -6346,7 +6459,7 @@ function vl({ children: e, className: t, dataCandidateLayout: n }) {
|
|
|
6346
6459
|
}
|
|
6347
6460
|
//#endregion
|
|
6348
6461
|
//#region src/question/renderers/QuestionSystemListItem.tsx
|
|
6349
|
-
function
|
|
6462
|
+
function Nl({ children: e, className: t }) {
|
|
6350
6463
|
let { systemListMarkup: n } = W();
|
|
6351
6464
|
return n === "native" ? /* @__PURE__ */ a("li", {
|
|
6352
6465
|
className: t,
|
|
@@ -6365,9 +6478,9 @@ function Y({ groups: e, title: t }) {
|
|
|
6365
6478
|
"aria-label": t,
|
|
6366
6479
|
className: i["answer-panel"],
|
|
6367
6480
|
"data-answer-group-layout": n,
|
|
6368
|
-
children: [/* @__PURE__ */ a(
|
|
6481
|
+
children: [/* @__PURE__ */ a(Al, { children: t }), /* @__PURE__ */ a(Ml, {
|
|
6369
6482
|
className: i["answer-list"],
|
|
6370
|
-
children: s.map((e, t) => /* @__PURE__ */ o(
|
|
6483
|
+
children: s.map((e, t) => /* @__PURE__ */ o(Nl, {
|
|
6371
6484
|
className: i["answer-row"],
|
|
6372
6485
|
children: [e.marker ? /* @__PURE__ */ a("span", {
|
|
6373
6486
|
className: e.kind === "markerOnly" ? `${i["answer-marker"]} ${i["answer-marker-only"]}` : i["answer-marker"],
|
|
@@ -6384,49 +6497,74 @@ function Y({ groups: e, title: t }) {
|
|
|
6384
6497
|
});
|
|
6385
6498
|
}
|
|
6386
6499
|
//#endregion
|
|
6500
|
+
//#region src/question/player/QuestionGradingMark.tsx
|
|
6501
|
+
function Pl({ status: e, children: t, unansweredAsWarning: n = !1 }) {
|
|
6502
|
+
let r = d(Zc);
|
|
6503
|
+
if (!e) return t ? /* @__PURE__ */ a(i, { children: t }) : null;
|
|
6504
|
+
let s = n && e === "unanswered";
|
|
6505
|
+
return /* @__PURE__ */ o("span", {
|
|
6506
|
+
className: `${Xc.mark} ${Qc(e)} ${s ? Xc["unanswered-warning"] : ""}`,
|
|
6507
|
+
title: s ? $c[r][e] : void 0,
|
|
6508
|
+
"data-grading-status": e,
|
|
6509
|
+
children: [t, s ? null : /* @__PURE__ */ a("span", {
|
|
6510
|
+
className: Xc.icon,
|
|
6511
|
+
role: "img",
|
|
6512
|
+
"aria-label": $c[r][e],
|
|
6513
|
+
title: $c[r][e],
|
|
6514
|
+
children: /* @__PURE__ */ a("svg", {
|
|
6515
|
+
viewBox: "0 0 24 24",
|
|
6516
|
+
"aria-hidden": "true",
|
|
6517
|
+
focusable: "false",
|
|
6518
|
+
children: /* @__PURE__ */ a("path", { d: el[e] })
|
|
6519
|
+
})
|
|
6520
|
+
})]
|
|
6521
|
+
});
|
|
6522
|
+
}
|
|
6523
|
+
//#endregion
|
|
6387
6524
|
//#region src/question/player/QuestionBlankGroupPlayer.tsx
|
|
6388
|
-
function
|
|
6389
|
-
let
|
|
6525
|
+
function Fl({ gradingResult: e, disabled: t, item: n, messages: r, onChange: i, response: s, responseIndex: c, showAnswer: l }) {
|
|
6526
|
+
let u = rc(s, c, n.blanks), d = Yn(n.answers, n.blanks).map((e, t) => ({
|
|
6390
6527
|
kind: "detailed",
|
|
6391
|
-
contents: e.answerPools.map((e,
|
|
6392
|
-
marker:
|
|
6528
|
+
contents: e.answerPools.map((e, n) => /* @__PURE__ */ a(J, { content: e }, `group-${t}-answer-${n}`)),
|
|
6529
|
+
marker: tl(e.blankIds, n.blanks, r.blankLabel)
|
|
6393
6530
|
}));
|
|
6394
|
-
function
|
|
6395
|
-
|
|
6531
|
+
function f(e, t) {
|
|
6532
|
+
i(j(j({}, u), {}, { answers: j(j({}, u.answers), {}, { [e]: t }) }));
|
|
6396
6533
|
}
|
|
6397
6534
|
return /* @__PURE__ */ o("div", {
|
|
6398
6535
|
className: q["control-list"],
|
|
6399
|
-
children: [
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
className: q["field
|
|
6403
|
-
children:
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
|
|
6536
|
+
children: [n.blanks.map((n, i) => {
|
|
6537
|
+
var o;
|
|
6538
|
+
return /* @__PURE__ */ a("label", {
|
|
6539
|
+
className: q["blank-field"],
|
|
6540
|
+
children: /* @__PURE__ */ a(Pl, {
|
|
6541
|
+
unansweredAsWarning: !0,
|
|
6542
|
+
status: e == null || (o = e.blankResults.find((e) => e.blankId === n)) == null ? void 0 : o.status,
|
|
6543
|
+
children: /* @__PURE__ */ a("input", {
|
|
6544
|
+
"aria-label": `${r.blankLabel} ${i + 1}`,
|
|
6545
|
+
className: q.input,
|
|
6546
|
+
disabled: t,
|
|
6547
|
+
onChange: (e) => f(n, e.target.value),
|
|
6548
|
+
value: Ll(u.answers, n)
|
|
6549
|
+
})
|
|
6550
|
+
})
|
|
6551
|
+
}, Il(n, i));
|
|
6552
|
+
}), l ? /* @__PURE__ */ a(Y, {
|
|
6553
|
+
groups: d,
|
|
6554
|
+
title: r.standardAnswer
|
|
6417
6555
|
}) : null]
|
|
6418
6556
|
});
|
|
6419
6557
|
}
|
|
6420
|
-
function
|
|
6558
|
+
function Il(e, t) {
|
|
6421
6559
|
return e || `blank-${t + 1}`;
|
|
6422
6560
|
}
|
|
6423
|
-
function
|
|
6561
|
+
function Ll(e, t) {
|
|
6424
6562
|
var n, r;
|
|
6425
6563
|
return (n = (r = Object.entries(e).find(([e]) => e === t)) == null ? void 0 : r[1]) == null ? "" : n;
|
|
6426
6564
|
}
|
|
6427
6565
|
//#endregion
|
|
6428
6566
|
//#region src/question/renderers/classificationAnswers.tsx
|
|
6429
|
-
function
|
|
6567
|
+
function Rl(e) {
|
|
6430
6568
|
return e.categories.map((t) => ({
|
|
6431
6569
|
kind: "detailed",
|
|
6432
6570
|
contents: e.items.filter((n) => e.answers[n.id] === t.id).map((e) => /* @__PURE__ */ a(J, { content: e.content }, `${t.id}-${e.id}`)),
|
|
@@ -6435,125 +6573,121 @@ function Cl(e) {
|
|
|
6435
6573
|
}
|
|
6436
6574
|
//#endregion
|
|
6437
6575
|
//#region src/question/player/QuestionClassificationPlayer.tsx
|
|
6438
|
-
function
|
|
6439
|
-
let [
|
|
6440
|
-
function
|
|
6441
|
-
|
|
6576
|
+
function zl({ gradingResult: e, disabled: t, item: n, messages: r, onChange: i, response: s, responseIndex: c, showAnswer: l }) {
|
|
6577
|
+
let [u, d] = h(""), f = sc(s, c), p = Bl(f.placements, n), m = n.items.find((e) => e.id === u);
|
|
6578
|
+
function g(e, r) {
|
|
6579
|
+
t || (i(j(j({}, f), {}, { placements: Bl(yc(p, e, r), n) })), d(""));
|
|
6442
6580
|
}
|
|
6443
|
-
function
|
|
6444
|
-
|
|
6445
|
-
let r =
|
|
6446
|
-
!
|
|
6581
|
+
function _(e, n) {
|
|
6582
|
+
e.preventDefault();
|
|
6583
|
+
let r = e.dataTransfer.getData("question/classification-item");
|
|
6584
|
+
!t && r && g(r, n);
|
|
6447
6585
|
}
|
|
6448
|
-
function
|
|
6449
|
-
|
|
6450
|
-
|
|
6451
|
-
|
|
6452
|
-
|
|
6453
|
-
|
|
6586
|
+
function v(n) {
|
|
6587
|
+
var r;
|
|
6588
|
+
let i = u === n.id, s = e == null || (r = e.itemResults.find((e) => e.itemId === n.id)) == null ? void 0 : r.status;
|
|
6589
|
+
return /* @__PURE__ */ o("button", {
|
|
6590
|
+
"aria-pressed": i,
|
|
6591
|
+
className: U(El.item, i && El.selected, Qc(s), s === "unanswered" && El["unanswered-item"]),
|
|
6592
|
+
"data-status": s,
|
|
6454
6593
|
"data-testid": `classification-player-item-${n.id}`,
|
|
6455
|
-
disabled:
|
|
6456
|
-
draggable: !
|
|
6594
|
+
disabled: t,
|
|
6595
|
+
draggable: !t,
|
|
6457
6596
|
onClick: (e) => {
|
|
6458
|
-
e.stopPropagation(),
|
|
6597
|
+
e.stopPropagation(), d(i ? "" : n.id);
|
|
6459
6598
|
},
|
|
6460
6599
|
onDragStart: (e) => {
|
|
6461
6600
|
e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("question/classification-item", n.id);
|
|
6462
6601
|
},
|
|
6463
6602
|
type: "button",
|
|
6464
|
-
children: /* @__PURE__ */ a(J, { content: n.content })
|
|
6603
|
+
children: [/* @__PURE__ */ a(J, { content: n.content }), s === "unanswered" ? null : /* @__PURE__ */ a(Pl, { status: s })]
|
|
6465
6604
|
}, n.id);
|
|
6466
6605
|
}
|
|
6467
6606
|
return /* @__PURE__ */ o("div", {
|
|
6468
6607
|
className: G.element,
|
|
6469
6608
|
children: [/* @__PURE__ */ o("div", {
|
|
6470
|
-
className:
|
|
6609
|
+
className: El.board,
|
|
6471
6610
|
children: [/* @__PURE__ */ a("div", {
|
|
6472
|
-
className:
|
|
6611
|
+
className: El.zones,
|
|
6473
6612
|
"data-testid": "classification-zones",
|
|
6474
|
-
children:
|
|
6475
|
-
let
|
|
6613
|
+
children: n.categories.map((e) => {
|
|
6614
|
+
let t = n.items.filter((t) => p[t.id] === e.id);
|
|
6476
6615
|
return /* @__PURE__ */ o("section", {
|
|
6477
|
-
className:
|
|
6478
|
-
onClick: () =>
|
|
6616
|
+
className: El.zone,
|
|
6617
|
+
onClick: () => m ? g(m.id, e.id) : void 0,
|
|
6479
6618
|
onDragOver: (e) => e.preventDefault(),
|
|
6480
|
-
onDrop: (t) =>
|
|
6619
|
+
onDrop: (t) => _(t, e.id),
|
|
6481
6620
|
children: [/* @__PURE__ */ a("div", {
|
|
6482
|
-
className:
|
|
6621
|
+
className: El["zone-title"],
|
|
6483
6622
|
children: /* @__PURE__ */ a(J, { content: e.content })
|
|
6484
|
-
}),
|
|
6485
|
-
className:
|
|
6486
|
-
children:
|
|
6623
|
+
}), t.length > 0 ? t.map((e) => v(e)) : /* @__PURE__ */ a("span", {
|
|
6624
|
+
className: El.empty,
|
|
6625
|
+
children: r.unassigned
|
|
6487
6626
|
})]
|
|
6488
6627
|
}, e.id);
|
|
6489
6628
|
})
|
|
6490
6629
|
}), /* @__PURE__ */ a("section", {
|
|
6491
|
-
className:
|
|
6630
|
+
className: El.pool,
|
|
6492
6631
|
"data-testid": "classification-pool",
|
|
6493
|
-
onClick: () =>
|
|
6632
|
+
onClick: () => m ? g(m.id, "") : void 0,
|
|
6494
6633
|
onDragOver: (e) => e.preventDefault(),
|
|
6495
|
-
onDrop: (e) =>
|
|
6496
|
-
children:
|
|
6634
|
+
onDrop: (e) => _(e, ""),
|
|
6635
|
+
children: n.items.filter((e) => !p[e.id]).map((e) => v(e))
|
|
6497
6636
|
})]
|
|
6498
|
-
}),
|
|
6499
|
-
groups:
|
|
6500
|
-
title:
|
|
6637
|
+
}), l ? /* @__PURE__ */ a(Y, {
|
|
6638
|
+
groups: Rl(n),
|
|
6639
|
+
title: r.standardAnswer
|
|
6501
6640
|
}) : null]
|
|
6502
6641
|
});
|
|
6503
6642
|
}
|
|
6504
|
-
function
|
|
6505
|
-
var i, a;
|
|
6506
|
-
let o = (i = t[e]) == null ? "" : i, s = (a = n.answers[e]) == null ? "" : a;
|
|
6507
|
-
if (!(!r || !s)) return o ? s === o ? "correct" : "incorrect" : "unanswered";
|
|
6508
|
-
}
|
|
6509
|
-
function El(e, t) {
|
|
6643
|
+
function Bl(e, t) {
|
|
6510
6644
|
return Qe(e, t.categories, t.items);
|
|
6511
6645
|
}
|
|
6512
6646
|
//#endregion
|
|
6513
6647
|
//#region src/question/renderers/QuestionRichContentWithBlankView.tsx
|
|
6514
|
-
function
|
|
6648
|
+
function Vl({ className: e, content: t, renderBlank: n }) {
|
|
6515
6649
|
let { renderer: r } = K(), i = /* @__PURE__ */ new Map();
|
|
6516
6650
|
return /* @__PURE__ */ a("div", {
|
|
6517
6651
|
className: [r["rich-content"], e == null ? "" : e].filter(Boolean).join(" "),
|
|
6518
|
-
children: t.json.map((e, t) =>
|
|
6652
|
+
children: t.json.map((e, t) => Hl(e, {
|
|
6519
6653
|
blankIndexes: i,
|
|
6520
6654
|
key: `node-${t}`,
|
|
6521
6655
|
renderBlank: n
|
|
6522
6656
|
}))
|
|
6523
6657
|
});
|
|
6524
6658
|
}
|
|
6525
|
-
function
|
|
6526
|
-
return typeof e.text == "string" ? /* @__PURE__ */ a(c, { children: e.text }, t.key) : e.type === "blank" ? /* @__PURE__ */ a(c, { children:
|
|
6659
|
+
function Hl(e, t) {
|
|
6660
|
+
return typeof e.text == "string" ? /* @__PURE__ */ a(c, { children: e.text }, t.key) : e.type === "blank" ? /* @__PURE__ */ a(c, { children: Wl(e, t) }, t.key) : Ul(e, t);
|
|
6527
6661
|
}
|
|
6528
|
-
function
|
|
6662
|
+
function Ul(e, t) {
|
|
6529
6663
|
if (e.type === "image" || e.type === "formula") return /* @__PURE__ */ a("span", { dangerouslySetInnerHTML: { __html: r([e]) } }, t.key);
|
|
6530
|
-
let n =
|
|
6664
|
+
let n = Kl(e.children, t);
|
|
6531
6665
|
switch (e.type) {
|
|
6532
|
-
case "heading": return
|
|
6666
|
+
case "heading": return ql(e, n, t.key);
|
|
6533
6667
|
case "table": return /* @__PURE__ */ a("table", { children: n }, t.key);
|
|
6534
6668
|
case "table-row": return /* @__PURE__ */ a("tr", { children: n }, t.key);
|
|
6535
6669
|
case "table-cell": return /* @__PURE__ */ a("td", { children: n }, t.key);
|
|
6536
6670
|
default: return /* @__PURE__ */ a("p", { children: n }, t.key);
|
|
6537
6671
|
}
|
|
6538
6672
|
}
|
|
6539
|
-
function
|
|
6540
|
-
let n =
|
|
6673
|
+
function Wl(e, t) {
|
|
6674
|
+
let n = Jl(e.blankId), r = Gl(t.blankIndexes, n);
|
|
6541
6675
|
return t.renderBlank({
|
|
6542
6676
|
blankId: n,
|
|
6543
6677
|
index: r,
|
|
6544
|
-
label:
|
|
6678
|
+
label: Jl(e.label)
|
|
6545
6679
|
});
|
|
6546
6680
|
}
|
|
6547
|
-
function
|
|
6681
|
+
function Gl(e, t) {
|
|
6548
6682
|
let n = e.get(t);
|
|
6549
6683
|
if (n !== void 0) return n;
|
|
6550
6684
|
let r = e.size;
|
|
6551
6685
|
return e.set(t, r), r;
|
|
6552
6686
|
}
|
|
6553
|
-
function
|
|
6554
|
-
return (e == null ? [] : e).map((e, n) =>
|
|
6687
|
+
function Kl(e, t) {
|
|
6688
|
+
return (e == null ? [] : e).map((e, n) => Hl(e, j(j({}, t), {}, { key: `${t.key}-${n}` })));
|
|
6555
6689
|
}
|
|
6556
|
-
function
|
|
6690
|
+
function ql(e, t, n) {
|
|
6557
6691
|
switch (e.level) {
|
|
6558
6692
|
case 1: return /* @__PURE__ */ a("h1", { children: t }, n);
|
|
6559
6693
|
case 2: return /* @__PURE__ */ a("h2", { children: t }, n);
|
|
@@ -6561,45 +6695,56 @@ function Nl(e, t, n) {
|
|
|
6561
6695
|
default: return /* @__PURE__ */ a("p", { children: t }, n);
|
|
6562
6696
|
}
|
|
6563
6697
|
}
|
|
6564
|
-
function
|
|
6698
|
+
function Jl(e) {
|
|
6565
6699
|
return typeof e == "string" ? e : "";
|
|
6566
6700
|
}
|
|
6567
|
-
var
|
|
6568
|
-
"inline-
|
|
6569
|
-
"inline-
|
|
6570
|
-
"inline-
|
|
6571
|
-
"inline-blank-
|
|
6572
|
-
"
|
|
6573
|
-
"shared-candidate-
|
|
6574
|
-
"shared-candidate-
|
|
6575
|
-
"
|
|
6576
|
-
"per-blank-candidate-
|
|
6577
|
-
"per-blank-candidate-
|
|
6578
|
-
"per-blank-candidate-
|
|
6579
|
-
|
|
6701
|
+
var Yl = {
|
|
6702
|
+
"inline-answer": "_inline-answer_1lmz2_1",
|
|
6703
|
+
"inline-input": "_inline-input_1lmz2_8",
|
|
6704
|
+
"inline-select": "_inline-select_1lmz2_25",
|
|
6705
|
+
"inline-blank-underline": "_inline-blank-underline_1lmz2_53",
|
|
6706
|
+
"inline-blank-content": "_inline-blank-content_1lmz2_66",
|
|
6707
|
+
"shared-candidate-list": "_shared-candidate-list_1lmz2_73",
|
|
6708
|
+
"shared-candidate-item": "_shared-candidate-item_1lmz2_82",
|
|
6709
|
+
"shared-candidate-content": "_shared-candidate-content_1lmz2_98",
|
|
6710
|
+
"per-blank-candidate-options": "_per-blank-candidate-options_1lmz2_104",
|
|
6711
|
+
"per-blank-candidate-group": "_per-blank-candidate-group_1lmz2_111",
|
|
6712
|
+
"per-blank-candidate-title": "_per-blank-candidate-title_1lmz2_118",
|
|
6713
|
+
"per-blank-candidate-list": "_per-blank-candidate-list_1lmz2_137",
|
|
6714
|
+
selected: "_selected_1lmz2_159"
|
|
6580
6715
|
};
|
|
6581
6716
|
//#endregion
|
|
6582
6717
|
//#region src/question/player/QuestionFillTextContentPlayer.tsx
|
|
6583
|
-
function
|
|
6584
|
-
return /* @__PURE__ */ a(
|
|
6585
|
-
content:
|
|
6586
|
-
renderBlank: (
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6718
|
+
function Xl({ gradingResult: e, answers: t, disabled: n, item: r, messages: i, onAnswerChange: o, structure: s }) {
|
|
6719
|
+
return /* @__PURE__ */ a(Vl, {
|
|
6720
|
+
content: r.content,
|
|
6721
|
+
renderBlank: (c) => {
|
|
6722
|
+
var l;
|
|
6723
|
+
return /* @__PURE__ */ a("span", {
|
|
6724
|
+
className: Yl["inline-answer"],
|
|
6725
|
+
children: /* @__PURE__ */ a(Pl, {
|
|
6726
|
+
unansweredAsWarning: !0,
|
|
6727
|
+
status: e == null || (l = e.blankResults.find((e) => e.blankId === c.blankId)) == null ? void 0 : l.status,
|
|
6728
|
+
children: Zl(c, {
|
|
6729
|
+
answers: t,
|
|
6730
|
+
blankLabel: i.blankLabel,
|
|
6731
|
+
disabled: n,
|
|
6732
|
+
item: r,
|
|
6733
|
+
onAnswerChange: o,
|
|
6734
|
+
structure: s
|
|
6735
|
+
})
|
|
6736
|
+
})
|
|
6737
|
+
});
|
|
6738
|
+
}
|
|
6594
6739
|
});
|
|
6595
6740
|
}
|
|
6596
|
-
function
|
|
6597
|
-
let { blankId: n } = e, r = t.item.blanks.indexOf(n), i =
|
|
6741
|
+
function Zl(e, t) {
|
|
6742
|
+
let { blankId: n } = e, r = t.item.blanks.indexOf(n), i = ru(e.label, t.blankLabel, r);
|
|
6598
6743
|
if (t.structure.config.candidateMode === "none") {
|
|
6599
|
-
let e =
|
|
6744
|
+
let e = $l(t.answers, n);
|
|
6600
6745
|
return /* @__PURE__ */ a("input", {
|
|
6601
6746
|
"aria-label": i,
|
|
6602
|
-
className:
|
|
6747
|
+
className: Yl["inline-input"],
|
|
6603
6748
|
disabled: t.disabled,
|
|
6604
6749
|
onChange: (e) => t.onAnswerChange(n, {
|
|
6605
6750
|
kind: "text",
|
|
@@ -6608,23 +6753,23 @@ function Ll(e, t) {
|
|
|
6608
6753
|
value: (e == null ? void 0 : e.kind) === "text" ? e.value : ""
|
|
6609
6754
|
});
|
|
6610
6755
|
}
|
|
6611
|
-
if (t.structure.config.candidateMode === "sharedPool") return
|
|
6612
|
-
let o =
|
|
6756
|
+
if (t.structure.config.candidateMode === "sharedPool") return Ql(n, i, t);
|
|
6757
|
+
let o = $l(t.answers, n), s = tu(t.item, n, t.structure.config.candidateMode, o);
|
|
6613
6758
|
return /* @__PURE__ */ a("span", {
|
|
6614
6759
|
"aria-label": i,
|
|
6615
|
-
className:
|
|
6760
|
+
className: Yl["inline-blank-underline"],
|
|
6616
6761
|
children: s ? /* @__PURE__ */ a(J, {
|
|
6617
|
-
className:
|
|
6762
|
+
className: Yl["inline-blank-content"],
|
|
6618
6763
|
content: s.content
|
|
6619
6764
|
}) : i
|
|
6620
6765
|
});
|
|
6621
6766
|
}
|
|
6622
|
-
function
|
|
6767
|
+
function Ql(e, t, n) {
|
|
6623
6768
|
var r, i;
|
|
6624
|
-
let s =
|
|
6769
|
+
let s = $l(n.answers, e), c = (r = ((s == null ? void 0 : s.kind) === "option" ? s.optionIds : []).slice(0, 1)[0]) == null ? "" : r, l = nu(n.answers, e);
|
|
6625
6770
|
return /* @__PURE__ */ o("select", {
|
|
6626
6771
|
"aria-label": t,
|
|
6627
|
-
className:
|
|
6772
|
+
className: Yl["inline-select"],
|
|
6628
6773
|
disabled: n.disabled,
|
|
6629
6774
|
onChange: (t) => n.onAnswerChange(e, {
|
|
6630
6775
|
kind: "option",
|
|
@@ -6639,17 +6784,18 @@ function Rl(e, t, n) {
|
|
|
6639
6784
|
value: e.optionId,
|
|
6640
6785
|
children: [
|
|
6641
6786
|
un("upperAlpha", t),
|
|
6642
|
-
".
|
|
6787
|
+
".",
|
|
6788
|
+
" ",
|
|
6643
6789
|
e.content.text
|
|
6644
6790
|
]
|
|
6645
6791
|
}, e.optionId))]
|
|
6646
6792
|
});
|
|
6647
6793
|
}
|
|
6648
|
-
function
|
|
6794
|
+
function $l(e, t) {
|
|
6649
6795
|
var n;
|
|
6650
6796
|
return (n = Object.entries(e).find(([e]) => e === t)) == null ? void 0 : n[1];
|
|
6651
6797
|
}
|
|
6652
|
-
function
|
|
6798
|
+
function eu(e, t, n) {
|
|
6653
6799
|
var r, i;
|
|
6654
6800
|
if (n === "sharedPool") {
|
|
6655
6801
|
var a;
|
|
@@ -6657,72 +6803,73 @@ function Bl(e, t, n) {
|
|
|
6657
6803
|
}
|
|
6658
6804
|
return (r = (i = e.blankOptionGroups) == null || (i = i.find((e) => e.blankId === t)) == null ? void 0 : i.options) == null ? [] : r;
|
|
6659
6805
|
}
|
|
6660
|
-
function
|
|
6806
|
+
function tu(e, t, n, r) {
|
|
6661
6807
|
let i = (r == null ? void 0 : r.kind) === "option" ? r.optionIds[0] : void 0;
|
|
6662
|
-
if (i) return
|
|
6808
|
+
if (i) return eu(e, t, n).find((e) => e.optionId === i);
|
|
6663
6809
|
}
|
|
6664
|
-
function
|
|
6810
|
+
function nu(e, t) {
|
|
6665
6811
|
let n = /* @__PURE__ */ new Set(), r = Object.entries(e);
|
|
6666
6812
|
for (let [e, i] of r) if (e !== t && i.kind === "option") for (let e of i.optionIds) n.add(e);
|
|
6667
6813
|
return n;
|
|
6668
6814
|
}
|
|
6669
|
-
function
|
|
6815
|
+
function ru(e, t, n) {
|
|
6670
6816
|
return e || `${t} ${n + 1}`;
|
|
6671
6817
|
}
|
|
6672
6818
|
//#endregion
|
|
6673
6819
|
//#region src/question/player/QuestionFillTextPlayer.tsx
|
|
6674
|
-
function
|
|
6675
|
-
let
|
|
6820
|
+
function iu({ gradingResult: e, disabled: t, element: n, item: r, messages: i, onChange: s, response: c, responseIndex: l, showAnswer: u }) {
|
|
6821
|
+
let d = An(r, n, !0), f = sl(d), p = ic(c, l, n, d.blanks), m = f.map((e, t) => ({
|
|
6676
6822
|
kind: "detailed",
|
|
6677
6823
|
contents: e.contents.map((e, n) => /* @__PURE__ */ a(J, { content: e }, `group-${t}-answer-${n}`)),
|
|
6678
|
-
marker:
|
|
6824
|
+
marker: tl(e.blankIds, d.blanks, i.blankLabel)
|
|
6679
6825
|
}));
|
|
6680
|
-
function
|
|
6681
|
-
|
|
6826
|
+
function h(e, t) {
|
|
6827
|
+
s(j(j({}, p), {}, { answers: j(j({}, p.answers), {}, { [e]: t }) }));
|
|
6682
6828
|
}
|
|
6683
6829
|
return /* @__PURE__ */ o("div", {
|
|
6684
6830
|
className: q["fill-text"],
|
|
6685
6831
|
children: [
|
|
6686
|
-
/* @__PURE__ */ a(
|
|
6687
|
-
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6691
|
-
|
|
6692
|
-
|
|
6832
|
+
/* @__PURE__ */ a(Xl, {
|
|
6833
|
+
gradingResult: e,
|
|
6834
|
+
answers: p.answers,
|
|
6835
|
+
disabled: t,
|
|
6836
|
+
item: d,
|
|
6837
|
+
messages: i,
|
|
6838
|
+
onAnswerChange: h,
|
|
6839
|
+
structure: n
|
|
6693
6840
|
}),
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
disabled:
|
|
6697
|
-
item:
|
|
6698
|
-
onAnswerChange:
|
|
6699
|
-
responseItem:
|
|
6841
|
+
au(d, n.config.candidateMode),
|
|
6842
|
+
ou({
|
|
6843
|
+
disabled: t,
|
|
6844
|
+
item: d,
|
|
6845
|
+
onAnswerChange: h,
|
|
6846
|
+
responseItem: p
|
|
6700
6847
|
}),
|
|
6701
|
-
|
|
6702
|
-
groups:
|
|
6703
|
-
title:
|
|
6848
|
+
u ? /* @__PURE__ */ a(Y, {
|
|
6849
|
+
groups: m,
|
|
6850
|
+
title: i.standardAnswer
|
|
6704
6851
|
}) : null
|
|
6705
6852
|
]
|
|
6706
6853
|
});
|
|
6707
6854
|
}
|
|
6708
|
-
function
|
|
6855
|
+
function au(e, t) {
|
|
6709
6856
|
var n;
|
|
6710
6857
|
let r = (n = e.candidateOptions) == null ? [] : n;
|
|
6711
6858
|
return t !== "sharedPool" || r.length === 0 ? null : /* @__PURE__ */ a("ol", {
|
|
6712
|
-
className:
|
|
6859
|
+
className: Yl["shared-candidate-list"],
|
|
6713
6860
|
children: r.map((e, t) => /* @__PURE__ */ o("li", {
|
|
6714
|
-
className:
|
|
6861
|
+
className: Yl["shared-candidate-item"],
|
|
6715
6862
|
children: [/* @__PURE__ */ a("span", {
|
|
6716
6863
|
className: G.marker,
|
|
6717
6864
|
children: un("upperAlpha", t)
|
|
6718
6865
|
}), /* @__PURE__ */ a(J, {
|
|
6719
|
-
className:
|
|
6866
|
+
className: Yl["shared-candidate-content"],
|
|
6720
6867
|
content: e.content
|
|
6721
6868
|
})]
|
|
6722
6869
|
}, e.optionId))
|
|
6723
6870
|
});
|
|
6724
6871
|
}
|
|
6725
|
-
function
|
|
6872
|
+
function ou({ disabled: e, item: t, onAnswerChange: n, responseItem: r }) {
|
|
6726
6873
|
let i = t.blanks.reduce((e, n, r) => {
|
|
6727
6874
|
var i;
|
|
6728
6875
|
let a = (i = t.blankOptionGroups) == null ? void 0 : i.find((e) => e.blankId === n);
|
|
@@ -6732,8 +6879,8 @@ function Kl({ disabled: e, item: t, onAnswerChange: n, responseItem: r }) {
|
|
|
6732
6879
|
}] : e;
|
|
6733
6880
|
}, []);
|
|
6734
6881
|
return i.length === 0 ? null : /* @__PURE__ */ a("div", {
|
|
6735
|
-
className:
|
|
6736
|
-
children: i.map(({ group: t, marker: i }) =>
|
|
6882
|
+
className: Yl["per-blank-candidate-options"],
|
|
6883
|
+
children: i.map(({ group: t, marker: i }) => su({
|
|
6737
6884
|
disabled: e,
|
|
6738
6885
|
group: t,
|
|
6739
6886
|
marker: i,
|
|
@@ -6742,17 +6889,17 @@ function Kl({ disabled: e, item: t, onAnswerChange: n, responseItem: r }) {
|
|
|
6742
6889
|
}))
|
|
6743
6890
|
});
|
|
6744
6891
|
}
|
|
6745
|
-
function
|
|
6892
|
+
function su({ disabled: e, group: t, marker: n, onAnswerChange: r, responseItem: i }) {
|
|
6746
6893
|
let s = i.answers[t.blankId];
|
|
6747
6894
|
return /* @__PURE__ */ o("section", {
|
|
6748
6895
|
"aria-label": n,
|
|
6749
|
-
className:
|
|
6896
|
+
className: Yl["per-blank-candidate-group"],
|
|
6750
6897
|
children: [/* @__PURE__ */ a("span", {
|
|
6751
|
-
className:
|
|
6898
|
+
className: Yl["per-blank-candidate-title"],
|
|
6752
6899
|
children: n
|
|
6753
6900
|
}), /* @__PURE__ */ a("div", {
|
|
6754
|
-
className:
|
|
6755
|
-
children: t.options.map((n, i) =>
|
|
6901
|
+
className: Yl["per-blank-candidate-list"],
|
|
6902
|
+
children: t.options.map((n, i) => cu({
|
|
6756
6903
|
activeAnswer: s,
|
|
6757
6904
|
blankId: t.blankId,
|
|
6758
6905
|
disabled: e,
|
|
@@ -6763,11 +6910,11 @@ function ql({ disabled: e, group: t, marker: n, onAnswerChange: r, responseItem:
|
|
|
6763
6910
|
})]
|
|
6764
6911
|
}, t.blankId);
|
|
6765
6912
|
}
|
|
6766
|
-
function
|
|
6913
|
+
function cu({ activeAnswer: e, blankId: t, disabled: n, onAnswerChange: r, option: i, optionIndex: s }) {
|
|
6767
6914
|
let c = (e == null ? void 0 : e.kind) === "option" && e.optionIds.includes(i.optionId);
|
|
6768
6915
|
return /* @__PURE__ */ o("button", {
|
|
6769
6916
|
"aria-pressed": c,
|
|
6770
|
-
className: c ?
|
|
6917
|
+
className: c ? Yl.selected : void 0,
|
|
6771
6918
|
"data-selected": c ? "true" : void 0,
|
|
6772
6919
|
disabled: n,
|
|
6773
6920
|
onClick: () => r(t, gc(e, i.optionId, "single")),
|
|
@@ -6779,58 +6926,61 @@ function Jl({ activeAnswer: e, blankId: t, disabled: n, onAnswerChange: r, optio
|
|
|
6779
6926
|
}, i.optionId);
|
|
6780
6927
|
}
|
|
6781
6928
|
var X = {
|
|
6782
|
-
"choice-button": "_choice-
|
|
6783
|
-
"table-row-button": "_table-row-
|
|
6784
|
-
"judgement-button": "_judgement-
|
|
6785
|
-
"ordering-controls": "_ordering-
|
|
6786
|
-
"ordering-button": "_ordering-
|
|
6787
|
-
"choice-option": "_choice-
|
|
6788
|
-
"table-choice-row": "_table-choice-
|
|
6789
|
-
"judgement-option": "_judgement-
|
|
6790
|
-
selected: "
|
|
6791
|
-
"option-marker": "_option-
|
|
6792
|
-
"table-option-marker": "_table-option-
|
|
6929
|
+
"choice-button": "_choice-button_1twvo_1",
|
|
6930
|
+
"table-row-button": "_table-row-button_1twvo_2",
|
|
6931
|
+
"judgement-button": "_judgement-button_1twvo_28",
|
|
6932
|
+
"ordering-controls": "_ordering-controls_1twvo_44",
|
|
6933
|
+
"ordering-button": "_ordering-button_1twvo_52",
|
|
6934
|
+
"choice-option": "_choice-option_1twvo_69",
|
|
6935
|
+
"table-choice-row": "_table-choice-row_1twvo_73",
|
|
6936
|
+
"judgement-option": "_judgement-option_1twvo_79",
|
|
6937
|
+
selected: "_selected_1twvo_83",
|
|
6938
|
+
"option-marker": "_option-marker_1twvo_88",
|
|
6939
|
+
"table-option-marker": "_table-option-marker_1twvo_89",
|
|
6940
|
+
"missed-answer": "_missed-answer_1twvo_153"
|
|
6793
6941
|
};
|
|
6794
6942
|
//#endregion
|
|
6795
6943
|
//#region src/question/player/QuestionJudgementGroupPlayer.tsx
|
|
6796
|
-
function
|
|
6797
|
-
let
|
|
6944
|
+
function lu({ gradingResult: e, disabled: t, element: n, item: r, messages: i, onChange: s, response: c, responseIndex: l, showAnswer: u }) {
|
|
6945
|
+
let d = oc(c, l), f = mn(n.config.judgeAnswerMode), p = [{
|
|
6798
6946
|
kind: "detailed",
|
|
6799
|
-
contents: hn(
|
|
6947
|
+
contents: hn(n.config.judgeAnswerMode, r.answers),
|
|
6800
6948
|
marker: ""
|
|
6801
6949
|
}];
|
|
6802
|
-
function
|
|
6803
|
-
|
|
6950
|
+
function m(e) {
|
|
6951
|
+
s(j(j({}, d), {}, { selectedValues: d.selectedValues[0] === e ? [] : [e] }));
|
|
6804
6952
|
}
|
|
6805
6953
|
return /* @__PURE__ */ o("div", {
|
|
6806
6954
|
className: G.element,
|
|
6807
6955
|
children: [/* @__PURE__ */ a("ol", {
|
|
6808
6956
|
className: U(G["judgement-list"], X["judgement-list"]),
|
|
6809
|
-
children:
|
|
6810
|
-
|
|
6957
|
+
children: f.map(({ label: n, value: r }) => {
|
|
6958
|
+
var s;
|
|
6959
|
+
let c = d.selectedValues[0] === r, l = e == null || (s = e.optionResults.find((e) => e.value === r)) == null ? void 0 : s.status;
|
|
6811
6960
|
return /* @__PURE__ */ a("li", {
|
|
6812
|
-
className: U(G["judgement-item"], X["judgement-option"],
|
|
6813
|
-
"data-selected":
|
|
6814
|
-
children: /* @__PURE__ */
|
|
6815
|
-
"aria-pressed":
|
|
6961
|
+
className: U(G["judgement-item"], X["judgement-option"], c && X.selected, Qc(l)),
|
|
6962
|
+
"data-selected": c ? "true" : void 0,
|
|
6963
|
+
children: /* @__PURE__ */ o("button", {
|
|
6964
|
+
"aria-pressed": c,
|
|
6965
|
+
"aria-description": !c && l === "correct" ? i.standardAnswer : void 0,
|
|
6816
6966
|
className: X["judgement-button"],
|
|
6817
|
-
disabled:
|
|
6818
|
-
onClick: () =>
|
|
6967
|
+
disabled: t,
|
|
6968
|
+
onClick: () => m(r),
|
|
6819
6969
|
type: "button",
|
|
6820
|
-
children:
|
|
6970
|
+
children: [n, c ? /* @__PURE__ */ a(Pl, { status: l }) : null]
|
|
6821
6971
|
})
|
|
6822
|
-
}, String(
|
|
6972
|
+
}, String(r));
|
|
6823
6973
|
})
|
|
6824
|
-
}),
|
|
6825
|
-
groups:
|
|
6826
|
-
title:
|
|
6974
|
+
}), u ? /* @__PURE__ */ a(Y, {
|
|
6975
|
+
groups: p,
|
|
6976
|
+
title: i.standardAnswer
|
|
6827
6977
|
}) : null]
|
|
6828
6978
|
});
|
|
6829
6979
|
}
|
|
6830
6980
|
//#endregion
|
|
6831
6981
|
//#region src/question/renderers/lineConnectAnswers.tsx
|
|
6832
|
-
function
|
|
6833
|
-
let t =
|
|
6982
|
+
function uu(e) {
|
|
6983
|
+
let t = du(e);
|
|
6834
6984
|
return e.columns.reduce((n, r, i) => {
|
|
6835
6985
|
let o = r.items.map((n, o) => {
|
|
6836
6986
|
var s;
|
|
@@ -6846,7 +6996,7 @@ function Xl(e) {
|
|
|
6846
6996
|
return [...n, ...o];
|
|
6847
6997
|
}, []);
|
|
6848
6998
|
}
|
|
6849
|
-
function
|
|
6999
|
+
function du(e) {
|
|
6850
7000
|
return e.columns.reduce((e, t, n) => (t.items.forEach((t) => e.set(t.itemId, {
|
|
6851
7001
|
columnIndex: n,
|
|
6852
7002
|
item: t
|
|
@@ -6854,18 +7004,18 @@ function Zl(e) {
|
|
|
6854
7004
|
}
|
|
6855
7005
|
//#endregion
|
|
6856
7006
|
//#region src/question/player/QuestionLineConnectPlayer.tsx
|
|
6857
|
-
function
|
|
6858
|
-
let [
|
|
6859
|
-
columns:
|
|
6860
|
-
connections:
|
|
6861
|
-
}), [
|
|
6862
|
-
let e =
|
|
6863
|
-
if (!e ||
|
|
6864
|
-
|
|
7007
|
+
function fu({ gradingResult: e, disabled: t, item: n, messages: r, onChange: i, response: s, responseIndex: c, showAnswer: l }) {
|
|
7008
|
+
let [d, g] = h(null), [_, v] = h(null), y = m(null), b = m(/* @__PURE__ */ new Map()), x = cc(s, c), S = { gridTemplateColumns: `repeat(${n.columns.length}, fit-content(16rem))` }, C = p(() => oo(n, x.connections), [n, x.connections]), w = p(() => JSON.stringify({
|
|
7009
|
+
columns: n.columns.map((e) => e.items.map((e) => e.itemId)),
|
|
7010
|
+
connections: x.connections
|
|
7011
|
+
}), [n.columns, x.connections]), T = u(() => {
|
|
7012
|
+
let e = y.current;
|
|
7013
|
+
if (!e || C.length === 0) {
|
|
7014
|
+
v(null);
|
|
6865
7015
|
return;
|
|
6866
7016
|
}
|
|
6867
|
-
let t = e.getBoundingClientRect(), n =
|
|
6868
|
-
let i =
|
|
7017
|
+
let t = e.getBoundingClientRect(), n = C.reduce((n, r) => {
|
|
7018
|
+
let i = b.current.get(r.fromItemId), a = b.current.get(r.toItemId);
|
|
6869
7019
|
if (!i || !a) return n;
|
|
6870
7020
|
let o = i.getBoundingClientRect(), s = a.getBoundingClientRect();
|
|
6871
7021
|
return [...n, {
|
|
@@ -6876,41 +7026,41 @@ function Ql({ disabled: e, item: t, messages: n, onChange: r, response: i, respo
|
|
|
6876
7026
|
y2: co(s, t, e.scrollTop)
|
|
6877
7027
|
}];
|
|
6878
7028
|
}, []);
|
|
6879
|
-
fo(
|
|
7029
|
+
fo(v, {
|
|
6880
7030
|
height: e.scrollHeight,
|
|
6881
7031
|
lines: n,
|
|
6882
7032
|
width: e.scrollWidth
|
|
6883
7033
|
});
|
|
6884
|
-
}, [
|
|
7034
|
+
}, [C]);
|
|
6885
7035
|
f(() => {
|
|
6886
|
-
|
|
6887
|
-
let e =
|
|
7036
|
+
T();
|
|
7037
|
+
let e = y.current;
|
|
6888
7038
|
if (!e) return;
|
|
6889
|
-
if (typeof ResizeObserver > "u") return window.addEventListener("resize",
|
|
6890
|
-
let t = new ResizeObserver(() =>
|
|
6891
|
-
return t.observe(e),
|
|
6892
|
-
}, [
|
|
6893
|
-
function
|
|
7039
|
+
if (typeof ResizeObserver > "u") return window.addEventListener("resize", T), () => window.removeEventListener("resize", T);
|
|
7040
|
+
let t = new ResizeObserver(() => T());
|
|
7041
|
+
return t.observe(e), b.current.forEach((e) => t.observe(e)), () => t.disconnect();
|
|
7042
|
+
}, [w, T]);
|
|
7043
|
+
function E(e) {
|
|
6894
7044
|
return (t) => {
|
|
6895
7045
|
if (t) {
|
|
6896
|
-
|
|
7046
|
+
b.current.set(e, t);
|
|
6897
7047
|
return;
|
|
6898
7048
|
}
|
|
6899
|
-
|
|
7049
|
+
b.current.delete(e);
|
|
6900
7050
|
};
|
|
6901
7051
|
}
|
|
6902
|
-
function
|
|
6903
|
-
if (
|
|
6904
|
-
let
|
|
6905
|
-
columnIndex:
|
|
7052
|
+
function D(e, n) {
|
|
7053
|
+
if (t) return;
|
|
7054
|
+
let r = d ? rt(d, {
|
|
7055
|
+
columnIndex: e,
|
|
6906
7056
|
itemId: n
|
|
6907
7057
|
}) : null;
|
|
6908
|
-
if (
|
|
6909
|
-
|
|
7058
|
+
if (r) {
|
|
7059
|
+
i(j(j({}, x), {}, { connections: _c(x.connections, r.fromItemId, r.toItemId) })), g(null);
|
|
6910
7060
|
return;
|
|
6911
7061
|
}
|
|
6912
|
-
|
|
6913
|
-
columnIndex:
|
|
7062
|
+
g({
|
|
7063
|
+
columnIndex: e,
|
|
6914
7064
|
itemId: n
|
|
6915
7065
|
});
|
|
6916
7066
|
}
|
|
@@ -6919,71 +7069,69 @@ function Ql({ disabled: e, item: t, messages: n, onChange: r, response: i, respo
|
|
|
6919
7069
|
children: [/* @__PURE__ */ o("div", {
|
|
6920
7070
|
className: V.board,
|
|
6921
7071
|
"data-testid": "line-connect-player-board",
|
|
6922
|
-
ref:
|
|
6923
|
-
children: [
|
|
7072
|
+
ref: y,
|
|
7073
|
+
children: [_ ? /* @__PURE__ */ a("svg", {
|
|
6924
7074
|
"aria-hidden": "true",
|
|
6925
7075
|
className: V.lines,
|
|
6926
7076
|
"data-testid": "line-connect-player-lines",
|
|
6927
7077
|
style: {
|
|
6928
|
-
height: `${
|
|
6929
|
-
width: `${
|
|
7078
|
+
height: `${_.height}px`,
|
|
7079
|
+
width: `${_.width}px`
|
|
6930
7080
|
},
|
|
6931
|
-
viewBox: `0 0 ${
|
|
6932
|
-
children:
|
|
6933
|
-
|
|
6934
|
-
|
|
6935
|
-
|
|
6936
|
-
|
|
6937
|
-
|
|
6938
|
-
|
|
7081
|
+
viewBox: `0 0 ${_.width} ${_.height}`,
|
|
7082
|
+
children: _.lines.map((t) => {
|
|
7083
|
+
var n;
|
|
7084
|
+
let r = C.find((e) => e.key === t.key), i = e == null || (n = e.connectionResults.find((e) => e.fromItemId === (r == null ? void 0 : r.fromItemId) && e.toItemId === (r == null ? void 0 : r.toItemId))) == null ? void 0 : n.status;
|
|
7085
|
+
return /* @__PURE__ */ a("line", {
|
|
7086
|
+
className: U(V.line, Xc.line, Qc(i)),
|
|
7087
|
+
"data-grading-status": i,
|
|
7088
|
+
x1: t.x1,
|
|
7089
|
+
x2: t.x2,
|
|
7090
|
+
y1: t.y1,
|
|
7091
|
+
y2: t.y2
|
|
7092
|
+
}, t.key);
|
|
7093
|
+
})
|
|
6939
7094
|
}) : null, /* @__PURE__ */ a("div", {
|
|
6940
|
-
className: V.columns,
|
|
6941
|
-
style:
|
|
6942
|
-
children:
|
|
7095
|
+
className: U(V.columns, V["player-columns"]),
|
|
7096
|
+
style: S,
|
|
7097
|
+
children: n.columns.map((n, r) => /* @__PURE__ */ a("section", {
|
|
6943
7098
|
className: V.column,
|
|
6944
|
-
children:
|
|
6945
|
-
|
|
6946
|
-
children: [
|
|
6947
|
-
n.tableColumn,
|
|
6948
|
-
" ",
|
|
6949
|
-
r + 1
|
|
6950
|
-
]
|
|
6951
|
-
}), t.items.map((n, i) => {
|
|
6952
|
-
let s = dn(t.labelStyle, i), c = (l == null ? void 0 : l.itemId) === n.itemId;
|
|
7099
|
+
children: n.items.map((i, s) => {
|
|
7100
|
+
let c = dn(n.labelStyle, s), l = !e && (d == null ? void 0 : d.itemId) === i.itemId;
|
|
6953
7101
|
return /* @__PURE__ */ a("div", {
|
|
6954
|
-
className: U(V.item,
|
|
6955
|
-
"data-selected":
|
|
6956
|
-
"data-testid": `line-connect-player-item-${
|
|
6957
|
-
ref:
|
|
7102
|
+
className: U(V.item, l && V.selected),
|
|
7103
|
+
"data-selected": l ? "true" : void 0,
|
|
7104
|
+
"data-testid": `line-connect-player-item-${i.itemId}`,
|
|
7105
|
+
ref: E(i.itemId),
|
|
6958
7106
|
children: /* @__PURE__ */ o("button", {
|
|
6959
|
-
"aria-pressed":
|
|
7107
|
+
"aria-pressed": l,
|
|
6960
7108
|
className: V.button,
|
|
6961
|
-
disabled:
|
|
6962
|
-
onClick: () =>
|
|
7109
|
+
disabled: t,
|
|
7110
|
+
onClick: () => D(r, i.itemId),
|
|
6963
7111
|
type: "button",
|
|
6964
|
-
children: [
|
|
7112
|
+
children: [c ? /* @__PURE__ */ a("span", {
|
|
6965
7113
|
className: V.marker,
|
|
6966
|
-
children:
|
|
6967
|
-
}) : null, /* @__PURE__ */ a(J, { content:
|
|
7114
|
+
children: c
|
|
7115
|
+
}) : null, /* @__PURE__ */ a(J, { content: i.content })]
|
|
6968
7116
|
})
|
|
6969
|
-
},
|
|
6970
|
-
})
|
|
6971
|
-
},
|
|
7117
|
+
}, i.itemId);
|
|
7118
|
+
})
|
|
7119
|
+
}, n.columnId))
|
|
6972
7120
|
})]
|
|
6973
|
-
}),
|
|
6974
|
-
groups:
|
|
6975
|
-
title:
|
|
7121
|
+
}), l ? /* @__PURE__ */ a(Y, {
|
|
7122
|
+
groups: uu(n),
|
|
7123
|
+
title: r.standardAnswer
|
|
6976
7124
|
}) : null]
|
|
6977
7125
|
});
|
|
6978
7126
|
}
|
|
6979
|
-
var
|
|
7127
|
+
var pu = {
|
|
6980
7128
|
path: "_path_11o60_1",
|
|
6981
7129
|
endpoint: "_endpoint_11o60_7",
|
|
6982
7130
|
separator: "_separator_11o60_8"
|
|
6983
7131
|
};
|
|
6984
7132
|
//#endregion
|
|
6985
7133
|
//#region src/question/renderers/matchingAnswers.tsx
|
|
6986
|
-
function
|
|
7134
|
+
function mu(e) {
|
|
6987
7135
|
var t, n;
|
|
6988
7136
|
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);
|
|
6989
7137
|
return ((n = r == null ? void 0 : r.items) == null ? [] : n).map((t, n) => {
|
|
@@ -6998,7 +7146,7 @@ function eu(e) {
|
|
|
6998
7146
|
};
|
|
6999
7147
|
});
|
|
7000
7148
|
}
|
|
7001
|
-
function
|
|
7149
|
+
function hu(e) {
|
|
7002
7150
|
var t, n;
|
|
7003
7151
|
let r = e.columns[0], i = e.columns[1], s = new Map((t = i == null ? void 0 : i.items.map((e, t) => [e.itemId, {
|
|
7004
7152
|
item: e,
|
|
@@ -7009,19 +7157,19 @@ function tu(e) {
|
|
|
7009
7157
|
let u = (c = e.answers[t.itemId]) == null ? void 0 : c[0], d = u ? s.get(u) : void 0;
|
|
7010
7158
|
return {
|
|
7011
7159
|
contents: d && i ? [/* @__PURE__ */ o("div", {
|
|
7012
|
-
className:
|
|
7160
|
+
className: pu.path,
|
|
7013
7161
|
children: [
|
|
7014
7162
|
/* @__PURE__ */ a("span", {
|
|
7015
|
-
className:
|
|
7016
|
-
children:
|
|
7163
|
+
className: pu.endpoint,
|
|
7164
|
+
children: gu(r, t, n)
|
|
7017
7165
|
}),
|
|
7018
7166
|
/* @__PURE__ */ a("span", {
|
|
7019
|
-
className:
|
|
7167
|
+
className: pu.separator,
|
|
7020
7168
|
children: "-"
|
|
7021
7169
|
}),
|
|
7022
7170
|
/* @__PURE__ */ a("span", {
|
|
7023
|
-
className:
|
|
7024
|
-
children:
|
|
7171
|
+
className: pu.endpoint,
|
|
7172
|
+
children: gu(i, d.item, d.itemIndex)
|
|
7025
7173
|
})
|
|
7026
7174
|
]
|
|
7027
7175
|
}, `${t.itemId}-${d.item.itemId}`)] : [],
|
|
@@ -7030,82 +7178,92 @@ function tu(e) {
|
|
|
7030
7178
|
};
|
|
7031
7179
|
});
|
|
7032
7180
|
}
|
|
7033
|
-
function
|
|
7181
|
+
function gu(e, t, n) {
|
|
7034
7182
|
return fn(e.labelStyle, n) || /* @__PURE__ */ a(J, { content: t.content });
|
|
7035
7183
|
}
|
|
7036
|
-
var
|
|
7037
|
-
board: "
|
|
7038
|
-
"matched-rows": "_matched-
|
|
7039
|
-
"matched-row": "_matched-
|
|
7040
|
-
columns: "
|
|
7041
|
-
column: "
|
|
7042
|
-
item: "
|
|
7043
|
-
|
|
7044
|
-
|
|
7045
|
-
|
|
7184
|
+
var _u = {
|
|
7185
|
+
board: "_board_1j0zm_1",
|
|
7186
|
+
"matched-rows": "_matched-rows_1j0zm_6",
|
|
7187
|
+
"matched-row": "_matched-row_1j0zm_6",
|
|
7188
|
+
columns: "_columns_1j0zm_24",
|
|
7189
|
+
column: "_column_1j0zm_24",
|
|
7190
|
+
item: "_item_1j0zm_36",
|
|
7191
|
+
"unanswered-item": "_unanswered-item_1j0zm_59",
|
|
7192
|
+
selected: "_selected_1j0zm_70",
|
|
7193
|
+
matched: "_matched_1j0zm_6",
|
|
7194
|
+
marker: "_marker_1j0zm_79"
|
|
7046
7195
|
};
|
|
7047
7196
|
//#endregion
|
|
7048
7197
|
//#region src/question/player/QuestionMatchingPlayer.tsx
|
|
7049
|
-
function
|
|
7050
|
-
let [
|
|
7051
|
-
function
|
|
7052
|
-
if (
|
|
7053
|
-
let
|
|
7054
|
-
columnIndex:
|
|
7198
|
+
function vu({ gradingResult: e, disabled: t, item: n, messages: r, onChange: i, response: s, responseIndex: c, showAnswer: l }) {
|
|
7199
|
+
let [u, d] = h(null), f = lc(s, c), p = yu(n, f.connections);
|
|
7200
|
+
function m(e, n) {
|
|
7201
|
+
if (t) return;
|
|
7202
|
+
let r = u ? ht(u, {
|
|
7203
|
+
columnIndex: e,
|
|
7055
7204
|
itemId: n
|
|
7056
7205
|
}) : null;
|
|
7057
|
-
if (
|
|
7058
|
-
|
|
7206
|
+
if (r) {
|
|
7207
|
+
i(j(j({}, f), {}, { connections: vc(f.connections, r.fromItemId, r.toItemId) })), d(null);
|
|
7059
7208
|
return;
|
|
7060
7209
|
}
|
|
7061
|
-
|
|
7062
|
-
columnIndex:
|
|
7210
|
+
d((u == null ? void 0 : u.itemId) === n ? null : {
|
|
7211
|
+
columnIndex: e,
|
|
7063
7212
|
itemId: n
|
|
7064
7213
|
});
|
|
7065
7214
|
}
|
|
7066
|
-
|
|
7067
|
-
|
|
7215
|
+
let g = new Map(e == null ? void 0 : e.itemResults.map((e) => [e.itemId, e.status]));
|
|
7216
|
+
function _(e, n) {
|
|
7217
|
+
let r = (u == null ? void 0 : u.itemId) === e.item.itemId, i = g.get(e.item.itemId);
|
|
7068
7218
|
return /* @__PURE__ */ o("button", {
|
|
7069
7219
|
"aria-pressed": r,
|
|
7070
|
-
className: U(
|
|
7071
|
-
"data-testid": `matching-player-item-${
|
|
7072
|
-
disabled:
|
|
7073
|
-
onClick: () =>
|
|
7220
|
+
className: U(_u.item, r && _u.selected, n && _u.matched, !n && Qc(i), !n && i === "unanswered" && _u["unanswered-item"]),
|
|
7221
|
+
"data-testid": `matching-player-item-${e.item.itemId}`,
|
|
7222
|
+
disabled: t,
|
|
7223
|
+
onClick: () => m(e.columnIndex, e.item.itemId),
|
|
7074
7224
|
type: "button",
|
|
7075
|
-
children: [
|
|
7076
|
-
className:
|
|
7077
|
-
children:
|
|
7078
|
-
}) : null, /* @__PURE__ */ a(J, { content:
|
|
7079
|
-
},
|
|
7225
|
+
children: [e.marker ? /* @__PURE__ */ a("span", {
|
|
7226
|
+
className: _u.marker,
|
|
7227
|
+
children: e.marker
|
|
7228
|
+
}) : null, /* @__PURE__ */ a(J, { content: e.item.content })]
|
|
7229
|
+
}, e.item.itemId);
|
|
7080
7230
|
}
|
|
7081
7231
|
return /* @__PURE__ */ o("div", {
|
|
7082
7232
|
className: G.element,
|
|
7083
7233
|
children: [/* @__PURE__ */ o("div", {
|
|
7084
|
-
className:
|
|
7085
|
-
children: [
|
|
7086
|
-
className:
|
|
7087
|
-
children:
|
|
7088
|
-
|
|
7089
|
-
|
|
7090
|
-
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
|
|
7094
|
-
|
|
7234
|
+
className: _u.board,
|
|
7235
|
+
children: [p.rows.length > 0 ? /* @__PURE__ */ a("div", {
|
|
7236
|
+
className: _u["matched-rows"],
|
|
7237
|
+
children: p.rows.map((t) => {
|
|
7238
|
+
var n;
|
|
7239
|
+
let r = e == null || (n = e.connectionResults.find((e) => e.fromItemId === t.from.item.itemId && e.toItemId === t.to.item.itemId)) == null ? void 0 : n.status;
|
|
7240
|
+
return /* @__PURE__ */ o("div", {
|
|
7241
|
+
className: U(_u["matched-row"], Qc(r)),
|
|
7242
|
+
"data-testid": `matching-player-row-${t.from.item.itemId}-${t.to.item.itemId}`,
|
|
7243
|
+
children: [
|
|
7244
|
+
_(t.from, !0),
|
|
7245
|
+
_(t.to, !0),
|
|
7246
|
+
/* @__PURE__ */ a(Pl, { status: r })
|
|
7247
|
+
]
|
|
7248
|
+
}, `${t.from.item.itemId}-${t.to.item.itemId}`);
|
|
7249
|
+
})
|
|
7250
|
+
}) : null, p.unmatchedColumns.some((e) => e.length > 0) ? /* @__PURE__ */ a("div", {
|
|
7251
|
+
className: _u.columns,
|
|
7252
|
+
children: p.unmatchedColumns.map((e, t) => {
|
|
7095
7253
|
var r, i;
|
|
7096
7254
|
return /* @__PURE__ */ a("section", {
|
|
7097
|
-
className:
|
|
7098
|
-
children: e.map((e) =>
|
|
7099
|
-
}, (r = (i =
|
|
7255
|
+
className: _u.column,
|
|
7256
|
+
children: e.map((e) => _(e, !1))
|
|
7257
|
+
}, (r = (i = n.columns[t]) == null ? void 0 : i.columnId) == null ? t : r);
|
|
7100
7258
|
})
|
|
7101
7259
|
}) : null]
|
|
7102
|
-
}),
|
|
7103
|
-
groups:
|
|
7104
|
-
title:
|
|
7260
|
+
}), l ? /* @__PURE__ */ a(Y, {
|
|
7261
|
+
groups: mu(n),
|
|
7262
|
+
title: r.standardAnswer
|
|
7105
7263
|
}) : null]
|
|
7106
7264
|
});
|
|
7107
7265
|
}
|
|
7108
|
-
function
|
|
7266
|
+
function yu(e, t) {
|
|
7109
7267
|
var n;
|
|
7110
7268
|
let r = e.columns.map((e, t) => e.items.map((n, r) => ({
|
|
7111
7269
|
columnIndex: t,
|
|
@@ -7126,7 +7284,7 @@ function au(e, t) {
|
|
|
7126
7284
|
}
|
|
7127
7285
|
//#endregion
|
|
7128
7286
|
//#region src/question/renderers/optionGroupAnswers.tsx
|
|
7129
|
-
function
|
|
7287
|
+
function bu(e, t) {
|
|
7130
7288
|
return _n(t, e.config.optionLabelStyle).map((e) => ({
|
|
7131
7289
|
kind: "markerOnly",
|
|
7132
7290
|
marker: e.marker
|
|
@@ -7134,22 +7292,22 @@ function ou(e, t) {
|
|
|
7134
7292
|
}
|
|
7135
7293
|
//#endregion
|
|
7136
7294
|
//#region src/question/renderers/question-option-grid.ts
|
|
7137
|
-
function
|
|
7295
|
+
function xu({ availableWidth: e, columnGap: t, optionCount: n, widestOptionWidth: r }) {
|
|
7138
7296
|
let i = Math.max(1, Math.trunc(n));
|
|
7139
7297
|
if (e <= 0 || r <= 0) return 1;
|
|
7140
7298
|
for (let n = i; n >= 2; --n) if (i % n === 0 && (e - Math.max(0, t) * (n - 1)) / n >= r) return n;
|
|
7141
7299
|
return 1;
|
|
7142
7300
|
}
|
|
7143
|
-
var
|
|
7301
|
+
var Su = { list: "_list_1xo1n_1" }, Cu = {
|
|
7144
7302
|
table: "_table_p4zkf_1",
|
|
7145
7303
|
cell: "_cell_p4zkf_7"
|
|
7146
7304
|
};
|
|
7147
7305
|
//#endregion
|
|
7148
7306
|
//#region src/question/renderers/QuestionColumnLayout.tsx
|
|
7149
|
-
function
|
|
7307
|
+
function wu({ children: e, className: t, columnCount: n, dataAttributes: r, layoutRef: i, role: c, style: l }) {
|
|
7150
7308
|
let { columnLayout: u, systemListMarkup: d } = W(), f = Math.max(1, Math.floor(n));
|
|
7151
7309
|
if (u === "document-table") {
|
|
7152
|
-
let n =
|
|
7310
|
+
let n = Tu(s.toArray(e), f), l = `${100 / f}%`, u = t ? `${Cu.table} ${t}` : Cu.table;
|
|
7153
7311
|
return /* @__PURE__ */ o("table", j(j({}, r), {}, {
|
|
7154
7312
|
className: u,
|
|
7155
7313
|
"data-column-count": f,
|
|
@@ -7160,7 +7318,7 @@ function uu({ children: e, className: t, columnCount: n, dataAttributes: r, layo
|
|
|
7160
7318
|
let r = e.slice(n, n + 1)[0];
|
|
7161
7319
|
return /* @__PURE__ */ a("td", {
|
|
7162
7320
|
"aria-hidden": r ? void 0 : "true",
|
|
7163
|
-
className:
|
|
7321
|
+
className: Cu.cell,
|
|
7164
7322
|
children: r == null ? null : r
|
|
7165
7323
|
}, `cell-${n}`);
|
|
7166
7324
|
}) }, `row-${t}`)) })]
|
|
@@ -7181,18 +7339,18 @@ function uu({ children: e, className: t, columnCount: n, dataAttributes: r, layo
|
|
|
7181
7339
|
children: e
|
|
7182
7340
|
}));
|
|
7183
7341
|
}
|
|
7184
|
-
function
|
|
7342
|
+
function Tu(e, t) {
|
|
7185
7343
|
return Array.from({ length: Math.ceil(e.length / t) }, (n, r) => e.slice(r * t, (r + 1) * t));
|
|
7186
7344
|
}
|
|
7187
7345
|
//#endregion
|
|
7188
7346
|
//#region src/question/renderers/QuestionAdaptiveOptionList.tsx
|
|
7189
|
-
function
|
|
7347
|
+
function Eu({ children: e }) {
|
|
7190
7348
|
let { renderer: t } = K(), n = m(null), [r, i] = h(1), o = { gridTemplateColumns: `repeat(${r}, minmax(0, 1fr))` };
|
|
7191
7349
|
return f(() => {
|
|
7192
7350
|
if (!n.current) return;
|
|
7193
7351
|
let t = n.current, r = null;
|
|
7194
7352
|
function a() {
|
|
7195
|
-
let n = t.getBoundingClientRect().width, r = Number.parseFloat(getComputedStyle(t).columnGap) || 0, a =
|
|
7353
|
+
let n = t.getBoundingClientRect().width, r = Number.parseFloat(getComputedStyle(t).columnGap) || 0, a = Du(t), o = xu({
|
|
7196
7354
|
availableWidth: n,
|
|
7197
7355
|
columnGap: r,
|
|
7198
7356
|
optionCount: s.count(e),
|
|
@@ -7210,8 +7368,8 @@ function fu({ children: e }) {
|
|
|
7210
7368
|
return c.observe(t), () => {
|
|
7211
7369
|
r !== null && cancelAnimationFrame(r), t.removeEventListener("load", o, !0), c.disconnect();
|
|
7212
7370
|
};
|
|
7213
|
-
}), /* @__PURE__ */ a(
|
|
7214
|
-
className: `${t["option-list"]} ${
|
|
7371
|
+
}), /* @__PURE__ */ a(wu, {
|
|
7372
|
+
className: `${t["option-list"]} ${Su.list}`,
|
|
7215
7373
|
columnCount: r,
|
|
7216
7374
|
dataAttributes: { "data-question-option-grid": "true" },
|
|
7217
7375
|
layoutRef: (e) => {
|
|
@@ -7222,8 +7380,8 @@ function fu({ children: e }) {
|
|
|
7222
7380
|
children: e
|
|
7223
7381
|
});
|
|
7224
7382
|
}
|
|
7225
|
-
function
|
|
7226
|
-
let t = e.parentElement, n =
|
|
7383
|
+
function Du(e) {
|
|
7384
|
+
let t = e.parentElement, n = Ou(e);
|
|
7227
7385
|
if (!t || n.length === 0) return 0;
|
|
7228
7386
|
let r = e.ownerDocument.createElement("div");
|
|
7229
7387
|
r.className = e.className, r.setAttribute("aria-hidden", "true"), r.setAttribute("data-question-option-measurement", "true"), Object.assign(r.style, {
|
|
@@ -7241,91 +7399,120 @@ function pu(e) {
|
|
|
7241
7399
|
let i = r.getBoundingClientRect().width;
|
|
7242
7400
|
return r.remove(), i;
|
|
7243
7401
|
}
|
|
7244
|
-
function
|
|
7402
|
+
function Ou(e) {
|
|
7245
7403
|
return e instanceof HTMLTableElement ? Array.from(e.rows).reduce((e, t) => [...e, ...Array.from(t.cells).reduce((e, t) => t.firstElementChild ? [...e, t.firstElementChild] : e, [])], []) : Array.from(e.children);
|
|
7246
7404
|
}
|
|
7247
7405
|
//#endregion
|
|
7248
7406
|
//#region src/question/player/QuestionOptionGroupPlayer.tsx
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
|
|
7252
|
-
|
|
7407
|
+
var ku = [
|
|
7408
|
+
"selected",
|
|
7409
|
+
"status",
|
|
7410
|
+
"missed",
|
|
7411
|
+
"description"
|
|
7412
|
+
], Au = [
|
|
7413
|
+
"selected",
|
|
7414
|
+
"status",
|
|
7415
|
+
"missed",
|
|
7416
|
+
"description"
|
|
7417
|
+
];
|
|
7418
|
+
function ju({ gradingResult: e, disabled: t, element: n, item: r, messages: i, onChange: s, response: c, responseIndex: l, showAnswer: u }) {
|
|
7419
|
+
let d = nc(c, l), f = gn(r, n.config.optionLabelStyle).map((t) => {
|
|
7420
|
+
var r;
|
|
7421
|
+
let a = d.selectedOptionIds.includes(t.optionId), o = e == null || (r = e.optionResults.find((e) => e.optionId === t.optionId)) == null ? void 0 : r.status;
|
|
7422
|
+
return j(j({}, t), {}, {
|
|
7423
|
+
selected: a,
|
|
7424
|
+
status: o,
|
|
7425
|
+
missed: n.config.selectionType === "multiple" && !a && o === "correct",
|
|
7426
|
+
description: !a && o === "correct" ? i.standardAnswer : void 0
|
|
7427
|
+
});
|
|
7428
|
+
});
|
|
7429
|
+
function p(e) {
|
|
7430
|
+
s(j(j({}, d), {}, { selectedOptionIds: hc(d.selectedOptionIds, e, n.config.selectionType) }));
|
|
7253
7431
|
}
|
|
7254
|
-
if (
|
|
7255
|
-
let
|
|
7432
|
+
if (n.config.renderer === "table") {
|
|
7433
|
+
let s = bu(n, r);
|
|
7256
7434
|
return /* @__PURE__ */ o("div", {
|
|
7257
7435
|
className: G.element,
|
|
7258
7436
|
children: [/* @__PURE__ */ a("div", {
|
|
7259
|
-
className:
|
|
7437
|
+
className: Ol["table-wrap"],
|
|
7260
7438
|
children: /* @__PURE__ */ o("table", {
|
|
7261
|
-
className:
|
|
7439
|
+
className: Ol.table,
|
|
7262
7440
|
children: [
|
|
7263
|
-
/* @__PURE__ */ o("colgroup", { children: [/* @__PURE__ */ a("col", { className:
|
|
7264
|
-
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ o("tr", { children: [/* @__PURE__ */ a("th", { children:
|
|
7265
|
-
/* @__PURE__ */ a("tbody", { children:
|
|
7266
|
-
let n =
|
|
7441
|
+
/* @__PURE__ */ o("colgroup", { children: [/* @__PURE__ */ a("col", { className: Ol["table-option-column"] }), r.columns.map((e) => /* @__PURE__ */ a("col", {}, e.id))] }),
|
|
7442
|
+
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ o("tr", { children: [/* @__PURE__ */ a("th", { children: i.option }), r.columns.map((e) => /* @__PURE__ */ a("th", { children: /* @__PURE__ */ a(J, { content: e.content }) }, e.id))] }) }),
|
|
7443
|
+
/* @__PURE__ */ a("tbody", { children: f.map((n) => {
|
|
7444
|
+
let { selected: r, status: i, missed: s, description: c } = n, l = Oa(n, ku);
|
|
7267
7445
|
return /* @__PURE__ */ o("tr", {
|
|
7268
|
-
className: X["table-choice-row"],
|
|
7269
|
-
"data-
|
|
7270
|
-
|
|
7446
|
+
className: U(X["table-choice-row"], Qc(i), s && X["missed-answer"]),
|
|
7447
|
+
"data-graded": !!e,
|
|
7448
|
+
"data-selected": r ? "true" : void 0,
|
|
7449
|
+
children: [/* @__PURE__ */ a("td", { children: /* @__PURE__ */ o("button", {
|
|
7271
7450
|
className: X["table-row-button"],
|
|
7272
|
-
disabled:
|
|
7273
|
-
"aria-pressed":
|
|
7274
|
-
|
|
7451
|
+
disabled: t,
|
|
7452
|
+
"aria-pressed": r,
|
|
7453
|
+
"aria-description": c,
|
|
7454
|
+
onClick: () => p(l.optionId),
|
|
7275
7455
|
type: "button",
|
|
7276
|
-
children: /* @__PURE__ */ a("span", {
|
|
7456
|
+
children: [/* @__PURE__ */ a("span", {
|
|
7277
7457
|
className: U(G.marker, X["table-option-marker"]),
|
|
7278
|
-
"data-selected":
|
|
7279
|
-
children:
|
|
7280
|
-
})
|
|
7281
|
-
}) }),
|
|
7458
|
+
"data-selected": r ? "true" : void 0,
|
|
7459
|
+
children: l.marker
|
|
7460
|
+
}), r ? /* @__PURE__ */ a(Pl, { status: i }) : null]
|
|
7461
|
+
}) }), l.cells.map((e, n) => /* @__PURE__ */ a("td", { children: /* @__PURE__ */ a("button", {
|
|
7282
7462
|
className: X["table-row-button"],
|
|
7283
|
-
disabled:
|
|
7284
|
-
"aria-pressed":
|
|
7285
|
-
|
|
7463
|
+
disabled: t,
|
|
7464
|
+
"aria-pressed": r,
|
|
7465
|
+
"aria-description": c,
|
|
7466
|
+
onClick: () => p(l.optionId),
|
|
7286
7467
|
type: "button",
|
|
7287
|
-
children: /* @__PURE__ */ a(J, { content:
|
|
7288
|
-
}) }, `${
|
|
7289
|
-
},
|
|
7468
|
+
children: /* @__PURE__ */ a(J, { content: e })
|
|
7469
|
+
}) }, `${l.optionId}-cell-${n}`))]
|
|
7470
|
+
}, l.optionId);
|
|
7290
7471
|
}) })
|
|
7291
7472
|
]
|
|
7292
7473
|
})
|
|
7293
|
-
}),
|
|
7294
|
-
groups:
|
|
7295
|
-
title:
|
|
7474
|
+
}), u ? /* @__PURE__ */ a(Y, {
|
|
7475
|
+
groups: s,
|
|
7476
|
+
title: i.standardAnswer
|
|
7296
7477
|
}) : null]
|
|
7297
7478
|
});
|
|
7298
7479
|
}
|
|
7299
|
-
let
|
|
7480
|
+
let m = bu(n, r);
|
|
7300
7481
|
return /* @__PURE__ */ o("div", {
|
|
7301
7482
|
className: G.element,
|
|
7302
|
-
children: [/* @__PURE__ */ a(
|
|
7303
|
-
let n =
|
|
7483
|
+
children: [/* @__PURE__ */ a(Eu, { children: f.map((n) => {
|
|
7484
|
+
let { selected: r, status: i, missed: s, description: c } = n, l = Oa(n, Au);
|
|
7304
7485
|
return /* @__PURE__ */ a("li", {
|
|
7305
|
-
className: U(G["option-item"], X["choice-option"],
|
|
7306
|
-
"data-
|
|
7486
|
+
className: U(G["option-item"], X["choice-option"], Qc(i), s && X["missed-answer"]),
|
|
7487
|
+
"data-graded": !!e,
|
|
7488
|
+
"data-selected": r ? "true" : void 0,
|
|
7307
7489
|
children: /* @__PURE__ */ o("button", {
|
|
7308
7490
|
className: X["choice-button"],
|
|
7309
|
-
disabled:
|
|
7310
|
-
"aria-pressed":
|
|
7311
|
-
|
|
7491
|
+
disabled: t,
|
|
7492
|
+
"aria-pressed": r,
|
|
7493
|
+
"aria-description": c,
|
|
7494
|
+
onClick: () => p(l.optionId),
|
|
7312
7495
|
type: "button",
|
|
7313
|
-
children: [
|
|
7314
|
-
|
|
7315
|
-
|
|
7316
|
-
|
|
7317
|
-
|
|
7496
|
+
children: [
|
|
7497
|
+
/* @__PURE__ */ a("span", {
|
|
7498
|
+
className: U(G.marker, X["option-marker"]),
|
|
7499
|
+
"data-selected": r ? "true" : void 0,
|
|
7500
|
+
children: l.marker
|
|
7501
|
+
}),
|
|
7502
|
+
/* @__PURE__ */ a(J, { content: l.standardContent }),
|
|
7503
|
+
r ? /* @__PURE__ */ a(Pl, { status: i }) : null
|
|
7504
|
+
]
|
|
7318
7505
|
})
|
|
7319
|
-
},
|
|
7320
|
-
}) }),
|
|
7321
|
-
groups:
|
|
7322
|
-
title:
|
|
7506
|
+
}, l.optionId);
|
|
7507
|
+
}) }), u ? /* @__PURE__ */ a(Y, {
|
|
7508
|
+
groups: m,
|
|
7509
|
+
title: i.standardAnswer
|
|
7323
7510
|
}) : null]
|
|
7324
7511
|
});
|
|
7325
7512
|
}
|
|
7326
7513
|
//#endregion
|
|
7327
7514
|
//#region src/question/renderers/orderingAnswerGroups.tsx
|
|
7328
|
-
function
|
|
7515
|
+
function Mu(e) {
|
|
7329
7516
|
let t = Vr(e.sortOptions);
|
|
7330
7517
|
return e.answers.map((e) => {
|
|
7331
7518
|
let n = t.get(e);
|
|
@@ -7338,96 +7525,101 @@ function gu(e) {
|
|
|
7338
7525
|
}
|
|
7339
7526
|
//#endregion
|
|
7340
7527
|
//#region src/question/player/QuestionOrderingPlayer.tsx
|
|
7341
|
-
function
|
|
7342
|
-
let
|
|
7343
|
-
function
|
|
7344
|
-
|
|
7528
|
+
function Nu({ gradingResult: e, disabled: t, item: n, messages: r, onChange: i, response: s, responseIndex: c, showAnswer: l }) {
|
|
7529
|
+
let u = uc(s, c, n), d = Vr(n.sortOptions), f = u.orderedOptionIds.map((e) => d.get(e)).filter((e) => !!e);
|
|
7530
|
+
function p(e, t) {
|
|
7531
|
+
i(j(j({}, u), {}, { orderedOptionIds: bc(u.orderedOptionIds, n, e, t) }));
|
|
7345
7532
|
}
|
|
7346
7533
|
return /* @__PURE__ */ o("div", {
|
|
7347
7534
|
className: G.element,
|
|
7348
7535
|
children: [/* @__PURE__ */ a("ol", {
|
|
7349
7536
|
className: G["option-list"],
|
|
7350
|
-
children:
|
|
7351
|
-
|
|
7352
|
-
|
|
7353
|
-
|
|
7354
|
-
|
|
7355
|
-
|
|
7356
|
-
|
|
7357
|
-
|
|
7358
|
-
|
|
7359
|
-
|
|
7360
|
-
|
|
7361
|
-
|
|
7362
|
-
|
|
7363
|
-
|
|
7364
|
-
|
|
7365
|
-
|
|
7366
|
-
|
|
7367
|
-
|
|
7368
|
-
|
|
7369
|
-
|
|
7370
|
-
|
|
7371
|
-
|
|
7372
|
-
|
|
7373
|
-
|
|
7374
|
-
|
|
7375
|
-
|
|
7376
|
-
|
|
7377
|
-
|
|
7378
|
-
|
|
7379
|
-
|
|
7380
|
-
|
|
7537
|
+
children: f.map(({ number: n, option: i }, s) => {
|
|
7538
|
+
var c;
|
|
7539
|
+
let l = e == null || (c = e.optionResults.find((e) => e.optionId === i.id)) == null ? void 0 : c.status;
|
|
7540
|
+
return /* @__PURE__ */ o("li", {
|
|
7541
|
+
className: U(G["option-item"], X["choice-option"], Qc(l)),
|
|
7542
|
+
children: [
|
|
7543
|
+
/* @__PURE__ */ a("span", {
|
|
7544
|
+
className: G.marker,
|
|
7545
|
+
children: n
|
|
7546
|
+
}),
|
|
7547
|
+
/* @__PURE__ */ a(J, { content: i.content }),
|
|
7548
|
+
/* @__PURE__ */ a(Pl, { status: l }),
|
|
7549
|
+
/* @__PURE__ */ o("span", {
|
|
7550
|
+
className: X["ordering-controls"],
|
|
7551
|
+
children: [/* @__PURE__ */ a("button", {
|
|
7552
|
+
"aria-label": `${r.moveUp} ${n}`,
|
|
7553
|
+
className: X["ordering-button"],
|
|
7554
|
+
disabled: t || s === 0,
|
|
7555
|
+
onClick: () => p(i.id, -1),
|
|
7556
|
+
type: "button",
|
|
7557
|
+
children: "\u2191"
|
|
7558
|
+
}), /* @__PURE__ */ a("button", {
|
|
7559
|
+
"aria-label": `${r.moveDown} ${n}`,
|
|
7560
|
+
className: X["ordering-button"],
|
|
7561
|
+
disabled: t || s === f.length - 1,
|
|
7562
|
+
onClick: () => p(i.id, 1),
|
|
7563
|
+
type: "button",
|
|
7564
|
+
children: "\u2193"
|
|
7565
|
+
})]
|
|
7566
|
+
})
|
|
7567
|
+
]
|
|
7568
|
+
}, i.id);
|
|
7569
|
+
})
|
|
7570
|
+
}), l ? /* @__PURE__ */ a(Y, {
|
|
7571
|
+
groups: Mu(n),
|
|
7572
|
+
title: r.standardAnswer
|
|
7381
7573
|
}) : null]
|
|
7382
7574
|
});
|
|
7383
7575
|
}
|
|
7384
7576
|
//#endregion
|
|
7385
7577
|
//#region src/question/renderers/QuestionTextMarkerContent.tsx
|
|
7386
|
-
function
|
|
7387
|
-
let { textMarker:
|
|
7388
|
-
children: [{ text:
|
|
7578
|
+
function Pu({ renderMarker: e, answerMarkers: t = [], content: n, disabled: r = !1, onMarkerClick: i, selectedMarkers: o = [], showAnswer: s = !1 }) {
|
|
7579
|
+
let { textMarker: l } = K(), u = n.json.length ? n.json : [{
|
|
7580
|
+
children: [{ text: n.text }],
|
|
7389
7581
|
type: "paragraph"
|
|
7390
7582
|
}];
|
|
7391
7583
|
return /* @__PURE__ */ a("div", {
|
|
7392
|
-
className:
|
|
7393
|
-
children:
|
|
7584
|
+
className: l.content,
|
|
7585
|
+
children: u.map((e, t) => d(e, `node-${t}`))
|
|
7394
7586
|
});
|
|
7395
|
-
function
|
|
7396
|
-
if (
|
|
7397
|
-
if (!
|
|
7398
|
-
let n = e.children.map((e, n) =>
|
|
7587
|
+
function d(e, t) {
|
|
7588
|
+
if (Iu(e)) return f(e, t);
|
|
7589
|
+
if (!Fu(e)) return null;
|
|
7590
|
+
let n = e.children.map((e, n) => d(e, `${t}-${n}`));
|
|
7399
7591
|
return e.type === "paragraph" ? /* @__PURE__ */ a("p", {
|
|
7400
|
-
className:
|
|
7592
|
+
className: l.paragraph,
|
|
7401
7593
|
children: n
|
|
7402
7594
|
}, t) : /* @__PURE__ */ a("span", { children: n }, t);
|
|
7403
7595
|
}
|
|
7404
|
-
function
|
|
7405
|
-
let
|
|
7406
|
-
if (!
|
|
7407
|
-
let
|
|
7408
|
-
return
|
|
7596
|
+
function f(t, n) {
|
|
7597
|
+
let r = Ot(t);
|
|
7598
|
+
if (!r) return /* @__PURE__ */ a(c, { children: t.text }, n);
|
|
7599
|
+
let o = p(r), s = i ? m(r, t.text, n, o) : h(r, t.text, n, o);
|
|
7600
|
+
return e ? /* @__PURE__ */ a(c, { children: e(r, s) }, n) : s;
|
|
7409
7601
|
}
|
|
7410
|
-
function
|
|
7411
|
-
let n =
|
|
7602
|
+
function p(e) {
|
|
7603
|
+
let n = o.includes(e), r = s && t.includes(e);
|
|
7412
7604
|
return {
|
|
7413
|
-
answer:
|
|
7414
|
-
className: ro(
|
|
7605
|
+
answer: r,
|
|
7606
|
+
className: ro(l.marker, i ? l["marker-button"] : "", n ? l["marker-selected"] : "", r ? l["marker-answer"] : ""),
|
|
7415
7607
|
selected: n
|
|
7416
7608
|
};
|
|
7417
7609
|
}
|
|
7418
|
-
function
|
|
7610
|
+
function m(e, t, n, o) {
|
|
7419
7611
|
return /* @__PURE__ */ a("button", {
|
|
7420
7612
|
className: o.className,
|
|
7421
7613
|
"data-answer": o.answer ? "true" : void 0,
|
|
7422
7614
|
"data-marker-id": e,
|
|
7423
7615
|
"data-selected": o.selected ? "true" : void 0,
|
|
7424
|
-
disabled:
|
|
7425
|
-
onClick: () =>
|
|
7616
|
+
disabled: r,
|
|
7617
|
+
onClick: () => i == null ? void 0 : i(e),
|
|
7426
7618
|
type: "button",
|
|
7427
7619
|
children: t
|
|
7428
|
-
},
|
|
7620
|
+
}, n);
|
|
7429
7621
|
}
|
|
7430
|
-
function
|
|
7622
|
+
function h(e, t, n, r) {
|
|
7431
7623
|
return /* @__PURE__ */ a("span", {
|
|
7432
7624
|
className: r.className,
|
|
7433
7625
|
"data-answer": r.answer ? "true" : void 0,
|
|
@@ -7437,48 +7629,42 @@ function vu({ answerMarkers: e = [], content: t, disabled: n = !1, onMarkerClick
|
|
|
7437
7629
|
}, n);
|
|
7438
7630
|
}
|
|
7439
7631
|
}
|
|
7440
|
-
function
|
|
7632
|
+
function Fu(e) {
|
|
7441
7633
|
return !!(e && typeof e == "object" && "children" in e && Array.isArray(e.children));
|
|
7442
7634
|
}
|
|
7443
|
-
function
|
|
7635
|
+
function Iu(e) {
|
|
7444
7636
|
return !!(e && typeof e == "object" && "text" in e && typeof e.text == "string");
|
|
7445
7637
|
}
|
|
7446
7638
|
//#endregion
|
|
7447
|
-
//#region src/question/
|
|
7448
|
-
function
|
|
7449
|
-
let
|
|
7450
|
-
return /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(
|
|
7451
|
-
|
|
7452
|
-
|
|
7453
|
-
|
|
7454
|
-
|
|
7639
|
+
//#region src/question/player/QuestionTextMarkerPlayer.tsx
|
|
7640
|
+
function Lu({ gradingResult: e, disabled: t, item: n, messages: r, onChange: s, response: c, responseIndex: l, showAnswer: u }) {
|
|
7641
|
+
let d = dc(c, l);
|
|
7642
|
+
return /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(Pu, {
|
|
7643
|
+
renderMarker: (t, n) => {
|
|
7644
|
+
var r;
|
|
7645
|
+
return /* @__PURE__ */ a(Pl, {
|
|
7646
|
+
unansweredAsWarning: !0,
|
|
7647
|
+
status: e == null || (r = e.markerResults.find((e) => e.markerId === t)) == null ? void 0 : r.status,
|
|
7648
|
+
children: n
|
|
7649
|
+
});
|
|
7650
|
+
},
|
|
7651
|
+
answerMarkers: n.answers,
|
|
7652
|
+
content: n.content,
|
|
7653
|
+
disabled: t,
|
|
7654
|
+
onMarkerClick: (e) => s(j(j({}, d), {}, { selectedMarkers: xc(d.selectedMarkers, e) })),
|
|
7655
|
+
selectedMarkers: d.selectedMarkers
|
|
7656
|
+
}), u ? /* @__PURE__ */ a(Y, {
|
|
7657
|
+
title: r.standardAnswer,
|
|
7455
7658
|
groups: [{
|
|
7456
7659
|
kind: "detailed",
|
|
7457
|
-
|
|
7458
|
-
|
|
7459
|
-
}]
|
|
7460
|
-
title: t.standardAnswer
|
|
7660
|
+
marker: r.standardAnswer,
|
|
7661
|
+
contents: Et(n.content.json).filter((e) => n.answers.includes(e.markerId)).map((e) => e.text)
|
|
7662
|
+
}]
|
|
7461
7663
|
}) : null] });
|
|
7462
7664
|
}
|
|
7463
7665
|
//#endregion
|
|
7464
|
-
//#region src/question/player/QuestionTextMarkerPlayer.tsx
|
|
7465
|
-
function Su({ disabled: e, item: t, messages: n, onChange: r, response: i, responseIndex: o, showAnswer: s }) {
|
|
7466
|
-
let c = dc(i, o);
|
|
7467
|
-
return s ? /* @__PURE__ */ a(xu, {
|
|
7468
|
-
item: t,
|
|
7469
|
-
messages: n,
|
|
7470
|
-
showAnswer: s
|
|
7471
|
-
}) : /* @__PURE__ */ a(vu, {
|
|
7472
|
-
answerMarkers: t.answers,
|
|
7473
|
-
content: t.content,
|
|
7474
|
-
disabled: e,
|
|
7475
|
-
onMarkerClick: (e) => r(j(j({}, c), {}, { selectedMarkers: xc(c.selectedMarkers, e) })),
|
|
7476
|
-
selectedMarkers: c.selectedMarkers
|
|
7477
|
-
});
|
|
7478
|
-
}
|
|
7479
|
-
//#endregion
|
|
7480
7666
|
//#region src/question/player/QuestionTextResponsePlayer.tsx
|
|
7481
|
-
function
|
|
7667
|
+
function Ru({ disabled: e, locale: t, label: n, messages: r, onChange: i, response: o, responseIndex: s, uploadImage: c }) {
|
|
7482
7668
|
let l = fc(o, s);
|
|
7483
7669
|
return e ? F(l.content) ? null : /* @__PURE__ */ a(J, { content: l.content }) : /* @__PURE__ */ a(Ha, {
|
|
7484
7670
|
ariaLabel: n,
|
|
@@ -7495,7 +7681,7 @@ function Cu({ disabled: e, locale: t, label: n, messages: r, onChange: i, respon
|
|
|
7495
7681
|
}
|
|
7496
7682
|
//#endregion
|
|
7497
7683
|
//#region src/question/renderers/wordBuilderAnswers.tsx
|
|
7498
|
-
function
|
|
7684
|
+
function zu(e, t) {
|
|
7499
7685
|
return e.blanks.reduce((n, r) => {
|
|
7500
7686
|
var i;
|
|
7501
7687
|
let o = (i = e.answers[r]) == null ? void 0 : i.trim();
|
|
@@ -7508,297 +7694,303 @@ function wu(e, t) {
|
|
|
7508
7694
|
}
|
|
7509
7695
|
//#endregion
|
|
7510
7696
|
//#region src/question/player/QuestionPlayerWordBuilder.module.css
|
|
7511
|
-
var
|
|
7512
|
-
"word-builder-blank": "_word-builder-
|
|
7513
|
-
"word-builder-candidate-list": "_word-builder-candidate-
|
|
7697
|
+
var Bu = {
|
|
7698
|
+
"word-builder-blank": "_word-builder-blank_1q28p_1",
|
|
7699
|
+
"word-builder-candidate-list": "_word-builder-candidate-list_1q28p_35"
|
|
7514
7700
|
};
|
|
7515
7701
|
//#endregion
|
|
7516
7702
|
//#region src/question/player/QuestionWordBuilderPlayer.tsx
|
|
7517
|
-
function
|
|
7518
|
-
let
|
|
7519
|
-
function
|
|
7520
|
-
|
|
7703
|
+
function Vu({ gradingResult: e, disabled: t, element: n, item: r, messages: i, onChange: s, response: c, responseIndex: l, showAnswer: u }) {
|
|
7704
|
+
let d = kn(r, !0, n), f = ac(c, l, d.blanks), p = zu(d, (e, t) => tl(e, t, i.blankLabel));
|
|
7705
|
+
function m(e, t) {
|
|
7706
|
+
s(j(j({}, f), {}, { answers: j(j({}, f.answers), {}, { [e]: t }) }));
|
|
7521
7707
|
}
|
|
7522
|
-
function
|
|
7523
|
-
|
|
7708
|
+
function h(e) {
|
|
7709
|
+
t || !f.answers[e] || m(e, "");
|
|
7524
7710
|
}
|
|
7525
|
-
function
|
|
7711
|
+
function g(e, t) {
|
|
7526
7712
|
var r;
|
|
7527
|
-
let i = (r =
|
|
7528
|
-
|
|
7713
|
+
let i = (r = f.answers[e]) == null ? "" : r;
|
|
7714
|
+
m(e, n.config.builderMode === "sentence" ? t : `${i}${t}`);
|
|
7529
7715
|
}
|
|
7530
|
-
function
|
|
7716
|
+
function _(e) {
|
|
7531
7717
|
var t;
|
|
7532
|
-
let n = (t =
|
|
7718
|
+
let n = (t = d.blanks.find((e) => {
|
|
7533
7719
|
var t;
|
|
7534
|
-
return !((t =
|
|
7535
|
-
})) == null ?
|
|
7536
|
-
n &&
|
|
7720
|
+
return !((t = f.answers[e]) != null && t.trim());
|
|
7721
|
+
})) == null ? d.blanks[0] : t;
|
|
7722
|
+
n && g(n, e);
|
|
7537
7723
|
}
|
|
7538
|
-
function
|
|
7539
|
-
if (
|
|
7540
|
-
let r =
|
|
7541
|
-
r &&
|
|
7724
|
+
function v(e, n) {
|
|
7725
|
+
if (e.preventDefault(), t) return;
|
|
7726
|
+
let r = e.dataTransfer.getData("answer/item") || e.dataTransfer.getData("text/plain");
|
|
7727
|
+
r && g(n, r);
|
|
7542
7728
|
}
|
|
7543
7729
|
return /* @__PURE__ */ o("div", {
|
|
7544
7730
|
className: q["fill-text"],
|
|
7545
7731
|
children: [
|
|
7546
|
-
/* @__PURE__ */ a(
|
|
7547
|
-
content:
|
|
7548
|
-
renderBlank: ({ blankId:
|
|
7549
|
-
var
|
|
7550
|
-
let
|
|
7551
|
-
answers:
|
|
7552
|
-
blankLabel:
|
|
7553
|
-
canClear: !
|
|
7554
|
-
index:
|
|
7555
|
-
label:
|
|
7732
|
+
/* @__PURE__ */ a(Vl, {
|
|
7733
|
+
content: d.content,
|
|
7734
|
+
renderBlank: ({ blankId: n, index: r, label: o }) => {
|
|
7735
|
+
var s, c, l;
|
|
7736
|
+
let u = (s = f.answers[n]) == null ? "" : s, d = Hu({
|
|
7737
|
+
answers: u,
|
|
7738
|
+
blankLabel: i.blankLabel,
|
|
7739
|
+
canClear: !t && !!u.trim(),
|
|
7740
|
+
index: r,
|
|
7741
|
+
label: o
|
|
7556
7742
|
});
|
|
7557
|
-
return /* @__PURE__ */ a(
|
|
7558
|
-
|
|
7559
|
-
|
|
7560
|
-
|
|
7561
|
-
|
|
7562
|
-
|
|
7563
|
-
|
|
7564
|
-
|
|
7565
|
-
|
|
7566
|
-
|
|
7743
|
+
return /* @__PURE__ */ a(Pl, {
|
|
7744
|
+
unansweredAsWarning: !0,
|
|
7745
|
+
status: e == null || (c = e.blankResults.find((e) => e.blankId === n)) == null ? void 0 : c.status,
|
|
7746
|
+
children: /* @__PURE__ */ a("button", {
|
|
7747
|
+
"aria-label": d,
|
|
7748
|
+
className: Bu["word-builder-blank"],
|
|
7749
|
+
disabled: t,
|
|
7750
|
+
onClick: () => h(n),
|
|
7751
|
+
onDragOver: (e) => e.preventDefault(),
|
|
7752
|
+
onDrop: (e) => v(e, n),
|
|
7753
|
+
title: d,
|
|
7754
|
+
type: "button",
|
|
7755
|
+
children: (l = f.answers[n]) == null ? "" : l
|
|
7756
|
+
})
|
|
7567
7757
|
});
|
|
7568
7758
|
}
|
|
7569
7759
|
}),
|
|
7570
7760
|
/* @__PURE__ */ a("div", {
|
|
7571
|
-
className:
|
|
7572
|
-
children:
|
|
7573
|
-
disabled:
|
|
7574
|
-
draggable: !
|
|
7575
|
-
onClick: () =>
|
|
7576
|
-
onDragStart: (
|
|
7577
|
-
|
|
7761
|
+
className: Bu["word-builder-candidate-list"],
|
|
7762
|
+
children: d.candidateOptions.map((e, n) => /* @__PURE__ */ a("button", {
|
|
7763
|
+
disabled: t,
|
|
7764
|
+
draggable: !t,
|
|
7765
|
+
onClick: () => _(e),
|
|
7766
|
+
onDragStart: (t) => {
|
|
7767
|
+
t.dataTransfer.effectAllowed = "copy", t.dataTransfer.setData("answer/item", e), t.dataTransfer.setData("text/plain", e);
|
|
7578
7768
|
},
|
|
7579
7769
|
type: "button",
|
|
7580
|
-
children:
|
|
7581
|
-
}, `${
|
|
7770
|
+
children: e
|
|
7771
|
+
}, `${e}-${n}`))
|
|
7582
7772
|
}),
|
|
7583
|
-
|
|
7584
|
-
groups:
|
|
7585
|
-
title:
|
|
7773
|
+
u ? /* @__PURE__ */ a(Y, {
|
|
7774
|
+
groups: p,
|
|
7775
|
+
title: i.standardAnswer
|
|
7586
7776
|
}) : null
|
|
7587
7777
|
]
|
|
7588
7778
|
});
|
|
7589
7779
|
}
|
|
7590
|
-
function
|
|
7780
|
+
function Hu({ answers: e, blankLabel: t, canClear: n, index: r, label: i }) {
|
|
7591
7781
|
let a = i || `${t}${r + 1}`;
|
|
7592
7782
|
return !n || !e.trim() ? a : t === "\u7a7a" ? `${a}\uff0c\u70b9\u51fb\u6e05\u7a7a` : `${a}, click to clear`;
|
|
7593
7783
|
}
|
|
7594
7784
|
//#endregion
|
|
7595
7785
|
//#region src/question/player/QuestionPlayerElement.tsx
|
|
7596
|
-
function
|
|
7597
|
-
if (
|
|
7598
|
-
return
|
|
7786
|
+
function Uu({ disabled: e, gradingResult: t, element: n, item: r, locale: i, messages: o, onResponseItemChange: s, response: c, responseIndex: l, showAnswer: u, uploadImage: d }) {
|
|
7787
|
+
if (n.type !== r.type) throw Error(`\u9898\u76ee\u5143\u7d20\u7ed3\u6784\u4e0d\u5339\u914d\uff0cexpected=${n.type}\uff0cactual=${r.type}`);
|
|
7788
|
+
return n.type === "richText" ? /* @__PURE__ */ a(J, { content: r.content }) : n.type === "textResponse" ? /* @__PURE__ */ a(Ru, {
|
|
7599
7789
|
disabled: e,
|
|
7600
|
-
label:
|
|
7601
|
-
locale:
|
|
7602
|
-
messages:
|
|
7603
|
-
onChange:
|
|
7604
|
-
response:
|
|
7605
|
-
responseIndex:
|
|
7606
|
-
uploadImage:
|
|
7607
|
-
}) :
|
|
7790
|
+
label: n.name,
|
|
7791
|
+
locale: i,
|
|
7792
|
+
messages: o,
|
|
7793
|
+
onChange: s,
|
|
7794
|
+
response: c,
|
|
7795
|
+
responseIndex: l,
|
|
7796
|
+
uploadImage: d
|
|
7797
|
+
}) : n.type === "ordering" ? /* @__PURE__ */ a(Nu, {
|
|
7798
|
+
gradingResult: Yc(t, "ordering"),
|
|
7608
7799
|
disabled: e,
|
|
7609
|
-
item:
|
|
7610
|
-
messages:
|
|
7611
|
-
onChange:
|
|
7612
|
-
response:
|
|
7613
|
-
responseIndex:
|
|
7614
|
-
showAnswer:
|
|
7615
|
-
}) :
|
|
7800
|
+
item: r,
|
|
7801
|
+
messages: o,
|
|
7802
|
+
onChange: s,
|
|
7803
|
+
response: c,
|
|
7804
|
+
responseIndex: l,
|
|
7805
|
+
showAnswer: u
|
|
7806
|
+
}) : n.type === "classification" ? /* @__PURE__ */ a(zl, {
|
|
7807
|
+
gradingResult: Yc(t, "classification"),
|
|
7616
7808
|
disabled: e,
|
|
7617
|
-
item:
|
|
7618
|
-
messages:
|
|
7619
|
-
onChange:
|
|
7620
|
-
response:
|
|
7621
|
-
responseIndex:
|
|
7622
|
-
showAnswer:
|
|
7623
|
-
}) :
|
|
7809
|
+
item: r,
|
|
7810
|
+
messages: o,
|
|
7811
|
+
onChange: s,
|
|
7812
|
+
response: c,
|
|
7813
|
+
responseIndex: l,
|
|
7814
|
+
showAnswer: u
|
|
7815
|
+
}) : n.type === "textMarker" ? /* @__PURE__ */ a(Lu, {
|
|
7816
|
+
gradingResult: Yc(t, "textMarker"),
|
|
7624
7817
|
disabled: e,
|
|
7625
|
-
item:
|
|
7626
|
-
messages:
|
|
7627
|
-
onChange:
|
|
7628
|
-
response:
|
|
7629
|
-
responseIndex:
|
|
7630
|
-
showAnswer:
|
|
7631
|
-
}) :
|
|
7818
|
+
item: r,
|
|
7819
|
+
messages: o,
|
|
7820
|
+
onChange: s,
|
|
7821
|
+
response: c,
|
|
7822
|
+
responseIndex: l,
|
|
7823
|
+
showAnswer: u
|
|
7824
|
+
}) : Wu({
|
|
7632
7825
|
disabled: e,
|
|
7633
|
-
|
|
7634
|
-
|
|
7635
|
-
|
|
7636
|
-
|
|
7637
|
-
|
|
7638
|
-
|
|
7639
|
-
|
|
7640
|
-
|
|
7641
|
-
|
|
7642
|
-
|
|
7643
|
-
}
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7826
|
+
gradingResult: t,
|
|
7827
|
+
element: n,
|
|
7828
|
+
item: r,
|
|
7829
|
+
locale: i,
|
|
7830
|
+
messages: o,
|
|
7831
|
+
onResponseItemChange: s,
|
|
7832
|
+
response: c,
|
|
7833
|
+
responseIndex: l,
|
|
7834
|
+
showAnswer: u,
|
|
7835
|
+
uploadImage: d
|
|
7836
|
+
});
|
|
7837
|
+
}
|
|
7838
|
+
function Wu({ disabled: e, gradingResult: t, element: n, item: r, messages: i, onResponseItemChange: o, response: s, responseIndex: c, showAnswer: l }) {
|
|
7839
|
+
switch (n.type) {
|
|
7840
|
+
case "choice": return /* @__PURE__ */ a(ju, {
|
|
7841
|
+
gradingResult: Yc(t, "choice"),
|
|
7647
7842
|
disabled: e,
|
|
7648
|
-
element:
|
|
7649
|
-
item:
|
|
7650
|
-
messages:
|
|
7651
|
-
onChange:
|
|
7652
|
-
response:
|
|
7653
|
-
responseIndex:
|
|
7654
|
-
showAnswer:
|
|
7843
|
+
element: n,
|
|
7844
|
+
item: r,
|
|
7845
|
+
messages: i,
|
|
7846
|
+
onChange: o,
|
|
7847
|
+
response: s,
|
|
7848
|
+
responseIndex: c,
|
|
7849
|
+
showAnswer: l
|
|
7655
7850
|
});
|
|
7656
|
-
case "fill": return /* @__PURE__ */ a(
|
|
7851
|
+
case "fill": return /* @__PURE__ */ a(Fl, {
|
|
7852
|
+
gradingResult: Yc(t, "fill"),
|
|
7657
7853
|
disabled: e,
|
|
7658
|
-
item:
|
|
7659
|
-
messages:
|
|
7660
|
-
onChange:
|
|
7661
|
-
response:
|
|
7662
|
-
responseIndex:
|
|
7663
|
-
showAnswer:
|
|
7854
|
+
item: r,
|
|
7855
|
+
messages: i,
|
|
7856
|
+
onChange: o,
|
|
7857
|
+
response: s,
|
|
7858
|
+
responseIndex: c,
|
|
7859
|
+
showAnswer: l
|
|
7664
7860
|
});
|
|
7665
|
-
case "inlineFill": return /* @__PURE__ */ a(
|
|
7861
|
+
case "inlineFill": return /* @__PURE__ */ a(iu, {
|
|
7862
|
+
gradingResult: Yc(t, "inlineFill"),
|
|
7666
7863
|
disabled: e,
|
|
7667
|
-
element:
|
|
7668
|
-
item:
|
|
7669
|
-
messages:
|
|
7670
|
-
onChange:
|
|
7671
|
-
response:
|
|
7672
|
-
responseIndex:
|
|
7673
|
-
showAnswer:
|
|
7864
|
+
element: n,
|
|
7865
|
+
item: r,
|
|
7866
|
+
messages: i,
|
|
7867
|
+
onChange: o,
|
|
7868
|
+
response: s,
|
|
7869
|
+
responseIndex: c,
|
|
7870
|
+
showAnswer: l
|
|
7674
7871
|
});
|
|
7675
|
-
case "wordBuilder": return /* @__PURE__ */ a(
|
|
7872
|
+
case "wordBuilder": return /* @__PURE__ */ a(Vu, {
|
|
7873
|
+
gradingResult: Yc(t, "wordBuilder"),
|
|
7676
7874
|
disabled: e,
|
|
7677
|
-
element:
|
|
7678
|
-
item:
|
|
7679
|
-
messages:
|
|
7680
|
-
onChange:
|
|
7681
|
-
response:
|
|
7682
|
-
responseIndex:
|
|
7683
|
-
showAnswer:
|
|
7875
|
+
element: n,
|
|
7876
|
+
item: r,
|
|
7877
|
+
messages: i,
|
|
7878
|
+
onChange: o,
|
|
7879
|
+
response: s,
|
|
7880
|
+
responseIndex: c,
|
|
7881
|
+
showAnswer: l
|
|
7684
7882
|
});
|
|
7685
|
-
case "judgement": return /* @__PURE__ */ a(
|
|
7883
|
+
case "judgement": return /* @__PURE__ */ a(lu, {
|
|
7884
|
+
gradingResult: Yc(t, "judgement"),
|
|
7686
7885
|
disabled: e,
|
|
7687
|
-
element:
|
|
7688
|
-
item:
|
|
7689
|
-
messages:
|
|
7690
|
-
onChange:
|
|
7691
|
-
response:
|
|
7692
|
-
responseIndex:
|
|
7693
|
-
showAnswer:
|
|
7886
|
+
element: n,
|
|
7887
|
+
item: r,
|
|
7888
|
+
messages: i,
|
|
7889
|
+
onChange: o,
|
|
7890
|
+
response: s,
|
|
7891
|
+
responseIndex: c,
|
|
7892
|
+
showAnswer: l
|
|
7694
7893
|
});
|
|
7695
|
-
case "lineConnect": return /* @__PURE__ */ a(
|
|
7894
|
+
case "lineConnect": return /* @__PURE__ */ a(fu, {
|
|
7895
|
+
gradingResult: Yc(t, "lineConnect"),
|
|
7696
7896
|
disabled: e,
|
|
7697
|
-
item:
|
|
7698
|
-
messages:
|
|
7699
|
-
onChange:
|
|
7700
|
-
response:
|
|
7701
|
-
responseIndex:
|
|
7702
|
-
showAnswer:
|
|
7897
|
+
item: r,
|
|
7898
|
+
messages: i,
|
|
7899
|
+
onChange: o,
|
|
7900
|
+
response: s,
|
|
7901
|
+
responseIndex: c,
|
|
7902
|
+
showAnswer: l
|
|
7703
7903
|
});
|
|
7704
|
-
case "matching": return /* @__PURE__ */ a(
|
|
7904
|
+
case "matching": return /* @__PURE__ */ a(vu, {
|
|
7905
|
+
gradingResult: Yc(t, "matching"),
|
|
7705
7906
|
disabled: e,
|
|
7706
|
-
item:
|
|
7707
|
-
messages:
|
|
7708
|
-
onChange:
|
|
7709
|
-
response:
|
|
7710
|
-
responseIndex:
|
|
7711
|
-
showAnswer:
|
|
7907
|
+
item: r,
|
|
7908
|
+
messages: i,
|
|
7909
|
+
onChange: o,
|
|
7910
|
+
response: s,
|
|
7911
|
+
responseIndex: c,
|
|
7912
|
+
showAnswer: l
|
|
7712
7913
|
});
|
|
7713
7914
|
}
|
|
7714
7915
|
}
|
|
7715
7916
|
//#endregion
|
|
7716
|
-
//#region src/question/player/
|
|
7717
|
-
|
|
7718
|
-
|
|
7719
|
-
|
|
7720
|
-
return /* @__PURE__ */ a(Mu, j(j({}, n), {}, {
|
|
7721
|
-
childIndexPath: [],
|
|
7722
|
-
locale: t,
|
|
7723
|
-
messages: Bc(t),
|
|
7724
|
-
onResponseChange: (e) => n.onResponseChange(Ns(e, r)),
|
|
7725
|
-
response: i,
|
|
7726
|
-
value: r
|
|
7727
|
-
}));
|
|
7728
|
-
}
|
|
7729
|
-
function Mu({ childIndexPath: e, className: t, disabled: n = !1, locale: r = "zh-CN", messages: i, onResponseChange: o, response: s, rootQuestionNumber: c, showAnswer: l = !1, showExtraAttributes: u = !1, questionTypeTemplates: d, uploadImage: f, value: p }) {
|
|
7730
|
-
let m = da(d, p);
|
|
7731
|
-
if (!m) return /* @__PURE__ */ a("div", {
|
|
7917
|
+
//#region src/question/player/QuestionPlayerInner.tsx
|
|
7918
|
+
function Gu({ childIndexPath: e, className: t, disabled: n = !1, gradingResult: r, locale: i = "zh-CN", messages: o, onResponseChange: s, response: c, rootQuestionNumber: l, showAnswer: u = !1, showExtraAttributes: d = !1, questionTypeTemplates: f, uploadImage: p, value: m }) {
|
|
7919
|
+
let h = da(f, m);
|
|
7920
|
+
if (!h) return /* @__PURE__ */ a("div", {
|
|
7732
7921
|
className: U(q.root, t),
|
|
7733
7922
|
children: /* @__PURE__ */ a("div", {
|
|
7734
7923
|
className: q.empty,
|
|
7735
|
-
children:
|
|
7924
|
+
children: o.missingQuestionTypeTemplate
|
|
7736
7925
|
})
|
|
7737
7926
|
});
|
|
7738
|
-
let
|
|
7927
|
+
let g = Ku({
|
|
7928
|
+
gradingResult: r,
|
|
7739
7929
|
childIndexPath: e,
|
|
7740
7930
|
disabled: n,
|
|
7741
|
-
locale:
|
|
7742
|
-
messages:
|
|
7743
|
-
onResponseChange:
|
|
7744
|
-
response:
|
|
7745
|
-
rootQuestionNumber:
|
|
7746
|
-
showAnswer:
|
|
7747
|
-
showExtraAttributes:
|
|
7748
|
-
structure:
|
|
7749
|
-
uploadImage:
|
|
7750
|
-
questionTypeTemplates:
|
|
7751
|
-
value:
|
|
7931
|
+
locale: i,
|
|
7932
|
+
messages: o,
|
|
7933
|
+
onResponseChange: s,
|
|
7934
|
+
response: c,
|
|
7935
|
+
rootQuestionNumber: l,
|
|
7936
|
+
showAnswer: u,
|
|
7937
|
+
showExtraAttributes: d,
|
|
7938
|
+
structure: h,
|
|
7939
|
+
uploadImage: p,
|
|
7940
|
+
questionTypeTemplates: f,
|
|
7941
|
+
value: m
|
|
7752
7942
|
});
|
|
7753
7943
|
return /* @__PURE__ */ a("div", {
|
|
7754
7944
|
className: U(q.root, t),
|
|
7755
|
-
children:
|
|
7945
|
+
children: Xu(h, m) ? /* @__PURE__ */ a("div", {
|
|
7756
7946
|
className: q.empty,
|
|
7757
|
-
children:
|
|
7758
|
-
}) :
|
|
7947
|
+
children: o.previewEmpty
|
|
7948
|
+
}) : g
|
|
7759
7949
|
});
|
|
7760
7950
|
}
|
|
7761
|
-
function
|
|
7951
|
+
function Ku(e) {
|
|
7762
7952
|
return /* @__PURE__ */ o(i, { children: [
|
|
7763
|
-
|
|
7764
|
-
|
|
7765
|
-
|
|
7953
|
+
qu(e),
|
|
7954
|
+
Yu(e),
|
|
7955
|
+
Ju(e)
|
|
7766
7956
|
] });
|
|
7767
7957
|
}
|
|
7768
|
-
function
|
|
7769
|
-
return
|
|
7958
|
+
function qu({ gradingResult: e, disabled: t, locale: n, messages: r, onResponseChange: i, response: o, showAnswer: s, structure: c, uploadImage: l, value: u }) {
|
|
7959
|
+
return c.elements.length === 0 ? null : /* @__PURE__ */ a("div", {
|
|
7770
7960
|
className: q["element-list"],
|
|
7771
|
-
children:
|
|
7772
|
-
|
|
7961
|
+
children: c.elements.map((d, f) => {
|
|
7962
|
+
var p;
|
|
7963
|
+
let m = cn(u, f, d), h = c.elements.slice(0, f).filter((e) => e.type !== "richText").length;
|
|
7773
7964
|
return /* @__PURE__ */ a("section", {
|
|
7774
7965
|
className: q.element,
|
|
7775
|
-
children: /* @__PURE__ */ a(
|
|
7776
|
-
disabled:
|
|
7777
|
-
|
|
7778
|
-
|
|
7779
|
-
|
|
7780
|
-
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
7785
|
-
|
|
7966
|
+
children: /* @__PURE__ */ a(Uu, {
|
|
7967
|
+
disabled: t,
|
|
7968
|
+
gradingResult: (p = e == null ? void 0 : e.elementResults[h]) == null ? void 0 : p,
|
|
7969
|
+
element: d,
|
|
7970
|
+
item: m,
|
|
7971
|
+
locale: n,
|
|
7972
|
+
messages: r,
|
|
7973
|
+
onResponseItemChange: (e) => i(pc(o, h, e)),
|
|
7974
|
+
response: o,
|
|
7975
|
+
responseIndex: h,
|
|
7976
|
+
showAnswer: s && c.hasAnswer,
|
|
7977
|
+
uploadImage: l
|
|
7786
7978
|
})
|
|
7787
|
-
}, `${
|
|
7979
|
+
}, `${d.type}-${f}`);
|
|
7788
7980
|
})
|
|
7789
7981
|
});
|
|
7790
7982
|
}
|
|
7791
|
-
function
|
|
7983
|
+
function Ju({ disabled: e, locale: t, messages: n, response: r, showExtraAttributes: i, structure: s, uploadImage: c, value: l }) {
|
|
7792
7984
|
return i ? /* @__PURE__ */ a("div", {
|
|
7793
7985
|
className: q["element-list"],
|
|
7794
7986
|
children: s.extras.map((i, s) => {
|
|
7795
7987
|
let u = ln(l, s, i);
|
|
7796
7988
|
return F(u.content) ? null : /* @__PURE__ */ o("section", {
|
|
7797
7989
|
className: q.extra,
|
|
7798
|
-
children: [/* @__PURE__ */ a(
|
|
7990
|
+
children: [/* @__PURE__ */ a(Al, { children: i.name }), /* @__PURE__ */ a(Uu, {
|
|
7799
7991
|
disabled: e,
|
|
7800
|
-
element:
|
|
7801
|
-
item:
|
|
7992
|
+
element: Zu(i),
|
|
7993
|
+
item: Qu(u),
|
|
7802
7994
|
locale: t,
|
|
7803
7995
|
messages: n,
|
|
7804
7996
|
onResponseItemChange: () => void 0,
|
|
@@ -7811,50 +8003,69 @@ function Fu({ disabled: e, locale: t, messages: n, response: r, showExtraAttribu
|
|
|
7811
8003
|
})
|
|
7812
8004
|
}) : null;
|
|
7813
8005
|
}
|
|
7814
|
-
function
|
|
7815
|
-
return
|
|
7816
|
-
childIndexPath:
|
|
7817
|
-
disabled:
|
|
7818
|
-
messages:
|
|
7819
|
-
onChildResponseChange: (e, t) =>
|
|
7820
|
-
response:
|
|
7821
|
-
renderChild: (
|
|
7822
|
-
|
|
7823
|
-
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
|
|
7827
|
-
|
|
7828
|
-
|
|
7829
|
-
|
|
7830
|
-
|
|
7831
|
-
|
|
7832
|
-
|
|
7833
|
-
|
|
8006
|
+
function Yu({ gradingResult: e, childIndexPath: t, disabled: n, locale: r, messages: i, onResponseChange: o, response: s, rootQuestionNumber: c, showAnswer: l, showExtraAttributes: u, questionTypeTemplates: d, uploadImage: f, value: p }) {
|
|
8007
|
+
return p.children.length === 0 ? null : /* @__PURE__ */ a(jl, {
|
|
8008
|
+
childIndexPath: t,
|
|
8009
|
+
disabled: n,
|
|
8010
|
+
messages: i,
|
|
8011
|
+
onChildResponseChange: (e, t) => o(mc(s, e, t)),
|
|
8012
|
+
response: s,
|
|
8013
|
+
renderChild: (t, o, s, p) => /* @__PURE__ */ a(Gu, {
|
|
8014
|
+
gradingResult: e == null ? void 0 : e.children[p[p.length - 1]],
|
|
8015
|
+
childIndexPath: p,
|
|
8016
|
+
disabled: n,
|
|
8017
|
+
locale: r,
|
|
8018
|
+
messages: i,
|
|
8019
|
+
onResponseChange: s,
|
|
8020
|
+
response: o,
|
|
8021
|
+
rootQuestionNumber: c,
|
|
8022
|
+
showAnswer: l,
|
|
8023
|
+
showExtraAttributes: u,
|
|
8024
|
+
questionTypeTemplates: d,
|
|
8025
|
+
uploadImage: f,
|
|
8026
|
+
value: t
|
|
7834
8027
|
}),
|
|
7835
|
-
rootQuestionNumber:
|
|
7836
|
-
value:
|
|
8028
|
+
rootQuestionNumber: c,
|
|
8029
|
+
value: p
|
|
7837
8030
|
});
|
|
7838
8031
|
}
|
|
7839
|
-
function
|
|
8032
|
+
function Xu(e, t) {
|
|
7840
8033
|
return t.elements.length === 0 && t.extras.length === 0 && t.children.length === 0;
|
|
7841
8034
|
}
|
|
7842
|
-
function
|
|
8035
|
+
function Zu(e) {
|
|
7843
8036
|
return {
|
|
7844
8037
|
config: {},
|
|
7845
8038
|
name: e.name,
|
|
7846
8039
|
type: "richText"
|
|
7847
8040
|
};
|
|
7848
8041
|
}
|
|
7849
|
-
function
|
|
8042
|
+
function Qu(e) {
|
|
7850
8043
|
return {
|
|
7851
8044
|
content: e.content,
|
|
7852
8045
|
type: "richText"
|
|
7853
8046
|
};
|
|
7854
8047
|
}
|
|
7855
8048
|
//#endregion
|
|
8049
|
+
//#region src/question/player/QuestionPlayer.tsx
|
|
8050
|
+
var $u = ["locale"];
|
|
8051
|
+
function ed(e) {
|
|
8052
|
+
let { locale: t = "zh-CN" } = e, n = Oa(e, $u), r = ks(n.value, n.questionTypeTemplates), i = Ps(n.response, r);
|
|
8053
|
+
return n.gradingResult && Uc(n.gradingResult, r), /* @__PURE__ */ a(Zc.Provider, {
|
|
8054
|
+
value: t,
|
|
8055
|
+
children: /* @__PURE__ */ a(Gu, j(j({}, n), {}, {
|
|
8056
|
+
disabled: !!(n.disabled || n.gradingResult),
|
|
8057
|
+
childIndexPath: [],
|
|
8058
|
+
locale: t,
|
|
8059
|
+
messages: Bc(t),
|
|
8060
|
+
onResponseChange: (e) => n.onResponseChange(Ns(e, r)),
|
|
8061
|
+
response: i,
|
|
8062
|
+
value: r
|
|
8063
|
+
}))
|
|
8064
|
+
});
|
|
8065
|
+
}
|
|
8066
|
+
//#endregion
|
|
7856
8067
|
//#region src/question/shared/QuestionTextResponsePlaceholder.tsx
|
|
7857
|
-
function
|
|
8068
|
+
function td({ className: e = wl.placeholder, label: t }) {
|
|
7858
8069
|
return /* @__PURE__ */ a("div", {
|
|
7859
8070
|
"aria-label": t,
|
|
7860
8071
|
className: e
|
|
@@ -7862,17 +8073,17 @@ function Bu({ className: e = ul.placeholder, label: t }) {
|
|
|
7862
8073
|
}
|
|
7863
8074
|
//#endregion
|
|
7864
8075
|
//#region src/question/renderers/blankStandardAnswerGroups.tsx
|
|
7865
|
-
function
|
|
7866
|
-
return [...e].sort((e, n) =>
|
|
8076
|
+
function nd(e, t, n) {
|
|
8077
|
+
return [...e].sort((e, n) => rd(e.blankIds, t) - rd(n.blankIds, t)).map((e, r) => ({
|
|
7867
8078
|
kind: "detailed",
|
|
7868
|
-
contents:
|
|
7869
|
-
marker:
|
|
8079
|
+
contents: id(e.contents.filter((e) => !F(e)), n, r),
|
|
8080
|
+
marker: hl(e.blankIds, t, n)
|
|
7870
8081
|
}));
|
|
7871
8082
|
}
|
|
7872
|
-
function
|
|
8083
|
+
function rd(e, t) {
|
|
7873
8084
|
return Math.min(...e.map((e) => t.indexOf(e)));
|
|
7874
8085
|
}
|
|
7875
|
-
function
|
|
8086
|
+
function id(e, t, n) {
|
|
7876
8087
|
let r = t === "zh-CN" ? "\uff1b" : "; ";
|
|
7877
8088
|
return e.reduce((t, i, o) => [
|
|
7878
8089
|
...t,
|
|
@@ -7882,8 +8093,8 @@ function Uu(e, t, n) {
|
|
|
7882
8093
|
}
|
|
7883
8094
|
//#endregion
|
|
7884
8095
|
//#region src/question/renderers/QuestionBlankGroupView.tsx
|
|
7885
|
-
function
|
|
7886
|
-
let i = W(), { blankGroup: s, renderer: c } = K(), l = Yn(e.answers, e.blanks), u = i.answerGroupLayout === "rows" ?
|
|
8096
|
+
function ad({ item: e, locale: t, messages: n, showAnswer: r }) {
|
|
8097
|
+
let i = W(), { blankGroup: s, renderer: c } = K(), l = Yn(e.answers, e.blanks), u = i.answerGroupLayout === "rows" ? nd(l.map((e) => ({
|
|
7887
8098
|
blankIds: e.blankIds,
|
|
7888
8099
|
contents: e.answerPools
|
|
7889
8100
|
})), e.blanks, t) : l.map((r, o) => ({
|
|
@@ -7893,36 +8104,36 @@ function Wu({ item: e, locale: t, messages: n, showAnswer: r }) {
|
|
|
7893
8104
|
}));
|
|
7894
8105
|
return /* @__PURE__ */ o("div", {
|
|
7895
8106
|
className: c.element,
|
|
7896
|
-
children: [/* @__PURE__ */ a(
|
|
8107
|
+
children: [/* @__PURE__ */ a(wu, {
|
|
7897
8108
|
className: s["blank-list"],
|
|
7898
8109
|
columnCount: Math.min(e.blanks.length, 4),
|
|
7899
8110
|
role: "list",
|
|
7900
|
-
children: e.blanks.map((e, r) => /* @__PURE__ */ a(
|
|
8111
|
+
children: e.blanks.map((e, r) => /* @__PURE__ */ a(Nl, {
|
|
7901
8112
|
className: s["blank-item"],
|
|
7902
8113
|
children: /* @__PURE__ */ a("span", {
|
|
7903
|
-
"aria-label": i.blankPlaceholder === "answer-line" ?
|
|
8114
|
+
"aria-label": i.blankPlaceholder === "answer-line" ? ml(r + 1, t) : void 0,
|
|
7904
8115
|
className: s["blank-field"],
|
|
7905
8116
|
children: i.blankPlaceholder === "answer-line" ? null : `${n.blankLabel} ${r + 1}`
|
|
7906
8117
|
})
|
|
7907
|
-
},
|
|
8118
|
+
}, od(e, r)))
|
|
7908
8119
|
}), r ? /* @__PURE__ */ a(Y, {
|
|
7909
8120
|
groups: u,
|
|
7910
8121
|
title: n.standardAnswer
|
|
7911
8122
|
}) : null]
|
|
7912
8123
|
});
|
|
7913
8124
|
}
|
|
7914
|
-
function
|
|
8125
|
+
function od(e, t) {
|
|
7915
8126
|
return e || `blank-${t + 1}`;
|
|
7916
8127
|
}
|
|
7917
8128
|
//#endregion
|
|
7918
8129
|
//#region src/question/renderers/QuestionClassificationView.tsx
|
|
7919
|
-
function
|
|
8130
|
+
function sd({ item: e, messages: t, showAnswer: n }) {
|
|
7920
8131
|
let { classification: r, renderer: i } = K();
|
|
7921
8132
|
return /* @__PURE__ */ o("div", {
|
|
7922
8133
|
className: i.element,
|
|
7923
8134
|
children: [/* @__PURE__ */ o("div", {
|
|
7924
8135
|
className: r.board,
|
|
7925
|
-
children: [/* @__PURE__ */ a(
|
|
8136
|
+
children: [/* @__PURE__ */ a(wu, {
|
|
7926
8137
|
className: r.zones,
|
|
7927
8138
|
columnCount: 2,
|
|
7928
8139
|
children: e.categories.map((e) => /* @__PURE__ */ o("section", {
|
|
@@ -7935,7 +8146,7 @@ function Ku({ item: e, messages: t, showAnswer: n }) {
|
|
|
7935
8146
|
children: t.unassigned
|
|
7936
8147
|
})]
|
|
7937
8148
|
}, e.id))
|
|
7938
|
-
}), /* @__PURE__ */ a(
|
|
8149
|
+
}), /* @__PURE__ */ a(wu, {
|
|
7939
8150
|
className: r.pool,
|
|
7940
8151
|
columnCount: Math.min(e.items.length, 4),
|
|
7941
8152
|
children: e.items.map((e) => /* @__PURE__ */ a("div", {
|
|
@@ -7944,15 +8155,15 @@ function Ku({ item: e, messages: t, showAnswer: n }) {
|
|
|
7944
8155
|
}, e.id))
|
|
7945
8156
|
})]
|
|
7946
8157
|
}), n ? /* @__PURE__ */ a(Y, {
|
|
7947
|
-
groups:
|
|
8158
|
+
groups: Rl(e),
|
|
7948
8159
|
title: t.standardAnswer
|
|
7949
8160
|
}) : null]
|
|
7950
8161
|
});
|
|
7951
8162
|
}
|
|
7952
8163
|
//#endregion
|
|
7953
8164
|
//#region src/question/renderers/QuestionFillTextView.tsx
|
|
7954
|
-
function
|
|
7955
|
-
let s = W(), { renderer: c } = K(), l = An(t, e, !0), u =
|
|
8165
|
+
function cd({ element: e, item: t, locale: n, messages: r, showAnswer: i }) {
|
|
8166
|
+
let s = W(), { renderer: c } = K(), l = An(t, e, !0), u = sl(l), d = s.answerGroupLayout === "rows" ? nd(u, l.blanks, n) : u.map((e, t) => ({
|
|
7956
8167
|
kind: "detailed",
|
|
7957
8168
|
contents: e.contents.map((e, n) => /* @__PURE__ */ a(J, { content: e }, `group-${t}-answer-${n}`)),
|
|
7958
8169
|
marker: s.blankAnswerMarker(e.blankIds, l.blanks, n, r.blankLabel)
|
|
@@ -7961,7 +8172,7 @@ function qu({ element: e, item: t, locale: n, messages: r, showAnswer: i }) {
|
|
|
7961
8172
|
className: c.element,
|
|
7962
8173
|
children: [
|
|
7963
8174
|
/* @__PURE__ */ a(J, { content: l.content }),
|
|
7964
|
-
|
|
8175
|
+
ld(l, s.candidateLayout === "labeled-groups" ? /* @__PURE__ */ a("span", {
|
|
7965
8176
|
className: c["section-title"],
|
|
7966
8177
|
children: r.candidateOptions
|
|
7967
8178
|
}) : null, c, s.candidateLayout, s.markerSuffix),
|
|
@@ -7972,14 +8183,14 @@ function qu({ element: e, item: t, locale: n, messages: r, showAnswer: i }) {
|
|
|
7972
8183
|
]
|
|
7973
8184
|
});
|
|
7974
8185
|
}
|
|
7975
|
-
function
|
|
8186
|
+
function ld(e, t, n, r, i) {
|
|
7976
8187
|
var s, c;
|
|
7977
8188
|
let l = (s = e.candidateOptions) == null ? [] : s, u = (c = e.blankOptionGroups) == null ? [] : c;
|
|
7978
8189
|
return !l.length && !u.length ? null : r === "plain-list" && l.length > 0 ? /* @__PURE__ */ a("div", {
|
|
7979
8190
|
className: n["candidate-section"],
|
|
7980
|
-
children: /* @__PURE__ */ a(
|
|
8191
|
+
children: /* @__PURE__ */ a(Ml, {
|
|
7981
8192
|
className: n["candidate-list"],
|
|
7982
|
-
children: l.map((e, t) => /* @__PURE__ */ o(
|
|
8193
|
+
children: l.map((e, t) => /* @__PURE__ */ o(Nl, {
|
|
7983
8194
|
className: n["candidate-item"],
|
|
7984
8195
|
children: [/* @__PURE__ */ a("span", {
|
|
7985
8196
|
className: n.marker,
|
|
@@ -7989,21 +8200,21 @@ function Ju(e, t, n, r, i) {
|
|
|
7989
8200
|
})
|
|
7990
8201
|
}) : /* @__PURE__ */ o("div", {
|
|
7991
8202
|
className: n["candidate-section"],
|
|
7992
|
-
children: [t, l.length > 0 ? /* @__PURE__ */ a(
|
|
8203
|
+
children: [t, l.length > 0 ? /* @__PURE__ */ a(Eu, { children: l.map((e, t) => /* @__PURE__ */ o(Nl, {
|
|
7993
8204
|
className: n["candidate-item"],
|
|
7994
8205
|
children: [/* @__PURE__ */ o("span", {
|
|
7995
8206
|
className: n.marker,
|
|
7996
8207
|
children: [un("upperAlpha", t), i]
|
|
7997
8208
|
}), /* @__PURE__ */ a(J, { content: e.content })]
|
|
7998
|
-
}, e.optionId)) }) : /* @__PURE__ */ a(
|
|
8209
|
+
}, e.optionId)) }) : /* @__PURE__ */ a(Ml, {
|
|
7999
8210
|
className: n["candidate-list"],
|
|
8000
8211
|
dataCandidateLayout: "per-blank",
|
|
8001
|
-
children: u.map((e, t) => /* @__PURE__ */ o(
|
|
8212
|
+
children: u.map((e, t) => /* @__PURE__ */ o(Nl, {
|
|
8002
8213
|
className: n["candidate-item"],
|
|
8003
8214
|
children: [/* @__PURE__ */ o("span", {
|
|
8004
8215
|
className: r === "plain-list" ? n["section-title"] : n.marker,
|
|
8005
8216
|
children: [t + 1, "."]
|
|
8006
|
-
}), /* @__PURE__ */ a(
|
|
8217
|
+
}), /* @__PURE__ */ a(Eu, { children: e.options.map((e, t) => /* @__PURE__ */ o(Nl, {
|
|
8007
8218
|
className: n["candidate-item"],
|
|
8008
8219
|
children: [r === "plain-list" ? /* @__PURE__ */ a("span", {
|
|
8009
8220
|
className: n.marker,
|
|
@@ -8016,7 +8227,7 @@ function Ju(e, t, n, r, i) {
|
|
|
8016
8227
|
}
|
|
8017
8228
|
//#endregion
|
|
8018
8229
|
//#region src/question/renderers/QuestionJudgementGroupView.tsx
|
|
8019
|
-
function
|
|
8230
|
+
function ud({ element: e, item: t, messages: n, showAnswer: r, stem: i }) {
|
|
8020
8231
|
let { renderer: s } = K(), c = mn(e.config.judgeAnswerMode), l = [{
|
|
8021
8232
|
kind: "detailed",
|
|
8022
8233
|
contents: hn(e.config.judgeAnswerMode, t.answers),
|
|
@@ -8033,11 +8244,11 @@ function Yu({ element: e, item: t, messages: n, showAnswer: r, stem: i }) {
|
|
|
8033
8244
|
className: s["judgement-placeholder"],
|
|
8034
8245
|
children: "\uff08\u3000\uff09"
|
|
8035
8246
|
})]
|
|
8036
|
-
}) : /* @__PURE__ */ a(
|
|
8247
|
+
}) : /* @__PURE__ */ a(wu, {
|
|
8037
8248
|
className: s["judgement-list"],
|
|
8038
8249
|
columnCount: 2,
|
|
8039
8250
|
role: "list",
|
|
8040
|
-
children: c.map(({ label: e, value: t }) => /* @__PURE__ */ a(
|
|
8251
|
+
children: c.map(({ label: e, value: t }) => /* @__PURE__ */ a(Nl, {
|
|
8041
8252
|
className: s["judgement-item"],
|
|
8042
8253
|
children: e
|
|
8043
8254
|
}, String(t)))
|
|
@@ -8049,13 +8260,13 @@ function Yu({ element: e, item: t, messages: n, showAnswer: r, stem: i }) {
|
|
|
8049
8260
|
}
|
|
8050
8261
|
//#endregion
|
|
8051
8262
|
//#region src/question/renderers/QuestionLineConnectView.tsx
|
|
8052
|
-
function
|
|
8263
|
+
function dd({ item: e, messages: t, showAnswer: n }) {
|
|
8053
8264
|
let { lineConnectColumnTitleVisibility: r, markerSuffix: i } = W(), { lineConnect: s, renderer: c } = K();
|
|
8054
8265
|
return /* @__PURE__ */ o("div", {
|
|
8055
8266
|
className: c.element,
|
|
8056
8267
|
children: [/* @__PURE__ */ a("div", {
|
|
8057
8268
|
className: s.board,
|
|
8058
|
-
children: /* @__PURE__ */ a(
|
|
8269
|
+
children: /* @__PURE__ */ a(wu, {
|
|
8059
8270
|
className: s.columns,
|
|
8060
8271
|
columnCount: e.columns.length,
|
|
8061
8272
|
style: { gridTemplateColumns: `repeat(${e.columns.length}, minmax(12rem, 1fr))` },
|
|
@@ -8081,20 +8292,20 @@ function Xu({ item: e, messages: t, showAnswer: n }) {
|
|
|
8081
8292
|
})
|
|
8082
8293
|
})
|
|
8083
8294
|
}), n ? /* @__PURE__ */ a(Y, {
|
|
8084
|
-
groups:
|
|
8295
|
+
groups: uu(e),
|
|
8085
8296
|
title: t.standardAnswer
|
|
8086
8297
|
}) : null]
|
|
8087
8298
|
});
|
|
8088
8299
|
}
|
|
8089
8300
|
//#endregion
|
|
8090
8301
|
//#region src/question/renderers/QuestionMatchingView.tsx
|
|
8091
|
-
function
|
|
8302
|
+
function fd({ item: e, messages: t, showAnswer: n }) {
|
|
8092
8303
|
let { markerSuffix: r, matchingAnswerLayout: i } = W(), { matching: s, renderer: c } = K();
|
|
8093
8304
|
return /* @__PURE__ */ o("div", {
|
|
8094
8305
|
className: c.element,
|
|
8095
8306
|
children: [/* @__PURE__ */ a("div", {
|
|
8096
8307
|
className: s.board,
|
|
8097
|
-
children: /* @__PURE__ */ a(
|
|
8308
|
+
children: /* @__PURE__ */ a(wu, {
|
|
8098
8309
|
className: s.columns,
|
|
8099
8310
|
columnCount: e.columns.length,
|
|
8100
8311
|
children: e.columns.map((e) => /* @__PURE__ */ a("section", {
|
|
@@ -8112,15 +8323,15 @@ function Zu({ item: e, messages: t, showAnswer: n }) {
|
|
|
8112
8323
|
}, e.columnId))
|
|
8113
8324
|
})
|
|
8114
8325
|
}), n ? /* @__PURE__ */ a(Y, {
|
|
8115
|
-
groups: i === "marker-path" ?
|
|
8326
|
+
groups: i === "marker-path" ? hu(e) : mu(e),
|
|
8116
8327
|
title: t.standardAnswer
|
|
8117
8328
|
}) : null]
|
|
8118
8329
|
});
|
|
8119
8330
|
}
|
|
8120
8331
|
//#endregion
|
|
8121
8332
|
//#region src/question/renderers/QuestionOptionGroupView.tsx
|
|
8122
|
-
function
|
|
8123
|
-
let { markerSuffix: s, optionStandardAnswer: c } = W(), { renderer: l, table: u } = K(), d = gn(t, e.config.optionLabelStyle), f =
|
|
8333
|
+
function pd({ element: e, item: t, locale: n, messages: r, showAnswer: i }) {
|
|
8334
|
+
let { markerSuffix: s, optionStandardAnswer: c } = W(), { renderer: l, table: u } = K(), d = gn(t, e.config.optionLabelStyle), f = bu(e, t), p = c === "value-only" ? md(f.map((e) => e.marker), n) : f;
|
|
8124
8335
|
return e.config.renderer === "table" ? /* @__PURE__ */ o("div", {
|
|
8125
8336
|
className: l.element,
|
|
8126
8337
|
children: [/* @__PURE__ */ a("div", {
|
|
@@ -8142,7 +8353,7 @@ function Qu({ element: e, item: t, locale: n, messages: r, showAnswer: i }) {
|
|
|
8142
8353
|
}) : null]
|
|
8143
8354
|
}) : /* @__PURE__ */ o("div", {
|
|
8144
8355
|
className: l.element,
|
|
8145
|
-
children: [/* @__PURE__ */ a(
|
|
8356
|
+
children: [/* @__PURE__ */ a(Eu, { children: d.map((e) => /* @__PURE__ */ o(Nl, {
|
|
8146
8357
|
className: l["option-item"],
|
|
8147
8358
|
children: [/* @__PURE__ */ o("span", {
|
|
8148
8359
|
className: l.marker,
|
|
@@ -8154,7 +8365,7 @@ function Qu({ element: e, item: t, locale: n, messages: r, showAnswer: i }) {
|
|
|
8154
8365
|
}) : null]
|
|
8155
8366
|
});
|
|
8156
8367
|
}
|
|
8157
|
-
function
|
|
8368
|
+
function md(e, t) {
|
|
8158
8369
|
let n = e.filter(Boolean).join(t === "zh-CN" ? "\uff1b" : "; ");
|
|
8159
8370
|
return n ? [{
|
|
8160
8371
|
contents: [n],
|
|
@@ -8164,13 +8375,13 @@ function $u(e, t) {
|
|
|
8164
8375
|
}
|
|
8165
8376
|
//#endregion
|
|
8166
8377
|
//#region src/question/renderers/QuestionOrderingView.tsx
|
|
8167
|
-
function
|
|
8378
|
+
function hd({ item: e, messages: t, showAnswer: n }) {
|
|
8168
8379
|
let { markerSuffix: r } = W(), { renderer: i } = K();
|
|
8169
8380
|
return /* @__PURE__ */ o("div", {
|
|
8170
8381
|
className: i.element,
|
|
8171
|
-
children: [/* @__PURE__ */ a(
|
|
8382
|
+
children: [/* @__PURE__ */ a(Ml, {
|
|
8172
8383
|
className: i["option-list"],
|
|
8173
|
-
children: e.sortOptions.map((e, t) => /* @__PURE__ */ o(
|
|
8384
|
+
children: e.sortOptions.map((e, t) => /* @__PURE__ */ o(Nl, {
|
|
8174
8385
|
className: i["option-item"],
|
|
8175
8386
|
children: [/* @__PURE__ */ o("span", {
|
|
8176
8387
|
className: i.marker,
|
|
@@ -8178,22 +8389,39 @@ function ed({ item: e, messages: t, showAnswer: n }) {
|
|
|
8178
8389
|
}), /* @__PURE__ */ a(J, { content: e.content })]
|
|
8179
8390
|
}, e.id))
|
|
8180
8391
|
}), n ? /* @__PURE__ */ a(Y, {
|
|
8181
|
-
groups:
|
|
8392
|
+
groups: Mu(e),
|
|
8182
8393
|
title: t.standardAnswer
|
|
8183
8394
|
}) : null]
|
|
8184
8395
|
});
|
|
8185
8396
|
}
|
|
8186
8397
|
//#endregion
|
|
8398
|
+
//#region src/question/renderers/QuestionTextMarkerView.tsx
|
|
8399
|
+
function gd({ item: e, messages: t, showAnswer: n }) {
|
|
8400
|
+
let r = Et(e.content.json).filter((t) => e.answers.includes(t.markerId)).map((e) => e.text);
|
|
8401
|
+
return /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(Pu, {
|
|
8402
|
+
answerMarkers: e.answers,
|
|
8403
|
+
content: e.content,
|
|
8404
|
+
showAnswer: n
|
|
8405
|
+
}), n ? /* @__PURE__ */ a(Y, {
|
|
8406
|
+
groups: [{
|
|
8407
|
+
kind: "detailed",
|
|
8408
|
+
contents: r,
|
|
8409
|
+
marker: t.standardAnswer
|
|
8410
|
+
}],
|
|
8411
|
+
title: t.standardAnswer
|
|
8412
|
+
}) : null] });
|
|
8413
|
+
}
|
|
8414
|
+
//#endregion
|
|
8187
8415
|
//#region src/question/renderers/QuestionWordBuilderView.tsx
|
|
8188
|
-
function
|
|
8189
|
-
let s = W(), { renderer: c } = K(), l = kn(t, !0, e), u =
|
|
8416
|
+
function _d({ element: e, item: t, locale: n, messages: r, showAnswer: i }) {
|
|
8417
|
+
let s = W(), { renderer: c } = K(), l = kn(t, !0, e), u = zu(l, (e, t) => s.blankAnswerMarker(e, t, n, r.blankLabel));
|
|
8190
8418
|
return /* @__PURE__ */ o("div", {
|
|
8191
8419
|
className: c.element,
|
|
8192
8420
|
children: [
|
|
8193
|
-
/* @__PURE__ */ a(
|
|
8421
|
+
/* @__PURE__ */ a(Vl, {
|
|
8194
8422
|
content: l.content,
|
|
8195
8423
|
renderBlank: ({ blankId: e, index: t, label: i }) => /* @__PURE__ */ a("span", {
|
|
8196
|
-
"aria-label": s.blankPlaceholder === "answer-line" ?
|
|
8424
|
+
"aria-label": s.blankPlaceholder === "answer-line" ? ml(t + 1, n) : i || `${r.blankLabel}${t + 1}`,
|
|
8197
8425
|
className: c["word-builder-blank"],
|
|
8198
8426
|
"data-blank-id": e
|
|
8199
8427
|
})
|
|
@@ -8203,11 +8431,11 @@ function td({ element: e, item: t, locale: n, messages: r, showAnswer: i }) {
|
|
|
8203
8431
|
children: [/* @__PURE__ */ a("span", {
|
|
8204
8432
|
className: c["section-title"],
|
|
8205
8433
|
children: r.candidateOptions
|
|
8206
|
-
}), /* @__PURE__ */ a(
|
|
8434
|
+
}), /* @__PURE__ */ a(wu, {
|
|
8207
8435
|
className: c["word-builder-candidate-list"],
|
|
8208
8436
|
columnCount: Math.min(l.candidateOptions.length, 4),
|
|
8209
8437
|
role: "list",
|
|
8210
|
-
children: l.candidateOptions.map((e, t) => /* @__PURE__ */ a(
|
|
8438
|
+
children: l.candidateOptions.map((e, t) => /* @__PURE__ */ a(Nl, {
|
|
8211
8439
|
className: c["candidate-item"],
|
|
8212
8440
|
children: e
|
|
8213
8441
|
}, `${e}-${t}`))
|
|
@@ -8222,25 +8450,25 @@ function td({ element: e, item: t, locale: n, messages: r, showAnswer: i }) {
|
|
|
8222
8450
|
}
|
|
8223
8451
|
//#endregion
|
|
8224
8452
|
//#region src/question/renderers/QuestionContentElementView.tsx
|
|
8225
|
-
function
|
|
8453
|
+
function vd({ element: e, item: t, judgementStem: n, locale: r, messages: i, showAnswer: o }) {
|
|
8226
8454
|
let { textResponseVisibility: s } = W(), { textResponse: c } = K();
|
|
8227
8455
|
if (e.type !== t.type) throw Error(`\u9898\u76ee\u5143\u7d20\u7ed3\u6784\u4e0d\u5339\u914d\uff0cexpected=${e.type}\uff0cactual=${t.type}`);
|
|
8228
|
-
return e.type === "richText" ? /* @__PURE__ */ a(J, { content: t.content }) : e.type === "textResponse" ? s === "hidden" ? null : /* @__PURE__ */ a(
|
|
8456
|
+
return e.type === "richText" ? /* @__PURE__ */ a(J, { content: t.content }) : e.type === "textResponse" ? s === "hidden" ? null : /* @__PURE__ */ a(td, {
|
|
8229
8457
|
className: c.placeholder,
|
|
8230
8458
|
label: i.textResponsePlaceholder
|
|
8231
|
-
}) : e.type === "ordering" ? /* @__PURE__ */ a(
|
|
8459
|
+
}) : e.type === "ordering" ? /* @__PURE__ */ a(hd, {
|
|
8232
8460
|
item: t,
|
|
8233
8461
|
messages: i,
|
|
8234
8462
|
showAnswer: o
|
|
8235
|
-
}) : e.type === "classification" ? /* @__PURE__ */ a(
|
|
8463
|
+
}) : e.type === "classification" ? /* @__PURE__ */ a(sd, {
|
|
8236
8464
|
item: t,
|
|
8237
8465
|
messages: i,
|
|
8238
8466
|
showAnswer: o
|
|
8239
|
-
}) : e.type === "textMarker" ? /* @__PURE__ */ a(
|
|
8467
|
+
}) : e.type === "textMarker" ? /* @__PURE__ */ a(gd, {
|
|
8240
8468
|
item: t,
|
|
8241
8469
|
messages: i,
|
|
8242
8470
|
showAnswer: o
|
|
8243
|
-
}) :
|
|
8471
|
+
}) : yd({
|
|
8244
8472
|
element: e,
|
|
8245
8473
|
item: t,
|
|
8246
8474
|
judgementStem: n,
|
|
@@ -8249,48 +8477,48 @@ function nd({ element: e, item: t, judgementStem: n, locale: r, messages: i, sho
|
|
|
8249
8477
|
showAnswer: o
|
|
8250
8478
|
});
|
|
8251
8479
|
}
|
|
8252
|
-
function
|
|
8480
|
+
function yd({ element: e, item: t, judgementStem: n, locale: r, messages: i, showAnswer: o }) {
|
|
8253
8481
|
switch (e.type) {
|
|
8254
|
-
case "choice": return /* @__PURE__ */ a(
|
|
8482
|
+
case "choice": return /* @__PURE__ */ a(pd, {
|
|
8255
8483
|
element: e,
|
|
8256
8484
|
item: t,
|
|
8257
8485
|
locale: r,
|
|
8258
8486
|
messages: i,
|
|
8259
8487
|
showAnswer: o
|
|
8260
8488
|
});
|
|
8261
|
-
case "fill": return /* @__PURE__ */ a(
|
|
8489
|
+
case "fill": return /* @__PURE__ */ a(ad, {
|
|
8262
8490
|
item: t,
|
|
8263
8491
|
locale: r,
|
|
8264
8492
|
messages: i,
|
|
8265
8493
|
showAnswer: o
|
|
8266
8494
|
});
|
|
8267
|
-
case "inlineFill": return /* @__PURE__ */ a(
|
|
8495
|
+
case "inlineFill": return /* @__PURE__ */ a(cd, {
|
|
8268
8496
|
element: e,
|
|
8269
8497
|
item: t,
|
|
8270
8498
|
locale: r,
|
|
8271
8499
|
messages: i,
|
|
8272
8500
|
showAnswer: o
|
|
8273
8501
|
});
|
|
8274
|
-
case "wordBuilder": return /* @__PURE__ */ a(
|
|
8502
|
+
case "wordBuilder": return /* @__PURE__ */ a(_d, {
|
|
8275
8503
|
element: e,
|
|
8276
8504
|
item: t,
|
|
8277
8505
|
locale: r,
|
|
8278
8506
|
messages: i,
|
|
8279
8507
|
showAnswer: o
|
|
8280
8508
|
});
|
|
8281
|
-
case "judgement": return /* @__PURE__ */ a(
|
|
8509
|
+
case "judgement": return /* @__PURE__ */ a(ud, {
|
|
8282
8510
|
element: e,
|
|
8283
8511
|
item: t,
|
|
8284
8512
|
stem: n,
|
|
8285
8513
|
messages: i,
|
|
8286
8514
|
showAnswer: o
|
|
8287
8515
|
});
|
|
8288
|
-
case "lineConnect": return /* @__PURE__ */ a(
|
|
8516
|
+
case "lineConnect": return /* @__PURE__ */ a(dd, {
|
|
8289
8517
|
item: t,
|
|
8290
8518
|
messages: i,
|
|
8291
8519
|
showAnswer: o
|
|
8292
8520
|
});
|
|
8293
|
-
case "matching": return /* @__PURE__ */ a(
|
|
8521
|
+
case "matching": return /* @__PURE__ */ a(fd, {
|
|
8294
8522
|
item: t,
|
|
8295
8523
|
messages: i,
|
|
8296
8524
|
showAnswer: o
|
|
@@ -8299,7 +8527,7 @@ function rd({ element: e, item: t, judgementStem: n, locale: r, messages: i, sho
|
|
|
8299
8527
|
}
|
|
8300
8528
|
//#endregion
|
|
8301
8529
|
//#region src/question/preview/question-preview-layout.ts
|
|
8302
|
-
var
|
|
8530
|
+
var bd = l({
|
|
8303
8531
|
root: "_root_13x11_1",
|
|
8304
8532
|
empty: "_empty_13x11_17",
|
|
8305
8533
|
"element-list": "_element-list_13x11_29",
|
|
@@ -8308,13 +8536,13 @@ var id = l({
|
|
|
8308
8536
|
extra: "_extra_13x11_40",
|
|
8309
8537
|
child: "_child_13x11_30"
|
|
8310
8538
|
});
|
|
8311
|
-
function
|
|
8312
|
-
return d(
|
|
8539
|
+
function xd() {
|
|
8540
|
+
return d(bd);
|
|
8313
8541
|
}
|
|
8314
8542
|
//#endregion
|
|
8315
8543
|
//#region src/question/preview/QuestionCompositePreview.tsx
|
|
8316
|
-
function
|
|
8317
|
-
let o =
|
|
8544
|
+
function Sd({ childIndexPath: e = [], messages: t, renderChild: n, rootQuestionNumber: r, value: i }) {
|
|
8545
|
+
let o = xd();
|
|
8318
8546
|
return i.children.length === 0 ? /* @__PURE__ */ a("div", {
|
|
8319
8547
|
className: o.empty,
|
|
8320
8548
|
children: t.previewEmpty
|
|
@@ -8335,12 +8563,12 @@ function od({ childIndexPath: e = [], messages: t, renderChild: n, rootQuestionN
|
|
|
8335
8563
|
}
|
|
8336
8564
|
//#endregion
|
|
8337
8565
|
//#region src/question/preview/QuestionPreviewContent.tsx
|
|
8338
|
-
var
|
|
8339
|
-
function
|
|
8340
|
-
let { locale: t = "zh-CN" } = e, n = Oa(e,
|
|
8341
|
-
return /* @__PURE__ */ a(
|
|
8566
|
+
var Cd = ["locale"];
|
|
8567
|
+
function wd(e) {
|
|
8568
|
+
let { locale: t = "zh-CN" } = e, n = Oa(e, Cd), r = ks(n.value, n.questionTypeTemplates);
|
|
8569
|
+
return /* @__PURE__ */ a(Sl.Provider, {
|
|
8342
8570
|
value: t,
|
|
8343
|
-
children: /* @__PURE__ */ a(
|
|
8571
|
+
children: /* @__PURE__ */ a(Td, j(j({}, n), {}, {
|
|
8344
8572
|
childIndexPath: [],
|
|
8345
8573
|
locale: t,
|
|
8346
8574
|
messages: Bc(t),
|
|
@@ -8348,8 +8576,8 @@ function cd(e) {
|
|
|
8348
8576
|
}))
|
|
8349
8577
|
});
|
|
8350
8578
|
}
|
|
8351
|
-
function
|
|
8352
|
-
let p =
|
|
8579
|
+
function Td({ childIndexPath: e, className: t, locale: n, messages: r, presentation: s, rootQuestionNumber: c, showAnswer: l = !1, showExtraAttributes: u = !1, questionTypeTemplates: d, value: f }) {
|
|
8580
|
+
let p = xd(), m = da(d, f);
|
|
8353
8581
|
if (!m) return /* @__PURE__ */ a("div", {
|
|
8354
8582
|
className: U(p.root, t),
|
|
8355
8583
|
"data-locale": n,
|
|
@@ -8363,11 +8591,11 @@ function ld({ childIndexPath: e, className: t, locale: n, messages: r, presentat
|
|
|
8363
8591
|
className: p["element-list"],
|
|
8364
8592
|
children: m.elements.map((e, t) => {
|
|
8365
8593
|
var i;
|
|
8366
|
-
if (s === "print" && e.type === "richText" && ((i =
|
|
8367
|
-
let o = cn(f, t, e), c = s === "print" ?
|
|
8594
|
+
if (s === "print" && e.type === "richText" && ((i = Dd(m.elements, t + 1)) == null ? void 0 : i.type) === "judgement") return null;
|
|
8595
|
+
let o = cn(f, t, e), c = s === "print" ? Ed(m, f, t) : void 0;
|
|
8368
8596
|
return /* @__PURE__ */ a("section", {
|
|
8369
8597
|
className: p.element,
|
|
8370
|
-
children: /* @__PURE__ */ a(
|
|
8598
|
+
children: /* @__PURE__ */ a(vd, {
|
|
8371
8599
|
element: e,
|
|
8372
8600
|
item: o,
|
|
8373
8601
|
judgementStem: c,
|
|
@@ -8383,19 +8611,19 @@ function ld({ childIndexPath: e, className: t, locale: n, messages: r, presentat
|
|
|
8383
8611
|
let i = ln(f, t, e);
|
|
8384
8612
|
return F(i.content) ? null : /* @__PURE__ */ o("section", {
|
|
8385
8613
|
className: p.extra,
|
|
8386
|
-
children: [/* @__PURE__ */ a(
|
|
8387
|
-
element:
|
|
8388
|
-
item:
|
|
8614
|
+
children: [/* @__PURE__ */ a(Al, { children: e.name }), /* @__PURE__ */ a(vd, {
|
|
8615
|
+
element: kd(e),
|
|
8616
|
+
item: Ad(i),
|
|
8389
8617
|
locale: n,
|
|
8390
8618
|
messages: r,
|
|
8391
8619
|
showAnswer: !1
|
|
8392
8620
|
})]
|
|
8393
8621
|
}, `${e.type}-${t}`);
|
|
8394
8622
|
})
|
|
8395
|
-
}) : null, _ = f.children.length === 0 ? null : /* @__PURE__ */ a(
|
|
8623
|
+
}) : null, _ = f.children.length === 0 ? null : /* @__PURE__ */ a(Sd, {
|
|
8396
8624
|
childIndexPath: e,
|
|
8397
8625
|
messages: r,
|
|
8398
|
-
renderChild: (e, t) => /* @__PURE__ */ a(
|
|
8626
|
+
renderChild: (e, t) => /* @__PURE__ */ a(Td, {
|
|
8399
8627
|
childIndexPath: t,
|
|
8400
8628
|
locale: n,
|
|
8401
8629
|
messages: r,
|
|
@@ -8413,7 +8641,7 @@ function ld({ childIndexPath: e, className: t, locale: n, messages: r, presentat
|
|
|
8413
8641
|
className: U(p.root, t),
|
|
8414
8642
|
"data-locale": n,
|
|
8415
8643
|
"data-question-presentation": s,
|
|
8416
|
-
children:
|
|
8644
|
+
children: Od(m, f) ? /* @__PURE__ */ a("div", {
|
|
8417
8645
|
className: p.empty,
|
|
8418
8646
|
children: r.previewEmpty
|
|
8419
8647
|
}) : /* @__PURE__ */ o(i, { children: [
|
|
@@ -8423,24 +8651,24 @@ function ld({ childIndexPath: e, className: t, locale: n, messages: r, presentat
|
|
|
8423
8651
|
] })
|
|
8424
8652
|
});
|
|
8425
8653
|
}
|
|
8426
|
-
function
|
|
8427
|
-
let r =
|
|
8654
|
+
function Ed(e, t, n) {
|
|
8655
|
+
let r = Dd(e.elements, n), i = Dd(e.elements, n - 1);
|
|
8428
8656
|
if (!((r == null ? void 0 : r.type) !== "judgement" || (i == null ? void 0 : i.type) !== "richText")) return cn(t, n - 1, i).content;
|
|
8429
8657
|
}
|
|
8430
|
-
function
|
|
8658
|
+
function Dd(e, t) {
|
|
8431
8659
|
return t >= 0 ? e.slice(t, t + 1)[0] : void 0;
|
|
8432
8660
|
}
|
|
8433
|
-
function
|
|
8661
|
+
function Od(e, t) {
|
|
8434
8662
|
return t.elements.length === 0 && t.extras.length === 0 && t.children.length === 0;
|
|
8435
8663
|
}
|
|
8436
|
-
function
|
|
8664
|
+
function kd(e) {
|
|
8437
8665
|
return {
|
|
8438
8666
|
config: {},
|
|
8439
8667
|
name: e.name,
|
|
8440
8668
|
type: "richText"
|
|
8441
8669
|
};
|
|
8442
8670
|
}
|
|
8443
|
-
function
|
|
8671
|
+
function Ad(e) {
|
|
8444
8672
|
return {
|
|
8445
8673
|
content: e.content,
|
|
8446
8674
|
type: "richText"
|
|
@@ -8448,12 +8676,12 @@ function md(e) {
|
|
|
8448
8676
|
}
|
|
8449
8677
|
//#endregion
|
|
8450
8678
|
//#region src/question/preview/QuestionPreview.tsx
|
|
8451
|
-
function
|
|
8452
|
-
return /* @__PURE__ */ a(
|
|
8679
|
+
function jd(e) {
|
|
8680
|
+
return /* @__PURE__ */ a(wd, j(j({}, e), {}, { presentation: "preview" }));
|
|
8453
8681
|
}
|
|
8454
8682
|
//#endregion
|
|
8455
8683
|
//#region src/question/preview/QuestionPrintAnswer.module.css
|
|
8456
|
-
var
|
|
8684
|
+
var Md = {
|
|
8457
8685
|
"answer-panel": "_answer-panel_1yaiz_1",
|
|
8458
8686
|
"answer-list": "_answer-list_1yaiz_8",
|
|
8459
8687
|
"answer-row": "_answer-row_1yaiz_20",
|
|
@@ -8461,11 +8689,11 @@ var gd = {
|
|
|
8461
8689
|
"answer-marker-only": "_answer-marker-only_1yaiz_39",
|
|
8462
8690
|
"answer-content-list": "_answer-content-list_1yaiz_43",
|
|
8463
8691
|
"answer-value": "_answer-value_1yaiz_49"
|
|
8464
|
-
},
|
|
8692
|
+
}, Nd = {
|
|
8465
8693
|
"blank-list": "_blank-list_14bj2_1",
|
|
8466
8694
|
"blank-item": "_blank-item_14bj2_9",
|
|
8467
8695
|
"blank-field": "_blank-field_14bj2_15"
|
|
8468
|
-
},
|
|
8696
|
+
}, Pd = {
|
|
8469
8697
|
board: "_board_fqylx_1",
|
|
8470
8698
|
pool: "_pool_fqylx_5",
|
|
8471
8699
|
zones: "_zones_fqylx_11",
|
|
@@ -8473,17 +8701,17 @@ var gd = {
|
|
|
8473
8701
|
"zone-title": "_zone-title_fqylx_22",
|
|
8474
8702
|
item: "_item_fqylx_28",
|
|
8475
8703
|
empty: "_empty_fqylx_34"
|
|
8476
|
-
},
|
|
8704
|
+
}, Fd = {
|
|
8477
8705
|
board: "_board_1qh77_1",
|
|
8478
8706
|
columns: "_columns_1qh77_6",
|
|
8479
8707
|
"column-title": "_column-title_1qh77_11"
|
|
8480
|
-
},
|
|
8708
|
+
}, Id = {
|
|
8481
8709
|
board: "_board_rmc9z_1",
|
|
8482
8710
|
columns: "_columns_rmc9z_5"
|
|
8483
|
-
},
|
|
8711
|
+
}, Ld = {
|
|
8484
8712
|
media: "_media_a9b7d_1",
|
|
8485
8713
|
"math-inline": "_math-inline_a9b7d_9"
|
|
8486
|
-
},
|
|
8714
|
+
}, Rd = {
|
|
8487
8715
|
"rich-content": "_rich-content_6llgo_1",
|
|
8488
8716
|
element: "_element_6llgo_61",
|
|
8489
8717
|
"option-list": "_option-list_6llgo_63",
|
|
@@ -8502,34 +8730,34 @@ var gd = {
|
|
|
8502
8730
|
"section-title": "_section-title_6llgo_142",
|
|
8503
8731
|
"word-builder-blank": "_word-builder-blank_6llgo_148",
|
|
8504
8732
|
"word-builder-candidate-list": "_word-builder-candidate-list_6llgo_162"
|
|
8505
|
-
},
|
|
8733
|
+
}, zd = { title: "_title_1csak_1" }, Bd = {
|
|
8506
8734
|
"table-wrap": "_table-wrap_1epdp_1",
|
|
8507
8735
|
table: "_table_1epdp_1",
|
|
8508
8736
|
"table-option-column": "_table-option-column_1epdp_13",
|
|
8509
8737
|
"table-option-marker": "_table-option-marker_1epdp_31"
|
|
8510
|
-
},
|
|
8738
|
+
}, Vd = {
|
|
8511
8739
|
content: "_content_1gnvb_1",
|
|
8512
8740
|
paragraph: "_paragraph_1gnvb_10",
|
|
8513
8741
|
marker: "_marker_1gnvb_14",
|
|
8514
8742
|
"marker-button": "_marker-button_1gnvb_21",
|
|
8515
8743
|
"marker-selected": "_marker-selected_1gnvb_30",
|
|
8516
8744
|
"marker-answer": "_marker-answer_1gnvb_31"
|
|
8517
|
-
},
|
|
8518
|
-
column:
|
|
8519
|
-
item:
|
|
8520
|
-
marker:
|
|
8521
|
-
},
|
|
8522
|
-
answer:
|
|
8523
|
-
blankGroup:
|
|
8524
|
-
classification:
|
|
8525
|
-
lineConnect: j(j({},
|
|
8526
|
-
matching: j(j({},
|
|
8527
|
-
renderer: j(j({},
|
|
8528
|
-
sectionTitle:
|
|
8529
|
-
table:
|
|
8530
|
-
textMarker:
|
|
8531
|
-
textResponse:
|
|
8532
|
-
},
|
|
8745
|
+
}, Hd = { placeholder: "_placeholder_np8ps_1" }, Ud = {
|
|
8746
|
+
column: Rd["labeled-column"],
|
|
8747
|
+
item: Rd["labeled-item"],
|
|
8748
|
+
marker: Rd["labeled-marker"]
|
|
8749
|
+
}, Wd = {
|
|
8750
|
+
answer: Md,
|
|
8751
|
+
blankGroup: Nd,
|
|
8752
|
+
classification: Pd,
|
|
8753
|
+
lineConnect: j(j({}, Fd), Ud),
|
|
8754
|
+
matching: j(j({}, Id), Ud),
|
|
8755
|
+
renderer: j(j({}, Rd), {}, { "rich-content": `${Rd["rich-content"]} ${Ld.media}` }),
|
|
8756
|
+
sectionTitle: zd,
|
|
8757
|
+
table: Bd,
|
|
8758
|
+
textMarker: Vd,
|
|
8759
|
+
textResponse: Hd
|
|
8760
|
+
}, Gd = {
|
|
8533
8761
|
root: "_root_1mvma_1",
|
|
8534
8762
|
empty: "_empty_1mvma_21",
|
|
8535
8763
|
"element-list": "_element-list_1mvma_29",
|
|
@@ -8540,19 +8768,19 @@ var gd = {
|
|
|
8540
8768
|
};
|
|
8541
8769
|
//#endregion
|
|
8542
8770
|
//#region src/question/preview/QuestionPrintPreview.tsx
|
|
8543
|
-
function
|
|
8544
|
-
return /* @__PURE__ */ a(
|
|
8545
|
-
value:
|
|
8546
|
-
children: /* @__PURE__ */ a(
|
|
8547
|
-
value:
|
|
8548
|
-
children: /* @__PURE__ */ a(
|
|
8549
|
-
value:
|
|
8550
|
-
children: /* @__PURE__ */ a(
|
|
8771
|
+
function Kd(e) {
|
|
8772
|
+
return /* @__PURE__ */ a(xl.Provider, {
|
|
8773
|
+
value: bl,
|
|
8774
|
+
children: /* @__PURE__ */ a(kl.Provider, {
|
|
8775
|
+
value: Wd,
|
|
8776
|
+
children: /* @__PURE__ */ a(bd.Provider, {
|
|
8777
|
+
value: Gd,
|
|
8778
|
+
children: /* @__PURE__ */ a(wd, j(j({}, e), {}, { presentation: "print" }))
|
|
8551
8779
|
})
|
|
8552
8780
|
})
|
|
8553
8781
|
});
|
|
8554
8782
|
}
|
|
8555
|
-
var
|
|
8783
|
+
var qd = {
|
|
8556
8784
|
root: "_root_17bqr_1",
|
|
8557
8785
|
toolbar: "_toolbar_17bqr_26",
|
|
8558
8786
|
"toolbar-title": "_toolbar-title_17bqr_36",
|
|
@@ -8604,7 +8832,7 @@ var jd = {
|
|
|
8604
8832
|
"palette-section": "_palette-section_vhj2r_56",
|
|
8605
8833
|
"palette-section-title": "_palette-section-title_vhj2r_62",
|
|
8606
8834
|
"palette-button": "_palette-button_vhj2r_70"
|
|
8607
|
-
},
|
|
8835
|
+
}, Jd = {
|
|
8608
8836
|
"en-US": {
|
|
8609
8837
|
addElement: "Add element",
|
|
8610
8838
|
addExtra: "Add extra attribute",
|
|
@@ -8826,24 +9054,24 @@ var jd = {
|
|
|
8826
9054
|
wordBuilderLabel: "\u7ec4\u8bcd\u62fc\u5199"
|
|
8827
9055
|
}
|
|
8828
9056
|
};
|
|
8829
|
-
function
|
|
9057
|
+
function Yd(e, t) {
|
|
8830
9058
|
var n;
|
|
8831
9059
|
return (n = e.extraDescriptions.get(t)) == null ? t : n;
|
|
8832
9060
|
}
|
|
8833
|
-
function
|
|
9061
|
+
function Xd(e, t) {
|
|
8834
9062
|
var n;
|
|
8835
9063
|
return (n = e.extraLabels.get(t)) == null ? t : n;
|
|
8836
9064
|
}
|
|
8837
|
-
function
|
|
9065
|
+
function Zd(e) {
|
|
8838
9066
|
switch (e) {
|
|
8839
|
-
case "en-US": return
|
|
8840
|
-
case "zh-CN": return
|
|
9067
|
+
case "en-US": return Jd["en-US"];
|
|
9068
|
+
case "zh-CN": return Jd["zh-CN"];
|
|
8841
9069
|
}
|
|
8842
9070
|
}
|
|
8843
|
-
function
|
|
8844
|
-
return t === "richText" ? e.richTextDescription : t === "ordering" ? e.orderingDescription :
|
|
9071
|
+
function Qd(e, t) {
|
|
9072
|
+
return t === "richText" ? e.richTextDescription : t === "ordering" ? e.orderingDescription : tf(e, t);
|
|
8845
9073
|
}
|
|
8846
|
-
var
|
|
9074
|
+
var $d = {
|
|
8847
9075
|
choice: (e) => e.optionGroupDescription,
|
|
8848
9076
|
classification: (e) => e.classificationDescription,
|
|
8849
9077
|
fill: (e) => e.blankGroupDescription,
|
|
@@ -8854,7 +9082,7 @@ var Ld = {
|
|
|
8854
9082
|
textMarker: (e) => e.textMarkerDescription,
|
|
8855
9083
|
textResponse: (e) => e.textResponseDescription,
|
|
8856
9084
|
wordBuilder: (e) => e.wordBuilderDescription
|
|
8857
|
-
},
|
|
9085
|
+
}, ef = {
|
|
8858
9086
|
choice: (e) => e.optionGroupLabel,
|
|
8859
9087
|
classification: (e) => e.classificationLabel,
|
|
8860
9088
|
fill: (e) => e.blankGroupLabel,
|
|
@@ -8866,30 +9094,30 @@ var Ld = {
|
|
|
8866
9094
|
textResponse: (e) => e.textResponseLabel,
|
|
8867
9095
|
wordBuilder: (e) => e.wordBuilderLabel
|
|
8868
9096
|
};
|
|
8869
|
-
function
|
|
8870
|
-
return
|
|
9097
|
+
function tf(e, t) {
|
|
9098
|
+
return $d[t](e);
|
|
8871
9099
|
}
|
|
8872
|
-
function
|
|
8873
|
-
return t === "richText" ? e.richTextLabel : t === "ordering" ? e.orderingLabel :
|
|
9100
|
+
function nf(e, t) {
|
|
9101
|
+
return t === "richText" ? e.richTextLabel : t === "ordering" ? e.orderingLabel : rf(e, t);
|
|
8874
9102
|
}
|
|
8875
|
-
function
|
|
8876
|
-
return
|
|
9103
|
+
function rf(e, t) {
|
|
9104
|
+
return ef[t](e);
|
|
8877
9105
|
}
|
|
8878
|
-
function
|
|
9106
|
+
function af(e, t) {
|
|
8879
9107
|
var n;
|
|
8880
9108
|
return (n = e.optionValueLabels.get(t)) == null ? t : n;
|
|
8881
9109
|
}
|
|
8882
|
-
function
|
|
9110
|
+
function of(e, t) {
|
|
8883
9111
|
var n;
|
|
8884
9112
|
return (n = e.candidateModeValueLabels.get(t)) == null ? t : n;
|
|
8885
9113
|
}
|
|
8886
|
-
function
|
|
9114
|
+
function sf(e, t) {
|
|
8887
9115
|
var n;
|
|
8888
9116
|
return (n = e.lineConnectLabelStyleLabels.get(t)) == null ? t : n;
|
|
8889
9117
|
}
|
|
8890
9118
|
//#endregion
|
|
8891
9119
|
//#region src/question/structure-editor/QuestionStructureCanvas.tsx
|
|
8892
|
-
function
|
|
9120
|
+
function cf({ elements: e, extras: t, labels: n, onDeleteElement: r, onDeleteExtra: i, onMoveElement: s, onSelectElement: c, selectedElementClientId: l }) {
|
|
8893
9121
|
let [u, d] = h(null);
|
|
8894
9122
|
return /* @__PURE__ */ o("section", {
|
|
8895
9123
|
className: Q.panel,
|
|
@@ -8909,7 +9137,7 @@ function Gd({ elements: e, extras: t, labels: n, onDeleteElement: r, onDeleteExt
|
|
|
8909
9137
|
className: Z["element-list"],
|
|
8910
9138
|
children: [
|
|
8911
9139
|
e.map((t, i) => {
|
|
8912
|
-
let f = t.clientId === l, p =
|
|
9140
|
+
let f = t.clientId === l, p = nf(n, t.type);
|
|
8913
9141
|
return /* @__PURE__ */ o("div", {
|
|
8914
9142
|
className: `${Z["element-card"]} ${f ? Z.active : ""}`,
|
|
8915
9143
|
onClick: () => c(t.clientId),
|
|
@@ -8973,7 +9201,7 @@ function Gd({ elements: e, extras: t, labels: n, onDeleteElement: r, onDeleteExt
|
|
|
8973
9201
|
children: n.extraTitle
|
|
8974
9202
|
}) : null,
|
|
8975
9203
|
t.map((t, r) => {
|
|
8976
|
-
let s = t.clientId === l, f =
|
|
9204
|
+
let s = t.clientId === l, f = Xd(n, t.type);
|
|
8977
9205
|
return /* @__PURE__ */ o("div", {
|
|
8978
9206
|
className: `${Z["element-card"]} ${s ? Z.active : ""}`,
|
|
8979
9207
|
onClick: () => c(t.clientId),
|
|
@@ -9022,7 +9250,7 @@ function Gd({ elements: e, extras: t, labels: n, onDeleteElement: r, onDeleteExt
|
|
|
9022
9250
|
}
|
|
9023
9251
|
//#endregion
|
|
9024
9252
|
//#region src/question/structure-editor/QuestionStructurePalette.tsx
|
|
9025
|
-
function
|
|
9253
|
+
function lf({ addedExtraTypes: e, labels: t, onAddElement: n, onAddExtra: r }) {
|
|
9026
9254
|
let i = new Set(e);
|
|
9027
9255
|
return /* @__PURE__ */ o("aside", {
|
|
9028
9256
|
className: Q.panel,
|
|
@@ -9037,11 +9265,11 @@ function Kd({ addedExtraTypes: e, labels: t, onAddElement: n, onAddExtra: r }) {
|
|
|
9037
9265
|
/* @__PURE__ */ a("div", {
|
|
9038
9266
|
className: Q.palette,
|
|
9039
9267
|
children: ae.map((e) => /* @__PURE__ */ o("button", {
|
|
9040
|
-
"aria-label": `${t.addElement}: ${
|
|
9268
|
+
"aria-label": `${t.addElement}: ${nf(t, e)}`,
|
|
9041
9269
|
className: Q["palette-button"],
|
|
9042
9270
|
onClick: () => n(e),
|
|
9043
9271
|
type: "button",
|
|
9044
|
-
children: [/* @__PURE__ */ a("strong", { children:
|
|
9272
|
+
children: [/* @__PURE__ */ a("strong", { children: nf(t, e) }), /* @__PURE__ */ a("small", { children: Qd(t, e) })]
|
|
9045
9273
|
}, e))
|
|
9046
9274
|
}),
|
|
9047
9275
|
/* @__PURE__ */ o("div", {
|
|
@@ -9054,12 +9282,12 @@ function Kd({ addedExtraTypes: e, labels: t, onAddElement: n, onAddExtra: r }) {
|
|
|
9054
9282
|
children: oe.map((e) => {
|
|
9055
9283
|
let n = i.has(e);
|
|
9056
9284
|
return /* @__PURE__ */ o("button", {
|
|
9057
|
-
"aria-label": `${t.addExtra}: ${
|
|
9285
|
+
"aria-label": `${t.addExtra}: ${Xd(t, e)}`,
|
|
9058
9286
|
className: Q["palette-button"],
|
|
9059
9287
|
disabled: n,
|
|
9060
9288
|
onClick: () => r(e),
|
|
9061
9289
|
type: "button",
|
|
9062
|
-
children: [/* @__PURE__ */ a("strong", { children:
|
|
9290
|
+
children: [/* @__PURE__ */ a("strong", { children: Xd(t, e) }), /* @__PURE__ */ a("small", { children: Yd(t, e) })]
|
|
9063
9291
|
}, e);
|
|
9064
9292
|
})
|
|
9065
9293
|
})]
|
|
@@ -9076,27 +9304,27 @@ var $ = {
|
|
|
9076
9304
|
select: "_select_tgswd_27",
|
|
9077
9305
|
textarea: "_textarea_tgswd_28",
|
|
9078
9306
|
empty: "_empty_tgswd_61"
|
|
9079
|
-
},
|
|
9307
|
+
}, uf = [
|
|
9080
9308
|
"none",
|
|
9081
9309
|
"sharedPool",
|
|
9082
9310
|
"perBlankOptions"
|
|
9083
|
-
],
|
|
9311
|
+
], df = [
|
|
9084
9312
|
"upperAlpha",
|
|
9085
9313
|
"lowerAlpha",
|
|
9086
9314
|
"number"
|
|
9087
|
-
],
|
|
9315
|
+
], ff = [
|
|
9088
9316
|
"number",
|
|
9089
9317
|
"upperAlpha",
|
|
9090
9318
|
"lowerAlpha",
|
|
9091
9319
|
"lowerRoman",
|
|
9092
9320
|
"chineseNumber",
|
|
9093
9321
|
"none"
|
|
9094
|
-
],
|
|
9322
|
+
], pf = [
|
|
9095
9323
|
2,
|
|
9096
9324
|
3,
|
|
9097
9325
|
4,
|
|
9098
9326
|
5
|
|
9099
|
-
],
|
|
9327
|
+
], mf = ["standard", "table"], hf = ["single", "multiple"], gf = ["spelling", "sentence"], _f = [
|
|
9100
9328
|
"correctWrong",
|
|
9101
9329
|
"yesNo",
|
|
9102
9330
|
"validInvalid",
|
|
@@ -9104,8 +9332,8 @@ var $ = {
|
|
|
9104
9332
|
"rightWrong",
|
|
9105
9333
|
"checkCross"
|
|
9106
9334
|
];
|
|
9107
|
-
function
|
|
9108
|
-
let f =
|
|
9335
|
+
function vf({ description: e, globalConfig: t, isSubjective: n, labels: r, onElementChange: i, onExtraChange: s, onGlobalConfigChange: c, onMetadataChange: l, selectedExtra: u, selectedElement: d }) {
|
|
9336
|
+
let f = yf({
|
|
9109
9337
|
labels: r,
|
|
9110
9338
|
onElementChange: i,
|
|
9111
9339
|
onExtraChange: s,
|
|
@@ -9187,7 +9415,7 @@ function tf({ description: e, globalConfig: t, isSubjective: n, labels: r, onEle
|
|
|
9187
9415
|
})]
|
|
9188
9416
|
});
|
|
9189
9417
|
}
|
|
9190
|
-
function
|
|
9418
|
+
function yf({ labels: e, onElementChange: t, onExtraChange: n, selectedElement: r, selectedExtra: i }) {
|
|
9191
9419
|
return r ? /* @__PURE__ */ o("div", {
|
|
9192
9420
|
className: $["form-stack"],
|
|
9193
9421
|
children: [
|
|
@@ -9207,7 +9435,7 @@ function nf({ labels: e, onElementChange: t, onExtraChange: n, selectedElement:
|
|
|
9207
9435
|
value: r.enName
|
|
9208
9436
|
})]
|
|
9209
9437
|
}),
|
|
9210
|
-
|
|
9438
|
+
bf(r, e, t)
|
|
9211
9439
|
]
|
|
9212
9440
|
}) : i ? /* @__PURE__ */ o("div", {
|
|
9213
9441
|
className: $["form-stack"],
|
|
@@ -9231,10 +9459,10 @@ function nf({ labels: e, onElementChange: t, onExtraChange: n, selectedElement:
|
|
|
9231
9459
|
children: e.noElement
|
|
9232
9460
|
});
|
|
9233
9461
|
}
|
|
9234
|
-
function
|
|
9235
|
-
return e.type === "fill" || e.type === "classification" || e.type === "ordering" || e.type === "richText" || e.type === "textMarker" || e.type === "textResponse" ? null :
|
|
9462
|
+
function bf(e, t, n) {
|
|
9463
|
+
return e.type === "fill" || e.type === "classification" || e.type === "ordering" || e.type === "richText" || e.type === "textMarker" || e.type === "textResponse" ? null : xf(e, t, n);
|
|
9236
9464
|
}
|
|
9237
|
-
function
|
|
9465
|
+
function xf(e, t, n) {
|
|
9238
9466
|
switch (e.type) {
|
|
9239
9467
|
case "inlineFill": return /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ o("label", {
|
|
9240
9468
|
className: $["form-row"],
|
|
@@ -9242,9 +9470,9 @@ function af(e, t, n) {
|
|
|
9242
9470
|
className: $.select,
|
|
9243
9471
|
onChange: (t) => n(j(j({}, e), {}, { config: j(j({}, e.config), {}, { candidateMode: t.target.value }) })),
|
|
9244
9472
|
value: e.config.candidateMode,
|
|
9245
|
-
children:
|
|
9473
|
+
children: uf.map((e) => /* @__PURE__ */ a("option", {
|
|
9246
9474
|
value: e,
|
|
9247
|
-
children:
|
|
9475
|
+
children: of(t, e)
|
|
9248
9476
|
}, e))
|
|
9249
9477
|
})]
|
|
9250
9478
|
}), /* @__PURE__ */ o("label", {
|
|
@@ -9261,9 +9489,9 @@ function af(e, t, n) {
|
|
|
9261
9489
|
className: $.select,
|
|
9262
9490
|
onChange: (t) => n(j(j({}, e), {}, { config: { builderMode: t.target.value } })),
|
|
9263
9491
|
value: e.config.builderMode,
|
|
9264
|
-
children:
|
|
9492
|
+
children: gf.map((e) => /* @__PURE__ */ a("option", {
|
|
9265
9493
|
value: e,
|
|
9266
|
-
children:
|
|
9494
|
+
children: af(t, e)
|
|
9267
9495
|
}, e))
|
|
9268
9496
|
})]
|
|
9269
9497
|
});
|
|
@@ -9273,18 +9501,18 @@ function af(e, t, n) {
|
|
|
9273
9501
|
className: $.select,
|
|
9274
9502
|
onChange: (t) => n(j(j({}, e), {}, { config: { judgeAnswerMode: t.target.value } })),
|
|
9275
9503
|
value: e.config.judgeAnswerMode,
|
|
9276
|
-
children:
|
|
9504
|
+
children: _f.map((e) => /* @__PURE__ */ a("option", {
|
|
9277
9505
|
value: e,
|
|
9278
|
-
children:
|
|
9506
|
+
children: af(t, e)
|
|
9279
9507
|
}, e))
|
|
9280
9508
|
})]
|
|
9281
9509
|
});
|
|
9282
|
-
case "choice": return
|
|
9283
|
-
case "lineConnect": return
|
|
9284
|
-
case "matching": return
|
|
9510
|
+
case "choice": return Sf(e, t, n);
|
|
9511
|
+
case "lineConnect": return Cf(e, t, n);
|
|
9512
|
+
case "matching": return wf(e, t, n);
|
|
9285
9513
|
}
|
|
9286
9514
|
}
|
|
9287
|
-
function
|
|
9515
|
+
function Sf(e, t, n) {
|
|
9288
9516
|
return /* @__PURE__ */ o(i, { children: [
|
|
9289
9517
|
/* @__PURE__ */ o("label", {
|
|
9290
9518
|
className: $["form-row"],
|
|
@@ -9292,9 +9520,9 @@ function of(e, t, n) {
|
|
|
9292
9520
|
className: $.select,
|
|
9293
9521
|
onChange: (t) => n(j(j({}, e), {}, { config: j(j({}, e.config), {}, { selectionType: t.target.value }) })),
|
|
9294
9522
|
value: e.config.selectionType,
|
|
9295
|
-
children:
|
|
9523
|
+
children: hf.map((e) => /* @__PURE__ */ a("option", {
|
|
9296
9524
|
value: e,
|
|
9297
|
-
children:
|
|
9525
|
+
children: af(t, e)
|
|
9298
9526
|
}, e))
|
|
9299
9527
|
})]
|
|
9300
9528
|
}),
|
|
@@ -9304,9 +9532,9 @@ function of(e, t, n) {
|
|
|
9304
9532
|
className: $.select,
|
|
9305
9533
|
onChange: (t) => n(j(j({}, e), {}, { config: j(j({}, e.config), {}, { optionLabelStyle: t.target.value }) })),
|
|
9306
9534
|
value: e.config.optionLabelStyle,
|
|
9307
|
-
children:
|
|
9535
|
+
children: df.map((e) => /* @__PURE__ */ a("option", {
|
|
9308
9536
|
value: e,
|
|
9309
|
-
children:
|
|
9537
|
+
children: af(t, e)
|
|
9310
9538
|
}, e))
|
|
9311
9539
|
})]
|
|
9312
9540
|
}),
|
|
@@ -9316,23 +9544,23 @@ function of(e, t, n) {
|
|
|
9316
9544
|
className: $.select,
|
|
9317
9545
|
onChange: (t) => n(j(j({}, e), {}, { config: j(j({}, e.config), {}, { renderer: t.target.value }) })),
|
|
9318
9546
|
value: e.config.renderer,
|
|
9319
|
-
children:
|
|
9547
|
+
children: mf.map((e) => /* @__PURE__ */ a("option", {
|
|
9320
9548
|
value: e,
|
|
9321
|
-
children:
|
|
9549
|
+
children: af(t, e)
|
|
9322
9550
|
}, e))
|
|
9323
9551
|
})]
|
|
9324
9552
|
})
|
|
9325
9553
|
] });
|
|
9326
9554
|
}
|
|
9327
|
-
function
|
|
9328
|
-
let r =
|
|
9555
|
+
function Cf(e, t, n) {
|
|
9556
|
+
let r = Tf(e.config.columns);
|
|
9329
9557
|
return /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ o("label", {
|
|
9330
9558
|
className: $["form-row"],
|
|
9331
9559
|
children: [/* @__PURE__ */ a("span", { children: t.lineConnectColumnCount }), /* @__PURE__ */ a("select", {
|
|
9332
9560
|
className: $.select,
|
|
9333
|
-
onChange: (t) => n(j(j({}, e), {}, { config: { columns:
|
|
9561
|
+
onChange: (t) => n(j(j({}, e), {}, { config: { columns: Df(r, Number(t.target.value)) } })),
|
|
9334
9562
|
value: r.length,
|
|
9335
|
-
children:
|
|
9563
|
+
children: pf.map((e) => /* @__PURE__ */ a("option", {
|
|
9336
9564
|
value: e,
|
|
9337
9565
|
children: e
|
|
9338
9566
|
}, e))
|
|
@@ -9343,47 +9571,47 @@ function sf(e, t, n) {
|
|
|
9343
9571
|
className: $.select,
|
|
9344
9572
|
onChange: (t) => n(j(j({}, e), {}, { config: { columns: r.map((e, n) => n === s ? { labelStyle: t.target.value } : e) } })),
|
|
9345
9573
|
value: i.labelStyle,
|
|
9346
|
-
children:
|
|
9574
|
+
children: ff.map((e) => /* @__PURE__ */ a("option", {
|
|
9347
9575
|
value: e,
|
|
9348
|
-
children:
|
|
9576
|
+
children: sf(t, e)
|
|
9349
9577
|
}, e))
|
|
9350
9578
|
})]
|
|
9351
9579
|
}, `line-column-${s}`))] });
|
|
9352
9580
|
}
|
|
9353
|
-
function
|
|
9354
|
-
let r =
|
|
9581
|
+
function wf(e, t, n) {
|
|
9582
|
+
let r = Ef(e.config.columns);
|
|
9355
9583
|
return /* @__PURE__ */ a(i, { children: r.map((i, s) => /* @__PURE__ */ o("label", {
|
|
9356
9584
|
className: $["form-row"],
|
|
9357
9585
|
children: [/* @__PURE__ */ a("span", { children: t.lineConnectColumnLabel(s + 1) }), /* @__PURE__ */ a("select", {
|
|
9358
9586
|
className: $.select,
|
|
9359
9587
|
onChange: (t) => n(j(j({}, e), {}, { config: { columns: r.map((e, n) => n === s ? { labelStyle: t.target.value } : e) } })),
|
|
9360
9588
|
value: i.labelStyle,
|
|
9361
|
-
children:
|
|
9589
|
+
children: ff.map((e) => /* @__PURE__ */ a("option", {
|
|
9362
9590
|
value: e,
|
|
9363
|
-
children:
|
|
9591
|
+
children: sf(t, e)
|
|
9364
9592
|
}, e))
|
|
9365
9593
|
})]
|
|
9366
9594
|
}, `matching-column-${s}`)) });
|
|
9367
9595
|
}
|
|
9368
|
-
function
|
|
9596
|
+
function Tf(e) {
|
|
9369
9597
|
let t = e.slice(0, 5);
|
|
9370
|
-
return t.length >= 2 ? t : [...t, ...
|
|
9598
|
+
return t.length >= 2 ? t : [...t, ...ff.slice(t.length, 2).map((e) => ({ labelStyle: e }))];
|
|
9371
9599
|
}
|
|
9372
|
-
function
|
|
9600
|
+
function Ef(e) {
|
|
9373
9601
|
let t = e.slice(0, 2);
|
|
9374
|
-
return t.length >= 2 ? t : [...t, ...
|
|
9602
|
+
return t.length >= 2 ? t : [...t, ...ff.slice(t.length, 2).map((e) => ({ labelStyle: e }))];
|
|
9375
9603
|
}
|
|
9376
|
-
function
|
|
9604
|
+
function Df(e, t) {
|
|
9377
9605
|
return Array.from({ length: Math.min(5, Math.max(2, t)) }, (t, n) => {
|
|
9378
9606
|
var r, i;
|
|
9379
|
-
return (r = e.slice(n, n + 1)[0]) == null ? { labelStyle: (i =
|
|
9607
|
+
return (r = e.slice(n, n + 1)[0]) == null ? { labelStyle: (i = ff[n]) == null ? "number" : i } : r;
|
|
9380
9608
|
});
|
|
9381
9609
|
}
|
|
9382
9610
|
//#endregion
|
|
9383
9611
|
//#region src/question/structure-editor/QuestionStructureEditor.tsx
|
|
9384
|
-
function
|
|
9612
|
+
function Of({ locale: e = "zh-CN", onChange: t, value: n }) {
|
|
9385
9613
|
var r, i, s, c;
|
|
9386
|
-
let l =
|
|
9614
|
+
let l = Zd(e), [u, d] = h((r = (i = n.elements[0]) == null ? void 0 : i.clientId) == null ? null : r), { selectedElement: f, selectedExtra: p } = kf(n, u);
|
|
9387
9615
|
function m(e) {
|
|
9388
9616
|
let r = pe(e, n.elements);
|
|
9389
9617
|
t(j(j({}, n), {}, { elements: [...n.elements, r] })), d(r.clientId);
|
|
@@ -9395,11 +9623,11 @@ function ff({ locale: e = "zh-CN", onChange: t, value: n }) {
|
|
|
9395
9623
|
}
|
|
9396
9624
|
function _(e) {
|
|
9397
9625
|
let r = _e(n, e);
|
|
9398
|
-
t(r), d(
|
|
9626
|
+
t(r), d(Af(r));
|
|
9399
9627
|
}
|
|
9400
9628
|
function v(e) {
|
|
9401
9629
|
let r = ge(n, e);
|
|
9402
|
-
t(r), d(
|
|
9630
|
+
t(r), d(Af(r));
|
|
9403
9631
|
}
|
|
9404
9632
|
function y(e) {
|
|
9405
9633
|
t(be(n, e.clientId, e));
|
|
@@ -9414,19 +9642,19 @@ function ff({ locale: e = "zh-CN", onChange: t, value: n }) {
|
|
|
9414
9642
|
t(Se(n, e));
|
|
9415
9643
|
}
|
|
9416
9644
|
return /* @__PURE__ */ a("section", {
|
|
9417
|
-
className:
|
|
9645
|
+
className: qd.root,
|
|
9418
9646
|
children: /* @__PURE__ */ a("div", {
|
|
9419
9647
|
className: Q.shell,
|
|
9420
9648
|
children: /* @__PURE__ */ o("div", {
|
|
9421
9649
|
className: Q.grid,
|
|
9422
9650
|
children: [
|
|
9423
|
-
/* @__PURE__ */ a(
|
|
9651
|
+
/* @__PURE__ */ a(lf, {
|
|
9424
9652
|
addedExtraTypes: n.extras.map((e) => e.type),
|
|
9425
9653
|
labels: l,
|
|
9426
9654
|
onAddElement: m,
|
|
9427
9655
|
onAddExtra: g
|
|
9428
9656
|
}),
|
|
9429
|
-
/* @__PURE__ */ a(
|
|
9657
|
+
/* @__PURE__ */ a(cf, {
|
|
9430
9658
|
elements: n.elements,
|
|
9431
9659
|
extras: n.extras,
|
|
9432
9660
|
labels: l,
|
|
@@ -9436,7 +9664,7 @@ function ff({ locale: e = "zh-CN", onChange: t, value: n }) {
|
|
|
9436
9664
|
onSelectElement: d,
|
|
9437
9665
|
selectedElementClientId: (s = (c = f == null ? void 0 : f.clientId) == null ? p == null ? void 0 : p.clientId : c) == null ? null : s
|
|
9438
9666
|
}),
|
|
9439
|
-
/* @__PURE__ */ a(
|
|
9667
|
+
/* @__PURE__ */ a(vf, {
|
|
9440
9668
|
description: n.description,
|
|
9441
9669
|
globalConfig: n.globalConfig,
|
|
9442
9670
|
isSubjective: n.isSubjective,
|
|
@@ -9453,7 +9681,7 @@ function ff({ locale: e = "zh-CN", onChange: t, value: n }) {
|
|
|
9453
9681
|
})
|
|
9454
9682
|
});
|
|
9455
9683
|
}
|
|
9456
|
-
function
|
|
9684
|
+
function kf(e, t) {
|
|
9457
9685
|
var n, r, i, a;
|
|
9458
9686
|
let o = (n = e.elements.find((e) => e.clientId === t)) == null ? null : n, s = (r = e.extras.find((e) => e.clientId === t)) == null ? null : r;
|
|
9459
9687
|
return o || s ? {
|
|
@@ -9464,9 +9692,9 @@ function pf(e, t) {
|
|
|
9464
9692
|
selectedExtra: e.elements[0] || (a = e.extras[0]) == null ? null : a
|
|
9465
9693
|
};
|
|
9466
9694
|
}
|
|
9467
|
-
function
|
|
9695
|
+
function Af(e) {
|
|
9468
9696
|
var t, n, r, i;
|
|
9469
9697
|
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;
|
|
9470
9698
|
}
|
|
9471
9699
|
//#endregion
|
|
9472
|
-
export { fs as QuestionContentEditor,
|
|
9700
|
+
export { fs as QuestionContentEditor, ed as QuestionPlayer, jd as QuestionPreview, Kd as QuestionPrintPreview, J as QuestionRichContentView, Of as QuestionStructureEditor, qn as addBlankToGroup, xn as alignQuestionContentDraftWithStructure, Zn as assignBlankToAnswerGroup, ro as cn, Qn as createBlankAnswerGroupWithBlank, Qt as createEmptyQuestionContentDraft, ec as createEmptyQuestionPlayerResponse, de as createEmptyQuestionStructureDraft, bn as createQuestionContentDraftFromSerialized, k as createQuestionContentId, hs as createQuestionContentStructureFromDraft, gs as createQuestionPreviewDraft, pe as createQuestionStructureElement, fe as createQuestionStructureExtra, P as createRichContentValue, rn as createRichContentValueFromDocument, Me as createRichTextContent, Jn as deleteBlankFromGroup, _e as deleteQuestionStructureElement, ge as deleteQuestionStructureExtra, $n as detachBlankFromAnswerGroup, la as findQuestionContentQuestionTypeStructure, pa as findQuestionContentQuestionTypeTemplate, pn as getQuestionContentJudgementOptions, un as getQuestionContentOptionMarker, on as getQuestionContentTextMarkerAnswerText, vs as getQuestionStructureDraftChangeKind, N as getQuestionStructureElementDefaultEnName, M as getQuestionStructureElementDefaultName, we as getQuestionStructureExtraDefaultEnName, Ce as getQuestionStructureExtraDefaultName, sn as getRichContentDocument, Xn as getSharedBlankAnswerGroups, Zt as isCompositeQuestionContentStructure, vn as isQuestionContentDraftEmpty, ve as moveQuestionStructureElement, An as normalizeFillTextCandidateState, Ne as normalizeRichTextContent, ae as questionStructureElementTypes, oe as questionStructureExtraTypes, ma as reconcileQuestionContentDraftWithTemplates, yn as serializeQuestionContentDraft, _s as serializeQuestionStructureDraft, be as updateQuestionStructureElement, ye as updateQuestionStructureExtra, xe as updateQuestionStructureGlobalConfig, Se as updateQuestionStructureMetadata };
|