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