@yungu-fed/question-editor 0.3.2 → 0.3.3
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 +5 -0
- package/dist/index.css +1 -1
- package/dist/index.js +763 -776
- package/dist/index.mjs +183 -193
- package/dist/question/player/QuestionTextResponsePlayer.d.ts +1 -1
- package/dist/question/player/QuestionTextResponsePlayer.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/question/shared/QuestionTextResponsePlaceholder.d.ts +0 -6
- package/dist/question/shared/QuestionTextResponsePlaceholder.d.ts.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -7103,21 +7103,11 @@ function zl({ disabled: e, item: t, messages: n, onChange: r, response: i, respo
|
|
|
7103
7103
|
selectedMarkers: c.selectedMarkers
|
|
7104
7104
|
});
|
|
7105
7105
|
}
|
|
7106
|
-
var Bl = { placeholder: "_placeholder_xde95_1" };
|
|
7107
|
-
//#endregion
|
|
7108
|
-
//#region src/question/shared/QuestionTextResponsePlaceholder.tsx
|
|
7109
|
-
function Vl({ label: e }) {
|
|
7110
|
-
return /* @__PURE__ */ a("div", {
|
|
7111
|
-
"aria-label": e,
|
|
7112
|
-
className: Bl.placeholder,
|
|
7113
|
-
children: e
|
|
7114
|
-
});
|
|
7115
|
-
}
|
|
7116
7106
|
//#endregion
|
|
7117
7107
|
//#region src/question/player/QuestionTextResponsePlayer.tsx
|
|
7118
|
-
function
|
|
7108
|
+
function Bl({ disabled: e, locale: t, label: n, messages: r, onChange: i, response: o, responseIndex: s, uploadImage: c }) {
|
|
7119
7109
|
let l = rc(o, s);
|
|
7120
|
-
return e ? P(l.content) ?
|
|
7110
|
+
return e ? P(l.content) ? null : /* @__PURE__ */ a(K, { content: l.content }) : /* @__PURE__ */ a(Ia, {
|
|
7121
7111
|
ariaLabel: n,
|
|
7122
7112
|
locale: t,
|
|
7123
7113
|
onChange: (e) => i({
|
|
@@ -7132,7 +7122,7 @@ function Hl({ disabled: e, locale: t, label: n, messages: r, onChange: i, respon
|
|
|
7132
7122
|
}
|
|
7133
7123
|
//#endregion
|
|
7134
7124
|
//#region src/question/renderers/wordBuilderAnswers.tsx
|
|
7135
|
-
function
|
|
7125
|
+
function Vl(e, t) {
|
|
7136
7126
|
return e.blanks.reduce((n, r) => {
|
|
7137
7127
|
var i;
|
|
7138
7128
|
let o = (i = e.answers[r]) == null ? void 0 : i.trim();
|
|
@@ -7145,14 +7135,14 @@ function Ul(e, t) {
|
|
|
7145
7135
|
}
|
|
7146
7136
|
//#endregion
|
|
7147
7137
|
//#region src/question/player/QuestionPlayerWordBuilder.module.css
|
|
7148
|
-
var
|
|
7138
|
+
var Hl = {
|
|
7149
7139
|
"word-builder-blank": "_word-builder-blank_ftw6q_1",
|
|
7150
7140
|
"word-builder-candidate-list": "_word-builder-candidate-list_ftw6q_30"
|
|
7151
7141
|
};
|
|
7152
7142
|
//#endregion
|
|
7153
7143
|
//#region src/question/player/QuestionWordBuilderPlayer.tsx
|
|
7154
|
-
function
|
|
7155
|
-
let u = En(n, !0, t), d = Xs(s, c, u.blanks), f =
|
|
7144
|
+
function Ul({ disabled: e, element: t, item: n, messages: r, onChange: i, response: s, responseIndex: c, showAnswer: l }) {
|
|
7145
|
+
let u = En(n, !0, t), d = Xs(s, c, u.blanks), f = Vl(u, r.blankLabel);
|
|
7156
7146
|
function p(e, t) {
|
|
7157
7147
|
i(k(k({}, d), {}, { answers: k(k({}, d.answers), {}, { [e]: t }) }));
|
|
7158
7148
|
}
|
|
@@ -7184,7 +7174,7 @@ function Gl({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7184
7174
|
content: u.content,
|
|
7185
7175
|
renderBlank: ({ blankId: t, index: n, label: i }) => {
|
|
7186
7176
|
var o, s;
|
|
7187
|
-
let c = (o = d.answers[t]) == null ? "" : o, l =
|
|
7177
|
+
let c = (o = d.answers[t]) == null ? "" : o, l = Wl({
|
|
7188
7178
|
answers: c,
|
|
7189
7179
|
blankLabel: r.blankLabel,
|
|
7190
7180
|
canClear: !e && !!c.trim(),
|
|
@@ -7193,7 +7183,7 @@ function Gl({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7193
7183
|
});
|
|
7194
7184
|
return /* @__PURE__ */ a("button", {
|
|
7195
7185
|
"aria-label": l,
|
|
7196
|
-
className:
|
|
7186
|
+
className: Hl["word-builder-blank"],
|
|
7197
7187
|
disabled: e,
|
|
7198
7188
|
onClick: () => m(t),
|
|
7199
7189
|
onDragOver: (e) => e.preventDefault(),
|
|
@@ -7205,7 +7195,7 @@ function Gl({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7205
7195
|
}
|
|
7206
7196
|
}),
|
|
7207
7197
|
/* @__PURE__ */ a("div", {
|
|
7208
|
-
className:
|
|
7198
|
+
className: Hl["word-builder-candidate-list"],
|
|
7209
7199
|
children: u.candidateOptions.map((t, n) => /* @__PURE__ */ a("button", {
|
|
7210
7200
|
disabled: e,
|
|
7211
7201
|
draggable: !e,
|
|
@@ -7224,15 +7214,15 @@ function Gl({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7224
7214
|
]
|
|
7225
7215
|
});
|
|
7226
7216
|
}
|
|
7227
|
-
function
|
|
7217
|
+
function Wl({ answers: e, blankLabel: t, canClear: n, index: r, label: i }) {
|
|
7228
7218
|
let a = i || `${t}${r + 1}`;
|
|
7229
7219
|
return !n || !e.trim() ? a : t === "\u7a7a" ? `${a}\uff0c\u70b9\u51fb\u6e05\u7a7a` : `${a}, click to clear`;
|
|
7230
7220
|
}
|
|
7231
7221
|
//#endregion
|
|
7232
7222
|
//#region src/question/player/QuestionPlayerElement.tsx
|
|
7233
|
-
function
|
|
7223
|
+
function Gl({ disabled: e, element: t, item: n, locale: r, messages: i, onResponseItemChange: o, response: s, responseIndex: c, showAnswer: l, uploadImage: u }) {
|
|
7234
7224
|
if (t.type !== n.type) throw Error(`\u9898\u76ee\u5143\u7d20\u7ed3\u6784\u4e0d\u5339\u914d\uff0cexpected=${t.type}\uff0cactual=${n.type}`);
|
|
7235
|
-
return t.type === "richText" ? /* @__PURE__ */ a(K, { content: n.content }) : t.type === "textResponse" ? /* @__PURE__ */ a(
|
|
7225
|
+
return t.type === "richText" ? /* @__PURE__ */ a(K, { content: n.content }) : t.type === "textResponse" ? /* @__PURE__ */ a(Bl, {
|
|
7236
7226
|
disabled: e,
|
|
7237
7227
|
label: t.name,
|
|
7238
7228
|
locale: r,
|
|
@@ -7265,7 +7255,7 @@ function ql({ disabled: e, element: t, item: n, locale: r, messages: i, onRespon
|
|
|
7265
7255
|
response: s,
|
|
7266
7256
|
responseIndex: c,
|
|
7267
7257
|
showAnswer: l
|
|
7268
|
-
}) :
|
|
7258
|
+
}) : Kl({
|
|
7269
7259
|
disabled: e,
|
|
7270
7260
|
element: t,
|
|
7271
7261
|
item: n,
|
|
@@ -7278,7 +7268,7 @@ function ql({ disabled: e, element: t, item: n, locale: r, messages: i, onRespon
|
|
|
7278
7268
|
uploadImage: u
|
|
7279
7269
|
});
|
|
7280
7270
|
}
|
|
7281
|
-
function
|
|
7271
|
+
function Kl({ disabled: e, element: t, item: n, messages: r, onResponseItemChange: i, response: o, responseIndex: s, showAnswer: c }) {
|
|
7282
7272
|
switch (t.type) {
|
|
7283
7273
|
case "choice": return /* @__PURE__ */ a(jl, {
|
|
7284
7274
|
disabled: e,
|
|
@@ -7309,7 +7299,7 @@ function Jl({ disabled: e, element: t, item: n, messages: r, onResponseItemChang
|
|
|
7309
7299
|
responseIndex: s,
|
|
7310
7300
|
showAnswer: c
|
|
7311
7301
|
});
|
|
7312
|
-
case "wordBuilder": return /* @__PURE__ */ a(
|
|
7302
|
+
case "wordBuilder": return /* @__PURE__ */ a(Ul, {
|
|
7313
7303
|
disabled: e,
|
|
7314
7304
|
element: t,
|
|
7315
7305
|
item: n,
|
|
@@ -7351,10 +7341,10 @@ function Jl({ disabled: e, element: t, item: n, messages: r, onResponseItemChang
|
|
|
7351
7341
|
}
|
|
7352
7342
|
//#endregion
|
|
7353
7343
|
//#region src/question/player/QuestionPlayer.tsx
|
|
7354
|
-
var
|
|
7355
|
-
function
|
|
7356
|
-
let { locale: t = "zh-CN" } = e, n = Ca(e,
|
|
7357
|
-
return /* @__PURE__ */ a(
|
|
7344
|
+
var ql = ["locale"];
|
|
7345
|
+
function Jl(e) {
|
|
7346
|
+
let { locale: t = "zh-CN" } = e, n = Ca(e, ql), r = xs(n.value, n.questionTypeTemplates), i = Es(n.response, r);
|
|
7347
|
+
return /* @__PURE__ */ a(Yl, k(k({}, n), {}, {
|
|
7358
7348
|
childIndexPath: [],
|
|
7359
7349
|
locale: t,
|
|
7360
7350
|
messages: jc(t),
|
|
@@ -7363,7 +7353,7 @@ function Xl(e) {
|
|
|
7363
7353
|
value: r
|
|
7364
7354
|
}));
|
|
7365
7355
|
}
|
|
7366
|
-
function
|
|
7356
|
+
function Yl({ 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 }) {
|
|
7367
7357
|
let m = oa(d, p);
|
|
7368
7358
|
if (!m) return /* @__PURE__ */ a("div", {
|
|
7369
7359
|
className: U(W.root, t),
|
|
@@ -7372,7 +7362,7 @@ function Zl({ childIndexPath: e, className: t, disabled: n = !1, locale: r = "zh
|
|
|
7372
7362
|
children: i.missingQuestionTypeTemplate
|
|
7373
7363
|
})
|
|
7374
7364
|
});
|
|
7375
|
-
let h =
|
|
7365
|
+
let h = Xl({
|
|
7376
7366
|
childIndexPath: e,
|
|
7377
7367
|
disabled: n,
|
|
7378
7368
|
locale: r,
|
|
@@ -7389,27 +7379,27 @@ function Zl({ childIndexPath: e, className: t, disabled: n = !1, locale: r = "zh
|
|
|
7389
7379
|
});
|
|
7390
7380
|
return /* @__PURE__ */ a("div", {
|
|
7391
7381
|
className: U(W.root, t),
|
|
7392
|
-
children:
|
|
7382
|
+
children: eu(m, p) ? /* @__PURE__ */ a("div", {
|
|
7393
7383
|
className: W.empty,
|
|
7394
7384
|
children: i.previewEmpty
|
|
7395
7385
|
}) : h
|
|
7396
7386
|
});
|
|
7397
7387
|
}
|
|
7398
|
-
function
|
|
7388
|
+
function Xl(e) {
|
|
7399
7389
|
return /* @__PURE__ */ o(i, { children: [
|
|
7390
|
+
Zl(e),
|
|
7400
7391
|
$l(e),
|
|
7401
|
-
|
|
7402
|
-
eu(e)
|
|
7392
|
+
Ql(e)
|
|
7403
7393
|
] });
|
|
7404
7394
|
}
|
|
7405
|
-
function
|
|
7395
|
+
function Zl({ disabled: e, locale: t, messages: n, onResponseChange: r, response: i, showAnswer: o, structure: s, uploadImage: c, value: l }) {
|
|
7406
7396
|
return s.elements.length === 0 ? null : /* @__PURE__ */ a("div", {
|
|
7407
7397
|
className: W["element-list"],
|
|
7408
7398
|
children: s.elements.map((u, d) => {
|
|
7409
7399
|
let f = an(l, d, u), p = s.elements.slice(0, d).filter((e) => e.type !== "richText").length;
|
|
7410
7400
|
return /* @__PURE__ */ a("section", {
|
|
7411
7401
|
className: W.element,
|
|
7412
|
-
children: /* @__PURE__ */ a(
|
|
7402
|
+
children: /* @__PURE__ */ a(Gl, {
|
|
7413
7403
|
disabled: e,
|
|
7414
7404
|
element: u,
|
|
7415
7405
|
item: f,
|
|
@@ -7425,17 +7415,17 @@ function $l({ disabled: e, locale: t, messages: n, onResponseChange: r, response
|
|
|
7425
7415
|
})
|
|
7426
7416
|
});
|
|
7427
7417
|
}
|
|
7428
|
-
function
|
|
7418
|
+
function Ql({ disabled: e, locale: t, messages: n, response: r, showExtraAttributes: i, structure: s, uploadImage: c, value: l }) {
|
|
7429
7419
|
return i ? /* @__PURE__ */ a("div", {
|
|
7430
7420
|
className: W["element-list"],
|
|
7431
7421
|
children: s.extras.map((i, s) => {
|
|
7432
7422
|
let u = on(l, s, i);
|
|
7433
7423
|
return P(u.content) ? null : /* @__PURE__ */ o("section", {
|
|
7434
7424
|
className: W.extra,
|
|
7435
|
-
children: [/* @__PURE__ */ a(Vc, { children: i.name }), /* @__PURE__ */ a(
|
|
7425
|
+
children: [/* @__PURE__ */ a(Vc, { children: i.name }), /* @__PURE__ */ a(Gl, {
|
|
7436
7426
|
disabled: e,
|
|
7437
|
-
element:
|
|
7438
|
-
item:
|
|
7427
|
+
element: tu(i),
|
|
7428
|
+
item: nu(u),
|
|
7439
7429
|
locale: t,
|
|
7440
7430
|
messages: n,
|
|
7441
7431
|
onResponseItemChange: () => void 0,
|
|
@@ -7448,14 +7438,14 @@ function eu({ disabled: e, locale: t, messages: n, response: r, showExtraAttribu
|
|
|
7448
7438
|
})
|
|
7449
7439
|
}) : null;
|
|
7450
7440
|
}
|
|
7451
|
-
function
|
|
7441
|
+
function $l({ childIndexPath: e, disabled: t, locale: n, messages: r, onResponseChange: i, response: o, rootQuestionNumber: s, showAnswer: c, showExtraAttributes: l, questionTypeTemplates: u, uploadImage: d, value: f }) {
|
|
7452
7442
|
return f.children.length === 0 ? null : /* @__PURE__ */ a(Hc, {
|
|
7453
7443
|
childIndexPath: e,
|
|
7454
7444
|
disabled: t,
|
|
7455
7445
|
messages: r,
|
|
7456
7446
|
onChildResponseChange: (e, t) => i(ac(o, e, t)),
|
|
7457
7447
|
response: o,
|
|
7458
|
-
renderChild: (e, i, o, f) => /* @__PURE__ */ a(
|
|
7448
|
+
renderChild: (e, i, o, f) => /* @__PURE__ */ a(Yl, {
|
|
7459
7449
|
childIndexPath: f,
|
|
7460
7450
|
disabled: t,
|
|
7461
7451
|
locale: n,
|
|
@@ -7473,17 +7463,17 @@ function tu({ childIndexPath: e, disabled: t, locale: n, messages: r, onResponse
|
|
|
7473
7463
|
value: f
|
|
7474
7464
|
});
|
|
7475
7465
|
}
|
|
7476
|
-
function
|
|
7466
|
+
function eu(e, t) {
|
|
7477
7467
|
return t.elements.length === 0 && t.extras.length === 0 && t.children.length === 0;
|
|
7478
7468
|
}
|
|
7479
|
-
function
|
|
7469
|
+
function tu(e) {
|
|
7480
7470
|
return {
|
|
7481
7471
|
config: {},
|
|
7482
7472
|
name: e.name,
|
|
7483
7473
|
type: "richText"
|
|
7484
7474
|
};
|
|
7485
7475
|
}
|
|
7486
|
-
function
|
|
7476
|
+
function nu(e) {
|
|
7487
7477
|
return {
|
|
7488
7478
|
content: e.content,
|
|
7489
7479
|
type: "richText"
|
|
@@ -7491,14 +7481,14 @@ function iu(e) {
|
|
|
7491
7481
|
}
|
|
7492
7482
|
//#endregion
|
|
7493
7483
|
//#region src/question/renderers/QuestionBlankGroupView.module.css
|
|
7494
|
-
var
|
|
7484
|
+
var ru = {
|
|
7495
7485
|
"blank-list": "_blank-list_12ccp_1",
|
|
7496
7486
|
"blank-item": "_blank-item_12ccp_11",
|
|
7497
7487
|
"blank-field": "_blank-field_12ccp_17"
|
|
7498
7488
|
};
|
|
7499
7489
|
//#endregion
|
|
7500
7490
|
//#region src/question/renderers/QuestionBlankGroupView.tsx
|
|
7501
|
-
function
|
|
7491
|
+
function iu({ item: e, messages: t, showAnswer: n }) {
|
|
7502
7492
|
let r = N(e.answers, e.blanks).map((n, r) => ({
|
|
7503
7493
|
kind: "detailed",
|
|
7504
7494
|
contents: n.answerPools.map((e, t) => /* @__PURE__ */ a(K, { content: e }, `group-${r}-answer-${t}`)),
|
|
@@ -7507,30 +7497,30 @@ function ou({ item: e, messages: t, showAnswer: n }) {
|
|
|
7507
7497
|
return /* @__PURE__ */ o("div", {
|
|
7508
7498
|
className: G.element,
|
|
7509
7499
|
children: [/* @__PURE__ */ a("ol", {
|
|
7510
|
-
className:
|
|
7500
|
+
className: ru["blank-list"],
|
|
7511
7501
|
children: e.blanks.map((e, n) => /* @__PURE__ */ a("li", {
|
|
7512
|
-
className:
|
|
7502
|
+
className: ru["blank-item"],
|
|
7513
7503
|
children: /* @__PURE__ */ o("span", {
|
|
7514
|
-
className:
|
|
7504
|
+
className: ru["blank-field"],
|
|
7515
7505
|
children: [
|
|
7516
7506
|
t.blankLabel,
|
|
7517
7507
|
" ",
|
|
7518
7508
|
n + 1
|
|
7519
7509
|
]
|
|
7520
7510
|
})
|
|
7521
|
-
},
|
|
7511
|
+
}, au(e, n)))
|
|
7522
7512
|
}), n ? /* @__PURE__ */ a(q, {
|
|
7523
7513
|
groups: r,
|
|
7524
7514
|
title: t.standardAnswer
|
|
7525
7515
|
}) : null]
|
|
7526
7516
|
});
|
|
7527
7517
|
}
|
|
7528
|
-
function
|
|
7518
|
+
function au(e, t) {
|
|
7529
7519
|
return e || `blank-${t + 1}`;
|
|
7530
7520
|
}
|
|
7531
7521
|
//#endregion
|
|
7532
7522
|
//#region src/question/renderers/QuestionClassificationView.tsx
|
|
7533
|
-
function
|
|
7523
|
+
function ou({ item: e, messages: t, showAnswer: n }) {
|
|
7534
7524
|
return /* @__PURE__ */ o("div", {
|
|
7535
7525
|
className: G.element,
|
|
7536
7526
|
children: [/* @__PURE__ */ o("div", {
|
|
@@ -7562,7 +7552,7 @@ function cu({ item: e, messages: t, showAnswer: n }) {
|
|
|
7562
7552
|
}
|
|
7563
7553
|
//#endregion
|
|
7564
7554
|
//#region src/question/renderers/QuestionFillTextView.tsx
|
|
7565
|
-
function
|
|
7555
|
+
function su({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
7566
7556
|
let i = Dn(t, e, !0), s = Rc(i).map((e, t) => ({
|
|
7567
7557
|
kind: "detailed",
|
|
7568
7558
|
contents: e.contents.map((e, n) => /* @__PURE__ */ a(K, { content: e }, `group-${t}-answer-${n}`)),
|
|
@@ -7572,7 +7562,7 @@ function lu({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
|
7572
7562
|
className: G.element,
|
|
7573
7563
|
children: [
|
|
7574
7564
|
/* @__PURE__ */ a(K, { content: i.content }),
|
|
7575
|
-
|
|
7565
|
+
cu(i, n.candidateOptions),
|
|
7576
7566
|
r ? /* @__PURE__ */ a(q, {
|
|
7577
7567
|
groups: s,
|
|
7578
7568
|
title: n.standardAnswer
|
|
@@ -7580,7 +7570,7 @@ function lu({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
|
7580
7570
|
]
|
|
7581
7571
|
});
|
|
7582
7572
|
}
|
|
7583
|
-
function
|
|
7573
|
+
function cu(e, t) {
|
|
7584
7574
|
var n, r;
|
|
7585
7575
|
let i = (n = e.candidateOptions) == null ? [] : n, s = (r = e.blankOptionGroups) == null ? [] : r;
|
|
7586
7576
|
return !i.length && !s.length ? null : /* @__PURE__ */ o("div", {
|
|
@@ -7602,7 +7592,7 @@ function uu(e, t) {
|
|
|
7602
7592
|
}
|
|
7603
7593
|
//#endregion
|
|
7604
7594
|
//#region src/question/renderers/QuestionJudgementGroupView.tsx
|
|
7605
|
-
function
|
|
7595
|
+
function lu({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
7606
7596
|
let i = dn(e.config.judgeAnswerMode), s = [{
|
|
7607
7597
|
kind: "detailed",
|
|
7608
7598
|
contents: fn(e.config.judgeAnswerMode, t.answers),
|
|
@@ -7624,7 +7614,7 @@ function du({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
|
7624
7614
|
}
|
|
7625
7615
|
//#endregion
|
|
7626
7616
|
//#region src/question/renderers/QuestionLineConnectView.tsx
|
|
7627
|
-
function
|
|
7617
|
+
function uu({ item: e, messages: t, showAnswer: n }) {
|
|
7628
7618
|
let r = { gridTemplateColumns: `repeat(${e.columns.length}, minmax(12rem, 1fr))` };
|
|
7629
7619
|
return /* @__PURE__ */ o("div", {
|
|
7630
7620
|
className: G.element,
|
|
@@ -7660,7 +7650,7 @@ function fu({ item: e, messages: t, showAnswer: n }) {
|
|
|
7660
7650
|
}) : null]
|
|
7661
7651
|
});
|
|
7662
7652
|
}
|
|
7663
|
-
var
|
|
7653
|
+
var du = {
|
|
7664
7654
|
board: "_board_5xarh_1",
|
|
7665
7655
|
columns: "_columns_5xarh_6",
|
|
7666
7656
|
column: "_column_5xarh_6",
|
|
@@ -7669,21 +7659,21 @@ var pu = {
|
|
|
7669
7659
|
};
|
|
7670
7660
|
//#endregion
|
|
7671
7661
|
//#region src/question/renderers/QuestionMatchingView.tsx
|
|
7672
|
-
function
|
|
7662
|
+
function fu({ item: e, messages: t, showAnswer: n }) {
|
|
7673
7663
|
return /* @__PURE__ */ o("div", {
|
|
7674
7664
|
className: G.element,
|
|
7675
7665
|
children: [/* @__PURE__ */ a("div", {
|
|
7676
|
-
className:
|
|
7666
|
+
className: du.board,
|
|
7677
7667
|
children: /* @__PURE__ */ a("div", {
|
|
7678
|
-
className:
|
|
7668
|
+
className: du.columns,
|
|
7679
7669
|
children: e.columns.map((e) => /* @__PURE__ */ a("section", {
|
|
7680
|
-
className:
|
|
7670
|
+
className: du.column,
|
|
7681
7671
|
children: e.items.map((t, n) => {
|
|
7682
7672
|
let r = ln(e.labelStyle, n);
|
|
7683
7673
|
return /* @__PURE__ */ o("div", {
|
|
7684
|
-
className:
|
|
7674
|
+
className: du.item,
|
|
7685
7675
|
children: [r ? /* @__PURE__ */ a("span", {
|
|
7686
|
-
className:
|
|
7676
|
+
className: du.marker,
|
|
7687
7677
|
children: r
|
|
7688
7678
|
}) : null, /* @__PURE__ */ a(K, { content: t.content })]
|
|
7689
7679
|
}, t.itemId);
|
|
@@ -7698,7 +7688,7 @@ function mu({ item: e, messages: t, showAnswer: n }) {
|
|
|
7698
7688
|
}
|
|
7699
7689
|
//#endregion
|
|
7700
7690
|
//#region src/question/renderers/QuestionOptionGroupView.tsx
|
|
7701
|
-
function
|
|
7691
|
+
function pu({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
7702
7692
|
let i = pn(t, e.config.optionLabelStyle);
|
|
7703
7693
|
if (e.config.renderer === "table") {
|
|
7704
7694
|
let s = Tl(e, t);
|
|
@@ -7740,7 +7730,7 @@ function hu({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
|
7740
7730
|
}
|
|
7741
7731
|
//#endregion
|
|
7742
7732
|
//#region src/question/renderers/QuestionOrderingView.tsx
|
|
7743
|
-
function
|
|
7733
|
+
function mu({ item: e, messages: t, showAnswer: n }) {
|
|
7744
7734
|
return /* @__PURE__ */ o("div", {
|
|
7745
7735
|
className: G.element,
|
|
7746
7736
|
children: [/* @__PURE__ */ a("ol", {
|
|
@@ -7760,8 +7750,8 @@ function gu({ item: e, messages: t, showAnswer: n }) {
|
|
|
7760
7750
|
}
|
|
7761
7751
|
//#endregion
|
|
7762
7752
|
//#region src/question/renderers/QuestionWordBuilderView.tsx
|
|
7763
|
-
function
|
|
7764
|
-
let i = En(t, !0, e), s =
|
|
7753
|
+
function hu({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
7754
|
+
let i = En(t, !0, e), s = Vl(i, n.blankLabel);
|
|
7765
7755
|
return /* @__PURE__ */ o("div", {
|
|
7766
7756
|
className: G.element,
|
|
7767
7757
|
children: [
|
|
@@ -7795,13 +7785,13 @@ function _u({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
|
7795
7785
|
}
|
|
7796
7786
|
//#endregion
|
|
7797
7787
|
//#region src/question/renderers/QuestionContentElementView.tsx
|
|
7798
|
-
function
|
|
7788
|
+
function gu({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
7799
7789
|
if (e.type !== t.type) throw Error(`\u9898\u76ee\u5143\u7d20\u7ed3\u6784\u4e0d\u5339\u914d\uff0cexpected=${e.type}\uff0cactual=${t.type}`);
|
|
7800
|
-
return e.type === "richText" ? /* @__PURE__ */ a(K, { content: t.content }) : e.type === "textResponse" ? null : e.type === "ordering" ? /* @__PURE__ */ a(
|
|
7790
|
+
return e.type === "richText" ? /* @__PURE__ */ a(K, { content: t.content }) : e.type === "textResponse" ? null : e.type === "ordering" ? /* @__PURE__ */ a(mu, {
|
|
7801
7791
|
item: t,
|
|
7802
7792
|
messages: n,
|
|
7803
7793
|
showAnswer: r
|
|
7804
|
-
}) : e.type === "classification" ? /* @__PURE__ */ a(
|
|
7794
|
+
}) : e.type === "classification" ? /* @__PURE__ */ a(ou, {
|
|
7805
7795
|
item: t,
|
|
7806
7796
|
messages: n,
|
|
7807
7797
|
showAnswer: r
|
|
@@ -7809,57 +7799,57 @@ function vu({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
|
7809
7799
|
item: t,
|
|
7810
7800
|
messages: n,
|
|
7811
7801
|
showAnswer: r
|
|
7812
|
-
}) :
|
|
7802
|
+
}) : _u({
|
|
7813
7803
|
element: e,
|
|
7814
7804
|
item: t,
|
|
7815
7805
|
messages: n,
|
|
7816
7806
|
showAnswer: r
|
|
7817
7807
|
});
|
|
7818
7808
|
}
|
|
7819
|
-
function
|
|
7809
|
+
function _u({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
7820
7810
|
switch (e.type) {
|
|
7821
|
-
case "choice": return /* @__PURE__ */ a(
|
|
7811
|
+
case "choice": return /* @__PURE__ */ a(pu, {
|
|
7822
7812
|
element: e,
|
|
7823
7813
|
item: t,
|
|
7824
7814
|
messages: n,
|
|
7825
7815
|
showAnswer: r
|
|
7826
7816
|
});
|
|
7827
|
-
case "fill": return /* @__PURE__ */ a(
|
|
7817
|
+
case "fill": return /* @__PURE__ */ a(iu, {
|
|
7828
7818
|
item: t,
|
|
7829
7819
|
messages: n,
|
|
7830
7820
|
showAnswer: r
|
|
7831
7821
|
});
|
|
7832
|
-
case "inlineFill": return /* @__PURE__ */ a(
|
|
7822
|
+
case "inlineFill": return /* @__PURE__ */ a(su, {
|
|
7833
7823
|
element: e,
|
|
7834
7824
|
item: t,
|
|
7835
7825
|
messages: n,
|
|
7836
7826
|
showAnswer: r
|
|
7837
7827
|
});
|
|
7838
|
-
case "wordBuilder": return /* @__PURE__ */ a(
|
|
7828
|
+
case "wordBuilder": return /* @__PURE__ */ a(hu, {
|
|
7839
7829
|
element: e,
|
|
7840
7830
|
item: t,
|
|
7841
7831
|
messages: n,
|
|
7842
7832
|
showAnswer: r
|
|
7843
7833
|
});
|
|
7844
|
-
case "judgement": return /* @__PURE__ */ a(
|
|
7834
|
+
case "judgement": return /* @__PURE__ */ a(lu, {
|
|
7845
7835
|
element: e,
|
|
7846
7836
|
item: t,
|
|
7847
7837
|
messages: n,
|
|
7848
7838
|
showAnswer: r
|
|
7849
7839
|
});
|
|
7850
|
-
case "lineConnect": return /* @__PURE__ */ a(
|
|
7840
|
+
case "lineConnect": return /* @__PURE__ */ a(uu, {
|
|
7851
7841
|
item: t,
|
|
7852
7842
|
messages: n,
|
|
7853
7843
|
showAnswer: r
|
|
7854
7844
|
});
|
|
7855
|
-
case "matching": return /* @__PURE__ */ a(
|
|
7845
|
+
case "matching": return /* @__PURE__ */ a(fu, {
|
|
7856
7846
|
item: t,
|
|
7857
7847
|
messages: n,
|
|
7858
7848
|
showAnswer: r
|
|
7859
7849
|
});
|
|
7860
7850
|
}
|
|
7861
7851
|
}
|
|
7862
|
-
var
|
|
7852
|
+
var vu = {
|
|
7863
7853
|
root: "_root_1jseb_1",
|
|
7864
7854
|
empty: "_empty_1jseb_18",
|
|
7865
7855
|
"element-list": "_element-list_1jseb_30",
|
|
@@ -7870,16 +7860,16 @@ var bu = {
|
|
|
7870
7860
|
};
|
|
7871
7861
|
//#endregion
|
|
7872
7862
|
//#region src/question/preview/QuestionCompositePreview.tsx
|
|
7873
|
-
function
|
|
7863
|
+
function yu({ childIndexPath: e = [], messages: t, renderChild: n, rootQuestionNumber: r, value: i }) {
|
|
7874
7864
|
return i.children.length === 0 ? /* @__PURE__ */ a("div", {
|
|
7875
|
-
className:
|
|
7865
|
+
className: vu.empty,
|
|
7876
7866
|
children: t.previewEmpty
|
|
7877
7867
|
}) : /* @__PURE__ */ a("div", {
|
|
7878
|
-
className:
|
|
7868
|
+
className: vu.children,
|
|
7879
7869
|
children: i.children.map((t, o) => {
|
|
7880
7870
|
let s = [...e, o], c = zo(s, i.children.length, r);
|
|
7881
7871
|
return /* @__PURE__ */ a("section", {
|
|
7882
|
-
className:
|
|
7872
|
+
className: vu.child,
|
|
7883
7873
|
children: /* @__PURE__ */ a(Vo, {
|
|
7884
7874
|
indented: !0,
|
|
7885
7875
|
number: c,
|
|
@@ -7891,31 +7881,31 @@ function xu({ childIndexPath: e = [], messages: t, renderChild: n, rootQuestionN
|
|
|
7891
7881
|
}
|
|
7892
7882
|
//#endregion
|
|
7893
7883
|
//#region src/question/preview/QuestionPreview.tsx
|
|
7894
|
-
var
|
|
7895
|
-
function
|
|
7896
|
-
let { locale: t = "zh-CN" } = e, n = Ca(e,
|
|
7897
|
-
return /* @__PURE__ */ a(
|
|
7884
|
+
var bu = ["locale"];
|
|
7885
|
+
function xu(e) {
|
|
7886
|
+
let { locale: t = "zh-CN" } = e, n = Ca(e, bu), r = xs(n.value, n.questionTypeTemplates);
|
|
7887
|
+
return /* @__PURE__ */ a(Su, k(k({}, n), {}, {
|
|
7898
7888
|
childIndexPath: [],
|
|
7899
7889
|
messages: jc(t),
|
|
7900
7890
|
value: r
|
|
7901
7891
|
}));
|
|
7902
7892
|
}
|
|
7903
|
-
function
|
|
7893
|
+
function Su({ childIndexPath: e, className: t, messages: n, rootQuestionNumber: r, showAnswer: s = !1, showExtraAttributes: c = !1, questionTypeTemplates: l, value: u }) {
|
|
7904
7894
|
let d = oa(l, u);
|
|
7905
7895
|
if (!d) return /* @__PURE__ */ a("div", {
|
|
7906
|
-
className: U(
|
|
7896
|
+
className: U(vu.root, t),
|
|
7907
7897
|
children: /* @__PURE__ */ a("div", {
|
|
7908
|
-
className:
|
|
7898
|
+
className: vu.empty,
|
|
7909
7899
|
children: n.missingQuestionTypeTemplate
|
|
7910
7900
|
})
|
|
7911
7901
|
});
|
|
7912
7902
|
let f = d.elements.length === 0 ? null : /* @__PURE__ */ a("div", {
|
|
7913
|
-
className:
|
|
7903
|
+
className: vu["element-list"],
|
|
7914
7904
|
children: d.elements.map((e, t) => {
|
|
7915
7905
|
let r = an(u, t, e);
|
|
7916
7906
|
return /* @__PURE__ */ a("section", {
|
|
7917
|
-
className:
|
|
7918
|
-
children: /* @__PURE__ */ a(
|
|
7907
|
+
className: vu.element,
|
|
7908
|
+
children: /* @__PURE__ */ a(gu, {
|
|
7919
7909
|
element: e,
|
|
7920
7910
|
item: r,
|
|
7921
7911
|
messages: n,
|
|
@@ -7924,14 +7914,14 @@ function wu({ childIndexPath: e, className: t, messages: n, rootQuestionNumber:
|
|
|
7924
7914
|
}, `${e.type}-${t}`);
|
|
7925
7915
|
})
|
|
7926
7916
|
}), p = c ? /* @__PURE__ */ a("div", {
|
|
7927
|
-
className:
|
|
7917
|
+
className: vu["element-list"],
|
|
7928
7918
|
children: d.extras.map((e, t) => {
|
|
7929
7919
|
let r = on(u, t, e);
|
|
7930
7920
|
return P(r.content) ? null : /* @__PURE__ */ o("section", {
|
|
7931
|
-
className:
|
|
7932
|
-
children: [/* @__PURE__ */ a(Vc, { children: e.name }), /* @__PURE__ */ a(
|
|
7933
|
-
element:
|
|
7934
|
-
item:
|
|
7921
|
+
className: vu.extra,
|
|
7922
|
+
children: [/* @__PURE__ */ a(Vc, { children: e.name }), /* @__PURE__ */ a(gu, {
|
|
7923
|
+
element: wu(e),
|
|
7924
|
+
item: Tu(r),
|
|
7935
7925
|
messages: n,
|
|
7936
7926
|
showAnswer: !1
|
|
7937
7927
|
})]
|
|
@@ -7939,10 +7929,10 @@ function wu({ childIndexPath: e, className: t, messages: n, rootQuestionNumber:
|
|
|
7939
7929
|
})
|
|
7940
7930
|
}) : null, m = /* @__PURE__ */ o(i, { children: [
|
|
7941
7931
|
f,
|
|
7942
|
-
u.children.length === 0 ? null : /* @__PURE__ */ a(
|
|
7932
|
+
u.children.length === 0 ? null : /* @__PURE__ */ a(yu, {
|
|
7943
7933
|
childIndexPath: e,
|
|
7944
7934
|
messages: n,
|
|
7945
|
-
renderChild: (e, t) => /* @__PURE__ */ a(
|
|
7935
|
+
renderChild: (e, t) => /* @__PURE__ */ a(Su, {
|
|
7946
7936
|
childIndexPath: t,
|
|
7947
7937
|
messages: n,
|
|
7948
7938
|
rootQuestionNumber: r,
|
|
@@ -7957,30 +7947,30 @@ function wu({ childIndexPath: e, className: t, messages: n, rootQuestionNumber:
|
|
|
7957
7947
|
p
|
|
7958
7948
|
] });
|
|
7959
7949
|
return /* @__PURE__ */ a("div", {
|
|
7960
|
-
className: U(
|
|
7961
|
-
children:
|
|
7962
|
-
className:
|
|
7950
|
+
className: U(vu.root, t),
|
|
7951
|
+
children: Cu(d, u) ? /* @__PURE__ */ a("div", {
|
|
7952
|
+
className: vu.empty,
|
|
7963
7953
|
children: n.previewEmpty
|
|
7964
7954
|
}) : m
|
|
7965
7955
|
});
|
|
7966
7956
|
}
|
|
7967
|
-
function
|
|
7957
|
+
function Cu(e, t) {
|
|
7968
7958
|
return t.elements.length === 0 && t.extras.length === 0 && t.children.length === 0;
|
|
7969
7959
|
}
|
|
7970
|
-
function
|
|
7960
|
+
function wu(e) {
|
|
7971
7961
|
return {
|
|
7972
7962
|
config: {},
|
|
7973
7963
|
name: e.name,
|
|
7974
7964
|
type: "richText"
|
|
7975
7965
|
};
|
|
7976
7966
|
}
|
|
7977
|
-
function
|
|
7967
|
+
function Tu(e) {
|
|
7978
7968
|
return {
|
|
7979
7969
|
content: e.content,
|
|
7980
7970
|
type: "richText"
|
|
7981
7971
|
};
|
|
7982
7972
|
}
|
|
7983
|
-
var
|
|
7973
|
+
var Eu = {
|
|
7984
7974
|
root: "_root_17bqr_1",
|
|
7985
7975
|
toolbar: "_toolbar_17bqr_26",
|
|
7986
7976
|
"toolbar-title": "_toolbar-title_17bqr_36",
|
|
@@ -8032,7 +8022,7 @@ var Ou = {
|
|
|
8032
8022
|
"palette-section": "_palette-section_vhj2r_56",
|
|
8033
8023
|
"palette-section-title": "_palette-section-title_vhj2r_62",
|
|
8034
8024
|
"palette-button": "_palette-button_vhj2r_70"
|
|
8035
|
-
},
|
|
8025
|
+
}, Du = {
|
|
8036
8026
|
"en-US": {
|
|
8037
8027
|
addElement: "Add element",
|
|
8038
8028
|
addExtra: "Add extra attribute",
|
|
@@ -8254,24 +8244,24 @@ var Ou = {
|
|
|
8254
8244
|
wordBuilderLabel: "\u7ec4\u8bcd\u62fc\u5199"
|
|
8255
8245
|
}
|
|
8256
8246
|
};
|
|
8257
|
-
function
|
|
8247
|
+
function Ou(e, t) {
|
|
8258
8248
|
var n;
|
|
8259
8249
|
return (n = e.extraDescriptions.get(t)) == null ? t : n;
|
|
8260
8250
|
}
|
|
8261
|
-
function
|
|
8251
|
+
function ku(e, t) {
|
|
8262
8252
|
var n;
|
|
8263
8253
|
return (n = e.extraLabels.get(t)) == null ? t : n;
|
|
8264
8254
|
}
|
|
8265
|
-
function
|
|
8255
|
+
function Au(e) {
|
|
8266
8256
|
switch (e) {
|
|
8267
|
-
case "en-US": return
|
|
8268
|
-
case "zh-CN": return
|
|
8257
|
+
case "en-US": return Du["en-US"];
|
|
8258
|
+
case "zh-CN": return Du["zh-CN"];
|
|
8269
8259
|
}
|
|
8270
8260
|
}
|
|
8271
|
-
function
|
|
8272
|
-
return t === "richText" ? e.richTextDescription : t === "ordering" ? e.orderingDescription :
|
|
8261
|
+
function ju(e, t) {
|
|
8262
|
+
return t === "richText" ? e.richTextDescription : t === "ordering" ? e.orderingDescription : Pu(e, t);
|
|
8273
8263
|
}
|
|
8274
|
-
var
|
|
8264
|
+
var Mu = {
|
|
8275
8265
|
choice: (e) => e.optionGroupDescription,
|
|
8276
8266
|
classification: (e) => e.classificationDescription,
|
|
8277
8267
|
fill: (e) => e.blankGroupDescription,
|
|
@@ -8282,7 +8272,7 @@ var Pu = {
|
|
|
8282
8272
|
textMarker: (e) => e.textMarkerDescription,
|
|
8283
8273
|
textResponse: (e) => e.textResponseDescription,
|
|
8284
8274
|
wordBuilder: (e) => e.wordBuilderDescription
|
|
8285
|
-
},
|
|
8275
|
+
}, Nu = {
|
|
8286
8276
|
choice: (e) => e.optionGroupLabel,
|
|
8287
8277
|
classification: (e) => e.classificationLabel,
|
|
8288
8278
|
fill: (e) => e.blankGroupLabel,
|
|
@@ -8294,30 +8284,30 @@ var Pu = {
|
|
|
8294
8284
|
textResponse: (e) => e.textResponseLabel,
|
|
8295
8285
|
wordBuilder: (e) => e.wordBuilderLabel
|
|
8296
8286
|
};
|
|
8297
|
-
function
|
|
8298
|
-
return
|
|
8287
|
+
function Pu(e, t) {
|
|
8288
|
+
return Mu[t](e);
|
|
8299
8289
|
}
|
|
8300
|
-
function
|
|
8301
|
-
return t === "richText" ? e.richTextLabel : t === "ordering" ? e.orderingLabel :
|
|
8290
|
+
function Fu(e, t) {
|
|
8291
|
+
return t === "richText" ? e.richTextLabel : t === "ordering" ? e.orderingLabel : Iu(e, t);
|
|
8302
8292
|
}
|
|
8303
|
-
function
|
|
8304
|
-
return
|
|
8293
|
+
function Iu(e, t) {
|
|
8294
|
+
return Nu[t](e);
|
|
8305
8295
|
}
|
|
8306
|
-
function
|
|
8296
|
+
function Lu(e, t) {
|
|
8307
8297
|
var n;
|
|
8308
8298
|
return (n = e.optionValueLabels.get(t)) == null ? t : n;
|
|
8309
8299
|
}
|
|
8310
|
-
function
|
|
8300
|
+
function Ru(e, t) {
|
|
8311
8301
|
var n;
|
|
8312
8302
|
return (n = e.candidateModeValueLabels.get(t)) == null ? t : n;
|
|
8313
8303
|
}
|
|
8314
|
-
function
|
|
8304
|
+
function zu(e, t) {
|
|
8315
8305
|
var n;
|
|
8316
8306
|
return (n = e.lineConnectLabelStyleLabels.get(t)) == null ? t : n;
|
|
8317
8307
|
}
|
|
8318
8308
|
//#endregion
|
|
8319
8309
|
//#region src/question/structure-editor/QuestionStructureCanvas.tsx
|
|
8320
|
-
function
|
|
8310
|
+
function Bu({ elements: e, extras: t, labels: n, onDeleteElement: r, onDeleteExtra: i, onMoveElement: s, onSelectElement: c, selectedElementClientId: l }) {
|
|
8321
8311
|
let [u, d] = h(null);
|
|
8322
8312
|
return /* @__PURE__ */ o("section", {
|
|
8323
8313
|
className: Q.panel,
|
|
@@ -8337,7 +8327,7 @@ function Hu({ elements: e, extras: t, labels: n, onDeleteElement: r, onDeleteExt
|
|
|
8337
8327
|
className: Z["element-list"],
|
|
8338
8328
|
children: [
|
|
8339
8329
|
e.map((t, i) => {
|
|
8340
|
-
let f = t.clientId === l, p =
|
|
8330
|
+
let f = t.clientId === l, p = Fu(n, t.type);
|
|
8341
8331
|
return /* @__PURE__ */ o("div", {
|
|
8342
8332
|
className: `${Z["element-card"]} ${f ? Z.active : ""}`,
|
|
8343
8333
|
onClick: () => c(t.clientId),
|
|
@@ -8401,7 +8391,7 @@ function Hu({ elements: e, extras: t, labels: n, onDeleteElement: r, onDeleteExt
|
|
|
8401
8391
|
children: n.extraTitle
|
|
8402
8392
|
}) : null,
|
|
8403
8393
|
t.map((t, r) => {
|
|
8404
|
-
let s = t.clientId === l, f =
|
|
8394
|
+
let s = t.clientId === l, f = ku(n, t.type);
|
|
8405
8395
|
return /* @__PURE__ */ o("div", {
|
|
8406
8396
|
className: `${Z["element-card"]} ${s ? Z.active : ""}`,
|
|
8407
8397
|
onClick: () => c(t.clientId),
|
|
@@ -8450,7 +8440,7 @@ function Hu({ elements: e, extras: t, labels: n, onDeleteElement: r, onDeleteExt
|
|
|
8450
8440
|
}
|
|
8451
8441
|
//#endregion
|
|
8452
8442
|
//#region src/question/structure-editor/QuestionStructurePalette.tsx
|
|
8453
|
-
function
|
|
8443
|
+
function Vu({ addedExtraTypes: e, labels: t, onAddElement: n, onAddExtra: r }) {
|
|
8454
8444
|
let i = new Set(e);
|
|
8455
8445
|
return /* @__PURE__ */ o("aside", {
|
|
8456
8446
|
className: Q.panel,
|
|
@@ -8465,11 +8455,11 @@ function Uu({ addedExtraTypes: e, labels: t, onAddElement: n, onAddExtra: r }) {
|
|
|
8465
8455
|
/* @__PURE__ */ a("div", {
|
|
8466
8456
|
className: Q.palette,
|
|
8467
8457
|
children: se.map((e) => /* @__PURE__ */ o("button", {
|
|
8468
|
-
"aria-label": `${t.addElement}: ${
|
|
8458
|
+
"aria-label": `${t.addElement}: ${Fu(t, e)}`,
|
|
8469
8459
|
className: Q["palette-button"],
|
|
8470
8460
|
onClick: () => n(e),
|
|
8471
8461
|
type: "button",
|
|
8472
|
-
children: [/* @__PURE__ */ a("strong", { children:
|
|
8462
|
+
children: [/* @__PURE__ */ a("strong", { children: Fu(t, e) }), /* @__PURE__ */ a("small", { children: ju(t, e) })]
|
|
8473
8463
|
}, e))
|
|
8474
8464
|
}),
|
|
8475
8465
|
/* @__PURE__ */ o("div", {
|
|
@@ -8482,12 +8472,12 @@ function Uu({ addedExtraTypes: e, labels: t, onAddElement: n, onAddExtra: r }) {
|
|
|
8482
8472
|
children: ce.map((e) => {
|
|
8483
8473
|
let n = i.has(e);
|
|
8484
8474
|
return /* @__PURE__ */ o("button", {
|
|
8485
|
-
"aria-label": `${t.addExtra}: ${
|
|
8475
|
+
"aria-label": `${t.addExtra}: ${ku(t, e)}`,
|
|
8486
8476
|
className: Q["palette-button"],
|
|
8487
8477
|
disabled: n,
|
|
8488
8478
|
onClick: () => r(e),
|
|
8489
8479
|
type: "button",
|
|
8490
|
-
children: [/* @__PURE__ */ a("strong", { children:
|
|
8480
|
+
children: [/* @__PURE__ */ a("strong", { children: ku(t, e) }), /* @__PURE__ */ a("small", { children: Ou(t, e) })]
|
|
8491
8481
|
}, e);
|
|
8492
8482
|
})
|
|
8493
8483
|
})]
|
|
@@ -8504,27 +8494,27 @@ var $ = {
|
|
|
8504
8494
|
select: "_select_tgswd_27",
|
|
8505
8495
|
textarea: "_textarea_tgswd_28",
|
|
8506
8496
|
empty: "_empty_tgswd_61"
|
|
8507
|
-
},
|
|
8497
|
+
}, Hu = [
|
|
8508
8498
|
"none",
|
|
8509
8499
|
"sharedPool",
|
|
8510
8500
|
"perBlankOptions"
|
|
8511
|
-
],
|
|
8501
|
+
], Uu = [
|
|
8512
8502
|
"upperAlpha",
|
|
8513
8503
|
"lowerAlpha",
|
|
8514
8504
|
"number"
|
|
8515
|
-
],
|
|
8505
|
+
], Wu = [
|
|
8516
8506
|
"number",
|
|
8517
8507
|
"upperAlpha",
|
|
8518
8508
|
"lowerAlpha",
|
|
8519
8509
|
"lowerRoman",
|
|
8520
8510
|
"chineseNumber",
|
|
8521
8511
|
"none"
|
|
8522
|
-
],
|
|
8512
|
+
], Gu = [
|
|
8523
8513
|
2,
|
|
8524
8514
|
3,
|
|
8525
8515
|
4,
|
|
8526
8516
|
5
|
|
8527
|
-
],
|
|
8517
|
+
], Ku = ["standard", "table"], qu = ["single", "multiple"], Ju = ["spelling", "sentence"], Yu = [
|
|
8528
8518
|
"correctWrong",
|
|
8529
8519
|
"yesNo",
|
|
8530
8520
|
"validInvalid",
|
|
@@ -8532,8 +8522,8 @@ var $ = {
|
|
|
8532
8522
|
"rightWrong",
|
|
8533
8523
|
"checkCross"
|
|
8534
8524
|
];
|
|
8535
|
-
function
|
|
8536
|
-
let f =
|
|
8525
|
+
function Xu({ description: e, globalConfig: t, isSubjective: n, labels: r, onElementChange: i, onExtraChange: s, onGlobalConfigChange: c, onMetadataChange: l, selectedExtra: u, selectedElement: d }) {
|
|
8526
|
+
let f = Zu({
|
|
8537
8527
|
labels: r,
|
|
8538
8528
|
onElementChange: i,
|
|
8539
8529
|
onExtraChange: s,
|
|
@@ -8615,7 +8605,7 @@ function Qu({ description: e, globalConfig: t, isSubjective: n, labels: r, onEle
|
|
|
8615
8605
|
})]
|
|
8616
8606
|
});
|
|
8617
8607
|
}
|
|
8618
|
-
function
|
|
8608
|
+
function Zu({ labels: e, onElementChange: t, onExtraChange: n, selectedElement: r, selectedExtra: i }) {
|
|
8619
8609
|
return r ? /* @__PURE__ */ o("div", {
|
|
8620
8610
|
className: $["form-stack"],
|
|
8621
8611
|
children: [
|
|
@@ -8635,7 +8625,7 @@ function $u({ labels: e, onElementChange: t, onExtraChange: n, selectedElement:
|
|
|
8635
8625
|
value: r.enName
|
|
8636
8626
|
})]
|
|
8637
8627
|
}),
|
|
8638
|
-
|
|
8628
|
+
Qu(r, e, t)
|
|
8639
8629
|
]
|
|
8640
8630
|
}) : i ? /* @__PURE__ */ o("div", {
|
|
8641
8631
|
className: $["form-stack"],
|
|
@@ -8659,10 +8649,10 @@ function $u({ labels: e, onElementChange: t, onExtraChange: n, selectedElement:
|
|
|
8659
8649
|
children: e.noElement
|
|
8660
8650
|
});
|
|
8661
8651
|
}
|
|
8662
|
-
function
|
|
8663
|
-
return e.type === "fill" || e.type === "classification" || e.type === "ordering" || e.type === "richText" || e.type === "textMarker" || e.type === "textResponse" ? null :
|
|
8652
|
+
function Qu(e, t, n) {
|
|
8653
|
+
return e.type === "fill" || e.type === "classification" || e.type === "ordering" || e.type === "richText" || e.type === "textMarker" || e.type === "textResponse" ? null : $u(e, t, n);
|
|
8664
8654
|
}
|
|
8665
|
-
function
|
|
8655
|
+
function $u(e, t, n) {
|
|
8666
8656
|
switch (e.type) {
|
|
8667
8657
|
case "inlineFill": return /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ o("label", {
|
|
8668
8658
|
className: $["form-row"],
|
|
@@ -8670,9 +8660,9 @@ function td(e, t, n) {
|
|
|
8670
8660
|
className: $.select,
|
|
8671
8661
|
onChange: (t) => n(k(k({}, e), {}, { config: k(k({}, e.config), {}, { candidateMode: t.target.value }) })),
|
|
8672
8662
|
value: e.config.candidateMode,
|
|
8673
|
-
children:
|
|
8663
|
+
children: Hu.map((e) => /* @__PURE__ */ a("option", {
|
|
8674
8664
|
value: e,
|
|
8675
|
-
children:
|
|
8665
|
+
children: Ru(t, e)
|
|
8676
8666
|
}, e))
|
|
8677
8667
|
})]
|
|
8678
8668
|
}), /* @__PURE__ */ o("label", {
|
|
@@ -8689,9 +8679,9 @@ function td(e, t, n) {
|
|
|
8689
8679
|
className: $.select,
|
|
8690
8680
|
onChange: (t) => n(k(k({}, e), {}, { config: { builderMode: t.target.value } })),
|
|
8691
8681
|
value: e.config.builderMode,
|
|
8692
|
-
children:
|
|
8682
|
+
children: Ju.map((e) => /* @__PURE__ */ a("option", {
|
|
8693
8683
|
value: e,
|
|
8694
|
-
children:
|
|
8684
|
+
children: Lu(t, e)
|
|
8695
8685
|
}, e))
|
|
8696
8686
|
})]
|
|
8697
8687
|
});
|
|
@@ -8701,18 +8691,18 @@ function td(e, t, n) {
|
|
|
8701
8691
|
className: $.select,
|
|
8702
8692
|
onChange: (t) => n(k(k({}, e), {}, { config: { judgeAnswerMode: t.target.value } })),
|
|
8703
8693
|
value: e.config.judgeAnswerMode,
|
|
8704
|
-
children:
|
|
8694
|
+
children: Yu.map((e) => /* @__PURE__ */ a("option", {
|
|
8705
8695
|
value: e,
|
|
8706
|
-
children:
|
|
8696
|
+
children: Lu(t, e)
|
|
8707
8697
|
}, e))
|
|
8708
8698
|
})]
|
|
8709
8699
|
});
|
|
8710
|
-
case "choice": return
|
|
8711
|
-
case "lineConnect": return
|
|
8712
|
-
case "matching": return
|
|
8700
|
+
case "choice": return ed(e, t, n);
|
|
8701
|
+
case "lineConnect": return td(e, t, n);
|
|
8702
|
+
case "matching": return nd(e, t, n);
|
|
8713
8703
|
}
|
|
8714
8704
|
}
|
|
8715
|
-
function
|
|
8705
|
+
function ed(e, t, n) {
|
|
8716
8706
|
return /* @__PURE__ */ o(i, { children: [
|
|
8717
8707
|
/* @__PURE__ */ o("label", {
|
|
8718
8708
|
className: $["form-row"],
|
|
@@ -8720,9 +8710,9 @@ function nd(e, t, n) {
|
|
|
8720
8710
|
className: $.select,
|
|
8721
8711
|
onChange: (t) => n(k(k({}, e), {}, { config: k(k({}, e.config), {}, { selectionType: t.target.value }) })),
|
|
8722
8712
|
value: e.config.selectionType,
|
|
8723
|
-
children:
|
|
8713
|
+
children: qu.map((e) => /* @__PURE__ */ a("option", {
|
|
8724
8714
|
value: e,
|
|
8725
|
-
children:
|
|
8715
|
+
children: Lu(t, e)
|
|
8726
8716
|
}, e))
|
|
8727
8717
|
})]
|
|
8728
8718
|
}),
|
|
@@ -8732,9 +8722,9 @@ function nd(e, t, n) {
|
|
|
8732
8722
|
className: $.select,
|
|
8733
8723
|
onChange: (t) => n(k(k({}, e), {}, { config: k(k({}, e.config), {}, { optionLabelStyle: t.target.value }) })),
|
|
8734
8724
|
value: e.config.optionLabelStyle,
|
|
8735
|
-
children:
|
|
8725
|
+
children: Uu.map((e) => /* @__PURE__ */ a("option", {
|
|
8736
8726
|
value: e,
|
|
8737
|
-
children:
|
|
8727
|
+
children: Lu(t, e)
|
|
8738
8728
|
}, e))
|
|
8739
8729
|
})]
|
|
8740
8730
|
}),
|
|
@@ -8744,23 +8734,23 @@ function nd(e, t, n) {
|
|
|
8744
8734
|
className: $.select,
|
|
8745
8735
|
onChange: (t) => n(k(k({}, e), {}, { config: k(k({}, e.config), {}, { renderer: t.target.value }) })),
|
|
8746
8736
|
value: e.config.renderer,
|
|
8747
|
-
children:
|
|
8737
|
+
children: Ku.map((e) => /* @__PURE__ */ a("option", {
|
|
8748
8738
|
value: e,
|
|
8749
|
-
children:
|
|
8739
|
+
children: Lu(t, e)
|
|
8750
8740
|
}, e))
|
|
8751
8741
|
})]
|
|
8752
8742
|
})
|
|
8753
8743
|
] });
|
|
8754
8744
|
}
|
|
8755
|
-
function
|
|
8756
|
-
let r =
|
|
8745
|
+
function td(e, t, n) {
|
|
8746
|
+
let r = rd(e.config.columns);
|
|
8757
8747
|
return /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ o("label", {
|
|
8758
8748
|
className: $["form-row"],
|
|
8759
8749
|
children: [/* @__PURE__ */ a("span", { children: t.lineConnectColumnCount }), /* @__PURE__ */ a("select", {
|
|
8760
8750
|
className: $.select,
|
|
8761
|
-
onChange: (t) => n(k(k({}, e), {}, { config: { columns:
|
|
8751
|
+
onChange: (t) => n(k(k({}, e), {}, { config: { columns: ad(r, Number(t.target.value)) } })),
|
|
8762
8752
|
value: r.length,
|
|
8763
|
-
children:
|
|
8753
|
+
children: Gu.map((e) => /* @__PURE__ */ a("option", {
|
|
8764
8754
|
value: e,
|
|
8765
8755
|
children: e
|
|
8766
8756
|
}, e))
|
|
@@ -8771,47 +8761,47 @@ function rd(e, t, n) {
|
|
|
8771
8761
|
className: $.select,
|
|
8772
8762
|
onChange: (t) => n(k(k({}, e), {}, { config: { columns: r.map((e, n) => n === s ? { labelStyle: t.target.value } : e) } })),
|
|
8773
8763
|
value: i.labelStyle,
|
|
8774
|
-
children:
|
|
8764
|
+
children: Wu.map((e) => /* @__PURE__ */ a("option", {
|
|
8775
8765
|
value: e,
|
|
8776
|
-
children:
|
|
8766
|
+
children: zu(t, e)
|
|
8777
8767
|
}, e))
|
|
8778
8768
|
})]
|
|
8779
8769
|
}, `line-column-${s}`))] });
|
|
8780
8770
|
}
|
|
8781
|
-
function
|
|
8782
|
-
let r =
|
|
8771
|
+
function nd(e, t, n) {
|
|
8772
|
+
let r = id(e.config.columns);
|
|
8783
8773
|
return /* @__PURE__ */ a(i, { children: r.map((i, s) => /* @__PURE__ */ o("label", {
|
|
8784
8774
|
className: $["form-row"],
|
|
8785
8775
|
children: [/* @__PURE__ */ a("span", { children: t.lineConnectColumnLabel(s + 1) }), /* @__PURE__ */ a("select", {
|
|
8786
8776
|
className: $.select,
|
|
8787
8777
|
onChange: (t) => n(k(k({}, e), {}, { config: { columns: r.map((e, n) => n === s ? { labelStyle: t.target.value } : e) } })),
|
|
8788
8778
|
value: i.labelStyle,
|
|
8789
|
-
children:
|
|
8779
|
+
children: Wu.map((e) => /* @__PURE__ */ a("option", {
|
|
8790
8780
|
value: e,
|
|
8791
|
-
children:
|
|
8781
|
+
children: zu(t, e)
|
|
8792
8782
|
}, e))
|
|
8793
8783
|
})]
|
|
8794
8784
|
}, `matching-column-${s}`)) });
|
|
8795
8785
|
}
|
|
8796
|
-
function
|
|
8786
|
+
function rd(e) {
|
|
8797
8787
|
let t = e.slice(0, 5);
|
|
8798
|
-
return t.length >= 2 ? t : [...t, ...
|
|
8788
|
+
return t.length >= 2 ? t : [...t, ...Wu.slice(t.length, 2).map((e) => ({ labelStyle: e }))];
|
|
8799
8789
|
}
|
|
8800
|
-
function
|
|
8790
|
+
function id(e) {
|
|
8801
8791
|
let t = e.slice(0, 2);
|
|
8802
|
-
return t.length >= 2 ? t : [...t, ...
|
|
8792
|
+
return t.length >= 2 ? t : [...t, ...Wu.slice(t.length, 2).map((e) => ({ labelStyle: e }))];
|
|
8803
8793
|
}
|
|
8804
|
-
function
|
|
8794
|
+
function ad(e, t) {
|
|
8805
8795
|
return Array.from({ length: Math.min(5, Math.max(2, t)) }, (t, n) => {
|
|
8806
8796
|
var r, i;
|
|
8807
|
-
return (r = e.slice(n, n + 1)[0]) == null ? { labelStyle: (i =
|
|
8797
|
+
return (r = e.slice(n, n + 1)[0]) == null ? { labelStyle: (i = Wu[n]) == null ? "number" : i } : r;
|
|
8808
8798
|
});
|
|
8809
8799
|
}
|
|
8810
8800
|
//#endregion
|
|
8811
8801
|
//#region src/question/structure-editor/QuestionStructureEditor.tsx
|
|
8812
|
-
function
|
|
8802
|
+
function od({ locale: e = "zh-CN", onChange: t, value: n }) {
|
|
8813
8803
|
var r, i, s, c;
|
|
8814
|
-
let l =
|
|
8804
|
+
let l = Au(e), [u, d] = h((r = (i = n.elements[0]) == null ? void 0 : i.clientId) == null ? null : r), { selectedElement: f, selectedExtra: p } = sd(n, u);
|
|
8815
8805
|
function m(e) {
|
|
8816
8806
|
let r = he(e, n.elements);
|
|
8817
8807
|
t(k(k({}, n), {}, { elements: [...n.elements, r] })), d(r.clientId);
|
|
@@ -8823,11 +8813,11 @@ function cd({ locale: e = "zh-CN", onChange: t, value: n }) {
|
|
|
8823
8813
|
}
|
|
8824
8814
|
function _(e) {
|
|
8825
8815
|
let r = ye(n, e);
|
|
8826
|
-
t(r), d(
|
|
8816
|
+
t(r), d(cd(r));
|
|
8827
8817
|
}
|
|
8828
8818
|
function v(e) {
|
|
8829
8819
|
let r = ve(n, e);
|
|
8830
|
-
t(r), d(
|
|
8820
|
+
t(r), d(cd(r));
|
|
8831
8821
|
}
|
|
8832
8822
|
function y(e) {
|
|
8833
8823
|
t(Se(n, e.clientId, e));
|
|
@@ -8842,19 +8832,19 @@ function cd({ locale: e = "zh-CN", onChange: t, value: n }) {
|
|
|
8842
8832
|
t(we(n, e));
|
|
8843
8833
|
}
|
|
8844
8834
|
return /* @__PURE__ */ a("section", {
|
|
8845
|
-
className:
|
|
8835
|
+
className: Eu.root,
|
|
8846
8836
|
children: /* @__PURE__ */ a("div", {
|
|
8847
8837
|
className: Q.shell,
|
|
8848
8838
|
children: /* @__PURE__ */ o("div", {
|
|
8849
8839
|
className: Q.grid,
|
|
8850
8840
|
children: [
|
|
8851
|
-
/* @__PURE__ */ a(
|
|
8841
|
+
/* @__PURE__ */ a(Vu, {
|
|
8852
8842
|
addedExtraTypes: n.extras.map((e) => e.type),
|
|
8853
8843
|
labels: l,
|
|
8854
8844
|
onAddElement: m,
|
|
8855
8845
|
onAddExtra: g
|
|
8856
8846
|
}),
|
|
8857
|
-
/* @__PURE__ */ a(
|
|
8847
|
+
/* @__PURE__ */ a(Bu, {
|
|
8858
8848
|
elements: n.elements,
|
|
8859
8849
|
extras: n.extras,
|
|
8860
8850
|
labels: l,
|
|
@@ -8864,7 +8854,7 @@ function cd({ locale: e = "zh-CN", onChange: t, value: n }) {
|
|
|
8864
8854
|
onSelectElement: d,
|
|
8865
8855
|
selectedElementClientId: (s = (c = f == null ? void 0 : f.clientId) == null ? p == null ? void 0 : p.clientId : c) == null ? null : s
|
|
8866
8856
|
}),
|
|
8867
|
-
/* @__PURE__ */ a(
|
|
8857
|
+
/* @__PURE__ */ a(Xu, {
|
|
8868
8858
|
description: n.description,
|
|
8869
8859
|
globalConfig: n.globalConfig,
|
|
8870
8860
|
isSubjective: n.isSubjective,
|
|
@@ -8881,7 +8871,7 @@ function cd({ locale: e = "zh-CN", onChange: t, value: n }) {
|
|
|
8881
8871
|
})
|
|
8882
8872
|
});
|
|
8883
8873
|
}
|
|
8884
|
-
function
|
|
8874
|
+
function sd(e, t) {
|
|
8885
8875
|
var n, r, i, a;
|
|
8886
8876
|
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;
|
|
8887
8877
|
return o || s ? {
|
|
@@ -8892,9 +8882,9 @@ function ld(e, t) {
|
|
|
8892
8882
|
selectedExtra: e.elements[0] || (a = e.extras[0]) == null ? null : a
|
|
8893
8883
|
};
|
|
8894
8884
|
}
|
|
8895
|
-
function
|
|
8885
|
+
function cd(e) {
|
|
8896
8886
|
var t, n, r, i;
|
|
8897
8887
|
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;
|
|
8898
8888
|
}
|
|
8899
8889
|
//#endregion
|
|
8900
|
-
export { is as QuestionContentEditor,
|
|
8890
|
+
export { is as QuestionContentEditor, Jl as QuestionPlayer, xu as QuestionPreview, K as QuestionRichContentView, od as QuestionStructureEditor, Wn as addBlankToGroup, vn as alignQuestionContentDraftWithStructure, qn as assignBlankToAnswerGroup, Ya as cn, Jn as createBlankAnswerGroupWithBlank, Jt as createEmptyQuestionContentDraft, Gs as createEmptyQuestionPlayerResponse, pe as createEmptyQuestionStructureDraft, _n as createQuestionContentDraftFromSerialized, D as createQuestionContentId, ss as createQuestionContentStructureFromDraft, cs as createQuestionPreviewDraft, he as createQuestionStructureElement, me as createQuestionStructureExtra, M as createRichContentValue, $t as createRichContentValueFromDocument, Pe as createRichTextContent, Gn as deleteBlankFromGroup, ye as deleteQuestionStructureElement, ve as deleteQuestionStructureExtra, Yn as detachBlankFromAnswerGroup, ia as findQuestionContentQuestionTypeStructure, ca as findQuestionContentQuestionTypeTemplate, un as getQuestionContentJudgementOptions, sn as getQuestionContentOptionMarker, nn as getQuestionContentTextMarkerAnswerText, us as getQuestionStructureDraftChangeKind, j as getQuestionStructureElementDefaultEnName, A as getQuestionStructureElementDefaultName, Ee as getQuestionStructureExtraDefaultEnName, Te as getQuestionStructureExtraDefaultName, rn as getRichContentDocument, Kn as getSharedBlankAnswerGroups, qt as isCompositeQuestionContentStructure, hn as isQuestionContentDraftEmpty, be as moveQuestionStructureElement, Dn as normalizeFillTextCandidateState, Fe as normalizeRichTextContent, se as questionStructureElementTypes, ce as questionStructureExtraTypes, la as reconcileQuestionContentDraftWithTemplates, gn as serializeQuestionContentDraft, ls as serializeQuestionStructureDraft, Se as updateQuestionStructureElement, xe as updateQuestionStructureExtra, Ce as updateQuestionStructureGlobalConfig, we as updateQuestionStructureMetadata };
|