|
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[292,23599,61876],{680:function(e,n,t){t.d(n,{Z:function(){return o}});var i=t(19973),s=t(59301),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},l=t(22589),a=function(e,n){return s.createElement(l.Z,(0,i.Z)({},e,{ref:n,icon:r}))};var o=s.forwardRef(a)},18468:function(e,n,t){function i(e){var n=!0;if(e.length>0){for(var t=0;t<e.length;t++)if(0==e[t].compile_success||!e[t].compile_success){n=!1;break}}else n=!1;return n}function s(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=[],i=0;i<e.length;i++){var s=e[i],r=n?"".concat(n,"/").concat(s.name):"".concat(s.name);t.push({title:s.name,isLeaf:"tree"!==s.type,key:r})}return t}function r(e,n,t){for(var i=0;i<e.length;i++){var s=e[i];if(s.key===n){s.children=t;break}s.children&&r(s.children,n,t)}return e}function l(e,n,t){var i;return function(){var s=this,r=arguments,l=function(){i=null,t||e.apply(s,r)},a=t&&!i;clearTimeout(i),i=setTimeout(l,n),a&&e.apply(s,r)}}t.d(n,{Ax:function(){return r},Ds:function(){return l},KI:function(){return a},SI:function(){return s},f1:function(){return i}});var a=t(15309).Z.API_SERVER},49088:function(e,n,t){t.d(n,{Z:function(){return l}});t(59301);var i="digitalLabel___tImKs",s="active___Ck70Q",r=t(37712),l=function(e){var n=e.number,t=e.active,l=e.className;return(0,r.jsx)("div",{className:"".concat(i," ").concat(t?s:""," ").concat(l),children:n})}},13261:function(e,n,t){var i=t(82242),s=t.n(i),r=(t(59301),t(19779)),l=t(3113),a=t(37712);n.Z=function(e){var n=e.img,t=e.buttonProps,i=void 0===t?{}:t,o=e.styles,c=void 0===o?{}:o,u=e.customText,d=e.ButtonText,p=e.ButtonClick,m=e.Buttonclass,h=e.ButtonTwo,f=e.imgStyles,x=e.loading,v=void 0!==x&&x;return(0,a.jsxs)("section",{className:"tc animated fadeIn",style:s()(s()({},{color:"#999",margin:"100px auto",visibility:v?"hidden":"visible"}),c),children:[(0,a.jsx)("img",{src:n||r,style:s()({width:288,height:200},f)}),(0,a.jsx)("p",{className:"mt20 font14",children:u||"暂时还没有相关数据哦!"}),d&&(0,a.jsx)(l.ZP,s()(s()({className:m,onClick:p},i),{},{children:d})),h&&h]})}},13282:function(e,n,t){t.d(n,{Z:function(){return b}});var i=t(82242),s=t.n(i),r=t(7557),l=t.n(r),a=t(41498),o=t.n(a),c=t(79800),u=t.n(c),d=t(59301),p={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},m=t(3113),h=t(38827),f=t(83743),x=t(6848),v=t(27627),_=t(91810),g=t(13261),j=t(15309),y=t(37712),b=function(e){var n,t,i,r,a,c,b,w=e.editOffice,k=void 0===w?"view":w,N=e.data,Z=(e.theme,e.type),I=e.filename,C=e.monacoEditor,P=e.className,S=e.style,T=e.close,q=e.onClose,E=e.hasMask,F=e.disabledDownload,O=e.onImgDimensions,L=e.showNodata,M=(0,d.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),R=u()(M,2),A=(R[0],R[1],(0,d.useState)("")),B=u()(A,2),D=(B[0],B[1]),z=(0,d.useState)(),V=u()(z,2),W=V[0],U=V[1],H="build"===window.ENV?"/react/build":"",G=location.host.startsWith("localhost")?j.Z.PROXY_SERVER:j.Z.API_SERVER,K=(0,d.useRef)();null!==(n=N)&&void 0!==n&&n.startsWith("/api")&&"txt"!==Z&&(N=j.Z.API_SERVER+N),I&&(C.filename=I),(0,d.useEffect)((function(){var e,n=null===(e=document.cookie)||void 0===e||null===(e=e.replace(/\s/g,""))||void 0===e?void 0:e.split(";");null==n||n.map((function(e){var n=e.split("=");"_educoder_session"===n[0]&&D(n[1])}))}),[]),(0,d.useEffect)((function(){"office"===Z&&Y()}),[Z,N]);var Y=function(){var e=o()(l()().mark((function e(){var n,t,i;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=N,N.startsWith("http")||(n=location.origin+n),t=new URL(n).pathname.split("/").pop(),e.next=5,(0,_.gJ)({attachment_id:t});case 5:i=e.sent,U(i);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),X=function(){N.startsWith("http")||N.startsWith("blob:")?J():(0,v.Sv)(I||"educoder",N,I)},J=function(){(0,v.Nd)(I||"educoder",decodeURIComponent(N))};return(0,y.jsxs)("div",{style:s()({},S||{}),className:"".concat(E&&p.bgBlack," ").concat(Z?p.wrp:"hide"),children:[T&&(0,y.jsxs)("div",{className:p.close,ref:K,children:[!!O&&(0,y.jsx)(x.Z,{title:"点击对图片进行批注",getPopupContainer:function(){return K.current},children:(0,y.jsx)("span",{onClick:function(){q(),O()},children:(0,y.jsx)("i",{className:"icon-yulanpizhu"})})}),!F&&(0,y.jsx)(x.Z,{title:"点击下载此文件",getPopupContainer:function(){return K.current},children:(0,y.jsx)("span",{onClick:J,children:(0,y.jsx)("i",{className:"icon-quxiaozhiding"})})}),(0,y.jsx)(x.Z,{title:"关闭",getPopupContainer:function(){return K.current},children:(0,y.jsx)("span",{className:"",onClick:q,children:(0,y.jsx)("i",{className:"icon-guanbi1"})})})]}),(0,y.jsx)("div",{className:"".concat(p[P]," ").concat(P," ").concat(p.monaco," ").concat("txt"===Z?"show":"hide"),children:"txt"===Z&&(0,y.jsx)(f.ZP,s()({},C))}),"audio"===Z&&(0,y.jsx)("audio",{src:(null===(t=N)||void 0===t?void 0:t.indexOf("http"))>-1||null!==(i=N)&&void 0!==i&&i.startsWith("/api")?N:"data:image/png;base64,".concat(N),autoPlay:!0}),"video"===Z&&(0,y.jsx)(y.Fragment,{children:(null===(r=N)||void 0===r?void 0:r.indexOf("http"))>-1||null!==(a=N)&&void 0!==a&&a.startsWith("/api")?(0,y.jsx)("video",{controls:!0,src:"".concat(N),autoPlay:!0}):(0,y.jsx)("video",{controls:!0,src:"data:video/mp4;base64,".concat(N),autoPlay:!0})}),"office"===Z&&W&&(0,y.jsx)("iframe",{src:"".concat(H,"/office.html?key=").concat(W.key,"&url=").concat(G+W.url,"&callbackUrl=").concat(G+W.callbackUrl,"&fileType=").concat(W.fileType,"&title=").concat(W.title,"&model=").concat(k,"&officeServer=").concat(j.Z.ONLYOFFICE,"&disabledDownload=").concat(!!F)}),"html"===Z&&(0,y.jsx)("iframe",{src:N+"&disposition=inline"}),"pdf"===Z&&(0,y.jsx)("iframe",{src:"".concat(H,"/js/pdfview/index.html?url=").concat(N,"&disabledDownload=").concat(!!F)}),"image"===Z&&(0,y.jsx)("img",{src:(null===(c=N)||void 0===c?void 0:c.indexOf("http"))>-1||null!==(b=N)&&void 0!==b&&b.startsWith("/api")?N:"data:image/png;base64,".concat(N)}),("other"===Z||"download"===Z)&&(0,y.jsx)(y.Fragment,{children:L?(0,y.jsx)(g.Z,{customText:"当前文件不支持预览,可点击下载查看",ButtonTwo:(0,y.jsx)(m.ZP,{icon:(0,y.jsx)("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:X,children:"下载"})}):(0,y.jsxs)(m.ZP,{type:"primary",size:"middle",onClick:X,children:[(0,y.jsx)(h.Z,{}),"点击下载"]})})]})}},53921:function(e,n,t){t.d(n,{t:function(){return q}});var i=t(39647),s=t.n(i),r=t(91232),l=t.n(r),a=t(85573),o=t.n(a),c=t(82242),u=t.n(c),d=t(79800),p=t.n(d),m=t(59301),h=t(73782),f=t(78673),x=t(78241),v=t(95237),_=t(43604),g=t(94001),j=t(57809),y=t(60950),b=t(65363),w=t(98887),k=t(43346),N=t(37712),Z=["key","name"],I=h.Z.TextArea,C=[{title:"C",key:"C"},{title:"C++",key:"C++"},{title:"Python",key:"Python"},{title:"Java",key:"Java"},{title:"JavaScript",key:"JavaScript"},{title:"Ruby",key:"Ruby"}],P=function(e){var n=e.value,t=e.onChange;return(0,N.jsx)(f.Z,{checked:n,onChange:function(e){t(e)}})},S="@▁@",T="@▁▁@",q=function(e){var n=e.questionTitlePlaceholder,t=e.form,i=e.scoreByBlank,r=void 0!==i&&i,a=e.hackidentifier,c=e.answerKey,d=(0,m.useState)(!1),f=p()(d,2),q=f[0],E=f[1],F=(0,m.useState)(!1),O=p()(F,2),L=(O[0],O[1],(0,b.useParams)().type,function(e,n){for(var t=n.line,i=0,s=0;s<t;s++)i+=e.getLine(s).split(S).length-1;for(var r=0;r<t;r++)i+=e.getLine(r).split(T).length-1;var l=e.getLine(t).substring(0,n.ch);return i+=l.split(S).length-1,i+=l.split(T).length-1}),M=function(){var e=t.getFieldValue(c);t.setFieldsValue(o()({},c,e.map((function(e,n){return u()(u()({},e),{},{position:n+1})}))))},R=(0,m.useRef)(),A=function(e,n){for(var t=0;t<e;t++)R.current({position:null,answer_text:""},n+t);M()},B=(0,m.useRef)(),D=function(e){B.current(e),M()},z=x.Z.useWatch(c,t);return(0,N.jsxs)("div",{className:w.Z.wrap,children:[(0,N.jsx)(x.Z.Item,{label:"试题描述",name:["hack","description"],style:{display:"table"},className:"w100",labelCol:{span:24},rules:[{required:!0}],children:(0,N.jsx)(y.h,{scrollId:"name",watch:!0,height:140})}),(0,N.jsx)("div",{className:w.Z.questionTitleEditorWrap,children:(0,N.jsx)(x.Z.Item,{label:"程序代码",name:["hack_codes","code"],labelCol:{span:24},rules:[{required:!0}],children:(0,N.jsx)(y.h,{scrollId:"name",watch:!0,height:400,showNullProgramButton:!0,onChange:function(e,n){var i=t.getFieldValue(c);console.log("--preAnswerData",i,n),t.setFieldsValue(o()({},c,null==i?void 0:i.map((function(e,t){var i;return u()(u()({},e),{},{position:t+1,multi_line:null==n||null===(i=n[t])||void 0===i?void 0:i.multiLine})}))))},placeholder:n,onCMBeforeChange:function(e,n){!function(e,n,t,i){var s=e.getRange(n.from,n.to),r=0;if(n.text.forEach((function(e){r+=e.split(S).length-1})),n.text.forEach((function(e){r+=e.split(T).length-1})),"setValue"!==n.origin)if(!s||-1===s.indexOf(S)&&-1===s.indexOf(T)){if(r>0){var l=L(e,n.from);console.log("新增".concat(r,"个,之前有").concat(l,"个")),t(r,l)}}else{var a=s.split(S).length-1+s.split(T).length-1,o=L(e,n.from);console.log("删除".concat(a,"个, 前面有").concat(o,"个,新增").concat(r,"个")),i(a>1?Array.from({length:a},(function(e,n){return o+n})):o)}}(e,n,A,D)}})})}),(0,N.jsx)(x.Z.List,{name:c,rules:[{validator:function(e,n){if(0===(null==n?void 0:n.length))return Promise.reject(new Error("答案不能为空"));var t,i=l()(n);try{for(i.s();!(t=i.n()).done;){var s=(t.value||{}).answer_text;if(0===(null==s?void 0:s.length))return Promise.reject(new Error("填空项答案不能为空"))}}catch(e){i.e(e)}finally{i.f()}return Promise.resolve()}}],children:function(e,n,t){var i=n.add,l=n.remove;t.errors;return R.current=i,B.current=l,(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(x.Z.Item,{label:"填空项答案",required:!0,labelCol:{span:24}}),e.map((function(e,n){var t,i,l=e.key,a=e.name,o=s()(e,Z);return(0,N.jsxs)(v.Z,{className:"mb20",align:"middle",wrap:!1,children:[(0,N.jsxs)(_.Z,{flex:"0 0 auto",className:"".concat(w.Z.blankIndex),children:["填空项",n+1]}),(0,N.jsx)(_.Z,{flex:1,children:(0,N.jsxs)(v.Z,{align:"top",justify:"space-between",wrap:!1,children:[(0,N.jsx)(_.Z,{children:(0,N.jsx)(x.Z.Item,u()(u()({},o),{},{name:[a,"answer_text"],noStyle:!0,children:null!=z&&null!==(t=z[a])&&void 0!==t&&t.multi_line||null!=z&&null!==(i=z[a])&&void 0!==i&&i.multiLine?(0,N.jsx)(I,{spellCheck:!1,style:{marginLeft:10,width:550}}):(0,N.jsx)(h.Z,{style:{marginLeft:10,width:550},className:w.Z.blankInput,size:"large",maxLength:1e3,onBlur:function(e){}})}))}),r&&(0,N.jsx)(_.Z,{flex:"224px",children:(0,N.jsx)(x.Z.Item,u()(u()({},o),{},{name:[a,"score"],label:"分值",rules:[{required:!0}],children:(0,N.jsx)(g.Z,{size:"large",className:w.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"按空给分请输入分值"})}))})]})})]},l)}))]})}}),(0,N.jsx)("div",{onClick:function(){return E(!0)},children:(0,N.jsx)(x.Z.Item,{name:["hack","analysis"],label:"题目解析",labelCol:{span:24},children:(0,N.jsx)(y.x,{placeholder:"请编辑题目解析(非必填)",isEdit:q})})}),(0,N.jsx)(x.Z.Item,{label:"编程语言",style:{marginTop:30},name:["hack_codes","language"],labelCol:{span:24},rules:[{required:!0,message:"请选择编程语言"}],children:(0,N.jsx)(j.default,{size:"large",children:C.map((function(e){return(0,N.jsxs)(j.default.Option,{value:e.key,children:[" ",e.title]},e.title)}))})}),(0,N.jsxs)(x.Z.Item,{label:"最大评测时长(秒)",style:{marginTop:30},labelCol:{span:24},required:!0,children:[(0,N.jsx)(x.Z.Item,{name:["hack","time_limit"],rules:[{required:!0,message:"请输入单个测试集评测时长限制"},{type:"number",min:3,message:"最小限制时间是3秒"}],noStyle:!0,children:(0,N.jsx)(g.Z,{precision:0,max:10,min:3,size:"large",style:{width:"97%"}})}),(0,N.jsx)("span",{className:"ml10 font14",children:"秒"})]}),(0,N.jsxs)(v.Z,{align:"middle",style:{marginTop:30},children:[(0,N.jsx)(x.Z.Item,{name:["hack","allow_student_debug"],children:(0,N.jsx)(P,{})}),(0,N.jsx)(_.Z,{className:"ml10",children:"允许学生答题时进行代码调试"})]}),(0,N.jsx)(x.Z.Item,{label:"测试用例",required:!0}),(0,N.jsxs)("div",{style:{background:"#F6F7F9",padding:15},children:[(0,N.jsx)(x.Z.Item,{label:"输入",labelCol:{span:24},name:["hack_sets","input"],children:(0,N.jsx)(I,{rows:4})}),(0,N.jsx)(x.Z.Item,{label:"输出",labelCol:{span:24},name:["hack_sets","output"],rules:[{required:!0,message:"请输入输出内容"}],children:(0,N.jsx)(I,{rows:4})})]}),(0,N.jsx)(k.Z,{answerKey:c,hackidentifier:a,ButtonText:"自测运行",ButtonProps:{ghost:!0,icon:(0,N.jsx)("i",{className:"iconfont icon-ceshi"}),style:{background:"rgba(55,173,131,0.05)",borderRadius:19,border:"1px solid #37AD83",width:116,height:38,display:"inline-flex",fontSize:14,alignItems:"center",justifyContent:"center",marginTop:20,cursor:"pointer",color:"#37AD83"}},form:t})]})}},43346:function(e,n,t){var i=t(82242),s=t.n(i),r=t(7557),l=t.n(r),a=t(41498),o=t.n(a),c=t(79800),u=t.n(c),d=t(65363),p=t(59301),m=t(8591),h=t(3113),f=t(43418),x=t(24334),v=t(79311),_=t(9187),g=t(55662),j=t(61186),y=t.n(j),b=t(37712);n.Z=function(e){var n=e.ButtonProps,t=e.ButtonText,i=e.form,r=e.answerKey,a=e.hackidentifier,c=void 0===a?"":a,j=e.items,w=void 0===j?{}:j,k=(0,p.useState)(!1),N=u()(k,2),Z=N[0],I=N[1],C=(0,p.useState)(""),P=u()(C,2),S=P[0],T=P[1],q=(0,d.useParams)(),E=(0,p.useState)({}),F=u()(E,2),O=F[0],L=F[1],M="edit"===q.type;window.location.href.includes("problemset");function R(e,n){return A.apply(this,arguments)}function A(){return(A=o()(l()().mark((function e(n,t){var s,a,o,c,u;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=i.getFieldValue("hack_codes"),o=i.getFieldValue(r),a.code){e.next=5;break}return m.ZP.info("程序代码不能为空!"),e.abrupt("return");case 5:if(a.language){e.next=8;break}return m.ZP.info("编程语言不能为空!"),e.abrupt("return");case 8:if(!(o.length>0&&(null===(s=o.filter((function(e){return!e.answer_text})))||void 0===s?void 0:s.length)>0)){e.next=11;break}return m.ZP.info("填空项不能为空!"),e.abrupt("return");case 11:return c=a.code,o.length>0&&(null==o||o.map((function(e){c=e.multi_line?c.substring(0,c.indexOf("@▁▁@"))+e.answer_text+c.substring(c.indexOf("@▁▁@")+4):c.substring(0,c.indexOf("@▁@"))+e.answer_text+c.substring(c.indexOf("@▁@")+3)}))),e.next=15,(0,_.n4)(t,n||{code:x.Base64.encode(c),language:a.language});case 15:return u=e.sent,e.abrupt("return",u);case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function B(e,n){return D.apply(this,arguments)}function D(){return(D=o()(l()().mark((function e(n,t){var i,s,r,a;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=w.userAnswer,r=x.Base64.decode(w.code),!(s.length>0&&(null===(i=s.filter((function(e){return!e.value})))||void 0===i?void 0:i.length)>0)){e.next=6;break}return m.ZP.info("填空项不能为空!"),e.abrupt("return");case 6:return s.length>0&&(null==s||s.map((function(e){r=e.multi_line?r.substring(0,r.indexOf("@▁▁@"))+e.value+r.substring(r.indexOf("@▁▁@")+4):r.substring(0,r.indexOf("@▁@"))+e.value+r.substring(r.indexOf("@▁@")+3)}))),e.next=9,(0,_.n4)(t,n||{code:x.Base64.encode(r),language:w.language});case 9:return a=e.sent,e.abrupt("return",a);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function z(){return(new Date).getTime()}return(0,p.useEffect)((function(){(M||c)&&T(c||q.id)}),[q]),(0,p.useEffect)((function(){return function(){sessionStorage.removeItem("projectFill")}}),[]),(0,b.jsxs)("div",{children:[(0,b.jsx)(h.ZP,s()(s()({loading:Z},n),{},{onClick:o()(l()().mark((function e(){var n,r,a,c,u,d,p,h,g,j,y,b,w,k;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("运行调试"!==t){e.next=20;break}if(I(!0),!Z){e.next=4;break}return e.abrupt("return");case 4:return e.next=6,(0,v.ZP)("/api/problems/".concat(S,"/start.json"),{method:"get"});case 6:return n=e.sent,e.next=9,B(null,null==n?void 0:n.identifier);case 9:if(0!==(null==(r=e.sent)?void 0:r.status)){e.next=18;break}return a=function(){var e=o()(l()().mark((function e(){var t,i,s,r,o;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.rX)(null==n?void 0:n.identifier,"submit");case 2:if(t=e.sent,i=t.status,t.message,s=t.data,r=z(),o=r-c>6e3,0===i||o||setTimeout(a,1e3),!o){e.next=13;break}return f.Z.error({centered:!0,okText:"知道啦",title:"调试代码超时"}),I(!1),e.abrupt("return");case 13:0===i&&(I(!1),L(s),2===s.status&&(I(!1),f.Z.error({centered:!0,okText:"知道啦",title:"调试代码超时"})));case 14:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),c=z(),e.next=15,(0,_.bM)(null==n?void 0:n.identifier,{});case 15:a(),e.next=19;break;case 18:I(!1);case 19:return e.abrupt("return");case 20:return u=!0,e.next=23,i.validateFields().then((function(){u=!1}),(function(e){var n,t;e.errorFields[0].name.includes("standard_answers")?m.ZP.error("填空项答案不能为空"):m.ZP.error(e.errorFields[0].errors[0]),0===(null===(n=e.errorFields)||void 0===n?void 0:n.length)&&(u=!1),i.scrollToField(null==e||null===(t=e.errorFields)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.name,{behavior:"smooth",block:"center"}),u=!0}));case 23:if(!u){e.next=25;break}return e.abrupt("return");case 25:if(I(!0),!Z){e.next=28;break}return e.abrupt("return");case 28:if(d="",p=i.getFieldsValue(),S){e.next=39;break}return e.next=33,(0,v.ZP)("/api/problems.json",{method:"post",body:s()(s()({},p),{},{hack:s()(s()({},null==p?void 0:p.hack),{},{sub_discipline_id:null==p||null===(h=p.hack)||void 0===h||null===(h=h.sub_discipline_id)||void 0===h?void 0:h[1],difficult:p.difficulty,item_banks_group_id:p.item_banks_group_id}),hack_codes:s()(s()({},p.hack_codes),{},{code:x.Base64.encode(p.hack_codes.code)}),hack_sets:[s()({},p.hack_sets)],is_blank:!0})});case 33:d=e.sent,S=null===(g=d)||void 0===g?void 0:g.identifier,sessionStorage.projectFill=S,T(S),e.next=42;break;case 39:return e.next=41,(0,v.ZP)("/api/problems/".concat(S,".json"),{method:"put",body:s()(s()({},p),{},{hack:s()(s()({},null==p?void 0:p.hack),{},{sub_discipline_id:null==p||null===(j=p.hack)||void 0===j||null===(j=j.sub_discipline_id)||void 0===j?void 0:j[1],difficult:p.difficulty,item_banks_group_id:p.item_banks_group_id}),hack_codes:s()(s()({},p.hack_codes),{},{code:x.Base64.encode(p.hack_codes.code)}),update_hack_sets:[s()({},p.hack_sets)],is_blank:!0})});case 41:d=e.sent;case 42:return e.next=44,(0,v.ZP)("/api/problems/".concat(S,"/start.json"),{method:"get"});case 44:return y=e.sent,e.next=47,R(null,null==y?void 0:y.identifier);case 47:if(0!==(null==(b=e.sent)?void 0:b.status)){e.next=56;break}return w=function(){var e=o()(l()().mark((function e(){var n,t,i,s,r;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.rX)(null==y?void 0:y.identifier,"submit");case 2:if(n=e.sent,t=n.status,n.message,i=n.data,s=z(),r=s-k>1e3*(p.hack.time_limit+3),0===t||r||setTimeout(w,1e3),!r){e.next=13;break}return f.Z.error({centered:!0,okText:"知道啦",title:"调试代码超时"}),I(!1),e.abrupt("return");case 13:0===t&&(I(!1),L(i),2===i.status&&(I(!1),f.Z.error({centered:!0,okText:"知道啦",title:"调试代码超时"})));case 14:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),k=z(),e.next=53,(0,_.bM)(null==y?void 0:y.identifier,{});case 53:w(),e.next=57;break;case 56:I(!1);case 57:case"end":return e.stop()}}),e)}))),children:t})),(null==O?void 0:O.id)&&2!==O.status&&(0,b.jsx)(f.Z,{open:(null==O?void 0:O.id)&&2!==O.status,title:"运行结果",width:1100,footer:!1,onOk:function(){L({})},onCancel:function(){L({})},children:(0,b.jsxs)("div",{style:{maxHeight:600,overflow:"auto",marginBottom:15},children:[(0,b.jsxs)("div",{style:{marginBottom:20,display:"flex",justifyContent:"space-between",fontSize:14},children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{style:{color:"#666666"},children:"状态"}),(0,b.jsx)("span",{style:{marginLeft:12,color:0!==O.status&&"#E30000"},children:g.Im[O.status]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{style:{color:"#666666"},children:"提交时间"}),(0,b.jsx)("span",{style:{marginLeft:12},children:y()(O.created_at).format("YYYY-MM-DD HH:mm:ss")})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{style:{color:"#666666"},children:"语言"}),(0,b.jsx)("span",{style:{marginLeft:12},children:O.language})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{style:{color:"#666666"},children:"执行用时"}),(0,b.jsxs)("span",{style:{marginLeft:12},children:[O.execute_time,"ms"]})]})]}),(0,b.jsx)(g.Y4,s()({},O))]})})]})}},3410:function(e,n,t){t.d(n,{u:function(){return k}});var i=t(39647),s=t.n(i),r=t(79800),l=t.n(r),a=t(85573),o=t.n(a),c=t(82242),u=t.n(c),d=t(59301),p=t(95237),m=t(43604),h=t(6848),f=t(78241),x=t(98887),v=t(45532),_=t(52103),g=t(60950),j=t(37712),y=["key","name"],b=["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"],w=function(e){var n=e.value,t=e.onChange,i=e.choiceTextKey,s=e.answerKey,r=e.index,l=e.isEdit,a=e.setInputActive,c=e.form,d=e.choiceOptionsPath,f=e.allowChangeMode,y=e.showAddIcon,w=e.addItem,k=e.deleteItem,N=1===(null==n?void 0:n[s]),Z=function(){var e;N?t(u()(u()({},n),{},o()({},s,0))):(f||(e=c.getFieldValue(d),c.setFieldValue(d,e.map((function(e){return u()(u()({},e),{},o()({},s,0))})))),t(u()(u()({},n),{},o()({},s,1))))};return(0,j.jsxs)(p.Z,{className:x.Z.choiceWrap,align:"middle",wrap:!1,children:[(0,j.jsx)(m.Z,{onClick:Z,className:"".concat(x.Z.choiceIndex," ").concat(N?x.Z.activeAnswer:""),children:b[r]}),(0,j.jsx)(m.Z,{flex:1,className:"".concat(x.Z.editorWrap," ml15"),onClick:a,children:(0,j.jsx)(g.x,{height:155,placeholder:"请您输入选项",isEdit:l,value:null==n?void 0:n[i],onChange:function(e){t(u()(u()({},n),{},o()({},i,e)))}})}),(0,j.jsx)(m.Z,{flex:"0 0 auto",className:"ml15",children:(0,j.jsx)("div",{onClick:Z,className:"".concat(x.Z.setAnswerBtn," ").concat(N?x.Z.activeAnswer:""),children:N?"正确答案":"设为答案"})}),(0,j.jsxs)(m.Z,{className:x.Z.actionWrapper,children:[(0,j.jsx)(h.Z,{title:"新增参考答案",children:(0,j.jsx)(v.Z,{className:x.Z.addIcon,onClick:w,style:{visibility:y?"visible":"hidden"}})}),(0,j.jsx)(h.Z,{title:"删除",children:(0,j.jsx)(_.Z,{className:x.Z.deleteIcon,onClick:k,style:{visibility:r>1?"visible":"hidden"}})})]})]})},k=function(e){var n=e.questionTitlePlaceholder,t=e.titleKey,i=e.choiceKey,r=e.analysisKey,a=e.choiceTextKey,c=e.answerKey,p=e.choiceOptionsPath,m=e.allowChangeMode,h=void 0===m||m,v=e.form,_=e.showAnalysis,k=void 0===_||_,N=(0,d.useState)(),Z=l()(N,2),I=Z[0],C=Z[1],P=(0,d.useState)(!1),S=l()(P,2),T=S[0],q=S[1];return(0,j.jsxs)("div",{className:x.Z.wrap,children:[(0,j.jsx)("div",{className:x.Z.questionTitleEditorWrap,children:(0,j.jsx)(f.Z.Item,{label:"题干",name:t,labelCol:{span:24},rules:[{required:!0}],children:(0,j.jsx)(g.h,{scrollId:Array.isArray(t)?t.join("_"):"".concat(t),watch:!0,height:140,placeholder:n})})}),(0,j.jsx)(f.Z.Item,{label:"答案选项",required:!0,labelCol:{span:24}}),(0,j.jsx)(f.Z.List,{name:i,rules:[{validator:function(e,n){var t=n.some((function(e){return 1===e[c]})),i=n.findIndex((function(e){var n;return(null===(n=e[a])||void 0===n?void 0:n.length)<=0}));return-1!==i?Promise.reject(new Error("请先输入".concat(b[i],"选项的内容"))):t?Promise.resolve():Promise.reject(new Error("请设置正确答案"))}}],children:function(e,n){var t=n.add,i=n.remove;return(0,j.jsxs)("div",{id:Array.isArray(p)?p.join("_"):"".concat(p),children:[e.map((function(n,r){var l=n.key,m=n.name,x=s()(n,y),_=I===l,g=r<7&&r===e.length-1;return(0,d.createElement)(f.Z.Item,u()(u()({},x),{},{key:l,name:m,noStyle:!0}),(0,j.jsx)(w,{choiceTextKey:a,answerKey:c,index:r,isEdit:_,setInputActive:function(){C(l)},form:v,choiceOptionsPath:p,allowChangeMode:h,showAddIcon:g,addItem:function(){return t(o()(o()({},a,""),c,0))},deleteItem:function(){return i(m)}}))})),e.length<8&&(0,j.jsx)("div",{className:"".concat(x.Z.addBtn," mb30"),onClick:function(){return t(o()(o()({},a,""),c,0))},children:"添加选项"})]})}}),k&&(0,j.jsx)("div",{onClick:function(){return q(!0)},children:(0,j.jsx)(f.Z.Item,{name:r,label:"题目解析",labelCol:{span:24},children:(0,j.jsx)(g.x,{placeholder:"请编辑题目解析(非必填)",isEdit:T})})})]})}},56949:function(e,n,t){t.d(n,{r:function(){return g}});var i=t(82242),s=t.n(i),r=t(39647),l=t.n(r),a=(t(59301),t(36381)),o=t(78241),c=t(95237),u=t(94001),d=t(6848),p=t(98887),m=t(52103),h=t(60950),f=t(3410),x=t(37712),v=["key","name"],_=a.Z.Panel,g=function(e){var n=e.questionTitlePlaceholder,t=(e.choiceKey,e.form),i=e.withScore;return(0,x.jsxs)("div",{className:p.Z.wrap,children:[(0,x.jsx)("div",{className:p.Z.questionTitleEditorWrap,children:(0,x.jsx)(o.Z.Item,{label:"题干",name:"name",labelCol:{span:24},rules:[{required:!0}],children:(0,x.jsx)(h.h,{scrollId:"name",watch:!0,height:140,placeholder:n})})}),(0,x.jsx)(o.Z.Item,{label:"小题",required:!0,labelCol:{span:24}}),(0,x.jsx)(o.Z.List,{name:"sub_item_banks",rules:[{validator:function(e,n){return n?Promise.resolve():Promise.reject(new Error("请添加小题"))}}],children:function(e,n){var r=n.add,h=n.remove;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(a.Z,{className:e.length>0?p.Z.collapseWrapper:"",bordered:!1,expandIcon:function(e){var n=e.isActive;return(0,x.jsx)("i",{className:"iconfont icon-weizhankai ".concat(n?p.Z.open:p.Z.close),style:{fontSize:14,transition:"all .2s"}})},children:e.map((function(e,n){var r=e.key,a=e.name,g=l()(e,v);return(0,x.jsx)(_,{className:p.Z.panel,forceRender:!0,header:(0,x.jsxs)("div",{className:p.Z.panelHeader,children:["第",n+1,"小题",(0,x.jsx)("span",{children:"(单选题)"})]}),extra:(0,x.jsxs)(c.Z,{align:"middle",onClick:function(e){return e.stopPropagation()},children:[i&&(0,x.jsx)(o.Z.Item,s()(s()({},g),{},{rules:[{required:!0,message:"请输入小题分值"}],label:"分值",name:[a,"question_score"],className:p.Z.blankInputNumberWrapper,children:(0,x.jsx)(u.Z,{className:p.Z.blankInput,placeholder:"请输入当前小题分数",min:.1,precision:1,max:100,style:{width:150}})})),(0,x.jsx)(d.Z,{title:"删除",children:(0,x.jsx)(m.Z,{className:"".concat(p.Z.deleteIcon," ml40"),onClick:function(){return h(a)}})})]}),children:(0,x.jsx)(o.Z.Item,s()(s()({},g),{},{name:a,children:(0,x.jsx)(f.u,{questionTitlePlaceholder:"请编辑选择题题干内容",allowChangeMode:!1,form:t,choiceKey:[a,"choices"],titleKey:[a,"name"],analysisKey:[a,"analysis"],choiceOptionsPath:["sub_item_banks",a,"choices"],choiceTextKey:"choice_text",answerKey:"is_answer"})}))},r)}))}),e.length<20&&(0,x.jsx)("div",{className:"".concat(p.Z.addBtn),onClick:function(){return r({name:"",choices:Array.from({length:4},(function(){return{choice_text:"",is_answer:0}})),analysis:""})},children:"添加小题"})]})}})]})}},89531:function(e,n,t){t.d(n,{u:function(){return q}});var i=t(39647),s=t.n(i),r=t(91232),l=t.n(r),a=t(85573),o=t.n(a),c=t(82242),u=t.n(c),d=t(79800),p=t.n(d),m=t(37205),h=t.n(m),f=t(59301),x=t(43418),v=t(95237),_=t(43604),g=t(73782),j=t(6848),y=t(78673),b=t(78241),w=t(94001),k=t(60950),N=t(52103),Z=t(98887),I=t(37712),C=["key","name"],P=function(e){var n=e.value,t=e.onChange;return(0,I.jsxs)(v.Z,{align:"middle",className:"ml20",gutter:[40,20],children:[null==n?void 0:n.map((function(e,i){return(0,I.jsxs)(_.Z,{className:Z.Z.blankWrapper,children:[(0,I.jsx)(g.Z,{className:Z.Z.blankInput,defaultValue:e,maxLength:1e3,onBlur:function(e){var s=h()(n),r=e.target.value.trim();s[i]=r,t(s)}}),(0,I.jsx)(j.Z,{title:"删除",children:(0,I.jsx)(N.Z,{className:Z.Z.deleteIcon,style:{marginLeft:15,visibility:i>0?"visible":"hidden"},onClick:function(){return function(e){x.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确认要删除这个参考答案吗?",className:Z.Z.modal,onOk:function(){var i=h()(n);i.splice(e,1),t(i)}})}(i)}})})]},"".concat(e,"_").concat(i))})),(0,I.jsx)(_.Z,{children:(0,I.jsx)("div",{className:"".concat(Z.Z.addBtn),onClick:function(){var e;(e=h()(n)).push(""),t(e)},children:"新增答案"})})]})},S=function(e){var n=e.value,t=void 0===n||n,i=e.onChange;return(0,I.jsx)(y.Z,{checked:!t,onChange:function(e){i(!e)}})},T="▁",q=function(e){var n=e.questionTitlePlaceholder,t=e.form,i=e.scoreByBlank,r=void 0!==i&&i,a=e.answerKey,c=(0,f.useState)(!1),d=p()(c,2),m=d[0],h=d[1],x=function(e,n){for(var t=n.line,i=0,s=0;s<t;s++)i+=e.getLine(s).split(T).length-1;return i+=e.getLine(t).substring(0,n.ch).split(T).length-1},j=function(){var e=t.getFieldValue(a);t.setFieldsValue(o()({},a,e.map((function(e,n){return u()(u()({},e),{},{position:n+1})}))))},y=(0,f.useRef)(),N=function(e,n){for(var t=0;t<e;t++)y.current({position:null,answer_text:[""]},n+t);j()},q=(0,f.useRef)(),E=function(e){q.current(e),j()},F=b.Z.useWatch(a,t);return(0,I.jsxs)("div",{className:Z.Z.wrap,children:[(0,I.jsx)("div",{className:Z.Z.questionTitleEditorWrap,children:(0,I.jsx)(b.Z.Item,{label:"题干",name:"name",labelCol:{span:24},rules:[{required:!0}],children:(0,I.jsx)(k.h,{scrollId:"name",watch:!0,height:140,placeholder:n,showNullButton:!0,onCMBeforeChange:function(e,n){!function(e,n,t,i){var s=e.getRange(n.from,n.to),r=0;if(n.text.forEach((function(e){r+=e.split(T).length-1})),"setValue"!==n.origin)if(s&&-1!==s.indexOf(T)){var l=s.split(T).length-1,a=x(e,n.from);console.log("删除".concat(l,"个, 前面有").concat(a,"个,新增").concat(r,"个")),i(l>1?Array.from({length:l},(function(e,n){return a+n})):a)}else if(r>0){var o=x(e,n.from);console.log("新增".concat(r,"个,之前有").concat(o,"个")),t(r,o)}}(e,n,N,E)}})})}),(0,I.jsx)(b.Z.List,{name:a,rules:[{validator:function(e,n){if(0===(null==n?void 0:n.length))return Promise.reject(new Error("答案不能为空"));var t,i=l()(n);try{for(i.s();!(t=i.n()).done;){var s=(t.value||{}).answer_text;if(null!=s&&s.some((function(e){return 0===(null==e?void 0:e.length)})))return Promise.reject(new Error("填空项答案不能为空"))}}catch(e){i.e(e)}finally{i.f()}return Promise.resolve()}}],children:function(e,n,t){var i=n.add,l=n.remove;t.errors;return y.current=i,q.current=l,(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(b.Z.Item,{label:"答案选项",required:!0,labelCol:{span:24}}),e.map((function(e,n){var t=e.key,i=e.name,l=s()(e,C);return(0,I.jsxs)(v.Z,{className:"mb20",align:"middle",wrap:!1,children:[(0,I.jsxs)(_.Z,{flex:"0 0 auto",className:"".concat(Z.Z.blankIndex),children:["填空项",n+1]}),(0,I.jsxs)(_.Z,{flex:1,children:[(0,I.jsxs)(v.Z,{align:"top",justify:"space-between",wrap:!1,children:[(0,I.jsx)(_.Z,{children:(0,I.jsx)(b.Z.Item,u()(u()({},l),{},{name:[i,"answer_text"],noStyle:!0,children:(0,I.jsx)(P,{})}))}),r&&(0,I.jsx)(_.Z,{flex:"224px",children:(0,I.jsx)(b.Z.Item,u()(u()({},l),{},{name:[i,"score"],label:"分值",rules:[{required:!0}],className:Z.Z.blankInputNumberWrapper,children:(0,I.jsx)(w.Z,{className:Z.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"按空给分请输入分值"})}))})]}),(0,I.jsx)(b.Z.Item,u()(u()({},l),{},{name:[i,"position"],noStyle:!0,children:(0,I.jsx)(g.Z,{type:"hidden"})}))]})]},t)}))]})}}),(null==F?void 0:F.length)>1&&(0,I.jsxs)(v.Z,{align:"middle",className:(null==F?void 0:F.length)>1?"mb30":"".concat(Z.Z.hide),children:[(0,I.jsx)(b.Z.Item,{name:"is_ordered",children:(0,I.jsx)(S,{})}),(0,I.jsx)(_.Z,{className:"ml10",children:"允许学生每个填空的答案与标准答案的顺序不一致"})]}),(0,I.jsx)("div",{onClick:function(){return h(!0)},children:(0,I.jsx)(b.Z.Item,{name:"analysis",label:"题目解析",labelCol:{span:24},children:(0,I.jsx)(k.x,{placeholder:"请编辑题目解析(非必填)",isEdit:m})})})]})}},19343:function(e,n,t){t.d(n,{Z:function(){return y}});var i=t(39647),s=t.n(i),r=t(79800),l=t.n(r),a=t(82242),o=t.n(a),c=t(85573),u=t.n(c),d=t(59301),p=t(95237),m=t(43604),h=t(78241),f=t(98887),x=t(60950),v=t(37712),_=["key","name"],g=u()(u()({},"正确","T"),"错误","F"),j=function(e){var n=e.value,t=e.onChange,i=e.form,s=1===(null==n?void 0:n.is_answer),r=null==n?void 0:n.choice_text,l=function(){var e=i.getFieldsValue().choices.map((function(e){return{choice_text:e.choice_text,is_answer:0}}));i.setFieldsValue({choices:e}),t(o()(o()({},n),{},{is_answer:1}))};return(0,v.jsxs)(p.Z,{className:f.Z.choiceWrap,align:"middle",wrap:!1,children:[(0,v.jsx)(m.Z,{onClick:l,className:"".concat(f.Z.choiceIndex," ").concat(f.Z.judgementIndex," ").concat(s?f.Z.activeAnswer:""),children:g[r]}),(0,v.jsx)(m.Z,{flex:1,className:"".concat(f.Z.editorWrap," ml15"),children:(0,v.jsx)("div",{className:"".concat(f.Z.inputBorder," ").concat(f.Z.placeholder," ").concat(s?f.Z.activeJudgementAnswer:""),children:r})}),(0,v.jsx)(m.Z,{flex:"0 0 auto",className:"ml15",children:(0,v.jsx)("div",{onClick:l,className:"".concat(f.Z.setAnswerBtn," ").concat(s?f.Z.activeAnswer:""),children:s?"正确答案":"设为答案"})})]})},y=function(e){var n=e.questionTitlePlaceholder,t=(e.choiceKey,e.form),i=(0,d.useState)(!1),r=l()(i,2),a=r[0],c=r[1];return(0,v.jsxs)("div",{className:f.Z.wrap,children:[(0,v.jsx)("div",{className:f.Z.questionTitleEditorWrap,children:(0,v.jsx)(h.Z.Item,{label:"题干",name:"name",labelCol:{span:24},rules:[{required:!0}],children:(0,v.jsx)(x.h,{scrollId:"name",watch:!0,height:140,placeholder:n})})}),(0,v.jsx)(h.Z.Item,{label:"答案选项",required:!0,labelCol:{span:24},children:(0,v.jsx)(h.Z.List,{name:"choices",rules:[{validator:function(e,n){return n.some((function(e){return 1===(null==e?void 0:e.is_answer)}))?Promise.resolve():Promise.reject(new Error("请设置正确答案"))}}],children:function(e){return(0,v.jsx)("div",{id:"choices",children:e.map((function(e){var n=e.key,i=e.name,r=s()(e,_);return(0,d.createElement)(h.Z.Item,o()(o()({},r),{},{key:n,name:i,noStyle:!0}),(0,v.jsx)(j,{form:t}))}))})}})}),(0,v.jsx)("div",{onClick:function(){return c(!0)},children:(0,v.jsx)(h.Z.Item,{name:"analysis",label:"题目解析",labelCol:{span:24},children:(0,v.jsx)(x.x,{placeholder:"请编辑题目解析(非必填)",isEdit:a})})})]})}},60950:function(e,n,t){t.d(n,{h:function(){return p},x:function(){return m}});var i=t(82242),s=t.n(i),r=t(39647),l=t.n(r),a=t(33987),o=t(98887),c=(t(59301),t(23599)),u=t(37712),d=["value","onChange","scrollId"],p=function(e){var n=e.value,t=e.onChange,i=e.scrollId,r=l()(e,d);return(0,u.jsx)("div",{id:i||"",children:(0,u.jsx)(a.Z,s()(s()({},r),{},{hidetoolBar:!0,defaultValue:n,onChange:function(e,n){console.log("a:",e,n),null!=n&&n.length?t(e,n):t(e)}}))})},m=function(e){var n=e.value,t=e.onChange,i=e.placeholder,s=e.height,r=void 0===s?140:s;return e.isEdit?(0,u.jsx)(a.Z,{watch:!0,isFocus:!0,height:r,placeholder:i,defaultValue:n,onChange:t}):(0,u.jsx)("div",{style:{cursor:"pointer"},children:n?(0,u.jsx)(c.Z,{className:o.Z.inputBorder,value:n}):(0,u.jsx)("div",{className:"".concat(o.Z.inputBorder," ").concat(o.Z.placeholder),children:i})})}},85628:function(e,n,t){t.d(n,{W:function(){return S}});var i=t(91232),s=t.n(i),r=t(79800),l=t.n(r),a=t(82242),o=t.n(a),c=t(39647),u=t.n(c),d=t(59301),p=t(8591),m=t(12563),h=t(78241),f=t(78673),x=t(95237),v=t(43604),_=t(6848),g=t(73782),j=t(94001),y=t(98887),b=t(60950),w=t(33987),k=t(39248),N=t(37712),Z=["value","onChange"],I=["key","name"],C=function(e){var n=e.value,t=e.onChange,i=u()(e,Z);return(0,N.jsx)(w.Z,o()(o()({},i),{},{defaultValue:null==n?void 0:n[0],onChange:function(e){t([e])}}))},P=function(e){var n=e.value,t=void 0===n?[]:n,i=e.onClose;return(0,N.jsx)(m.Z,{closable:!0,onClose:i,className:y.Z.keywordTag,children:null==t?void 0:t.join(" 或 ")})},S=function(e){var n=e.questionTitlePlaceholder,t=e.form,i=e.showKeywords,r=e.isMustKeyWords,a=void 0===r?i:r,c=(0,d.useState)(!1),m=l()(c,2),w=m[0],Z=m[1],S=(0,d.useState)(""),T=l()(S,2),q=T[0],E=T[1],F=h.Z.useWatch("use_keywords",t),O=h.Z.useWatch("question_score",t);return(0,N.jsxs)("div",{className:y.Z.wrap,children:[(0,N.jsx)("div",{className:y.Z.questionTitleEditorWrap,children:(0,N.jsx)(h.Z.Item,{label:"题干",name:"name",labelCol:{span:24},rules:[{required:!0}],children:(0,N.jsx)(b.h,{scrollId:"name",watch:!0,height:140,placeholder:n})})}),(0,N.jsx)(h.Z.Item,{label:"参考答案",name:"answer_texts",labelCol:{span:24},children:(0,N.jsx)(C,{watch:!0,height:140,placeholder:"请编辑参考答案(非必填)"})}),i&&!a&&(0,N.jsx)(h.Z.Item,{hidden:!0,name:"use_keywords",valuePropName:"checked",children:(0,N.jsx)(f.Z,{defaultChecked:!0})}),i&&a&&(0,N.jsxs)(x.Z,{align:"middle",className:"mb30",children:[(0,N.jsx)(h.Z.Item,{name:"use_keywords",valuePropName:"checked",children:(0,N.jsx)(f.Z,{})}),(0,N.jsx)(v.Z,{className:"ml10",children:"开启关键词自动判分"}),(0,N.jsx)(v.Z,{children:(0,N.jsx)(_.Z,{placement:"right",title:"选中后,需要设置每个关键词的分值,系统会根据设置的关键词进行自动判分; 所有关键词分值之和必须小于等于小题分值。",children:(0,N.jsx)(k.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})})})]}),(F||!a)&&(0,N.jsx)(h.Z.List,{name:"keywords",rules:[{validator:function(e,n){return a?null!=n&&n.length?(null==n?void 0:n.reduce((function(e,n){return e+n.score}),0))>parseFloat(O)?Promise.reject(new Error("所有关键词的分值之和必须小于等于该小题的分值")):Promise.resolve():Promise.reject(new Error("请输入关键词")):Promise.resolve()}}],children:function(e,n){var i=n.add,r=n.remove;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("div",{className:"".concat(y.Z.title," mb10"),children:a?"关键词":(0,N.jsx)("span",{style:{color:"#9096A3"},children:"判分关键词"})}),(0,N.jsxs)(x.Z,{align:"middle",className:"font14 mb30",children:[(0,N.jsx)(v.Z,{flex:1,children:(0,N.jsx)(g.Z,{value:q,onChange:function(e){E(e.target.value)},maxLength:50,allowClear:!0,onPressEnter:function(e){var n,r,l,a,o,c="".concat(null===(n=e.target)||void 0===n?void 0:n.value).replaceAll(" ",""),u=null==c||null===(r=c.split("|"))||void 0===r?void 0:r.filter((function(e){return!!e})),d=t.getFieldValue("keywords"),m=(null==d||null===(l=d.map((function(e){return null==e?void 0:e.keyword})))||void 0===l?void 0:l.flat())||[],h=s()(u);try{for(h.s();!(a=h.n()).done;){var f=a.value;if(m.includes(f))return void p.ZP.error("为避免判分错误,请勿设置相同的关键词")}}catch(e){h.e(e)}finally{h.f()}(o=c)&&(new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~!@#¥……&*()—【】‘;:”“。,、?「」『』_\\+\\-·%《》]|[\\\\/]"),"|"!==o||(p.ZP.warning("关键词不能只输入一个“|”字符!"),0))&&(i({keyword:u,score:1}),E(""))},className:y.Z.inputBorder,placeholder:"支持设置多个关键词;并列关键词(或的关系)请用“|”分隔开"})}),(0,N.jsx)(v.Z,{flex:"148px",style:{textAlign:"right",color:"#9096A3"},children:"“回车键”保存关键词"})]}),e.map((function(e){var n=e.key,t=e.name,i=u()(e,I);return(0,N.jsx)(x.Z,{className:"mb20",style:{marginRight:148},children:(0,N.jsx)(v.Z,{flex:1,children:(0,N.jsxs)(x.Z,{align:"middle",justify:"space-between",children:[(0,N.jsx)(h.Z.Item,o()(o()({},i),{},{name:[t,"keyword"],children:(0,N.jsx)(P,{onClose:function(){return r(t)}})})),a&&(0,N.jsx)(h.Z.Item,o()(o()({},i),{},{name:[t,"score"],label:"分值",rules:[{required:!0}],className:y.Z.blankInputNumberWrapper,children:(0,N.jsx)(j.Z,{className:y.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"请输入关键词分数"})}))]})})},n)}))]})}}),(0,N.jsx)("div",{onClick:function(){return Z(!0)},children:(0,N.jsx)(h.Z.Item,{name:"analysis",label:"题目解析",labelCol:{span:24},children:(0,N.jsx)(b.x,{placeholder:"请编辑题目解析(非必填)",isEdit:w})})})]})}},23599:function(e,n,t){t.d(n,{Z:function(){return V}});var i=t(82242),s=t.n(i),r=t(37205),l=t.n(r),a=t(91232),o=t.n(a),c=t(79800),u=t.n(c),d=t(59301),p=(t(86622),t(32834)),m=t.n(p),h=t(11690);var f=[],x=["<ul>"],v=new(m().Renderer),_=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function g(){f.length=0,x=["<ul>"]}var j={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function y(e,n,t,i){if(n>=e.length||e[n].level<=t)return n;var s=e[n];i.push("<li><a href='#"+s.anchor+"'>"+s.text+"</a>");var r=[];return n=y(e,++n,s.level,r),r.length>0&&(i.push("<ul>"),r.forEach((function(e){i.push(e)})),i.push("</ul>")),i.push("</li>"),n=y(e,n,t,i)}function b(){return y(f,0,0,x),x.push("</ul>"),x.join("")}var w={heading:function(e){var n=_.exec(e);if(n)return{type:"heading",raw:n[0],depth:n[1].length,text:n[2]}},fences:function(e){var n=this.rules.block.fences.exec(e);if(n){var t=n[0],i=function(e,n){var t=e.match(/^(\s+)(?:```)/);if(null===t)return n;var i=t[1];return n.split("\n").map((function(e){var n=e.match(/^\s+/);return null===n?e:u()(n,1)[0].length>=i.length?e.slice(i.length):e})).join("\n")}(t,n[3]||""),s=n[2]?n[2].trim():n[2];if(["latex","katex","math"].indexOf(s)>=0){var r=Z(),l=i;i=r,I[r]={type:"block",expression:l}}return{type:"code",raw:t,lang:s,text:i}}}},k=/(?:\${2})([^\n`]+?)(?:\${2})/gi,N=0,Z=function(){return"__special_katext_id_".concat(N++,"__")},I={};function C(){return I}function P(){N=0,I={}}function S(e){return e=e.replace(k,(function(e,n){var t=Z();return I[t]={type:"inline",expression:n},t}))}var T=v.listitem;v.listitem=function(e){return T(S(e))};var q=v.paragraph;v.paragraph=function(e){return q(S(e))};var E=v.tablecell;v.tablecell=function(e,n){return E(S(e),n)},v.code=function(e,n,t){var i=(n||"").match(/\S*/)[0];return i?["latex","katex","math"].indexOf(i)>=0?"<p class='editormd-tex'>".concat(e,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(n,'">').concat(t?e:(0,h.escape)(e,!0),"</code></pre>\n"):'<pre class="prettyprint linenums"><code>'+(t?e:(0,h.escape)(e,!0))+"</code></pre>"},v.heading=function(e,n,t){var i=this.options.headerPrefix+t.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return f.push({anchor:i,level:n,text:e}),"<h"+n+' id="'+i+'">'+e+"</h"+n+">"},m().setOptions({silent:!0,gfm:!0,pedantic:!1}),m().use({tokenizer:w,renderer:v});var F=m(),O=(t(64018),t(45071)),L=t(15309),M=t(15342),R=t(1012),A=t(13282),B=t(37712),D="@▁@",z=/<pre[^>]*>/g;var V=function(e){var n=e.value,t=void 0===n?"":n,i=e.className,r=e.showTextOnly,a=e.showLines,c=e.style,p=void 0===c?{}:c,m=e.stylesPrev,h=void 0===m?{}:m,f=e.highlightKeywords,x=e.showProgramFill,v=(e.isProgramFill,e.disabledFill),_=void 0!==v&&v,y=e.programFillValue,w=e.onFillChange,k=void 0===w?function(e){}:w,N=e.onFillBlur,Z=void 0===N?function(){}:N,I=String(t),S=(0,d.useState)(""),T=u()(S,2),q=T[0],E=T[1],V=(0,d.useState)("office"),W=u()(V,2),U=W[0],H=W[1],G=(0,d.useState)([]),K=u()(G,2),Y=K[0],X=K[1],J=(0,d.useRef)("a"+(0,R.Z)()),Q={},$=function(e){return e.replace(/<style.*?>([\s\S]+?)<\/style>/gim,(function(e,n){var t=n.replace(/(\n|\r)/g,"").split("}"),i=[];return t.map((function(e){""!=e&&i.push(".".concat(J.current," ").concat(e))})),"<style>".concat(i.join("}"),"</style>")}))},ee=(0,d.useMemo)((function(){try{I=I.replace(/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,"("+L.Z.API_SERVER+"/api/attachments/").replace(/\"\/api\/attachments\/|\"\/attachments\/download\//g,'"'+L.Z.API_SERVER+"/api/attachments/").replace(/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,'"'+L.Z.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,"\n")}catch(e){}if(x){var e=-1;return I=I.replaceAll("<","<").replaceAll(">",">").replace(/(@▁▁@|@▁@)/g,(function(n,t,i){return function(e,n){var t=document.createElement(e===D?"input":"textarea");t.style.width="100%",t.style.height=e===D?"40px":"151px",t.rows=5,t.spellcheck=!1,t.name="edu-program-fill",t.placeholder="请输入",t.dataset.id=n;var i=Object.keys(Q).length;return Q[i]=t,'<span class="edu-program-fill-wrap '.concat(e===D?"":"show",'" style="width:').concat(e===D?"200px":"100%",'"><span>').concat(t.outerHTML,'<span class="edu-program-fill-score"></span></span></span>')}(n,++e)})),'<pre style="background:#fff;padding:4px">'.concat($(I||""),"</pre>")}var n=F(I);n=$(n);var t=C();I.match(/\[TOC\]/)&&(n=n.replace("<p>[TOC]</p>",b()),g()),n=n.replace(/(__special_katext_id_\d+__)/g,(function(e,n){var i=t[n],s=i.type,r=i.expression;return(0,M.renderToString)(function(e){var n=document.createElement("div");return n.innerHTML=e,0===n.childNodes.length?"":n.childNodes[0].nodeValue}(r)||"",{displayMode:"block"===s,throwOnError:!1,output:"html"})})),n=n.replace(/▁/g,"▁▁▁"),P();var i=document.createElement("div");return i.innerHTML=n,f?(ie(i,f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),i.innerHTML):r?i.innerText:(setTimeout((function(){return le()}),500),i.innerHTML)}),[I,f]);(0,d.useEffect)((function(){se.current&&se.current.querySelectorAll(["input","textarea"]).forEach((function(e){e.oninput=ne,e.onblur=te}))}),[Y]),(0,d.useEffect)((function(){if(null!=y&&y.length){var e,n=se.current.querySelectorAll(".edu-program-fill-score"),t=se.current.querySelectorAll('[name="edu-program-fill"]'),i=o()(t.entries());try{for(i.s();!(e=i.n()).done;){var s,r=u()(e.value,2),l=r[0],a=r[1];a.value=null===(s=y[l])||void 0===s?void 0:s.value,"warning"===y[l].type?a.className="program-fill-warning":"success"===y[l].type?a.className="program-fill-success":a.className=""}}catch(e){i.e(e)}finally{i.f()}var c,d=o()(n.entries());try{for(d.s();!(c=d.n()).done;){var p,m,h=u()(c.value,2),f=h[0];h[1].innerHTML=null!==(p=y[f])&&void 0!==p&&p.score?"".concat(null===(m=y[f])||void 0===m?void 0:m.score,"分"):""}}catch(e){d.e(e)}finally{d.f()}X(y)}}),[y]);var ne=function(e){Y[e.target.dataset.id]=Y[e.target.dataset.id]||{},Y[e.target.dataset.id].value=e.target.value,X(l()(Y)),k(Y,e.target.dataset.id)},te=function(e){Y[e.target.dataset.id]=Y[e.target.dataset.id]||{},Y[e.target.dataset.id].value=e.target.value,X(l()(Y)),Z(Y,e.target.dataset.id)};function ie(e,n){return e.childNodes.forEach((function(e){if(e.childNodes.length>0)ie(e,n);else if("IMG"!==e.nodeName)if(e.innerHTML){var t;e.innerHTML=null===(t=e.innerHTML)||void 0===t?void 0:t.replace(new RegExp(n,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>')}else{var i=document.createElement("span");i.innerHTML=e.textContent.replace(new RegExp(n,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),e.replaceWith(i)}}))}var se=(0,d.useRef)();function re(e){var n=e.target;if("A"===n.tagName.toUpperCase()){var t=n.getAttribute("href");if(t.indexOf("office")>-1)e.preventDefault(),E(t),H("office");else if(t.indexOf("application/pdf")>-1)e.preventDefault(),E(t),H("pdf");else if(t.indexOf("text/html")>-1)e.preventDefault(),E(t),H("html");else if(t.startsWith("#")){e.preventDefault();var i=document.getElementById(t.replace("#",""));i&&i.scrollIntoView(!0)}}}j.WebkitLineClamp=a,a&&(p=s()(s()({},p),j));var le=function(){var e,n=null===(e=se.current)||void 0===e?void 0:e.querySelectorAll("video");null==n||n.forEach((function(e){if(e.oncontextmenu=function(){return!1},e.src.indexOf(".m3u8")>-1)if(e.canPlayType("application/vnd.apple.mpegurl"));else if(O.ZP.isSupported()){var n=new O.ZP;n.loadSource(e.src),n.attachMedia(e)}}))};return(0,d.useEffect)((function(){if(se.current&&ee&&ee.match(z)&&window.PR.prettyPrint(),se.current)return se.current.addEventListener("click",re),function(){var e;null===(e=se.current)||void 0===e||e.removeEventListener("click",re),P(),g()}}),[ee,se.current,re]),(0,B.jsxs)(B.Fragment,{children:[r&&(0,B.jsx)("div",{ref:se,children:ee}),!r&&(0,B.jsx)("div",{ref:se,style:s()({},p),className:"".concat(i||""," ").concat(_?"disabled-fill":""," markdown-body ").concat(J.current),dangerouslySetInnerHTML:{__html:ee}}),(0,B.jsx)(A.Z,{close:!0,data:q,type:null!=q&&q.length?U:"",style:s()({},h),onClose:function(){return E("")}})]})}},90155:function(e,n,t){t.d(n,{Z:function(){return O},P:function(){return E}});var i=t(37205),s=t.n(i),r=t(39647),l=t.n(r),a=t(7557),o=t.n(a),c=t(82242),u=t.n(c),d=t(41498),p=t.n(d),m=t(79800),h=t.n(m),f=t(59301),x=t(78241),v=t(43418),_=t(5112),g=t(73782),j=t(61998),y="brief___LOzpE",b="contentTitle___xkdcN",w="content___Vtri0",k="antdTable___s8T2N",N="tableCell___kN9Fw",Z="antdModal___WVBk3",I="orangeColor___ryB2u",C=t(18620),P=t(37712),S=["isImportMultipleCourse"],T=function(e){var n=e.studentNames,t=e.total;return t>3?(0,P.jsxs)(P.Fragment,{children:["课堂内有",(0,P.jsx)("span",{className:I,children:null==n?void 0:n.join("、")}),"等",(0,P.jsx)("span",{className:I,children:t}),"名学生"]}):(0,P.jsxs)(P.Fragment,{children:["课堂内有",(0,P.jsx)("span",{className:I,children:null==n?void 0:n.join("、")}),["","一","两","三"][t],"名学生"]})},q=function(e){var n=e.onCancel,t=e.onOk,i=e.visible,s=(e.inPaper,e.renderData),r=(e.type,e.isMultipleCourse),l=void 0!==r&&r,a=x.Z.useForm(),c=h()(a,1)[0],d=(0,f.useState)(1),m=h()(d,2),g=m[0],j=m[1],y=(0,f.useState)(!1),b=h()(y,2),k=b[0],N=b[1],C=(0,f.useMemo)((function(){return 1===(null==s?void 0:s.total_num)&&1===(null==s?void 0:s.can_copy_num)}),[s]),S=(0,f.useMemo)((function(){var e;return null==s||null===(e=s.course_data_list)||void 0===e?void 0:e.filter((function(e){return e.is_show}))}),[s]);return(0,P.jsx)(P.Fragment,{children:C?(0,P.jsxs)(v.Z,{centered:!0,closable:!0,open:i,destroyOnClose:!0,title:"提示",className:Z,width:682,confirmLoading:k,onCancel:n,onOk:p()(o()().mark((function e(){var n,i,r;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return N(!0),n=g,l&&(r=u()({},c.getFieldsValue()),n=null==s||null===(i=s.course_data_list)||void 0===i?void 0:i.map((function(e){return void 0!==r[e.id]?u()(u()({},e),{},{is_copy:r[e.id]}):e}))),e.next=5,t(n);case 5:N(!1);case 6:case"end":return e.stop()}}),e)}))),children:[(0,P.jsx)("div",{className:w,style:{marginBottom:20},children:l?"检测到以下课堂已在教学课堂中使用,请问是否复制成新的实训发送至教学课堂中?":(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(T,{studentNames:null==s?void 0:s.student_names,total:null==s?void 0:s.student_count}),"学习过该实践项目。该项目支持复制,请选择是否将该项目复制为新项目发送至课堂中?"]})}),l?(0,P.jsx)(x.Z,{form:c,preserve:!1,children:null==S?void 0:S.map((function(e){return(0,P.jsxs)(f.Fragment,{children:[(0,P.jsx)("h3",{className:"ml15 mb5",children:e.name}),(0,P.jsx)(x.Z.Item,{name:e.id,initialValue:1,children:(0,P.jsxs)(_.ZP.Group,{className:w,children:[(0,P.jsx)(_.ZP,{value:1,style:{color:"#464f66"},children:"复制实训"}),(0,P.jsx)(_.ZP,{value:0,style:{color:"#464f66"},children:"不复制实训"})]})})]},e.id)}))}):(0,P.jsxs)(_.ZP.Group,{value:g,onChange:function(e){return j(e.target.value)},className:w,style:{marginBottom:30},children:[(0,P.jsx)(_.ZP,{value:1,style:{color:"#464f66"},children:"复制"}),(0,P.jsx)(_.ZP,{value:0,style:{color:"#464f66"},children:"不复制"})]}),(0,P.jsxs)("div",{children:[(0,P.jsx)("div",{className:w,style:{marginBottom:10},children:"* 说明:"}),(0,P.jsx)("div",{className:w,style:{marginBottom:20},children:"1、复制:系统将复制并创建一个新的项目发送到课堂中使用(不会复制学生的挑战记录),新的项目支持进行编辑并与原项目信息互不影响。"}),(0,P.jsx)("div",{className:"".concat(w," ").concat(I),children:"2、不复制:当前项目会被直接发送到课堂中使用,挑战过该项目的学生再次进入项目开启挑战时,会清空之前的挑战记录。"})]})]}):(0,P.jsx)(v.Z,{centered:!0,closable:!0,destroyOnClose:!0,open:i,confirmLoading:k,title:"提示",width:682,onCancel:n,onOk:p()(o()().mark((function e(){var n,i,r;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return N(!0),n=0,l&&(r=u()({},c.getFieldsValue()),n=null==s||null===(i=s.course_data_list)||void 0===i?void 0:i.map((function(e){return void 0!==r[e.id]?u()(u()({},e),{},{is_use:r[e.id]}):e}))),e.next=5,t(n);case 5:N(!1);case 6:case"end":return e.stop()}}),e)}))),children:(0,P.jsxs)("div",{className:w,children:[(0,P.jsx)(T,{studentNames:null==s?void 0:s.student_names,total:null==s?void 0:s.student_count}),"学习过该实践项目。",l?(0,P.jsxs)(x.Z,{form:c,preserve:!1,children:[(0,P.jsx)("h3",{children:"当前实训不可复制,已经检测到以下课堂存在该实训,同一实训在课堂中重复使用时,会导致成绩互相影响,请确认是否继续使用"}),null==S?void 0:S.map((function(e){return(0,P.jsxs)(f.Fragment,{children:[(0,P.jsx)("h3",{className:"ml15 mb5",children:e.name}),(0,P.jsx)(x.Z.Item,{name:e.id,initialValue:1,children:(0,P.jsxs)(_.ZP.Group,{className:w,children:[(0,P.jsx)(_.ZP,{value:1,style:{color:"#464f66"},children:"继续使用"}),(0,P.jsx)(_.ZP,{value:0,style:{color:"#464f66"},children:"不使用"})]})})]},e.id)}))]}):(0,P.jsxs)("div",{children:["该项目不支持复制,若确认继续发送,",(0,P.jsx)("span",{className:I,children:"当前项目会被直接发送到课堂中使用,挑战过该项目的学生再次进入项目开启挑战时,会清空之前的挑战记录。"}),"(如果不想清空学生之前的挑战记录,建议参照该实践项目的内容自行创建一个新的项目,或者尝试联系项目创建人开放本项目的复制权限)。"]})]})})})},E=function(){var e=(0,f.useState)(!1),n=h()(e,2),t=n[0],i=n[1],s=(0,f.useState)(),r=h()(s,2),a=r[0],c=r[1],u=function(){var e=p()(o()().mark((function e(n){var t,s,r,a,u;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.isImportMultipleCourse,s=void 0!==t&&t,r=l()(n,S),e.next=3,(0,C.Tr)(r);case 3:if(!("status"in(a=e.sent))){e.next=6;break}return e.abrupt("return",!1);case 6:if(!s){e.next=13;break}if(!(null==a||null===(u=a.course_data_list)||void 0===u?void 0:u.some((function(e){return e.is_show})))){e.next=12;break}return c(a),i(!0),e.abrupt("return",!0);case 12:return e.abrupt("return",a.course_data_list||[]);case 13:if(0!==a.student_count){e.next=15;break}return e.abrupt("return",!1);case 15:return c(a),i(!0),e.abrupt("return",!0);case 18:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return[t,function(){return i(!1)},a,u]},F=function(e){var n=x.Z.useForm(),t=h()(n,1)[0],i=(0,f.useState)(!1),r=h()(i,2),l=r[0],a=r[1],c=e.onCancel,u=e.onOk,d=e.visible,m=e.inPaper,w=void 0!==m&&m,C=e.renderData,S=e.type,q=e.isMultipleCourse,E=void 0!==q&&q,F=e.position,O=(0,f.useMemo)((function(){return w?[{title:"实践项目名称",dataIndex:"name",width:424,align:"center",ellipsis:!0,className:N,render:function(e,n){return(0,P.jsx)("a",{href:"/shixuns/".concat(n.identifier,"/challenges"),target:"_blank",children:e})}},{title:"是否复制",dataIndex:"is_copy",align:"center",render:function(e,n){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(x.Z.Item,{name:["".concat("subject"===S?n.stage_shixun_id:n.shixun_course_id||n.id),"is_copy"],initialValue:1,children:(0,P.jsxs)(_.ZP.Group,{children:[(0,P.jsx)(_.ZP,{value:1,children:"是"}),(0,P.jsx)(_.ZP,{value:0,children:"否"})]})}),(0,P.jsx)(x.Z.Item,{name:["".concat("subject"===S?null==n?void 0:n.stage_shixun_id:n.shixun_course_id||n.id),"is_use"],hidden:!0,initialValue:1,children:(0,P.jsx)(g.Z,{type:"hidden"})})]})}}]:[{title:"实践项目名称",dataIndex:"name",width:424,align:"center",ellipsis:!0,className:N,render:function(e,n){return(0,P.jsx)("a",{href:"/shixuns/".concat(n.identifier,"/challenges"),target:"_blank",children:e})}},{title:"是否使用",dataIndex:"is_use",align:"center",render:function(e,n){return(0,P.jsx)(x.Z.Item,{name:["".concat("subject"===S?n.stage_shixun_id:n.shixun_course_id||n.id),"is_use"],initialValue:1,children:(0,P.jsxs)(_.ZP.Group,{children:[(0,P.jsx)(_.ZP,{value:1,children:"是"}),(0,P.jsx)(_.ZP,{value:0,children:"否"})]})})}},{title:"是否复制",dataIndex:"is_copy",align:"center",render:function(e,n){return(0,P.jsx)(x.Z.Item,{name:["".concat("subject"===S?n.stage_shixun_id:n.shixun_course_id||n.id),"is_copy"],initialValue:1,children:(0,P.jsxs)(_.ZP.Group,{children:[(0,P.jsx)(_.ZP,{value:1,children:"是"}),(0,P.jsx)(_.ZP,{value:0,children:"否"})]})})}}]}),[w]),L=(0,f.useMemo)((function(){return w?[{title:"实践项目名称",dataIndex:"name",width:424,className:N,align:"center",ellipsis:!0,render:function(e,n){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("a",{href:"/shixuns/".concat(n.identifier,"/challenges"),target:"_blank",children:e}),(0,P.jsx)(x.Z.Item,{name:["".concat("subject"===S?null==n?void 0:n.stage_shixun_id:n.shixun_course_id||n.id),"is_copy"],hidden:!0,initialValue:0,children:(0,P.jsx)(g.Z,{type:"hidden"})}),(0,P.jsx)(x.Z.Item,{name:["".concat("subject"===S?null==n?void 0:n.stage_shixun_id:n.shixun_course_id||n.id),"is_use"],hidden:!0,initialValue:1,children:(0,P.jsx)(g.Z,{type:"hidden"})})]})}}]:[{title:"实践项目名称",dataIndex:"name",width:424,className:N,ellipsis:!0,align:"center",render:function(e,n){return(0,P.jsx)("a",{href:"/shixuns/".concat(n.identifier,"/challenges"),target:"_blank",children:e})}},{title:"是否使用",dataIndex:"is_use",align:"center",render:function(e,n){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(x.Z.Item,{name:["".concat("subject"===S?null==n?void 0:n.stage_shixun_id:n.shixun_course_id||n.id),"is_use"],initialValue:0,children:(0,P.jsxs)(_.ZP.Group,{children:[(0,P.jsx)(_.ZP,{value:1,children:"是"}),(0,P.jsx)(_.ZP,{value:0,children:"否"})]})}),(0,P.jsx)(x.Z.Item,{name:["".concat("subject"===S?null==n?void 0:n.stage_shixun_id:n.shixun_course_id||n.id),"is_copy"],hidden:!0,initialValue:0,children:(0,P.jsx)(g.Z,{type:"hidden"})})]})}}]}),[w]);if(E){var M={title:"课堂名称",ellipsis:!0,dataIndex:"course_name",width:190,align:"center",className:N,render:function(e,n){return(0,P.jsx)("a",{href:"/classrooms/".concat(n.course_id),children:e})}};O=[M].concat(s()(O)),L=[M].concat(s()(L))}var R=(0,f.useMemo)((function(){return function(e){var n=e.used,t=e.copy,i=e.canNotCopy,s=e.studentNames,r=e.studentCount,l=e.inPaper,a=e.is_random,o=void 0!==a&&a,c=e.position,u=(void 0===c?"":c)||(l?"试卷":"课程");return(0,P.jsxs)("span",{children:[(0,P.jsx)(T,{studentNames:s,total:r}),"学习过",u,"中的",(0,P.jsx)("span",{className:I,children:n}),"个项目,",t>0&&i>0?(0,P.jsxs)(P.Fragment,{children:["其中",(0,P.jsx)("span",{className:I,children:t}),"个项目支持复制,",(0,P.jsx)("span",{className:I,children:i}),"个项目不支持复制"]}):t>0&&0===i?(0,P.jsxs)(P.Fragment,{children:["其中",(0,P.jsx)("span",{className:I,children:t}),"个项目支持复制"]}):0===t&&i>0?(0,P.jsxs)(P.Fragment,{children:["其中",(0,P.jsx)("span",{className:I,children:i}),"个项目不支持复制"]}):void 0,"。请选择",o?"":"是否继续使用和","是否复制为新项目发送至课堂中?"]})}({used:null==C?void 0:C.repeat_shixun_num,copy:null==C?void 0:C.can_copy_num,canNotCopy:null==C?void 0:C.no_copy_num,studentNames:null==C?void 0:C.student_names,studentCount:null==C?void 0:C.student_count,is_random:null==C?void 0:C.is_random,inPaper:w,position:F})}),[C,w,F]);return(0,P.jsx)(v.Z,{title:"提示",centered:!0,open:d,confirmLoading:l,onOk:p()(o()().mark((function e(){var n,i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a(!0),n=t.getFieldsValue(),i=Object.keys(n).map((function(e){return{id:parseInt(e.split("_")[0]),course_id:parseInt(e.split("_")[1]),is_use:n[e].is_use,is_copy:n[e].is_copy}})),e.next=5,u(i);case 5:a(!1);case 6:case"end":return e.stop()}}),e)}))),onCancel:c,width:880,okText:"确认",className:Z,destroyOnClose:!0,children:(0,P.jsxs)(x.Z,{form:t,preserve:!1,children:[(0,P.jsx)("div",{className:y,children:R}),(0,P.jsxs)("div",{style:{marginBottom:30},children:[(0,P.jsx)("div",{style:{marginBottom:20},children:"* 说明"}),(0,P.jsx)("div",{style:{marginBottom:20},children:"1、复制:系统将复制并创建一个新的项目发送到课堂中使用(不会复制学生的挑战记录),新的项目支持进行编辑并与原项目信息互不影响。"}),(0,P.jsx)("div",{className:I,children:"2、不复制:当前项目会被直接发送到课堂中使用,挑战过该项目的学生再次进入项目开启挑战时,会清空之前的挑战记录。"})]}),(null==C?void 0:C.can_copy_num)>0&&(0,P.jsxs)("div",{children:[(0,P.jsx)("div",{className:b,children:"支持复制的项目"}),(0,P.jsx)(j.Z,{columns:O,className:k,dataSource:null==C?void 0:C.can_copy_list,rowKey:"subject"===S?"stage_shixun_id":"id",pagination:!1,scroll:{y:240},bordered:!0})]}),(null==C?void 0:C.no_copy_num)>0&&(0,P.jsxs)("div",{children:[(0,P.jsx)("div",{className:b,children:"不支持复制的项目"}),(0,P.jsx)(j.Z,{columns:L,className:k,dataSource:null==C?void 0:C.no_copy_list,rowKey:"subject"===S?"stage_shixun_id":"id",pagination:!1,scroll:{y:200},bordered:!0})]}),(null==C?void 0:C.no_use_list.length)>0&&(null==C?void 0:C.no_use_list.map((function(e){return(0,P.jsxs)("div",{children:[(0,P.jsx)(x.Z.Item,{name:["".concat("subject"===S?null==e?void 0:e.stage_shixun_id:e.shixun_course_id||e.id),"is_copy"],hidden:!0,initialValue:0,children:(0,P.jsx)(g.Z,{type:"hidden"})}),(0,P.jsx)(x.Z.Item,{name:["".concat("subject"===S?null==e?void 0:e.stage_shixun_id:e.shixun_course_id||e.id),"is_use"],hidden:!0,initialValue:1,children:(0,P.jsx)(g.Z,{type:"hidden"})})]},"subject"===S?e.stage_shixun_id:e.shixun_course_id||e.id)})))]})})},O=function(e){return"multiple"===e.modalType?(0,P.jsx)(F,u()({},e)):(0,P.jsx)(q,u()({},e))}},58152:function(e,n,t){t.d(n,{Z:function(){return a}});t(59301);var i=t(65363),s="ldsRing___mpBZC",r="idsRingWrapper___Of9_n",l=t(37712),a=function(e){var n=e.message,t=e.className,a=(e.children,e.style),o=void 0===a?{}:a;return(0,l.jsxs)("div",{className:"".concat(r," ").concat(t),children:[(0,l.jsxs)("div",{className:s,children:[(0,l.jsx)("div",{}),(0,l.jsx)("div",{}),(0,l.jsx)("div",{}),(0,l.jsx)("div",{})]}),n?(0,l.jsx)("p",{style:o,children:n}):null,(0,l.jsx)(i.Outlet,{})]})}},35028:function(e,n,t){t.d(n,{h:function(){return v}});var i=t(82242),s=t.n(i),r=t(79800),l=t.n(r),a=t(59301),o=t(57809),c=t(78241),u=t(3113),d=t(89780),p=t.n(d),m=(t(48860),t(48838),t(37712)),h=o.default.Option,f={labelCol:{span:4},wrapperCol:{span:20}},x={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};function v(e){var n=e.value,t=e.onChange,i=e.mode,r=e.options,o=void 0===r?{}:r,c=(0,a.useRef)(),u=(0,a.useState)(),d=l()(u,2),h=d[0],f=d[1];return(0,a.useEffect)((function(){if(h){var e=function(e){var n=e.getValue();t&&t(n)};return h.on("change",e),function(){h.off("change",e)}}}),[h,t]),(0,a.useEffect)((function(){h&&h.setOption("mode",i)}),[h,i]),(0,a.useEffect)((function(){h&&(n===h.getValue()&&""!==n||setTimeout((function(){h.setValue(n||"")}),300))}),[h,n]),(0,a.useEffect)((function(){if(c.current&&!h){var e=p().fromTextArea(c.current,s()({mode:i,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},o));f(e)}}),[c.current,h]),(0,m.jsx)("div",{className:"my-codemirror-container",children:(0,m.jsx)("textarea",{ref:c})})}n.Z=function(e){var n=e.callback,t=e.onCancel,i=(0,a.useState)("python"),r=l()(i,2),d=r[0],p=r[1];return(0,m.jsxs)(c.Z,s()(s()({},f),{},{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(e){n(e)},children:[(0,m.jsx)(c.Z.Item,{label:"代码语言",name:"language",children:(0,m.jsx)(o.default,{getPopupContainer:function(e){return e.parentNode},onChange:function(e){p(x[e][1])},children:Object.keys(x).map((function(e){return(0,m.jsx)(h,{value:e,children:x[e][0]},e)}))})}),(0,m.jsx)(c.Z.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}],children:(0,m.jsx)(v,{mode:d})}),(0,m.jsxs)("div",{className:"flex-container flex-end",children:[(0,m.jsx)(u.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,m.jsx)(u.ZP,{type:"ghost",onClick:t,children:"取消"})]})]}))}},33987:function(e,n,t){t.d(n,{Z:function(){return oe}});var i=t(91232),s=t.n(i),r=t(7557),l=t.n(r),a=t(41498),o=t.n(a),c=t(79800),u=t.n(c),d=t(85573),p=t.n(d),m=t(59301),h=t(89780),f=t.n(h),x=t(76374),v=(t(48860),t(6313),t(25717),t(99498),t(25419),t(67549),t(23599)),_=t(37712),g=function(e){var n=e.value,t=void 0===n?"":n,i=(e.className,e.showTextOnly,e.showLines,e.style,(0,m.useMemo)((function(){return""}),[t]));return(0,_.jsx)(_.Fragment,{children:(0,_.jsx)("div",{dangerouslySetInnerHTML:{__html:i}})})},j=t(82242),y=t.n(j),b=[{title:"粗体",icon:"icon-bold",actionName:"bold"},{title:"斜体",icon:"icon-italic",actionName:"italic"},"|",{title:"无序列表",icon:"icon-unorder-list",actionName:"list-ul"},{title:"有序列表",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"行内代码",icon:"icon-code",actionName:"code"},{title:"代码块(多语言风格)",icon:"icon-file-code",actionName:"code-block"},{title:"链接",icon:"icon-link",actionName:"link"},"|",{title:"行内公式",icon:"icon-sum",actionName:"inline-latex"},{title:"多行公式",icon:"icon-formula",actionName:"latex"},"|",{title:"添加图片",icon:"icon-picture",actionName:"upload-image"},{title:"表格",icon:"icon-table",actionName:"add-table"},"|",{title:"换行",icon:"icon-minus",actionName:"line-break"},{title:"清空",icon:"icon-eraser",actionName:"eraser"}];function w(e){var n=e.onActionCallback,t=e.title,i=e.icon,s=e.actionName,r=e.className,l=void 0===r?"":r,a=e.children;return(0,_.jsxs)("a",{title:t,className:l,onClick:function(){n(s)},children:[(0,_.jsx)("i",{className:"md-iconfont ".concat(i)}),a]})}var k=function(e){var n=e.watch,t=e.showNullButton,i=e.showNullProgramButton,s=e.onActionCallback,r=e.fullScreen,l=e.insertTemp,a=e.hidetoolBar,o=[].concat(b,[{title:"".concat(n?"关闭实时预览":"开启实时预览"),icon:"".concat(n?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return(0,_.jsxs)("ul",{className:"markdown-toolbar-container",children:[!a&&o.map((function(e,n){return(0,_.jsx)("li",{children:e.actionName?(0,_.jsx)(w,y()(y()({},e),{},{onActionCallback:s})):(0,_.jsx)("span",{className:"v-line"})},n)})),t?(0,_.jsx)("li",{children:(0,_.jsx)(w,{icon:"icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-null-ch",onActionCallback:s,children:(0,_.jsx)("span",{className:"fill-tip",children:"点击插入\b填空项"})})}):null,i?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("li",{children:(0,_.jsx)(w,{icon:"icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-signal",onActionCallback:s,children:(0,_.jsx)("span",{className:"fill-tip",children:"添加单行填空项"})})}),(0,_.jsx)("li",{children:(0,_.jsx)(w,{icon:"icon-uniE900 insert-blank",className:"btn-null",title:"增加填空",actionName:"add-multiple",onActionCallback:s,children:(0,_.jsx)("span",{className:"fill-tip",children:"添加多行填空项"})})})]}):null,l&&(0,_.jsx)("li",{children:(0,_.jsx)(w,{icon:"icon-edit",className:"btn-null",title:"插入模板",actionName:"inster-template-".concat(l),onActionCallback:s,children:(0,_.jsx)("span",{className:"fill-tip",children:"插入模板"})})}),(0,_.jsx)("li",{className:"btn-full-screen",children:(0,_.jsx)(w,{icon:"".concat(r?"icon-shrink":"icon-enlarge"),title:r?"关闭全屏":"开启全屏",actionName:"trigger-full-screen",onActionCallback:s})})]})},N=t(56386),Z=t(78241),I=t(73782),C=t(3113),P={labelCol:{span:4},wrapperCol:{span:20}},S=function(e){var n=e.callback,t=e.onCancel;return(0,_.jsxs)(Z.Z,y()(y()({},P),{},{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:function(e){n(e)},children:[(0,_.jsx)(Z.Z.Item,{label:"链接地址",name:"link",rules:[{required:!0,message:"请输入链接地址"}],children:(0,_.jsx)(I.Z,{})}),(0,_.jsx)(Z.Z.Item,{label:"链接标题",name:"title",rules:[{required:!0,message:"请输入链接标题"}],children:(0,_.jsx)(I.Z,{})}),(0,_.jsxs)("div",{className:"flex-container flex-end",children:[(0,_.jsx)(C.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,_.jsx)(C.ZP,{type:"ghost",onClick:t,children:"取消"})]})]}))},T=t(35028),q=t(8591),E=t(18468),F=Z.Z.useForm,O={width:280,marginRight:10},L={labelCol:{span:5},wrapperCol:{span:19}},M=function(e){var n=e.callback,t=e.onCancel,i=F(),s=u()(i,1)[0],r=(0,m.useRef)();function l(e,n){-1!==e.status?s.setFieldsValue({src:"/api/attachments/".concat(e.id),type:n.type}):q.ZP.error(e.message)}return(0,_.jsxs)(Z.Z,y()(y()({form:s},L),{},{className:"upload-image-panel",onFinish:function(e){n(y()(y()({},e),{},{name:r.current}))},style:{width:470,overflow:"hidden"},children:[(0,_.jsx)(Z.Z.Item,{label:"图片地址",required:!0,children:(0,_.jsxs)("div",{className:"flex-container",children:[(0,_.jsx)(Z.Z.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入文件地址"}],children:(0,_.jsx)(I.Z,{style:O})}),(0,_.jsx)(R,{onFileChange:function(e){var n=e.target.files[0];r.current=n.name,A(n,l)}})]})}),(0,_.jsx)(Z.Z.Item,{label:"图片描述",name:"alt",children:(0,_.jsx)(I.Z,{style:{width:264}})}),(0,_.jsxs)(Z.Z.Item,{style:{textAlign:"right"},children:[(0,_.jsx)(C.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,_.jsx)(C.ZP,{type:"default",onClick:t,children:"取消"})]})]}))};function R(e){var n=e.onFileChange;return(0,_.jsxs)("label",{className:"upload-button",style:{cursor:"pointer"},children:["本地上传",(0,_.jsx)("input",{type:"file",onChange:n})]})}function A(e,n){if(!e)throw new String("没有文件");var t=new FormData;t.append("editormd-image-file",e),t.append("file_param_name","editormd-image-file"),t.append("byxhr","true");var i=new window.XMLHttpRequest;i.withCredentials=!0,i.addEventListener("load",(function(t){n(JSON.parse(t.target.responseText),e)}),!1),i.addEventListener("error",(function(e){console.error(e)}),!1),i.open("POST","".concat(E.KI,"/api/attachments.json")),i.send(t)}var B=t(5112),D=t(94001),z=B.ZP.Group,V={margin:"0 8px"},W=function(e){var n=e.callback,t=e.onCancel;return(0,_.jsxs)(Z.Z,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:function(e){n(e)},children:[(0,_.jsxs)("div",{className:"flex-container",style:{alignItems:"baseline"},children:[(0,_.jsx)("span",{style:V,children:"单元格数:"}),(0,_.jsx)("span",{style:V,children:"行数"}),(0,_.jsx)(Z.Z.Item,{name:"row",rules:[{required:!0,message:"请输入行数"}],children:(0,_.jsx)(D.Z,{})}),(0,_.jsx)("span",{style:V,children:"列数"}),(0,_.jsx)(Z.Z.Item,{name:"col",rules:[{required:!0,message:"请输入列数"}],children:(0,_.jsx)(D.Z,{})})]}),(0,_.jsxs)("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"},children:[(0,_.jsx)("span",{style:V,children:"对齐方式:"}),(0,_.jsx)(Z.Z.Item,{name:"align",children:(0,_.jsxs)(z,{children:[(0,_.jsx)(B.ZP,{value:"default",children:(0,_.jsx)("i",{className:"fa fa-align-justify"})}),(0,_.jsx)(B.ZP,{value:"left",children:(0,_.jsx)("i",{className:"fa fa-align-left"})}),(0,_.jsx)(B.ZP,{value:"center",children:(0,_.jsx)("i",{className:"fa fa-align-center"})}),(0,_.jsx)(B.ZP,{value:"right",children:(0,_.jsx)("i",{className:"fa fa-align-right"})})]})})]}),(0,_.jsxs)("div",{className:"flex-container flex-end",children:[(0,_.jsx)(C.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,_.jsx)(C.ZP,{type:"ghost",onClick:t,children:"取消"})]})]})},U=t(15309),H=t(79311),G=t(1012),K=t(43418),Y="link",X="upload-image",J="code-block",Q="add-table",$="------------",ee={default:$,left:":".concat($),center:":".concat($,":"),right:"".concat($,":")},ne=t(70325);var te="@▁▁@";function ie(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}var se=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",re=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],le=p()(p()({},se+"-B","bold"),se+"-I","italic"),ae=p()(p()(p()(p()({},Y,"添加链接"),J,"添加代码块"),X,"添加文件"),Q,"添加表格"),oe=function(e){var n=e.defaultValue,t=void 0===n?"":n,i=e.onChange,r=e.width,a=void 0===r?"100%":r,c=e.height,d=void 0===c?400:c,h=e.miniToolbar,j=void 0!==h&&h,y=e.isFocus,b=void 0!==y&&y,w=e.watch,Z=e.insertTemp,I=e.mode,C=void 0===I?"markdown":I,P=e.id,E=void 0===P?"markdown-editor-id":P,F=e.showResizeBar,O=void 0!==F&&F,L=e.noStorage,R=void 0!==L&&L,B=e.showNullButton,D=void 0!==B&&B,z=e.showNullProgramButton,V=void 0!==z&&z,$=e.hidetoolBar,se=void 0!==$&&$,oe=e.fullScreen,ce=void 0!==oe&&oe,ue=e.onBlur,de=e.onCMBeforeChange,pe=e.onFullScreen,me=e.className,he=void 0===me?"":me,fe=e.disablePaste,xe=void 0!==fe&&fe,ve=e.disabled,_e=void 0!==ve&&ve,ge=e.disabledFill,je=void 0!==ge&&ge,ye=e.placeholder,be=void 0===ye?"":ye,we=e.values,ke=void 0===we?"":we,Ne=(0,m.useState)(null),Ze=u()(Ne,2),Ie=Ze[0],Ce=Ze[1],Pe=(0,m.useState)(t),Se=u()(Pe,2),Te=Se[0],qe=Se[1],Ee=(0,m.useState)(w),Fe=u()(Ee,2),Oe=Fe[0],Le=Fe[1],Me=(0,m.useState)(ce),Re=u()(Me,2),Ae=Re[0],Be=Re[1],De=(0,m.useState)(""),ze=u()(De,2),Ve=ze[0],We=ze[1],Ue=(0,m.useState)(0),He=u()(Ue,2),Ge=He[0],Ke=He[1],Ye=(0,m.useState)(d),Xe=u()(Ye,2),Je=Xe[0],Qe=Xe[1],$e=(0,m.useState)(!1),en=u()($e,2),nn=(en[0],en[1]),tn=(0,m.useRef)((0,G.Z)()),sn=(0,m.useRef)(!1),rn=(0,m.useRef)(),ln=(0,m.useRef)(),an=(0,m.useRef)(),on=(0,m.useRef)(),cn=(0,m.useRef)(),un=function(){var e=o()(l()().mark((function e(){var n,t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,H.ZP)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:tn.current}});case 2:null!=(t=e.sent)&&null!==(n=t.attachments)&&void 0!==n&&n.length&&(console.log("cm:",Ie,ln),t.attachments.map((function(e){e.content_type.indexOf("image")>-1?Ie.replaceSelection(".concat(e.content_type,")")):e.content_type.indexOf("video")>-1?Ie.replaceSelection('<video width="100%" controls src="'.concat(U.Z.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):e.content_type.indexOf("pdf")>-1?Ie.replaceSelection('<a href="'.concat(U.Z.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(e.content_type,'&disposition=inline" target="_blank">').concat(e.name,"</a>")):Ie.replaceSelection("[".concat(e.name,"](").concat(U.Z.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(e.content_type,")"))})));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();(0,m.useEffect)((function(){var e=window.scrollY||window.pageYOffset;qe(ke),null==Ie||Ie.setValue(ke),window.scrollTo(0,e)}),[ke]),(0,m.useEffect)((function(){null==pe||pe(Ae)}),[Ae]),(0,m.useEffect)((function(){if(ln.current){var e=function(e,t){if(!xe){var i=t.clipboardData;if(i){var s=i.types.toString(),r=i.items;if("Files"===s||i.types.indexOf("Files")>-1){if(t.preventDefault(),"stex"==C)return;try{var l,a=r[1];"file"===(null===(l=r[0])||void 0===l?void 0:l.kind)&&(a=r[0]);var o=a.getAsFile(),c=o.name.split(".").pop();A(o,(function(e){var t,i,s;e.id?(null==o||null===(t=o.type)||void 0===t?void 0:t.indexOf("image"))>-1?n.replaceSelection(".concat(e.content_type,")")):(null==o||null===(i=o.type)||void 0===i?void 0:i.indexOf("video"))>-1?n.replaceSelection('<video width="100%" controls src="'.concat(U.Z.API_SERVER,"/api/attachments/").concat(e.id,'"></video>')):(null==o||null===(s=o.type)||void 0===s?void 0:s.indexOf("pdf"))>-1?n.replaceSelection('<a href="'.concat(U.Z.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(o.type,'&disposition=inline" target="_blank">').concat(o.name,"</a>")):re.includes(c)?n.replaceSelection('<a href="'.concat(U.Z.API_SERVER,"/api/attachments/").concat(e.id,'?type=office&disposition=inline" target="_blank">').concat(o.name,"</a>")):n.replaceSelection("[".concat(o.name,"](").concat(U.Z.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(e.content_type,")")):401===(null==e?void 0:e.status)&&(document.location.href="/user/login")}))}catch(t){q.ZP.warning("请使用chrome浏览器粘贴")}return!0}return!0}return!0}t.preventDefault()},n=f().fromTextArea(ln.current,{mode:C,lineNumbers:!j,lineWrapping:!0,value:t,autoCloseTags:!V,autoCloseBrackets:!0});return n.on("keyup",(function(e,t){8===t.keyCode&&(""==e.getValue()?n.setOption("placeholder",be):n.setOption("placeholder",null))})),n.on("keydown",(function(e,n){if(8===n.keyCode){var t=function(e,n){var t=e.getDoc(),i=t.getCursor(),s=t.getLine(i.line),r=s.charAt(i.ch-1),l=s.lastIndexOf("@▁@",i.ch),a=s.lastIndexOf("@▁▁@",i.ch),o=l>a?l:a,c=l>a?3:4;if(-1===te.indexOf(r))return null;if(console.log("change1:",n,e,s,i,o,l,a,r),o>=0&&i.ch-o<5){var u=o+c;return t.replaceRange("",{line:i.line,ch:o},{line:i.line,ch:u}),{line:i.line,ch:u}}return null}(e);t&&n.preventDefault()}})),b&&n.focus(),n.on("paste",e),n.on("dragleave",(function(e,n){an.current.classList.remove("mouse-hover-md")})),n.on("dragover",(function(e,n){an.current.classList.add("mouse-hover-md")})),n.on("drop",(function(e,t){var i;if(an.current.classList.add("mouse-hover-md"),(i=t.dataTransfer.files).length>0){t.preventDefault(),t.stopPropagation();for(var s=function(){var e=i[r],t=e.name.split(".").pop();A(e,(function(i){var s,r,l;i.id?(null==e||null===(s=e.type)||void 0===s?void 0:s.indexOf("image"))>-1?n.replaceSelection(".concat(i.content_type,")")):(null==e||null===(r=e.type)||void 0===r?void 0:r.indexOf("video"))>-1?n.replaceSelection('<video width="100%" controls src="'.concat(U.Z.API_SERVER,"/api/attachments/").concat(i.id,'"></video>')):(null==e||null===(l=e.type)||void 0===l?void 0:l.indexOf("pdf"))>-1?n.replaceSelection('<a href="'.concat(U.Z.API_SERVER,"/api/attachments/").concat(i.id,"?type=").concat(e.type,'&disposition=inline" target="_blank">').concat(e.name,"</a>")):re.includes(t)?n.replaceSelection('<a href="'.concat(U.Z.API_SERVER,"/api/attachments/").concat(i.id,'?type=office&disposition=inline" target="_blank">').concat(e.name,"</a>")):n.replaceSelection("[".concat(e.name,"](").concat(U.Z.API_SERVER,"/api/attachments/").concat(i.id,"?type=").concat(i.content_type,")")):401===(null==i?void 0:i.status)&&(document.location.href="/user/login")}))},r=0;r<i.length;r++)s()}})),_e&&n.on("beforeChange",(function(e,n){"paste"!==n.origin&&"+input"!==n.origin||n.cancel()})),Ce(n),function(){n.off("paste",e)}}}),[]);var dn=(0,m.useCallback)((function(){an.current}),[Je,an,Ae]);(0,m.useEffect)((function(){if(Ie){var e=function(){var e=new x.Z((function(e){var n,t=s()(e);try{for(t.s();!(n=t.n()).done;){var i=n.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&(dn(),Ie.setSize("100%","100%"),Ie.refresh())}}catch(e){t.e(e)}finally{t.f()}}));return e.observe(ln.current.parentElement),e}();return function(){var n,t;null!==(n=ln.current)&&void 0!==n&&n.parentElement&&e.unobserve(null===(t=ln.current)||void 0===t?void 0:t.parentElement)}}}),[Ie,dn]),(0,m.useEffect)((function(){if(Ie){for(var e=[],n=function(){var n=u()(i[t],2),s=n[0],r=n[1],l=p()({},s,(function(){pn(r)}));e.push(l),Ie.addKeyMap(l)},t=0,i=Object.entries(le);t<i.length;t++)n();return rn.current=setInterval((function(){sn.current&&un()}),4e3),function(){clearInterval(rn.current);for(var n=0,t=e;n<t.length;n++){var i=t[n];Ie.removeKeyMap(i)}}}}),[Ie]),(0,m.useEffect)((function(){ce!==Ae&&Be(ce)}),[ce]),(0,ne.Z)((function(){if(!R&&Ge>0){var e=(new Date).getTime(),n=window.sessionStorage.getItem(E);e>=Ge+1e4&&(!n||n!==Te)&&(window.sessionStorage.setItem(E,Te),nn(!0))}}),1e4),(0,m.useEffect)((function(){Le(w)}),[Ie,w]),(0,m.useEffect)((function(){Ie&&b&&Ie.focus()}),[Ie,b]),(0,m.useEffect)((function(){if(Oe&&Ie){var e=function(e){var n=e.target;if(cn.current){var t=n.scrollTop/n.scrollHeight;cn.current.scrollTop=cn.current.scrollHeight*t}},n=Ie.getScrollerElement();return n.addEventListener("scroll",e),function(){n.removeEventListener("scroll",e)}}}),[Ie,Oe]),(0,m.useEffect)((function(){if(Ie&&de){var e=function(e,n){de(e,n)};return Ie.on("beforeChange",e),function(){Ie.off("beforeChange",e)}}}),[Ie,de]),(0,m.useEffect)((function(){if(Ie&&ue){var e=function(){ue(Ie.getValue())};return Ie.on("blur",e),function(){Ie.off("blur",e)}}}),[Ie,ue]),(0,m.useEffect)((function(){if(Ie){var e=function(e,n){var t=e.getValue();qe(t),Ke((new Date).getTime()),e.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),i&&(V?i(t,vn(t)):i(t))};return Ie.on("change",e),function(){Ie.off("change",e)}}}),[Ie,i]),(0,m.useEffect)((function(){if(Ie)if(null==t)Ie.setValue(""),qe("");else{var e=window.scrollY||window.pageYOffset;t!==Ie.getValue()&&(Ie.setValue(t),qe(t),Ie.setCursor(_e?1:Ie.lineCount(),0),window.scrollTo(0,e))}}),[Ie,t]);var pn=(0,m.useCallback)((function(e){var n=Ie.getCursor(),t=Ie.getSelection(),i=t.split("\n");switch(e){case"bold":return Ie.replaceSelection("**"+t+"**"),""===t&&Ie.setCursor(n.line,n.ch+2),Ie.focus();case"italic":return Ie.replaceSelection("*"+t+"*"),""===t&&Ie.setCursor(n.line,n.ch+1),Ie.focus();case"code":return Ie.replaceSelection("`"+t+"`"),""===t&&Ie.setCursor(n.line,n.ch+1),Ie.focus();case"inline-latex":return Ie.replaceSelection("`$$"+t+"$$`"),""===t&&Ie.setCursor(n.line,n.ch+3),Ie.focus();case"latex":return Ie.replaceSelection("```latex\n"+t+"\n```"),Ie.setCursor(n.line+1,t.length+1),Ie.focus();case"line-break":return Ie.replaceSelection("<br/>\n"),Ie.focus();case"list-ul":return""===t?Ie.replaceSelection("- "+t):Ie.replaceSelection(i.map((function(e){return""===e?"":"- ".concat(e)})).join("\n")),Ie.focus();case"list-ol":return""===t?Ie.replaceSelection("1. "+t):Ie.replaceSelection(i.map((function(e,n){return""===e?"":"".concat(n+1,". ").concat(e)})).join("\n")),Ie.focus();case"add-null-ch":return""===t&&Ie.setCursor(n.line,n.ch),Ie.replaceSelection("▁"),Ie.focus();case"add-signal":return""===t&&Ie.setCursor(n.line,n.ch),Ie.replaceSelection("@▁@"),Ie.focus();case"add-multiple":return""===t&&Ie.setCursor(n.line,n.ch),Ie.replaceSelection(te),Ie.focus();case"inster-template-1":return""===t&&Ie.setCursor(n.line,n.ch),Ie.replaceSelection("\n**模板标题**\n模板正文内容,可输入文本内容和粘贴图片等操作"),Ie.focus();case"eraser":return Ie.setValue(""),Ie.focus();case"trigger-watch":return Le(!Oe),Ie.focus();case"trigger-full-screen":return Be(!Ae),Ie.focus();case Y:return void We(Y);case J:return void We(J);case X:return void We(X);case Q:return void We(Q);default:throw new Error}}),[Ie,Oe,Ae]),mn=(0,m.useCallback)((function(e){switch(We(""),Ve){case Y:var n=e.title,t=e.link;return Ie.replaceSelection("[".concat(n,"](").concat(t,")")),Ie.focus();case J:var i=e.language,s=e.content;return Ie.replaceSelection(["```"+i,s,"```"].join("\n")),Ie.focus();case X:var r=e.src,l=e.alt;return l?Ie.replaceSelection(".concat(r,' "').concat(l,'" )')):Ie.replaceSelection("")),Ie.focus();case Q:for(var a=e.row,o=e.col,c=e.align,u="\n",d=0;d<a;d++){for(var p=[],m=[],h=0;h<o;h++)1===d&&m.push(ee[c]),p.push(" ");1===d&&(u+="| ".concat(m.join(" | ")," |\n")),u+="| ".concat(p.join(1===o?"":" | ")," |\n")}return Ie.replaceSelection(u+"\n"),Ie.focus();default:throw new Error}}),[Ie,Ve]),hn=(0,m.useMemo)((function(){switch(Ve){case Y:return(0,_.jsx)(S,{callback:mn,onCancel:fn});case J:return(0,_.jsx)(T.Z,{callback:mn,onCancel:fn});case X:return(0,_.jsx)(M,{callback:mn,onCancel:fn});case Q:return(0,_.jsx)(W,{callback:mn,onCancel:fn});default:return null}}),[Ve]);function fn(){We("")}(0,m.useEffect)((function(){if(on.current){var e=function(e){s=!0,r=e.pageY},n=function(){s=!1},t=function(e){if(s){var n=e.pageY-r;n<0&&(n=0),n>300&&(n=300),Qe(d+n+"px")}},i=on.current,s=!1,r=0;return i.addEventListener("mousedown",e),document.addEventListener("mousemove",t),document.addEventListener("mouseup",n),function(){i.removeEventListener("mousedown",e),document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",n)}}}),[Ie,on]),(0,m.useEffect)((function(){Qe(d)}),[d]);var xn={width:ie(a),height:ie(Je)},vn=((0,m.useMemo)((function(){if(Ge){var e=new Date(Ge),n=e.getHours(),t=e.getMinutes(),i=e.getSeconds();return t=t<10?"0"+t:t,i=i<10?"0"+i:i,"".concat(n=n<10?"0"+n:n,":").concat(t,":").concat(i)}return 0}),[Ge]),function(e){var n=[];if(V){e=e.replace(/(@▁▁@|@▁@)/g,(function(e,t,i){n.push({multiLine:!("@▁@"===e)})}))}return n});return(0,_.jsxs)(m.Fragment,{children:[(0,_.jsx)("div",{className:"markdown-editor-wrapper",ref:an,children:(0,_.jsxs)("div",{className:"markdown-editor-container ".concat(he," ").concat(Oe?"on-preview":""," ").concat(j?"mini":""," ").concat(Ae?"full-screen":""),style:xn,children:[(0,_.jsx)(k,{insertTemp:Z,watch:Oe,fullScreen:Ae,showNullButton:D,showNullProgramButton:V,onActionCallback:pn,hidetoolBar:se,uuid:tn.current,setOpenPhones:function(){sn.current=!0}}),(0,_.jsxs)("div",{className:"markdown-editor-body",children:[(0,_.jsx)("div",{className:"codemirror-container",children:(0,_.jsx)("textarea",{ref:ln,placeholder:be})}),Oe?(0,_.jsxs)("div",{ref:cn,className:"preview-container",children:["stex"===C&&(0,_.jsx)(g,{value:Te}),"stex"!==C&&(0,_.jsx)(v.Z,{disabledFill:je,showProgramFill:V,value:Te})]}):null]})]})}),O?(0,_.jsx)("a",{ref:on,className:"editor-resize"}):null,(0,_.jsx)(N.Z,{children:ae[Ve]?(0,_.jsx)(K.Z,{centered:!0,title:ae[Ve],open:!0,onCancel:fn,footer:null,className:"markdown-popup-form",children:hn}):null})]})}},56386:function(e,n,t){t.d(n,{Z:function(){return m}});var i=t(82100),s=t.n(i),r=t(29186),l=t.n(r),a=t(80619),o=t.n(a),c=t(47074),u=t.n(c),d=t(59301),p=t(4676),m=function(e){o()(t,e);var n=u()(t);function t(e){var i;s()(this,t),i=n.call(this,e);var r=window.document;return i.node=r.createElement("div"),r.body.appendChild(i.node),i}return l()(t,[{key:"render",value:function(){var e=this.props.children;return(0,p.createPortal)(e,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),t}(d.Component)},70325:function(e,n,t){t.d(n,{Z:function(){return s}});var i=t(59301);function s(e,n){var t=(0,i.useRef)();(0,i.useEffect)((function(){t.current=e})),(0,i.useEffect)((function(){if(null!==n){var e=setInterval((function(){t.current()}),n);return function(){return clearInterval(e)}}}),[n])}},55582:function(e,n,t){t.r(n),t.d(n,{default:function(){return Dt}});var i=t(82242),s=t.n(i),r=t(7557),l=t.n(r),a=t(41498),o=t.n(a),c=t(79800),u=t.n(c),d=t(39647),p=t.n(d),m=t(59301),h=t(65363),f=t(78241),x=t(8591),v=t(66104),_=t(73782),g=t(19842),j=t(5112),y=t(94001),b=t(3113),w={flex_box_center:"flex_box_center___aPGWN",flex_space_between:"flex_space_between___MQNX5",flex_box_vertical_center:"flex_box_vertical_center___Z7QdK",flex_box_center_end:"flex_box_center_end___JQl5O",flex_box_column:"flex_box_column___IhYhx",bg:"bg___Kg8x_",title:"title___UhsVG",titleLeft:"titleLeft___NPVwn",titleRight:"titleRight___UGtmZ",formWrap:"formWrap___Jowb2",baseLineHeight:"baseLineHeight___N68WX",radioBtnWrapper:"radioBtnWrapper___bX7Pi",radiogroup:"radiogroup___ukf8u",easy:"easy___ZHYPU",medium:"medium___piewx",hard:"hard___HMXyt",selectdiv:"selectdiv___gkuBG",divitem:"divitem___vNm0q",bottmodiv:"bottmodiv___assW5",cancelBtn:"cancelBtn___Nl6Pi",confirmBtn:"confirmBtn___BNoFU",baseFormItem:"baseFormItem___ILZ2V",cascaderPopup:"cascaderPopup___QPxW3"},k=t(43418),N=t(57930),Z=t(61186),I=t.n(Z),C=t(37712),P=(0,h.connect)((function(e){return{user:e.user,classroomList:e.classroomList}}))((function(e){e.user;var n=e.dispatch,t=e.classroomList,i=e.onModalOk,s=e.setsubloading,r=((0,h.useParams)(),(0,m.useState)()),a=u()(r,2),c=a[0],d=a[1],p=(0,m.useState)(!1),f=u()(p,2),v=f[0],_=f[1];return(0,C.jsx)(k.Z,{title:"温馨提示",afterClose:function(){_(!1)},zIndex:8888,destroyOnClose:!0,footer:null,maskClosable:!1,keyboard:!1,open:"预约弹窗"===t.actionTabs.key,onCancel:function(){v?x.ZP.warning("正在请求数据中..."):(s(!1),n({type:"classroomList/setActionTabs",payload:{}}))},children:(0,C.jsxs)("div",{children:[(0,C.jsx)("span",{children:"EduCoder注意到您的课堂中学生人数较多。为更好地为您和您的学生服务,给同学们带来更好的考试体验,我们将提前为您和您的学生准备好服务器资源。 请您告知我们,这份试卷的预计考试时间是:"}),(0,C.jsx)("br",{}),(0,C.jsx)(N.default,{popupStyle:{zIndex:9999},style:{marginTop:"10px",marginBottom:"10px"},disabledDate:function(e){return e&&e<I()().subtract(1,"days")},format:"YYYY-MM-DD HH:mm:ss",onChange:function(e,n){d(n)},showTime:{defaultValue:I()("00:00:00","HH:mm:ss")}}),(0,C.jsx)("br",{}),(0,C.jsx)("span",{children:"感谢您的配合"}),(0,C.jsx)("br",{}),(0,C.jsx)("div",{style:{textAlign:"end"},children:(0,C.jsx)(b.ZP,{loading:v,type:"primary",onClick:o()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:_(!0),i(c,(function(){n({type:"classroomList/setActionTabs",payload:{}})}));case 2:case"end":return e.stop()}}),e)}))),children:"确认"})})]})})})),S=t(79311),T=t(37205),q=t.n(T),E=t(45532),F=t(52103),O={wrap:"wrap___Ww0Ti",itemWarp:"itemWarp___LMLjd",addIcon:"addIcon___xmRLl",deleteIcon:"deleteIcon___gjwgO"},L=t(57809),M=function(e){var n,t,i,r,a,c,d,p,h=e.setitem,x=e.item,v=e.rz,_=(0,m.useState)({zydatas:[],jbdatas:[],kcdatas:[],zsdatas:[],page:1,per_page:20}),g=u()(_,2),j=g[0],y=g[1],b=f.Z.useForm(),w=u()(b,1)[0],k=(0,m.useState)(!1),N=u()(k,2),Z=N[0],I=N[1];function P(){return(P=o()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,T(null==x?void 0:x.ec_major_school_id);case 2:return e.next=4,E(null==x?void 0:x.ec_year_id);case 4:return e.next=6,M(null==x?void 0:x.ec_course_id);case 6:w.setFieldsValue({ec_course_id:null==x?void 0:x.ec_course_id,ec_major_school_id:null==x?void 0:x.ec_major_school_id,ec_point_ids:null==x?void 0:x.ec_point_ids,ec_year_id:null==x?void 0:x.ec_year_id});case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function T(e){return q.apply(this,arguments)}function q(){return(q=o()(l()().mark((function e(n){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.ZP)("/api/ec_major_schools/".concat(n,"/ec_years/get_year_list.json"),{method:"get"});case 2:t=e.sent,j.jbdatas=null==t?void 0:t.data,y(s()({},j)),w.setFieldsValue({ec_year_id:"",ec_course_id:"",ec_point_ids:[]});case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function E(e){return F.apply(this,arguments)}function F(){return(F=o()(l()().mark((function e(n){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.ZP)("/api/ec_years/".concat(n,"/ec_courses/get_courses.json"),{method:"get"});case 2:t=e.sent,j.kcdatas=null==t?void 0:t.data,y(s()({},j)),w.setFieldsValue({ec_course_id:"",ec_point_ids:[]});case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(0,m.useEffect)((function(){v&&!Z&&(j.zydatas=v,y(s()({},j)),I(!0),null!=x&&x.ec_course_id&&function(){P.apply(this,arguments)}())}),[x,v,Z]),console.log(j,"params");var M=function(){var e=o()(l()().mark((function e(n){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.ZP)("/api/ec_courses/".concat(n,"/ec_points.json"),{method:"get",params:{ec_course_id:n}});case 2:t=e.sent,j.zsdatas=null==t?void 0:t.data,y(s()({},j));case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,C.jsx)("div",{className:O.from,children:(0,C.jsxs)(f.Z,{form:w,layout:"inline",onValuesChange:function(e){console.log("----",e),e.ec_major_school_id&&(j.jbdatas=[],j.kcdatas=[],j.zsdatas=[],y(s()({},j)),T(e.ec_major_school_id)),e.ec_year_id&&(j.kcdatas=[],j.zsdatas=[],y(s()({},j)),E(e.ec_year_id)),e.ec_course_id&&(j.zsdatas=[],y(s()({},j)),M(e.ec_course_id))},onFinish:function(){var e=o()(l()().mark((function e(n){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:h(n);case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:[(0,C.jsx)(f.Z.Item,{name:"ec_major_school_id",children:(0,C.jsx)(L.default,{style:{width:160},disabled:(null===(n=j.zydatas)||void 0===n?void 0:n.length)<=0,placeholder:"请选择认证专业",children:null==j||null===(t=j.zydatas)||void 0===t?void 0:t.map((function(e,n){return(0,C.jsx)(L.default.Option,{value:null==e?void 0:e.ec_major_school_id,children:null==e?void 0:e.name},n)}))})}),(0,C.jsx)(f.Z.Item,{name:"ec_year_id",children:(0,C.jsx)(L.default,{style:{width:160},disabled:(null===(i=j.jbdatas)||void 0===i?void 0:i.length)<=0,placeholder:"请选择认证届别",children:null==j||null===(r=j.jbdatas)||void 0===r?void 0:r.map((function(e,n){return(0,C.jsx)(L.default.Option,{value:null==e?void 0:e.ec_year_id,children:null==e?void 0:e.year},n)}))})}),(0,C.jsx)(f.Z.Item,{name:"ec_course_id",children:(0,C.jsx)(L.default,{style:{width:208},disabled:(null===(a=j.kcdatas)||void 0===a?void 0:a.length)<=0,placeholder:"请选择课程",children:null==j||null===(c=j.kcdatas)||void 0===c?void 0:c.map((function(e,n){return(0,C.jsx)(L.default.Option,{value:null==e?void 0:e.id,children:null==e?void 0:e.name},n)}))})}),(0,C.jsx)(f.Z.Item,{name:"ec_point_ids",children:(0,C.jsx)(L.default,{onChange:function(){w.submit()},style:{width:160},maxTagCount:1,maxTagTextLength:7,mode:"multiple",disabled:(null===(d=j.zsdatas)||void 0===d?void 0:d.length)<=0,placeholder:"请选择知识点",children:null==j||null===(p=j.zsdatas)||void 0===p?void 0:p.map((function(e,n){return(0,C.jsx)(L.default.Option,{value:null==e?void 0:e.id,children:null==e?void 0:e.name},n)}))})})]})})},R=(0,h.connect)((function(e){return{user:e.user}}))((function(e){var n,t,i=e.user,r=e.exercise_id,a=void 0===r?null:r,c=e.homework_common_id,d=void 0===c?null:c,p=e.setitem,h=(0,m.useState)([{id:Math.random()}]),f=u()(h,2),x=f[0],v=f[1],_=(0,m.useState)(null),g=u()(_,2),j=g[0],y=g[1];function b(){return w.apply(this,arguments)}function w(){return(w=o()(l()().mark((function e(){var n,t,i,r,o,c;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.ZP)("/api/ec_courses/".concat(0,"/ec_points/get_work_points.json"),{method:"get",params:{exercise_id:a,homework_common_id:d}});case 2:(null==(t=e.sent)||null===(n=t.data)||void 0===n?void 0:n.length)>0&&(c=[],null==t||null===(i=t.data)||void 0===i||i.map((function(e){var n;null==e||null===(n=e.ec_point_ids)||void 0===n||n.map((function(e){c.push(e)}))})),p(s()(s()({},null==t||null===(r=t.data)||void 0===r?void 0:r[0]),{},{ec_point_ids:c})),v(null==t||null===(o=t.data)||void 0===o?void 0:o.map((function(e){return s()(s()({},e),{},{id:Math.random()})}))));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(){return(k=o()(l()().mark((function e(){var n,t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.ZP)("/api/schools/".concat(null==i||null===(n=i.userInfo)||void 0===n||null===(n=n.course)||void 0===n?void 0:n.course_school_id,"/ec_majors/get_major_list.json"),{method:"get"});case 2:t=e.sent,y(null==t?void 0:t.data),(d||a)&&b();case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return(0,m.useEffect)((function(){var e;null!=i&&null!==(e=i.userInfo)&&void 0!==e&&null!==(e=e.course)&&void 0!==e&&e.course_school_id&&function(){k.apply(this,arguments)}()}),[null==i||null===(n=i.userInfo)||void 0===n||null===(n=n.course)||void 0===n?void 0:n.course_school_id]),console.log(x,j,"datas"),(0,C.jsx)("div",{style:{display:null!==(t=i.userInfo.course)&&void 0!==t&&t.is_openengineering?"":"none"},children:(0,C.jsxs)("div",{className:O.wrap,children:[(0,C.jsxs)("p",{children:["工程认证",(0,C.jsx)("br",{}),"考核知识点"]}),(0,C.jsx)("div",{className:O.itemWarp,children:null==x?void 0:x.map((function(e,n){return(0,C.jsxs)("div",{style:{display:"flex",alignItems:"center",marginBottom:20},children:[(0,C.jsx)(M,{rz:j,item:e,setitem:function(e){e=s()(s()({},null==x?void 0:x[n]),e),x.splice(n,1,e),v(q()(x));var t=[];null==x||x.map((function(e){var n;null==e||null===(n=e.ec_point_ids)||void 0===n||n.map((function(e){t.push(e)}))})),p(s()(s()({},e),{},{ec_point_ids:t}))}}),(0,C.jsx)(E.Z,{className:O.addIcon,onClick:function(){x.push({id:Math.random()}),v(q()(x))}}),0!=n&&(0,C.jsx)(F.Z,{className:O.deleteIcon,onClick:function(){x.splice(n,1);var e=[];null==x||x.map((function(n){var t;null==n||null===(t=n.ec_point_ids)||void 0===t||t.map((function(n){e.push(n)}))})),p(s()(s()({},x[n-1]),{},{ec_point_ids:e})),v(q()(x))}})]},e.id)}))})]})})})),A=t(20834),B=t(71418),D=t(81228),z=t(96865),V=t(38854),W="moreSpan___VJeLv",U="bg___oBBHW",H="title___xV4Rt",G="bottomdiv___rPfwr",K="spanBtn___eJxID",Y="addQuestionBtn___RPRiP",X="saveBtn___y9nNf",J="left___Q3Qf4",Q="scrollWrapper___a3Wdq",$="Button___r00OP",ee="titleleft___WZ83K",ne="more_style___ZXYnN",te="qcount___o6F1k",ie="score___Gy6jr",se="qtitle___KF7pa",re="qcountclick___kvoyc",le="right___Nfa70",ae="edit___RVRSb",oe="delete___J9BAT",ce="shixun___YkjdZ",ue="scoreByBlankRadio___QYQY5",de="modalconfirm___dmWFe",pe="scoremodal___CDA7w",me="close___jdUWv",he="content___HPqUf",fe="items___YkyQL",xe="bottom___mzpp4",ve="yes___Xio6z",_e="no___hbicD",ge="formcenter___kN8Ax",je="radiogroup___htjtc",ye="easy____g1mR",be="medium___vPAsn",we="hard___c6tcf",ke="formcenterselect___B88vb",Ne="selectitems___wUGKF",Ze="morebottom___F5cFQ",Ie="scoreinput___S9Fbv",Ce="titleTooltip___J0i26",Pe="exercise_styles___BJAZm",Se=t(27627),Te=t(13261),qe=t(6848),Ee=t(71108),Fe=t(23599),Oe=function(e){var n=e.Itemid,t=e.setqitem,i=e.qitem,r=e.data,a=e.getdata,c=e.bigitem,d=e.setBigqitem,p=e.isedit,h=(0,m.useState)([]),f=u()(h,2),v=f[0],_=f[1],g=(0,m.useState)(!1),j=u()(g,2),y=j[0],b=j[1],w=function(e,n,t){var i=Array.from(e),s=i.splice(n,1),r=u()(s,1)[0];return i.splice(t,0,r),i};(0,m.useEffect)((function(){r.length>0&&_(q()(r)||[])}),[r]);var k=function(){var e=o()(l()().mark((function e(t,i){var s,r;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.destination){e.next=2;break}return e.abrupt("return");case 2:if(!p){e.next=5;break}return x.ZP.info("请先保存或取消当前正在编辑的试题。"),e.abrupt("return");case 5:return s=w(i,t.source.index,t.destination.index),b(!0),e.next=9,(0,S.ZP)("/api/exercises/".concat(n,"/adjust_position.json"),{method:"post",body:{id:n,question_ids:null==s?void 0:s.map((function(e){return e.question_id}))}});case 9:r=e.sent,b(!1),0===r.status&&a({id:null==i?void 0:i[t.source.index].question_id});case 12:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}();return(0,C.jsx)("div",{children:(0,C.jsx)(Ee.Z5,{onDragEnd:function(e){return k(e,v)},children:(0,C.jsx)(Ee.bK,{droppableId:"droppable",children:function(e,n){return(0,C.jsxs)("div",s()(s()({ref:e.innerRef},e.droppableProps),{},{children:[(0,C.jsx)(B.Z,{spinning:y,children:v.map((function(e,n){return(0,C.jsx)(Ee._l,{draggableId:n.toString(),index:n,children:function(r,l){var a;return(0,C.jsx)("aside",s()(s()(s()({ref:r.innerRef},r.draggableProps),r.dragHandleProps),{},{children:(0,C.jsx)(qe.Z,{title:(0,C.jsx)(Fe.Z,{value:e.question_title||e.description}),color:"#fff",placement:"left",overlayClassName:Ce,children:(0,C.jsxs)("div",{onClick:function(){p?x.ZP.info("请先保存或取消当前正在编辑的试题。"):(t(s()(s()({},e),{},{index:n+1})),d(c),(0,Se.k3)())},className:"".concat(te," ").concat(e.question_id===(null==i?void 0:i.question_id)?re:""),children:[(0,C.jsxs)("span",{className:ie,children:[null==e?void 0:e.question_score,"分"]}),(0,C.jsxs)("span",{className:se,children:[n+1,"、",(0,C.jsx)(Fe.Z,{value:8===(null==e?void 0:e.question_type)?null==e||null===(a=e.program_attr)||void 0===a?void 0:a.description:e.question_title,showTextOnly:!0})]})]})})}))}},n)}))}),e.placeholder]}))}})})})},Le=t(3410),Me=t(78673),Re=t(78386),Ae=t(20538),Be=t(39248),De=t(680),ze=function(e){var n,t=e.form,i=e.TagDiscipline,s=e.exerciseitem,r=e.qitem,a=e.getTagData,c=(0,m.useState)(!1),d=u()(c,2),p=d[0],h=d[1],v=(0,m.useState)(!1),g=u()(v,2),y=g[0],w=g[1],N=(0,m.useState)(""),Z=u()(N,2),I=Z[0],P=Z[1];return(0,m.useEffect)((function(){t.setFieldsValue({difficulty:r.difficulty||2,tag_discipline_ids:r.tag_discipline_ids,repeat_answer:!r.repeat_answer})}),[]),(0,C.jsxs)("div",{children:[(0,C.jsxs)("div",{onClick:function(){h(!p)},style:{width:"100%",textAlign:"center",color:"#3061D0",marginTop:50,cursor:"pointer"},children:["更多设置 ",p?(0,C.jsx)(Ae.Z,{}):(0,C.jsx)(Re.Z,{})]}),(0,C.jsxs)("div",{style:{marginTop:30,height:p?"100%":"0px",overflow:"hidden"},children:[(0,C.jsx)(f.Z.Item,{className:ge,rules:[{required:!0,message:"请先选择难度"}],label:"难度",name:"difficulty",children:(0,C.jsxs)(j.ZP.Group,{className:je,children:[(0,C.jsx)(j.ZP.Button,{className:ye,value:1,children:"简单"}),(0,C.jsx)(j.ZP.Button,{className:be,value:2,children:"适中"}),(0,C.jsx)(j.ZP.Button,{className:we,value:3,children:"困难"})]})}),(0,C.jsx)(f.Z.Item,{className:ke,label:"知识点",children:(0,C.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,C.jsx)(f.Z.Item,{name:"tag_discipline_ids",children:(0,C.jsx)(L.default,{className:Ne,showSearch:!0,listHeight:200,dropdownStyle:{zIndex:9},allowClear:!0,optionFilterProp:"children",filterOption:function(e,n){return n.key.indexOf(e.toLowerCase())>=0},children:null==i||null===(n=i.tag_disciplines)||void 0===n?void 0:n.map((function(e){return(0,C.jsx)(L.default.Option,{value:e.id,children:(0,C.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,C.jsx)("span",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:e.name}),(0,C.jsx)("span",{children:"personal"===e.type?"(自用)":""})]})},e.name+e.id)}))})}),(0,C.jsxs)("div",{style:{marginLeft:20,marginTop:"-16px",lineHeight:"48px",height:48,fontSize:14},children:[(0,C.jsx)("span",{children:"没有合适的知识点?"}),(0,C.jsx)("a",{onClick:function(){w(!0)},style:{marginLeft:3,color:"#3061D0"},children:"新建知识点"})]})]})}),(0,C.jsx)(f.Z.Item,{className:ke,children:(0,C.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,C.jsx)(f.Z.Item,{name:"repeat_answer",valuePropName:"checked",children:(0,C.jsx)(Me.Z,{})}),(0,C.jsxs)("div",{style:{marginLeft:10,marginTop:"-16px",lineHeight:"48px",height:48,color:"#000000"},children:["不允许学生重复答题",(0,C.jsx)(qe.Z,{placement:"right",title:"选中后,学生必须作答完成才能进入下一题,且进入下一题之后不允许再修改该题答案",children:(0,C.jsx)(Be.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})})]})]})})]}),(0,C.jsxs)(k.Z,{title:!1,footer:!1,open:y,width:640,centered:!0,closable:!1,className:pe,children:[(0,C.jsxs)("div",{style:{display:"flex",alignItems:"center",marginBottom:40},children:[(0,C.jsx)("div",{className:H,children:"新建知识点"}),(0,C.jsx)("span",{onClick:function(){return w(!1)},className:me,children:"X"})]}),(0,C.jsxs)("div",{children:[(0,C.jsx)(De.Z,{style:{color:"#FF8C29",marginRight:10}}),"新建的知识点仅本人可见,平台审核列入公开知识点后,对所有用户可见。 平台有权删除不合适的知识点,请认真填写知识点名称。"]}),(0,C.jsx)(_.Z,{style:{marginBottom:30,marginTop:30,height:46},showCount:!0,maxLength:20,onChange:function(e){P(e.target.value)},placeholder:"请输入知识点名称"}),(0,C.jsxs)("div",{className:xe,children:[(0,C.jsx)(b.ZP,{className:_e,onClick:function(){w(!1)},children:"取消"}),(0,C.jsx)(b.ZP,{className:ve,onClick:o()(l()().mark((function e(){var n,i,r;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(I){e.next=3;break}return x.ZP.info("知识点名称不能为空"),e.abrupt("return");case 3:return e.next=5,(0,S.ZP)("/api/tag_disciplines.json",{method:"post",body:{name:I,sub_discipline_id:null==s||null===(n=s.exercise)||void 0===n?void 0:n.sub_discipline_id}});case 5:0===(null==(i=e.sent)?void 0:i.status)&&(t.setFieldsValue({knowledge:I}),a(null===(r=s.exercise)||void 0===r?void 0:r.sub_discipline_id)),w(!1);case 8:case"end":return e.stop()}}),e)}))),children:"确认"})]})]})]})},Ve=function(e){var n,t,i=e.qitem,r=e.setisedit,a=e.TagDiscipline,c=e.exerciseitem,d=e.seveeditor,p=e.deleteitem,h=e.getTagData,v=e.init,_=f.Z.useForm(),g=u()(_,1)[0];return(0,m.useEffect)((function(){var e;g.setFieldsValue(s()(s()({},i),{},{name:null==i?void 0:i.question_title,choices:null==i||null===(e=i.question_choices)||void 0===e?void 0:e.map((function(e){return s()(s()({},e),{},{standard_boolean:null!=e&&e.standard_boolean?1:0})})),repeat_answer:!(null!=i&&i.repeat_answer)}))}),[i]),(0,C.jsxs)("div",{children:[(0,C.jsxs)(f.Z,{form:g,colon:!1,onFinish:function(e){var n,t,r,l,a,o=null==e||null===(n=e.choices)||void 0===n||null===(t=n.map)||void 0===t?void 0:t.call(n,(function(e,n){if(1===(null==e?void 0:e.standard_boolean))return n+1})),c=s()(s()({},e),{},{item_type:null==i?void 0:i.question_type,question_choices:null==e||null===(r=e.choices)||void 0===r||null===(l=r.map)||void 0===l?void 0:l.call(r,(function(e){return e.choice_text})),standard_answers:o.filter((function(e){return e})),choices:null==e||null===(a=e.choices)||void 0===a?void 0:a.map((function(e){return s()(s()({},e),{},{is_answer:e.standard_boolean})}))});d(s()(s()({},i),c))},onFinishFailed:function(){var e=o()(l()().mark((function e(n){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:x.ZP.error(n.errorFields[0].errors[0]),g.scrollToField(null==n||null===(t=n.errorFields)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.name,{behavior:"smooth",block:"center"});case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:[(0,C.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,C.jsxs)("div",{style:{flex:1},children:[(0,C.jsx)("span",{style:{display:"inline-flex",border:"1px solid #9096A3",borderRadius:"50%",width:10,height:10,marginRight:5,background:"#9096A3"}}),(0,C.jsx)("span",{children:1===(null==i?void 0:i.question_type)?"多选题":"单选题"})]}),1===(null==i?void 0:i.question_type)&&(0,C.jsx)(f.Z.Item,{name:"use_blank_score",noStyle:!0,children:(0,C.jsx)(j.ZP.Group,{className:ue,disabled:1!==(null==c||null===(n=c.exercise)||void 0===n?void 0:n.exercise_status),optionType:"button",options:[{label:"全对给分",value:!1},{label:"漏选给分",value:!0}]})}),(0,C.jsx)(f.Z.Item,{className:Ie,name:"question_score",label:"分值",rules:[{required:!0,message:"请输入分值"}],children:(0,C.jsx)(y.Z,{style:{width:150},placeholder:"请输入当前小题分数",max:100,min:.1})}),1==(null==c||null===(t=c.exercise)||void 0===t?void 0:t.exercise_status)&&(0,C.jsxs)("span",{style:{marginLeft:20,color:"red",cursor:"pointer"},onClick:function(){p()},children:[(0,C.jsx)("i",{className:"iconfont icon-piliangshanchu3",style:{fontSize:14,marginRight:6}}),"删除"]})]}),(0,C.jsx)(Le.u,{form:g,questionTitlePlaceholder:"请编辑选择题题干内容",titleKey:"question_title",choiceKey:"choices",analysisKey:"analysis",choiceOptionsPath:"choices",choiceTextKey:"choice_text",answerKey:"standard_boolean"}),(0,C.jsx)(ze,{getTagData:h,qitem:i,exerciseitem:c,TagDiscipline:a,form:g})]}),(0,C.jsxs)("div",{className:Ze,children:[(0,C.jsx)(b.ZP,{className:_e,onClick:function(){var e;g.setFieldsValue(s()(s()({},i),{},{name:null==i?void 0:i.question_title,choices:null==i||null===(e=i.question_choices)||void 0===e?void 0:e.map((function(e){return s()(s()({},e),{},{standard_boolean:null!=e&&e.standard_boolean?1:0})})),repeat_answer:!(null!=i&&i.repeat_answer)}))},children:"重置"}),(0,C.jsx)(b.ZP,{className:_e,onClick:function(){var e;i.isadd?(r(!1),v()):(g.setFieldsValue(s()(s()({},i),{},{name:null==i?void 0:i.question_title,choices:null==i||null===(e=i.question_choices)||void 0===e?void 0:e.map((function(e){return s()(s()({},e),{},{standard_boolean:null!=e&&e.standard_boolean?1:0})})),repeat_answer:!(null!=i&&i.repeat_answer)})),r(!1))},children:"取消"}),(0,C.jsx)(b.ZP,{className:ve,onClick:o()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:g.submit();case 1:case"end":return e.stop()}}),e)}))),children:"保存题目"})]})]})},We=t(89531),Ue=function(e){var n,t=e.qitem,i=e.TagDiscipline,r=e.exerciseitem,a=e.setisedit,c=e.seveeditor,d=e.deleteitem,p=e.getTagData,h=e.init,v=f.Z.useForm(),_=u()(v,1)[0],g=f.Z.useWatch("use_blank_score",_);return(0,m.useEffect)((function(){_.setFieldsValue(s()(s()({},t),{},{standard_answers:t.standard_answer||[],name:t.question_title,repeat_answer:!t.repeat_answer}))}),[t]),(0,C.jsxs)("div",{children:[(0,C.jsxs)(f.Z,{form:_,colon:!1,onValuesChange:function(e,n){if(null!=e&&e.standard_answers){var t,i,s,r=(null===(t=_.getFieldValue("standard_answers"))||void 0===t?void 0:t.length)>0&&(null===(i=_.getFieldValue("standard_answers"))||void 0===i||null===(i=i.map((function(e){return e.score})))||void 0===i?void 0:i.filter((function(e){return e})));if((null==r?void 0:r.length)>0)_.setFieldsValue({question_score:(null==r?void 0:r.length)>0&&(null===(s=r.reduce((function(e,n){return e+n})))||void 0===s?void 0:s.toFixed(1))})}},onFinish:function(e){c(s()(s()(s()({},t),e),{},{item_type:null==t?void 0:t.question_type,standard_answers:e.standard_answers,standard_answer:void 0,question_title:e.name}))},onFinishFailed:function(){var e=o()(l()().mark((function e(n){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:x.ZP.error(n.errorFields[0].errors[0]),_.scrollToField(null==n||null===(t=n.errorFields)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.name,{behavior:"smooth",block:"center"});case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:[(0,C.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,C.jsxs)("div",{style:{flex:1},children:[(0,C.jsx)("span",{style:{display:"inline-flex",border:"1px solid #9096A3",borderRadius:"50%",width:10,height:10,marginRight:5,background:"#9096A3"}}),(0,C.jsx)("span",{children:"填空题"})]}),(0,C.jsx)(f.Z.Item,{name:"use_blank_score",noStyle:!0,children:(0,C.jsx)(j.ZP.Group,{className:ue,optionType:"button",options:[{label:"按空给分",value:!0},{label:"按题给分",value:!1}]})}),(0,C.jsx)(f.Z.Item,{className:Ie,name:"question_score",label:"分值",rules:[{required:!0,message:"请输入分值"}],children:(0,C.jsx)(y.Z,{style:{width:150},placeholder:"请输入当前小题分数",disabled:g,max:100,min:.1})}),1==(null==r||null===(n=r.exercise)||void 0===n?void 0:n.exercise_status)&&(0,C.jsxs)("span",{style:{marginLeft:20,color:"red",cursor:"pointer"},onClick:function(){d()},children:[(0,C.jsx)("i",{className:"iconfont icon-piliangshanchu3",style:{fontSize:14,marginRight:6}}),"删除"]})]}),(0,C.jsx)(We.u,{form:_,questionTitlePlaceholder:"请编辑填空题题干内容",scoreByBlank:g,answerKey:"standard_answers"}),(0,C.jsx)(ze,{getTagData:p,qitem:t,exerciseitem:r,TagDiscipline:i,form:_})]}),(0,C.jsxs)("div",{className:Ze,children:[(0,C.jsx)(b.ZP,{className:_e,onClick:function(){_.setFieldsValue(s()(s()({},t),{},{standard_answers:t.standard_answer||[],name:t.question_title,repeat_answer:!t.repeat_answer}))},children:"重置"}),(0,C.jsx)(b.ZP,{className:_e,onClick:function(){t.isadd?(a(!1),h()):(_.setFieldsValue(s()(s()({},t),{},{standard_answers:t.standard_answer||[],name:t.question_title,repeat_answer:!t.repeat_answer})),a(!1))},children:"取消"}),(0,C.jsx)(b.ZP,{className:ve,onClick:function(){_.submit()},children:"保存题目"})]})]})},He=t(19343),Ge=function(e){var n,t=e.qitem,i=e.setisedit,r=e.TagDiscipline,a=e.exerciseitem,c=e.seveeditor,d=e.deleteitem,p=e.getTagData,h=e.init,v=f.Z.useForm(),_=u()(v,1)[0];return(0,m.useEffect)((function(){var e;_.setFieldsValue(s()(s()({},t),{},{name:t.question_title,repeat_answer:!t.repeat_answer,choices:null==t||null===(e=t.question_choices)||void 0===e?void 0:e.map((function(e){return s()(s()({},e),{},{is_answer:null!=e&&e.standard_boolean?1:0})}))}))}),[t]),(0,C.jsxs)("div",{children:[(0,C.jsxs)(f.Z,{form:_,colon:!1,onFinish:function(e){var n,i,r,l,a=null==e||null===(n=e.choices)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,(function(e,n){if(1===(null==e?void 0:e.is_answer))return n+1}));c(s()(s()(s()({},t),e),{},{question_title:e.name,standard_answers:a.filter((function(e){return e})),question_choices:null==e||null===(r=e.choices)||void 0===r||null===(l=r.map)||void 0===l?void 0:l.call(r,(function(e){return e.choice_text}))}))},onFinishFailed:function(){var e=o()(l()().mark((function e(n){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:x.ZP.error(n.errorFields[0].errors[0]),_.scrollToField(null==n||null===(t=n.errorFields)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.name,{behavior:"smooth",block:"center"});case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:[(0,C.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,C.jsxs)("div",{style:{flex:1},children:[(0,C.jsx)("span",{style:{display:"inline-flex",border:"1px solid #9096A3",borderRadius:"50%",width:10,height:10,marginRight:5,background:"#9096A3"}}),(0,C.jsx)("span",{children:"判断题"})]}),(0,C.jsx)(f.Z.Item,{className:Ie,name:"question_score",label:"分值",rules:[{required:!0,message:"请输入分值"}],children:(0,C.jsx)(y.Z,{style:{width:150},placeholder:"请输入当前小题分数",max:100,min:.1})}),1==(null==a||null===(n=a.exercise)||void 0===n?void 0:n.exercise_status)&&(0,C.jsxs)("span",{style:{marginLeft:20,color:"red",cursor:"pointer"},onClick:function(){d()},children:[(0,C.jsx)("i",{className:"iconfont icon-piliangshanchu3",style:{fontSize:14,marginRight:6}}),"删除"]})]}),(0,C.jsx)(He.Z,{form:_,questionTitlePlaceholder:"请编辑判断题题干内容",choiceKey:""}),(0,C.jsx)(ze,{getTagData:p,qitem:t,exerciseitem:a,TagDiscipline:r,form:_})]}),(0,C.jsxs)("div",{className:Ze,children:[(0,C.jsx)(b.ZP,{className:_e,onClick:function(){var e;_.setFieldsValue(s()(s()({},t),{},{name:t.question_title,repeat_answer:!t.repeat_answer,choices:null==t||null===(e=t.question_choices)||void 0===e?void 0:e.map((function(e){return s()(s()({},e),{},{is_answer:null!=e&&e.standard_boolean?1:0})}))}))},children:"重置"}),(0,C.jsx)(b.ZP,{className:_e,onClick:function(){var e;t.isadd?(i(!1),h()):(_.setFieldsValue(s()(s()({},t),{},{name:t.question_title,repeat_answer:!t.repeat_answer,choices:null==t||null===(e=t.question_choices)||void 0===e?void 0:e.map((function(e){return s()(s()({},e),{},{is_answer:null!=e&&e.standard_boolean?1:0})}))})),i(!1))},children:"取消"}),(0,C.jsx)(b.ZP,{className:ve,onClick:function(){_.submit()},children:"保存题目"})]})]})},Ke=t(56949),Ye=function(e){var n,t=e.qitem,i=e.setisedit,r=e.TagDiscipline,a=e.exerciseitem,c=e.seveeditor,d=e.deleteitem,p=e.getTagData,h=e.init,v=f.Z.useForm(),_=u()(v,1)[0];return(0,m.useEffect)((function(){var e;_.setFieldsValue(s()(s()({},t),{},{name:t.question_title,sub_item_banks:null===(e=t.sub_exercise_questions)||void 0===e?void 0:e.map((function(e){return s()(s()({},e),{},{name:e.question_title,choices:e.question_choices.map((function(e){return s()(s()({},e),{},{is_answer:null!=e&&e.standard_boolean?1:0})}))})})),repeat_answer:!t.repeat_answer}))}),[t]),(0,C.jsxs)("div",{children:[(0,C.jsxs)(f.Z,{form:_,colon:!1,onValuesChange:function(e,n){if(null!=e&&e.sub_item_banks){var t,i,s,r=(null===(t=_.getFieldValue("sub_item_banks"))||void 0===t?void 0:t.length)>0&&(null===(i=_.getFieldValue("sub_item_banks"))||void 0===i||null===(i=i.map((function(e){return e.question_score})))||void 0===i?void 0:i.filter((function(e){return e})));if((null==r?void 0:r.length)>0)_.setFieldsValue({question_score:null===(s=parseFloat(r.reduce((function(e,n){return parseFloat(e)+parseFloat(n)}))))||void 0===s?void 0:s.toFixed(1)})}},onFinish:function(e){var n;c(s()(s()(s()({},t),e),{},{question_title:e.name,sub_questions:null==e||null===(n=e.sub_item_banks)||void 0===n?void 0:n.map((function(e){var n,t,i,r;return s()(s()({},e),{},{question_title:e.name,question_choices:null==e||null===(n=e.choices)||void 0===n||null===(t=n.map)||void 0===t?void 0:t.call(n,(function(e){return e.choice_text})),standard_answers:null==e||null===(i=e.choices)||void 0===i||null===(r=i.map)||void 0===r?void 0:r.call(i,(function(e,n){return 1===(null==e?void 0:e.is_answer)&&n+1})).filter((function(e){return e})),item_type:0})}))}))},onFinishFailed:function(){var e=o()(l()().mark((function e(n){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:x.ZP.error(n.errorFields[0].errors[0]),_.scrollToField(null==n||null===(t=n.errorFields)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.name,{behavior:"smooth",block:"center"});case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:[(0,C.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,C.jsxs)("div",{style:{flex:1},children:[(0,C.jsx)("span",{style:{display:"inline-flex",border:"1px solid #9096A3",borderRadius:"50%",width:10,height:10,marginRight:5,background:"#9096A3"}}),(0,C.jsx)("span",{children:"组合题"})]}),(0,C.jsx)(f.Z.Item,{className:Ie,name:"question_score",label:"分值",rules:[{required:!0,message:"请输入分值"}],children:(0,C.jsx)(y.Z,{style:{width:150},placeholder:"请输入当前小题分数",disabled:!0,max:100,min:.1})}),1==(null==a||null===(n=a.exercise)||void 0===n?void 0:n.exercise_status)&&(0,C.jsxs)("span",{style:{marginLeft:20,color:"red",cursor:"pointer"},onClick:function(){d()},children:[(0,C.jsx)("i",{className:"iconfont icon-piliangshanchu3",style:{fontSize:14,marginRight:6}}),"删除"]})]}),(0,C.jsx)(Ke.r,{form:_,withScore:!0,choiceKey:"",questionTitlePlaceholder:"请编辑组合题题干内容"}),(0,C.jsx)(ze,{getTagData:p,qitem:t,exerciseitem:a,TagDiscipline:r,form:_})]}),(0,C.jsxs)("div",{className:Ze,children:[(0,C.jsx)(b.ZP,{className:_e,onClick:function(){var e;_.setFieldsValue(s()(s()({},t),{},{name:t.question_title,sub_item_banks:null===(e=t.sub_exercise_questions)||void 0===e?void 0:e.map((function(e){return s()(s()({},e),{},{name:e.question_title,choices:e.question_choices.map((function(e){return s()(s()({},e),{},{is_answer:null!=e&&e.standard_boolean?1:0})}))})})),repeat_answer:!t.repeat_answer}))},children:"重置"}),(0,C.jsx)(b.ZP,{className:_e,onClick:function(){var e;t.isadd?(i(!1),h()):(_.setFieldsValue(s()(s()({},t),{},{name:t.question_title,sub_item_banks:null===(e=t.sub_exercise_questions)||void 0===e?void 0:e.map((function(e){return s()(s()({},e),{},{name:e.question_title,choices:e.question_choices.map((function(e){return s()(s()({},e),{},{is_answer:null!=e&&e.standard_boolean?1:0})}))})})),repeat_answer:!t.repeat_answer})),i(!1))},children:"取消"}),(0,C.jsx)(b.ZP,{className:ve,onClick:function(){_.submit()},children:"保存题目"})]})]})},Xe=t(33987),Je=function(e){var n,t,i=e.qitem,r=e.setqitem,a=e.setisedit,c=(e.TagDiscipline,e.exerciseitem),d=e.seveeditor,p=e.deleteitem,h=f.Z.useForm(),v=u()(h,1)[0];return(0,m.useEffect)((function(){var e,n;v.setFieldsValue(s()(s()({},i),{},{name:null==i?void 0:i.question_title,choices:null==i||null===(e=i.question_choices)||void 0===e?void 0:e.map((function(e){return s()(s()({},e),{},{standard_boolean:null!=e&&e.standard_boolean?1:0})})),repeat_answer:!(null!=i&&i.repeat_answer)})),i.shixun=null==i||null===(n=i.shixun)||void 0===n?void 0:n.map((function(e){return s()(s()({},e),{},{defaultscore:e.challenge_score})}))}),[]),(0,C.jsxs)("div",{children:[(0,C.jsxs)(f.Z,{form:v,colon:!1,onFinish:function(e){var n,t,r=s()(s()({},e),{},{question_scores:null==i||null===(n=i.shixun)||void 0===n?void 0:n.map((function(e){return e.challenge_score})),item_type:null==i?void 0:i.question_type,choices:null==e||null===(t=e.choices)||void 0===t?void 0:t.map((function(e){return s()(s()({},e),{},{is_answer:e.standard_boolean})}))});d(s()(s()({},i),r))},onFinishFailed:function(){var e=o()(l()().mark((function e(n){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:x.ZP.error(n.errorFields[0].errors[0]),v.scrollToField(null==n||null===(t=n.errorFields)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.name,{behavior:"smooth",block:"center"});case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:[(0,C.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,C.jsxs)("div",{style:{flex:1},children:[(0,C.jsx)("span",{style:{display:"inline-flex",border:"1px solid #9096A3",borderRadius:"50%",width:10,height:10,marginRight:5,background:"#9096A3"}}),(0,C.jsx)("span",{children:"实训题"})]}),(0,C.jsx)(f.Z.Item,{className:Ie,name:"question_score",label:"分值",rules:[{required:!0,message:"请输入分值"}],children:(0,C.jsx)(y.Z,{style:{width:150},placeholder:"请输入当前小题分数",disabled:!0,max:100,min:1})}),1==(null==c||null===(n=c.exercise)||void 0===n?void 0:n.exercise_status)&&(0,C.jsxs)("span",{style:{marginLeft:20,color:"red",cursor:"pointer"},onClick:function(){p()},children:[(0,C.jsx)("i",{className:"iconfont icon-piliangshanchu3",style:{fontSize:14,marginRight:6}}),"删除"]})]}),(0,C.jsx)(f.Z.Item,{label:"题干",name:"question_title",labelCol:{span:24},rules:[{required:!0}],children:(0,C.jsx)(Xe.Z,{watch:!0,height:140,placeholder:"",defaultValue:i.question_title})})]}),(0,C.jsx)("div",{children:(0,C.jsxs)("p",{children:[(0,C.jsx)("span",{style:{color:"red"},children:"*"}),"关卡名称"]})}),null==i||null===(t=i.shixun)||void 0===t?void 0:t.map((function(e,n){return(0,C.jsxs)("div",{style:{display:"flex",marginBottom:20},children:[(0,C.jsxs)("div",{style:{flex:1},children:[n+1,"、",e.challenge_name]}),(0,C.jsxs)("div",{children:[(0,C.jsx)("span",{style:{color:"red"},children:"*"}),"分值",(0,C.jsx)(y.Z,{value:null==e?void 0:e.challenge_score,onChange:function(n){var t;e.challenge_score=n;var l=parseFloat(null==i||null===(t=i.shixun)||void 0===t?void 0:t.map((function(e){return e.challenge_score})).reduce((function(e,n){return parseFloat(e)+parseFloat(n)})));v.setFieldsValue({question_score:l.toFixed(1)}),r(s()({},i))},max:100,min:.1,style:{marginLeft:10,width:150},placeholder:"请输入当前小题分数",size:"middle"})]})]})})),(0,C.jsxs)("div",{className:Ze,children:[(0,C.jsx)(b.ZP,{className:_e,onClick:function(){var e,n;v.setFieldsValue(s()(s()({},i),{},{name:null==i?void 0:i.question_title,choices:null==i||null===(e=i.question_choices)||void 0===e?void 0:e.map((function(e){return s()(s()({},e),{},{standard_boolean:null!=e&&e.standard_boolean?1:0})})),repeat_answer:!(null!=i&&i.repeat_answer)})),i.shixun=null==i||null===(n=i.shixun)||void 0===n?void 0:n.map((function(e){return s()(s()({},e),{},{challenge_score:e.defaultscore})})),r(s()({},i))},children:"重置"}),(0,C.jsx)(b.ZP,{className:_e,onClick:function(){var e,n;v.setFieldsValue(s()(s()({},i),{},{name:null==i?void 0:i.question_title,choices:null==i||null===(e=i.question_choices)||void 0===e?void 0:e.map((function(e){return s()(s()({},e),{},{standard_boolean:null!=e&&e.standard_boolean?1:0})})),repeat_answer:!(null!=i&&i.repeat_answer)})),i.shixun=null==i||null===(n=i.shixun)||void 0===n?void 0:n.map((function(e){return s()(s()({},e),{},{challenge_score:e.defaultscore})})),r(s()({},i)),a(!1)},children:"取消"}),(0,C.jsx)(b.ZP,{className:ve,onClick:o()(l()().mark((function e(){var n,t,s;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((null==i||null===(n=i.shixun)||void 0===n||null===(t=n.map)||void 0===t?void 0:t.call(n,(function(e){return e.challenge_score})).filter((function(e){return e})).length)<(null==i||null===(s=i.shixun)||void 0===s?void 0:s.length))){e.next=3;break}return x.ZP.info("分数不能为空"),e.abrupt("return");case 3:v.submit();case 4:case"end":return e.stop()}}),e)}))),children:"保存题目"})]}),console.log("---",i)]})},Qe="warp___UlRJc",$e="normalWrap___Qm4zY",en="indexTag___rjJ1u",nn="redio___VW3yr",tn="redioitem___jAPlJ",sn="redioitemyes___VoiQ1",rn="title___Dt2dl",ln="titleyes___Fjh3a",an="yestag___CXrPv",on="checkbox___CgMU_",cn="checkboxitem___PpJ9n",un="checkboxitemyes___pCfvZ",dn="bottom___BqrmJ",pn="bottomitem___Qk2rG",mn="left___l29lW",hn="right___nB1XE",fn="completion___y1m7L",xn="content___AmQy4",vn="items___lIt8e",_n="simple___zxJLH",gn="shixunWrapper___kAYdL",jn="shixun___UE6xS",yn="score___Px5Fq",bn="qtitle___wG7Nn",wn="program___gzKdL",kn="combination___R0ysn",Nn="qtype___U0Suy",Zn=t(95237),In=t(43604),Cn=t(24334),Pn=["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."],Sn=function(e){var n,t,i,s,r,l,a,o,c,u=e.qitem;return(0,C.jsxs)("div",{className:Qe,children:[(0===(null==u?void 0:u.question_type)||2===(null==u?void 0:u.question_type))&&(0,C.jsx)("div",{className:$e,children:null==u||null===(n=u.question_choices)||void 0===n?void 0:n.map((function(e,n){return(0,C.jsxs)("div",{className:nn,children:[!(null!=e&&e.standard_boolean)&&(0,C.jsx)("span",{className:tn}),(null==e?void 0:e.standard_boolean)&&(0,C.jsx)("i",{className:"".concat(sn," icon-duigou1")}),(0,C.jsx)("span",{className:"".concat(null!=e&&e.standard_boolean?ln:rn," ").concat(en),children:0===(null==u?void 0:u.question_type)?Pn[n]:""}),(0,C.jsx)(Fe.Z,{className:null!=e&&e.standard_boolean?ln:rn,value:null==e?void 0:e.choice_text}),(null==e?void 0:e.standard_boolean)&&(0,C.jsx)("div",{className:an,children:"正确答案"})]})}))}),1===(null==u?void 0:u.question_type)&&(0,C.jsx)("div",{className:$e,children:null==u||null===(t=u.question_choices)||void 0===t?void 0:t.map((function(e,n){return(0,C.jsxs)("div",{className:on,children:[!(null!=e&&e.standard_boolean)&&(0,C.jsx)("span",{className:cn}),(null==e?void 0:e.standard_boolean)&&(0,C.jsx)("i",{className:"".concat(un," icon-duigou1")}),(0,C.jsx)("span",{className:"".concat(null!=e&&e.standard_boolean?ln:rn," ").concat(en),children:Pn[n]}),(0,C.jsx)(Fe.Z,{className:null!=e&&e.standard_boolean?ln:rn,value:null==e?void 0:e.choice_text}),(null==e?void 0:e.standard_boolean)&&(0,C.jsx)("div",{className:an,children:"正确答案"})]})}))}),3===(null==u?void 0:u.question_type)&&(0,C.jsx)("div",{className:fn,children:null==u||null===(i=u.standard_answer)||void 0===i?void 0:i.map((function(e,n){var t;return(0,C.jsxs)("div",{style:{display:"flex"},children:[(0,C.jsxs)("span",{className:rn,children:["填空项",n+1]}),(0,C.jsx)(Zn.Z,{gutter:[30,20],className:"".concat(xn," mb20"),children:null===(t=e.answer_text)||void 0===t?void 0:t.map((function(e,n){return(0,C.jsx)(In.Z,{children:(0,C.jsx)("div",{className:vn,children:e})},n)}))})]})}))}),4===(null==u?void 0:u.question_type)&&(0,C.jsxs)("div",{className:_n,children:[(0,C.jsx)("span",{className:rn,children:"参考答案"}),(0,C.jsx)(Fe.Z,{className:xn,value:(null==u||null===(s=u.standard_answer)||void 0===s?void 0:s[0])||""})]}),5===(null==u?void 0:u.question_type)&&(0,C.jsx)("div",{className:gn,children:null==u||null===(r=u.shixun)||void 0===r?void 0:r.map((function(e,n){return(0,C.jsxs)("div",{className:"".concat(jn," mb30"),children:[(0,C.jsxs)("span",{className:yn,children:["(",null==e?void 0:e.challenge_score,"分)"]}),(0,C.jsxs)("span",{className:bn,children:[(null==u?void 0:u.index)+"."+(n+1),"、",null==e?void 0:e.challenge_name]})]},n)}))}),6===(null==u?void 0:u.question_type)&&(0,C.jsx)("div",{className:wn,children:(0,C.jsx)(Fe.Z,{className:xn,value:(null==u?void 0:u.description)||"- -"})}),7===(null==u?void 0:u.question_type)&&(null==u||null===(l=u.sub_exercise_questions)||void 0===l?void 0:l.map((function(e,n){var t;return(0,C.jsxs)("div",{children:[(0,C.jsxs)("div",{className:kn,children:[(0,C.jsxs)("span",{className:yn,children:[null==e?void 0:e.question_score,"分"]}),(0,C.jsx)("span",{className:Nn,children:"单选题"}),(0,C.jsxs)("span",{className:bn,children:[(null==u?void 0:u.index)+"."+(n+1),"、",null==e?void 0:e.question_title]})]}),(0,C.jsx)("div",{className:Qe,style:{padding:"30px 58px",paddingBottom:0},children:(0,C.jsx)("div",{children:null==e||null===(t=e.question_choices)||void 0===t?void 0:t.map((function(e,n){return(0,C.jsxs)("div",{className:nn,children:[!(null!=e&&e.standard_boolean)&&(0,C.jsx)("span",{className:tn}),(null==e?void 0:e.standard_boolean)&&(0,C.jsx)("i",{className:"".concat(sn," icon-duigou1")}),(0,C.jsx)("span",{className:"".concat(null!=e&&e.standard_boolean?ln:rn," ").concat(en),children:Pn[n]}),(0,C.jsx)(Fe.Z,{className:null!=e&&e.standard_boolean?ln:rn,value:null==e?void 0:e.choice_text}),(null==e?void 0:e.standard_boolean)&&(0,C.jsx)("div",{className:an,children:"正确答案"})]})}))})})]})}))),8===(null==u?void 0:u.question_type)&&(0,C.jsx)("div",{children:(0,C.jsx)(Fe.Z,{disabledFill:!0,className:xn,showProgramFill:!0,value:Cn.Base64.decode((null==u||null===(a=u.program_attr)||void 0===a?void 0:a.code)||"")})}),((null==u?void 0:u.question_type)<=4||[6,8].includes(null==u?void 0:u.question_type))&&(0,C.jsxs)("div",{className:dn,children:[(0,C.jsxs)("div",{className:"".concat(pn," mb30"),children:[(0,C.jsx)("span",{className:mn,children:"解析"}),(0,C.jsx)(Fe.Z,{className:hn,value:(null==u?void 0:u.analysis)||""})]}),(0,C.jsxs)("div",{className:"".concat(pn," mb30"),children:[(0,C.jsx)("span",{className:mn,children:"难度"}),(0,C.jsx)("span",{className:hn,children:1===(null==u?void 0:u.difficulty)?"简单":2===(null==u?void 0:u.difficulty)?"适中":3===(null==u?void 0:u.difficulty)?"困难":"- -"})]}),(0,C.jsxs)("div",{className:pn,children:[(0,C.jsx)("span",{className:mn,children:"知识点"}),(0,C.jsx)("span",{className:hn,children:(null==u||null===(o=u.tag_discipline_names)||void 0===o?void 0:o.length)<=0?"- -":null==u||null===(c=u.tag_discipline_names)||void 0===c?void 0:c.toString()})]})]})]})},Tn=t(18187),qn=t(85628),En=function(e){var n,t=e.qitem,i=e.setisedit,r=e.TagDiscipline,a=e.exerciseitem,c=e.seveeditor,d=e.deleteitem,p=e.getTagData,h=e.init,v=f.Z.useForm(),_=u()(v,1)[0];return(0,m.useEffect)((function(){_.setFieldsValue(s()(s()({},t),{},{name:t.question_title,answer_texts:t.standard_answer,repeat_answer:!t.repeat_answer}))}),[t]),(0,C.jsxs)("div",{children:[(0,C.jsxs)(f.Z,{form:_,colon:!1,onFinish:function(e){c(s()(s()(s()({},t),e),{},{standard_answers:null==e?void 0:e.answer_texts,question_title:null==e?void 0:e.name}))},onFinishFailed:function(){var e=o()(l()().mark((function e(n){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:x.ZP.error(n.errorFields[0].errors[0]),_.scrollToField(null==n||null===(t=n.errorFields)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.name,{behavior:"smooth",block:"center"});case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:[(0,C.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,C.jsxs)("div",{style:{flex:1},children:[(0,C.jsx)("span",{style:{display:"inline-flex",border:"1px solid #9096A3",borderRadius:"50%",width:10,height:10,marginRight:5,background:"#9096A3"}}),(0,C.jsx)("span",{children:"简答题"})]}),(0,C.jsx)(f.Z.Item,{className:Ie,name:"question_score",label:"分值",rules:[{required:!0,message:"请输入分值"}],children:(0,C.jsx)(y.Z,{style:{width:150},placeholder:"请输入当前小题分数",max:100,min:.1})}),1==(null==a||null===(n=a.exercise)||void 0===n?void 0:n.exercise_status)&&(0,C.jsxs)("span",{style:{marginLeft:20,color:"red",cursor:"pointer"},onClick:function(){d()},children:[(0,C.jsx)("i",{className:"iconfont icon-piliangshanchu3",style:{fontSize:14,marginRight:6}}),"删除"]})]}),(0,C.jsx)(qn.W,{form:_,showKeywords:!0,questionTitlePlaceholder:"请编辑简答题题干内容"}),(0,C.jsx)(ze,{getTagData:p,qitem:t,exerciseitem:a,TagDiscipline:r,form:_})]}),(0,C.jsxs)("div",{className:Ze,children:[(0,C.jsx)(b.ZP,{className:_e,onClick:function(){_.setFieldsValue(s()(s()({},t),{},{name:null==t?void 0:t.question_title,answer_texts:t.standard_answer||[],repeat_answer:!(null!=t&&t.repeat_answer)}))},children:"重置"}),(0,C.jsx)(b.ZP,{className:_e,onClick:function(){t.isadd?(i(!1),h()):(_.setFieldsValue(s()(s()({},t),{},{name:null==t?void 0:t.question_title,answer_texts:t.standard_answer||[],repeat_answer:!(null!=t&&t.repeat_answer)})),i(!1))},children:"取消"}),(0,C.jsx)(b.ZP,{className:ve,onClick:function(){_.submit()},children:"保存题目"})]})]})},Fn=function(e){var n,t,i=e.setScoreShow,s=e.ScoreShow,r=e.exerciseitem,a=e.getdata,c=(0,m.useState)(!1),d=u()(c,2),p=d[0],h=d[1];function f(){return x.apply(this,arguments)}function x(){return(x=o()(l()().mark((function e(){var n,t,i,s;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=null==r||null===(n=r.exercise_question_types)||void 0===n||null===(n=n.filter((function(e){return e.Singlequestion})))||void 0===n?void 0:n.map((function(e){return{question_type:e.question_type,score:e.Singlequestion}})),e.next=3,(0,S.ZP)("/api/exercises/".concat(null==r||null===(t=r.exercise)||void 0===t?void 0:t.id,"/batch_set_score.json"),{method:"POST",body:{question_arr:i}});case 3:0===(null==(s=e.sent)?void 0:s.status)&&a();case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return(0,C.jsxs)("div",{children:[s&&(0,C.jsxs)(k.Z,{title:!1,footer:!1,open:s,width:640,centered:!0,zIndex:10,closable:!1,className:pe,onCancel:function(){i(!1)},children:[(0,C.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,C.jsxs)("div",{className:H,children:["批量设置分值",(0,C.jsxs)("div",{className:ie,children:["总分 ",(null==r?void 0:r.exercise_question_types.length)>0&&(null==r||null===(n=r.exercise_types)||void 0===n?void 0:n.q_scores)]})]}),(0,C.jsx)("span",{onClick:function(){return i(!1)},className:me,children:"X"})]}),(0,C.jsxs)("div",{className:he,children:[(0,C.jsx)("span",{children:"题型名称"}),(0,C.jsx)("span",{children:"小题总数"}),(0,C.jsx)("span",{children:"题型总分"}),(0,C.jsx)("span",{children:"操作"})]}),null==r||null===(t=r.exercise_question_types)||void 0===t||null===(t=t.filter((function(e){return"实训题"!==e.name&&"组合题"!==e.name})))||void 0===t?void 0:t.map((function(e){var n;return(0,C.jsxs)("div",{className:fe,children:[(0,C.jsx)("span",{children:null==e?void 0:e.name}),(0,C.jsx)("span",{children:null==e||null===(n=e.items)||void 0===n?void 0:n.length}),(0,C.jsx)("span",{children:null==e?void 0:e.score}),(0,C.jsxs)("span",{children:["每题",(0,C.jsx)(y.Z,{max:100,min:.1,onChange:function(n){e.Singlequestion=n},style:{width:90,height:38,margin:"0px 10px",display:"flex",alignItems:"center"}}),"分"]})]})})),(0,C.jsxs)("div",{className:xe,children:[(0,C.jsx)(b.ZP,{className:_e,onClick:function(){i(!1)},children:"取消"}),(0,C.jsx)(b.ZP,{className:ve,onClick:function(){var e;null!=r&&r.use_blank_score&&null!=r&&null!==(e=r.exercise_question_types)&&void 0!==e&&null!==(e=e.filter((function(e){return"填空题"===e.name})))&&void 0!==e&&null!==(e=e[0])&&void 0!==e&&e.Singlequestion?h(!0):(f(),i(!1))},children:"确认"})]})]}),(0,C.jsxs)(k.Z,{title:!1,footer:!1,centered:!0,zIndex:20,open:p,width:640,closable:!1,className:pe,children:[(0,C.jsxs)("div",{style:{marginTop:40},children:["填空题中存在",(0,C.jsx)("span",{style:{color:"#FA6400"},children:"按空给分"}),"的小题,若批量设置分值会统一将填空题改为按题给分"]}),(0,C.jsxs)("div",{className:xe,children:[(0,C.jsx)(b.ZP,{className:_e,onClick:function(){h(!1)},children:"取消"}),(0,C.jsx)(b.ZP,{className:ve,onClick:function(){f(),h(!1),i(!1)},children:"确认"})]})]})]})},On=t(91232),Ln=t.n(On),Mn=t(99313),Rn=t(61998),An=t(27092),Bn="scoremodal___PfqOf",Dn="selectWrapper___Mtqcz",zn="allqingchu___IqL8g",Vn="title___UgYfD",Wn="close___I0jAO",Un="bottom___vQTEm",Hn="yes___j81JQ",Gn="no___kiUH4",Kn="titlecount___lliQr",Yn="add___QhDj8",Xn="search___QCCaL",Jn="searchIcon___oXRH5",Qn="tabWrap___Cu_4D",$n="previewModal___BVDlS",et=t(65010),nt="warp___isAcM",tt="mainPart___TiJvQ",it="shixunbutton___h3Ybb",st="redio___xDffb",rt="redioitem___FFPtq",lt="redioitemyes___pF7ID",at="title___mnPZc",ot="titleyes___wrtWQ",ct="yestag___D4krY",ut="qcount___W5pwO",dt="qtitle___lb8MD",pt="checkbox___QpUm4",mt="checkboxitem___Wm2SH",ht="checkboxitemyes___VVVTe",ft="bottom___Mn_Bw",xt="bottomitem___JTyHT",vt="left___nQqpo",_t="right___v58qy",gt="completion___BnZSp",jt="content___MU8hZ",yt="items___a7i54",bt="simple___GDw3K",wt="shixun___DGzTe",kt="combination___AG9cr",Nt=["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."],Zt=function(e){var n,t,i,s,r,l,a,o,c,u=e.qitem;return(0,C.jsxs)("div",{className:nt,children:[(0,C.jsxs)("div",{className:tt,children:[(0,C.jsxs)("div",{className:ut,children:[8===(null==u?void 0:u.question_type)&&(0,C.jsx)(Fe.Z,{className:jt,showProgramFill:!0,value:null==u||null===(n=u.program_attr)||void 0===n?void 0:n.description}),8!=(null==u?void 0:u.question_type)&&(0,C.jsx)(Fe.Z,{className:dt,value:(null==u?void 0:u.name)||(null==u?void 0:u.title)})]}),(0===(null==u?void 0:u.question_type)||2===(null==u?void 0:u.question_type))&&(0,C.jsx)("div",{children:null==u||null===(t=u.choices)||void 0===t?void 0:t.map((function(e,n){return(0,C.jsxs)("div",{className:st,children:[!(null!=e&&e.is_answer)&&(0,C.jsx)("span",{className:rt}),(null==e?void 0:e.is_answer)&&(0,C.jsx)("i",{className:"".concat(lt," icon-duigou1")}),(0,C.jsx)(Fe.Z,{className:null!=e&&e.is_answer?ot:at,value:Nt[n]+(null==e?void 0:e.choice_text)}),(null==e?void 0:e.is_answer)&&(0,C.jsx)("div",{className:ct,children:"正确答案"})]})}))}),1===(null==u?void 0:u.question_type)&&(0,C.jsx)("div",{children:null==u||null===(i=u.choices)||void 0===i?void 0:i.map((function(e,n){return(0,C.jsxs)("div",{className:pt,children:[!(null!=e&&e.is_answer)&&(0,C.jsx)("span",{className:mt}),(null==e?void 0:e.is_answer)&&(0,C.jsx)("i",{className:"".concat(ht," icon-duigou1")}),(0,C.jsx)(Fe.Z,{className:null!=e&&e.is_answer?ot:at,value:Nt[n]+(null==e?void 0:e.choice_text)}),(null==e?void 0:e.is_answer)&&(0,C.jsx)("div",{className:ct,children:"正确答案"})]})}))}),3===(null==u?void 0:u.question_type)&&(0,C.jsx)("div",{className:gt,children:null==u||null===(s=u.standard_answer)||void 0===s?void 0:s.map((function(e,n){var t;return(0,C.jsxs)("div",{style:{display:"flex"},children:[(0,C.jsxs)("span",{className:at,children:["填空项",n+1]}),(0,C.jsx)("div",{className:jt,children:null==e||null===(t=e.answer_text)||void 0===t?void 0:t.map((function(e,n){return(0,C.jsx)("div",{className:yt,children:e})}))})]})}))}),4===(null==u?void 0:u.question_type)&&(0,C.jsxs)("div",{className:bt,children:[(0,C.jsx)("span",{className:at,children:"参考答案"}),(0,C.jsx)(Fe.Z,{className:jt,value:(null==u||null===(r=u.answer_texts)||void 0===r?void 0:r[0])||"- -"})]}),5===(null==u?void 0:u.question_type)&&(null==u||null===(l=u.challenge_names)||void 0===l?void 0:l.map((function(e,n){return(0,C.jsx)("div",{className:wt,children:(0,C.jsxs)("span",{className:dt,children:[(0,C.jsxs)("span",{style:{marginRight:10},children:["第",(0,Se.EM)(n+1),"题"]}),e]})})}))),6===(null==u?void 0:u.question_type)&&(0,C.jsx)("div",{className:bt,children:(0,C.jsx)(Fe.Z,{className:jt,value:(null==u||null===(a=u.program_attr)||void 0===a?void 0:a.description)||"- -"})}),7===(null==u?void 0:u.question_type)&&(null==u||null===(o=u.sub_item_banks)||void 0===o?void 0:o.map((function(e,n){var t;return(0,C.jsxs)("div",{children:[(0,C.jsx)("div",{className:kt,children:(0,C.jsx)("span",{className:dt,children:null==e?void 0:e.name})}),(0,C.jsx)("div",{className:nt,style:{padding:"0px",paddingTop:20},children:(0,C.jsx)("div",{children:null==e||null===(t=e.choices)||void 0===t?void 0:t.map((function(e,n){return(0,C.jsxs)("div",{className:st,children:[!(null!=e&&e.is_answer)&&(0,C.jsx)("span",{className:rt}),(null==e?void 0:e.is_answer)&&(0,C.jsx)("i",{className:"".concat(lt," icon-duigou1")}),(0,C.jsx)(Fe.Z,{className:null!=e&&e.is_answer?ot:at,value:Nt[n]+(null==e?void 0:e.choice_text)}),(null==e?void 0:e.is_answer)&&(0,C.jsx)("div",{className:ct,children:"正确答案"})]})}))})})]})}))),8===(null==u?void 0:u.question_type)&&(0,C.jsx)("div",{children:(0,C.jsx)(Fe.Z,{disabledFill:!0,className:jt,showProgramFill:!0,value:Cn.Base64.decode((null==u||null===(c=u.program_attr)||void 0===c?void 0:c.code)||"")})}),5===(null==u?void 0:u.question_type)&&(0,C.jsxs)("div",{style:{background:"#F6F7F9",padding:"0px 20px",height:46,lineHeight:"46px",marginTop:40,display:"flex",alignItems:"center"},children:[(0,C.jsxs)("div",{style:{flex:1,alignItems:"center",display:"flex"},children:[(0,C.jsxs)("div",{style:{marginRight:30},children:[(0,C.jsx)("span",{style:{marginRight:10,color:"#666666"},children:"创建者"}),(0,C.jsx)("span",{style:{color:"#000000"},children:(null==u?void 0:u.author_name)||"- -"})]}),(0,C.jsxs)("div",{style:{marginRight:30},children:[(0,C.jsx)("span",{style:{marginRight:10,color:"#666666"},children:"所属单位"}),(0,C.jsx)("span",{style:{color:"#000000"},children:(null==u?void 0:u.author_school_name)||"- -"})]}),(0,C.jsxs)("div",{style:{marginRight:30},children:[(0,C.jsx)("span",{style:{marginRight:10,color:"#666666"},children:"学习人数"}),(0,C.jsx)("span",{style:{color:"#000000"},children:(null==u?void 0:u.study_count)||"0"})]})]}),(0,C.jsxs)("a",{className:it,href:"/shixuns/".concat(null==u?void 0:u.identifier,"/challenges?exercise=true"),target:"_blank",children:[(0,C.jsx)("i",{onClick:function(){},style:{marginRight:20},className:"iconfont icon-shixunkecheng mr5 "}),"实训详情"]})]})]}),((null==u?void 0:u.question_type)<=4||[6,8].includes(null==u?void 0:u.question_type))&&(0,C.jsxs)("div",{className:ft,children:[(0,C.jsxs)("div",{className:xt,style:{alignItems:"flex-start"},children:[(0,C.jsx)("span",{className:vt,children:"解析"}),(0,C.jsx)(Fe.Z,{className:_t,value:(null==u?void 0:u.analysis)||""})]}),(0,C.jsxs)("div",{className:xt,style:{alignItems:"center"},children:[(0,C.jsx)("span",{className:vt,children:"难度"}),(0,C.jsx)("span",{className:_t,children:1===(null==u?void 0:u.difficulty)?"简单":2===(null==u?void 0:u.difficulty)?"适中":"困难"})]}),(0,C.jsxs)("div",{className:xt,style:{alignItems:"center"},children:[(0,C.jsx)("span",{className:vt,children:"知识点"}),(0,C.jsx)("span",{className:_t,children:null==u?void 0:u.tag_discipline})]})]})]})},It=t(73806),Ct=t(72684),Pt=t(90155),St=function(e){var n,t=e.setScoreShow,i=e.ScoreShow,r=e.onOk,a=e.isshixuns,c=e.isloadings,d=(0,m.useState)({type:"1",page:1,per_page:10,updated_at:"",quotes:""}),p=u()(d,2),v=p[0],j=p[1],y=(0,m.useState)([]),w=u()(y,2),N=w[0],Z=w[1],I=(0,m.useState)([]),P=u()(I,2),T=P[0],E=P[1],F=(0,m.useState)([]),O=u()(F,2),M=O[0],R=O[1],A=(0,m.useState)([]),B=u()(A,2),D=B[0],z=B[1],V=(0,m.useState)(!1),W=u()(V,2),U=W[0],H=W[1],G=f.Z.useForm(),K=u()(G,1)[0],Y=(0,m.useState)(),X=u()(Y,2),J=X[0],Q=X[1],$=(0,m.useState)(!1),ee=u()($,2),ne=ee[0],te=ee[1],ie=(0,m.useState)(a),se=u()(ie,2),re=se[0],le=se[1],ae=(0,m.useState)([]),oe=u()(ae,2),ce=oe[0],ue=oe[1],de=(0,m.useState)(!0),pe=u()(de,2),me=pe[0],he=pe[1],fe=(0,m.useState)(0),xe=u()(fe,2),ve=xe[0],_e=xe[1],ge=[{name:"全部",value:"",question_type:0},{name:"编程题",value:"PROGRAM",question_type:6},{name:"单选题",value:"SINGLE",question_type:0},{name:"多选题",value:"MULTIPLE",question_type:1},{name:"判断题",value:"JUDGMENT",question_type:2},{name:"填空题",value:"COMPLETION",question_type:3},{name:"简答题",value:"SUBJECTIVE",question_type:4},{name:"实训题",value:"SHIXUN",question_type:5},{name:"组合题",value:"COMBINATION",question_type:7},{name:"程序填空题",value:"BPROGRAM",question_type:8}],je=(0,m.useState)([]),ye=u()(je,2),be=ye[0],we=ye[1],ke=(0,m.useRef)(new Set),Ne=(0,m.useRef)(new Set),Ze=[{name:"简单",value:1},{name:"适中",value:2},{name:"困难",value:3}],Ie=(0,m.useState)(!1),Ce=u()(Ie,2),Pe=Ce[0],Se=Ce[1];function Te(e){return qe.apply(this,arguments)}function qe(){return(qe=o()(l()().mark((function e(n){var t,i,r,a,o,c,u,d;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(H(!0),j(n),!re){e.next=9;break}return e.next=5,(0,S.ZP)("/api/shixun_lists.json",{method:"get",params:s()(s()({},n),{},{discipline_id:(null==n||null===(t=n.courseid)||void 0===t?void 0:t[0])||null,sub_discipline_id:(null==n||null===(i=n.courseid)||void 0===i?void 0:i[1])||null,limit:n.per_page})});case 5:r=e.sent,z(r),e.next=19;break;case 9:if(!((null==M?void 0:M.length)<=0&&"5"===n.type)){e.next=13;break}return z([]),H(!1),e.abrupt("return");case 13:return c="5"===n.type?null==M?void 0:M.filter((function(e){return!ce.includes(e)})):null,u="5"===n.type?null==M?void 0:M.filter((function(e){return ce.includes(e)})):null,e.next=17,(0,S.ZP)("/api/item_banks.json",{method:"get",params:s()(s()({},n),{},{discipline_id:(null==n||null===(a=n.courseid)||void 0===a?void 0:a[0])||null,sub_discipline_id:(null==n||null===(o=n.courseid)||void 0===o?void 0:o[1])||null,ids:c,shixun_ids:u,type:"5"===n.type?null:n.type})});case 17:d=e.sent,z(d);case 19:H(!1);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ee(){return(Ee=o()(l()().mark((function e(){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.ZP)("/api/disciplines.json",{method:"get",params:{source:"question",group_id:0,group_type:"5"===v.type?null:"5"===v.type,clazz:"ItemBanksGroup"}});case 2:n=e.sent,Z((0,et.L)(null==n?void 0:n.disciplines));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Oe(e){return Le.apply(this,arguments)}function Le(){return(Le=o()(l()().mark((function e(n){var t,i,r,a,o,c,u;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(H(!0),o=null===(t=n.list)||void 0===t?void 0:t.filter((function(e){return!ce.includes(e)})),c=null===(i=n.list)||void 0===i?void 0:i.filter((function(e){return ce.includes(e)})),0!==o.length||0!==c.length){e.next=7;break}return H(!1),z([]),e.abrupt("return");case 7:return e.next=9,(0,S.ZP)("/api/item_banks.json",{method:"get",params:s()(s()({},n),{},{discipline_id:(null==n||null===(r=n.courseid)||void 0===r?void 0:r[0])||null,sub_discipline_id:(null==n||null===(a=n.courseid)||void 0===a?void 0:a[1])||null,ids:o,shixun_ids:c,type:"5"===n.type?null:n.type})});case 9:u=e.sent,H(!1),z(u);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(0,m.useEffect)((function(){ve>0&&setTimeout((function(){_e(0)}),2e3)}),[ve]),(0,m.useEffect)((function(){i&&(Te(v),function(){Ee.apply(this,arguments)}(),K.setFieldsValue({item_type:null,courseid:"",tag_discipline_id:null,difficulty:null,keyword:null}),me&&re&&(K.setFieldsValue({item_type:"SHIXUN"}),he(!1)))}),[i]);var Me=(0,h.useParams)(),Re=(0,Pt.P)(),Ae=u()(Re,4),Be=Ae[0],De=Ae[1],ze=Ae[2],Ve=Ae[3];return(0,C.jsxs)("div",{children:[(0,C.jsxs)(k.Z,{title:!1,footer:!1,open:i,width:1200,centered:!0,closable:!1,className:Bn,onCancel:function(){t(!1)},children:[(0,C.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,C.jsx)("div",{className:Vn,children:"题库选题"}),(0,C.jsx)("span",{onClick:function(){return t(!1)},className:Wn,children:"X"})]}),(0,C.jsx)(Mn.Z,{className:Qn,activeKey:v.type,onChange:function(e){v.type=e,v.page=1,v.updated_at="",v.quotes="",v.item_type=null,v.courseid="",v.tag_discipline_id=null,v.difficulty=null,v.keyword=null,K.setFieldsValue({item_type:null,courseid:"",tag_discipline_id:null,difficulty:null,keyword:null}),Se(!1),"5"===v.type&&(re=!1,le(!1)),j(s()({},v)),Te(s()({},v))},items:[{label:"公共",key:"1"},{label:"团队共享",key:"3"},{label:"收藏夹",key:"2"},{label:"我创建的",key:"0"},{label:(0,C.jsxs)("div",{children:["已选",M.length>0&&(0,C.jsx)("span",{className:Kn,children:M.length}),ve>0&&(0,C.jsxs)("span",{className:Yn,children:["+",ve]})]}),key:"5"}]}),(0,C.jsxs)(f.Z,{layout:"inline",form:K,onValuesChange:function(e,n){var t,i,s=Object.values(n).some((function(e){return null!==e&&""!==e&&void 0!==e})),r=""===n.keyword;if(Se(s||!r),v.page=1,v.keyword=null===(t=v.keyword)||void 0===t||null===(i=t.replace)||void 0===i?void 0:i.call(t,/^\s+|\s+$/g,""),"SHIXUN"===(null==n?void 0:n.item_type)){if("5"===v.type?le(!1):le(!0),e.keyword||""===e.keyword)return;K.submit()}else{if(null!=e&&e.courseid&&K.setFieldsValue({tag_discipline_id:""}),le(!1),e.keyword||""===e.keyword)return;K.submit()}},onFinish:function(e){Te(s()(s()({},v),e))},children:[(0,C.jsx)(f.Z.Item,{name:"item_type",children:(0,C.jsx)(L.default,{className:Dn,placeholder:"题型",style:{width:110},size:"middle",allowClear:!0,children:ge.map((function(e){return(0,C.jsx)(L.default.Option,{children:e.name},e.value)}))})}),(0,C.jsx)(f.Z.Item,{name:"courseid",children:(0,C.jsx)(g.Z,{className:Dn,style:{width:160},size:"middle",placeholder:"方向&课程",options:N})}),!re&&(0,C.jsx)(f.Z.Item,{name:"tag_discipline_id",children:(0,C.jsx)(L.default,{className:Dn,placeholder:"知识点",style:{width:160},size:"middle",allowClear:!0,children:null==D||null===(n=D.tag_disciplines)||void 0===n?void 0:n.map((function(e){return(0,C.jsx)(L.default.Option,{children:e.name},e.id)}))})}),(0,C.jsx)(f.Z.Item,{name:re?"diff":"difficulty",children:(0,C.jsxs)(L.default,{className:Dn,placeholder:"难度",style:{width:118},size:"middle",allowClear:!0,children:[!re&&Ze.map((function(e){return(0,C.jsx)(L.default.Option,{children:e.name},e.value)})),re&&[{name:"初级",value:1},{name:"中级",value:2},{name:"中高级",value:3},{name:"高级",value:4}].map((function(e){return(0,C.jsx)(L.default.Option,{children:e.name},e.value)}))]})}),Pe&&(0,C.jsxs)("span",{className:zn,onClick:function(){K.resetFields(),Se(!1),K.submit()},children:[(0,C.jsx)("i",{className:"iconfont icon-guanbi4"}),(0,C.jsx)("span",{children:"清除筛选条件"})]}),(0,C.jsx)(f.Z.Item,{style:{flex:"0 0 auto",marginRight:0,marginLeft:"auto"},name:"keyword",children:(0,C.jsx)(_.Z.Search,{className:Xn,placeholder:"请输入关键词搜索",allowClear:!0,suffix:(0,C.jsx)("i",{className:"iconfont icon-sousuo9 font14 ".concat(Jn),onClick:function(){return K.submit()}}),onSearch:function(e){K.submit()}})})]}),(0,C.jsxs)("div",{style:{background:"#F6F7F9",display:"flex",alignItems:"center",marginTop:18,height:40,paddingLeft:10,paddingRight:20},children:[(0,C.jsxs)("div",{onClick:function(){"asc"===v.updated_at?v.updated_at="desc":v.updated_at="asc",j(s()(s()({},v),{},{page:1})),Te(s()(s()({},v),{},{page:1}))},children:[" ",v.updated_at?(0,C.jsx)("img",{src:"asc"===v.updated_at?It.Z:Ct.Z,style:{width:"15px",verticalAlign:"text-bottom"},className:"font14 mr5 c-light-primary"}):(0,C.jsx)("i",{style:{fontSize:"14px"},className:"iconfont icon-jiangxu mr5 c-light-primary"}),"按更新时间排序"]}),(0,C.jsxs)("div",{onClick:function(){"asc"===v.quotes?v.quotes="desc":v.quotes="asc",j(s()(s()({},v),{},{page:1})),Te(s()(s()({},v),{},{page:1}))},style:{marginLeft:20},children:[" ",v.quotes?(0,C.jsx)("img",{src:"asc"===v.quotes?It.Z:Ct.Z,style:{width:"15px",verticalAlign:"text-bottom"},className:"font14 mr5 c-light-primary"}):(0,C.jsx)("i",{style:{fontSize:"14px"},className:"iconfont icon-jiangxu mr5 c-light-primary"}),"按使用次数排序"]})]}),(0,C.jsx)(Rn.Z,{style:{marginTop:2,marginBottom:20},scroll:{y:260},dataSource:(null==D?void 0:D.items)||(null==D?void 0:D.shixun_list),pagination:!1,loading:U,rowKey:function(e){return e.id},rowSelection:{type:"checkbox",selectedRowKeys:T,onSelect:function(e,n,t){if(n)re&&ue([].concat(q()(ce),[e.id])),E([].concat(q()(T),[e.id])),we([].concat(q()(be),[e])),e.identifier?ke.current.add(e.id):Ne.current.add(e.id),_e(1),R([].concat(q()(M),[e.id]));else{var i=be.filter((function(n){return n.id!==e.id}));we(i);var r=i.map((function(e){return e.id}));E(q()(r)),e.identifier?ke.current.delete(e.id):Ne.current.delete(e.id);var l=M.filter((function(n){return n!==e.id}));if(R(l),re){var a=ce.filter((function(n){return n!==e.id}));ue(q()(a))}if("5"===v.type)return void Oe(s()(s()({},v),{},{list:q()(l)}))}},onSelectAll:function(e,n,t){if(e){var i=t.map((function(e){return e.id}));re&&ue([].concat(q()(ce),q()(i))),we([].concat(q()(be),q()(t))),E([].concat(q()(T),q()(i))),R([].concat(q()(M),q()(i)));var r,l=Ln()(t);try{for(l.s();!(r=l.n()).done;){var a=r.value;a.identifier?ke.current.add(a.id):Ne.current.add(a.id)}}catch(e){l.e(e)}finally{l.f()}}else{var o=t.map((function(e){return e.id})),c=T.filter((function(e){return!o.some((function(n){return n===e}))})),u=be.filter((function(e){return!o.some((function(n){return n===e.id}))}));if(we(u),E(q()(c)),R(q()(c)),re){var d=ce.filter((function(e){return!o.some((function(n){return n===e.id}))}));ue(q()(d))}"5"===v.type&&Oe(s()(s()({},v),{},{list:q()(c)}));var p,m=Ln()(o);try{for(m.s();!(p=m.n()).done;){var h=p.value;h.identifier?ke.current.delete(h):Ne.current.delete(h)}}catch(e){m.e(e)}finally{m.f()}}}},columns:[{title:"题型",dataIndex:"item_type",key:"item_type",render:function(e,n,t){var i;return(0,C.jsx)("span",{children:re||null!=n&&n.challenge_names?"实训题":null==ge||null===(i=ge.filter((function(n){return n.value===e})))||void 0===i||null===(i=i[0])||void 0===i?void 0:i.name})}},{title:"试题名称",dataIndex:"name",width:re?"30%":"60%",key:"name",render:function(e,n,t){var i;return(0,C.jsx)(Fe.Z,{showLines:1,showTextOnly:!0,value:re||null!=n&&n.challenge_names?(null==n?void 0:n.title)||e:"BPROGRAM"==(null==n?void 0:n.item_type)?null==n||null===(i=n.program_attr)||void 0===i?void 0:i.description:e},1)}},{title:"创建者",dataIndex:"author_name",key:"author_name",hidden:!re},{title:"所属单位",dataIndex:"author_school_name",key:"author_school_name",hidden:!re},{title:"难度",dataIndex:"difficulty",key:"difficulty",render:function(e,n,t){var i,s;return(0,C.jsx)("span",{children:re||null!=n&&n.challenge_names?(null==n?void 0:n.level)||(null==Ze||null===(i=Ze.filter((function(n){return n.value===e})))||void 0===i||null===(i=i[0])||void 0===i?void 0:i.name):null==Ze||null===(s=Ze.filter((function(n){return n.value===e})))||void 0===s||null===(s=s[0])||void 0===s?void 0:s.name})}},{title:"使用次数",dataIndex:"quotes",key:"quotes",render:function(e,n,t){return(0,C.jsx)("span",{children:re||null!=n&&n.challenge_names?(null==n?void 0:n.study_count)||(null==n?void 0:n.stu_num):e})}},{title:"操作",dataIndex:"id",key:"item_type",render:function(e,n,t){return(0,C.jsx)("div",{style:{flex:1,textAlign:"start"},children:(0,C.jsx)("a",{onClick:function(){var e;Q(s()(s()({},n),{},{question_type:re||null!=n&&n.challenge_names?5:null==ge||null===(e=ge.filter((function(e){return e.value===(null==n?void 0:n.item_type)})))||void 0===e||null===(e=e[0])||void 0===e?void 0:e.question_type})),te(!0)},children:"查看"})})}}].filter((function(e){return!e.hidden}))}),(0,C.jsx)(An.Z,{current:v.page,total:(null==D?void 0:D.items_count)||(null==D?void 0:D.shixuns_count),style:{marginBottom:20},defaultPageSize:v.per_page,showTotal:function(e){return(0,C.jsxs)("span",{children:["共 ",(0,C.jsx)("span",{style:{color:"#165DFF"},children:e})," 条数据"]})},pageSize:v.per_page,onChange:function(e,n){v.page=e,v.per_page=n,j(s()({},v)),Te(s()({},v))}}),(0,C.jsxs)("div",{className:Un,children:[(0,C.jsx)(b.ZP,{className:Gn,onClick:function(){t(!1)},children:"取消"}),(0,C.jsx)(b.ZP,{loading:c,style:{width:c&&75},className:Hn,onClick:o()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((null==M?void 0:M.length)<=0)){e.next=3;break}return x.ZP.info("当前暂未选择数据"),e.abrupt("return");case 3:return e.next=5,Ve({id:q()(ke.current),course_id:Me.coursesId,type:"shixun"});case 5:e.sent||r(q()(Ne.current),q()(ke.current),!0,null==M?void 0:M.length);case 7:case"end":return e.stop()}}),e)}))),children:"确认"})]})]}),(0,C.jsx)(k.Z,{open:ne,title:"题目详情",footer:!1,className:$n,width:1e3,centered:!0,onCancel:function(){te(!1)},onOk:function(){te(!1)},children:(0,C.jsx)(Zt,{qitem:J})}),(0,C.jsx)(Pt.Z,{visible:Be,position:"已选试题",onCancel:De,onOk:function(){var e=o()(l()().mark((function e(n){var t,i,s,a,o;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=[],i=[],s=Ln()(n);try{for(s.s();!(a=s.n()).done;)1===(o=a.value).is_copy&&1===o.is_use&&t.push(o.id),0===o.is_use&&i.push(o.id)}catch(e){s.e(e)}finally{s.f()}return e.next=6,r(q()(Ne.current),q()(ke.current).filter((function(e){return!i.includes(e)})),!0,null==M?void 0:M.length,t);case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),renderData:ze,inPaper:!1,modalType:"multiple",type:"shixun"})]})},Tt=t(53921),qt=function(e){var n=e.qitem,t=e.TagDiscipline,i=e.exerciseitem,r=e.setisedit,a=e.seveeditor,c=e.deleteitem,d=e.getTagData,p=e.init,h=f.Z.useForm(),v=u()(h,1)[0];return(0,m.useEffect)((function(){var e,t,i,r;v.setFieldsValue(s()(s()({},n),{},{standard_answers:n.standard_answer,difficulty:(null==n?void 0:n.difficult)||2,item_banks_group_id:n.item_banks_group_id,hack:s()(s()({},n),{},{time_limit:(null==n||null===(e=n.hack)||void 0===e?void 0:e.time_limit)||3}),hack_codes:{language:null==n||null===(t=n.program_attr)||void 0===t?void 0:t.language,code:Cn.Base64.decode((null==n||null===(i=n.program_attr)||void 0===i?void 0:i.code)||"")},hack_sets:s()({},null==n||null===(r=n.hack_sets)||void 0===r?void 0:r[0]),repeat_answer:!n.repeat_answer}))}),[n]),(0,C.jsxs)("div",{children:[(0,C.jsxs)(f.Z,{form:v,colon:!1,onValuesChange:function(e,n){if(null!=e&&e.standard_answers){var t,i,s,r=(null===(t=v.getFieldValue("standard_answers"))||void 0===t?void 0:t.length)>0&&(null===(i=v.getFieldValue("standard_answers"))||void 0===i||null===(i=i.map((function(e){return e.score})))||void 0===i?void 0:i.filter((function(e){return e})));if((null==r?void 0:r.length)>0)v.setFieldsValue({question_score:(null==r?void 0:r.length)>0&&(null===(s=r.reduce((function(e,n){return e+n})))||void 0===s?void 0:s.toFixed(1))})}},onFinish:function(e){var t;a(s()(s()(s()({},n),e),{},{item_type:null==n?void 0:n.question_type,standard_answers:null===(t=e.standard_answers)||void 0===t?void 0:t.map((function(e,n){return s()(s()({},e),{},{position:e.choice_id||n+1})})),hack_codes:s()(s()({},e.hack_codes),{},{code:Cn.Base64.encode(e.hack_codes.code)}),standard_answer:void 0}))},onFinishFailed:function(){var e=o()(l()().mark((function e(n){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:x.ZP.error(n.errorFields[0].errors[0]),v.scrollToField(null==n||null===(t=n.errorFields)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.name,{behavior:"smooth",block:"center"});case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:[(0,C.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,C.jsxs)("div",{style:{flex:1},children:[(0,C.jsx)("span",{style:{display:"inline-flex",border:"1px solid #9096A3",borderRadius:"50%",width:10,height:10,marginRight:5,background:"#9096A3"}}),(0,C.jsx)("span",{children:"程序填空题"})]}),(0,C.jsx)(f.Z.Item,{className:Ie,name:"question_score",label:"分值",rules:[{required:!0,message:"请输入分值"}],children:(0,C.jsx)(y.Z,{style:{width:150},placeholder:"请输入当前小题分数",size:"middle",disabled:!0,max:100,min:.1})}),(0,C.jsxs)("span",{style:{marginLeft:20,color:"red",cursor:"pointer"},onClick:function(){c()},children:[(0,C.jsx)("i",{className:"iconfont icon-piliangshanchu3",style:{fontSize:14,marginRight:6}})," 删除"]})]}),(0,C.jsx)(Tt.t,{form:v,questionTitlePlaceholder:"请编辑填空题题干内容",scoreByBlank:!0,hackidentifier:null==n?void 0:n.hack_identifier,answerKey:"standard_answers"}),(0,C.jsx)(ze,{getTagData:d,qitem:n,exerciseitem:i,TagDiscipline:t,form:v})]}),(0,C.jsxs)("div",{className:Ze,children:[(0,C.jsx)(b.ZP,{className:_e,onClick:function(){var e,t,r,l;v.setFieldsValue(s()(s()({},n),{},{standard_answers:n.standard_answer,difficulty:n.difficult,item_banks_group_id:n.item_banks_group_id,hack:s()(s()({},n),{},{sub_discipline_id:null==i||null===(e=i.exercise)||void 0===e?void 0:e.sub_discipline_id,tag_discipline_ids:[]}),hack_codes:{language:null==n||null===(t=n.program_attr)||void 0===t?void 0:t.language,code:Cn.Base64.decode(null==n||null===(r=n.program_attr)||void 0===r?void 0:r.code)},hack_sets:s()({},null==n||null===(l=n.hack_sets)||void 0===l?void 0:l[0]),repeat_answer:!n.repeat_answer}))},children:"重置"}),(0,C.jsx)(b.ZP,{className:_e,onClick:function(){var e,t,l,a;n.isadd?(r(!1),p()):(v.setFieldsValue(s()(s()({},n),{},{standard_answers:n.standard_answer,difficulty:n.difficult,item_banks_group_id:n.item_banks_group_id,hack:s()(s()({},n),{},{sub_discipline_id:null==i||null===(e=i.exercise)||void 0===e?void 0:e.sub_discipline_id,tag_discipline_ids:[]}),hack_codes:{language:null==n||null===(t=n.program_attr)||void 0===t?void 0:t.language,code:Cn.Base64.decode(null==n||null===(l=n.program_attr)||void 0===l?void 0:l.code)},hack_sets:s()({},null==n||null===(a=n.hack_sets)||void 0===a?void 0:a[0]),repeat_answer:!n.repeat_answer})),r(!1))},children:"取消"}),(0,C.jsx)(b.ZP,{className:ve,onClick:function(){v.submit()},children:"保存题目"})]})]})},Et=t(15309),Ft=t(11025),Ot=t(91810),Lt=[{name:"单选题",id:0,count:"q_singles",score:"q_singles_scores",nameType:"SINGLE"},{name:"多选题",id:1,count:"q_doubles",score:"q_doubles_scores",nameType:"MULTIPLE"},{name:"判断题",id:2,count:"q_judges",score:"q_judges_scores",nameType:"JUDGMENT"},{name:"填空题",id:3,count:"q_nulls",score:"q_nulls_scores",nameType:"COMPLETION"},{name:"简答题",id:4,count:"q_mains",score:"q_mains_scores",nameType:"SUBJECTIVE"},{name:"实训题",id:5,count:"q_shixuns",score:"q_shixuns_scores",nameType:"PRACTICAL"},{name:"编程题",id:6,count:"q_pros",score:"q_pros_scores",nameType:"PROGRAM"},{name:"组合题",id:7,count:"q_combinations",score:"q_combinations_scores",nameType:"COMBINATION"},{name:"程序填空题",id:8,count:"q_combinations",score:"q_combinations_scores",nameType:"BPROGRAM"}],Mt=(0,h.connect)((function(e){return{user:e.user,dispatch:e.dispatch}}))((function(e){var n,t,i,r,a,c,d,p,v,g,j,y,w,N,Z,I=e.user,P=e.dispatch,T=e.itemid,q=e.setisedits,E=(e.setitemid,(0,m.useState)()),F=u()(E,2),O=F[0],L=F[1],M=(0,m.useState)(!1),R=u()(M,2),re=R[0],ue=R[1],pe=(0,m.useState)(),me=u()(pe,2),he=me[0],fe=me[1],xe=(0,m.useState)(),ve=u()(xe,2),_e=ve[0],ge=ve[1],je=(0,m.useState)(!1),ye=u()(je,2),be=ye[0],we=ye[1],ke=(0,m.useState)(!1),Ne=u()(ke,2),Ze=Ne[0],Ie=Ne[1],Ce=(0,m.useState)(),qe=u()(Ce,2),Ee=qe[0],Le=qe[1],Me=(0,m.useState)(!1),Re=u()(Me,2),Ae=Re[0],Be=Re[1],De=(0,m.useState)(!1),ze=u()(De,2),We=ze[0],He=ze[1],Ke=(0,m.useState)(!1),Xe=u()(Ke,2),Qe=Xe[0],$e=Xe[1],en=(0,m.useState)(!1),nn=u()(en,2),tn=nn[0],sn=nn[1],rn=(0,m.useState)(!1),ln=u()(rn,2),an=ln[0],on=ln[1],cn=(0,m.useState)(!1),un=u()(cn,2),dn=un[0],pn=un[1],mn=(0,h.useParams)(),hn=(0,m.useState)(!1),fn=u()(hn,2),xn=fn[0],vn=fn[1],_n=f.Z.useForm(),gn=u()(_n,1)[0],jn=(0,m.useState)(!1),yn=u()(jn,2),bn=yn[0],wn=yn[1];(0,m.useEffect)((function(){T&&Nn()}),[T]),(0,m.useEffect)((function(){q(Ze)}),[Ze]);var kn=function(){var e=o()(l()().mark((function e(n){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,P({type:"newExercisePaper/getTagDiscipline",payload:{sub_discipline_id:n}});case 2:t=e.sent,P({type:"globalSetting/footerToggle",payload:!1}),Le(t);case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();function Nn(){return Zn.apply(this,arguments)}function Zn(){return(Zn=o()(l()().mark((function e(){var n,t,i,r,a;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return we(!0),ue(!0),e.next=4,P({type:"exercise/editExercise",payload:{categoryId:T}});case 4:r=e.sent,we(!1),ue(!1),L(r),on(!1),null!=r&&null!==(n=r.exercise)&&void 0!==n&&n.sub_discipline_id&&kn(null==r||null===(a=r.exercise)||void 0===a?void 0:a.sub_discipline_id),fe(s()(s()({},null==r||null===(t=r.exercise_question_types)||void 0===t||null===(t=t[0])||void 0===t||null===(t=t.items)||void 0===t?void 0:t[0]),{},{index:1})),ge(s()(s()({},null==r||null===(i=r.exercise_question_types)||void 0===i?void 0:i[0]),{},{indexs:1}));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function In(e){return Cn.apply(this,arguments)}function Cn(){return Cn=o()(l()().mark((function e(n){var t,i,r,a,o,c,u,d,p;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return we(!0),ue(!0),e.next=4,P({type:"exercise/editExercise",payload:{categoryId:T}});case 4:o=e.sent,L(o),c=[],null==o||null===(t=o.exercise_question_types)||void 0===t||t.map((function(e){var n;null==e||null===(n=e.items)||void 0===n||n.map((function(e,n){c.push(s()(s()({},e),{},{index:n+1}))}))})),u=null===(i=c.filter((function(e){return e.question_id===(null==n?void 0:n.id)})))||void 0===i?void 0:i[0],d=null==o||null===(r=o.exercise_question_types)||void 0===r?void 0:r.map((function(e,n){if((null==u?void 0:u.question_type)===(null==e?void 0:e.question_type))return s()(s()({},e),{},{indexs:n+1})})),p=null===(a=d.filter((function(e){return e})))||void 0===a?void 0:a[0],ge(s()({},p)),fe(s()({},u)),we(!1),ue(!1),on(!1);case 16:case"end":return e.stop()}}),e)}))),Cn.apply(this,arguments)}function Pn(e){return qn.apply(this,arguments)}function qn(){return qn=o()(l()().mark((function e(n){var t,i,r,a;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=s()(s()({},n),{},{repeat_answer:!n.repeat_answer,difficulty:(null==n?void 0:n.difficulty)||2,item_type:n.question_type,sub_discipline_id:null==O||null===(t=O.exercise)||void 0===t?void 0:t.sub_discipline_id,tag_discipline_ids:[],hack:s()(s()({},null==n?void 0:n.hack),{},{difficult:(null==n?void 0:n.difficulty)||2}),hack_identifier:sessionStorage.projectFill}),n.tag_discipline_ids&&(i.tag_discipline_ids=Array.isArray(n.tag_discipline_ids)?n.tag_discipline_ids:[n.tag_discipline_ids]),r=an?"/api/exercises/".concat(T,"/exercise_questions"):"/api/exercise_questions/".concat(null==n?void 0:n.question_id,".json"),1!==(null==n?void 0:n.is_my)){e.next=7;break}k.Z.confirm({title:"提示",content:"此题目已存在于试题库,是否将修改后的题目覆盖试题库的原题?",okText:"覆盖原题",cancelText:"不覆盖",keyboard:!1,onOk:function(){var e=o()(l()().mark((function e(){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.is_cover=1,e.next=3,(0,S.ZP)(r,{method:an?"post":"PUT",body:s()({},i)});case 3:0===(null==(t=e.sent)?void 0:t.status)&&(Ie(!1),In({id:(null==t?void 0:t.exercise_question_id)||(null==n?void 0:n.question_id)}));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),onCancel:function(){var e=o()(l()().mark((function e(){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.ZP)(r,{method:an?"post":"PUT",body:s()({},i)});case 2:0===(null==(t=e.sent)?void 0:t.status)&&(Ie(!1),In({id:(null==t?void 0:t.exercise_question_id)||(null==n?void 0:n.question_id)}));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}),e.next=11;break;case 7:return e.next=9,(0,S.ZP)(r,{method:an?"post":"PUT",body:s()({},i)});case 9:0===(null==(a=e.sent)?void 0:a.status)&&(Ie(!1),In({id:(null==a?void 0:a.exercise_question_id)||(null==n?void 0:n.question_id)}));case 11:(0,Se.k3)();case 12:case"end":return e.stop()}}),e)}))),qn.apply(this,arguments)}function On(e){return Ln.apply(this,arguments)}function Ln(){return Ln=o()(l()().mark((function e(n){var t,i,s,r;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ue(!0),e.next=3,(0,S.ZP)("/api/exercises/".concat(T,"/sort_question_type.json"),{method:"post",body:{question_type:n}});case 3:if(t=e.sent,ue(!1),0!==(null==t?void 0:t.status)){e.next=12;break}return e.next=8,P({type:"exercise/editExercise",payload:{categoryId:T}});case 8:s=e.sent,L(s),on(!1),null!=s&&null!==(i=s.exercise)&&void 0!==i&&i.sub_discipline_id&&kn(null==s||null===(r=s.exercise)||void 0===r?void 0:r.sub_discipline_id);case 12:case"end":return e.stop()}}),e)}))),Ln.apply(this,arguments)}var Mn=function(){var e=o()(l()().mark((function e(n,t){var i,s;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==n.length){e.next=4;break}return x.ZP.warning("请上传文件"),t(),e.abrupt("return");case 4:s={id:null==mn?void 0:mn.exerciseId,file:null===(i=n[0])||void 0===i?void 0:i.file},Rn(s,"".concat(Et.Z.API_SERVER,"/api/courses/").concat(null==mn?void 0:mn.coursesId,"/exercises/import_exercise.json"),(function(e){if(0===(null==e?void 0:e.status)){var n,i={};null==e||null===(n=e.fail)||void 0===n||n.forEach((function(e){var n,t=null===(n=Object.keys(i))||void 0===n?void 0:n.includes(e.message);i[e.message]=t?i[e.message]+1:1}));var s="成功导入".concat(null==e?void 0:e.success,"条");Object.keys(i).forEach((function(e){s+=",".concat(e).concat(i[e],"条")})),x.ZP.success(s),Be(!1),Nn()}-1===(null==e?void 0:e.status)&&(x.ZP.error(null==e?void 0:e.message),t())}));case 6:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),Rn=function(e,n,t,i,s){var r=new FormData;Object.keys(e).forEach((function(n){r.append(n,e[n])}));var l=new window.XMLHttpRequest;return l.withCredentials=!0,l.addEventListener("load",(function(e){var n;t(JSON.parse(null==e||null===(n=e.target)||void 0===n?void 0:n.response))}),!1),l.addEventListener("error",(function(e){s&&s(e)}),!1),l.upload.onprogress=function(e){i&&i(e)},l.open("POST",n),l.send(r),l};function An(){return Bn.apply(this,arguments)}function Bn(){return Bn=o()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:k.Z.confirm({title:"提示",content:"确定要删除这个试题吗?",okText:"确定",centered:!0,className:de,onOk:function(){var e=o()(l()().mark((function e(){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!he.question_id){e.next=7;break}return e.next=3,(0,S.ZP)("/api/exercise_questions/".concat(he.question_id,".json"),{method:"delete"});case 3:0===(null==(n=e.sent)?void 0:n.status)&&(Nn(),Ie(!1)),e.next=10;break;case 7:fe({}),Ie(!1),Nn();case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),cancelText:"取消"});case 1:case"end":return e.stop()}}),e)}))),Bn.apply(this,arguments)}var Dn=function(){var e=o()(l()().mark((function e(n){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.ZP)("/api/exercises/".concat(T,"/select_questions.json"),{method:"post",body:s()({},n)});case 2:return t=e.sent,e.abrupt("return",t);case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),zn=(0,Ft.I)(),Vn=zn.overflow,Wn=zn.handleMouseEnter,Un=zn.handleMouseLeave;return(0,C.jsxs)("div",{children:[(0,C.jsx)(B.Z,{spinning:be,children:(0,C.jsxs)("div",{className:U,children:[0===(null==O||null===(n=O.exercise_types)||void 0===n?void 0:n.q_counts)&&!Ze&&(0,C.jsx)(Te.Z,{customText:"还没有试题,从底部操作栏来添加吧~"}),((null==O||null===(t=O.exercise_types)||void 0===t?void 0:t.q_counts)>0||Ze)&&(0,C.jsx)("div",{style:{textAlign:"center"},children:(0,C.jsxs)("div",{style:{marginTop:20,borderTop:"1px solid #DCDCDC",display:"flex",alignItems:"stretch"},children:[(0,C.jsx)("div",{style:{backgroundColor:"#F6F7F9"},children:(0,C.jsx)(D.Z,{offsetTop:10,children:(0,C.jsx)(z.Z,{className:J,active:!0,loading:re,children:(0,C.jsxs)("div",{className:J,children:[1===(null==O||null===(i=O.exercise)||void 0===i?void 0:i.exercise_status)&&(0,C.jsx)(b.ZP,{onClick:function(){Ze?x.ZP.info("请先保存或取消当前正在编辑试题。"):He(!0)},className:$,children:"批量设置分值"}),(0,C.jsx)("div",{className:Q,style:{overflow:Vn},onMouseEnter:Wn,onMouseLeave:Un,children:null==O||null===(r=O.exercise_question_types)||void 0===r?void 0:r.map((function(e,n){return(0,C.jsxs)("div",{className:"mb30",children:[(0,C.jsxs)("div",{className:H,children:[(0,C.jsxs)("div",{className:ee,children:[(0,C.jsxs)("span",{style:{color:"#000000",fontWeight:400,fontSize:12},children:[" ",(0,Se.EM)(n+1),"、【",e.name,"】"]}),(0,C.jsxs)("span",{style:{color:"#464F66",fontSize:12},children:["(",e.count,"小题,共",e.score,"分)"]})]}),(0,C.jsx)(V.Z,{dropdownRender:function(){return function(e,n){return(0,C.jsxs)(A.Z,{children:[(0,C.jsx)(A.Z.Item,{disabled:0===n,onClick:o()(l()().mark((function e(){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==n){e.next=2;break}return e.abrupt("return");case 2:if(!Ze){e.next=5;break}return x.ZP.info("请先保存或取消当前正在编辑的试题。"),e.abrupt("return");case 5:return t=(0,Se.rz)(null==O?void 0:O.exercise_question_types,n,n-1),e.next=8,On(t.map((function(e){return e.name})));case 8:case"end":return e.stop()}}),e)}))),children:(0,C.jsx)("span",{className:W,children:"上移"})},"1"),(0,C.jsx)(A.Z.Item,{disabled:n===(null==O?void 0:O.exercise_question_types.length)-1,onClick:o()(l()().mark((function e(){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n!==(null==O?void 0:O.exercise_question_types.length)-1){e.next=2;break}return e.abrupt("return");case 2:if(!Ze){e.next=5;break}return x.ZP.info("请先保存或取消当前正在编辑的试题。"),e.abrupt("return");case 5:return t=(0,Se.rz)(null==O?void 0:O.exercise_question_types,n,n+1),e.next=8,On(t.map((function(e){return e.name})));case 8:case"end":return e.stop()}}),e)}))),children:(0,C.jsx)("span",{className:W,children:"下移"})},"2"),(0,C.jsx)(A.Z.Item,{onClick:function(){var n;gn.setFieldsValue({name:e.name,item_type_en:null===(n=Lt.find((function(n){return n.id==e.question_type})))||void 0===n?void 0:n.nameType}),wn(!0)},children:(0,C.jsx)("span",{className:W,children:"重命名"})},"3")]})}(e,n)},placement:"bottomLeft",children:(0,C.jsx)("div",{className:ne,children:(0,C.jsx)("i",{className:"iconfont icon-sandian font12"})})})]}),(0,C.jsx)(Oe,{isedit:Ze,setBigqitem:ge,bigitem:s()(s()({},e),{},{indexs:n+1}),setqitem:fe,qitem:he,Itemid:T,getdata:In,data:e.items})]},n)}))})]})})})}),(0,C.jsx)(z.Z,{className:le,active:!0,loading:be,children:(0,C.jsxs)("div",{className:le,children:[(null==_e?void 0:_e.question_type)===(null==he?void 0:he.question_type)&&(0,C.jsxs)("div",{className:H,children:[(0,C.jsxs)("div",{style:{flex:1},children:[(0,C.jsxs)("span",{style:{color:"#000000",fontWeight:600,fontSize:16},children:[" ",(null==_e?void 0:_e.indexs)&&(0,Se.EM)(null==_e?void 0:_e.indexs),"、【",null==_e?void 0:_e.name,"】"]}),(0,C.jsxs)("span",{style:{color:"#464F66",fontSize:16,fontWeight:400},children:["(",null==_e?void 0:_e.count,"小题,共",null==_e?void 0:_e.score,"分)"]})]}),(0,C.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[5===(null==he?void 0:he.question_type)&&!Ze&&(0,C.jsxs)("a",{className:ce,href:"/shixuns/".concat(null==he?void 0:he.shixun_identifier,"/challenges?exercise=true"),target:"_blank",children:[(0,C.jsx)("i",{onClick:function(){},style:{marginRight:20},className:"iconfont icon-shixunkecheng mr5 "}),"实训详情"]}),!Ze&&1==(null==O||null===(a=O.exercise)||void 0===a?void 0:a.exercise_status)&&(0,C.jsx)("i",{onClick:function(){An()},style:{marginRight:20},className:"".concat(oe," iconfont icon-shanchu13 mr5 ")}),!Ze&&(1==(null==O||null===(c=O.exercise)||void 0===c?void 0:c.exercise_status)||2==(null==O||null===(d=O.exercise)||void 0===d?void 0:d.exercise_status)&&15!=(null===(p=I.userInfo)||void 0===p||null===(p=p.course)||void 0===p?void 0:p.course_role)||3==(null==O||null===(v=O.exercise)||void 0===v?void 0:v.exercise_status)&&15!=(null===(g=I.userInfo)||void 0===g||null===(g=g.course)||void 0===g?void 0:g.course_role)||4==(null==O||null===(j=O.exercise)||void 0===j?void 0:j.exercise_status)&&15!=(null===(y=I.userInfo)||void 0===y||null===(y=y.course)||void 0===y?void 0:y.course_role))&&(0,C.jsx)("i",{onClick:function(){6===(null==he?void 0:he.question_type)?h.history.push("/problems/newedit/".concat(null==he?void 0:he.hack_identifier,"?type=exercises&express_id=").concat(mn.exerciseId,"&question_id=").concat(null==he?void 0:he.question_id,"&score=").concat(null==he?void 0:he.question_score,"&exercise=true&callback_url=/classrooms/").concat(mn.coursesId,"/exercise/add/").concat(T,"?type=2")):Ie(!0)},className:"".concat(ae," iconfont icon-bianji_Hover mr5 ")})]})]}),!Ze&&(0,C.jsxs)("div",{children:[(0,C.jsxs)("div",{className:te,children:[(0,C.jsxs)("span",{className:ie,children:[null==he?void 0:he.question_score,"分"]}),(0,C.jsx)(Fe.Z,{className:se,value:(null==he?void 0:he.index)+"、"+"".concat(8==(null==he?void 0:he.question_type)?null==he||null===(w=he.program_attr)||void 0===w?void 0:w.description:null==he?void 0:he.question_title)})]}),(0,C.jsx)(Sn,{TagDiscipline:Ee,qitem:he})]}),Ze&&(0,C.jsxs)("div",{children:[(null==he?void 0:he.question_type)<=1&&(0,C.jsx)(Ve,{deleteitem:An,getTagData:kn,seveeditor:Pn,exerciseitem:O,TagDiscipline:Ee,setisedit:Ie,qitem:he,init:Nn}),5===(null==he?void 0:he.question_type)&&(0,C.jsx)(Je,{setqitem:fe,deleteitem:An,seveeditor:Pn,exerciseitem:O,TagDiscipline:Ee,setisedit:Ie,qitem:he}),3===(null==he?void 0:he.question_type)&&(0,C.jsx)(Ue,{deleteitem:An,getTagData:kn,seveeditor:Pn,exerciseitem:O,TagDiscipline:Ee,setisedit:Ie,qitem:he,init:Nn}),2===(null==he?void 0:he.question_type)&&(0,C.jsx)(Ge,{deleteitem:An,getTagData:kn,seveeditor:Pn,exerciseitem:O,TagDiscipline:Ee,setisedit:Ie,qitem:he,init:Nn}),4===(null==he?void 0:he.question_type)&&(0,C.jsx)(En,{deleteitem:An,getTagData:kn,seveeditor:Pn,exerciseitem:O,TagDiscipline:Ee,setisedit:Ie,qitem:he,init:Nn}),7===(null==he?void 0:he.question_type)&&(0,C.jsx)(Ye,{deleteitem:An,getTagData:kn,seveeditor:Pn,exerciseitem:O,TagDiscipline:Ee,setisedit:Ie,qitem:he,init:Nn}),8===(null==he?void 0:he.question_type)&&(0,C.jsx)(qt,{deleteitem:An,getTagData:kn,seveeditor:Pn,exerciseitem:O,TagDiscipline:Ee,setisedit:Ie,qitem:he,init:Nn})]})]})})]})})]})}),(0,C.jsx)("div",{className:G,children:(0,C.jsxs)("div",{className:Pe,children:[1==(null==O||null===(N=O.exercise)||void 0===N?void 0:N.exercise_status)&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("span",{className:K,onClick:function(){Ze?x.ZP.info("请先保存或取消当前正在编辑的试题。"):($e(!0),sn(!1))},children:"题库选题"}),(0,C.jsx)("span",{className:K,onClick:function(){Ze?x.ZP.info("请先保存或取消当前正在编辑的试题。"):Be(!0)},children:"导入试题"}),(0,C.jsx)("span",{className:K,onClick:o()(l()().mark((function e(){var n,t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.ZP)("/api/exercises/".concat(null==mn?void 0:mn.exerciseId,"/simulate_start_answer.json"),{method:"get",params:{coursesId:null==mn?void 0:mn.coursesId,categoryId:null==mn?void 0:mn.exerciseId,is_reset:1}});case 2:-1!=(null==(n=e.sent)?void 0:n.status)&&window.open("/classrooms/".concat(null==mn?void 0:mn.coursesId,"/exercise/").concat(null==mn?void 0:mn.exerciseId,"/").concat(null===(t=I.userInfo)||void 0===t?void 0:t.login,"/initate_answer"));case 4:case"end":return e.stop()}}),e)}))),children:"模拟考试"}),(0,C.jsx)("span",{className:K,onClick:function(){window.open("/classrooms/".concat(null==mn?void 0:mn.coursesId,"/exercise/").concat(null==mn?void 0:mn.exerciseId,"/detail?random=false&tabs=2"))},children:"试卷预览"}),null==Lt?void 0:Lt.map((function(e){return(0,C.jsx)(b.ZP,{className:Y,type:"primary",onClick:function(){if(Ze)x.ZP.info("请先保存或取消当前正在编辑的试题。");else{if(on(!0),5===e.id)return $e(!0),void sn(!0);var n,t,i;if(6!==e.id)Ie(!0),2===e.id?fe({question_type:e.id,isadd:!0,repeat_answer:!0,choices:[{choice_text:"正确",is_answer:0},{choice_text:"错误",is_answer:0}],question_choices:[{choice_text:"正确",is_answer:0},{choice_text:"错误",is_answer:0}],difficulty:2,standard_answers:[],question_score:"",question_title:"",tag_discipline_ids:"",analysis:""}):fe({question_type:e.id,question_choices:Array.from({length:4},(function(){return{choice_text:"",is_answer:0}})),standard_answers:[],repeat_answer:!0,difficulty:2,isadd:!0,tag_discipline_ids:"",question_score:"",analysis:"",sub_item_banks:[],is_ordered:!0,question_title:"",use_keywords:!1,keywords:[],use_blank_score:!0,allow_student_debug:!1});else h.history.push("/problems/newcreate?difficult=".concat(null==O||null===(n=O.exercise)||void 0===n?void 0:n.difficulty,"&sub_discipline_id=").concat(null==O||null===(t=O.exercise)||void 0===t?void 0:t.sub_discipline_id,"&express_id=").concat(null==O||null===(i=O.exercise)||void 0===i?void 0:i.id,"&callback_url=/classrooms/").concat(mn.coursesId,"/exercise/add/").concat(T,"?type=2"))}},children:e.name},e.id)}))]}),1!=(null==O||null===(Z=O.exercise)||void 0===Z?void 0:Z.exercise_status)&&(0,C.jsx)(C.Fragment,{children:(0,C.jsx)("span",{style:{width:"1022px"}})}),(0,C.jsxs)("span",{className:X,onClick:function(){var e;Ze?x.ZP.info("请先保存或取消当前正在编辑试题。"):1==(null==O||null===(e=O.exercise)||void 0===e?void 0:e.exercise_status)?pn(!0):h.history.back()},children:[(0,C.jsx)("i",{className:"iconfont icon-baocun1",style:{fontSize:15,marginRight:5}}),"保存试卷"]})]})}),(0,C.jsx)(Fn,{setScoreShow:He,ScoreShow:We,exerciseitem:O,getdata:Nn}),Qe&&(0,C.jsx)(St,{setScoreShow:$e,isshixuns:tn,isloadings:xn,ScoreShow:Qe,onOk:function(){var e=o()(l()().mark((function e(n,t,i,r,a){var c,u;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return vn(!0),c={exam_id:T,item_bank_ids:n,shixun_ids:t,shixun_copy_ids:a},e.next=4,Dn(s()(s()({},c),{},{check_only:i}));case 4:if(u=e.sent,vn(!1),0!==(null==u?void 0:u.status)){e.next=14;break}return e.next=9,Dn(c);case 9:Nn(),$e(!1),x.ZP.info("添加成功"),e.next=15;break;case 14:-2===u.status&&k.Z.confirm({title:"提示",content:"当前已选择".concat(r,"道试题,已加入过的试题或未发布的编程题将不会重复加入"),onOk:function(){var e=o()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Dn(c);case 2:$e(!1),Nn(),x.ZP.info("添加成功");case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()});case 15:case"end":return e.stop()}}),e)})));return function(n,t,i,s,r){return e.apply(this,arguments)}}()}),(0,C.jsx)(Tn.Z,{visible:Ae,onCancel:function(){return Be(!1)},onOk:Mn}),(0,C.jsx)(k.Z,{title:"提示",open:dn,confirmLoading:!1,centered:!0,okText:"设置规则",cancelText:"修改试卷",footer:(0,C.jsxs)("div",{children:[(0,C.jsx)(b.ZP,{onClick:function(){pn(!1),h.history.back()},children:"稍后再说"}),(0,C.jsx)(b.ZP,{type:"primary",onClick:function(){h.history.push("/classrooms/".concat(null==mn?void 0:mn.coursesId,"/exercise/").concat(T,"/detail?random=",!1,"&tabs=3")),pn(!1)},children:"设置规则"})]}),onCancel:function(){pn(!1)},children:(0,C.jsx)("p",{children:"试卷创建完成!目前处于未发布状态,是否设置考试规则?"})}),(0,C.jsx)(k.Z,{centered:!0,title:"编辑题型名称",open:bn,width:500,onOk:function(){return gn.submit()},onCancel:function(){return wn(!1)},children:(0,C.jsxs)(f.Z,{form:gn,initialValues:{},onFinish:function(){var e=o()(l()().mark((function e(n){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Ot.RK)(s()({id:T},n));case 2:0==e.sent.status&&(x.ZP.success("修改成功"),Nn(),wn(!1));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:[(0,C.jsx)(f.Z.Item,{name:"name",style:{marginBottom:0},rules:[{required:!0,message:"请输入题型名称"},{whitespace:!0,message:"请勿输入空格"}],children:(0,C.jsx)(_.Z,{size:"large",maxLength:6,showCount:!0})}),(0,C.jsx)(f.Z.Item,{hidden:!0,name:"item_type_en",children:(0,C.jsx)(_.Z,{size:"large"})})]})})]})})),Rt=t(49088),At=t(91676),Bt=["classroomList","globalSetting","problemset","loading","exercise","user","dispatch"],Dt=(0,h.connect)((function(e){var n=e.classroomList,t=e.loading,i=e.user,s=e.problemset;return{classroomList:n,globalSetting:e.globalSetting,problemset:s,user:i,exercise:e.exercise,loading:t.effects}}))((function(e){e.classroomList,e.globalSetting;var n,t,i,r,a,c,d,k,N=e.problemset,Z=(e.loading,e.exercise),I=e.user,T=e.dispatch,q=(p()(e,Bt),(0,h.useParams)()),E=(0,m.useState)(!1),F=u()(E,2),O=(F[0],F[1]),L=I.userInfo,M=f.Z.useForm(),A=u()(M,1)[0],B=(0,m.useState)({}),D=u()(B,2),z=D[0],V=D[1],W=(0,m.useState)(1),U=u()(W,2),H=U[0],G=U[1],K=(0,m.useState)(""),Y=u()(K,2),X=Y[0],J=Y[1],Q=(0,h.useSearchParams)(),$=u()(Q,1)[0],ee=(0,m.useState)(!1),ne=u()(ee,2),te=ne[0],ie=ne[1],se=(0,m.useState)(!1),re=u()(se,2),le=re[0],ae=re[1],oe=(0,m.useState)(!1),ce=u()(oe,2),ue=ce[0],de=ce[1];function pe(){return(pe=o()(l()().mark((function e(n,t){var i,r,a,o,c,d,p,m,f;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,A.validateFields();case 2:return i=A.getFieldsValue(),r=i.courseid,a=u()(r,2),a[0],o=a[1],i.sub_discipline_id=o,i.is_md=!0,i.time=parseInt(i.time)>9999?9999:i.time,e.next=10,T({type:"exercise/addExercise",payload:s()(s()({},i),q)});case 10:if(0!==(c=e.sent).status){e.next=21;break}return e.next=14,(0,S.ZP)("/api/courses/".concat(null==q?void 0:q.coursesId,"/exercises/notice_at.json"),{method:"POST",body:{course_id:null==q?void 0:q.coursesId,id:null==c||null===(d=c.data)||void 0===d?void 0:d.exercise_id,time:n}});case 14:me(null===(p=c.data)||void 0===p?void 0:p.exercise_id),J(null==c||null===(m=c.data)||void 0===m?void 0:m.exercise_id),G(2),ie(!1),h.history.replace("/classrooms/".concat(q.coursesId,"/exercise/add/").concat(null===(f=c.data)||void 0===f?void 0:f.exercise_id,"?type=2")),e.next=22;break;case 21:x.ZP.error(c.message);case 22:t();case 23:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function me(e){return he.apply(this,arguments)}function he(){return(he=o()(l()().mark((function e(n){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=z&&z.ec_point_ids){e.next=2;break}return e.abrupt("return");case 2:return delete(t=s()({},z)).id,e.next=6,(0,S.ZP)("/api/ec_courses/".concat(null==z?void 0:z.ec_course_id,"/ec_points/set_work_points.json"),{method:"post",body:s()({exercise_id:n},t)});case 6:e.sent;case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return(0,m.useEffect)((function(){T({type:"problemset/getEditDisciplines",payload:{source:"new_question",identifier:null==q?void 0:q.coursesId}}),T({type:"globalSetting/footerToggle",payload:!1}),A.setFieldsValue({difficulty:2})}),[]),(0,m.useEffect)((function(){q.exerciseId&&o()(l()().mark((function e(){var n,t,i,s;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,T({type:"exercise/editExercise",payload:{categoryId:q.exerciseId}});case 2:-1!==(null==(n=e.sent)?void 0:n.status)&&(2===(null==n||null===(t=n.exercise)||void 0===t?void 0:t.exercise_status)||3===(null==n||null===(i=n.exercise)||void 0===i?void 0:i.exercise_status)||4===(null==n||null===(s=n.exercise)||void 0===s?void 0:s.exercise_status)?de(!0):de(!1));case 4:case"end":return e.stop()}}),e)})))()}),[q]),(0,m.useEffect)((function(){if(q.exerciseId){var e,n,t=Z.editData;A.setFieldsValue(s()(s()({},t.exercise),{},{courseid:[null==t||null===(e=t.exercise)||void 0===e?void 0:e.discipline_id,null===(n=t.exercise)||void 0===n?void 0:n.sub_discipline_id]}))}}),[Z]),(0,m.useEffect)((function(){"2"===$.get("type")&&(J(q.exerciseId),G(2))}),[$.get("type")]),(0,m.useEffect)((function(){var e,n,t;null!=N&&null!==(e=N.disciplinesData)&&void 0!==e&&null!==(e=e.checked)&&void 0!==e&&e.sub_discipline_id&&A.setFieldsValue({courseid:[null==N||null===(n=N.disciplinesData)||void 0===n||null===(n=n.checked)||void 0===n?void 0:n.discipline_id,null==N||null===(t=N.disciplinesData)||void 0===t||null===(t=t.checked)||void 0===t?void 0:t.sub_discipline_id]})}),[null==N||null===(n=N.disciplinesData)||void 0===n?void 0:n.checked]),(0,C.jsx)("div",{style:{background:"#ffffff",marginTop:-8,padding:8,minHeight:"100vh",paddingBottom:64},children:(0,C.jsxs)("section",{className:"edu-container",children:[(0,C.jsx)("section",{className:"animated fadeIn",children:(0,C.jsx)("aside",{className:"mt10",children:L&&(0,C.jsxs)(v.Z,{separator:">",children:[(0,C.jsx)(v.Z.Item,{children:(0,C.jsx)(h.Link,{to:"/classrooms/".concat(q.coursesId,"/exercise"),children:null==L||null===(t=L.course)||void 0===t?void 0:t.course_name})}),(0,C.jsx)(v.Z.Item,{children:(0,C.jsx)(h.Link,{to:"/classrooms/".concat(q.coursesId,"/exercise"),children:"试卷列表"})}),(0,C.jsx)(v.Z.Item,{children:q.exerciseId?"编辑试卷":"新建试卷"})]})})}),(0,C.jsxs)("div",{className:"bg-white",children:[(0,C.jsxs)("div",{style:{display:"flex",justifyContent:"center",paddingTop:20,alignItems:"center"},children:[(0,C.jsxs)("div",{onClick:function(){le?x.ZP.info("请先保存或取消当前正在编辑试题。"):G(1)},className:1===H?w.selectdiv:w.divitem,children:[(0,C.jsx)(Rt.Z,{number:1,active:1===H,className:"mr10"}),(0,C.jsx)("span",{children:"试卷基础信息"})]}),(0,C.jsx)("div",{style:{width:188,border:"1px dotted #9096A3",margin:"0px 30px",height:1}}),(0,C.jsxs)("div",{onClick:function(){q.exerciseId||X?(G(2),X||J(q.exerciseId)):x.ZP.info("请先保存基础信息再新建试题")},className:1!==H?w.selectdiv:w.divitem,children:[(0,C.jsx)(Rt.Z,{number:2,active:1!==H,className:"mr10"}),(0,C.jsx)("span",{children:"编辑试题"})]})]}),2===H&&(0,C.jsxs)("div",{className:"tc",children:[(0,C.jsx)(At.Z,{defaultValue:null==Z||null===(i=Z.editData)||void 0===i||null===(i=i.exercise)||void 0===i?void 0:i.exercise_name,onFinish:function(){var e=o()(l()().mark((function e(n){var t,i,s,r,a,o;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.trim()!==(null==Z||null===(t=Z.editData)||void 0===t||null===(t=t.exercise)||void 0===t?void 0:t.exercise_name)){e.next=2;break}return e.abrupt("return",!0);case 2:return e.next=4,(0,Ot.wy)({exercise_name:n,exercise_description:null==Z||null===(i=Z.editData)||void 0===i||null===(i=i.exercise)||void 0===i?void 0:i.exercise_description,sub_discipline_id:null==Z||null===(s=Z.editData)||void 0===s||null===(s=s.exercise)||void 0===s?void 0:s.sub_discipline_id,time:null==Z||null===(r=Z.editData)||void 0===r||null===(r=r.exercise)||void 0===r?void 0:r.time,exerciseId:null===(a=Z.editData)||void 0===a||null===(a=a.exercise)||void 0===a?void 0:a.id,difficulty:null===(o=Z.editData)||void 0===o||null===(o=o.exercise)||void 0===o?void 0:o.difficulty});case 4:if(0!==e.sent.status){e.next=8;break}return A.setFieldValue("exercise_name",n),e.abrupt("return",!0);case 8:return e.abrupt("return",!1);case 9:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()}),(0,C.jsxs)("div",{style:{fontSize:14},children:[(0,C.jsxs)("span",{style:{color:"#5F6368"},children:["答题时长",(0,C.jsx)("span",{style:{color:"#000000",marginLeft:8},children:(null==Z||null===(r=Z.editData)||void 0===r||null===(r=r.exercise)||void 0===r?void 0:r.time)||"不限"})]}),(0,C.jsxs)("span",{style:{margin:"0px 30px",color:"#5F6368"},children:["难度",(0,C.jsx)("span",{style:{color:"#000000",marginLeft:8},children:1===(null==Z||null===(a=Z.editData)||void 0===a||null===(a=a.exercise)||void 0===a?void 0:a.difficulty)?"简单":2===(null==Z||null===(c=Z.editData)||void 0===c||null===(c=c.exercise)||void 0===c?void 0:c.difficulty)?"适中":"困难"})]}),(0,C.jsxs)("span",{style:{marginRight:30,color:"#5F6368"},children:["试题总数",(0,C.jsx)("span",{style:{color:"#000000",marginLeft:8},children:(null==Z||null===(d=Z.editData)||void 0===d||null===(d=d.exercise_types)||void 0===d?void 0:d.q_counts)||0})]}),(0,C.jsxs)("span",{style:{color:"#5F6368"},children:["总分",(0,C.jsx)("span",{style:{color:"#000000",marginLeft:8},children:null==Z||null===(k=Z.editData)||void 0===k||null===(k=k.exercise_types)||void 0===k?void 0:k.q_scores})]})]})]})]}),1===H&&(0,C.jsxs)("div",{children:[(0,C.jsxs)("section",{className:[w.bg,"mt20"].join(" "),style:{padding:"30px 120px 300px 120px"},children:[(0,C.jsxs)(f.Z,{form:A,colon:!1,layout:"horizontal",labelCol:{span:4},wrapperCol:{span:20},initialValues:{time:60},onFinish:function(){var e=o()(l()().mark((function e(n){var t,i,r,a,o,c,d,p,m;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(O(!0),ie(!0),!q.exerciseId){e.next=13;break}return n.exerciseId=null===(t=Z.editData)||void 0===t||null===(t=t.exercise)||void 0===t?void 0:t.id,n.sub_discipline_id=n.courseid[n.courseid.length-1],e.next=7,(0,Ot.wy)(s()({},n));case 7:return G(2),me(null==q?void 0:q.exerciseId),J(q.exerciseId),O(!1),ie(!1),e.abrupt("return");case 13:return e.next=15,(0,S.ZP)("/api/courses/".concat(null==q?void 0:q.coursesId,"/exercises/overload_alert.json"),{method:"get",params:{course_id:null==q?void 0:q.coursesId}});case 15:if(null==(i=e.sent)||!i.alert){e.next=20;break}T({type:"classroomList/setActionTabs",payload:{key:"预约弹窗"}}),e.next=30;break;case 20:return r=n.courseid,a=u()(r,2),a[0],o=a[1],n.sub_discipline_id=o,n.is_md=!0,n.time=parseInt(n.time)>9999?9999:n.time,e.next=27,T({type:"exercise/addExercise",payload:s()(s()({},n),q)});case 27:0===(c=e.sent).status&&(me(null===(d=c.data)||void 0===d?void 0:d.exercise_id),h.history.replace("/classrooms/".concat(q.coursesId,"/exercise/add/").concat(null===(p=c.data)||void 0===p?void 0:p.exercise_id,"?type=2")),J(null==c||null===(m=c.data)||void 0===m?void 0:m.exercise_id),G(2)),ie(!1);case 30:O(!1);case 31:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),className:w.formWrap,children:[(0,C.jsx)(f.Z.Item,{name:"exercise_name",label:"试卷名称",className:w.baseLineHeight,rules:[{required:!0,validator:function(e,n){var t;return(null==n||null===(t=n.replaceAll(" ",""))||void 0===t?void 0:t.length)>0?Promise.resolve():Promise.reject("请填写试卷标题")}}],children:(0,C.jsx)(_.Z,{maxLength:60,className:w.baseFormItem,placeholder:"请输入试卷名称",showCount:!0})}),(0,C.jsx)(f.Z.Item,{label:"方向&课程",name:"courseid",rules:[{required:!0,message:"请选择课程"}],className:w.baseLineHeight,children:(0,C.jsx)(g.Z,{disabled:ue,placeholder:"请选择方向&课程",options:N.courseOptions,className:w.baseFormItem,allowClear:!1,size:"large",popupClassName:w.cascaderPopup,dropdownMenuColumnStyle:{padding:"8px 12px",fontSize:14}})}),(0,C.jsx)(f.Z.Item,{label:"难度",name:"difficulty",className:w.radioBtnWrapper,rules:[{required:!0,message:"请选择难度"}],children:(0,C.jsxs)(j.ZP.Group,{className:w.radiogroup,disabled:ue,children:[(0,C.jsx)(j.ZP.Button,{className:w.easy,value:1,children:"简单"}),(0,C.jsx)(j.ZP.Button,{className:w.medium,value:2,children:"适中"}),(0,C.jsx)(j.ZP.Button,{className:w.hard,value:3,children:"困难"})]})}),(0,C.jsx)(f.Z.Item,{label:"答题时长",className:w.baseLineHeight,children:(0,C.jsxs)("div",{style:{display:"flex",width:"100%"},children:[(0,C.jsx)(f.Z.Item,{name:"time",noStyle:!0,children:(0,C.jsx)(y.Z,{disabled:ue,min:1,max:9999,className:w.baseFormItem,style:{width:220},maxLength:60,placeholder:"请填写答题时长"})}),(0,C.jsx)("span",{style:{marginLeft:"10px",width:"40px",lineHeight:"46px",fontSize:14},children:"分钟"})]})}),(0,C.jsx)(f.Z.Item,{label:"试卷须知",name:"exercise_description",children:(0,C.jsx)(_.Z.TextArea,{disabled:ue,rows:6,maxLength:65535,placeholder:"请在此输入本次试卷答题的相关说明,最大限制65535个字符"})})]}),(0,C.jsx)(R,{exercise_id:null==q?void 0:q.exerciseId,setitem:function(e){V(s()({},e))}})]}),(0,C.jsxs)("div",{className:w.bottmodiv,children:[(0,C.jsx)(b.ZP,{className:"".concat(w.cancelBtn),type:"primary",onClick:function(){h.history.back()},children:"取消"}),(0,C.jsx)(b.ZP,{loading:te,onClick:function(){A.validateFields(),A.submit()},type:"primary",className:"".concat(w.confirmBtn," ml20"),children:"下一步"})]}),(0,C.jsx)(P,{setsubloading:ie,onModalOk:function(e,n){return pe.apply(this,arguments)}})]}),2===H&&(0,C.jsx)("div",{children:(0,C.jsx)(Mt,{setisedits:ae,setitemid:J,itemid:X})})]})})}))},18187:function(e,n,t){t.d(n,{Z:function(){return j}});var i=t(79800),s=t.n(i),r=t(59301),l=t(43418),a=t(59028),o=t(3113),c=t(15309),u=t(27627),d=t(65363),p="customModal___bVzUV",m="content___oKhZq",h="upload___nPxEL",f="infoText___gZEJF",x="okBtn___CVo2A",v="fileList___tauGN",_="fileName___T_8JX",g=t(37712),j=function(e){var n=e.visible,t=e.onOk,i=e.onCancel,j=(0,r.useState)([]),y=s()(j,2),b=y[0],w=y[1],k=(0,r.useState)(!1),N=s()(k,2),Z=N[0],I=N[1],C=(0,d.useParams)();(0,r.useEffect)((function(){n||(w([]),I(!1))}),[n]);var P=function(){var e="".concat(c.Z.API_SERVER,"/api/courses/").concat(C.coursesId,"/exercises/down_template");(0,u.Nd)(null,e)},S=function(){w([])};return(0,g.jsx)(l.Z,{title:"导入试题",open:n,onOk:function(){I(!0),t(b,(function(){I(!1)}))},centered:!0,wrapClassName:p,onCancel:function(){i()},width:663,okText:"确认",okButtonProps:{className:x},cancelText:"取消",confirmLoading:Z,children:(0,g.jsxs)("div",{className:m,children:[(0,g.jsxs)("aside",{children:[(0,g.jsx)("div",{style:{fontWeight:600},children:"步骤1"}),(0,g.jsxs)("ul",{children:[(0,g.jsxs)("li",{children:[(0,g.jsx)("span",{style:{color:"#5F6367"},children:"根据模板要求编辑需要上传的试题"}),(0,g.jsx)("span",{style:{color:"#0152d9",cursor:"pointer",marginLeft:20},onClick:P,children:"下载考试试题模板"}),(0,g.jsx)("i",{className:"iconfont icon-xiazai4 ml10",onClick:P,style:{fontSize:14,cursor:"pointer",color:"#0152d9"}})]}),(0,g.jsx)("li",{style:{color:"#FA6400"},className:"mt10",children:"提示"}),(0,g.jsx)("li",{className:f,children:"1、目前仅支持Excel格式模板; "}),(0,g.jsx)("li",{className:f,children:"2、不支持组合题和实训题导入;"}),(0,g.jsx)("li",{className:f,children:"3、每次最多导入300题;"}),(0,g.jsx)("li",{className:f,children:"4、填空题导入最多支持5个填空项。"})]})]}),(0,g.jsxs)("aside",{style:{marginTop:22},children:[(0,g.jsx)("div",{style:{fontWeight:600},children:"步骤2"}),(0,g.jsxs)("ul",{style:{flex:1},children:[(0,g.jsx)("li",{style:{color:"#5F6367"},children:"上传编辑好的试题文档,确定导入"}),n&&(0,g.jsx)(a.Z,{action:"".concat(c.Z.API_SERVER,"/api/attachments.json"),beforeUpload:function(e){var n={name:e.name,uid:e.uid,file:e};return w([n]),!1},onRemove:S,withCredentials:!0,fileList:b,accept:".xls,.xlsx",showUploadList:!1,children:(0,g.jsx)(o.ZP,{className:h,type:"primary",icon:(0,g.jsx)("i",{className:"iconfont icon-shangchuan3",style:{fontSize:14}}),children:"上传文件"})}),b.map((function(e,n){return(0,g.jsxs)("div",{className:v,children:[(0,g.jsx)("span",{className:_,children:null==e?void 0:e.name}),(0,g.jsx)("i",{className:"iconfont icon-shanchu12",style:{color:"#F65160",fontSize:16,cursor:"pointer"},onClick:S})]},n)}))]})]})]})})}},55662:function(e,n,t){t.d(n,{Y4:function(){return q},Im:function(){return P},ZP:function(){return F}});var i=t(79800),s=t.n(i),r=t(7557),l=t.n(r),a=t(41498),o=t.n(a),c=t(82242),u=t.n(c),d=t(85573),p=t.n(d),m=t(59301),h=t(73782),f=t(3113),x=t(78386),v=t(20538),_=t(53326),g=t(24334),j=t(58152),y=t(23599),b=t(27627),w=t(34376),k=t(79311),N=t(65363),Z=t(37712),I=h.Z.TextArea,C={visible:!1,tabIndex:"0"},P=p()(p()(p()(p()(p()(p()({},_.h.NOMATCH,"测试用例结果不匹配"),_.h.OK,"调试通过"),2,"调试超时"),3,"调试pod失败"),4,"编译失败"),5,"执行失败"),S=function(e){return e[e.SET_VISIBLE=0]="SET_VISIBLE",e[e.SET_TABINDEX=1]="SET_TABINDEX",e}(S||{});function T(e,n){switch(n.type){case S.SET_VISIBLE:return u()(u()({},e),{},{visible:n.payload});case S.SET_TABINDEX:return u()(u()({},e),{},{tabIndex:n.payload});default:throw new Error}}function q(e){var n=e.status,t=e.error_msg,i=e.output,s=e.input,r=e.expected_output,a=e.is_file,c=e.input_file_url,u=e.output_file_url,d=e.expected_output_file_url,p=e.setMonacoValue,h=e.setData,f=(0,m.useRef)(),x=(0,m.useRef)(),v=(0,m.useRef)(),j=null,N={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch((0,m.useEffect)((function(){if(i&&!a&&f.current){var e=new w.Terminal({fontSize:14,letterSpacing:1,cols:83,rows:10});e.open(f.current);var n=(0,b.pp)(g.Base64.decode(i));e.write(n),e.setOption("theme",{background:"#1e1e1e"})}if(s&&!a&&x.current){var t=new w.Terminal({fontSize:14,letterSpacing:1,cols:83,rows:10});t.open(x.current),t.write((0,b.pp)(s)),t.setOption("theme",{background:"#1e1e1e"})}if(r&&!a&&v.current){var l=new w.Terminal({fontSize:14,letterSpacing:1,cols:83,rows:10});l.open(v.current),l.write((0,b.pp)(g.Base64.decode(r))),l.setOption("theme",{background:"#1e1e1e"})}}),[i]),n){case _.h.NOMATCH:j=(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)("p",{className:"c-red",children:"实际输入:"}),!a&&(0,Z.jsx)("div",{ref:x}),a&&(0,Z.jsx)("div",{style:N,children:(0,Z.jsx)("a",{style:{fontSize:"16px"},onClick:o()(l()().mark((function e(){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(c,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return n=e.sent,e.t0=p,e.next=6,n.text();case 6:e.t1=e.sent,(0,e.t0)(e.t1),setTimeout((function(){h(c)}),200);case 9:case"end":return e.stop()}}),e)}))),children:s})}),(0,Z.jsx)("p",{className:"c-red",children:"实际输出:"}),!a&&(0,Z.jsx)("div",{ref:f}),a&&(0,Z.jsx)("div",{style:N,children:(0,Z.jsx)("a",{style:{fontSize:"16px"},onClick:o()(l()().mark((function e(){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,k.ZP)(u,{method:"Get",headers:{"Content-Type":"application/xml",Accept:"*/*"}});case 2:n=e.sent,p(n),setTimeout((function(){h(u)}),200);case 5:case"end":return e.stop()}}),e)}))),children:i})}),(0,Z.jsx)("p",{className:"c-red",children:"预期输出:"}),!a&&(0,Z.jsx)("div",{ref:v}),a&&(0,Z.jsx)("div",{style:N,children:(0,Z.jsx)("a",{style:{fontSize:"16px"},onClick:o()(l()().mark((function e(){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(d,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return n=e.sent,e.t0=p,e.next=6,n.text();case 6:e.t1=e.sent,(0,e.t0)(e.t1),setTimeout((function(){h(d)}),200);case 9:case"end":return e.stop()}}),e)}))),children:r})})]});break;case _.h.EXECUTEFAILURE:j=(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)("div",{style:{border:"1px #F6F7F9 solid"},children:[(0,Z.jsx)("p",{style:{width:"100%",height:40,background:"#F6F7F9",lineHeight:"40px",color:"#666666",paddingLeft:"12px"},children:"最后执行的输入:"}),!a&&(0,Z.jsx)(y.Z,{value:s,style:N}),a&&(0,Z.jsx)("div",{style:N,children:(0,Z.jsx)("a",{onClick:function(){return(0,b.LR)(c,s)},children:s})})]}),(0,Z.jsxs)("div",{style:{border:"1px #F6F7F9 solid",marginTop:"10px"},children:[(0,Z.jsx)("p",{style:{width:"100%",height:40,background:"#F6F7F9",lineHeight:"40px",color:"#666666",paddingLeft:"12px"},children:"执行出错信息:"}),(0,Z.jsxs)("pre",{className:"error",style:{color:"#E30000",padding:"0 10px"},children:[g.Base64.decode(t),"111"]})]})]});break;case _.h.COMPILEFAILURE:j=(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)("p",{children:"最后执行的输入:"}),!a&&(0,Z.jsx)("div",{ref:x}),a&&(0,Z.jsx)("div",{style:N,children:(0,Z.jsx)("a",{onClick:function(){return(0,b.LR)(c,s)},children:s})}),(0,Z.jsx)("p",{children:"执行出错信息:"}),(0,Z.jsx)("pre",{className:"error",children:g.Base64.decode(t)})]});break;case _.h.PODFAILURE:j=(0,Z.jsx)("p",{children:"创建pod失败,请稍后重试"});break;case _.h.TIMEOUT:j=(0,Z.jsx)("p",{children:"评测超时,请稍后重试"})}return(0,Z.jsxs)(Z.Fragment,{children:[" ",j," "]})}function E(e){var n=e.status,t=e.error_msg,i=e.execute_time,s=e.output,r=e.input,l=e.expected_output,a=(e.is_file,e.input_file_url,e.output_file_url,e.expected_output_file_url,null);switch(n){case _.h.OK:a=(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)("p",{children:["执行用时:",i/1e3,"秒"]}),(0,Z.jsx)("p",{children:"执行结果:"}),(0,Z.jsx)("pre",{children:g.Base64.decode(s)})]});break;case _.h.NOMATCH:a=(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)("p",{children:["输入:",(0,Z.jsx)("pre",{children:r})]}),(0,Z.jsxs)("p",{children:["输出:",s&&g.Base64.decode(s)]}),(0,Z.jsxs)("p",{children:["预期输出:",l&&g.Base64.decode(l)]})]});break;case _.h.EXECUTEFAILURE:case _.h.COMPILEFAILURE:a=(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)("p",{children:["最后执行的输入:",(0,Z.jsx)("pre",{children:r})]}),(0,Z.jsx)("p",{children:"执行出错信息:"}),(0,Z.jsx)("pre",{className:"error",children:g.Base64.decode(t)})]});break;case _.h.PODFAILURE:a=(0,Z.jsx)("p",{children:"创建pod失败,请稍后重试"});break;case _.h.TIMEOUT:a=(0,Z.jsx)("p",{children:"评测超时,请稍后重试"})}return(0,Z.jsxs)(Z.Fragment,{children:[" ",a," "]})}var F=function(e){var n=e.input,t=e.debuging,i=e.submitting,r=e.executingMessage,a=e.debugResult,c=e.onChangeInput,u=e.onDebugCode,d=e.onSubmitCode,p=e.hack,h=e.user,_=(0,m.useReducer)(T,C),g=s()(_,2),y=g[0],b=g[1],w=y.visible,P=y.tabIndex,q=(0,N.useSearchParams)(),F=s()(q,1)[0];function O(e){var n=e.target.id;b({type:S.SET_TABINDEX,payload:n})}var L=(0,m.useMemo)((function(){if(a){a.status;return(0,Z.jsx)(Z.Fragment,{children:E(a)})}return null}),[a]);var M=function(){var e=o()(l()().mark((function e(n){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,k.ZP)("/api/problems/".concat(n,"/start.json"),{method:"get",params:{hack_user_id:null==h?void 0:h.user_id}});case 2:(t=e.sent)&&(window.location.href="/myproblems/".concat(null==t?void 0:t.identifier,"?type=1"));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,Z.jsxs)("div",{className:"test-case-panel",children:[(0,Z.jsxs)("div",{className:"test-case-panel-body ".concat(w?"active":""),children:[(0,Z.jsxs)("ul",{className:"s-navs",children:[(0,Z.jsx)("li",{children:(0,Z.jsx)("a",{className:"0"===P?"active":"",id:"0",onClick:O,children:"自定义测试用例"})}),(0,Z.jsx)("li",{children:(0,Z.jsx)("a",{className:"1"===P?"active":"",id:"1",onClick:O,children:"代码执行结果"})})]}),(0,Z.jsx)("div",{className:"tab-panel-body ".concat("0"===P?"":"hide"),children:(0,Z.jsx)(I,{placeholder:"请填写测试用例的输入值,点击“调试代码”",value:n,onChange:c})}),(0,Z.jsx)("div",{className:"tab-panel-body ".concat("1"===P?"":"hide"),children:t?(0,Z.jsx)(j.Z,{message:r}):a?(0,Z.jsxs)("section",{style:{height:200},children:[" ",L," "]}):(0,Z.jsx)("p",{className:"tip",children:"请填写测试用例的输入值,点击“调试代码”"})})]}),(0,Z.jsx)("a",{className:"btn-collapse ".concat(w?"up":""),onClick:function(){b({type:S.SET_VISIBLE,payload:!w})},children:w?(0,Z.jsx)(x.Z,{}):(0,Z.jsx)(v.Z,{})}),(0,Z.jsxs)("footer",{className:"footer",children:[(0,Z.jsx)("span",{children:"控制台"}),(0,Z.jsxs)("div",{className:"flex-container",children:[(null==p?void 0:p.is_program)&&(null==p?void 0:p.above_question)&&(0,Z.jsx)(f.ZP,{onClick:function(){return M(null==p?void 0:p.above_question)},id:"oj-prev",className:"btn-blue",type:"ghost",children:"上一题"}),(null==p?void 0:p.is_program)&&(null==p?void 0:p.under_question)&&(0,Z.jsx)(f.ZP,{onClick:function(){return M(null==p?void 0:p.under_question)},id:"oj-next",className:"btn-blue",type:"ghost",children:"下一题"}),(0,Z.jsx)(f.ZP,{className:"btn-green",type:"ghost",loading:t,onClick:function(){b({type:S.SET_VISIBLE,payload:!0}),b({type:S.SET_TABINDEX,payload:"1"}),u()},children:"调试代码"}),"8"!==F.get("qtype")&&(0,Z.jsx)(f.ZP,{type:"primary",className:"custom-ant-disabled",loading:i,disabled:i,onClick:function(){b({type:S.SET_VISIBLE,payload:!1}),d()},children:"评测并提交"})]})]})]})}},53326:function(e,n,t){t.d(n,{h:function(){return i}});var i=function(e){return e[e.NOMATCH=-1]="NOMATCH",e[e.OK=0]="OK",e[e.TIMEOUT=2]="TIMEOUT",e[e.PODFAILURE=3]="PODFAILURE",e[e.COMPILEFAILURE=4]="COMPILEFAILURE",e[e.EXECUTEFAILURE=5]="EXECUTEFAILURE",e}({})},9187:function(e,n,t){t.d(n,{H7:function(){return m},MK:function(){return p},MU:function(){return o},X6:function(){return u},bM:function(){return a},fi:function(){return h},fu:function(){return l},n4:function(){return f},rX:function(){return d},vl:function(){return x},zO:function(){return c}});var i=t(82242),s=t.n(i),r=t(79311);function l(e,n){return(0,r.U2)("myproblems/".concat(e,".json"),s()({hidePopLogin:!0},n||{}))}function a(e,n){return(0,r.v_)("myproblems/".concat(e,"/code_submit.json"),n)}function o(e,n){return(0,r.v_)("myproblems/".concat(e,"/code_debug.json"),n)}function c(e,n){return n.language&&(n.language=encodeURIComponent(n.language)),(0,r.U2)("myproblems/".concat(e,"/submit_records.json"),n)}function u(e){return(0,r.U2)("myproblems/record_detail.json",{id:e})}function d(e,n){return(0,r.U2)("myproblems/".concat(e,"/result.json"),{mode:n})}function p(e,n){return(0,r.v_)("myproblems/".concat(e,"/add_notes.json"),n)}function m(e){return(0,r.v_)("myproblems/".concat(e,"/restore_initial_code.json"))}function h(e){return(0,r.v_)("myproblems/".concat(e,"/sync_code.json"))}function f(e,n){return(0,r.v_)("myproblems/".concat(e,"/update_code.json"),n)}function x(e,n){return(0,r.v_)("discusses/".concat(e,"/plus.json"),n)}},91676:function(e,n,t){var i=t(7557),s=t.n(i),r=t(41498),l=t.n(r),a=t(79800),o=t.n(a),c=t(59301),u=t(6848),d=t(73782),p=t(8591),m=t(54199),h=t(37712);n.Z=function(e){var n=e.defaultValue,t=e.onFinish,i=(0,c.useState)(!1),r=o()(i,2),a=r[0],f=r[1],x=(0,c.useState)(n),v=o()(x,2),_=v[0],g=v[1];return(0,c.useEffect)((function(){g(n)}),[n]),(0,h.jsx)("div",{children:a?(0,h.jsx)(d.Z,{autoFocus:!0,maxLength:60,style:{textAlign:"center",marginTop:20,marginBottom:20},value:_,onChange:function(e){g(e.target.value)},onBlur:l()(s()().mark((function e(){var n;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((null==_||null===(n=_.replaceAll(" ",""))||void 0===n?void 0:n.length)<=0)){e.next=3;break}return p.ZP.error("试卷标题不能为空"),e.abrupt("return");case 3:return e.next=5,t(_);case 5:e.sent&&f(!1);case 7:case"end":return e.stop()}}),e)}))),onPressEnter:l()(s()().mark((function e(){var n;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((null==_||null===(n=_.replaceAll(" ",""))||void 0===n?void 0:n.length)<=0)){e.next=3;break}return p.ZP.error("试卷标题不能为空"),e.abrupt("return");case 3:return e.next=5,t(_);case 5:e.sent&&f(!1);case 7:case"end":return e.stop()}}),e)})))}):(0,h.jsxs)("div",{className:m.Z.title,children:[_,(0,h.jsx)(u.Z,{title:"点击编辑试卷名称",children:(0,h.jsx)("i",{className:"".concat(m.Z.editIcon," iconfont icon-bianji_Hover"),onClick:function(){return f(!0)}})})]})})}},11025:function(e,n,t){t.d(n,{I:function(){return l}});var i=t(79800),s=t.n(i),r=t(59301),l=function(){var e=(0,r.useState)("hidden"),n=s()(e,2),t=n[0],i=n[1];return{overflow:t,handleMouseEnter:function(){return i("auto")},handleMouseLeave:function(){return i("hidden")}}}},72684:function(e,n,t){t(59301);Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;n.Z="data:image/svg+xml;base64,PHN2ZyBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMzIiIGhlaWdodD0iMzIiPjxwYXRoIGQ9Ik0zNjUuNzE0IDczLjE0M0gxMDI0djczLjE0M0gzNjUuNzE0em0wIDI5Mi41NzFIMTAyNHY3My4xNDNIMzY1LjcxNHptMCAyOTIuNTcySDEwMjR2NzMuMTQzSDM2NS43MTR6bTAgMjkyLjU3MUgxMDI0VjEwMjRIMzY1LjcxNHYtNzMuMTQzeiIgZmlsbD0iIzk4QkRGNyIvPjxwYXRoIGQ9Im0yNDguNjg2IDgwMy4xODItNjUuODI5IDc1LjkyMlY2NTguMjg2aC03My4xNDN2MjIwLjgxOGwtNjUuODI4LTc1Ljk5NUwwIDg1MS4zODMgMTQ2LjI4NiAxMDI0IDI5Mi41NyA4NTEuNTN6IiBmaWxsPSIjMTQ1REZGIi8+PHBhdGggZD0iTTE0Ni4yODYgMCAwIDE1OC43Mmw0My44ODYgNTUuMjIzIDY1LjgyOC03NS45MjJ2MjI3LjY5M2g3My4xNDNWMTM4LjAyMWw2NS44MjkgNzUuOTIyIDQzLjg4NS01NS4yMjN6IiBmaWxsPSIjOThCREY3Ii8+PC9zdmc+"},73806:function(e,n,t){t(59301);Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;n.Z="data:image/svg+xml;base64,PHN2ZyBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMzIiIGhlaWdodD0iMzIiPjxwYXRoIGQ9Ik0zNjUuNzE0IDczLjE0M0gxMDI0djczLjE0M0gzNjUuNzE0em0wIDI5Mi41NzFIMTAyNHY3My4xNDNIMzY1LjcxNHptMCAyOTIuNTcySDEwMjR2NzMuMTQzSDM2NS43MTR6bTAgMjkyLjU3MUgxMDI0VjEwMjRIMzY1LjcxNHYtNzMuMTQzek0yNDguNjg2IDgwMy4xODJsLTY1LjgyOSA3NS45MjJWNjU4LjI4NmgtNzMuMTQzdjIyMC44MThsLTY1LjgyOC03NS45OTVMMCA4NTEuMzgzIDE0Ni4yODYgMTAyNCAyOTIuNTcgODUxLjUzeiIgZmlsbD0iIzk4QkRGNyIvPjxwYXRoIGQ9Ik0xNDYuMjg2IDAgMCAxNTguNzJsNDMuODg2IDU1LjIyMyA2NS44MjgtNzUuOTIydjIyNy42OTNoNzMuMTQzVjEzOC4wMjFsNjUuODI5IDc1LjkyMiA0My44ODUtNTUuMjIzeiIgZmlsbD0iIzE0NURGRiIvPjwvc3ZnPg=="},98887:function(e,n){n.Z={wrap:"wrap___ilWvf",deleteIcon:"deleteIcon___JBDG8",keywordTag:"keywordTag___iieCb",questionTitleEditorWrap:"questionTitleEditorWrap___MHB5s",choiceWrap:"choiceWrap___QFkTc",choiceIndex:"choiceIndex___Mr2YO",judgementIndex:"judgementIndex___fUVWK",setAnswerBtn:"setAnswerBtn___Whox5",activeAnswer:"activeAnswer___fGU6Y",activeJudgementAnswer:"activeJudgementAnswer___wJv8P",actionWrapper:"actionWrapper___ERQ7k",addIcon:"addIcon___L9TE0",inputBorder:"inputBorder___Q5tRE",placeholder:"placeholder___p9sFY",blankWrapper:"blankWrapper___nC45e",blankInput:"blankInput___pEHsx",blankInputNumberWrapper:"blankInputNumberWrapper___uEHb0",addBtn:"addBtn___WR5ZI",blankIndex:"blankIndex___x9Pny",baseInputWrapper:"baseInputWrapper___eVsG7",collapseWrapper:"collapseWrapper___ZTysU",panelHeader:"panelHeader___QSN9g",open:"open___B6FU9",close:"close___QX19r",hide:"hide___mn25n"}},54199:function(e,n){n.Z={flex_box_center:"flex_box_center___ycN2f",flex_space_between:"flex_space_between___LcS9e",flex_box_vertical_center:"flex_box_vertical_center___uwjPm",flex_box_center_end:"flex_box_center_end___Pc903",flex_box_column:"flex_box_column___AXEdv",bg:"bg___fm2Cw",title:"title___J3MCU",editIcon:"editIcon___i4Zll",titleLeft:"titleLeft___da61c",titleRight:"titleRight___EsdL6",formWrap:"formWrap___YTxC3",baseLineHeight:"baseLineHeight___TprCB",radioBtnWrapper:"radioBtnWrapper___Mt_XG",radiogroup:"radiogroup___EvkWh",easy:"easy___mSxtg",medium:"medium___NIaWN",hard:"hard___mddnD",baseFormItem:"baseFormItem___csbyb",cascaderPopup:"cascaderPopup___BttnF",selectdiv:"selectdiv___TAr4i",divitem:"divitem___iaXB2",bottmodiv:"bottmodiv___bmp6p",cancelBtn:"cancelBtn___Q4ZcL",confirmBtn:"confirmBtn___nRiCD"}},27666:function(e,n,t){var i=t(40447),s=t(71783);n.Z=function(e){let n;const t=t=>()=>{n=null,e.apply(void 0,(0,i.Z)(t))},r=function(){if(null==n){for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];n=(0,s.Z)(t(i))}};return r.cancel=()=>{s.Z.cancel(n),n=null},r}},81228:function(e,n,t){t.d(n,{Z:function(){return N}});var i=t(93669),s=t(59362),r=t(97015),l=t(20911),a=t(59301),o=t(92310),c=t.n(o),u=t(28647),d=t(55405),p=t(27666),m=t(36355),h=t(83116),f=t(37613);const x=e=>{const{componentCls:n}=e;return{[n]:{position:"fixed",zIndex:e.zIndexPopup}}};var v=(0,h.Z)("Affix",(e=>{const n=(0,f.TS)(e,{zIndexPopup:e.zIndexBase+10});return[x(n)]}));function _(e){return e!==window?e.getBoundingClientRect():{top:0,bottom:window.innerHeight}}function g(e,n,t){if(void 0!==t&&n.top>e.top-t)return t+n.top}function j(e,n,t){if(void 0!==t&&n.bottom<e.bottom+t){return t+(window.innerHeight-n.bottom)}}const y=["resize","scroll","touchstart","touchmove","touchend","pageshow","load"];function b(){return"undefined"!=typeof window?window:null}var w;!function(e){e[e.None=0]="None",e[e.Prepare=1]="Prepare"}(w||(w={}));let k=function(e){(0,r.Z)(t,e);var n=(0,l.Z)(t);function t(){var e;return(0,i.Z)(this,t),(e=n.apply(this,arguments)).state={status:w.None,lastAffix:!1,prevTarget:null},e.placeholderNodeRef=(0,a.createRef)(),e.fixedNodeRef=(0,a.createRef)(),e.addListeners=()=>{const n=e.getTargetFunc(),t=null==n?void 0:n(),{prevTarget:i}=e.state;i!==t&&(y.forEach((n=>{null==i||i.removeEventListener(n,e.lazyUpdatePosition),null==t||t.addEventListener(n,e.lazyUpdatePosition)})),e.updatePosition(),e.setState({prevTarget:t}))},e.removeListeners=()=>{e.timer&&(clearTimeout(e.timer),e.timer=null);const{prevTarget:n}=e.state,t=e.getTargetFunc(),i=null==t?void 0:t();y.forEach((t=>{null==i||i.removeEventListener(t,e.lazyUpdatePosition),null==n||n.removeEventListener(t,e.lazyUpdatePosition)})),e.updatePosition.cancel(),e.lazyUpdatePosition.cancel()},e.getOffsetTop=()=>{const{offsetBottom:n,offsetTop:t}=e.props;return void 0===n&&void 0===t?0:t},e.getOffsetBottom=()=>e.props.offsetBottom,e.measure=()=>{const{status:n,lastAffix:t}=e.state,{onChange:i}=e.props,s=e.getTargetFunc();if(n!==w.Prepare||!e.fixedNodeRef.current||!e.placeholderNodeRef.current||!s)return;const r=e.getOffsetTop(),l=e.getOffsetBottom(),a=s();if(a){const n={status:w.None},s=_(e.placeholderNodeRef.current);if(0===s.top&&0===s.left&&0===s.width&&0===s.height)return;const o=_(a),c=g(s,o,r),u=j(s,o,l);void 0!==c?(n.affixStyle={position:"fixed",top:c,width:s.width,height:s.height},n.placeholderStyle={width:s.width,height:s.height}):void 0!==u&&(n.affixStyle={position:"fixed",bottom:u,width:s.width,height:s.height},n.placeholderStyle={width:s.width,height:s.height}),n.lastAffix=!!n.affixStyle,i&&t!==n.lastAffix&&i(n.lastAffix),e.setState(n)}},e.prepareMeasure=()=>{e.setState({status:w.Prepare,affixStyle:void 0,placeholderStyle:void 0})},e.updatePosition=(0,p.Z)((()=>{e.prepareMeasure()})),e.lazyUpdatePosition=(0,p.Z)((()=>{const n=e.getTargetFunc(),{affixStyle:t}=e.state;if(n&&t){const i=e.getOffsetTop(),s=e.getOffsetBottom(),r=n();if(r&&e.placeholderNodeRef.current){const n=_(r),l=_(e.placeholderNodeRef.current),a=g(l,n,i),o=j(l,n,s);if(void 0!==a&&t.top===a||void 0!==o&&t.bottom===o)return}}e.prepareMeasure()})),e}return(0,s.Z)(t,[{key:"getTargetFunc",value:function(){const{getTargetContainer:e}=this.context,{target:n}=this.props;return void 0!==n?n:null!=e?e:b}},{key:"componentDidMount",value:function(){this.timer=setTimeout(this.addListeners)}},{key:"componentDidUpdate",value:function(e){this.addListeners(),e.offsetTop===this.props.offsetTop&&e.offsetBottom===this.props.offsetBottom||this.updatePosition(),this.measure()}},{key:"componentWillUnmount",value:function(){this.removeListeners()}},{key:"render",value:function(){const{affixStyle:e,placeholderStyle:n}=this.state,{affixPrefixCls:t,rootClassName:i,children:s}=this.props,r=c()(e&&i,{[t]:!!e});let l=(0,d.Z)(this.props,["prefixCls","offsetTop","offsetBottom","target","onChange","affixPrefixCls","rootClassName"]);return a.createElement(u.Z,{onResize:this.updatePosition},a.createElement("div",Object.assign({},l,{ref:this.placeholderNodeRef}),e&&a.createElement("div",{style:n,"aria-hidden":"true"}),a.createElement("div",{className:r,ref:this.fixedNodeRef,style:e},a.createElement(u.Z,{onResize:this.updatePosition},s))))}}]),t}(a.Component);k.contextType=m.E_;var N=(0,a.forwardRef)(((e,n)=>{const{prefixCls:t,rootClassName:i}=e,{getPrefixCls:s}=(0,a.useContext)(m.E_),r=s("affix",t),[l,o]=v(r),u=Object.assign(Object.assign({},e),{affixPrefixCls:r,rootClassName:c()(i,o)});return l(a.createElement(k,Object.assign({},u,{ref:n})))}))},66104:function(e,n,t){t.d(n,{Z:function(){return S}});var i=t(92310),s=t.n(i),r=t(75440),l=t(47413),a=t(59301),o=t(92343),c=t(36355),u=t(78386),d=t(91857);const p=e=>{let{children:n}=e;const{getPrefixCls:t}=a.useContext(c.E_),i=t("breadcrumb");return a.createElement("li",{className:`${i}-separator`,"aria-hidden":"true"},""===n?n:n||"/")};p.__ANT_BREADCRUMB_SEPARATOR=!0;var m=p,h=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(t[i[s]]=e[i[s]])}return t};function f(e,n,t,i){if(null==t)return null;const{className:r,onClick:o}=n,c=h(n,["className","onClick"]),u=Object.assign(Object.assign({},(0,l.Z)(c,{data:!0,aria:!0})),{onClick:o});return void 0!==i?a.createElement("a",Object.assign({},u,{className:s()(`${e}-link`,r),href:i}),t):a.createElement("span",Object.assign({},u,{className:s()(`${e}-link`,r)}),t)}function x(e,n){return(t,i,s,r,l)=>{if(n)return n(t,i,s,r);const a=function(e,n){if(void 0===e.title||null===e.title)return null;const t=Object.keys(n).join("|");return"object"==typeof e.title?e.title:String(e.title).replace(new RegExp(`:(${t})`,"g"),((e,t)=>n[t]||e))}(t,i);return f(e,t,a,l)}}var v=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(t[i[s]]=e[i[s]])}return t};const _=e=>{const{prefixCls:n,separator:t="/",children:i,menu:s,overlay:r,dropdownProps:l,href:o}=e;const c=(e=>{if(s||r){const t=Object.assign({},l);if(s){const e=s||{},{items:n}=e,i=v(e,["items"]);t.menu=Object.assign(Object.assign({},i),{items:null==n?void 0:n.map(((e,n)=>{var{key:t,title:i,label:s,path:r}=e,l=v(e,["key","title","label","path"]);let c=null!=s?s:i;return r&&(c=a.createElement("a",{href:`${o}${r}`},c)),Object.assign(Object.assign({},l),{key:null!=t?t:n,label:c})}))})}else r&&(t.overlay=r);return a.createElement(d.Z,Object.assign({placement:"bottom"},t),a.createElement("span",{className:`${n}-overlay-link`},e,a.createElement(u.Z,null)))}return e})(i);return null!=c?a.createElement(a.Fragment,null,a.createElement("li",null,c),t&&a.createElement(m,null,t)):null},g=e=>{const{prefixCls:n,children:t,href:i}=e,s=v(e,["prefixCls","children","href"]),{getPrefixCls:r}=a.useContext(c.E_),l=r("breadcrumb",n);return a.createElement(_,Object.assign({},s,{prefixCls:l}),f(l,s,t,i))};g.__ANT_BREADCRUMB_ITEM=!0;var j=g,y=t(17313),b=t(83116),w=t(37613);const k=e=>{const{componentCls:n,iconCls:t}=e;return{[n]:Object.assign(Object.assign({},(0,y.Wf)(e)),{color:e.itemColor,fontSize:e.fontSize,[t]:{fontSize:e.iconFontSize},ol:{display:"flex",flexWrap:"wrap",margin:0,padding:0,listStyle:"none"},a:Object.assign({color:e.linkColor,transition:`color ${e.motionDurationMid}`,padding:`0 ${e.paddingXXS}px`,borderRadius:e.borderRadiusSM,height:e.lineHeight*e.fontSize,display:"inline-block",marginInline:-e.marginXXS,"&:hover":{color:e.linkHoverColor,backgroundColor:e.colorBgTextHover}},(0,y.Qy)(e)),"li:last-child":{color:e.lastItemColor},[`${n}-separator`]:{marginInline:e.separatorMargin,color:e.separatorColor},[`${n}-link`]:{[`\n > ${t} + span,\n > ${t} + a\n `]:{marginInlineStart:e.marginXXS}},[`${n}-overlay-link`]:{borderRadius:e.borderRadiusSM,height:e.lineHeight*e.fontSize,display:"inline-block",padding:`0 ${e.paddingXXS}px`,marginInline:-e.marginXXS,[`> ${t}`]:{marginInlineStart:e.marginXXS,fontSize:e.fontSizeIcon},"&:hover":{color:e.linkHoverColor,backgroundColor:e.colorBgTextHover,a:{color:e.linkHoverColor}},a:{"&:hover":{backgroundColor:"transparent"}}},[`&${e.componentCls}-rtl`]:{direction:"rtl"}})}};var N=(0,b.Z)("Breadcrumb",(e=>{const n=(0,w.TS)(e,{});return[k(n)]}),(e=>({itemColor:e.colorTextDescription,lastItemColor:e.colorText,iconFontSize:e.fontSize,linkColor:e.colorTextDescription,linkHoverColor:e.colorText,separatorColor:e.colorTextDescription,separatorMargin:e.marginXS}))),Z=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(t[i[s]]=e[i[s]])}return t};function I(e){const{breadcrumbName:n,children:t}=e,i=Z(e,["breadcrumbName","children"]),s=Object.assign({title:n},i);return t&&(s.menu={items:t.map((e=>{var{breadcrumbName:n}=e,t=Z(e,["breadcrumbName"]);return Object.assign(Object.assign({},t),{title:n})}))}),s}var C=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(t[i[s]]=e[i[s]])}return t};const P=e=>{const{prefixCls:n,separator:t="/",style:i,className:u,rootClassName:d,routes:p,items:h,children:f,itemRender:v,params:g={}}=e,j=C(e,["prefixCls","separator","style","className","rootClassName","routes","items","children","itemRender","params"]),{getPrefixCls:y,direction:b,breadcrumb:w}=a.useContext(c.E_);let k;const Z=y("breadcrumb",n),[P,S]=N(Z),T=function(e,n){return(0,a.useMemo)((()=>e||(n?n.map(I):null)),[e,n])}(h,p);const q=x(Z,v);if(T&&T.length>0){const e=[],n=h||p;k=T.map(((i,s)=>{const{path:r,key:o,type:c,menu:u,overlay:d,onClick:p,className:h,separator:f,dropdownProps:x}=i,v=((e,n)=>{if(void 0===n)return n;let t=(n||"").replace(/^\//,"");return Object.keys(e).forEach((n=>{t=t.replace(`:${n}`,e[n])})),t})(g,r);void 0!==v&&e.push(v);const j=null!=o?o:s;if("separator"===c)return a.createElement(m,{key:j},f);const y={},b=s===T.length-1;u?y.menu=u:d&&(y.overlay=d);let{href:w}=i;return e.length&&void 0!==v&&(w=`#/${e.join("/")}`),a.createElement(_,Object.assign({key:j},y,(0,l.Z)(i,{data:!0,aria:!0}),{className:h,dropdownProps:x,href:w,separator:b?"":t,onClick:p,prefixCls:Z}),q(i,g,n,e,w))}))}else if(f){const e=(0,r.Z)(f).length;k=(0,r.Z)(f).map(((n,i)=>{if(!n)return n;const s=i===e-1;return(0,o.Tm)(n,{separator:s?"":t,key:i})}))}const E=s()(Z,null==w?void 0:w.className,{[`${Z}-rtl`]:"rtl"===b},u,d,S),F=Object.assign(Object.assign({},null==w?void 0:w.style),i);return P(a.createElement("nav",Object.assign({className:E,style:F},j),a.createElement("ol",null,k)))};P.Item=j,P.Separator=m;var S=P}}]); |