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
152 KiB

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