UNPKG

cthep-ui-vue3

Version:

Vue 3 试题组件库

1,267 lines 471 kB
import { reactive as $t, onMounted as bs, resolveComponent as Nt, createElementBlock as $, openBlock as V, createElementVNode as n, createCommentVNode as Ge, toDisplayString as Xe, createVNode as ht, withCtx as Rt, Fragment as ft, renderList as _t, createBlock as Pt, normalizeClass as Kt, createTextVNode as Re, normalizeStyle as Qt, ref as He, getCurrentInstance as fn, toRefs as _n, watch as ls, unref as Zt, withDirectives as Ls, withModifiers as pn, vShow as Cs, withKeys as hn, createStaticVNode as mn, resolveDirective as gn } from "vue"; import { Base64 as Is } from "js-base64"; import { fabric as vn } from "fabric"; import { VueDraggable as bn } from "vue-draggable-plus"; import { ElMessage as js } from "element-plus"; import { uuid as Os } from "vue-uuid"; import Ys from "fast-xml-parser"; import Us from "crypto-js"; function wn(T) { for (var a = T.length, u, F; a > 0; ) u = Math.floor(Math.random() * a), F = T[a - 1], T[a - 1] = T[u], T[u] = F, a--; return T; } function Rs(T) { let a = JSON.parse(JSON.stringify(T)), u = a.indexOf("<img"); for (; u !== -1; ) { let F = a.substring(u, a.indexOf(">", u + 1) + 1); if (F.indexOf("mathTypeImage") !== -1) { let A = F.indexOf('attribute="') + 11; a = a.replace( //将img替换成Base64转换后的值 F, Is.decode( F.substring( A, F.indexOf('"', A + 1) ) ) ); } u = a.indexOf("<img", u + 1); } return a = a.replace(/mml:/g, ""), a; } function Qs(T) { return T.subjectEditorValue && (T.subjectEditorValue = Rs(T.subjectEditorValue)), T.explainEditorValue && (T.explainEditorValue = Rs(T.explainEditorValue)), T.answerEditorValue && (T.answerEditorValue = Rs(T.answerEditorValue)), ["dan_xuan", "duo_xuan", "pan_duan", "any_xuan", "tian_kong"].includes(T.questionTypeBase) && T.options.forEach((a) => { a.optionTextValue && (a.optionTextValue = Rs(a.optionTextValue)), a.optionTipEditorValue && (a.optionTipEditorValue = Rs(a.optionTipEditorValue)); }), ["zong_he"].includes(T.questionTypeBase) && T.subQuestionList.forEach((a) => { a = Qs(a); }), T; } const Jt = (T, a) => { const u = T.__vccOpts || T; for (const [F, A] of a) u[F] = A; return u; }, yn = { class: "singChoice" }, Sn = { class: "tiBox" }, xn = { class: "tiNumber" }, Tn = { class: "tiContent" }, kn = ["innerHTML"], Vn = ["innerHTML"], Mn = { key: 0 }, An = { class: "answerTips" }, Rn = { key: 0, class: "reAnswered", "aria-hidden": "true" }, Bn = { key: 1, class: "reTrue", "aria-hidden": "true" }, En = { key: 2, class: "reFalse", "aria-hidden": "true" }, Ln = { class: "reckT" }, In = { class: "solution analysis" }, Cn = ["innerHTML"], Pn = { class: "solutionTitle" }, Hn = { style: { color: "#50ca45", "font-weight": "600" } }, $n = { class: "solutionTitle" }, On = { style: { color: "#50ca45", "font-weight": "600" } }, Nn = { __name: "SingChoice", props: { modelValue: { type: Object, default: () => ({}) }, keys: { type: Number, default: 0 }, restore: { type: Boolean, default: !1 }, background: { type: String, default: "#fffad6" }, isPreview: { type: Boolean, default: !0 } }, emits: ["SingChoiceEmit"], setup(T, { emit: a }) { const u = T, F = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"], A = $t({ optionIndex: null, isRight: null, answer: null, qAnswer: null }), w = (B) => { u.modelValue.options.forEach((b, oe) => { (b.optionIndex == B || !b.optionIndex && oe == B - 1) && (A.isRight = b.isAnswer), b.isAnswer && (A.qAnswer = b.optionIndex); }), u.modelValue.answers = Object.assign(u.modelValue.answers, { id: u.modelValue.id, questionUuid: u.modelValue.questionUuid, getScore: A.isRight ? u.modelValue.answers.score - 0 : 0, type: u.modelValue.questionTypeBase, answer: F[B - 1], isRight: A.isRight, isAnswered: A.isRight != null ? "true" : "false" }); }; return bs(() => { }), (B, b) => { const oe = Nt("el-radio"), ae = Nt("el-radio-group"); return V(), $("div", yn, [ n("section", Sn, [ n("span", xn, Xe(u.modelValue.id) + ".", 1), n("div", Tn, [ n("div", { class: "opImg tiganContent", innerHTML: u.modelValue.subjectEditorValue }, null, 8, kn), ht(ae, { modelValue: u.modelValue.answers.optionIndex, "onUpdate:modelValue": b[0] || (b[0] = (pe) => u.modelValue.answers.optionIndex = pe), onChange: w, class: "tiOption" }, { default: Rt(() => [ (V(!0), $(ft, null, _t(u.modelValue.options, (pe, ye) => (V(), Pt(oe, { key: ye, disabled: u.restore || u.isPreview, value: pe.optionIndex ? pe.optionIndex : ye + 1 }, { default: Rt(() => [ n("span", { style: { display: "flex", "align-items": "center" }, class: Kt(u.restore ? "isColor" : "") }, [ Re(Xe(F[ye]) + ". ", 1), n("span", { innerHTML: pe.optionTextValue }, null, 8, Vn) ], 2) ]), _: 2 }, 1032, ["disabled", "value"]))), 128)) ]), _: 1 }, 8, ["modelValue"]) ]), u.restore ? (V(), $("div", Mn, [ n("div", An, [ u.modelValue.answers.isAnswered ? u.modelValue.answers.isRight ? (V(), $("span", Bn, b[2] || (b[2] = [ n("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "20", height: "20" }, [ n("path", { fill: "none", d: "M0 0h24v24H0z" }), n("path", { d: "M10 15.172l9.192-9.193 1.415 1.414L10 18l-6.364-6.364 1.414-1.414z", fill: "rgba(0,182,0,1)" }) ], -1), Re("回答正确 ") ]))) : u.modelValue.answers.isRight ? Ge("", !0) : (V(), $("span", En, b[3] || (b[3] = [ n("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "20", height: "20" }, [ n("path", { fill: "none", d: "M0 0h24v24H0z" }), n("path", { d: "M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z", fill: "rgba(221,61,61,1)" }) ], -1), Re("回答错误 ") ]))) : (V(), $("span", Rn, b[1] || (b[1] = [ n("b", { style: { color: "#ffffff", "padding-top": "5px", display: "inline-block" } }, "?", -1), Re("本题未答 ") ]))) ]), n("section", { class: "reck", style: Qt({ background: T.background }) }, [ n("span", null, [ b[4] || (b[4] = Re(" 参考答案:")), n("span", Ln, Xe(Array.isArray(u.modelValue.answers.qAnswer) ? u.modelValue.answers.qAnswer[0] : u.modelValue.answers.qAnswer), 1) ]), n("span", null, [ b[5] || (b[5] = Re("我的答案:")), n("span", { class: Kt(["reckT", u.modelValue.answers.isRight == !0 ? "standardTrue" : u.modelValue.answers.isRight == !1 ? "standardFalse" : "standardHalfTrue"]) }, Xe(u.modelValue.answers.answer[0]), 3) ]) ], 4), n("section", In, [ n("ul", null, [ n("li", null, [ b[6] || (b[6] = n("span", { class: "solutionTitle" }, "参考解析:", -1)), n("div", { class: "solutionBody jiexi", innerHTML: u.modelValue.explainEditorValue }, null, 8, Cn) ]), n("li", null, [ n("span", Pn, [ b[7] || (b[7] = Re("本题得分:")), n("span", Hn, Xe(u.modelValue.answers.getScore), 1), b[8] || (b[8] = Re("分")) ]) ]), n("li", null, [ n("span", $n, [ b[9] || (b[9] = Re("本题满分:")), n("span", On, Xe(u.modelValue.answers.score), 1), b[10] || (b[10] = Re("分")) ]) ]) ]) ]) ])) : Ge("", !0) ]) ]); }; } }, Ks = /* @__PURE__ */ Jt(Nn, [["__scopeId", "data-v-ff5bc43e"]]), jn = { class: "multipleChoice" }, Un = { class: "tiBox" }, Fn = { class: "tiNumber" }, qn = { class: "tiContent" }, Dn = ["innerHTML"], zn = { style: { display: "flex", "align-items": "flex-start", "vertical-align": "top" } }, Xn = { class: "tiContentSpan" }, Yn = ["innerHTML"], Qn = { key: 0 }, Kn = { class: "answerTips" }, Zn = { key: 0, class: "reAnswered", "aria-hidden": "true" }, Gn = { key: 1, class: "reTrue", "aria-hidden": "true" }, Wn = { key: 2, class: "reFalse", "aria-hidden": "true" }, Jn = { key: 3, class: "reHalfTrue", "aria-hidden": "true" }, ea = { key: 0, class: "reckT" }, ta = { key: 1, class: "reckT" }, sa = { key: 0 }, na = { key: 1 }, aa = { class: "solution analysis" }, ia = ["innerHTML"], la = { class: "solutionTitle" }, oa = { style: { color: "#50ca45", "font-weight": "600" } }, ra = { class: "solutionTitle" }, ua = { style: { color: "#50ca45", "font-weight": "600" } }, da = { __name: "MultipleChoice", props: { modelValue: { type: Object, default: () => ({}) }, keys: { type: Number, default: 0 }, restore: { type: Boolean, default: !1 }, background: { type: String, default: "#fffad6" }, isPreview: { type: Boolean, default: !0 } }, setup(T) { const a = T, u = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"], F = $t({ optionIndex: null, isRight: null, answer: null, qAnswer: null, getScoreLs: 0 }), A = He(!1), w = () => { let B = []; F.qAnswer = [], A.value = !0, F.getScoreLs = 0, a.modelValue.options.forEach((oe) => { oe.isAnswer && B.push(u[oe.optionIndex - 1]); }); const b = ((a.modelValue.answers.score - 0) / B.length).toFixed(2) - 0; a.modelValue.options.forEach((oe) => { a.modelValue.answers.answerObj.forEach((ae) => { oe.isAnswer ? ae === u[oe.optionIndex - 1] && (F.getScoreLs += b - 0) : ae === u[oe.optionIndex - 1] && (A.value = !1); }); }), a.modelValue.answers.answerObj.sort().toString() === B.sort().toString() ? (F.isRight = !0, F.getScoreLs = a.modelValue.answers.score - 0) : A.value ? F.isRight = "trueFalse" : (F.isRight = !1, F.getScoreLs = 0), a.modelValue.answers = Object.assign(a.modelValue.answers, { id: a.modelValue.id, questionUuid: a.modelValue.questionUuid, getScore: F.getScoreLs, type: a.modelValue.questionTypeBase, answer: a.modelValue.answers.answerObj, answerObj: a.modelValue.answers.answerObj, isAnswered: F.isRight != null ? "true" : "false", isRight: F.isRight }); }; return (B, b) => { const oe = Nt("el-checkbox"), ae = Nt("el-checkbox-group"); return V(), $("div", jn, [ n("section", Un, [ n("span", Fn, Xe(a.modelValue.id) + ".", 1), n("div", qn, [ n("div", { class: "opImg tiganContent", style: { display: "flex", "align-items": "center", "flex-wrap": "wrap" }, innerHTML: a.modelValue.subjectEditorValue }, null, 8, Dn), ht(ae, { modelValue: a.modelValue.answers.answerObj, "onUpdate:modelValue": b[0] || (b[0] = (pe) => a.modelValue.answers.answerObj = pe), onChange: w, class: "tiOption", disabled: a.restore || a.isPreview }, { default: Rt(() => [ (V(!0), $(ft, null, _t(a.modelValue.options, (pe, ye) => (V(), Pt(oe, { key: ye, value: pe.optionIndex ? u[pe.optionIndex - 1] : u[ye] }, { default: Rt(() => [ n("span", zn, [ n("span", Xn, Xe(u[ye]) + ". ", 1), n("span", { innerHTML: pe.optionTextValue, class: "tiContentSpan", style: { display: "flex", "align-items": "center" } }, null, 8, Yn) ]) ]), _: 2 }, 1032, ["value"]))), 128)) ]), _: 1 }, 8, ["modelValue", "disabled"]) ]), a.restore ? (V(), $("div", Qn, [ n("div", Kn, [ a.modelValue.answers.isAnswered ? a.modelValue.answers.isRight == !0 ? (V(), $("span", Gn, b[2] || (b[2] = [ n("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "20", height: "20" }, [ n("path", { fill: "none", d: "M0 0h24v24H0z" }), n("path", { d: "M10 15.172l9.192-9.193 1.415 1.414L10 18l-6.364-6.364 1.414-1.414z", fill: "rgba(0,182,0,1)" }) ], -1), Re("回答正确 ") ]))) : a.modelValue.answers.isRight == !1 ? (V(), $("span", Wn, b[3] || (b[3] = [ n("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "20", height: "20" }, [ n("path", { fill: "none", d: "M0 0h24v24H0z" }), n("path", { d: "M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z", fill: "rgba(221,61,61,1)" }) ], -1), Re("回答错误 ") ]))) : a.modelValue.answers.isRight == "trueFalse" ? (V(), $("span", Jn, b[4] || (b[4] = [ n("svg", { t: "1668049716312", class: "icon", viewBox: "0 0 1024 1024", version: "1.1", xmlns: "http://www.w3.org/2000/svg", "p-id": "7502", width: "20", height: "20" }, [ n("path", { d: "M863.3 296c-12.8-15.2-35.5-17.2-50.7-4.4L624.1 449.7l-64.7-77.1c-12.8-15.2-35.5-17.2-50.7-4.4-15.2 12.8-17.2 35.5-4.4 50.7L569 496 379 655.4 215.9 461.1c-12.8-15.2-35.5-17.2-50.7-4.4-15.2 12.8-17.2 35.5-4.4 50.7L345.9 728c7.4 8.8 18.1 13.2 28.8 12.8 8.6 0.3 17.4-2.4 24.6-8.4l216-181.3 74.1 88.3c12.8 15.2 35.5 17.2 50.7 4.4 15.2-12.8 17.2-35.5 4.4-50.7l-74.1-88.3 188.4-158.1C874 334 876 311.3 863.3 296z", "p-id": "7503", fill: "#FF8F49" }) ], -1), Re("不完全正确 ") ]))) : Ge("", !0) : (V(), $("span", Zn, b[1] || (b[1] = [ n("b", { style: { color: "#ffffff", "padding-top": "5px", display: "inline-block" } }, "?", -1), Re("本题未答 ") ]))) ]), n("section", { class: "reck", style: Qt({ background: T.background }) }, [ n("span", null, [ n("span", null, [ b[5] || (b[5] = Re(" 参考答案:")), Array.isArray(a.modelValue.answers.qAnswer) ? (V(), $("span", ea, [ (V(!0), $(ft, null, _t(a.modelValue.answers.qAnswer, (pe, ye) => (V(), $("i", { key: ye }, Xe(pe), 1))), 128)) ])) : (V(), $("span", ta, [ n("i", null, Xe(a.modelValue.answers.qAnswer), 1) ])) ]) ]), n("span", null, [ b[6] || (b[6] = Re("我的答案:")), n("span", { class: Kt(["reckT", a.modelValue.answers.isRight == !0 ? "standardTrue" : a.modelValue.answers.isRight == !1 ? "standardFalse" : "standardHalfTrue"]) }, [ (V(!0), $(ft, null, _t(a.modelValue.answers.answerObj, (pe, ye) => (V(), $("i", { key: ye }, [ Array.isArray(pe) ? (V(), $("span", sa, [ (V(!0), $(ft, null, _t(pe, (K, ce) => (V(), $("span", { key: ce }, Xe(K), 1))), 128)) ])) : (V(), $("span", na, Xe(pe), 1)) ]))), 128)) ], 2) ]) ], 4), n("section", aa, [ n("ul", null, [ n("li", null, [ b[7] || (b[7] = n("span", { class: "solutionTitle" }, "参考解析:", -1)), n("div", { class: "solutionBody jiexi", innerHTML: a.modelValue.explainEditorValue }, null, 8, ia) ]), n("li", null, [ n("span", la, [ b[8] || (b[8] = Re("本题得分:")), n("span", oa, Xe(a.modelValue.answers.getScore), 1), b[9] || (b[9] = Re("分")) ]) ]), n("li", null, [ n("span", ra, [ b[10] || (b[10] = Re("本题满分:")), n("span", ua, Xe(a.modelValue.answers.score), 1), b[11] || (b[11] = Re("分")) ]) ]) ]) ]) ])) : Ge("", !0) ]) ]); }; } }, Zs = /* @__PURE__ */ Jt(da, [["__scopeId", "data-v-899996a7"]]), ca = { class: "multipleChoice" }, fa = { class: "tiBox" }, _a = { class: "tiNumber" }, pa = { class: "tiContent" }, ha = ["innerHTML"], ma = { style: { display: "flex", "align-items": "flex-start", "vertical-align": "top" } }, ga = { class: "tiContentSpan" }, va = ["innerHTML"], ba = { key: 0 }, wa = { class: "answerTips" }, ya = { key: 0, class: "reAnswered", "aria-hidden": "true" }, Sa = { key: 1, class: "reTrue", "aria-hidden": "true" }, xa = { key: 2, class: "reFalse", "aria-hidden": "true" }, Ta = { key: 3, class: "reHalfTrue", "aria-hidden": "true" }, ka = { key: 0, class: "reckT" }, Va = { key: 1, class: "reckT" }, Ma = { key: 0 }, Aa = { key: 1 }, Ra = { class: "solution analysis" }, Ba = ["innerHTML"], Ea = { class: "solutionTitle" }, La = { style: { color: "#50ca45", "font-weight": "600" } }, Ia = { class: "solutionTitle" }, Ca = { style: { color: "#50ca45", "font-weight": "600" } }, Pa = { __name: "Nondirectional", props: { modelValue: { type: Object, default: () => ({}) }, keys: { type: Number, default: 0 }, restore: { type: Boolean, default: !1 }, background: { type: String, default: "#fffad6" }, isPreview: { type: Boolean, default: !0 } }, setup(T) { const a = T, u = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"], F = $t({ optionIndex: null, isRight: null, answer: null, qAnswer: null, getScoreLs: 0 }), A = He(!1), w = () => { let B = []; F.qAnswer = [], A.value = !0, F.getScoreLs = 0, a.modelValue.options.forEach((oe) => { oe.isAnswer && B.push(u[oe.optionIndex - 1]); }); const b = ((a.modelValue.answers.score - 0) / B.length).toFixed(2) - 0; a.modelValue.options.forEach((oe) => { a.modelValue.answers.answerObj.forEach((ae) => { oe.isAnswer ? ae === u[oe.optionIndex - 1] && (F.getScoreLs += b - 0) : ae === u[oe.optionIndex - 1] && (A.value = !1); }); }), a.modelValue.answers.answerObj.sort().toString() === B.sort().toString() ? (F.isRight = !0, F.getScoreLs = a.modelValue.answers.score - 0) : A.value ? F.isRight = "trueFalse" : (F.isRight = !1, F.getScoreLs = 0), a.modelValue.answers = Object.assign(a.modelValue.answers, { id: a.modelValue.id, questionUuid: a.modelValue.questionUuid, getScore: F.getScoreLs, type: a.modelValue.questionTypeBase, answer: a.modelValue.answers.answerObj, answerObj: a.modelValue.answers.answerObj, isAnswered: F.isRight != null ? "true" : "false", isRight: F.isRight }); }; return (B, b) => { const oe = Nt("el-checkbox"), ae = Nt("el-checkbox-group"); return V(), $("div", ca, [ n("section", fa, [ n("span", _a, Xe(a.modelValue.id) + ".", 1), n("div", pa, [ n("div", { class: "opImg tiganContent", style: { display: "flex", "align-items": "center", "flex-wrap": "wrap" }, innerHTML: a.modelValue.subjectEditorValue }, null, 8, ha), ht(ae, { modelValue: a.modelValue.answers.answerObj, "onUpdate:modelValue": b[0] || (b[0] = (pe) => a.modelValue.answers.answerObj = pe), onChange: w, class: "tiOption", disabled: a.restore || a.isPreview }, { default: Rt(() => [ (V(!0), $(ft, null, _t(a.modelValue.options, (pe, ye) => (V(), Pt(oe, { key: ye, value: pe.optionIndex ? u[pe.optionIndex - 1] : u[ye] }, { default: Rt(() => [ n("span", ma, [ n("span", ga, Xe(u[ye]) + ". ", 1), n("span", { innerHTML: pe.optionTextValue, class: "tiContentSpan", style: { display: "flex", "align-items": "center" } }, null, 8, va) ]) ]), _: 2 }, 1032, ["value"]))), 128)) ]), _: 1 }, 8, ["modelValue", "disabled"]) ]), a.restore ? (V(), $("div", ba, [ n("div", wa, [ a.modelValue.answers.isAnswered ? a.modelValue.answers.isRight == !0 ? (V(), $("span", Sa, b[2] || (b[2] = [ n("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "20", height: "20" }, [ n("path", { fill: "none", d: "M0 0h24v24H0z" }), n("path", { d: "M10 15.172l9.192-9.193 1.415 1.414L10 18l-6.364-6.364 1.414-1.414z", fill: "rgba(0,182,0,1)" }) ], -1), Re("回答正确 ") ]))) : a.modelValue.answers.isRight == !1 ? (V(), $("span", xa, b[3] || (b[3] = [ n("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "20", height: "20" }, [ n("path", { fill: "none", d: "M0 0h24v24H0z" }), n("path", { d: "M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z", fill: "rgba(221,61,61,1)" }) ], -1), Re("回答错误 ") ]))) : a.modelValue.answers.isRight == "trueFalse" ? (V(), $("span", Ta, b[4] || (b[4] = [ n("svg", { t: "1668049716312", class: "icon", viewBox: "0 0 1024 1024", version: "1.1", xmlns: "http://www.w3.org/2000/svg", "p-id": "7502", width: "20", height: "20" }, [ n("path", { d: "M863.3 296c-12.8-15.2-35.5-17.2-50.7-4.4L624.1 449.7l-64.7-77.1c-12.8-15.2-35.5-17.2-50.7-4.4-15.2 12.8-17.2 35.5-4.4 50.7L569 496 379 655.4 215.9 461.1c-12.8-15.2-35.5-17.2-50.7-4.4-15.2 12.8-17.2 35.5-4.4 50.7L345.9 728c7.4 8.8 18.1 13.2 28.8 12.8 8.6 0.3 17.4-2.4 24.6-8.4l216-181.3 74.1 88.3c12.8 15.2 35.5 17.2 50.7 4.4 15.2-12.8 17.2-35.5 4.4-50.7l-74.1-88.3 188.4-158.1C874 334 876 311.3 863.3 296z", "p-id": "7503", fill: "#FF8F49" }) ], -1), Re("不完全正确 ") ]))) : Ge("", !0) : (V(), $("span", ya, b[1] || (b[1] = [ n("b", { style: { color: "#ffffff", "padding-top": "5px", display: "inline-block" } }, "?", -1), Re("本题未答 ") ]))) ]), n("section", { class: "reck", style: Qt({ background: T.background }) }, [ n("span", null, [ n("span", null, [ b[5] || (b[5] = Re(" 参考答案:")), Array.isArray(a.modelValue.answers.qAnswer) ? (V(), $("span", ka, [ (V(!0), $(ft, null, _t(a.modelValue.answers.qAnswer, (pe, ye) => (V(), $("i", { key: ye }, Xe(pe), 1))), 128)) ])) : (V(), $("span", Va, [ n("i", null, Xe(a.modelValue.answers.qAnswer), 1) ])) ]) ]), n("span", null, [ b[6] || (b[6] = Re("我的答案:")), n("span", { class: Kt(["reckT", a.modelValue.answers.isRight == !0 ? "standardTrue" : a.modelValue.answers.isRight == !1 ? "standardFalse" : "standardHalfTrue"]) }, [ (V(!0), $(ft, null, _t(a.modelValue.answers.answerObj, (pe, ye) => (V(), $("i", { key: ye }, [ Array.isArray(pe) ? (V(), $("span", Ma, [ (V(!0), $(ft, null, _t(pe, (K, ce) => (V(), $("span", { key: ce }, Xe(K), 1))), 128)) ])) : (V(), $("span", Aa, Xe(pe), 1)) ]))), 128)) ], 2) ]) ], 4), n("section", Ra, [ n("ul", null, [ n("li", null, [ b[7] || (b[7] = n("span", { class: "solutionTitle" }, "参考解析:", -1)), n("div", { class: "solutionBody jiexi", innerHTML: a.modelValue.explainEditorValue }, null, 8, Ba) ]), n("li", null, [ n("span", Ea, [ b[8] || (b[8] = Re("本题得分:")), n("span", La, Xe(a.modelValue.answers.getScore), 1), b[9] || (b[9] = Re("分")) ]) ]), n("li", null, [ n("span", Ia, [ b[10] || (b[10] = Re("本题满分:")), n("span", Ca, Xe(a.modelValue.answers.score), 1), b[11] || (b[11] = Re("分")) ]) ]) ]) ]) ])) : Ge("", !0) ]) ]); }; } }, Gs = /* @__PURE__ */ Jt(Pa, [["__scopeId", "data-v-a889ed4b"]]), Ha = { class: "JudgmentalQuestion" }, $a = { class: "tiBox" }, Oa = { class: "tiNumber" }, Na = { class: "tiContent" }, ja = ["innerHTML"], Ua = { class: "tiContentSpan" }, Fa = ["innerHTML"], qa = { key: 0 }, Da = { class: "answerTips" }, za = { key: 0, class: "reAnswered", "aria-hidden": "true" }, Xa = { key: 1, class: "reTrue", "aria-hidden": "true" }, Ya = { key: 2, class: "reFalse", "aria-hidden": "true" }, Qa = { key: 3, class: "reHalfTrue", "aria-hidden": "true" }, Ka = { class: "reckT" }, Za = { class: "solution analysis" }, Ga = ["innerHTML"], Wa = { class: "solutionTitle" }, Ja = { style: { color: "#50ca45", "font-weight": "600" } }, ei = { class: "solutionTitle" }, ti = { style: { color: "#50ca45", "font-weight": "600" } }, Ws = { __name: "JudgmentalQuestion", props: { modelValue: { type: Object, default: () => ({}) }, keys: { type: Number, default: 0 }, restore: { type: Boolean, default: !1 }, background: { type: String, default: "#fffad6" }, isPreview: { type: Boolean, default: !0 } }, setup(T) { const a = T, u = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"], F = $t({ optionIndex: null, isRight: null, answer: null, qAnswer: null }), A = (w) => { a.modelValue.options.forEach((B, b) => { b === w && (F.isRight = B.isAnswer), B.isAnswer && (F.qAnswer = B.optionIndex); }), a.modelValue.answers = Object.assign(a.modelValue.answers, { id: a.modelValue.id, questionUuid: a.modelValue.questionUuid, getScore: F.isRight ? a.modelValue.answers.score - 0 : 0, type: a.modelValue.questionTypeBase, answer: u[w], isRight: F.isRight, isAnswered: F.isRight != null ? "true" : "false" }); }; return (w, B) => { const b = Nt("el-radio"), oe = Nt("el-radio-group"); return V(), $("div", Ha, [ n("section", $a, [ n("span", Oa, Xe(a.modelValue.id) + ".", 1), n("div", Na, [ n("div", { style: { display: "flex", "align-items": "center", "flex-wrap": "wrap" }, innerHTML: a.modelValue.subjectEditorValue, class: "tiganContent" }, null, 8, ja), ht(oe, { modelValue: a.modelValue.answers.optionIndex, "onUpdate:modelValue": B[0] || (B[0] = (ae) => a.modelValue.answers.optionIndex = ae), onChange: A, disabled: a.restore || a.isPreview, class: "panduan tiOption" }, { default: Rt(() => [ (V(!0), $(ft, null, _t(a.modelValue.options, (ae, pe) => (V(), Pt(b, { key: pe, value: pe }, { default: Rt(() => [ n("span", Ua, Xe(u[pe]) + ".", 1), n("span", { class: "tiContentSpan", innerHTML: ae.optionTextValue }, null, 8, Fa) ]), _: 2 }, 1032, ["value"]))), 128)) ]), _: 1 }, 8, ["modelValue", "disabled"]) ]), a.restore ? (V(), $("div", qa, [ n("div", Da, [ a.modelValue.answers.isAnswered ? a.modelValue.answers.isRight == !0 ? (V(), $("span", Xa, B[2] || (B[2] = [ n("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "20", height: "20" }, [ n("path", { fill: "none", d: "M0 0h24v24H0z" }), n("path", { d: "M10 15.172l9.192-9.193 1.415 1.414L10 18l-6.364-6.364 1.414-1.414z", fill: "rgba(0,182,0,1)" }) ], -1), Re("回答正确 ") ]))) : a.modelValue.answers.isRight == !1 ? (V(), $("span", Ya, B[3] || (B[3] = [ n("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "20", height: "20" }, [ n("path", { fill: "none", d: "M0 0h24v24H0z" }), n("path", { d: "M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z", fill: "rgba(221,61,61,1)" }) ], -1), Re("回答错误 ") ]))) : a.modelValue.answers.isRight == "trueFalse" ? (V(), $("span", Qa, B[4] || (B[4] = [ n("svg", { t: "1668049716312", class: "icon", viewBox: "0 0 1024 1024", version: "1.1", xmlns: "http://www.w3.org/2000/svg", "p-id": "7502", width: "20", height: "20" }, [ n("path", { d: "M863.3 296c-12.8-15.2-35.5-17.2-50.7-4.4L624.1 449.7l-64.7-77.1c-12.8-15.2-35.5-17.2-50.7-4.4-15.2 12.8-17.2 35.5-4.4 50.7L569 496 379 655.4 215.9 461.1c-12.8-15.2-35.5-17.2-50.7-4.4-15.2 12.8-17.2 35.5-4.4 50.7L345.9 728c7.4 8.8 18.1 13.2 28.8 12.8 8.6 0.3 17.4-2.4 24.6-8.4l216-181.3 74.1 88.3c12.8 15.2 35.5 17.2 50.7 4.4 15.2-12.8 17.2-35.5 4.4-50.7l-74.1-88.3 188.4-158.1C874 334 876 311.3 863.3 296z", "p-id": "7503", fill: "#FF8F49" }) ], -1), Re("不完全正确 ") ]))) : Ge("", !0) : (V(), $("span", za, B[1] || (B[1] = [ n("b", { style: { color: "#ffffff", "padding-top": "5px", display: "inline-block" } }, "?", -1), Re("本题未答 ") ]))) ]), n("section", { class: "reck", style: Qt({ background: T.background }) }, [ n("span", null, [ B[5] || (B[5] = Re("参考答案:")), n("span", Ka, Xe(Array.isArray(a.modelValue.answers.qAnswer) ? a.modelValue.answers.qAnswer[0] : a.modelValue.answers.qAnswer), 1) ]), n("span", null, [ B[6] || (B[6] = Re("我的答案:")), n("span", { class: Kt(["reckT", a.modelValue.answers.isRight == !0 ? "standardTrue" : a.modelValue.answers.isRight == !1 ? "standardFalse" : "standardHalfTrue"]) }, Xe(a.modelValue.answers.answer[0]), 3) ]) ], 4), n("section", Za, [ n("ul", null, [ n("li", null, [ B[7] || (B[7] = n("span", { class: "solutionTitle" }, "参考解析:", -1)), n("div", { class: "solutionBody jiexi", innerHTML: a.modelValue.explainEditorValue }, null, 8, Ga) ]), n("li", null, [ n("span", Wa, [ B[8] || (B[8] = Re("本题得分:")), n("span", Ja, Xe(a.modelValue.answers.getScore), 1), B[9] || (B[9] = Re("分")) ]) ]), n("li", null, [ n("span", ei, [ B[10] || (B[10] = Re("本题满分:")), n("span", ti, Xe(a.modelValue.answers.score), 1), B[11] || (B[11] = Re("分")) ]) ]) ]) ]) ])) : Ge("", !0) ]) ]); }; } }, si = { class: "bodyStyle" }, ni = { class: "tigan" }, ai = ["innerHTML"], ii = ["id"], li = { __name: "index", props: { modelValue: { questionJsonContent: [String, Object, Array], type: null } }, emits: ["update:modelValue"], setup(T, { emit: a }) { const u = T, F = $t({ arrayList: [] }), A = () => { if (u.modelValue.attachObject) { let Z = Object.keys(u.modelValue.attachObject); F.arrayList = Z.reduce((Te, Be) => u.modelValue.attachObject[Be] && Object.prototype.toString.call(u.modelValue.attachObject[Be]) == "[object Array]" ? (u.modelValue.attachObject[Be].forEach((Ye) => { Te.push(Ye); }), Te) : u.modelValue.attachObject[Be] && Object.prototype.toString.call(u.modelValue.attachObject[Be]) == "[object Object]" ? (Te.push(u.modelValue.attachObject[Be]), Te) : void 0, []); } }; He(0), He(!1), He(0), He(0), He(1), He(0), He(0), He("rgba(255, 255, 255, 1)"), He("rgba(59, 203, 133, 0.57)"); const { proxy: w } = fn(); He(w.apiPath + "/api/oss/aliyun/upload"), He(new Image()), He(0), He(!0), He(0), He(!1), $t({ optionTextValue: "", fontSize: "" }); let B = He(null), b = He(null); window.addEventListener("scroll", function() { B.value !== null && b.value !== null && window.scrollTo(B.value, b.value); }); const { canvas: oe, ctx: ae, canvasPic: pe, canvasHistory: ye, fileList: K } = _n($t({ canvas: null, // canvas dom对象 ctx: null, // canvas 2d对象 canvasPic: null, //画布照片实例 canvasHistory: [], // allAngList: [], fileList: [] })), ce = a; ls( () => u.modelValue, (Z, Te) => { ce("update:modelValue", Z); }, { deep: !0 } ), He(!1), He(20), He(null), He(null); const Le = He(null); He(0), He(0), He(0), He(0), He(0), He(0), $t({ imgScale: 1, // 标注的时候放大缩小倍数 isClick: !1, // 区域是否被点击了 x1: void 0, y1: void 0, x2: void 0, y2: void 0, // 拖拽需要用的标志位 moveX1: void 0, moveY1: void 0, moveX2: void 0, moveY2: void 0, //-------------------------- left: void 0, // x轴侧偏移量,相对于canvas上的值 top: void 0, // y轴偏移量,相对于canvas上的值 imgScale: 1, // 标注的时候放大缩小倍数 isClick: !1, // 区域是否被点击了 // 原始图片上的位置 originX1: void 0, originX2: void 0, originY1: void 0, originY2: void 0, color: void 0 // 上颜色用的的 }), He(!1), He([]), He(!1), He(void 0), He(void 0), He(!0); let X = null; const h = $t({ width: 500, height: 500 }); $t({ width: null, height: null }); function I() { if (X = new vn.Canvas(`labelCanvas${u.modelValue.questionIndex}`, { width: h.width, // canvas 宽 height: h.height, backgroundColor: "#ffffff", transparentCorners: !0, fireRightClick: !0, // 启用右键,button的数字为3 stopContextMenu: !0 // 禁止默认右键菜单 }), X.skipTargetFind = !0, X.on("mouse:wheel", (Z) => { let Te = Z.e.deltaY, Be = X.getZoom(); Be *= 0.999 ** Te, Be > 20 && (Be = 20), Be < 0.01 && (Be = 0.01), X.zoomToPoint( { // 关键点 x: Z.e.offsetX, y: Z.e.offsetY }, Be ), Z.e.preventDefault(), Z.e.stopPropagation(); }), u.modelValue.maodianObject.str && u.modelValue.maodianObject.imgUrl) { const Z = JSON.parse(u.modelValue.maodianObject.str); Z.objects.forEach((Te, Be) => { Te.objects[1].text = String(Be + 1); }), X.loadFromJSON( Z, X.renderAll.bind(X), function(Te, Be) { } ); } } return bs(() => { I(), A(); }), (Z, Te) => (V(), $("div", si, [ n("div", ni, [ n("span", { class: "contentStyle", innerHTML: u.modelValue.subjectEditorValue }, null, 8, ai), n("div", { ref_key: "imgContainer", ref: Le, class: "imgContainer" }, [ n("canvas", { ref_key: "canvas", ref: oe, id: "labelCanvas" + u.modelValue.questionIndex, width: "500", height: "500" }, null, 8, ii) ], 512) ]) ])); } }, oi = /* @__PURE__ */ Jt(li, [["__scopeId", "data-v-135d5ee5"]]), ri = { class: "tiBox tiBox3" }, ui = { class: "tiNumber" }, di = { class: "tiContent maodianCentent" }, ci = ["for"], fi = { key: 0 }, _i = { class: "solution" }, pi = { style: { color: "#00b600", "margin-right": "5px", "margin-left": "5px" } }, hi = { key: 0 }, mi = { style: { color: "#766f6f" } }, gi = { class: "solutionTitle" }, vi = ["innerHTML"], bi = { class: "solutionTitle" }, wi = { style: { color: "#50ca45", "font-weight": "600" } }, yi = { class: "solutionTitle" }, Si = { style: { color: "#50ca45", "font-weight": "600" } }, xi = { __name: "canvasMaoDian", props: { modelValue: { type: Object, default: () => ({}) }, keys: { type: Number, default: 0 }, restore: { type: Boolean, default: !1 }, isPreview: { type: Boolean, default: !0 } }, setup(T) { const a = T, u = $t({ optionIndex: null, isRight: null, answer: null, qAnswer: null, answerObj: [] }), F = $t({ getScore: 0, isRight: !0, isAnswered: !1 }), A = (B = "") => { const b = /<br>$/i, oe = B.replace(/^(\s*&nbsp;\s*)+|(\s*&nbsp;\s*)+$/g, "").trim(); return b.test(oe) ? oe.replace(b, "") : oe; }, w = (B) => { F.getScore = 0; let b = (a.modelValue.answers.score - 0) / a.modelValue.options.length; u.answerObj = a.modelValue.options.reduce((pe, ye) => { ye.answer == ye.optionTextValue ? ye.isRight = !0 : ye.equalAnswers.length ? ye.isRight = ye.equalAnswers.some( (ce) => A(ce.equalAnswerEditorValue) == A(ye.answer) ) : ye.isRight = !1, ye.getScore = ye.isRight ? (b.toFixed(2) - 0).toFixed(2) : 0, ye.score = b.toFixed(2) - 0, ye.isAnswered = ye.answer != null, ye.qAnswer = [], ye.qAnswer.push(ye.optionTextValue); let K = { isRight: ye.isRight, getScore: ye.getScore, score: ye.score, isAnswered: ye.isAnswered, answer: ye.answer, qAnswer: ye.qAnswer }; return pe.push(K), pe; }, []); let oe = a.modelValue.options.every((pe) => pe.isAnswered && pe.isRight), ae = 0; oe ? F.getScore = a.modelValue.answers.score : u.answerObj.forEach((pe) => { F.getScore += pe.getScore - 0, pe.isRight && (ae += 1), pe.isAnswered && (F.isAnswered = !0); }), F.isRight = ae == 0 ? !1 : ae == a.modelValue.options.length ? !0 : "trueFalse", a.modelValue.answers = Object.assign(a.modelValue.answers, { id: a.modelValue.id, questionUuid: a.modelValue.questionUuid, getScore: F.getScore - 0, type: a.modelValue.questionTypeBase, isRight: F.isRight, answerObj: u.answerObj, isAnswered: F.isAnswered }); }; return (B, b) => { const oe = Nt("el-input"); return V(), $("article", null, [ n("section", ri, [ n("span", ui, Xe(a.modelValue.id) + ".", 1), n("div", di, [ (V(), Pt(oi, { modelValue: a.modelValue, props: a.restore, key: a.modelValue.id + a.restore }, null, 8, ["modelValue", "props"])), n("div", null, [ (V(!0), $(ft, null, _t(a.modelValue.options, (ae, pe) => (V(), $("div", { key: pe, style: { "margin-right": "30px" } }, [ n("div", null, [ ht(oe, { modelValue: ae.answer, "onUpdate:modelValue": (ye) => ae.answer = ye, id: ae.optionUuid, onBlur: (ye) => w(), disabled: a.restore || a.isPreview }, { prepend: Rt(() => [ n("label", { for: ae.optionUuid }, "空" + Xe(pe + 1), 9, ci) ]), _: 2 }, 1032, ["modelValue", "onUpdate:modelValue", "id", "onBlur", "disabled"]) ]) ]))), 128)) ]) ]) ]), a.restore ? (V(), $("div", fi, [ n("section", _i, [ n("ul", null, [ n("li", null, [ b[2] || (b[2] = n("span", { class: "solutionTitle" }, "参考答案:", -1)), (V(!0), $(ft, null, _t(a.modelValue.options, (ae, pe) => (V(), $("div", { class: "solutionBody", key: pe }, [ n("span", null, [ Re("区域" + Xe(pe + 1) + ": ", 1), n("span", pi, Xe(ae.optionTextValue), 1), ae.equalAnswers ? (V(), $("span", hi, [ b[0] || (b[0] = Re("(  等效答案: ")), (V(!0), $(ft, null, _t(ae.equalAnswers, (ye) => (V(), $("span", null, Xe(ye.equalAnswerEditorValue) + "、  ", 1))), 256)), b[1] || (b[1] = Re(" ) ")) ])) : Ge("", !0) ]) ]))), 128)) ]), n("li", null, [ b[3] || (b[3] = n("span", { class: "solutionTitle" }, "我的答案:", -1)), (V(!0), $(ft, null, _t(a.modelValue.answers.answerObj, (ae, pe) => (V(), $("div", { class: "solutionBody", key: pe }, [ n("span", mi, [ Re("区域" + Xe(pe + 1) + ": ", 1), n("span", { style: { "margin-right": "5px", "margin-left": "5px" }, class: Kt(a.modelValue.answers.isRight == !0 ? "standardTrue" : a.modelValue.answers.isRight == !1 ? "standardFalse" : "standardHalfTrue") }, Xe(ae.answer), 3) ]) ]))), 128)) ]), n("li", null, [ n("span", gi, [ b[4] || (b[4] = Re("参考解析: ")), n("div", { class: "solutionBody", innerHTML: a.modelValue.explainEditorValue }, null, 8, vi) ]) ]), n("li", null, [ n("span", bi, [ b[5] || (b[5] = Re("本题得分:")), n("span", wi, Xe(a.modelValue.answers.getScore), 1), b[6] || (b[6] = Re("分")) ]) ]), n("li", null, [ n("span", yi, [ b[7] || (b[7] = Re("本题满分:")), n("span", Si, Xe(a.modelValue.answers.score), 1), b[8] || (b[8] = Re("分")) ]) ]) ]) ]) ])) : Ge("", !0) ]); }; } }, Js = /* @__PURE__ */ Jt(xi, [["__scopeId", "data-v-23d398df"]]), Ti = { class: "tiBox tiBox3" }, ki = { class: "tiNumber" }, Vi = { class: "tiContent" }, Mi = ["innerHTML"], Ai = { key: 0 }, Ri = { class: "answerTips" }, Bi = { key: 0, class: "reAnswered", "aria-hidden": "true" }, Ei = { key: 1, class: "reTrue", "aria-hidden": "true" }, Li = { key: 2, class: "reFalse", "aria-hidden": "true" }, Ii = { key: 3, class: "reHalfTrue", "aria-hidden": "true" }, Ci = { class: "solution" }, Pi = { class: "solutionBody" }, Hi = { class: "solutionBody" }, $i = ["innerHTML"], Oi = { class: "solutionTitle" }, Ni = { style: { color: "#50ca45", "font-weight": "600" } }, ji = { class: "solutionTitle" }, Ui = { style: { color: "#50ca45", "font-weight": "600" } }, Fi = { __name: "rankingQuestion", props: { modelValue: { type: Object, default: () => ({}) }, keys: { type: Number, default: 0 }, restore: { type: Boolean, default: !1 }, background: { type: String, default: "#fffad6" }, isPreview: { type: Boolean, default: !0 } }, emits: ["rankingQuestionEmit"], setup(T, { emit: a }) { const u = T, F = He(!1), A = () => { F.value = !0; let w = !0, B = []; u.modelValue.options.map((b, oe) => { B.push(b.optionTextValue), b.optionPaiXuValue - 0 != oe + 1 && (w = !1); }), u.modelValue.answers = Object.assign(u.modelValue.answers, { id: u.modelValue.id, answer: B.join(","), answerObj: B, questionUuid: u.modelValue.questionUuid, getScore: w ? u.modelValue.answers.score - 0 : 0, type: u.modelValue.questionTypeBase, isRight: w, isAnswered: F.value }); }; return (w, B) => (V(), $("article", null, [ n("section", Ti, [ n("span", ki, Xe(u.modelValue.id) + ".", 1), n("div", Vi, [ n("div", { style: { display: "flex", "align-items": "center" }, innerHTML: u.modelValue.subjectEditorValue, class: "tiganContent" }, null, 8, Mi), ht(Zt(bn), { ref: "el", modelValue: u.modelValue.options, "onUpdate:modelValue": B[0] || (B[0] = (b) => u.modelValue.options = b), disabled: u.restore || u.isPreview, animation: 150, ghostClass: