You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
148 KiB
2 lines
148 KiB
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[3260],{6021:function(mn,ll,v){v.d(ll,{Z:function(){return Ye}});var n=v(3113),ae=v(59301),w=Object.defineProperty,wt=Object.defineProperties,le=Object.getOwnPropertyDescriptors,Ve=Object.getOwnPropertySymbols,vt=Object.prototype.hasOwnProperty,Mt=Object.prototype.propertyIsEnumerable,At=(H,Ne,b)=>Ne in H?w(H,Ne,{enumerable:!0,configurable:!0,writable:!0,value:b}):H[Ne]=b,lt=(H,Ne)=>{for(var b in Ne||(Ne={}))vt.call(Ne,b)&&At(H,b,Ne[b]);if(Ve)for(var b of Ve(Ne))Mt.call(Ne,b)&&At(H,b,Ne[b]);return H},ke=(H,Ne)=>wt(H,le(Ne)),Oe=(H,Ne)=>{var b={};for(var ie in H)vt.call(H,ie)&&Ne.indexOf(ie)<0&&(b[ie]=H[ie]);if(H!=null&&Ve)for(var ie of Ve(H))Ne.indexOf(ie)<0&&Mt.call(H,ie)&&(b[ie]=H[ie]);return b},ge=(H,Ne,b)=>new Promise((ie,Bt)=>{var oe=ze=>{try{S(b.next(ze))}catch(je){Bt(je)}},bt=ze=>{try{S(b.throw(ze))}catch(je){Bt(je)}},S=ze=>ze.done?ie(ze.value):Promise.resolve(ze.value).then(oe,bt);S((b=b.apply(H,Ne)).next())});const Ye=H=>{var Ne=H,{children:b}=Ne,ie=Oe(Ne,["children"]);const[Bt,oe]=(0,ae.useState)(!1);return ae.createElement(n.ZP,ke(lt({},ie),{loading:Bt,onClick:bt=>ge(void 0,null,function*(){try{oe(!0),yield ie.onClick(bt),oe(!1)}catch(S){console.error(S),oe(!1)}})}),b)}},8478:function(mn,ll,v){v.r(ll),v.d(ll,{default:function(){return Ya},useCourseOptions:function(){return Kn}});var n=v(59301),ae=v(89070),w=v(78241),wt=v(66104),le=v(8591),Ve=v(71418),vt=v(92832),Mt=v(19842),At=v(24905),lt=v(5112),ke=v(5871),Oe=v(3113),ge=v(7761),Ye=v(80401),H=v(26422),Ne=v(6021),b=v(43418),ie=v(20834),Bt=v(38854),oe=v(6848),bt=v(43428),S={flex_box_center:"flex_box_center___gi93l",flex_space_between:"flex_space_between___mWMLA",flex_box_vertical_center:"flex_box_vertical_center___rk4nc",flex_box_center_end:"flex_box_center_end___B8XxF",flex_box_column:"flex_box_column___AX3Vm",moreSpan:"moreSpan___hbStq",bg:"bg___Ya739",title:"title___BC46y",bottomdiv:"bottomdiv___uaPr6",spanBtn:"spanBtn___jjgnA",addQuestionBtn:"addQuestionBtn___qOlYW",saveBtn:"saveBtn___ulgem",left:"left___i8aTX",leftAction:"leftAction___sQkuq",Button:"Button___auxWm",iconWrapper:"iconWrapper___h3H1m",up:"up___tLyCX",down:"down___T5_aj",disabled:"disabled___GRBbF",titleleft:"titleleft___xZGbq",more_style:"more_style___nhWCX",qcount:"qcount___ID7OA",score:"score___T7dbm",qtitle:"qtitle___qJBFd",qcountclick:"qcountclick___m_VKG",right:"right___CBabI",edit:"edit___WHuql",delete:"delete___Pa6db",shixun:"shixun___oObBe",scoreByBlankRadio:"scoreByBlankRadio___r4AWn",modalconfirm:"modalconfirm___Ru9B_",scoremodal:"scoremodal___BdW7P",close:"close___blHYk",content:"content___jlm9o",items:"items___i3TrH",bottom:"bottom___zMQZ6",yes:"yes___lOPY6",no:"no___gtzKI",formcenter:"formcenter___fCxkm",radiogroup:"radiogroup___oXWHc",easy:"easy___ANNVD",medium:"medium___ov7N3",hard:"hard___n4afW",formcenterselect:"formcenterselect___lYa4f",selectitems1:"selectitems1___Y2Zy4",selectitems:"selectitems___c9Pt5",morebottom:"morebottom____I_ev",scoreinput:"scoreinput___O8EhL",shake:"shake___QxkjH",titleTooltip:"titleTooltip___CAyYg",exercise_styles:"exercise_styles___u40hG"},ze=v(955),je=v(99064),fl=v(8797),yl=v(67248),ol=v(54203),He=v(85149),Je=v(59301),P=Object.defineProperty,Hl=Object.defineProperties,Jl=Object.getOwnPropertyDescriptors,hl=Object.getOwnPropertySymbols,gl=Object.prototype.hasOwnProperty,Gl=Object.prototype.propertyIsEnumerable,Fl=(e,t,l)=>t in e?P(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,zt=(e,t)=>{for(var l in t||(t={}))gl.call(t,l)&&Fl(e,l,t[l]);if(hl)for(var l of hl(t))Gl.call(t,l)&&Fl(e,l,t[l]);return e},ce=(e,t)=>Hl(e,Jl(t)),Et=(e,t,l)=>new Promise((u,p)=>{var D=a=>{try{_(l.next(a))}catch(o){p(o)}},k=a=>{try{_(l.throw(a))}catch(o){p(o)}},_=a=>a.done?u(a.value):Promise.resolve(a.value).then(D,k);_((l=l.apply(e,t)).next())}),Ul=({Itemid:e,setqitem:t,qitem:l,data:u,getdata:p,bigitem:D,setBigqitem:k,isedit:_,handleEditing:a})=>{const[o,h]=(0,n.useState)([]),[i,d]=(0,n.useState)(!1);(0,n.useEffect)(()=>{u.length>0&&h([...u])},[u]);const x=(O,E)=>Et(void 0,null,function*(){if(_){a();return}if(!O.destination)return;d(!0);let I=yield(0,je.ZP)(`/api/examination_banks/${e}/examination_banks_item_banks/${E==null?void 0:E[O.source.index].question_id}/adjust_position.json`,{method:"post",body:{id:e,itemid:E==null?void 0:E[O.source.index].question_id,position:O.destination.index}});d(!1),I.status===0&&p({id:E==null?void 0:E[O.source.index].question_id})});return Je.createElement("div",null,Je.createElement(ol.Z5,{onDragEnd:O=>x(O,o)},Je.createElement(ol.bK,{droppableId:"droppable"},(O,E)=>Je.createElement("div",zt({ref:O.innerRef},O.droppableProps),Je.createElement(Ve.Z,{spinning:i},o.map((I,c)=>Je.createElement(ol._l,{key:c,draggableId:c.toString(),index:c},(V,_e)=>{var m,s;return Je.createElement("aside",zt(zt({ref:V.innerRef},V.draggableProps),V.dragHandleProps),Je.createElement("div",{onClick:()=>{if(_){a();return}t(ce(zt({},I),{index:c+1})),k(D),(0,ze.Vf)("#question-scroll-id")},className:`${S.qcount} ${I.question_id===(l==null?void 0:l.question_id)?S.qcountclick:""}`},Je.createElement("span",{className:S.score},I==null?void 0:I.question_score,"\u5206"),Je.createElement(oe.Z,{title:Je.createElement(He.Z,{value:(I==null?void 0:I.question_type)===8?(m=I==null?void 0:I.program_attr)==null?void 0:m.description:I.question_title}),color:"#fff",placement:"left",overlayClassName:S.titleTooltip},Je.createElement("span",{className:S.qtitle},c+1,"\u3001",Je.createElement(He.Z,{value:(I==null?void 0:I.question_type)===8?(s=I==null?void 0:I.program_attr)==null?void 0:s.description:I.question_title,showTextOnly:!0}))),(I==null?void 0:I.question_imperfect)&&Je.createElement(oe.Z,{title:"\u77E5\u8BC6\u70B9\u4FE1\u606F\u4E0D\u5B8C\u5584"},Je.createElement("div",{style:{transform:"scaleY(-1)",color:"#E99237"},className:"iconfont icon-tishi12"}))))}))),O.placeholder))))},Se=v(95237),C=v(65357),Fe=v(57809),Be=v(78673),Pt=v(61485),Ct=v(87198),q=v(59301),Le=(e,t,l)=>new Promise((u,p)=>{var D=a=>{try{_(l.next(a))}catch(o){p(o)}},k=a=>{try{_(l.throw(a))}catch(o){p(o)}},_=a=>a.done?u(a.value):Promise.resolve(a.value).then(D,k);_((l=l.apply(e,t)).next())}),fe=({form:e,TagDiscipline:t,exerciseitem:l,qitem:u,getTagData:p})=>{var D;const[k,_]=(0,n.useState)(!0),[a,o]=(0,n.useState)(!1),[h,i]=(0,n.useState)(""),[d,x]=(0,n.useState)([]),[O,E]=(0,n.useState)([]),[I,c]=(0,n.useState)(0);(0,n.useEffect)(()=>{_e()},[]);const V=m=>Le(void 0,null,function*(){const s=yield(0,je.ZP)("/api/tag_disciplines.json",{method:"get",params:{sub_discipline_id:m==null?void 0:m.sub_discipline_id}});E(s==null?void 0:s.tag_disciplines)}),_e=()=>Le(void 0,null,function*(){const m=yield(0,je.ZP)("/api/disciplines.json",{method:"get",params:{source:"subject"}});x(m.disciplines||[]),u!=null&&u.sub_discipline_id&&V(u),c(u!=null&&u.sub_discipline_id?1:0),e.setFieldsValue({difficulty:u.difficulty||2,repeat_answer:!u.repeat_answer,sub_discipline_id:u!=null&&u.sub_discipline_id?[u==null?void 0:u.discipline_id,u==null?void 0:u.sub_discipline_id]:[]})});return q.createElement("div",null,q.createElement("div",{style:{marginTop:30,overflow:"hidden",height:k?"100%":0}},q.createElement(w.default.Item,{className:S.formcenter,rules:[{required:!0,message:"\u8BF7\u5148\u9009\u62E9\u96BE\u5EA6"}],label:"\u96BE\u5EA6",name:"difficulty"},q.createElement(lt.ZP.Group,{className:S.radiogroup},q.createElement(lt.ZP.Button,{className:S.easy,value:1},"\u7B80\u5355"),q.createElement(lt.ZP.Button,{className:S.medium,value:2},"\u9002\u4E2D"),q.createElement(lt.ZP.Button,{className:S.hard,value:3},"\u56F0\u96BE"))),q.createElement(w.default.Item,{name:"sub_discipline_id",label:"\u77E5\u8BC6\u70B9",className:S.formcenterselect},q.createElement(Mt.Z,{className:S.selectitems1,expandTrigger:"hover",placeholder:"\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B",options:d,fieldNames:{label:"name",value:"id",children:"sub_disciplines"},onChange:(m,s)=>{e.setFieldsValue({sub_discipline_id:m,tag_discipline_ids:[]}),c(m?m.length:0),(m==null?void 0:m.length)>0&&(V({sub_discipline_id:m[1]}),m[1]==(u==null?void 0:u.sub_discipline_id)&&e.setFieldValue("tag_discipline_ids",u.tag_discipline_ids))},onClear:()=>{E([]),e.setFieldValue("tag_discipline_ids",[]),c(0)}})),q.createElement(w.default.Item,{className:S.formcenterselect},q.createElement("div",{style:{display:"flex",alignItems:"center",paddingLeft:55}},q.createElement(w.default.Item,{name:"tag_discipline_ids"},q.createElement(Fe.default,{className:S.selectitems,disabled:I===0,showSearch:!0,placeholder:"\u8BF7\u9009\u62E9\u77E5\u8BC6\u70B9\uFF0C\u652F\u6301\u9009\u62E9\u591A\u4E2A",mode:"multiple",listHeight:200,dropdownStyle:{zIndex:9},allowClear:!0,optionFilterProp:"children",filterOption:(m,s)=>s.key.indexOf(m.toLowerCase())>=0},O==null?void 0:O.map(m=>q.createElement(Fe.default.Option,{key:m.name+m.id,value:m.id},q.createElement("div",{style:{display:"flex",alignItems:"center"}},q.createElement("span",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},m.name),(m==null?void 0:m.type)==="personal"&&q.createElement("div",{style:{marginLeft:"5px",border:"1px solid #24C074",color:"#24C074",padding:"0 4px",borderRadius:"2px",fontSize:"12px",height:"20px",lineHeight:"20px"}},"\u81EA\u7528")))))),I>0&&q.createElement("div",{style:{marginLeft:20,marginTop:"-16px",lineHeight:"48px",height:48,fontSize:14}},q.createElement("span",null,"\u6CA1\u6709\u5408\u9002\u7684\u77E5\u8BC6\u70B9\uFF1F"),q.createElement("a",{onClick:()=>{o(!0)},style:{marginLeft:3,color:"#3061D0"}},"\u65B0\u5EFA\u77E5\u8BC6\u70B9")))),q.createElement(w.default.Item,{className:S.formcenterselect},q.createElement("div",{style:{display:"flex",alignItems:"center"}},q.createElement(w.default.Item,{name:"repeat_answer",valuePropName:"checked"},q.createElement(Be.Z,null)),q.createElement("div",{style:{marginLeft:10,marginTop:"-16px",lineHeight:"40px",height:48,color:"#000000"}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898",q.createElement(oe.Z,{placement:"right",title:"\u5F00\u542F\u540E\uFF0C\u5B66\u751F\u4F5C\u7B54\u5B8C\u6210\u8BE5\u9898\u5E76\u8FDB\u5165\u4E0B\u4E00\u9898\u4E4B\u540E\uFF0C\u4E0D\u5141\u8BB8\u518D\u4FEE\u6539\u8BE5\u9898\u7B54\u6848"},q.createElement(Pt.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))))),q.createElement(Ct.Z,{open:a,subDisciplineId:(D=e.getFieldValue("sub_discipline_id"))==null?void 0:D[1],onCancel:()=>{o(!1)},onOkClick:m=>{E(s=>[...s,m]),e.setFieldValue("tag_discipline_ids",[...e.getFieldValue("tag_discipline_ids"),m==null?void 0:m.id])}}))},be=v(59301),Ht=Object.defineProperty,R=Object.defineProperties,rt=Object.getOwnPropertyDescriptors,N=Object.getOwnPropertySymbols,ut=Object.prototype.hasOwnProperty,Jt=Object.prototype.propertyIsEnumerable,Gt=(e,t,l)=>t in e?Ht(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,Ke=(e,t)=>{for(var l in t||(t={}))ut.call(t,l)&&Gt(e,l,t[l]);if(N)for(var l of N(t))Jt.call(t,l)&&Gt(e,l,t[l]);return e},Y=(e,t)=>R(e,rt(t)),Pe=(e,t,l)=>new Promise((u,p)=>{var D=a=>{try{_(l.next(a))}catch(o){p(o)}},k=a=>{try{_(l.throw(a))}catch(o){p(o)}},_=a=>a.done?u(a.value):Promise.resolve(a.value).then(D,k);_((l=l.apply(e,t)).next())}),at=({qitem:e,setisedit:t,TagDiscipline:l,exerciseitem:u,seveeditor:p,deleteitem:D,getTagData:k,init:_,showTip:a=!1})=>{const[o]=w.default.useForm();(0,n.useEffect)(()=>{var i;o.setFieldsValue(Y(Ke({},e),{name:e==null?void 0:e.question_title,choices:(i=e==null?void 0:e.question_choices)==null?void 0:i.map(d=>Y(Ke({},d),{standard_boolean:d!=null&&d.standard_boolean?1:0})),repeat_answer:!(e!=null&&e.repeat_answer)}))},[e]);const h=i=>{if(!(i!=null&&i.length))return!1;const d=i.map(O=>{var E;return(E=O.choice_text)==null?void 0:E.trim().replace(/^\s+|\s+$/g,"")});return new Set(d).size!==d.length};return be.createElement("div",null,be.createElement(w.default,{form:o,colon:!1,onFinish:i=>{var d;if(h(i.choices)){le.ZP.error("\u9009\u62E9\u9898\u9009\u9879\u5185\u5BB9\u4E0D\u80FD\u91CD\u590D\uFF0C\u8BF7\u4FEE\u6539\u540E\u518D\u4FDD\u5B58");return}let x=Y(Ke({},i),{item_type:e==null?void 0:e.question_type,choices:(d=i==null?void 0:i.choices)==null?void 0:d.map(O=>Y(Ke({},O),{is_answer:O.standard_boolean}))});p(Ke(Ke({},e),x))},onFinishFailed:i=>Pe(void 0,null,function*(){var d,x;le.ZP.error(i.errorFields[0].errors[0]),o.scrollToField((x=(d=i==null?void 0:i.errorFields)==null?void 0:d[0])==null?void 0:x.name,{behavior:"smooth",block:"center"})})},be.createElement("div",{style:{display:"flex",alignItems:"center"}},be.createElement("div",{style:{flex:1}},be.createElement("span",{style:{display:"inline-flex",border:"1px solid #9096A3",borderRadius:"50%",width:10,height:10,marginRight:5,background:"#9096A3"}}),be.createElement("span",null,(e==null?void 0:e.question_type)===1?"\u591A\u9009\u9898":"\u5355\u9009\u9898")),!e.isadd&&be.createElement("span",{style:{marginLeft:20,marginRight:20,color:"red",cursor:"pointer"},onClick:()=>{D()}},be.createElement("i",{className:"iconfont icon-piliangshanchu3",style:{fontSize:14,marginRight:6}}),"\u5220\u9664"),be.createElement(Oe.ZP,{onClick:()=>{var i;e.isadd?(t(!1),_()):(o.setFieldsValue(Y(Ke({},e),{name:e==null?void 0:e.question_title,choices:(i=e==null?void 0:e.question_choices)==null?void 0:i.map(d=>Y(Ke({},d),{standard_boolean:d!=null&&d.standard_boolean?1:0})),repeat_answer:!(e!=null&&e.repeat_answer)})),t(!1))}},"\u53D6\u6D88"),be.createElement(oe.Z,{overlayClassName:S.shake,open:a,placement:"bottom",color:"rgba(244,156,14,0.19)",title:be.createElement("div",{style:{color:"#FF841A",fontSize:"14px"}},be.createElement("i",{className:"iconfont icon-tishi11 mr5 font14"}),"\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u8BD5\u9898\u3002")},be.createElement(Oe.ZP,{className:"ml20",type:"primary",onClick:()=>Pe(void 0,null,function*(){o.submit()})},"\u4FDD\u5B58"))),be.createElement("div",{style:{maxHeight:"calc(100vh - 148px)",overflowY:"auto",marginTop:"10px",paddingRight:"5px"}},be.createElement(Se.Z,{align:"middle"},be.createElement(w.default.Item,{className:S.scoreinput,name:"question_score",label:"\u5206\u503C",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5206\u503C"}]},be.createElement(ke.Z,{onBlur:i=>{i.target.value==="0"&&le.ZP.error("\u5206\u503C\u5FC5\u987B\u5927\u4E8E0\u4E14\u5C0F\u4E8E\u7B49\u4E8E100")},style:{width:150},precision:1,placeholder:"\u8BF7\u8F93\u5165\u5206\u503C",max:100,min:.1}))),be.createElement(C.u,{form:o,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9009\u62E9\u9898\u9898\u5E72\u5185\u5BB9",titleKey:"name",choiceKey:"choices",analysisKey:"analysis",choiceOptionsPath:"choices",choiceTextKey:"choice_text",answerKey:"standard_boolean"}),be.createElement(fe,{getTagData:k,qitem:e,exerciseitem:u,TagDiscipline:l,form:o}))))},Ut=v(70472),nl=v(27693),se=v(59301),dt=Object.defineProperty,Xl=Object.defineProperties,Yl=Object.getOwnPropertyDescriptors,Bl=Object.getOwnPropertySymbols,sl=Object.prototype.hasOwnProperty,ye=Object.prototype.propertyIsEnumerable,ht=(e,t,l)=>t in e?dt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,et=(e,t)=>{for(var l in t||(t={}))sl.call(t,l)&&ht(e,l,t[l]);if(Bl)for(var l of Bl(t))ye.call(t,l)&&ht(e,l,t[l]);return e},Ot=(e,t)=>Xl(e,Yl(t)),ul=(e,t,l)=>new Promise((u,p)=>{var D=a=>{try{_(l.next(a))}catch(o){p(o)}},k=a=>{try{_(l.throw(a))}catch(o){p(o)}},_=a=>a.done?u(a.value):Promise.resolve(a.value).then(D,k);_((l=l.apply(e,t)).next())}),Kl=({qitem:e,TagDiscipline:t,exerciseitem:l,setisedit:u,seveeditor:p,deleteitem:D,getTagData:k,init:_,showTip:a=!1})=>{const[o]=w.default.useForm(),h=w.default.useWatch("use_blank_score",o);return(0,n.useEffect)(()=>{o.setFieldsValue(Ot(et({},e),{standard_answers:e.standard_answers||[],name:e.question_title,repeat_answer:!e.repeat_answer}))},[e]),se.createElement("div",null,se.createElement(w.default,{form:o,colon:!1,onValuesChange:(i,d)=>{var x,O,E,I;if(i!=null&&i.standard_answers||i!=null&&i.use_blank_score){let c=((x=o.getFieldValue("standard_answers"))==null?void 0:x.length)>0&&((E=(O=o.getFieldValue("standard_answers"))==null?void 0:O.map(V=>V.score))==null?void 0:E.filter(V=>V));(c==null?void 0:c.length)>0&&o.setFieldsValue({question_score:(c==null?void 0:c.length)>0&&((I=c.reduce((V,_e)=>V+_e))==null?void 0:I.toFixed(1))})}},onFinish:i=>{var d;p(Ot(et(et({},e),i),{item_type:e==null?void 0:e.question_type,standard_answers:(d=i.standard_answers)==null?void 0:d.map((x,O)=>Ot(et({},x),{position:x.choice_id||O+1}))}))},onFinishFailed:i=>ul(void 0,null,function*(){var d,x;i.errorFields[0].errors[0]==="\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879"&&(0,ze.pE)(),le.ZP.error(i.errorFields[0].errors[0]),o.scrollToField((x=(d=i==null?void 0:i.errorFields)==null?void 0:d[0])==null?void 0:x.name,{behavior:"smooth",block:"center"})})},se.createElement("div",{style:{display:"flex",alignItems:"center"}},se.createElement("div",{style:{flex:1}},se.createElement("span",{style:{display:"inline-flex",border:"1px solid #9096A3",borderRadius:"50%",width:10,height:10,marginRight:5,background:"#9096A3"}}),se.createElement("span",null,"\u586B\u7A7A\u9898")),!e.isadd&&se.createElement("span",{style:{marginLeft:20,marginRight:20,color:"red",cursor:"pointer"},onClick:()=>{D()}},se.createElement("i",{className:"iconfont icon-piliangshanchu3",style:{fontSize:14,marginRight:6}})," \u5220\u9664"),se.createElement(Oe.ZP,{onClick:()=>{e.isadd?(u(!1),_()):(o.setFieldsValue(Ot(et({},e),{standard_answers:e.standard_answers,name:e.question_title,repeat_answer:!e.repeat_answer})),u(!1))}},"\u53D6\u6D88"),se.createElement(oe.Z,{overlayClassName:S.shake,open:a,placement:"bottom",color:"rgba(244,156,14,0.19)",title:se.createElement("div",{style:{color:"#FF841A",fontSize:"14px"}},se.createElement("i",{className:"iconfont icon-tishi11 mr5 font14"}),"\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u8BD5\u9898\u3002")},se.createElement(Oe.ZP,{className:"ml20",type:"primary",onClick:()=>{o.submit()}},"\u4FDD\u5B58"))),se.createElement("div",{style:{maxHeight:"calc(100vh - 148px)",overflowY:"auto",marginTop:"10px",paddingRight:"5px"}},se.createElement(Se.Z,{align:"middle"},h?se.createElement(nl.Z,{text:"\uFF08\u5C0F\u9898\u5206\u503C\u7B49\u4E8E\u5404\u586B\u7A7A\u9879\u5206\u503C\u4E4B\u548C\uFF09"}):se.createElement(w.default.Item,{key:2,className:S.scoreinput,name:"question_score",label:"\u5206\u503C",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5206\u503C"}]},se.createElement(ke.Z,{onBlur:i=>{i.target.value==="0"&&le.ZP.error("\u5206\u503C\u5FC5\u987B\u5927\u4E8E0\u4E14\u5C0F\u4E8E\u7B49\u4E8E100")},style:{width:150},precision:1,placeholder:"\u8BF7\u8F93\u5165\u5206\u503C",size:"middle",max:100,min:.1})),se.createElement(w.default.Item,{name:"use_blank_score",noStyle:!0},se.createElement(lt.ZP.Group,{className:S.scoreByBlankRadio,optionType:"button",options:[{label:"\u6309\u7A7A\u7ED9\u5206",value:!0},{label:"\u6309\u9898\u7ED9\u5206",value:!1}]})),se.createElement(oe.Z,{overlayInnerStyle:{width:460},title:se.createElement("div",null,"\u6309\u7A7A\u7ED9\u5206\uFF1A\u9700\u8981\u5206\u522B\u8BBE\u7F6E\u6BCF\u4E2A\u586B\u7A7A\u9879\u7684\u5206\u503C\uFF0C\u586B\u7A7A\u9879\u7B54\u5BF9\u4E4B\u540E\u5219\u83B7\u5F97\u5BF9\u5E94\u7684\u5206\u503C\u3002",se.createElement("br",null),"\u6309\u9898\u7ED9\u5206\uFF1A\u9700\u8981\u8BBE\u7F6E\u6574\u4E2A\u5C0F\u9898\u7684\u5206\u503C\uFF0C\u7B54\u5BF9\u5168\u90E8\u586B\u7A7A\u9879\u4E4B\u540E\u624D\u80FD\u83B7\u5F97\u8BE5\u5C0F\u9898\u7684\u5206\u503C\u3002")},se.createElement("i",{className:"icon-tishixiaowenhao font18 ml20 c-3061d0"}))),se.createElement(Ut.u,{form:o,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u586B\u7A7A\u9898\u9898\u5E72\u5185\u5BB9",scoreByBlank:h,answerKey:"standard_answers"}),se.createElement(fe,{getTagData:k,qitem:e,exerciseitem:l,TagDiscipline:t,form:o}))))},ql=v(11832),Qe=v(59301),Cl=Object.defineProperty,xl=Object.defineProperties,en=Object.getOwnPropertyDescriptors,xt=Object.getOwnPropertySymbols,ct=Object.prototype.hasOwnProperty,tn=Object.prototype.propertyIsEnumerable,Qt=(e,t,l)=>t in e?Cl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,mt=(e,t)=>{for(var l in t||(t={}))ct.call(t,l)&&Qt(e,l,t[l]);if(xt)for(var l of xt(t))tn.call(t,l)&&Qt(e,l,t[l]);return e},Dt=(e,t)=>xl(e,en(t)),ln=(e,t,l)=>new Promise((u,p)=>{var D=a=>{try{_(l.next(a))}catch(o){p(o)}},k=a=>{try{_(l.throw(a))}catch(o){p(o)}},_=a=>a.done?u(a.value):Promise.resolve(a.value).then(D,k);_((l=l.apply(e,t)).next())}),nn=({qitem:e,setisedit:t,TagDiscipline:l,exerciseitem:u,seveeditor:p,deleteitem:D,getTagData:k,init:_,showTip:a=!1})=>{const[o]=w.default.useForm();return(0,n.useEffect)(()=>{var h;o.setFieldsValue(Dt(mt({},e),{name:e.question_title,repeat_answer:!e.repeat_answer,choices:(h=e==null?void 0:e.question_choices)==null?void 0:h.map(i=>Dt(mt({},i),{is_answer:i!=null&&i.standard_boolean?1:0}))}))},[e]),Qe.createElement("div",null,Qe.createElement(w.default,{form:o,colon:!1,onFinish:h=>{p(mt(mt({},e),h))},onFinishFailed:h=>ln(void 0,null,function*(){var i,d;le.ZP.error(h.errorFields[0].errors[0]),o.scrollToField((d=(i=h==null?void 0:h.errorFields)==null?void 0:i[0])==null?void 0:d.name,{behavior:"smooth",block:"center"})})},Qe.createElement("div",{style:{display:"flex",alignItems:"center"}},Qe.createElement("div",{style:{flex:1}},Qe.createElement("span",{style:{display:"inline-flex",border:"1px solid #9096A3",borderRadius:"50%",width:10,height:10,marginRight:5,background:"#9096A3"}}),Qe.createElement("span",null,"\u5224\u65AD\u9898")),!(e!=null&&e.isadd)&&Qe.createElement("span",{style:{marginLeft:20,marginRight:20,color:"red",cursor:"pointer"},onClick:()=>{D()}},Qe.createElement("i",{className:"iconfont icon-piliangshanchu3",style:{fontSize:14,marginRight:6}}),"\u5220\u9664"),Qe.createElement(Oe.ZP,{onClick:()=>{var h;e.isadd?(t(!1),_()):(o.setFieldsValue(Dt(mt({},e),{name:e==null?void 0:e.question_title,choices:(h=e==null?void 0:e.question_choices)==null?void 0:h.map(i=>Dt(mt({},i),{is_answer:i!=null&&i.standard_boolean?1:0})),repeat_answer:!(e!=null&&e.repeat_answer)})),t(!1))}},"\u53D6\u6D88"),Qe.createElement(oe.Z,{overlayClassName:S.shake,open:a,placement:"bottom",color:"rgba(244,156,14,0.19)",title:Qe.createElement("div",{style:{color:"#FF841A",fontSize:"14px"}},Qe.createElement("i",{className:"iconfont icon-tishi11 mr5 font14"}),"\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u8BD5\u9898\u3002")},Qe.createElement(Oe.ZP,{className:"ml20",type:"primary",onClick:()=>{o.submit()}},"\u4FDD\u5B58"))),Qe.createElement("div",{style:{maxHeight:"calc(100vh - 148px)",overflowY:"auto",marginTop:"10px",paddingRight:"5px"}},Qe.createElement(w.default.Item,{className:S.scoreinput,name:"question_score",label:"\u5206\u503C",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5206\u503C"}]},Qe.createElement(ke.Z,{onBlur:h=>{h.target.value==="0"&&le.ZP.error("\u5206\u503C\u5FC5\u987B\u5927\u4E8E0\u4E14\u5C0F\u4E8E\u7B49\u4E8E100")},style:{width:150},precision:1,placeholder:"\u8BF7\u8F93\u5165\u5206\u503C",max:100,min:.1})),Qe.createElement(ql.Z,{form:o,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u5224\u65AD\u9898\u9898\u5E72\u5185\u5BB9",choiceKey:""}),Qe.createElement(fe,{getTagData:k,qitem:e,exerciseitem:u,TagDiscipline:l,form:o}))))},al=v(36381),$={wrap:"wrap___YewKC",deleteIcon:"deleteIcon___AKmkj",keywordTag:"keywordTag___hMKmU",questionTitleEditorWrap:"questionTitleEditorWrap___SpNyf",choiceWrap:"choiceWrap___lDCnP",choiceIndex:"choiceIndex___dabwf",judgementIndex:"judgementIndex___sausK",setAnswerBtn:"setAnswerBtn___moVcF",activeAnswer:"activeAnswer___Cd32c",activeJudgementAnswer:"activeJudgementAnswer___rbuoo",actionWrapper:"actionWrapper___dZuBC",addIcon:"addIcon___A9GtN",inputBorder:"inputBorder___DeyjY",placeholder:"placeholder___dhOmk",blankWrapper:"blankWrapper___vU8Cg",blankInput:"blankInput___Vzre8",blankInputNumberWrapper:"blankInputNumberWrapper___yLeaN",addBtn:"addBtn___LhI0I",blankIndex:"blankIndex___caKgB",baseInputWrapper:"baseInputWrapper___DhjJY",collapseWrapper:"collapseWrapper___btrfP",panelHeader:"panelHeader___xIZ7O",open:"open___IMQhg",close:"close___FTAU3",hide:"hide___GBtJP",scoreByBlankRadio:"scoreByBlankRadio___HAunQ"},gt=v(12893),Xt=v(12290),rl=Object.defineProperty,Dl=Object.defineProperties,un=Object.getOwnPropertyDescriptors,it=Object.getOwnPropertySymbols,dl=Object.prototype.hasOwnProperty,wl=Object.prototype.propertyIsEnumerable,Al=(e,t,l)=>t in e?rl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,an=(e,t)=>{for(var l in t||(t={}))dl.call(t,l)&&Al(e,l,t[l]);if(it)for(var l of it(t))wl.call(t,l)&&Al(e,l,t[l]);return e},r=(e,t)=>Dl(e,un(t)),g=(e,t)=>{var l={};for(var u in e)dl.call(e,u)&&t.indexOf(u)<0&&(l[u]=e[u]);if(e!=null&&it)for(var u of it(e))t.indexOf(u)<0&&wl.call(e,u)&&(l[u]=e[u]);return l};const U=e=>{var t=e,{value:l,onChange:u,scrollId:p}=t,D=g(t,["value","onChange","scrollId"]);return n.createElement("div",{id:p||""},n.createElement(Xt.Z,r(an({},D),{defaultValue:l,onChange:(k,_)=>{console.log("a:",k,_),_!=null&&_.length?u(k,_):u(k)}})))},Q=({value:e,onChange:t,placeholder:l,height:u=140,isEdit:p})=>p?n.createElement(Xt.Z,{watch:!0,isFocus:!0,height:u,placeholder:l,defaultValue:e,onChange:t}):n.createElement("div",{style:{cursor:"pointer"}},e?n.createElement(He.Z,{className:$.inputBorder,value:e}):n.createElement("div",{className:`${$.inputBorder} ${$.placeholder}`},l));var Z=v(43604),me=v(32134),We=Object.defineProperty,we=Object.defineProperties,$t=Object.getOwnPropertyDescriptors,Yt=Object.getOwnPropertySymbols,pn=Object.prototype.hasOwnProperty,vn=Object.prototype.propertyIsEnumerable,En=(e,t,l)=>t in e?We(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,cl=(e,t)=>{for(var l in t||(t={}))pn.call(t,l)&&En(e,l,t[l]);if(Yt)for(var l of Yt(t))vn.call(t,l)&&En(e,l,t[l]);return e},ml=(e,t)=>we(e,$t(t)),fu=(e,t)=>{var l={};for(var u in e)pn.call(e,u)&&t.indexOf(u)<0&&(l[u]=e[u]);if(e!=null&&Yt)for(var u of Yt(e))t.indexOf(u)<0&&vn.call(e,u)&&(l[u]=e[u]);return l};const fn=["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"],yu=({value:e,onChange:t,choiceTextKey:l,answerKey:u,index:p,isEdit:D,setInputActive:k,form:_,choiceOptionsPath:a,allowChangeMode:o,showAddIcon:h,addItem:i,deleteItem:d})=>{const x=(e==null?void 0:e[u])===1,O=()=>{const I=_.getFieldValue(a);_.setFieldValue(a,I.map(c=>ml(cl({},c),{[u]:0})))},E=()=>{x?t(ml(cl({},e),{[u]:0})):(o||O(),t(ml(cl({},e),{[u]:1})))};return n.createElement(Se.Z,{className:$.choiceWrap,align:"middle",wrap:!1},n.createElement(Z.Z,{onClick:E,className:`${$.choiceIndex} ${x?$.activeAnswer:""}`},fn[p]),n.createElement(Z.Z,{flex:1,className:`${$.editorWrap} ml15`,onClick:k},n.createElement(Q,{height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",isEdit:D,value:e==null?void 0:e[l],onChange:I=>{t(ml(cl({},e),{[l]:I}))}})),n.createElement(Z.Z,{flex:"0 0 auto",className:"ml15"},n.createElement("div",{onClick:E,className:`${$.setAnswerBtn} ${x?$.activeAnswer:""}`},x?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")),n.createElement(Z.Z,{className:$.actionWrapper},n.createElement(oe.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},n.createElement(me.Z,{className:$.addIcon,onClick:i,style:{visibility:h?"visible":"hidden"}})),n.createElement(oe.Z,{title:"\u5220\u9664"},n.createElement(gt.Z,{className:$.deleteIcon,onClick:d,style:{visibility:p>1?"visible":"hidden"}}))))},hu=({questionTitlePlaceholder:e,titleKey:t,choiceKey:l,analysisKey:u,choiceTextKey:p,answerKey:D,choiceOptionsPath:k,allowChangeMode:_=!0,form:a,showAnalysis:o=!0})=>{const[h,i]=(0,n.useState)(),[d,x]=(0,n.useState)(!1);return n.createElement("div",{className:$.wrap},n.createElement("div",{className:$.questionTitleEditorWrap},n.createElement(w.default.Item,{label:"\u9898\u5E72",name:t,labelCol:{span:24},rules:[{required:!0}]},n.createElement(U,{scrollId:Array.isArray(t)?t.join("_"):`${t}`,watch:!0,height:140,placeholder:e}))),n.createElement(w.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}}),n.createElement(w.default.List,{name:l,rules:[{validator(O,E){const I=E.some(V=>V[D]===1),c=E.findIndex(V=>{var _e;return((_e=V[p])==null?void 0:_e.length)<=0});return c!==-1?Promise.reject(new Error(`\u8BF7\u5148\u8F93\u5165${fn[c]}\u9009\u9879\u7684\u5185\u5BB9`)):I?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},(O,{add:E,remove:I})=>n.createElement("div",{id:Array.isArray(k)?k.join("_"):`${k}`},O.map((c,V)=>{var _e=c,{key:m,name:s}=_e,J=fu(_e,["key","name"]);const ne=h===m,ee=()=>{i(m)},de=V<7&&V===O.length-1,G=()=>E({[p]:"",[D]:0}),y=()=>I(s);return n.createElement(w.default.Item,ml(cl({},J),{key:m,name:s,noStyle:!0}),n.createElement(yu,{choiceTextKey:p,answerKey:D,index:V,isEdit:ne,setInputActive:ee,form:a,choiceOptionsPath:k,allowChangeMode:_,showAddIcon:de,addItem:G,deleteItem:y}))}),O.length<8&&n.createElement("div",{className:`${$.addBtn} mb30`,onClick:()=>E({[p]:"",[D]:0})},"\u6DFB\u52A0\u9009\u9879"))),o&&n.createElement("div",{onClick:()=>x(!0)},n.createElement(w.default.Item,{name:u,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},n.createElement(Q,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:d}))))};var L=v(59301),gu=Object.defineProperty,Fu=Object.defineProperties,Bu=Object.getOwnPropertyDescriptors,Nl=Object.getOwnPropertySymbols,yn=Object.prototype.hasOwnProperty,hn=Object.prototype.propertyIsEnumerable,gn=(e,t,l)=>t in e?gu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,Pl=(e,t)=>{for(var l in t||(t={}))yn.call(t,l)&&gn(e,l,t[l]);if(Nl)for(var l of Nl(t))hn.call(t,l)&&gn(e,l,t[l]);return e},kl=(e,t)=>Fu(e,Bu(t)),bu=(e,t)=>{var l={};for(var u in e)yn.call(e,u)&&t.indexOf(u)<0&&(l[u]=e[u]);if(e!=null&&Nl)for(var u of Nl(e))t.indexOf(u)<0&&hn.call(e,u)&&(l[u]=e[u]);return l};const Cu=({value:e,onChange:t})=>{const l=p=>{b.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:$.modal,onOk:()=>{const D=[...e];D.splice(p,1),t(D)}})},u=()=>{const p=[...e];p.push(""),t(p)};return L.createElement(Se.Z,{className:"ml20"},L.createElement(Z.Z,{flex:1},e==null?void 0:e.map((p,D)=>L.createElement(Se.Z,{key:`${p}_${D}`,align:"middle",className:"mb20"},L.createElement(vt.default.TextArea,{style:{flex:1,minHeight:44},defaultValue:p,autoSize:{maxRows:3},maxLength:1e3,onBlur:k=>{const _=[...e],a=k.target.value.trim();_[D]=a,t(_)}}),L.createElement(oe.Z,{title:"\u5220\u9664"},L.createElement(gt.Z,{className:$.deleteIcon,style:{marginLeft:15,visibility:D>0?"visible":"hidden"},onClick:()=>l(D)}))))),L.createElement(Z.Z,null,L.createElement("div",{className:`${$.addBtn}`,onClick:()=>{u()}},"\u65B0\u589E\u7B54\u6848")))},xu=({value:e=!0,onChange:t})=>L.createElement(Be.Z,{checked:!e,onChange:l=>{t(!l)}}),_l="\u2581",Du=({questionTitlePlaceholder:e,form:t,name:l,scoreByBlank:u,answerKey:p,titleKey:D="name",analysisKey:k="analysis",isOrdered:_="is_ordered"})=>{var a,o;const[h,i]=(0,n.useState)(!1),d=(m,s)=>{const J=s.line;let ne=0;for(let de=0;de<J;de++)ne+=m.getLine(de).split(_l).length-1;const ee=m.getLine(J).substring(0,s.ch);return ne+=ee.split(_l).length-1,ne},x=(m,s,J,ne)=>{const ee=m.getRange(s.from,s.to);let de=0;if(s.text.forEach(G=>{de+=G.split(_l).length-1}),s.origin!=="setValue"){if(ee&&ee.indexOf(_l)!==-1){const G=ee.split(_l).length-1,y=d(m,s.from);if(console.log(`\u5220\u9664${G}\u4E2A\uFF0C \u524D\u9762\u6709${y}\u4E2A\uFF0C\u65B0\u589E${de}\u4E2A`),G>1){const te=Array.from({length:G},(Ce,xe)=>y+xe);ne(te)}else ne(y)}else if(de>0){const G=d(m,s.from);console.log(`\u65B0\u589E${de}\u4E2A\uFF0C\u4E4B\u524D\u6709${G}\u4E2A`),J(de,G)}}},O=()=>{const m=t.getFieldValue(["sub_item_banks",...p]);t.setFieldValue(["sub_item_banks",...p],m==null?void 0:m.map((s,J)=>kl(Pl({},s),{position:J+1})))},E=(0,n.useRef)(),I=(m,s)=>{for(let J=0;J<m;J++)E.current({position:null,answer_text:[""]},s+J);O()},c=(0,n.useRef)(),V=m=>{c.current(m),O()},_e=(o=(a=t.getFieldValue("sub_item_banks"))==null?void 0:a[p==null?void 0:p[0]])==null?void 0:o[p==null?void 0:p[1]];return console.log(t==null?void 0:t.getFieldValue(["sub_item_banks",...u])),L.createElement("div",{className:$.wrap},L.createElement("div",{className:$.questionTitleEditorWrap},L.createElement(w.default.Item,{label:"\u9898\u5E72",name:D,labelCol:{span:24},rules:[{required:!0}]},L.createElement(U,{scrollId:"name",watch:!0,height:140,placeholder:e,showNullButton:!0,onCMBeforeChange:(m,s)=>{x(m,s,I,V)}}))),L.createElement(w.default.List,{name:p,rules:[{validator(m,s){if((s==null?void 0:s.length)===0)return Promise.reject(new Error("\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879"));for(const J of s){const{answer_text:ne}=J||{};if(ne!=null&&ne.some(ee=>(ee==null?void 0:ee.length)===0))return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"))}return Promise.resolve()}}]},(m,{add:s,remove:J},{errors:ne})=>(E.current=s,c.current=J,L.createElement(L.Fragment,null,L.createElement(w.default.Item,{label:L.createElement("span",null,"\u586B\u7A7A\u9879\u7B54\u6848",!(m!=null&&m.length)&&L.createElement("span",{style:{color:"#E99237"}},"\uFF08\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879\uFF09")),required:!0,labelCol:{span:24}}),m.map((ee,de)=>{var G=ee,{key:y,name:te}=G,Ce=bu(G,["key","name"]);return L.createElement(Se.Z,{className:"mb20",key:y,align:"top"},L.createElement(Z.Z,{flex:"0 0 auto",className:`${$.blankIndex} pt5`},"\u586B\u7A7A\u9879",de+1),L.createElement(Z.Z,{flex:1},L.createElement(Se.Z,{align:"top",justify:"space-between"},L.createElement(Z.Z,{flex:1},L.createElement(w.default.Item,kl(Pl({},Ce),{name:[te,"answer_text"],noStyle:!0}),L.createElement(Cu,null))),(t==null?void 0:t.getFieldValue(["sub_item_banks",...u]))&&L.createElement(Z.Z,{flex:"224px",style:{margin:"-7px 0 0 20px"}},L.createElement(w.default.Item,kl(Pl({},Ce),{name:[te,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:$.blankInputNumberWrapper}),L.createElement(ke.Z,{onChange:()=>{var xe,pe;let ue=t==null?void 0:t.getFieldValue(["sub_item_banks",p==null?void 0:p[0],"standard_answers"]),Ee=0;for(let Ie in ue)(xe=ue[Ie])!=null&&xe.score&&(Ee+=Number((pe=ue[Ie])==null?void 0:pe.score));t==null||t.setFieldValue(["sub_item_banks",p==null?void 0:p[0],"question_score"],Ee)},className:$.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5206\u503C"})))),L.createElement(w.default.Item,kl(Pl({},Ce),{name:[te,"position"],noStyle:!0}),L.createElement(vt.default,{type:"hidden"}))))})))),L.createElement(Se.Z,{align:"middle"},L.createElement(w.default.Item,{name:[l,"downcase"],valuePropName:"checked"},L.createElement(Be.Z,null)),L.createElement(Z.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")),L.createElement(Se.Z,{align:"middle"},L.createElement(w.default.Item,{name:[l,"no_space"],valuePropName:"checked"},L.createElement(Be.Z,null)),L.createElement(Z.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),(_e==null?void 0:_e.length)>1&&L.createElement(Se.Z,{align:"middle",className:(_e==null?void 0:_e.length)>1?"mb30":`${$.hide}`},L.createElement(w.default.Item,{name:_},L.createElement(xu,null)),L.createElement(Z.Z,{className:"ml10"},"\u5141\u8BB8\u5B66\u751F\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u4E0E\u6807\u51C6\u7B54\u6848\u7684\u987A\u5E8F\u4E0D\u4E00\u81F4")),L.createElement("div",{onClick:()=>i(!0)},L.createElement(w.default.Item,{name:k,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},L.createElement(Q,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:h}))))};var wu=Object.defineProperty,Au=Object.defineProperties,Nu=Object.getOwnPropertyDescriptors,Ol=Object.getOwnPropertySymbols,Fn=Object.prototype.hasOwnProperty,Bn=Object.prototype.propertyIsEnumerable,bn=(e,t,l)=>t in e?wu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,Cn=(e,t)=>{for(var l in t||(t={}))Fn.call(t,l)&&bn(e,l,t[l]);if(Ol)for(var l of Ol(t))Bn.call(t,l)&&bn(e,l,t[l]);return e},xn=(e,t)=>Au(e,Nu(t)),Pu=(e,t)=>{var l={};for(var u in e)Fn.call(e,u)&&t.indexOf(u)<0&&(l[u]=e[u]);if(e!=null&&Ol)for(var u of Ol(e))t.indexOf(u)<0&&Bn.call(e,u)&&(l[u]=e[u]);return l};const ku={\u6B63\u786E:"T",\u9519\u8BEF:"F"},Ou=({value:e,onChange:t,form:l,choiceKey:u})=>{const p=(e==null?void 0:e.is_answer)===1,D=e==null?void 0:e.choice_text,k=()=>{var _;const a=(_=l==null?void 0:l.getFieldValue(["sub_item_banks",...u]))==null?void 0:_.map(o=>({choice_text:o.choice_text,is_answer:0}));l==null||l.setFieldValue(["sub_item_banks",...u],a),t(xn(Cn({},e),{is_answer:1}))};return n.createElement(Se.Z,{className:$.choiceWrap,align:"middle",wrap:!1},n.createElement(Z.Z,{onClick:k,className:`${$.choiceIndex} ${$.judgementIndex} ${p?$.activeAnswer:""}`},ku[D]),n.createElement(Z.Z,{flex:1,className:`${$.editorWrap} ml15`},n.createElement("div",{className:`${$.inputBorder} ${$.placeholder} ${p?$.activeJudgementAnswer:""}`},D)),n.createElement(Z.Z,{flex:"0 0 auto",className:"ml15"},n.createElement("div",{onClick:k,className:`${$.setAnswerBtn} ${p?$.activeAnswer:""}`},p?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")))},Su=({questionTitlePlaceholder:e,choiceKey:t="choices",form:l,titleKey:u="name",analysisKey:p="analysis"})=>{const[D,k]=(0,n.useState)(!1);return n.createElement("div",{className:$.wrap},n.createElement("div",{className:$.questionTitleEditorWrap},n.createElement(w.default.Item,{label:"\u9898\u5E72",name:u,labelCol:{span:24},rules:[{required:!0}]},n.createElement(U,{scrollId:"name",watch:!0,height:140,placeholder:e}))),n.createElement(w.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}},n.createElement(w.default.List,{name:t,rules:[{validator(_,a){return a.some(h=>(h==null?void 0:h.is_answer)===1)?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},_=>n.createElement("div",{id:"choices"},_.map(a=>{var o=a,{key:h,name:i}=o,d=Pu(o,["key","name"]);return n.createElement(w.default.Item,xn(Cn({},d),{key:h,name:i,noStyle:!0}),n.createElement(Ou,{form:l,choiceKey:t}))})))),n.createElement("div",{onClick:()=>k(!0)},n.createElement(w.default.Item,{name:p,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},n.createElement(Q,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:D}))))};var Zu=v(12563),Iu=Object.defineProperty,ju=Object.defineProperties,Tu=Object.getOwnPropertyDescriptors,Sl=Object.getOwnPropertySymbols,Dn=Object.prototype.hasOwnProperty,wn=Object.prototype.propertyIsEnumerable,An=(e,t,l)=>t in e?Iu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,on=(e,t)=>{for(var l in t||(t={}))Dn.call(t,l)&&An(e,l,t[l]);if(Sl)for(var l of Sl(t))wn.call(t,l)&&An(e,l,t[l]);return e},sn=(e,t)=>ju(e,Tu(t)),Nn=(e,t)=>{var l={};for(var u in e)Dn.call(e,u)&&t.indexOf(u)<0&&(l[u]=e[u]);if(e!=null&&Sl)for(var u of Sl(e))t.indexOf(u)<0&&wn.call(e,u)&&(l[u]=e[u]);return l};const Qu=e=>{var t=e,{value:l,onChange:u}=t,p=Nn(t,["value","onChange"]);const D=k=>{u([k])};return n.createElement(Xt.Z,sn(on({},p),{defaultValue:l==null?void 0:l[0],onChange:D}))},$u=e=>{if(!e)return!1;if(/^s*$/.test(e)||e.trim()===""){le.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u5168\u4E3A\u7A7A\u683C");return}let t=new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~\uFF01@#\uFFE5\u2026\u2026&*\uFF08\uFF09\u2014\u3010\u3011\u2018\uFF1B\uFF1A\u201D\u201C\u3002\uFF0C\u3001\uFF1F\u300C\u300D\u300E\u300F_\\+\\-\xB7%\u300A\u300B]|[\\\\/]");return e==="|"?(le.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0},Ru=({value:e=[],onClose:t})=>n.createElement(Zu.default,{closable:!0,onClose:t,className:$.keywordTag},n.createElement("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"}},e.join(" \u6216 "))),Vu=({questionTitlePlaceholder:e,form:t,showKeywords:l,isMustKeyWords:u=l,titleKey:p="name",analysisKey:D="analysis",answerTexts:k="answer_texts",keywords:_="keywords",useKeywords:a="use_keywords",indexs:o})=>{var h,i,d,x;const[O,E]=(0,n.useState)(!1),[I,c]=(0,n.useState)(""),V=(i=(h=t.getFieldValue("sub_item_banks"))==null?void 0:h[a==null?void 0:a[0]])==null?void 0:i[a==null?void 0:a[1]],_e=(x=(d=t.getFieldValue("sub_item_banks"))==null?void 0:d[a==null?void 0:a[0]])==null?void 0:x.question_score;return n.createElement("div",{className:$.wrap},n.createElement("div",{className:$.questionTitleEditorWrap},n.createElement(w.default.Item,{label:"\u9898\u5E72",name:p,labelCol:{span:24},rules:[{required:!0}]},n.createElement(U,{scrollId:"name",watch:!0,height:140,placeholder:e}))),n.createElement(w.default.Item,{label:"\u53C2\u8003\u7B54\u6848",name:k,labelCol:{span:24}},n.createElement(Qu,{watch:!0,height:140,placeholder:"\u8BF7\u7F16\u8F91\u53C2\u8003\u7B54\u6848\uFF08\u975E\u5FC5\u586B\uFF09"})),l&&!u&&n.createElement(w.default.Item,{hidden:!0,name:a,valuePropName:"checked"},n.createElement(Be.Z,{defaultChecked:!0})),l&&u&&n.createElement(Se.Z,{align:"middle",className:"mb30"},n.createElement(w.default.Item,{name:a,valuePropName:"checked"},n.createElement(Be.Z,null)),n.createElement(Z.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),n.createElement(Z.Z,null,n.createElement(oe.Z,{placement:"right",title:"\u9009\u4E2D\u540E\uFF0C\u9700\u8981\u8BBE\u7F6E\u6BCF\u4E2A\u5173\u952E\u8BCD\u7684\u5206\u503C\uFF0C\u7CFB\u7EDF\u4F1A\u6839\u636E\u8BBE\u7F6E\u7684\u5173\u952E\u8BCD\u8FDB\u884C\u81EA\u52A8\u5224\u5206\uFF1B \u6240\u6709\u5173\u952E\u8BCD\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u5C0F\u9898\u5206\u503C\u3002"},n.createElement(Pt.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),(V||!u)&&n.createElement(w.default.List,{name:_,rules:[{validator(m,s){return u?s!=null&&s.length?(s==null?void 0:s.reduce((ne,ee)=>ne+ee.score,0))>parseFloat(_e)?Promise.reject(new Error("\u6240\u6709\u5173\u952E\u8BCD\u7684\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u8BE5\u5C0F\u9898\u7684\u5206\u503C")):Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u5224\u5206\u5173\u952E\u8BCD")):Promise.resolve()}}]},(m,{add:s,remove:J})=>n.createElement(n.Fragment,null,n.createElement("div",{className:`${$.title} mb10`},u?"\u5173\u952E\u8BCD":n.createElement("span",{style:{color:"#9096A3"}},"\u5224\u5206\u5173\u952E\u8BCD")),n.createElement(Se.Z,{align:"middle",className:"font14 mb30"},n.createElement(Z.Z,{flex:1},n.createElement(vt.default,{value:I,onChange:ne=>{c(ne.target.value)},maxLength:50,allowClear:!0,onPressEnter:ne=>{var ee,de,G,y;const te=`${(ee=ne.target)==null?void 0:ee.value}`,Ce=(G=(de=te==null?void 0:te.split("|"))==null?void 0:de.filter(ue=>!!ue))==null?void 0:G.map(ue=>ue.trim()),xe=t.getFieldValue(["sub_item_banks",..._]),pe=((y=xe==null?void 0:xe.map(ue=>ue==null?void 0:ue.keyword))==null?void 0:y.flat())||[];for(const ue of Ce)if(pe.includes(ue)){le.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}$u(te)&&(s({keyword:Ce,score:1}),c(""))},className:$.inputBorder,placeholder:"\u652F\u6301\u8BBE\u7F6E\u591A\u4E2A\u5173\u952E\u8BCD\uFF1B\u5E76\u5217\u5173\u952E\u8BCD\uFF08\u6216\u7684\u5173\u7CFB\uFF09\u8BF7\u7528\u201C|\u201D\u5206\u9694\u5F00"})),n.createElement(Z.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),m.map(ne=>{var ee=ne,{key:de,name:G}=ee,y=Nn(ee,["key","name"]);return n.createElement(Se.Z,{key:de,className:"mb20",style:{marginRight:148}},n.createElement(Z.Z,{flex:1},n.createElement(Se.Z,{align:"middle",justify:"space-between"},n.createElement(w.default.Item,sn(on({},y),{name:[G,"keyword"]}),n.createElement(Ru,{onClose:()=>J(G)})),u&&n.createElement(w.default.Item,sn(on({},y),{name:[G,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:$.blankInputNumberWrapper}),n.createElement(ke.Z,{className:$.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))}))),n.createElement("div",{onClick:()=>E(!0)},n.createElement(w.default.Item,{name:D,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},n.createElement(Q,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:O}))))};var W=v(59301),Lu=Object.defineProperty,Wu=Object.defineProperties,Mu=Object.getOwnPropertyDescriptors,Zl=Object.getOwnPropertySymbols,Pn=Object.prototype.hasOwnProperty,kn=Object.prototype.propertyIsEnumerable,On=(e,t,l)=>t in e?Lu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,Sn=(e,t)=>{for(var l in t||(t={}))Pn.call(t,l)&&On(e,l,t[l]);if(Zl)for(var l of Zl(t))kn.call(t,l)&&On(e,l,t[l]);return e},Zn=(e,t)=>Wu(e,Mu(t)),zu=(e,t)=>{var l={};for(var u in e)Pn.call(e,u)&&t.indexOf(u)<0&&(l[u]=e[u]);if(e!=null&&Zl)for(var u of Zl(e))t.indexOf(u)<0&&kn.call(e,u)&&(l[u]=e[u]);return l};const{Panel:Hu}=al.default,Ju=({questionTitlePlaceholder:e,choiceKey:t,form:l,withScore:u})=>{const p=[{type:0,name:"\u5355\u9009\u9898"},{type:1,name:"\u591A\u9009\u9898"},{type:2,name:"\u5224\u65AD\u9898"},{type:3,name:"\u586B\u7A7A\u9898"},{type:4,name:"\u7B80\u7B54\u9898"},{type:5,name:"\u5B9E\u8BAD\u9898"},{type:6,name:"\u7F16\u7A0B\u9898"},{type:7,name:"\u7EC4\u5408\u9898"},{type:8,name:"\u7A0B\u5E8F\u586B\u7A7A\u9898"}],[D,k]=(0,n.useState)(),[_,a]=(0,n.useState)([]),o=i=>{a(i)},h=({value:i})=>W.createElement("div",{style:{width:150,paddingLeft:11}},i);return W.createElement("div",{className:$.wrap},W.createElement("div",{className:$.questionTitleEditorWrap},W.createElement(w.default.Item,{label:"\u9898\u5E72",name:"name",labelCol:{span:24},rules:[{required:!0}]},W.createElement(U,{scrollId:"name",watch:!0,height:140,placeholder:e}))),W.createElement(w.default.Item,{label:"\u5C0F\u9898",required:!0,labelCol:{span:24}}),W.createElement(w.default.List,{name:"sub_item_banks",rules:[{validator(i,d){return d?Promise.resolve():Promise.reject(new Error("\u8BF7\u6DFB\u52A0\u5C0F\u9898"))}}]},(i,{add:d,remove:x,move:O})=>{const E=l.getFieldValue("sub_item_banks");return W.createElement(W.Fragment,null,W.createElement(al.default,{className:i.length>0?$.collapseWrapper:"",bordered:!1,activeKey:_,onChange:o,expandIcon:({isActive:I})=>W.createElement("i",{className:`iconfont icon-weizhankai ${I?$.open:$.close}`,style:{fontSize:14,transition:"all .2s"}})},i.map((I,c)=>{var V=I,{key:_e,name:m}=V,s=zu(V,["key","name"]),J,ne,ee,de,G,y,te,Ce,xe,pe,ue,Ee,Ie,M;return W.createElement(Hu,{className:$.panel,forceRender:!0,header:W.createElement("div",{className:$.panelHeader},"\u7B2C",c+1,"\u5C0F\u9898",W.createElement("span",null,"\uFF08",((J=E==null?void 0:E[m])==null?void 0:J.question_type)==0?"\u5355\u9009\u9898":((ne=E==null?void 0:E[m])==null?void 0:ne.question_type)==1?"\u591A\u9009\u9898":((ee=E==null?void 0:E[m])==null?void 0:ee.question_type)==3?"\u586B\u7A7A\u9898":((de=E==null?void 0:E[m])==null?void 0:de.question_type)==2?"\u5224\u65AD\u9898":"\u7B80\u7B54\u9898","\uFF09")),key:m,extra:W.createElement(Se.Z,{align:"middle",onClick:re=>re.stopPropagation()},((G=E==null?void 0:E[m])==null?void 0:G.question_type)==3&&W.createElement(W.Fragment,null,W.createElement(lt.ZP.Group,{defaultValue:(y=E==null?void 0:E[m])==null?void 0:y.use_blank_score,className:S.scoreByBlankRadio,style:{marginRight:20},optionType:"button",options:[{label:"\u6309\u7A7A\u7ED9\u5206",value:!0},{label:"\u6309\u9898\u7ED9\u5206",value:!1}],onChange:re=>{var he,De,Xe,tt,st;if(l==null||l.setFieldValue(["sub_item_banks",m,"use_blank_score"],(he=re==null?void 0:re.target)==null?void 0:he.value),(De=re==null?void 0:re.target)!=null&&De.value){let _t=0;for(let jt in(Xe=l==null?void 0:l.getFieldValue(["sub_item_banks",m]))==null?void 0:Xe.standard_answers)_t+=Number((st=(tt=l==null?void 0:l.getFieldValue(["sub_item_banks",m]))==null?void 0:tt.standard_answers[jt])==null?void 0:st.score);l==null||l.setFieldValue(["sub_item_banks",m,"question_score"],_t||"")}k(new Date)}}),W.createElement(oe.Z,{overlayInnerStyle:{width:460},title:W.createElement("div",null,"\u6309\u7A7A\u7ED9\u5206\uFF1A\u9700\u8981\u5206\u522B\u8BBE\u7F6E\u6BCF\u4E2A\u586B\u7A7A\u9879\u7684\u5206\u503C\uFF0C\u586B\u7A7A\u9879\u7B54\u5BF9\u4E4B\u540E\u5219\u83B7\u5F97\u5BF9\u5E94\u7684\u5206\u503C\u3002",W.createElement("br",null),"\u6309\u9898\u7ED9\u5206\uFF1A\u9700\u8981\u8BBE\u7F6E\u6574\u4E2A\u5C0F\u9898\u7684\u5206\u503C\uFF0C\u7B54\u5BF9\u5168\u90E8\u586B\u7A7A\u9879\u4E4B\u540E\u624D\u80FD\u83B7\u5F97\u8BE5\u5C0F\u9898\u7684\u5206\u503C\u3002")},W.createElement("i",{className:"icon-tishixiaowenhao font18 mr25 c-3061d0"}))),u&&W.createElement(w.default.Item,Zn(Sn({},s),{rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5C0F\u9898\u5206\u503C"}],label:"\u5206\u503C",name:[m,"question_score"],className:$.blankInputNumberWrapper}),((te=E==null?void 0:E[m])==null?void 0:te.question_type)==3&&((Ce=E==null?void 0:E[m])!=null&&Ce.use_blank_score)?W.createElement(h,null):W.createElement(ke.Z,{className:$.blankInput,placeholder:"\u8BF7\u8F93\u5165\u5206\u6570",min:.1,precision:1,max:100,style:{width:150}})),W.createElement(Se.Z,{align:"middle",className:"pl40",style:{width:82}},c!==0&&W.createElement("div",{onClick:()=>{var re;O(c,c-1);const he=(re=l.getFieldValue("sub_item_banks"))==null?void 0:re.map((De,Xe)=>(i.map((tt,st)=>{Xe===st&&(De.q_position=Number(tt.name)+1)}),De));l.setFieldValue("sub_item_banks",he)}},W.createElement(oe.Z,{title:"\u4E0A\u79FB"},W.createElement("i",{className:"iconfont icon-shangyi3 c-grey-999 primary-hover"}))),c<i.length-1&&W.createElement("div",{onClick:()=>{var re;O(c,c+1);const he=(re=l.getFieldValue("sub_item_banks"))==null?void 0:re.map((De,Xe)=>(i.map((tt,st)=>{Xe===st&&(De.q_position=Number(tt.name)+1)}),De));l.setFieldValue("sub_item_banks",he)},className:c===0?"":"ml10"},W.createElement(oe.Z,{title:"\u4E0B\u79FB"},W.createElement("i",{className:"iconfont icon-xiayi3 c-grey-999 primary-hover"})))),W.createElement(oe.Z,{title:"\u5220\u9664"},W.createElement(gt.Z,{className:`${$.deleteIcon} ml40`,onClick:()=>x(m)})))},W.createElement(w.default.Item,Zn(Sn({},s),{name:m}),(((xe=E==null?void 0:E[m])==null?void 0:xe.question_type)==0||((pe=E==null?void 0:E[m])==null?void 0:pe.question_type)==1)&&W.createElement(hu,{questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9009\u62E9\u9898\u9898\u5E72\u5185\u5BB9",allowChangeMode:((ue=E==null?void 0:E[m])==null?void 0:ue.question_type)==1,form:l,choiceKey:[m,"choices"],titleKey:[m,"name"],analysisKey:[m,"analysis"],choiceOptionsPath:["sub_item_banks",m,"choices"],choiceTextKey:"choice_text",answerKey:"is_answer"}),((Ee=E==null?void 0:E[m])==null?void 0:Ee.question_type)==3&&W.createElement(Du,{form:l,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9898\u5E72\u5E76\u8BBE\u7F6E\u586B\u7A7A\u9879",name:m,scoreByBlank:[m,"use_blank_score"],titleKey:[m,"name"],analysisKey:[m,"analysis"],isOrdered:[m,"is_ordered"],answerKey:[m,"standard_answers"],key:D}),((Ie=E==null?void 0:E[m])==null?void 0:Ie.question_type)==2&&W.createElement(Su,{form:l,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u5224\u65AD\u9898\u9898\u5E72\u5185\u5BB9",titleKey:[m,"name"],analysisKey:[m,"analysis"],choiceKey:[m,"choices"]}),((M=E==null?void 0:E[m])==null?void 0:M.question_type)==4&&W.createElement(Vu,{showKeywords:!0,isMustKeyWords:!0,form:l,titleKey:[m,"name"],analysisKey:[m,"analysis"],answerTexts:[m,"answer_texts"],useKeywords:[m,"use_keywords"],keywords:[m,"keywords"],indexs:m,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u7B80\u7B54\u9898\u9898\u5E72\u5185\u5BB9",key:D})))})),i.length<20&&W.createElement(Bt.Z,{menu:{items:[{label:W.createElement("div",{onClick:()=>{d({name:"",choices:Array.from({length:4},()=>({choice_text:"",is_answer:0})),analysis:"",question_type:0,item_type:"SINGLE"}),a([i==null?void 0:i.length,..._])}},"\u5355\u9009\u9898"),key:"1",show:!0},{label:W.createElement("div",{onClick:()=>{d({name:"",choices:Array.from({length:4},()=>({choice_text:"",is_answer:0})),analysis:"",question_type:1,item_type:"MULTIPLE"}),a([i==null?void 0:i.length,..._])}},"\u591A\u9009\u9898"),key:"2",show:!0},{label:W.createElement("div",{onClick:()=>{d({name:"",choices:[{choice_text:"\u6B63\u786E",is_answer:0},{choice_text:"\u9519\u8BEF",is_answer:0}],analysis:"",question_type:2,item_type:"JUDGMENT"}),a([i==null?void 0:i.length,..._])}},"\u5224\u65AD\u9898"),key:"3",show:!0},{label:W.createElement("div",{onClick:()=>{d({name:"",analysis:"",is_ordered:!0,standard_answers:[],question_type:3,item_type:"COMPLETION",use_blank_score:!0,downcase:!0,no_space:!0}),a([i==null?void 0:i.length,..._])}},"\u586B\u7A7A\u9898"),key:"4",show:!0},{label:W.createElement("div",{onClick:()=>{d({name:"",answer_texts:[],keywords:[],use_keywords:!1,analysis:"",question_type:4,item_type:"SUBJECTIVE"}),a([i==null?void 0:i.length,..._])}},"\u7B80\u7B54\u9898"),key:"5",show:!0}].filter(I=>I.show).map(I=>({label:I.label,key:I.key}))}},W.createElement("div",{className:`${$.addBtn}`},"\u6DFB\u52A0\u5C0F\u9898")))}))};var Ge=v(59301),Gu=Object.defineProperty,Uu=Object.defineProperties,Xu=Object.getOwnPropertyDescriptors,In=Object.getOwnPropertySymbols,Yu=Object.prototype.hasOwnProperty,Ku=Object.prototype.propertyIsEnumerable,jn=(e,t,l)=>t in e?Gu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,Rt=(e,t)=>{for(var l in t||(t={}))Yu.call(t,l)&&jn(e,l,t[l]);if(In)for(var l of In(t))Ku.call(t,l)&&jn(e,l,t[l]);return e},Kt=(e,t)=>Uu(e,Xu(t)),qu=(e,t,l)=>new Promise((u,p)=>{var D=a=>{try{_(l.next(a))}catch(o){p(o)}},k=a=>{try{_(l.throw(a))}catch(o){p(o)}},_=a=>a.done?u(a.value):Promise.resolve(a.value).then(D,k);_((l=l.apply(e,t)).next())}),ea=({qitem:e,setisedit:t,TagDiscipline:l,exerciseitem:u,seveeditor:p,deleteitem:D,getTagData:k,init:_,showTip:a=!1})=>{const[o]=w.default.useForm();(0,n.useEffect)(()=>{var i;o.setFieldsValue(Kt(Rt({},e),{name:e.question_title,sub_item_banks:(i=e.sub_exercise_questions)==null?void 0:i.map(d=>{var x;return Kt(Rt({},d),{name:d.question_title,choices:(x=d==null?void 0:d.question_choices)==null?void 0:x.map(O=>Kt(Rt({},O),{is_answer:O!=null&&O.standard_boolean?1:0}))})}),repeat_answer:!e.repeat_answer}))},[e]);const h=i=>{if(!(i!=null&&i.length))return!1;const d=i.map(O=>{var E;return(E=O.choice_text)==null?void 0:E.trim().replace(/^\s+|\s+$/g,"")});return new Set(d).size!==d.length};return Ge.createElement("div",null,Ge.createElement(w.default,{form:o,colon:!1,onValuesChange:(i,d)=>{var x,O,E;if(i!=null&&i.sub_item_banks){let I=((x=o.getFieldValue("sub_item_banks"))==null?void 0:x.length)>0&&((E=(O=o.getFieldValue("sub_item_banks"))==null?void 0:O.map(c=>{var V;if(c.question_type==3&&(c!=null&&c.use_blank_score)){let _e=0;for(let m in c==null?void 0:c.standard_answers)_e+=Number((V=c==null?void 0:c.standard_answers[m])==null?void 0:V.score);return _e}else return c.question_score}))==null?void 0:E.filter(c=>c));(I==null?void 0:I.length)>0&&o.setFieldsValue({question_score:parseFloat(I==null?void 0:I.reduce((c,V)=>parseFloat(c)+parseFloat(V))).toFixed(1)})}},onFinish:i=>{var d,x;if((d=i.sub_item_banks)==null?void 0:d.some(E=>E.question_type===0||E.question_type===1?h(E.choices):!1)){le.ZP.error("\u9009\u62E9\u9898\u9009\u9879\u5185\u5BB9\u4E0D\u80FD\u91CD\u590D\uFF0C\u8BF7\u4FEE\u6539\u540E\u518D\u4FDD\u5B58");return}p(Kt(Rt(Rt({},e),i),{sub_item_banks:(x=i==null?void 0:i.sub_item_banks)==null?void 0:x.map(E=>(console.log(E),Kt(Rt({},E),{item_type:E==null?void 0:E.question_type,id:(E==null?void 0:E.question_id)||""})))}))},onFinishFailed:i=>qu(void 0,null,function*(){var d,x;le.ZP.error(i.errorFields[0].errors[0]),o.scrollToField((x=(d=i==null?void 0:i.errorFields)==null?void 0:d[0])==null?void 0:x.name,{behavior:"smooth",block:"center"})})},Ge.createElement("div",{style:{display:"flex",alignItems:"center"}},Ge.createElement("div",{style:{flex:1}},Ge.createElement("span",{style:{display:"inline-flex",border:"1px solid #9096A3",borderRadius:"50%",width:10,height:10,marginRight:5,background:"#9096A3"}}),Ge.createElement("span",null,"\u7EC4\u5408\u9898")),!e.isadd&&Ge.createElement("span",{style:{marginLeft:20,marginRight:20,color:"red",cursor:"pointer"},onClick:()=>{D()}},Ge.createElement("i",{className:"iconfont icon-piliangshanchu3",style:{fontSize:14,marginRight:6}}),"\u5220\u9664"),Ge.createElement(Oe.ZP,{onClick:()=>{var i;e.isadd?(t(!1),_()):(o.setFieldsValue(Kt(Rt({},e),{name:e==null?void 0:e.question_title,choices:(i=e==null?void 0:e.question_choices)==null?void 0:i.map(d=>Kt(Rt({},d),{standard_boolean:d!=null&&d.standard_boolean?1:0})),repeat_answer:!(e!=null&&e.repeat_answer)})),t(!1))}},"\u53D6\u6D88"),Ge.createElement(oe.Z,{overlayClassName:S.shake,open:a,placement:"bottom",color:"rgba(244,156,14,0.19)",title:Ge.createElement("div",{style:{color:"#FF841A",fontSize:"14px"}},Ge.createElement("i",{className:"iconfont icon-tishi11 mr5 font14"}),"\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u8BD5\u9898\u3002")},Ge.createElement(Oe.ZP,{className:"ml20",type:"primary",onClick:()=>{o.submit()}},"\u4FDD\u5B58"))),Ge.createElement("div",{style:{maxHeight:"calc(100vh - 148px)",overflowY:"auto",marginTop:"10px",paddingRight:"5px"}},Ge.createElement(nl.Z,{text:"\uFF08\u7EC4\u5408\u9898\u5206\u503C\u7B49\u4E8E\u5404\u5C0F\u9898\u5206\u503C\u4E4B\u548C\uFF09"}),Ge.createElement(Ju,{form:o,withScore:!0,choiceKey:"",questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u7EC4\u5408\u9898\u9898\u5E72\u5185\u5BB9"}),Ge.createElement(fe,{getTagData:k,qitem:e,exerciseitem:u,TagDiscipline:l,form:o}))))},ta=v(90502),Il=v(24334),Ue=v(59301),la=Object.defineProperty,na=Object.defineProperties,ua=Object.getOwnPropertyDescriptors,Tn=Object.getOwnPropertySymbols,aa=Object.prototype.hasOwnProperty,ia=Object.prototype.propertyIsEnumerable,Qn=(e,t,l)=>t in e?la(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,St=(e,t)=>{for(var l in t||(t={}))aa.call(t,l)&&Qn(e,l,t[l]);if(Tn)for(var l of Tn(t))ia.call(t,l)&&Qn(e,l,t[l]);return e},pl=(e,t)=>na(e,ua(t)),oa=(e,t,l)=>new Promise((u,p)=>{var D=a=>{try{_(l.next(a))}catch(o){p(o)}},k=a=>{try{_(l.throw(a))}catch(o){p(o)}},_=a=>a.done?u(a.value):Promise.resolve(a.value).then(D,k);_((l=l.apply(e,t)).next())}),sa=({qitem:e,TagDiscipline:t,exerciseitem:l,setisedit:u,seveeditor:p,deleteitem:D,getTagData:k,init:_,showTip:a=!1})=>{const[o]=w.default.useForm(),h=!0;return(0,n.useEffect)(()=>{var i,d,x;o.setFieldsValue(pl(St({},e),{standard_answers:e.standard_answer,difficulty:e.difficulty,item_banks_group_id:e.item_banks_group_id,hack:pl(St({},e),{time_limit:(e==null?void 0:e.time_limit)||3}),hack_codes:{language:(i=e==null?void 0:e.program_attr)==null?void 0:i.language,code:Il.Base64.decode(((d=e==null?void 0:e.program_attr)==null?void 0:d.code)||"")},hack_sets:St({},(x=e==null?void 0:e.hack_sets)==null?void 0:x[0]),repeat_answer:!e.repeat_answer}))},[e]),Ue.createElement("div",null,Ue.createElement(w.default,{form:o,colon:!1,onValuesChange:(i,d)=>{var x,O,E,I;if(i!=null&&i.standard_answers){let c=((x=o.getFieldValue("standard_answers"))==null?void 0:x.length)>0&&((E=(O=o.getFieldValue("standard_answers"))==null?void 0:O.map(V=>V.score))==null?void 0:E.filter(V=>V));(c==null?void 0:c.length)>0&&o.setFieldsValue({question_score:(c==null?void 0:c.length)>0&&((I=c.reduce((V,_e)=>V+_e))==null?void 0:I.toFixed(1))})}},onFinish:i=>{var d;p(pl(St(St({},e),i),{item_type:e==null?void 0:e.question_type,standard_answers:(d=i.standard_answers)==null?void 0:d.map((x,O)=>pl(St({},x),{position:O+1})),standard_answer:void 0}))},onFinishFailed:i=>oa(void 0,null,function*(){var d,x;le.ZP.error(i.errorFields[0].errors[0]),o.scrollToField((x=(d=i==null?void 0:i.errorFields)==null?void 0:d[0])==null?void 0:x.name,{behavior:"smooth",block:"center"})})},Ue.createElement("div",{style:{display:"flex",alignItems:"center"}},Ue.createElement("div",{style:{flex:1}},Ue.createElement("span",{style:{display:"inline-flex",border:"1px solid #9096A3",borderRadius:"50%",width:10,height:10,marginRight:5,background:"#9096A3"}}),Ue.createElement("span",null,"\u7A0B\u5E8F\u586B\u7A7A\u9898")),!e.isadd&&Ue.createElement("span",{style:{marginLeft:20,marginRight:20,color:"red",cursor:"pointer"},onClick:()=>{D()}},Ue.createElement("i",{className:"iconfont icon-piliangshanchu3",style:{fontSize:14,marginRight:6}})," \u5220\u9664"),Ue.createElement(Oe.ZP,{onClick:()=>{var i,d,x;e.isadd?(u(!1),_()):(o.setFieldsValue(pl(St({},e),{standard_answers:e.standard_answer,difficulty:e.difficult,item_banks_group_id:e.item_banks_group_id,hack:St({},e),hack_codes:{language:(i=e==null?void 0:e.program_attr)==null?void 0:i.language,code:Il.Base64.decode((d=e==null?void 0:e.program_attr)==null?void 0:d.code)},hack_sets:St({},(x=e==null?void 0:e.hack_sets)==null?void 0:x[0]),repeat_answer:!e.repeat_answer})),u(!1))}},"\u53D6\u6D88"),Ue.createElement(oe.Z,{overlayClassName:S.shake,open:a,placement:"bottom",color:"rgba(244,156,14,0.19)",title:Ue.createElement("div",{style:{color:"#FF841A",fontSize:"14px"}},Ue.createElement("i",{className:"iconfont icon-tishi11 mr5 font14"}),"\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u8BD5\u9898\u3002")},Ue.createElement(Oe.ZP,{className:"ml20",type:"primary",onClick:()=>{o.submit()}},"\u4FDD\u5B58"))),Ue.createElement("div",{style:{maxHeight:"calc(100vh - 148px)",overflowY:"auto",marginTop:"10px",paddingRight:"5px"}},Ue.createElement(nl.Z,{text:"\uFF08\u5C0F\u9898\u5206\u503C\u7B49\u4E8E\u5404\u586B\u7A7A\u9879\u5206\u503C\u4E4B\u548C\uFF09"}),Ue.createElement(ta.t,{form:o,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u7A0B\u5E8F\u586B\u7A7A\u9898\u9898\u5E72\u5185\u5BB9",scoreByBlank:h,hackidentifier:e==null?void 0:e.hack_identifier,answerKey:"standard_answers"}),Ue.createElement(fe,{getTagData:k,qitem:e,exerciseitem:l,TagDiscipline:t,form:o}))))},Ae=v(59301),ra=Object.defineProperty,da=Object.defineProperties,ca=Object.getOwnPropertyDescriptors,$n=Object.getOwnPropertySymbols,ma=Object.prototype.hasOwnProperty,_a=Object.prototype.propertyIsEnumerable,Rn=(e,t,l)=>t in e?ra(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,ft=(e,t)=>{for(var l in t||(t={}))ma.call(t,l)&&Rn(e,l,t[l]);if($n)for(var l of $n(t))_a.call(t,l)&&Rn(e,l,t[l]);return e},Zt=(e,t)=>da(e,ca(t)),Vn=(e,t,l)=>new Promise((u,p)=>{var D=a=>{try{_(l.next(a))}catch(o){p(o)}},k=a=>{try{_(l.throw(a))}catch(o){p(o)}},_=a=>a.done?u(a.value):Promise.resolve(a.value).then(D,k);_((l=l.apply(e,t)).next())}),pa=({qitem:e,setqitem:t,setisedit:l,TagDiscipline:u,exerciseitem:p,seveeditor:D,deleteitem:k,showTip:_=!1})=>{var a;const[o]=w.default.useForm();return(0,n.useEffect)(()=>{var h,i;o.setFieldsValue(Zt(ft({},e),{name:e==null?void 0:e.question_title,choices:(h=e==null?void 0:e.question_choices)==null?void 0:h.map(d=>Zt(ft({},d),{standard_boolean:d!=null&&d.standard_boolean?1:0})),repeat_answer:!(e!=null&&e.repeat_answer)})),e.shixun=(i=e==null?void 0:e.shixun)==null?void 0:i.map(d=>Zt(ft({},d),{defaultscore:d.challenge_score}))},[]),Ae.createElement("div",null,Ae.createElement(w.default,{form:o,colon:!1,onFinish:h=>{var i,d;let x=Zt(ft({},h),{question_scores:(i=e==null?void 0:e.shixun)==null?void 0:i.map(O=>O.challenge_score),item_type:e==null?void 0:e.question_type,choices:(d=h==null?void 0:h.choices)==null?void 0:d.map(O=>Zt(ft({},O),{is_answer:O.standard_boolean}))});D(ft(ft({},e),x))},onFinishFailed:h=>Vn(void 0,null,function*(){var i,d;le.ZP.error(h.errorFields[0].errors[0]),o.scrollToField((d=(i=h==null?void 0:h.errorFields)==null?void 0:i[0])==null?void 0:d.name,{behavior:"smooth",block:"center"})})},Ae.createElement("div",{style:{display:"flex",alignItems:"center"}},Ae.createElement("div",{style:{flex:1}},Ae.createElement("span",{style:{display:"inline-flex",border:"1px solid #9096A3",borderRadius:"50%",width:10,height:10,marginRight:5,background:"#9096A3"}}),Ae.createElement("span",null,"\u5B9E\u8BAD\u9898")),Ae.createElement("span",{style:{marginLeft:20,marginRight:20,color:"red",cursor:"pointer"},onClick:()=>{k()}},Ae.createElement("i",{className:"iconfont icon-piliangshanchu3",style:{fontSize:14,marginRight:6}}),"\u5220\u9664"),Ae.createElement(Oe.ZP,{onClick:()=>{var h,i;o.setFieldsValue(Zt(ft({},e),{name:e==null?void 0:e.question_title,choices:(h=e==null?void 0:e.question_choices)==null?void 0:h.map(d=>Zt(ft({},d),{standard_boolean:d!=null&&d.standard_boolean?1:0})),repeat_answer:!(e!=null&&e.repeat_answer)})),e.shixun=(i=e==null?void 0:e.shixun)==null?void 0:i.map(d=>Zt(ft({},d),{challenge_score:d.defaultscore})),t(ft({},e)),l(!1)}},"\u53D6\u6D88"),Ae.createElement(oe.Z,{overlayClassName:S.shake,open:_,placement:"bottom",color:"rgba(244,156,14,0.19)",title:Ae.createElement("div",{style:{color:"#FF841A",fontSize:"14px"}},Ae.createElement("i",{className:"iconfont icon-tishi11 mr5 font14"}),"\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u8BD5\u9898\u3002")},Ae.createElement(Oe.ZP,{className:"ml20",type:"primary",onClick:()=>Vn(void 0,null,function*(){var h,i,d;if(((i=(h=e==null?void 0:e.shixun)==null?void 0:h.map)==null?void 0:i.call(h,x=>x.challenge_score).filter(x=>x).length)<((d=e==null?void 0:e.shixun)==null?void 0:d.length)){le.ZP.info("\u5206\u6570\u4E0D\u80FD\u4E3A\u7A7A");return}o.submit()})},"\u4FDD\u5B58"))),Ae.createElement(nl.Z,{text:"\uFF08\u5B9E\u8BAD\u9898\u5206\u503C\u7B49\u4E8E\u5404\u5173\u5361\u5206\u503C\u4E4B\u548C\uFF09"}),Ae.createElement(w.default.Item,{label:"\u9898\u5E72",name:"question_title",labelCol:{span:24},rules:[{required:!0}]},Ae.createElement(Xt.Z,{watch:!0,height:140,placeholder:"",defaultValue:e.question_title}))),Ae.createElement(Se.Z,{style:{marginBottom:15},align:"middle",justify:"space-between"},Ae.createElement("div",null,Ae.createElement("span",{style:{color:"red"}},"*"),"\u5173\u5361\u540D\u79F0"),Ae.createElement("a",{href:`/shixuns/${e==null?void 0:e.shixun_identifier}/challenges?exercise=true`,target:"_blank"},Ae.createElement("i",{onClick:()=>{},className:"iconfont icon-shixunkecheng font14 mr5"}),"\u5B9E\u8BAD\u8BE6\u60C5")),(a=e==null?void 0:e.shixun)==null?void 0:a.map((h,i)=>Ae.createElement("div",{key:h.challenge_id,style:{display:"flex",marginBottom:20}},Ae.createElement("div",{style:{flex:1}},i+1,"\u3001",h.challenge_name),Ae.createElement("div",null,Ae.createElement("span",{style:{color:"red"}},"*"),"\u5206\u503C",Ae.createElement(ke.Z,{precision:1,value:h==null?void 0:h.challenge_score,onChange:d=>{const x=JSON.parse(JSON.stringify((e==null?void 0:e.shixun)||[]));x[i].challenge_score=d;const O=x.every(I=>!I.challenge_score),E=parseFloat(x==null?void 0:x.map(I=>I.challenge_score).reduce((I,c)=>parseFloat(I||0)+parseFloat(c||0)));o.setFieldsValue({question_score:O?"":E.toFixed(1)}),t(Zt(ft({},e),{shixun:x}))},max:200,min:1,style:{marginLeft:10,width:150},placeholder:"\u8BF7\u8F93\u5165\u5206\u503C",size:"middle"})))))},A={flex_box_center:"flex_box_center___ljmk3",flex_space_between:"flex_space_between___Fy45C",flex_box_vertical_center:"flex_box_vertical_center___SoC1C",flex_box_center_end:"flex_box_center_end___MumBX",flex_box_column:"flex_box_column___cutpt",warp:"warp___w1JUC",indexTag:"indexTag___LPncW",normalWrap:"normalWrap___pEIzs",redio:"redio___I6tXM",redioitem:"redioitem___cS4Gp",redioitemyes:"redioitemyes___JBDmk",title:"title___XAohQ",titleyes:"titleyes____bNQk",yestag:"yestag___zQnb1",checkbox:"checkbox___MHadU",checkboxitem:"checkboxitem___KX7mB",checkboxitemyes:"checkboxitemyes___MpOWf",bottom:"bottom___FkHfO",bottomitem:"bottomitem___AS0Qp",left:"left___U23z1",right:"right___yJVEk",completion:"completion___Bu5G6",content:"content___LySPW",items:"items___ETMq9",simple:"simple___XX5t0",shixunWrapper:"shixunWrapper___w6oIG",shixun:"shixun___ePWKn",score:"score___nGh9k",qtitle:"qtitle___DAMW1",program:"program___Mm1qL",combination:"combination___Sw7S6",qtype:"qtype___Xdl60",divname:"divname___AZYhO"},va=v(1710),Ea=v(59879),f=v(59301);const jl=["A\uFF0E","B\uFF0E","C\uFF0E","D\uFF0E","E\uFF0E","F\uFF0E","G\uFF0E","H\uFF0E","I\uFF0E","J\uFF0E","K\uFF0E","L\uFF0E","M\uFF0E","N\uFF0E","O\uFF0E","P\uFF0E","Q\uFF0E","R\uFF0E","S\uFF0E","T\uFF0E","U\uFF0E","V\uFF0E","W\uFF0E","X\uFF0E","Y\uFF0E","Z\uFF0E"],fa=[{type:0,name:"\u5355\u9009\u9898"},{type:1,name:"\u591A\u9009\u9898"},{type:2,name:"\u5224\u65AD\u9898"},{type:3,name:"\u586B\u7A7A\u9898"},{type:4,name:"\u7B80\u7B54\u9898"},{type:5,name:"\u5B9E\u8BAD\u9898"},{type:6,name:"\u7F16\u7A0B\u9898"},{type:7,name:"\u7EC4\u5408\u9898"},{type:8,name:"\u7A0B\u5E8F\u586B\u7A7A\u9898"}];var ya=({qitem:e,newExercisePaper:t})=>{var l,u,p,D,k,_,a,o,h,i,d,x,O,E,I,c,V,_e,m,s,J,ne,ee,de,G;return f.createElement("div",{className:A.warp},((e==null?void 0:e.question_type)===0||(e==null?void 0:e.question_type)===2)&&f.createElement("div",{className:A.normalWrap},(l=e==null?void 0:e.question_choices)==null?void 0:l.map((y,te)=>f.createElement("div",{className:A.redio,key:te},!(y!=null&&y.standard_boolean)&&f.createElement("span",{className:A.redioitem}),(y==null?void 0:y.standard_boolean)&&f.createElement("i",{className:`${A.redioitemyes} icon-duigou1`}),f.createElement("span",{className:`${y!=null&&y.standard_boolean?A.titleyes:A.title} ${A.indexTag}`},(e==null?void 0:e.question_type)===0?jl[te]:""),f.createElement(He.Z,{className:y!=null&&y.standard_boolean?A.titleyes:A.title,value:y==null?void 0:y.choice_text}),(y==null?void 0:y.standard_boolean)&&f.createElement("div",{className:A.yestag},"\u6B63\u786E\u7B54\u6848")))),(e==null?void 0:e.question_type)===1&&f.createElement("div",{className:A.normalWrap},(u=e==null?void 0:e.question_choices)==null?void 0:u.map((y,te)=>f.createElement("div",{className:A.checkbox,key:te},!(y!=null&&y.standard_boolean)&&f.createElement("span",{className:A.checkboxitem}),(y==null?void 0:y.standard_boolean)&&f.createElement("i",{className:`${A.checkboxitemyes} icon-duigou1`}),f.createElement("span",{className:`${y!=null&&y.standard_boolean?A.titleyes:A.title} ${A.indexTag}`},jl[te]),f.createElement(He.Z,{className:y!=null&&y.standard_boolean?A.titleyes:A.title,value:y==null?void 0:y.choice_text}),(y==null?void 0:y.standard_boolean)&&f.createElement("div",{className:A.yestag},"\u6B63\u786E\u7B54\u6848")))),(e==null?void 0:e.question_type)===3&&f.createElement("div",{className:A.completion},(p=e==null?void 0:e.standard_answers)==null?void 0:p.map((y,te)=>{var Ce;return f.createElement(Se.Z,{align:"top"},f.createElement("span",{className:A.title},"\u586B\u7A7A\u9879",te+1),f.createElement("div",{className:A.content},(Ce=y.answer_text)==null?void 0:Ce.map((xe,pe)=>f.createElement("div",{key:pe,className:A.items,style:(y==null?void 0:y.model)===2?{border:0,padding:0}:{}},(y==null?void 0:y.model)===1?f.createElement("pre",{className:"mb0"},xe):f.createElement(Ea.Z,{value:xe,disabled:!0})))))})),(e==null?void 0:e.question_type)===4&&f.createElement("div",{className:A.simple},f.createElement("div",{className:A.title},"\u53C2\u8003\u7B54\u6848"),f.createElement("div",{className:"mt10",style:{fontSize:"16px"}},(D=e==null?void 0:e.answer_texts)!=null&&D[0]?f.createElement(He.Z,{className:A.content,value:(k=e==null?void 0:e.answer_texts)==null?void 0:k[0]}):f.createElement("div",{style:{color:"#C1C1C1"}},"\u6682\u672A\u8BBE\u7F6E~")),f.createElement("div",{className:"mt20 "},f.createElement("span",{className:A.title,style:{color:"#3061D0"}},"\u5224\u5206\u65B9\u5F0F"),f.createElement("span",{style:{color:"#000",marginLeft:10,fontSize:"16px"}},e!=null&&e.use_keywords?"\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206":"\u624B\u52A8\u5224\u5206"))),(e==null?void 0:e.question_type)===5&&f.createElement("div",{className:A.shixunWrapper},(_=e==null?void 0:e.shixun)==null?void 0:_.map((y,te)=>{var Ce,xe;return f.createElement("div",null,f.createElement("div",{key:te,className:`${A.shixun} mb30`},f.createElement("span",{className:A.score},"\uFF08",y==null?void 0:y.challenge_score,"\u5206\uFF09"),f.createElement("span",{className:A.qtitle},(e==null?void 0:e.index)+"."+(te+1),"\u3001",y==null?void 0:y.challenge_name)),((xe=(Ce=t==null?void 0:t.editData)==null?void 0:Ce.exercise)==null?void 0:xe.show_challenge_task_pass)&&f.createElement(He.Z,{className:A.content,value:(y==null?void 0:y.challenge_task_pass)||"\u6682\u65E0\u5173\u5361\u63CF\u8FF0"}))})),(e==null?void 0:e.question_type)===6&&f.createElement("div",{className:A.program,style:{border:!((o=(a=t==null?void 0:t.editData)==null?void 0:a.exercise)!=null&&o.show_hack_sets)&&!((i=(h=t==null?void 0:t.editData)==null?void 0:h.exercise)!=null&&i.show_hack_description)&&"none"}},((x=(d=t==null?void 0:t.editData)==null?void 0:d.exercise)==null?void 0:x.show_hack_sets)&&f.createElement("div",{style:{marginBottom:10,border:"1px solid #F1F4F9"}},f.createElement("p",{style:{padding:"0px 10px",height:40,lineHeight:"40px",background:"#F1F4F9",color:"#3061D0"}},f.createElement("i",{className:"iconfont icon-ceshiyongli"})," \u6D4B\u8BD5\u7528\u4F8B\uFF1A"),f.createElement(va.default,{style:{margin:10},columns:[{title:"\u5E8F\u53F7",dataIndex:"name",key:"name",width:"10%",render:(y,te,Ce)=>Ce+1},{title:"\u6D4B\u8BD5\u7528\u4F8B\u8F93\u5165",dataIndex:"input",key:"input",width:"40%",render:(y,te,Ce)=>f.createElement(oe.Z,{title:f.createElement("pre",null,y)},f.createElement("div",{className:A.divname},y))},{title:"\u6D4B\u8BD5\u7528\u4F8B\u8F93\u51FA",dataIndex:"output",key:"output",width:"40%",render:(y,te,Ce)=>f.createElement(oe.Z,{title:f.createElement("pre",null,y)}," ",f.createElement("div",{className:A.divname},y))},{title:"\u662F\u5426\u53EF\u89C1",dataIndex:"visibility_cn",key:"visibility_cn",width:"10%"}],pagination:!1,dataSource:(O=e==null?void 0:e.program_attr)==null?void 0:O.hack_sets})),((I=(E=t==null?void 0:t.editData)==null?void 0:E.exercise)==null?void 0:I.show_hack_description)&&f.createElement("div",null,f.createElement(He.Z,{className:A.content,value:(e==null?void 0:e.description)||"- -"}))),(e==null?void 0:e.question_type)===7&&((c=e==null?void 0:e.sub_exercise_questions)==null?void 0:c.map((y,te)=>{var Ce,xe,pe,ue,Ee,Ie;return f.createElement("div",{key:te},f.createElement("div",{className:A.combination},f.createElement("span",{className:A.score},y==null?void 0:y.question_score,"\u5206"),f.createElement("span",{className:A.qtype},(Ce=fa.find(M=>M.type==y.question_type))==null?void 0:Ce.name),f.createElement("span",{className:A.qtitle},f.createElement(He.Z,{value:`${te+1}\u3001${y==null?void 0:y.question_title}`}))),(y.question_type===0||y.question_type===2)&&f.createElement("div",{className:A.warp,style:{padding:"20px 58px 0 58px"}},f.createElement("div",null,(xe=y==null?void 0:y.question_choices)==null?void 0:xe.map((M,re)=>f.createElement("div",{className:A.redio,key:re},!(M!=null&&M.standard_boolean)&&f.createElement("span",{className:A.redioitem}),(M==null?void 0:M.standard_boolean)&&f.createElement("i",{className:`${A.redioitemyes} icon-duigou1`}),f.createElement("span",{className:`${M!=null&&M.standard_boolean?A.titleyes:A.title} ${A.indexTag}`},jl[re]),f.createElement(He.Z,{className:M!=null&&M.standard_boolean?A.titleyes:A.title,value:M==null?void 0:M.choice_text}),(M==null?void 0:M.standard_boolean)&&f.createElement("div",{className:A.yestag},"\u6B63\u786E\u7B54\u6848"))))),y.question_type===1&&f.createElement("div",{className:A.normalWrap},(pe=y==null?void 0:y.question_choices)==null?void 0:pe.map((M,re)=>f.createElement("div",{className:A.checkbox,key:re},!(M!=null&&M.standard_boolean)&&f.createElement("span",{className:A.checkboxitem}),(M==null?void 0:M.standard_boolean)&&f.createElement("i",{className:`${A.checkboxitemyes} icon-duigou1`}),f.createElement("span",{className:`${M!=null&&M.standard_boolean?A.titleyes:A.title} ${A.indexTag}`},jl[re]),f.createElement(He.Z,{className:M!=null&&M.standard_boolean?A.titleyes:A.title,value:M==null?void 0:M.choice_text}),(M==null?void 0:M.standard_boolean)&&f.createElement("div",{className:A.yestag},"\u6B63\u786E\u7B54\u6848")))),y.question_type===3&&f.createElement("div",{className:A.completion},(ue=y==null?void 0:y.standard_answers)==null?void 0:ue.map((M,re)=>{var he;return f.createElement(Se.Z,{align:"top"},f.createElement("span",{className:A.title},"\u586B\u7A7A\u9879",re+1),f.createElement("div",{className:A.content},(he=M.answer_text)==null?void 0:he.map((De,Xe)=>f.createElement("div",{key:Xe,className:A.items},f.createElement("pre",{className:"mb0"},De)))))})),y.question_type===4&&f.createElement("div",{className:A.simple},f.createElement("div",{className:A.title},"\u53C2\u8003\u7B54\u6848"),f.createElement("div",{className:"mt10",style:{fontSize:"16px"}},(Ee=y==null?void 0:y.answer_texts)!=null&&Ee[0]?f.createElement(He.Z,{className:A.content,value:(Ie=y==null?void 0:y.answer_texts)==null?void 0:Ie[0]}):f.createElement("div",{style:{color:"#C1C1C1"}},"\u6682\u672A\u8BBE\u7F6E~")),f.createElement("div",{className:"mt20 "},f.createElement("span",{className:A.title,style:{color:"#3061D0"}},"\u5224\u5206\u65B9\u5F0F"),f.createElement("span",{style:{color:"#000",marginLeft:10,fontSize:"16px"}},y!=null&&y.use_keywords?"\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206":"\u624B\u52A8\u5224\u5206"))))})),(e==null?void 0:e.question_type)===8&&f.createElement("div",null,f.createElement(He.Z,{disabledFill:!0,className:A.content,showProgramFill:!0,value:Il.Base64.decode(((V=e==null?void 0:e.program_attr)==null?void 0:V.code)||"")})),((e==null?void 0:e.question_type)<=4||[6,8].includes(e==null?void 0:e.question_type))&&f.createElement("div",{className:A.bottom},f.createElement("div",{className:`${A.bottomitem} mb30`},f.createElement("span",{className:A.left},"\u89E3\u6790"),f.createElement("span",{className:A.right},e!=null&&e.analysis?f.createElement(He.Z,{value:e==null?void 0:e.analysis}):f.createElement("span",{style:{color:"#C1C1C1"}},"\u6682\u672A\u8BBE\u7F6E~"))),f.createElement("div",{className:`${A.bottomitem} mb30`},f.createElement("span",{className:A.left},"\u96BE\u5EA6"),f.createElement("span",{className:A.right},(e==null?void 0:e.difficulty)===1?"\u7B80\u5355":(e==null?void 0:e.difficulty)===2?"\u9002\u4E2D":"\u56F0\u96BE")),f.createElement("div",{className:A.bottomitem},f.createElement("span",{className:A.left},"\u77E5\u8BC6\u70B9"),f.createElement(oe.Z,{title:((_e=e==null?void 0:e.tag_discipline_names)==null?void 0:_e.length)<=0||((m=e==null?void 0:e.tag_discipline_names)==null?void 0:m.length)==1&&["-"].includes(e==null?void 0:e.tag_discipline_names[0])?"\u6682\u672A\u8BBE\u7F6E~":(J=(s=e==null?void 0:e.tag_discipline_names)==null?void 0:s.join("\uFF1B"))==null?void 0:J.toString()},f.createElement("span",{className:A.right},((ne=e==null?void 0:e.tag_discipline_names)==null?void 0:ne.length)<=0?f.createElement("span",{style:{color:"#C1C1C1"}},"\u6682\u672A\u8BBE\u7F6E~"):((ee=e==null?void 0:e.tag_discipline_names)==null?void 0:ee.length)==1&&["-"].includes(e==null?void 0:e.tag_discipline_names[0])?f.createElement("span",{style:{color:"#C1C1C1"}},"\u6682\u672A\u8BBE\u7F6E~"):(G=(de=e==null?void 0:e.tag_discipline_names)==null?void 0:de.join("\uFF1B"))==null?void 0:G.toString())))))},ha=v(42609),ga=v(35173),Me=v(59301),Fa=Object.defineProperty,Ba=Object.defineProperties,ba=Object.getOwnPropertyDescriptors,Ln=Object.getOwnPropertySymbols,Ca=Object.prototype.hasOwnProperty,xa=Object.prototype.propertyIsEnumerable,Wn=(e,t,l)=>t in e?Fa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,Tl=(e,t)=>{for(var l in t||(t={}))Ca.call(t,l)&&Wn(e,l,t[l]);if(Ln)for(var l of Ln(t))xa.call(t,l)&&Wn(e,l,t[l]);return e},Mn=(e,t)=>Ba(e,ba(t)),Da=(e,t,l)=>new Promise((u,p)=>{var D=a=>{try{_(l.next(a))}catch(o){p(o)}},k=a=>{try{_(l.throw(a))}catch(o){p(o)}},_=a=>a.done?u(a.value):Promise.resolve(a.value).then(D,k);_((l=l.apply(e,t)).next())}),wa=({qitem:e,setisedit:t,TagDiscipline:l,exerciseitem:u,seveeditor:p,deleteitem:D,getTagData:k,init:_,showTip:a=!1})=>{const[o]=w.default.useForm();return(0,n.useEffect)(()=>{o.setFieldsValue(Mn(Tl({},e),{name:e.question_title,answer_texts:e.answer_texts,repeat_answer:!e.repeat_answer}))},[e]),Me.createElement("div",null,Me.createElement(w.default,{form:o,colon:!1,onFinish:h=>{p(Tl(Tl({},e),h))},onFinishFailed:h=>Da(void 0,null,function*(){var i,d;le.ZP.error(h.errorFields[0].errors[0]),o.scrollToField((d=(i=h==null?void 0:h.errorFields)==null?void 0:i[0])==null?void 0:d.name,{behavior:"smooth",block:"center"})})},Me.createElement("div",{style:{display:"flex",alignItems:"center"}},Me.createElement("div",{style:{flex:1}},Me.createElement("span",{style:{display:"inline-flex",border:"1px solid #9096A3",borderRadius:"50%",width:10,height:10,marginRight:5,background:"#9096A3"}}),Me.createElement("span",null,"\u7B80\u7B54\u9898")),!(e!=null&&e.isadd)&&Me.createElement("span",{style:{marginLeft:20,marginRight:20,color:"red",cursor:"pointer"},onClick:()=>{D()}},Me.createElement("i",{className:"iconfont icon-piliangshanchu3",style:{fontSize:14,marginRight:6}}),"\u5220\u9664"),Me.createElement(Oe.ZP,{onClick:()=>{e.isadd?(t(!1),_()):(o.setFieldsValue(Mn(Tl({},e),{name:e==null?void 0:e.question_title,answer_texts:e.answer_texts||[],repeat_answer:!(e!=null&&e.repeat_answer)})),t(!1))}},"\u53D6\u6D88"),Me.createElement(oe.Z,{overlayClassName:S.shake,open:a,placement:"bottom",color:"rgba(244,156,14,0.19)",title:Me.createElement("div",{style:{color:"#FF841A",fontSize:"14px"}},Me.createElement("i",{className:"iconfont icon-tishi11 mr5 font14"}),"\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u8BD5\u9898\u3002")},Me.createElement(Oe.ZP,{type:"primary",className:"ml20",onClick:()=>{o.submit()}},"\u4FDD\u5B58"))),Me.createElement("div",{style:{maxHeight:"calc(100vh - 148px)",overflowY:"auto",marginTop:"10px",paddingRight:"5px"}},Me.createElement(w.default.Item,{className:S.scoreinput,name:"question_score",label:"\u5206\u503C",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5206\u503C"}]},Me.createElement(ke.Z,{onBlur:h=>{h.target.value==="0"&&le.ZP.error("\u5206\u503C\u5FC5\u987B\u5927\u4E8E0\u4E14\u5C0F\u4E8E\u7B49\u4E8E100")},style:{width:150},precision:1,placeholder:"\u8BF7\u8F93\u5165\u5206\u503C",max:100,min:.1})),Me.createElement(ga.W,{form:o,showKeywords:!0,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u7B80\u7B54\u9898\u9898\u5E72\u5185\u5BB9"}),Me.createElement(fe,{getTagData:k,qitem:e,exerciseitem:u,TagDiscipline:l,form:o}))))},Te=v(59301),Aa=(e,t,l)=>new Promise((u,p)=>{var D=a=>{try{_(l.next(a))}catch(o){p(o)}},k=a=>{try{_(l.throw(a))}catch(o){p(o)}},_=a=>a.done?u(a.value):Promise.resolve(a.value).then(D,k);_((l=l.apply(e,t)).next())}),Na=({setScoreShow:e,ScoreShow:t,exerciseitem:l,getdata:u})=>{var p,D,k;const[_,a]=(0,n.useState)(!1);function o(){return Aa(this,null,function*(){var h,i,d;let x=(i=(h=l==null?void 0:l.exercise_question_types)==null?void 0:h.filter(E=>E.Singlequestion))==null?void 0:i.map(E=>({question_type:E.question_type,score:E.Singlequestion})),O=yield(0,je.ZP)(`/api/examination_banks/${(d=l==null?void 0:l.exercise)==null?void 0:d.id}/batch_set_score.json`,{method:"POST",body:{question_arr:x}});(O==null?void 0:O.status)===0&&u()})}return Te.createElement("div",null,t&&Te.createElement(b.default,{title:"\u6279\u91CF\u8BBE\u7F6E\u5206\u503C",open:t,width:640,centered:!0,zIndex:10,className:S.scoremodal,onCancel:()=>{e(!1)},onOk:()=>{var h,i,d;if(l!=null&&l.use_blank_score&&((d=(i=(h=l==null?void 0:l.exercise_question_types)==null?void 0:h.filter(x=>x.name==="\u586B\u7A7A\u9898"))==null?void 0:i[0])!=null&&d.Singlequestion)){a(!0);return}o(),e(!1)}},Te.createElement("div",{className:"c-black"},"\u603B\u5206",Te.createElement("span",{className:"ml10 c-light-primary"},(l==null?void 0:l.exercise_question_types.length)>0&&((p=l==null?void 0:l.exercise_types)==null?void 0:p.q_scores))),Te.createElement("div",{className:S.content},Te.createElement("span",null,"\u9898\u578B\u540D\u79F0"),Te.createElement("span",null,"\u5C0F\u9898\u603B\u6570"),Te.createElement("span",null,"\u9898\u578B\u603B\u5206"),Te.createElement("span",null,"\u64CD\u4F5C")),(k=(D=l==null?void 0:l.exercise_question_types)==null?void 0:D.filter(h=>h.name!=="\u5B9E\u8BAD\u9898"&&h.name!=="\u7EC4\u5408\u9898"))==null?void 0:k.map((h,i)=>{var d;return Te.createElement("div",{key:i,className:S.items},Te.createElement("span",null,h==null?void 0:h.name),Te.createElement("span",null,(d=h==null?void 0:h.items)==null?void 0:d.length),Te.createElement("span",null,h==null?void 0:h.score),Te.createElement("span",null,"\u6BCF\u9898",Te.createElement(ke.Z,{min:.1,precision:1,max:100,onChange:x=>{h.Singlequestion=x},defaultValue:h.Singlequestion,style:{width:90,height:38,margin:"0px 10px",display:"flex",alignItems:"center"}}),"\u5206"))})),Te.createElement(b.default,{title:!1,footer:!1,centered:!0,open:_,zIndex:20,width:640,closable:!1,className:S.scoremodal},Te.createElement("div",{style:{marginTop:40}},"\u586B\u7A7A\u9898\u4E2D\u5B58\u5728",Te.createElement("span",{style:{color:"#FA6400"}},"\u6309\u7A7A\u7ED9\u5206"),"\u7684\u5C0F\u9898\uFF0C\u82E5\u6279\u91CF\u8BBE\u7F6E\u5206\u503C\u4F1A\u7EDF\u4E00\u5C06\u586B\u7A7A\u9898\u6539\u4E3A\u6309\u9898\u7ED9\u5206"),Te.createElement("div",{className:S.bottom},Te.createElement(Oe.ZP,{className:S.no,onClick:()=>{a(!1)}},"\u53D6\u6D88"),Te.createElement(Oe.ZP,{className:S.yes,onClick:()=>{o(),a(!1),e(!1)}},"\u786E\u8BA4"))))},Pa=v(79285),ka=v(88918),Oa=v(89392),Sa=v(86248),zn=v(14791),Za=v(32570),F=v(59301),Ia=Object.defineProperty,ja=Object.defineProperties,Ta=Object.getOwnPropertyDescriptors,Hn=Object.getOwnPropertySymbols,Qa=Object.prototype.hasOwnProperty,$a=Object.prototype.propertyIsEnumerable,Jn=(e,t,l)=>t in e?Ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,ot=(e,t)=>{for(var l in t||(t={}))Qa.call(t,l)&&Jn(e,l,t[l]);if(Hn)for(var l of Hn(t))$a.call(t,l)&&Jn(e,l,t[l]);return e},It=(e,t)=>ja(e,Ta(t)),Ze=(e,t,l)=>new Promise((u,p)=>{var D=a=>{try{_(l.next(a))}catch(o){p(o)}},k=a=>{try{_(l.throw(a))}catch(o){p(o)}},_=a=>a.done?u(a.value):Promise.resolve(a.value).then(D,k);_((l=l.apply(e,t)).next())});const il=[{name:"\u5355\u9009\u9898",id:0,count:"q_singles",score:"q_singles_scores",nameType:"SINGLE"},{name:"\u591A\u9009\u9898",id:1,count:"q_doubles",score:"q_doubles_scores",nameType:"MULTIPLE"},{name:"\u5224\u65AD\u9898",id:2,count:"q_judges",score:"q_judges_scores",nameType:"JUDGMENT"},{name:"\u586B\u7A7A\u9898",id:3,count:"q_nulls",score:"q_nulls_scores",nameType:"COMPLETION"},{name:"\u7B80\u7B54\u9898",id:4,count:"q_mains",score:"q_mains_scores",nameType:"SUBJECTIVE"},{name:"\u5B9E\u8BAD\u9898",id:5,count:"q_shixuns",score:"q_shixuns_scores",nameType:"PRACTICAL"},{name:"\u7F16\u7A0B\u9898",id:6,count:"q_pros",score:"q_pros_scores",nameType:"PROGRAM"},{name:"\u7EC4\u5408\u9898",id:7,count:"q_combinations",score:"q_combinations_scores",nameType:"COMBINATION"},{name:"\u7A0B\u5E8F\u586B\u7A7A\u9898",id:8,count:"q_combinations",score:"q_combinations_scores",nameType:"BPROGRAM"}],Ra=({user:e,dispatch:t,itemid:l,newExercisePaper:u,setisedits:p})=>{var D,k,_,a,o,h,i,d,x,O,E,I;const[c,V]=(0,n.useState)(),[_e,m]=(0,n.useState)(!1),[s,J]=(0,n.useState)(),[ne,ee]=(0,n.useState)(),de=(0,n.useRef)(),G=(0,n.useRef)(),[y,te]=(0,n.useState)(),[Ce,xe]=(0,n.useState)(!1),[pe,ue]=(0,n.useState)(!1),[Ee,Ie]=(0,n.useState)(),[M,re]=(0,n.useState)(!1),[he,De]=(0,n.useState)(!1),[Xe,tt]=(0,n.useState)(!1),[st,_t]=(0,n.useState)(!1),[jt,vl]=(0,n.useState)(!1),[$l,rn]=(0,n.useState)(!1),[Ei,fi]=(0,n.useState)(!1),[Ka,qn]=(0,n.useState)(!1),[El]=w.default.useForm(),[qa,Rl]=(0,n.useState)(!1),ei=(0,n.useRef)(null),[Re]=(0,ae.useSearchParams)(),[Vl,Ll]=(0,n.useState)(!1),eu=Re.get("isIntelligentAssistant"),[Tt,dn]=(0,n.useState)(!1);(0,n.useEffect)(()=>{qe(),t({type:"globalSetting/footerToggle",payload:!1})},[]),(0,n.useEffect)(()=>{p(pe)},[pe]),(0,n.useEffect)(()=>{s!=null&&s.question_id&&(ee(s==null?void 0:s.question_score),G.current=s==null?void 0:s.question_id)},[s]);const Vt=B=>Ze(void 0,null,function*(){let j=yield t({type:"newExercisePaper/getTagDiscipline",payload:{sub_discipline_id:B}});Ie(j)});function qe(){return Ze(this,null,function*(){var B,j,z,X,K,ve;xe(!0),m(!0);const $e=yield t({type:"newExercisePaper/editExercise",payload:{id:l}});xe(!1),m(!1),V($e),(B=$e==null?void 0:$e.exercise)!=null&&B.sub_discipline_id&&Vt((j=$e==null?void 0:$e.exercise)==null?void 0:j.sub_discipline_id),J(It(ot({},(K=(X=(z=$e==null?void 0:$e.exercise_question_types)==null?void 0:z[0])==null?void 0:X.items)==null?void 0:K[0]),{index:1})),te(It(ot({},(ve=$e==null?void 0:$e.exercise_question_types)==null?void 0:ve[0]),{indexs:1}))})}function qt(B,j=!0){return Ze(this,null,function*(){var z,X,K,ve;j&&(xe(!0),m(!0));const $e=yield t({type:"newExercisePaper/editExercise",payload:{id:l}});V($e);let yt=[];(z=$e==null?void 0:$e.exercise_question_types)==null||z.map(pt=>{var tl;(tl=pt==null?void 0:pt.items)==null||tl.map((Ml,zl)=>{yt.push(It(ot({},Ml),{index:zl+1}))})});let Wt=(X=yt.filter(pt=>pt.question_id===(B==null?void 0:B.id)))==null?void 0:X[0],Wl=(ve=((K=$e==null?void 0:$e.exercise_question_types)==null?void 0:K.map((pt,tl)=>{if((Wt==null?void 0:Wt.question_type)===(pt==null?void 0:pt.question_type))return It(ot({},pt),{indexs:tl+1})})).filter(pt=>pt))==null?void 0:ve[0];te(ot({},Wl)),J(ot({},Wt)),ee(Wt==null?void 0:Wt.question_score),xe(!1),m(!1)})}function el(B){return Ze(this,null,function*(){var j;let z=It(ot({},B),{difficulty:(B==null?void 0:B.difficulty)||2,item_type:B.question_type,sub_discipline_id:((j=B==null?void 0:B.sub_discipline_id)==null?void 0:j[1])||"",tag_discipline_ids:[],repeat_answer:!B.repeat_answer}),X={};B.question_type===8&&(X=It(ot({},B),{hack:It(ot({},B==null?void 0:B.hack),{difficult:B.difficulty}),hack_codes:It(ot({},B.hack_codes),{code:Il.Base64.encode(B.hack_codes.code)}),hack_sets:[ot({},B.hack_sets)],is_blank:!0})),B.tag_discipline_ids&&(z.tag_discipline_ids=Array.isArray(B.tag_discipline_ids)?B.tag_discipline_ids:[B.tag_discipline_ids],X.tag_discipline_ids=Array.isArray(B.tag_discipline_ids)?B.tag_discipline_ids:[B.tag_discipline_ids]),sessionStorage.projectFill&&(X.hack_identifier=sessionStorage.projectFill);let K=yield(0,je.ZP)(`/api/examination_banks/${l}/examination_banks_item_banks/create_item_bank.json`,{method:"post",body:B.question_type===8?X:z});(K==null?void 0:K.status)===0&&(ue(!1),qt(K)),(0,ze.Vf)("#question-scroll-id")})}function yi(B){return Ze(this,null,function*(){m(!0);let j=yield(0,je.ZP)(`/api/examination_banks/${l}/sort_question_type.json`,{method:"post",body:{question_type:B}});m(!1),(j==null?void 0:j.status)===0&&qe()})}const ti=(B,j,z)=>Ze(void 0,null,function*(){var X;if(B.length===0){le.ZP.warning("\u8BF7\u4E0A\u4F20\u6587\u4EF6"),z();return}const K=yield(0,Ye.Hb)(l,(X=B[0])==null?void 0:X.file,j);K.status===0&&(le.ZP.success(`\u6210\u529F\u5BFC\u5165${K==null?void 0:K.success}\u6761`),re(!1),qe()),z()}),li=(B,j)=>Ze(void 0,null,function*(){const z=yield(0,Ye.kF)({score:(0,Oa.round)(B,1),question_id:j==null?void 0:j.question_id});if((z==null?void 0:z.status)===0){le.ZP.success("\u4FEE\u6539\u6210\u529F"),qt({id:G.current},!1);return}(z==null?void 0:z.status)===-1&&ee(j==null?void 0:j.question_score)});function Lt(){return Ze(this,null,function*(){b.default.confirm({title:"\u63D0\u793A",content:"\u786E\u5B9A\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",okText:"\u786E\u5B9A",centered:!0,className:S.modalconfirm,onOk:()=>Ze(this,null,function*(){if(s.question_id){let B=yield(0,je.ZP)(`/api/examination_banks/${l}/examination_banks_item_banks/${s.question_id}.json`,{method:"delete"});(B==null?void 0:B.status)===0&&(qe(),ue(!1))}else J({}),ue(!1),qe()}),cancelText:"\u53D6\u6D88"})})}const ni=B=>Ze(void 0,null,function*(){return yield(0,je.ZP)(`/api/examination_banks/${l}/examination_banks_item_banks.json`,{method:"post",body:ot({},B)})}),{overflow:ui,handleMouseEnter:ai,handleMouseLeave:ii}=(0,ka.I)(),tu=B=>Ze(void 0,null,function*(){var j,z;m(!0);let X=yield(0,je.ZP)(`/api/examination_banks/${l}/sort_question_type.json`,{method:"post",body:{question_type:B}});if(m(!1),(X==null?void 0:X.status)===0){const K=yield t({type:"newExercisePaper/editExercise",payload:{id:l}});V(K),(j=K==null?void 0:K.exercise)!=null&&j.sub_discipline_id&&Vt((z=K==null?void 0:K.exercise)==null?void 0:z.sub_discipline_id)}}),Ft=()=>pe?(dn(!0),!0):!1;(0,n.useEffect)(()=>{if(Tt){const B=setTimeout(()=>{dn(!1)},2e3);return()=>clearTimeout(B)}},[Tt]);const oi=(B,j)=>F.createElement(ie.default,null,F.createElement(ie.default.Item,{key:"0",onClick:()=>lu(B==null?void 0:B.question_type)},F.createElement("span",{className:S.moreSpan},"\u65B0\u589E")),F.createElement(ie.default.Item,{key:"1",disabled:j===0,onClick:()=>Ze(void 0,null,function*(){if(j===0||Ft())return;let z=(0,ze.rz)(c==null?void 0:c.exercise_question_types,j,j-1);yield tu(z.map(X=>X.name))})},F.createElement("span",{className:S.moreSpan},"\u4E0A\u79FB")),F.createElement(ie.default.Item,{key:"2",disabled:j===(c==null?void 0:c.exercise_question_types.length)-1,onClick:()=>Ze(void 0,null,function*(){if(j===(c==null?void 0:c.exercise_question_types.length)-1||Ft())return;let z=(0,ze.rz)(c==null?void 0:c.exercise_question_types,j,j+1);yield tu(z.map(X=>X.name))})},F.createElement("span",{className:S.moreSpan},"\u4E0B\u79FB")),F.createElement(ie.default.Item,{key:"3",onClick:()=>{var z;El.setFieldsValue({name:B.name,item_type_en:(z=il.find(X=>X.id==B.question_type))==null?void 0:z.nameType}),Rl(!0)}},F.createElement("span",{className:S.moreSpan},"\u91CD\u547D\u540D"))),lu=B=>{var j,z,X,K,ve,$e,yt,Wt,cn,Wl,pt,tl,Ml,zl,nu,uu,au,iu,ou,su,ru,du,cu,mu,_u,pu,vu,Eu;if(!Ft()){if(B===5){_t(!0),vl(!0);return}if(B===6){if(Re.get("pageType")=="course")Re.get("updateType")=="course"?ae.history.push(`/problems/newcreate?express_id=${(j=c==null?void 0:c.exercise)==null?void 0:j.id}&callback_url=/paperlibrary/add/${(z=c==null?void 0:c.exercise)==null?void 0:z.id}?type=2&pageType=course&updateType=course&courseId=${Re.get("courseId")}&stageId=${Re.get("stageId")}`):ae.history.push(`/problems/newcreate?express_id=${(X=c==null?void 0:c.exercise)==null?void 0:X.id}&callback_url=/paperlibrary/add/${(K=c==null?void 0:c.exercise)==null?void 0:K.id}?type=2&pageType=course&courseId=${Re.get("courseId")}&stageId=${Re.get("stageId")}`);else{let ri=($e=(ve=u==null?void 0:u.editData)==null?void 0:ve.exercise)!=null&&$e.set_question_sub_discipline?`/problems/newcreate?express_id=${(yt=c==null?void 0:c.exercise)==null?void 0:yt.id}&callback_url=${window.location.pathname+window.location.search}&discipline_id=${(cn=(Wt=u==null?void 0:u.editData)==null?void 0:Wt.exercise)==null?void 0:cn.discipline_id}&sub_discipline_id=${(pt=(Wl=u==null?void 0:u.editData)==null?void 0:Wl.exercise)==null?void 0:pt.sub_discipline_id}`:`/problems/newcreate?express_id=${(tl=c==null?void 0:c.exercise)==null?void 0:tl.id}&callback_url=${window.location.pathname+window.location.search}`;ae.history.push(ri)}return}ue(!0),J(B===2?{question_type:B,isadd:!0,repeat_answer:!0,choices:[{choice_text:"\u6B63\u786E",is_answer:0},{choice_text:"\u9519\u8BEF",is_answer:0}],question_choices:[{choice_text:"\u6B63\u786E",is_answer:0},{choice_text:"\u9519\u8BEF",is_answer:0}],difficulty:2,standard_answers:[],question_score:"",tag_discipline_ids:[],question_title:"",discipline_id:(zl=(Ml=u==null?void 0:u.editData)==null?void 0:Ml.exercise)!=null&&zl.set_question_sub_discipline?(uu=(nu=u==null?void 0:u.editData)==null?void 0:nu.exercise)==null?void 0:uu.discipline_id:0,sub_discipline_id:(iu=(au=u==null?void 0:u.editData)==null?void 0:au.exercise)!=null&&iu.set_question_sub_discipline?(su=(ou=u==null?void 0:u.editData)==null?void 0:ou.exercise)==null?void 0:su.sub_discipline_id:0,analysis:""}:{question_type:B,question_choices:Array.from({length:4},()=>({choice_text:"",is_answer:0})),standard_answers:[],repeat_answer:!0,difficulty:2,isadd:!0,tag_discipline_ids:[],question_score:"",analysis:"",sub_item_banks:[],question_title:"",is_ordered:!0,use_keywords:!1,use_blank_score:!0,keywords:[],allow_student_debug:!1,submit_rule:1,downcase:!0,no_space:!0,discipline_id:(du=(ru=u==null?void 0:u.editData)==null?void 0:ru.exercise)!=null&&du.set_question_sub_discipline?(mu=(cu=u==null?void 0:u.editData)==null?void 0:cu.exercise)==null?void 0:mu.discipline_id:0,sub_discipline_id:(pu=(_u=u==null?void 0:u.editData)==null?void 0:_u.exercise)!=null&&pu.set_question_sub_discipline?(Eu=(vu=u==null?void 0:u.editData)==null?void 0:vu.exercise)==null?void 0:Eu.sub_discipline_id:0})}},si=[{key:1,label:"\u6279\u91CF\u5BFC\u5165",onClick:()=>{Ft()||re(!0)}},{key:2,label:F.createElement("div",null,F.createElement("img",{width:26,style:{position:"absolute",top:-2},src:zn.$}),F.createElement("span",null,"\u667A\u80FD\u5BFC\u5165")),onClick:()=>{Ft()||De(!0)}}];return F.createElement("div",null,F.createElement(Ve.Z,{spinning:Ce},F.createElement("div",{className:S.bg},F.createElement("div",{style:{textAlign:"center"}},((D=c==null?void 0:c.exercise_types)==null?void 0:D.q_counts)===0&&!pe&&F.createElement(fl.Z,{styles:{marginTop:180},customText:F.createElement("span",null,"\u8FD8\u6CA1\u6709\u8BD5\u9898\uFF0C\u8BF7\u4ECE",F.createElement("span",{className:"c-light-primary"},"\u5E95\u90E8\u64CD\u4F5C\u680F"),"\u8FDB\u884C\u6DFB\u52A0~")}),(((k=c==null?void 0:c.exercise_types)==null?void 0:k.q_counts)>0||pe)&&F.createElement("div",{style:{marginTop:20,borderTop:"1px solid #DCDCDC",display:"block",alignItems:"stretch"}},F.createElement("div",{style:{backgroundColor:"#F6F7F9",display:"inline-block",position:"sticky",top:0}},F.createElement("div",{className:S.left},F.createElement("div",{className:S.leftAction},F.createElement(Oe.ZP,{onClick:()=>{Ft()||tt(!0)},className:S.Button},"\u6279\u91CF\u8BBE\u7F6E\u5206\u503C")),F.createElement("div",{className:S.scrollWrapper,style:{overflow:ui},onMouseEnter:ai,onMouseLeave:ii},(_=c==null?void 0:c.exercise_question_types)==null?void 0:_.map((B,j)=>F.createElement("div",{key:j,className:"mb30"},F.createElement("div",{className:S.title},F.createElement("div",{className:S.titleleft},F.createElement("span",{style:{color:"#000000",fontWeight:400,fontSize:12}}," ",(0,ze.EM)(j+1),"\u3001\u3010",B.name,"\u3011"),F.createElement("span",{style:{color:"#464F66",fontSize:12}},"\uFF08",B.count,"\u5C0F\u9898\uFF0C\u5171",B.score,"\u5206\uFF09")),F.createElement(Bt.Z,{dropdownRender:()=>oi(B,j),placement:"bottomLeft"},F.createElement("div",{className:S.more_style},F.createElement("i",{className:"iconfont icon-sandian font12"})))),F.createElement(Ul,{handleEditing:()=>{dn(!0)},isedit:pe,setBigqitem:te,bigitem:It(ot({},B),{indexs:j+1}),setqitem:z=>Ze(void 0,null,function*(){var X;(X=de.current)==null||X.blur(),J(z)}),qitem:s,Itemid:l,getdata:qt,data:B.items})))))),F.createElement("div",{id:"question-scroll-id",style:{overflow:pe?"hidden":"auto"},className:S.right,ref:ei},!(s!=null&&s.isadd)&&F.createElement("div",{className:S.title},!pe&&F.createElement("div",{style:{flex:1}},F.createElement("span",{style:{color:"#000000",fontWeight:600,fontSize:16}}," ",(y==null?void 0:y.indexs)&&(0,ze.EM)(y==null?void 0:y.indexs),"\u3001\u3010",y==null?void 0:y.name,"\u3011"),F.createElement(oe.Z,{title:"\u7F16\u8F91\u9898\u578B\u540D\u79F0"},F.createElement("i",{className:`${S.edit} iconfont icon-bianji_Hover mr5 ml5 font18`,onClick:()=>{var B;El.setFieldsValue({name:y.name,item_type_en:(B=il.find(j=>j.id==y.question_type))==null?void 0:B.nameType}),Rl(!0)}})),F.createElement("span",{style:{color:"#464F66",fontSize:16,fontWeight:400}},"\uFF08",y==null?void 0:y.count,"\u5C0F\u9898\uFF0C\u5171",y==null?void 0:y.score,"\u5206\uFF09"),(s==null?void 0:s.question_type)===6&&F.createElement("span",{onClick:()=>Ll(2),className:"current c-light-primary font14 bold-400"},"\u6279\u91CF\u8BBE\u7F6E\u7F16\u7A0B\u8BED\u8A00"),(s==null?void 0:s.question_type)===5&&F.createElement(At.default,{defaultChecked:(o=(a=u==null?void 0:u.editData)==null?void 0:a.exercise)==null?void 0:o.show_challenge_task_pass,onChange:B=>Ze(void 0,null,function*(){let j=yield(0,je.ZP)(`/api/examination_banks/${l}/update_show_columns.json`,{method:"post",body:{show_challenge_task_pass:B.target.checked}});(j==null?void 0:j.status)===0&&(le.ZP.info("\u8BBE\u7F6E\u6210\u529F"),qt({id:G.current}))}),style:{marginTop:20,marginBottom:20}},"\u5C55\u793A\u5173\u5361\u63CF\u8FF0"),(s==null?void 0:s.question_type)===6&&F.createElement("span",{style:{marginLeft:20},onClick:()=>{var B,j,z,X;b.default.confirm({title:"\u7F16\u7A0B\u9898\u8BBE\u7F6E",icon:null,centered:!0,closable:!0,footer:null,content:F.createElement("div",null,(s==null?void 0:s.question_type)===6&&F.createElement(At.default,{defaultChecked:(j=(B=u==null?void 0:u.editData)==null?void 0:B.exercise)==null?void 0:j.show_hack_sets,onChange:K=>Ze(void 0,null,function*(){let ve=yield(0,je.ZP)(`/api/examination_banks/${l}/update_show_columns.json`,{method:"post",body:{show_hack_sets:K.target.checked}});(ve==null?void 0:ve.status)===0&&(le.ZP.info("\u8BBE\u7F6E\u6210\u529F"),b.default.destroyAll(),qt({id:G.current}))}),style:{marginTop:20,marginBottom:20}},"\u5C55\u793A\u6D4B\u8BD5\u7528\u4F8B"),F.createElement("br",null),(s==null?void 0:s.question_type)===6&&F.createElement(At.default,{defaultChecked:(X=(z=u==null?void 0:u.editData)==null?void 0:z.exercise)==null?void 0:X.show_hack_description,onChange:K=>Ze(void 0,null,function*(){let ve=yield(0,je.ZP)(`/api/examination_banks/${l}/update_show_columns.json`,{method:"post",body:{show_hack_description:K.target.checked}});(ve==null?void 0:ve.status)===0&&(le.ZP.info("\u8BBE\u7F6E\u6210\u529F"),b.default.destroyAll(),qt({id:G.current}))}),style:{marginBottom:10}},"\u5C55\u793A\u8BD5\u9898\u63CF\u8FF0"))})},className:"current c-light-primary font14 bold-400"},"\u7F16\u7A0B\u9898\u663E\u793A\u8BBE\u7F6E")),F.createElement("div",{style:{display:"flex",alignItems:"center"}},(s==null?void 0:s.question_type)===5&&!pe&&F.createElement("a",{className:S.shixun,href:`/shixuns/${s==null?void 0:s.shixun_identifier}/challenges?exercise=true`,target:"_blank"},F.createElement("i",{onClick:()=>{},style:{marginRight:20},className:"iconfont icon-shixunkecheng mr5 "}),"\u5B9E\u8BAD\u8BE6\u60C5"),!pe&&[0,1,2,4,6].includes(s==null?void 0:s.question_type)&&F.createElement(w.default.Item,{label:"\u5206\u503C",style:{margin:"0 20px"},required:!0},F.createElement(ke.Z,{precision:1,ref:de,onChange:B=>ee(B),value:ne,onBlur:B=>{li(B.target.value,s)}})),!pe&&F.createElement(oe.Z,{title:"\u5220\u9664"},F.createElement("i",{onClick:()=>{Lt()},style:{marginRight:20},className:`${S.delete} iconfont icon-shanchu13 mr5 `})),!pe&&F.createElement(oe.Z,{title:"\u7F16\u8F91\u8BD5\u9898"},F.createElement("i",{onClick:()=>{var B,j,z;(s==null?void 0:s.question_type)===6?Re.get("pageType")=="course"?Re.get("updateType")=="course"?ae.history.push(`/problems/newedit/${s==null?void 0:s.hack_identifier}?type=exercises&express_id=${(B=c==null?void 0:c.exercise)==null?void 0:B.id}&question_id=${s==null?void 0:s.question_id}&score=${s==null?void 0:s.question_score}&exercise=true&callback_url=${location.pathname}?type=2&pageType=course&updateType=course&courseId=${Re.get("courseId")}&stageId=${Re.get("stageId")}`):ae.history.push(`/problems/newedit/${s==null?void 0:s.hack_identifier}?type=exercises&express_id=${(j=c==null?void 0:c.exercise)==null?void 0:j.id}&question_id=${s==null?void 0:s.question_id}&score=${s==null?void 0:s.question_score}&exercise=true&callback_url=${location.pathname}?type=2&pageType=course&courseId=${Re.get("courseId")}&stageId=${Re.get("stageId")}`):ae.history.push(`/problems/newedit/${s==null?void 0:s.hack_identifier}?type=exercises&express_id=${(z=c==null?void 0:c.exercise)==null?void 0:z.id}&question_id=${s==null?void 0:s.question_id}&score=${s==null?void 0:s.question_score}&exercise=true&callback_url=${window.location.pathname+window.location.search}`):ue(!0)},className:`${S.edit} iconfont icon-bianji_Hover mr5 `})))),!pe&&F.createElement("div",null,F.createElement("div",{className:S.qcount},F.createElement("span",{className:S.score},s==null?void 0:s.question_score,"\u5206"),F.createElement(He.Z,{className:S.qtitle,value:(s==null?void 0:s.index)+`\u3001${(s==null?void 0:s.question_type)==8?(h=s==null?void 0:s.program_attr)==null?void 0:h.description:s==null?void 0:s.question_title}`}),(s==null?void 0:s.high_resources_consume)&&F.createElement(Za.Z,{type:"shixun",style:{marginLeft:10}})),(s==null?void 0:s.question_type)===6&&F.createElement(yl.Z,{onEdit:()=>Ll(1),className:"mt10",dataSource:(s==null?void 0:s.languages)||[]}),F.createElement(ya,{newExercisePaper:u,TagDiscipline:Ee,qitem:s})),pe&&F.createElement("div",null,(s==null?void 0:s.question_type)<=1&&F.createElement(at,{getTagData:Vt,deleteitem:Lt,seveeditor:el,exerciseitem:c,TagDiscipline:Ee,setisedit:ue,qitem:s,init:qe,showTip:Tt}),(s==null?void 0:s.question_type)===5&&F.createElement(pa,{setqitem:J,deleteitem:Lt,seveeditor:el,exerciseitem:c,TagDiscipline:Ee,setisedit:ue,qitem:s,showTip:Tt}),(s==null?void 0:s.question_type)===3&&F.createElement(Kl,{getTagData:Vt,deleteitem:Lt,seveeditor:el,exerciseitem:c,TagDiscipline:Ee,setisedit:ue,qitem:s,init:qe,showTip:Tt}),(s==null?void 0:s.question_type)===2&&F.createElement(nn,{getTagData:Vt,deleteitem:Lt,seveeditor:el,exerciseitem:c,TagDiscipline:Ee,setisedit:ue,qitem:s,init:qe,showTip:Tt}),(s==null?void 0:s.question_type)===4&&F.createElement(wa,{getTagData:Vt,deleteitem:Lt,seveeditor:el,exerciseitem:c,TagDiscipline:Ee,setisedit:ue,qitem:s,init:qe,showTip:Tt}),(s==null?void 0:s.question_type)===7&&F.createElement(ea,{getTagData:Vt,deleteitem:Lt,seveeditor:el,exerciseitem:c,TagDiscipline:Ee,setisedit:ue,qitem:s,init:qe,showTip:Tt}),(s==null?void 0:s.question_type)===8&&F.createElement(sa,{getTagData:Vt,deleteitem:Lt,seveeditor:el,exerciseitem:c,TagDiscipline:Ee,setisedit:ue,qitem:s,init:qe,showTip:Tt}))))))),F.createElement("div",{className:S.bottomdiv},F.createElement("div",{style:{width:1200,margin:"0px auto",display:"flex",justifyContent:"space-between",alignItems:"center"}},F.createElement("span",{className:S.spanBtn,onClick:()=>{Ft()||(_t(!0),vl(!1))}},"\u9898\u5E93\u9009\u9898"),F.createElement(Bt.Z,{menu:{items:si}},F.createElement("span",{className:S.spanBtn},"\u5BFC\u5165\u8BD5\u9898")),F.createElement("span",{className:S.spanBtn,onClick:()=>Ze(void 0,null,function*(){var B;if(Ft())return;const j=yield(0,Ye.JP)(l);j.status===0&&window.open(`/classrooms/coursesId/exercise/${j.exercise_id}/${(B=e.userInfo)==null?void 0:B.login}/initate_answer`)})},"\u6A21\u62DF\u8003\u8BD5"),F.createElement("span",{className:S.spanBtn,onClick:()=>{if(!Ft()){if(eu){window.open(`/paperlibrary/see/${l}?isIntelligentAssistant=true`);return}window.open(`/paperlibrary/see/${l}`)}}},"\u8BD5\u5377\u9884\u89C8"),il==null?void 0:il.map((B,j)=>F.createElement(Oe.ZP,{key:j,className:S.addQuestionBtn,type:"primary",onClick:()=>{lu(B.id)}},B.name)),F.createElement(Oe.ZP,{className:S.saveBtn,loading:Ka,onClick:()=>{var B,j;const z=()=>Ze(void 0,null,function*(){if(Re.get("pageType")=="course")if(Re.get("updateType")=="course")le.ZP.info("\u7F16\u8F91\u6210\u529F"),ae.history.replace(`/paths/${Re.get("courseId")}`);else{if(Ft())return;(0,Sa._C)({id:Re.get("stageId"),subject_id:Re.get("courseId"),homework_type:"exercise",examination_bank_ids:[l]}).then(ve=>{(ve==null?void 0:ve.status)==0&&(le.ZP.info("\u521B\u5EFA\u6210\u529F"),ae.history.replace(`/paths/${Re.get("courseId")}`))})}else{if(Ft())return;if(eu){qn(!0);const ve=yield(0,je.ZP)("/api/intelligent_imports/save_recognize_papers.json",{method:"post",body:{examination_bank_id:l}});if(qn(!1),(ve==null?void 0:ve.status)!==0)return}le.ZP.info("\u521B\u5EFA\u6210\u529F"),ae.history.push("/paperlibrary?defaultActiveKey=0")}});let X=(j=(B=c==null?void 0:c.exercise_question_types)==null?void 0:B.filter(ve=>ve.question_type===5)[0])==null?void 0:j.items,K=0;X==null||X.map(ve=>{ve.high_resources_consume&&(K=K+1)}),console.log(K),K>0?t({type:"classroomList/setActionTabs",payload:{key:"\u6388\u6743\u63D0\u793A",count:K,fn:()=>{z()}}}):z()}},F.createElement("i",{className:"iconfont icon-baocun1",style:{fontSize:15,marginRight:5}}),"\u4FDD\u5B58\u8BD5\u5377"))),F.createElement(Na,{setScoreShow:tt,ScoreShow:Xe,exerciseitem:c,getdata:qe}),st&&F.createElement(Pa.Z,{setScoreShow:_t,isshixuns:jt,ScoreShow:st,isloadings:$l,onOk:(B,j,z,X)=>Ze(void 0,null,function*(){rn(!0);let ve=yield ni({exam_id:l,item_bank_ids:B,shixun_ids:j});rn(!1),(ve==null?void 0:ve.status)===0&&b.default.confirm({title:"\u63D0\u793A",icon:null,centered:!0,content:"\u65B0\u52FE\u9009\u7684\u8BD5\u9898\u5DF2\u7ECF\u6DFB\u52A0\u5230\u8BD5\u5377\uFF0C\u5982\u679C\u9700\u8981\u7EE7\u7EED\u6DFB\u52A0\u65B0\u8BD5\u9898\u8BF7\u70B9\u51FB\u201C\u7EE7\u7EED\u9009\u9898\u201D\uFF0C\u5C06\u56DE\u5230\u60A8\u4E0A\u6B21\u64CD\u4F5C\u7684\u9009\u9898\u9875\u9762",okText:"\u7EE7\u7EED\u9009\u9898",cancelText:"\u8FD4\u56DE\u8BD5\u5377",onOk:()=>{qe()},onCancel:()=>{_t(!1),qe()}})})}),F.createElement(ha.Z,{sub_discipline_id:(i=c==null?void 0:c.exercise)!=null&&i.sub_discipline_id?[(d=c==null?void 0:c.exercise)==null?void 0:d.discipline_id,(x=c==null?void 0:c.exercise)==null?void 0:x.sub_discipline_id]:[],visible:M,onCancel:()=>re(!1),onOk:ti}),F.createElement(b.default,{centered:!0,title:"\u7F16\u8F91\u9898\u578B\u540D\u79F0",open:qa,width:500,onOk:()=>El.submit(),onCancel:()=>Rl(!1)},F.createElement(w.default,{form:El,initialValues:{},onFinish:B=>Ze(void 0,null,function*(){(yield(0,Ye.RK)(ot({id:l},B))).status==0&&(le.ZP.success("\u4FEE\u6539\u6210\u529F"),qe(),Rl(!1))})},F.createElement(w.default.Item,{style:{marginBottom:0},name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u9898\u578B\u540D\u79F0"},{whitespace:!0,message:"\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C"},{validator(B,j){var z,X,K,ve;const $e=(z=il==null?void 0:il.find(yt=>yt.nameType==El.getFieldValue("item_type_en")))==null?void 0:z.id;return(ve=(K=(X=c==null?void 0:c.exercise_question_types)==null?void 0:X.filter(yt=>yt.question_type!=$e))==null?void 0:K.map(yt=>yt==null?void 0:yt.name))!=null&&ve.includes(j)?Promise.reject(new Error("\u9898\u578B\u540D\u79F0\u5DF2\u5B58\u5728\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u9898\u578B\u540D\u79F0")):Promise.resolve()}}]},F.createElement(vt.default,{size:"large",maxLength:10,showCount:!0})),F.createElement(w.default.Item,{hidden:!0,name:"item_type_en"},F.createElement(vt.default,{size:"large"})))),F.createElement(bt.Z,{placement:"bottom",height:"100%",destroyOnClose:!0,closable:!1,className:"body-overflow-hidden",open:he},F.createElement("div",{style:{margin:"8px auto 24px auto",width:1200,fontWeight:600},className:"c-black font18"},"\u667A\u80FD\u5BFC\u5165"),F.createElement(zn.Z,{stickyTop:-24,subDisciplineId:(O=c==null?void 0:c.exercise)!=null&&O.sub_discipline_id?[(E=c==null?void 0:c.exercise)==null?void 0:E.discipline_id,(I=c==null?void 0:c.exercise)==null?void 0:I.sub_discipline_id]:[],onCancel:()=>De(!1),mode:2,gather:{exam_id:l},onSuccess:()=>{De(!1),qe()}}),F.createElement("div",{style:{height:70}})),F.createElement(yl.Q,{visible:!!Vl,setVisible:Ll,tip:Vl===2&&"\u8BBE\u7F6E\u5DF2\u6DFB\u52A0\u5728\u8BD5\u5377\u4E2D\u7684\u7F16\u7A0B\u9898\u6240\u5141\u8BB8\u4F7F\u7528\u7684\u7F16\u7A0B\u8BED\u8A00",dataSource:Vl===1?s==null?void 0:s.languages:[],onOk:B=>Ze(void 0,null,function*(){const j={languages:B};Vl===1?j.hack_id=s==null?void 0:s.hack_id:j.exam_id=l,(yield(0,je.ZP)("/api/problems/update_languages.json",{method:"post",body:j})).status===0&&(le.ZP.success("\u4FEE\u6539\u6210\u529F"),qt({id:G.current}),Ll(!1))})}))};var Va=(0,ae.connect)(({user:e,newExercisePaper:t,dispatch:l})=>({user:e,newExercisePaper:t,dispatch:l}))(Ra),Gn=v(85786),La=v(15730),Wa=v(86918),T=v(59301),Ma=Object.defineProperty,za=Object.defineProperties,Ha=Object.getOwnPropertyDescriptors,Un=Object.getOwnPropertySymbols,Ja=Object.prototype.hasOwnProperty,Ga=Object.prototype.propertyIsEnumerable,Xn=(e,t,l)=>t in e?Ma(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,Yn=(e,t)=>{for(var l in t||(t={}))Ja.call(t,l)&&Xn(e,l,t[l]);if(Un)for(var l of Un(t))Ga.call(t,l)&&Xn(e,l,t[l]);return e},Ua=(e,t)=>za(e,Ha(t)),Ql=(e,t,l)=>new Promise((u,p)=>{var D=a=>{try{_(l.next(a))}catch(o){p(o)}},k=a=>{try{_(l.throw(a))}catch(o){p(o)}},_=a=>a.done?u(a.value):Promise.resolve(a.value).then(D,k);_((l=l.apply(e,t)).next())});const Kn=()=>{const[e,t]=(0,n.useState)([]);return(0,n.useEffect)(()=>{Ql(void 0,null,function*(){const u=yield(0,Ye.d1)({source:"question"});u!=null&&u.disciplines&&t((0,H.L)(u==null?void 0:u.disciplines))})},[]),e},Xa=({user:e,newExercisePaper:t,dispatch:l})=>{var u,p,D,k,_,a,o,h,i,d,x,O;const E=(0,ae.useParams)(),I=Kn(),[c]=w.default.useForm(),[V,_e]=(0,n.useState)(),[m,s]=(0,n.useState)(!1),[J,ne]=(0,n.useState)(1),[ee,de]=(0,n.useState)(""),[G]=(0,ae.useSearchParams)(),[y,te]=(0,n.useState)(!1),[Ce,xe]=(0,n.useState)(!1),[pe,ue]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{G.get("type")==="2"&&(de(E.id),ne(2))},[G.get("type")]),(0,n.useEffect)(()=>{if(E.id){if(!I.length)return;Ql(void 0,null,function*(){var Ie,M,re;s(!0);const he=yield(0,Ye.Di)({id:E.id});s(!1);const De=(Ie=he==null?void 0:he.exercise)==null?void 0:Ie.sub_discipline_id;let Xe=[];for(const _t of I)for(const jt of _t.children)jt.value===De&&(Xe=[_t.value,jt.value]);const tt=(M=he==null?void 0:he.exercise)==null?void 0:M.time,st=Ua(Yn({},he.exercise),{sub_discipline_id:Xe,time:tt===-1?null:tt});_e(st),ue((re=he.exercise)==null?void 0:re.set_question_sub_discipline)})}else _e({time:60,difficulty:2});l({type:"globalSetting/footerToggle",payload:!1})},[I]),T.createElement("div",{style:{background:"#ffffff",marginTop:-8,padding:8,minHeight:"100vh",paddingBottom:64}},T.createElement("section",{className:"edu-container"},T.createElement("section",{className:"animated fadeIn"},T.createElement("aside",{style:{marginTop:15}},T.createElement(wt.Z,{separator:">"},T.createElement(wt.Z.Item,null,T.createElement(ae.Link,{to:"/paperlibrary"},"\u8BD5\u5377\u5E93")),T.createElement(wt.Z.Item,null,"\u4EBA\u5DE5\u7EC4\u5377")))),T.createElement("div",{className:"bg-white"},T.createElement("div",{style:{display:"flex",justifyContent:"center",paddingTop:20,alignItems:"center"}},T.createElement("div",{onClick:()=>{if(y){le.ZP.info("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u8BD5\u9898\u3002");return}ne(1)},className:J===1?ge.Z.selectdiv:ge.Z.divitem},T.createElement(Gn.Z,{number:1,active:J===1,className:"mr10"}),T.createElement("span",null,"\u8BD5\u5377\u57FA\u7840\u4FE1\u606F")),T.createElement("div",{style:{width:188,border:"1px dotted #9096A3",margin:"0px 30px",height:1}}),T.createElement("div",{onClick:()=>{if(!E.id&&!ee){le.ZP.info("\u8BF7\u5148\u4FDD\u5B58\u57FA\u7840\u4FE1\u606F\u518D\u65B0\u5EFA\u8BD5\u9898");return}ne(2),!ee&&de(E.id)},className:J!==1?ge.Z.selectdiv:ge.Z.divitem},T.createElement(Gn.Z,{number:2,active:J!==1,className:"mr10"}),T.createElement("span",null,"\u7F16\u8F91\u8BD5\u9898"))),J===2&&T.createElement("div",{className:"tc"},T.createElement(La.Z,{defaultValue:(p=(u=t==null?void 0:t.editData)==null?void 0:u.exercise)==null?void 0:p.exercise_name,onFinish:Ee=>Ql(void 0,null,function*(){var Ie,M,re,he,De,Xe,tt,st,_t,jt,vl,$l;return Ee.trim()===((M=(Ie=t==null?void 0:t.editData)==null?void 0:Ie.exercise)==null?void 0:M.exercise_name)?!0:(yield(0,Ye.w0)({id:`${(he=(re=t==null?void 0:t.editData)==null?void 0:re.exercise)==null?void 0:he.id}`,sub_discipline_id:(Xe=(De=t==null?void 0:t.editData)==null?void 0:De.exercise)==null?void 0:Xe.sub_discipline_id,time:`${(st=(tt=t==null?void 0:t.editData)==null?void 0:tt.exercise)==null?void 0:st.time}`,exercise_name:Ee,exercise_description:(jt=(_t=t==null?void 0:t.editData)==null?void 0:_t.exercise)==null?void 0:jt.exercise_description,difficulty:($l=(vl=t==null?void 0:t.editData)==null?void 0:vl.exercise)==null?void 0:$l.difficulty})).status===0?(c.setFieldValue("exercise_name",Ee),l({type:"newExercisePaper/modifyTitle",payload:Ee}),!0):!1})}),T.createElement("div",{style:{fontSize:14}},T.createElement("span",{style:{color:"#5F6368"}},"\u7B54\u9898\u65F6\u957F",T.createElement("span",{style:{color:"#000000",marginLeft:8}},(k=(D=t==null?void 0:t.editData)==null?void 0:D.exercise)==null?void 0:k.time)),T.createElement("span",{style:{margin:"0px 30px",color:"#5F6368"}},"\u96BE\u5EA6",T.createElement("span",{style:{color:"#000000",marginLeft:8}},((a=(_=t==null?void 0:t.editData)==null?void 0:_.exercise)==null?void 0:a.difficulty)===1?"\u7B80\u5355":((h=(o=t==null?void 0:t.editData)==null?void 0:o.exercise)==null?void 0:h.difficulty)===2?"\u9002\u4E2D":"\u56F0\u96BE")),T.createElement("span",{style:{marginRight:30,color:"#5F6368"}},"\u8BD5\u9898\u603B\u6570",T.createElement("span",{style:{color:"#000000",marginLeft:8}},((d=(i=t==null?void 0:t.editData)==null?void 0:i.exercise_types)==null?void 0:d.q_counts)||0)),T.createElement("span",{style:{color:"#5F6368"}},"\u603B\u5206",T.createElement("span",{style:{color:"#000000",marginLeft:8}},(O=(x=t==null?void 0:t.editData)==null?void 0:x.exercise_types)==null?void 0:O.q_scores))))),J===1&&T.createElement(Ve.Z,{spinning:m,size:"middle",style:{position:"fixed",maxHeight:"100vh"},className:"mt30"},T.createElement("section",{className:[ge.Z.bg,"mt20"].join(" "),style:{padding:"30px 120px 300px 120px"}},V&&T.createElement(w.default,{layout:"horizontal",form:c,colon:!1,labelCol:{span:4},wrapperCol:{span:20},className:ge.Z.formWrap,initialValues:V},T.createElement(w.default.Item,{name:"exercise_name",label:"\u8BD5\u5377\u540D\u79F0",className:ge.Z.baseLineHeight,rules:[{required:!0,validator:(Ee,Ie)=>{var M;return((M=Ie==null?void 0:Ie.replaceAll(" ",""))==null?void 0:M.length)>0?Promise.resolve():Promise.reject("\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0")}}]},T.createElement(vt.default,{maxLength:60,className:ge.Z.baseFormItem,placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0",showCount:!0})),T.createElement(w.default.Item,{label:"\u65B9\u5411&\u8BFE\u7A0B",name:"sub_discipline_id",className:ge.Z.baseLineHeight},T.createElement(Mt.Z,{className:ge.Z.baseFormItem,allowClear:!0,placeholder:"\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B",options:I,popupClassName:ge.Z.cascaderPopup,dropdownMenuColumnStyle:{padding:"8px 12px",fontSize:14}})),T.createElement("div",{className:ge.Z.concat},T.createElement("div",null,T.createElement(At.default,{checked:pe,onChange:Ee=>{ue(Ee.target.checked)},style:{color:"#000"}},"\u8BBE\u7F6E\u8BE5\u65B9\u5411&\u8BFE\u7A0B\u4E3A\u8BD5\u9898\u6A21\u7248\uFF08\u521B\u5EFA\u65B0\u8BD5\u9898\u81EA\u52A8\u4F7F\u7528\u8BE5\u65B9\u5411&\u8BFE\u7A0B\uFF09")),T.createElement("div",null,"\u6CA1\u6709\u5408\u9002\u7684\u65B9\u5411&\u8BFE\u7A0B\uFF1F",T.createElement("a",{onClick:()=>xe(!0)},"\u8054\u7CFB\u6559\u7814\u52A9\u7406"))),T.createElement(w.default.Item,{label:"\u96BE\u5EA6",name:"difficulty",className:ge.Z.radioBtnWrapper,rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},T.createElement(lt.ZP.Group,{className:ge.Z.radiogroup},T.createElement(lt.ZP.Button,{className:ge.Z.easy,value:1},"\u7B80\u5355"),T.createElement(lt.ZP.Button,{className:ge.Z.medium,value:2},"\u9002\u4E2D"),T.createElement(lt.ZP.Button,{className:ge.Z.hard,value:3},"\u56F0\u96BE"))),T.createElement(w.default.Item,{label:"\u7B54\u9898\u65F6\u957F",className:ge.Z.baseLineHeight},T.createElement("div",{style:{display:"flex",width:"100%"}},T.createElement(w.default.Item,{name:"time",noStyle:!0},T.createElement(ke.Z,{min:1,className:ge.Z.baseFormItem,max:9999,style:{width:220},maxLength:60,placeholder:"\u8BF7\u586B\u5199\u7B54\u9898\u65F6\u957F"})),T.createElement("span",{style:{marginLeft:"10px",width:"40px",lineHeight:"46px",fontSize:14}},"\u5206\u949F"))),T.createElement(w.default.Item,{label:"\u8BD5\u5377\u987B\u77E5",name:"exercise_description"},T.createElement(vt.default.TextArea,{rows:6,maxLength:65535,placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u987B\u77E5"})))),T.createElement("div",{className:ge.Z.bottmodiv},T.createElement(Oe.ZP,{className:`${ge.Z.cancelBtn} mr5`,type:"primary",onClick:()=>{G.get("pageType")=="course"?ae.history.push(`/paths/${G.get("courseId")}`):ae.history.push("/paperlibrary")}},"\u53D6\u6D88"),T.createElement(Ne.Z,{className:`${ge.Z.confirmBtn} ml15`,type:"primary",onClick:()=>Ql(void 0,null,function*(){var Ee,Ie,M,re;yield c.validateFields();const he=c.getFieldsValue();if(he.sub_discipline_id=((Ee=he.sub_discipline_id)==null?void 0:Ee.length)>0?he.sub_discipline_id[1]:"",he.set_question_sub_discipline=pe,E.id){(yield(0,Ye.w0)(Yn({id:E.id},he))).status===0&&(de(E.id),ne(2),ae.history.replace(`/paperlibrary/add/${E.id}?type=2`));return}const De=yield(0,Ye.un)(he);De.status===0&&(de((Ie=De==null?void 0:De.data)==null?void 0:Ie.exam_id),ne(2),G.get("pageType")=="course"?ae.history.replace(`/paperlibrary/add/${(M=De==null?void 0:De.data)==null?void 0:M.exam_id}?type=2&pageType=course&courseId=${G.get("courseId")}&stageId=${G.get("stageId")}`):ae.history.replace(`/paperlibrary/add/${(re=De==null?void 0:De.data)==null?void 0:re.exam_id}?type=2`))})},"\u4E0B\u4E00\u6B65"))),J===2&&T.createElement("div",null,T.createElement(Va,{setisedits:te,itemid:ee}))),T.createElement(Wa.Z,{open:Ce,onCancel:()=>{xe(!1)}}))};var Ya=(0,ae.connect)(({user:e,newExercisePaper:t,dispatch:l})=>({user:e,newExercisePaper:t,dispatch:l}))(Xa)},79285:function(mn,ll,v){v.d(ll,{Z:function(){return Se}});var n=v(59301),ae=v(78241),w=v(8591),wt=v(43418),le=v(99313),Ve=v(57809),vt=v(19842),Mt=v(98228),At=v(92832),lt=v(1710),ke=v(6848),Oe=v(58421),ge=v(3113),Ye=v(99064),H={flex_box_center:"flex_box_center___kuaVT",flex_space_between:"flex_space_between___exKHH",flex_box_vertical_center:"flex_box_vertical_center___BzvkN",flex_box_center_end:"flex_box_center_end___Ss2DJ",flex_box_column:"flex_box_column___p1LEr",scoremodal:"scoremodal___upTFR",selectWrapper:"selectWrapper___HH3RX",selectWrappers:"selectWrappers___fUWwr",allqingchu:"allqingchu___BFF1D",title:"title___hFasb",score:"score___DXG3o",close:"close___kEIiB",content:"content___Mco8L",items:"items___j98jk",bottom:"bottom___A1n1C",yes:"yes___P1zzb",no:"no___xZqXd",titlecount:"titlecount___fqA9P",add:"add___MqV0R",search:"search___NREgv",searchIcon:"searchIcon___qny3A",tabWrap:"tabWrap___dR18c",previewModal:"previewModal___uSiGS",q_title:"q_title___a9NY9"},Ne=v(26422),b={flex_box_center:"flex_box_center___nnwwA",flex_space_between:"flex_space_between___cRir9",flex_box_vertical_center:"flex_box_vertical_center___FqTZ8",flex_box_center_end:"flex_box_center_end___WU5_v",flex_box_column:"flex_box_column___QZFa1",warp:"warp___aLZwN",shixunbutton:"shixunbutton___Eoa1i",redio:"redio___LJ4js",redioitem:"redioitem___YicCC",redioitemyes:"redioitemyes___lX4Nr",title:"title___pi1jH",titleyes:"titleyes___jiEh7",yestag:"yestag___DLWoP",qcount:"qcount___U9kkL",score:"score___vLK4B",qtitle:"qtitle___kyg0t",checkbox:"checkbox___vjiBw",checkboxitem:"checkboxitem___HW3CP",checkboxitemyes:"checkboxitemyes___kpjek",bottom:"bottom___uG8Zq",bottomitem:"bottomitem___TnJQQ",left:"left___M8WXX",right:"right____dkCI",completion:"completion___H6RmA",content:"content___a2hGC",items:"items___D8mLd",simple:"simple___fQ0OS",shixun:"shixun___nB6Jk",combination:"combination___YrOdz",program:"program___lG0JA"},ie=v(85149),Bt=v(955),oe=v(24334);const bt=["A\uFF0E","B\uFF0E","C\uFF0E","D\uFF0E","E\uFF0E","F\uFF0E","G\uFF0E","H\uFF0E","I\uFF0E","J\uFF0E","K\uFF0E","L\uFF0E","M\uFF0E","N\uFF0E","O\uFF0E","P\uFF0E","Q\uFF0E","R\uFF0E","S\uFF0E","T\uFF0E","U\uFF0E","V\uFF0E","W\uFF0E","X\uFF0E","Y\uFF0E","Z\uFF0E"];var ze=({qitem:C})=>{var Fe,Be,Pt,Ct,q,Le,nt,fe,be,Ht;return n.createElement("div",{className:b.warp},n.createElement("div",{className:b.mainPart},n.createElement("div",{className:b.qcount},(C==null?void 0:C.question_type)===8&&n.createElement(ie.Z,{className:b.content,showProgramFill:!0,value:(Fe=C==null?void 0:C.program_attr)==null?void 0:Fe.description}),(C==null?void 0:C.question_type)!=8&&n.createElement(ie.Z,{className:b.qtitle,value:(C==null?void 0:C.name)||(C==null?void 0:C.title)})),((C==null?void 0:C.question_type)===0||(C==null?void 0:C.question_type)===2)&&n.createElement("div",null,(Be=C==null?void 0:C.choices)==null?void 0:Be.map((R,rt)=>n.createElement("div",{className:b.redio},!(R!=null&&R.is_answer)&&n.createElement("span",{className:b.redioitem}),(R==null?void 0:R.is_answer)&&n.createElement("i",{className:`${b.redioitemyes} icon-duigou1`}),n.createElement(ie.Z,{className:R!=null&&R.is_answer?b.titleyes:b.title,value:bt[rt]+(R==null?void 0:R.choice_text)}),(R==null?void 0:R.is_answer)&&n.createElement("div",{className:b.yestag},"\u6B63\u786E\u7B54\u6848")))),(C==null?void 0:C.question_type)===1&&n.createElement("div",null,(Pt=C==null?void 0:C.choices)==null?void 0:Pt.map((R,rt)=>n.createElement("div",{className:b.checkbox},!(R!=null&&R.is_answer)&&n.createElement("span",{className:b.checkboxitem}),(R==null?void 0:R.is_answer)&&n.createElement("i",{className:`${b.checkboxitemyes} icon-duigou1`}),n.createElement(ie.Z,{className:R!=null&&R.is_answer?b.titleyes:b.title,value:bt[rt]+(R==null?void 0:R.choice_text)}),(R==null?void 0:R.is_answer)&&n.createElement("div",{className:b.yestag},"\u6B63\u786E\u7B54\u6848")))),(C==null?void 0:C.question_type)===3&&n.createElement("div",{className:b.completion},(Ct=C==null?void 0:C.standard_answer)==null?void 0:Ct.map((R,rt)=>{var N;return n.createElement("div",{style:{display:"flex"}},n.createElement("span",{className:b.title},"\u586B\u7A7A\u9879",rt+1),n.createElement("div",{className:b.content},(N=R==null?void 0:R.answer_text)==null?void 0:N.map((ut,Jt)=>n.createElement("div",{className:b.items},ut))))})),(C==null?void 0:C.question_type)===4&&n.createElement("div",{className:b.simple},n.createElement("div",{className:b.title},"\u53C2\u8003\u7B54\u6848"),n.createElement("div",{className:"mt10",style:{fontSize:"16px"}},(q=C==null?void 0:C.answer_texts)!=null&&q[0]?n.createElement(ie.Z,{className:b.content,value:(Le=C==null?void 0:C.answer_texts)==null?void 0:Le[0]}):n.createElement("div",{style:{color:"#C1C1C1"}},"\u6682\u672A\u8BBE\u7F6E~"))),(C==null?void 0:C.question_type)===5&&((nt=C==null?void 0:C.challenge_names)==null?void 0:nt.map((R,rt)=>n.createElement("div",{className:b.shixun},n.createElement("span",{className:b.qtitle},n.createElement("span",{style:{marginRight:10}},"\u7B2C",(0,Bt.EM)(rt+1),"\u9898"),R)))),(C==null?void 0:C.question_type)===6&&n.createElement("div",{className:b.program},n.createElement(ie.Z,{className:b.content,value:((fe=C==null?void 0:C.program_attr)==null?void 0:fe.description)||"- -"})),(C==null?void 0:C.question_type)===7&&((be=C==null?void 0:C.sub_item_banks)==null?void 0:be.map((R,rt)=>{var N,ut,Jt,Gt,Ke;return n.createElement("div",null,n.createElement("div",{className:b.combination},n.createElement("span",{className:b.qtitle},R==null?void 0:R.name)),n.createElement("div",{className:b.warp,style:{padding:"0px",paddingTop:20}},n.createElement("div",null,((R==null?void 0:R.item_type)=="SINGLE"||(R==null?void 0:R.item_type)=="JUDGMENT")&&((N=R==null?void 0:R.choices)==null?void 0:N.map((Y,Pe)=>n.createElement("div",{className:b.redio},!(Y!=null&&Y.is_answer)&&n.createElement("span",{className:b.redioitem}),(Y==null?void 0:Y.is_answer)&&n.createElement("i",{className:`${b.redioitemyes} icon-duigou1`}),n.createElement(ie.Z,{className:Y!=null&&Y.is_answer?b.titleyes:b.title,value:bt[Pe]+(Y==null?void 0:Y.choice_text)}),(Y==null?void 0:Y.is_answer)&&n.createElement("div",{className:b.yestag},"\u6B63\u786E\u7B54\u6848")))),(R==null?void 0:R.item_type)=="MULTIPLE"&&((ut=R==null?void 0:R.choices)==null?void 0:ut.map((Y,Pe)=>n.createElement("div",{className:b.checkbox},!(Y!=null&&Y.is_answer)&&n.createElement("span",{className:b.checkboxitem}),(Y==null?void 0:Y.is_answer)&&n.createElement("i",{className:`${b.checkboxitemyes} icon-duigou1`}),n.createElement(ie.Z,{className:Y!=null&&Y.is_answer?b.titleyes:b.title,value:bt[Pe]+(Y==null?void 0:Y.choice_text)}),(Y==null?void 0:Y.is_answer)&&n.createElement("div",{className:b.yestag},"\u6B63\u786E\u7B54\u6848")))),(R==null?void 0:R.item_type)=="COMPLETION"&&n.createElement("div",{className:b.completion},(Jt=R==null?void 0:R.standard_answer)==null?void 0:Jt.map((Y,Pe)=>{var kt;return n.createElement("div",{style:{display:"flex"}},n.createElement("span",{className:b.title},"\u586B\u7A7A\u9879",Pe+1),n.createElement("div",{className:b.content},(kt=Y==null?void 0:Y.answer_text)==null?void 0:kt.map((at,Ut)=>n.createElement("div",{className:b.items},at))))})),(R==null?void 0:R.item_type)=="SUBJECTIVE"&&n.createElement("div",{className:b.simple},n.createElement("div",{className:b.title},"\u53C2\u8003\u7B54\u6848"),n.createElement("div",{className:"mt10",style:{fontSize:"16px"}},(Gt=R==null?void 0:R.answer_texts)!=null&&Gt[0]?n.createElement(ie.Z,{className:b.content,value:(Ke=R==null?void 0:R.answer_texts)==null?void 0:Ke[0]}):n.createElement("div",{style:{color:"#C1C1C1"}},"\u6682\u672A\u8BBE\u7F6E~"))))))})),(C==null?void 0:C.question_type)===8&&n.createElement("div",null,n.createElement(ie.Z,{disabledFill:!0,className:b.content,showProgramFill:!0,value:oe.Base64.decode(((Ht=C==null?void 0:C.program_attr)==null?void 0:Ht.code)||"")})),(C==null?void 0:C.question_type)===5&&n.createElement("div",{style:{background:"#F6F7F9",padding:"0px 20px",height:46,lineHeight:"46px",marginTop:40,display:"flex",alignItems:"center"}},n.createElement("div",{style:{flex:1,alignItems:"center",display:"flex"}},n.createElement("div",{style:{marginRight:30}},n.createElement("span",{style:{marginRight:10}},"\u521B\u5EFA\u8005"),n.createElement("span",{style:{color:"#000000"}},(C==null?void 0:C.author_name)||"- -")),n.createElement("div",{style:{marginRight:30}},n.createElement("span",{style:{marginRight:10}},"\u6240\u5C5E\u5355\u4F4D"),n.createElement("span",{style:{color:"#000000"}},(C==null?void 0:C.author_school_name)||"- -")),n.createElement("div",{style:{marginRight:30}},n.createElement("span",{style:{marginRight:10}},"\u5B66\u4E60\u4EBA\u6570"),n.createElement("span",{style:{color:"#000000"}},(C==null?void 0:C.study_count)||"0"))),n.createElement("a",{className:b.shixunbutton,href:`/shixuns/${C==null?void 0:C.identifier}/challenges?exercise=true`,target:"_blank"},n.createElement("i",{onClick:()=>{},style:{marginRight:20},className:"iconfont icon-shixunkecheng mr5 "}),"\u5B9E\u8BAD\u8BE6\u60C5"))),((C==null?void 0:C.question_type)<=4||[6,8].includes(C==null?void 0:C.question_type))&&n.createElement("div",{className:b.bottom},n.createElement("div",{className:b.bottomitem},n.createElement("span",{className:b.left},"\u89E3\u6790"),n.createElement("span",{className:b.right},C!=null&&C.analysis?n.createElement(ie.Z,{value:C==null?void 0:C.analysis}):n.createElement("span",{style:{color:"#C1C1C1"}},"\u6682\u672A\u8BBE\u7F6E~"))),n.createElement("div",{className:b.bottomitem},n.createElement("span",{className:b.left},"\u96BE\u5EA6"),n.createElement("span",{className:b.right},(C==null?void 0:C.difficulty)===1?"\u7B80\u5355":(C==null?void 0:C.difficulty)===2?"\u9002\u4E2D":"\u56F0\u96BE")),n.createElement("div",{className:b.bottomitem},n.createElement("span",{className:b.left},"\u77E5\u8BC6\u70B9"),n.createElement("span",{className:b.right},C!=null&&C.tag_discipline?C==null?void 0:C.tag_discipline:n.createElement("span",{style:{color:"#C1C1C1"}},"\u6682\u672A\u8BBE\u7F6E~")))))},je=v(86087),fl=v(84287),yl=v(89070),ol=v(61485),He=v(32570),Je=v(16149),P=v(59301),Hl=Object.defineProperty,Jl=Object.defineProperties,hl=Object.getOwnPropertyDescriptors,gl=Object.getOwnPropertySymbols,Gl=Object.prototype.hasOwnProperty,Fl=Object.prototype.propertyIsEnumerable,zt=(C,Fe,Be)=>Fe in C?Hl(C,Fe,{enumerable:!0,configurable:!0,writable:!0,value:Be}):C[Fe]=Be,ce=(C,Fe)=>{for(var Be in Fe||(Fe={}))Gl.call(Fe,Be)&&zt(C,Be,Fe[Be]);if(gl)for(var Be of gl(Fe))Fl.call(Fe,Be)&&zt(C,Be,Fe[Be]);return C},Et=(C,Fe)=>Jl(C,hl(Fe)),Nt=(C,Fe,Be)=>new Promise((Pt,Ct)=>{var q=fe=>{try{nt(Be.next(fe))}catch(be){Ct(be)}},Le=fe=>{try{nt(Be.throw(fe))}catch(be){Ct(be)}},nt=fe=>fe.done?Pt(fe.value):Promise.resolve(fe.value).then(q,Le);nt((Be=Be.apply(C,Fe)).next())});const Ul=({setScoreShow:C,ScoreShow:Fe,onOk:Be,isshixuns:Pt,isloadings:Ct,dispatch:q,isIntelligentAssistant:Le=!1,ispptModal:nt=!1,newExercisePaper:fe,shixunsDetail:be})=>{var Ht,R,rt;let[N,ut]=(0,n.useState)({type:"0",page:1,updated_at:"",quotes:"",item_type:null,per_page:10,courseid:"",tag_discipline_id:null,difficulty:null,keyword:null,bigmodel:Le,is_smart_plan:nt,group_id:[]}),[Jt,Gt]=(0,n.useState)([]),[Ke,Y]=(0,n.useState)([]),[Pe,kt]=(0,n.useState)([]),[at,Ut]=(0,n.useState)([]);const[nl,se]=(0,n.useState)(!1),[dt]=ae.default.useForm(),[Xl,Yl]=(0,n.useState)(),[Bl,sl]=(0,n.useState)(!1);let[ye,ht]=(0,n.useState)(Pt);const[et,Ot]=(0,n.useState)([]),[ul,bl]=(0,n.useState)(0),[Kl,ql]=(0,n.useState)(!0),[Qe,Cl]=(0,n.useState)([]),[xl,en]=(0,n.useState)([]),xt=[{name:"\u5168\u90E8",value:"",question_type:0},{name:"\u5355\u9009\u9898",value:"SINGLE",question_type:0},{name:"\u591A\u9009\u9898",value:"MULTIPLE",question_type:1},{name:"\u5224\u65AD\u9898",value:"JUDGMENT",question_type:2},{name:"\u586B\u7A7A\u9898",value:"COMPLETION",question_type:3},{name:"\u7B80\u7B54\u9898",value:"SUBJECTIVE",question_type:4},{name:"\u5B9E\u8BAD\u9898",value:"SHIXUN",question_type:5},{name:"\u7F16\u7A0B\u9898",value:"PROGRAM",question_type:6},{name:"\u7EC4\u5408\u9898",value:"COMBINATION",question_type:7},{name:"\u7A0B\u5E8F\u586B\u7A7A\u9898",value:"BPROGRAM",question_type:8}];let[ct,tn]=(0,n.useState)({gg:{type:"1",page:1,updated_at:"",quotes:"",item_type:null,courseid:"",per_page:10,tag_discipline_id:null,difficulty:null,keyword:null},ttgx:{type:"3",page:1,updated_at:"",quotes:"",item_type:null,per_page:10,courseid:"",tag_discipline_id:null,difficulty:null,keyword:null,group_id:[]},scj:{type:"2",page:1,updated_at:"",quotes:"",item_type:null,per_page:10,courseid:"",tag_discipline_id:null,difficulty:null,keyword:null},wcjd:{type:"0",page:1,updated_at:"",quotes:"",item_type:null,per_page:10,courseid:"",tag_discipline_id:null,difficulty:null,keyword:null,group_id:[]},yx:{type:"5",page:1,updated_at:"",quotes:"",item_type:null,per_page:10,courseid:"",tag_discipline_id:null,difficulty:null,keyword:null,group_id:null}});const Qt=(0,n.useRef)(new Set),mt=(0,n.useRef)(new Set),Dt=[{name:"\u7B80\u5355",value:1},{name:"\u9002\u4E2D",value:2},{name:"\u56F0\u96BE",value:3}],ln=[{name:"\u521D\u7EA7",value:1},{name:"\u4E2D\u7EA7",value:2},{name:"\u4E2D\u9AD8\u7EA7",value:3},{name:"\u9AD8\u7EA7",value:4}],_n=[{name:"\u672A\u53D1\u5E03",value:"unpublish"},{name:"\u9759\u9ED8\u53D1\u5E03",value:"silent_publish"},{name:"\u516C\u5F00\u53D1\u5E03",value:"public_publish"}],[nn,al]=(0,n.useState)(!1),$=()=>{dt.resetFields(),ye=!1,ht(!1),al(!1),dt.submit()};(0,n.useEffect)(()=>{var r,g,U,Q,Z,me,We,we,$t,Yt;(((U=(g=(r=fe==null?void 0:fe.editData)==null?void 0:r.exercise)==null?void 0:g.exist_item_bank_ids)==null?void 0:U.length)>0||((me=(Z=(Q=fe==null?void 0:fe.editData)==null?void 0:Q.exercise)==null?void 0:Z.exist_item_bank_shixun_ids)==null?void 0:me.length)>0)&&en([...(we=(We=fe==null?void 0:fe.editData)==null?void 0:We.exercise)==null?void 0:we.exist_item_bank_ids,...(Yt=($t=fe==null?void 0:fe.editData)==null?void 0:$t.exercise)==null?void 0:Yt.exist_item_bank_shixun_ids])},[(R=(Ht=fe==null?void 0:fe.editData)==null?void 0:Ht.exercise)==null?void 0:R.exist_item_bank_ids]),(0,n.useEffect)(()=>{Fe&&(dt.setFieldsValue({item_type:"",courseid:"",tag_discipline_id:null,difficulty:null,keyword:null}),Kl&&ye&&(dt.setFieldsValue({item_type:"SHIXUN"}),N.item_type="SHIXUN",ut(ce({},N)),ql(!1)),gt(N),Xt(),rl({group_id:0,page:1,per_page:20,sort_by:"updated_at",sort_direction:"desc",type:"0"}))},[Fe]),(0,n.useEffect)(()=>{ul>0&&setTimeout(()=>{bl(0)},2e3)},[ul]);function gt(r){return Nt(this,null,function*(){var g,U,Q;if(se(!0),ut(ce({},r)),(Pe==null?void 0:Pe.length)<=0&&r.type==="5"){Ut([]),se(!1);return}console.log("----",Pe,et);let Z=r.type==="5"?Pe==null?void 0:Pe.filter(we=>!et.includes(we)):null,me=r.type==="5"?Pe==null?void 0:Pe.filter(we=>et.includes(we)):null,We=yield(0,Ye.ZP)("/api/item_banks.json",{method:"get",params:Et(ce({},r),{discipline_id:((g=r==null?void 0:r.courseid)==null?void 0:g[0])||null,sub_discipline_id:((U=r==null?void 0:r.courseid)==null?void 0:U[1])||null,ids:Z,shixun_ids:me,include_shixuns:!Le,group_id:((Q=r.group_id)==null?void 0:Q.map(we=>we==null?void 0:we.value))||null,keyword:r.keyword?encodeURIComponent(r.keyword):r.keyword,type:r.type==="5"?null:r.type,clazz:r.type==="3"?"ItemBanksGroup":null,bigmodel:Le,is_smart_plan:nt})});Ut(We),se(!1)})}function Xt(){return Nt(this,null,function*(){let r=yield(0,Ye.ZP)("/api/disciplines.json",{method:"get",params:{source:"question",group_id:0,group_type:N.type==="5"?null:N.type,clazz:"ItemBanksGroup"}});Gt((0,Ne.L)(r==null?void 0:r.disciplines))})}function rl(r){return Nt(this,null,function*(){var g;let U=yield(0,Ye.ZP)("/api/item_banks_groups/for_problemset.json",{method:"post",body:r}),Q=[{title:"\u6839\u76EE\u5F55",id:0,pid:0,value:0,key:0,isLeaf:!1,children:(g=U==null?void 0:U.data)==null?void 0:g.map(Z=>({title:Z.name,id:Z.id,pid:Z.id,value:Z.id,key:Z.id,isLeaf:!Z.have_child}))}];Cl(Q)})}function Dl(r){return Nt(this,null,function*(){var g,U,Q,Z;se(!0);let me=(g=r.list)==null?void 0:g.filter($t=>!et.includes($t)),We=(U=r.list)==null?void 0:U.filter($t=>et.includes($t));if(me.length===0&&We.length===0){se(!1),Ut([]);return}let we=yield(0,Ye.ZP)("/api/item_banks.json",{method:"get",params:Et(ce({},r),{discipline_id:((Q=r==null?void 0:r.courseid)==null?void 0:Q[0])||null,sub_discipline_id:((Z=r==null?void 0:r.courseid)==null?void 0:Z[1])||null,ids:me,shixun_ids:We,type:r.type==="5"?null:r.type,clazz:r.type==="3"?"ItemBanksGroup":null})});se(!1),Ut(we)})}const un=r=>Nt(void 0,null,function*(){const g=yield q({type:"shixunsDetail/release",payload:{id:r}});let U=g==null?void 0:g.tag_position,Q=(g==null?void 0:g.evaluation_set_position)||[],Z=g.status;return Z===0?(w.ZP.success("\u53D1\u5E03\u6210\u529F"),gt(N),!0):(Z===2?w.ZP.error(`\u7B2C${Q.join(",")}\u5173\u5C1A\u672A\u5B8C\u6210\uFF0C\u65E0\u6CD5\u7533\u8BF7\u53D1\u5E03`):Z===3?w.ZP.error(`\u6BCF\u4E00\u4E2A\u5173\u5361\u81F3\u5C11\u9700\u8981\u4E00\u4E2A\u6280\u80FD\u6807\u7B7E, \u7B2C${U.join(",")}\u5173\u5C1A\u672A\u8BBE\u7F6E\u6280\u80FD\u6807\u7B7E\uFF0C\u8BF7\u8865\u5145`):w.ZP.error("\u5C1A\u672A\u521B\u5EFA\u4EFB\u52A1\u7684\u5B9E\u8BAD\uFF0C\u4E0D\u80FD\u7533\u8BF7\u53D1\u5E03"),!1)}),it=r=>(r==null?void 0:r.shixun_tag_num)===1?"\u672A\u53D1\u5E03\u7684\u5B9E\u8DF5\u9879\u76EE\u4E0D\u80FD\u88AB\u9009\u7528\uFF0C\u8BF7\u5148\u8FDB\u884C\u53D1\u5E03":"",dl=(r,g,U)=>r.map(Q=>Q.key===g?ce(ce({},Q),U):Q.children?Et(ce({},Q),{children:dl(Q.children,g,U)}):Q),wl=r=>Nt(void 0,null,function*(){const{key:g}=r;let U=N.type;const Q=yield(0,Je.ex)({page:1,per_page:20,sort_by:"updated_at",sort_direction:"desc",group_id:Math.abs(g),type:U}),{data:Z,total_count:me}=Q||{};me>0&&Cl(We=>dl(We,g,{children:Z.map(we=>({title:we.name,id:we.id,pid:we.id,value:we.id,key:we.id,isLeaf:!we.have_child}))}))});function Al(r){console.log("----",N),r==="1"&&(ct.gg=ce({},N)),r==="2"&&(ct.scj=ce({},N)),r==="3"&&(ct.ttgx=ce({},N)),r==="0"&&(ct.wcjd=ce({},N)),r==="5"&&(ct.yx=ce({},N)),tn(ce({},ct))}function an(){N.type==="1"&&(N=ct.gg),N.type==="2"&&(N=ct.scj),N.type==="3"&&(N=ct.ttgx),N.type==="0"&&(N=ct.wcjd),N.type==="5"&&(N=ct.yx),(N==null?void 0:N.item_type)==="SHIXUN"?(ye=!0,ht(!0)):(ye=!1,ht(!1)),dt.setFieldsValue(ce({},N)),ut(ce({},N)),gt(ce({},N))}return P.createElement("div",null,P.createElement(wt.default,{title:!1,footer:!1,open:Fe,width:1200,centered:!0,className:H.scoremodal,onCancel:()=>{C(!1)}},P.createElement("div",{style:{display:"flex",alignItems:"center"}},P.createElement("div",{className:H.title},Le?"\u4EE5\u9898\u6362\u9898":"\u9898\u5E93\u9009\u9898")),Le&&P.createElement("div",{style:{padding:10,background:"#F6F7F9",borderRadius:4,marginTop:14}},"\u6839\u636E\u73B0\u6709\u8BD5\u9898\u7684\u9898\u578B\u3001\u65B9\u5411\u3001\u77E5\u8BC6\u70B9\u3001\u96BE\u6613\u5EA6\uFF0C\u5FEB\u901F\u751F\u6210\u65B0\u7684\u8BD5\u9898\uFF0C\u589E\u52A0\u8BD5\u9898\u7684\u4E30\u5BCC\u5EA6"),P.createElement(le.default,{className:H.tabWrap,activeKey:N.type,onChange:r=>{r==="3"?(N.show_all_share=!0,rl({group_id:0,page:1,per_page:20,sort_by:"updated_at",sort_direction:"desc",type:"3"})):N.show_all_share=null,r==="0"&&rl({group_id:0,page:1,per_page:20,sort_by:"updated_at",sort_direction:"desc",type:"0"}),Al(N.type),N.type=r,(N==null?void 0:N.item_type)==="SHIXUN"&&N.type!=="5"&&(ye=!0,ht(!0)),al(!1),N.type==="5"&&(ye=!1,ht(!1)),an(),Xt()},items:[{label:"\u516C\u5171",key:"1"},{label:"\u56E2\u961F\u5171\u4EAB",key:"3"},{label:"\u6536\u85CF\u5939",key:"2"},{label:"\u6211\u521B\u5EFA\u7684",key:"0"},{label:P.createElement("div",null,"\u5DF2\u9009",Pe.length>0&&P.createElement("span",{className:H.titlecount},Pe.length),ul>0&&P.createElement("span",{className:H.add},"+",ul)),key:"5"}]}),P.createElement(ae.default,{layout:"inline",form:dt,onValuesChange:(r,g)=>{const U=Object.values(g).some(Z=>Z!==null&&Z!==""&&Z!==void 0),Q=g.keyword==="";if(al(U||!Q),N.page=1,(g==null?void 0:g.item_type)==="SHIXUN"){if(N.type==="5"?ht(!1):ht(!0),r.keyword||r.keyword==="")return;dt.submit()}else{if(r!=null&&r.courseid&&dt.setFieldsValue({tag_discipline_id:""}),ht(!1),r.keyword||r.keyword==="")return;dt.submit()}},onFinish:r=>{var g;N.type==="3"&&(!r.group_id||((g=r==null?void 0:r.group_id)==null?void 0:g.length)===0)?N.show_all_share=!0:N.show_all_share=null,ut(ce(ce({},N),r)),gt(ce(ce({},N),r))}},P.createElement(ae.default.Item,{name:"item_type"},P.createElement(Ve.default,{className:H.selectWrapper,placeholder:"\u9898\u578B",style:{width:110},size:"middle"},(Le?xt.slice(0,6):nt?xt.slice(0,4):xt).map(r=>P.createElement(Ve.default.Option,{key:r.value},r.name)))),P.createElement(ae.default.Item,{name:"courseid"},P.createElement(vt.Z,{className:H.selectWrapper,style:{width:160},size:"middle",placeholder:"\u65B9\u5411&\u8BFE\u7A0B",options:Jt})),!ye&&P.createElement(ae.default.Item,{name:"tag_discipline_id"},P.createElement(Ve.default,{className:H.selectWrapper,placeholder:"\u77E5\u8BC6\u70B9",style:{width:160},size:"middle",allowClear:!0},(rt=at==null?void 0:at.tag_disciplines)==null?void 0:rt.map(r=>P.createElement(Ve.default.Option,{key:r.id},r.name)))),P.createElement(ae.default.Item,{name:ye?"diff":"difficulty"},P.createElement(Ve.default,{className:H.selectWrapper,placeholder:"\u96BE\u5EA6",style:{width:118},size:"middle",allowClear:!0},!ye&&Dt.map(r=>P.createElement(Ve.default.Option,{key:r.value},r.name)),ye&&ln.map(r=>P.createElement(Ve.default.Option,{key:r.value},r.name)))),ye&&P.createElement(ae.default.Item,{name:"shixun_publish_status"},P.createElement(Ve.default,{className:H.selectWrapper,placeholder:"\u5168\u90E8\u72B6\u6001",style:{width:118},size:"middle",allowClear:!0},_n.map(r=>P.createElement(Ve.default.Option,{key:r.value},r.name)))),(N.type==="3"||N.type==="0")&&!ye&&P.createElement(ae.default.Item,{name:"group_id"},P.createElement(Mt.default,{treeDataSimpleMode:!0,style:{width:118},className:H.selectWrappers,multiple:!0,allowClear:!0,showSearch:!0,filterTreeNode:(r,g)=>g.title.toUpperCase().indexOf(r.toUpperCase())!==-1,dropdownStyle:{maxHeight:400,width:500,overflow:"auto"},placeholder:"\u8BF7\u9009\u62E9\u6587\u4EF6\u5939",treeCheckStrictly:!0,loadData:wl,treeDefaultExpandedKeys:[0],maxTagCount:0,treeCheckable:!0,treeData:Qe})),nn&&P.createElement("span",{className:H.allqingchu,onClick:$},P.createElement("i",{className:"iconfont icon-guanbi4"}),P.createElement("span",null,"\u6E05\u9664\u7B5B\u9009\u6761\u4EF6")),P.createElement(ae.default.Item,{style:{flex:"0 0 auto",marginRight:0,marginLeft:"auto"},name:"keyword"},P.createElement(At.default.Search,{className:H.search,placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",allowClear:!0,suffix:P.createElement("i",{className:`iconfont icon-sousuo9 font14 ${H.searchIcon}`,onClick:()=>dt.submit()}),onSearch:r=>{dt.submit()}}))),P.createElement("div",{style:{background:"#F6F7F9",display:"flex",alignItems:"center",marginTop:18,height:40,paddingLeft:10,paddingRight:20}},P.createElement("div",{onClick:()=>{N.updated_at==="asc"?N.updated_at="desc":N.updated_at="asc",ut(Et(ce({},N),{page:1})),gt(Et(ce({},N),{page:1}))}}," ",N.updated_at?P.createElement("img",{src:N.updated_at==="asc"?je.Z:fl.Z,style:{width:"15px",verticalAlign:"text-bottom"},className:"font14 mr5 c-light-primary"}):P.createElement("i",{style:{fontSize:"14px"},className:"iconfont icon-jiangxu mr5 c-light-primary"}),"\u6309\u66F4\u65B0\u65F6\u95F4\u6392\u5E8F"),P.createElement("div",{onClick:()=>{N.quotes==="asc"?N.quotes="desc":N.quotes="asc",ut(Et(ce({},N),{page:1})),gt(Et(ce({},N),{page:1}))},style:{marginLeft:20}}," ",N.quotes?P.createElement("img",{src:N.quotes==="asc"?je.Z:fl.Z,style:{width:"15px",verticalAlign:"text-bottom"},className:"font14 mr5 c-light-primary"}):P.createElement("i",{style:{fontSize:"14px"},className:"iconfont icon-jiangxu mr5 c-light-primary"}),"\u6309\u4F7F\u7528\u6B21\u6570\u6392\u5E8F")),P.createElement(lt.default,{style:{marginTop:2,marginBottom:20},scroll:{y:260},dataSource:(at==null?void 0:at.items)||(at==null?void 0:at.shixun_list),pagination:!1,loading:nl,rowKey:r=>r.id,rowSelection:{type:Le||nt?"radio":"checkbox",selectedRowKeys:Ke,getCheckboxProps:r=>({disabled:r.shixun_tag_num===1||(xl==null?void 0:xl.find(g=>r.id===g))}),onSelect(r,g,U){if(Le||nt){Y([r.id]),mt.current=new Set([r.id]),bl(1),kt([r.id]);return}if(g)ye&&Ot([...et,r.id]),Y([...Ke,r.id]),r.identifier?Qt.current.add(r.id):mt.current.add(r.id),bl(1),kt([...Pe,r.id]);else{r.identifier?Qt.current.delete(r.id):mt.current.delete(r.id);let Q=Pe.filter(Z=>Z!==r.id);if(Y(Q),kt(Q),ye){let Z=et.filter(me=>me!==r.id);Ot([...Z])}if(N.type==="5"){Dl(Et(ce({},N),{list:[...Q]}));return}}},onSelectAll(r,g,U){if(r){const Q=U.map(Z=>Z.id);ye&&Ot([...et,...Q]),Y([...Ke,...Q]),kt([...Pe,...Q]);for(const Z of U)Z.identifier?Qt.current.add(Z.id):mt.current.add(Z.id)}else{const Q=U.map(me=>me.id),Z=Ke.filter(me=>!Q.some(We=>We===me));if(Y([...Z]),kt([...Z]),ye){let me=et.filter(We=>!Q.some(we=>we===We.id));Ot([...me])}N.type==="5"&&Dl(Et(ce({},N),{list:[...Z]}));for(const me of Q)me.identifier?Qt.current.delete(me):mt.current.delete(me)}}},columns:[{title:"\u9898\u578B",dataIndex:"item_type",key:"item_type",render:(r,g,U)=>{var Q,Z;return P.createElement(ke.Z,{title:it(g)},P.createElement("div",null,ye||g!=null&&g.challenge_names?"\u5B9E\u8BAD\u9898":(Z=(Q=xt==null?void 0:xt.filter(me=>me.value===r))==null?void 0:Q[0])==null?void 0:Z.name))}},{title:"\u8BD5\u9898\u540D\u79F0",dataIndex:"name",width:ye?"30%":"60%",key:"name",render:(r,g,U)=>{var Q;return P.createElement("div",{style:{display:"flex",alignItems:"center"}},P.createElement(ke.Z,{title:it(g)},P.createElement("div",{className:g!=null&&g.high_resources_consume?H.q_title:""},P.createElement(ie.Z,{key:1,showLines:1,showTextOnly:!0,value:ye||g!=null&&g.challenge_names?g!=null&&g.title||r===null?"--":r:(g==null?void 0:g.item_type)=="BPROGRAM"?(Q=g==null?void 0:g.program_attr)==null?void 0:Q.description:r}))),(g==null?void 0:g.high_resources_consume)&&P.createElement(He.Z,{type:"shixun",style:{marginLeft:10}}))}},{title:"\u521B\u5EFA\u8005",dataIndex:"author_name",key:"author_name",hidden:!ye,render:(r,g,U)=>{var Q;return P.createElement(ke.Z,{title:it(g)},P.createElement("span",null,r?(Q=r==null?void 0:r.split("\u3001"))==null?void 0:Q[0]:"- -"))}},{title:"\u6240\u5C5E\u5355\u4F4D",dataIndex:"author_school_name",key:"author_school_name",hidden:!ye,render:(r,g,U)=>P.createElement(ke.Z,{title:it(g)},P.createElement("span",null,r||"- -"))},{title:"\u96BE\u5EA6",dataIndex:"difficulty",key:"difficulty",render:(r,g,U)=>{var Q,Z,me,We;return P.createElement(ke.Z,{title:it(g)},P.createElement("div",null,ye||g!=null&&g.challenge_names?(g==null?void 0:g.level)||((Z=(Q=Dt==null?void 0:Dt.filter(we=>we.value===r))==null?void 0:Q[0])==null?void 0:Z.name):(We=(me=Dt==null?void 0:Dt.filter(we=>we.value===r))==null?void 0:me[0])==null?void 0:We.name))}},{title:"\u5173\u5361\u6570\u91CF",dataIndex:"challenges_count",key:"challenges_count",hidden:!ye,render:(r,g,U)=>P.createElement(ke.Z,{title:it(g)},P.createElement("div",null,r||"- -"))},{title:"\u4F7F\u7528\u6B21\u6570",dataIndex:"quotes",key:"quotes",render:(r,g,U)=>P.createElement(ke.Z,{title:it(g)},P.createElement("div",null,ye||g!=null&&g.challenge_names?(g==null?void 0:g.study_count)||(g==null?void 0:g.stu_num):r))},{title:P.createElement("span",null,"\u53D1\u5E03\u72B6\u6001 ",P.createElement(ke.Z,{title:"\u672A\u53D1\u5E03\u7684\u5B9E\u8DF5\u9879\u76EE\u4E0D\u80FD\u88AB\u9009\u7528"},P.createElement(ol.Z,null))),dataIndex:"shixun_tag_num_name",key:"shixun_tag_num_name",hidden:!ye,render:(r,g,U)=>P.createElement(ke.Z,{title:it(g)},P.createElement("div",null,r||"- -"))},{title:"\u64CD\u4F5C",dataIndex:"id",key:"item_type",render:(r,g,U)=>P.createElement(ke.Z,{title:it(g)},P.createElement("div",{style:{flex:1,textAlign:"start"}},P.createElement("a",{onClick:()=>{var Q,Z;Yl(Et(ce({},g),{question_type:ye||g!=null&&g.challenge_names?5:(Z=(Q=xt==null?void 0:xt.filter(me=>me.value===(g==null?void 0:g.item_type)))==null?void 0:Q[0])==null?void 0:Z.question_type})),sl(!0)}},"\u67E5\u770B"),(g==null?void 0:g.shixun_tag_num)===1&&P.createElement("a",{style:{marginLeft:10},onClick:()=>{wt.default.confirm({title:"\u63D0\u793A",icon:null,centered:!0,width:400,content:P.createElement("div",null,"\u662F\u5426\u786E\u5B9A\u53D1\u5E03",P.createElement("span",{style:{cursor:"pointer",color:"#3061D0"},onClick:()=>{window.open(`/shixuns/${g==null?void 0:g.identifier}/challenges`)}},(g==null?void 0:g.shixun_name)||"--"),"\uFF1F"),onOk:()=>Nt(void 0,null,function*(){if(!un(g==null?void 0:g.identifier))return new Promise((Q,Z)=>{Z()})})})}},"\u53D1\u5E03")))}].filter(r=>!r.hidden)}),P.createElement(Oe.Z,{current:N.page,total:(at==null?void 0:at.items_count)||(at==null?void 0:at.shixuns_count),style:{marginBottom:20},defaultPageSize:N.per_page,showTotal:r=>P.createElement("span",null,"\u5171\xA0",P.createElement("span",{style:{color:"#165DFF"}},r),"\xA0\u6761\u6570\u636E"),pageSize:N.per_page,onChange:(r,g)=>{N.page=r,N.per_page=g,ut(ce({},N)),gt(ce({},N))}}),P.createElement("div",{className:H.bottom},P.createElement(ge.ZP,{className:H.no,onClick:()=>{C(!1)}},"\u53D6\u6D88"),P.createElement(ge.ZP,{loading:Ct,style:{width:Ct&&75},className:H.yes,onClick:()=>Nt(void 0,null,function*(){if((Pe==null?void 0:Pe.length)<=0){w.ZP.info(Le||nt?"\u8BF7\u9009\u62E9\u4E00\u9053\u8BD5\u9898":"\u5F53\u524D\u6682\u672A\u9009\u62E9\u6570\u636E");return}Be([...mt.current],[...Qt.current],!0,Pe==null?void 0:Pe.length)})},Le?"\u5F00\u59CB\u6362\u9898":"\u786E\u8BA4"))),P.createElement(wt.default,{open:Bl,title:"\u9898\u76EE\u8BE6\u60C5",footer:!1,className:H.previewModal,width:1e3,centered:!0,onCancel:()=>{sl(!1)},onOk:()=>{sl(!1)}},P.createElement(ze,{qitem:Xl})))};var Se=(0,yl.connect)(({shixunsDetail:C,newExercisePaper:Fe})=>({shixunsDetail:C,newExercisePaper:Fe}))(Ul)}}]);
|