@yungu-fed/question-editor 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1318 -1334
- package/dist/index.mjs +655 -669
- package/dist/question/content-editor/QuestionRichTextField.d.ts.map +1 -1
- package/dist/question/content-editor/helpers.d.ts +2 -2
- package/dist/question/content-editor/helpers.d.ts.map +1 -1
- package/dist/question/content-editor/types.d.ts +3 -3
- package/dist/question/content-editor/types.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1734,9 +1734,9 @@ function M(e = "", t) {
|
|
|
1734
1734
|
function ui(e, t = [Jr]) {
|
|
1735
1735
|
let n = Io(e, t);
|
|
1736
1736
|
return {
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1737
|
+
html: r(n, { plugins: t }),
|
|
1738
|
+
json: n,
|
|
1739
|
+
text: ko(n)
|
|
1740
1740
|
};
|
|
1741
1741
|
}
|
|
1742
1742
|
function di(e = "", t, n = "") {
|
|
@@ -1746,10 +1746,10 @@ function fi(e, n, r) {
|
|
|
1746
1746
|
return n && Fo(n) ? n : r ? t(r, { plugins: [kt] }) : Oo(e);
|
|
1747
1747
|
}
|
|
1748
1748
|
function pi(e) {
|
|
1749
|
-
return Pt(e.content.
|
|
1749
|
+
return Pt(e.content.json).filter((t) => e.answer.includes(t.markerId)).map((e) => e.text.trim()).filter(Boolean).join(" / ");
|
|
1750
1750
|
}
|
|
1751
1751
|
function mi(e) {
|
|
1752
|
-
return Fo(e.
|
|
1752
|
+
return Fo(e.json) ? e.json : Oo(e.text);
|
|
1753
1753
|
}
|
|
1754
1754
|
function hi(e, t, n) {
|
|
1755
1755
|
var r;
|
|
@@ -1830,21 +1830,21 @@ function Ei(e) {
|
|
|
1830
1830
|
return Do(e);
|
|
1831
1831
|
}
|
|
1832
1832
|
function Di(e, t, n, r) {
|
|
1833
|
-
let i = Ti(t.
|
|
1833
|
+
let i = Ti(t.json);
|
|
1834
1834
|
return ji(k(k({}, e), {}, {
|
|
1835
1835
|
blanks: i,
|
|
1836
1836
|
content: t
|
|
1837
1837
|
}), r, n);
|
|
1838
1838
|
}
|
|
1839
1839
|
function Oi(e, t, n, r) {
|
|
1840
|
-
let i = Ti(t.
|
|
1840
|
+
let i = Ti(t.json);
|
|
1841
1841
|
return Ai(k(k({}, e), {}, {
|
|
1842
1842
|
blanks: i,
|
|
1843
1843
|
content: t
|
|
1844
1844
|
}), n, r);
|
|
1845
1845
|
}
|
|
1846
1846
|
function ki(e, t, n) {
|
|
1847
|
-
let r = di(t.
|
|
1847
|
+
let r = di(t.text, t.json, t.html), i = Nt(r.json);
|
|
1848
1848
|
return k(k({}, e), {}, {
|
|
1849
1849
|
answer: n ? uo(e.answer, i) : [],
|
|
1850
1850
|
content: r,
|
|
@@ -2516,7 +2516,7 @@ function Do(e) {
|
|
|
2516
2516
|
}, -1) + 1);
|
|
2517
2517
|
}
|
|
2518
2518
|
function P(e) {
|
|
2519
|
-
return e.
|
|
2519
|
+
return e.text.trim() === "";
|
|
2520
2520
|
}
|
|
2521
2521
|
function Oo(e) {
|
|
2522
2522
|
return [{
|
|
@@ -2653,7 +2653,7 @@ function $o(e) {
|
|
|
2653
2653
|
};
|
|
2654
2654
|
case "textMarker": return {
|
|
2655
2655
|
answer: uo(e.answer, e.markers),
|
|
2656
|
-
content: di(e.content.
|
|
2656
|
+
content: di(e.content.text, e.content.json, e.content.html),
|
|
2657
2657
|
markers: e.markers,
|
|
2658
2658
|
type: "textMarker"
|
|
2659
2659
|
};
|
|
@@ -3440,47 +3440,33 @@ function z({ controls: e, disabled: t, editorRef: n, label: r, onChange: i, plac
|
|
|
3440
3440
|
apiRef: n,
|
|
3441
3441
|
ariaLabel: r,
|
|
3442
3442
|
compact: l === "compact",
|
|
3443
|
-
onChange:
|
|
3443
|
+
onChange: i,
|
|
3444
3444
|
plugins: e.plugins,
|
|
3445
3445
|
uploadImage: e.uploadImage,
|
|
3446
|
-
value:
|
|
3446
|
+
value: c
|
|
3447
3447
|
}), s ? /* @__PURE__ */ a("span", {
|
|
3448
3448
|
hidden: !0,
|
|
3449
3449
|
children: s
|
|
3450
3450
|
}) : null]
|
|
3451
3451
|
});
|
|
3452
3452
|
}
|
|
3453
|
-
function zs(e) {
|
|
3454
|
-
return {
|
|
3455
|
-
html: e.contentHtml,
|
|
3456
|
-
json: e.contentJson,
|
|
3457
|
-
text: e.contentText
|
|
3458
|
-
};
|
|
3459
|
-
}
|
|
3460
|
-
function Bs(e) {
|
|
3461
|
-
return {
|
|
3462
|
-
contentHtml: e.html,
|
|
3463
|
-
contentJson: e.json,
|
|
3464
|
-
contentText: e.text
|
|
3465
|
-
};
|
|
3466
|
-
}
|
|
3467
3453
|
//#endregion
|
|
3468
3454
|
//#region src/question/content-editor/QuestionContentBlankGroupEditor.tsx
|
|
3469
|
-
function
|
|
3455
|
+
function zs({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls: s, translator: c }) {
|
|
3470
3456
|
let { t: l } = c, [u, d] = m(null), [f, p] = m(null), h = t ? Ki(n.answer, n.blanks) : [], g = qi(h);
|
|
3471
3457
|
function _(e) {
|
|
3472
3458
|
r(k(k({}, e), {}, { answer: t ? Ki(e.answer, e.blanks) : [] }));
|
|
3473
3459
|
}
|
|
3474
3460
|
function v(e, t, r) {
|
|
3475
|
-
let i =
|
|
3461
|
+
let i = Bs(h, e);
|
|
3476
3462
|
i && _(Zi(k(k({}, n), {}, { answer: h }), e, i.answerPools.map((e, n) => n === t ? r : e)));
|
|
3477
3463
|
}
|
|
3478
3464
|
function y(e) {
|
|
3479
|
-
let t =
|
|
3465
|
+
let t = Bs(h, e);
|
|
3480
3466
|
t && _(Zi(k(k({}, n), {}, { answer: h }), e, [...t.answerPools, M()]));
|
|
3481
3467
|
}
|
|
3482
3468
|
function b(e, t) {
|
|
3483
|
-
let r =
|
|
3469
|
+
let r = Bs(h, e);
|
|
3484
3470
|
r && _(Zi(k(k({}, n), {}, { answer: h }), e, r.answerPools.filter((e, n) => n !== t)));
|
|
3485
3471
|
}
|
|
3486
3472
|
function x(e, t) {
|
|
@@ -3618,7 +3604,7 @@ function Vs({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
3618
3604
|
function te() {
|
|
3619
3605
|
let e = /* @__PURE__ */ new Set();
|
|
3620
3606
|
return n.blanks.reduce((t, n, r) => {
|
|
3621
|
-
let i = h.findIndex((e) => e.blankIds.includes(n)), a =
|
|
3607
|
+
let i = h.findIndex((e) => e.blankIds.includes(n)), a = Bs(h, i);
|
|
3622
3608
|
if (!a) return t;
|
|
3623
3609
|
if (a.blankIds.length > 1) {
|
|
3624
3610
|
if (e.has(i)) return t;
|
|
@@ -3665,7 +3651,7 @@ function Vs({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
3665
3651
|
})
|
|
3666
3652
|
});
|
|
3667
3653
|
}
|
|
3668
|
-
function
|
|
3654
|
+
function Bs(e, t) {
|
|
3669
3655
|
return e.slice(t, t + 1)[0];
|
|
3670
3656
|
}
|
|
3671
3657
|
var B = {
|
|
@@ -3691,7 +3677,7 @@ var B = {
|
|
|
3691
3677
|
};
|
|
3692
3678
|
//#endregion
|
|
3693
3679
|
//#region src/question/content-editor/QuestionContentClassificationEditor.tsx
|
|
3694
|
-
function
|
|
3680
|
+
function Vs({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls: i, translator: s }) {
|
|
3695
3681
|
let { t: c } = s, l = Ta(n, t);
|
|
3696
3682
|
function u(e) {
|
|
3697
3683
|
r(Ta(e, t));
|
|
@@ -3750,7 +3736,7 @@ function Us({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
3750
3736
|
variant: "compact"
|
|
3751
3737
|
})
|
|
3752
3738
|
}),
|
|
3753
|
-
|
|
3739
|
+
Hs({
|
|
3754
3740
|
ariaLabel: c("questionContentEditor.classification.deleteCategory", { index: n + 1 }),
|
|
3755
3741
|
disabled: e || l.categories.length <= 1,
|
|
3756
3742
|
onClick: () => u(Da(l, t.id))
|
|
@@ -3799,7 +3785,7 @@ function Us({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
3799
3785
|
value: n.content,
|
|
3800
3786
|
variant: "compact"
|
|
3801
3787
|
})
|
|
3802
|
-
}),
|
|
3788
|
+
}), Hs({
|
|
3803
3789
|
ariaLabel: c("questionContentEditor.classification.deleteCard", { index: r + 1 }),
|
|
3804
3790
|
disabled: e || l.items.length <= 1,
|
|
3805
3791
|
onClick: () => u(Aa(l, n.id))
|
|
@@ -3816,7 +3802,7 @@ function Us({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
3816
3802
|
disabled: e,
|
|
3817
3803
|
onChange: (e) => p(n.id, e),
|
|
3818
3804
|
options: l.categories.map((e) => ({
|
|
3819
|
-
label: e.content.
|
|
3805
|
+
label: e.content.text || e.id,
|
|
3820
3806
|
value: e.id
|
|
3821
3807
|
})),
|
|
3822
3808
|
placeholder: c("questionContentEditor.classification.unsetCategory"),
|
|
@@ -3829,7 +3815,7 @@ function Us({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
3829
3815
|
})]
|
|
3830
3816
|
});
|
|
3831
3817
|
}
|
|
3832
|
-
function
|
|
3818
|
+
function Hs({ ariaLabel: e, disabled: t, onClick: n }) {
|
|
3833
3819
|
return /* @__PURE__ */ a(I, {
|
|
3834
3820
|
"aria-label": e,
|
|
3835
3821
|
className: B["icon-button"],
|
|
@@ -3846,7 +3832,7 @@ function Ws({ ariaLabel: e, disabled: t, onClick: n }) {
|
|
|
3846
3832
|
}
|
|
3847
3833
|
//#endregion
|
|
3848
3834
|
//#region src/question/content-editor/QuestionContentFillTextEditor.tsx
|
|
3849
|
-
function
|
|
3835
|
+
function Us({ disabled: e, element: t, hasAnswer: n, item: r, onChange: s, richTextControls: c, title: l, translator: u }) {
|
|
3850
3836
|
let { t: d } = u, f = p(null), [h, g] = m({}), [_, v] = m(null), [y, b] = m(null), x = ji(r, t, n), S = {
|
|
3851
3837
|
answer: x.answer.filter((e) => "answerPools" in e),
|
|
3852
3838
|
blanks: x.blanks,
|
|
@@ -3890,7 +3876,7 @@ function Gs({ disabled: e, element: t, hasAnswer: n, item: r, onChange: s, richT
|
|
|
3890
3876
|
let r = D(), i = r.slice(e, e + 1)[0];
|
|
3891
3877
|
if (!i) return;
|
|
3892
3878
|
let a = te(i), o = (t < i.answerOptionIds.length ? i.answerOptionIds.map((e, r) => r === t ? n : e) : [...i.answerOptionIds, n]).filter((e, t, n) => !!e && n.indexOf(e) === t);
|
|
3893
|
-
t >= i.answerOptionIds.length && n && g((e) => k(k({}, e), {}, { [a]: Math.max(0,
|
|
3879
|
+
t >= i.answerOptionIds.length && n && g((e) => k(k({}, e), {}, { [a]: Math.max(0, Ws(e, a) - 1) })), O(r.map((t, n) => n === e ? k(k({}, t), {}, { answerOptionIds: o }) : t));
|
|
3894
3880
|
}
|
|
3895
3881
|
function re(e) {
|
|
3896
3882
|
let t = Bi(x.blankOptionGroups, x.blanks).find((t) => t.blankId === e);
|
|
@@ -3957,7 +3943,7 @@ function Gs({ disabled: e, element: t, hasAnswer: n, item: r, onChange: s, richT
|
|
|
3957
3943
|
}
|
|
3958
3944
|
function he(e) {
|
|
3959
3945
|
let t = te(e);
|
|
3960
|
-
g((e) => k(k({}, e), {}, { [t]:
|
|
3946
|
+
g((e) => k(k({}, e), {}, { [t]: Ws(e, t) + 1 }));
|
|
3961
3947
|
}
|
|
3962
3948
|
function ge(e, t) {
|
|
3963
3949
|
return [
|
|
@@ -4049,11 +4035,11 @@ function Gs({ disabled: e, element: t, hasAnswer: n, item: r, onChange: s, richT
|
|
|
4049
4035
|
return new Set(D().filter((e) => e.blankIds.every((e) => !n.has(e))).reduce((e, t) => [...e, ...t.answerOptionIds], []));
|
|
4050
4036
|
}
|
|
4051
4037
|
function Ce(t, n) {
|
|
4052
|
-
let r = te(t), i = Vi(t), s = i.length ? [...i, ...Array.from({ length:
|
|
4038
|
+
let r = te(t), i = Vi(t), s = i.length ? [...i, ...Array.from({ length: Ws(h, r) }, () => "")] : Array.from({ length: Ws(h, r) + 1 }, () => ""), c = Se(t), l = xe().map((e, t) => {
|
|
4053
4039
|
let n = N("upperAlpha", t), r = i.includes(e.optionId);
|
|
4054
4040
|
return {
|
|
4055
4041
|
disabled: c.has(e.optionId) && !r,
|
|
4056
|
-
label: `${n}. ${e.content.
|
|
4042
|
+
label: `${n}. ${e.content.text || d("questionContentEditor.fields.candidateOption", { index: t + 1 })}`,
|
|
4057
4043
|
value: e.optionId
|
|
4058
4044
|
};
|
|
4059
4045
|
});
|
|
@@ -4171,7 +4157,7 @@ function Gs({ disabled: e, element: t, hasAnswer: n, item: r, onChange: s, richT
|
|
|
4171
4157
|
}
|
|
4172
4158
|
function Me(t, r) {
|
|
4173
4159
|
let i = ke(t.blankId), s = t.options.map((e, t) => ({
|
|
4174
|
-
label: `${N("upperAlpha", t)}. ${e.content.
|
|
4160
|
+
label: `${N("upperAlpha", t)}. ${e.content.text || d("questionContentEditor.fields.candidateOption", { index: t + 1 })}`,
|
|
4175
4161
|
value: e.optionId
|
|
4176
4162
|
}));
|
|
4177
4163
|
return /* @__PURE__ */ o("section", {
|
|
@@ -4248,7 +4234,7 @@ function Gs({ disabled: e, element: t, hasAnswer: n, item: r, onChange: s, richT
|
|
|
4248
4234
|
placeholder: d("questionContentEditor.placeholders.fillTextContent"),
|
|
4249
4235
|
value: x.content
|
|
4250
4236
|
}),
|
|
4251
|
-
t.config.candidateMode === "none" ? /* @__PURE__ */ a(
|
|
4237
|
+
t.config.candidateMode === "none" ? /* @__PURE__ */ a(zs, {
|
|
4252
4238
|
disabled: e,
|
|
4253
4239
|
hasAnswer: n,
|
|
4254
4240
|
item: S,
|
|
@@ -4280,13 +4266,13 @@ function Gs({ disabled: e, element: t, hasAnswer: n, item: r, onChange: s, richT
|
|
|
4280
4266
|
]
|
|
4281
4267
|
});
|
|
4282
4268
|
}
|
|
4283
|
-
function
|
|
4269
|
+
function Ws(e, t) {
|
|
4284
4270
|
var n, r;
|
|
4285
4271
|
return (n = (r = Object.entries(e).find(([e]) => e === t)) == null ? void 0 : r[1]) == null ? 0 : n;
|
|
4286
4272
|
}
|
|
4287
4273
|
//#endregion
|
|
4288
4274
|
//#region src/question/content-editor/QuestionContentJudgementGroupEditor.tsx
|
|
4289
|
-
function
|
|
4275
|
+
function Gs({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, translator: o }) {
|
|
4290
4276
|
let { t: s } = o, c = yi(t.config.judgeAnswerMode), l = n ? r.answer.filter((e) => c.includes(e)).slice(0, 1) : [];
|
|
4291
4277
|
function u(e) {
|
|
4292
4278
|
i(k(k({}, r), {}, { answer: l.includes(e) ? [] : [e] }));
|
|
@@ -4312,18 +4298,18 @@ function qs({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, trans
|
|
|
4312
4298
|
}
|
|
4313
4299
|
//#endregion
|
|
4314
4300
|
//#region src/utils/cn.ts
|
|
4315
|
-
function
|
|
4316
|
-
return e.reduce((e, t) => [...e, ...
|
|
4301
|
+
function Ks(...e) {
|
|
4302
|
+
return e.reduce((e, t) => [...e, ...qs(t)], []).join(" ");
|
|
4317
4303
|
}
|
|
4318
|
-
function
|
|
4319
|
-
return e ?
|
|
4304
|
+
function qs(e) {
|
|
4305
|
+
return e ? Js(e) ? e.reduce((e, t) => [...e, ...qs(t)], []) : [e] : [];
|
|
4320
4306
|
}
|
|
4321
|
-
function
|
|
4307
|
+
function Js(e) {
|
|
4322
4308
|
return Array.isArray(e);
|
|
4323
4309
|
}
|
|
4324
4310
|
//#endregion
|
|
4325
4311
|
//#region src/question/line-connect/lineConnectLines.ts
|
|
4326
|
-
function
|
|
4312
|
+
function Ys(e, t, n = Me) {
|
|
4327
4313
|
let r = e.columns.reduce((e, t, n) => (t.items.forEach((t, r) => e.set(t.itemId, {
|
|
4328
4314
|
columnIndex: n,
|
|
4329
4315
|
itemIndex: r
|
|
@@ -4344,25 +4330,25 @@ function Zs(e, t, n = Me) {
|
|
|
4344
4330
|
}, [])] : e;
|
|
4345
4331
|
}, []);
|
|
4346
4332
|
}
|
|
4347
|
-
function
|
|
4333
|
+
function Xs(e, t, n) {
|
|
4348
4334
|
return e.left - t.left + n + e.width / 2;
|
|
4349
4335
|
}
|
|
4350
|
-
function
|
|
4336
|
+
function Zs(e, t, n) {
|
|
4351
4337
|
return e.top - t.top + n + e.height / 2;
|
|
4352
4338
|
}
|
|
4353
|
-
function
|
|
4339
|
+
function Qs(e, t, n) {
|
|
4354
4340
|
return e.left - t.left + n;
|
|
4355
4341
|
}
|
|
4356
|
-
function
|
|
4342
|
+
function $s(e, t, n) {
|
|
4357
4343
|
return e.right - t.left + n;
|
|
4358
4344
|
}
|
|
4359
|
-
function
|
|
4360
|
-
e((e) =>
|
|
4345
|
+
function ec(e, t) {
|
|
4346
|
+
e((e) => tc(e, t) ? e : t);
|
|
4361
4347
|
}
|
|
4362
|
-
function
|
|
4363
|
-
return (e == null ? void 0 : e.height) === t.height && e.width === t.width && e.lines.length === t.lines.length && e.lines.every((e, n) =>
|
|
4348
|
+
function tc(e, t) {
|
|
4349
|
+
return (e == null ? void 0 : e.height) === t.height && e.width === t.width && e.lines.length === t.lines.length && e.lines.every((e, n) => nc(e, t.lines[n]));
|
|
4364
4350
|
}
|
|
4365
|
-
function
|
|
4351
|
+
function nc(e, t) {
|
|
4366
4352
|
return t !== void 0 && e.key === t.key && e.x1 === t.x1 && e.x2 === t.x2 && e.y1 === t.y1 && e.y2 === t.y2;
|
|
4367
4353
|
}
|
|
4368
4354
|
var V = {
|
|
@@ -4384,7 +4370,7 @@ var V = {
|
|
|
4384
4370
|
"connect-dot": "_connect-dot_1cqr2_56",
|
|
4385
4371
|
"connect-button-connected": "_connect-button-connected_1cqr2_64",
|
|
4386
4372
|
"connect-button-selected": "_connect-button-selected_1cqr2_70"
|
|
4387
|
-
},
|
|
4373
|
+
}, rc = [
|
|
4388
4374
|
"number",
|
|
4389
4375
|
"upperAlpha",
|
|
4390
4376
|
"lowerAlpha",
|
|
@@ -4392,29 +4378,29 @@ var V = {
|
|
|
4392
4378
|
"chineseNumber",
|
|
4393
4379
|
"none"
|
|
4394
4380
|
];
|
|
4395
|
-
function
|
|
4381
|
+
function ic({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richTextControls: s, translator: c }) {
|
|
4396
4382
|
let { t: u } = c, [h, g] = m(null), [_, v] = m(null), y = p(null), b = p(/* @__PURE__ */ new Map()), x = la(r, t, n), S = { gridTemplateColumns: `repeat(${x.columns.length}, minmax(16rem, 1fr))` }, C = f(() => JSON.stringify({
|
|
4397
4383
|
answer: x.answer,
|
|
4398
4384
|
columns: x.columns.map((e) => e.items.map((e) => e.itemId))
|
|
4399
|
-
}), [x.answer, x.columns]), w = f(() => n ?
|
|
4385
|
+
}), [x.answer, x.columns]), w = f(() => n ? Ys(x, x.answer) : [], [n, x]), T = l(() => {
|
|
4400
4386
|
let e = y.current;
|
|
4401
4387
|
if (!n || !e || w.length === 0) {
|
|
4402
4388
|
v(null);
|
|
4403
4389
|
return;
|
|
4404
4390
|
}
|
|
4405
4391
|
let t = e.getBoundingClientRect(), r = w.reduce((n, r) => {
|
|
4406
|
-
let i = b.current.get(
|
|
4392
|
+
let i = b.current.get(uc(r.fromItemId, "outgoing")), a = b.current.get(uc(r.toItemId, "incoming"));
|
|
4407
4393
|
if (!i || !a) return n;
|
|
4408
4394
|
let o = i.getBoundingClientRect(), s = a.getBoundingClientRect();
|
|
4409
4395
|
return [...n, {
|
|
4410
4396
|
key: r.key,
|
|
4411
|
-
x1:
|
|
4412
|
-
x2:
|
|
4413
|
-
y1:
|
|
4414
|
-
y2:
|
|
4397
|
+
x1: Xs(o, t, e.scrollLeft),
|
|
4398
|
+
x2: Xs(s, t, e.scrollLeft),
|
|
4399
|
+
y1: Zs(o, t, e.scrollTop),
|
|
4400
|
+
y2: Zs(s, t, e.scrollTop)
|
|
4415
4401
|
}];
|
|
4416
4402
|
}, []);
|
|
4417
|
-
|
|
4403
|
+
ec(v, {
|
|
4418
4404
|
height: e.scrollHeight,
|
|
4419
4405
|
lines: r,
|
|
4420
4406
|
width: e.scrollWidth
|
|
@@ -4434,7 +4420,7 @@ function oc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4434
4420
|
]);
|
|
4435
4421
|
function ee(e, t) {
|
|
4436
4422
|
return (n) => {
|
|
4437
|
-
let r =
|
|
4423
|
+
let r = uc(e, t);
|
|
4438
4424
|
if (n) {
|
|
4439
4425
|
b.current.set(r, n);
|
|
4440
4426
|
return;
|
|
@@ -4486,7 +4472,7 @@ function oc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4486
4472
|
"aria-label": u("questionContentEditor.lineConnect.labelStyle", { index: n + 1 }),
|
|
4487
4473
|
disabled: e,
|
|
4488
4474
|
onChange: (e) => e ? E(fa(x, t.columnId, e)) : void 0,
|
|
4489
|
-
options:
|
|
4475
|
+
options: rc.map((e) => ({
|
|
4490
4476
|
label: u(`questionContentEditor.lineConnect.labels.${e}`),
|
|
4491
4477
|
value: e
|
|
4492
4478
|
})),
|
|
@@ -4517,9 +4503,9 @@ function oc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4517
4503
|
}, t.columnId);
|
|
4518
4504
|
}
|
|
4519
4505
|
function ie(t, r, i, c) {
|
|
4520
|
-
let l = _i(t.labelStyle, c), d = l ? `${l}. ${i.content.
|
|
4506
|
+
let l = _i(t.labelStyle, c), d = l ? `${l}. ${i.content.text}` : i.content.text, f = (h == null ? void 0 : h.itemId) === i.itemId, p = ac(x, i.itemId), m = oc(x, i.itemId), g = sc(p, m), _ = cc(n);
|
|
4521
4507
|
return /* @__PURE__ */ o("div", {
|
|
4522
|
-
className:
|
|
4508
|
+
className: lc(f, g),
|
|
4523
4509
|
"data-testid": `line-connect-item-${i.itemId}`,
|
|
4524
4510
|
style: _,
|
|
4525
4511
|
children: [
|
|
@@ -4553,9 +4539,9 @@ function oc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4553
4539
|
}
|
|
4554
4540
|
function ae(t, r, i, o, s, c) {
|
|
4555
4541
|
return n ? /* @__PURE__ */ a("button", {
|
|
4556
|
-
"aria-label": se("incoming", t, i, r.content.
|
|
4542
|
+
"aria-label": se("incoming", t, i, r.content.text),
|
|
4557
4543
|
"aria-pressed": c,
|
|
4558
|
-
className:
|
|
4544
|
+
className: Ks(H.marker, H["incoming-marker"], c && H["connect-button-connected"]),
|
|
4559
4545
|
disabled: e,
|
|
4560
4546
|
onClick: () => O(t, r.itemId, s),
|
|
4561
4547
|
ref: ee(r.itemId, "incoming"),
|
|
@@ -4573,9 +4559,9 @@ function oc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4573
4559
|
}
|
|
4574
4560
|
function oe(t, r, i, o, s, c) {
|
|
4575
4561
|
return n ? /* @__PURE__ */ a("button", {
|
|
4576
|
-
"aria-label": se("outgoing", t, i, r.content.
|
|
4562
|
+
"aria-label": se("outgoing", t, i, r.content.text),
|
|
4577
4563
|
"aria-pressed": s,
|
|
4578
|
-
className:
|
|
4564
|
+
className: Ks(H["connect-handle"], H["connect-handle-outgoing"], s && H["connect-button-selected"], c && H["connect-button-connected"]),
|
|
4579
4565
|
disabled: e,
|
|
4580
4566
|
ref: ee(r.itemId, "outgoing"),
|
|
4581
4567
|
onClick: () => O(t, r.itemId, o),
|
|
@@ -4635,26 +4621,26 @@ function oc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4635
4621
|
]
|
|
4636
4622
|
});
|
|
4637
4623
|
}
|
|
4638
|
-
function
|
|
4624
|
+
function ac(e, t) {
|
|
4639
4625
|
return Object.values(e.answer).some((e) => e.includes(t));
|
|
4640
4626
|
}
|
|
4641
|
-
function
|
|
4627
|
+
function oc(e, t) {
|
|
4642
4628
|
var n;
|
|
4643
4629
|
return ((n = e.answer[t]) == null ? [] : n).length > 0;
|
|
4644
4630
|
}
|
|
4645
|
-
function
|
|
4631
|
+
function sc(e, t) {
|
|
4646
4632
|
return e || t;
|
|
4647
4633
|
}
|
|
4648
|
-
function
|
|
4634
|
+
function cc(e) {
|
|
4649
4635
|
return { gridTemplateColumns: e ? "2rem minmax(0, 1fr) auto auto" : "2rem minmax(0, 1fr) auto" };
|
|
4650
4636
|
}
|
|
4651
|
-
function
|
|
4652
|
-
return
|
|
4637
|
+
function lc(e, t) {
|
|
4638
|
+
return Ks("grid min-w-0 items-center gap-2 rounded-md border border-slate-200 bg-white p-2", e && "border-blue-600 bg-blue-50", t && !e && "border-blue-200 bg-blue-50/40");
|
|
4653
4639
|
}
|
|
4654
|
-
function
|
|
4640
|
+
function uc(e, t) {
|
|
4655
4641
|
return `${t}:${e}`;
|
|
4656
4642
|
}
|
|
4657
|
-
var
|
|
4643
|
+
var dc = {
|
|
4658
4644
|
board: "_board_30ao0_1",
|
|
4659
4645
|
"connect-board": "_connect-board_30ao0_7",
|
|
4660
4646
|
columns: "_columns_30ao0_14",
|
|
@@ -4664,7 +4650,7 @@ var pc = {
|
|
|
4664
4650
|
selected: "_selected_30ao0_46",
|
|
4665
4651
|
matched: "_matched_30ao0_51",
|
|
4666
4652
|
marker: "_marker_30ao0_55"
|
|
4667
|
-
},
|
|
4653
|
+
}, fc = [
|
|
4668
4654
|
"number",
|
|
4669
4655
|
"upperAlpha",
|
|
4670
4656
|
"lowerAlpha",
|
|
@@ -4672,8 +4658,8 @@ var pc = {
|
|
|
4672
4658
|
"chineseNumber",
|
|
4673
4659
|
"none"
|
|
4674
4660
|
];
|
|
4675
|
-
function
|
|
4676
|
-
let { t: u } = c, [h, g] = m(null), [_, v] = m(null), y = p(null), b = p(/* @__PURE__ */ new Map()), x = _a(r, t, n), S = { gridTemplateColumns: `repeat(${x.columns.length}, minmax(16rem, 1fr))` }, C = f(() => n ?
|
|
4661
|
+
function pc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richTextControls: s, translator: c }) {
|
|
4662
|
+
let { t: u } = c, [h, g] = m(null), [_, v] = m(null), y = p(null), b = p(/* @__PURE__ */ new Map()), x = _a(r, t, n), S = { gridTemplateColumns: `repeat(${x.columns.length}, minmax(16rem, 1fr))` }, C = f(() => n ? Ys(x, x.answer, at) : [], [n, x]), w = f(() => JSON.stringify({
|
|
4677
4663
|
answer: x.answer,
|
|
4678
4664
|
columns: x.columns.map((e) => e.items.map((e) => e.itemId))
|
|
4679
4665
|
}), [x.answer, x.columns]), T = l(() => {
|
|
@@ -4683,18 +4669,18 @@ function hc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4683
4669
|
return;
|
|
4684
4670
|
}
|
|
4685
4671
|
let t = e.getBoundingClientRect(), r = C.reduce((n, r) => {
|
|
4686
|
-
let i = b.current.get(
|
|
4672
|
+
let i = b.current.get(_c(r.fromItemId, "outgoing")), a = b.current.get(_c(r.toItemId, "incoming"));
|
|
4687
4673
|
if (!i || !a) return n;
|
|
4688
4674
|
let o = i.getBoundingClientRect(), s = a.getBoundingClientRect();
|
|
4689
4675
|
return [...n, {
|
|
4690
4676
|
key: r.key,
|
|
4691
|
-
x1:
|
|
4692
|
-
x2:
|
|
4693
|
-
y1:
|
|
4694
|
-
y2:
|
|
4677
|
+
x1: Xs(o, t, e.scrollLeft),
|
|
4678
|
+
x2: Xs(s, t, e.scrollLeft),
|
|
4679
|
+
y1: Zs(o, t, e.scrollTop),
|
|
4680
|
+
y2: Zs(s, t, e.scrollTop)
|
|
4695
4681
|
}];
|
|
4696
4682
|
}, []);
|
|
4697
|
-
|
|
4683
|
+
ec(v, {
|
|
4698
4684
|
height: e.scrollHeight,
|
|
4699
4685
|
lines: r,
|
|
4700
4686
|
width: e.scrollWidth
|
|
@@ -4714,7 +4700,7 @@ function hc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4714
4700
|
]);
|
|
4715
4701
|
function ee(e, t) {
|
|
4716
4702
|
return (n) => {
|
|
4717
|
-
let r =
|
|
4703
|
+
let r = _c(e, t);
|
|
4718
4704
|
if (n) {
|
|
4719
4705
|
b.current.set(r, n);
|
|
4720
4706
|
return;
|
|
@@ -4743,7 +4729,7 @@ function hc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4743
4729
|
}
|
|
4744
4730
|
function O(t, n) {
|
|
4745
4731
|
return /* @__PURE__ */ o("section", {
|
|
4746
|
-
className:
|
|
4732
|
+
className: dc.column,
|
|
4747
4733
|
children: [
|
|
4748
4734
|
/* @__PURE__ */ a("div", {
|
|
4749
4735
|
className: "flex min-w-0 flex-wrap items-center justify-end gap-2",
|
|
@@ -4751,7 +4737,7 @@ function hc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4751
4737
|
"aria-label": u("questionContentEditor.matching.labelStyle", { index: n + 1 }),
|
|
4752
4738
|
disabled: e,
|
|
4753
4739
|
onChange: (e) => e ? E(va(x, t.columnId, e)) : void 0,
|
|
4754
|
-
options:
|
|
4740
|
+
options: fc.map((e) => ({
|
|
4755
4741
|
label: u(`questionContentEditor.matching.labels.${e}`),
|
|
4756
4742
|
value: e
|
|
4757
4743
|
})),
|
|
@@ -4759,7 +4745,7 @@ function hc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4759
4745
|
})
|
|
4760
4746
|
}),
|
|
4761
4747
|
/* @__PURE__ */ a("div", {
|
|
4762
|
-
className:
|
|
4748
|
+
className: dc.items,
|
|
4763
4749
|
children: t.items.map((e, r) => ne(t, n, e, r))
|
|
4764
4750
|
}),
|
|
4765
4751
|
/* @__PURE__ */ a(I, {
|
|
@@ -4774,9 +4760,9 @@ function hc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4774
4760
|
}, t.columnId);
|
|
4775
4761
|
}
|
|
4776
4762
|
function ne(t, r, i, c) {
|
|
4777
|
-
let l = vi(t.labelStyle, c), d = (h == null ? void 0 : h.itemId) === i.itemId, f =
|
|
4763
|
+
let l = vi(t.labelStyle, c), d = (h == null ? void 0 : h.itemId) === i.itemId, f = mc(x, i.itemId), p = hc(x, i.itemId), m = f || p, g = l ? `${l}. ${i.content.text}` : i.content.text, _ = gc(n);
|
|
4778
4764
|
return /* @__PURE__ */ o("div", {
|
|
4779
|
-
className:
|
|
4765
|
+
className: Ks(dc.item, d ? dc.selected : "", m ? dc.matched : ""),
|
|
4780
4766
|
"data-testid": `matching-editor-item-${i.itemId}`,
|
|
4781
4767
|
style: _,
|
|
4782
4768
|
children: [
|
|
@@ -4810,9 +4796,9 @@ function hc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4810
4796
|
}
|
|
4811
4797
|
function re(t, r, i, o, s, c) {
|
|
4812
4798
|
return n ? /* @__PURE__ */ a("button", {
|
|
4813
|
-
"aria-label": ae("incoming", t, i, r.content.
|
|
4799
|
+
"aria-label": ae("incoming", t, i, r.content.text),
|
|
4814
4800
|
"aria-pressed": c,
|
|
4815
|
-
className:
|
|
4801
|
+
className: Ks(dc.marker, H["incoming-marker"], c && H["connect-button-connected"]),
|
|
4816
4802
|
disabled: e,
|
|
4817
4803
|
onClick: () => te(t, r.itemId, s),
|
|
4818
4804
|
ref: ee(r.itemId, "incoming"),
|
|
@@ -4823,15 +4809,15 @@ function hc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4823
4809
|
className: H["connect-dot"]
|
|
4824
4810
|
})
|
|
4825
4811
|
}) : o ? /* @__PURE__ */ a("span", {
|
|
4826
|
-
className:
|
|
4812
|
+
className: dc.marker,
|
|
4827
4813
|
children: o
|
|
4828
4814
|
}) : /* @__PURE__ */ a("span", {});
|
|
4829
4815
|
}
|
|
4830
4816
|
function ie(t, r, i, o, s, c) {
|
|
4831
4817
|
return n ? /* @__PURE__ */ a("button", {
|
|
4832
|
-
"aria-label": ae("outgoing", t, i, r.content.
|
|
4818
|
+
"aria-label": ae("outgoing", t, i, r.content.text),
|
|
4833
4819
|
"aria-pressed": s,
|
|
4834
|
-
className:
|
|
4820
|
+
className: Ks(H["connect-handle"], H["connect-handle-outgoing"], s && H["connect-button-selected"], c && H["connect-button-connected"]),
|
|
4835
4821
|
disabled: e,
|
|
4836
4822
|
onClick: () => te(t, r.itemId, o),
|
|
4837
4823
|
ref: ee(r.itemId, "outgoing"),
|
|
@@ -4851,13 +4837,13 @@ function hc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4851
4837
|
});
|
|
4852
4838
|
}
|
|
4853
4839
|
return /* @__PURE__ */ o("div", {
|
|
4854
|
-
className:
|
|
4840
|
+
className: dc.board,
|
|
4855
4841
|
children: [n ? /* @__PURE__ */ a("div", {
|
|
4856
4842
|
"aria-live": "polite",
|
|
4857
4843
|
className: "rounded-md border border-blue-100 bg-blue-50 px-3 py-2 text-sm text-blue-700",
|
|
4858
4844
|
children: h ? u("questionContentEditor.matching.connectHintActive", { label: h.label }) : u("questionContentEditor.matching.connectHintIdle")
|
|
4859
4845
|
}) : null, /* @__PURE__ */ o("div", {
|
|
4860
|
-
className:
|
|
4846
|
+
className: dc["connect-board"],
|
|
4861
4847
|
"data-testid": "matching-editor-board",
|
|
4862
4848
|
ref: y,
|
|
4863
4849
|
children: [n && _ ? /* @__PURE__ */ a("svg", {
|
|
@@ -4878,29 +4864,29 @@ function hc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
4878
4864
|
y2: e.y2
|
|
4879
4865
|
}, e.key))
|
|
4880
4866
|
}) : null, /* @__PURE__ */ a("div", {
|
|
4881
|
-
className:
|
|
4867
|
+
className: dc.columns,
|
|
4882
4868
|
style: S,
|
|
4883
4869
|
children: x.columns.map((e, t) => O(e, t))
|
|
4884
4870
|
})]
|
|
4885
4871
|
})]
|
|
4886
4872
|
});
|
|
4887
4873
|
}
|
|
4888
|
-
function
|
|
4874
|
+
function mc(e, t) {
|
|
4889
4875
|
return Object.values(e.answer).some((e) => e.includes(t));
|
|
4890
4876
|
}
|
|
4891
|
-
function
|
|
4877
|
+
function hc(e, t) {
|
|
4892
4878
|
var n;
|
|
4893
4879
|
return ((n = e.answer[t]) == null ? [] : n).length > 0;
|
|
4894
4880
|
}
|
|
4895
|
-
function
|
|
4881
|
+
function gc(e) {
|
|
4896
4882
|
return { gridTemplateColumns: e ? "2rem minmax(0, 1fr) auto auto" : "2rem minmax(0, 1fr) auto" };
|
|
4897
4883
|
}
|
|
4898
|
-
function
|
|
4884
|
+
function _c(e, t) {
|
|
4899
4885
|
return `${t}:${e}`;
|
|
4900
4886
|
}
|
|
4901
4887
|
//#endregion
|
|
4902
4888
|
//#region src/question/content-editor/QuestionContentOptionGroupEditor.tsx
|
|
4903
|
-
function
|
|
4889
|
+
function vc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richTextControls: s, translator: c }) {
|
|
4904
4890
|
let { t: l } = c, u = n ? r.answer : [], d = t.config.renderer === "table";
|
|
4905
4891
|
function f(e) {
|
|
4906
4892
|
i(k(k({}, e), {}, { answer: n ? e.answer : [] }));
|
|
@@ -5100,7 +5086,7 @@ function bc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
5100
5086
|
return (r.options && r.options.length ? r.options : [M()]).map((e, n) => {
|
|
5101
5087
|
let r = N(t.config.optionLabelStyle, n);
|
|
5102
5088
|
return {
|
|
5103
|
-
|
|
5089
|
+
text: e.text || l("questionContentEditor.placeholders.option", { marker: r }),
|
|
5104
5090
|
marker: r
|
|
5105
5091
|
};
|
|
5106
5092
|
});
|
|
@@ -5109,7 +5095,7 @@ function bc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
5109
5095
|
return ca(r).data.map((e, n) => {
|
|
5110
5096
|
let r = N(t.config.optionLabelStyle, n);
|
|
5111
5097
|
return {
|
|
5112
|
-
|
|
5098
|
+
text: e.map((e) => e.text.trim()).filter(Boolean).join(" / ") || l("questionContentEditor.placeholders.option", { marker: r }),
|
|
5113
5099
|
marker: r
|
|
5114
5100
|
};
|
|
5115
5101
|
});
|
|
@@ -5125,7 +5111,7 @@ function bc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
5125
5111
|
children: l("questionContentEditor.option.answerSettings")
|
|
5126
5112
|
}), /* @__PURE__ */ a("div", {
|
|
5127
5113
|
className: "grid min-w-0 grid-cols-1 gap-2 md:grid-cols-2 xl:grid-cols-4",
|
|
5128
|
-
children: e.map(({
|
|
5114
|
+
children: e.map(({ text: e, marker: t }, n) => y(n, t, e))
|
|
5129
5115
|
})]
|
|
5130
5116
|
});
|
|
5131
5117
|
}
|
|
@@ -5136,7 +5122,7 @@ function bc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
5136
5122
|
}
|
|
5137
5123
|
//#endregion
|
|
5138
5124
|
//#region src/question/content-editor/QuestionContentOrderingEditor.tsx
|
|
5139
|
-
function
|
|
5125
|
+
function yc({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls: i, translator: s }) {
|
|
5140
5126
|
let { t: c } = s, l = Na(n, t), u = new Map(l.sortOptions.map((e) => [e.id, e]));
|
|
5141
5127
|
function d(e) {
|
|
5142
5128
|
r(Na(e, t));
|
|
@@ -5199,7 +5185,7 @@ function xc({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
5199
5185
|
strong: !0,
|
|
5200
5186
|
children: r + 1
|
|
5201
5187
|
}),
|
|
5202
|
-
/* @__PURE__ */ a(L.Text, { children: i.content.
|
|
5188
|
+
/* @__PURE__ */ a(L.Text, { children: i.content.text }),
|
|
5203
5189
|
/* @__PURE__ */ o("div", {
|
|
5204
5190
|
className: "flex items-center gap-1",
|
|
5205
5191
|
children: [/* @__PURE__ */ a(I, {
|
|
@@ -5225,7 +5211,7 @@ function xc({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
5225
5211
|
}
|
|
5226
5212
|
//#endregion
|
|
5227
5213
|
//#region src/question/content-editor/QuestionContentRichTextEditor.tsx
|
|
5228
|
-
function
|
|
5214
|
+
function bc({ disabled: e, item: t, onChange: n, richTextControls: r, translator: i }) {
|
|
5229
5215
|
let { t: o } = i;
|
|
5230
5216
|
return /* @__PURE__ */ a(z, {
|
|
5231
5217
|
controls: r,
|
|
@@ -5236,7 +5222,7 @@ function Sc({ disabled: e, item: t, onChange: n, richTextControls: r, translator
|
|
|
5236
5222
|
value: t.content
|
|
5237
5223
|
});
|
|
5238
5224
|
}
|
|
5239
|
-
var
|
|
5225
|
+
var xc = {
|
|
5240
5226
|
stack: "_stack_1v8u9_1",
|
|
5241
5227
|
"toolbar-row": "_toolbar-row_1v8u9_8",
|
|
5242
5228
|
"marker-list": "_marker-list_1v8u9_13",
|
|
@@ -5247,8 +5233,8 @@ var Cc = {
|
|
|
5247
5233
|
};
|
|
5248
5234
|
//#endregion
|
|
5249
5235
|
//#region src/question/content-editor/QuestionContentTextMarkerEditor.tsx
|
|
5250
|
-
function
|
|
5251
|
-
let c = p(null), { t: l } = s, u = Pt(n.content.
|
|
5236
|
+
function Sc({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls: i, translator: s }) {
|
|
5237
|
+
let c = p(null), { t: l } = s, u = Pt(n.content.json);
|
|
5252
5238
|
function d(e) {
|
|
5253
5239
|
r(ki(e, e.content, t));
|
|
5254
5240
|
}
|
|
@@ -5265,14 +5251,14 @@ function wc({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
5265
5251
|
d(k(k({}, n), {}, { answer: r }));
|
|
5266
5252
|
}
|
|
5267
5253
|
return /* @__PURE__ */ o("div", {
|
|
5268
|
-
className:
|
|
5254
|
+
className: xc.stack,
|
|
5269
5255
|
children: [
|
|
5270
5256
|
/* @__PURE__ */ a(L.Text, {
|
|
5271
5257
|
strong: !0,
|
|
5272
5258
|
children: l("questionContentEditor.fields.textMarkerContent")
|
|
5273
5259
|
}),
|
|
5274
5260
|
/* @__PURE__ */ a("div", {
|
|
5275
|
-
className:
|
|
5261
|
+
className: xc["toolbar-row"],
|
|
5276
5262
|
children: /* @__PURE__ */ a(I, {
|
|
5277
5263
|
disabled: e,
|
|
5278
5264
|
onClick: f,
|
|
@@ -5285,25 +5271,25 @@ function wc({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
5285
5271
|
disabled: e,
|
|
5286
5272
|
editorRef: c,
|
|
5287
5273
|
label: l("questionContentEditor.fields.textMarkerContent"),
|
|
5288
|
-
onChange: (e) => d(k(k({}, n), {}, { content: di(e.
|
|
5274
|
+
onChange: (e) => d(k(k({}, n), {}, { content: di(e.text, e.json) })),
|
|
5289
5275
|
placeholder: l("questionContentEditor.placeholders.textMarkerContent"),
|
|
5290
5276
|
value: n.content
|
|
5291
5277
|
}),
|
|
5292
5278
|
/* @__PURE__ */ o("div", {
|
|
5293
|
-
className:
|
|
5279
|
+
className: xc["marker-list"],
|
|
5294
5280
|
children: [/* @__PURE__ */ a(L.Text, {
|
|
5295
5281
|
strong: !0,
|
|
5296
5282
|
children: l("questionContentEditor.textMarker.markersTitle")
|
|
5297
5283
|
}), u.length === 0 ? /* @__PURE__ */ a("div", {
|
|
5298
|
-
className:
|
|
5284
|
+
className: xc.empty,
|
|
5299
5285
|
children: l("questionContentEditor.textMarker.emptyMarkers")
|
|
5300
5286
|
}) : u.map((r) => /* @__PURE__ */ o("label", {
|
|
5301
|
-
className:
|
|
5287
|
+
className: xc["marker-card"],
|
|
5302
5288
|
children: [/* @__PURE__ */ a("span", {
|
|
5303
|
-
className:
|
|
5289
|
+
className: xc["marker-text"],
|
|
5304
5290
|
children: r.text
|
|
5305
5291
|
}), /* @__PURE__ */ o("span", {
|
|
5306
|
-
className:
|
|
5292
|
+
className: xc["answer-toggle"],
|
|
5307
5293
|
children: [/* @__PURE__ */ a("input", {
|
|
5308
5294
|
"aria-label": l("questionContentEditor.textMarker.answerAria", { marker: r.text }),
|
|
5309
5295
|
checked: n.answer.includes(r.markerId),
|
|
@@ -5328,7 +5314,7 @@ var U = {
|
|
|
5328
5314
|
};
|
|
5329
5315
|
//#endregion
|
|
5330
5316
|
//#region src/question/content-editor/QuestionContentWordBuilderEditor.tsx
|
|
5331
|
-
function
|
|
5317
|
+
function Cc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richTextControls: s, title: c, translator: l }) {
|
|
5332
5318
|
let { t: u } = l, d = p(null), f = Ai(r, n, t);
|
|
5333
5319
|
function m(e) {
|
|
5334
5320
|
i(Ai(e, n, t));
|
|
@@ -5442,9 +5428,9 @@ function Tc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
5442
5428
|
}
|
|
5443
5429
|
//#endregion
|
|
5444
5430
|
//#region src/question/content-editor/QuestionContentElementEditor.tsx
|
|
5445
|
-
function
|
|
5431
|
+
function wc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richTextControls: o, title: s, translator: c }) {
|
|
5446
5432
|
let { t: l } = c;
|
|
5447
|
-
return t.type === "inlineFill" ? /* @__PURE__ */ a(
|
|
5433
|
+
return t.type === "inlineFill" ? /* @__PURE__ */ a(Us, {
|
|
5448
5434
|
disabled: e,
|
|
5449
5435
|
element: t,
|
|
5450
5436
|
hasAnswer: n,
|
|
@@ -5453,7 +5439,7 @@ function Ec({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
5453
5439
|
richTextControls: o,
|
|
5454
5440
|
title: s,
|
|
5455
5441
|
translator: c
|
|
5456
|
-
}) : t.type === "wordBuilder" ? /* @__PURE__ */ a(
|
|
5442
|
+
}) : t.type === "wordBuilder" ? /* @__PURE__ */ a(Cc, {
|
|
5457
5443
|
disabled: e,
|
|
5458
5444
|
element: t,
|
|
5459
5445
|
hasAnswer: n,
|
|
@@ -5462,20 +5448,20 @@ function Ec({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
5462
5448
|
richTextControls: o,
|
|
5463
5449
|
title: s,
|
|
5464
5450
|
translator: c
|
|
5465
|
-
}) : t.type === "classification" ?
|
|
5451
|
+
}) : t.type === "classification" ? Ec(s, null, /* @__PURE__ */ a(Vs, {
|
|
5466
5452
|
disabled: e,
|
|
5467
5453
|
hasAnswer: n,
|
|
5468
5454
|
item: r,
|
|
5469
5455
|
onChange: i,
|
|
5470
5456
|
richTextControls: o,
|
|
5471
5457
|
translator: c
|
|
5472
|
-
})) : t.type === "richText" ?
|
|
5458
|
+
})) : t.type === "richText" ? Ec(s, null, /* @__PURE__ */ a(bc, {
|
|
5473
5459
|
disabled: e,
|
|
5474
5460
|
item: r,
|
|
5475
5461
|
onChange: i,
|
|
5476
5462
|
richTextControls: o,
|
|
5477
5463
|
translator: c
|
|
5478
|
-
})) :
|
|
5464
|
+
})) : Tc({
|
|
5479
5465
|
disabled: e,
|
|
5480
5466
|
element: t,
|
|
5481
5467
|
hasAnswer: n,
|
|
@@ -5487,15 +5473,15 @@ function Ec({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
5487
5473
|
t: l
|
|
5488
5474
|
});
|
|
5489
5475
|
}
|
|
5490
|
-
function
|
|
5476
|
+
function Tc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richTextControls: o, title: s, translator: c, t: l }) {
|
|
5491
5477
|
switch (t.type) {
|
|
5492
|
-
case "fill": return
|
|
5478
|
+
case "fill": return Ec(s, /* @__PURE__ */ a(I, {
|
|
5493
5479
|
"aria-label": l("questionContentEditor.actions.addBlank"),
|
|
5494
5480
|
disabled: e,
|
|
5495
5481
|
icon: "+",
|
|
5496
|
-
onClick: () => i(
|
|
5482
|
+
onClick: () => i(Dc(r, n)),
|
|
5497
5483
|
children: l("questionContentEditor.actions.addBlank")
|
|
5498
|
-
}), /* @__PURE__ */ a(
|
|
5484
|
+
}), /* @__PURE__ */ a(zs, {
|
|
5499
5485
|
disabled: e,
|
|
5500
5486
|
hasAnswer: n,
|
|
5501
5487
|
item: r,
|
|
@@ -5503,7 +5489,7 @@ function Dc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
5503
5489
|
richTextControls: o,
|
|
5504
5490
|
translator: c
|
|
5505
5491
|
}));
|
|
5506
|
-
case "choice": return
|
|
5492
|
+
case "choice": return Ec(s, null, /* @__PURE__ */ a(vc, {
|
|
5507
5493
|
disabled: e,
|
|
5508
5494
|
element: t,
|
|
5509
5495
|
hasAnswer: n,
|
|
@@ -5512,7 +5498,7 @@ function Dc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
5512
5498
|
richTextControls: o,
|
|
5513
5499
|
translator: c
|
|
5514
5500
|
}));
|
|
5515
|
-
case "judgement": return
|
|
5501
|
+
case "judgement": return Ec(s, null, /* @__PURE__ */ a(Gs, {
|
|
5516
5502
|
disabled: e,
|
|
5517
5503
|
element: t,
|
|
5518
5504
|
hasAnswer: n,
|
|
@@ -5520,7 +5506,7 @@ function Dc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
5520
5506
|
onChange: i,
|
|
5521
5507
|
translator: c
|
|
5522
5508
|
}));
|
|
5523
|
-
case "lineConnect": return
|
|
5509
|
+
case "lineConnect": return Ec(s, null, /* @__PURE__ */ a(ic, {
|
|
5524
5510
|
disabled: e,
|
|
5525
5511
|
element: t,
|
|
5526
5512
|
hasAnswer: n,
|
|
@@ -5529,7 +5515,7 @@ function Dc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
5529
5515
|
richTextControls: o,
|
|
5530
5516
|
translator: c
|
|
5531
5517
|
}));
|
|
5532
|
-
case "matching": return
|
|
5518
|
+
case "matching": return Ec(s, null, /* @__PURE__ */ a(pc, {
|
|
5533
5519
|
disabled: e,
|
|
5534
5520
|
element: t,
|
|
5535
5521
|
hasAnswer: n,
|
|
@@ -5538,7 +5524,7 @@ function Dc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
5538
5524
|
richTextControls: o,
|
|
5539
5525
|
translator: c
|
|
5540
5526
|
}));
|
|
5541
|
-
case "ordering": return
|
|
5527
|
+
case "ordering": return Ec(s, null, /* @__PURE__ */ a(yc, {
|
|
5542
5528
|
disabled: e,
|
|
5543
5529
|
hasAnswer: n,
|
|
5544
5530
|
item: r,
|
|
@@ -5546,7 +5532,7 @@ function Dc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
5546
5532
|
richTextControls: o,
|
|
5547
5533
|
translator: c
|
|
5548
5534
|
}));
|
|
5549
|
-
case "textMarker": return
|
|
5535
|
+
case "textMarker": return Ec(s, null, /* @__PURE__ */ a(Sc, {
|
|
5550
5536
|
disabled: e,
|
|
5551
5537
|
hasAnswer: n,
|
|
5552
5538
|
item: r,
|
|
@@ -5556,7 +5542,7 @@ function Dc({ disabled: e, element: t, hasAnswer: n, item: r, onChange: i, richT
|
|
|
5556
5542
|
}));
|
|
5557
5543
|
}
|
|
5558
5544
|
}
|
|
5559
|
-
function
|
|
5545
|
+
function Ec(e, t, n) {
|
|
5560
5546
|
return /* @__PURE__ */ o("div", {
|
|
5561
5547
|
className: "flex min-w-0 flex-col gap-3",
|
|
5562
5548
|
children: [/* @__PURE__ */ o("div", {
|
|
@@ -5568,22 +5554,22 @@ function Oc(e, t, n) {
|
|
|
5568
5554
|
}), n]
|
|
5569
5555
|
});
|
|
5570
5556
|
}
|
|
5571
|
-
function
|
|
5557
|
+
function Dc(e, t) {
|
|
5572
5558
|
let n = Wi(e);
|
|
5573
5559
|
return t ? n : k(k({}, n), {}, { answer: [] });
|
|
5574
5560
|
}
|
|
5575
5561
|
//#endregion
|
|
5576
5562
|
//#region src/question/content-editor/subquestion-group-editor-helpers.ts
|
|
5577
|
-
function
|
|
5578
|
-
return li(
|
|
5563
|
+
function Oc(e, t) {
|
|
5564
|
+
return li(Ac(e.structure, t), e.questionTypeKey);
|
|
5579
5565
|
}
|
|
5580
|
-
function
|
|
5566
|
+
function kc(e) {
|
|
5581
5567
|
return e;
|
|
5582
5568
|
}
|
|
5583
|
-
function
|
|
5569
|
+
function Ac(e, t) {
|
|
5584
5570
|
return k(k({}, e), {}, { hasAnswer: t && e.hasAnswer });
|
|
5585
5571
|
}
|
|
5586
|
-
function
|
|
5572
|
+
function jc(e, t, n) {
|
|
5587
5573
|
let r = t + n;
|
|
5588
5574
|
return t < 0 || r < 0 || r >= e.length ? e : e.map((n, i) => {
|
|
5589
5575
|
if (i === t) {
|
|
@@ -5599,15 +5585,15 @@ function Nc(e, t, n) {
|
|
|
5599
5585
|
}
|
|
5600
5586
|
//#endregion
|
|
5601
5587
|
//#region src/question/content-editor/QuestionContentSubquestionAddChildDropdown.tsx
|
|
5602
|
-
function
|
|
5588
|
+
function Mc({ disabled: e, hasAnswer: t, onAddChild: n, subquestionTemplates: r, translator: i }) {
|
|
5603
5589
|
var s, c, l;
|
|
5604
|
-
let { t: u } = i, d = f(() =>
|
|
5590
|
+
let { t: u } = i, d = f(() => kc(r), [r]), p = f(() => new Map(d.map((e) => [String(e.questionTypeKey), e])), [d]), h = f(() => d.map((e) => ({
|
|
5605
5591
|
label: e.label,
|
|
5606
5592
|
value: String(e.questionTypeKey)
|
|
5607
5593
|
})), [d]), [g, _] = m((s = (c = h[0]) == null ? void 0 : c.value) == null ? "" : s), v = p.has(g) ? g : ((l = h[0]) == null ? void 0 : l.value) || "";
|
|
5608
5594
|
function y() {
|
|
5609
5595
|
let e = p.get(v);
|
|
5610
|
-
e && n(
|
|
5596
|
+
e && n(Oc(e, t));
|
|
5611
5597
|
}
|
|
5612
5598
|
let b = e || d.length === 0;
|
|
5613
5599
|
return /* @__PURE__ */ o("span", {
|
|
@@ -5628,12 +5614,12 @@ function Pc({ disabled: e, hasAnswer: t, onAddChild: n, subquestionTemplates: r,
|
|
|
5628
5614
|
}
|
|
5629
5615
|
//#endregion
|
|
5630
5616
|
//#region src/question/shared/subquestion-numbering.ts
|
|
5631
|
-
function
|
|
5617
|
+
function Nc(e) {
|
|
5632
5618
|
return e.map((e) => String(e + 1)).join(".");
|
|
5633
5619
|
}
|
|
5634
5620
|
//#endregion
|
|
5635
5621
|
//#region src/question/content-editor/QuestionContentSubquestionChildElements.tsx
|
|
5636
|
-
function
|
|
5622
|
+
function Pc({ child: e, disabled: t, onChange: n, richTextControls: r, structure: i, translator: s }) {
|
|
5637
5623
|
let { t: c } = s;
|
|
5638
5624
|
function l(t) {
|
|
5639
5625
|
n(k(k({}, e), Ci(e, t)));
|
|
@@ -5645,7 +5631,7 @@ function Ic({ child: e, disabled: t, onChange: n, richTextControls: r, structure
|
|
|
5645
5631
|
className: "flex min-w-0 flex-col",
|
|
5646
5632
|
children: [i.elements.map((n) => /* @__PURE__ */ a("section", {
|
|
5647
5633
|
className: "flex min-w-0 flex-col gap-3 border-t border-slate-100 py-3 first:border-t-0 first:pt-0 last:pb-0",
|
|
5648
|
-
children: /* @__PURE__ */ a(
|
|
5634
|
+
children: /* @__PURE__ */ a(wc, {
|
|
5649
5635
|
disabled: t,
|
|
5650
5636
|
element: n,
|
|
5651
5637
|
hasAnswer: i.hasAnswer,
|
|
@@ -5659,11 +5645,11 @@ function Ic({ child: e, disabled: t, onChange: n, richTextControls: r, structure
|
|
|
5659
5645
|
let o = gi(e, n);
|
|
5660
5646
|
return /* @__PURE__ */ a("section", {
|
|
5661
5647
|
className: "flex min-w-0 flex-col gap-3 border-t border-slate-100 py-3 first:border-t-0 first:pt-0 last:pb-0",
|
|
5662
|
-
children: /* @__PURE__ */ a(
|
|
5648
|
+
children: /* @__PURE__ */ a(wc, {
|
|
5663
5649
|
disabled: t,
|
|
5664
|
-
element:
|
|
5650
|
+
element: Fc(n),
|
|
5665
5651
|
hasAnswer: i.hasAnswer,
|
|
5666
|
-
item:
|
|
5652
|
+
item: Ic(o),
|
|
5667
5653
|
onChange: (e) => u({
|
|
5668
5654
|
content: e.content,
|
|
5669
5655
|
extraKey: n.extraKey,
|
|
@@ -5677,7 +5663,7 @@ function Ic({ child: e, disabled: t, onChange: n, richTextControls: r, structure
|
|
|
5677
5663
|
})]
|
|
5678
5664
|
});
|
|
5679
5665
|
}
|
|
5680
|
-
function
|
|
5666
|
+
function Fc(e) {
|
|
5681
5667
|
return {
|
|
5682
5668
|
config: {},
|
|
5683
5669
|
elementKey: e.extraKey,
|
|
@@ -5685,7 +5671,7 @@ function Lc(e) {
|
|
|
5685
5671
|
type: "richText"
|
|
5686
5672
|
};
|
|
5687
5673
|
}
|
|
5688
|
-
function
|
|
5674
|
+
function Ic(e) {
|
|
5689
5675
|
return {
|
|
5690
5676
|
content: e.content,
|
|
5691
5677
|
elementKey: e.extraKey,
|
|
@@ -5694,16 +5680,16 @@ function Rc(e) {
|
|
|
5694
5680
|
}
|
|
5695
5681
|
//#endregion
|
|
5696
5682
|
//#region src/question/content-editor/subquestion-template.ts
|
|
5697
|
-
function
|
|
5683
|
+
function Lc(e, t) {
|
|
5698
5684
|
return t !== null && e.questionTypeKey === t;
|
|
5699
5685
|
}
|
|
5700
|
-
function
|
|
5701
|
-
return e.find((e) =>
|
|
5686
|
+
function Rc(e, t) {
|
|
5687
|
+
return e.find((e) => Lc(e, t));
|
|
5702
5688
|
}
|
|
5703
5689
|
//#endregion
|
|
5704
5690
|
//#region src/question/content-editor/QuestionContentSubquestionChildEditor.tsx
|
|
5705
|
-
function
|
|
5706
|
-
let { t: m } = p, h = i == null ? [t] : i, g =
|
|
5691
|
+
function zc({ child: e, childIndex: t, disabled: n, hasAnswer: r, numberPath: i, onChange: s, onDelete: c, onMove: l, richTextControls: u, siblingCount: d, subquestionTemplates: f, translator: p }) {
|
|
5692
|
+
let { t: m } = p, h = i == null ? [t] : i, g = Nc(h), _ = Bc(e, f), v = Vc(_, r), y = ci(v), b = k(k(k({}, e), Si(v, e)), {}, { children: e.children });
|
|
5707
5693
|
function x(e) {
|
|
5708
5694
|
s(k(k({}, b), {}, { children: [...b.children, e] }));
|
|
5709
5695
|
}
|
|
@@ -5714,7 +5700,7 @@ function Vc({ child: e, childIndex: t, disabled: n, hasAnswer: r, numberPath: i,
|
|
|
5714
5700
|
s(k(k({}, b), {}, { children: b.children.filter((t, n) => n !== e) }));
|
|
5715
5701
|
}
|
|
5716
5702
|
function w(e, t) {
|
|
5717
|
-
s(k(k({}, b), {}, { children:
|
|
5703
|
+
s(k(k({}, b), {}, { children: jc(b.children, e, t) }));
|
|
5718
5704
|
}
|
|
5719
5705
|
return /* @__PURE__ */ o("section", {
|
|
5720
5706
|
className: "flex min-w-0 flex-col gap-3 border-b border-l-2 border-slate-200 border-l-blue-600 bg-white py-4 pr-0 pl-3 last:border-b-0 sm:pl-4",
|
|
@@ -5733,14 +5719,14 @@ function Vc({ child: e, childIndex: t, disabled: n, hasAnswer: r, numberPath: i,
|
|
|
5733
5719
|
m("questionContentEditor.subquestion.questionKind"),
|
|
5734
5720
|
" \u00b7",
|
|
5735
5721
|
" ",
|
|
5736
|
-
|
|
5722
|
+
Hc(_, e)
|
|
5737
5723
|
]
|
|
5738
5724
|
})]
|
|
5739
5725
|
}), /* @__PURE__ */ o(Os, {
|
|
5740
5726
|
size: 4,
|
|
5741
5727
|
wrap: !0,
|
|
5742
5728
|
children: [
|
|
5743
|
-
/* @__PURE__ */ a(
|
|
5729
|
+
/* @__PURE__ */ a(Mc, {
|
|
5744
5730
|
disabled: n,
|
|
5745
5731
|
hasAnswer: r,
|
|
5746
5732
|
onAddChild: x,
|
|
@@ -5772,10 +5758,10 @@ function Vc({ child: e, childIndex: t, disabled: n, hasAnswer: r, numberPath: i,
|
|
|
5772
5758
|
]
|
|
5773
5759
|
})]
|
|
5774
5760
|
}),
|
|
5775
|
-
|
|
5761
|
+
Uc(y, n, b, s, u, v, p),
|
|
5776
5762
|
b.children.length === 0 ? null : /* @__PURE__ */ a("div", {
|
|
5777
5763
|
className: "ml-3 flex min-w-0 flex-col pl-3 sm:ml-4 sm:pl-4",
|
|
5778
|
-
children: b.children.map((e, t) => /* @__PURE__ */ a(
|
|
5764
|
+
children: b.children.map((e, t) => /* @__PURE__ */ a(zc, {
|
|
5779
5765
|
child: e,
|
|
5780
5766
|
childIndex: t,
|
|
5781
5767
|
disabled: n,
|
|
@@ -5788,27 +5774,27 @@ function Vc({ child: e, childIndex: t, disabled: n, hasAnswer: r, numberPath: i,
|
|
|
5788
5774
|
siblingCount: b.children.length,
|
|
5789
5775
|
subquestionTemplates: f,
|
|
5790
5776
|
translator: p
|
|
5791
|
-
},
|
|
5777
|
+
}, Wc(e, t)))
|
|
5792
5778
|
})
|
|
5793
5779
|
]
|
|
5794
5780
|
});
|
|
5795
5781
|
}
|
|
5796
|
-
function
|
|
5797
|
-
return
|
|
5782
|
+
function Bc(e, t) {
|
|
5783
|
+
return Rc(t, e.questionTypeKey);
|
|
5798
5784
|
}
|
|
5799
|
-
function
|
|
5800
|
-
return
|
|
5785
|
+
function Vc(e, t) {
|
|
5786
|
+
return Ac(e ? e.structure : {
|
|
5801
5787
|
elements: [],
|
|
5802
5788
|
extras: [],
|
|
5803
5789
|
hasAnswer: t,
|
|
5804
5790
|
systemQuestionType: ""
|
|
5805
5791
|
}, t);
|
|
5806
5792
|
}
|
|
5807
|
-
function
|
|
5793
|
+
function Hc(e, t) {
|
|
5808
5794
|
return e ? e.label : t.questionTypeKey;
|
|
5809
5795
|
}
|
|
5810
|
-
function
|
|
5811
|
-
return e ? null : /* @__PURE__ */ a(
|
|
5796
|
+
function Uc(e, t, n, r, i, o, s) {
|
|
5797
|
+
return e ? null : /* @__PURE__ */ a(Pc, {
|
|
5812
5798
|
child: n,
|
|
5813
5799
|
disabled: t,
|
|
5814
5800
|
onChange: r,
|
|
@@ -5817,12 +5803,12 @@ function Gc(e, t, n, r, i, o, s) {
|
|
|
5817
5803
|
translator: s
|
|
5818
5804
|
});
|
|
5819
5805
|
}
|
|
5820
|
-
function
|
|
5806
|
+
function Wc(e, t) {
|
|
5821
5807
|
return `child-${e.questionTypeKey}-${t}`;
|
|
5822
5808
|
}
|
|
5823
5809
|
//#endregion
|
|
5824
5810
|
//#region src/question/content-editor/QuestionContentSubquestionGroupEditor.tsx
|
|
5825
|
-
function
|
|
5811
|
+
function Gc({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls: i, subquestionTemplates: s, translator: c }) {
|
|
5826
5812
|
let { t: l } = c, u = n.children.length;
|
|
5827
5813
|
function d(e) {
|
|
5828
5814
|
r(k(k({}, n), {}, {
|
|
@@ -5840,11 +5826,11 @@ function qc({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
5840
5826
|
d(n.children.filter((t, n) => n !== e));
|
|
5841
5827
|
}
|
|
5842
5828
|
function h(e, t) {
|
|
5843
|
-
d(
|
|
5829
|
+
d(jc(n.children, e, t));
|
|
5844
5830
|
}
|
|
5845
5831
|
function g(r, o) {
|
|
5846
5832
|
var l;
|
|
5847
|
-
return /* @__PURE__ */ a(
|
|
5833
|
+
return /* @__PURE__ */ a(zc, {
|
|
5848
5834
|
child: r,
|
|
5849
5835
|
childIndex: o,
|
|
5850
5836
|
disabled: e,
|
|
@@ -5875,7 +5861,7 @@ function qc({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
5875
5861
|
}), /* @__PURE__ */ a(Os, {
|
|
5876
5862
|
className: "min-w-0 justify-end",
|
|
5877
5863
|
wrap: !0,
|
|
5878
|
-
children: /* @__PURE__ */ a(
|
|
5864
|
+
children: /* @__PURE__ */ a(Mc, {
|
|
5879
5865
|
disabled: e,
|
|
5880
5866
|
hasAnswer: t,
|
|
5881
5867
|
onAddChild: f,
|
|
@@ -5891,7 +5877,7 @@ function qc({ disabled: e, hasAnswer: t, item: n, onChange: r, richTextControls:
|
|
|
5891
5877
|
}
|
|
5892
5878
|
//#endregion
|
|
5893
5879
|
//#region src/question/content-editor/QuestionContentEditor.tsx
|
|
5894
|
-
function
|
|
5880
|
+
function Kc({ disabled: t = !1, locale: n = "zh-CN", onChange: r, structure: i, subquestionTemplates: s = [], uploadImage: c, value: l }) {
|
|
5895
5881
|
let u = hs(n), { t: d } = u, p = f(() => ({
|
|
5896
5882
|
plugins: [Jr, us],
|
|
5897
5883
|
uploadImage: c
|
|
@@ -5904,7 +5890,7 @@ function Jc({ disabled: t = !1, locale: n = "zh-CN", onChange: r, structure: i,
|
|
|
5904
5890
|
}
|
|
5905
5891
|
function g(e) {
|
|
5906
5892
|
let n = hi(l, e, i.hasAnswer);
|
|
5907
|
-
return /* @__PURE__ */ a(
|
|
5893
|
+
return /* @__PURE__ */ a(wc, {
|
|
5908
5894
|
disabled: t,
|
|
5909
5895
|
element: e,
|
|
5910
5896
|
hasAnswer: i.hasAnswer,
|
|
@@ -5917,11 +5903,11 @@ function Jc({ disabled: t = !1, locale: n = "zh-CN", onChange: r, structure: i,
|
|
|
5917
5903
|
}
|
|
5918
5904
|
function _(e) {
|
|
5919
5905
|
let n = gi(l, e);
|
|
5920
|
-
return /* @__PURE__ */ a(
|
|
5906
|
+
return /* @__PURE__ */ a(wc, {
|
|
5921
5907
|
disabled: t,
|
|
5922
|
-
element:
|
|
5908
|
+
element: qc(e),
|
|
5923
5909
|
hasAnswer: i.hasAnswer,
|
|
5924
|
-
item:
|
|
5910
|
+
item: Jc(n),
|
|
5925
5911
|
onChange: (t) => h({
|
|
5926
5912
|
content: t.content,
|
|
5927
5913
|
extraKey: e.extraKey,
|
|
@@ -5932,7 +5918,7 @@ function Jc({ disabled: t = !1, locale: n = "zh-CN", onChange: r, structure: i,
|
|
|
5932
5918
|
translator: u
|
|
5933
5919
|
});
|
|
5934
5920
|
}
|
|
5935
|
-
let v = ci(i) ? /* @__PURE__ */ a(
|
|
5921
|
+
let v = ci(i) ? /* @__PURE__ */ a(Gc, {
|
|
5936
5922
|
disabled: t,
|
|
5937
5923
|
hasAnswer: i.hasAnswer,
|
|
5938
5924
|
item: k(k({}, l), {}, { elements: [] }),
|
|
@@ -5967,7 +5953,7 @@ function Jc({ disabled: t = !1, locale: n = "zh-CN", onChange: r, structure: i,
|
|
|
5967
5953
|
})]
|
|
5968
5954
|
});
|
|
5969
5955
|
}
|
|
5970
|
-
function
|
|
5956
|
+
function qc(e) {
|
|
5971
5957
|
return {
|
|
5972
5958
|
config: {},
|
|
5973
5959
|
elementKey: e.extraKey,
|
|
@@ -5975,7 +5961,7 @@ function Yc(e) {
|
|
|
5975
5961
|
type: "richText"
|
|
5976
5962
|
};
|
|
5977
5963
|
}
|
|
5978
|
-
function
|
|
5964
|
+
function Jc(e) {
|
|
5979
5965
|
return {
|
|
5980
5966
|
content: e.content,
|
|
5981
5967
|
elementKey: e.extraKey,
|
|
@@ -5984,38 +5970,38 @@ function Xc(e) {
|
|
|
5984
5970
|
}
|
|
5985
5971
|
//#endregion
|
|
5986
5972
|
//#region src/question/content-editor/structure.ts
|
|
5987
|
-
function
|
|
5973
|
+
function Yc(e, t) {
|
|
5988
5974
|
return {
|
|
5989
|
-
elements: e.elements.map((e) =>
|
|
5975
|
+
elements: e.elements.map((e) => ol(e, t)),
|
|
5990
5976
|
extras: e.extras.map((e) => ({
|
|
5991
5977
|
extraKey: e.clientId,
|
|
5992
|
-
name:
|
|
5978
|
+
name: cl(e, Vr(e.type), Hr(e.type), t),
|
|
5993
5979
|
type: e.type
|
|
5994
5980
|
})),
|
|
5995
5981
|
hasAnswer: e.globalConfig.hasAnswer,
|
|
5996
5982
|
systemQuestionType: ""
|
|
5997
5983
|
};
|
|
5998
5984
|
}
|
|
5999
|
-
function
|
|
6000
|
-
return !e || !t ? null : k(k({}, Si(t,
|
|
6001
|
-
let t =
|
|
6002
|
-
return t ?
|
|
5985
|
+
function Xc(e, t, n) {
|
|
5986
|
+
return !e || !t ? null : k(k({}, Si(t, $c(e))), {}, { children: e.children.map((e) => {
|
|
5987
|
+
let t = Rc(n, e.questionTypeKey);
|
|
5988
|
+
return t ? Xc(e, t.structure, n) : null;
|
|
6003
5989
|
}).filter((e) => !!e) });
|
|
6004
5990
|
}
|
|
6005
|
-
function
|
|
5991
|
+
function Zc(e) {
|
|
6006
5992
|
return {
|
|
6007
5993
|
description: e.description,
|
|
6008
|
-
elements: e.elements.map(
|
|
6009
|
-
extras: e.extras.map(
|
|
5994
|
+
elements: e.elements.map(nl),
|
|
5995
|
+
extras: e.extras.map(al),
|
|
6010
5996
|
globalConfig: k({}, e.globalConfig),
|
|
6011
5997
|
isSubjective: e.isSubjective,
|
|
6012
5998
|
version: e.version
|
|
6013
5999
|
};
|
|
6014
6000
|
}
|
|
6015
|
-
function
|
|
6016
|
-
return e.globalConfig.hasAnswer !== t.globalConfig.hasAnswer || e.elements.length !== t.elements.length || e.extras.length !== t.extras.length ||
|
|
6001
|
+
function Qc(e, t) {
|
|
6002
|
+
return e.globalConfig.hasAnswer !== t.globalConfig.hasAnswer || e.elements.length !== t.elements.length || e.extras.length !== t.extras.length || el(e.elements, t.elements) || tl(e.extras, t.extras) ? "shape" : "metadata";
|
|
6017
6003
|
}
|
|
6018
|
-
function
|
|
6004
|
+
function $c(e) {
|
|
6019
6005
|
return {
|
|
6020
6006
|
questionTypeKey: e.questionTypeKey,
|
|
6021
6007
|
children: [],
|
|
@@ -6025,22 +6011,22 @@ function tl(e) {
|
|
|
6025
6011
|
version: e.version
|
|
6026
6012
|
};
|
|
6027
6013
|
}
|
|
6028
|
-
function
|
|
6014
|
+
function el(e, t) {
|
|
6029
6015
|
return e.some((e, n) => {
|
|
6030
6016
|
let r = t.slice(n, n + 1)[0];
|
|
6031
6017
|
return !r || e.clientId !== r.clientId || e.type !== r.type || JSON.stringify(e.config) !== JSON.stringify(r.config);
|
|
6032
6018
|
});
|
|
6033
6019
|
}
|
|
6034
|
-
function
|
|
6020
|
+
function tl(e, t) {
|
|
6035
6021
|
return e.some((e, n) => {
|
|
6036
6022
|
let r = t.slice(n, n + 1)[0];
|
|
6037
6023
|
return !r || e.clientId !== r.clientId || e.type !== r.type;
|
|
6038
6024
|
});
|
|
6039
6025
|
}
|
|
6040
|
-
function
|
|
6041
|
-
return e.type === "fill" || e.type === "classification" || e.type === "ordering" || e.type === "richText" || e.type === "textMarker" ?
|
|
6026
|
+
function nl(e) {
|
|
6027
|
+
return e.type === "fill" || e.type === "classification" || e.type === "ordering" || e.type === "richText" || e.type === "textMarker" ? il(e) : rl(e);
|
|
6042
6028
|
}
|
|
6043
|
-
function
|
|
6029
|
+
function rl(e) {
|
|
6044
6030
|
switch (e.type) {
|
|
6045
6031
|
case "inlineFill": return {
|
|
6046
6032
|
config: k({}, e.config),
|
|
@@ -6080,7 +6066,7 @@ function al(e) {
|
|
|
6080
6066
|
};
|
|
6081
6067
|
}
|
|
6082
6068
|
}
|
|
6083
|
-
function
|
|
6069
|
+
function il(e) {
|
|
6084
6070
|
return {
|
|
6085
6071
|
config: {},
|
|
6086
6072
|
enName: e.enName,
|
|
@@ -6088,22 +6074,22 @@ function ol(e) {
|
|
|
6088
6074
|
type: e.type
|
|
6089
6075
|
};
|
|
6090
6076
|
}
|
|
6091
|
-
function
|
|
6077
|
+
function al(e) {
|
|
6092
6078
|
return {
|
|
6093
6079
|
enName: e.enName,
|
|
6094
6080
|
name: e.name,
|
|
6095
6081
|
type: e.type
|
|
6096
6082
|
};
|
|
6097
6083
|
}
|
|
6098
|
-
function
|
|
6084
|
+
function ol(e, t) {
|
|
6099
6085
|
return e.type === "fill" || e.type === "classification" || e.type === "ordering" || e.type === "richText" || e.type === "textMarker" ? {
|
|
6100
6086
|
config: {},
|
|
6101
6087
|
elementKey: e.clientId,
|
|
6102
|
-
name:
|
|
6088
|
+
name: cl(e, A(e.type), j(e.type), t),
|
|
6103
6089
|
type: e.type
|
|
6104
|
-
} :
|
|
6090
|
+
} : sl(e, t);
|
|
6105
6091
|
}
|
|
6106
|
-
function
|
|
6092
|
+
function sl(e, t) {
|
|
6107
6093
|
switch (e.type) {
|
|
6108
6094
|
case "inlineFill": return {
|
|
6109
6095
|
config: {
|
|
@@ -6111,19 +6097,19 @@ function ll(e, t) {
|
|
|
6111
6097
|
candidateMode: e.config.candidateMode
|
|
6112
6098
|
},
|
|
6113
6099
|
elementKey: e.clientId,
|
|
6114
|
-
name:
|
|
6100
|
+
name: cl(e, A("inlineFill"), j("inlineFill"), t),
|
|
6115
6101
|
type: "inlineFill"
|
|
6116
6102
|
};
|
|
6117
6103
|
case "wordBuilder": return {
|
|
6118
6104
|
config: { builderMode: e.config.builderMode },
|
|
6119
6105
|
elementKey: e.clientId,
|
|
6120
|
-
name:
|
|
6106
|
+
name: cl(e, A("wordBuilder"), j("wordBuilder"), t),
|
|
6121
6107
|
type: "wordBuilder"
|
|
6122
6108
|
};
|
|
6123
6109
|
case "judgement": return {
|
|
6124
6110
|
config: { judgeAnswerMode: e.config.judgeAnswerMode },
|
|
6125
6111
|
elementKey: e.clientId,
|
|
6126
|
-
name:
|
|
6112
|
+
name: cl(e, A("judgement"), j("judgement"), t),
|
|
6127
6113
|
type: "judgement"
|
|
6128
6114
|
};
|
|
6129
6115
|
case "choice": return {
|
|
@@ -6133,24 +6119,24 @@ function ll(e, t) {
|
|
|
6133
6119
|
selectionType: e.config.selectionType
|
|
6134
6120
|
},
|
|
6135
6121
|
elementKey: e.clientId,
|
|
6136
|
-
name:
|
|
6122
|
+
name: cl(e, A("choice"), j("choice"), t),
|
|
6137
6123
|
type: "choice"
|
|
6138
6124
|
};
|
|
6139
6125
|
case "lineConnect": return {
|
|
6140
6126
|
config: { columns: e.config.columns.map((e) => k({}, e)) },
|
|
6141
6127
|
elementKey: e.clientId,
|
|
6142
|
-
name:
|
|
6128
|
+
name: cl(e, A("lineConnect"), j("lineConnect"), t),
|
|
6143
6129
|
type: "lineConnect"
|
|
6144
6130
|
};
|
|
6145
6131
|
case "matching": return {
|
|
6146
6132
|
config: { columns: e.config.columns.map((e) => k({}, e)) },
|
|
6147
6133
|
elementKey: e.clientId,
|
|
6148
|
-
name:
|
|
6134
|
+
name: cl(e, A("matching"), j("matching"), t),
|
|
6149
6135
|
type: "matching"
|
|
6150
6136
|
};
|
|
6151
6137
|
}
|
|
6152
6138
|
}
|
|
6153
|
-
function
|
|
6139
|
+
function cl(e, t, n, r) {
|
|
6154
6140
|
var i;
|
|
6155
6141
|
if (r === "en-US") {
|
|
6156
6142
|
var a;
|
|
@@ -6160,231 +6146,231 @@ function ul(e, t, n, r) {
|
|
|
6160
6146
|
}
|
|
6161
6147
|
//#endregion
|
|
6162
6148
|
//#region src/question/player/helpers.ts
|
|
6163
|
-
function
|
|
6149
|
+
function ll(e, t, n = []) {
|
|
6164
6150
|
let r = ci(t);
|
|
6165
6151
|
return {
|
|
6166
6152
|
questionTypeKey: e.questionTypeKey,
|
|
6167
|
-
children: e.children.map((e) =>
|
|
6153
|
+
children: e.children.map((e) => kl(e, n)),
|
|
6168
6154
|
id: e.id,
|
|
6169
6155
|
items: r ? [] : t.elements.reduce((n, r) => {
|
|
6170
|
-
let i =
|
|
6156
|
+
let i = Al(r, hi(e, r, t.hasAnswer));
|
|
6171
6157
|
return i ? [...n, i] : n;
|
|
6172
6158
|
}, []),
|
|
6173
6159
|
version: e.version
|
|
6174
6160
|
};
|
|
6175
6161
|
}
|
|
6176
|
-
function
|
|
6162
|
+
function ul(e, t) {
|
|
6177
6163
|
var n;
|
|
6178
|
-
return (n =
|
|
6164
|
+
return (n = Gl(e, t, "choice")) == null ? {
|
|
6179
6165
|
elementKey: t,
|
|
6180
6166
|
selectedIndexes: [],
|
|
6181
6167
|
type: "choice"
|
|
6182
6168
|
} : n;
|
|
6183
6169
|
}
|
|
6184
|
-
function
|
|
6170
|
+
function dl(e, t, n) {
|
|
6185
6171
|
var r;
|
|
6186
|
-
return (r =
|
|
6187
|
-
answers:
|
|
6172
|
+
return (r = Gl(e, t, "fill")) == null ? {
|
|
6173
|
+
answers: Ul(n),
|
|
6188
6174
|
elementKey: t,
|
|
6189
6175
|
type: "fill"
|
|
6190
6176
|
} : r;
|
|
6191
6177
|
}
|
|
6192
|
-
function
|
|
6178
|
+
function fl(e, t, n) {
|
|
6193
6179
|
var r;
|
|
6194
|
-
return (r =
|
|
6195
|
-
answers:
|
|
6180
|
+
return (r = Gl(e, t.elementKey, "inlineFill")) == null ? {
|
|
6181
|
+
answers: Wl(t, n),
|
|
6196
6182
|
elementKey: t.elementKey,
|
|
6197
6183
|
type: "inlineFill"
|
|
6198
6184
|
} : r;
|
|
6199
6185
|
}
|
|
6200
|
-
function
|
|
6186
|
+
function pl(e, t, n) {
|
|
6201
6187
|
var r;
|
|
6202
|
-
return (r =
|
|
6203
|
-
answers:
|
|
6188
|
+
return (r = Gl(e, t, "wordBuilder")) == null ? {
|
|
6189
|
+
answers: Ul(n),
|
|
6204
6190
|
elementKey: t,
|
|
6205
6191
|
type: "wordBuilder"
|
|
6206
6192
|
} : r;
|
|
6207
6193
|
}
|
|
6208
|
-
function
|
|
6194
|
+
function ml(e, t) {
|
|
6209
6195
|
var n;
|
|
6210
|
-
return (n =
|
|
6196
|
+
return (n = Gl(e, t, "judgement")) == null ? {
|
|
6211
6197
|
elementKey: t,
|
|
6212
6198
|
selectedValues: [],
|
|
6213
6199
|
type: "judgement"
|
|
6214
6200
|
} : n;
|
|
6215
6201
|
}
|
|
6216
|
-
function
|
|
6202
|
+
function hl(e, t) {
|
|
6217
6203
|
var n;
|
|
6218
|
-
return (n =
|
|
6204
|
+
return (n = Gl(e, t, "classification")) == null ? {
|
|
6219
6205
|
elementKey: t,
|
|
6220
6206
|
placements: {},
|
|
6221
6207
|
type: "classification"
|
|
6222
6208
|
} : n;
|
|
6223
6209
|
}
|
|
6224
|
-
function
|
|
6210
|
+
function gl(e, t) {
|
|
6225
6211
|
var n;
|
|
6226
|
-
return (n =
|
|
6212
|
+
return (n = Gl(e, t, "lineConnect")) == null ? {
|
|
6227
6213
|
connections: {},
|
|
6228
6214
|
elementKey: t,
|
|
6229
6215
|
type: "lineConnect"
|
|
6230
6216
|
} : n;
|
|
6231
6217
|
}
|
|
6232
|
-
function
|
|
6218
|
+
function _l(e, t) {
|
|
6233
6219
|
var n;
|
|
6234
|
-
return (n =
|
|
6220
|
+
return (n = Gl(e, t, "matching")) == null ? {
|
|
6235
6221
|
connections: {},
|
|
6236
6222
|
elementKey: t,
|
|
6237
6223
|
type: "matching"
|
|
6238
6224
|
} : n;
|
|
6239
6225
|
}
|
|
6240
|
-
function
|
|
6226
|
+
function vl(e, t) {
|
|
6241
6227
|
var n;
|
|
6242
|
-
return (n =
|
|
6228
|
+
return (n = Gl(e, t.elementKey, "ordering")) == null ? {
|
|
6243
6229
|
elementKey: t.elementKey,
|
|
6244
6230
|
orderedOptionIds: t.sortOptions.map((e) => e.id),
|
|
6245
6231
|
type: "ordering"
|
|
6246
6232
|
} : n;
|
|
6247
6233
|
}
|
|
6248
|
-
function
|
|
6234
|
+
function yl(e, t) {
|
|
6249
6235
|
var n;
|
|
6250
|
-
return (n =
|
|
6236
|
+
return (n = Gl(e, t, "textMarker")) == null ? {
|
|
6251
6237
|
elementKey: t,
|
|
6252
6238
|
selectedMarkers: [],
|
|
6253
6239
|
type: "textMarker"
|
|
6254
6240
|
} : n;
|
|
6255
6241
|
}
|
|
6256
|
-
function
|
|
6242
|
+
function bl(e, t) {
|
|
6257
6243
|
let n = e.items.some((e) => e.elementKey === t.elementKey && e.type === t.type);
|
|
6258
6244
|
return k(k({}, e), {}, { items: n ? e.items.map((e) => e.elementKey === t.elementKey && e.type === t.type ? t : e) : [...e.items, t] });
|
|
6259
6245
|
}
|
|
6260
|
-
function
|
|
6246
|
+
function xl(e, t, n) {
|
|
6261
6247
|
return k(k({}, e), {}, { children: e.children.map((e, r) => r === t ? n : e) });
|
|
6262
6248
|
}
|
|
6263
|
-
function
|
|
6249
|
+
function Sl(e, t, n) {
|
|
6264
6250
|
return n === "single" ? e.includes(t) ? [] : [t] : e.includes(t) ? e.filter((e) => e !== t) : [...e, t];
|
|
6265
6251
|
}
|
|
6266
|
-
function
|
|
6252
|
+
function Cl(e, t, n = "single") {
|
|
6267
6253
|
return {
|
|
6268
6254
|
kind: "option",
|
|
6269
|
-
optionIds:
|
|
6255
|
+
optionIds: Kl((e == null ? void 0 : e.kind) === "option" ? e.optionIds : [], t, n)
|
|
6270
6256
|
};
|
|
6271
6257
|
}
|
|
6272
|
-
function
|
|
6258
|
+
function wl(e, t, n) {
|
|
6273
6259
|
return Ue(e, t, n);
|
|
6274
6260
|
}
|
|
6275
|
-
function
|
|
6261
|
+
function Tl(e, t, n) {
|
|
6276
6262
|
return pt(e, t, n);
|
|
6277
6263
|
}
|
|
6278
|
-
function
|
|
6264
|
+
function El(e, t, n) {
|
|
6279
6265
|
return Se(e, t, n);
|
|
6280
6266
|
}
|
|
6281
|
-
function
|
|
6267
|
+
function Dl(e, t, n, r) {
|
|
6282
6268
|
return Ra(e, t.sortOptions, n, r);
|
|
6283
6269
|
}
|
|
6284
|
-
function
|
|
6270
|
+
function Ol(e, t) {
|
|
6285
6271
|
return e.includes(t) ? e.filter((e) => e !== t) : [...e, t];
|
|
6286
6272
|
}
|
|
6287
|
-
function
|
|
6273
|
+
function kl(e, t) {
|
|
6288
6274
|
var n;
|
|
6289
|
-
let r =
|
|
6290
|
-
return
|
|
6275
|
+
let r = Rc(t, e.questionTypeKey);
|
|
6276
|
+
return ll(e, (n = r == null ? void 0 : r.structure) == null ? {
|
|
6291
6277
|
elements: [],
|
|
6292
6278
|
extras: [],
|
|
6293
6279
|
hasAnswer: !0,
|
|
6294
6280
|
systemQuestionType: ""
|
|
6295
6281
|
} : n, t);
|
|
6296
6282
|
}
|
|
6297
|
-
function
|
|
6298
|
-
return e.type === "richText" ? null : e.type === "ordering" ?
|
|
6283
|
+
function Al(e, t) {
|
|
6284
|
+
return e.type === "richText" ? null : e.type === "ordering" ? Vl(e.elementKey, t) : e.type === "classification" ? Ml(e.elementKey, t) : e.type === "fill" ? Fl(e.elementKey, t) : jl(e, t);
|
|
6299
6285
|
}
|
|
6300
|
-
function
|
|
6286
|
+
function jl(e, t) {
|
|
6301
6287
|
switch (e.type) {
|
|
6302
|
-
case "choice": return
|
|
6303
|
-
case "inlineFill": return
|
|
6304
|
-
case "wordBuilder": return
|
|
6305
|
-
case "judgement": return
|
|
6306
|
-
case "lineConnect": return
|
|
6307
|
-
case "matching": return
|
|
6308
|
-
case "textMarker": return
|
|
6288
|
+
case "choice": return Pl(e.elementKey);
|
|
6289
|
+
case "inlineFill": return Il(e, t);
|
|
6290
|
+
case "wordBuilder": return Nl(e.elementKey, t);
|
|
6291
|
+
case "judgement": return Ll(e.elementKey);
|
|
6292
|
+
case "lineConnect": return Rl(e.elementKey);
|
|
6293
|
+
case "matching": return zl(e.elementKey);
|
|
6294
|
+
case "textMarker": return Hl(e.elementKey);
|
|
6309
6295
|
}
|
|
6310
6296
|
}
|
|
6311
|
-
function
|
|
6297
|
+
function Ml(e, t) {
|
|
6312
6298
|
return t.type === "classification" ? {
|
|
6313
6299
|
elementKey: e,
|
|
6314
|
-
placements:
|
|
6300
|
+
placements: Bl({}, t),
|
|
6315
6301
|
type: "classification"
|
|
6316
6302
|
} : null;
|
|
6317
6303
|
}
|
|
6318
|
-
function
|
|
6304
|
+
function Nl(e, t) {
|
|
6319
6305
|
return t.type === "wordBuilder" ? {
|
|
6320
|
-
answers:
|
|
6306
|
+
answers: Ul(t.blanks),
|
|
6321
6307
|
elementKey: e,
|
|
6322
6308
|
type: "wordBuilder"
|
|
6323
6309
|
} : null;
|
|
6324
6310
|
}
|
|
6325
|
-
function
|
|
6311
|
+
function Pl(e) {
|
|
6326
6312
|
return {
|
|
6327
6313
|
elementKey: e,
|
|
6328
6314
|
selectedIndexes: [],
|
|
6329
6315
|
type: "choice"
|
|
6330
6316
|
};
|
|
6331
6317
|
}
|
|
6332
|
-
function
|
|
6318
|
+
function Fl(e, t) {
|
|
6333
6319
|
return t.type === "fill" ? {
|
|
6334
|
-
answers:
|
|
6320
|
+
answers: Ul(t.blanks),
|
|
6335
6321
|
elementKey: e,
|
|
6336
6322
|
type: "fill"
|
|
6337
6323
|
} : null;
|
|
6338
6324
|
}
|
|
6339
|
-
function
|
|
6325
|
+
function Il(e, t) {
|
|
6340
6326
|
return t.type === "inlineFill" ? {
|
|
6341
|
-
answers:
|
|
6327
|
+
answers: Wl(e, t.blanks),
|
|
6342
6328
|
elementKey: e.elementKey,
|
|
6343
6329
|
type: "inlineFill"
|
|
6344
6330
|
} : null;
|
|
6345
6331
|
}
|
|
6346
|
-
function
|
|
6332
|
+
function Ll(e) {
|
|
6347
6333
|
return {
|
|
6348
6334
|
elementKey: e,
|
|
6349
6335
|
selectedValues: [],
|
|
6350
6336
|
type: "judgement"
|
|
6351
6337
|
};
|
|
6352
6338
|
}
|
|
6353
|
-
function
|
|
6339
|
+
function Rl(e) {
|
|
6354
6340
|
return {
|
|
6355
6341
|
connections: {},
|
|
6356
6342
|
elementKey: e,
|
|
6357
6343
|
type: "lineConnect"
|
|
6358
6344
|
};
|
|
6359
6345
|
}
|
|
6360
|
-
function
|
|
6346
|
+
function zl(e) {
|
|
6361
6347
|
return {
|
|
6362
6348
|
connections: {},
|
|
6363
6349
|
elementKey: e,
|
|
6364
6350
|
type: "matching"
|
|
6365
6351
|
};
|
|
6366
6352
|
}
|
|
6367
|
-
function
|
|
6353
|
+
function Bl(e, t) {
|
|
6368
6354
|
return xe(e, t.categories, t.items);
|
|
6369
6355
|
}
|
|
6370
|
-
function
|
|
6356
|
+
function Vl(e, t) {
|
|
6371
6357
|
return t.type === "ordering" ? {
|
|
6372
6358
|
elementKey: e,
|
|
6373
6359
|
orderedOptionIds: t.sortOptions.map((e) => e.id),
|
|
6374
6360
|
type: "ordering"
|
|
6375
6361
|
} : null;
|
|
6376
6362
|
}
|
|
6377
|
-
function
|
|
6363
|
+
function Hl(e) {
|
|
6378
6364
|
return {
|
|
6379
6365
|
elementKey: e,
|
|
6380
6366
|
selectedMarkers: [],
|
|
6381
6367
|
type: "textMarker"
|
|
6382
6368
|
};
|
|
6383
6369
|
}
|
|
6384
|
-
function
|
|
6370
|
+
function Ul(e) {
|
|
6385
6371
|
return e.reduce((e, t) => k(k({}, e), {}, { [t]: "" }), {});
|
|
6386
6372
|
}
|
|
6387
|
-
function
|
|
6373
|
+
function Wl(e, t) {
|
|
6388
6374
|
return t.reduce((t, n) => k(k({}, t), {}, { [n]: e.config.candidateMode === "none" ? {
|
|
6389
6375
|
kind: "text",
|
|
6390
6376
|
value: ""
|
|
@@ -6393,15 +6379,15 @@ function Kl(e, t) {
|
|
|
6393
6379
|
optionIds: []
|
|
6394
6380
|
} }), {});
|
|
6395
6381
|
}
|
|
6396
|
-
function
|
|
6382
|
+
function Gl(e, t, n) {
|
|
6397
6383
|
return e.items.find((e) => e.elementKey === t && e.type === n);
|
|
6398
6384
|
}
|
|
6399
|
-
function
|
|
6385
|
+
function Kl(e, t, n) {
|
|
6400
6386
|
return n === "single" ? e.includes(t) ? [] : [t] : e.includes(t) ? e.filter((e) => e !== t) : [...e, t];
|
|
6401
6387
|
}
|
|
6402
6388
|
//#endregion
|
|
6403
6389
|
//#region src/question/i18n/messages.ts
|
|
6404
|
-
var
|
|
6390
|
+
var ql = {
|
|
6405
6391
|
"en-US": {
|
|
6406
6392
|
addBlank: "Add blank",
|
|
6407
6393
|
addCard: "Add card",
|
|
@@ -6531,53 +6517,53 @@ var Yl = {
|
|
|
6531
6517
|
previewEmpty: "\u6682\u65e0\u9898\u76ee\u5185\u5bb9\u3002"
|
|
6532
6518
|
}
|
|
6533
6519
|
};
|
|
6534
|
-
function
|
|
6520
|
+
function Jl(e = "zh-CN") {
|
|
6535
6521
|
switch (e) {
|
|
6536
|
-
case "en-US": return
|
|
6537
|
-
case "zh-CN": return
|
|
6522
|
+
case "en-US": return ql["en-US"];
|
|
6523
|
+
case "zh-CN": return ql["zh-CN"];
|
|
6538
6524
|
}
|
|
6539
6525
|
}
|
|
6540
6526
|
//#endregion
|
|
6541
6527
|
//#region src/question/renderers/helpers.ts
|
|
6542
|
-
function
|
|
6528
|
+
function Yl(...e) {
|
|
6543
6529
|
return e.filter(Boolean).join(" ");
|
|
6544
6530
|
}
|
|
6545
|
-
function
|
|
6531
|
+
function Xl(e, t, n) {
|
|
6546
6532
|
return e.map((e) => t.indexOf(e) + 1).filter((e) => e > 0).map((e) => `${n}${e}`).join(" ");
|
|
6547
6533
|
}
|
|
6548
|
-
function
|
|
6534
|
+
function Zl(e) {
|
|
6549
6535
|
return "answerPools" in e;
|
|
6550
6536
|
}
|
|
6551
|
-
function
|
|
6537
|
+
function Ql(e) {
|
|
6552
6538
|
return "answerOptionId" in e;
|
|
6553
6539
|
}
|
|
6554
|
-
function
|
|
6540
|
+
function $l(e) {
|
|
6555
6541
|
return "answerOptionIds" in e;
|
|
6556
6542
|
}
|
|
6557
|
-
function
|
|
6543
|
+
function eu(e, t) {
|
|
6558
6544
|
var n, r;
|
|
6559
6545
|
return (n = e == null || (r = e.find((e) => e.optionId === t)) == null ? void 0 : r.content) == null ? null : n;
|
|
6560
6546
|
}
|
|
6561
|
-
function
|
|
6547
|
+
function tu(e, t, n) {
|
|
6562
6548
|
var r, i;
|
|
6563
6549
|
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;
|
|
6564
6550
|
}
|
|
6565
|
-
function
|
|
6551
|
+
function nu(e) {
|
|
6566
6552
|
return e.answer.reduce((t, n) => {
|
|
6567
|
-
if (
|
|
6553
|
+
if (Zl(n)) return ru(t, {
|
|
6568
6554
|
blankIds: n.blankIds,
|
|
6569
6555
|
contents: n.answerPools
|
|
6570
6556
|
});
|
|
6571
|
-
if (
|
|
6572
|
-
let r =
|
|
6573
|
-
return
|
|
6557
|
+
if (Ql(n)) {
|
|
6558
|
+
let r = tu(e.blankOptionGroups, n.blankId, n.answerOptionId);
|
|
6559
|
+
return ru(t, {
|
|
6574
6560
|
blankIds: [n.blankId],
|
|
6575
6561
|
contents: r ? [r] : []
|
|
6576
6562
|
});
|
|
6577
6563
|
}
|
|
6578
|
-
if (
|
|
6579
|
-
let r = n.answerOptionIds.map((t) =>
|
|
6580
|
-
return
|
|
6564
|
+
if ($l(n)) {
|
|
6565
|
+
let r = n.answerOptionIds.map((t) => eu(e.candidateOptions, t)).filter((e) => !!e);
|
|
6566
|
+
return ru(t, {
|
|
6581
6567
|
blankIds: n.blankIds,
|
|
6582
6568
|
contents: r
|
|
6583
6569
|
});
|
|
@@ -6585,8 +6571,8 @@ function iu(e) {
|
|
|
6585
6571
|
return t;
|
|
6586
6572
|
}, []);
|
|
6587
6573
|
}
|
|
6588
|
-
function
|
|
6589
|
-
let n = t.contents.filter((e) => e.
|
|
6574
|
+
function ru(e, t) {
|
|
6575
|
+
let n = t.contents.filter((e) => e.text.trim() !== "");
|
|
6590
6576
|
return n.length > 0 ? [...e, {
|
|
6591
6577
|
blankIds: t.blankIds,
|
|
6592
6578
|
contents: n
|
|
@@ -6609,14 +6595,14 @@ var W = {
|
|
|
6609
6595
|
};
|
|
6610
6596
|
//#endregion
|
|
6611
6597
|
//#region src/question/player/QuestionPlayerComposite.tsx
|
|
6612
|
-
function
|
|
6598
|
+
function iu({ messages: e, numberPath: t = [], onChildResponseChange: n, renderChild: r, response: i, subquestionTemplates: s, value: c }) {
|
|
6613
6599
|
return c.children.length === 0 ? /* @__PURE__ */ a("div", {
|
|
6614
6600
|
className: W.empty,
|
|
6615
6601
|
children: e.previewEmpty
|
|
6616
6602
|
}) : /* @__PURE__ */ a("div", {
|
|
6617
6603
|
className: W.children,
|
|
6618
6604
|
children: c.children.map((c, l) => {
|
|
6619
|
-
let u = [...t, l], d =
|
|
6605
|
+
let u = [...t, l], d = Rc(s, c.questionTypeKey), f = i.children.slice(l, l + 1)[0];
|
|
6620
6606
|
return /* @__PURE__ */ o("section", {
|
|
6621
6607
|
className: W.child,
|
|
6622
6608
|
children: [/* @__PURE__ */ o("div", {
|
|
@@ -6624,7 +6610,7 @@ function ou({ messages: e, numberPath: t = [], onChildResponseChange: n, renderC
|
|
|
6624
6610
|
children: [
|
|
6625
6611
|
e.subquestion,
|
|
6626
6612
|
" ",
|
|
6627
|
-
|
|
6613
|
+
Nc(u)
|
|
6628
6614
|
]
|
|
6629
6615
|
}), d && f ? r(c, f, d.structure, (e) => n(l, e), u) : /* @__PURE__ */ a("div", {
|
|
6630
6616
|
className: W.empty,
|
|
@@ -6652,7 +6638,7 @@ var G = {
|
|
|
6652
6638
|
//#endregion
|
|
6653
6639
|
//#region src/question/renderers/QuestionRichContentView.tsx
|
|
6654
6640
|
function K({ className: e, content: t }) {
|
|
6655
|
-
let n = t.
|
|
6641
|
+
let n = t.html || r(mi(t), { plugins: [Jr] });
|
|
6656
6642
|
return /* @__PURE__ */ a("div", {
|
|
6657
6643
|
className: e ? `${G["rich-content"]} ${e}` : G["rich-content"],
|
|
6658
6644
|
dangerouslySetInnerHTML: { __html: n }
|
|
@@ -6660,7 +6646,7 @@ function K({ className: e, content: t }) {
|
|
|
6660
6646
|
}
|
|
6661
6647
|
//#endregion
|
|
6662
6648
|
//#region src/question/renderers/QuestionStandardAnswerPanel.module.css
|
|
6663
|
-
var
|
|
6649
|
+
var au = {
|
|
6664
6650
|
"answer-panel": "_answer-panel_1a0m0_1",
|
|
6665
6651
|
"answer-title": "_answer-title_1a0m0_12",
|
|
6666
6652
|
"answer-list": "_answer-list_1a0m0_30",
|
|
@@ -6675,21 +6661,21 @@ function q({ groups: e, title: t }) {
|
|
|
6675
6661
|
let n = e.filter((e) => e.contents.length > 0);
|
|
6676
6662
|
return n.length === 0 ? null : /* @__PURE__ */ o("section", {
|
|
6677
6663
|
"aria-label": t,
|
|
6678
|
-
className:
|
|
6664
|
+
className: au["answer-panel"],
|
|
6679
6665
|
children: [/* @__PURE__ */ a("span", {
|
|
6680
|
-
className:
|
|
6666
|
+
className: au["answer-title"],
|
|
6681
6667
|
children: t
|
|
6682
6668
|
}), /* @__PURE__ */ a("ol", {
|
|
6683
|
-
className:
|
|
6669
|
+
className: au["answer-list"],
|
|
6684
6670
|
children: n.map((e, t) => /* @__PURE__ */ o("li", {
|
|
6685
|
-
className:
|
|
6671
|
+
className: au["answer-row"],
|
|
6686
6672
|
children: [e.marker ? /* @__PURE__ */ a("span", {
|
|
6687
|
-
className:
|
|
6673
|
+
className: au["answer-marker"],
|
|
6688
6674
|
children: e.marker
|
|
6689
6675
|
}) : null, /* @__PURE__ */ a("div", {
|
|
6690
|
-
className:
|
|
6676
|
+
className: au["answer-content-list"],
|
|
6691
6677
|
children: e.contents.map((e, t) => /* @__PURE__ */ a("div", {
|
|
6692
|
-
className:
|
|
6678
|
+
className: au["answer-value"],
|
|
6693
6679
|
children: e
|
|
6694
6680
|
}, `answer-${t}`))
|
|
6695
6681
|
})]
|
|
@@ -6699,10 +6685,10 @@ function q({ groups: e, title: t }) {
|
|
|
6699
6685
|
}
|
|
6700
6686
|
//#endregion
|
|
6701
6687
|
//#region src/question/player/QuestionBlankGroupPlayer.tsx
|
|
6702
|
-
function
|
|
6703
|
-
let c =
|
|
6688
|
+
function ou({ disabled: e, item: t, messages: n, onChange: r, response: i, showAnswer: s }) {
|
|
6689
|
+
let c = dl(i, t.elementKey, t.blanks), l = Ki(t.answer, t.blanks).map((e, r) => ({
|
|
6704
6690
|
contents: e.answerPools.map((e, t) => /* @__PURE__ */ a(K, { content: e }, `group-${r}-answer-${t}`)),
|
|
6705
|
-
marker:
|
|
6691
|
+
marker: Xl(e.blankIds, t.blanks, n.blankLabel)
|
|
6706
6692
|
}));
|
|
6707
6693
|
function u(e, t) {
|
|
6708
6694
|
r(k(k({}, c), {}, { answers: k(k({}, c.answers), {}, { [e]: t }) }));
|
|
@@ -6722,27 +6708,27 @@ function cu({ disabled: e, item: t, messages: n, onChange: r, response: i, showA
|
|
|
6722
6708
|
className: W.input,
|
|
6723
6709
|
disabled: e,
|
|
6724
6710
|
onChange: (e) => u(t, e.target.value),
|
|
6725
|
-
value:
|
|
6711
|
+
value: cu(c.answers, t)
|
|
6726
6712
|
})]
|
|
6727
|
-
},
|
|
6713
|
+
}, su(t, r))), s ? /* @__PURE__ */ a(q, {
|
|
6728
6714
|
groups: l,
|
|
6729
6715
|
title: n.standardAnswer
|
|
6730
6716
|
}) : null]
|
|
6731
6717
|
});
|
|
6732
6718
|
}
|
|
6733
|
-
function
|
|
6719
|
+
function su(e, t) {
|
|
6734
6720
|
return e || `blank-${t + 1}`;
|
|
6735
6721
|
}
|
|
6736
|
-
function
|
|
6722
|
+
function cu(e, t) {
|
|
6737
6723
|
var n, r;
|
|
6738
6724
|
return (n = (r = Object.entries(e).find(([e]) => e === t)) == null ? void 0 : r[1]) == null ? "" : n;
|
|
6739
6725
|
}
|
|
6740
6726
|
//#endregion
|
|
6741
6727
|
//#region src/question/renderers/classificationAnswers.tsx
|
|
6742
|
-
function
|
|
6728
|
+
function lu(e) {
|
|
6743
6729
|
return e.categories.map((t) => ({
|
|
6744
6730
|
contents: e.items.filter((n) => e.answer[n.id] === t.id).map((e) => /* @__PURE__ */ a(K, { content: e.content }, `${t.id}-${e.id}`)),
|
|
6745
|
-
marker: t.content.
|
|
6731
|
+
marker: t.content.text || t.id
|
|
6746
6732
|
}));
|
|
6747
6733
|
}
|
|
6748
6734
|
var J = {
|
|
@@ -6760,10 +6746,10 @@ var J = {
|
|
|
6760
6746
|
};
|
|
6761
6747
|
//#endregion
|
|
6762
6748
|
//#region src/question/player/QuestionClassificationPlayer.tsx
|
|
6763
|
-
function
|
|
6764
|
-
let [c, l] = m(""), u =
|
|
6749
|
+
function uu({ disabled: e, item: t, messages: n, onChange: r, response: i, showAnswer: s }) {
|
|
6750
|
+
let [c, l] = m(""), u = hl(i, t.elementKey), d = fu(u.placements, t), f = t.items.find((e) => e.id === c);
|
|
6765
6751
|
function p(e, n) {
|
|
6766
|
-
r(k(k({}, u), {}, { placements:
|
|
6752
|
+
r(k(k({}, u), {}, { placements: fu(El(d, e, n), t) })), l("");
|
|
6767
6753
|
}
|
|
6768
6754
|
function h(t, n) {
|
|
6769
6755
|
t.preventDefault();
|
|
@@ -6771,10 +6757,10 @@ function fu({ disabled: e, item: t, messages: n, onChange: r, response: i, showA
|
|
|
6771
6757
|
!e && r && p(r, n);
|
|
6772
6758
|
}
|
|
6773
6759
|
function g(n) {
|
|
6774
|
-
let r = c === n.id, i =
|
|
6760
|
+
let r = c === n.id, i = du(n.id, d, t, s);
|
|
6775
6761
|
return /* @__PURE__ */ a("button", {
|
|
6776
6762
|
"aria-pressed": r,
|
|
6777
|
-
className:
|
|
6763
|
+
className: Yl(J.item, r && J.selected, i === "correct" && J.correct, i === "incorrect" && J.incorrect, i === "unanswered" && J.unanswered),
|
|
6778
6764
|
"data-status": i,
|
|
6779
6765
|
"data-testid": `classification-player-item-${n.id}`,
|
|
6780
6766
|
disabled: e,
|
|
@@ -6821,62 +6807,62 @@ function fu({ disabled: e, item: t, messages: n, onChange: r, response: i, showA
|
|
|
6821
6807
|
children: t.items.filter((e) => !d[e.id]).map((e) => g(e))
|
|
6822
6808
|
})]
|
|
6823
6809
|
}), s ? /* @__PURE__ */ a(q, {
|
|
6824
|
-
groups:
|
|
6810
|
+
groups: lu(t),
|
|
6825
6811
|
title: n.standardAnswer
|
|
6826
6812
|
}) : null]
|
|
6827
6813
|
});
|
|
6828
6814
|
}
|
|
6829
|
-
function
|
|
6815
|
+
function du(e, t, n, r) {
|
|
6830
6816
|
var i, a;
|
|
6831
6817
|
let o = (i = t[e]) == null ? "" : i, s = (a = n.answer[e]) == null ? "" : a;
|
|
6832
6818
|
if (!(!r || !s)) return o ? s === o ? "correct" : "incorrect" : "unanswered";
|
|
6833
6819
|
}
|
|
6834
|
-
function
|
|
6820
|
+
function fu(e, t) {
|
|
6835
6821
|
return xe(e, t.categories, t.items);
|
|
6836
6822
|
}
|
|
6837
6823
|
//#endregion
|
|
6838
6824
|
//#region src/question/renderers/QuestionRichContentWithBlankView.tsx
|
|
6839
|
-
function
|
|
6825
|
+
function pu({ className: e, content: t, renderBlank: n }) {
|
|
6840
6826
|
let r = /* @__PURE__ */ new Map();
|
|
6841
6827
|
return /* @__PURE__ */ a("div", {
|
|
6842
6828
|
className: [G["rich-content"], e == null ? "" : e].filter(Boolean).join(" "),
|
|
6843
|
-
children: t.
|
|
6829
|
+
children: t.json.map((e, t) => mu(e, {
|
|
6844
6830
|
blankIndexes: r,
|
|
6845
6831
|
key: `node-${t}`,
|
|
6846
6832
|
renderBlank: n
|
|
6847
6833
|
}))
|
|
6848
6834
|
});
|
|
6849
6835
|
}
|
|
6850
|
-
function
|
|
6836
|
+
function mu(e, t) {
|
|
6851
6837
|
if (typeof e.text == "string") return /* @__PURE__ */ a(s, { children: e.text }, t.key);
|
|
6852
|
-
if (e.type === "blank") return /* @__PURE__ */ a(s, { children:
|
|
6853
|
-
let n =
|
|
6838
|
+
if (e.type === "blank") return /* @__PURE__ */ a(s, { children: hu(e, t) }, t.key);
|
|
6839
|
+
let n = _u(e.children, t);
|
|
6854
6840
|
switch (e.type) {
|
|
6855
|
-
case "heading": return
|
|
6841
|
+
case "heading": return vu(e, n, t.key);
|
|
6856
6842
|
case "table": return /* @__PURE__ */ a("table", { children: n }, t.key);
|
|
6857
6843
|
case "table-row": return /* @__PURE__ */ a("tr", { children: n }, t.key);
|
|
6858
6844
|
case "table-cell": return /* @__PURE__ */ a("td", { children: n }, t.key);
|
|
6859
6845
|
default: return /* @__PURE__ */ a("p", { children: n }, t.key);
|
|
6860
6846
|
}
|
|
6861
6847
|
}
|
|
6862
|
-
function
|
|
6863
|
-
let n =
|
|
6848
|
+
function hu(e, t) {
|
|
6849
|
+
let n = yu(e.blankId), r = gu(t.blankIndexes, n);
|
|
6864
6850
|
return t.renderBlank({
|
|
6865
6851
|
blankId: n,
|
|
6866
6852
|
index: r,
|
|
6867
|
-
label:
|
|
6853
|
+
label: yu(e.label)
|
|
6868
6854
|
});
|
|
6869
6855
|
}
|
|
6870
|
-
function
|
|
6856
|
+
function gu(e, t) {
|
|
6871
6857
|
let n = e.get(t);
|
|
6872
6858
|
if (n !== void 0) return n;
|
|
6873
6859
|
let r = e.size;
|
|
6874
6860
|
return e.set(t, r), r;
|
|
6875
6861
|
}
|
|
6876
|
-
function
|
|
6877
|
-
return (e == null ? [] : e).map((e, n) =>
|
|
6862
|
+
function _u(e, t) {
|
|
6863
|
+
return (e == null ? [] : e).map((e, n) => mu(e, k(k({}, t), {}, { key: `${t.key}-${n}` })));
|
|
6878
6864
|
}
|
|
6879
|
-
function
|
|
6865
|
+
function vu(e, t, n) {
|
|
6880
6866
|
switch (e.level) {
|
|
6881
6867
|
case 1: return /* @__PURE__ */ a("h1", { children: t }, n);
|
|
6882
6868
|
case 2: return /* @__PURE__ */ a("h2", { children: t }, n);
|
|
@@ -6884,7 +6870,7 @@ function bu(e, t, n) {
|
|
|
6884
6870
|
default: return /* @__PURE__ */ a("p", { children: t }, n);
|
|
6885
6871
|
}
|
|
6886
6872
|
}
|
|
6887
|
-
function
|
|
6873
|
+
function yu(e) {
|
|
6888
6874
|
return typeof e == "string" ? e : "";
|
|
6889
6875
|
}
|
|
6890
6876
|
var Y = {
|
|
@@ -6905,10 +6891,10 @@ var Y = {
|
|
|
6905
6891
|
};
|
|
6906
6892
|
//#endregion
|
|
6907
6893
|
//#region src/question/player/QuestionFillTextContentPlayer.tsx
|
|
6908
|
-
function
|
|
6909
|
-
return /* @__PURE__ */ a(
|
|
6894
|
+
function bu({ answers: e, disabled: t, item: n, messages: r, onAnswerChange: i, structure: o }) {
|
|
6895
|
+
return /* @__PURE__ */ a(pu, {
|
|
6910
6896
|
content: n.content,
|
|
6911
|
-
renderBlank: (a) =>
|
|
6897
|
+
renderBlank: (a) => xu(a, {
|
|
6912
6898
|
answers: e,
|
|
6913
6899
|
blankLabel: r.blankLabel,
|
|
6914
6900
|
disabled: t,
|
|
@@ -6918,10 +6904,10 @@ function Su({ answers: e, disabled: t, item: n, messages: r, onAnswerChange: i,
|
|
|
6918
6904
|
})
|
|
6919
6905
|
});
|
|
6920
6906
|
}
|
|
6921
|
-
function
|
|
6922
|
-
let { blankId: n } = e, r = t.item.blanks.indexOf(n), i =
|
|
6907
|
+
function xu(e, t) {
|
|
6908
|
+
let { blankId: n } = e, r = t.item.blanks.indexOf(n), i = Du(e.label, t.blankLabel, r);
|
|
6923
6909
|
if (t.structure.config.candidateMode === "none") {
|
|
6924
|
-
let e =
|
|
6910
|
+
let e = Cu(t.answers, n);
|
|
6925
6911
|
return /* @__PURE__ */ a("input", {
|
|
6926
6912
|
"aria-label": i,
|
|
6927
6913
|
className: Y["inline-input"],
|
|
@@ -6933,8 +6919,8 @@ function Cu(e, t) {
|
|
|
6933
6919
|
value: (e == null ? void 0 : e.kind) === "text" ? e.value : ""
|
|
6934
6920
|
});
|
|
6935
6921
|
}
|
|
6936
|
-
if (t.structure.config.candidateMode === "sharedPool") return
|
|
6937
|
-
let o =
|
|
6922
|
+
if (t.structure.config.candidateMode === "sharedPool") return Su(n, i, t);
|
|
6923
|
+
let o = Cu(t.answers, n), s = Tu(t.item, n, t.structure.config.candidateMode, o);
|
|
6938
6924
|
return /* @__PURE__ */ a("span", {
|
|
6939
6925
|
"aria-label": i,
|
|
6940
6926
|
className: Y["inline-blank-underline"],
|
|
@@ -6944,9 +6930,9 @@ function Cu(e, t) {
|
|
|
6944
6930
|
}) : i
|
|
6945
6931
|
});
|
|
6946
6932
|
}
|
|
6947
|
-
function
|
|
6933
|
+
function Su(e, t, n) {
|
|
6948
6934
|
var r, i;
|
|
6949
|
-
let s =
|
|
6935
|
+
let s = Cu(n.answers, e), c = (r = ((s == null ? void 0 : s.kind) === "option" ? s.optionIds : []).slice(0, 1)[0]) == null ? "" : r, l = Eu(n.answers, e);
|
|
6950
6936
|
return /* @__PURE__ */ o("select", {
|
|
6951
6937
|
"aria-label": t,
|
|
6952
6938
|
className: Y["inline-select"],
|
|
@@ -6962,15 +6948,15 @@ function wu(e, t, n) {
|
|
|
6962
6948
|
}), ((i = n.item.candidateOptions) == null ? [] : i).map((e) => /* @__PURE__ */ a("option", {
|
|
6963
6949
|
disabled: !n.structure.config.allowCandidateReuse && l.has(e.optionId),
|
|
6964
6950
|
value: e.optionId,
|
|
6965
|
-
children: e.content.
|
|
6951
|
+
children: e.content.text
|
|
6966
6952
|
}, e.optionId))]
|
|
6967
6953
|
});
|
|
6968
6954
|
}
|
|
6969
|
-
function
|
|
6955
|
+
function Cu(e, t) {
|
|
6970
6956
|
var n;
|
|
6971
6957
|
return (n = Object.entries(e).find(([e]) => e === t)) == null ? void 0 : n[1];
|
|
6972
6958
|
}
|
|
6973
|
-
function
|
|
6959
|
+
function wu(e, t, n) {
|
|
6974
6960
|
var r, i;
|
|
6975
6961
|
if (n === "sharedPool") {
|
|
6976
6962
|
var a;
|
|
@@ -6978,24 +6964,24 @@ function Eu(e, t, n) {
|
|
|
6978
6964
|
}
|
|
6979
6965
|
return (r = (i = e.blankOptionGroups) == null || (i = i.find((e) => e.blankId === t)) == null ? void 0 : i.options) == null ? [] : r;
|
|
6980
6966
|
}
|
|
6981
|
-
function
|
|
6967
|
+
function Tu(e, t, n, r) {
|
|
6982
6968
|
let i = (r == null ? void 0 : r.kind) === "option" ? r.optionIds[0] : void 0;
|
|
6983
|
-
if (i) return
|
|
6969
|
+
if (i) return wu(e, t, n).find((e) => e.optionId === i);
|
|
6984
6970
|
}
|
|
6985
|
-
function
|
|
6971
|
+
function Eu(e, t) {
|
|
6986
6972
|
let n = /* @__PURE__ */ new Set(), r = Object.entries(e);
|
|
6987
6973
|
for (let [e, i] of r) if (e !== t && i.kind === "option") for (let e of i.optionIds) n.add(e);
|
|
6988
6974
|
return n;
|
|
6989
6975
|
}
|
|
6990
|
-
function
|
|
6976
|
+
function Du(e, t, n) {
|
|
6991
6977
|
return e || `${t} ${n + 1}`;
|
|
6992
6978
|
}
|
|
6993
6979
|
//#endregion
|
|
6994
6980
|
//#region src/question/player/QuestionFillTextPlayer.tsx
|
|
6995
|
-
function
|
|
6996
|
-
let l = ji(n, t, !0), u =
|
|
6981
|
+
function Ou({ disabled: e, element: t, item: n, messages: r, onChange: i, response: s, showAnswer: c }) {
|
|
6982
|
+
let l = ji(n, t, !0), u = nu(l), d = fl(s, t, l.blanks), f = u.map((e, t) => ({
|
|
6997
6983
|
contents: e.contents.map((e, n) => /* @__PURE__ */ a(K, { content: e }, `group-${t}-answer-${n}`)),
|
|
6998
|
-
marker:
|
|
6984
|
+
marker: Xl(e.blankIds, l.blanks, r.blankLabel)
|
|
6999
6985
|
}));
|
|
7000
6986
|
function p(e, t) {
|
|
7001
6987
|
i(k(k({}, d), {}, { answers: k(k({}, d.answers), {}, { [e]: t }) }));
|
|
@@ -7003,7 +6989,7 @@ function Au({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7003
6989
|
return /* @__PURE__ */ o("div", {
|
|
7004
6990
|
className: W["fill-text"],
|
|
7005
6991
|
children: [
|
|
7006
|
-
/* @__PURE__ */ a(
|
|
6992
|
+
/* @__PURE__ */ a(bu, {
|
|
7007
6993
|
answers: d.answers,
|
|
7008
6994
|
disabled: e,
|
|
7009
6995
|
item: l,
|
|
@@ -7011,8 +6997,8 @@ function Au({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7011
6997
|
onAnswerChange: p,
|
|
7012
6998
|
structure: t
|
|
7013
6999
|
}),
|
|
7014
|
-
|
|
7015
|
-
|
|
7000
|
+
ku(l, t.config.candidateMode, r.candidateOptions),
|
|
7001
|
+
Au({
|
|
7016
7002
|
disabled: e,
|
|
7017
7003
|
item: l,
|
|
7018
7004
|
onAnswerChange: p,
|
|
@@ -7025,7 +7011,7 @@ function Au({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7025
7011
|
]
|
|
7026
7012
|
});
|
|
7027
7013
|
}
|
|
7028
|
-
function
|
|
7014
|
+
function ku(e, t, n) {
|
|
7029
7015
|
var r;
|
|
7030
7016
|
let i = (r = e.candidateOptions) == null ? [] : r;
|
|
7031
7017
|
return t !== "sharedPool" || i.length === 0 ? null : /* @__PURE__ */ o("div", {
|
|
@@ -7045,7 +7031,7 @@ function ju(e, t, n) {
|
|
|
7045
7031
|
})]
|
|
7046
7032
|
});
|
|
7047
7033
|
}
|
|
7048
|
-
function
|
|
7034
|
+
function Au({ disabled: e, item: t, onAnswerChange: n, responseItem: r }) {
|
|
7049
7035
|
let i = t.blanks.reduce((e, n, r) => {
|
|
7050
7036
|
var i;
|
|
7051
7037
|
let a = (i = t.blankOptionGroups) == null ? void 0 : i.find((e) => e.blankId === n);
|
|
@@ -7056,7 +7042,7 @@ function Mu({ disabled: e, item: t, onAnswerChange: n, responseItem: r }) {
|
|
|
7056
7042
|
}, []);
|
|
7057
7043
|
return i.length === 0 ? null : /* @__PURE__ */ a("div", {
|
|
7058
7044
|
className: Y["per-blank-candidate-options"],
|
|
7059
|
-
children: i.map(({ group: t, marker: i }) =>
|
|
7045
|
+
children: i.map(({ group: t, marker: i }) => ju({
|
|
7060
7046
|
disabled: e,
|
|
7061
7047
|
group: t,
|
|
7062
7048
|
marker: i,
|
|
@@ -7065,7 +7051,7 @@ function Mu({ disabled: e, item: t, onAnswerChange: n, responseItem: r }) {
|
|
|
7065
7051
|
}))
|
|
7066
7052
|
});
|
|
7067
7053
|
}
|
|
7068
|
-
function
|
|
7054
|
+
function ju({ disabled: e, group: t, marker: n, onAnswerChange: r, responseItem: i }) {
|
|
7069
7055
|
let s = i.answers[t.blankId];
|
|
7070
7056
|
return /* @__PURE__ */ o("section", {
|
|
7071
7057
|
"aria-label": n,
|
|
@@ -7075,7 +7061,7 @@ function Nu({ disabled: e, group: t, marker: n, onAnswerChange: r, responseItem:
|
|
|
7075
7061
|
children: n
|
|
7076
7062
|
}), /* @__PURE__ */ a("div", {
|
|
7077
7063
|
className: Y["per-blank-candidate-list"],
|
|
7078
|
-
children: t.options.map((n) =>
|
|
7064
|
+
children: t.options.map((n) => Mu({
|
|
7079
7065
|
activeAnswer: s,
|
|
7080
7066
|
blankId: t.blankId,
|
|
7081
7067
|
disabled: e,
|
|
@@ -7085,14 +7071,14 @@ function Nu({ disabled: e, group: t, marker: n, onAnswerChange: r, responseItem:
|
|
|
7085
7071
|
})]
|
|
7086
7072
|
}, t.blankId);
|
|
7087
7073
|
}
|
|
7088
|
-
function
|
|
7074
|
+
function Mu({ activeAnswer: e, blankId: t, disabled: n, onAnswerChange: r, option: i }) {
|
|
7089
7075
|
let o = (e == null ? void 0 : e.kind) === "option" && e.optionIds.includes(i.optionId);
|
|
7090
7076
|
return /* @__PURE__ */ a("button", {
|
|
7091
7077
|
"aria-pressed": o,
|
|
7092
7078
|
className: o ? Y.selected : void 0,
|
|
7093
7079
|
"data-selected": o ? "true" : void 0,
|
|
7094
7080
|
disabled: n,
|
|
7095
|
-
onClick: () => r(t,
|
|
7081
|
+
onClick: () => r(t, Cl(e, i.optionId, "single")),
|
|
7096
7082
|
type: "button",
|
|
7097
7083
|
children: /* @__PURE__ */ a(K, { content: i.content })
|
|
7098
7084
|
}, i.optionId);
|
|
@@ -7113,8 +7099,8 @@ var X = {
|
|
|
7113
7099
|
};
|
|
7114
7100
|
//#endregion
|
|
7115
7101
|
//#region src/question/player/QuestionJudgementGroupPlayer.tsx
|
|
7116
|
-
function
|
|
7117
|
-
let l =
|
|
7102
|
+
function Nu({ disabled: e, element: t, item: n, messages: r, onChange: i, response: s, showAnswer: c }) {
|
|
7103
|
+
let l = ml(s, t.elementKey), u = yi(t.config.judgeAnswerMode), d = [{
|
|
7118
7104
|
contents: n.answer.filter((e) => e.trim() !== ""),
|
|
7119
7105
|
marker: ""
|
|
7120
7106
|
}];
|
|
@@ -7124,11 +7110,11 @@ function Fu({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7124
7110
|
return /* @__PURE__ */ o("div", {
|
|
7125
7111
|
className: G.element,
|
|
7126
7112
|
children: [/* @__PURE__ */ a("ol", {
|
|
7127
|
-
className:
|
|
7113
|
+
className: Yl(G["judgement-list"], X["judgement-list"]),
|
|
7128
7114
|
children: u.map((t) => {
|
|
7129
7115
|
let n = l.selectedValues.includes(t);
|
|
7130
7116
|
return /* @__PURE__ */ a("li", {
|
|
7131
|
-
className:
|
|
7117
|
+
className: Yl(G["judgement-item"], X["judgement-option"], n && X.selected),
|
|
7132
7118
|
"data-selected": n ? "true" : void 0,
|
|
7133
7119
|
children: /* @__PURE__ */ a("button", {
|
|
7134
7120
|
"aria-pressed": n,
|
|
@@ -7148,8 +7134,8 @@ function Fu({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7148
7134
|
}
|
|
7149
7135
|
//#endregion
|
|
7150
7136
|
//#region src/question/renderers/lineConnectAnswers.tsx
|
|
7151
|
-
function
|
|
7152
|
-
let t =
|
|
7137
|
+
function Pu(e) {
|
|
7138
|
+
let t = Fu(e);
|
|
7153
7139
|
return e.columns.reduce((n, r, i) => {
|
|
7154
7140
|
let o = r.items.map((n, o) => {
|
|
7155
7141
|
var s;
|
|
@@ -7164,7 +7150,7 @@ function Iu(e) {
|
|
|
7164
7150
|
return [...n, ...o];
|
|
7165
7151
|
}, []);
|
|
7166
7152
|
}
|
|
7167
|
-
function
|
|
7153
|
+
function Fu(e) {
|
|
7168
7154
|
return e.columns.reduce((e, t, n) => (t.items.forEach((t) => e.set(t.itemId, {
|
|
7169
7155
|
columnIndex: n,
|
|
7170
7156
|
item: t
|
|
@@ -7172,8 +7158,8 @@ function Lu(e) {
|
|
|
7172
7158
|
}
|
|
7173
7159
|
//#endregion
|
|
7174
7160
|
//#region src/question/player/QuestionLineConnectPlayer.tsx
|
|
7175
|
-
function
|
|
7176
|
-
let [c, u] = m(null), [h, g] = m(null), _ = p(null), v = p(/* @__PURE__ */ new Map()), y =
|
|
7161
|
+
function Iu({ disabled: e, item: t, messages: n, onChange: r, response: i, showAnswer: s }) {
|
|
7162
|
+
let [c, u] = m(null), [h, g] = m(null), _ = p(null), v = p(/* @__PURE__ */ new Map()), y = gl(i, t.elementKey), b = { gridTemplateColumns: `repeat(${t.columns.length}, minmax(12rem, 1fr))` }, x = f(() => Ys(t, y.connections), [t, y.connections]), S = f(() => JSON.stringify({
|
|
7177
7163
|
columns: t.columns.map((e) => e.items.map((e) => e.itemId)),
|
|
7178
7164
|
connections: y.connections
|
|
7179
7165
|
}), [t.columns, y.connections]), C = l(() => {
|
|
@@ -7188,13 +7174,13 @@ function Ru({ disabled: e, item: t, messages: n, onChange: r, response: i, showA
|
|
|
7188
7174
|
let o = i.getBoundingClientRect(), s = a.getBoundingClientRect();
|
|
7189
7175
|
return [...n, {
|
|
7190
7176
|
key: r.key,
|
|
7191
|
-
x1:
|
|
7192
|
-
x2:
|
|
7193
|
-
y1:
|
|
7194
|
-
y2:
|
|
7177
|
+
x1: $s(o, t, e.scrollLeft),
|
|
7178
|
+
x2: Qs(s, t, e.scrollLeft),
|
|
7179
|
+
y1: Zs(o, t, e.scrollTop),
|
|
7180
|
+
y2: Zs(s, t, e.scrollTop)
|
|
7195
7181
|
}];
|
|
7196
7182
|
}, []);
|
|
7197
|
-
|
|
7183
|
+
ec(g, {
|
|
7198
7184
|
height: e.scrollHeight,
|
|
7199
7185
|
lines: n,
|
|
7200
7186
|
width: e.scrollWidth
|
|
@@ -7224,7 +7210,7 @@ function Ru({ disabled: e, item: t, messages: n, onChange: r, response: i, showA
|
|
|
7224
7210
|
itemId: n
|
|
7225
7211
|
}) : null;
|
|
7226
7212
|
if (i) {
|
|
7227
|
-
r(k(k({}, y), {}, { connections:
|
|
7213
|
+
r(k(k({}, y), {}, { connections: wl(y.connections, i.fromItemId, i.toItemId) })), u(null);
|
|
7228
7214
|
return;
|
|
7229
7215
|
}
|
|
7230
7216
|
u({
|
|
@@ -7269,7 +7255,7 @@ function Ru({ disabled: e, item: t, messages: n, onChange: r, response: i, showA
|
|
|
7269
7255
|
}), t.items.map((n, i) => {
|
|
7270
7256
|
let s = _i(t.labelStyle, i), l = (c == null ? void 0 : c.itemId) === n.itemId;
|
|
7271
7257
|
return /* @__PURE__ */ a("div", {
|
|
7272
|
-
className:
|
|
7258
|
+
className: Yl(V.item, l && V.selected),
|
|
7273
7259
|
"data-selected": l ? "true" : void 0,
|
|
7274
7260
|
"data-testid": `line-connect-player-item-${n.itemId}`,
|
|
7275
7261
|
ref: w(n.itemId),
|
|
@@ -7289,14 +7275,14 @@ function Ru({ disabled: e, item: t, messages: n, onChange: r, response: i, showA
|
|
|
7289
7275
|
}, t.columnId))
|
|
7290
7276
|
})]
|
|
7291
7277
|
}), s ? /* @__PURE__ */ a(q, {
|
|
7292
|
-
groups:
|
|
7278
|
+
groups: Pu(t),
|
|
7293
7279
|
title: n.standardAnswer
|
|
7294
7280
|
}) : null]
|
|
7295
7281
|
});
|
|
7296
7282
|
}
|
|
7297
7283
|
//#endregion
|
|
7298
7284
|
//#region src/question/renderers/matchingAnswers.tsx
|
|
7299
|
-
function
|
|
7285
|
+
function Lu(e) {
|
|
7300
7286
|
var t, n;
|
|
7301
7287
|
let r = e.columns[0], i = e.columns[1], o = new Map((t = i == null ? void 0 : i.items.map((e) => [e.itemId, e])) == null ? [] : t);
|
|
7302
7288
|
return ((n = r == null ? void 0 : r.items) == null ? [] : n).map((t, n) => {
|
|
@@ -7310,7 +7296,7 @@ function zu(e) {
|
|
|
7310
7296
|
};
|
|
7311
7297
|
});
|
|
7312
7298
|
}
|
|
7313
|
-
var
|
|
7299
|
+
var Ru = {
|
|
7314
7300
|
board: "_board_1q6ar_1",
|
|
7315
7301
|
"matched-rows": "_matched-rows_1q6ar_6",
|
|
7316
7302
|
"matched-row": "_matched-row_1q6ar_6",
|
|
@@ -7323,8 +7309,8 @@ var Bu = {
|
|
|
7323
7309
|
};
|
|
7324
7310
|
//#endregion
|
|
7325
7311
|
//#region src/question/player/QuestionMatchingPlayer.tsx
|
|
7326
|
-
function
|
|
7327
|
-
let [c, l] = m(null), u =
|
|
7312
|
+
function zu({ disabled: e, item: t, messages: n, onChange: r, response: i, showAnswer: s }) {
|
|
7313
|
+
let [c, l] = m(null), u = _l(i, t.elementKey), d = Bu(t, u.connections);
|
|
7328
7314
|
function f(t, n) {
|
|
7329
7315
|
if (e) return;
|
|
7330
7316
|
let i = c ? ot(c, {
|
|
@@ -7332,7 +7318,7 @@ function Vu({ disabled: e, item: t, messages: n, onChange: r, response: i, showA
|
|
|
7332
7318
|
itemId: n
|
|
7333
7319
|
}) : null;
|
|
7334
7320
|
if (i) {
|
|
7335
|
-
r(k(k({}, u), {}, { connections:
|
|
7321
|
+
r(k(k({}, u), {}, { connections: Tl(u.connections, i.fromItemId, i.toItemId) })), l(null);
|
|
7336
7322
|
return;
|
|
7337
7323
|
}
|
|
7338
7324
|
l((c == null ? void 0 : c.itemId) === n ? null : {
|
|
@@ -7344,13 +7330,13 @@ function Vu({ disabled: e, item: t, messages: n, onChange: r, response: i, showA
|
|
|
7344
7330
|
let r = (c == null ? void 0 : c.itemId) === t.item.itemId;
|
|
7345
7331
|
return /* @__PURE__ */ o("button", {
|
|
7346
7332
|
"aria-pressed": r,
|
|
7347
|
-
className:
|
|
7333
|
+
className: Yl(Ru.item, r && Ru.selected, n && Ru.matched),
|
|
7348
7334
|
"data-testid": `matching-player-item-${t.item.itemId}`,
|
|
7349
7335
|
disabled: e,
|
|
7350
7336
|
onClick: () => f(t.columnIndex, t.item.itemId),
|
|
7351
7337
|
type: "button",
|
|
7352
7338
|
children: [t.marker ? /* @__PURE__ */ a("span", {
|
|
7353
|
-
className:
|
|
7339
|
+
className: Ru.marker,
|
|
7354
7340
|
children: t.marker
|
|
7355
7341
|
}) : null, /* @__PURE__ */ a(K, { content: t.item.content })]
|
|
7356
7342
|
}, t.item.itemId);
|
|
@@ -7358,31 +7344,31 @@ function Vu({ disabled: e, item: t, messages: n, onChange: r, response: i, showA
|
|
|
7358
7344
|
return /* @__PURE__ */ o("div", {
|
|
7359
7345
|
className: G.element,
|
|
7360
7346
|
children: [/* @__PURE__ */ o("div", {
|
|
7361
|
-
className:
|
|
7347
|
+
className: Ru.board,
|
|
7362
7348
|
children: [d.rows.length > 0 ? /* @__PURE__ */ a("div", {
|
|
7363
|
-
className:
|
|
7349
|
+
className: Ru["matched-rows"],
|
|
7364
7350
|
children: d.rows.map((e) => /* @__PURE__ */ o("div", {
|
|
7365
|
-
className:
|
|
7351
|
+
className: Ru["matched-row"],
|
|
7366
7352
|
"data-testid": `matching-player-row-${e.from.item.itemId}-${e.to.item.itemId}`,
|
|
7367
7353
|
children: [p(e.from, !0), p(e.to, !0)]
|
|
7368
7354
|
}, `${e.from.item.itemId}-${e.to.item.itemId}`))
|
|
7369
7355
|
}) : null, d.unmatchedColumns.some((e) => e.length > 0) ? /* @__PURE__ */ a("div", {
|
|
7370
|
-
className:
|
|
7356
|
+
className: Ru.columns,
|
|
7371
7357
|
children: d.unmatchedColumns.map((e, n) => {
|
|
7372
7358
|
var r, i;
|
|
7373
7359
|
return /* @__PURE__ */ a("section", {
|
|
7374
|
-
className:
|
|
7360
|
+
className: Ru.column,
|
|
7375
7361
|
children: e.map((e) => p(e, !1))
|
|
7376
7362
|
}, (r = (i = t.columns[n]) == null ? void 0 : i.columnId) == null ? n : r);
|
|
7377
7363
|
})
|
|
7378
7364
|
}) : null]
|
|
7379
7365
|
}), s ? /* @__PURE__ */ a(q, {
|
|
7380
|
-
groups:
|
|
7366
|
+
groups: Lu(t),
|
|
7381
7367
|
title: n.standardAnswer
|
|
7382
7368
|
}) : null]
|
|
7383
7369
|
});
|
|
7384
7370
|
}
|
|
7385
|
-
function
|
|
7371
|
+
function Bu(e, t) {
|
|
7386
7372
|
var n;
|
|
7387
7373
|
let r = e.columns.map((e, t) => e.items.map((n, r) => ({
|
|
7388
7374
|
columnIndex: t,
|
|
@@ -7403,7 +7389,7 @@ function Hu(e, t) {
|
|
|
7403
7389
|
}
|
|
7404
7390
|
//#endregion
|
|
7405
7391
|
//#region src/question/renderers/optionGroupAnswers.tsx
|
|
7406
|
-
function
|
|
7392
|
+
function Vu(e, t) {
|
|
7407
7393
|
var n;
|
|
7408
7394
|
if (e.config.renderer === "table") {
|
|
7409
7395
|
let n = ca(t);
|
|
@@ -7424,7 +7410,7 @@ function Uu(e, t) {
|
|
|
7424
7410
|
};
|
|
7425
7411
|
});
|
|
7426
7412
|
}
|
|
7427
|
-
var
|
|
7413
|
+
var Hu = {
|
|
7428
7414
|
"table-wrap": "_table-wrap_n67ah_1",
|
|
7429
7415
|
table: "_table_n67ah_1",
|
|
7430
7416
|
"table-option-column": "_table-option-column_n67ah_17",
|
|
@@ -7432,22 +7418,22 @@ var Wu = {
|
|
|
7432
7418
|
};
|
|
7433
7419
|
//#endregion
|
|
7434
7420
|
//#region src/question/player/QuestionOptionGroupPlayer.tsx
|
|
7435
|
-
function
|
|
7421
|
+
function Uu({ disabled: e, element: t, item: n, messages: r, onChange: i, response: s, showAnswer: c }) {
|
|
7436
7422
|
var l;
|
|
7437
|
-
let u =
|
|
7423
|
+
let u = ul(s, t.elementKey);
|
|
7438
7424
|
function d(e) {
|
|
7439
|
-
i(k(k({}, u), {}, { selectedIndexes:
|
|
7425
|
+
i(k(k({}, u), {}, { selectedIndexes: Sl(u.selectedIndexes, e, t.config.selectionType) }));
|
|
7440
7426
|
}
|
|
7441
7427
|
if (t.config.renderer === "table") {
|
|
7442
|
-
let i = ca(n), s =
|
|
7428
|
+
let i = ca(n), s = Vu(t, n);
|
|
7443
7429
|
return /* @__PURE__ */ o("div", {
|
|
7444
7430
|
className: G.element,
|
|
7445
7431
|
children: [/* @__PURE__ */ a("div", {
|
|
7446
|
-
className:
|
|
7432
|
+
className: Hu["table-wrap"],
|
|
7447
7433
|
children: /* @__PURE__ */ o("table", {
|
|
7448
|
-
className:
|
|
7434
|
+
className: Hu.table,
|
|
7449
7435
|
children: [
|
|
7450
|
-
/* @__PURE__ */ o("colgroup", { children: [/* @__PURE__ */ a("col", { className:
|
|
7436
|
+
/* @__PURE__ */ o("colgroup", { children: [/* @__PURE__ */ a("col", { className: Hu["table-option-column"] }), i.headers.map((e, t) => /* @__PURE__ */ a("col", {}, `column-${t}`))] }),
|
|
7451
7437
|
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ o("tr", { children: [/* @__PURE__ */ a("th", { children: r.option }), i.headers.map((e, t) => /* @__PURE__ */ a("th", { children: /* @__PURE__ */ a(K, { content: e }) }, `header-${t}`))] }) }),
|
|
7452
7438
|
/* @__PURE__ */ a("tbody", { children: i.data.map((n, r) => {
|
|
7453
7439
|
let i = N(t.config.optionLabelStyle, r), s = u.selectedIndexes.includes(r);
|
|
@@ -7461,7 +7447,7 @@ function Gu({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7461
7447
|
onClick: () => d(r),
|
|
7462
7448
|
type: "button",
|
|
7463
7449
|
children: /* @__PURE__ */ a("span", {
|
|
7464
|
-
className:
|
|
7450
|
+
className: Yl(G.marker, X["table-option-marker"]),
|
|
7465
7451
|
"data-selected": s ? "true" : void 0,
|
|
7466
7452
|
children: i
|
|
7467
7453
|
})
|
|
@@ -7483,7 +7469,7 @@ function Gu({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7483
7469
|
}) : null]
|
|
7484
7470
|
});
|
|
7485
7471
|
}
|
|
7486
|
-
let f = (l = n.options) == null ? [] : l, p =
|
|
7472
|
+
let f = (l = n.options) == null ? [] : l, p = Vu(t, n);
|
|
7487
7473
|
return /* @__PURE__ */ o("div", {
|
|
7488
7474
|
className: G.element,
|
|
7489
7475
|
children: [/* @__PURE__ */ a("ol", {
|
|
@@ -7491,7 +7477,7 @@ function Gu({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7491
7477
|
children: f.map((n, r) => {
|
|
7492
7478
|
let i = N(t.config.optionLabelStyle, r), s = u.selectedIndexes.includes(r);
|
|
7493
7479
|
return /* @__PURE__ */ a("li", {
|
|
7494
|
-
className:
|
|
7480
|
+
className: Yl(G["option-item"], X["choice-option"], s && X.selected),
|
|
7495
7481
|
"data-selected": s ? "true" : void 0,
|
|
7496
7482
|
children: /* @__PURE__ */ o("button", {
|
|
7497
7483
|
className: X["choice-button"],
|
|
@@ -7500,7 +7486,7 @@ function Gu({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7500
7486
|
onClick: () => d(r),
|
|
7501
7487
|
type: "button",
|
|
7502
7488
|
children: [/* @__PURE__ */ a("span", {
|
|
7503
|
-
className:
|
|
7489
|
+
className: Yl(G.marker, X["option-marker"]),
|
|
7504
7490
|
"data-selected": s ? "true" : void 0,
|
|
7505
7491
|
children: i
|
|
7506
7492
|
}), /* @__PURE__ */ a(K, { content: n })]
|
|
@@ -7515,7 +7501,7 @@ function Gu({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7515
7501
|
}
|
|
7516
7502
|
//#endregion
|
|
7517
7503
|
//#region src/question/renderers/orderingAnswerGroups.tsx
|
|
7518
|
-
function
|
|
7504
|
+
function Wu(e) {
|
|
7519
7505
|
let t = new Map(e.sortOptions.map((e) => [e.id, e]));
|
|
7520
7506
|
return e.answer.map((e, n) => {
|
|
7521
7507
|
let r = t.get(e);
|
|
@@ -7527,17 +7513,17 @@ function Ku(e) {
|
|
|
7527
7513
|
}
|
|
7528
7514
|
//#endregion
|
|
7529
7515
|
//#region src/question/player/QuestionOrderingPlayer.tsx
|
|
7530
|
-
function
|
|
7531
|
-
let c =
|
|
7516
|
+
function Gu({ disabled: e, item: t, messages: n, onChange: r, response: i, showAnswer: s }) {
|
|
7517
|
+
let c = vl(i, t), l = new Map(t.sortOptions.map((e) => [e.id, e])), u = c.orderedOptionIds.map((e) => l.get(e)).filter((e) => !!e);
|
|
7532
7518
|
function d(e, n) {
|
|
7533
|
-
r(k(k({}, c), {}, { orderedOptionIds:
|
|
7519
|
+
r(k(k({}, c), {}, { orderedOptionIds: Dl(c.orderedOptionIds, t, e, n) }));
|
|
7534
7520
|
}
|
|
7535
7521
|
return /* @__PURE__ */ o("div", {
|
|
7536
7522
|
className: G.element,
|
|
7537
7523
|
children: [/* @__PURE__ */ a("ol", {
|
|
7538
7524
|
className: G["option-list"],
|
|
7539
7525
|
children: u.map((t, r) => /* @__PURE__ */ o("li", {
|
|
7540
|
-
className:
|
|
7526
|
+
className: Yl(G["option-item"], X["choice-option"]),
|
|
7541
7527
|
children: [
|
|
7542
7528
|
/* @__PURE__ */ a("span", {
|
|
7543
7529
|
className: G.marker,
|
|
@@ -7565,12 +7551,12 @@ function qu({ disabled: e, item: t, messages: n, onChange: r, response: i, showA
|
|
|
7565
7551
|
]
|
|
7566
7552
|
}, t.id))
|
|
7567
7553
|
}), s ? /* @__PURE__ */ a(q, {
|
|
7568
|
-
groups:
|
|
7554
|
+
groups: Wu(t),
|
|
7569
7555
|
title: n.standardAnswer
|
|
7570
7556
|
}) : null]
|
|
7571
7557
|
});
|
|
7572
7558
|
}
|
|
7573
|
-
var
|
|
7559
|
+
var Ku = {
|
|
7574
7560
|
content: "_content_63948_1",
|
|
7575
7561
|
paragraph: "_paragraph_63948_10",
|
|
7576
7562
|
marker: "_marker_63948_14",
|
|
@@ -7580,21 +7566,21 @@ var Ju = {
|
|
|
7580
7566
|
};
|
|
7581
7567
|
//#endregion
|
|
7582
7568
|
//#region src/question/renderers/QuestionTextMarkerContent.tsx
|
|
7583
|
-
function
|
|
7584
|
-
let c = t.
|
|
7585
|
-
children: [{ text: t.
|
|
7569
|
+
function qu({ answerMarkers: e = [], content: t, disabled: n = !1, onMarkerClick: r, selectedMarkers: i = [], showAnswer: o = !1 }) {
|
|
7570
|
+
let c = t.json.length ? t.json : [{
|
|
7571
|
+
children: [{ text: t.text }],
|
|
7586
7572
|
type: "paragraph"
|
|
7587
7573
|
}];
|
|
7588
7574
|
return /* @__PURE__ */ a("div", {
|
|
7589
|
-
className:
|
|
7575
|
+
className: Ku.content,
|
|
7590
7576
|
children: c.map((e, t) => l(e, `node-${t}`))
|
|
7591
7577
|
});
|
|
7592
7578
|
function l(e, t) {
|
|
7593
|
-
if (
|
|
7594
|
-
if (!
|
|
7579
|
+
if (Yu(e)) return u(e, t);
|
|
7580
|
+
if (!Ju(e)) return null;
|
|
7595
7581
|
let n = e.children.map((e, n) => l(e, `${t}-${n}`));
|
|
7596
7582
|
return e.type === "paragraph" ? /* @__PURE__ */ a("p", {
|
|
7597
|
-
className:
|
|
7583
|
+
className: Ku.paragraph,
|
|
7598
7584
|
children: n
|
|
7599
7585
|
}, t) : /* @__PURE__ */ a("span", { children: n }, t);
|
|
7600
7586
|
}
|
|
@@ -7608,7 +7594,7 @@ function Yu({ answerMarkers: e = [], content: t, disabled: n = !1, onMarkerClick
|
|
|
7608
7594
|
let n = i.includes(t), a = o && e.includes(t);
|
|
7609
7595
|
return {
|
|
7610
7596
|
answer: a,
|
|
7611
|
-
className:
|
|
7597
|
+
className: Ks(Ku.marker, r ? Ku["marker-button"] : "", n ? Ku["marker-selected"] : "", a ? Ku["marker-answer"] : ""),
|
|
7612
7598
|
selected: n
|
|
7613
7599
|
};
|
|
7614
7600
|
}
|
|
@@ -7634,17 +7620,17 @@ function Yu({ answerMarkers: e = [], content: t, disabled: n = !1, onMarkerClick
|
|
|
7634
7620
|
}, n);
|
|
7635
7621
|
}
|
|
7636
7622
|
}
|
|
7637
|
-
function
|
|
7623
|
+
function Ju(e) {
|
|
7638
7624
|
return !!(e && typeof e == "object" && "children" in e && Array.isArray(e.children));
|
|
7639
7625
|
}
|
|
7640
|
-
function
|
|
7626
|
+
function Yu(e) {
|
|
7641
7627
|
return !!(e && typeof e == "object" && "text" in e && typeof e.text == "string");
|
|
7642
7628
|
}
|
|
7643
7629
|
//#endregion
|
|
7644
7630
|
//#region src/question/renderers/QuestionTextMarkerView.tsx
|
|
7645
|
-
function
|
|
7646
|
-
let r = Pt(e.content.
|
|
7647
|
-
return /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(
|
|
7631
|
+
function Xu({ item: e, messages: t, showAnswer: n }) {
|
|
7632
|
+
let r = Pt(e.content.json).filter((t) => e.answer.includes(t.markerId)).map((e) => e.text);
|
|
7633
|
+
return /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(qu, {
|
|
7648
7634
|
answerMarkers: e.answer,
|
|
7649
7635
|
content: e.content,
|
|
7650
7636
|
showAnswer: n
|
|
@@ -7658,42 +7644,42 @@ function Qu({ item: e, messages: t, showAnswer: n }) {
|
|
|
7658
7644
|
}
|
|
7659
7645
|
//#endregion
|
|
7660
7646
|
//#region src/question/player/QuestionTextMarkerPlayer.tsx
|
|
7661
|
-
function
|
|
7662
|
-
let s =
|
|
7663
|
-
return o ? /* @__PURE__ */ a(
|
|
7647
|
+
function Zu({ disabled: e, item: t, messages: n, onChange: r, response: i, showAnswer: o }) {
|
|
7648
|
+
let s = yl(i, t.elementKey);
|
|
7649
|
+
return o ? /* @__PURE__ */ a(Xu, {
|
|
7664
7650
|
item: t,
|
|
7665
7651
|
messages: n,
|
|
7666
7652
|
showAnswer: o
|
|
7667
|
-
}) : /* @__PURE__ */ a(
|
|
7653
|
+
}) : /* @__PURE__ */ a(qu, {
|
|
7668
7654
|
answerMarkers: t.answer,
|
|
7669
7655
|
content: t.content,
|
|
7670
7656
|
disabled: e,
|
|
7671
|
-
onMarkerClick: (e) => r(k(k({}, s), {}, { selectedMarkers:
|
|
7657
|
+
onMarkerClick: (e) => r(k(k({}, s), {}, { selectedMarkers: Ol(s.selectedMarkers, e) })),
|
|
7672
7658
|
selectedMarkers: s.selectedMarkers
|
|
7673
7659
|
});
|
|
7674
7660
|
}
|
|
7675
7661
|
//#endregion
|
|
7676
7662
|
//#region src/question/renderers/wordBuilderAnswers.tsx
|
|
7677
|
-
function
|
|
7663
|
+
function Qu(e, t) {
|
|
7678
7664
|
return e.blanks.reduce((n, r) => {
|
|
7679
7665
|
var i;
|
|
7680
7666
|
let o = (i = e.answer[r]) == null ? void 0 : i.trim();
|
|
7681
7667
|
return o ? [...n, {
|
|
7682
7668
|
contents: [/* @__PURE__ */ a(K, { content: M(o) }, `${r}-answer`)],
|
|
7683
|
-
marker:
|
|
7669
|
+
marker: Xl([r], e.blanks, t)
|
|
7684
7670
|
}] : n;
|
|
7685
7671
|
}, []);
|
|
7686
7672
|
}
|
|
7687
7673
|
//#endregion
|
|
7688
7674
|
//#region src/question/player/QuestionPlayerWordBuilder.module.css
|
|
7689
|
-
var
|
|
7675
|
+
var $u = {
|
|
7690
7676
|
"word-builder-blank": "_word-builder-blank_ftw6q_1",
|
|
7691
7677
|
"word-builder-candidate-list": "_word-builder-candidate-list_ftw6q_30"
|
|
7692
7678
|
};
|
|
7693
7679
|
//#endregion
|
|
7694
7680
|
//#region src/question/player/QuestionWordBuilderPlayer.tsx
|
|
7695
|
-
function
|
|
7696
|
-
let l = Ai(n, !0, t), u =
|
|
7681
|
+
function ed({ disabled: e, element: t, item: n, messages: r, onChange: i, response: s, showAnswer: c }) {
|
|
7682
|
+
let l = Ai(n, !0, t), u = pl(s, t.elementKey, l.blanks), d = Qu(l, r.blankLabel);
|
|
7697
7683
|
function f(e, t) {
|
|
7698
7684
|
i(k(k({}, u), {}, { answers: k(k({}, u.answers), {}, { [e]: t }) }));
|
|
7699
7685
|
}
|
|
@@ -7721,11 +7707,11 @@ function nd({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7721
7707
|
return /* @__PURE__ */ o("div", {
|
|
7722
7708
|
className: W["fill-text"],
|
|
7723
7709
|
children: [
|
|
7724
|
-
/* @__PURE__ */ a(
|
|
7710
|
+
/* @__PURE__ */ a(pu, {
|
|
7725
7711
|
content: l.content,
|
|
7726
7712
|
renderBlank: ({ blankId: t, index: n, label: i }) => {
|
|
7727
7713
|
var o, s;
|
|
7728
|
-
let c = (o = u.answers[t]) == null ? "" : o, l =
|
|
7714
|
+
let c = (o = u.answers[t]) == null ? "" : o, l = td({
|
|
7729
7715
|
answer: c,
|
|
7730
7716
|
blankLabel: r.blankLabel,
|
|
7731
7717
|
canClear: !e && !!c.trim(),
|
|
@@ -7734,7 +7720,7 @@ function nd({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7734
7720
|
});
|
|
7735
7721
|
return /* @__PURE__ */ a("button", {
|
|
7736
7722
|
"aria-label": l,
|
|
7737
|
-
className:
|
|
7723
|
+
className: $u["word-builder-blank"],
|
|
7738
7724
|
disabled: e,
|
|
7739
7725
|
onClick: () => p(t),
|
|
7740
7726
|
onDragOver: (e) => e.preventDefault(),
|
|
@@ -7746,7 +7732,7 @@ function nd({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7746
7732
|
}
|
|
7747
7733
|
}),
|
|
7748
7734
|
/* @__PURE__ */ a("div", {
|
|
7749
|
-
className:
|
|
7735
|
+
className: $u["word-builder-candidate-list"],
|
|
7750
7736
|
children: l.candidateOptions.map((t, n) => /* @__PURE__ */ a("button", {
|
|
7751
7737
|
disabled: e,
|
|
7752
7738
|
draggable: !e,
|
|
@@ -7765,35 +7751,35 @@ function nd({ disabled: e, element: t, item: n, messages: r, onChange: i, respon
|
|
|
7765
7751
|
]
|
|
7766
7752
|
});
|
|
7767
7753
|
}
|
|
7768
|
-
function
|
|
7754
|
+
function td({ answer: e, blankLabel: t, canClear: n, index: r, label: i }) {
|
|
7769
7755
|
let a = i || `${t}${r + 1}`;
|
|
7770
7756
|
return !n || !e.trim() ? a : t === "\u7a7a" ? `${a}\uff0c\u70b9\u51fb\u6e05\u7a7a` : `${a}, click to clear`;
|
|
7771
7757
|
}
|
|
7772
7758
|
//#endregion
|
|
7773
7759
|
//#region src/question/player/QuestionPlayerElement.tsx
|
|
7774
|
-
function
|
|
7775
|
-
return t.type === n.type ? t.type === "richText" ? /* @__PURE__ */ a(K, { content: n.content }) : t.type === "ordering" ? /* @__PURE__ */ a(
|
|
7760
|
+
function nd({ disabled: e, element: t, item: n, messages: r, onResponseItemChange: i, response: o, showAnswer: s }) {
|
|
7761
|
+
return t.type === n.type ? t.type === "richText" ? /* @__PURE__ */ a(K, { content: n.content }) : t.type === "ordering" ? /* @__PURE__ */ a(Gu, {
|
|
7776
7762
|
disabled: e,
|
|
7777
7763
|
item: n,
|
|
7778
7764
|
messages: r,
|
|
7779
7765
|
onChange: i,
|
|
7780
7766
|
response: o,
|
|
7781
7767
|
showAnswer: s
|
|
7782
|
-
}) : t.type === "classification" ? /* @__PURE__ */ a(
|
|
7768
|
+
}) : t.type === "classification" ? /* @__PURE__ */ a(uu, {
|
|
7783
7769
|
disabled: e,
|
|
7784
7770
|
item: n,
|
|
7785
7771
|
messages: r,
|
|
7786
7772
|
onChange: i,
|
|
7787
7773
|
response: o,
|
|
7788
7774
|
showAnswer: s
|
|
7789
|
-
}) : t.type === "textMarker" ? /* @__PURE__ */ a(
|
|
7775
|
+
}) : t.type === "textMarker" ? /* @__PURE__ */ a(Zu, {
|
|
7790
7776
|
disabled: e,
|
|
7791
7777
|
item: n,
|
|
7792
7778
|
messages: r,
|
|
7793
7779
|
onChange: i,
|
|
7794
7780
|
response: o,
|
|
7795
7781
|
showAnswer: s
|
|
7796
|
-
}) :
|
|
7782
|
+
}) : rd({
|
|
7797
7783
|
disabled: e,
|
|
7798
7784
|
element: t,
|
|
7799
7785
|
item: n,
|
|
@@ -7803,9 +7789,9 @@ function id({ disabled: e, element: t, item: n, messages: r, onResponseItemChang
|
|
|
7803
7789
|
showAnswer: s
|
|
7804
7790
|
}) : null;
|
|
7805
7791
|
}
|
|
7806
|
-
function
|
|
7792
|
+
function rd({ disabled: e, element: t, item: n, messages: r, onResponseItemChange: i, response: o, showAnswer: s }) {
|
|
7807
7793
|
switch (t.type) {
|
|
7808
|
-
case "choice": return /* @__PURE__ */ a(
|
|
7794
|
+
case "choice": return /* @__PURE__ */ a(Uu, {
|
|
7809
7795
|
disabled: e,
|
|
7810
7796
|
element: t,
|
|
7811
7797
|
item: n,
|
|
@@ -7814,7 +7800,7 @@ function ad({ disabled: e, element: t, item: n, messages: r, onResponseItemChang
|
|
|
7814
7800
|
response: o,
|
|
7815
7801
|
showAnswer: s
|
|
7816
7802
|
});
|
|
7817
|
-
case "fill": return /* @__PURE__ */ a(
|
|
7803
|
+
case "fill": return /* @__PURE__ */ a(ou, {
|
|
7818
7804
|
disabled: e,
|
|
7819
7805
|
item: n,
|
|
7820
7806
|
messages: r,
|
|
@@ -7822,7 +7808,7 @@ function ad({ disabled: e, element: t, item: n, messages: r, onResponseItemChang
|
|
|
7822
7808
|
response: o,
|
|
7823
7809
|
showAnswer: s
|
|
7824
7810
|
});
|
|
7825
|
-
case "inlineFill": return /* @__PURE__ */ a(
|
|
7811
|
+
case "inlineFill": return /* @__PURE__ */ a(Ou, {
|
|
7826
7812
|
disabled: e,
|
|
7827
7813
|
element: t,
|
|
7828
7814
|
item: n,
|
|
@@ -7831,7 +7817,7 @@ function ad({ disabled: e, element: t, item: n, messages: r, onResponseItemChang
|
|
|
7831
7817
|
response: o,
|
|
7832
7818
|
showAnswer: s
|
|
7833
7819
|
});
|
|
7834
|
-
case "wordBuilder": return /* @__PURE__ */ a(
|
|
7820
|
+
case "wordBuilder": return /* @__PURE__ */ a(ed, {
|
|
7835
7821
|
disabled: e,
|
|
7836
7822
|
element: t,
|
|
7837
7823
|
item: n,
|
|
@@ -7840,7 +7826,7 @@ function ad({ disabled: e, element: t, item: n, messages: r, onResponseItemChang
|
|
|
7840
7826
|
response: o,
|
|
7841
7827
|
showAnswer: s
|
|
7842
7828
|
});
|
|
7843
|
-
case "judgement": return /* @__PURE__ */ a(
|
|
7829
|
+
case "judgement": return /* @__PURE__ */ a(Nu, {
|
|
7844
7830
|
disabled: e,
|
|
7845
7831
|
element: t,
|
|
7846
7832
|
item: n,
|
|
@@ -7849,7 +7835,7 @@ function ad({ disabled: e, element: t, item: n, messages: r, onResponseItemChang
|
|
|
7849
7835
|
response: o,
|
|
7850
7836
|
showAnswer: s
|
|
7851
7837
|
});
|
|
7852
|
-
case "lineConnect": return /* @__PURE__ */ a(
|
|
7838
|
+
case "lineConnect": return /* @__PURE__ */ a(Iu, {
|
|
7853
7839
|
disabled: e,
|
|
7854
7840
|
item: n,
|
|
7855
7841
|
messages: r,
|
|
@@ -7857,7 +7843,7 @@ function ad({ disabled: e, element: t, item: n, messages: r, onResponseItemChang
|
|
|
7857
7843
|
response: o,
|
|
7858
7844
|
showAnswer: s
|
|
7859
7845
|
});
|
|
7860
|
-
case "matching": return /* @__PURE__ */ a(
|
|
7846
|
+
case "matching": return /* @__PURE__ */ a(zu, {
|
|
7861
7847
|
disabled: e,
|
|
7862
7848
|
item: n,
|
|
7863
7849
|
messages: r,
|
|
@@ -7869,16 +7855,16 @@ function ad({ disabled: e, element: t, item: n, messages: r, onResponseItemChang
|
|
|
7869
7855
|
}
|
|
7870
7856
|
//#endregion
|
|
7871
7857
|
//#region src/question/player/QuestionPlayer.tsx
|
|
7872
|
-
var
|
|
7873
|
-
function
|
|
7858
|
+
var id = ["locale"];
|
|
7859
|
+
function ad(e) {
|
|
7874
7860
|
let { locale: t = "zh-CN" } = e;
|
|
7875
|
-
return /* @__PURE__ */ a(
|
|
7876
|
-
messages:
|
|
7861
|
+
return /* @__PURE__ */ a(od, k(k({}, xs(e, id)), {}, {
|
|
7862
|
+
messages: Jl(t),
|
|
7877
7863
|
numberPath: []
|
|
7878
7864
|
}));
|
|
7879
7865
|
}
|
|
7880
|
-
function
|
|
7881
|
-
let f =
|
|
7866
|
+
function od({ className: e, disabled: t = !1, messages: n, numberPath: r, onResponseChange: i, response: o, showAnswer: s = !1, showExtraAttributes: c = !1, structure: l, subquestionTemplates: u = [], value: d }) {
|
|
7867
|
+
let f = sd({
|
|
7882
7868
|
disabled: t,
|
|
7883
7869
|
messages: n,
|
|
7884
7870
|
numberPath: r,
|
|
@@ -7891,29 +7877,29 @@ function cd({ className: e, disabled: t = !1, messages: n, numberPath: r, onResp
|
|
|
7891
7877
|
value: d
|
|
7892
7878
|
});
|
|
7893
7879
|
return /* @__PURE__ */ a("div", {
|
|
7894
|
-
className:
|
|
7895
|
-
children:
|
|
7880
|
+
className: Yl(W.root, e),
|
|
7881
|
+
children: ud(l, d) ? /* @__PURE__ */ a("div", {
|
|
7896
7882
|
className: W.empty,
|
|
7897
7883
|
children: n.previewEmpty
|
|
7898
7884
|
}) : f
|
|
7899
7885
|
});
|
|
7900
7886
|
}
|
|
7901
|
-
function
|
|
7902
|
-
return /* @__PURE__ */ o(i, { children: [
|
|
7887
|
+
function sd(e) {
|
|
7888
|
+
return /* @__PURE__ */ o(i, { children: [cd(e), ld(e)] });
|
|
7903
7889
|
}
|
|
7904
|
-
function
|
|
7890
|
+
function cd({ disabled: e, messages: t, onResponseChange: n, response: r, showAnswer: i, showExtraAttributes: s, structure: c, value: l }) {
|
|
7905
7891
|
return ci(c) ? null : /* @__PURE__ */ o("div", {
|
|
7906
7892
|
className: W["element-list"],
|
|
7907
7893
|
children: [c.elements.map((o) => {
|
|
7908
7894
|
let s = hi(l, o, c.hasAnswer);
|
|
7909
7895
|
return /* @__PURE__ */ a("section", {
|
|
7910
7896
|
className: W.element,
|
|
7911
|
-
children: /* @__PURE__ */ a(
|
|
7897
|
+
children: /* @__PURE__ */ a(nd, {
|
|
7912
7898
|
disabled: e,
|
|
7913
7899
|
element: o,
|
|
7914
7900
|
item: s,
|
|
7915
7901
|
messages: t,
|
|
7916
|
-
onResponseItemChange: (e) => n(
|
|
7902
|
+
onResponseItemChange: (e) => n(bl(r, e)),
|
|
7917
7903
|
response: r,
|
|
7918
7904
|
showAnswer: i && c.hasAnswer
|
|
7919
7905
|
})
|
|
@@ -7925,10 +7911,10 @@ function ud({ disabled: e, messages: t, onResponseChange: n, response: r, showAn
|
|
|
7925
7911
|
children: [/* @__PURE__ */ a("h3", {
|
|
7926
7912
|
className: W["section-title"],
|
|
7927
7913
|
children: n.name
|
|
7928
|
-
}), /* @__PURE__ */ a(
|
|
7914
|
+
}), /* @__PURE__ */ a(nd, {
|
|
7929
7915
|
disabled: e,
|
|
7930
|
-
element:
|
|
7931
|
-
item:
|
|
7916
|
+
element: dd(n),
|
|
7917
|
+
item: fd(i),
|
|
7932
7918
|
messages: t,
|
|
7933
7919
|
onResponseItemChange: () => void 0,
|
|
7934
7920
|
response: r,
|
|
@@ -7938,14 +7924,14 @@ function ud({ disabled: e, messages: t, onResponseChange: n, response: r, showAn
|
|
|
7938
7924
|
}) : null]
|
|
7939
7925
|
});
|
|
7940
7926
|
}
|
|
7941
|
-
function
|
|
7942
|
-
return l.children.length === 0 ? null : /* @__PURE__ */ a(
|
|
7927
|
+
function ld({ disabled: e, messages: t, numberPath: n, onResponseChange: r, response: i, showAnswer: o, showExtraAttributes: s, subquestionTemplates: c = [], value: l }) {
|
|
7928
|
+
return l.children.length === 0 ? null : /* @__PURE__ */ a(iu, {
|
|
7943
7929
|
disabled: e,
|
|
7944
7930
|
messages: t,
|
|
7945
7931
|
numberPath: n,
|
|
7946
|
-
onChildResponseChange: (e, t) => r(
|
|
7932
|
+
onChildResponseChange: (e, t) => r(xl(i, e, t)),
|
|
7947
7933
|
response: i,
|
|
7948
|
-
renderChild: (n, r, i, l, u) => /* @__PURE__ */ a(
|
|
7934
|
+
renderChild: (n, r, i, l, u) => /* @__PURE__ */ a(od, {
|
|
7949
7935
|
disabled: e,
|
|
7950
7936
|
messages: t,
|
|
7951
7937
|
numberPath: u,
|
|
@@ -7961,10 +7947,10 @@ function dd({ disabled: e, messages: t, numberPath: n, onResponseChange: r, resp
|
|
|
7961
7947
|
value: l
|
|
7962
7948
|
});
|
|
7963
7949
|
}
|
|
7964
|
-
function
|
|
7950
|
+
function ud(e, t) {
|
|
7965
7951
|
return ci(e) && t.children.length === 0;
|
|
7966
7952
|
}
|
|
7967
|
-
function
|
|
7953
|
+
function dd(e) {
|
|
7968
7954
|
return {
|
|
7969
7955
|
config: {},
|
|
7970
7956
|
elementKey: e.extraKey,
|
|
@@ -7972,7 +7958,7 @@ function pd(e) {
|
|
|
7972
7958
|
type: "richText"
|
|
7973
7959
|
};
|
|
7974
7960
|
}
|
|
7975
|
-
function
|
|
7961
|
+
function fd(e) {
|
|
7976
7962
|
return {
|
|
7977
7963
|
content: e.content,
|
|
7978
7964
|
elementKey: e.extraKey,
|
|
@@ -7981,45 +7967,45 @@ function md(e) {
|
|
|
7981
7967
|
}
|
|
7982
7968
|
//#endregion
|
|
7983
7969
|
//#region src/question/renderers/QuestionBlankGroupView.module.css
|
|
7984
|
-
var
|
|
7970
|
+
var pd = {
|
|
7985
7971
|
"blank-list": "_blank-list_12ccp_1",
|
|
7986
7972
|
"blank-item": "_blank-item_12ccp_11",
|
|
7987
7973
|
"blank-field": "_blank-field_12ccp_17"
|
|
7988
7974
|
};
|
|
7989
7975
|
//#endregion
|
|
7990
7976
|
//#region src/question/renderers/QuestionBlankGroupView.tsx
|
|
7991
|
-
function
|
|
7977
|
+
function md({ item: e, messages: t, showAnswer: n }) {
|
|
7992
7978
|
let r = Ki(e.answer, e.blanks).map((n, r) => ({
|
|
7993
7979
|
contents: n.answerPools.map((e, t) => /* @__PURE__ */ a(K, { content: e }, `group-${r}-answer-${t}`)),
|
|
7994
|
-
marker:
|
|
7980
|
+
marker: Xl(n.blankIds, e.blanks, t.blankLabel)
|
|
7995
7981
|
}));
|
|
7996
7982
|
return /* @__PURE__ */ o("div", {
|
|
7997
7983
|
className: G.element,
|
|
7998
7984
|
children: [/* @__PURE__ */ a("ol", {
|
|
7999
|
-
className:
|
|
7985
|
+
className: pd["blank-list"],
|
|
8000
7986
|
children: e.blanks.map((e, n) => /* @__PURE__ */ a("li", {
|
|
8001
|
-
className:
|
|
7987
|
+
className: pd["blank-item"],
|
|
8002
7988
|
children: /* @__PURE__ */ o("span", {
|
|
8003
|
-
className:
|
|
7989
|
+
className: pd["blank-field"],
|
|
8004
7990
|
children: [
|
|
8005
7991
|
t.blankLabel,
|
|
8006
7992
|
" ",
|
|
8007
7993
|
n + 1
|
|
8008
7994
|
]
|
|
8009
7995
|
})
|
|
8010
|
-
},
|
|
7996
|
+
}, hd(e, n)))
|
|
8011
7997
|
}), n ? /* @__PURE__ */ a(q, {
|
|
8012
7998
|
groups: r,
|
|
8013
7999
|
title: t.standardAnswer
|
|
8014
8000
|
}) : null]
|
|
8015
8001
|
});
|
|
8016
8002
|
}
|
|
8017
|
-
function
|
|
8003
|
+
function hd(e, t) {
|
|
8018
8004
|
return e || `blank-${t + 1}`;
|
|
8019
8005
|
}
|
|
8020
8006
|
//#endregion
|
|
8021
8007
|
//#region src/question/renderers/QuestionClassificationView.tsx
|
|
8022
|
-
function
|
|
8008
|
+
function gd({ item: e, messages: t, showAnswer: n }) {
|
|
8023
8009
|
return /* @__PURE__ */ o("div", {
|
|
8024
8010
|
className: G.element,
|
|
8025
8011
|
children: [/* @__PURE__ */ o("div", {
|
|
@@ -8044,23 +8030,23 @@ function vd({ item: e, messages: t, showAnswer: n }) {
|
|
|
8044
8030
|
}, e.id))
|
|
8045
8031
|
})]
|
|
8046
8032
|
}), n ? /* @__PURE__ */ a(q, {
|
|
8047
|
-
groups:
|
|
8033
|
+
groups: lu(e),
|
|
8048
8034
|
title: t.standardAnswer
|
|
8049
8035
|
}) : null]
|
|
8050
8036
|
});
|
|
8051
8037
|
}
|
|
8052
8038
|
//#endregion
|
|
8053
8039
|
//#region src/question/renderers/QuestionFillTextView.tsx
|
|
8054
|
-
function
|
|
8055
|
-
let i = ji(t, e, !0), s =
|
|
8040
|
+
function _d({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
8041
|
+
let i = ji(t, e, !0), s = nu(i).map((e, t) => ({
|
|
8056
8042
|
contents: e.contents.map((e, n) => /* @__PURE__ */ a(K, { content: e }, `group-${t}-answer-${n}`)),
|
|
8057
|
-
marker:
|
|
8043
|
+
marker: Xl(e.blankIds, i.blanks, n.blankLabel)
|
|
8058
8044
|
}));
|
|
8059
8045
|
return /* @__PURE__ */ o("div", {
|
|
8060
8046
|
className: G.element,
|
|
8061
8047
|
children: [
|
|
8062
8048
|
/* @__PURE__ */ a(K, { content: i.content }),
|
|
8063
|
-
|
|
8049
|
+
vd(i, n.candidateOptions),
|
|
8064
8050
|
r ? /* @__PURE__ */ a(q, {
|
|
8065
8051
|
groups: s,
|
|
8066
8052
|
title: n.standardAnswer
|
|
@@ -8068,7 +8054,7 @@ function yd({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
|
8068
8054
|
]
|
|
8069
8055
|
});
|
|
8070
8056
|
}
|
|
8071
|
-
function
|
|
8057
|
+
function vd(e, t) {
|
|
8072
8058
|
var n, r;
|
|
8073
8059
|
let i = (n = e.candidateOptions) == null ? [] : n, s = (r = e.blankOptionGroups) == null ? [] : r;
|
|
8074
8060
|
return !i.length && !s.length ? null : /* @__PURE__ */ o("div", {
|
|
@@ -8090,7 +8076,7 @@ function bd(e, t) {
|
|
|
8090
8076
|
}
|
|
8091
8077
|
//#endregion
|
|
8092
8078
|
//#region src/question/renderers/QuestionJudgementGroupView.tsx
|
|
8093
|
-
function
|
|
8079
|
+
function yd({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
8094
8080
|
let i = yi(e.config.judgeAnswerMode), s = [{
|
|
8095
8081
|
contents: t.answer.filter((e) => e.trim() !== ""),
|
|
8096
8082
|
marker: ""
|
|
@@ -8111,7 +8097,7 @@ function xd({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
|
8111
8097
|
}
|
|
8112
8098
|
//#endregion
|
|
8113
8099
|
//#region src/question/renderers/QuestionLineConnectView.tsx
|
|
8114
|
-
function
|
|
8100
|
+
function bd({ item: e, messages: t, showAnswer: n }) {
|
|
8115
8101
|
let r = { gridTemplateColumns: `repeat(${e.columns.length}, minmax(12rem, 1fr))` };
|
|
8116
8102
|
return /* @__PURE__ */ o("div", {
|
|
8117
8103
|
className: G.element,
|
|
@@ -8142,12 +8128,12 @@ function Sd({ item: e, messages: t, showAnswer: n }) {
|
|
|
8142
8128
|
}, e.columnId))
|
|
8143
8129
|
})
|
|
8144
8130
|
}), n ? /* @__PURE__ */ a(q, {
|
|
8145
|
-
groups:
|
|
8131
|
+
groups: Pu(e),
|
|
8146
8132
|
title: t.standardAnswer
|
|
8147
8133
|
}) : null]
|
|
8148
8134
|
});
|
|
8149
8135
|
}
|
|
8150
|
-
var
|
|
8136
|
+
var xd = {
|
|
8151
8137
|
board: "_board_5xarh_1",
|
|
8152
8138
|
columns: "_columns_5xarh_6",
|
|
8153
8139
|
column: "_column_5xarh_6",
|
|
@@ -8156,21 +8142,21 @@ var Cd = {
|
|
|
8156
8142
|
};
|
|
8157
8143
|
//#endregion
|
|
8158
8144
|
//#region src/question/renderers/QuestionMatchingView.tsx
|
|
8159
|
-
function
|
|
8145
|
+
function Sd({ item: e, messages: t, showAnswer: n }) {
|
|
8160
8146
|
return /* @__PURE__ */ o("div", {
|
|
8161
8147
|
className: G.element,
|
|
8162
8148
|
children: [/* @__PURE__ */ a("div", {
|
|
8163
|
-
className:
|
|
8149
|
+
className: xd.board,
|
|
8164
8150
|
children: /* @__PURE__ */ a("div", {
|
|
8165
|
-
className:
|
|
8151
|
+
className: xd.columns,
|
|
8166
8152
|
children: e.columns.map((e) => /* @__PURE__ */ a("section", {
|
|
8167
|
-
className:
|
|
8153
|
+
className: xd.column,
|
|
8168
8154
|
children: e.items.map((t, n) => {
|
|
8169
8155
|
let r = vi(e.labelStyle, n);
|
|
8170
8156
|
return /* @__PURE__ */ o("div", {
|
|
8171
|
-
className:
|
|
8157
|
+
className: xd.item,
|
|
8172
8158
|
children: [r ? /* @__PURE__ */ a("span", {
|
|
8173
|
-
className:
|
|
8159
|
+
className: xd.marker,
|
|
8174
8160
|
children: r
|
|
8175
8161
|
}) : null, /* @__PURE__ */ a(K, { content: t.content })]
|
|
8176
8162
|
}, t.itemId);
|
|
@@ -8178,30 +8164,30 @@ function wd({ item: e, messages: t, showAnswer: n }) {
|
|
|
8178
8164
|
}, e.columnId))
|
|
8179
8165
|
})
|
|
8180
8166
|
}), n ? /* @__PURE__ */ a(q, {
|
|
8181
|
-
groups:
|
|
8167
|
+
groups: Lu(e),
|
|
8182
8168
|
title: t.standardAnswer
|
|
8183
8169
|
}) : null]
|
|
8184
8170
|
});
|
|
8185
8171
|
}
|
|
8186
8172
|
//#endregion
|
|
8187
8173
|
//#region src/question/renderers/QuestionOptionGroupView.tsx
|
|
8188
|
-
function
|
|
8174
|
+
function Cd({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
8189
8175
|
var i;
|
|
8190
8176
|
if (e.config.renderer === "table") {
|
|
8191
|
-
let i = ca(t), s =
|
|
8177
|
+
let i = ca(t), s = Vu(e, t);
|
|
8192
8178
|
return /* @__PURE__ */ o("div", {
|
|
8193
8179
|
className: G.element,
|
|
8194
8180
|
children: [/* @__PURE__ */ a("div", {
|
|
8195
|
-
className:
|
|
8181
|
+
className: Hu["table-wrap"],
|
|
8196
8182
|
children: /* @__PURE__ */ o("table", {
|
|
8197
|
-
className:
|
|
8183
|
+
className: Hu.table,
|
|
8198
8184
|
children: [
|
|
8199
|
-
/* @__PURE__ */ o("colgroup", { children: [/* @__PURE__ */ a("col", { className:
|
|
8185
|
+
/* @__PURE__ */ o("colgroup", { children: [/* @__PURE__ */ a("col", { className: Hu["table-option-column"] }), i.headers.map((e, t) => /* @__PURE__ */ a("col", {}, `column-${t}`))] }),
|
|
8200
8186
|
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ o("tr", { children: [/* @__PURE__ */ a("th", { children: n.option }), i.headers.map((e, t) => /* @__PURE__ */ a("th", { children: /* @__PURE__ */ a(K, { content: e }) }, `header-${t}`))] }) }),
|
|
8201
8187
|
/* @__PURE__ */ a("tbody", { children: i.data.map((t, n) => {
|
|
8202
8188
|
let r = N(e.config.optionLabelStyle, n);
|
|
8203
8189
|
return /* @__PURE__ */ o("tr", { children: [/* @__PURE__ */ a("td", { children: /* @__PURE__ */ a("span", {
|
|
8204
|
-
className:
|
|
8190
|
+
className: Hu["table-option-marker"],
|
|
8205
8191
|
children: r
|
|
8206
8192
|
}) }), t.map((e, t) => /* @__PURE__ */ a("td", { children: /* @__PURE__ */ a(K, { content: e }) }, `cell-${n}-${t}`))] }, `row-${n}`);
|
|
8207
8193
|
}) })
|
|
@@ -8213,7 +8199,7 @@ function Td({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
|
8213
8199
|
}) : null]
|
|
8214
8200
|
});
|
|
8215
8201
|
}
|
|
8216
|
-
let s = (i = t.options) == null ? [] : i, c =
|
|
8202
|
+
let s = (i = t.options) == null ? [] : i, c = Vu(e, t);
|
|
8217
8203
|
return /* @__PURE__ */ o("div", {
|
|
8218
8204
|
className: G.element,
|
|
8219
8205
|
children: [/* @__PURE__ */ a("ol", {
|
|
@@ -8236,7 +8222,7 @@ function Td({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
|
8236
8222
|
}
|
|
8237
8223
|
//#endregion
|
|
8238
8224
|
//#region src/question/renderers/QuestionOrderingView.tsx
|
|
8239
|
-
function
|
|
8225
|
+
function wd({ item: e, messages: t, showAnswer: n }) {
|
|
8240
8226
|
return /* @__PURE__ */ o("div", {
|
|
8241
8227
|
className: G.element,
|
|
8242
8228
|
children: [/* @__PURE__ */ a("ol", {
|
|
@@ -8249,19 +8235,19 @@ function Ed({ item: e, messages: t, showAnswer: n }) {
|
|
|
8249
8235
|
}), /* @__PURE__ */ a(K, { content: e.content })]
|
|
8250
8236
|
}, e.id))
|
|
8251
8237
|
}), n ? /* @__PURE__ */ a(q, {
|
|
8252
|
-
groups:
|
|
8238
|
+
groups: Wu(e),
|
|
8253
8239
|
title: t.standardAnswer
|
|
8254
8240
|
}) : null]
|
|
8255
8241
|
});
|
|
8256
8242
|
}
|
|
8257
8243
|
//#endregion
|
|
8258
8244
|
//#region src/question/renderers/QuestionWordBuilderView.tsx
|
|
8259
|
-
function
|
|
8260
|
-
let i = Ai(t, !0, e), s =
|
|
8245
|
+
function Td({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
8246
|
+
let i = Ai(t, !0, e), s = Qu(i, n.blankLabel);
|
|
8261
8247
|
return /* @__PURE__ */ o("div", {
|
|
8262
8248
|
className: G.element,
|
|
8263
8249
|
children: [
|
|
8264
|
-
/* @__PURE__ */ a(
|
|
8250
|
+
/* @__PURE__ */ a(pu, {
|
|
8265
8251
|
content: i.content,
|
|
8266
8252
|
renderBlank: ({ blankId: e, index: t, label: r }) => /* @__PURE__ */ a("span", {
|
|
8267
8253
|
"aria-label": r || `${n.blankLabel}${t + 1}`,
|
|
@@ -8291,70 +8277,70 @@ function Dd({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
|
8291
8277
|
}
|
|
8292
8278
|
//#endregion
|
|
8293
8279
|
//#region src/question/renderers/QuestionContentElementView.tsx
|
|
8294
|
-
function
|
|
8295
|
-
return e.type === t.type ? e.type === "richText" ? /* @__PURE__ */ a(K, { content: t.content }) : e.type === "ordering" ? /* @__PURE__ */ a(
|
|
8280
|
+
function Ed({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
8281
|
+
return e.type === t.type ? e.type === "richText" ? /* @__PURE__ */ a(K, { content: t.content }) : e.type === "ordering" ? /* @__PURE__ */ a(wd, {
|
|
8296
8282
|
item: t,
|
|
8297
8283
|
messages: n,
|
|
8298
8284
|
showAnswer: r
|
|
8299
|
-
}) : e.type === "classification" ? /* @__PURE__ */ a(
|
|
8285
|
+
}) : e.type === "classification" ? /* @__PURE__ */ a(gd, {
|
|
8300
8286
|
item: t,
|
|
8301
8287
|
messages: n,
|
|
8302
8288
|
showAnswer: r
|
|
8303
|
-
}) : e.type === "textMarker" ? /* @__PURE__ */ a(
|
|
8289
|
+
}) : e.type === "textMarker" ? /* @__PURE__ */ a(Xu, {
|
|
8304
8290
|
item: t,
|
|
8305
8291
|
messages: n,
|
|
8306
8292
|
showAnswer: r
|
|
8307
|
-
}) :
|
|
8293
|
+
}) : Dd({
|
|
8308
8294
|
element: e,
|
|
8309
8295
|
item: t,
|
|
8310
8296
|
messages: n,
|
|
8311
8297
|
showAnswer: r
|
|
8312
8298
|
}) : null;
|
|
8313
8299
|
}
|
|
8314
|
-
function
|
|
8300
|
+
function Dd({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
8315
8301
|
switch (e.type) {
|
|
8316
|
-
case "choice": return /* @__PURE__ */ a(
|
|
8302
|
+
case "choice": return /* @__PURE__ */ a(Cd, {
|
|
8317
8303
|
element: e,
|
|
8318
8304
|
item: t,
|
|
8319
8305
|
messages: n,
|
|
8320
8306
|
showAnswer: r
|
|
8321
8307
|
});
|
|
8322
|
-
case "fill": return /* @__PURE__ */ a(
|
|
8308
|
+
case "fill": return /* @__PURE__ */ a(md, {
|
|
8323
8309
|
item: t,
|
|
8324
8310
|
messages: n,
|
|
8325
8311
|
showAnswer: r
|
|
8326
8312
|
});
|
|
8327
|
-
case "inlineFill": return /* @__PURE__ */ a(
|
|
8313
|
+
case "inlineFill": return /* @__PURE__ */ a(_d, {
|
|
8328
8314
|
element: e,
|
|
8329
8315
|
item: t,
|
|
8330
8316
|
messages: n,
|
|
8331
8317
|
showAnswer: r
|
|
8332
8318
|
});
|
|
8333
|
-
case "wordBuilder": return /* @__PURE__ */ a(
|
|
8319
|
+
case "wordBuilder": return /* @__PURE__ */ a(Td, {
|
|
8334
8320
|
element: e,
|
|
8335
8321
|
item: t,
|
|
8336
8322
|
messages: n,
|
|
8337
8323
|
showAnswer: r
|
|
8338
8324
|
});
|
|
8339
|
-
case "judgement": return /* @__PURE__ */ a(
|
|
8325
|
+
case "judgement": return /* @__PURE__ */ a(yd, {
|
|
8340
8326
|
element: e,
|
|
8341
8327
|
item: t,
|
|
8342
8328
|
messages: n,
|
|
8343
8329
|
showAnswer: r
|
|
8344
8330
|
});
|
|
8345
|
-
case "lineConnect": return /* @__PURE__ */ a(
|
|
8331
|
+
case "lineConnect": return /* @__PURE__ */ a(bd, {
|
|
8346
8332
|
item: t,
|
|
8347
8333
|
messages: n,
|
|
8348
8334
|
showAnswer: r
|
|
8349
8335
|
});
|
|
8350
|
-
case "matching": return /* @__PURE__ */ a(
|
|
8336
|
+
case "matching": return /* @__PURE__ */ a(Sd, {
|
|
8351
8337
|
item: t,
|
|
8352
8338
|
messages: n,
|
|
8353
8339
|
showAnswer: r
|
|
8354
8340
|
});
|
|
8355
8341
|
}
|
|
8356
8342
|
}
|
|
8357
|
-
var
|
|
8343
|
+
var Od = {
|
|
8358
8344
|
root: "_root_oqlnl_1",
|
|
8359
8345
|
empty: "_empty_oqlnl_19",
|
|
8360
8346
|
"element-list": "_element-list_oqlnl_31",
|
|
@@ -8366,25 +8352,25 @@ var Ad = {
|
|
|
8366
8352
|
};
|
|
8367
8353
|
//#endregion
|
|
8368
8354
|
//#region src/question/preview/QuestionCompositePreview.tsx
|
|
8369
|
-
function
|
|
8355
|
+
function kd({ messages: e, numberPath: t = [], renderChild: n, subquestionTemplates: r, value: i }) {
|
|
8370
8356
|
return i.children.length === 0 ? /* @__PURE__ */ a("div", {
|
|
8371
|
-
className:
|
|
8357
|
+
className: Od.empty,
|
|
8372
8358
|
children: e.previewEmpty
|
|
8373
8359
|
}) : /* @__PURE__ */ a("div", {
|
|
8374
|
-
className:
|
|
8360
|
+
className: Od.children,
|
|
8375
8361
|
children: i.children.map((i, s) => {
|
|
8376
|
-
let c = [...t, s], l =
|
|
8362
|
+
let c = [...t, s], l = Rc(r, i.questionTypeKey);
|
|
8377
8363
|
return /* @__PURE__ */ o("section", {
|
|
8378
|
-
className:
|
|
8364
|
+
className: Od.child,
|
|
8379
8365
|
children: [/* @__PURE__ */ o("div", {
|
|
8380
|
-
className:
|
|
8366
|
+
className: Od["child-title"],
|
|
8381
8367
|
children: [
|
|
8382
8368
|
e.subquestion,
|
|
8383
8369
|
" ",
|
|
8384
|
-
|
|
8370
|
+
Nc(c)
|
|
8385
8371
|
]
|
|
8386
8372
|
}), l ? n(i, l.structure, c) : /* @__PURE__ */ a("div", {
|
|
8387
|
-
className:
|
|
8373
|
+
className: Od.empty,
|
|
8388
8374
|
children: e.missingSubquestionTemplate
|
|
8389
8375
|
})]
|
|
8390
8376
|
}, i.id || s);
|
|
@@ -8393,22 +8379,22 @@ function jd({ messages: e, numberPath: t = [], renderChild: n, subquestionTempla
|
|
|
8393
8379
|
}
|
|
8394
8380
|
//#endregion
|
|
8395
8381
|
//#region src/question/preview/QuestionPreview.tsx
|
|
8396
|
-
var
|
|
8397
|
-
function
|
|
8382
|
+
var Ad = ["locale"];
|
|
8383
|
+
function jd(e) {
|
|
8398
8384
|
let { locale: t = "zh-CN" } = e;
|
|
8399
|
-
return /* @__PURE__ */ a(
|
|
8400
|
-
messages:
|
|
8385
|
+
return /* @__PURE__ */ a(Md, k(k({}, xs(e, Ad)), {}, {
|
|
8386
|
+
messages: Jl(t),
|
|
8401
8387
|
numberPath: []
|
|
8402
8388
|
}));
|
|
8403
8389
|
}
|
|
8404
|
-
function
|
|
8390
|
+
function Md({ className: e, messages: t, numberPath: n, showAnswer: r = !1, showExtraAttributes: s = !1, structure: c, subquestionTemplates: l = [], value: u }) {
|
|
8405
8391
|
let d = /* @__PURE__ */ o(i, { children: [ci(c) ? null : /* @__PURE__ */ o("div", {
|
|
8406
|
-
className:
|
|
8392
|
+
className: Od["element-list"],
|
|
8407
8393
|
children: [c.elements.map((e) => {
|
|
8408
8394
|
let n = hi(u, e, c.hasAnswer);
|
|
8409
8395
|
return /* @__PURE__ */ a("section", {
|
|
8410
|
-
className:
|
|
8411
|
-
children: /* @__PURE__ */ a(
|
|
8396
|
+
className: Od.element,
|
|
8397
|
+
children: /* @__PURE__ */ a(Ed, {
|
|
8412
8398
|
element: e,
|
|
8413
8399
|
item: n,
|
|
8414
8400
|
messages: t,
|
|
@@ -8418,22 +8404,22 @@ function Pd({ className: e, messages: t, numberPath: n, showAnswer: r = !1, show
|
|
|
8418
8404
|
}), s ? c.extras.map((e) => {
|
|
8419
8405
|
let n = gi(u, e);
|
|
8420
8406
|
return /* @__PURE__ */ o("section", {
|
|
8421
|
-
className:
|
|
8407
|
+
className: Od.element,
|
|
8422
8408
|
children: [/* @__PURE__ */ a("h3", {
|
|
8423
|
-
className:
|
|
8409
|
+
className: Od["section-title"],
|
|
8424
8410
|
children: e.name
|
|
8425
|
-
}), /* @__PURE__ */ a(
|
|
8426
|
-
element:
|
|
8427
|
-
item:
|
|
8411
|
+
}), /* @__PURE__ */ a(Ed, {
|
|
8412
|
+
element: Pd(e),
|
|
8413
|
+
item: Fd(n),
|
|
8428
8414
|
messages: t,
|
|
8429
8415
|
showAnswer: !1
|
|
8430
8416
|
})]
|
|
8431
8417
|
}, e.extraKey);
|
|
8432
8418
|
}) : null]
|
|
8433
|
-
}), u.children.length === 0 ? null : /* @__PURE__ */ a(
|
|
8419
|
+
}), u.children.length === 0 ? null : /* @__PURE__ */ a(kd, {
|
|
8434
8420
|
messages: t,
|
|
8435
8421
|
numberPath: n,
|
|
8436
|
-
renderChild: (e, n, i) => /* @__PURE__ */ a(
|
|
8422
|
+
renderChild: (e, n, i) => /* @__PURE__ */ a(Md, {
|
|
8437
8423
|
numberPath: i,
|
|
8438
8424
|
messages: t,
|
|
8439
8425
|
showAnswer: r,
|
|
@@ -8446,17 +8432,17 @@ function Pd({ className: e, messages: t, numberPath: n, showAnswer: r = !1, show
|
|
|
8446
8432
|
value: u
|
|
8447
8433
|
})] });
|
|
8448
8434
|
return /* @__PURE__ */ a("div", {
|
|
8449
|
-
className:
|
|
8450
|
-
children:
|
|
8451
|
-
className:
|
|
8435
|
+
className: Yl(Od.root, e),
|
|
8436
|
+
children: Nd(c, u) ? /* @__PURE__ */ a("div", {
|
|
8437
|
+
className: Od.empty,
|
|
8452
8438
|
children: t.previewEmpty
|
|
8453
8439
|
}) : d
|
|
8454
8440
|
});
|
|
8455
8441
|
}
|
|
8456
|
-
function
|
|
8442
|
+
function Nd(e, t) {
|
|
8457
8443
|
return ci(e) && t.children.length === 0;
|
|
8458
8444
|
}
|
|
8459
|
-
function
|
|
8445
|
+
function Pd(e) {
|
|
8460
8446
|
return {
|
|
8461
8447
|
config: {},
|
|
8462
8448
|
elementKey: e.extraKey,
|
|
@@ -8464,14 +8450,14 @@ function Id(e) {
|
|
|
8464
8450
|
type: "richText"
|
|
8465
8451
|
};
|
|
8466
8452
|
}
|
|
8467
|
-
function
|
|
8453
|
+
function Fd(e) {
|
|
8468
8454
|
return {
|
|
8469
8455
|
content: e.content,
|
|
8470
8456
|
elementKey: e.extraKey,
|
|
8471
8457
|
type: "richText"
|
|
8472
8458
|
};
|
|
8473
8459
|
}
|
|
8474
|
-
var
|
|
8460
|
+
var Id = {
|
|
8475
8461
|
root: "_root_17bqr_1",
|
|
8476
8462
|
toolbar: "_toolbar_17bqr_26",
|
|
8477
8463
|
"toolbar-title": "_toolbar-title_17bqr_36",
|
|
@@ -8523,7 +8509,7 @@ var Rd = {
|
|
|
8523
8509
|
"palette-section": "_palette-section_vhj2r_56",
|
|
8524
8510
|
"palette-section-title": "_palette-section-title_vhj2r_62",
|
|
8525
8511
|
"palette-button": "_palette-button_vhj2r_70"
|
|
8526
|
-
},
|
|
8512
|
+
}, Ld = {
|
|
8527
8513
|
"en-US": {
|
|
8528
8514
|
addElement: "Add element",
|
|
8529
8515
|
addExtra: "Add extra attribute",
|
|
@@ -8741,24 +8727,24 @@ var Rd = {
|
|
|
8741
8727
|
wordBuilderLabel: "\u7ec4\u8bcd\u62fc\u5199"
|
|
8742
8728
|
}
|
|
8743
8729
|
};
|
|
8744
|
-
function
|
|
8730
|
+
function Rd(e, t) {
|
|
8745
8731
|
var n;
|
|
8746
8732
|
return (n = e.extraDescriptions.get(t)) == null ? t : n;
|
|
8747
8733
|
}
|
|
8748
|
-
function
|
|
8734
|
+
function zd(e, t) {
|
|
8749
8735
|
var n;
|
|
8750
8736
|
return (n = e.extraLabels.get(t)) == null ? t : n;
|
|
8751
8737
|
}
|
|
8752
|
-
function
|
|
8738
|
+
function Bd(e) {
|
|
8753
8739
|
switch (e) {
|
|
8754
|
-
case "en-US": return
|
|
8755
|
-
case "zh-CN": return
|
|
8740
|
+
case "en-US": return Ld["en-US"];
|
|
8741
|
+
case "zh-CN": return Ld["zh-CN"];
|
|
8756
8742
|
}
|
|
8757
8743
|
}
|
|
8758
|
-
function
|
|
8759
|
-
return t === "richText" ? e.richTextDescription : t === "ordering" ? e.orderingDescription :
|
|
8744
|
+
function Vd(e, t) {
|
|
8745
|
+
return t === "richText" ? e.richTextDescription : t === "ordering" ? e.orderingDescription : Wd(e, t);
|
|
8760
8746
|
}
|
|
8761
|
-
var
|
|
8747
|
+
var Hd = {
|
|
8762
8748
|
choice: (e) => e.optionGroupDescription,
|
|
8763
8749
|
classification: (e) => e.classificationDescription,
|
|
8764
8750
|
fill: (e) => e.blankGroupDescription,
|
|
@@ -8768,7 +8754,7 @@ var Wd = {
|
|
|
8768
8754
|
matching: (e) => e.matchingDescription,
|
|
8769
8755
|
textMarker: (e) => e.textMarkerDescription,
|
|
8770
8756
|
wordBuilder: (e) => e.wordBuilderDescription
|
|
8771
|
-
},
|
|
8757
|
+
}, Ud = {
|
|
8772
8758
|
choice: (e) => e.optionGroupLabel,
|
|
8773
8759
|
classification: (e) => e.classificationLabel,
|
|
8774
8760
|
fill: (e) => e.blankGroupLabel,
|
|
@@ -8779,30 +8765,30 @@ var Wd = {
|
|
|
8779
8765
|
textMarker: (e) => e.textMarkerLabel,
|
|
8780
8766
|
wordBuilder: (e) => e.wordBuilderLabel
|
|
8781
8767
|
};
|
|
8782
|
-
function
|
|
8783
|
-
return
|
|
8768
|
+
function Wd(e, t) {
|
|
8769
|
+
return Hd[t](e);
|
|
8784
8770
|
}
|
|
8785
|
-
function
|
|
8786
|
-
return t === "richText" ? e.richTextLabel : t === "ordering" ? e.orderingLabel :
|
|
8771
|
+
function Gd(e, t) {
|
|
8772
|
+
return t === "richText" ? e.richTextLabel : t === "ordering" ? e.orderingLabel : Kd(e, t);
|
|
8787
8773
|
}
|
|
8788
|
-
function
|
|
8789
|
-
return
|
|
8774
|
+
function Kd(e, t) {
|
|
8775
|
+
return Ud[t](e);
|
|
8790
8776
|
}
|
|
8791
|
-
function
|
|
8777
|
+
function qd(e, t) {
|
|
8792
8778
|
var n;
|
|
8793
8779
|
return (n = e.optionValueLabels.get(t)) == null ? t : n;
|
|
8794
8780
|
}
|
|
8795
|
-
function
|
|
8781
|
+
function Jd(e, t) {
|
|
8796
8782
|
var n;
|
|
8797
8783
|
return (n = e.candidateModeValueLabels.get(t)) == null ? t : n;
|
|
8798
8784
|
}
|
|
8799
|
-
function
|
|
8785
|
+
function Yd(e, t) {
|
|
8800
8786
|
var n;
|
|
8801
8787
|
return (n = e.lineConnectLabelStyleLabels.get(t)) == null ? t : n;
|
|
8802
8788
|
}
|
|
8803
8789
|
//#endregion
|
|
8804
8790
|
//#region src/question/structure-editor/QuestionStructureCanvas.tsx
|
|
8805
|
-
function
|
|
8791
|
+
function Xd({ elements: e, extras: t, labels: n, onDeleteElement: r, onDeleteExtra: i, onMoveElement: s, onSelectElement: c, selectedElementClientId: l }) {
|
|
8806
8792
|
let [u, d] = m(null);
|
|
8807
8793
|
return /* @__PURE__ */ o("section", {
|
|
8808
8794
|
className: Q.panel,
|
|
@@ -8822,7 +8808,7 @@ function Qd({ elements: e, extras: t, labels: n, onDeleteElement: r, onDeleteExt
|
|
|
8822
8808
|
className: Z["element-list"],
|
|
8823
8809
|
children: [
|
|
8824
8810
|
e.map((t, i) => {
|
|
8825
|
-
let f = t.clientId === l, p =
|
|
8811
|
+
let f = t.clientId === l, p = Gd(n, t.type);
|
|
8826
8812
|
return /* @__PURE__ */ o("div", {
|
|
8827
8813
|
className: `${Z["element-card"]} ${f ? Z.active : ""}`,
|
|
8828
8814
|
onClick: () => c(t.clientId),
|
|
@@ -8886,7 +8872,7 @@ function Qd({ elements: e, extras: t, labels: n, onDeleteElement: r, onDeleteExt
|
|
|
8886
8872
|
children: n.extraTitle
|
|
8887
8873
|
}) : null,
|
|
8888
8874
|
t.map((t, r) => {
|
|
8889
|
-
let s = t.clientId === l, f =
|
|
8875
|
+
let s = t.clientId === l, f = zd(n, t.type);
|
|
8890
8876
|
return /* @__PURE__ */ o("div", {
|
|
8891
8877
|
className: `${Z["element-card"]} ${s ? Z.active : ""}`,
|
|
8892
8878
|
onClick: () => c(t.clientId),
|
|
@@ -8935,7 +8921,7 @@ function Qd({ elements: e, extras: t, labels: n, onDeleteElement: r, onDeleteExt
|
|
|
8935
8921
|
}
|
|
8936
8922
|
//#endregion
|
|
8937
8923
|
//#region src/question/structure-editor/QuestionStructurePalette.tsx
|
|
8938
|
-
function
|
|
8924
|
+
function Zd({ addedExtraTypes: e, labels: t, onAddElement: n, onAddExtra: r }) {
|
|
8939
8925
|
let i = new Set(e);
|
|
8940
8926
|
return /* @__PURE__ */ o("aside", {
|
|
8941
8927
|
className: Q.panel,
|
|
@@ -8950,11 +8936,11 @@ function $d({ addedExtraTypes: e, labels: t, onAddElement: n, onAddExtra: r }) {
|
|
|
8950
8936
|
/* @__PURE__ */ a("div", {
|
|
8951
8937
|
className: Q.palette,
|
|
8952
8938
|
children: Cr.map((e) => /* @__PURE__ */ o("button", {
|
|
8953
|
-
"aria-label": `${t.addElement}: ${
|
|
8939
|
+
"aria-label": `${t.addElement}: ${Gd(t, e)}`,
|
|
8954
8940
|
className: Q["palette-button"],
|
|
8955
8941
|
onClick: () => n(e),
|
|
8956
8942
|
type: "button",
|
|
8957
|
-
children: [/* @__PURE__ */ a("strong", { children:
|
|
8943
|
+
children: [/* @__PURE__ */ a("strong", { children: Gd(t, e) }), /* @__PURE__ */ a("small", { children: Vd(t, e) })]
|
|
8958
8944
|
}, e))
|
|
8959
8945
|
}),
|
|
8960
8946
|
/* @__PURE__ */ o("div", {
|
|
@@ -8967,12 +8953,12 @@ function $d({ addedExtraTypes: e, labels: t, onAddElement: n, onAddExtra: r }) {
|
|
|
8967
8953
|
children: wr.map((e) => {
|
|
8968
8954
|
let n = i.has(e);
|
|
8969
8955
|
return /* @__PURE__ */ o("button", {
|
|
8970
|
-
"aria-label": `${t.addExtra}: ${
|
|
8956
|
+
"aria-label": `${t.addExtra}: ${zd(t, e)}`,
|
|
8971
8957
|
className: Q["palette-button"],
|
|
8972
8958
|
disabled: n,
|
|
8973
8959
|
onClick: () => r(e),
|
|
8974
8960
|
type: "button",
|
|
8975
|
-
children: [/* @__PURE__ */ a("strong", { children:
|
|
8961
|
+
children: [/* @__PURE__ */ a("strong", { children: zd(t, e) }), /* @__PURE__ */ a("small", { children: Rd(t, e) })]
|
|
8976
8962
|
}, e);
|
|
8977
8963
|
})
|
|
8978
8964
|
})]
|
|
@@ -8989,27 +8975,27 @@ var $ = {
|
|
|
8989
8975
|
select: "_select_tgswd_27",
|
|
8990
8976
|
textarea: "_textarea_tgswd_28",
|
|
8991
8977
|
empty: "_empty_tgswd_61"
|
|
8992
|
-
},
|
|
8978
|
+
}, Qd = [
|
|
8993
8979
|
"none",
|
|
8994
8980
|
"sharedPool",
|
|
8995
8981
|
"perBlankOptions"
|
|
8996
|
-
],
|
|
8982
|
+
], $d = [
|
|
8997
8983
|
"upperAlpha",
|
|
8998
8984
|
"lowerAlpha",
|
|
8999
8985
|
"number"
|
|
9000
|
-
],
|
|
8986
|
+
], ef = [
|
|
9001
8987
|
"number",
|
|
9002
8988
|
"upperAlpha",
|
|
9003
8989
|
"lowerAlpha",
|
|
9004
8990
|
"lowerRoman",
|
|
9005
8991
|
"chineseNumber",
|
|
9006
8992
|
"none"
|
|
9007
|
-
],
|
|
8993
|
+
], tf = [
|
|
9008
8994
|
2,
|
|
9009
8995
|
3,
|
|
9010
8996
|
4,
|
|
9011
8997
|
5
|
|
9012
|
-
],
|
|
8998
|
+
], nf = ["standard", "table"], rf = ["single", "multiple"], af = ["spelling", "sentence"], of = [
|
|
9013
8999
|
"correctWrong",
|
|
9014
9000
|
"yesNo",
|
|
9015
9001
|
"validInvalid",
|
|
@@ -9017,8 +9003,8 @@ var $ = {
|
|
|
9017
9003
|
"rightWrong",
|
|
9018
9004
|
"checkCross"
|
|
9019
9005
|
];
|
|
9020
|
-
function
|
|
9021
|
-
let f =
|
|
9006
|
+
function sf({ description: e, globalConfig: t, isSubjective: n, labels: r, onElementChange: i, onExtraChange: s, onGlobalConfigChange: c, onMetadataChange: l, selectedExtra: u, selectedElement: d }) {
|
|
9007
|
+
let f = cf({
|
|
9022
9008
|
labels: r,
|
|
9023
9009
|
onElementChange: i,
|
|
9024
9010
|
onExtraChange: s,
|
|
@@ -9100,7 +9086,7 @@ function lf({ description: e, globalConfig: t, isSubjective: n, labels: r, onEle
|
|
|
9100
9086
|
})]
|
|
9101
9087
|
});
|
|
9102
9088
|
}
|
|
9103
|
-
function
|
|
9089
|
+
function cf({ labels: e, onElementChange: t, onExtraChange: n, selectedElement: r, selectedExtra: i }) {
|
|
9104
9090
|
return r ? /* @__PURE__ */ o("div", {
|
|
9105
9091
|
className: $["form-stack"],
|
|
9106
9092
|
children: [
|
|
@@ -9120,7 +9106,7 @@ function uf({ labels: e, onElementChange: t, onExtraChange: n, selectedElement:
|
|
|
9120
9106
|
value: r.enName
|
|
9121
9107
|
})]
|
|
9122
9108
|
}),
|
|
9123
|
-
|
|
9109
|
+
lf(r, e, t)
|
|
9124
9110
|
]
|
|
9125
9111
|
}) : i ? /* @__PURE__ */ o("div", {
|
|
9126
9112
|
className: $["form-stack"],
|
|
@@ -9144,10 +9130,10 @@ function uf({ labels: e, onElementChange: t, onExtraChange: n, selectedElement:
|
|
|
9144
9130
|
children: e.noElement
|
|
9145
9131
|
});
|
|
9146
9132
|
}
|
|
9147
|
-
function
|
|
9148
|
-
return e.type === "fill" || e.type === "classification" || e.type === "ordering" || e.type === "richText" || e.type === "textMarker" ? null :
|
|
9133
|
+
function lf(e, t, n) {
|
|
9134
|
+
return e.type === "fill" || e.type === "classification" || e.type === "ordering" || e.type === "richText" || e.type === "textMarker" ? null : uf(e, t, n);
|
|
9149
9135
|
}
|
|
9150
|
-
function
|
|
9136
|
+
function uf(e, t, n) {
|
|
9151
9137
|
switch (e.type) {
|
|
9152
9138
|
case "inlineFill": return /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ o("label", {
|
|
9153
9139
|
className: $["form-row"],
|
|
@@ -9155,9 +9141,9 @@ function ff(e, t, n) {
|
|
|
9155
9141
|
className: $.select,
|
|
9156
9142
|
onChange: (t) => n(k(k({}, e), {}, { config: k(k({}, e.config), {}, { candidateMode: t.target.value }) })),
|
|
9157
9143
|
value: e.config.candidateMode,
|
|
9158
|
-
children:
|
|
9144
|
+
children: Qd.map((e) => /* @__PURE__ */ a("option", {
|
|
9159
9145
|
value: e,
|
|
9160
|
-
children:
|
|
9146
|
+
children: Jd(t, e)
|
|
9161
9147
|
}, e))
|
|
9162
9148
|
})]
|
|
9163
9149
|
}), /* @__PURE__ */ o("label", {
|
|
@@ -9174,9 +9160,9 @@ function ff(e, t, n) {
|
|
|
9174
9160
|
className: $.select,
|
|
9175
9161
|
onChange: (t) => n(k(k({}, e), {}, { config: { builderMode: t.target.value } })),
|
|
9176
9162
|
value: e.config.builderMode,
|
|
9177
|
-
children:
|
|
9163
|
+
children: af.map((e) => /* @__PURE__ */ a("option", {
|
|
9178
9164
|
value: e,
|
|
9179
|
-
children:
|
|
9165
|
+
children: qd(t, e)
|
|
9180
9166
|
}, e))
|
|
9181
9167
|
})]
|
|
9182
9168
|
});
|
|
@@ -9186,18 +9172,18 @@ function ff(e, t, n) {
|
|
|
9186
9172
|
className: $.select,
|
|
9187
9173
|
onChange: (t) => n(k(k({}, e), {}, { config: { judgeAnswerMode: t.target.value } })),
|
|
9188
9174
|
value: e.config.judgeAnswerMode,
|
|
9189
|
-
children:
|
|
9175
|
+
children: of.map((e) => /* @__PURE__ */ a("option", {
|
|
9190
9176
|
value: e,
|
|
9191
|
-
children:
|
|
9177
|
+
children: qd(t, e)
|
|
9192
9178
|
}, e))
|
|
9193
9179
|
})]
|
|
9194
9180
|
});
|
|
9195
|
-
case "choice": return
|
|
9196
|
-
case "lineConnect": return
|
|
9197
|
-
case "matching": return
|
|
9181
|
+
case "choice": return df(e, t, n);
|
|
9182
|
+
case "lineConnect": return ff(e, t, n);
|
|
9183
|
+
case "matching": return pf(e, t, n);
|
|
9198
9184
|
}
|
|
9199
9185
|
}
|
|
9200
|
-
function
|
|
9186
|
+
function df(e, t, n) {
|
|
9201
9187
|
return /* @__PURE__ */ o(i, { children: [
|
|
9202
9188
|
/* @__PURE__ */ o("label", {
|
|
9203
9189
|
className: $["form-row"],
|
|
@@ -9205,9 +9191,9 @@ function pf(e, t, n) {
|
|
|
9205
9191
|
className: $.select,
|
|
9206
9192
|
onChange: (t) => n(k(k({}, e), {}, { config: k(k({}, e.config), {}, { selectionType: t.target.value }) })),
|
|
9207
9193
|
value: e.config.selectionType,
|
|
9208
|
-
children:
|
|
9194
|
+
children: rf.map((e) => /* @__PURE__ */ a("option", {
|
|
9209
9195
|
value: e,
|
|
9210
|
-
children:
|
|
9196
|
+
children: qd(t, e)
|
|
9211
9197
|
}, e))
|
|
9212
9198
|
})]
|
|
9213
9199
|
}),
|
|
@@ -9217,9 +9203,9 @@ function pf(e, t, n) {
|
|
|
9217
9203
|
className: $.select,
|
|
9218
9204
|
onChange: (t) => n(k(k({}, e), {}, { config: k(k({}, e.config), {}, { optionLabelStyle: t.target.value }) })),
|
|
9219
9205
|
value: e.config.optionLabelStyle,
|
|
9220
|
-
children:
|
|
9206
|
+
children: $d.map((e) => /* @__PURE__ */ a("option", {
|
|
9221
9207
|
value: e,
|
|
9222
|
-
children:
|
|
9208
|
+
children: qd(t, e)
|
|
9223
9209
|
}, e))
|
|
9224
9210
|
})]
|
|
9225
9211
|
}),
|
|
@@ -9229,23 +9215,23 @@ function pf(e, t, n) {
|
|
|
9229
9215
|
className: $.select,
|
|
9230
9216
|
onChange: (t) => n(k(k({}, e), {}, { config: k(k({}, e.config), {}, { renderer: t.target.value }) })),
|
|
9231
9217
|
value: e.config.renderer,
|
|
9232
|
-
children:
|
|
9218
|
+
children: nf.map((e) => /* @__PURE__ */ a("option", {
|
|
9233
9219
|
value: e,
|
|
9234
|
-
children:
|
|
9220
|
+
children: qd(t, e)
|
|
9235
9221
|
}, e))
|
|
9236
9222
|
})]
|
|
9237
9223
|
})
|
|
9238
9224
|
] });
|
|
9239
9225
|
}
|
|
9240
|
-
function
|
|
9241
|
-
let r =
|
|
9226
|
+
function ff(e, t, n) {
|
|
9227
|
+
let r = mf(e.config.columns);
|
|
9242
9228
|
return /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ o("label", {
|
|
9243
9229
|
className: $["form-row"],
|
|
9244
9230
|
children: [/* @__PURE__ */ a("span", { children: t.lineConnectColumnCount }), /* @__PURE__ */ a("select", {
|
|
9245
9231
|
className: $.select,
|
|
9246
|
-
onChange: (t) => n(k(k({}, e), {}, { config: { columns:
|
|
9232
|
+
onChange: (t) => n(k(k({}, e), {}, { config: { columns: gf(r, Number(t.target.value)) } })),
|
|
9247
9233
|
value: r.length,
|
|
9248
|
-
children:
|
|
9234
|
+
children: tf.map((e) => /* @__PURE__ */ a("option", {
|
|
9249
9235
|
value: e,
|
|
9250
9236
|
children: e
|
|
9251
9237
|
}, e))
|
|
@@ -9256,47 +9242,47 @@ function mf(e, t, n) {
|
|
|
9256
9242
|
className: $.select,
|
|
9257
9243
|
onChange: (t) => n(k(k({}, e), {}, { config: { columns: r.map((e, n) => n === s ? { labelStyle: t.target.value } : e) } })),
|
|
9258
9244
|
value: i.labelStyle,
|
|
9259
|
-
children:
|
|
9245
|
+
children: ef.map((e) => /* @__PURE__ */ a("option", {
|
|
9260
9246
|
value: e,
|
|
9261
|
-
children:
|
|
9247
|
+
children: Yd(t, e)
|
|
9262
9248
|
}, e))
|
|
9263
9249
|
})]
|
|
9264
9250
|
}, `line-column-${s}`))] });
|
|
9265
9251
|
}
|
|
9266
|
-
function
|
|
9267
|
-
let r =
|
|
9252
|
+
function pf(e, t, n) {
|
|
9253
|
+
let r = hf(e.config.columns);
|
|
9268
9254
|
return /* @__PURE__ */ a(i, { children: r.map((i, s) => /* @__PURE__ */ o("label", {
|
|
9269
9255
|
className: $["form-row"],
|
|
9270
9256
|
children: [/* @__PURE__ */ a("span", { children: t.lineConnectColumnLabel(s + 1) }), /* @__PURE__ */ a("select", {
|
|
9271
9257
|
className: $.select,
|
|
9272
9258
|
onChange: (t) => n(k(k({}, e), {}, { config: { columns: r.map((e, n) => n === s ? { labelStyle: t.target.value } : e) } })),
|
|
9273
9259
|
value: i.labelStyle,
|
|
9274
|
-
children:
|
|
9260
|
+
children: ef.map((e) => /* @__PURE__ */ a("option", {
|
|
9275
9261
|
value: e,
|
|
9276
|
-
children:
|
|
9262
|
+
children: Yd(t, e)
|
|
9277
9263
|
}, e))
|
|
9278
9264
|
})]
|
|
9279
9265
|
}, `matching-column-${s}`)) });
|
|
9280
9266
|
}
|
|
9281
|
-
function
|
|
9267
|
+
function mf(e) {
|
|
9282
9268
|
let t = e.slice(0, 5);
|
|
9283
|
-
return t.length >= 2 ? t : [...t, ...
|
|
9269
|
+
return t.length >= 2 ? t : [...t, ...ef.slice(t.length, 2).map((e) => ({ labelStyle: e }))];
|
|
9284
9270
|
}
|
|
9285
|
-
function
|
|
9271
|
+
function hf(e) {
|
|
9286
9272
|
let t = e.slice(0, 2);
|
|
9287
|
-
return t.length >= 2 ? t : [...t, ...
|
|
9273
|
+
return t.length >= 2 ? t : [...t, ...ef.slice(t.length, 2).map((e) => ({ labelStyle: e }))];
|
|
9288
9274
|
}
|
|
9289
|
-
function
|
|
9275
|
+
function gf(e, t) {
|
|
9290
9276
|
return Array.from({ length: Math.min(5, Math.max(2, t)) }, (t, n) => {
|
|
9291
9277
|
var r, i;
|
|
9292
|
-
return (r = e.slice(n, n + 1)[0]) == null ? { labelStyle: (i =
|
|
9278
|
+
return (r = e.slice(n, n + 1)[0]) == null ? { labelStyle: (i = ef[n]) == null ? "number" : i } : r;
|
|
9293
9279
|
});
|
|
9294
9280
|
}
|
|
9295
9281
|
//#endregion
|
|
9296
9282
|
//#region src/question/structure-editor/QuestionStructureEditor.tsx
|
|
9297
|
-
function
|
|
9283
|
+
function _f({ locale: e = "zh-CN", onChange: t, value: n }) {
|
|
9298
9284
|
var r, i, s, c;
|
|
9299
|
-
let l =
|
|
9285
|
+
let l = Bd(e), [u, d] = m((r = (i = n.elements[0]) == null ? void 0 : i.clientId) == null ? null : r), { selectedElement: f, selectedExtra: p } = vf(n, u);
|
|
9300
9286
|
function h(e) {
|
|
9301
9287
|
let r = jr(e, n.elements);
|
|
9302
9288
|
t(k(k({}, n), {}, { elements: [...n.elements, r] })), d(r.clientId);
|
|
@@ -9308,11 +9294,11 @@ function yf({ locale: e = "zh-CN", onChange: t, value: n }) {
|
|
|
9308
9294
|
}
|
|
9309
9295
|
function _(e) {
|
|
9310
9296
|
let r = Fr(n, e);
|
|
9311
|
-
t(r), d(
|
|
9297
|
+
t(r), d(yf(r));
|
|
9312
9298
|
}
|
|
9313
9299
|
function v(e) {
|
|
9314
9300
|
let r = Pr(n, e);
|
|
9315
|
-
t(r), d(
|
|
9301
|
+
t(r), d(yf(r));
|
|
9316
9302
|
}
|
|
9317
9303
|
function y(e) {
|
|
9318
9304
|
t(Rr(n, e.clientId, e));
|
|
@@ -9327,19 +9313,19 @@ function yf({ locale: e = "zh-CN", onChange: t, value: n }) {
|
|
|
9327
9313
|
t(Br(n, e));
|
|
9328
9314
|
}
|
|
9329
9315
|
return /* @__PURE__ */ a("section", {
|
|
9330
|
-
className:
|
|
9316
|
+
className: Id.root,
|
|
9331
9317
|
children: /* @__PURE__ */ a("div", {
|
|
9332
9318
|
className: Q.shell,
|
|
9333
9319
|
children: /* @__PURE__ */ o("div", {
|
|
9334
9320
|
className: Q.grid,
|
|
9335
9321
|
children: [
|
|
9336
|
-
/* @__PURE__ */ a(
|
|
9322
|
+
/* @__PURE__ */ a(Zd, {
|
|
9337
9323
|
addedExtraTypes: n.extras.map((e) => e.type),
|
|
9338
9324
|
labels: l,
|
|
9339
9325
|
onAddElement: h,
|
|
9340
9326
|
onAddExtra: g
|
|
9341
9327
|
}),
|
|
9342
|
-
/* @__PURE__ */ a(
|
|
9328
|
+
/* @__PURE__ */ a(Xd, {
|
|
9343
9329
|
elements: n.elements,
|
|
9344
9330
|
extras: n.extras,
|
|
9345
9331
|
labels: l,
|
|
@@ -9349,7 +9335,7 @@ function yf({ locale: e = "zh-CN", onChange: t, value: n }) {
|
|
|
9349
9335
|
onSelectElement: d,
|
|
9350
9336
|
selectedElementClientId: (s = (c = f == null ? void 0 : f.clientId) == null ? p == null ? void 0 : p.clientId : c) == null ? null : s
|
|
9351
9337
|
}),
|
|
9352
|
-
/* @__PURE__ */ a(
|
|
9338
|
+
/* @__PURE__ */ a(sf, {
|
|
9353
9339
|
description: n.description,
|
|
9354
9340
|
globalConfig: n.globalConfig,
|
|
9355
9341
|
isSubjective: n.isSubjective,
|
|
@@ -9366,7 +9352,7 @@ function yf({ locale: e = "zh-CN", onChange: t, value: n }) {
|
|
|
9366
9352
|
})
|
|
9367
9353
|
});
|
|
9368
9354
|
}
|
|
9369
|
-
function
|
|
9355
|
+
function vf(e, t) {
|
|
9370
9356
|
var n, r, i, a;
|
|
9371
9357
|
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;
|
|
9372
9358
|
return o || s ? {
|
|
@@ -9377,9 +9363,9 @@ function bf(e, t) {
|
|
|
9377
9363
|
selectedExtra: e.elements[0] || (a = e.extras[0]) == null ? null : a
|
|
9378
9364
|
};
|
|
9379
9365
|
}
|
|
9380
|
-
function
|
|
9366
|
+
function yf(e) {
|
|
9381
9367
|
var t, n, r, i;
|
|
9382
9368
|
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;
|
|
9383
9369
|
}
|
|
9384
9370
|
//#endregion
|
|
9385
|
-
export {
|
|
9371
|
+
export { Kc as QuestionContentEditor, ad as QuestionPlayer, jd as QuestionPreview, K as QuestionRichContentView, _f as QuestionStructureEditor, Wi as addBlankToGroup, Ji as assignBlankToAnswerGroup, Ks as cn, Yi as createBlankAnswerGroupWithBlank, li as createEmptyQuestionContentDraft, Xn as createEmptyQuestionData, ll as createEmptyQuestionPlayerResponse, Qn as createEmptyQuestionResponse, kr as createEmptyQuestionStructureDraft, Si as createQuestionContentDraftFromSerialized, Yc as createQuestionContentStructureFromDraft, Xc as createQuestionPreviewDraft, jr as createQuestionStructureElement, Ar as createQuestionStructureExtra, M as createRichContentValue, ui as createRichContentValueFromDocument, v as createRichTextContent, Gi as deleteBlankFromGroup, Fr as deleteQuestionStructureElement, Pr as deleteQuestionStructureExtra, Xi as detachBlankFromAnswerGroup, Rc as findQuestionContentSubquestionTemplate, gi as getQuestionContentExtraItem, hi as getQuestionContentItem, yi as getQuestionContentJudgementOptions, N as getQuestionContentOptionMarker, pi as getQuestionContentTextMarkerAnswerText, Qc as getQuestionStructureDraftChangeKind, j as getQuestionStructureElementDefaultEnName, A as getQuestionStructureElementDefaultName, Hr as getQuestionStructureExtraDefaultEnName, Vr as getQuestionStructureExtraDefaultName, mi as getRichContentDocument, qi as getSharedBlankAnswerGroups, ci as isCompositeQuestionContentStructure, er as isCompositeQuestionType, bi as isQuestionContentDraftEmpty, Lc as isQuestionContentSubquestionTemplateMatch, Ir as moveQuestionStructureElement, ji as normalizeFillTextCandidateState, Zn as normalizeQuestionData, $n as normalizeQuestionResponse, y as normalizeRichTextContent, Cr as questionStructureElementTypes, wr as questionStructureExtraKeys, xi as serializeQuestionContentDraft, Zc as serializeQuestionStructureDraft, wi as updateQuestionContentExtraItem, Ci as updateQuestionContentItem, Rr as updateQuestionStructureElement, Lr as updateQuestionStructureExtra, zr as updateQuestionStructureGlobalConfig, Br as updateQuestionStructureMetadata, rr as validateQuestionDataElementAlignment };
|