"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-BB7fFseo.cjs"),m={class:"option-list"},k={key:2,class:"standard-text"},p=e.defineComponent({__name:"Choice",setup(v){const t=e.inject("widget"),l=e.inject("answerItem"),d=e.computed(()=>{switch(t.type){case"eduRadio":case"eduJudgement":case"eduSelect":return"radio";case"eduCheckbox":return"square"}}),i=e.computed(()=>t.attrs.list||t.attrs.options||[]),o=r=>{var c,a;switch(t.type){case"eduRadio":case"eduJudgement":case"eduSelect":return((c=l.answer)==null?void 0:c.id)===r.value;case"eduCheckbox":return(a=l.answer)==null?void 0:a.some(n=>n.id===r.value)}},u=r=>{var c,a,n;if(t.attrs.scoreType==="single"&&t.attrs.standard.find(s=>s.id===r.value))return"(正确答案)";if(t.attrs.scoreType==="multiple"&&(c=t.attrs.standard.find(s=>s.id===r.value))!=null&&c.mark)return`(${(a=t.attrs.standard.find(s=>s.id===r.value))==null?void 0:a.mark}分)`;if(t.attrs.scoreType==="cumulative"&&typeof((n=t.attrs.standard.find(s=>s.id===r.value))==null?void 0:n.mark)=="number")return`(${t.attrs.standard.find(s=>s.id===r.value).mark}分) (正确答案)`};return(r,c)=>(e.openBlock(),e.createElementBlock("div",m,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,a=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["option-item",{checked:o(a)}]),key:a.value},[d.value==="radio"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["radio-icon",{checked:o(a)}])},null,2)):(e.openBlock(),e.createBlock(e.unref(e.ElCheckbox),{key:1,class:"square-icon","model-value":o(a)},null,8,["model-value"])),e.createTextVNode(" "+e.toDisplayString(a.label)+" ",1),e.unref(e.isShowAnalysis)?(e.openBlock(),e.createElementBlock("span",k,e.toDisplayString(u(a)),1)):e.createCommentVNode("",!0)],2))),128))]))}}),f=e._export_sfc(p,[["__scopeId","data-v-5b67bf94"]]);exports.default=f;
