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.
NewEduCoderBuild/p__Paperlibrary__Add__index...

2 lines
148 KiB

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[3260],{69668:function(Eu,hl,E){E.r(hl),E.d(hl,{default:function(){return Ya},useCourseOptions:function(){return Yn}});var n=E(67294),de=E(35973),A=E(91773),Mt=E(85673),ie=E(2453),mt=E(74330),bt=E(28802),gl=E(38089),Kt=E(84567),pt=E(98813),we=E(37720),Ne=E(85804),xe=E(62038),Ye=E(56443),Se=E(53430),Xl=E(60580),k=E(62844),Re=E(50136),al=E(85418),Ee=E(83062),qt=E(95012),I={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"},Ct=E(28706),Me=E(33170),Fl=E(26194),Bl=E(3830),il=E(66012),We=E(65226),ze=E(67294),N=Object.defineProperty,Yl=Object.defineProperties,Kl=Object.getOwnPropertyDescriptors,bl=Object.getOwnPropertySymbols,Cl=Object.prototype.hasOwnProperty,ql=Object.prototype.propertyIsEnumerable,xl=(e,t,l)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,Wt=(e,t)=>{for(var l in t||(t={}))Cl.call(t,l)&&xl(e,l,t[l]);if(bl)for(var l of bl(t))ql.call(t,l)&&xl(e,l,t[l]);return e},re=(e,t)=>Yl(e,Kl(t)),_t=(e,t,l)=>new Promise((u,_)=>{var x=a=>{try{p(l.next(a))}catch(o){_(o)}},w=a=>{try{p(l.throw(a))}catch(o){_(o)}},p=a=>a.done?u(a.value):Promise.resolve(a.value).then(x,w);p((l=l.apply(e,t)).next())}),en=({Itemid:e,setqitem:t,qitem:l,data:u,getdata:_,bigitem:x,setBigqitem:w,isedit:p,handleEditing:a})=>{const[o,g]=(0,n.useState)([]),[i,d]=(0,n.useState)(!1);(0,n.useEffect)(()=>{u.length>0&&g([...u])},[u]);const C=(S,v)=>_t(void 0,null,function*(){if(p){a();return}if(!S.destination)return;d(!0);let O=yield(0,Me.ZP)(`/api/examination_banks/${e}/examination_banks_item_banks/${v==null?void 0:v[S.source.index].question_id}/adjust_position.json`,{method:"post",body:{id:e,itemid:v==null?void 0:v[S.source.index].question_id,position:S.destination.index}});d(!1),O.status===0&&_({id:v==null?void 0:v[S.source.index].question_id})});return ze.createElement("div",null,ze.createElement(il.Z5,{onDragEnd:S=>C(S,o)},ze.createElement(il.bK,{droppableId:"droppable"},(S,v)=>ze.createElement("div",Wt({ref:S.innerRef},S.droppableProps),ze.createElement(mt.Z,{spinning:i},o.map((O,c)=>ze.createElement(il._l,{key:c,draggableId:c.toString(),index:c},(V,ce)=>{var m,r;return ze.createElement("aside",Wt(Wt({ref:V.innerRef},V.draggableProps),V.dragHandleProps),ze.createElement("div",{onClick:()=>{if(p){a();return}t(re(Wt({},O),{index:c+1})),w(x),(0,Ct.Vf)("#question-scroll-id")},className:`${I.qcount} ${O.question_id===(l==null?void 0:l.question_id)?I.qcountclick:""}`},ze.createElement("span",{className:I.score},O==null?void 0:O.question_score,"\u5206"),ze.createElement(Ee.Z,{title:ze.createElement(We.Z,{value:(O==null?void 0:O.question_type)===8?(m=O==null?void 0:O.program_attr)==null?void 0:m.description:O.question_title}),color:"#fff",placement:"left",overlayClassName:I.titleTooltip},ze.createElement("span",{className:I.qtitle},c+1,"\u3001",ze.createElement(We.Z,{value:(O==null?void 0:O.question_type)===8?(r=O==null?void 0:O.program_attr)==null?void 0:r.description:O.question_title,showTextOnly:!0}))),(O==null?void 0:O.question_imperfect)&&ze.createElement(Ee.Z,{title:"\u77E5\u8BC6\u70B9\u4FE1\u606F\u4E0D\u5B8C\u5584"},ze.createElement("div",{style:{transform:"scaleY(-1)",color:"#E99237"},className:"iconfont icon-tishi12"}))))}))),S.placeholder))))},Pe=E(71230),b=E(11776),fe=E(88044),ye=E(59637),Dt=E(17663),Ft=E(41188),q=E(67294),Ve=(e,t,l)=>new Promise((u,_)=>{var x=a=>{try{p(l.next(a))}catch(o){_(o)}},w=a=>{try{p(l.throw(a))}catch(o){_(o)}},p=a=>a.done?u(a.value):Promise.resolve(a.value).then(x,w);p((l=l.apply(e,t)).next())}),Oe=({form:e,TagDiscipline:t,exerciseitem:l,qitem:u,getTagData:_})=>{var x;const[w,p]=(0,n.useState)(!0),[a,o]=(0,n.useState)(!1),[g,i]=(0,n.useState)(""),[d,C]=(0,n.useState)([]),[S,v]=(0,n.useState)([]),[O,c]=(0,n.useState)(0);(0,n.useEffect)(()=>{ce()},[]);const V=m=>Ve(void 0,null,function*(){const r=yield(0,Me.ZP)("/api/tag_disciplines.json",{method:"get",params:{sub_discipline_id:m==null?void 0:m.sub_discipline_id}});v(r==null?void 0:r.tag_disciplines)}),ce=()=>Ve(void 0,null,function*(){const m=yield(0,Me.ZP)("/api/disciplines.json",{method:"get",params:{source:"subject"}});C(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:w?"100%":0}},q.createElement(A.default.Item,{className:I.formcenter,rules:[{required:!0,message:"\u8BF7\u5148\u9009\u62E9\u96BE\u5EA6"}],label:"\u96BE\u5EA6",name:"difficulty"},q.createElement(pt.ZP.Group,{className:I.radiogroup},q.createElement(pt.ZP.Button,{className:I.easy,value:1},"\u7B80\u5355"),q.createElement(pt.ZP.Button,{className:I.medium,value:2},"\u9002\u4E2D"),q.createElement(pt.ZP.Button,{className:I.hard,value:3},"\u56F0\u96BE"))),q.createElement(A.default.Item,{name:"sub_discipline_id",label:"\u77E5\u8BC6\u70B9",className:I.formcenterselect},q.createElement(gl.Z,{className:I.selectitems1,expandTrigger:"hover",placeholder:"\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B",options:d,fieldNames:{label:"name",value:"id",children:"sub_disciplines"},onChange:(m,r)=>{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:()=>{v([]),e.setFieldValue("tag_discipline_ids",[]),c(0)}})),q.createElement(A.default.Item,{className:I.formcenterselect},q.createElement("div",{style:{display:"flex",alignItems:"center",paddingLeft:55}},q.createElement(A.default.Item,{name:"tag_discipline_ids"},q.createElement(fe.default,{className:I.selectitems,disabled:O===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,r)=>r.key.indexOf(m.toLowerCase())>=0},S==null?void 0:S.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")))))),O>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(A.default.Item,{className:I.formcenterselect},q.createElement("div",{style:{display:"flex",alignItems:"center"}},q.createElement(A.default.Item,{name:"repeat_answer",valuePropName:"checked"},q.createElement(ye.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(Ee.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(Dt.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))))),q.createElement(Ft.Z,{open:a,subDisciplineId:(x=e.getFieldValue("sub_discipline_id"))==null?void 0:x[1],onCancel:()=>{o(!1)},onOkClick:m=>{v(r=>[...r,m]),e.setFieldValue("tag_discipline_ids",[...e.getFieldValue("tag_discipline_ids"),m==null?void 0:m.id])}}))},Y=E(67294),ol=Object.defineProperty,$=Object.defineProperties,at=Object.getOwnPropertyDescriptors,yt=Object.getOwnPropertySymbols,P=Object.prototype.hasOwnProperty,it=Object.prototype.propertyIsEnumerable,zt=(e,t,l)=>t in e?ol(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,ot=(e,t)=>{for(var l in t||(t={}))P.call(t,l)&&zt(e,l,t[l]);if(yt)for(var l of yt(t))it.call(t,l)&&zt(e,l,t[l]);return e},K=(e,t)=>$(e,at(t)),Ke=(e,t,l)=>new Promise((u,_)=>{var x=a=>{try{p(l.next(a))}catch(o){_(o)}},w=a=>{try{p(l.throw(a))}catch(o){_(o)}},p=a=>a.done?u(a.value):Promise.resolve(a.value).then(x,w);p((l=l.apply(e,t)).next())}),At=({qitem:e,setisedit:t,TagDiscipline:l,exerciseitem:u,seveeditor:_,deleteitem:x,getTagData:w,init:p,showTip:a=!1})=>{const[o]=A.default.useForm();(0,n.useEffect)(()=>{var i;o.setFieldsValue(K(ot({},e),{name:e==null?void 0:e.question_title,choices:(i=e==null?void 0:e.question_choices)==null?void 0:i.map(d=>K(ot({},d),{standard_boolean:d!=null&&d.standard_boolean?1:0})),repeat_answer:!(e!=null&&e.repeat_answer)}))},[e]);const g=i=>{if(!(i!=null&&i.length))return!1;const d=i.map(S=>{var v;return(v=S.choice_text)==null?void 0:v.trim().replace(/^\s+|\s+$/g,"")});return new Set(d).size!==d.length};return Y.createElement("div",null,Y.createElement(A.default,{form:o,colon:!1,onFinish:i=>{var d;if(g(i.choices)){ie.ZP.error("\u9009\u62E9\u9898\u9009\u9879\u5185\u5BB9\u4E0D\u80FD\u91CD\u590D\uFF0C\u8BF7\u4FEE\u6539\u540E\u518D\u4FDD\u5B58");return}let C=K(ot({},i),{item_type:e==null?void 0:e.question_type,choices:(d=i==null?void 0:i.choices)==null?void 0:d.map(S=>K(ot({},S),{is_answer:S.standard_boolean}))});_(ot(ot({},e),C))},onFinishFailed:i=>Ke(void 0,null,function*(){var d,C;ie.ZP.error(i.errorFields[0].errors[0]),o.scrollToField((C=(d=i==null?void 0:i.errorFields)==null?void 0:d[0])==null?void 0:C.name,{behavior:"smooth",block:"center"})})},Y.createElement("div",{style:{display:"flex",alignItems:"center"}},Y.createElement("div",{style:{flex:1}},Y.createElement("span",{style:{display:"inline-flex",border:"1px solid #9096A3",borderRadius:"50%",width:10,height:10,marginRight:5,background:"#9096A3"}}),Y.createElement("span",null,(e==null?void 0:e.question_type)===1?"\u591A\u9009\u9898":"\u5355\u9009\u9898")),!e.isadd&&Y.createElement("span",{style:{marginLeft:20,marginRight:20,color:"red",cursor:"pointer"},onClick:()=>{x()}},Y.createElement("i",{className:"iconfont icon-piliangshanchu3",style:{fontSize:14,marginRight:6}}),"\u5220\u9664"),Y.createElement(Ne.ZP,{onClick:()=>{var i;e.isadd?(t(!1),p()):(o.setFieldsValue(K(ot({},e),{name:e==null?void 0:e.question_title,choices:(i=e==null?void 0:e.question_choices)==null?void 0:i.map(d=>K(ot({},d),{standard_boolean:d!=null&&d.standard_boolean?1:0})),repeat_answer:!(e!=null&&e.repeat_answer)})),t(!1))}},"\u53D6\u6D88"),Y.createElement(Ee.Z,{overlayClassName:I.shake,open:a,placement:"bottom",color:"rgba(244,156,14,0.19)",title:Y.createElement("div",{style:{color:"#FF841A",fontSize:"14px"}},Y.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")},Y.createElement(Ne.ZP,{className:"ml20",type:"primary",onClick:()=>Ke(void 0,null,function*(){o.submit()})},"\u4FDD\u5B58"))),Y.createElement("div",{style:{maxHeight:"calc(100vh - 148px)",overflowY:"auto",marginTop:"10px",paddingRight:"5px"}},Y.createElement(Pe.Z,{align:"middle"},Y.createElement(A.default.Item,{className:I.scoreinput,name:"question_score",label:"\u5206\u503C",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5206\u503C"}]},Y.createElement(we.Z,{onBlur:i=>{i.target.value==="0"&&ie.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}))),Y.createElement(b.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"}),Y.createElement(Oe,{getTagData:w,qitem:e,exerciseitem:u,TagDiscipline:l,form:o}))))},st=E(81580),wt=E(39044),_e=E(67294),jt=Object.defineProperty,rt=Object.defineProperties,tn=Object.getOwnPropertyDescriptors,Dl=Object.getOwnPropertySymbols,ln=Object.prototype.hasOwnProperty,sl=Object.prototype.propertyIsEnumerable,De=(e,t,l)=>t in e?jt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,qe=(e,t)=>{for(var l in t||(t={}))ln.call(t,l)&&De(e,l,t[l]);if(Dl)for(var l of Dl(t))sl.call(t,l)&&De(e,l,t[l]);return e},et=(e,t)=>rt(e,tn(t)),el=(e,t,l)=>new Promise((u,_)=>{var x=a=>{try{p(l.next(a))}catch(o){_(o)}},w=a=>{try{p(l.throw(a))}catch(o){_(o)}},p=a=>a.done?u(a.value):Promise.resolve(a.value).then(x,w);p((l=l.apply(e,t)).next())}),dl=({qitem:e,TagDiscipline:t,exerciseitem:l,setisedit:u,seveeditor:_,deleteitem:x,getTagData:w,init:p,showTip:a=!1})=>{const[o]=A.default.useForm(),g=A.default.useWatch("use_blank_score",o);return(0,n.useEffect)(()=>{o.setFieldsValue(et(qe({},e),{standard_answers:e.standard_answers||[],name:e.question_title,repeat_answer:!e.repeat_answer}))},[e]),_e.createElement("div",null,_e.createElement(A.default,{form:o,colon:!1,onValuesChange:(i,d)=>{var C,S,v,O;if(i!=null&&i.standard_answers||i!=null&&i.use_blank_score){let c=((C=o.getFieldValue("standard_answers"))==null?void 0:C.length)>0&&((v=(S=o.getFieldValue("standard_answers"))==null?void 0:S.map(V=>V.score))==null?void 0:v.filter(V=>V));(c==null?void 0:c.length)>0&&o.setFieldsValue({question_score:(c==null?void 0:c.length)>0&&((O=c.reduce((V,ce)=>V+ce))==null?void 0:O.toFixed(1))})}},onFinish:i=>{var d;_(et(qe(qe({},e),i),{item_type:e==null?void 0:e.question_type,standard_answers:(d=i.standard_answers)==null?void 0:d.map((C,S)=>et(qe({},C),{position:C.choice_id||S+1}))}))},onFinishFailed:i=>el(void 0,null,function*(){var d,C;i.errorFields[0].errors[0]==="\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879"&&(0,Ct.pE)(),ie.ZP.error(i.errorFields[0].errors[0]),o.scrollToField((C=(d=i==null?void 0:i.errorFields)==null?void 0:d[0])==null?void 0:C.name,{behavior:"smooth",block:"center"})})},_e.createElement("div",{style:{display:"flex",alignItems:"center"}},_e.createElement("div",{style:{flex:1}},_e.createElement("span",{style:{display:"inline-flex",border:"1px solid #9096A3",borderRadius:"50%",width:10,height:10,marginRight:5,background:"#9096A3"}}),_e.createElement("span",null,"\u586B\u7A7A\u9898")),!e.isadd&&_e.createElement("span",{style:{marginLeft:20,marginRight:20,color:"red",cursor:"pointer"},onClick:()=>{x()}},_e.createElement("i",{className:"iconfont icon-piliangshanchu3",style:{fontSize:14,marginRight:6}})," \u5220\u9664"),_e.createElement(Ne.ZP,{onClick:()=>{e.isadd?(u(!1),p()):(o.setFieldsValue(et(qe({},e),{standard_answers:e.standard_answers,name:e.question_title,repeat_answer:!e.repeat_answer})),u(!1))}},"\u53D6\u6D88"),_e.createElement(Ee.Z,{overlayClassName:I.shake,open:a,placement:"bottom",color:"rgba(244,156,14,0.19)",title:_e.createElement("div",{style:{color:"#FF841A",fontSize:"14px"}},_e.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")},_e.createElement(Ne.ZP,{className:"ml20",type:"primary",onClick:()=>{o.submit()}},"\u4FDD\u5B58"))),_e.createElement("div",{style:{maxHeight:"calc(100vh - 148px)",overflowY:"auto",marginTop:"10px",paddingRight:"5px"}},_e.createElement(Pe.Z,{align:"middle"},g?_e.createElement(wt.Z,{text:"\uFF08\u5C0F\u9898\u5206\u503C\u7B49\u4E8E\u5404\u586B\u7A7A\u9879\u5206\u503C\u4E4B\u548C\uFF09"}):_e.createElement(A.default.Item,{key:2,className:I.scoreinput,name:"question_score",label:"\u5206\u503C",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5206\u503C"}]},_e.createElement(we.Z,{onBlur:i=>{i.target.value==="0"&&ie.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})),_e.createElement(A.default.Item,{name:"use_blank_score",noStyle:!0},_e.createElement(pt.ZP.Group,{className:I.scoreByBlankRadio,optionType:"button",options:[{label:"\u6309\u7A7A\u7ED9\u5206",value:!0},{label:"\u6309\u9898\u7ED9\u5206",value:!1}]})),_e.createElement(Ee.Z,{overlayInnerStyle:{width:460},title:_e.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",_e.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")},_e.createElement("i",{className:"icon-tishixiaowenhao font18 ml20 c-3061d0"}))),_e.createElement(st.u,{form:o,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u586B\u7A7A\u9898\u9898\u5E72\u5185\u5BB9",scoreByBlank:g,answerKey:"standard_answers"}),_e.createElement(Oe,{getTagData:w,qitem:e,exerciseitem:l,TagDiscipline:t,form:o}))))},nn=E(66495),je=E(67294),un=Object.defineProperty,Al=Object.defineProperties,wl=Object.getOwnPropertyDescriptors,Nl=Object.getOwnPropertySymbols,Nt=Object.prototype.hasOwnProperty,an=Object.prototype.propertyIsEnumerable,tt=(e,t,l)=>t in e?un(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,Tt=(e,t)=>{for(var l in t||(t={}))Nt.call(t,l)&&tt(e,l,t[l]);if(Nl)for(var l of Nl(t))an.call(t,l)&&tt(e,l,t[l]);return e},Bt=(e,t)=>Al(e,wl(t)),Qt=(e,t,l)=>new Promise((u,_)=>{var x=a=>{try{p(l.next(a))}catch(o){_(o)}},w=a=>{try{p(l.throw(a))}catch(o){_(o)}},p=a=>a.done?u(a.value):Promise.resolve(a.value).then(x,w);p((l=l.apply(e,t)).next())}),vn=({qitem:e,setisedit:t,TagDiscipline:l,exerciseitem:u,seveeditor:_,deleteitem:x,getTagData:w,init:p,showTip:a=!1})=>{const[o]=A.default.useForm();return(0,n.useEffect)(()=>{var g;o.setFieldsValue(Bt(Tt({},e),{name:e.question_title,repeat_answer:!e.repeat_answer,choices:(g=e==null?void 0:e.question_choices)==null?void 0:g.map(i=>Bt(Tt({},i),{is_answer:i!=null&&i.standard_boolean?1:0}))}))},[e]),je.createElement("div",null,je.createElement(A.default,{form:o,colon:!1,onFinish:g=>{_(Tt(Tt({},e),g))},onFinishFailed:g=>Qt(void 0,null,function*(){var i,d;ie.ZP.error(g.errorFields[0].errors[0]),o.scrollToField((d=(i=g==null?void 0:g.errorFields)==null?void 0:i[0])==null?void 0:d.name,{behavior:"smooth",block:"center"})})},je.createElement("div",{style:{display:"flex",alignItems:"center"}},je.createElement("div",{style:{flex:1}},je.createElement("span",{style:{display:"inline-flex",border:"1px solid #9096A3",borderRadius:"50%",width:10,height:10,marginRight:5,background:"#9096A3"}}),je.createElement("span",null,"\u5224\u65AD\u9898")),!(e!=null&&e.isadd)&&je.createElement("span",{style:{marginLeft:20,marginRight:20,color:"red",cursor:"pointer"},onClick:()=>{x()}},je.createElement("i",{className:"iconfont icon-piliangshanchu3",style:{fontSize:14,marginRight:6}}),"\u5220\u9664"),je.createElement(Ne.ZP,{onClick:()=>{var g;e.isadd?(t(!1),p()):(o.setFieldsValue(Bt(Tt({},e),{name:e==null?void 0:e.question_title,choices:(g=e==null?void 0:e.question_choices)==null?void 0:g.map(i=>Bt(Tt({},i),{is_answer:i!=null&&i.standard_boolean?1:0})),repeat_answer:!(e!=null&&e.repeat_answer)})),t(!1))}},"\u53D6\u6D88"),je.createElement(Ee.Z,{overlayClassName:I.shake,open:a,placement:"bottom",color:"rgba(244,156,14,0.19)",title:je.createElement("div",{style:{color:"#FF841A",fontSize:"14px"}},je.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")},je.createElement(Ne.ZP,{className:"ml20",type:"primary",onClick:()=>{o.submit()}},"\u4FDD\u5B58"))),je.createElement("div",{style:{maxHeight:"calc(100vh - 148px)",overflowY:"auto",marginTop:"10px",paddingRight:"5px"}},je.createElement(A.default.Item,{className:I.scoreinput,name:"question_score",label:"\u5206\u503C",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5206\u503C"}]},je.createElement(we.Z,{onBlur:g=>{g.target.value==="0"&&ie.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})),je.createElement(nn.Z,{form:o,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u5224\u65AD\u9898\u9898\u5E72\u5185\u5BB9",choiceKey:""}),je.createElement(Oe,{getTagData:w,qitem:e,exerciseitem:u,TagDiscipline:l,form:o}))))},Pl=E(69234),Q={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"},Ht=E(24018),ll=E(35567),Pt=Object.defineProperty,kl=Object.defineProperties,cl=Object.getOwnPropertyDescriptors,Jt=Object.getOwnPropertySymbols,Sl=Object.prototype.hasOwnProperty,vt=Object.prototype.propertyIsEnumerable,ml=(e,t,l)=>t in e?Pt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,on=(e,t)=>{for(var l in t||(t={}))Sl.call(t,l)&&ml(e,l,t[l]);if(Jt)for(var l of Jt(t))vt.call(t,l)&&ml(e,l,t[l]);return e},sn=(e,t)=>kl(e,cl(t)),rn=(e,t)=>{var l={};for(var u in e)Sl.call(e,u)&&t.indexOf(u)<0&&(l[u]=e[u]);if(e!=null&&Jt)for(var u of Jt(e))t.indexOf(u)<0&&vt.call(e,u)&&(l[u]=e[u]);return l};const s=e=>{var t=e,{value:l,onChange:u,scrollId:_}=t,x=rn(t,["value","onChange","scrollId"]);return n.createElement("div",{id:_||""},n.createElement(ll.Z,sn(on({},x),{defaultValue:l,onChange:(w,p)=>{console.log("a:",w,p),p!=null&&p.length?u(w,p):u(w)}})))},f=({value:e,onChange:t,placeholder:l,height:u=140,isEdit:_})=>_?n.createElement(ll.Z,{watch:!0,isFocus:!0,height:u,placeholder:l,defaultValue:e,onChange:t}):n.createElement("div",{style:{cursor:"pointer"}},e?n.createElement(We.Z,{className:Q.inputBorder,value:e}):n.createElement("div",{className:`${Q.inputBorder} ${Q.placeholder}`},l));var j=E(15746),R=E(40043),H=Object.defineProperty,Be=Object.defineProperties,Te=Object.getOwnPropertyDescriptors,U=Object.getOwnPropertySymbols,ht=Object.prototype.hasOwnProperty,Qe=Object.prototype.propertyIsEnumerable,nl=(e,t,l)=>t in e?H(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,pl=(e,t)=>{for(var l in t||(t={}))ht.call(t,l)&&nl(e,l,t[l]);if(U)for(var l of U(t))Qe.call(t,l)&&nl(e,l,t[l]);return e},_l=(e,t)=>Be(e,Te(t)),fu=(e,t)=>{var l={};for(var u in e)ht.call(e,u)&&t.indexOf(u)<0&&(l[u]=e[u]);if(e!=null&&U)for(var u of U(e))t.indexOf(u)<0&&Qe.call(e,u)&&(l[u]=e[u]);return l};const En=["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:_,isEdit:x,setInputActive:w,form:p,choiceOptionsPath:a,allowChangeMode:o,showAddIcon:g,addItem:i,deleteItem:d})=>{const C=(e==null?void 0:e[u])===1,S=()=>{const O=p.getFieldValue(a);p.setFieldValue(a,O.map(c=>_l(pl({},c),{[u]:0})))},v=()=>{C?t(_l(pl({},e),{[u]:0})):(o||S(),t(_l(pl({},e),{[u]:1})))};return n.createElement(Pe.Z,{className:Q.choiceWrap,align:"middle",wrap:!1},n.createElement(j.Z,{onClick:v,className:`${Q.choiceIndex} ${C?Q.activeAnswer:""}`},En[_]),n.createElement(j.Z,{flex:1,className:`${Q.editorWrap} ml15`,onClick:w},n.createElement(f,{height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",isEdit:x,value:e==null?void 0:e[l],onChange:O=>{t(_l(pl({},e),{[l]:O}))}})),n.createElement(j.Z,{flex:"0 0 auto",className:"ml15"},n.createElement("div",{onClick:v,className:`${Q.setAnswerBtn} ${C?Q.activeAnswer:""}`},C?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")),n.createElement(j.Z,{className:Q.actionWrapper},n.createElement(Ee.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},n.createElement(R.Z,{className:Q.addIcon,onClick:i,style:{visibility:g?"visible":"hidden"}})),n.createElement(Ee.Z,{title:"\u5220\u9664"},n.createElement(Ht.Z,{className:Q.deleteIcon,onClick:d,style:{visibility:_>1?"visible":"hidden"}}))))},hu=({questionTitlePlaceholder:e,titleKey:t,choiceKey:l,analysisKey:u,choiceTextKey:_,answerKey:x,choiceOptionsPath:w,allowChangeMode:p=!0,form:a,showAnalysis:o=!0})=>{const[g,i]=(0,n.useState)(),[d,C]=(0,n.useState)(!1);return n.createElement("div",{className:Q.wrap},n.createElement("div",{className:Q.questionTitleEditorWrap},n.createElement(A.default.Item,{label:"\u9898\u5E72",name:t,labelCol:{span:24},rules:[{required:!0}]},n.createElement(s,{scrollId:Array.isArray(t)?t.join("_"):`${t}`,watch:!0,height:140,placeholder:e}))),n.createElement(A.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}}),n.createElement(A.default.List,{name:l,rules:[{validator(S,v){const O=v.some(V=>V[x]===1),c=v.findIndex(V=>{var ce;return((ce=V[_])==null?void 0:ce.length)<=0});return c!==-1?Promise.reject(new Error(`\u8BF7\u5148\u8F93\u5165${En[c]}\u9009\u9879\u7684\u5185\u5BB9`)):O?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},(S,{add:v,remove:O})=>n.createElement("div",{id:Array.isArray(w)?w.join("_"):`${w}`},S.map((c,V)=>{var ce=c,{key:m,name:r}=ce,J=fu(ce,["key","name"]);const le=g===m,ee=()=>{i(m)},oe=V<7&&V===S.length-1,G=()=>v({[_]:"",[x]:0}),h=()=>O(r);return n.createElement(A.default.Item,_l(pl({},J),{key:m,name:r,noStyle:!0}),n.createElement(yu,{choiceTextKey:_,answerKey:x,index:V,isEdit:le,setInputActive:ee,form:a,choiceOptionsPath:w,allowChangeMode:p,showAddIcon:oe,addItem:G,deleteItem:h}))}),S.length<8&&n.createElement("div",{className:`${Q.addBtn} mb30`,onClick:()=>v({[_]:"",[x]:0})},"\u6DFB\u52A0\u9009\u9879"))),o&&n.createElement("div",{onClick:()=>C(!0)},n.createElement(A.default.Item,{name:u,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},n.createElement(f,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:d}))))};var L=E(67294),gu=Object.defineProperty,Fu=Object.defineProperties,Bu=Object.getOwnPropertyDescriptors,Ol=Object.getOwnPropertySymbols,fn=Object.prototype.hasOwnProperty,yn=Object.prototype.propertyIsEnumerable,hn=(e,t,l)=>t in e?gu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,Zl=(e,t)=>{for(var l in t||(t={}))fn.call(t,l)&&hn(e,l,t[l]);if(Ol)for(var l of Ol(t))yn.call(t,l)&&hn(e,l,t[l]);return e},Il=(e,t)=>Fu(e,Bu(t)),bu=(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&&yn.call(e,u)&&(l[u]=e[u]);return l};const Cu=({value:e,onChange:t})=>{const l=_=>{k.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:Q.modal,onOk:()=>{const x=[...e];x.splice(_,1),t(x)}})},u=()=>{const _=[...e];_.push(""),t(_)};return L.createElement(Pe.Z,{className:"ml20"},L.createElement(j.Z,{flex:1},e==null?void 0:e.map((_,x)=>L.createElement(Pe.Z,{key:`${_}_${x}`,align:"middle",className:"mb20"},L.createElement(bt.default.TextArea,{style:{flex:1,minHeight:44},defaultValue:_,autoSize:{maxRows:3},maxLength:1e3,onBlur:w=>{const p=[...e],a=w.target.value.trim();p[x]=a,t(p)}}),L.createElement(Ee.Z,{title:"\u5220\u9664"},L.createElement(Ht.Z,{className:Q.deleteIcon,style:{marginLeft:15,visibility:x>0?"visible":"hidden"},onClick:()=>l(x)}))))),L.createElement(j.Z,null,L.createElement("div",{className:`${Q.addBtn}`,onClick:()=>{u()}},"\u65B0\u589E\u7B54\u6848")))},xu=({value:e=!0,onChange:t})=>L.createElement(ye.Z,{checked:!e,onChange:l=>{t(!l)}}),vl="\u2581",Du=({questionTitlePlaceholder:e,form:t,name:l,scoreByBlank:u,answerKey:_,titleKey:x="name",analysisKey:w="analysis",isOrdered:p="is_ordered"})=>{var a,o;const[g,i]=(0,n.useState)(!1),d=(m,r)=>{const J=r.line;let le=0;for(let oe=0;oe<J;oe++)le+=m.getLine(oe).split(vl).length-1;const ee=m.getLine(J).substring(0,r.ch);return le+=ee.split(vl).length-1,le},C=(m,r,J,le)=>{const ee=m.getRange(r.from,r.to);let oe=0;if(r.text.forEach(G=>{oe+=G.split(vl).length-1}),r.origin!=="setValue"){if(ee&&ee.indexOf(vl)!==-1){const G=ee.split(vl).length-1,h=d(m,r.from);if(console.log(`\u5220\u9664${G}\u4E2A\uFF0C \u524D\u9762\u6709${h}\u4E2A\uFF0C\u65B0\u589E${oe}\u4E2A`),G>1){const te=Array.from({length:G},(he,ge)=>h+ge);le(te)}else le(h)}else if(oe>0){const G=d(m,r.from);console.log(`\u65B0\u589E${oe}\u4E2A\uFF0C\u4E4B\u524D\u6709${G}\u4E2A`),J(oe,G)}}},S=()=>{const m=t.getFieldValue(["sub_item_banks",..._]);t.setFieldValue(["sub_item_banks",..._],m==null?void 0:m.map((r,J)=>Il(Zl({},r),{position:J+1})))},v=(0,n.useRef)(),O=(m,r)=>{for(let J=0;J<m;J++)v.current({position:null,answer_text:[""]},r+J);S()},c=(0,n.useRef)(),V=m=>{c.current(m),S()},ce=(o=(a=t.getFieldValue("sub_item_banks"))==null?void 0:a[_==null?void 0:_[0]])==null?void 0:o[_==null?void 0:_[1]];return console.log(t==null?void 0:t.getFieldValue(["sub_item_banks",...u])),L.createElement("div",{className:Q.wrap},L.createElement("div",{className:Q.questionTitleEditorWrap},L.createElement(A.default.Item,{label:"\u9898\u5E72",name:x,labelCol:{span:24},rules:[{required:!0}]},L.createElement(s,{scrollId:"name",watch:!0,height:140,placeholder:e,showNullButton:!0,onCMBeforeChange:(m,r)=>{C(m,r,O,V)}}))),L.createElement(A.default.List,{name:_,rules:[{validator(m,r){if((r==null?void 0:r.length)===0)return Promise.reject(new Error("\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879"));for(const J of r){const{answer_text:le}=J||{};if(le!=null&&le.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:r,remove:J},{errors:le})=>(v.current=r,c.current=J,L.createElement(L.Fragment,null,L.createElement(A.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,oe)=>{var G=ee,{key:h,name:te}=G,he=bu(G,["key","name"]);return L.createElement(Pe.Z,{className:"mb20",key:h,align:"top"},L.createElement(j.Z,{flex:"0 0 auto",className:`${Q.blankIndex} pt5`},"\u586B\u7A7A\u9879",oe+1),L.createElement(j.Z,{flex:1},L.createElement(Pe.Z,{align:"top",justify:"space-between"},L.createElement(j.Z,{flex:1},L.createElement(A.default.Item,Il(Zl({},he),{name:[te,"answer_text"],noStyle:!0}),L.createElement(Cu,null))),(t==null?void 0:t.getFieldValue(["sub_item_banks",...u]))&&L.createElement(j.Z,{flex:"224px",style:{margin:"-7px 0 0 20px"}},L.createElement(A.default.Item,Il(Zl({},he),{name:[te,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:Q.blankInputNumberWrapper}),L.createElement(we.Z,{onChange:()=>{var ge,me;let ne=t==null?void 0:t.getFieldValue(["sub_item_banks",_==null?void 0:_[0],"standard_answers"]),pe=0;for(let ke in ne)(ge=ne[ke])!=null&&ge.score&&(pe+=Number((me=ne[ke])==null?void 0:me.score));t==null||t.setFieldValue(["sub_item_banks",_==null?void 0:_[0],"question_score"],pe)},className:Q.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5206\u503C"})))),L.createElement(A.default.Item,Il(Zl({},he),{name:[te,"position"],noStyle:!0}),L.createElement(bt.default,{type:"hidden"}))))})))),L.createElement(Pe.Z,{align:"middle"},L.createElement(A.default.Item,{name:[l,"downcase"],valuePropName:"checked"},L.createElement(ye.Z,null)),L.createElement(j.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")),L.createElement(Pe.Z,{align:"middle"},L.createElement(A.default.Item,{name:[l,"no_space"],valuePropName:"checked"},L.createElement(ye.Z,null)),L.createElement(j.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),(ce==null?void 0:ce.length)>1&&L.createElement(Pe.Z,{align:"middle",className:(ce==null?void 0:ce.length)>1?"mb30":`${Q.hide}`},L.createElement(A.default.Item,{name:p},L.createElement(xu,null)),L.createElement(j.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(A.default.Item,{name:w,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},L.createElement(f,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:g}))))};var Au=Object.defineProperty,wu=Object.defineProperties,Nu=Object.getOwnPropertyDescriptors,jl=Object.getOwnPropertySymbols,gn=Object.prototype.hasOwnProperty,Fn=Object.prototype.propertyIsEnumerable,Bn=(e,t,l)=>t in e?Au(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,bn=(e,t)=>{for(var l in t||(t={}))gn.call(t,l)&&Bn(e,l,t[l]);if(jl)for(var l of jl(t))Fn.call(t,l)&&Bn(e,l,t[l]);return e},Cn=(e,t)=>wu(e,Nu(t)),Pu=(e,t)=>{var l={};for(var u in e)gn.call(e,u)&&t.indexOf(u)<0&&(l[u]=e[u]);if(e!=null&&jl)for(var u of jl(e))t.indexOf(u)<0&&Fn.call(e,u)&&(l[u]=e[u]);return l};const ku={\u6B63\u786E:"T",\u9519\u8BEF:"F"},Su=({value:e,onChange:t,form:l,choiceKey:u})=>{const _=(e==null?void 0:e.is_answer)===1,x=e==null?void 0:e.choice_text,w=()=>{var p;const a=(p=l==null?void 0:l.getFieldValue(["sub_item_banks",...u]))==null?void 0:p.map(o=>({choice_text:o.choice_text,is_answer:0}));l==null||l.setFieldValue(["sub_item_banks",...u],a),t(Cn(bn({},e),{is_answer:1}))};return n.createElement(Pe.Z,{className:Q.choiceWrap,align:"middle",wrap:!1},n.createElement(j.Z,{onClick:w,className:`${Q.choiceIndex} ${Q.judgementIndex} ${_?Q.activeAnswer:""}`},ku[x]),n.createElement(j.Z,{flex:1,className:`${Q.editorWrap} ml15`},n.createElement("div",{className:`${Q.inputBorder} ${Q.placeholder} ${_?Q.activeJudgementAnswer:""}`},x)),n.createElement(j.Z,{flex:"0 0 auto",className:"ml15"},n.createElement("div",{onClick:w,className:`${Q.setAnswerBtn} ${_?Q.activeAnswer:""}`},_?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")))},Ou=({questionTitlePlaceholder:e,choiceKey:t="choices",form:l,titleKey:u="name",analysisKey:_="analysis"})=>{const[x,w]=(0,n.useState)(!1);return n.createElement("div",{className:Q.wrap},n.createElement("div",{className:Q.questionTitleEditorWrap},n.createElement(A.default.Item,{label:"\u9898\u5E72",name:u,labelCol:{span:24},rules:[{required:!0}]},n.createElement(s,{scrollId:"name",watch:!0,height:140,placeholder:e}))),n.createElement(A.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}},n.createElement(A.default.List,{name:t,rules:[{validator(p,a){return a.some(g=>(g==null?void 0:g.is_answer)===1)?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},p=>n.createElement("div",{id:"choices"},p.map(a=>{var o=a,{key:g,name:i}=o,d=Pu(o,["key","name"]);return n.createElement(A.default.Item,Cn(bn({},d),{key:g,name:i,noStyle:!0}),n.createElement(Su,{form:l,choiceKey:t}))})))),n.createElement("div",{onClick:()=>w(!0)},n.createElement(A.default.Item,{name:_,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},n.createElement(f,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:x}))))};var Zu=E(66309),Iu=Object.defineProperty,ju=Object.defineProperties,Tu=Object.getOwnPropertyDescriptors,Tl=Object.getOwnPropertySymbols,xn=Object.prototype.hasOwnProperty,Dn=Object.prototype.propertyIsEnumerable,An=(e,t,l)=>t in e?Iu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,dn=(e,t)=>{for(var l in t||(t={}))xn.call(t,l)&&An(e,l,t[l]);if(Tl)for(var l of Tl(t))Dn.call(t,l)&&An(e,l,t[l]);return e},cn=(e,t)=>ju(e,Tu(t)),wn=(e,t)=>{var l={};for(var u in e)xn.call(e,u)&&t.indexOf(u)<0&&(l[u]=e[u]);if(e!=null&&Tl)for(var u of Tl(e))t.indexOf(u)<0&&Dn.call(e,u)&&(l[u]=e[u]);return l};const Qu=e=>{var t=e,{value:l,onChange:u}=t,_=wn(t,["value","onChange"]);const x=w=>{u([w])};return n.createElement(ll.Z,cn(dn({},_),{defaultValue:l==null?void 0:l[0],onChange:x}))},$u=e=>{if(!e)return!1;if(/^s*$/.test(e)||e.trim()===""){ie.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==="|"?(ie.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:Q.keywordTag},n.createElement("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"}},e.join(" \u6216 "))),Vu=({questionTitlePlaceholder:e,form:t,showKeywords:l,isMustKeyWords:u=l,titleKey:_="name",analysisKey:x="analysis",answerTexts:w="answer_texts",keywords:p="keywords",useKeywords:a="use_keywords",indexs:o})=>{var g,i,d,C;const[S,v]=(0,n.useState)(!1),[O,c]=(0,n.useState)(""),V=(i=(g=t.getFieldValue("sub_item_banks"))==null?void 0:g[a==null?void 0:a[0]])==null?void 0:i[a==null?void 0:a[1]],ce=(C=(d=t.getFieldValue("sub_item_banks"))==null?void 0:d[a==null?void 0:a[0]])==null?void 0:C.question_score;return n.createElement("div",{className:Q.wrap},n.createElement("div",{className:Q.questionTitleEditorWrap},n.createElement(A.default.Item,{label:"\u9898\u5E72",name:_,labelCol:{span:24},rules:[{required:!0}]},n.createElement(s,{scrollId:"name",watch:!0,height:140,placeholder:e}))),n.createElement(A.default.Item,{label:"\u53C2\u8003\u7B54\u6848",name:w,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(A.default.Item,{hidden:!0,name:a,valuePropName:"checked"},n.createElement(ye.Z,{defaultChecked:!0})),l&&u&&n.createElement(Pe.Z,{align:"middle",className:"mb30"},n.createElement(A.default.Item,{name:a,valuePropName:"checked"},n.createElement(ye.Z,null)),n.createElement(j.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),n.createElement(j.Z,null,n.createElement(Ee.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(Dt.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),(V||!u)&&n.createElement(A.default.List,{name:p,rules:[{validator(m,r){return u?r!=null&&r.length?(r==null?void 0:r.reduce((le,ee)=>le+ee.score,0))>parseFloat(ce)?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:r,remove:J})=>n.createElement(n.Fragment,null,n.createElement("div",{className:`${Q.title} mb10`},u?"\u5173\u952E\u8BCD":n.createElement("span",{style:{color:"#9096A3"}},"\u5224\u5206\u5173\u952E\u8BCD")),n.createElement(Pe.Z,{align:"middle",className:"font14 mb30"},n.createElement(j.Z,{flex:1},n.createElement(bt.default,{value:O,onChange:le=>{c(le.target.value)},maxLength:50,allowClear:!0,onPressEnter:le=>{var ee,oe,G,h;const te=`${(ee=le.target)==null?void 0:ee.value}`,he=(G=(oe=te==null?void 0:te.split("|"))==null?void 0:oe.filter(ne=>!!ne))==null?void 0:G.map(ne=>ne.trim()),ge=t.getFieldValue(["sub_item_banks",...p]),me=((h=ge==null?void 0:ge.map(ne=>ne==null?void 0:ne.keyword))==null?void 0:h.flat())||[];for(const ne of he)if(me.includes(ne)){ie.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}$u(te)&&(r({keyword:he,score:1}),c(""))},className:Q.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(j.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),m.map(le=>{var ee=le,{key:oe,name:G}=ee,h=wn(ee,["key","name"]);return n.createElement(Pe.Z,{key:oe,className:"mb20",style:{marginRight:148}},n.createElement(j.Z,{flex:1},n.createElement(Pe.Z,{align:"middle",justify:"space-between"},n.createElement(A.default.Item,cn(dn({},h),{name:[G,"keyword"]}),n.createElement(Ru,{onClose:()=>J(G)})),u&&n.createElement(A.default.Item,cn(dn({},h),{name:[G,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:Q.blankInputNumberWrapper}),n.createElement(we.Z,{className:Q.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))}))),n.createElement("div",{onClick:()=>v(!0)},n.createElement(A.default.Item,{name:x,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},n.createElement(f,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:S}))))};var M=E(67294),Lu=Object.defineProperty,Mu=Object.defineProperties,Wu=Object.getOwnPropertyDescriptors,Ql=Object.getOwnPropertySymbols,Nn=Object.prototype.hasOwnProperty,Pn=Object.prototype.propertyIsEnumerable,kn=(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={}))Nn.call(t,l)&&kn(e,l,t[l]);if(Ql)for(var l of Ql(t))Pn.call(t,l)&&kn(e,l,t[l]);return e},On=(e,t)=>Mu(e,Wu(t)),zu=(e,t)=>{var l={};for(var u in e)Nn.call(e,u)&&t.indexOf(u)<0&&(l[u]=e[u]);if(e!=null&&Ql)for(var u of Ql(e))t.indexOf(u)<0&&Pn.call(e,u)&&(l[u]=e[u]);return l};const{Panel:Hu}=Pl.default,Ju=({questionTitlePlaceholder:e,choiceKey:t,form:l,withScore:u})=>{const _=[{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"}],[x,w]=(0,n.useState)(),[p,a]=(0,n.useState)([]),o=i=>{a(i)},g=({value:i})=>M.createElement("div",{style:{width:150,paddingLeft:11}},i);return M.createElement("div",{className:Q.wrap},M.createElement("div",{className:Q.questionTitleEditorWrap},M.createElement(A.default.Item,{label:"\u9898\u5E72",name:"name",labelCol:{span:24},rules:[{required:!0}]},M.createElement(s,{scrollId:"name",watch:!0,height:140,placeholder:e}))),M.createElement(A.default.Item,{label:"\u5C0F\u9898",required:!0,labelCol:{span:24}}),M.createElement(A.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:C,move:S})=>{const v=l.getFieldValue("sub_item_banks");return M.createElement(M.Fragment,null,M.createElement(Pl.default,{className:i.length>0?Q.collapseWrapper:"",bordered:!1,activeKey:p,onChange:o,expandIcon:({isActive:O})=>M.createElement("i",{className:`iconfont icon-weizhankai ${O?Q.open:Q.close}`,style:{fontSize:14,transition:"all .2s"}})},i.map((O,c)=>{var V=O,{key:ce,name:m}=V,r=zu(V,["key","name"]),J,le,ee,oe,G,h,te,he,ge,me,ne,pe,ke,W;return M.createElement(Hu,{className:Q.panel,forceRender:!0,header:M.createElement("div",{className:Q.panelHeader},"\u7B2C",c+1,"\u5C0F\u9898",M.createElement("span",null,"\uFF08",((J=v==null?void 0:v[m])==null?void 0:J.question_type)==0?"\u5355\u9009\u9898":((le=v==null?void 0:v[m])==null?void 0:le.question_type)==1?"\u591A\u9009\u9898":((ee=v==null?void 0:v[m])==null?void 0:ee.question_type)==3?"\u586B\u7A7A\u9898":((oe=v==null?void 0:v[m])==null?void 0:oe.question_type)==2?"\u5224\u65AD\u9898":"\u7B80\u7B54\u9898","\uFF09")),key:m,extra:M.createElement(Pe.Z,{align:"middle",onClick:ue=>ue.stopPropagation()},((G=v==null?void 0:v[m])==null?void 0:G.question_type)==3&&M.createElement(M.Fragment,null,M.createElement(pt.ZP.Group,{defaultValue:(h=v==null?void 0:v[m])==null?void 0:h.use_blank_score,className:I.scoreByBlankRadio,style:{marginRight:20},optionType:"button",options:[{label:"\u6309\u7A7A\u7ED9\u5206",value:!0},{label:"\u6309\u9898\u7ED9\u5206",value:!1}],onChange:ue=>{var ve,Fe,Ge,Xe,nt;if(l==null||l.setFieldValue(["sub_item_banks",m,"use_blank_score"],(ve=ue==null?void 0:ue.target)==null?void 0:ve.value),(Fe=ue==null?void 0:ue.target)!=null&&Fe.value){let dt=0;for(let Zt in(Ge=l==null?void 0:l.getFieldValue(["sub_item_banks",m]))==null?void 0:Ge.standard_answers)dt+=Number((nt=(Xe=l==null?void 0:l.getFieldValue(["sub_item_banks",m]))==null?void 0:Xe.standard_answers[Zt])==null?void 0:nt.score);l==null||l.setFieldValue(["sub_item_banks",m,"question_score"],dt||"")}w(new Date)}}),M.createElement(Ee.Z,{overlayInnerStyle:{width:460},title:M.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",M.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")},M.createElement("i",{className:"icon-tishixiaowenhao font18 mr25 c-3061d0"}))),u&&M.createElement(A.default.Item,On(Sn({},r),{rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5C0F\u9898\u5206\u503C"}],label:"\u5206\u503C",name:[m,"question_score"],className:Q.blankInputNumberWrapper}),((te=v==null?void 0:v[m])==null?void 0:te.question_type)==3&&((he=v==null?void 0:v[m])!=null&&he.use_blank_score)?M.createElement(g,null):M.createElement(we.Z,{className:Q.blankInput,placeholder:"\u8BF7\u8F93\u5165\u5206\u6570",min:.1,precision:1,max:100,style:{width:150}})),M.createElement(Pe.Z,{align:"middle",className:"pl40",style:{width:82}},c!==0&&M.createElement("div",{onClick:()=>{var ue;S(c,c-1);const ve=(ue=l.getFieldValue("sub_item_banks"))==null?void 0:ue.map((Fe,Ge)=>(i.map((Xe,nt)=>{Ge===nt&&(Fe.q_position=Number(Xe.name)+1)}),Fe));l.setFieldValue("sub_item_banks",ve)}},M.createElement(Ee.Z,{title:"\u4E0A\u79FB"},M.createElement("i",{className:"iconfont icon-shangyi3 c-grey-999 primary-hover"}))),c<i.length-1&&M.createElement("div",{onClick:()=>{var ue;S(c,c+1);const ve=(ue=l.getFieldValue("sub_item_banks"))==null?void 0:ue.map((Fe,Ge)=>(i.map((Xe,nt)=>{Ge===nt&&(Fe.q_position=Number(Xe.name)+1)}),Fe));l.setFieldValue("sub_item_banks",ve)},className:c===0?"":"ml10"},M.createElement(Ee.Z,{title:"\u4E0B\u79FB"},M.createElement("i",{className:"iconfont icon-xiayi3 c-grey-999 primary-hover"})))),M.createElement(Ee.Z,{title:"\u5220\u9664"},M.createElement(Ht.Z,{className:`${Q.deleteIcon} ml40`,onClick:()=>C(m)})))},M.createElement(A.default.Item,On(Sn({},r),{name:m}),(((ge=v==null?void 0:v[m])==null?void 0:ge.question_type)==0||((me=v==null?void 0:v[m])==null?void 0:me.question_type)==1)&&M.createElement(hu,{questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9009\u62E9\u9898\u9898\u5E72\u5185\u5BB9",allowChangeMode:((ne=v==null?void 0:v[m])==null?void 0:ne.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"}),((pe=v==null?void 0:v[m])==null?void 0:pe.question_type)==3&&M.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:x}),((ke=v==null?void 0:v[m])==null?void 0:ke.question_type)==2&&M.createElement(Ou,{form:l,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u5224\u65AD\u9898\u9898\u5E72\u5185\u5BB9",titleKey:[m,"name"],analysisKey:[m,"analysis"],choiceKey:[m,"choices"]}),((W=v==null?void 0:v[m])==null?void 0:W.question_type)==4&&M.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:x})))})),i.length<20&&M.createElement(al.Z,{menu:{items:[{label:M.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,...p])}},"\u5355\u9009\u9898"),key:"1",show:!0},{label:M.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,...p])}},"\u591A\u9009\u9898"),key:"2",show:!0},{label:M.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,...p])}},"\u5224\u65AD\u9898"),key:"3",show:!0},{label:M.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,...p])}},"\u586B\u7A7A\u9898"),key:"4",show:!0},{label:M.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,...p])}},"\u7B80\u7B54\u9898"),key:"5",show:!0}].filter(O=>O.show).map(O=>({label:O.label,key:O.key}))}},M.createElement("div",{className:`${Q.addBtn}`},"\u6DFB\u52A0\u5C0F\u9898")))}))};var He=E(67294),Gu=Object.defineProperty,Uu=Object.defineProperties,Xu=Object.getOwnPropertyDescriptors,Zn=Object.getOwnPropertySymbols,Yu=Object.prototype.hasOwnProperty,Ku=Object.prototype.propertyIsEnumerable,In=(e,t,l)=>t in e?Gu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,$t=(e,t)=>{for(var l in t||(t={}))Yu.call(t,l)&&In(e,l,t[l]);if(Zn)for(var l of Zn(t))Ku.call(t,l)&&In(e,l,t[l]);return e},Gt=(e,t)=>Uu(e,Xu(t)),qu=(e,t,l)=>new Promise((u,_)=>{var x=a=>{try{p(l.next(a))}catch(o){_(o)}},w=a=>{try{p(l.throw(a))}catch(o){_(o)}},p=a=>a.done?u(a.value):Promise.resolve(a.value).then(x,w);p((l=l.apply(e,t)).next())}),ea=({qitem:e,setisedit:t,TagDiscipline:l,exerciseitem:u,seveeditor:_,deleteitem:x,getTagData:w,init:p,showTip:a=!1})=>{const[o]=A.default.useForm();(0,n.useEffect)(()=>{var i;o.setFieldsValue(Gt($t({},e),{name:e.question_title,sub_item_banks:(i=e.sub_exercise_questions)==null?void 0:i.map(d=>{var C;return Gt($t({},d),{name:d.question_title,choices:(C=d==null?void 0:d.question_choices)==null?void 0:C.map(S=>Gt($t({},S),{is_answer:S!=null&&S.standard_boolean?1:0}))})}),repeat_answer:!e.repeat_answer}))},[e]);const g=i=>{if(!(i!=null&&i.length))return!1;const d=i.map(S=>{var v;return(v=S.choice_text)==null?void 0:v.trim().replace(/^\s+|\s+$/g,"")});return new Set(d).size!==d.length};return He.createElement("div",null,He.createElement(A.default,{form:o,colon:!1,onValuesChange:(i,d)=>{var C,S,v;if(i!=null&&i.sub_item_banks){let O=((C=o.getFieldValue("sub_item_banks"))==null?void 0:C.length)>0&&((v=(S=o.getFieldValue("sub_item_banks"))==null?void 0:S.map(c=>{var V;if(c.question_type==3&&(c!=null&&c.use_blank_score)){let ce=0;for(let m in c==null?void 0:c.standard_answers)ce+=Number((V=c==null?void 0:c.standard_answers[m])==null?void 0:V.score);return ce}else return c.question_score}))==null?void 0:v.filter(c=>c));(O==null?void 0:O.length)>0&&o.setFieldsValue({question_score:parseFloat(O==null?void 0:O.reduce((c,V)=>parseFloat(c)+parseFloat(V))).toFixed(1)})}},onFinish:i=>{var d,C;if((d=i.sub_item_banks)==null?void 0:d.some(v=>v.question_type===0||v.question_type===1?g(v.choices):!1)){ie.ZP.error("\u9009\u62E9\u9898\u9009\u9879\u5185\u5BB9\u4E0D\u80FD\u91CD\u590D\uFF0C\u8BF7\u4FEE\u6539\u540E\u518D\u4FDD\u5B58");return}_(Gt($t($t({},e),i),{sub_item_banks:(C=i==null?void 0:i.sub_item_banks)==null?void 0:C.map(v=>(console.log(v),Gt($t({},v),{item_type:v==null?void 0:v.question_type,id:(v==null?void 0:v.question_id)||""})))}))},onFinishFailed:i=>qu(void 0,null,function*(){var d,C;ie.ZP.error(i.errorFields[0].errors[0]),o.scrollToField((C=(d=i==null?void 0:i.errorFields)==null?void 0:d[0])==null?void 0:C.name,{behavior:"smooth",block:"center"})})},He.createElement("div",{style:{display:"flex",alignItems:"center"}},He.createElement("div",{style:{flex:1}},He.createElement("span",{style:{display:"inline-flex",border:"1px solid #9096A3",borderRadius:"50%",width:10,height:10,marginRight:5,background:"#9096A3"}}),He.createElement("span",null,"\u7EC4\u5408\u9898")),!e.isadd&&He.createElement("span",{style:{marginLeft:20,marginRight:20,color:"red",cursor:"pointer"},onClick:()=>{x()}},He.createElement("i",{className:"iconfont icon-piliangshanchu3",style:{fontSize:14,marginRight:6}}),"\u5220\u9664"),He.createElement(Ne.ZP,{onClick:()=>{var i;e.isadd?(t(!1),p()):(o.setFieldsValue(Gt($t({},e),{name:e==null?void 0:e.question_title,choices:(i=e==null?void 0:e.question_choices)==null?void 0:i.map(d=>Gt($t({},d),{standard_boolean:d!=null&&d.standard_boolean?1:0})),repeat_answer:!(e!=null&&e.repeat_answer)})),t(!1))}},"\u53D6\u6D88"),He.createElement(Ee.Z,{overlayClassName:I.shake,open:a,placement:"bottom",color:"rgba(244,156,14,0.19)",title:He.createElement("div",{style:{color:"#FF841A",fontSize:"14px"}},He.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")},He.createElement(Ne.ZP,{className:"ml20",type:"primary",onClick:()=>{o.submit()}},"\u4FDD\u5B58"))),He.createElement("div",{style:{maxHeight:"calc(100vh - 148px)",overflowY:"auto",marginTop:"10px",paddingRight:"5px"}},He.createElement(wt.Z,{text:"\uFF08\u7EC4\u5408\u9898\u5206\u503C\u7B49\u4E8E\u5404\u5C0F\u9898\u5206\u503C\u4E4B\u548C\uFF09"}),He.createElement(Ju,{form:o,withScore:!0,choiceKey:"",questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u7EC4\u5408\u9898\u9898\u5E72\u5185\u5BB9"}),He.createElement(Oe,{getTagData:w,qitem:e,exerciseitem:u,TagDiscipline:l,form:o}))))},ta=E(15312),$l=E(19575),Je=E(67294),la=Object.defineProperty,na=Object.defineProperties,ua=Object.getOwnPropertyDescriptors,jn=Object.getOwnPropertySymbols,aa=Object.prototype.hasOwnProperty,ia=Object.prototype.propertyIsEnumerable,Tn=(e,t,l)=>t in e?la(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,kt=(e,t)=>{for(var l in t||(t={}))aa.call(t,l)&&Tn(e,l,t[l]);if(jn)for(var l of jn(t))ia.call(t,l)&&Tn(e,l,t[l]);return e},El=(e,t)=>na(e,ua(t)),oa=(e,t,l)=>new Promise((u,_)=>{var x=a=>{try{p(l.next(a))}catch(o){_(o)}},w=a=>{try{p(l.throw(a))}catch(o){_(o)}},p=a=>a.done?u(a.value):Promise.resolve(a.value).then(x,w);p((l=l.apply(e,t)).next())}),sa=({qitem:e,TagDiscipline:t,exerciseitem:l,setisedit:u,seveeditor:_,deleteitem:x,getTagData:w,init:p,showTip:a=!1})=>{const[o]=A.default.useForm(),g=!0;return(0,n.useEffect)(()=>{var i,d,C;o.setFieldsValue(El(kt({},e),{standard_answers:e.standard_answer,difficulty:e.difficulty,item_banks_group_id:e.item_banks_group_id,hack:El(kt({},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:$l.Base64.decode(((d=e==null?void 0:e.program_attr)==null?void 0:d.code)||"")},hack_sets:kt({},(C=e==null?void 0:e.hack_sets)==null?void 0:C[0]),repeat_answer:!e.repeat_answer}))},[e]),Je.createElement("div",null,Je.createElement(A.default,{form:o,colon:!1,onValuesChange:(i,d)=>{var C,S,v,O;if(i!=null&&i.standard_answers){let c=((C=o.getFieldValue("standard_answers"))==null?void 0:C.length)>0&&((v=(S=o.getFieldValue("standard_answers"))==null?void 0:S.map(V=>V.score))==null?void 0:v.filter(V=>V));(c==null?void 0:c.length)>0&&o.setFieldsValue({question_score:(c==null?void 0:c.length)>0&&((O=c.reduce((V,ce)=>V+ce))==null?void 0:O.toFixed(1))})}},onFinish:i=>{var d;_(El(kt(kt({},e),i),{item_type:e==null?void 0:e.question_type,standard_answers:(d=i.standard_answers)==null?void 0:d.map((C,S)=>El(kt({},C),{position:S+1})),standard_answer:void 0}))},onFinishFailed:i=>oa(void 0,null,function*(){var d,C;ie.ZP.error(i.errorFields[0].errors[0]),o.scrollToField((C=(d=i==null?void 0:i.errorFields)==null?void 0:d[0])==null?void 0:C.name,{behavior:"smooth",block:"center"})})},Je.createElement("div",{style:{display:"flex",alignItems:"center"}},Je.createElement("div",{style:{flex:1}},Je.createElement("span",{style:{display:"inline-flex",border:"1px solid #9096A3",borderRadius:"50%",width:10,height:10,marginRight:5,background:"#9096A3"}}),Je.createElement("span",null,"\u7A0B\u5E8F\u586B\u7A7A\u9898")),!e.isadd&&Je.createElement("span",{style:{marginLeft:20,marginRight:20,color:"red",cursor:"pointer"},onClick:()=>{x()}},Je.createElement("i",{className:"iconfont icon-piliangshanchu3",style:{fontSize:14,marginRight:6}})," \u5220\u9664"),Je.createElement(Ne.ZP,{onClick:()=>{var i,d,C;e.isadd?(u(!1),p()):(o.setFieldsValue(El(kt({},e),{standard_answers:e.standard_answer,difficulty:e.difficult,item_banks_group_id:e.item_banks_group_id,hack:kt({},e),hack_codes:{language:(i=e==null?void 0:e.program_attr)==null?void 0:i.language,code:$l.Base64.decode((d=e==null?void 0:e.program_attr)==null?void 0:d.code)},hack_sets:kt({},(C=e==null?void 0:e.hack_sets)==null?void 0:C[0]),repeat_answer:!e.repeat_answer})),u(!1))}},"\u53D6\u6D88"),Je.createElement(Ee.Z,{overlayClassName:I.shake,open:a,placement:"bottom",color:"rgba(244,156,14,0.19)",title:Je.createElement("div",{style:{color:"#FF841A",fontSize:"14px"}},Je.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")},Je.createElement(Ne.ZP,{className:"ml20",type:"primary",onClick:()=>{o.submit()}},"\u4FDD\u5B58"))),Je.createElement("div",{style:{maxHeight:"calc(100vh - 148px)",overflowY:"auto",marginTop:"10px",paddingRight:"5px"}},Je.createElement(wt.Z,{text:"\uFF08\u5C0F\u9898\u5206\u503C\u7B49\u4E8E\u5404\u586B\u7A7A\u9879\u5206\u503C\u4E4B\u548C\uFF09"}),Je.createElement(ta.t,{form:o,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u7A0B\u5E8F\u586B\u7A7A\u9898\u9898\u5E72\u5185\u5BB9",scoreByBlank:g,hackidentifier:e==null?void 0:e.hack_identifier,answerKey:"standard_answers"}),Je.createElement(Oe,{getTagData:w,qitem:e,exerciseitem:l,TagDiscipline:t,form:o}))))},be=E(67294),ra=Object.defineProperty,da=Object.defineProperties,ca=Object.getOwnPropertyDescriptors,Qn=Object.getOwnPropertySymbols,ma=Object.prototype.hasOwnProperty,pa=Object.prototype.propertyIsEnumerable,$n=(e,t,l)=>t in e?ra(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,Et=(e,t)=>{for(var l in t||(t={}))ma.call(t,l)&&$n(e,l,t[l]);if(Qn)for(var l of Qn(t))pa.call(t,l)&&$n(e,l,t[l]);return e},St=(e,t)=>da(e,ca(t)),Rn=(e,t,l)=>new Promise((u,_)=>{var x=a=>{try{p(l.next(a))}catch(o){_(o)}},w=a=>{try{p(l.throw(a))}catch(o){_(o)}},p=a=>a.done?u(a.value):Promise.resolve(a.value).then(x,w);p((l=l.apply(e,t)).next())}),_a=({qitem:e,setqitem:t,setisedit:l,TagDiscipline:u,exerciseitem:_,seveeditor:x,deleteitem:w,showTip:p=!1})=>{var a;const[o]=A.default.useForm();return(0,n.useEffect)(()=>{var g,i;o.setFieldsValue(St(Et({},e),{name:e==null?void 0:e.question_title,choices:(g=e==null?void 0:e.question_choices)==null?void 0:g.map(d=>St(Et({},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=>St(Et({},d),{defaultscore:d.challenge_score}))},[]),be.createElement("div",null,be.createElement(A.default,{form:o,colon:!1,onFinish:g=>{var i,d;let C=St(Et({},g),{question_scores:(i=e==null?void 0:e.shixun)==null?void 0:i.map(S=>S.challenge_score),item_type:e==null?void 0:e.question_type,choices:(d=g==null?void 0:g.choices)==null?void 0:d.map(S=>St(Et({},S),{is_answer:S.standard_boolean}))});x(Et(Et({},e),C))},onFinishFailed:g=>Rn(void 0,null,function*(){var i,d;ie.ZP.error(g.errorFields[0].errors[0]),o.scrollToField((d=(i=g==null?void 0:g.errorFields)==null?void 0:i[0])==null?void 0:d.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,"\u5B9E\u8BAD\u9898")),be.createElement("span",{style:{marginLeft:20,marginRight:20,color:"red",cursor:"pointer"},onClick:()=>{w()}},be.createElement("i",{className:"iconfont icon-piliangshanchu3",style:{fontSize:14,marginRight:6}}),"\u5220\u9664"),be.createElement(Ne.ZP,{onClick:()=>{var g,i;o.setFieldsValue(St(Et({},e),{name:e==null?void 0:e.question_title,choices:(g=e==null?void 0:e.question_choices)==null?void 0:g.map(d=>St(Et({},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=>St(Et({},d),{challenge_score:d.defaultscore})),t(Et({},e)),l(!1)}},"\u53D6\u6D88"),be.createElement(Ee.Z,{overlayClassName:I.shake,open:p,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(Ne.ZP,{className:"ml20",type:"primary",onClick:()=>Rn(void 0,null,function*(){var g,i,d;if(((i=(g=e==null?void 0:e.shixun)==null?void 0:g.map)==null?void 0:i.call(g,C=>C.challenge_score).filter(C=>C).length)<((d=e==null?void 0:e.shixun)==null?void 0:d.length)){ie.ZP.info("\u5206\u6570\u4E0D\u80FD\u4E3A\u7A7A");return}o.submit()})},"\u4FDD\u5B58"))),be.createElement(wt.Z,{text:"\uFF08\u5B9E\u8BAD\u9898\u5206\u503C\u7B49\u4E8E\u5404\u5173\u5361\u5206\u503C\u4E4B\u548C\uFF09"}),be.createElement(A.default.Item,{label:"\u9898\u5E72",name:"question_title",labelCol:{span:24},rules:[{required:!0}]},be.createElement(ll.Z,{watch:!0,height:140,placeholder:"",defaultValue:e.question_title}))),be.createElement(Pe.Z,{style:{marginBottom:15},align:"middle",justify:"space-between"},be.createElement("div",null,be.createElement("span",{style:{color:"red"}},"*"),"\u5173\u5361\u540D\u79F0"),be.createElement("a",{href:`/shixuns/${e==null?void 0:e.shixun_identifier}/challenges?exercise=true`,target:"_blank"},be.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((g,i)=>be.createElement("div",{key:g.challenge_id,style:{display:"flex",marginBottom:20}},be.createElement("div",{style:{flex:1}},i+1,"\u3001",g.challenge_name),be.createElement("div",null,be.createElement("span",{style:{color:"red"}},"*"),"\u5206\u503C",be.createElement(we.Z,{precision:1,value:g==null?void 0:g.challenge_score,onChange:d=>{const C=JSON.parse(JSON.stringify((e==null?void 0:e.shixun)||[]));C[i].challenge_score=d;const S=C.every(O=>!O.challenge_score),v=parseFloat(C==null?void 0:C.map(O=>O.challenge_score).reduce((O,c)=>parseFloat(O||0)+parseFloat(c||0)));o.setFieldsValue({question_score:S?"":v.toFixed(1)}),t(St(Et({},e),{shixun:C}))},max:200,min:1,style:{marginLeft:10,width:150},placeholder:"\u8BF7\u8F93\u5165\u5206\u503C",size:"middle"})))))},D={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=E(57399),Ea=E(35713),y=E(67294);const Rl=["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,_,x,w,p,a,o,g,i,d,C,S,v,O,c,V,ce,m,r,J,le,ee,oe,G;return y.createElement("div",{className:D.warp},((e==null?void 0:e.question_type)===0||(e==null?void 0:e.question_type)===2)&&y.createElement("div",{className:D.normalWrap},(l=e==null?void 0:e.question_choices)==null?void 0:l.map((h,te)=>y.createElement("div",{className:D.redio,key:te},!(h!=null&&h.standard_boolean)&&y.createElement("span",{className:D.redioitem}),(h==null?void 0:h.standard_boolean)&&y.createElement("i",{className:`${D.redioitemyes} icon-duigou1`}),y.createElement("span",{className:`${h!=null&&h.standard_boolean?D.titleyes:D.title} ${D.indexTag}`},(e==null?void 0:e.question_type)===0?Rl[te]:""),y.createElement(We.Z,{className:h!=null&&h.standard_boolean?D.titleyes:D.title,value:h==null?void 0:h.choice_text}),(h==null?void 0:h.standard_boolean)&&y.createElement("div",{className:D.yestag},"\u6B63\u786E\u7B54\u6848")))),(e==null?void 0:e.question_type)===1&&y.createElement("div",{className:D.normalWrap},(u=e==null?void 0:e.question_choices)==null?void 0:u.map((h,te)=>y.createElement("div",{className:D.checkbox,key:te},!(h!=null&&h.standard_boolean)&&y.createElement("span",{className:D.checkboxitem}),(h==null?void 0:h.standard_boolean)&&y.createElement("i",{className:`${D.checkboxitemyes} icon-duigou1`}),y.createElement("span",{className:`${h!=null&&h.standard_boolean?D.titleyes:D.title} ${D.indexTag}`},Rl[te]),y.createElement(We.Z,{className:h!=null&&h.standard_boolean?D.titleyes:D.title,value:h==null?void 0:h.choice_text}),(h==null?void 0:h.standard_boolean)&&y.createElement("div",{className:D.yestag},"\u6B63\u786E\u7B54\u6848")))),(e==null?void 0:e.question_type)===3&&y.createElement("div",{className:D.completion},(_=e==null?void 0:e.standard_answers)==null?void 0:_.map((h,te)=>{var he;return y.createElement(Pe.Z,{align:"top"},y.createElement("span",{className:D.title},"\u586B\u7A7A\u9879",te+1),y.createElement("div",{className:D.content},(he=h.answer_text)==null?void 0:he.map((ge,me)=>y.createElement("div",{key:me,className:D.items,style:(h==null?void 0:h.model)===2?{border:0,padding:0}:{}},(h==null?void 0:h.model)===1?y.createElement("pre",{className:"mb0"},ge):y.createElement(Ea.Z,{value:ge,disabled:!0})))))})),(e==null?void 0:e.question_type)===4&&y.createElement("div",{className:D.simple},y.createElement("div",{className:D.title},"\u53C2\u8003\u7B54\u6848"),y.createElement("div",{className:"mt10",style:{fontSize:"16px"}},(x=e==null?void 0:e.answer_texts)!=null&&x[0]?y.createElement(We.Z,{className:D.content,value:(w=e==null?void 0:e.answer_texts)==null?void 0:w[0]}):y.createElement("div",{style:{color:"#C1C1C1"}},"\u6682\u672A\u8BBE\u7F6E~")),y.createElement("div",{className:"mt20 "},y.createElement("span",{className:D.title,style:{color:"#3061D0"}},"\u5224\u5206\u65B9\u5F0F"),y.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&&y.createElement("div",{className:D.shixunWrapper},(p=e==null?void 0:e.shixun)==null?void 0:p.map((h,te)=>{var he,ge;return y.createElement("div",null,y.createElement("div",{key:te,className:`${D.shixun} mb30`},y.createElement("span",{className:D.score},"\uFF08",h==null?void 0:h.challenge_score,"\u5206\uFF09"),y.createElement("span",{className:D.qtitle},(e==null?void 0:e.index)+"."+(te+1),"\u3001",h==null?void 0:h.challenge_name)),((ge=(he=t==null?void 0:t.editData)==null?void 0:he.exercise)==null?void 0:ge.show_challenge_task_pass)&&y.createElement(We.Z,{className:D.content,value:(h==null?void 0:h.challenge_task_pass)||"\u6682\u65E0\u5173\u5361\u63CF\u8FF0"}))})),(e==null?void 0:e.question_type)===6&&y.createElement("div",{className:D.program,style:{border:!((o=(a=t==null?void 0:t.editData)==null?void 0:a.exercise)!=null&&o.show_hack_sets)&&!((i=(g=t==null?void 0:t.editData)==null?void 0:g.exercise)!=null&&i.show_hack_description)&&"none"}},((C=(d=t==null?void 0:t.editData)==null?void 0:d.exercise)==null?void 0:C.show_hack_sets)&&y.createElement("div",{style:{marginBottom:10,border:"1px solid #F1F4F9"}},y.createElement("p",{style:{padding:"0px 10px",height:40,lineHeight:"40px",background:"#F1F4F9",color:"#3061D0"}},y.createElement("i",{className:"iconfont icon-ceshiyongli"})," \u6D4B\u8BD5\u7528\u4F8B\uFF1A"),y.createElement(va.default,{style:{margin:10},columns:[{title:"\u5E8F\u53F7",dataIndex:"name",key:"name",width:"10%",render:(h,te,he)=>he+1},{title:"\u6D4B\u8BD5\u7528\u4F8B\u8F93\u5165",dataIndex:"input",key:"input",width:"40%",render:(h,te,he)=>y.createElement(Ee.Z,{title:y.createElement("pre",null,h)},y.createElement("div",{className:D.divname},h))},{title:"\u6D4B\u8BD5\u7528\u4F8B\u8F93\u51FA",dataIndex:"output",key:"output",width:"40%",render:(h,te,he)=>y.createElement(Ee.Z,{title:y.createElement("pre",null,h)}," ",y.createElement("div",{className:D.divname},h))},{title:"\u662F\u5426\u53EF\u89C1",dataIndex:"visibility_cn",key:"visibility_cn",width:"10%"}],pagination:!1,dataSource:(S=e==null?void 0:e.program_attr)==null?void 0:S.hack_sets})),((O=(v=t==null?void 0:t.editData)==null?void 0:v.exercise)==null?void 0:O.show_hack_description)&&y.createElement("div",null,y.createElement(We.Z,{className:D.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((h,te)=>{var he,ge,me,ne,pe,ke;return y.createElement("div",{key:te},y.createElement("div",{className:D.combination},y.createElement("span",{className:D.score},h==null?void 0:h.question_score,"\u5206"),y.createElement("span",{className:D.qtype},(he=fa.find(W=>W.type==h.question_type))==null?void 0:he.name),y.createElement("span",{className:D.qtitle},y.createElement(We.Z,{value:`${te+1}\u3001${h==null?void 0:h.question_title}`}))),(h.question_type===0||h.question_type===2)&&y.createElement("div",{className:D.warp,style:{padding:"20px 58px 0 58px"}},y.createElement("div",null,(ge=h==null?void 0:h.question_choices)==null?void 0:ge.map((W,ue)=>y.createElement("div",{className:D.redio,key:ue},!(W!=null&&W.standard_boolean)&&y.createElement("span",{className:D.redioitem}),(W==null?void 0:W.standard_boolean)&&y.createElement("i",{className:`${D.redioitemyes} icon-duigou1`}),y.createElement("span",{className:`${W!=null&&W.standard_boolean?D.titleyes:D.title} ${D.indexTag}`},Rl[ue]),y.createElement(We.Z,{className:W!=null&&W.standard_boolean?D.titleyes:D.title,value:W==null?void 0:W.choice_text}),(W==null?void 0:W.standard_boolean)&&y.createElement("div",{className:D.yestag},"\u6B63\u786E\u7B54\u6848"))))),h.question_type===1&&y.createElement("div",{className:D.normalWrap},(me=h==null?void 0:h.question_choices)==null?void 0:me.map((W,ue)=>y.createElement("div",{className:D.checkbox,key:ue},!(W!=null&&W.standard_boolean)&&y.createElement("span",{className:D.checkboxitem}),(W==null?void 0:W.standard_boolean)&&y.createElement("i",{className:`${D.checkboxitemyes} icon-duigou1`}),y.createElement("span",{className:`${W!=null&&W.standard_boolean?D.titleyes:D.title} ${D.indexTag}`},Rl[ue]),y.createElement(We.Z,{className:W!=null&&W.standard_boolean?D.titleyes:D.title,value:W==null?void 0:W.choice_text}),(W==null?void 0:W.standard_boolean)&&y.createElement("div",{className:D.yestag},"\u6B63\u786E\u7B54\u6848")))),h.question_type===3&&y.createElement("div",{className:D.completion},(ne=h==null?void 0:h.standard_answers)==null?void 0:ne.map((W,ue)=>{var ve;return y.createElement(Pe.Z,{align:"top"},y.createElement("span",{className:D.title},"\u586B\u7A7A\u9879",ue+1),y.createElement("div",{className:D.content},(ve=W.answer_text)==null?void 0:ve.map((Fe,Ge)=>y.createElement("div",{key:Ge,className:D.items},y.createElement("pre",{className:"mb0"},Fe)))))})),h.question_type===4&&y.createElement("div",{className:D.simple},y.createElement("div",{className:D.title},"\u53C2\u8003\u7B54\u6848"),y.createElement("div",{className:"mt10",style:{fontSize:"16px"}},(pe=h==null?void 0:h.answer_texts)!=null&&pe[0]?y.createElement(We.Z,{className:D.content,value:(ke=h==null?void 0:h.answer_texts)==null?void 0:ke[0]}):y.createElement("div",{style:{color:"#C1C1C1"}},"\u6682\u672A\u8BBE\u7F6E~")),y.createElement("div",{className:"mt20 "},y.createElement("span",{className:D.title,style:{color:"#3061D0"}},"\u5224\u5206\u65B9\u5F0F"),y.createElement("span",{style:{color:"#000",marginLeft:10,fontSize:"16px"}},h!=null&&h.use_keywords?"\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206":"\u624B\u52A8\u5224\u5206"))))})),(e==null?void 0:e.question_type)===8&&y.createElement("div",null,y.createElement(We.Z,{disabledFill:!0,className:D.content,showProgramFill:!0,value:$l.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))&&y.createElement("div",{className:D.bottom},y.createElement("div",{className:`${D.bottomitem} mb30`},y.createElement("span",{className:D.left},"\u89E3\u6790"),y.createElement("span",{className:D.right},e!=null&&e.analysis?y.createElement(We.Z,{value:e==null?void 0:e.analysis}):y.createElement("span",{style:{color:"#C1C1C1"}},"\u6682\u672A\u8BBE\u7F6E~"))),y.createElement("div",{className:`${D.bottomitem} mb30`},y.createElement("span",{className:D.left},"\u96BE\u5EA6"),y.createElement("span",{className:D.right},(e==null?void 0:e.difficulty)===1?"\u7B80\u5355":(e==null?void 0:e.difficulty)===2?"\u9002\u4E2D":"\u56F0\u96BE")),y.createElement("div",{className:D.bottomitem},y.createElement("span",{className:D.left},"\u77E5\u8BC6\u70B9"),y.createElement(Ee.Z,{title:((ce=e==null?void 0:e.tag_discipline_names)==null?void 0:ce.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=(r=e==null?void 0:e.tag_discipline_names)==null?void 0:r.join("\uFF1B"))==null?void 0:J.toString()},y.createElement("span",{className:D.right},((le=e==null?void 0:e.tag_discipline_names)==null?void 0:le.length)<=0?y.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])?y.createElement("span",{style:{color:"#C1C1C1"}},"\u6682\u672A\u8BBE\u7F6E~"):(G=(oe=e==null?void 0:e.tag_discipline_names)==null?void 0:oe.join("\uFF1B"))==null?void 0:G.toString())))))},ha=E(92359),ga=E(77792),Le=E(67294),Fa=Object.defineProperty,Ba=Object.defineProperties,ba=Object.getOwnPropertyDescriptors,Vn=Object.getOwnPropertySymbols,Ca=Object.prototype.hasOwnProperty,xa=Object.prototype.propertyIsEnumerable,Ln=(e,t,l)=>t in e?Fa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,Vl=(e,t)=>{for(var l in t||(t={}))Ca.call(t,l)&&Ln(e,l,t[l]);if(Vn)for(var l of Vn(t))xa.call(t,l)&&Ln(e,l,t[l]);return e},Mn=(e,t)=>Ba(e,ba(t)),Da=(e,t,l)=>new Promise((u,_)=>{var x=a=>{try{p(l.next(a))}catch(o){_(o)}},w=a=>{try{p(l.throw(a))}catch(o){_(o)}},p=a=>a.done?u(a.value):Promise.resolve(a.value).then(x,w);p((l=l.apply(e,t)).next())}),Aa=({qitem:e,setisedit:t,TagDiscipline:l,exerciseitem:u,seveeditor:_,deleteitem:x,getTagData:w,init:p,showTip:a=!1})=>{const[o]=A.default.useForm();return(0,n.useEffect)(()=>{o.setFieldsValue(Mn(Vl({},e),{name:e.question_title,answer_texts:e.answer_texts,repeat_answer:!e.repeat_answer}))},[e]),Le.createElement("div",null,Le.createElement(A.default,{form:o,colon:!1,onFinish:g=>{_(Vl(Vl({},e),g))},onFinishFailed:g=>Da(void 0,null,function*(){var i,d;ie.ZP.error(g.errorFields[0].errors[0]),o.scrollToField((d=(i=g==null?void 0:g.errorFields)==null?void 0:i[0])==null?void 0:d.name,{behavior:"smooth",block:"center"})})},Le.createElement("div",{style:{display:"flex",alignItems:"center"}},Le.createElement("div",{style:{flex:1}},Le.createElement("span",{style:{display:"inline-flex",border:"1px solid #9096A3",borderRadius:"50%",width:10,height:10,marginRight:5,background:"#9096A3"}}),Le.createElement("span",null,"\u7B80\u7B54\u9898")),!(e!=null&&e.isadd)&&Le.createElement("span",{style:{marginLeft:20,marginRight:20,color:"red",cursor:"pointer"},onClick:()=>{x()}},Le.createElement("i",{className:"iconfont icon-piliangshanchu3",style:{fontSize:14,marginRight:6}}),"\u5220\u9664"),Le.createElement(Ne.ZP,{onClick:()=>{e.isadd?(t(!1),p()):(o.setFieldsValue(Mn(Vl({},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"),Le.createElement(Ee.Z,{overlayClassName:I.shake,open:a,placement:"bottom",color:"rgba(244,156,14,0.19)",title:Le.createElement("div",{style:{color:"#FF841A",fontSize:"14px"}},Le.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")},Le.createElement(Ne.ZP,{type:"primary",className:"ml20",onClick:()=>{o.submit()}},"\u4FDD\u5B58"))),Le.createElement("div",{style:{maxHeight:"calc(100vh - 148px)",overflowY:"auto",marginTop:"10px",paddingRight:"5px"}},Le.createElement(A.default.Item,{className:I.scoreinput,name:"question_score",label:"\u5206\u503C",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5206\u503C"}]},Le.createElement(we.Z,{onBlur:g=>{g.target.value==="0"&&ie.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})),Le.createElement(ga.W,{form:o,showKeywords:!0,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u7B80\u7B54\u9898\u9898\u5E72\u5185\u5BB9"}),Le.createElement(Oe,{getTagData:w,qitem:e,exerciseitem:u,TagDiscipline:l,form:o}))))},Ze=E(67294),wa=(e,t,l)=>new Promise((u,_)=>{var x=a=>{try{p(l.next(a))}catch(o){_(o)}},w=a=>{try{p(l.throw(a))}catch(o){_(o)}},p=a=>a.done?u(a.value):Promise.resolve(a.value).then(x,w);p((l=l.apply(e,t)).next())}),Na=({setScoreShow:e,ScoreShow:t,exerciseitem:l,getdata:u})=>{var _,x,w;const[p,a]=(0,n.useState)(!1);function o(){return wa(this,null,function*(){var g,i,d;let C=(i=(g=l==null?void 0:l.exercise_question_types)==null?void 0:g.filter(v=>v.Singlequestion))==null?void 0:i.map(v=>({question_type:v.question_type,score:v.Singlequestion})),S=yield(0,Me.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:C}});(S==null?void 0:S.status)===0&&u()})}return Ze.createElement("div",null,t&&Ze.createElement(k.default,{title:"\u6279\u91CF\u8BBE\u7F6E\u5206\u503C",open:t,width:640,centered:!0,zIndex:10,className:I.scoremodal,onCancel:()=>{e(!1)},onOk:()=>{var g,i,d;if(l!=null&&l.use_blank_score&&((d=(i=(g=l==null?void 0:l.exercise_question_types)==null?void 0:g.filter(C=>C.name==="\u586B\u7A7A\u9898"))==null?void 0:i[0])!=null&&d.Singlequestion)){a(!0);return}o(),e(!1)}},Ze.createElement("div",{className:"c-black"},"\u603B\u5206",Ze.createElement("span",{className:"ml10 c-light-primary"},(l==null?void 0:l.exercise_question_types.length)>0&&((_=l==null?void 0:l.exercise_types)==null?void 0:_.q_scores))),Ze.createElement("div",{className:I.content},Ze.createElement("span",null,"\u9898\u578B\u540D\u79F0"),Ze.createElement("span",null,"\u5C0F\u9898\u603B\u6570"),Ze.createElement("span",null,"\u9898\u578B\u603B\u5206"),Ze.createElement("span",null,"\u64CD\u4F5C")),(w=(x=l==null?void 0:l.exercise_question_types)==null?void 0:x.filter(g=>g.name!=="\u5B9E\u8BAD\u9898"&&g.name!=="\u7EC4\u5408\u9898"))==null?void 0:w.map((g,i)=>{var d;return Ze.createElement("div",{key:i,className:I.items},Ze.createElement("span",null,g==null?void 0:g.name),Ze.createElement("span",null,(d=g==null?void 0:g.items)==null?void 0:d.length),Ze.createElement("span",null,g==null?void 0:g.score),Ze.createElement("span",null,"\u6BCF\u9898",Ze.createElement(we.Z,{min:.1,precision:1,max:100,onChange:C=>{g.Singlequestion=C},defaultValue:g.Singlequestion,style:{width:90,height:38,margin:"0px 10px",display:"flex",alignItems:"center"}}),"\u5206"))})),Ze.createElement(k.default,{title:!1,footer:!1,centered:!0,open:p,zIndex:20,width:640,closable:!1,className:I.scoremodal},Ze.createElement("div",{style:{marginTop:40}},"\u586B\u7A7A\u9898\u4E2D\u5B58\u5728",Ze.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"),Ze.createElement("div",{className:I.bottom},Ze.createElement(Ne.ZP,{className:I.no,onClick:()=>{a(!1)}},"\u53D6\u6D88"),Ze.createElement(Ne.ZP,{className:I.yes,onClick:()=>{o(),a(!1),e(!1)}},"\u786E\u8BA4"))))},Pa=E(97964),ka=E(84223),Sa=E(96486),Oa=E(93671),Wn=E(38478),Za=E(20670),F=E(67294),Ia=Object.defineProperty,ja=Object.defineProperties,Ta=Object.getOwnPropertyDescriptors,zn=Object.getOwnPropertySymbols,Qa=Object.prototype.hasOwnProperty,$a=Object.prototype.propertyIsEnumerable,Hn=(e,t,l)=>t in e?Ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,lt=(e,t)=>{for(var l in t||(t={}))Qa.call(t,l)&&Hn(e,l,t[l]);if(zn)for(var l of zn(t))$a.call(t,l)&&Hn(e,l,t[l]);return e},Ot=(e,t)=>ja(e,Ta(t)),Ae=(e,t,l)=>new Promise((u,_)=>{var x=a=>{try{p(l.next(a))}catch(o){_(o)}},w=a=>{try{p(l.throw(a))}catch(o){_(o)}},p=a=>a.done?u(a.value):Promise.resolve(a.value).then(x,w);p((l=l.apply(e,t)).next())});const ul=[{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:_})=>{var x,w,p,a,o,g,i,d,C,S,v,O;const[c,V]=(0,n.useState)(),[ce,m]=(0,n.useState)(!1),[r,J]=(0,n.useState)(),[le,ee]=(0,n.useState)(),oe=(0,n.useRef)(),G=(0,n.useRef)(),[h,te]=(0,n.useState)(),[he,ge]=(0,n.useState)(!1),[me,ne]=(0,n.useState)(!1),[pe,ke]=(0,n.useState)(),[W,ue]=(0,n.useState)(!1),[ve,Fe]=(0,n.useState)(!1),[Ge,Xe]=(0,n.useState)(!1),[nt,dt]=(0,n.useState)(!1),[Zt,fl]=(0,n.useState)(!1),[Ml,mn]=(0,n.useState)(!1),[Ei,fi]=(0,n.useState)(!1),[Ka,Kn]=(0,n.useState)(!1),[yl]=A.default.useForm(),[qa,Wl]=(0,n.useState)(!1),ei=(0,n.useRef)(null),[$e]=(0,de.useSearchParams)(),[zl,Hl]=(0,n.useState)(!1),qn=$e.get("isIntelligentAssistant"),[It,pn]=(0,n.useState)(!1);(0,n.useEffect)(()=>{Ue(),t({type:"globalSetting/footerToggle",payload:!1})},[]),(0,n.useEffect)(()=>{_(me)},[me]),(0,n.useEffect)(()=>{r!=null&&r.question_id&&(ee(r==null?void 0:r.question_score),G.current=r==null?void 0:r.question_id)},[r]);const Rt=B=>Ae(void 0,null,function*(){let Z=yield t({type:"newExercisePaper/getTagDiscipline",payload:{sub_discipline_id:B}});ke(Z)});function Ue(){return Ae(this,null,function*(){var B,Z,z,X,ae,Ce;ge(!0),m(!0);const se=yield t({type:"newExercisePaper/editExercise",payload:{id:l}});ge(!1),m(!1),V(se),(B=se==null?void 0:se.exercise)!=null&&B.sub_discipline_id&&Rt((Z=se==null?void 0:se.exercise)==null?void 0:Z.sub_discipline_id),J(Ot(lt({},(ae=(X=(z=se==null?void 0:se.exercise_question_types)==null?void 0:z[0])==null?void 0:X.items)==null?void 0:ae[0]),{index:1})),te(Ot(lt({},(Ce=se==null?void 0:se.exercise_question_types)==null?void 0:Ce[0]),{indexs:1}))})}function Ut(B,Z=!0){return Ae(this,null,function*(){var z,X,ae,Ce;Z&&(ge(!0),m(!0));const se=yield t({type:"newExercisePaper/editExercise",payload:{id:l}});V(se);let ut=[];(z=se==null?void 0:se.exercise_question_types)==null||z.map(ct=>{var Yt;(Yt=ct==null?void 0:ct.items)==null||Yt.map((Gl,Ul)=>{ut.push(Ot(lt({},Gl),{index:Ul+1}))})});let Lt=(X=ut.filter(ct=>ct.question_id===(B==null?void 0:B.id)))==null?void 0:X[0],Jl=(Ce=((ae=se==null?void 0:se.exercise_question_types)==null?void 0:ae.map((ct,Yt)=>{if((Lt==null?void 0:Lt.question_type)===(ct==null?void 0:ct.question_type))return Ot(lt({},ct),{indexs:Yt+1})})).filter(ct=>ct))==null?void 0:Ce[0];te(lt({},Jl)),J(lt({},Lt)),ee(Lt==null?void 0:Lt.question_score),ge(!1),m(!1)})}function Xt(B){return Ae(this,null,function*(){var Z;let z=Ot(lt({},B),{difficulty:(B==null?void 0:B.difficulty)||2,item_type:B.question_type,sub_discipline_id:((Z=B==null?void 0:B.sub_discipline_id)==null?void 0:Z[1])||"",tag_discipline_ids:[],repeat_answer:!B.repeat_answer}),X={};B.question_type===8&&(X=Ot(lt({},B),{hack:Ot(lt({},B==null?void 0:B.hack),{difficult:B.difficulty}),hack_codes:Ot(lt({},B.hack_codes),{code:$l.Base64.encode(B.hack_codes.code)}),hack_sets:[lt({},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 ae=yield(0,Me.ZP)(`/api/examination_banks/${l}/examination_banks_item_banks/create_item_bank.json`,{method:"post",body:B.question_type===8?X:z});(ae==null?void 0:ae.status)===0&&(ne(!1),Ut(ae)),(0,Ct.Vf)("#question-scroll-id")})}function yi(B){return Ae(this,null,function*(){m(!0);let Z=yield(0,Me.ZP)(`/api/examination_banks/${l}/sort_question_type.json`,{method:"post",body:{question_type:B}});m(!1),(Z==null?void 0:Z.status)===0&&Ue()})}const ti=(B,Z,z)=>Ae(void 0,null,function*(){var X;if(B.length===0){ie.ZP.warning("\u8BF7\u4E0A\u4F20\u6587\u4EF6"),z();return}const ae=yield(0,Ye.Hb)(l,(X=B[0])==null?void 0:X.file,Z);ae.status===0&&(ie.ZP.success(`\u6210\u529F\u5BFC\u5165${ae==null?void 0:ae.success}\u6761`),ue(!1),Ue()),z()}),li=(B,Z)=>Ae(void 0,null,function*(){c.exercise_types.q_scores=Number(c.exercise_types.q_scores)+Number(B)-Number(Z==null?void 0:Z.question_score);const z=yield(0,Ye.kF)({score:(0,Sa.round)(B,1),question_id:Z==null?void 0:Z.question_id});if((z==null?void 0:z.status)===0){ie.ZP.success("\u4FEE\u6539\u6210\u529F"),Ut({id:G.current},!1);return}(z==null?void 0:z.status)===-1&&ee(Z==null?void 0:Z.question_score)});function Vt(){return Ae(this,null,function*(){k.default.confirm({title:"\u63D0\u793A",content:"\u786E\u5B9A\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",okText:"\u786E\u5B9A",centered:!0,className:I.modalconfirm,onOk:()=>Ae(this,null,function*(){if(r.question_id){let B=yield(0,Me.ZP)(`/api/examination_banks/${l}/examination_banks_item_banks/${r.question_id}.json`,{method:"delete"});(B==null?void 0:B.status)===0&&(Ue(),ne(!1))}else J({}),ne(!1),Ue()}),cancelText:"\u53D6\u6D88"})})}const ni=B=>Ae(void 0,null,function*(){return yield(0,Me.ZP)(`/api/examination_banks/${l}/examination_banks_item_banks.json`,{method:"post",body:lt({},B)})}),{overflow:ui,handleMouseEnter:ai,handleMouseLeave:ii}=(0,ka.I)(),eu=B=>Ae(void 0,null,function*(){var Z,z;m(!0);let X=yield(0,Me.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 ae=yield t({type:"newExercisePaper/editExercise",payload:{id:l}});V(ae),(Z=ae==null?void 0:ae.exercise)!=null&&Z.sub_discipline_id&&Rt((z=ae==null?void 0:ae.exercise)==null?void 0:z.sub_discipline_id)}}),gt=()=>me?(pn(!0),!0):!1;(0,n.useEffect)(()=>{if(It){const B=setTimeout(()=>{pn(!1)},2e3);return()=>clearTimeout(B)}},[It]);const oi=(B,Z)=>F.createElement(Re.default,null,F.createElement(Re.default.Item,{key:"0",onClick:()=>tu(B==null?void 0:B.question_type)},F.createElement("span",{className:I.moreSpan},"\u65B0\u589E")),F.createElement(Re.default.Item,{key:"1",disabled:Z===0,onClick:()=>Ae(void 0,null,function*(){if(Z===0||gt())return;let z=(0,Ct.rz)(c==null?void 0:c.exercise_question_types,Z,Z-1);yield eu(z.map(X=>X.name))})},F.createElement("span",{className:I.moreSpan},"\u4E0A\u79FB")),F.createElement(Re.default.Item,{key:"2",disabled:Z===(c==null?void 0:c.exercise_question_types.length)-1,onClick:()=>Ae(void 0,null,function*(){if(Z===(c==null?void 0:c.exercise_question_types.length)-1||gt())return;let z=(0,Ct.rz)(c==null?void 0:c.exercise_question_types,Z,Z+1);yield eu(z.map(X=>X.name))})},F.createElement("span",{className:I.moreSpan},"\u4E0B\u79FB")),F.createElement(Re.default.Item,{key:"3",onClick:()=>{var z;yl.setFieldsValue({name:B.name,item_type_en:(z=ul.find(X=>X.id==B.question_type))==null?void 0:z.nameType}),Wl(!0)}},F.createElement("span",{className:I.moreSpan},"\u91CD\u547D\u540D"))),tu=B=>{var Z,z,X,ae,Ce,se,ut,Lt,_n,Jl,ct,Yt,Gl,Ul,lu,nu,uu,au,iu,ou,su,ru,du,cu,mu,pu,_u,vu;if(!gt()){if(B===5){dt(!0),fl(!0);return}if(B===6){if($e.get("pageType")=="course")$e.get("updateType")=="course"?de.history.push(`/problems/newcreate?express_id=${(Z=c==null?void 0:c.exercise)==null?void 0:Z.id}&callback_url=/paperlibrary/add/${(z=c==null?void 0:c.exercise)==null?void 0:z.id}?type=2&pageType=course&updateType=course&courseId=${$e.get("courseId")}&stageId=${$e.get("stageId")}`):de.history.push(`/problems/newcreate?express_id=${(X=c==null?void 0:c.exercise)==null?void 0:X.id}&callback_url=/paperlibrary/add/${(ae=c==null?void 0:c.exercise)==null?void 0:ae.id}?type=2&pageType=course&courseId=${$e.get("courseId")}&stageId=${$e.get("stageId")}`);else{let ri=(se=(Ce=u==null?void 0:u.editData)==null?void 0:Ce.exercise)!=null&&se.set_question_sub_discipline?`/problems/newcreate?express_id=${(ut=c==null?void 0:c.exercise)==null?void 0:ut.id}&callback_url=${window.location.pathname+window.location.search}&discipline_id=${(_n=(Lt=u==null?void 0:u.editData)==null?void 0:Lt.exercise)==null?void 0:_n.discipline_id}&sub_discipline_id=${(ct=(Jl=u==null?void 0:u.editData)==null?void 0:Jl.exercise)==null?void 0:ct.sub_discipline_id}`:`/problems/newcreate?express_id=${(Yt=c==null?void 0:c.exercise)==null?void 0:Yt.id}&callback_url=${window.location.pathname+window.location.search}`;de.history.push(ri)}return}ne(!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:(Ul=(Gl=u==null?void 0:u.editData)==null?void 0:Gl.exercise)!=null&&Ul.set_question_sub_discipline?(nu=(lu=u==null?void 0:u.editData)==null?void 0:lu.exercise)==null?void 0:nu.discipline_id:0,sub_discipline_id:(au=(uu=u==null?void 0:u.editData)==null?void 0:uu.exercise)!=null&&au.set_question_sub_discipline?(ou=(iu=u==null?void 0:u.editData)==null?void 0:iu.exercise)==null?void 0:ou.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:(ru=(su=u==null?void 0:u.editData)==null?void 0:su.exercise)!=null&&ru.set_question_sub_discipline?(cu=(du=u==null?void 0:u.editData)==null?void 0:du.exercise)==null?void 0:cu.discipline_id:0,sub_discipline_id:(pu=(mu=u==null?void 0:u.editData)==null?void 0:mu.exercise)!=null&&pu.set_question_sub_discipline?(vu=(_u=u==null?void 0:u.editData)==null?void 0:_u.exercise)==null?void 0:vu.sub_discipline_id:0})}},si=[{key:1,label:"\u6279\u91CF\u5BFC\u5165",onClick:()=>{gt()||ue(!0)}},{key:2,label:F.createElement("div",null,F.createElement("img",{width:26,style:{position:"absolute",top:-2},src:Wn.$}),F.createElement("span",null,"\u667A\u80FD\u5BFC\u5165")),onClick:()=>{gt()||Fe(!0)}}];return F.createElement("div",null,F.createElement(mt.Z,{spinning:he},F.createElement("div",{className:I.bg},F.createElement("div",{style:{textAlign:"center"}},((x=c==null?void 0:c.exercise_types)==null?void 0:x.q_counts)===0&&!me&&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~")}),(((w=c==null?void 0:c.exercise_types)==null?void 0:w.q_counts)>0||me)&&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:I.left},F.createElement("div",{className:I.leftAction},F.createElement(Ne.ZP,{onClick:()=>{gt()||Xe(!0)},className:I.Button},"\u6279\u91CF\u8BBE\u7F6E\u5206\u503C")),F.createElement("div",{className:I.scrollWrapper,style:{overflow:ui},onMouseEnter:ai,onMouseLeave:ii},(p=c==null?void 0:c.exercise_question_types)==null?void 0:p.map((B,Z)=>F.createElement("div",{key:Z,className:"mb30"},F.createElement("div",{className:I.title},F.createElement("div",{className:I.titleleft},F.createElement("span",{style:{color:"#000000",fontWeight:400,fontSize:12}}," ",(0,Ct.EM)(Z+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(al.Z,{dropdownRender:()=>oi(B,Z),placement:"bottomLeft"},F.createElement("div",{className:I.more_style},F.createElement("i",{className:"iconfont icon-sandian font12"})))),F.createElement(en,{handleEditing:()=>{pn(!0)},isedit:me,setBigqitem:te,bigitem:Ot(lt({},B),{indexs:Z+1}),setqitem:z=>Ae(void 0,null,function*(){var X;(X=oe.current)==null||X.blur(),J(z)}),qitem:r,Itemid:l,getdata:Ut,data:B.items})))))),F.createElement("div",{id:"question-scroll-id",style:{overflow:me?"hidden":"auto"},className:I.right,ref:ei},!(r!=null&&r.isadd)&&F.createElement("div",{className:I.title},!me&&F.createElement("div",{style:{flex:1}},F.createElement("span",{style:{color:"#000000",fontWeight:600,fontSize:16}}," ",(h==null?void 0:h.indexs)&&(0,Ct.EM)(h==null?void 0:h.indexs),"\u3001\u3010",h==null?void 0:h.name,"\u3011"),F.createElement(Ee.Z,{title:"\u7F16\u8F91\u9898\u578B\u540D\u79F0"},F.createElement("i",{className:`${I.edit} iconfont icon-bianji_Hover mr5 ml5 font18`,onClick:()=>{var B;yl.setFieldsValue({name:h.name,item_type_en:(B=ul.find(Z=>Z.id==h.question_type))==null?void 0:B.nameType}),Wl(!0)}})),F.createElement("span",{style:{color:"#464F66",fontSize:16,fontWeight:400}},"\uFF08",h==null?void 0:h.count,"\u5C0F\u9898\uFF0C\u5171",h==null?void 0:h.score,"\u5206\uFF09"),(r==null?void 0:r.question_type)===6&&F.createElement("span",{onClick:()=>Hl(2),className:"current c-light-primary font14 bold-400"},"\u6279\u91CF\u8BBE\u7F6E\u7F16\u7A0B\u8BED\u8A00"),(r==null?void 0:r.question_type)===5&&F.createElement(Kt.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=>Ae(void 0,null,function*(){let Z=yield(0,Me.ZP)(`/api/examination_banks/${l}/update_show_columns.json`,{method:"post",body:{show_challenge_task_pass:B.target.checked}});(Z==null?void 0:Z.status)===0&&(ie.ZP.info("\u8BBE\u7F6E\u6210\u529F"),Ut({id:G.current}))}),style:{marginTop:20,marginBottom:20}},"\u5C55\u793A\u5173\u5361\u63CF\u8FF0"),(r==null?void 0:r.question_type)===6&&F.createElement("span",{style:{marginLeft:20},onClick:()=>{var B,Z,z,X;k.default.confirm({title:"\u7F16\u7A0B\u9898\u8BBE\u7F6E",icon:null,centered:!0,closable:!0,footer:null,content:F.createElement("div",null,(r==null?void 0:r.question_type)===6&&F.createElement(Kt.default,{defaultChecked:(Z=(B=u==null?void 0:u.editData)==null?void 0:B.exercise)==null?void 0:Z.show_hack_sets,onChange:ae=>Ae(void 0,null,function*(){let Ce=yield(0,Me.ZP)(`/api/examination_banks/${l}/update_show_columns.json`,{method:"post",body:{show_hack_sets:ae.target.checked}});(Ce==null?void 0:Ce.status)===0&&(ie.ZP.info("\u8BBE\u7F6E\u6210\u529F"),k.default.destroyAll(),Ut({id:G.current}))}),style:{marginTop:20,marginBottom:20}},"\u5C55\u793A\u6D4B\u8BD5\u7528\u4F8B"),F.createElement("br",null),(r==null?void 0:r.question_type)===6&&F.createElement(Kt.default,{defaultChecked:(X=(z=u==null?void 0:u.editData)==null?void 0:z.exercise)==null?void 0:X.show_hack_description,onChange:ae=>Ae(void 0,null,function*(){let Ce=yield(0,Me.ZP)(`/api/examination_banks/${l}/update_show_columns.json`,{method:"post",body:{show_hack_description:ae.target.checked}});(Ce==null?void 0:Ce.status)===0&&(ie.ZP.info("\u8BBE\u7F6E\u6210\u529F"),k.default.destroyAll(),Ut({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"}},(r==null?void 0:r.question_type)===5&&!me&&F.createElement("a",{className:I.shixun,href:`/shixuns/${r==null?void 0:r.shixun_identifier}/challenges?exercise=true`,target:"_blank"},F.createElement("i",{onClick:()=>{},style:{marginRight:20},className:"iconfont icon-shixunkecheng mr5 "}),"\u5B9E\u8BAD\u8BE6\u60C5"),!me&&[0,1,2,4,6].includes(r==null?void 0:r.question_type)&&F.createElement(A.default.Item,{label:"\u5206\u503C",style:{margin:"0 20px"},required:!0},F.createElement(we.Z,{precision:1,ref:oe,onChange:B=>ee(B),value:le,onBlur:B=>{li(B.target.value,r)}})),!me&&F.createElement(Ee.Z,{title:"\u5220\u9664"},F.createElement("i",{onClick:()=>{Vt()},style:{marginRight:20},className:`${I.delete} iconfont icon-shanchu13 mr5 `})),!me&&F.createElement(Ee.Z,{title:"\u7F16\u8F91\u8BD5\u9898"},F.createElement("i",{onClick:()=>{var B,Z,z;(r==null?void 0:r.question_type)===6?$e.get("pageType")=="course"?$e.get("updateType")=="course"?de.history.push(`/problems/newedit/${r==null?void 0:r.hack_identifier}?type=exercises&express_id=${(B=c==null?void 0:c.exercise)==null?void 0:B.id}&question_id=${r==null?void 0:r.question_id}&score=${r==null?void 0:r.question_score}&exercise=true&callback_url=${location.pathname}?type=2&pageType=course&updateType=course&courseId=${$e.get("courseId")}&stageId=${$e.get("stageId")}`):de.history.push(`/problems/newedit/${r==null?void 0:r.hack_identifier}?type=exercises&express_id=${(Z=c==null?void 0:c.exercise)==null?void 0:Z.id}&question_id=${r==null?void 0:r.question_id}&score=${r==null?void 0:r.question_score}&exercise=true&callback_url=${location.pathname}?type=2&pageType=course&courseId=${$e.get("courseId")}&stageId=${$e.get("stageId")}`):de.history.push(`/problems/newedit/${r==null?void 0:r.hack_identifier}?type=exercises&express_id=${(z=c==null?void 0:c.exercise)==null?void 0:z.id}&question_id=${r==null?void 0:r.question_id}&score=${r==null?void 0:r.question_score}&exercise=true&callback_url=${window.location.pathname+window.location.search}`):ne(!0)},className:`${I.edit} iconfont icon-bianji_Hover mr5 `})))),!me&&F.createElement("div",null,F.createElement("div",{className:I.qcount},F.createElement("span",{className:I.score},r==null?void 0:r.question_score,"\u5206"),F.createElement(We.Z,{className:I.qtitle,value:(r==null?void 0:r.index)+`\u3001${(r==null?void 0:r.question_type)==8?(g=r==null?void 0:r.program_attr)==null?void 0:g.description:r==null?void 0:r.question_title}`}),(r==null?void 0:r.high_resources_consume)&&F.createElement(Za.Z,{type:"shixun",style:{marginLeft:10}})),(r==null?void 0:r.question_type)===6&&F.createElement(Bl.Z,{onEdit:()=>Hl(1),className:"mt10",dataSource:(r==null?void 0:r.languages)||[]}),F.createElement(ya,{newExercisePaper:u,TagDiscipline:pe,qitem:r})),me&&F.createElement("div",null,(r==null?void 0:r.question_type)<=1&&F.createElement(At,{getTagData:Rt,deleteitem:Vt,seveeditor:Xt,exerciseitem:c,TagDiscipline:pe,setisedit:ne,qitem:r,init:Ue,showTip:It}),(r==null?void 0:r.question_type)===5&&F.createElement(_a,{setqitem:J,deleteitem:Vt,seveeditor:Xt,exerciseitem:c,TagDiscipline:pe,setisedit:ne,qitem:r,showTip:It}),(r==null?void 0:r.question_type)===3&&F.createElement(dl,{getTagData:Rt,deleteitem:Vt,seveeditor:Xt,exerciseitem:c,TagDiscipline:pe,setisedit:ne,qitem:r,init:Ue,showTip:It}),(r==null?void 0:r.question_type)===2&&F.createElement(vn,{getTagData:Rt,deleteitem:Vt,seveeditor:Xt,exerciseitem:c,TagDiscipline:pe,setisedit:ne,qitem:r,init:Ue,showTip:It}),(r==null?void 0:r.question_type)===4&&F.createElement(Aa,{getTagData:Rt,deleteitem:Vt,seveeditor:Xt,exerciseitem:c,TagDiscipline:pe,setisedit:ne,qitem:r,init:Ue,showTip:It}),(r==null?void 0:r.question_type)===7&&F.createElement(ea,{getTagData:Rt,deleteitem:Vt,seveeditor:Xt,exerciseitem:c,TagDiscipline:pe,setisedit:ne,qitem:r,init:Ue,showTip:It}),(r==null?void 0:r.question_type)===8&&F.createElement(sa,{getTagData:Rt,deleteitem:Vt,seveeditor:Xt,exerciseitem:c,TagDiscipline:pe,setisedit:ne,qitem:r,init:Ue,showTip:It}))))))),F.createElement("div",{className:I.bottomdiv},F.createElement("div",{style:{width:1200,margin:"0px auto",display:"flex",justifyContent:"space-between",alignItems:"center"}},F.createElement("span",{className:I.spanBtn,onClick:()=>{gt()||(dt(!0),fl(!1))}},"\u9898\u5E93\u9009\u9898"),F.createElement(al.Z,{menu:{items:si}},F.createElement("span",{className:I.spanBtn},"\u5BFC\u5165\u8BD5\u9898")),F.createElement("span",{className:I.spanBtn,onClick:()=>Ae(void 0,null,function*(){var B;if(gt())return;const Z=yield(0,Ye.JP)(l);Z.status===0&&window.open(`/classrooms/coursesId/exercise/${Z.exercise_id}/${(B=e.userInfo)==null?void 0:B.login}/initate_answer`)})},"\u6A21\u62DF\u8003\u8BD5"),F.createElement("span",{className:I.spanBtn,onClick:()=>{if(!gt()){if(qn){window.open(`/paperlibrary/see/${l}?isIntelligentAssistant=true`);return}window.open(`/paperlibrary/see/${l}`)}}},"\u8BD5\u5377\u9884\u89C8"),ul==null?void 0:ul.map((B,Z)=>F.createElement(Ne.ZP,{key:Z,className:I.addQuestionBtn,type:"primary",onClick:()=>{tu(B.id)}},B.name)),F.createElement(Ne.ZP,{className:I.saveBtn,loading:Ka,onClick:()=>Ae(void 0,null,function*(){var B,Z;const z=Number(c.exercise_types.q_scores);[100,120,150].includes(z)||(yield new Promise((se,ut)=>{k.default.confirm({centered:!0,icon:null,okText:"\u4FDD\u5B58",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:F.createElement("div",{className:"c-grey-333"},"\u5F53\u524D\u8BD5\u5377\u603B\u5206\u4E3A",F.createElement("span",{style:{color:"#FA6400",margin:"0 5px"}},z),"\u5206\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u8FDB\u884C\u4FDD\u5B58\uFF1F"),onOk:()=>Ae(void 0,null,function*(){se("")}),onCancel:()=>{ut()}})}));const X=()=>Ae(void 0,null,function*(){if($e.get("pageType")=="course")if($e.get("updateType")=="course")ie.ZP.info("\u7F16\u8F91\u6210\u529F"),de.history.replace(`/paths/${$e.get("courseId")}`);else{if(gt())return;(0,Oa._C)({id:$e.get("stageId"),subject_id:$e.get("courseId"),homework_type:"exercise",examination_bank_ids:[l]}).then(se=>{(se==null?void 0:se.status)==0&&(ie.ZP.info("\u521B\u5EFA\u6210\u529F"),de.history.replace(`/paths/${$e.get("courseId")}`))})}else{if(gt())return;if(qn){Kn(!0);const se=yield(0,Me.ZP)("/api/intelligent_imports/save_recognize_papers.json",{method:"post",body:{examination_bank_id:l}});if(Kn(!1),(se==null?void 0:se.status)!==0)return}ie.ZP.info("\u4FDD\u5B58\u6210\u529F"),de.history.push("/paperlibrary?defaultActiveKey=0")}});let ae=(Z=(B=c==null?void 0:c.exercise_question_types)==null?void 0:B.filter(se=>se.question_type===5)[0])==null?void 0:Z.items,Ce=0;ae==null||ae.map(se=>{se.high_resources_consume&&(Ce=Ce+1)}),console.log(Ce),Ce>0?t({type:"classroomList/setActionTabs",payload:{key:"\u6388\u6743\u63D0\u793A",count:Ce,fn:()=>{X()}}}):X()})},F.createElement("i",{className:"iconfont icon-baocun1",style:{fontSize:15,marginRight:5}}),"\u4FDD\u5B58\u8BD5\u5377"))),F.createElement(Na,{setScoreShow:Xe,ScoreShow:Ge,exerciseitem:c,getdata:Ue}),nt&&F.createElement(Pa.Z,{setScoreShow:dt,isshixuns:Zt,ScoreShow:nt,isloadings:Ml,onOk:(B,Z,z,X)=>Ae(void 0,null,function*(){mn(!0);let Ce=yield ni({exam_id:l,item_bank_ids:B,shixun_ids:Z});mn(!1),(Ce==null?void 0:Ce.status)===0&&k.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:()=>{Ue()},onCancel:()=>{dt(!1),Ue()}})})}),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,(C=c==null?void 0:c.exercise)==null?void 0:C.sub_discipline_id]:[],visible:W,onCancel:()=>ue(!1),onOk:ti}),F.createElement(k.default,{centered:!0,title:"\u7F16\u8F91\u9898\u578B\u540D\u79F0",open:qa,width:500,onOk:()=>yl.submit(),onCancel:()=>Wl(!1)},F.createElement(A.default,{form:yl,initialValues:{},onFinish:B=>Ae(void 0,null,function*(){(yield(0,Ye.RK)(lt({id:l},B))).status==0&&(ie.ZP.success("\u4FEE\u6539\u6210\u529F"),Ue(),Wl(!1))})},F.createElement(A.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,Z){var z,X,ae,Ce;const se=(z=ul==null?void 0:ul.find(ut=>ut.nameType==yl.getFieldValue("item_type_en")))==null?void 0:z.id;return(Ce=(ae=(X=c==null?void 0:c.exercise_question_types)==null?void 0:X.filter(ut=>ut.question_type!=se))==null?void 0:ae.map(ut=>ut==null?void 0:ut.name))!=null&&Ce.includes(Z)?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(bt.default,{size:"large",maxLength:10,showCount:!0})),F.createElement(A.default.Item,{hidden:!0,name:"item_type_en"},F.createElement(bt.default,{size:"large"})))),F.createElement(qt.Z,{placement:"bottom",height:"100%",destroyOnClose:!0,closable:!1,className:"body-overflow-hidden",open:ve},F.createElement("div",{style:{margin:"8px auto 24px auto",width:1200,fontWeight:600},className:"c-black font18"},"\u667A\u80FD\u5BFC\u5165"),F.createElement(Wn.Z,{stickyTop:-24,subDisciplineId:(S=c==null?void 0:c.exercise)!=null&&S.sub_discipline_id?[(v=c==null?void 0:c.exercise)==null?void 0:v.discipline_id,(O=c==null?void 0:c.exercise)==null?void 0:O.sub_discipline_id]:[],onCancel:()=>Fe(!1),mode:2,gather:{exam_id:l},onSuccess:()=>{Fe(!1),Ue()}}),F.createElement("div",{style:{height:70}})),F.createElement(Bl.Q,{visible:!!zl,setVisible:Hl,tip:zl===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:zl===1?r==null?void 0:r.languages:[],onOk:B=>Ae(void 0,null,function*(){const Z={languages:B};zl===1?Z.hack_id=r==null?void 0:r.hack_id:Z.exam_id=l,(yield(0,Me.ZP)("/api/problems/update_languages.json",{method:"post",body:Z})).status===0&&(ie.ZP.success("\u4FEE\u6539\u6210\u529F"),Ut({id:G.current}),Hl(!1))})}))};var Va=(0,de.connect)(({user:e,newExercisePaper:t,dispatch:l})=>({user:e,newExercisePaper:t,dispatch:l}))(Ra),Jn=E(65213),La=E(50637),Ma=E(99640),T=E(67294),Wa=Object.defineProperty,za=Object.defineProperties,Ha=Object.getOwnPropertyDescriptors,Gn=Object.getOwnPropertySymbols,Ja=Object.prototype.hasOwnProperty,Ga=Object.prototype.propertyIsEnumerable,Un=(e,t,l)=>t in e?Wa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,Xn=(e,t)=>{for(var l in t||(t={}))Ja.call(t,l)&&Un(e,l,t[l]);if(Gn)for(var l of Gn(t))Ga.call(t,l)&&Un(e,l,t[l]);return e},Ua=(e,t)=>za(e,Ha(t)),Ll=(e,t,l)=>new Promise((u,_)=>{var x=a=>{try{p(l.next(a))}catch(o){_(o)}},w=a=>{try{p(l.throw(a))}catch(o){_(o)}},p=a=>a.done?u(a.value):Promise.resolve(a.value).then(x,w);p((l=l.apply(e,t)).next())});const Yn=()=>{const[e,t]=(0,n.useState)([]);return(0,n.useEffect)(()=>{Ll(void 0,null,function*(){const u=yield(0,Ye.d1)({source:"question"});u!=null&&u.disciplines&&t((0,Se.L)(u==null?void 0:u.disciplines))})},[]),e},Xa=({user:e,newExercisePaper:t,dispatch:l})=>{var u,_,x,w,p,a,o,g,i,d,C,S;const v=(0,de.useParams)(),O=Yn(),[c]=A.default.useForm(),[V,ce]=(0,n.useState)(),[m,r]=(0,n.useState)(!1),[J,le]=(0,n.useState)(1),[ee,oe]=(0,n.useState)(""),[G]=(0,de.useSearchParams)(),[h,te]=(0,n.useState)(!1),[he,ge]=(0,n.useState)(!1),[me,ne]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{G.get("type")==="2"&&(oe(v.id),le(2))},[G.get("type")]),(0,n.useEffect)(()=>{if(v.id){if(!O.length)return;Ll(void 0,null,function*(){var ke,W,ue;r(!0);const ve=yield(0,Ye.Di)({id:v.id});r(!1);const Fe=(ke=ve==null?void 0:ve.exercise)==null?void 0:ke.sub_discipline_id;let Ge=[];for(const dt of O)for(const Zt of dt.children)Zt.value===Fe&&(Ge=[dt.value,Zt.value]);const Xe=(W=ve==null?void 0:ve.exercise)==null?void 0:W.time,nt=Ua(Xn({},ve.exercise),{sub_discipline_id:Ge,time:Xe===-1?null:Xe});ce(nt),ne((ue=ve.exercise)==null?void 0:ue.set_question_sub_discipline)})}else ce({time:60,difficulty:2});l({type:"globalSetting/footerToggle",payload:!1})},[O]),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(Mt.Z,{separator:">"},T.createElement(Mt.Z.Item,null,T.createElement(de.Link,{to:"/paperlibrary"},"\u8BD5\u5377\u5E93")),T.createElement(Mt.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(h){ie.ZP.info("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u8BD5\u9898\u3002");return}le(1)},className:J===1?xe.Z.selectdiv:xe.Z.divitem},T.createElement(Jn.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(!v.id&&!ee){ie.ZP.info("\u8BF7\u5148\u4FDD\u5B58\u57FA\u7840\u4FE1\u606F\u518D\u65B0\u5EFA\u8BD5\u9898");return}le(2),!ee&&oe(v.id)},className:J!==1?xe.Z.selectdiv:xe.Z.divitem},T.createElement(Jn.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:(_=(u=t==null?void 0:t.editData)==null?void 0:u.exercise)==null?void 0:_.exercise_name,onFinish:pe=>Ll(void 0,null,function*(){var ke,W,ue,ve,Fe,Ge,Xe,nt,dt,Zt,fl,Ml;return pe.trim()===((W=(ke=t==null?void 0:t.editData)==null?void 0:ke.exercise)==null?void 0:W.exercise_name)?!0:(yield(0,Ye.w0)({id:`${(ve=(ue=t==null?void 0:t.editData)==null?void 0:ue.exercise)==null?void 0:ve.id}`,sub_discipline_id:(Ge=(Fe=t==null?void 0:t.editData)==null?void 0:Fe.exercise)==null?void 0:Ge.sub_discipline_id,time:`${(nt=(Xe=t==null?void 0:t.editData)==null?void 0:Xe.exercise)==null?void 0:nt.time}`,exercise_name:pe,exercise_description:(Zt=(dt=t==null?void 0:t.editData)==null?void 0:dt.exercise)==null?void 0:Zt.exercise_description,difficulty:(Ml=(fl=t==null?void 0:t.editData)==null?void 0:fl.exercise)==null?void 0:Ml.difficulty})).status===0?(c.setFieldValue("exercise_name",pe),l({type:"newExercisePaper/modifyTitle",payload:pe}),!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}},(w=(x=t==null?void 0:t.editData)==null?void 0:x.exercise)==null?void 0:w.time)),T.createElement("span",{style:{margin:"0px 30px",color:"#5F6368"}},"\u96BE\u5EA6",T.createElement("span",{style:{color:"#000000",marginLeft:8}},((a=(p=t==null?void 0:t.editData)==null?void 0:p.exercise)==null?void 0:a.difficulty)===1?"\u7B80\u5355":((g=(o=t==null?void 0:t.editData)==null?void 0:o.exercise)==null?void 0:g.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}},(S=(C=t==null?void 0:t.editData)==null?void 0:C.exercise_types)==null?void 0:S.q_scores))))),J===1&&T.createElement(mt.Z,{spinning:m,size:"middle",style:{position:"fixed",maxHeight:"100vh"},className:"mt30"},T.createElement("section",{className:[xe.Z.bg,"mt20"].join(" "),style:{padding:"30px 120px 300px 120px"}},V&&T.createElement(A.default,{layout:"horizontal",form:c,colon:!1,labelCol:{span:4},wrapperCol:{span:20},className:xe.Z.formWrap,initialValues:V},T.createElement(A.default.Item,{name:"exercise_name",label:"\u8BD5\u5377\u540D\u79F0",className:xe.Z.baseLineHeight,rules:[{required:!0,validator:(pe,ke)=>{var W;return((W=ke==null?void 0:ke.replaceAll(" ",""))==null?void 0:W.length)>0?Promise.resolve():Promise.reject("\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0")}}]},T.createElement(bt.default,{maxLength:60,className:xe.Z.baseFormItem,placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0",showCount:!0})),T.createElement(A.default.Item,{label:"\u65B9\u5411&\u8BFE\u7A0B",name:"sub_discipline_id",className:xe.Z.baseLineHeight},T.createElement(gl.Z,{className:xe.Z.baseFormItem,allowClear:!0,placeholder:"\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B",options:O,popupClassName:xe.Z.cascaderPopup,dropdownMenuColumnStyle:{padding:"8px 12px",fontSize:14}})),T.createElement("div",{className:xe.Z.concat},T.createElement("div",null,T.createElement(Kt.default,{checked:me,onChange:pe=>{ne(pe.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:()=>ge(!0)},"\u8054\u7CFB\u6559\u7814\u52A9\u7406"))),T.createElement(A.default.Item,{label:"\u96BE\u5EA6",name:"difficulty",className:xe.Z.radioBtnWrapper,rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},T.createElement(pt.ZP.Group,{className:xe.Z.radiogroup},T.createElement(pt.ZP.Button,{className:xe.Z.easy,value:1},"\u7B80\u5355"),T.createElement(pt.ZP.Button,{className:xe.Z.medium,value:2},"\u9002\u4E2D"),T.createElement(pt.ZP.Button,{className:xe.Z.hard,value:3},"\u56F0\u96BE"))),T.createElement(A.default.Item,{label:"\u7B54\u9898\u65F6\u957F",className:xe.Z.baseLineHeight},T.createElement("div",{style:{display:"flex",width:"100%"}},T.createElement(A.default.Item,{name:"time",noStyle:!0},T.createElement(we.Z,{min:1,className:xe.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(A.default.Item,{label:"\u8BD5\u5377\u987B\u77E5",name:"exercise_description"},T.createElement(bt.default.TextArea,{rows:6,maxLength:65535,placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u987B\u77E5"})))),T.createElement("div",{className:xe.Z.bottmodiv},T.createElement(Ne.ZP,{className:`${xe.Z.cancelBtn} mr5`,type:"primary",onClick:()=>{G.get("pageType")=="course"?de.history.push(`/paths/${G.get("courseId")}`):de.history.push("/paperlibrary")}},"\u53D6\u6D88"),T.createElement(Xl.Z,{className:`${xe.Z.confirmBtn} ml15`,type:"primary",onClick:()=>Ll(void 0,null,function*(){var pe,ke,W,ue;yield c.validateFields();const ve=c.getFieldsValue();if(ve.sub_discipline_id=((pe=ve.sub_discipline_id)==null?void 0:pe.length)>0?ve.sub_discipline_id[1]:"",ve.set_question_sub_discipline=me,v.id){(yield(0,Ye.w0)(Xn({id:v.id},ve))).status===0&&(oe(v.id),le(2),de.history.replace(`/paperlibrary/add/${v.id}?type=2`));return}const Fe=yield(0,Ye.un)(ve);Fe.status===0&&(oe((ke=Fe==null?void 0:Fe.data)==null?void 0:ke.exam_id),le(2),G.get("pageType")=="course"?de.history.replace(`/paperlibrary/add/${(W=Fe==null?void 0:Fe.data)==null?void 0:W.exam_id}?type=2&pageType=course&courseId=${G.get("courseId")}&stageId=${G.get("stageId")}`):de.history.replace(`/paperlibrary/add/${(ue=Fe==null?void 0:Fe.data)==null?void 0:ue.exam_id}?type=2`))})},"\u4E0B\u4E00\u6B65"))),J===2&&T.createElement("div",null,T.createElement(Va,{setisedits:te,itemid:ee}))),T.createElement(Ma.Z,{open:he,onCancel:()=>{ge(!1)}}))};var Ya=(0,de.connect)(({user:e,newExercisePaper:t,dispatch:l})=>({user:e,newExercisePaper:t,dispatch:l}))(Xa)},97964:function(Eu,hl,E){E.d(hl,{Z:function(){return Pe}});var n=E(67294),de=E(91773),A=E(2453),Mt=E(62844),ie=E(55238),mt=E(88044),bt=E(38089),gl=E(60024),Kt=E(28802),pt=E(57399),we=E(83062),Ne=E(14845),xe=E(85804),Ye=E(33170),Se={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"},Xl=E(53430),k={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"},Re=E(65226),al=E(28706),Ee=E(19575);const qt=["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 Ct=({qitem:b})=>{var fe,ye,Dt,Ft,q,Ve,ft,Oe,Y,ol;return n.createElement("div",{className:k.warp},n.createElement("div",{className:k.mainPart},n.createElement("div",{className:k.qcount},(b==null?void 0:b.question_type)===8&&n.createElement(Re.Z,{className:k.content,showProgramFill:!0,value:(fe=b==null?void 0:b.program_attr)==null?void 0:fe.description}),(b==null?void 0:b.question_type)!=8&&n.createElement(Re.Z,{className:k.qtitle,value:(b==null?void 0:b.name)||(b==null?void 0:b.title)})),((b==null?void 0:b.question_type)===0||(b==null?void 0:b.question_type)===2)&&n.createElement("div",null,(ye=b==null?void 0:b.choices)==null?void 0:ye.map(($,at)=>n.createElement("div",{className:k.redio},!($!=null&&$.is_answer)&&n.createElement("span",{className:k.redioitem}),($==null?void 0:$.is_answer)&&n.createElement("i",{className:`${k.redioitemyes} icon-duigou1`}),n.createElement(Re.Z,{className:$!=null&&$.is_answer?k.titleyes:k.title,value:qt[at]+($==null?void 0:$.choice_text)}),($==null?void 0:$.is_answer)&&n.createElement("div",{className:k.yestag},"\u6B63\u786E\u7B54\u6848")))),(b==null?void 0:b.question_type)===1&&n.createElement("div",null,(Dt=b==null?void 0:b.choices)==null?void 0:Dt.map(($,at)=>n.createElement("div",{className:k.checkbox},!($!=null&&$.is_answer)&&n.createElement("span",{className:k.checkboxitem}),($==null?void 0:$.is_answer)&&n.createElement("i",{className:`${k.checkboxitemyes} icon-duigou1`}),n.createElement(Re.Z,{className:$!=null&&$.is_answer?k.titleyes:k.title,value:qt[at]+($==null?void 0:$.choice_text)}),($==null?void 0:$.is_answer)&&n.createElement("div",{className:k.yestag},"\u6B63\u786E\u7B54\u6848")))),(b==null?void 0:b.question_type)===3&&n.createElement("div",{className:k.completion},(Ft=b==null?void 0:b.standard_answer)==null?void 0:Ft.map(($,at)=>{var yt;return n.createElement("div",{style:{display:"flex"}},n.createElement("span",{className:k.title},"\u586B\u7A7A\u9879",at+1),n.createElement("div",{className:k.content},(yt=$==null?void 0:$.answer_text)==null?void 0:yt.map((P,it)=>n.createElement("div",{className:k.items},P))))})),(b==null?void 0:b.question_type)===4&&n.createElement("div",{className:k.simple},n.createElement("div",{className:k.title},"\u53C2\u8003\u7B54\u6848"),n.createElement("div",{className:"mt10",style:{fontSize:"16px"}},(q=b==null?void 0:b.answer_texts)!=null&&q[0]?n.createElement(Re.Z,{className:k.content,value:(Ve=b==null?void 0:b.answer_texts)==null?void 0:Ve[0]}):n.createElement("div",{style:{color:"#C1C1C1"}},"\u6682\u672A\u8BBE\u7F6E~"))),(b==null?void 0:b.question_type)===5&&((ft=b==null?void 0:b.challenge_names)==null?void 0:ft.map(($,at)=>n.createElement("div",{className:k.shixun},n.createElement("span",{className:k.qtitle},n.createElement("span",{style:{marginRight:10}},"\u7B2C",(0,al.EM)(at+1),"\u9898"),$)))),(b==null?void 0:b.question_type)===6&&n.createElement("div",{className:k.program},n.createElement(Re.Z,{className:k.content,value:((Oe=b==null?void 0:b.program_attr)==null?void 0:Oe.description)||"- -"})),(b==null?void 0:b.question_type)===7&&((Y=b==null?void 0:b.sub_item_banks)==null?void 0:Y.map(($,at)=>{var yt,P,it,zt,ot;return n.createElement("div",null,n.createElement("div",{className:k.combination},n.createElement("span",{className:k.qtitle},$==null?void 0:$.name)),n.createElement("div",{className:k.warp,style:{padding:"0px",paddingTop:20}},n.createElement("div",null,(($==null?void 0:$.item_type)=="SINGLE"||($==null?void 0:$.item_type)=="JUDGMENT")&&((yt=$==null?void 0:$.choices)==null?void 0:yt.map((K,Ke)=>n.createElement("div",{className:k.redio},!(K!=null&&K.is_answer)&&n.createElement("span",{className:k.redioitem}),(K==null?void 0:K.is_answer)&&n.createElement("i",{className:`${k.redioitemyes} icon-duigou1`}),n.createElement(Re.Z,{className:K!=null&&K.is_answer?k.titleyes:k.title,value:qt[Ke]+(K==null?void 0:K.choice_text)}),(K==null?void 0:K.is_answer)&&n.createElement("div",{className:k.yestag},"\u6B63\u786E\u7B54\u6848")))),($==null?void 0:$.item_type)=="MULTIPLE"&&((P=$==null?void 0:$.choices)==null?void 0:P.map((K,Ke)=>n.createElement("div",{className:k.checkbox},!(K!=null&&K.is_answer)&&n.createElement("span",{className:k.checkboxitem}),(K==null?void 0:K.is_answer)&&n.createElement("i",{className:`${k.checkboxitemyes} icon-duigou1`}),n.createElement(Re.Z,{className:K!=null&&K.is_answer?k.titleyes:k.title,value:qt[Ke]+(K==null?void 0:K.choice_text)}),(K==null?void 0:K.is_answer)&&n.createElement("div",{className:k.yestag},"\u6B63\u786E\u7B54\u6848")))),($==null?void 0:$.item_type)=="COMPLETION"&&n.createElement("div",{className:k.completion},(it=$==null?void 0:$.standard_answer)==null?void 0:it.map((K,Ke)=>{var Ie;return n.createElement("div",{style:{display:"flex"}},n.createElement("span",{className:k.title},"\u586B\u7A7A\u9879",Ke+1),n.createElement("div",{className:k.content},(Ie=K==null?void 0:K.answer_text)==null?void 0:Ie.map((At,st)=>n.createElement("div",{className:k.items},At))))})),($==null?void 0:$.item_type)=="SUBJECTIVE"&&n.createElement("div",{className:k.simple},n.createElement("div",{className:k.title},"\u53C2\u8003\u7B54\u6848"),n.createElement("div",{className:"mt10",style:{fontSize:"16px"}},(zt=$==null?void 0:$.answer_texts)!=null&&zt[0]?n.createElement(Re.Z,{className:k.content,value:(ot=$==null?void 0:$.answer_texts)==null?void 0:ot[0]}):n.createElement("div",{style:{color:"#C1C1C1"}},"\u6682\u672A\u8BBE\u7F6E~"))))))})),(b==null?void 0:b.question_type)===8&&n.createElement("div",null,n.createElement(Re.Z,{disabledFill:!0,className:k.content,showProgramFill:!0,value:Ee.Base64.decode(((ol=b==null?void 0:b.program_attr)==null?void 0:ol.code)||"")})),(b==null?void 0:b.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"}},(b==null?void 0:b.author_name)||"- -")),n.createElement("div",{style:{marginRight:30}},n.createElement("span",{style:{marginRight:10}},"\u6240\u5C5E\u5355\u4F4D"),n.createElement("span",{style:{color:"#000000"}},(b==null?void 0:b.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"}},(b==null?void 0:b.study_count)||"0"))),n.createElement("a",{className:k.shixunbutton,href:`/shixuns/${b==null?void 0:b.identifier}/challenges?exercise=true`,target:"_blank"},n.createElement("i",{onClick:()=>{},style:{marginRight:20},className:"iconfont icon-shixunkecheng mr5 "}),"\u5B9E\u8BAD\u8BE6\u60C5"))),((b==null?void 0:b.question_type)<=4||[6,8].includes(b==null?void 0:b.question_type))&&n.createElement("div",{className:k.bottom},n.createElement("div",{className:k.bottomitem},n.createElement("span",{className:k.left},"\u89E3\u6790"),n.createElement("span",{className:k.right},b!=null&&b.analysis?n.createElement(Re.Z,{value:b==null?void 0:b.analysis}):n.createElement("span",{style:{color:"#C1C1C1"}},"\u6682\u672A\u8BBE\u7F6E~"))),n.createElement("div",{className:k.bottomitem},n.createElement("span",{className:k.left},"\u96BE\u5EA6"),n.createElement("span",{className:k.right},(b==null?void 0:b.difficulty)===1?"\u7B80\u5355":(b==null?void 0:b.difficulty)===2?"\u9002\u4E2D":"\u56F0\u96BE")),n.createElement("div",{className:k.bottomitem},n.createElement("span",{className:k.left},"\u77E5\u8BC6\u70B9"),n.createElement("span",{className:k.right},b!=null&&b.tag_discipline?b==null?void 0:b.tag_discipline:n.createElement("span",{style:{color:"#C1C1C1"}},"\u6682\u672A\u8BBE\u7F6E~")))))},Me=E(36913),Fl=E(57971),Bl=E(35973),il=E(17663),We=E(20670),ze=E(38244),N=E(67294),Yl=Object.defineProperty,Kl=Object.defineProperties,bl=Object.getOwnPropertyDescriptors,Cl=Object.getOwnPropertySymbols,ql=Object.prototype.hasOwnProperty,xl=Object.prototype.propertyIsEnumerable,Wt=(b,fe,ye)=>fe in b?Yl(b,fe,{enumerable:!0,configurable:!0,writable:!0,value:ye}):b[fe]=ye,re=(b,fe)=>{for(var ye in fe||(fe={}))ql.call(fe,ye)&&Wt(b,ye,fe[ye]);if(Cl)for(var ye of Cl(fe))xl.call(fe,ye)&&Wt(b,ye,fe[ye]);return b},_t=(b,fe)=>Kl(b,bl(fe)),xt=(b,fe,ye)=>new Promise((Dt,Ft)=>{var q=Oe=>{try{ft(ye.next(Oe))}catch(Y){Ft(Y)}},Ve=Oe=>{try{ft(ye.throw(Oe))}catch(Y){Ft(Y)}},ft=Oe=>Oe.done?Dt(Oe.value):Promise.resolve(Oe.value).then(q,Ve);ft((ye=ye.apply(b,fe)).next())});const en=({setScoreShow:b,ScoreShow:fe,onOk:ye,isshixuns:Dt,isloadings:Ft,dispatch:q,isIntelligentAssistant:Ve=!1,ispptModal:ft=!1,isChangeQuestion:Oe=!1,newExercisePaper:Y,shixunsDetail:ol})=>{var $,at,yt;let[P,it]=(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:Ve,is_smart_plan:ft,group_id:[]}),[zt,ot]=(0,n.useState)([]),[K,Ke]=(0,n.useState)([]),[Ie,At]=(0,n.useState)([]),[st,wt]=(0,n.useState)([]);const[_e,jt]=(0,n.useState)(!1),[rt]=de.default.useForm(),[tn,Dl]=(0,n.useState)(),[ln,sl]=(0,n.useState)(!1);let[De,qe]=(0,n.useState)(Dt);const[et,el]=(0,n.useState)([]),[rl,dl]=(0,n.useState)(0),[nn,je]=(0,n.useState)(!0),[un,Al]=(0,n.useState)([]),[wl,Nl]=(0,n.useState)([]),Nt=[{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}],an=[{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:"\u7F16\u7A0B\u9898",value:"PROGRAM",question_type:6}];let[tt,Tt]=(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 Bt=(0,n.useRef)(new Set),Qt=(0,n.useRef)(new Set),tl=[{name:"\u7B80\u5355",value:1},{name:"\u9002\u4E2D",value:2},{name:"\u56F0\u96BE",value:3}],vn=[{name:"\u521D\u7EA7",value:1},{name:"\u4E2D\u7EA7",value:2},{name:"\u4E2D\u9AD8\u7EA7",value:3},{name:"\u9AD8\u7EA7",value:4}],Pl=[{name:"\u672A\u53D1\u5E03",value:"unpublish"},{name:"\u9759\u9ED8\u53D1\u5E03",value:"silent_publish"},{name:"\u516C\u5F00\u53D1\u5E03",value:"public_publish"}],[Q,Ht]=(0,n.useState)(!1),ll=()=>{rt.resetFields(),De=!1,qe(!1),Ht(!1),rt.submit()};(0,n.useEffect)(()=>{var s,f,j,R,H,Be,Te,U,ht,Qe;(((j=(f=(s=Y==null?void 0:Y.editData)==null?void 0:s.exercise)==null?void 0:f.exist_item_bank_ids)==null?void 0:j.length)>0||((Be=(H=(R=Y==null?void 0:Y.editData)==null?void 0:R.exercise)==null?void 0:H.exist_item_bank_shixun_ids)==null?void 0:Be.length)>0)&&Nl([...(U=(Te=Y==null?void 0:Y.editData)==null?void 0:Te.exercise)==null?void 0:U.exist_item_bank_ids,...(Qe=(ht=Y==null?void 0:Y.editData)==null?void 0:ht.exercise)==null?void 0:Qe.exist_item_bank_shixun_ids])},[(at=($=Y==null?void 0:Y.editData)==null?void 0:$.exercise)==null?void 0:at.exist_item_bank_ids]),(0,n.useEffect)(()=>{fe&&(rt.setFieldsValue({item_type:"",courseid:"",tag_discipline_id:null,difficulty:null,keyword:null}),nn&&De&&(rt.setFieldsValue({item_type:"SHIXUN"}),P.item_type="SHIXUN",it(re({},P)),je(!1)),Pt(P),kl(),cl({group_id:0,page:1,per_page:20,sort_by:"updated_at",sort_direction:"desc",type:"0"}))},[fe]),(0,n.useEffect)(()=>{rl>0&&setTimeout(()=>{dl(0)},2e3)},[rl]);function Pt(s){return xt(this,null,function*(){var f,j,R;if(jt(!0),it(re({},s)),(Ie==null?void 0:Ie.length)<=0&&s.type==="5"){wt([]),jt(!1);return}console.log("----",Ie,et);let H=s.type==="5"?Ie==null?void 0:Ie.filter(U=>!et.includes(U)):null,Be=s.type==="5"?Ie==null?void 0:Ie.filter(U=>et.includes(U)):null,Te=yield(0,Ye.ZP)("/api/item_banks.json",{method:"get",params:_t(re({},s),{discipline_id:((f=s==null?void 0:s.courseid)==null?void 0:f[0])||null,sub_discipline_id:((j=s==null?void 0:s.courseid)==null?void 0:j[1])||null,ids:H,shixun_ids:Be,include_shixuns:!Ve,group_id:((R=s.group_id)==null?void 0:R.map(U=>U==null?void 0:U.value))||null,keyword:s.keyword?encodeURIComponent(s.keyword):s.keyword,type:s.type==="5"?null:s.type,clazz:s.type==="3"?"ItemBanksGroup":null,bigmodel:Ve,is_smart_plan:ft})});wt(Te),jt(!1)})}function kl(){return xt(this,null,function*(){let s=yield(0,Ye.ZP)("/api/disciplines.json",{method:"get",params:{source:"question",group_id:0,group_type:P.type==="5"?null:P.type,clazz:"ItemBanksGroup"}});ot((0,Xl.L)(s==null?void 0:s.disciplines))})}function cl(s){return xt(this,null,function*(){var f;let j=yield(0,Ye.ZP)("/api/item_banks_groups/for_problemset.json",{method:"post",body:s}),R=[{title:"\u6839\u76EE\u5F55",id:0,pid:0,value:0,key:0,isLeaf:!1,children:(f=j==null?void 0:j.data)==null?void 0:f.map(H=>({title:H.name,id:H.id,pid:H.id,value:H.id,key:H.id,isLeaf:!H.have_child}))}];Al(R)})}function Jt(s){return xt(this,null,function*(){var f,j,R,H;jt(!0);let Be=(f=s.list)==null?void 0:f.filter(ht=>!et.includes(ht)),Te=(j=s.list)==null?void 0:j.filter(ht=>et.includes(ht));if(Be.length===0&&Te.length===0){jt(!1),wt([]);return}let U=yield(0,Ye.ZP)("/api/item_banks.json",{method:"get",params:_t(re({},s),{discipline_id:((R=s==null?void 0:s.courseid)==null?void 0:R[0])||null,sub_discipline_id:((H=s==null?void 0:s.courseid)==null?void 0:H[1])||null,ids:Be,shixun_ids:Te,type:s.type==="5"?null:s.type,clazz:s.type==="3"?"ItemBanksGroup":null})});jt(!1),wt(U)})}const Sl=s=>xt(void 0,null,function*(){const f=yield q({type:"shixunsDetail/release",payload:{id:s}});let j=f==null?void 0:f.tag_position,R=(f==null?void 0:f.evaluation_set_position)||[],H=f.status;return H===0?(A.ZP.success("\u53D1\u5E03\u6210\u529F"),Pt(P),!0):(H===2?A.ZP.error(`\u7B2C${R.join(",")}\u5173\u5C1A\u672A\u5B8C\u6210\uFF0C\u65E0\u6CD5\u7533\u8BF7\u53D1\u5E03`):H===3?A.ZP.error(`\u6BCF\u4E00\u4E2A\u5173\u5361\u81F3\u5C11\u9700\u8981\u4E00\u4E2A\u6280\u80FD\u6807\u7B7E, \u7B2C${j.join(",")}\u5173\u5C1A\u672A\u8BBE\u7F6E\u6280\u80FD\u6807\u7B7E\uFF0C\u8BF7\u8865\u5145`):A.ZP.error("\u5C1A\u672A\u521B\u5EFA\u4EFB\u52A1\u7684\u5B9E\u8BAD\uFF0C\u4E0D\u80FD\u7533\u8BF7\u53D1\u5E03"),!1)}),vt=s=>(s==null?void 0:s.shixun_tag_num)===1?"\u672A\u53D1\u5E03\u7684\u5B9E\u8DF5\u9879\u76EE\u4E0D\u80FD\u88AB\u9009\u7528\uFF0C\u8BF7\u5148\u8FDB\u884C\u53D1\u5E03":"",ml=(s,f,j)=>s.map(R=>R.key===f?re(re({},R),j):R.children?_t(re({},R),{children:ml(R.children,f,j)}):R),on=s=>xt(void 0,null,function*(){const{key:f}=s;let j=P.type;const R=yield(0,ze.ex)({page:1,per_page:20,sort_by:"updated_at",sort_direction:"desc",group_id:Math.abs(f),type:j}),{data:H,total_count:Be}=R||{};Be>0&&Al(Te=>ml(Te,f,{children:H.map(U=>({title:U.name,id:U.id,pid:U.id,value:U.id,key:U.id,isLeaf:!U.have_child}))}))});function sn(s){console.log("----",P),s==="1"&&(tt.gg=re({},P)),s==="2"&&(tt.scj=re({},P)),s==="3"&&(tt.ttgx=re({},P)),s==="0"&&(tt.wcjd=re({},P)),s==="5"&&(tt.yx=re({},P)),Tt(re({},tt))}function rn(){P.type==="1"&&(P=tt.gg),P.type==="2"&&(P=tt.scj),P.type==="3"&&(P=tt.ttgx),P.type==="0"&&(P=tt.wcjd),P.type==="5"&&(P=tt.yx),(P==null?void 0:P.item_type)==="SHIXUN"?(De=!0,qe(!0)):(De=!1,qe(!1)),rt.setFieldsValue(re({},P)),it(re({},P)),Pt(re({},P))}return N.createElement("div",null,N.createElement(Mt.default,{title:!1,footer:!1,open:fe,width:1200,centered:!0,className:Se.scoremodal,onCancel:()=>{b(!1)}},N.createElement("div",{style:{display:"flex",alignItems:"center"}},N.createElement("div",{className:Se.title},Ve?"\u4EE5\u9898\u6362\u9898":"\u9898\u5E93\u9009\u9898")),Ve&&N.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"),N.createElement(ie.default,{className:Se.tabWrap,activeKey:P.type,onChange:s=>{s==="3"?(P.show_all_share=!0,cl({group_id:0,page:1,per_page:20,sort_by:"updated_at",sort_direction:"desc",type:"3"})):P.show_all_share=null,s==="0"&&cl({group_id:0,page:1,per_page:20,sort_by:"updated_at",sort_direction:"desc",type:"0"}),sn(P.type),P.type=s,(P==null?void 0:P.item_type)==="SHIXUN"&&P.type!=="5"&&(De=!0,qe(!0)),Ht(!1),P.type==="5"&&(De=!1,qe(!1)),rn(),kl()},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:N.createElement("div",null,"\u5DF2\u9009",Ie.length>0&&N.createElement("span",{className:Se.titlecount},Ie.length),rl>0&&N.createElement("span",{className:Se.add},"+",rl)),key:"5"}]}),N.createElement(de.default,{layout:"inline",form:rt,onValuesChange:(s,f)=>{const j=Object.values(f).some(H=>H!==null&&H!==""&&H!==void 0),R=f.keyword==="";if(Ht(j||!R),P.page=1,(f==null?void 0:f.item_type)==="SHIXUN"){if(P.type==="5"?qe(!1):qe(!0),s.keyword||s.keyword==="")return;rt.submit()}else{if(s!=null&&s.courseid&&rt.setFieldsValue({tag_discipline_id:""}),qe(!1),s.keyword||s.keyword==="")return;rt.submit()}},onFinish:s=>{var f;P.type==="3"&&(!s.group_id||((f=s==null?void 0:s.group_id)==null?void 0:f.length)===0)?P.show_all_share=!0:P.show_all_share=null,it(re(re({},P),s)),Pt(re(re({},P),s))}},N.createElement(de.default.Item,{name:"item_type"},N.createElement(mt.default,{className:Se.selectWrapper,placeholder:"\u9898\u578B",style:{width:110},size:"middle"},(ft?an:Ve?Nt==null?void 0:Nt.filter(s=>s.question_type!==5):Nt).map(s=>N.createElement(mt.default.Option,{key:s.value},s.name)))),N.createElement(de.default.Item,{name:"courseid"},N.createElement(bt.Z,{className:Se.selectWrapper,style:{width:160},size:"middle",placeholder:"\u65B9\u5411&\u8BFE\u7A0B",options:zt})),!De&&N.createElement(de.default.Item,{name:"tag_discipline_id"},N.createElement(mt.default,{className:Se.selectWrapper,placeholder:"\u77E5\u8BC6\u70B9",style:{width:160},size:"middle",allowClear:!0},(yt=st==null?void 0:st.tag_disciplines)==null?void 0:yt.map(s=>N.createElement(mt.default.Option,{key:s.id},s.name)))),N.createElement(de.default.Item,{name:De?"diff":"difficulty"},N.createElement(mt.default,{className:Se.selectWrapper,placeholder:"\u96BE\u5EA6",style:{width:118},size:"middle",allowClear:!0},tl.map(s=>N.createElement(mt.default.Option,{key:s.value},s.name)))),De&&N.createElement(de.default.Item,{name:"shixun_publish_status"},N.createElement(mt.default,{className:Se.selectWrapper,placeholder:"\u5168\u90E8\u72B6\u6001",style:{width:118},size:"middle",allowClear:!0},Pl.map(s=>N.createElement(mt.default.Option,{key:s.value},s.name)))),(P.type==="3"||P.type==="0")&&!De&&N.createElement(de.default.Item,{name:"group_id"},N.createElement(gl.default,{treeDataSimpleMode:!0,style:{width:118},className:Se.selectWrappers,multiple:!0,allowClear:!0,showSearch:!0,filterTreeNode:(s,f)=>f.title.toUpperCase().indexOf(s.toUpperCase())!==-1,dropdownStyle:{maxHeight:400,width:500,overflow:"auto"},placeholder:"\u8BF7\u9009\u62E9\u6587\u4EF6\u5939",treeCheckStrictly:!0,loadData:on,treeDefaultExpandedKeys:[0],maxTagCount:0,treeCheckable:!0,treeData:un})),Q&&N.createElement("span",{className:Se.allqingchu,onClick:ll},N.createElement("i",{className:"iconfont icon-guanbi4"}),N.createElement("span",null,"\u6E05\u9664\u7B5B\u9009\u6761\u4EF6")),N.createElement(de.default.Item,{style:{flex:"0 0 auto",marginRight:0,marginLeft:"auto"},name:"keyword"},N.createElement(Kt.default.Search,{className:Se.search,placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",allowClear:!0,suffix:N.createElement("i",{className:`iconfont icon-sousuo9 font14 ${Se.searchIcon}`,onClick:()=>rt.submit()}),onSearch:s=>{rt.submit()}}))),N.createElement("div",{style:{background:"#F6F7F9",display:"flex",alignItems:"center",marginTop:18,height:40,paddingLeft:10,paddingRight:20}},N.createElement("div",{onClick:()=>{P.updated_at==="asc"?P.updated_at="desc":P.updated_at="asc",it(_t(re({},P),{page:1})),Pt(_t(re({},P),{page:1}))}}," ",P.updated_at?N.createElement("img",{src:P.updated_at==="asc"?Me.Z:Fl.Z,style:{width:"15px",verticalAlign:"text-bottom"},className:"font14 mr5 c-light-primary"}):N.createElement("i",{style:{fontSize:"14px"},className:"iconfont icon-jiangxu mr5 c-light-primary"}),"\u6309\u66F4\u65B0\u65F6\u95F4\u6392\u5E8F"),N.createElement("div",{onClick:()=>{P.quotes==="asc"?P.quotes="desc":P.quotes="asc",it(_t(re({},P),{page:1})),Pt(_t(re({},P),{page:1}))},style:{marginLeft:20}}," ",P.quotes?N.createElement("img",{src:P.quotes==="asc"?Me.Z:Fl.Z,style:{width:"15px",verticalAlign:"text-bottom"},className:"font14 mr5 c-light-primary"}):N.createElement("i",{style:{fontSize:"14px"},className:"iconfont icon-jiangxu mr5 c-light-primary"}),"\u6309\u4F7F\u7528\u6B21\u6570\u6392\u5E8F")),N.createElement(pt.default,{style:{marginTop:2,marginBottom:20},scroll:{y:260},dataSource:(st==null?void 0:st.items)||(st==null?void 0:st.shixun_list),pagination:!1,loading:_e,rowKey:s=>s.id,rowSelection:{type:Ve||Oe?"radio":"checkbox",selectedRowKeys:K,getCheckboxProps:s=>({disabled:s.shixun_tag_num===1||(wl==null?void 0:wl.find(f=>s.id===f))}),onSelect(s,f,j){if(Ve||Oe){Ke([s.id]),Qt.current=new Set([s.id]),dl(1),At([s.id]);return}if(f)(De||s!=null&&s.challenge_names)&&el([...et,s.id]),Ke([...K,s.id]),s.identifier?Bt.current.add(s.id):Qt.current.add(s.id),dl(1),At([...Ie,s.id]);else{s.identifier?Bt.current.delete(s.id):Qt.current.delete(s.id);let R=Ie.filter(H=>H!==s.id);if(Ke(R),At(R),De||s!=null&&s.challenge_names){let H=et.filter(Be=>Be!==s.id);el([...H])}if(P.type==="5"){Jt(_t(re({},P),{list:[...R]}));return}}},onSelectAll(s,f,j){var R,H;if(s){const Be=j.map(U=>U.id),Te=(H=j==null?void 0:j.filter(U=>U==null?void 0:U.challenge_names))==null?void 0:H.map(U=>U.id);el([...et,...Te]),Ke([...K,...Be]),At([...Ie,...Be]);for(const U of j)U.identifier?Bt.current.add(U.id):Qt.current.add(U.id)}else{const Be=j.map(Qe=>Qe.id),Te=K.filter(Qe=>!Be.some(nl=>nl===Qe)),U=(R=j==null?void 0:j.filter(Qe=>Qe==null?void 0:Qe.challenge_names))==null?void 0:R.map(Qe=>Qe.id);Ke([...Te]),At([...Te]);let ht=et.filter(Qe=>!U.some(nl=>nl===Qe.id));el([...ht]),P.type==="5"&&Jt(_t(re({},P),{list:[...Te]}));for(const Qe of Be)Qe.identifier?Bt.current.delete(Qe):Qt.current.delete(Qe)}}},columns:[{title:"\u9898\u578B",dataIndex:"item_type",key:"item_type",render:(s,f,j)=>{var R,H;return N.createElement(we.Z,{title:vt(f)},N.createElement("div",null,De||f!=null&&f.challenge_names?"\u5B9E\u8BAD\u9898":(H=(R=Nt==null?void 0:Nt.filter(Be=>Be.value===s))==null?void 0:R[0])==null?void 0:H.name))}},{title:"\u8BD5\u9898\u540D\u79F0",dataIndex:"name",width:De?"30%":"60%",key:"name",render:(s,f,j)=>{var R;return N.createElement("div",{style:{display:"flex",alignItems:"center"}},N.createElement(we.Z,{title:vt(f)},N.createElement("div",{className:f!=null&&f.high_resources_consume?Se.q_title:""},N.createElement(Re.Z,{key:1,showLines:1,showTextOnly:!0,value:De||f!=null&&f.challenge_names?f!=null&&f.title||s===null?"--":s:(f==null?void 0:f.item_type)=="BPROGRAM"?(R=f==null?void 0:f.program_attr)==null?void 0:R.description:s}))),(f==null?void 0:f.high_resources_consume)&&N.createElement(We.Z,{type:"shixun",style:{marginLeft:10}}))}},{title:"\u521B\u5EFA\u8005",dataIndex:"author_name",key:"author_name",hidden:!De,render:(s,f,j)=>{var R;return N.createElement(we.Z,{title:vt(f)},N.createElement("span",null,s?(R=s==null?void 0:s.split("\u3001"))==null?void 0:R[0]:"- -"))}},{title:"\u6240\u5C5E\u5355\u4F4D",dataIndex:"author_school_name",key:"author_school_name",hidden:!De,render:(s,f,j)=>N.createElement(we.Z,{title:vt(f)},N.createElement("span",null,s||"- -"))},{title:"\u96BE\u5EA6",dataIndex:"difficulty",key:"difficulty",render:(s,f,j)=>{var R,H,Be,Te;return N.createElement(we.Z,{title:vt(f)},N.createElement("div",null,De||f!=null&&f.challenge_names?(f==null?void 0:f.level)||((H=(R=tl==null?void 0:tl.filter(U=>U.value===s))==null?void 0:R[0])==null?void 0:H.name):(Te=(Be=tl==null?void 0:tl.filter(U=>U.value===s))==null?void 0:Be[0])==null?void 0:Te.name))}},{title:"\u5173\u5361\u6570\u91CF",dataIndex:"challenges_count",key:"challenges_count",hidden:!De,render:(s,f,j)=>N.createElement(we.Z,{title:vt(f)},N.createElement("div",null,s||"- -"))},{title:"\u4F7F\u7528\u6B21\u6570",dataIndex:"quotes",key:"quotes",render:(s,f,j)=>N.createElement(we.Z,{title:vt(f)},N.createElement("div",null,De||f!=null&&f.challenge_names?(f==null?void 0:f.study_count)||(f==null?void 0:f.stu_num):s))},{title:N.createElement("span",null,"\u53D1\u5E03\u72B6\u6001 ",N.createElement(we.Z,{title:"\u672A\u53D1\u5E03\u7684\u5B9E\u8DF5\u9879\u76EE\u4E0D\u80FD\u88AB\u9009\u7528"},N.createElement(il.Z,null))),dataIndex:"shixun_tag_num_name",key:"shixun_tag_num_name",hidden:!De,render:(s,f,j)=>N.createElement(we.Z,{title:vt(f)},N.createElement("div",null,s||"- -"))},{title:"\u64CD\u4F5C",dataIndex:"id",key:"item_type",render:(s,f,j)=>N.createElement(we.Z,{title:vt(f)},N.createElement("div",{style:{flex:1,textAlign:"start"}},N.createElement("a",{onClick:()=>{var R,H;Dl(_t(re({},f),{question_type:De||f!=null&&f.challenge_names?5:(H=(R=Nt==null?void 0:Nt.filter(Be=>Be.value===(f==null?void 0:f.item_type)))==null?void 0:R[0])==null?void 0:H.question_type})),sl(!0)}},"\u67E5\u770B"),(f==null?void 0:f.shixun_tag_num)===1&&N.createElement("a",{style:{marginLeft:10},onClick:()=>{Mt.default.confirm({title:"\u63D0\u793A",icon:null,centered:!0,width:400,content:N.createElement("div",null,"\u662F\u5426\u786E\u5B9A\u53D1\u5E03",N.createElement("span",{style:{cursor:"pointer",color:"#3061D0"},onClick:()=>{window.open(`/shixuns/${f==null?void 0:f.identifier}/challenges`)}},(f==null?void 0:f.shixun_name)||"--"),"\uFF1F"),onOk:()=>xt(void 0,null,function*(){if(!Sl(f==null?void 0:f.identifier))return new Promise((R,H)=>{H()})})})}},"\u53D1\u5E03")))}].filter(s=>!s.hidden)}),N.createElement(Ne.Z,{current:P.page,total:(st==null?void 0:st.items_count)||(st==null?void 0:st.shixuns_count),style:{marginBottom:20},defaultPageSize:P.per_page,showTotal:s=>N.createElement("span",null,"\u5171\xA0",N.createElement("span",{style:{color:"#165DFF"}},s),"\xA0\u6761\u6570\u636E"),pageSize:P.per_page,onChange:(s,f)=>{P.page=s,P.per_page=f,it(re({},P)),Pt(re({},P))}}),N.createElement("div",{className:Se.bottom},N.createElement(xe.ZP,{className:Se.no,onClick:()=>{b(!1)}},"\u53D6\u6D88"),N.createElement(xe.ZP,{loading:Ft,style:{width:Ft&&75},className:Se.yes,onClick:()=>xt(void 0,null,function*(){if((Ie==null?void 0:Ie.length)<=0){A.ZP.info(Ve||Oe?"\u8BF7\u9009\u62E9\u4E00\u9053\u8BD5\u9898":"\u5F53\u524D\u6682\u672A\u9009\u62E9\u6570\u636E");return}ye([...Qt.current],[...Bt.current],!0,Ie==null?void 0:Ie.length)})},Ve?"\u5F00\u59CB\u6362\u9898":"\u786E\u8BA4"))),N.createElement(Mt.default,{open:ln,title:"\u9898\u76EE\u8BE6\u60C5",footer:!1,className:Se.previewModal,width:1e3,centered:!0,onCancel:()=>{sl(!1)},onOk:()=>{sl(!1)}},N.createElement(Ct,{qitem:tn})))};var Pe=(0,Bl.connect)(({shixunsDetail:b,newExercisePaper:fe})=>({shixunsDetail:b,newExercisePaper:fe}))(en)}}]);