@yungu-fed/question-editor 0.4.6 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -1
- package/dist/index.js +1222 -1228
- package/dist/index.mjs +332 -329
- package/dist/question/player/QuestionFillTextContentPlayer.d.ts.map +1 -1
- package/dist/question/player/QuestionFillTextPlayer.d.ts.map +1 -1
- package/dist/question/renderers/QuestionFillTextView.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -6042,45 +6042,45 @@ function Bc(e = "zh-CN") {
|
|
|
6042
6042
|
}
|
|
6043
6043
|
//#endregion
|
|
6044
6044
|
//#region src/question/renderers/helpers.ts
|
|
6045
|
-
function
|
|
6045
|
+
function U(...e) {
|
|
6046
6046
|
return e.filter(Boolean).join(" ");
|
|
6047
6047
|
}
|
|
6048
|
-
function
|
|
6048
|
+
function Vc(e, t, n) {
|
|
6049
6049
|
return e.map((e) => t.indexOf(e) + 1).filter((e) => e > 0).map((e) => `${n}${e}`).join(" ");
|
|
6050
6050
|
}
|
|
6051
|
-
function
|
|
6051
|
+
function Hc(e) {
|
|
6052
6052
|
return "answerPools" in e;
|
|
6053
6053
|
}
|
|
6054
|
-
function
|
|
6054
|
+
function Uc(e) {
|
|
6055
6055
|
return "answerOptionId" in e;
|
|
6056
6056
|
}
|
|
6057
|
-
function
|
|
6057
|
+
function Wc(e) {
|
|
6058
6058
|
return "answerOptionIds" in e;
|
|
6059
6059
|
}
|
|
6060
|
-
function
|
|
6060
|
+
function Gc(e, t) {
|
|
6061
6061
|
var n, r;
|
|
6062
6062
|
return (n = e == null || (r = e.find((e) => e.optionId === t)) == null ? void 0 : r.content) == null ? null : n;
|
|
6063
6063
|
}
|
|
6064
|
-
function
|
|
6064
|
+
function Kc(e, t, n) {
|
|
6065
6065
|
var r, i;
|
|
6066
6066
|
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
6067
|
}
|
|
6068
|
-
function
|
|
6068
|
+
function qc(e) {
|
|
6069
6069
|
return e.answers.reduce((t, n) => {
|
|
6070
|
-
if (
|
|
6070
|
+
if (Hc(n)) return Jc(t, {
|
|
6071
6071
|
blankIds: n.blankIds,
|
|
6072
6072
|
contents: n.answerPools
|
|
6073
6073
|
});
|
|
6074
|
-
if (
|
|
6075
|
-
let r =
|
|
6076
|
-
return
|
|
6074
|
+
if (Uc(n)) {
|
|
6075
|
+
let r = Kc(e.blankOptionGroups, n.blankId, n.answerOptionId);
|
|
6076
|
+
return Jc(t, {
|
|
6077
6077
|
blankIds: [n.blankId],
|
|
6078
6078
|
contents: r ? [r] : []
|
|
6079
6079
|
});
|
|
6080
6080
|
}
|
|
6081
|
-
if (
|
|
6082
|
-
let r = n.answerOptionIds.map((t) =>
|
|
6083
|
-
return
|
|
6081
|
+
if (Wc(n)) {
|
|
6082
|
+
let r = n.answerOptionIds.map((t) => Gc(e.candidateOptions, t)).filter((e) => !!e);
|
|
6083
|
+
return Jc(t, {
|
|
6084
6084
|
blankIds: n.blankIds,
|
|
6085
6085
|
contents: r
|
|
6086
6086
|
});
|
|
@@ -6088,7 +6088,7 @@ function Jc(e) {
|
|
|
6088
6088
|
return t;
|
|
6089
6089
|
}, []);
|
|
6090
6090
|
}
|
|
6091
|
-
function
|
|
6091
|
+
function Jc(e, t) {
|
|
6092
6092
|
let n = t.contents.filter((e) => e.text.trim() !== "");
|
|
6093
6093
|
return n.length > 0 ? [...e, {
|
|
6094
6094
|
blankIds: t.blankIds,
|
|
@@ -6097,7 +6097,7 @@ function Yc(e, t) {
|
|
|
6097
6097
|
}
|
|
6098
6098
|
//#endregion
|
|
6099
6099
|
//#region src/question/shared/blank-numbering.ts
|
|
6100
|
-
var
|
|
6100
|
+
var Yc = [
|
|
6101
6101
|
"\u96f6",
|
|
6102
6102
|
"\u4e00",
|
|
6103
6103
|
"\u4e8c",
|
|
@@ -6108,17 +6108,17 @@ var Xc = [
|
|
|
6108
6108
|
"\u4e03",
|
|
6109
6109
|
"\u516b",
|
|
6110
6110
|
"\u4e5d"
|
|
6111
|
-
],
|
|
6111
|
+
], Xc = [
|
|
6112
6112
|
"",
|
|
6113
6113
|
"\u5341",
|
|
6114
6114
|
"\u767e",
|
|
6115
6115
|
"\u5343"
|
|
6116
|
-
],
|
|
6116
|
+
], Zc = [
|
|
6117
6117
|
"",
|
|
6118
6118
|
"\u4e07",
|
|
6119
6119
|
"\u4ebf",
|
|
6120
6120
|
"\u5146"
|
|
6121
|
-
],
|
|
6121
|
+
], Qc = new Intl.PluralRules("en-US", { type: "ordinal" }), $c = {
|
|
6122
6122
|
few: "rd",
|
|
6123
6123
|
many: "th",
|
|
6124
6124
|
one: "st",
|
|
@@ -6126,15 +6126,15 @@ var Xc = [
|
|
|
6126
6126
|
two: "nd",
|
|
6127
6127
|
zero: "th"
|
|
6128
6128
|
};
|
|
6129
|
-
function
|
|
6130
|
-
return t === "zh-CN" ? `\u7b2c${
|
|
6129
|
+
function el(e, t) {
|
|
6130
|
+
return t === "zh-CN" ? `\u7b2c${nl(e)}\u7a7a` : `${e}${$c[Qc.select(e)]} blank`;
|
|
6131
6131
|
}
|
|
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) =>
|
|
6132
|
+
function tl(e, t, n) {
|
|
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) => el(e, n));
|
|
6134
6134
|
return n === "zh-CN" ? `${r.join("\u3001")}\uff1a` : `${r.join(", ")}:`;
|
|
6135
6135
|
}
|
|
6136
|
-
function
|
|
6137
|
-
let t =
|
|
6136
|
+
function nl(e) {
|
|
6137
|
+
let t = rl(e), n = "", r = !1;
|
|
6138
6138
|
for (let e = t.length - 1; e >= 0; --e) {
|
|
6139
6139
|
var i;
|
|
6140
6140
|
let a = (i = t[e]) == null ? 0 : i;
|
|
@@ -6142,16 +6142,16 @@ function rl(e) {
|
|
|
6142
6142
|
r = n.length > 0;
|
|
6143
6143
|
continue;
|
|
6144
6144
|
}
|
|
6145
|
-
n.length > 0 && (r || a < 1e3) && (n +=
|
|
6145
|
+
n.length > 0 && (r || a < 1e3) && (n += Yc[0]), n += `${il(a)}${Zc[e]}`, r = !1;
|
|
6146
6146
|
}
|
|
6147
6147
|
return n.startsWith("\u4e00\u5341") ? n.slice(1) : n;
|
|
6148
6148
|
}
|
|
6149
|
-
function
|
|
6149
|
+
function rl(e) {
|
|
6150
6150
|
let t = [], n = e;
|
|
6151
6151
|
for (; n > 0;) t.push(n % 1e4), n = Math.floor(n / 1e4);
|
|
6152
6152
|
return t;
|
|
6153
6153
|
}
|
|
6154
|
-
function
|
|
6154
|
+
function il(e) {
|
|
6155
6155
|
let t = "", n = !1;
|
|
6156
6156
|
for (let r = 3; r >= 0; --r) {
|
|
6157
6157
|
let i = Math.pow(10, r), a = Math.floor(e / i) % 10;
|
|
@@ -6159,15 +6159,15 @@ function al(e) {
|
|
|
6159
6159
|
n = t.length > 0 && e % i > 0;
|
|
6160
6160
|
continue;
|
|
6161
6161
|
}
|
|
6162
|
-
n && (t +=
|
|
6162
|
+
n && (t += Yc[0]), t += `${Yc[a]}${Xc[r]}`, n = !1;
|
|
6163
6163
|
}
|
|
6164
6164
|
return t;
|
|
6165
6165
|
}
|
|
6166
6166
|
//#endregion
|
|
6167
6167
|
//#region src/question/renderers/question-renderer-behavior.ts
|
|
6168
|
-
var
|
|
6168
|
+
var al = {
|
|
6169
6169
|
answerGroupLayout: "flow",
|
|
6170
|
-
blankAnswerMarker: (e, t, n, r) =>
|
|
6170
|
+
blankAnswerMarker: (e, t, n, r) => Vc(e, t, r),
|
|
6171
6171
|
blankPlaceholder: "labeled-field",
|
|
6172
6172
|
candidateLayout: "plain-list",
|
|
6173
6173
|
columnLayout: "css",
|
|
@@ -6179,9 +6179,9 @@ var ol = {
|
|
|
6179
6179
|
showEmptyAnswerGroups: !1,
|
|
6180
6180
|
systemListMarkup: "native",
|
|
6181
6181
|
textResponseVisibility: "hidden"
|
|
6182
|
-
},
|
|
6182
|
+
}, ol = {
|
|
6183
6183
|
answerGroupLayout: "rows",
|
|
6184
|
-
blankAnswerMarker: (e, t, n) =>
|
|
6184
|
+
blankAnswerMarker: (e, t, n) => tl(e, t, n),
|
|
6185
6185
|
blankPlaceholder: "answer-line",
|
|
6186
6186
|
candidateLayout: "labeled-groups",
|
|
6187
6187
|
columnLayout: "document-table",
|
|
@@ -6193,18 +6193,18 @@ var ol = {
|
|
|
6193
6193
|
showEmptyAnswerGroups: !0,
|
|
6194
6194
|
systemListMarkup: "explicit",
|
|
6195
6195
|
textResponseVisibility: "accessible-only"
|
|
6196
|
-
},
|
|
6197
|
-
function
|
|
6198
|
-
return d(
|
|
6196
|
+
}, sl = l(al), cl = l("zh-CN");
|
|
6197
|
+
function W() {
|
|
6198
|
+
return d(sl);
|
|
6199
6199
|
}
|
|
6200
|
-
function
|
|
6201
|
-
return d(
|
|
6200
|
+
function ll() {
|
|
6201
|
+
return d(cl);
|
|
6202
6202
|
}
|
|
6203
|
-
var
|
|
6203
|
+
var ul = { placeholder: "_placeholder_np8ps_1" }, dl = {
|
|
6204
6204
|
"blank-list": "_blank-list_12ccp_1",
|
|
6205
6205
|
"blank-item": "_blank-item_12ccp_11",
|
|
6206
6206
|
"blank-field": "_blank-field_12ccp_17"
|
|
6207
|
-
},
|
|
6207
|
+
}, fl = {
|
|
6208
6208
|
board: "_board_1f76b_1",
|
|
6209
6209
|
pool: "_pool_1f76b_6",
|
|
6210
6210
|
zones: "_zones_1f76b_13",
|
|
@@ -6216,34 +6216,34 @@ var dl = { placeholder: "_placeholder_np8ps_1" }, fl = {
|
|
|
6216
6216
|
correct: "_correct_1f76b_77",
|
|
6217
6217
|
incorrect: "_incorrect_1f76b_81",
|
|
6218
6218
|
unanswered: "_unanswered_1f76b_85"
|
|
6219
|
-
},
|
|
6219
|
+
}, pl = {
|
|
6220
6220
|
board: "_board_5xarh_1",
|
|
6221
6221
|
columns: "_columns_5xarh_6",
|
|
6222
6222
|
column: "_column_5xarh_6",
|
|
6223
6223
|
item: "_item_5xarh_18",
|
|
6224
6224
|
marker: "_marker_5xarh_42"
|
|
6225
|
-
},
|
|
6226
|
-
"rich-content": "_rich-
|
|
6227
|
-
element: "
|
|
6228
|
-
"option-list": "_option-
|
|
6229
|
-
"candidate-list": "_candidate-
|
|
6230
|
-
"judgement-list": "_judgement-
|
|
6231
|
-
"judgement-row": "_judgement-
|
|
6232
|
-
"judgement-placeholder": "_judgement-
|
|
6233
|
-
"option-item": "_option-
|
|
6234
|
-
"candidate-item": "_candidate-
|
|
6235
|
-
"judgement-item": "_judgement-
|
|
6236
|
-
marker: "
|
|
6237
|
-
"candidate-section": "_candidate-
|
|
6238
|
-
"section-title": "_section-
|
|
6239
|
-
"word-builder-blank": "_word-builder-
|
|
6240
|
-
"word-builder-candidate-list": "_word-builder-candidate-
|
|
6241
|
-
},
|
|
6225
|
+
}, G = {
|
|
6226
|
+
"rich-content": "_rich-content_1aumw_1",
|
|
6227
|
+
element: "_element_1aumw_52",
|
|
6228
|
+
"option-list": "_option-list_1aumw_54",
|
|
6229
|
+
"candidate-list": "_candidate-list_1aumw_55",
|
|
6230
|
+
"judgement-list": "_judgement-list_1aumw_56",
|
|
6231
|
+
"judgement-row": "_judgement-row_1aumw_68",
|
|
6232
|
+
"judgement-placeholder": "_judgement-placeholder_1aumw_76",
|
|
6233
|
+
"option-item": "_option-item_1aumw_83",
|
|
6234
|
+
"candidate-item": "_candidate-item_1aumw_84",
|
|
6235
|
+
"judgement-item": "_judgement-item_1aumw_85",
|
|
6236
|
+
marker: "_marker_1aumw_97",
|
|
6237
|
+
"candidate-section": "_candidate-section_1aumw_112",
|
|
6238
|
+
"section-title": "_section-title_1aumw_125",
|
|
6239
|
+
"word-builder-blank": "_word-builder-blank_1aumw_131",
|
|
6240
|
+
"word-builder-candidate-list": "_word-builder-candidate-list_1aumw_147"
|
|
6241
|
+
}, ml = {
|
|
6242
6242
|
"table-wrap": "_table-wrap_n67ah_1",
|
|
6243
6243
|
table: "_table_n67ah_1",
|
|
6244
6244
|
"table-option-column": "_table-option-column_n67ah_17",
|
|
6245
6245
|
"table-option-marker": "_table-option-marker_n67ah_45"
|
|
6246
|
-
},
|
|
6246
|
+
}, hl = l({
|
|
6247
6247
|
answer: {
|
|
6248
6248
|
"answer-panel": "_answer-panel_1bkkd_1",
|
|
6249
6249
|
"answer-list": "_answer-list_1bkkd_8",
|
|
@@ -6253,13 +6253,13 @@ var dl = { placeholder: "_placeholder_np8ps_1" }, fl = {
|
|
|
6253
6253
|
"answer-content-list": "_answer-content-list_1bkkd_46",
|
|
6254
6254
|
"answer-value": "_answer-value_1bkkd_55"
|
|
6255
6255
|
},
|
|
6256
|
-
blankGroup:
|
|
6257
|
-
classification:
|
|
6256
|
+
blankGroup: dl,
|
|
6257
|
+
classification: fl,
|
|
6258
6258
|
lineConnect: V,
|
|
6259
|
-
matching:
|
|
6260
|
-
renderer:
|
|
6259
|
+
matching: pl,
|
|
6260
|
+
renderer: G,
|
|
6261
6261
|
sectionTitle: { title: "_title_hrc5o_1" },
|
|
6262
|
-
table:
|
|
6262
|
+
table: ml,
|
|
6263
6263
|
textMarker: {
|
|
6264
6264
|
content: "_content_63948_1",
|
|
6265
6265
|
paragraph: "_paragraph_63948_10",
|
|
@@ -6268,21 +6268,21 @@ var dl = { placeholder: "_placeholder_np8ps_1" }, fl = {
|
|
|
6268
6268
|
"marker-selected": "_marker-selected_63948_31",
|
|
6269
6269
|
"marker-answer": "_marker-answer_63948_37"
|
|
6270
6270
|
},
|
|
6271
|
-
textResponse:
|
|
6271
|
+
textResponse: ul
|
|
6272
6272
|
});
|
|
6273
|
-
function
|
|
6274
|
-
return d(
|
|
6273
|
+
function K() {
|
|
6274
|
+
return d(hl);
|
|
6275
6275
|
}
|
|
6276
6276
|
//#endregion
|
|
6277
6277
|
//#region src/question/renderers/QuestionSectionTitle.tsx
|
|
6278
|
-
function
|
|
6279
|
-
let { sectionTitleSuffix: t } =
|
|
6278
|
+
function gl({ children: e }) {
|
|
6279
|
+
let { sectionTitleSuffix: t } = W(), n = ll(), { sectionTitle: r } = K();
|
|
6280
6280
|
return /* @__PURE__ */ o("h3", {
|
|
6281
6281
|
className: r.title,
|
|
6282
6282
|
children: [e, t(n)]
|
|
6283
6283
|
});
|
|
6284
6284
|
}
|
|
6285
|
-
var
|
|
6285
|
+
var q = {
|
|
6286
6286
|
root: "_root_nr9um_1",
|
|
6287
6287
|
"element-list": "_element-list_nr9um_18",
|
|
6288
6288
|
children: "_children_nr9um_19",
|
|
@@ -6298,21 +6298,21 @@ var K = {
|
|
|
6298
6298
|
};
|
|
6299
6299
|
//#endregion
|
|
6300
6300
|
//#region src/question/player/QuestionPlayerComposite.tsx
|
|
6301
|
-
function
|
|
6301
|
+
function _l({ childIndexPath: e = [], messages: t, onChildResponseChange: n, renderChild: r, response: i, rootQuestionNumber: o, value: s }) {
|
|
6302
6302
|
return s.children.length === 0 ? /* @__PURE__ */ a("div", {
|
|
6303
|
-
className:
|
|
6303
|
+
className: q.empty,
|
|
6304
6304
|
children: t.previewEmpty
|
|
6305
6305
|
}) : /* @__PURE__ */ a("div", {
|
|
6306
|
-
className:
|
|
6306
|
+
className: q.children,
|
|
6307
6307
|
children: s.children.map((c, l) => {
|
|
6308
6308
|
let u = [...e, l], d = i.children.slice(l, l + 1)[0], f = qo(u, s.children.length, o);
|
|
6309
6309
|
return /* @__PURE__ */ a("section", {
|
|
6310
|
-
className:
|
|
6310
|
+
className: q.child,
|
|
6311
6311
|
children: /* @__PURE__ */ a(Yo, {
|
|
6312
6312
|
indented: !0,
|
|
6313
6313
|
number: f,
|
|
6314
6314
|
children: d ? r(c, d, (e) => n(l, e), u) : /* @__PURE__ */ a("div", {
|
|
6315
|
-
className:
|
|
6315
|
+
className: q.empty,
|
|
6316
6316
|
children: t.missingQuestionTypeTemplate
|
|
6317
6317
|
})
|
|
6318
6318
|
})
|
|
@@ -6322,8 +6322,8 @@ function vl({ childIndexPath: e = [], messages: t, onChildResponseChange: n, ren
|
|
|
6322
6322
|
}
|
|
6323
6323
|
//#endregion
|
|
6324
6324
|
//#region src/question/renderers/QuestionRichContentView.tsx
|
|
6325
|
-
function
|
|
6326
|
-
let { renderer: n } =
|
|
6325
|
+
function J({ className: e, content: t }) {
|
|
6326
|
+
let { renderer: n } = K(), i = t.html || r(sn(t), { plugins: [Pt] });
|
|
6327
6327
|
return /* @__PURE__ */ a("div", {
|
|
6328
6328
|
className: e ? `${n["rich-content"]} ${e}` : n["rich-content"],
|
|
6329
6329
|
dangerouslySetInnerHTML: { __html: i }
|
|
@@ -6331,8 +6331,8 @@ function q({ className: e, content: t }) {
|
|
|
6331
6331
|
}
|
|
6332
6332
|
//#endregion
|
|
6333
6333
|
//#region src/question/renderers/QuestionSystemList.tsx
|
|
6334
|
-
function
|
|
6335
|
-
let { systemListMarkup: r } =
|
|
6334
|
+
function vl({ children: e, className: t, dataCandidateLayout: n }) {
|
|
6335
|
+
let { systemListMarkup: r } = W();
|
|
6336
6336
|
return r === "native" ? /* @__PURE__ */ a("ol", {
|
|
6337
6337
|
className: t,
|
|
6338
6338
|
"data-candidate-layout": n,
|
|
@@ -6346,8 +6346,8 @@ function yl({ children: e, className: t, dataCandidateLayout: n }) {
|
|
|
6346
6346
|
}
|
|
6347
6347
|
//#endregion
|
|
6348
6348
|
//#region src/question/renderers/QuestionSystemListItem.tsx
|
|
6349
|
-
function
|
|
6350
|
-
let { systemListMarkup: n } =
|
|
6349
|
+
function yl({ children: e, className: t }) {
|
|
6350
|
+
let { systemListMarkup: n } = W();
|
|
6351
6351
|
return n === "native" ? /* @__PURE__ */ a("li", {
|
|
6352
6352
|
className: t,
|
|
6353
6353
|
children: e
|
|
@@ -6359,15 +6359,15 @@ function bl({ children: e, className: t }) {
|
|
|
6359
6359
|
}
|
|
6360
6360
|
//#endregion
|
|
6361
6361
|
//#region src/question/renderers/QuestionStandardAnswerPanel.tsx
|
|
6362
|
-
function
|
|
6363
|
-
let { answerGroupLayout: n, showEmptyAnswerGroups: r } =
|
|
6362
|
+
function Y({ groups: e, title: t }) {
|
|
6363
|
+
let { answerGroupLayout: n, showEmptyAnswerGroups: r } = W(), { answer: i } = K(), s = e.filter((e) => e.kind === "markerOnly" || e.contents.length > 0 || r && !!e.marker);
|
|
6364
6364
|
return s.length === 0 ? null : /* @__PURE__ */ o("section", {
|
|
6365
6365
|
"aria-label": t,
|
|
6366
6366
|
className: i["answer-panel"],
|
|
6367
6367
|
"data-answer-group-layout": n,
|
|
6368
|
-
children: [/* @__PURE__ */ a(
|
|
6368
|
+
children: [/* @__PURE__ */ a(gl, { children: t }), /* @__PURE__ */ a(vl, {
|
|
6369
6369
|
className: i["answer-list"],
|
|
6370
|
-
children: s.map((e, t) => /* @__PURE__ */ o(
|
|
6370
|
+
children: s.map((e, t) => /* @__PURE__ */ o(yl, {
|
|
6371
6371
|
className: i["answer-row"],
|
|
6372
6372
|
children: [e.marker ? /* @__PURE__ */ a("span", {
|
|
6373
6373
|
className: e.kind === "markerOnly" ? `${i["answer-marker"]} ${i["answer-marker-only"]}` : i["answer-marker"],
|
|
@@ -6385,60 +6385,60 @@ function J({ groups: e, title: t }) {
|
|
|
6385
6385
|
}
|
|
6386
6386
|
//#endregion
|
|
6387
6387
|
//#region src/question/player/QuestionBlankGroupPlayer.tsx
|
|
6388
|
-
function
|
|
6388
|
+
function bl({ disabled: e, item: t, messages: n, onChange: r, response: i, responseIndex: s, showAnswer: c }) {
|
|
6389
6389
|
let l = rc(i, s, t.blanks), u = Yn(t.answers, t.blanks).map((e, r) => ({
|
|
6390
6390
|
kind: "detailed",
|
|
6391
|
-
contents: e.answerPools.map((e, t) => /* @__PURE__ */ a(
|
|
6392
|
-
marker:
|
|
6391
|
+
contents: e.answerPools.map((e, t) => /* @__PURE__ */ a(J, { content: e }, `group-${r}-answer-${t}`)),
|
|
6392
|
+
marker: Vc(e.blankIds, t.blanks, n.blankLabel)
|
|
6393
6393
|
}));
|
|
6394
6394
|
function d(e, t) {
|
|
6395
6395
|
r(j(j({}, l), {}, { answers: j(j({}, l.answers), {}, { [e]: t }) }));
|
|
6396
6396
|
}
|
|
6397
6397
|
return /* @__PURE__ */ o("div", {
|
|
6398
|
-
className:
|
|
6398
|
+
className: q["control-list"],
|
|
6399
6399
|
children: [t.blanks.map((t, r) => /* @__PURE__ */ o("label", {
|
|
6400
|
-
className:
|
|
6400
|
+
className: q.field,
|
|
6401
6401
|
children: [/* @__PURE__ */ o("span", {
|
|
6402
|
-
className:
|
|
6402
|
+
className: q["field-label"],
|
|
6403
6403
|
children: [
|
|
6404
6404
|
n.blankLabel,
|
|
6405
6405
|
" ",
|
|
6406
6406
|
r + 1
|
|
6407
6407
|
]
|
|
6408
6408
|
}), /* @__PURE__ */ a("input", {
|
|
6409
|
-
className:
|
|
6409
|
+
className: q.input,
|
|
6410
6410
|
disabled: e,
|
|
6411
6411
|
onChange: (e) => d(t, e.target.value),
|
|
6412
|
-
value:
|
|
6412
|
+
value: Sl(l.answers, t)
|
|
6413
6413
|
})]
|
|
6414
|
-
},
|
|
6414
|
+
}, xl(t, r))), c ? /* @__PURE__ */ a(Y, {
|
|
6415
6415
|
groups: u,
|
|
6416
6416
|
title: n.standardAnswer
|
|
6417
6417
|
}) : null]
|
|
6418
6418
|
});
|
|
6419
6419
|
}
|
|
6420
|
-
function
|
|
6420
|
+
function xl(e, t) {
|
|
6421
6421
|
return e || `blank-${t + 1}`;
|
|
6422
6422
|
}
|
|
6423
|
-
function
|
|
6423
|
+
function Sl(e, t) {
|
|
6424
6424
|
var n, r;
|
|
6425
6425
|
return (n = (r = Object.entries(e).find(([e]) => e === t)) == null ? void 0 : r[1]) == null ? "" : n;
|
|
6426
6426
|
}
|
|
6427
6427
|
//#endregion
|
|
6428
6428
|
//#region src/question/renderers/classificationAnswers.tsx
|
|
6429
|
-
function
|
|
6429
|
+
function Cl(e) {
|
|
6430
6430
|
return e.categories.map((t) => ({
|
|
6431
6431
|
kind: "detailed",
|
|
6432
|
-
contents: e.items.filter((n) => e.answers[n.id] === t.id).map((e) => /* @__PURE__ */ a(
|
|
6432
|
+
contents: e.items.filter((n) => e.answers[n.id] === t.id).map((e) => /* @__PURE__ */ a(J, { content: e.content }, `${t.id}-${e.id}`)),
|
|
6433
6433
|
marker: t.content.text || t.id
|
|
6434
6434
|
}));
|
|
6435
6435
|
}
|
|
6436
6436
|
//#endregion
|
|
6437
6437
|
//#region src/question/player/QuestionClassificationPlayer.tsx
|
|
6438
|
-
function
|
|
6439
|
-
let [l, u] = h(""), d = sc(i, s), f =
|
|
6438
|
+
function wl({ disabled: e, item: t, messages: n, onChange: r, response: i, responseIndex: s, showAnswer: c }) {
|
|
6439
|
+
let [l, u] = h(""), d = sc(i, s), f = El(d.placements, t), p = t.items.find((e) => e.id === l);
|
|
6440
6440
|
function m(e, n) {
|
|
6441
|
-
r(j(j({}, d), {}, { placements:
|
|
6441
|
+
r(j(j({}, d), {}, { placements: El(yc(f, e, n), t) })), u("");
|
|
6442
6442
|
}
|
|
6443
6443
|
function g(t, n) {
|
|
6444
6444
|
t.preventDefault();
|
|
@@ -6446,10 +6446,10 @@ function Tl({ disabled: e, item: t, messages: n, onChange: r, response: i, respo
|
|
|
6446
6446
|
!e && r && m(r, n);
|
|
6447
6447
|
}
|
|
6448
6448
|
function _(n) {
|
|
6449
|
-
let r = l === n.id, i =
|
|
6449
|
+
let r = l === n.id, i = Tl(n.id, f, t, c);
|
|
6450
6450
|
return /* @__PURE__ */ a("button", {
|
|
6451
6451
|
"aria-pressed": r,
|
|
6452
|
-
className:
|
|
6452
|
+
className: U(fl.item, r && fl.selected, i === "correct" && fl.correct, i === "incorrect" && fl.incorrect, i === "unanswered" && fl.unanswered),
|
|
6453
6453
|
"data-status": i,
|
|
6454
6454
|
"data-testid": `classification-player-item-${n.id}`,
|
|
6455
6455
|
disabled: e,
|
|
@@ -6461,99 +6461,99 @@ function Tl({ disabled: e, item: t, messages: n, onChange: r, response: i, respo
|
|
|
6461
6461
|
e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("question/classification-item", n.id);
|
|
6462
6462
|
},
|
|
6463
6463
|
type: "button",
|
|
6464
|
-
children: /* @__PURE__ */ a(
|
|
6464
|
+
children: /* @__PURE__ */ a(J, { content: n.content })
|
|
6465
6465
|
}, n.id);
|
|
6466
6466
|
}
|
|
6467
6467
|
return /* @__PURE__ */ o("div", {
|
|
6468
|
-
className:
|
|
6468
|
+
className: G.element,
|
|
6469
6469
|
children: [/* @__PURE__ */ o("div", {
|
|
6470
|
-
className:
|
|
6470
|
+
className: fl.board,
|
|
6471
6471
|
children: [/* @__PURE__ */ a("div", {
|
|
6472
|
-
className:
|
|
6472
|
+
className: fl.zones,
|
|
6473
6473
|
"data-testid": "classification-zones",
|
|
6474
6474
|
children: t.categories.map((e) => {
|
|
6475
6475
|
let r = t.items.filter((t) => f[t.id] === e.id);
|
|
6476
6476
|
return /* @__PURE__ */ o("section", {
|
|
6477
|
-
className:
|
|
6477
|
+
className: fl.zone,
|
|
6478
6478
|
onClick: () => p ? m(p.id, e.id) : void 0,
|
|
6479
6479
|
onDragOver: (e) => e.preventDefault(),
|
|
6480
6480
|
onDrop: (t) => g(t, e.id),
|
|
6481
6481
|
children: [/* @__PURE__ */ a("div", {
|
|
6482
|
-
className:
|
|
6483
|
-
children: /* @__PURE__ */ a(
|
|
6482
|
+
className: fl["zone-title"],
|
|
6483
|
+
children: /* @__PURE__ */ a(J, { content: e.content })
|
|
6484
6484
|
}), r.length > 0 ? r.map((e) => _(e)) : /* @__PURE__ */ a("span", {
|
|
6485
|
-
className:
|
|
6485
|
+
className: fl.empty,
|
|
6486
6486
|
children: n.unassigned
|
|
6487
6487
|
})]
|
|
6488
6488
|
}, e.id);
|
|
6489
6489
|
})
|
|
6490
6490
|
}), /* @__PURE__ */ a("section", {
|
|
6491
|
-
className:
|
|
6491
|
+
className: fl.pool,
|
|
6492
6492
|
"data-testid": "classification-pool",
|
|
6493
6493
|
onClick: () => p ? m(p.id, "") : void 0,
|
|
6494
6494
|
onDragOver: (e) => e.preventDefault(),
|
|
6495
6495
|
onDrop: (e) => g(e, ""),
|
|
6496
6496
|
children: t.items.filter((e) => !f[e.id]).map((e) => _(e))
|
|
6497
6497
|
})]
|
|
6498
|
-
}), c ? /* @__PURE__ */ a(
|
|
6499
|
-
groups:
|
|
6498
|
+
}), c ? /* @__PURE__ */ a(Y, {
|
|
6499
|
+
groups: Cl(t),
|
|
6500
6500
|
title: n.standardAnswer
|
|
6501
6501
|
}) : null]
|
|
6502
6502
|
});
|
|
6503
6503
|
}
|
|
6504
|
-
function
|
|
6504
|
+
function Tl(e, t, n, r) {
|
|
6505
6505
|
var i, a;
|
|
6506
6506
|
let o = (i = t[e]) == null ? "" : i, s = (a = n.answers[e]) == null ? "" : a;
|
|
6507
6507
|
if (!(!r || !s)) return o ? s === o ? "correct" : "incorrect" : "unanswered";
|
|
6508
6508
|
}
|
|
6509
|
-
function
|
|
6509
|
+
function El(e, t) {
|
|
6510
6510
|
return Qe(e, t.categories, t.items);
|
|
6511
6511
|
}
|
|
6512
6512
|
//#endregion
|
|
6513
6513
|
//#region src/question/renderers/QuestionRichContentWithBlankView.tsx
|
|
6514
|
-
function
|
|
6515
|
-
let { renderer: r } =
|
|
6514
|
+
function Dl({ className: e, content: t, renderBlank: n }) {
|
|
6515
|
+
let { renderer: r } = K(), i = /* @__PURE__ */ new Map();
|
|
6516
6516
|
return /* @__PURE__ */ a("div", {
|
|
6517
6517
|
className: [r["rich-content"], e == null ? "" : e].filter(Boolean).join(" "),
|
|
6518
|
-
children: t.json.map((e, t) =>
|
|
6518
|
+
children: t.json.map((e, t) => Ol(e, {
|
|
6519
6519
|
blankIndexes: i,
|
|
6520
6520
|
key: `node-${t}`,
|
|
6521
6521
|
renderBlank: n
|
|
6522
6522
|
}))
|
|
6523
6523
|
});
|
|
6524
6524
|
}
|
|
6525
|
-
function
|
|
6526
|
-
return typeof e.text == "string" ? /* @__PURE__ */ a(c, { children: e.text }, t.key) : e.type === "blank" ? /* @__PURE__ */ a(c, { children:
|
|
6525
|
+
function Ol(e, t) {
|
|
6526
|
+
return typeof e.text == "string" ? /* @__PURE__ */ a(c, { children: e.text }, t.key) : e.type === "blank" ? /* @__PURE__ */ a(c, { children: Al(e, t) }, t.key) : kl(e, t);
|
|
6527
6527
|
}
|
|
6528
|
-
function
|
|
6528
|
+
function kl(e, t) {
|
|
6529
6529
|
if (e.type === "image" || e.type === "formula") return /* @__PURE__ */ a("span", { dangerouslySetInnerHTML: { __html: r([e]) } }, t.key);
|
|
6530
|
-
let n =
|
|
6530
|
+
let n = Ml(e.children, t);
|
|
6531
6531
|
switch (e.type) {
|
|
6532
|
-
case "heading": return
|
|
6532
|
+
case "heading": return Nl(e, n, t.key);
|
|
6533
6533
|
case "table": return /* @__PURE__ */ a("table", { children: n }, t.key);
|
|
6534
6534
|
case "table-row": return /* @__PURE__ */ a("tr", { children: n }, t.key);
|
|
6535
6535
|
case "table-cell": return /* @__PURE__ */ a("td", { children: n }, t.key);
|
|
6536
6536
|
default: return /* @__PURE__ */ a("p", { children: n }, t.key);
|
|
6537
6537
|
}
|
|
6538
6538
|
}
|
|
6539
|
-
function
|
|
6540
|
-
let n =
|
|
6539
|
+
function Al(e, t) {
|
|
6540
|
+
let n = Pl(e.blankId), r = jl(t.blankIndexes, n);
|
|
6541
6541
|
return t.renderBlank({
|
|
6542
6542
|
blankId: n,
|
|
6543
6543
|
index: r,
|
|
6544
|
-
label:
|
|
6544
|
+
label: Pl(e.label)
|
|
6545
6545
|
});
|
|
6546
6546
|
}
|
|
6547
|
-
function
|
|
6547
|
+
function jl(e, t) {
|
|
6548
6548
|
let n = e.get(t);
|
|
6549
6549
|
if (n !== void 0) return n;
|
|
6550
6550
|
let r = e.size;
|
|
6551
6551
|
return e.set(t, r), r;
|
|
6552
6552
|
}
|
|
6553
|
-
function
|
|
6554
|
-
return (e == null ? [] : e).map((e, n) =>
|
|
6553
|
+
function Ml(e, t) {
|
|
6554
|
+
return (e == null ? [] : e).map((e, n) => Ol(e, j(j({}, t), {}, { key: `${t.key}-${n}` })));
|
|
6555
6555
|
}
|
|
6556
|
-
function
|
|
6556
|
+
function Nl(e, t, n) {
|
|
6557
6557
|
switch (e.level) {
|
|
6558
6558
|
case 1: return /* @__PURE__ */ a("h1", { children: t }, n);
|
|
6559
6559
|
case 2: return /* @__PURE__ */ a("h2", { children: t }, n);
|
|
@@ -6561,29 +6561,27 @@ function Pl(e, t, n) {
|
|
|
6561
6561
|
default: return /* @__PURE__ */ a("p", { children: t }, n);
|
|
6562
6562
|
}
|
|
6563
6563
|
}
|
|
6564
|
-
function
|
|
6564
|
+
function Pl(e) {
|
|
6565
6565
|
return typeof e == "string" ? e : "";
|
|
6566
6566
|
}
|
|
6567
|
-
var
|
|
6568
|
-
"inline-input": "_inline-
|
|
6569
|
-
"inline-select": "_inline-
|
|
6570
|
-
"inline-blank-underline": "_inline-blank-
|
|
6571
|
-
"inline-blank-content": "_inline-blank-
|
|
6572
|
-
"shared-candidate-
|
|
6573
|
-
"shared-candidate-
|
|
6574
|
-
"shared-candidate-
|
|
6575
|
-
"
|
|
6576
|
-
"
|
|
6577
|
-
"per-blank-candidate-
|
|
6578
|
-
"per-blank-candidate-
|
|
6579
|
-
|
|
6580
|
-
"per-blank-candidate-list": "_per-blank-candidate-list_2je8q_140",
|
|
6581
|
-
selected: "_selected_2je8q_161"
|
|
6567
|
+
var Fl = {
|
|
6568
|
+
"inline-input": "_inline-input_fv4mf_1",
|
|
6569
|
+
"inline-select": "_inline-select_fv4mf_19",
|
|
6570
|
+
"inline-blank-underline": "_inline-blank-underline_fv4mf_43",
|
|
6571
|
+
"inline-blank-content": "_inline-blank-content_fv4mf_56",
|
|
6572
|
+
"shared-candidate-list": "_shared-candidate-list_fv4mf_63",
|
|
6573
|
+
"shared-candidate-item": "_shared-candidate-item_fv4mf_72",
|
|
6574
|
+
"shared-candidate-content": "_shared-candidate-content_fv4mf_88",
|
|
6575
|
+
"per-blank-candidate-options": "_per-blank-candidate-options_fv4mf_94",
|
|
6576
|
+
"per-blank-candidate-group": "_per-blank-candidate-group_fv4mf_101",
|
|
6577
|
+
"per-blank-candidate-title": "_per-blank-candidate-title_fv4mf_108",
|
|
6578
|
+
"per-blank-candidate-list": "_per-blank-candidate-list_fv4mf_127",
|
|
6579
|
+
selected: "_selected_fv4mf_149"
|
|
6582
6580
|
};
|
|
6583
6581
|
//#endregion
|
|
6584
6582
|
//#region src/question/player/QuestionFillTextContentPlayer.tsx
|
|
6585
6583
|
function Il({ answers: e, disabled: t, item: n, messages: r, onAnswerChange: i, structure: o }) {
|
|
6586
|
-
return /* @__PURE__ */ a(
|
|
6584
|
+
return /* @__PURE__ */ a(Dl, {
|
|
6587
6585
|
content: n.content,
|
|
6588
6586
|
renderBlank: (a) => Ll(a, {
|
|
6589
6587
|
answers: e,
|
|
@@ -6601,7 +6599,7 @@ function Ll(e, t) {
|
|
|
6601
6599
|
let e = zl(t.answers, n);
|
|
6602
6600
|
return /* @__PURE__ */ a("input", {
|
|
6603
6601
|
"aria-label": i,
|
|
6604
|
-
className:
|
|
6602
|
+
className: Fl["inline-input"],
|
|
6605
6603
|
disabled: t.disabled,
|
|
6606
6604
|
onChange: (e) => t.onAnswerChange(n, {
|
|
6607
6605
|
kind: "text",
|
|
@@ -6614,9 +6612,9 @@ function Ll(e, t) {
|
|
|
6614
6612
|
let o = zl(t.answers, n), s = Vl(t.item, n, t.structure.config.candidateMode, o);
|
|
6615
6613
|
return /* @__PURE__ */ a("span", {
|
|
6616
6614
|
"aria-label": i,
|
|
6617
|
-
className:
|
|
6618
|
-
children: s ? /* @__PURE__ */ a(
|
|
6619
|
-
className:
|
|
6615
|
+
className: Fl["inline-blank-underline"],
|
|
6616
|
+
children: s ? /* @__PURE__ */ a(J, {
|
|
6617
|
+
className: Fl["inline-blank-content"],
|
|
6620
6618
|
content: s.content
|
|
6621
6619
|
}) : i
|
|
6622
6620
|
});
|
|
@@ -6626,7 +6624,7 @@ function Rl(e, t, n) {
|
|
|
6626
6624
|
let s = zl(n.answers, e), c = (r = ((s == null ? void 0 : s.kind) === "option" ? s.optionIds : []).slice(0, 1)[0]) == null ? "" : r, l = Hl(n.answers, e);
|
|
6627
6625
|
return /* @__PURE__ */ o("select", {
|
|
6628
6626
|
"aria-label": t,
|
|
6629
|
-
className:
|
|
6627
|
+
className: Fl["inline-select"],
|
|
6630
6628
|
disabled: n.disabled,
|
|
6631
6629
|
onChange: (t) => n.onAnswerChange(e, {
|
|
6632
6630
|
kind: "option",
|
|
@@ -6636,10 +6634,14 @@ function Rl(e, t, n) {
|
|
|
6636
6634
|
children: [/* @__PURE__ */ a("option", {
|
|
6637
6635
|
value: "",
|
|
6638
6636
|
children: t
|
|
6639
|
-
}), ((i = n.item.candidateOptions) == null ? [] : i).map((e) => /* @__PURE__ */
|
|
6637
|
+
}), ((i = n.item.candidateOptions) == null ? [] : i).map((e, t) => /* @__PURE__ */ o("option", {
|
|
6640
6638
|
disabled: !n.structure.config.allowCandidateReuse && l.has(e.optionId),
|
|
6641
6639
|
value: e.optionId,
|
|
6642
|
-
children:
|
|
6640
|
+
children: [
|
|
6641
|
+
un("upperAlpha", t),
|
|
6642
|
+
". ",
|
|
6643
|
+
e.content.text
|
|
6644
|
+
]
|
|
6643
6645
|
}, e.optionId))]
|
|
6644
6646
|
});
|
|
6645
6647
|
}
|
|
@@ -6670,16 +6672,16 @@ function Ul(e, t, n) {
|
|
|
6670
6672
|
//#endregion
|
|
6671
6673
|
//#region src/question/player/QuestionFillTextPlayer.tsx
|
|
6672
6674
|
function Wl({ disabled: e, element: t, item: n, messages: r, onChange: i, response: s, responseIndex: c, showAnswer: l }) {
|
|
6673
|
-
let u = An(n, t, !0), d =
|
|
6675
|
+
let u = An(n, t, !0), d = qc(u), f = ic(s, c, t, u.blanks), p = d.map((e, t) => ({
|
|
6674
6676
|
kind: "detailed",
|
|
6675
|
-
contents: e.contents.map((e, n) => /* @__PURE__ */ a(
|
|
6676
|
-
marker:
|
|
6677
|
+
contents: e.contents.map((e, n) => /* @__PURE__ */ a(J, { content: e }, `group-${t}-answer-${n}`)),
|
|
6678
|
+
marker: Vc(e.blankIds, u.blanks, r.blankLabel)
|
|
6677
6679
|
}));
|
|
6678
6680
|
function m(e, t) {
|
|
6679
6681
|
i(j(j({}, f), {}, { answers: j(j({}, f.answers), {}, { [e]: t }) }));
|
|
6680
6682
|
}
|
|
6681
6683
|
return /* @__PURE__ */ o("div", {
|
|
6682
|
-
className:
|
|
6684
|
+
className: q["fill-text"],
|
|
6683
6685
|
children: [
|
|
6684
6686
|
/* @__PURE__ */ a(Il, {
|
|
6685
6687
|
answers: f.answers,
|
|
@@ -6689,38 +6691,35 @@ function Wl({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
6689
6691
|
onAnswerChange: m,
|
|
6690
6692
|
structure: t
|
|
6691
6693
|
}),
|
|
6692
|
-
Gl(u, t.config.candidateMode
|
|
6694
|
+
Gl(u, t.config.candidateMode),
|
|
6693
6695
|
Kl({
|
|
6694
6696
|
disabled: e,
|
|
6695
6697
|
item: u,
|
|
6696
6698
|
onAnswerChange: m,
|
|
6697
6699
|
responseItem: f
|
|
6698
6700
|
}),
|
|
6699
|
-
l ? /* @__PURE__ */ a(
|
|
6701
|
+
l ? /* @__PURE__ */ a(Y, {
|
|
6700
6702
|
groups: p,
|
|
6701
6703
|
title: r.standardAnswer
|
|
6702
6704
|
}) : null
|
|
6703
6705
|
]
|
|
6704
6706
|
});
|
|
6705
6707
|
}
|
|
6706
|
-
function Gl(e, t
|
|
6707
|
-
var
|
|
6708
|
-
let
|
|
6709
|
-
return t !== "sharedPool" ||
|
|
6710
|
-
className:
|
|
6711
|
-
children:
|
|
6712
|
-
className:
|
|
6713
|
-
children:
|
|
6714
|
-
|
|
6715
|
-
|
|
6716
|
-
|
|
6717
|
-
className:
|
|
6718
|
-
|
|
6719
|
-
|
|
6720
|
-
|
|
6721
|
-
})
|
|
6722
|
-
}, e.optionId))
|
|
6723
|
-
})]
|
|
6708
|
+
function Gl(e, t) {
|
|
6709
|
+
var n;
|
|
6710
|
+
let r = (n = e.candidateOptions) == null ? [] : n;
|
|
6711
|
+
return t !== "sharedPool" || r.length === 0 ? null : /* @__PURE__ */ a("ol", {
|
|
6712
|
+
className: Fl["shared-candidate-list"],
|
|
6713
|
+
children: r.map((e, t) => /* @__PURE__ */ o("li", {
|
|
6714
|
+
className: Fl["shared-candidate-item"],
|
|
6715
|
+
children: [/* @__PURE__ */ a("span", {
|
|
6716
|
+
className: G.marker,
|
|
6717
|
+
children: un("upperAlpha", t)
|
|
6718
|
+
}), /* @__PURE__ */ a(J, {
|
|
6719
|
+
className: Fl["shared-candidate-content"],
|
|
6720
|
+
content: e.content
|
|
6721
|
+
})]
|
|
6722
|
+
}, e.optionId))
|
|
6724
6723
|
});
|
|
6725
6724
|
}
|
|
6726
6725
|
function Kl({ disabled: e, item: t, onAnswerChange: n, responseItem: r }) {
|
|
@@ -6733,7 +6732,7 @@ function Kl({ disabled: e, item: t, onAnswerChange: n, responseItem: r }) {
|
|
|
6733
6732
|
}] : e;
|
|
6734
6733
|
}, []);
|
|
6735
6734
|
return i.length === 0 ? null : /* @__PURE__ */ a("div", {
|
|
6736
|
-
className:
|
|
6735
|
+
className: Fl["per-blank-candidate-options"],
|
|
6737
6736
|
children: i.map(({ group: t, marker: i }) => ql({
|
|
6738
6737
|
disabled: e,
|
|
6739
6738
|
group: t,
|
|
@@ -6747,32 +6746,36 @@ function ql({ disabled: e, group: t, marker: n, onAnswerChange: r, responseItem:
|
|
|
6747
6746
|
let s = i.answers[t.blankId];
|
|
6748
6747
|
return /* @__PURE__ */ o("section", {
|
|
6749
6748
|
"aria-label": n,
|
|
6750
|
-
className:
|
|
6749
|
+
className: Fl["per-blank-candidate-group"],
|
|
6751
6750
|
children: [/* @__PURE__ */ a("span", {
|
|
6752
|
-
className:
|
|
6751
|
+
className: Fl["per-blank-candidate-title"],
|
|
6753
6752
|
children: n
|
|
6754
6753
|
}), /* @__PURE__ */ a("div", {
|
|
6755
|
-
className:
|
|
6756
|
-
children: t.options.map((n) => Jl({
|
|
6754
|
+
className: Fl["per-blank-candidate-list"],
|
|
6755
|
+
children: t.options.map((n, i) => Jl({
|
|
6757
6756
|
activeAnswer: s,
|
|
6758
6757
|
blankId: t.blankId,
|
|
6759
6758
|
disabled: e,
|
|
6760
6759
|
onAnswerChange: r,
|
|
6761
|
-
option: n
|
|
6760
|
+
option: n,
|
|
6761
|
+
optionIndex: i
|
|
6762
6762
|
}))
|
|
6763
6763
|
})]
|
|
6764
6764
|
}, t.blankId);
|
|
6765
6765
|
}
|
|
6766
|
-
function Jl({ activeAnswer: e, blankId: t, disabled: n, onAnswerChange: r, option: i }) {
|
|
6767
|
-
let
|
|
6768
|
-
return /* @__PURE__ */
|
|
6769
|
-
"aria-pressed":
|
|
6770
|
-
className:
|
|
6771
|
-
"data-selected":
|
|
6766
|
+
function Jl({ activeAnswer: e, blankId: t, disabled: n, onAnswerChange: r, option: i, optionIndex: s }) {
|
|
6767
|
+
let c = (e == null ? void 0 : e.kind) === "option" && e.optionIds.includes(i.optionId);
|
|
6768
|
+
return /* @__PURE__ */ o("button", {
|
|
6769
|
+
"aria-pressed": c,
|
|
6770
|
+
className: c ? Fl.selected : void 0,
|
|
6771
|
+
"data-selected": c ? "true" : void 0,
|
|
6772
6772
|
disabled: n,
|
|
6773
6773
|
onClick: () => r(t, gc(e, i.optionId, "single")),
|
|
6774
6774
|
type: "button",
|
|
6775
|
-
children: /* @__PURE__ */ a(
|
|
6775
|
+
children: [/* @__PURE__ */ a("span", {
|
|
6776
|
+
className: G.marker,
|
|
6777
|
+
children: un("upperAlpha", s)
|
|
6778
|
+
}), /* @__PURE__ */ a(J, { content: i.content })]
|
|
6776
6779
|
}, i.optionId);
|
|
6777
6780
|
}
|
|
6778
6781
|
var X = {
|
|
@@ -6800,13 +6803,13 @@ function Yl({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
6800
6803
|
i(j(j({}, u), {}, { selectedValues: u.selectedValues[0] === e ? [] : [e] }));
|
|
6801
6804
|
}
|
|
6802
6805
|
return /* @__PURE__ */ o("div", {
|
|
6803
|
-
className:
|
|
6806
|
+
className: G.element,
|
|
6804
6807
|
children: [/* @__PURE__ */ a("ol", {
|
|
6805
|
-
className:
|
|
6808
|
+
className: U(G["judgement-list"], X["judgement-list"]),
|
|
6806
6809
|
children: d.map(({ label: t, value: n }) => {
|
|
6807
6810
|
let r = u.selectedValues[0] === n;
|
|
6808
6811
|
return /* @__PURE__ */ a("li", {
|
|
6809
|
-
className:
|
|
6812
|
+
className: U(G["judgement-item"], X["judgement-option"], r && X.selected),
|
|
6810
6813
|
"data-selected": r ? "true" : void 0,
|
|
6811
6814
|
children: /* @__PURE__ */ a("button", {
|
|
6812
6815
|
"aria-pressed": r,
|
|
@@ -6818,7 +6821,7 @@ function Yl({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
6818
6821
|
})
|
|
6819
6822
|
}, String(n));
|
|
6820
6823
|
})
|
|
6821
|
-
}), l ? /* @__PURE__ */ a(
|
|
6824
|
+
}), l ? /* @__PURE__ */ a(Y, {
|
|
6822
6825
|
groups: f,
|
|
6823
6826
|
title: r.standardAnswer
|
|
6824
6827
|
}) : null]
|
|
@@ -6836,7 +6839,7 @@ function Xl(e) {
|
|
|
6836
6839
|
contents: ((s = e.answers[n.itemId]) == null ? [] : s).map((e) => {
|
|
6837
6840
|
let n = t.get(e);
|
|
6838
6841
|
return n && nt(i, n.columnIndex) ? n.item : void 0;
|
|
6839
|
-
}).filter((e) => !!e).map((e, t) => /* @__PURE__ */ a(
|
|
6842
|
+
}).filter((e) => !!e).map((e, t) => /* @__PURE__ */ a(J, { content: e.content }, `${n.itemId}-${e.itemId}-${t}`)),
|
|
6840
6843
|
marker: dn(r.labelStyle, o)
|
|
6841
6844
|
};
|
|
6842
6845
|
});
|
|
@@ -6912,7 +6915,7 @@ function Ql({ disabled: e, item: t, messages: n, onChange: r, response: i, respo
|
|
|
6912
6915
|
});
|
|
6913
6916
|
}
|
|
6914
6917
|
return /* @__PURE__ */ o("div", {
|
|
6915
|
-
className:
|
|
6918
|
+
className: G.element,
|
|
6916
6919
|
children: [/* @__PURE__ */ o("div", {
|
|
6917
6920
|
className: V.board,
|
|
6918
6921
|
"data-testid": "line-connect-player-board",
|
|
@@ -6948,7 +6951,7 @@ function Ql({ disabled: e, item: t, messages: n, onChange: r, response: i, respo
|
|
|
6948
6951
|
}), t.items.map((n, i) => {
|
|
6949
6952
|
let s = dn(t.labelStyle, i), c = (l == null ? void 0 : l.itemId) === n.itemId;
|
|
6950
6953
|
return /* @__PURE__ */ a("div", {
|
|
6951
|
-
className:
|
|
6954
|
+
className: U(V.item, c && V.selected),
|
|
6952
6955
|
"data-selected": c ? "true" : void 0,
|
|
6953
6956
|
"data-testid": `line-connect-player-item-${n.itemId}`,
|
|
6954
6957
|
ref: T(n.itemId),
|
|
@@ -6961,13 +6964,13 @@ function Ql({ disabled: e, item: t, messages: n, onChange: r, response: i, respo
|
|
|
6961
6964
|
children: [s ? /* @__PURE__ */ a("span", {
|
|
6962
6965
|
className: V.marker,
|
|
6963
6966
|
children: s
|
|
6964
|
-
}) : null, /* @__PURE__ */ a(
|
|
6967
|
+
}) : null, /* @__PURE__ */ a(J, { content: n.content })]
|
|
6965
6968
|
})
|
|
6966
6969
|
}, n.itemId);
|
|
6967
6970
|
})]
|
|
6968
6971
|
}, t.columnId))
|
|
6969
6972
|
})]
|
|
6970
|
-
}), c ? /* @__PURE__ */ a(
|
|
6973
|
+
}), c ? /* @__PURE__ */ a(Y, {
|
|
6971
6974
|
groups: Xl(t),
|
|
6972
6975
|
title: n.standardAnswer
|
|
6973
6976
|
}) : null]
|
|
@@ -6990,7 +6993,7 @@ function eu(e) {
|
|
|
6990
6993
|
contents: ((i = e.answers[t.itemId]) == null ? [] : i).reduce((e, t) => {
|
|
6991
6994
|
let n = o.get(t);
|
|
6992
6995
|
return n ? [...e, n] : e;
|
|
6993
|
-
}, []).map((e, n) => /* @__PURE__ */ a(
|
|
6996
|
+
}, []).map((e, n) => /* @__PURE__ */ a(J, { content: e.content }, `${t.itemId}-${e.itemId}-${n}`)),
|
|
6994
6997
|
marker: fn((s = r == null ? void 0 : r.labelStyle) == null ? "number" : s, n)
|
|
6995
6998
|
};
|
|
6996
6999
|
});
|
|
@@ -7028,7 +7031,7 @@ function tu(e) {
|
|
|
7028
7031
|
});
|
|
7029
7032
|
}
|
|
7030
7033
|
function nu(e, t, n) {
|
|
7031
|
-
return fn(e.labelStyle, n) || /* @__PURE__ */ a(
|
|
7034
|
+
return fn(e.labelStyle, n) || /* @__PURE__ */ a(J, { content: t.content });
|
|
7032
7035
|
}
|
|
7033
7036
|
var ru = {
|
|
7034
7037
|
board: "_board_1q6ar_1",
|
|
@@ -7064,7 +7067,7 @@ function iu({ disabled: e, item: t, messages: n, onChange: r, response: i, respo
|
|
|
7064
7067
|
let r = (l == null ? void 0 : l.itemId) === t.item.itemId;
|
|
7065
7068
|
return /* @__PURE__ */ o("button", {
|
|
7066
7069
|
"aria-pressed": r,
|
|
7067
|
-
className:
|
|
7070
|
+
className: U(ru.item, r && ru.selected, n && ru.matched),
|
|
7068
7071
|
"data-testid": `matching-player-item-${t.item.itemId}`,
|
|
7069
7072
|
disabled: e,
|
|
7070
7073
|
onClick: () => p(t.columnIndex, t.item.itemId),
|
|
@@ -7072,11 +7075,11 @@ function iu({ disabled: e, item: t, messages: n, onChange: r, response: i, respo
|
|
|
7072
7075
|
children: [t.marker ? /* @__PURE__ */ a("span", {
|
|
7073
7076
|
className: ru.marker,
|
|
7074
7077
|
children: t.marker
|
|
7075
|
-
}) : null, /* @__PURE__ */ a(
|
|
7078
|
+
}) : null, /* @__PURE__ */ a(J, { content: t.item.content })]
|
|
7076
7079
|
}, t.item.itemId);
|
|
7077
7080
|
}
|
|
7078
7081
|
return /* @__PURE__ */ o("div", {
|
|
7079
|
-
className:
|
|
7082
|
+
className: G.element,
|
|
7080
7083
|
children: [/* @__PURE__ */ o("div", {
|
|
7081
7084
|
className: ru.board,
|
|
7082
7085
|
children: [f.rows.length > 0 ? /* @__PURE__ */ a("div", {
|
|
@@ -7096,7 +7099,7 @@ function iu({ disabled: e, item: t, messages: n, onChange: r, response: i, respo
|
|
|
7096
7099
|
}, (r = (i = t.columns[n]) == null ? void 0 : i.columnId) == null ? n : r);
|
|
7097
7100
|
})
|
|
7098
7101
|
}) : null]
|
|
7099
|
-
}), c ? /* @__PURE__ */ a(
|
|
7102
|
+
}), c ? /* @__PURE__ */ a(Y, {
|
|
7100
7103
|
groups: eu(t),
|
|
7101
7104
|
title: n.standardAnswer
|
|
7102
7105
|
}) : null]
|
|
@@ -7144,7 +7147,7 @@ var cu = { list: "_list_1xo1n_1" }, lu = {
|
|
|
7144
7147
|
//#endregion
|
|
7145
7148
|
//#region src/question/renderers/QuestionColumnLayout.tsx
|
|
7146
7149
|
function uu({ children: e, className: t, columnCount: n, dataAttributes: r, layoutRef: i, role: c, style: l }) {
|
|
7147
|
-
let { columnLayout: u, systemListMarkup: d } =
|
|
7150
|
+
let { columnLayout: u, systemListMarkup: d } = W(), f = Math.max(1, Math.floor(n));
|
|
7148
7151
|
if (u === "document-table") {
|
|
7149
7152
|
let n = du(s.toArray(e), f), l = `${100 / f}%`, u = t ? `${lu.table} ${t}` : lu.table;
|
|
7150
7153
|
return /* @__PURE__ */ o("table", j(j({}, r), {}, {
|
|
@@ -7184,7 +7187,7 @@ function du(e, t) {
|
|
|
7184
7187
|
//#endregion
|
|
7185
7188
|
//#region src/question/renderers/QuestionAdaptiveOptionList.tsx
|
|
7186
7189
|
function fu({ children: e }) {
|
|
7187
|
-
let { renderer: t } =
|
|
7190
|
+
let { renderer: t } = K(), n = m(null), [r, i] = h(1), o = { gridTemplateColumns: `repeat(${r}, minmax(0, 1fr))` };
|
|
7188
7191
|
return f(() => {
|
|
7189
7192
|
if (!n.current) return;
|
|
7190
7193
|
let t = n.current, r = null;
|
|
@@ -7251,14 +7254,14 @@ function hu({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7251
7254
|
if (t.config.renderer === "table") {
|
|
7252
7255
|
let i = ou(t, n);
|
|
7253
7256
|
return /* @__PURE__ */ o("div", {
|
|
7254
|
-
className:
|
|
7257
|
+
className: G.element,
|
|
7255
7258
|
children: [/* @__PURE__ */ a("div", {
|
|
7256
|
-
className:
|
|
7259
|
+
className: ml["table-wrap"],
|
|
7257
7260
|
children: /* @__PURE__ */ o("table", {
|
|
7258
|
-
className:
|
|
7261
|
+
className: ml.table,
|
|
7259
7262
|
children: [
|
|
7260
|
-
/* @__PURE__ */ o("colgroup", { children: [/* @__PURE__ */ a("col", { className:
|
|
7261
|
-
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ o("tr", { children: [/* @__PURE__ */ a("th", { children: r.option }), n.columns.map((e) => /* @__PURE__ */ a("th", { children: /* @__PURE__ */ a(
|
|
7263
|
+
/* @__PURE__ */ o("colgroup", { children: [/* @__PURE__ */ a("col", { className: ml["table-option-column"] }), n.columns.map((e) => /* @__PURE__ */ a("col", {}, e.id))] }),
|
|
7264
|
+
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ o("tr", { children: [/* @__PURE__ */ a("th", { children: r.option }), n.columns.map((e) => /* @__PURE__ */ a("th", { children: /* @__PURE__ */ a(J, { content: e.content }) }, e.id))] }) }),
|
|
7262
7265
|
/* @__PURE__ */ a("tbody", { children: d.map((t) => {
|
|
7263
7266
|
let n = u.selectedOptionIds.includes(t.optionId);
|
|
7264
7267
|
return /* @__PURE__ */ o("tr", {
|
|
@@ -7271,7 +7274,7 @@ function hu({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7271
7274
|
onClick: () => f(t.optionId),
|
|
7272
7275
|
type: "button",
|
|
7273
7276
|
children: /* @__PURE__ */ a("span", {
|
|
7274
|
-
className:
|
|
7277
|
+
className: U(G.marker, X["table-option-marker"]),
|
|
7275
7278
|
"data-selected": n ? "true" : void 0,
|
|
7276
7279
|
children: t.marker
|
|
7277
7280
|
})
|
|
@@ -7281,13 +7284,13 @@ function hu({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7281
7284
|
"aria-pressed": n,
|
|
7282
7285
|
onClick: () => f(t.optionId),
|
|
7283
7286
|
type: "button",
|
|
7284
|
-
children: /* @__PURE__ */ a(
|
|
7287
|
+
children: /* @__PURE__ */ a(J, { content: r })
|
|
7285
7288
|
}) }, `${t.optionId}-cell-${i}`))]
|
|
7286
7289
|
}, t.optionId);
|
|
7287
7290
|
}) })
|
|
7288
7291
|
]
|
|
7289
7292
|
})
|
|
7290
|
-
}), l ? /* @__PURE__ */ a(
|
|
7293
|
+
}), l ? /* @__PURE__ */ a(Y, {
|
|
7291
7294
|
groups: i,
|
|
7292
7295
|
title: r.standardAnswer
|
|
7293
7296
|
}) : null]
|
|
@@ -7295,11 +7298,11 @@ function hu({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7295
7298
|
}
|
|
7296
7299
|
let p = ou(t, n);
|
|
7297
7300
|
return /* @__PURE__ */ o("div", {
|
|
7298
|
-
className:
|
|
7301
|
+
className: G.element,
|
|
7299
7302
|
children: [/* @__PURE__ */ a(fu, { children: d.map((t) => {
|
|
7300
7303
|
let n = u.selectedOptionIds.includes(t.optionId);
|
|
7301
7304
|
return /* @__PURE__ */ a("li", {
|
|
7302
|
-
className:
|
|
7305
|
+
className: U(G["option-item"], X["choice-option"], n && X.selected),
|
|
7303
7306
|
"data-selected": n ? "true" : void 0,
|
|
7304
7307
|
children: /* @__PURE__ */ o("button", {
|
|
7305
7308
|
className: X["choice-button"],
|
|
@@ -7308,13 +7311,13 @@ function hu({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7308
7311
|
onClick: () => f(t.optionId),
|
|
7309
7312
|
type: "button",
|
|
7310
7313
|
children: [/* @__PURE__ */ a("span", {
|
|
7311
|
-
className:
|
|
7314
|
+
className: U(G.marker, X["option-marker"]),
|
|
7312
7315
|
"data-selected": n ? "true" : void 0,
|
|
7313
7316
|
children: t.marker
|
|
7314
|
-
}), /* @__PURE__ */ a(
|
|
7317
|
+
}), /* @__PURE__ */ a(J, { content: t.standardContent })]
|
|
7315
7318
|
})
|
|
7316
7319
|
}, t.optionId);
|
|
7317
|
-
}) }), l ? /* @__PURE__ */ a(
|
|
7320
|
+
}) }), l ? /* @__PURE__ */ a(Y, {
|
|
7318
7321
|
groups: p,
|
|
7319
7322
|
title: r.standardAnswer
|
|
7320
7323
|
}) : null]
|
|
@@ -7328,7 +7331,7 @@ function gu(e) {
|
|
|
7328
7331
|
let n = t.get(e);
|
|
7329
7332
|
return {
|
|
7330
7333
|
kind: "detailed",
|
|
7331
|
-
contents: n ? [/* @__PURE__ */ a(
|
|
7334
|
+
contents: n ? [/* @__PURE__ */ a(J, { content: n.option.content }, e)] : [],
|
|
7332
7335
|
marker: n ? String(n.number) : ""
|
|
7333
7336
|
};
|
|
7334
7337
|
});
|
|
@@ -7341,17 +7344,17 @@ function _u({ disabled: e, item: t, messages: n, onChange: r, response: i, respo
|
|
|
7341
7344
|
r(j(j({}, l), {}, { orderedOptionIds: bc(l.orderedOptionIds, t, e, n) }));
|
|
7342
7345
|
}
|
|
7343
7346
|
return /* @__PURE__ */ o("div", {
|
|
7344
|
-
className:
|
|
7347
|
+
className: G.element,
|
|
7345
7348
|
children: [/* @__PURE__ */ a("ol", {
|
|
7346
|
-
className:
|
|
7349
|
+
className: G["option-list"],
|
|
7347
7350
|
children: d.map(({ number: t, option: r }, i) => /* @__PURE__ */ o("li", {
|
|
7348
|
-
className:
|
|
7351
|
+
className: U(G["option-item"], X["choice-option"]),
|
|
7349
7352
|
children: [
|
|
7350
7353
|
/* @__PURE__ */ a("span", {
|
|
7351
|
-
className:
|
|
7354
|
+
className: G.marker,
|
|
7352
7355
|
children: t
|
|
7353
7356
|
}),
|
|
7354
|
-
/* @__PURE__ */ a(
|
|
7357
|
+
/* @__PURE__ */ a(J, { content: r.content }),
|
|
7355
7358
|
/* @__PURE__ */ o("span", {
|
|
7356
7359
|
className: X["ordering-controls"],
|
|
7357
7360
|
children: [/* @__PURE__ */ a("button", {
|
|
@@ -7372,7 +7375,7 @@ function _u({ disabled: e, item: t, messages: n, onChange: r, response: i, respo
|
|
|
7372
7375
|
})
|
|
7373
7376
|
]
|
|
7374
7377
|
}, r.id))
|
|
7375
|
-
}), c ? /* @__PURE__ */ a(
|
|
7378
|
+
}), c ? /* @__PURE__ */ a(Y, {
|
|
7376
7379
|
groups: gu(t),
|
|
7377
7380
|
title: n.standardAnswer
|
|
7378
7381
|
}) : null]
|
|
@@ -7381,7 +7384,7 @@ function _u({ disabled: e, item: t, messages: n, onChange: r, response: i, respo
|
|
|
7381
7384
|
//#endregion
|
|
7382
7385
|
//#region src/question/renderers/QuestionTextMarkerContent.tsx
|
|
7383
7386
|
function vu({ answerMarkers: e = [], content: t, disabled: n = !1, onMarkerClick: r, selectedMarkers: i = [], showAnswer: o = !1 }) {
|
|
7384
|
-
let { textMarker: s } =
|
|
7387
|
+
let { textMarker: s } = K(), l = t.json.length ? t.json : [{
|
|
7385
7388
|
children: [{ text: t.text }],
|
|
7386
7389
|
type: "paragraph"
|
|
7387
7390
|
}];
|
|
@@ -7448,7 +7451,7 @@ function xu({ item: e, messages: t, showAnswer: n }) {
|
|
|
7448
7451
|
answerMarkers: e.answers,
|
|
7449
7452
|
content: e.content,
|
|
7450
7453
|
showAnswer: n
|
|
7451
|
-
}), n ? /* @__PURE__ */ a(
|
|
7454
|
+
}), n ? /* @__PURE__ */ a(Y, {
|
|
7452
7455
|
groups: [{
|
|
7453
7456
|
kind: "detailed",
|
|
7454
7457
|
contents: r,
|
|
@@ -7477,7 +7480,7 @@ function Su({ disabled: e, item: t, messages: n, onChange: r, response: i, respo
|
|
|
7477
7480
|
//#region src/question/player/QuestionTextResponsePlayer.tsx
|
|
7478
7481
|
function Cu({ disabled: e, locale: t, label: n, messages: r, onChange: i, response: o, responseIndex: s, uploadImage: c }) {
|
|
7479
7482
|
let l = fc(o, s);
|
|
7480
|
-
return e ? F(l.content) ? null : /* @__PURE__ */ a(
|
|
7483
|
+
return e ? F(l.content) ? null : /* @__PURE__ */ a(J, { content: l.content }) : /* @__PURE__ */ a(Ha, {
|
|
7481
7484
|
ariaLabel: n,
|
|
7482
7485
|
locale: t,
|
|
7483
7486
|
onChange: (e) => i({
|
|
@@ -7498,7 +7501,7 @@ function wu(e, t) {
|
|
|
7498
7501
|
let o = (i = e.answers[r]) == null ? void 0 : i.trim();
|
|
7499
7502
|
return o ? [...n, {
|
|
7500
7503
|
kind: "detailed",
|
|
7501
|
-
contents: [/* @__PURE__ */ a(
|
|
7504
|
+
contents: [/* @__PURE__ */ a(J, { content: P(o) }, `${r}-answer`)],
|
|
7502
7505
|
marker: t([r], e.blanks)
|
|
7503
7506
|
}] : n;
|
|
7504
7507
|
}, []);
|
|
@@ -7512,7 +7515,7 @@ var Tu = {
|
|
|
7512
7515
|
//#endregion
|
|
7513
7516
|
//#region src/question/player/QuestionWordBuilderPlayer.tsx
|
|
7514
7517
|
function Eu({ disabled: e, element: t, item: n, messages: r, onChange: i, response: s, responseIndex: c, showAnswer: l }) {
|
|
7515
|
-
let u = kn(n, !0, t), d = ac(s, c, u.blanks), f = wu(u, (e, t) =>
|
|
7518
|
+
let u = kn(n, !0, t), d = ac(s, c, u.blanks), f = wu(u, (e, t) => Vc(e, t, r.blankLabel));
|
|
7516
7519
|
function p(e, t) {
|
|
7517
7520
|
i(j(j({}, d), {}, { answers: j(j({}, d.answers), {}, { [e]: t }) }));
|
|
7518
7521
|
}
|
|
@@ -7538,9 +7541,9 @@ function Eu({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7538
7541
|
r && h(n, r);
|
|
7539
7542
|
}
|
|
7540
7543
|
return /* @__PURE__ */ o("div", {
|
|
7541
|
-
className:
|
|
7544
|
+
className: q["fill-text"],
|
|
7542
7545
|
children: [
|
|
7543
|
-
/* @__PURE__ */ a(
|
|
7546
|
+
/* @__PURE__ */ a(Dl, {
|
|
7544
7547
|
content: u.content,
|
|
7545
7548
|
renderBlank: ({ blankId: t, index: n, label: i }) => {
|
|
7546
7549
|
var o, s;
|
|
@@ -7577,7 +7580,7 @@ function Eu({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7577
7580
|
children: t
|
|
7578
7581
|
}, `${t}-${n}`))
|
|
7579
7582
|
}),
|
|
7580
|
-
l ? /* @__PURE__ */ a(
|
|
7583
|
+
l ? /* @__PURE__ */ a(Y, {
|
|
7581
7584
|
groups: f,
|
|
7582
7585
|
title: r.standardAnswer
|
|
7583
7586
|
}) : null
|
|
@@ -7592,7 +7595,7 @@ function Du({ answers: e, blankLabel: t, canClear: n, index: r, label: i }) {
|
|
|
7592
7595
|
//#region src/question/player/QuestionPlayerElement.tsx
|
|
7593
7596
|
function Ou({ disabled: e, element: t, item: n, locale: r, messages: i, onResponseItemChange: o, response: s, responseIndex: c, showAnswer: l, uploadImage: u }) {
|
|
7594
7597
|
if (t.type !== n.type) throw Error(`\u9898\u76ee\u5143\u7d20\u7ed3\u6784\u4e0d\u5339\u914d\uff0cexpected=${t.type}\uff0cactual=${n.type}`);
|
|
7595
|
-
return t.type === "richText" ? /* @__PURE__ */ a(
|
|
7598
|
+
return t.type === "richText" ? /* @__PURE__ */ a(J, { content: n.content }) : t.type === "textResponse" ? /* @__PURE__ */ a(Cu, {
|
|
7596
7599
|
disabled: e,
|
|
7597
7600
|
label: t.name,
|
|
7598
7601
|
locale: r,
|
|
@@ -7609,7 +7612,7 @@ function Ou({ disabled: e, element: t, item: n, locale: r, messages: i, onRespon
|
|
|
7609
7612
|
response: s,
|
|
7610
7613
|
responseIndex: c,
|
|
7611
7614
|
showAnswer: l
|
|
7612
|
-
}) : t.type === "classification" ? /* @__PURE__ */ a(
|
|
7615
|
+
}) : t.type === "classification" ? /* @__PURE__ */ a(wl, {
|
|
7613
7616
|
disabled: e,
|
|
7614
7617
|
item: n,
|
|
7615
7618
|
messages: i,
|
|
@@ -7650,7 +7653,7 @@ function ku({ disabled: e, element: t, item: n, messages: r, onResponseItemChang
|
|
|
7650
7653
|
responseIndex: s,
|
|
7651
7654
|
showAnswer: c
|
|
7652
7655
|
});
|
|
7653
|
-
case "fill": return /* @__PURE__ */ a(
|
|
7656
|
+
case "fill": return /* @__PURE__ */ a(bl, {
|
|
7654
7657
|
disabled: e,
|
|
7655
7658
|
item: n,
|
|
7656
7659
|
messages: r,
|
|
@@ -7726,9 +7729,9 @@ function ju(e) {
|
|
|
7726
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 }) {
|
|
7727
7730
|
let m = da(d, p);
|
|
7728
7731
|
if (!m) return /* @__PURE__ */ a("div", {
|
|
7729
|
-
className:
|
|
7732
|
+
className: U(q.root, t),
|
|
7730
7733
|
children: /* @__PURE__ */ a("div", {
|
|
7731
|
-
className:
|
|
7734
|
+
className: q.empty,
|
|
7732
7735
|
children: i.missingQuestionTypeTemplate
|
|
7733
7736
|
})
|
|
7734
7737
|
});
|
|
@@ -7748,9 +7751,9 @@ function Mu({ childIndexPath: e, className: t, disabled: n = !1, locale: r = "zh
|
|
|
7748
7751
|
value: p
|
|
7749
7752
|
});
|
|
7750
7753
|
return /* @__PURE__ */ a("div", {
|
|
7751
|
-
className:
|
|
7754
|
+
className: U(q.root, t),
|
|
7752
7755
|
children: Lu(m, p) ? /* @__PURE__ */ a("div", {
|
|
7753
|
-
className:
|
|
7756
|
+
className: q.empty,
|
|
7754
7757
|
children: i.previewEmpty
|
|
7755
7758
|
}) : h
|
|
7756
7759
|
});
|
|
@@ -7764,11 +7767,11 @@ function Nu(e) {
|
|
|
7764
7767
|
}
|
|
7765
7768
|
function Pu({ disabled: e, locale: t, messages: n, onResponseChange: r, response: i, showAnswer: o, structure: s, uploadImage: c, value: l }) {
|
|
7766
7769
|
return s.elements.length === 0 ? null : /* @__PURE__ */ a("div", {
|
|
7767
|
-
className:
|
|
7770
|
+
className: q["element-list"],
|
|
7768
7771
|
children: s.elements.map((u, d) => {
|
|
7769
7772
|
let f = cn(l, d, u), p = s.elements.slice(0, d).filter((e) => e.type !== "richText").length;
|
|
7770
7773
|
return /* @__PURE__ */ a("section", {
|
|
7771
|
-
className:
|
|
7774
|
+
className: q.element,
|
|
7772
7775
|
children: /* @__PURE__ */ a(Ou, {
|
|
7773
7776
|
disabled: e,
|
|
7774
7777
|
element: u,
|
|
@@ -7787,12 +7790,12 @@ function Pu({ disabled: e, locale: t, messages: n, onResponseChange: r, response
|
|
|
7787
7790
|
}
|
|
7788
7791
|
function Fu({ disabled: e, locale: t, messages: n, response: r, showExtraAttributes: i, structure: s, uploadImage: c, value: l }) {
|
|
7789
7792
|
return i ? /* @__PURE__ */ a("div", {
|
|
7790
|
-
className:
|
|
7793
|
+
className: q["element-list"],
|
|
7791
7794
|
children: s.extras.map((i, s) => {
|
|
7792
7795
|
let u = ln(l, s, i);
|
|
7793
7796
|
return F(u.content) ? null : /* @__PURE__ */ o("section", {
|
|
7794
|
-
className:
|
|
7795
|
-
children: [/* @__PURE__ */ a(
|
|
7797
|
+
className: q.extra,
|
|
7798
|
+
children: [/* @__PURE__ */ a(gl, { children: i.name }), /* @__PURE__ */ a(Ou, {
|
|
7796
7799
|
disabled: e,
|
|
7797
7800
|
element: Ru(i),
|
|
7798
7801
|
item: zu(u),
|
|
@@ -7809,7 +7812,7 @@ function Fu({ disabled: e, locale: t, messages: n, response: r, showExtraAttribu
|
|
|
7809
7812
|
}) : null;
|
|
7810
7813
|
}
|
|
7811
7814
|
function Iu({ childIndexPath: e, disabled: t, locale: n, messages: r, onResponseChange: i, response: o, rootQuestionNumber: s, showAnswer: c, showExtraAttributes: l, questionTypeTemplates: u, uploadImage: d, value: f }) {
|
|
7812
|
-
return f.children.length === 0 ? null : /* @__PURE__ */ a(
|
|
7815
|
+
return f.children.length === 0 ? null : /* @__PURE__ */ a(_l, {
|
|
7813
7816
|
childIndexPath: e,
|
|
7814
7817
|
disabled: t,
|
|
7815
7818
|
messages: r,
|
|
@@ -7851,7 +7854,7 @@ function zu(e) {
|
|
|
7851
7854
|
}
|
|
7852
7855
|
//#endregion
|
|
7853
7856
|
//#region src/question/shared/QuestionTextResponsePlaceholder.tsx
|
|
7854
|
-
function Bu({ className: e =
|
|
7857
|
+
function Bu({ className: e = ul.placeholder, label: t }) {
|
|
7855
7858
|
return /* @__PURE__ */ a("div", {
|
|
7856
7859
|
"aria-label": t,
|
|
7857
7860
|
className: e
|
|
@@ -7863,7 +7866,7 @@ function Vu(e, t, n) {
|
|
|
7863
7866
|
return [...e].sort((e, n) => Hu(e.blankIds, t) - Hu(n.blankIds, t)).map((e, r) => ({
|
|
7864
7867
|
kind: "detailed",
|
|
7865
7868
|
contents: Uu(e.contents.filter((e) => !F(e)), n, r),
|
|
7866
|
-
marker:
|
|
7869
|
+
marker: tl(e.blankIds, t, n)
|
|
7867
7870
|
}));
|
|
7868
7871
|
}
|
|
7869
7872
|
function Hu(e, t) {
|
|
@@ -7873,19 +7876,19 @@ function Uu(e, t, n) {
|
|
|
7873
7876
|
let r = t === "zh-CN" ? "\uff1b" : "; ";
|
|
7874
7877
|
return e.reduce((t, i, o) => [
|
|
7875
7878
|
...t,
|
|
7876
|
-
/* @__PURE__ */ a(
|
|
7879
|
+
/* @__PURE__ */ a(J, { content: i }, `group-${n}-answer-${o}`),
|
|
7877
7880
|
...o < e.length - 1 ? [r] : []
|
|
7878
7881
|
], []);
|
|
7879
7882
|
}
|
|
7880
7883
|
//#endregion
|
|
7881
7884
|
//#region src/question/renderers/QuestionBlankGroupView.tsx
|
|
7882
7885
|
function Wu({ item: e, locale: t, messages: n, showAnswer: r }) {
|
|
7883
|
-
let i =
|
|
7886
|
+
let i = W(), { blankGroup: s, renderer: c } = K(), l = Yn(e.answers, e.blanks), u = i.answerGroupLayout === "rows" ? Vu(l.map((e) => ({
|
|
7884
7887
|
blankIds: e.blankIds,
|
|
7885
7888
|
contents: e.answerPools
|
|
7886
7889
|
})), e.blanks, t) : l.map((r, o) => ({
|
|
7887
7890
|
kind: "detailed",
|
|
7888
|
-
contents: r.answerPools.map((e, t) => /* @__PURE__ */ a(
|
|
7891
|
+
contents: r.answerPools.map((e, t) => /* @__PURE__ */ a(J, { content: e }, `group-${o}-answer-${t}`)),
|
|
7889
7892
|
marker: i.blankAnswerMarker(r.blankIds, e.blanks, t, n.blankLabel)
|
|
7890
7893
|
}));
|
|
7891
7894
|
return /* @__PURE__ */ o("div", {
|
|
@@ -7894,15 +7897,15 @@ function Wu({ item: e, locale: t, messages: n, showAnswer: r }) {
|
|
|
7894
7897
|
className: s["blank-list"],
|
|
7895
7898
|
columnCount: Math.min(e.blanks.length, 4),
|
|
7896
7899
|
role: "list",
|
|
7897
|
-
children: e.blanks.map((e, r) => /* @__PURE__ */ a(
|
|
7900
|
+
children: e.blanks.map((e, r) => /* @__PURE__ */ a(yl, {
|
|
7898
7901
|
className: s["blank-item"],
|
|
7899
7902
|
children: /* @__PURE__ */ a("span", {
|
|
7900
|
-
"aria-label": i.blankPlaceholder === "answer-line" ?
|
|
7903
|
+
"aria-label": i.blankPlaceholder === "answer-line" ? el(r + 1, t) : void 0,
|
|
7901
7904
|
className: s["blank-field"],
|
|
7902
7905
|
children: i.blankPlaceholder === "answer-line" ? null : `${n.blankLabel} ${r + 1}`
|
|
7903
7906
|
})
|
|
7904
7907
|
}, Gu(e, r)))
|
|
7905
|
-
}), r ? /* @__PURE__ */ a(
|
|
7908
|
+
}), r ? /* @__PURE__ */ a(Y, {
|
|
7906
7909
|
groups: u,
|
|
7907
7910
|
title: n.standardAnswer
|
|
7908
7911
|
}) : null]
|
|
@@ -7914,7 +7917,7 @@ function Gu(e, t) {
|
|
|
7914
7917
|
//#endregion
|
|
7915
7918
|
//#region src/question/renderers/QuestionClassificationView.tsx
|
|
7916
7919
|
function Ku({ item: e, messages: t, showAnswer: n }) {
|
|
7917
|
-
let { classification: r, renderer: i } =
|
|
7920
|
+
let { classification: r, renderer: i } = K();
|
|
7918
7921
|
return /* @__PURE__ */ o("div", {
|
|
7919
7922
|
className: i.element,
|
|
7920
7923
|
children: [/* @__PURE__ */ o("div", {
|
|
@@ -7926,7 +7929,7 @@ function Ku({ item: e, messages: t, showAnswer: n }) {
|
|
|
7926
7929
|
className: r.zone,
|
|
7927
7930
|
children: [/* @__PURE__ */ a("div", {
|
|
7928
7931
|
className: r["zone-title"],
|
|
7929
|
-
children: /* @__PURE__ */ a(
|
|
7932
|
+
children: /* @__PURE__ */ a(J, { content: e.content })
|
|
7930
7933
|
}), /* @__PURE__ */ a("span", {
|
|
7931
7934
|
className: r.empty,
|
|
7932
7935
|
children: t.unassigned
|
|
@@ -7937,11 +7940,11 @@ function Ku({ item: e, messages: t, showAnswer: n }) {
|
|
|
7937
7940
|
columnCount: Math.min(e.items.length, 4),
|
|
7938
7941
|
children: e.items.map((e) => /* @__PURE__ */ a("div", {
|
|
7939
7942
|
className: r.item,
|
|
7940
|
-
children: /* @__PURE__ */ a(
|
|
7943
|
+
children: /* @__PURE__ */ a(J, { content: e.content })
|
|
7941
7944
|
}, e.id))
|
|
7942
7945
|
})]
|
|
7943
|
-
}), n ? /* @__PURE__ */ a(
|
|
7944
|
-
groups:
|
|
7946
|
+
}), n ? /* @__PURE__ */ a(Y, {
|
|
7947
|
+
groups: Cl(e),
|
|
7945
7948
|
title: t.standardAnswer
|
|
7946
7949
|
}) : null]
|
|
7947
7950
|
});
|
|
@@ -7949,17 +7952,20 @@ function Ku({ item: e, messages: t, showAnswer: n }) {
|
|
|
7949
7952
|
//#endregion
|
|
7950
7953
|
//#region src/question/renderers/QuestionFillTextView.tsx
|
|
7951
7954
|
function qu({ element: e, item: t, locale: n, messages: r, showAnswer: i }) {
|
|
7952
|
-
let s =
|
|
7955
|
+
let s = W(), { renderer: c } = K(), l = An(t, e, !0), u = qc(l), d = s.answerGroupLayout === "rows" ? Vu(u, l.blanks, n) : u.map((e, t) => ({
|
|
7953
7956
|
kind: "detailed",
|
|
7954
|
-
contents: e.contents.map((e, n) => /* @__PURE__ */ a(
|
|
7957
|
+
contents: e.contents.map((e, n) => /* @__PURE__ */ a(J, { content: e }, `group-${t}-answer-${n}`)),
|
|
7955
7958
|
marker: s.blankAnswerMarker(e.blankIds, l.blanks, n, r.blankLabel)
|
|
7956
7959
|
}));
|
|
7957
7960
|
return /* @__PURE__ */ o("div", {
|
|
7958
7961
|
className: c.element,
|
|
7959
7962
|
children: [
|
|
7960
|
-
/* @__PURE__ */ a(
|
|
7961
|
-
Ju(l,
|
|
7962
|
-
|
|
7963
|
+
/* @__PURE__ */ a(J, { content: l.content }),
|
|
7964
|
+
Ju(l, s.candidateLayout === "labeled-groups" ? /* @__PURE__ */ a("span", {
|
|
7965
|
+
className: c["section-title"],
|
|
7966
|
+
children: r.candidateOptions
|
|
7967
|
+
}) : null, c, s.candidateLayout, s.markerSuffix),
|
|
7968
|
+
i ? /* @__PURE__ */ a(Y, {
|
|
7963
7969
|
groups: d,
|
|
7964
7970
|
title: r.standardAnswer
|
|
7965
7971
|
}) : null
|
|
@@ -7969,43 +7975,40 @@ function qu({ element: e, item: t, locale: n, messages: r, showAnswer: i }) {
|
|
|
7969
7975
|
function Ju(e, t, n, r, i) {
|
|
7970
7976
|
var s, c;
|
|
7971
7977
|
let l = (s = e.candidateOptions) == null ? [] : s, u = (c = e.blankOptionGroups) == null ? [] : c;
|
|
7972
|
-
return !l.length && !u.length ? null : r === "plain-list" ? /* @__PURE__ */
|
|
7978
|
+
return !l.length && !u.length ? null : r === "plain-list" && l.length > 0 ? /* @__PURE__ */ a("div", {
|
|
7973
7979
|
className: n["candidate-section"],
|
|
7974
|
-
children:
|
|
7975
|
-
className: n["section-title"],
|
|
7976
|
-
children: t
|
|
7977
|
-
}), /* @__PURE__ */ o(yl, {
|
|
7980
|
+
children: /* @__PURE__ */ a(vl, {
|
|
7978
7981
|
className: n["candidate-list"],
|
|
7979
|
-
children:
|
|
7982
|
+
children: l.map((e, t) => /* @__PURE__ */ o(yl, {
|
|
7980
7983
|
className: n["candidate-item"],
|
|
7981
|
-
children: /* @__PURE__ */ a(
|
|
7982
|
-
|
|
7983
|
-
|
|
7984
|
-
|
|
7985
|
-
},
|
|
7986
|
-
})
|
|
7984
|
+
children: [/* @__PURE__ */ a("span", {
|
|
7985
|
+
className: n.marker,
|
|
7986
|
+
children: un("upperAlpha", t)
|
|
7987
|
+
}), /* @__PURE__ */ a(J, { content: e.content })]
|
|
7988
|
+
}, e.optionId))
|
|
7989
|
+
})
|
|
7987
7990
|
}) : /* @__PURE__ */ o("div", {
|
|
7988
7991
|
className: n["candidate-section"],
|
|
7989
|
-
children: [/* @__PURE__ */ a(
|
|
7990
|
-
className: n["section-title"],
|
|
7991
|
-
children: t
|
|
7992
|
-
}), l.length > 0 ? /* @__PURE__ */ a(fu, { children: l.map((e, t) => /* @__PURE__ */ o(bl, {
|
|
7992
|
+
children: [t, l.length > 0 ? /* @__PURE__ */ a(fu, { children: l.map((e, t) => /* @__PURE__ */ o(yl, {
|
|
7993
7993
|
className: n["candidate-item"],
|
|
7994
7994
|
children: [/* @__PURE__ */ o("span", {
|
|
7995
7995
|
className: n.marker,
|
|
7996
7996
|
children: [un("upperAlpha", t), i]
|
|
7997
|
-
}), /* @__PURE__ */ a(
|
|
7998
|
-
}, e.optionId)) }) : /* @__PURE__ */ a(
|
|
7997
|
+
}), /* @__PURE__ */ a(J, { content: e.content })]
|
|
7998
|
+
}, e.optionId)) }) : /* @__PURE__ */ a(vl, {
|
|
7999
7999
|
className: n["candidate-list"],
|
|
8000
8000
|
dataCandidateLayout: "per-blank",
|
|
8001
|
-
children: u.map((e, t) => /* @__PURE__ */ o(
|
|
8001
|
+
children: u.map((e, t) => /* @__PURE__ */ o(yl, {
|
|
8002
8002
|
className: n["candidate-item"],
|
|
8003
8003
|
children: [/* @__PURE__ */ o("span", {
|
|
8004
|
-
className: n.marker,
|
|
8005
|
-
children: [t + 1,
|
|
8006
|
-
}), /* @__PURE__ */ a(fu, { children: e.options.map((e) => /* @__PURE__ */
|
|
8004
|
+
className: r === "plain-list" ? n["section-title"] : n.marker,
|
|
8005
|
+
children: [t + 1, "."]
|
|
8006
|
+
}), /* @__PURE__ */ a(fu, { children: e.options.map((e, t) => /* @__PURE__ */ o(yl, {
|
|
8007
8007
|
className: n["candidate-item"],
|
|
8008
|
-
children: /* @__PURE__ */ a(
|
|
8008
|
+
children: [r === "plain-list" ? /* @__PURE__ */ a("span", {
|
|
8009
|
+
className: n.marker,
|
|
8010
|
+
children: un("upperAlpha", t)
|
|
8011
|
+
}) : null, /* @__PURE__ */ a(J, { content: e.content })]
|
|
8009
8012
|
}, e.optionId)) })]
|
|
8010
8013
|
}, e.blankId))
|
|
8011
8014
|
})]
|
|
@@ -8014,7 +8017,7 @@ function Ju(e, t, n, r, i) {
|
|
|
8014
8017
|
//#endregion
|
|
8015
8018
|
//#region src/question/renderers/QuestionJudgementGroupView.tsx
|
|
8016
8019
|
function Yu({ element: e, item: t, messages: n, showAnswer: r, stem: i }) {
|
|
8017
|
-
let { renderer: s } =
|
|
8020
|
+
let { renderer: s } = K(), c = mn(e.config.judgeAnswerMode), l = [{
|
|
8018
8021
|
kind: "detailed",
|
|
8019
8022
|
contents: hn(e.config.judgeAnswerMode, t.answers),
|
|
8020
8023
|
marker: ""
|
|
@@ -8025,7 +8028,7 @@ function Yu({ element: e, item: t, messages: n, showAnswer: r, stem: i }) {
|
|
|
8025
8028
|
"aria-label": e.name,
|
|
8026
8029
|
className: s["judgement-row"],
|
|
8027
8030
|
role: "group",
|
|
8028
|
-
children: [/* @__PURE__ */ a(
|
|
8031
|
+
children: [/* @__PURE__ */ a(J, { content: i }), /* @__PURE__ */ a("span", {
|
|
8029
8032
|
"aria-hidden": "true",
|
|
8030
8033
|
className: s["judgement-placeholder"],
|
|
8031
8034
|
children: "\uff08\u3000\uff09"
|
|
@@ -8034,11 +8037,11 @@ function Yu({ element: e, item: t, messages: n, showAnswer: r, stem: i }) {
|
|
|
8034
8037
|
className: s["judgement-list"],
|
|
8035
8038
|
columnCount: 2,
|
|
8036
8039
|
role: "list",
|
|
8037
|
-
children: c.map(({ label: e, value: t }) => /* @__PURE__ */ a(
|
|
8040
|
+
children: c.map(({ label: e, value: t }) => /* @__PURE__ */ a(yl, {
|
|
8038
8041
|
className: s["judgement-item"],
|
|
8039
8042
|
children: e
|
|
8040
8043
|
}, String(t)))
|
|
8041
|
-
}), r ? /* @__PURE__ */ a(
|
|
8044
|
+
}), r ? /* @__PURE__ */ a(Y, {
|
|
8042
8045
|
groups: l,
|
|
8043
8046
|
title: n.standardAnswer
|
|
8044
8047
|
}) : null]
|
|
@@ -8047,7 +8050,7 @@ function Yu({ element: e, item: t, messages: n, showAnswer: r, stem: i }) {
|
|
|
8047
8050
|
//#endregion
|
|
8048
8051
|
//#region src/question/renderers/QuestionLineConnectView.tsx
|
|
8049
8052
|
function Xu({ item: e, messages: t, showAnswer: n }) {
|
|
8050
|
-
let { lineConnectColumnTitleVisibility: r, markerSuffix: i } =
|
|
8053
|
+
let { lineConnectColumnTitleVisibility: r, markerSuffix: i } = W(), { lineConnect: s, renderer: c } = K();
|
|
8051
8054
|
return /* @__PURE__ */ o("div", {
|
|
8052
8055
|
className: c.element,
|
|
8053
8056
|
children: [/* @__PURE__ */ a("div", {
|
|
@@ -8071,13 +8074,13 @@ function Xu({ item: e, messages: t, showAnswer: n }) {
|
|
|
8071
8074
|
children: [r ? /* @__PURE__ */ o("span", {
|
|
8072
8075
|
className: s.marker,
|
|
8073
8076
|
children: [r, i]
|
|
8074
|
-
}) : null, /* @__PURE__ */ a(
|
|
8077
|
+
}) : null, /* @__PURE__ */ a(J, { content: t.content })]
|
|
8075
8078
|
}, t.itemId);
|
|
8076
8079
|
})]
|
|
8077
8080
|
}, e.columnId);
|
|
8078
8081
|
})
|
|
8079
8082
|
})
|
|
8080
|
-
}), n ? /* @__PURE__ */ a(
|
|
8083
|
+
}), n ? /* @__PURE__ */ a(Y, {
|
|
8081
8084
|
groups: Xl(e),
|
|
8082
8085
|
title: t.standardAnswer
|
|
8083
8086
|
}) : null]
|
|
@@ -8086,7 +8089,7 @@ function Xu({ item: e, messages: t, showAnswer: n }) {
|
|
|
8086
8089
|
//#endregion
|
|
8087
8090
|
//#region src/question/renderers/QuestionMatchingView.tsx
|
|
8088
8091
|
function Zu({ item: e, messages: t, showAnswer: n }) {
|
|
8089
|
-
let { markerSuffix: r, matchingAnswerLayout: i } =
|
|
8092
|
+
let { markerSuffix: r, matchingAnswerLayout: i } = W(), { matching: s, renderer: c } = K();
|
|
8090
8093
|
return /* @__PURE__ */ o("div", {
|
|
8091
8094
|
className: c.element,
|
|
8092
8095
|
children: [/* @__PURE__ */ a("div", {
|
|
@@ -8103,12 +8106,12 @@ function Zu({ item: e, messages: t, showAnswer: n }) {
|
|
|
8103
8106
|
children: [i ? /* @__PURE__ */ o("span", {
|
|
8104
8107
|
className: s.marker,
|
|
8105
8108
|
children: [i, r]
|
|
8106
|
-
}) : null, /* @__PURE__ */ a(
|
|
8109
|
+
}) : null, /* @__PURE__ */ a(J, { content: t.content })]
|
|
8107
8110
|
}, t.itemId);
|
|
8108
8111
|
})
|
|
8109
8112
|
}, e.columnId))
|
|
8110
8113
|
})
|
|
8111
|
-
}), n ? /* @__PURE__ */ a(
|
|
8114
|
+
}), n ? /* @__PURE__ */ a(Y, {
|
|
8112
8115
|
groups: i === "marker-path" ? tu(e) : eu(e),
|
|
8113
8116
|
title: t.standardAnswer
|
|
8114
8117
|
}) : null]
|
|
@@ -8117,7 +8120,7 @@ function Zu({ item: e, messages: t, showAnswer: n }) {
|
|
|
8117
8120
|
//#endregion
|
|
8118
8121
|
//#region src/question/renderers/QuestionOptionGroupView.tsx
|
|
8119
8122
|
function Qu({ element: e, item: t, locale: n, messages: r, showAnswer: i }) {
|
|
8120
|
-
let { markerSuffix: s, optionStandardAnswer: c } =
|
|
8123
|
+
let { markerSuffix: s, optionStandardAnswer: c } = W(), { renderer: l, table: u } = K(), d = gn(t, e.config.optionLabelStyle), f = ou(e, t), p = c === "value-only" ? $u(f.map((e) => e.marker), n) : f;
|
|
8121
8124
|
return e.config.renderer === "table" ? /* @__PURE__ */ o("div", {
|
|
8122
8125
|
className: l.element,
|
|
8123
8126
|
children: [/* @__PURE__ */ a("div", {
|
|
@@ -8126,26 +8129,26 @@ function Qu({ element: e, item: t, locale: n, messages: r, showAnswer: i }) {
|
|
|
8126
8129
|
className: u.table,
|
|
8127
8130
|
children: [
|
|
8128
8131
|
/* @__PURE__ */ o("colgroup", { children: [/* @__PURE__ */ a("col", { className: u["table-option-column"] }), t.columns.map((e) => /* @__PURE__ */ a("col", {}, e.id))] }),
|
|
8129
|
-
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ o("tr", { children: [/* @__PURE__ */ a("th", { children: r.option }), t.columns.map((e) => /* @__PURE__ */ a("th", { children: /* @__PURE__ */ a(
|
|
8132
|
+
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ o("tr", { children: [/* @__PURE__ */ a("th", { children: r.option }), t.columns.map((e) => /* @__PURE__ */ a("th", { children: /* @__PURE__ */ a(J, { content: e.content }) }, e.id))] }) }),
|
|
8130
8133
|
/* @__PURE__ */ a("tbody", { children: d.map((e) => /* @__PURE__ */ o("tr", { children: [/* @__PURE__ */ a("td", { children: /* @__PURE__ */ o("span", {
|
|
8131
8134
|
className: u["table-option-marker"],
|
|
8132
8135
|
children: [e.marker, s]
|
|
8133
|
-
}) }), e.cells.map((t, n) => /* @__PURE__ */ a("td", { children: /* @__PURE__ */ a(
|
|
8136
|
+
}) }), e.cells.map((t, n) => /* @__PURE__ */ a("td", { children: /* @__PURE__ */ a(J, { content: t }) }, `${e.optionId}-cell-${n}`))] }, e.optionId)) })
|
|
8134
8137
|
]
|
|
8135
8138
|
})
|
|
8136
|
-
}), i ? /* @__PURE__ */ a(
|
|
8139
|
+
}), i ? /* @__PURE__ */ a(Y, {
|
|
8137
8140
|
groups: p,
|
|
8138
8141
|
title: r.standardAnswer
|
|
8139
8142
|
}) : null]
|
|
8140
8143
|
}) : /* @__PURE__ */ o("div", {
|
|
8141
8144
|
className: l.element,
|
|
8142
|
-
children: [/* @__PURE__ */ a(fu, { children: d.map((e) => /* @__PURE__ */ o(
|
|
8145
|
+
children: [/* @__PURE__ */ a(fu, { children: d.map((e) => /* @__PURE__ */ o(yl, {
|
|
8143
8146
|
className: l["option-item"],
|
|
8144
8147
|
children: [/* @__PURE__ */ o("span", {
|
|
8145
8148
|
className: l.marker,
|
|
8146
8149
|
children: [e.marker, s]
|
|
8147
|
-
}), /* @__PURE__ */ a(
|
|
8148
|
-
}, e.optionId)) }), i ? /* @__PURE__ */ a(
|
|
8150
|
+
}), /* @__PURE__ */ a(J, { content: e.standardContent })]
|
|
8151
|
+
}, e.optionId)) }), i ? /* @__PURE__ */ a(Y, {
|
|
8149
8152
|
groups: p,
|
|
8150
8153
|
title: r.standardAnswer
|
|
8151
8154
|
}) : null]
|
|
@@ -8162,19 +8165,19 @@ function $u(e, t) {
|
|
|
8162
8165
|
//#endregion
|
|
8163
8166
|
//#region src/question/renderers/QuestionOrderingView.tsx
|
|
8164
8167
|
function ed({ item: e, messages: t, showAnswer: n }) {
|
|
8165
|
-
let { markerSuffix: r } =
|
|
8168
|
+
let { markerSuffix: r } = W(), { renderer: i } = K();
|
|
8166
8169
|
return /* @__PURE__ */ o("div", {
|
|
8167
8170
|
className: i.element,
|
|
8168
|
-
children: [/* @__PURE__ */ a(
|
|
8171
|
+
children: [/* @__PURE__ */ a(vl, {
|
|
8169
8172
|
className: i["option-list"],
|
|
8170
|
-
children: e.sortOptions.map((e, t) => /* @__PURE__ */ o(
|
|
8173
|
+
children: e.sortOptions.map((e, t) => /* @__PURE__ */ o(yl, {
|
|
8171
8174
|
className: i["option-item"],
|
|
8172
8175
|
children: [/* @__PURE__ */ o("span", {
|
|
8173
8176
|
className: i.marker,
|
|
8174
8177
|
children: [t + 1, r]
|
|
8175
|
-
}), /* @__PURE__ */ a(
|
|
8178
|
+
}), /* @__PURE__ */ a(J, { content: e.content })]
|
|
8176
8179
|
}, e.id))
|
|
8177
|
-
}), n ? /* @__PURE__ */ a(
|
|
8180
|
+
}), n ? /* @__PURE__ */ a(Y, {
|
|
8178
8181
|
groups: gu(e),
|
|
8179
8182
|
title: t.standardAnswer
|
|
8180
8183
|
}) : null]
|
|
@@ -8183,14 +8186,14 @@ function ed({ item: e, messages: t, showAnswer: n }) {
|
|
|
8183
8186
|
//#endregion
|
|
8184
8187
|
//#region src/question/renderers/QuestionWordBuilderView.tsx
|
|
8185
8188
|
function td({ element: e, item: t, locale: n, messages: r, showAnswer: i }) {
|
|
8186
|
-
let s =
|
|
8189
|
+
let s = W(), { renderer: c } = K(), l = kn(t, !0, e), u = wu(l, (e, t) => s.blankAnswerMarker(e, t, n, r.blankLabel));
|
|
8187
8190
|
return /* @__PURE__ */ o("div", {
|
|
8188
8191
|
className: c.element,
|
|
8189
8192
|
children: [
|
|
8190
|
-
/* @__PURE__ */ a(
|
|
8193
|
+
/* @__PURE__ */ a(Dl, {
|
|
8191
8194
|
content: l.content,
|
|
8192
8195
|
renderBlank: ({ blankId: e, index: t, label: i }) => /* @__PURE__ */ a("span", {
|
|
8193
|
-
"aria-label": s.blankPlaceholder === "answer-line" ?
|
|
8196
|
+
"aria-label": s.blankPlaceholder === "answer-line" ? el(t + 1, n) : i || `${r.blankLabel}${t + 1}`,
|
|
8194
8197
|
className: c["word-builder-blank"],
|
|
8195
8198
|
"data-blank-id": e
|
|
8196
8199
|
})
|
|
@@ -8204,13 +8207,13 @@ function td({ element: e, item: t, locale: n, messages: r, showAnswer: i }) {
|
|
|
8204
8207
|
className: c["word-builder-candidate-list"],
|
|
8205
8208
|
columnCount: Math.min(l.candidateOptions.length, 4),
|
|
8206
8209
|
role: "list",
|
|
8207
|
-
children: l.candidateOptions.map((e, t) => /* @__PURE__ */ a(
|
|
8210
|
+
children: l.candidateOptions.map((e, t) => /* @__PURE__ */ a(yl, {
|
|
8208
8211
|
className: c["candidate-item"],
|
|
8209
8212
|
children: e
|
|
8210
8213
|
}, `${e}-${t}`))
|
|
8211
8214
|
})]
|
|
8212
8215
|
}),
|
|
8213
|
-
i ? /* @__PURE__ */ a(
|
|
8216
|
+
i ? /* @__PURE__ */ a(Y, {
|
|
8214
8217
|
groups: u,
|
|
8215
8218
|
title: r.standardAnswer
|
|
8216
8219
|
}) : null
|
|
@@ -8220,9 +8223,9 @@ function td({ element: e, item: t, locale: n, messages: r, showAnswer: i }) {
|
|
|
8220
8223
|
//#endregion
|
|
8221
8224
|
//#region src/question/renderers/QuestionContentElementView.tsx
|
|
8222
8225
|
function nd({ element: e, item: t, judgementStem: n, locale: r, messages: i, showAnswer: o }) {
|
|
8223
|
-
let { textResponseVisibility: s } =
|
|
8226
|
+
let { textResponseVisibility: s } = W(), { textResponse: c } = K();
|
|
8224
8227
|
if (e.type !== t.type) throw Error(`\u9898\u76ee\u5143\u7d20\u7ed3\u6784\u4e0d\u5339\u914d\uff0cexpected=${e.type}\uff0cactual=${t.type}`);
|
|
8225
|
-
return e.type === "richText" ? /* @__PURE__ */ a(
|
|
8228
|
+
return e.type === "richText" ? /* @__PURE__ */ a(J, { content: t.content }) : e.type === "textResponse" ? s === "hidden" ? null : /* @__PURE__ */ a(Bu, {
|
|
8226
8229
|
className: c.placeholder,
|
|
8227
8230
|
label: i.textResponsePlaceholder
|
|
8228
8231
|
}) : e.type === "ordering" ? /* @__PURE__ */ a(ed, {
|
|
@@ -8335,7 +8338,7 @@ function od({ childIndexPath: e = [], messages: t, renderChild: n, rootQuestionN
|
|
|
8335
8338
|
var sd = ["locale"];
|
|
8336
8339
|
function cd(e) {
|
|
8337
8340
|
let { locale: t = "zh-CN" } = e, n = Oa(e, sd), r = ks(n.value, n.questionTypeTemplates);
|
|
8338
|
-
return /* @__PURE__ */ a(
|
|
8341
|
+
return /* @__PURE__ */ a(cl.Provider, {
|
|
8339
8342
|
value: t,
|
|
8340
8343
|
children: /* @__PURE__ */ a(ld, j(j({}, n), {}, {
|
|
8341
8344
|
childIndexPath: [],
|
|
@@ -8348,7 +8351,7 @@ function cd(e) {
|
|
|
8348
8351
|
function ld({ childIndexPath: e, className: t, locale: n, messages: r, presentation: s, rootQuestionNumber: c, showAnswer: l = !1, showExtraAttributes: u = !1, questionTypeTemplates: d, value: f }) {
|
|
8349
8352
|
let p = ad(), m = da(d, f);
|
|
8350
8353
|
if (!m) return /* @__PURE__ */ a("div", {
|
|
8351
|
-
className:
|
|
8354
|
+
className: U(p.root, t),
|
|
8352
8355
|
"data-locale": n,
|
|
8353
8356
|
"data-question-presentation": s,
|
|
8354
8357
|
children: /* @__PURE__ */ a("div", {
|
|
@@ -8380,7 +8383,7 @@ function ld({ childIndexPath: e, className: t, locale: n, messages: r, presentat
|
|
|
8380
8383
|
let i = ln(f, t, e);
|
|
8381
8384
|
return F(i.content) ? null : /* @__PURE__ */ o("section", {
|
|
8382
8385
|
className: p.extra,
|
|
8383
|
-
children: [/* @__PURE__ */ a(
|
|
8386
|
+
children: [/* @__PURE__ */ a(gl, { children: e.name }), /* @__PURE__ */ a(nd, {
|
|
8384
8387
|
element: pd(e),
|
|
8385
8388
|
item: md(i),
|
|
8386
8389
|
locale: n,
|
|
@@ -8407,7 +8410,7 @@ function ld({ childIndexPath: e, className: t, locale: n, messages: r, presentat
|
|
|
8407
8410
|
value: f
|
|
8408
8411
|
});
|
|
8409
8412
|
return /* @__PURE__ */ a("div", {
|
|
8410
|
-
className:
|
|
8413
|
+
className: U(p.root, t),
|
|
8411
8414
|
"data-locale": n,
|
|
8412
8415
|
"data-question-presentation": s,
|
|
8413
8416
|
children: fd(m, f) ? /* @__PURE__ */ a("div", {
|
|
@@ -8538,9 +8541,9 @@ var gd = {
|
|
|
8538
8541
|
//#endregion
|
|
8539
8542
|
//#region src/question/preview/QuestionPrintPreview.tsx
|
|
8540
8543
|
function Ad(e) {
|
|
8541
|
-
return /* @__PURE__ */ a(
|
|
8542
|
-
value:
|
|
8543
|
-
children: /* @__PURE__ */ a(
|
|
8544
|
+
return /* @__PURE__ */ a(sl.Provider, {
|
|
8545
|
+
value: ol,
|
|
8546
|
+
children: /* @__PURE__ */ a(hl.Provider, {
|
|
8544
8547
|
value: Od,
|
|
8545
8548
|
children: /* @__PURE__ */ a(id.Provider, {
|
|
8546
8549
|
value: kd,
|
|
@@ -9466,4 +9469,4 @@ function mf(e) {
|
|
|
9466
9469
|
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;
|
|
9467
9470
|
}
|
|
9468
9471
|
//#endregion
|
|
9469
|
-
export { fs as QuestionContentEditor, ju as QuestionPlayer, hd as QuestionPreview, Ad as QuestionPrintPreview,
|
|
9472
|
+
export { fs as QuestionContentEditor, ju as QuestionPlayer, hd as QuestionPreview, Ad as QuestionPrintPreview, J as QuestionRichContentView, ff 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 };
|