(self.webpackChunk=self.webpackChunk||[]).push([[93260,4977,39752],{66455:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,_typeof=__webpack_require__(31468).default;(function(){if("function"!=typeof window.GGBApplet){var isRenderGGBElementEnabled=!1,scriptLoadStarted=!1,html5AppletsToProcess=null,ggbHTML5LoadedCodebaseIsWebSimple=!1,ggbHTML5LoadedCodebaseVersion=null,ggbHTML5LoadedScript=null,GGBApplet=function(){"use strict";for(var e={},n="5.0",t={},i=null,r=!1,l=!1,a=null,o=!1,s=null,c=null,d=0;d4?parseFloat(e):5};function b(){try{return window.self!==window.top}catch(e){return!0}}function j(){return(!t.hasOwnProperty("screenshotGenerator")||!t.screenshotGenerator)&&Math.max(screen.width,screen.height)<800}e.setHTML5Codebase=function(e,n){c=e,L(e,n)},e.setJavaCodebase=e.setJavaCodebaseVersion=e.isCompiledInstalled=e.setPreCompiledScriptPath=e.setPreCompiledResourcePath=function(){},e.setHTML5CodebaseVersion=function(e,n){var t=parseFloat(e);NaN!==t&&t<5?console.log("The GeoGebra HTML5 codebase version "+t+" is deprecated. Using version latest instead."):(s=e,M(e,n))},e.getHTML5CodebaseVersion=function(){return f},e.getParameters=function(){return t},e.setFontsCSSURL=function(e){_=e},e.setGiacJSURL=function(e){},e.setJNLPFile=function(e){e},e.setJNLPBaseDir=function(e){},e.inject=function(){function n(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var i,r="auto",l=t.id,a=!1,s=0;s=5)return!0;var n=e.getAppletObject();return!(!n||"function"!=typeof n.recalculateEnvironments)&&(n.recalculateEnvironments(),!0)},e.startAnimation=function(){var n=e.getAppletObject();return!(!n||"function"!=typeof n.startAnimation)&&(n.startAnimation(),!0)},e.stopAnimation=function(){var n=e.getAppletObject();return!(!n||"function"!=typeof n.stopAnimation)&&(n.stopAnimation(),!0)},e.getAppletObject=function(){var e=void 0!==t.id?t.id:"ggbApplet";return window[e]},e.resize=function(){};var Z=function(e){return e&&"false"!==e},S=function(n,t,i){w(f)<=4.2&&(i=!0);var r=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==f||ggbHTML5LoadedCodebaseIsWebSimple&&!x)&&(r=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var l=document.createElement("div");l.classList.add("appletParameters","notranslate");var a=t.width,o=t.height;if(t.disableAutoScale=void 0===t.disableAutoScale?GGBAppletUtils.isFlexibleWorksheetEditor():t.disableAutoScale,void 0!==t.width)if(w(f)<=4.4)Z(t.showToolBar)&&(t.height-=7),Z(t.showAlgebraInput)&&(t.height-=37),t.width<605&&Z(t.showToolBar)&&(t.width=605,a=605);else{var d=100;(Z(t.showToolBar)||Z(t.showMenuBar))&&(t.hasOwnProperty("customToolBar")&&(t.customToolbar=t.customToolBar),d=Z(t.showMenuBar)?245:155),a=5?(t.appletOnLoad=function(e){var t=n.querySelector(".ggb_preview");t&&t.parentNode.removeChild(t),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(g),window.GGBT_wsf_view&&$(window).trigger("resize"),m(e)},y||g.appendChild(b)):l.appendChild(b),g.appendChild(l),y||n.appendChild(g),setTimeout((function(){e.resize()}),1)}function j(e,n){n&&"function"==typeof n.appletOnLoad&&"function"==typeof renderGGBElement?renderGGBElement(e,n.appletOnLoad):renderGGBElement(e),O("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",n)}function k(e,n){"undefined"==typeof renderGGBElement?(null===html5AppletsToProcess&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:e,params:n}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,null!==html5AppletsToProcess&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach((function(e){j(e.article,e.params)})),html5AppletsToProcess=null)},w(f)<5&&(e.className+=" geogebraweb")):j(e,n)}if(r){scriptLoadStarted=!0;for(var C=0;C0?(r.remove(),o.attr("id","fullscreencontent").show(),jQuery(l).append(o),window.dispatchEvent(new Event("resize"))):S(r,n,!1),window.GGBT_wsf_view.launchFullScreen(l)}else h=i,S(e,n,!1);if(!window.GGBT_wsf_view)for(a=0;ae/4*3&&(o=e/4*3),s=o/5.8,a.setAttribute("src",y),a.setAttribute("width",o),a.setAttribute("height",s);var d=(e-o)/2,u=(n-s)/2;a.style.left=d+"px",a.style.top=u+"px",r.appendChild(a)}return r.appendChild(c),r},E=function(e){return"html5"===(e=e.toLowerCase())||"screenshot"===e?e:"html5"},q=["web","webSimple","web3d","tablet","tablet3d","phone"],M=function(e,n){if(f=e,n)L(f,!0);else{var l,a,o=!r;if(o){var s=w(f);!isNaN(s)&&s<4.4&&(o=!1)}l="http"===window.location.protocol.substr(0,4)?window.location.protocol:"http:";var c=f.indexOf("//");for(var d in a=c>0?f:0===c?l+f:"https://www.geogebra.org/apps/5.2.814.0/",q)if(f.slice(-1*q[d].length)===q[d]||f.slice(-1*(q[d].length+1))===q[d]+"/")return void L(a,!1);GGBAppletUtils.isFlexibleWorksheetEditor()||!o||i.is3D||i.AV||i.SV||i.CV||i.EV2||i.CP||i.PC||i.DA||i.FI||i.PV||Z(t.showToolBar)||Z(t.showMenuBar)||Z(t.showAlgebraInput)||Z(t.enableRightClick)||t.appName&&"classic"!=t.appName?a+="web3d/":a+="webSimple/",L(a,!1)}},L=function(e,n){if(e.requirejs)p=e;else{"/"!==e.slice(-1)&&(e+="/"),p=e,null===n&&(n=-1===e.indexOf("http")),m=n,v="web.nocache.js",x=!1;var t=p.split("/");t.length>1&&(n||"webSimple"!==t[t.length-2]?q.indexOf(t[t.length-2])>=0&&(v=t[t.length-2]+".nocache.js"):(v="webSimple.nocache.js",x=!0)),t=e.split("/"),"test"===(f=t[t.length-3]).substr(0,4)?f=f.substr(4,1)+"."+f.substr(5,1):"war"!==f.substr(0,3)&&"beta"!==f.substr(0,4)||(f="5.0");var i=parseFloat(f);NaN!==i&&i<5&&e.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+i+" is deprecated. Using version latest instead."),M("5.0",n))}},O=function(e,n){window.console&&window.console.log&&(!n||void 0===n.showLogging||n.showLogging&&"false"!==n.showLogging)&&console.log(e)};function D(){var e=n;null!==s?e=s:parseFloat(e)<5&&(e="5.0"),M(e,!1),null!==c&&L(c,m),o=!0}return void 0!==t.material_id?k(D):D(),e},GGBAppletUtils=function(){"use strict";function e(){return void 0!==window.GGBT_wsf_edit}function n(e,n){1!=n?(e.style.transformOrigin="0% 0% 0px",e.style.webkitTransformOrigin="0% 0% 0px",e.style.transform="scale("+n+","+n+")",e.style.webkitTransform="scale("+n+","+n+")",e.style.maxWidth="initial",null!==e.querySelector(".ggb_preview")&&(e.querySelector(".ggb_preview").style.maxWidth="initial"),void 0!==e.querySelectorAll(".ggb_preview img")[0]&&(e.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),void 0!==e.querySelectorAll(".ggb_preview img")[1]&&(e.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(e.style.transform="none",e.style.webkitTransform="none")}function t(e,n,t,i,r){if(e.isScreenshoGenerator)return 1;var l,a=void 0!==i&&i,o=null!=e.noScaleMargin&&e.noScaleMargin,s=(l=e.autoHeight)&&"false"!==l,c=function(e,n,t,i,r,l){var a=null;if(null!=l&&""!=l)for(var o=e.parentNode;null!=o;){if((" "+o.className+" ").indexOf(" "+l+" ")>-1){a=o;break}o=o.parentNode}var s=0,c=0,d=0,u=0,p=0,m=0,h=0;if(a)s=a.offsetWidth,c=Math.max(i?a.offsetWidth:0,a.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(s=Math.min(window.innerWidth,document.documentElement.clientWidth),c=Math.min(window.innerHeight,document.documentElement.clientHeight),d=s):(s=window.innerWidth,c=window.innerHeight,d=window.innerWidth),e){var f=e.getBoundingClientRect();f.left>0&&f.left<=s&&(void 0===r||!r)&&("rtl"===document.dir?(p=s-f.width-f.left,m=d<=480?10:30):(m=f.left,p=d<=480?10:30),u=m+p)}e&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(e.getBoundingClientRect(),"closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(u=40,h=0):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(u=0,h=40))}return e&&((void 0===t||!t)&&n>0&&n+u1&&(a=!0)),n&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(a=!0),e.hasOwnProperty("disableAutoScale")&&e.disableAutoScale?l:(r=t(e,n,a,i,e.scaleContainerClass),!a||e.hasOwnProperty("scale")&&1!==l?Math.min(l,r):r)}function r(e){var n=Math.min(window.innerWidth,document.documentElement.clientWidth),t=Math.min(window.innerHeight,document.documentElement.clientHeight),i=e.getBoundingClientRect(),r=(n-i.width)/2,l=(t-i.height)/2;l<0&&(l=0),e.style.position="relative","closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(e.style.left=r<40?"40px":r+"px",e.style.top=l+"px"):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(e.style.top=l<40?"40px":l+"px",e.style.left=r+"px")}return{responsiveResize:function(t,l){var a=t.querySelector(".appletParameters");if(a){if("object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()){if(l.id!==a.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(t)}if(a.parentElement&&/fullscreen/.test(a.parentElement.className))return;var o=i(l,t);e()&&a.setAttribute("data-param-scale",o);for(var s=null,c=0;c=O)continue;if(j==jb){if(k=i.getAttribute(kb),k){var l,m=k.indexOf(lb);m>=O?(j=k.substring(O,m),l=k.substring(m+P)):(j=k,l=W),c[j]=l}}else if(j==mb){if(k=i.getAttribute(kb),k)try{d=eval(k)}catch(e){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(e){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(e){var n=c[e];return null==n?null:n},r=d,webModule.__errFn=e}function B(){function e(e){var n=e.lastIndexOf(rb);-1==n&&(n=e.length);var t=e.indexOf(sb);-1==t&&(t=e.length);var i=e.lastIndexOf(tb,Math.min(t,n));return i>=O?e.substring(O,i+P):W}var n,t=null!=(n=__gwt_getMetaProperty(wb))?n:W;return t==W&&(t=function(){for(var n=o.getElementsByTagName(_),t=O;tO?e[e.length-P].href:W}()),t==W&&function(){var e=o.location;return e.href==e.protocol+zb+e.host+e.pathname+e.search+e.hash}()&&(t=e(o.location.href)),t=function(n){if(n.match(/^\w+:\/\//));else{var t=o.createElement(ub);t.src=n+vb,n=e(t.src)}return n}(t),t}function C(e){return e.match(/^\//)||e.match(/^[a-zA-Z]+:\/\//)?e:webModule.__moduleBase+e}function D(){var e,t=O,i=[],l=[];function a(e){var n=l[e](),t=i[e];if(n in t)return n;var a=[];for(var o in t)a[t[o]]=o;throw r&&r(e,a,n),null}if(__gwt_isKnownPropertyValue=function(e,n){return n in i[e]},webModule.__getPropMap=function(){var e={};for(var n in i)i.hasOwnProperty(n)&&(e[n]=a(n));return e},webModule.__computePropValue=a,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);try{var o=(e=Cb).indexOf(Db);-1!=o&&(t=parseInt(e.substring(o+P),$),e=e.substring(O,o))}catch(e){}return webModule.__softPermutationId=t,C(e+Eb)}function F(){n.__gwt_stylesLoaded||(n.__gwt_stylesLoaded={})}s[L]={moduleName:L},webModule.__moduleStartupDone=function(e){var n=s[L].bindings;s[L].bindings=function(){for(var t=n?n():{},i=e[webModule.__softPermutationId],r=O;r0){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:"",t=[],i=0;ie||e>l-20&&tn||n>r-20&&i1e3*(a+3)*s,te.current){e.next=9;break}return e.abrupt("return");case 9:if(!o){e.next=13;break}return T.ZP.error("调试代码超时"),f(!1),e.abrupt("return");case 13:if(0!==t){e.next=17;break}return f(!1),H(d()(d()({},i),{},{showText:!0})),e.abrupt("return");case 17:setTimeout(c,1e3);case 18:case"end":return e.stop()}}),e)}))),u.apply(this,arguments)},c=function(){return u.apply(this,arguments)},l=ie(),a=re?null==o?void 0:o.time_limit:null===(n=i.getFieldsValue())||void 0===n?void 0:n.hack.time_limit,s=re?null==o||null===(t=o.answer_content)||void 0===t?void 0:t.length:null===(r=i.getFieldsValue())||void 0===r||null===(r=r.standard_answers)||void 0===r?void 0:r.length,f(!0),e.next=8,(0,D.bM)(ne.current,{test_hack_code:U,test_input:Q});case 8:c();case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),oe=function(){var e=S()(N()().mark((function e(){var n,t,r,l,a,s,c,u;return N()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o){e.next=25;break}return e.prev=1,e.next=4,i.validateFields();case 4:e.next=11;break;case 6:return e.prev=6,e.t0=e.catch(1),null!==e.t0&&void 0!==e.t0&&null!==(n=e.t0.errorFields)&&void 0!==n&&null!==(n=n[0])&&void 0!==n&&null!==(n=n.name)&&void 0!==n&&n.includes("standard_answers")?T.ZP.error("填空项答案不能为空"):T.ZP.error(e.t0.errorFields[0].errors[0]),i.scrollToField(e.t0.errorFields[0].name,{behavior:"smooth",block:"center"}),e.abrupt("return");case 11:if(_(!0),t="",r=i.getFieldsValue(),ee.current){e.next=22;break}return e.next=17,(0,O.ZP)("/api/problems.json",{method:"post",body:d()(d()({},r),{},{hack:d()(d()({},null==r?void 0:r.hack),{},{sub_discipline_id:null==r||null===(l=r.hack)||void 0===l||null===(l=l.sub_discipline_id)||void 0===l?void 0:l[1],difficult:r.difficulty,item_banks_group_id:r.item_banks_group_id}),hack_codes:d()(d()({},r.hack_codes),{},{code:B.Base64.encode(r.hack_codes.code)}),hack_sets:[d()({},r.hack_sets)],is_blank:!0})});case 17:t=e.sent,ee.current=null===(a=t)||void 0===a?void 0:a.identifier,sessionStorage.projectFill=null===(s=t)||void 0===s?void 0:s.identifier,e.next=25;break;case 22:return e.next=24,(0,O.ZP)("/api/problems/".concat(ee.current,".json"),{method:"put",body:d()(d()({},r),{},{hack:d()(d()({},null==r?void 0:r.hack),{},{sub_discipline_id:null==r||null===(c=r.hack)||void 0===c||null===(c=c.sub_discipline_id)||void 0===c?void 0:c[1],difficult:r.difficulty,item_banks_group_id:r.item_banks_group_id}),hack_codes:d()(d()({},r.hack_codes),{},{code:B.Base64.encode(r.hack_codes.code)}),update_hack_sets:[d()({},r.hack_sets)],is_blank:!0})});case 24:t=e.sent;case 25:return e.next=27,(0,O.ZP)("/api/problems/".concat(ee.current,"/start.json"),{method:"get"});case 27:if(0!==(null==(u=e.sent)?void 0:u.status)){e.next=34;break}return ne.current=null==u?void 0:u.identifier,te.current=!0,_(!1),le(),e.abrupt("return");case 34:_(!1);case 35:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(){return e.apply(this,arguments)}}();return(0,G.jsxs)("div",{children:[(0,G.jsx)(P.ZP,d()(d()({loading:y},n),{},{onClick:oe,children:t})),(0,G.jsx)(v.Z,{open:j,title:"调试代码",destroyOnClose:!0,width:1200,okText:"运行测试",confirmLoading:u,cancelButtonProps:{style:{display:"none"}},onOk:function(){return ae()},onCancel:function(){te.current=!1,k(!1)},children:(0,G.jsxs)("div",{className:A,children:[(0,G.jsxs)("div",{className:E,children:[(0,G.jsxs)("div",{className:"mb20",children:[(0,G.jsx)("span",{className:"c-black",children:"执行代码"}),!o&&(0,G.jsx)(R.CopyToClipboard,{text:U,onCopy:function(){return T.ZP.success("复制成功")},children:(0,G.jsxs)("span",{style:{float:"right"},className:"current c-light-primary",children:[(0,G.jsx)("i",{className:"iconfont icon-fuzhi8 mr5"}),"复制"]})})]}),(0,G.jsx)(F.Z,{height:510,className:"mb0",hidetoolBar:!0,defaultValue:U,onChange:function(e){return Y(e)}})]}),(0,G.jsxs)("div",{className:q,children:[(0,G.jsx)("div",{className:"c-black mb20",children:"自定义测试用例"}),(0,G.jsx)("div",{className:M,children:(0,G.jsx)("div",{className:L,children:(0,G.jsx)(h.Z.TextArea,{placeholder:"请输入",value:Q,onChange:function(e){return $(e.target.value)},bordered:!1,style:{height:180}})})}),(0,G.jsx)("div",{className:"c-black mb20 mt30",children:"代码执行结果"}),(0,G.jsx)("div",{className:M,children:(0,G.jsx)(I.Z,{spinning:u,tip:"代码执行中",children:(0,G.jsx)("div",{className:L,style:{height:196,overflow:"auto",padding:10},children:function(e){var n=e.status,t=e.error_msg,i=e.execute_time,r=e.output,l=e.input,a=e.expected_output,o=null;switch(n){case z.h.OK:o=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)("p",{children:["执行用时:",i/1e3,"秒"]}),(0,G.jsx)("p",{children:"执行结果:调试通过"})]});break;case z.h.NOMATCH:o=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)("div",{children:"输入:"}),(0,G.jsx)("pre",{style:{fontFamily:"initial"},children:l}),(0,G.jsx)("div",{children:"输出:"}),(0,G.jsx)("pre",{style:{fontFamily:"initial"},children:r&&B.Base64.decode(r)}),(0,G.jsx)("div",{children:"预期输出:"}),(0,G.jsx)("pre",{style:{fontFamily:"initial"},children:a&&B.Base64.decode(a)})]});break;case z.h.EXECUTEFAILURE:case z.h.COMPILEFAILURE:o=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)("p",{children:["最后执行的输入:",(0,G.jsx)("pre",{children:l})]}),(0,G.jsx)("p",{children:"执行出错信息:"}),(0,G.jsx)("pre",{className:"error",children:B.Base64.decode(t)})]});break;case z.h.PODFAILURE:o=(0,G.jsx)("p",{children:"创建pod失败,请稍后重试"});break;case z.h.TIMEOUT:o=(0,G.jsx)("p",{children:"评测超时,请稍后重试"})}return(0,G.jsxs)(G.Fragment,{children:[" ",o," "]})}(W)})})})]})]})})]})},H=t(88289),V=["key","name"],K=h.Z.TextArea,U=[{title:"C",key:"C"},{title:"C++",key:"C++"},{title:"Python",key:"Python"},{title:"Java",key:"Java"},{title:"JavaScript",key:"JavaScript"},{title:"Ruby",key:"Ruby"}],Y="@▁@",J="@▁▁@",X=function(e){var n=e.questionTitlePlaceholder,t=e.form,i=e.scoreByBlank,l=void 0!==i&&i,o=e.hackidentifier,c=e.answerKey,u=(0,m.useState)(!1),C=p()(u,2),N=C[0],Z=C[1],S=(0,m.useState)(!1),T=p()(S,2),P=(T[0],T[1],(0,j.useParams)().type,function(e,n){for(var t=n.line,i=0,r=0;r0){var a=P(e,n.from);console.log("新增".concat(l,"个,之前有").concat(a,"个")),t(l,a)}}else{var o=r.split(Y).length-1+r.split(J).length-1,s=P(e,n.from);console.log("删除".concat(o,"个, 前面有").concat(s,"个,新增").concat(l,"个")),i(o>1?Array.from({length:o},(function(e,n){return s+n})):s)}}(e,n,A,q)}})})}),(0,G.jsx)(f.Z.List,{name:c,rules:[{validator:function(e,n){if(null==n||!n.length)return Promise.reject(new Error("答案不能为空"));var t,i=a()(n);try{for(i.s();!(t=i.n()).done;){var r=(t.value||{}).answer_text;if(0===(null==r?void 0:r.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,a=n.remove;t.errors;return B.current=i,E.current=a,(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,G.jsx)(f.Z.Item,{label:"填空项答案",required:!0,labelCol:{span:24}}),(0,G.jsxs)("div",{onClick:function(){v.Z.warning({title:"给分说明",icon:null,width:700,centered:!0,content:(0,G.jsxs)("div",{children:[(0,G.jsxs)("div",{children:["1.学生填写答案之后,必须提交代码",(0,G.jsx)("span",{style:{color:"#e30000"},children:"进行评测"}),"才能得分。"]}),(0,G.jsx)("div",{style:{marginTop:10},children:"2.试题算分时,系统会将程序里面的所有空替换成学生的答案进行评测。输出的结果与测试集比对,完全正确则得满分;若不完全正确,则依次将每个空换成学生提交的答案,同时将其他空替换成标准答案,运行程序。如果这个空的学生答案与标准答案结合能得到正确输出,则这个空得到该空的满分,否则该空得0分。"})]})})},style:{minHeight:32,color:"#3061D0",cursor:"pointer"},children:[(0,G.jsx)(H.Z,{style:{marginRight:3,color:"#3061D0"}}),(0,G.jsx)("span",{children:" 给分说明"})]})]}),e.map((function(e,n){var t,i,a=e.key,o=e.name,s=r()(e,V);return(0,G.jsxs)(x.Z,{className:"mb20",align:"middle",wrap:!1,children:[(0,G.jsxs)(g.Z,{flex:"0 0 auto",className:"".concat(k.Z.blankIndex),children:["填空项",n+1]}),(0,G.jsx)(g.Z,{flex:1,children:(0,G.jsxs)(x.Z,{align:"top",justify:"space-between",wrap:!1,children:[(0,G.jsx)(g.Z,{children:(0,G.jsx)(f.Z.Item,d()(d()({},s),{},{name:[o,"answer_text"],noStyle:!0,children:null!=M&&null!==(t=M[o])&&void 0!==t&&t.multi_line||null!=M&&null!==(i=M[o])&&void 0!==i&&i.multiLine?(0,G.jsx)(K,{spellCheck:!1,style:{marginLeft:10,width:550}}):(0,G.jsx)(h.Z,{style:{marginLeft:10,width:550},className:k.Z.blankInput,size:"large",maxLength:1e3,onBlur:function(e){}})}))}),l&&(0,G.jsx)(g.Z,{flex:"224px",children:(0,G.jsx)(f.Z.Item,d()(d()({},s),{},{name:[o,"score"],label:"分值",rules:[{required:!0}],children:(0,G.jsx)(y.Z,{size:"large",className:k.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"请输入分值"})}))})]})})]},a)}))]})}}),(0,G.jsx)("div",{onClick:function(){return Z(!0)},children:(0,G.jsx)(f.Z.Item,{name:["hack","analysis"],label:"题目解析",labelCol:{span:24},children:(0,G.jsx)(b.x,{placeholder:"请编辑题目解析(非必填)",isEdit:N})})}),(0,G.jsx)(f.Z.Item,{label:"编程语言",style:{marginTop:30},name:["hack_codes","language"],labelCol:{span:24},rules:[{required:!0,message:"请选择编程语言"}],children:(0,G.jsx)(_.default,{size:"large",children:U.map((function(e){return(0,G.jsxs)(_.default.Option,{value:e.key,children:[" ",e.title]},e.title)}))})}),(0,G.jsxs)(f.Z.Item,{label:"最大评测时长(秒)",style:{marginTop:30},labelCol:{span:24},required:!0,children:[(0,G.jsx)(f.Z.Item,{name:["hack","time_limit"],rules:[{required:!0,message:"请输入单个测试集评测时长限制"},{type:"number",min:3,message:"最小限制时间是3秒"}],noStyle:!0,children:(0,G.jsx)(y.Z,{precision:0,max:10,min:3,size:"large",style:{width:"97%"}})}),(0,G.jsx)("span",{className:"ml10 font14",children:"秒"})]}),(0,G.jsx)(f.Z.Item,{label:"学生答案的空格处理方式",style:{marginTop:30},name:["hack","submit_rule"],labelCol:{span:24},rules:[{required:!0,message:"请选择学生答案的空格处理方式"}],children:(0,G.jsxs)(w.ZP.Group,{style:{marginTop:-10},children:[(0,G.jsx)(w.ZP,{value:0,children:"不忽略空格"}),(0,G.jsx)(w.ZP,{value:1,children:"忽略首尾空格"}),(0,G.jsx)(w.ZP,{value:2,children:"忽略所有空格"})]})}),(0,G.jsx)(f.Z.Item,{label:"测试用例",required:!0,style:{marginTop:30}}),(0,G.jsxs)("div",{style:{background:"#F6F7F9",padding:15},children:[(0,G.jsx)(f.Z.Item,{label:"输入",labelCol:{span:24},name:["hack_sets","input"],children:(0,G.jsx)(K,{rows:4})}),(0,G.jsx)(f.Z.Item,{label:"输出",labelCol:{span:24},name:["hack_sets","output"],rules:[{required:!0,message:"请输入输出内容"}],children:(0,G.jsx)(K,{rows:4})})]}),(0,G.jsx)(W,{form:t,answerKey:c,hackIdentifier:o,buttonText:"运行调试",buttonProps:{ghost:!0,icon:(0,G.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"}}})]})}},5309:function(e,n,t){"use strict";t.d(n,{u:function(){return k}});var i=t(39647),r=t.n(i),l=t(79800),a=t.n(l),o=t(85573),s=t.n(o),c=t(82242),d=t.n(c),u=t(59301),p=t(95237),m=t(43604),h=t(6848),f=t(78241),v=t(5547),x=t(57703),g=t(78091),y=t(36017),_=t(37712),w=["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"],j=function(e){var n=e.value,t=e.onChange,i=e.choiceTextKey,r=e.answerKey,l=e.index,a=e.isEdit,o=e.setInputActive,c=e.form,u=e.choiceOptionsPath,f=e.allowChangeMode,w=e.showAddIcon,j=e.addItem,k=e.deleteItem;console.log(n,"value");var C=1===(null==n?void 0:n[r]),N=function(){var e;C?t(d()(d()({},n),{},s()({},r,0))):(f||(e=c.getFieldValue(u),c.setFieldValue(u,e.map((function(e){return d()(d()({},e),{},s()({},r,0))})))),t(d()(d()({},n),{},s()({},r,1))))};return(0,_.jsxs)(p.Z,{className:v.Z.choiceWrap,align:"middle",wrap:!1,children:[(0,_.jsx)(m.Z,{onClick:N,className:"".concat(v.Z.choiceIndex," ").concat(C?v.Z.activeAnswer:""),children:b[l]}),(0,_.jsx)(m.Z,{flex:1,className:"".concat(v.Z.editorWrap," ml15"),onClick:o,children:(0,_.jsx)(y.x,{height:155,placeholder:"请您输入选项",isEdit:a,value:null==n?void 0:n[i],onChange:function(e){t(d()(d()({},n),{},s()({},i,e)))}})}),(0,_.jsx)(m.Z,{flex:"0 0 auto",className:"ml15",children:(0,_.jsx)("div",{onClick:N,className:"".concat(v.Z.setAnswerBtn," ").concat(C?v.Z.activeAnswer:""),children:C?"正确答案":"设为答案"})}),(0,_.jsxs)(m.Z,{className:v.Z.actionWrapper,children:[(0,_.jsx)(h.Z,{title:"新增参考答案",children:(0,_.jsx)(x.Z,{className:v.Z.addIcon,onClick:j,style:{visibility:w?"visible":"hidden"}})}),(0,_.jsx)(h.Z,{title:"删除",children:(0,_.jsx)(g.Z,{className:v.Z.deleteIcon,onClick:k,style:{visibility:l>1?"visible":"hidden"}})})]})]})},k=function(e){var n=e.questionTitlePlaceholder,t=e.titleKey,i=e.choiceKey,l=e.analysisKey,o=e.choiceTextKey,c=e.answerKey,p=e.choiceOptionsPath,m=e.allowChangeMode,h=void 0===m||m,x=e.form,g=e.showAnalysis,k=void 0===g||g,C=(0,u.useState)(),N=a()(C,2),Z=N[0],S=N[1],T=(0,u.useState)(!1),P=a()(T,2),I=P[0],B=P[1];return(0,_.jsxs)("div",{className:v.Z.wrap,children:[(0,_.jsx)("div",{className:v.Z.questionTitleEditorWrap,children:(0,_.jsx)(f.Z.Item,{label:"题干",name:t,labelCol:{span:24},rules:[{required:!0}],children:(0,_.jsx)(y.h,{scrollId:Array.isArray(t)?t.join("_"):"".concat(t),watch:!0,height:140,placeholder:n})})}),(0,_.jsx)(f.Z.Item,{label:"答案选项",required:!0,labelCol:{span:24}}),(0,_.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[o])||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,_.jsxs)("div",{id:Array.isArray(p)?p.join("_"):"".concat(p),children:[e.map((function(n,l){var a=n.key,m=n.name,g=r()(n,w),y=Z===a,k=l<7&&l===e.length-1;return(0,u.createElement)(f.Z.Item,d()(d()({},g),{},{key:a,name:m,className:v.Z.choiceListWrap,rules:[{validator:function(e,n){return null!=n&&n.choice_text?Promise.resolve():Promise.reject(new Error("请先输入".concat(b[l],"选项的内容")))}}]}),(0,_.jsx)(j,{choiceTextKey:o,answerKey:c,index:l,isEdit:y,setInputActive:function(){S(a)},form:x,choiceOptionsPath:p,allowChangeMode:h,showAddIcon:k,addItem:function(){return t(s()(s()({},o,""),c,0))},deleteItem:function(){return i(m)}}))})),e.length<8&&(0,_.jsx)("div",{className:"".concat(v.Z.addBtn," mb30"),onClick:function(){return t(s()(s()({},o,""),c,0))},children:"添加选项"})]})}}),k&&(0,_.jsx)("div",{onClick:function(){return B(!0)},children:(0,_.jsx)(f.Z.Item,{name:l,label:"题目解析",labelCol:{span:24},children:(0,_.jsx)(y.x,{placeholder:"请编辑题目解析(非必填)",isEdit:I})})})]})}},56763:function(e,n,t){"use strict";t.d(n,{u:function(){return M}});var i=t(39647),r=t.n(i),l=t(91232),a=t.n(l),o=t(85573),s=t.n(o),c=t(82242),d=t.n(c),u=t(79800),p=t.n(u),m=t(37205),h=t.n(m),f=t(59301),v=t(43418),x=t(95237),g=t(43604),y=t(98135),_=t(6848),w=t(78673),b=t(78241),j=t(5112),k=t(54449),C=t(36017),N=t(78091),Z=t(85699),S=t(5547),T=t(30347),P=t(37712),I=["key","name"],B=function(e){var n=e.value,t=e.onChange;return(0,P.jsxs)(x.Z,{className:"ml20",children:[(0,P.jsx)(g.Z,{flex:1,children:null==n?void 0:n.map((function(e,i){return(0,P.jsxs)(x.Z,{className:"mb20",children:[(0,P.jsx)(y.Z.TextArea,{style:{flex:1,minHeight:44},defaultValue:e,autoSize:{maxRows:3},maxLength:1e3,onBlur:function(e){var r=h()(n),l=e.target.value.trim();r[i]=l,t(r)}}),(0,P.jsx)(_.Z,{title:"删除",children:(0,P.jsx)(N.Z,{className:S.Z.deleteIcon,style:{marginLeft:15,visibility:i>0?"visible":"hidden"},onClick:function(){return function(e){v.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确认要删除这个参考答案吗?",className:S.Z.modal,onOk:function(){var i=h()(n);i.splice(e,1),t(i)}})}(i)}})})]},"".concat(e,"_").concat(i))}))}),(0,P.jsx)(g.Z,{children:(0,P.jsx)("div",{className:"".concat(S.Z.addBtn),onClick:function(){var e;(e=h()(n)).push(""),t(e)},children:"新增答案"})})]})},A=function(e){var n=e.value,t=e.onChange;return(0,P.jsxs)(x.Z,{className:"ml20",children:[(0,P.jsx)(g.Z,{flex:1,children:null==n?void 0:n.map((function(e,i){return(0,P.jsxs)(x.Z,{align:"middle",className:"mb20",children:[(0,P.jsx)(T.Z,{value:e,style:{flex:1},onChange:function(e){var r=h()(n);r[i]=e,t(r)}}),(0,P.jsx)(_.Z,{title:"删除",children:(0,P.jsx)(N.Z,{className:S.Z.deleteIcon,style:{marginLeft:15,visibility:i>0?"visible":"hidden"},onClick:function(){return function(e){v.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确认要删除这个参考答案吗?",className:S.Z.modal,onOk:function(){var i=h()(n);i.splice(e,1),t(i)}})}(i)}})})]},"".concat(e,"_").concat(i))}))}),(0,P.jsx)(g.Z,{children:(0,P.jsx)("div",{className:"".concat(S.Z.addBtn),onClick:function(){var e;(e=h()(n)).push(""),t(e)},children:"新增答案"})})]})},E=function(e){var n=e.value,t=void 0===n||n,i=e.onChange;return(0,P.jsx)(w.Z,{checked:!t,onChange:function(e){i(!e)}})},q="▁",M=function(e){var n=e.questionTitlePlaceholder,t=e.form,i=e.scoreByBlank,l=void 0!==i&&i,o=e.answerKey,c=(0,f.useState)(!1),u=p()(c,2),m=u[0],h=u[1],v=function(e,n){for(var t=n.line,i=0,r=0;r1?Array.from({length:a},(function(e,n){return o+n})):o)}else if(l>0){var s=v(e,n.from);console.log("新增".concat(l,"个,之前有").concat(s,"个")),t(l,s)}}(e,n,M,O)}})})}),(0,P.jsx)(b.Z.List,{name:o,rules:[{validator:function(e,n){if(null==n||!n.length)return Promise.reject(new Error("请先在题干中插入填空项"));var t,i=a()(n);try{for(i.s();!(t=i.n()).done;){var r=(t.value||{}).answer_text;if(null!=r&&r.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,i){var a=n.add,c=n.remove;i.errors;return T.current=a,L.current=c,(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(b.Z.Item,{label:(0,P.jsxs)("span",{children:["填空项答案",!(null!=e&&e.length)&&(0,P.jsx)("span",{style:{color:"#E99237"},children:"(请先在题干中插入填空项)"})]}),required:!0,labelCol:{span:24}}),e.map((function(e,n){var i,a=e.key,c=e.name,u=r()(e,I);return(0,P.jsxs)("div",{style:{marginBottom:10},children:[(0,P.jsxs)(x.Z,{className:"mb20",align:"middle",wrap:!1,children:[(0,P.jsxs)(g.Z,{style:{marginRight:10},flex:"0 0 auto",className:"".concat(S.Z.blankIndex),children:["填空项",n+1]}),(0,P.jsx)(b.Z.Item,d()(d()({},u),{},{name:[c,"model"],noStyle:!0,children:(0,P.jsxs)(j.ZP.Group,{onChange:function(){var e=t.getFieldValue(o);t.setFieldsValue(s()({},o,e.map((function(e,n){return d()(d()({},e),{},{answer_text:c===n?[""]:e.answer_text})}))))},children:[(0,P.jsxs)(j.ZP,{value:1,children:["文本模式 ",(0,P.jsx)(_.Z,{title:"学生答题时,需要在文本框中填写文本答案",children:(0,P.jsx)(Z.Z,{})})]}),(0,P.jsxs)(j.ZP,{value:2,children:["数学公式模式 ",(0,P.jsx)(_.Z,{title:"学生答题时,需要编写数学公式作为答案",children:(0,P.jsx)(Z.Z,{})})]})]})}))]}),(0,P.jsx)(x.Z,{style:{marginLeft:20},align:"middle",wrap:!1,children:(0,P.jsxs)(g.Z,{flex:1,children:[(0,P.jsxs)(x.Z,{align:"top",justify:"space-between",wrap:!1,children:[(0,P.jsx)(g.Z,{flex:1,children:(0,P.jsx)(b.Z.Item,d()(d()({},u),{},{name:[c,"answer_text"],noStyle:!0,children:1===(null===(i=t.getFieldValue(o))||void 0===i||null===(i=i[c])||void 0===i?void 0:i.model)?(0,P.jsx)(B,{}):(0,P.jsx)(A,{})}))}),l&&(0,P.jsx)(g.Z,{flex:"224px",style:{margin:"-7px 0 0 20px"},children:(0,P.jsx)(b.Z.Item,d()(d()({},u),{},{name:[c,"score"],label:"分值",rules:[{required:!0}],className:S.Z.blankInputNumberWrapper,children:(0,P.jsx)(k.Z,{min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"请输入分值"})}))})]}),(0,P.jsx)(b.Z.Item,d()(d()({},u),{},{name:[c,"position"],noStyle:!0,children:(0,P.jsx)(y.Z,{type:"hidden"})}))]})})]},a)}))]})}}),(0,P.jsxs)(x.Z,{align:"middle",children:[(0,P.jsx)(b.Z.Item,{name:"downcase",valuePropName:"checked",children:(0,P.jsx)(w.Z,{})}),(0,P.jsx)(g.Z,{className:"ml10",children:"判分时忽略答案中的字母大小写"})]}),(0,P.jsxs)(x.Z,{align:"middle",children:[(0,P.jsx)(b.Z.Item,{name:"no_space",valuePropName:"checked",children:(0,P.jsx)(w.Z,{})}),(0,P.jsx)(g.Z,{className:"ml10",children:"判分时忽略答案中的空格"})]}),(null==D?void 0:D.length)>1&&(0,P.jsxs)(x.Z,{align:"middle",className:(null==D?void 0:D.length)>1?"mb30":"".concat(S.Z.hide),children:[(0,P.jsx)(b.Z.Item,{name:"is_ordered",children:(0,P.jsx)(E,{})}),(0,P.jsx)(g.Z,{className:"ml10",children:"允许学生每个填空的答案与标准答案的顺序不一致"})]}),(0,P.jsx)("div",{onClick:function(){return h(!0)},children:(0,P.jsx)(b.Z.Item,{name:"analysis",label:"题目解析",labelCol:{span:24},children:(0,P.jsx)(C.x,{placeholder:"请编辑题目解析(非必填)",isEdit:m})})})]})}},99041:function(e,n,t){"use strict";t.d(n,{Z:function(){return w}});var i=t(39647),r=t.n(i),l=t(79800),a=t.n(l),o=t(82242),s=t.n(o),c=t(85573),d=t.n(c),u=t(59301),p=t(95237),m=t(43604),h=t(78241),f=t(5547),v=t(36017),x=t(37712),g=["key","name"],y=d()(d()({},"正确","T"),"错误","F"),_=function(e){var n=e.value,t=e.onChange,i=e.form,r=1===(null==n?void 0:n.is_answer),l=null==n?void 0:n.choice_text,a=function(){var e=i.getFieldsValue().choices.map((function(e){return{choice_text:e.choice_text,is_answer:0}}));i.setFieldsValue({choices:e}),t(s()(s()({},n),{},{is_answer:1}))};return(0,x.jsxs)(p.Z,{className:f.Z.choiceWrap,align:"middle",wrap:!1,style:{marginBottom:"20px"},children:[(0,x.jsx)(m.Z,{onClick:a,className:"".concat(f.Z.choiceIndex," ").concat(f.Z.judgementIndex," ").concat(r?f.Z.activeAnswer:""),children:y[l]}),(0,x.jsx)(m.Z,{flex:1,className:"".concat(f.Z.editorWrap," ml15"),children:(0,x.jsx)("div",{className:"".concat(f.Z.inputBorder," ").concat(f.Z.placeholder," ").concat(r?f.Z.activeJudgementAnswer:""),children:l})}),(0,x.jsx)(m.Z,{flex:"0 0 auto",className:"ml15",children:(0,x.jsx)("div",{onClick:a,className:"".concat(f.Z.setAnswerBtn," ").concat(r?f.Z.activeAnswer:""),children:r?"正确答案":"设为答案"})})]})},w=function(e){var n=e.questionTitlePlaceholder,t=(e.choiceKey,e.form),i=(0,u.useState)(!1),l=a()(i,2),o=l[0],c=l[1];return(0,x.jsxs)("div",{className:f.Z.wrap,children:[(0,x.jsx)("div",{className:f.Z.questionTitleEditorWrap,children:(0,x.jsx)(h.Z.Item,{label:"题干",name:"name",labelCol:{span:24},rules:[{required:!0}],children:(0,x.jsx)(v.h,{scrollId:"name",watch:!0,height:140,placeholder:n})})}),(0,x.jsx)(h.Z.Item,{label:"答案选项",required:!0,labelCol:{span:24},children:(0,x.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,x.jsx)("div",{id:"choices",children:e.map((function(e){var n=e.key,i=e.name,l=r()(e,g);return(0,u.createElement)(h.Z.Item,s()(s()({},l),{},{key:n,name:i,noStyle:!0}),(0,x.jsx)(_,{form:t}))}))})}})}),(0,x.jsx)("div",{onClick:function(){return c(!0)},children:(0,x.jsx)(h.Z.Item,{name:"analysis",label:"题目解析",labelCol:{span:24},children:(0,x.jsx)(v.x,{placeholder:"请编辑题目解析(非必填)",isEdit:o})})})]})}},36017:function(e,n,t){"use strict";t.d(n,{h:function(){return p},x:function(){return m}});var i=t(82242),r=t.n(i),l=t(39647),a=t.n(l),o=t(11094),s=t(5547),c=t(42783),d=t(37712),u=["value","onChange","scrollId"],p=function(e){var n=e.value,t=e.onChange,i=e.scrollId,l=a()(e,u);return(0,d.jsx)("div",{id:i||"",children:(0,d.jsx)(o.Z,r()(r()({},l),{},{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,r=e.height,l=void 0===r?140:r;return e.isEdit?(0,d.jsx)(o.Z,{watch:!0,isFocus:!0,height:l,placeholder:i,defaultValue:n,onChange:t}):(0,d.jsx)("div",{style:{cursor:"pointer"},children:n?(0,d.jsx)(c.Z,{className:s.Z.inputBorder,value:n}):(0,d.jsx)("div",{className:"".concat(s.Z.inputBorder," ").concat(s.Z.placeholder," inputBorderError"),children:i})})}},42230:function(e,n,t){"use strict";t.d(n,{W:function(){return P}});var i=t(91232),r=t.n(i),l=t(79800),a=t.n(l),o=t(82242),s=t.n(o),c=t(39647),d=t.n(c),u=t(59301),p=t(8591),m=t(12563),h=t(78241),f=t(78673),v=t(95237),x=t(43604),g=t(6848),y=t(98135),_=t(54449),w=t(5547),b=t(36017),j=t(11094),k=t(85699),C=t(37712),N=["value","onChange"],Z=["key","name"],S=function(e){var n=e.value,t=e.onChange,i=d()(e,N);return(0,C.jsx)(j.Z,s()(s()({},i),{},{defaultValue:null==n?void 0:n[0],onChange:function(e){t([e])}}))},T=function(e){var n=e.value,t=void 0===n?[]:n,i=e.onClose;return(0,C.jsx)(m.Z,{closable:!0,onClose:i,className:w.Z.keywordTag,children:(0,C.jsx)("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"},children:t.join(" 或 ")})})},P=function(e){var n=e.questionTitlePlaceholder,t=e.form,i=e.showKeywords,l=e.isMustKeyWords,o=void 0===l?i:l,c=(0,u.useState)(!1),m=a()(c,2),j=m[0],N=m[1],P=(0,u.useState)(""),I=a()(P,2),B=I[0],A=I[1],E=h.Z.useWatch("use_keywords",t),q=h.Z.useWatch("question_score",t);return(0,C.jsxs)("div",{className:w.Z.wrap,children:[(0,C.jsx)("div",{className:w.Z.questionTitleEditorWrap,children:(0,C.jsx)(h.Z.Item,{label:"题干",name:"name",labelCol:{span:24},rules:[{required:!0}],children:(0,C.jsx)(b.h,{scrollId:"name",watch:!0,height:140,placeholder:n})})}),(0,C.jsx)(h.Z.Item,{label:"参考答案",name:"answer_texts",labelCol:{span:24},children:(0,C.jsx)(S,{watch:!0,height:140,placeholder:"请编辑参考答案(非必填)"})}),i&&!o&&(0,C.jsx)(h.Z.Item,{hidden:!0,name:"use_keywords",valuePropName:"checked",children:(0,C.jsx)(f.Z,{defaultChecked:!0})}),i&&o&&(0,C.jsxs)(v.Z,{align:"middle",className:"mb30",children:[(0,C.jsx)(h.Z.Item,{name:"use_keywords",valuePropName:"checked",children:(0,C.jsx)(f.Z,{})}),(0,C.jsx)(x.Z,{className:"ml10",children:"开启关键词自动判分"}),(0,C.jsx)(x.Z,{children:(0,C.jsx)(g.Z,{placement:"right",title:"选中后,需要设置每个关键词的分值,系统会根据设置的关键词进行自动判分; 所有关键词分值之和必须小于等于小题分值。",children:(0,C.jsx)(k.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})})})]}),(E||!o)&&(0,C.jsx)(h.Z.List,{name:"keywords",rules:[{validator:function(e,n){return o?null!=n&&n.length?(null==n?void 0:n.reduce((function(e,n){return e+n.score}),0))>parseFloat(q)?Promise.reject(new Error("所有关键词的分值之和必须小于等于该小题的分值")):Promise.resolve():Promise.reject(new Error("请输入关键词")):Promise.resolve()}}],children:function(e,n){var i=n.add,l=n.remove;return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("div",{className:"".concat(w.Z.title," mb10"),children:o?"关键词":(0,C.jsx)("span",{style:{color:"#9096A3"},children:"判分关键词"})}),(0,C.jsxs)(v.Z,{align:"middle",className:"font14 mb30",children:[(0,C.jsx)(x.Z,{flex:1,children:(0,C.jsx)(y.Z,{value:B,onChange:function(e){A(e.target.value)},maxLength:50,allowClear:!0,onPressEnter:function(e){var n,l,a,o,s="".concat(null===(n=e.target)||void 0===n?void 0:n.value),c=null==s||null===(l=s.split("|"))||void 0===l||null===(l=l.filter((function(e){return!!e})))||void 0===l?void 0:l.map((function(e){return null==e?void 0:e.trim()})),d=t.getFieldValue("keywords"),u=(null==d||null===(a=d.map((function(e){return null==e?void 0:e.keyword})))||void 0===a?void 0:a.flat())||[],m=r()(c);try{for(m.s();!(o=m.n()).done;){var h=o.value;if(u.includes(h))return void p.ZP.error("为避免判分错误,请勿设置相同的关键词")}}catch(e){m.e(e)}finally{m.f()}(function(e){if(!e)return!1;if(!/^s*$/.test(e)&&""!==e.trim())return new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~!@#¥……&*()—【】‘;:”“。,、?「」『』_\\+\\-·%《》]|[\\\\/]"),"|"!==e||(p.ZP.warning("关键词不能只输入一个“|”字符!"),!1);p.ZP.warning("关键词不能全为空格")})(s)&&(i({keyword:c,score:1}),A(""))},className:w.Z.inputBorder,placeholder:"支持设置多个关键词;并列关键词(或的关系)请用“|”分隔开"})}),(0,C.jsx)(x.Z,{flex:"148px",style:{textAlign:"right",color:"#9096A3"},children:"“回车键”保存关键词"})]}),e.map((function(e){var n=e.key,t=e.name,i=d()(e,Z);return(0,C.jsx)(v.Z,{className:"mb20",style:{marginRight:148},children:(0,C.jsx)(x.Z,{flex:1,children:(0,C.jsxs)(v.Z,{align:"middle",justify:"space-between",children:[(0,C.jsx)(h.Z.Item,s()(s()({},i),{},{name:[t,"keyword"],children:(0,C.jsx)(T,{onClose:function(){return l(t)}})})),o&&(0,C.jsx)(h.Z.Item,s()(s()({},i),{},{name:[t,"score"],label:"分值",rules:[{required:!0}],className:w.Z.blankInputNumberWrapper,children:(0,C.jsx)(_.Z,{className:w.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"请输入关键词分数"})}))]})})},n)}))]})}}),(0,C.jsx)("div",{onClick:function(){return N(!0)},children:(0,C.jsx)(h.Z.Item,{name:"analysis",label:"题目解析",labelCol:{span:24},children:(0,C.jsx)(b.x,{placeholder:"请编辑题目解析(非必填)",isEdit:j})})})]})}},95166:function(e,n,t){"use strict";t.d(n,{Z:function(){return o}});var i="text___bQulM",r="sup___rX_Y3",l=t(78241),a=t(37712),o=function(e){var n=e.text,t=e.name,o=void 0===t?"question_score":t,s=function(e){var t=e.value;return(0,a.jsxs)("div",{className:i,children:[(0,a.jsx)("span",{className:r,children:"*"}),(0,a.jsx)("span",{className:"mr10",children:"分值"}),(0,a.jsx)("span",{children:t||"--"}),(0,a.jsx)("span",{className:"c-grey-999",children:n})]})};return(0,a.jsx)(l.Z.Item,{noStyle:!0,name:o,children:(0,a.jsx)(s,{})})}},37507:function(e,n,t){"use strict";t.d(n,{h:function(){return x}});var i=t(82242),r=t.n(i),l=t(79800),a=t.n(l),o=t(59301),s=t(57809),c=t(78241),d=t(3113),u=t(89780),p=t.n(u),m=(t(81974),t(3693),t(37712)),h=s.default.Option,f={labelCol:{span:4},wrapperCol:{span:20}},v={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 x(e){var n=e.value,t=e.onChange,i=e.mode,l=e.options,s=void 0===l?{}:l,c=(0,o.useRef)(),d=(0,o.useState)(),u=a()(d,2),h=u[0],f=u[1];return(0,o.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,o.useEffect)((function(){h&&h.setOption("mode",i)}),[h,i]),(0,o.useEffect)((function(){h&&(n===h.getValue()&&""!==n||setTimeout((function(){h.setValue(n||"")}),300))}),[h,n]),(0,o.useEffect)((function(){if(c.current&&!h){var e=p().fromTextArea(c.current,r()({mode:i,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},s));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,o.useState)("python"),l=a()(i,2),u=l[0],p=l[1];return(0,m.jsxs)(c.Z,r()(r()({},f),{},{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(e){n(e)},style:{width:500},children:[(0,m.jsx)(c.Z.Item,{label:"代码语言",name:"language",children:(0,m.jsx)(s.default,{getPopupContainer:function(e){return e.parentNode},onChange:function(e){p(v[e][1])},children:Object.keys(v).map((function(e){return(0,m.jsx)(h,{value:e,children:v[e][0]},e)}))})}),(0,m.jsx)(c.Z.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}],children:(0,m.jsx)(x,{mode:u})}),(0,m.jsxs)("div",{className:"flex-container flex-end",children:[(0,m.jsx)(d.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,m.jsx)(d.ZP,{type:"ghost",onClick:t,children:"取消"})]})]}))}},11094:function(e,n,t){"use strict";t.d(n,{Z:function(){return Ze}});var i=t(91232),r=t.n(i),l=t(79800),a=t.n(l),o=t(85573),s=t.n(o),c=t(59301),d=t(89780),u=t.n(d),p=t(76374),m=(t(81974),t(6313),t(25717),t(99498),t(25419),t(67549),t(42783)),h=t(37712),f=function(e){var n=e.value,t=void 0===n?"":n,i=(e.className,e.showTextOnly,e.showLines,e.style,(0,c.useMemo)((function(){return""}),[t]));return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)("div",{dangerouslySetInnerHTML:{__html:i}})})},v=t(82242),x=t.n(v),g=[{title:"粗体",icon:"md-iconfont icon-bold",actionName:"bold"},{title:"斜体",icon:"md-iconfont icon-italic",actionName:"italic"},"|",{title:"无序列表",icon:"md-iconfont icon-unorder-list",actionName:"list-ul"},{title:"有序列表",icon:"md-iconfont icon-order-list",actionName:"list-ol"},"|",{title:"行内代码",icon:"md-iconfont icon-code",actionName:"code"},{title:"代码块(多语言风格)",icon:"md-iconfont icon-file-code",actionName:"code-block"},{title:"链接",icon:"md-iconfont icon-link",actionName:"link"},"|",{title:"行内公式",icon:"md-iconfont icon-sum",actionName:"inline-latex"},{title:"数学图像",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"多行公式",icon:"iconfont icon-jisuan1",actionName:"latex"},"|",{title:"添加图片",icon:"md-iconfont icon-picture",actionName:"upload-image"},{title:"插入画图",icon:"iconfont icon-sheji",actionName:"draw-image"},{title:"插入流程图",icon:"iconfont icon-liucheng",actionName:"add-flowchart"},{title:"表格",icon:"md-iconfont icon-table",actionName:"add-table"},"|",{title:"换行",icon:"md-iconfont icon-minus",actionName:"line-break"},{title:"清空",icon:"md-iconfont icon-eraser",actionName:"eraser"}];function y(e){var n=e.onActionCallback,t=e.title,i=e.icon,r=e.actionName,l=e.className,a=void 0===l?"":l,o=e.children;return(0,h.jsxs)("a",{title:t,className:a,onClick:function(){n(r)},children:[(0,h.jsx)("i",{className:"".concat(i)}),o]})}var _=function(e){var n=e.watch,t=e.showNullButton,i=e.showNullProgramButton,r=e.onActionCallback,l=e.fullScreen,a=e.insertTemp,o=e.hidetoolBar,s=e.extraUse,c=[].concat(g,[{title:"".concat(n?"关闭实时预览":"开启实时预览"),icon:"".concat(n?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"),actionName:"trigger-watch"}]);return(0,h.jsxs)("ul",{className:"markdown-toolbar-container",children:[!o&&c.map((function(e,n){return(0,h.jsx)("li",{children:e.actionName?(0,h.jsx)(y,x()(x()({},e),{},{onActionCallback:r})):(0,h.jsx)("span",{className:"v-line"})},n)})),t?(0,h.jsx)("li",{children:(0,h.jsx)(y,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-null-ch",onActionCallback:r,children:(0,h.jsx)("span",{className:"fill-tip",children:"点击插入\b填空项"})})}):null,i?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("li",{children:(0,h.jsx)(y,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-signal",onActionCallback:r,children:(0,h.jsx)("span",{className:"fill-tip",children:"+单行填空项"})})}),(0,h.jsx)("li",{children:(0,h.jsx)(y,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"增加填空",actionName:"add-multiple",onActionCallback:r,children:(0,h.jsx)("span",{className:"fill-tip",children:"+多行填空项"})})})]}):null,a&&(0,h.jsx)("li",{children:(0,h.jsx)(y,{icon:"md-iconfont icon-edit",className:"btn-null",title:"插入模板",actionName:"inster-template-".concat(a),onActionCallback:r,children:(0,h.jsx)("span",{className:"fill-tip",children:"插入模板"})})}),s&&(0,h.jsx)("li",{children:s}),(0,h.jsx)("li",{className:"btn-full-screen",children:(0,h.jsx)(y,{icon:"".concat(l?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"),title:l?"关闭全屏":"开启全屏",actionName:"trigger-full-screen",onActionCallback:r})})]})},w=t(27308),b=t(78241),j=t(98135),k=t(3113),C={labelCol:{span:4},wrapperCol:{span:20}},N=function(e){var n=e.callback,t=e.onCancel;return(0,h.jsxs)(b.Z,x()(x()({},C),{},{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:function(e){n(e)},style:{width:500},children:[(0,h.jsx)(b.Z.Item,{label:"链接地址",name:"link",rules:[{required:!0,message:"请输入链接地址"}],children:(0,h.jsx)(j.Z,{})}),(0,h.jsx)(b.Z.Item,{label:"链接标题",name:"title",rules:[{required:!0,message:"请输入链接标题"}],children:(0,h.jsx)(j.Z,{})}),(0,h.jsxs)("div",{className:"flex-container flex-end",children:[(0,h.jsx)(k.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,h.jsx)(k.ZP,{type:"ghost",onClick:t,children:"取消"})]})]}))},Z=t(37507),S=t(8591),T=t(55087),P=b.Z.useForm,I={width:280,marginRight:10},B={labelCol:{span:5},wrapperCol:{span:19}},A=function(e){var n=e.callback,t=e.onCancel,i=P(),r=a()(i,1)[0],l=(0,c.useRef)();function o(e,n){-1!==e.status?r.setFieldsValue({src:"/api/attachments/".concat(e.id),type:n.type}):S.ZP.error(e.message)}return(0,h.jsxs)(b.Z,x()(x()({form:r},B),{},{className:"upload-image-panel",onFinish:function(e){n(e,l.current)},style:{width:470,overflow:"hidden"},children:[(0,h.jsx)(b.Z.Item,{label:"图片地址",required:!0,children:(0,h.jsxs)("div",{className:"flex-container",children:[(0,h.jsx)(b.Z.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入图片地址"}],children:(0,h.jsx)(j.Z,{style:I})}),(0,h.jsx)(E,{onFileChange:function(e){var n=e.target.files[0];l.current=n,q(n,o)}})]})}),(0,h.jsx)(b.Z.Item,{label:"图片描述",name:"alt",children:(0,h.jsx)(j.Z,{style:{width:264}})}),(0,h.jsxs)(b.Z.Item,{style:{textAlign:"right"},children:[(0,h.jsx)(k.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,h.jsx)(k.ZP,{type:"default",onClick:t,children:"取消"})]})]}))};function E(e){var n=e.onFileChange;return(0,h.jsxs)("label",{className:"upload-button",style:{cursor:"pointer"},children:["本地上传",(0,h.jsx)("input",{type:"file",onChange:n})]})}function q(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(T.KI,"/api/attachments.json")),i.send(t)}var M=t(95237),L=t(74908),O=function(e){var n=e.callback,t=e.onCancel,i=document.createElement("canvas"),r=i.getContext("2d");i.width=1e3,i.height=800,r.fillStyle="#ffffff",r.fillRect(0,0,i.width,i.height);var l=i.toDataURL("image/png");return(0,h.jsx)(M.Z,{style:{height:"100vh"},children:(0,h.jsx)(L.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:l,visible:!0,title:String(Date.now())},onOk:function(e){n({src:e.url})},onClose:t})})},D=t(7557),F=t.n(D),R=t(41498),z=t.n(R),G=t(37205),W=t.n(G),H=t(12378);function V(){go.CommandHandler.call(this),this._arrowKeyBehavior="move",this._pasteOffset=new go.Point(10,10),this._lastPasteOffset=new go.Point(0,0)}go.Diagram.inherit(V,go.CommandHandler),V.prototype.canAlignSelection=function(){var e=this.diagram;return null!==e&&!e.isReadOnly&&!e.isModelReadOnly&&!(e.selection.count<2)},V.prototype.alignLeft=function(){var e=this.diagram;e.startTransaction("aligning left");var n=1/0;e.selection.each((function(e){e instanceof go.Link||(n=Math.min(e.position.x,n))})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(n,e.position.y))})),e.commitTransaction("aligning left")},V.prototype.alignRight=function(){var e=this.diagram;e.startTransaction("aligning right");var n=-1/0;e.selection.each((function(e){if(!(e instanceof go.Link)){var t=e.actualBounds.x+e.actualBounds.width;n=Math.max(t,n)}})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(n-e.actualBounds.width,e.position.y))})),e.commitTransaction("aligning right")},V.prototype.alignTop=function(){var e=this.diagram;e.startTransaction("alignTop");var n=1/0;e.selection.each((function(e){e instanceof go.Link||(n=Math.min(e.position.y,n))})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.position.x,n))})),e.commitTransaction("alignTop")},V.prototype.alignBottom=function(){var e=this.diagram;e.startTransaction("aligning bottom");var n=-1/0;e.selection.each((function(e){if(!(e instanceof go.Link)){var t=e.actualBounds.y+e.actualBounds.height;n=Math.max(t,n)}})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.actualBounds.x,n-e.actualBounds.height))})),e.commitTransaction("aligning bottom")},V.prototype.alignCenterX=function(){var e=this.diagram,n=e.selection.first();if(n){e.startTransaction("aligning Center X");var t=n.actualBounds.x+n.actualBounds.width/2;e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(t-e.actualBounds.width/2,e.actualBounds.y))})),e.commitTransaction("aligning Center X")}},V.prototype.alignCenterY=function(){var e=this.diagram,n=e.selection.first();if(n){e.startTransaction("aligning Center Y");var t=n.actualBounds.y+n.actualBounds.height/2;e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.actualBounds.x,t-e.actualBounds.height/2))})),e.commitTransaction("aligning Center Y")}},V.prototype.alignColumn=function(e){var n=this.diagram;n.startTransaction("align Column"),void 0===e&&(e=0),e=parseFloat(e);var t=new Array;n.selection.each((function(e){e instanceof go.Link||t.push(e)}));for(var i=0;i0){for(var i=a.elt(o-1);null!==i&&i.isTreeExpanded&&!i.isTreeLeaf;){i=this._sortTreeChildrenByY(i).last()}null!==i&&e.select(i)}else e.select(l)}else if("Down"===t.key){var r;if(n.isTreeExpanded&&!n.isTreeLeaf)null!==(r=this._sortTreeChildrenByY(n).first())&&e.select(r);else for(;null!==n;){var l,a,o;if(null===(l=n.findTreeParentNode()))break;if((o=(a=this._sortTreeChildrenByY(l)).indexOf(n))i.y?1:t.xi.x?1:0})),n},V.prototype.copyToClipboard=function(e){go.CommandHandler.prototype.copyToClipboard.call(this,e),this._lastPasteOffset.set(this.pasteOffset)},V.prototype.pasteFromClipboard=function(){var e=go.CommandHandler.prototype.pasteFromClipboard.call(this);return this.diagram.moveParts(e,this._lastPasteOffset),this._lastPasteOffset.add(this.pasteOffset),e},Object.defineProperty(V.prototype,"arrowKeyBehavior",{get:function(){return this._arrowKeyBehavior},set:function(e){if("move"!==e&&"select"!==e&&"scroll"!==e&&"tree"!==e&&"none"!==e)throw new Error('DrawCommandHandler.arrowKeyBehavior must be either "move", "select", "scroll", "tree", or "none", not: '+e);this._arrowKeyBehavior=e}}),Object.defineProperty(V.prototype,"pasteOffset",{get:function(){return this._pasteOffset},set:function(e){if(!(e instanceof go.Point))throw new Error("DrawCommandHandler.pasteOffset must be a Point, not: "+e);this._pasteOffset.set(e)}});var K=V,U=(t(31270),t(85160)),Y=t(43418),J=t(43604),X=t(51136),Q="myPaletteDiv___Xjz2I",$="maxH60___Pd4Re";window.go=H;var ee=function(e){var n=e.onCancel,t=e.callback,i=(0,c.useRef)(),r=(0,c.useRef)(),l=(0,c.useRef)(),o=(0,c.useRef)(!1),s=(0,c.useRef)(!1),d=(0,c.useState)(0),u=a()(d,2),p=u[0],m=u[1],f=function(){var e=z()(F()().mark((function e(){var n,r;return F()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.current.makeImage(),e.next=3,(0,X.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Date.now(),file:n.src}});case 3:r=e.sent,t({src:r.url});case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,c.useEffect)((function(){m(p+1)}),[]),(0,h.jsx)("div",{ref:s,className:o.current?"".concat($," body-overflow-initial"):"body-overflow-initial",children:(0,h.jsx)(Y.Z,{width:1200,icon:null,footer:null,closable:!0,visible:!!p,destroyOnClose:!0,maskClosable:!1,getContainer:s.current,rootClassName:"zIndex-9999",title:(0,h.jsxs)(M.Z,{children:[(0,h.jsx)(J.Z,{flex:1,children:"插入流程图"}),(0,h.jsx)(J.Z,{onClick:function(){o.current=!o.current,m(p+1)},children:(0,h.jsx)("span",{className:"current c-blue mr30",style:{fontWeight:400},children:"展开/收起"})})]}),onCancel:n,children:(0,h.jsxs)("div",{style:{width:"100%",height:"80vh",overflow:"hidden",position:"relative"},children:[(0,h.jsxs)("div",{style:{display:"flex",height:"100%"},children:[(0,h.jsxs)("div",{style:{width:"300px",height:"100%"},children:[(0,h.jsx)("div",{style:{background:"#fff",position:"relative",zIndex:12,fontSize:16,color:"#3061d0"},children:"图形库"}),(0,h.jsx)("div",{style:{height:"calc(100% - 50px)"},className:Q,ref:l})]}),(0,h.jsxs)("div",{style:{flex:1,position:"relative"},children:[(0,h.jsx)(U.FI,{initDiagram:function(){var e=H.GraphObject.make,n="#ff3333",t="#3358ff",a="#25ad23",o="#d533ff",s="#7d33ff",c="#ff6233",d="#ffffff",u="#000000",p="#fffcd5",m="#d5ebff",h="#f2dfe0",f="#a5d2fa",v="#cccccc",x="#b3e6b3",g="#fcbbbd";function y(n,t){var i=function(e,t){e.handled=!0,e.diagram.model.commit((function(i){var r=t.part.adornedPart,l=(new H.Point).setRectSpot(r.actualBounds,n);l.subtract(r.location),l.scale(2,2),l.x+=130*Math.sign(l.x),l.y+=130*Math.sign(l.y),l.add(r.location),l.snapToGridPoint(e.diagram.grid.gridOrigin,e.diagram.grid.gridCellSize);var a=i.copyNodeData(r.data);i.setGroupKeyForNodeData(a,i.getGroupKeyForNodeData(r.data)),i.addNodeData(a);var o={from:r.key,to:i.getKeyForNodeData(a)};i.addLinkData(o);var s=e.diagram.findNodeForData(a);s.location=l,e.diagram.select(s),setTimeout((function(){e.diagram.commandHandler.editTextBlock()}),20)}))};return e(H.Shape,{figure:t,alignment:n,alignmentFocus:n.opposite(),width:n.equals(H.Spot.Top)||n.equals(H.Spot.Bottom)?25:18,height:n.equals(H.Spot.Top)||n.equals(H.Spot.Bottom)?18:25,fill:"orange",stroke:d,strokeWidth:4,mouseEnter:function(e,n){return n.fill="dodgerblue"},mouseLeave:function(e,n){return n.fill="orange"},isActionable:!0,click:i,contextClick:i})}function _(n){return e(H.Shape,{fill:"orange",stroke:"rgba(0, 0, 0, 0)",strokeWidth:15,background:"transparent",geometryString:"F1 M0 0 b 0 360 -4 0 4 z M10 0 b 0 360 -4 0 4 z M20 0 b 0 360 -4 0 4",isActionable:!0,cursor:"context-menu",mouseEnter:function(e,n){return n.fill="dodgerblue"},mouseLeave:function(e,n){return n.fill="orange"},click:function(e,n){e.diagram.commandHandler.showContextMenu(n.part.adornedPart)}},n||{})}function w(e,n){return function(t,i){t.handled=!0,t.diagram.model.commit((function(t){t.set(i.part.adornedPart.data,e,n)}))}}function b(n,t){return t||(t="color"),e(H.Shape,{width:16,height:16,stroke:"lightgray",fill:n,margin:1,background:"transparent",mouseEnter:function(e,n){return n.stroke="dodgerblue"},mouseLeave:function(e,n){return n.stroke="lightgray"},click:w(t,n),contextClick:w(t,n)})}function j(){return[e("ContextMenuButton",e(H.Panel,"Horizontal",b(d,"fill"),b(p,"fill"),b(m,"fill"),b(h,"fill"))),e("ContextMenuButton",e(H.Panel,"Horizontal",b(v,"fill"),b(x,"fill"),b(f,"fill"),b(g,"fill")))]}function k(){return[e("ContextMenuButton",e(H.Panel,"Horizontal",b(u),b(a),b(t),b(n))),e("ContextMenuButton",e(H.Panel,"Horizontal",b(d),b(o),b(s),b(c)))]}function C(n,t){return t||(t="thickness"),e(H.Shape,"LineH",{width:16,height:16,strokeWidth:n,margin:1,background:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:w(t,n),contextClick:w(t,n)})}function N(n,t){return t||(t="dash"),e(H.Shape,"LineH",{width:24,height:16,strokeWidth:2,strokeDashArray:n,margin:1,background:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:w(t,n),contextClick:w(t,n)})}function Z(){return[e("ContextMenuButton",e(H.Panel,"Horizontal",C(1),C(2),C(3),C(4))),e("ContextMenuButton",e(H.Panel,"Horizontal",N(null),N([2,4]),N([4,4])))]}function S(n,t){return t||(t="figure"),e(H.Shape,{width:32,height:32,scale:.5,fill:"lightgray",figure:n,margin:1,background:"transparent",mouseEnter:function(e,n){return n.fill="dodgerblue"},mouseLeave:function(e,n){return n.fill="lightgray"},click:w(t,n),contextClick:w(t,n)})}function T(n){return e(H.Shape,{stroke:"dodgerblue",strokeWidth:2,strokeCap:"square",geometryString:"M0 0 M4 2 H3 M4 "+(n+4).toString()+" H3"})}function P(n){var t="M0 0 M8 16 M0 8 L16 8 M12 11 L16 8 L12 5";return 0===n?t="M0 0 M16 16 M0 8 L16 8":2===n&&(t="M0 0 M16 16 M0 8 L16 8 M12 11 L16 8 L12 5 M4 11 L0 8 L4 5"),e(H.Shape,{geometryString:t,margin:2,background:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:w("dir",n),contextClick:w("dir",n)})}function I(n){var t=function(e,t){e.handled=!0,e.diagram.model.commit((function(e){var i=t.part.adornedPart;e.set(i.data,n?"toSpot":"fromSpot",H.Spot.stringify(H.Spot.AllSides)),(n?i.toNode:i.fromNode).invalidateConnectedLinks()}))};return e(H.Shape,{width:12,height:12,fill:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:t,contextClick:t})}function B(n,t){var i=0,r=H.Spot.RightSide;n.equals(H.Spot.Top)?(i=270,r=H.Spot.TopSide):n.equals(H.Spot.Left)?(i=180,r=H.Spot.LeftSide):n.equals(H.Spot.Bottom)&&(i=90,r=H.Spot.BottomSide),t||(i-=180);var l=function(e,n){e.handled=!0,e.diagram.model.commit((function(e){var i=n.part.adornedPart;e.set(i.data,t?"toSpot":"fromSpot",H.Spot.stringify(r)),(t?i.toNode:i.fromNode).invalidateConnectedLinks()}))};return e(H.Shape,{alignment:n,alignmentFocus:n.opposite(),geometryString:"M0 0 M12 12 M12 6 L1 6 L4 4 M1 6 L4 8",angle:i,background:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:l,contextClick:l})}return i.current=new H.Diagram(r.current,{padding:20,grid:e(H.Panel,"Grid",e(H.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),e(H.Shape,"LineV",{stroke:"lightgray",strokeWidth:.5})),"draggingTool.isGridSnapEnabled":!0,handlesDragDropForTopLevelParts:!0,mouseDrop:function(e){e.diagram.commandHandler.addTopLevelParts(e.diagram.selection,!0)||e.diagram.currentTool.doCancel()},commandHandler:e(K),"clickCreatingTool.archetypeNodeData":{text:"未命名",fill:null,stroke:null,borderColor:"rgba(0,0,0,0)"},PartCreated:function(e){var n=e.subject;n.location=n.location.copy().snapToGridPoint(e.diagram.grid.gridOrigin,e.diagram.grid.gridCellSize),setTimeout((function(){e.diagram.commandHandler.editTextBlock()}),20)},"commandHandler.archetypeGroupData":{isGroup:!0,text:"NEW GROUP"},SelectionGrouped:function(e){e.subject;setTimeout((function(){e.diagram.commandHandler.editTextBlock()}))},LinkRelinked:function(e){e.parameter.part.invalidateConnectedLinks();var n=e.subject;e.diagram.toolManager.linkingTool.isForwards?n.toNode.invalidateConnectedLinks():n.fromNode.invalidateConnectedLinks()},"undoManager.isEnabled":!0}),i.current.nodeTemplate=e(H.Node,"Auto",{locationSpot:H.Spot.Center,locationObjectName:"SHAPE",desiredSize:new H.Size(120,60),minSize:new H.Size(40,40),resizable:!0,resizeCellSize:new H.Size(10,10),rotatable:!0},new H.Binding("location","loc",H.Point.parse).makeTwoWay(H.Point.stringify),new H.Binding("desiredSize","size",H.Size.parse).makeTwoWay(H.Size.stringify),e(H.Shape,{name:"SHAPE",fill:d,cursor:"pointer",portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:H.Spot.AllSides,toSpot:H.Spot.AllSides},new H.Binding("figure"),new H.Binding("fill"),new H.Binding("stroke","borderColor"),new H.Binding("strokeWidth","thickness"),new H.Binding("strokeDashArray","dash")),e(H.Shape,{width:100,height:20,strokeWidth:0,fill:"transparent"}),e(H.TextBlock,{margin:1,textAlign:"center",overflow:H.TextBlock.OverflowEllipsis,editable:!0},new H.Binding("text").makeTwoWay(),new H.Binding("stroke","color"))),i.current.nodeTemplate.toolTip=e("ToolTip",e(H.Panel,"Vertical",{maxSize:new H.Size(200,NaN)},e(H.TextBlock,{font:"bold 10pt sans-serif",textAlign:"center"},new H.Binding("text")),e(H.TextBlock,{font:"10pt sans-serif",textAlign:"center"},new H.Binding("text","details")))),i.current.nodeTemplate.selectionAdornmentTemplate=e(H.Adornment,"Spot",e(H.Placeholder,{padding:10}),y(H.Spot.Top,"TriangleUp"),y(H.Spot.Left,"TriangleLeft"),y(H.Spot.Right,"TriangleRight"),y(H.Spot.Bottom,"TriangleDown"),_({alignment:new H.Spot(.75,0)})),i.current.nodeTemplate.contextMenu=e("ContextMenu",e("ContextMenuButton",e(H.Panel,"Horizontal",S("Rectangle"),S("RoundedRectangle"),S("Ellipse"),S("Diamond"))),e("ContextMenuButton",e(H.Panel,"Horizontal",S("Parallelogram2"),S("ManualOperation"),S("Procedure"),S("Cylinder1"))),e("ContextMenuButton",e(H.Panel,"Horizontal",S("Terminator"),S("CreateRequest"),S("Document"),S("TriangleDown"))),j(),k(),Z()),i.current.groupTemplate=e(H.Group,"Spot",{layerName:"Background",ungroupable:!0,locationSpot:H.Spot.Center,selectionObjectName:"BODY",computesBoundsAfterDrag:!0,handlesDragDropForMembers:!0,mouseDrop:function(e,n){n.addMembers(n.diagram.selection,!0)||n.diagram.currentTool.doCancel()},avoidable:!1},new H.Binding("location","loc",H.Point.parse).makeTwoWay(H.Point.stringify),e(H.Panel,"Auto",{name:"BODY"},e(H.Shape,{parameter1:10,fill:d,strokeWidth:2,cursor:"pointer",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:H.Spot.AllSides,toSpot:H.Spot.AllSides},new H.Binding("fill"),new H.Binding("stroke","color"),new H.Binding("strokeWidth","thickness"),new H.Binding("strokeDashArray","dash")),e(H.Placeholder,{background:"transparent",margin:20})),e(H.TextBlock,{alignment:H.Spot.Top,alignmentFocus:H.Spot.Bottom,font:"bold 12pt sans-serif",editable:!0},new H.Binding("text"),new H.Binding("stroke","color"))),i.current.groupTemplate.selectionAdornmentTemplate=e(H.Adornment,"Spot",e(H.Panel,"Auto",e(H.Shape,{fill:null,stroke:"dodgerblue",strokeWidth:3}),e(H.Placeholder,{margin:1.5})),_({alignment:H.Spot.TopRight,alignmentFocus:H.Spot.BottomRight})),i.current.groupTemplate.contextMenu=e("ContextMenu",j(),k(),Z()),i.current.linkTemplate=e(H.Link,{layerName:"Foreground",routing:H.Link.AvoidsNodes,corner:10,fromShortLength:10,toShortLength:15,relinkableFrom:!0,relinkableTo:!0,reshapable:!0,resegmentable:!0},new H.Binding("fromSpot","fromSpot",H.Spot.parse),new H.Binding("toSpot","toSpot",H.Spot.parse),new H.Binding("fromShortLength","dir",(function(e){return e>=1?10:0})),new H.Binding("toShortLength","dir",(function(e){return e>=1?10:0})),new H.Binding("points").makeTwoWay(),e(H.Shape,{strokeWidth:2},new H.Binding("stroke","color"),new H.Binding("strokeWidth","thickness"),new H.Binding("strokeDashArray","dash")),e(H.Shape,{segmentIndex:0,segmentOffset:new H.Point(15,0),segmentOrientation:H.Link.OrientAlong,alignmentFocus:H.Spot.Right,figure:"circle",width:10,strokeWidth:0},new H.Binding("fill","color"),new H.Binding("visible","dir",(function(e){return 1===e}))),e(H.Shape,{segmentIndex:-1,segmentOffset:new H.Point(-10,6),segmentOrientation:H.Link.OrientPlus90,alignmentFocus:H.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new H.Binding("fill","color"),new H.Binding("visible","dir",(function(e){return e>=1})),new H.Binding("width","thickness",(function(e){return 7+3*e})),new H.Binding("height","thickness",(function(e){return 7+3*e})),new H.Binding("segmentOffset","thickness",(function(e){return new H.Point(-15,4+1.5*e)}))),e(H.Shape,{segmentIndex:0,segmentOffset:new H.Point(15,-6),segmentOrientation:H.Link.OrientMinus90,alignmentFocus:H.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new H.Binding("fill","color"),new H.Binding("visible","dir",(function(e){return 2===e})),new H.Binding("width","thickness",(function(e){return 7+3*e})),new H.Binding("height","thickness",(function(e){return 7+3*e})),new H.Binding("segmentOffset","thickness",(function(e){return new H.Point(-15,4+1.5*e)}))),e(H.TextBlock,{alignmentFocus:new H.Spot(0,1,-4,0),editable:!0},new H.Binding("text").makeTwoWay(),new H.Binding("stroke","color"))),i.current.linkTemplate.selectionAdornmentTemplate=e(H.Adornment,e(H.Shape,{isPanelMain:!0,stroke:"transparent",strokeWidth:6,pathPattern:T(2)},new H.Binding("pathPattern","thickness",T)),_({alignmentFocus:new H.Spot(0,0,-6,-4)})),i.current.linkTemplate.contextMenu=e("ContextMenu",k(),Z(),e("ContextMenuButton",e(H.Panel,"Horizontal",P(0),P(1),P(2))),e("ContextMenuButton",e(H.Panel,"Horizontal",e(H.Panel,"Spot",I(!1),B(H.Spot.Top,!1),B(H.Spot.Left,!1),B(H.Spot.Right,!1),B(H.Spot.Bottom,!1)),e(H.Panel,"Spot",{margin:new H.Margin(0,0,0,2)},I(!0),B(H.Spot.Top,!0),B(H.Spot.Left,!0),B(H.Spot.Right,!0),B(H.Spot.Bottom,!0))))),new H.Palette(l.current,{maxSelectionCount:1,linkTemplate:e(H.Link,{locationSpot:H.Spot.Center,selectionAdornmentTemplate:e(H.Adornment,"Link",{locationSpot:H.Spot.Center},e(H.Shape,{isPanelMain:!0,fill:null,stroke:"deepskyblue",strokeWidth:0}),e(H.Shape,{toArrow:"Standard",stroke:null}))},{routing:H.Link.AvoidsNodes,curve:H.Link.JumpOver,corner:5,toShortLength:4},new H.Binding("points"),e(H.Shape,{isPanelMain:!0,strokeWidth:2}),e(H.Shape,{toArrow:"Standard",stroke:null})),model:new H.GraphLinksModel([{text:"未命名",size:"100 100",fill:null,stroke:"#000"}].concat(W()(H.Shape.getFigureGenerators().toArray().map((function(e){return{text:"未命名",size:"100 100",figure:e.key,fill:"white",stroke:"#666",borderColor:"#000"}})))))}).nodeTemplate=e(H.Node,"Auto",{locationSpot:H.Spot.Center},new H.Binding("location","location",H.Point.parse).makeTwoWay(H.Point.stringify),e(H.Shape,"Circle",{fill:"white",stroke:"gray",strokeWidth:2,width:20,height:20,portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromLinkableSelfNode:!0,toLinkableSelfNode:!0},new H.Binding("stroke").makeTwoWay(),new H.Binding("fill").makeTwoWay(),new H.Binding("figure")),e(H.TextBlock,{margin:new H.Margin(5,5,3,5),font:"10pt sans-serif",minSize:new H.Size(16,16),maxSize:new H.Size(10,NaN),textAlign:"center",editable:!0},new H.Binding("key").makeTwoWay())),setTimeout((function(){i.current.grid=e(H.Panel,"Grid",e(H.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),e(H.Shape,"LineV",{stroke:"lightgray",strokeWidth:.5})),i.current.grid.visible=!0,i.current.grid.gridCellStroke="darkgray",i.current.grid.gridCellStrokeWidth=1}),300),window.myDiagrams=i.current,i.current},divClassName:"diagram-component",style:{height:"80vh"}}),(0,h.jsx)("div",{ref:r})]})]}),(0,h.jsx)("div",{className:"tr",children:(0,h.jsx)(k.ZP,{size:"large",onClick:f,style:{position:"absolute",right:0,bottom:0,zIndex:8},type:"primary",children:"保存到编辑器"})})]})})})},ne=t(5112),te=t(54449),ie=ne.ZP.Group,re={margin:"0 8px"},le=function(e){var n=e.callback,t=e.onCancel;return(0,h.jsxs)(b.Z,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:function(e){n(e)},children:[(0,h.jsxs)("div",{className:"flex-container",style:{alignItems:"baseline"},children:[(0,h.jsx)("span",{style:re,children:"单元格数:"}),(0,h.jsx)("span",{style:re,children:"行数"}),(0,h.jsx)(b.Z.Item,{name:"row",rules:[{required:!0,message:"请输入行数"}],children:(0,h.jsx)(te.Z,{})}),(0,h.jsx)("span",{style:re,children:"列数"}),(0,h.jsx)(b.Z.Item,{name:"col",rules:[{required:!0,message:"请输入列数"}],children:(0,h.jsx)(te.Z,{})})]}),(0,h.jsxs)("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"},children:[(0,h.jsx)("span",{style:re,children:"对齐方式:"}),(0,h.jsx)(b.Z.Item,{name:"align",children:(0,h.jsxs)(ie,{children:[(0,h.jsx)(ne.ZP,{value:"default",children:(0,h.jsx)("i",{className:"fa fa-align-justify"})}),(0,h.jsx)(ne.ZP,{value:"left",children:(0,h.jsx)("i",{className:"fa fa-align-left"})}),(0,h.jsx)(ne.ZP,{value:"center",children:(0,h.jsx)("i",{className:"fa fa-align-center"})}),(0,h.jsx)(ne.ZP,{value:"right",children:(0,h.jsx)("i",{className:"fa fa-align-right"})})]})})]}),(0,h.jsxs)("div",{className:"flex-container flex-end",children:[(0,h.jsx)(k.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,h.jsx)(k.ZP,{type:"ghost",onClick:t,children:"取消"})]})]})},ae=t(78673),oe=t(66455),se=t.n(oe),ce=(0,c.forwardRef)((function(e,n){var t=e.use3d,i=e.width,r=e.height,l=e.callback,o=(e.showSaveButton,(0,c.useRef)()),s=(0,c.useRef)(),d=(0,c.useState)(!1),u=a()(d,2),p=u[0],m=u[1],f=(0,c.useRef)({id:o,appName:"graphing",width:i||1e3,height:r||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,c.useEffect)((function(){s.current=new(se())(f.current,!0),window.onload=function(){s.current.inject("applet_container")}}),[]);var v=function(){var e=window.ggbApplet.getPNGBase64(1,!0,72);return l&&l(e),e};return(0,c.useEffect)((function(){f.current.appName=p?"3D":"graphing",s.current.inject("applet_container")}),[p]),(0,c.useEffect)((function(){m(t)}),[t]),(0,c.useImperativeHandle)(n,(function(){return{getImgData:v}})),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:o}),(0,h.jsxs)(M.Z,{align:"middle",children:[(0,h.jsx)(J.Z,{flex:1,children:(0,h.jsx)(ae.Z,{size:"default",checkedChildren:"关闭3D图像",unCheckedChildren:"开启3D图像",checked:p,onChange:function(e){return m(e)}})}),(0,h.jsx)(J.Z,{children:(0,h.jsx)(k.ZP,{size:"large",onClick:v,style:{zIndex:8,marginTop:10},type:"primary",children:"保存到编辑器"})})]})]})})),de=t(33773),ue=t(27065),pe="link",me="upload-image",he="add-flowchart",fe="draw-image",ve="code-block",xe="add-table",ge="------------",ye={default:ge,left:":".concat(ge),center:":".concat(ge,":"),right:"".concat(ge,":")},_e=t(56266);var we="@▁▁@",be=["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"];function je(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}var ke=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",Ce=s()(s()({},ke+"-B","bold"),ke+"-I","italic"),Ne=s()(s()(s()(s()(s()(s()(s()(s()({},pe,"添加链接"),ve,"添加代码块"),me,"添加图片"),fe,"添加画图"),he,"插入流程图"),xe,"添加表格"),"maths-latex","数学图像"),"inline-latex","LATEX公式"),Ze=function(e){var n=e.defaultValue,t=void 0===n?"":n,i=e.onChange,l=e.width,o=void 0===l?"100%":l,d=e.height,v=void 0===d?400:d,x=e.miniToolbar,g=void 0!==x&&x,y=e.isFocus,b=void 0!==y&&y,j=e.watch,k=e.insertTemp,C=e.mode,T=void 0===C?"markdown":C,P=e.id,I=void 0===P?"markdown-editor-id":P,B=e.showResizeBar,E=void 0!==B&&B,M=e.noStorage,L=void 0!==M&&M,D=e.showNullButton,F=void 0!==D&&D,R=e.showNullProgramButton,z=void 0!==R&&R,G=e.hidetoolBar,W=void 0!==G&&G,H=e.fullScreen,V=void 0!==H&&H,K=e.onBlur,U=e.onCMBeforeChange,J=e.onFullScreen,X=e.className,Q=void 0===X?"":X,$=e.disablePaste,ne=void 0!==$&&$,te=e.disabled,ie=void 0!==te&&te,re=e.disabledFill,ae=void 0!==re&&re,oe=e.placeholder,se=void 0===oe?"":oe,ge=e.values,ke=void 0===ge?"":ge,Ze=e.extraUse,Se=(0,c.useState)(null),Te=a()(Se,2),Pe=Te[0],Ie=Te[1],Be=(0,c.useState)(t),Ae=a()(Be,2),Ee=Ae[0],qe=Ae[1],Me=(0,c.useState)(j),Le=a()(Me,2),Oe=Le[0],De=Le[1],Fe=(0,c.useState)(V),Re=a()(Fe,2),ze=Re[0],Ge=Re[1],We=(0,c.useState)(""),He=a()(We,2),Ve=He[0],Ke=He[1],Ue=(0,c.useState)(0),Ye=a()(Ue,2),Je=Ye[0],Xe=Ye[1],Qe=(0,c.useState)(v),$e=a()(Qe,2),en=$e[0],nn=$e[1],tn=(0,c.useState)(!1),rn=a()(tn,2),ln=(rn[0],rn[1]),an=(0,c.useState)(0),on=a()(an,2),sn=on[0],cn=on[1],dn=(0,c.useState)(0),un=a()(dn,2),pn=un[0],mn=un[1],hn=(0,c.useRef)(),fn=(0,c.useRef)(),vn=(0,c.useRef)(),xn=(0,c.useRef)();(0,c.useEffect)((function(){var e=window.scrollY||window.pageYOffset;qe(ke),null==Pe||Pe.setValue(ke),window.scrollTo(0,e)}),[ke]),(0,c.useEffect)((function(){null==J||J(ze)}),[ze]),(0,c.useEffect)((function(){if(hn.current){var e=function(e,t){if(!ne){var i=t.clipboardData;if(i){var r=i.types.toString(),l=i.items;if("Files"===r||i.types.indexOf("Files")>-1){if(t.preventDefault(),"stex"==T)return;try{var a,o=l[1];"file"===(null===(a=l[0])||void 0===a?void 0:a.kind)&&(o=l[0]);var s=o.getAsFile(),c=s.name.split(".").pop();q(s,(function(e){var t,i,r;e.id?(null==s||null===(t=s.type)||void 0===t?void 0:t.indexOf("image"))>-1?n.replaceSelection("![,](/api/attachments/".concat(e.id,"?type=").concat(e.content_type,")")):(null==s||null===(i=s.type)||void 0===i?void 0:i.indexOf("video"))>-1?n.replaceSelection('')):(null==s||null===(r=s.type)||void 0===r?void 0:r.indexOf("pdf"))>-1?n.replaceSelection('').concat(s.name,"")):be.includes(c)?n.replaceSelection('').concat(s.name,"")):n.replaceSelection("[".concat(s.name,"](").concat(ue.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){S.ZP.warning("请使用chrome浏览器粘贴")}return!0}return!0}return!0}t.preventDefault()},n=u().fromTextArea(hn.current,{mode:T,lineNumbers:!g,lineWrapping:!0,value:t,autoCloseTags:!0,autoCloseBrackets:!0});return n.on("keyup",(function(e,t){8===t.keyCode&&(""==e.getValue()?n.setOption("placeholder",se):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(),r=t.getLine(i.line),l=r.charAt(i.ch-1),a=r.lastIndexOf("@▁@",i.ch),o=r.lastIndexOf("@▁▁@",i.ch),s=a>o?a:o,c=a>o?3:4;if(-1===we.indexOf(l))return null;if(console.log("change1:",n,e,r,i,s,a,o,l),s>=0&&i.ch-s<5){var d=s+c;return t.replaceRange("",{line:i.line,ch:s},{line:i.line,ch:d}),{line:i.line,ch:d}}return null}(e);t&&n.preventDefault()}})),b&&n.focus(),n.on("paste",e),ie&&n.on("beforeChange",(function(e,n){"paste"!==n.origin&&"+input"!==n.origin||n.cancel()})),Ie(n),function(){n.off("paste",e)}}}),[]);var gn=(0,c.useCallback)((function(){fn.current}),[en,fn,ze]);(0,c.useEffect)((function(){if(Pe){var e=function(){var e=new p.Z((function(e){var n,t=r()(e);try{for(t.s();!(n=t.n()).done;){var i=n.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&(gn(),Pe.setSize("100%","100%"),Pe.refresh())}}catch(e){t.e(e)}finally{t.f()}}));return e.observe(hn.current.parentElement),e}();return function(){var n,t;null!==(n=hn.current)&&void 0!==n&&n.parentElement&&e.unobserve(null===(t=hn.current)||void 0===t?void 0:t.parentElement)}}}),[Pe,gn]),(0,c.useEffect)((function(){if(Pe){for(var e=[],n=function(){var n=a()(i[t],2),r=n[0],l=n[1],o=s()({},r,(function(){yn(l)}));e.push(o),Pe.addKeyMap(o)},t=0,i=Object.entries(Ce);t0){var e=(new Date).getTime(),n=window.sessionStorage.getItem(I);e>=Je+1e4&&(!n||n!==Ee)&&(window.sessionStorage.setItem(I,Ee),ln(!0))}}),1e4),(0,c.useEffect)((function(){De(j)}),[Pe,j]),(0,c.useEffect)((function(){Pe&&b&&Pe.focus()}),[Pe,b]),(0,c.useEffect)((function(){if(Oe&&Pe){var e=function(e){var n=e.target;if(xn.current){var t=n.scrollTop/n.scrollHeight;xn.current.scrollTop=xn.current.scrollHeight*t}},n=Pe.getScrollerElement();return n.addEventListener("scroll",e),function(){n.removeEventListener("scroll",e)}}}),[Pe,Oe]),(0,c.useEffect)((function(){if(Pe&&U){var e=function(e,n){U(e,n)};return Pe.on("beforeChange",e),function(){Pe.off("beforeChange",e)}}}),[Pe,U]),(0,c.useEffect)((function(){if(Pe&&K){var e=function(){K(Pe.getValue())};return Pe.on("blur",e),function(){Pe.off("blur",e)}}}),[Pe,K]),(0,c.useEffect)((function(){if(Pe){var e=function(e,n){var t=e.getValue();qe(t),Xe((new Date).getTime()),e.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),i&&(z?i(t,kn(t)):i(t))};return Pe.on("change",e),function(){Pe.off("change",e)}}}),[Pe,i]),(0,c.useEffect)((function(){if(Pe)if(null==t)Pe.setValue(""),qe("");else{var e=window.scrollY||window.pageYOffset;t!==Pe.getValue()&&(Pe.setValue(t),qe(t),Pe.setCursor(ie?1:Pe.lineCount(),0),window.scrollTo(0,e))}}),[Pe,t]);var yn=(0,c.useCallback)((function(e){var n=Pe.getCursor(),t=Pe.getSelection(),i=t.split("\n");switch(e){case"bold":return Pe.replaceSelection("**"+t+"**"),""===t&&Pe.setCursor(n.line,n.ch+2),Pe.focus();case"italic":return Pe.replaceSelection("*"+t+"*"),""===t&&Pe.setCursor(n.line,n.ch+1),Pe.focus();case"code":return Pe.replaceSelection("`"+t+"`"),""===t&&Pe.setCursor(n.line,n.ch+1),Pe.focus();case"inline-latex":return Ke("inline-latex"),Pe.focus();case"latex":return Pe.replaceSelection("```latex\n"+t+"\n```"),Pe.setCursor(n.line+1,t.length+1),Pe.focus();case"line-break":return Pe.replaceSelection("
\n"),Pe.focus();case"list-ul":return""===t?Pe.replaceSelection("- "+t):Pe.replaceSelection(i.map((function(e){return""===e?"":"- ".concat(e)})).join("\n")),Pe.focus();case"list-ol":return""===t?Pe.replaceSelection("1. "+t):Pe.replaceSelection(i.map((function(e,n){return""===e?"":"".concat(n+1,". ").concat(e)})).join("\n")),Pe.focus();case"add-null-ch":return""===t&&Pe.setCursor(n.line,n.ch),Pe.replaceSelection("▁"),Pe.focus();case"add-signal":return""===t&&Pe.setCursor(n.line,n.ch),Pe.replaceSelection("@▁@"),Pe.focus();case"add-multiple":return""===t&&Pe.setCursor(n.line,n.ch),Pe.replaceSelection(we),Pe.focus();case"inster-template-1":return""===t&&Pe.setCursor(n.line,n.ch),Pe.replaceSelection("\n**模板标题**\n模板正文内容,可输入文本内容和粘贴图片等操作"),Pe.focus();case"eraser":return Pe.setValue(""),Pe.focus();case"trigger-watch":return De(!Oe),Pe.focus();case"trigger-full-screen":return Ge(!ze),Pe.focus();case pe:return void Ke(pe);case ve:return void Ke(ve);case me:return void Ke(me);case fe:return void Ke(fe);case"maths-latex":return void Ke("maths-latex");case he:return void Ke(he);case xe:return void Ke(xe);default:throw new Error}}),[Pe,Oe,ze]),_n=(0,c.useCallback)((function(e,n){var t,i,r,l,a;switch(Ke(""),Ve){case pe:var o=e.title,s=e.link;return Pe.replaceSelection("[".concat(o,"](").concat(s,")")),Pe.focus();case ve:var c=e.language,d=e.content;return Pe.replaceSelection(["```"+c,d,"```"].join("\n")),Pe.focus();case"maths-latex":for(var u=atob(e),p=new Uint8Array(u.length),m=0;m-1||null==v||!v.type?f?Pe.replaceSelection("![ ".concat(f," ]( ").concat(h,' "').concat(f,'" )')):Pe.replaceSelection("![,](".concat(h,")")):(null==v||null===(l=v.type)||void 0===l?void 0:l.indexOf("video"))>-1?Pe.replaceSelection('')):(null==v||null===(a=v.type)||void 0===a?void 0:a.indexOf("pdf"))>-1?Pe.replaceSelection('').concat(v.name,"")):be.includes(x)?Pe.replaceSelection('').concat(v.name,"")):Pe.replaceSelection("[".concat(v.name,"](").concat(ue.Z.API_SERVER).concat(h,")")),Pe.focus();case xe:for(var g=e.row,y=e.col,_=e.align,w="\n",b=0;b300&&(n=300),nn(v+n+"px")}},i=vn.current,r=!1,l=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)}}}),[Pe,vn]),(0,c.useEffect)((function(){nn(v)}),[v]);var jn={width:je(o),height:je(en)},kn=((0,c.useMemo)((function(){if(Je){var e=new Date(Je),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}),[Je]),function(e){var n=[];if(z){e=e.replace(/(@▁▁@|@▁@)/g,(function(e,t,i){n.push({multiLine:!("@▁@"===e)})}))}return n});(0,c.useEffect)((function(){if(Ne[Ve]&&Ve!==fe&&Ve!==he){var e=document.getElementsByClassName("ant-modal")[0],n=window.innerWidth/2-e.offsetWidth/2,t=window.innerHeight/2-e.offsetHeight/2;cn(n),mn(t)}}),[Ve]);var Cn=function(e,n,t,i){var r=document.body.clientHeight,l=document.body.clientWidth;return!(e<20&&t>e||e>l-20&&tn||n>r-20&&i0&&y(O()(l)||[])}),[l]);var k=function(){var e=d()(s()().mark((function e(t,i){var r;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!u){e.next=3;break}return x.ZP.info("请先保存或取消当前正在编辑的试题。"),e.abrupt("return");case 3:if(t.destination){e.next=5;break}return e.abrupt("return");case 5:return j(!0),e.next=8,(0,q.ZP)("/api/examination_banks/".concat(n,"/examination_banks_item_banks/").concat(null==i?void 0:i[t.source.index].question_id,"/adjust_position.json"),{method:"post",body:{id:n,itemid:null==i?void 0:i[t.source.index].question_id,position:t.destination.index}});case 8:r=e.sent,j(!1),0===r.status&&a({id:null==i?void 0:i[t.source.index].question_id});case 11:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}();return(0,R.jsx)("div",{children:(0,R.jsx)(D.Z5,{onDragEnd:function(e){return k(e,v)},children:(0,R.jsx)(D.bK,{droppableId:"droppable",children:function(e,n){return(0,R.jsxs)("div",r()(r()({ref:e.innerRef},e.droppableProps),{},{children:[(0,R.jsx)(g.Z,{spinning:b,children:v.map((function(e,n){return(0,R.jsx)(D._l,{draggableId:n.toString(),index:n,children:function(l,a){var s,d;return(0,R.jsx)("aside",r()(r()(r()({ref:l.innerRef},l.draggableProps),l.dragHandleProps),{},{children:(0,R.jsx)(B.Z,{title:(0,R.jsx)(F.Z,{value:8===(null==e?void 0:e.question_type)?null==e||null===(s=e.program_attr)||void 0===s?void 0:s.description:e.question_title}),color:"#fff",placement:"left",overlayClassName:A.titleTooltip,children:(0,R.jsxs)("div",{onClick:function(){u?x.ZP.info("请先保存或取消当前正在编辑的试题。"):(t(r()(r()({},e),{},{index:n+1})),c(o),(0,E.Vf)("#question-scroll-id"))},className:"".concat(A.qcount," ").concat(e.question_id===(null==i?void 0:i.question_id)?A.qcountclick:""),children:[(0,R.jsxs)("span",{className:A.score,children:[null==e?void 0:e.question_score,"分"]}),(0,R.jsxs)("span",{className:A.qtitle,children:[n+1,"、",(0,R.jsx)(F.Z,{value:8===(null==e?void 0:e.question_type)?null==e||null===(d=e.program_attr)||void 0===d?void 0:d.description:e.question_title,showTextOnly:!0})]})]})})}))}},n)}))}),e.placeholder]}))}})})})},G=t(95237),W=t(5309),H=t(57809),V=t(78673),K=t(85699),U=t(88289),Y=function(e){var n,t=e.form,i=e.TagDiscipline,r=e.exerciseitem,l=e.qitem,a=e.getTagData,o=(0,m.useState)(!0),c=p()(o,2),u=c[0],h=(c[1],(0,m.useState)(!1)),v=p()(h,2),g=v[0],_=v[1],b=(0,m.useState)(""),k=p()(b,2),C=k[0],N=k[1];return(0,m.useEffect)((function(){t.setFieldsValue({difficulty:l.difficulty||2,repeat_answer:!l.repeat_answer})}),[]),(0,R.jsxs)("div",{children:[(0,R.jsxs)("div",{style:{marginTop:30,overflow:"hidden",height:u?"100%":0},children:[(0,R.jsx)(f.Z.Item,{className:A.formcenter,rules:[{required:!0,message:"请先选择难度"}],label:"难度",name:"difficulty",children:(0,R.jsxs)(w.ZP.Group,{className:A.radiogroup,children:[(0,R.jsx)(w.ZP.Button,{className:A.easy,value:1,children:"简单"}),(0,R.jsx)(w.ZP.Button,{className:A.medium,value:2,children:"适中"}),(0,R.jsx)(w.ZP.Button,{className:A.hard,value:3,children:"困难"})]})}),(0,R.jsx)(f.Z.Item,{className:A.formcenterselect,label:"知识点",children:(0,R.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,R.jsx)(f.Z.Item,{name:"tag_discipline_ids",style:{marginBottom:12},children:(0,R.jsx)(H.default,{className:A.selectitems,showSearch:!0,mode:"multiple",placeholder:"请选择知识点,支持选择多个",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,R.jsx)(H.default.Option,{value:e.id,children:(0,R.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,R.jsx)("span",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:e.name}),"personal"===(null==e?void 0:e.type)&&(0,R.jsx)("div",{style:{marginLeft:"5px",border:"1px solid #24C074",color:"#24C074",padding:"0 4px",borderRadius:"2px",fontSize:"12px",height:"20px",lineHeight:"20px"},children:"自用"})]})},e.name+e.id)}))})}),(0,R.jsxs)("div",{style:{marginLeft:20,marginTop:"-16px",lineHeight:"48px",height:48,fontSize:14},children:[(0,R.jsx)("span",{children:"没有合适的知识点?"}),(0,R.jsx)("a",{onClick:function(){_(!0)},style:{marginLeft:3,color:"#3061D0"},children:"新建知识点"})]})]})}),(0,R.jsx)(f.Z.Item,{className:A.formcenterselect,children:(0,R.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,R.jsx)(f.Z.Item,{name:"repeat_answer",valuePropName:"checked",children:(0,R.jsx)(V.Z,{})}),(0,R.jsxs)("div",{style:{marginLeft:10,marginTop:"-16px",lineHeight:"40px",height:48,color:"#000000"},children:["不允许学生重复答题",(0,R.jsx)(B.Z,{placement:"right",title:"选中后,学生必须作答完成才能进入下一题,且进入下一题之后不允许再修改该题答案",children:(0,R.jsx)(K.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})})]})]})})]}),(0,R.jsxs)(S.Z,{title:!1,footer:!1,open:g,width:640,centered:!0,closable:!1,className:A.scoremodal,children:[(0,R.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,R.jsx)("div",{className:A.title,children:"新建知识点"}),(0,R.jsx)("span",{onClick:function(){return _(!1)},className:A.close,children:"X"})]}),(0,R.jsxs)("div",{children:[(0,R.jsx)(U.Z,{style:{color:"#FF8C29",marginRight:10}}),"新建的知识点仅本人可见,平台审核列入公开知识点后,对所有用户可见。 平台有权删除不合适的知识点,请认真填写知识点名称。"]}),(0,R.jsx)(y.Z,{showCount:!0,maxLength:20,style:{marginBottom:30,marginTop:30,height:46},onChange:function(e){N(e.target.value)},placeholder:"请输入知识点名称"}),(0,R.jsxs)("div",{className:A.bottom,children:[(0,R.jsx)(j.ZP,{className:A.no,onClick:function(){_(!1)},children:"取消"}),(0,R.jsx)(j.ZP,{className:A.yes,onClick:d()(s()().mark((function e(){var n,i,l;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(C){e.next=3;break}return x.ZP.info("知识点名称不能为空"),e.abrupt("return");case 3:return e.next=5,(0,q.ZP)("/api/tag_disciplines.json",{method:"post",body:{name:C,sub_discipline_id:null==r||null===(n=r.exercise)||void 0===n?void 0:n.sub_discipline_id}});case 5:0===(null==(i=e.sent)?void 0:i.status)&&(t.setFieldsValue({knowledge:C,tag_discipline_ids:[].concat(O()(t.getFieldValue("tag_discipline_ids")),[null==i?void 0:i.tag_discipline_id])}),a(null===(l=r.exercise)||void 0===l?void 0:l.sub_discipline_id)),_(!1);case 8:case"end":return e.stop()}}),e)}))),children:"确认"})]})]})]})},J=function(e){var n=e.qitem,t=e.setisedit,i=e.TagDiscipline,l=e.exerciseitem,a=e.seveeditor,o=e.deleteitem,c=e.getTagData,u=e.init,h=f.Z.useForm(),v=p()(h,1)[0];return(0,m.useEffect)((function(){var e;v.setFieldsValue(r()(r()({},n),{},{name:null==n?void 0:n.question_title,choices:null==n||null===(e=n.question_choices)||void 0===e?void 0:e.map((function(e){return r()(r()({},e),{},{standard_boolean:null!=e&&e.standard_boolean?1:0})})),repeat_answer:!(null!=n&&n.repeat_answer)}))}),[n]),(0,R.jsx)("div",{children:(0,R.jsxs)(f.Z,{form:v,colon:!1,onFinish:function(e){var t,i=r()(r()({},e),{},{item_type:null==n?void 0:n.question_type,choices:null==e||null===(t=e.choices)||void 0===t?void 0:t.map((function(e){return r()(r()({},e),{},{is_answer:e.standard_boolean})}))});a(r()(r()({},n),i))},onFinishFailed:function(){var e=d()(s()().mark((function e(n){var t;return s()().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,R.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,R.jsxs)("div",{style:{flex:1},children:[(0,R.jsx)("span",{style:{display:"inline-flex",border:"1px solid #9096A3",borderRadius:"50%",width:10,height:10,marginRight:5,background:"#9096A3"}}),(0,R.jsx)("span",{children:1===(null==n?void 0:n.question_type)?"多选题":"单选题"})]}),!n.isadd&&(0,R.jsxs)("span",{style:{marginLeft:20,marginRight:20,color:"red",cursor:"pointer"},onClick:function(){o()},children:[(0,R.jsx)("i",{className:"iconfont icon-piliangshanchu3",style:{fontSize:14,marginRight:6}}),"删除"]}),(0,R.jsx)(j.ZP,{onClick:function(){var e;n.isadd?(t(!1),u()):(v.setFieldsValue(r()(r()({},n),{},{name:null==n?void 0:n.question_title,choices:null==n||null===(e=n.question_choices)||void 0===e?void 0:e.map((function(e){return r()(r()({},e),{},{standard_boolean:null!=e&&e.standard_boolean?1:0})})),repeat_answer:!(null!=n&&n.repeat_answer)})),t(!1))},children:"取消"}),(0,R.jsx)(j.ZP,{className:"ml20",type:"primary",onClick:d()(s()().mark((function e(){return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:v.submit();case 1:case"end":return e.stop()}}),e)}))),children:"保存"})]}),(0,R.jsxs)("div",{style:{maxHeight:"70vh",overflowY:"auto",marginTop:"10px",paddingRight:"5px"},children:[(0,R.jsx)(G.Z,{align:"middle",children:(0,R.jsx)(f.Z.Item,{className:A.scoreinput,name:"question_score",label:"分值",rules:[{required:!0,message:"请输入分值"}],children:(0,R.jsx)(b.Z,{onBlur:function(e){"0"===e.target.value&&x.ZP.error("分值必须大于0且小于等于100")},style:{width:150},precision:1,placeholder:"请输入分值",max:100,min:.1})})}),(0,R.jsx)(W.u,{form:v,questionTitlePlaceholder:"请编辑选择题题干内容",titleKey:"name",choiceKey:"choices",analysisKey:"analysis",choiceOptionsPath:"choices",choiceTextKey:"choice_text",answerKey:"standard_boolean"}),(0,R.jsx)(Y,{getTagData:c,qitem:n,exerciseitem:l,TagDiscipline:i,form:v})]})]})})},X=t(56763),Q=t(95166),$=function(e){var n=e.qitem,t=e.TagDiscipline,i=e.exerciseitem,l=e.setisedit,a=e.seveeditor,o=e.deleteitem,c=e.getTagData,u=e.init,h=f.Z.useForm(),v=p()(h,1)[0],g=f.Z.useWatch("use_blank_score",v);return(0,m.useEffect)((function(){v.setFieldsValue(r()(r()({},n),{},{standard_answers:n.standard_answers||[],name:n.question_title,repeat_answer:!n.repeat_answer}))}),[n]),(0,R.jsx)("div",{children:(0,R.jsxs)(f.Z,{form:v,colon:!1,onValuesChange:function(e,n){if(null!=e&&e.standard_answers||null!=e&&e.use_blank_score){var t,i,r,l=(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==l?void 0:l.length)>0)v.setFieldsValue({question_score:(null==l?void 0:l.length)>0&&(null===(r=l.reduce((function(e,n){return e+n})))||void 0===r?void 0:r.toFixed(1))})}},onFinish:function(e){var t;a(r()(r()(r()({},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 r()(r()({},e),{},{position:e.choice_id||n+1})}))}))},onFinishFailed:function(){var e=d()(s()().mark((function e(n){var t;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"请先在题干中插入填空项"===n.errorFields[0].errors[0]&&(0,E.pE)(),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 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:[(0,R.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,R.jsxs)("div",{style:{flex:1},children:[(0,R.jsx)("span",{style:{display:"inline-flex",border:"1px solid #9096A3",borderRadius:"50%",width:10,height:10,marginRight:5,background:"#9096A3"}}),(0,R.jsx)("span",{children:"填空题"})]}),!n.isadd&&(0,R.jsxs)("span",{style:{marginLeft:20,marginRight:20,color:"red",cursor:"pointer"},onClick:function(){o()},children:[(0,R.jsx)("i",{className:"iconfont icon-piliangshanchu3",style:{fontSize:14,marginRight:6}})," 删除"]}),(0,R.jsx)(j.ZP,{onClick:function(){n.isadd?(l(!1),u()):(v.setFieldsValue(r()(r()({},n),{},{standard_answers:n.standard_answers,name:n.question_title,repeat_answer:!n.repeat_answer})),l(!1))},children:"取消"}),(0,R.jsx)(j.ZP,{className:"ml20",type:"primary",onClick:function(){v.submit()},children:"保存"})]}),(0,R.jsxs)("div",{style:{maxHeight:"70vh",overflowY:"auto",marginTop:"10px",paddingRight:"5px"},children:[(0,R.jsxs)(G.Z,{align:"middle",children:[g?(0,R.jsx)(Q.Z,{text:"(小题分值等于各填空项分值之和)"}):(0,R.jsx)(f.Z.Item,{className:A.scoreinput,name:"question_score",label:"分值",rules:[{required:!0,message:"请输入分值"}],children:(0,R.jsx)(b.Z,{onBlur:function(e){"0"===e.target.value&&x.ZP.error("分值必须大于0且小于等于100")},style:{width:150},precision:1,placeholder:"请输入分值",size:"middle",max:100,min:.1})},2),(0,R.jsx)(f.Z.Item,{name:"use_blank_score",noStyle:!0,children:(0,R.jsx)(w.ZP.Group,{className:A.scoreByBlankRadio,optionType:"button",options:[{label:"按空给分",value:!0},{label:"按题给分",value:!1}]})}),(0,R.jsx)(B.Z,{overlayInnerStyle:{width:460},title:(0,R.jsxs)("div",{children:["按空给分:需要分别设置每个填空项的分值,填空项答对之后则获得对应的分值。",(0,R.jsx)("br",{}),"按题给分:需要设置整个小题的分值,答对全部填空项之后才能获得该小题的分值。"]}),children:(0,R.jsx)("i",{className:"icon-tishixiaowenhao font18 ml20 c-3061d0"})})]}),(0,R.jsx)(X.u,{form:v,questionTitlePlaceholder:"请编辑填空题题干内容",scoreByBlank:g,answerKey:"standard_answers"}),(0,R.jsx)(Y,{getTagData:c,qitem:n,exerciseitem:i,TagDiscipline:t,form:v})]})]})})},ee=t(99041),ne=function(e){var n=e.qitem,t=e.setisedit,i=e.TagDiscipline,l=e.exerciseitem,a=e.seveeditor,o=e.deleteitem,c=e.getTagData,u=e.init,h=f.Z.useForm(),v=p()(h,1)[0];return(0,m.useEffect)((function(){var e;v.setFieldsValue(r()(r()({},n),{},{name:n.question_title,repeat_answer:!n.repeat_answer,choices:null==n||null===(e=n.question_choices)||void 0===e?void 0:e.map((function(e){return r()(r()({},e),{},{is_answer:null!=e&&e.standard_boolean?1:0})}))}))}),[n]),(0,R.jsx)("div",{children:(0,R.jsxs)(f.Z,{form:v,colon:!1,onFinish:function(e){a(r()(r()({},n),e))},onFinishFailed:function(){var e=d()(s()().mark((function e(n){var t;return s()().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,R.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,R.jsxs)("div",{style:{flex:1},children:[(0,R.jsx)("span",{style:{display:"inline-flex",border:"1px solid #9096A3",borderRadius:"50%",width:10,height:10,marginRight:5,background:"#9096A3"}}),(0,R.jsx)("span",{children:"判断题"})]}),!(null!=n&&n.isadd)&&(0,R.jsxs)("span",{style:{marginLeft:20,marginRight:20,color:"red",cursor:"pointer"},onClick:function(){o()},children:[(0,R.jsx)("i",{className:"iconfont icon-piliangshanchu3",style:{fontSize:14,marginRight:6}}),"删除"]}),(0,R.jsx)(j.ZP,{onClick:function(){var e;n.isadd?(t(!1),u()):(v.setFieldsValue(r()(r()({},n),{},{name:null==n?void 0:n.question_title,choices:null==n||null===(e=n.question_choices)||void 0===e?void 0:e.map((function(e){return r()(r()({},e),{},{is_answer:null!=e&&e.standard_boolean?1:0})})),repeat_answer:!(null!=n&&n.repeat_answer)})),t(!1))},children:"取消"}),(0,R.jsx)(j.ZP,{className:"ml20",type:"primary",onClick:function(){v.submit()},children:"保存"})]}),(0,R.jsxs)("div",{style:{maxHeight:"70vh",overflowY:"auto",marginTop:"10px",paddingRight:"5px"},children:[(0,R.jsx)(f.Z.Item,{className:A.scoreinput,name:"question_score",label:"分值",rules:[{required:!0,message:"请输入分值"}],children:(0,R.jsx)(b.Z,{onBlur:function(e){"0"===e.target.value&&x.ZP.error("分值必须大于0且小于等于100")},style:{width:150},precision:1,placeholder:"请输入分值",max:100,min:.1})}),(0,R.jsx)(ee.Z,{form:v,questionTitlePlaceholder:"请编辑判断题题干内容",choiceKey:""}),(0,R.jsx)(Y,{getTagData:c,qitem:n,exerciseitem:l,TagDiscipline:i,form:v})]})]})})},te=t(39647),ie=t.n(te),re=t(36381),le={wrap:"wrap___YewKC",deleteIcon:"deleteIcon___AKmkj",keywordTag:"keywordTag___hMKmU",questionTitleEditorWrap:"questionTitleEditorWrap___SpNyf",choiceWrap:"choiceWrap___lDCnP",choiceIndex:"choiceIndex___dabwf",judgementIndex:"judgementIndex___sausK",setAnswerBtn:"setAnswerBtn___moVcF",activeAnswer:"activeAnswer___Cd32c",activeJudgementAnswer:"activeJudgementAnswer___rbuoo",actionWrapper:"actionWrapper___dZuBC",addIcon:"addIcon___A9GtN",inputBorder:"inputBorder___DeyjY",placeholder:"placeholder___dhOmk",blankWrapper:"blankWrapper___vU8Cg",blankInput:"blankInput___Vzre8",blankInputNumberWrapper:"blankInputNumberWrapper___yLeaN",addBtn:"addBtn___LhI0I",blankIndex:"blankIndex___caKgB",baseInputWrapper:"baseInputWrapper___DhjJY",collapseWrapper:"collapseWrapper___btrfP",panelHeader:"panelHeader___xIZ7O",open:"open___IMQhg",close:"close___FTAU3",hide:"hide___GBtJP",scoreByBlankRadio:"scoreByBlankRadio___HAunQ"},ae=t(78091),oe=t(11094),se=["value","onChange","scrollId"],ce=function(e){var n=e.value,t=e.onChange,i=e.scrollId,l=ie()(e,se);return(0,R.jsx)("div",{id:i||"",children:(0,R.jsx)(oe.Z,r()(r()({},l),{},{defaultValue:n,onChange:function(e,n){console.log("a:",e,n),null!=n&&n.length?t(e,n):t(e)}}))})},de=function(e){var n=e.value,t=e.onChange,i=e.placeholder,r=e.height,l=void 0===r?140:r;return e.isEdit?(0,R.jsx)(oe.Z,{watch:!0,isFocus:!0,height:l,placeholder:i,defaultValue:n,onChange:t}):(0,R.jsx)("div",{style:{cursor:"pointer"},children:n?(0,R.jsx)(F.Z,{className:le.inputBorder,value:n}):(0,R.jsx)("div",{className:"".concat(le.inputBorder," ").concat(le.placeholder),children:i})})},ue=t(85573),pe=t.n(ue),me=t(43604),he=t(57703),fe=["key","name"],ve=["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"],xe=function(e){var n=e.value,t=e.onChange,i=e.choiceTextKey,l=e.answerKey,a=e.index,o=e.isEdit,s=e.setInputActive,c=e.form,d=e.choiceOptionsPath,u=e.allowChangeMode,p=e.showAddIcon,m=e.addItem,h=e.deleteItem,f=1===(null==n?void 0:n[l]),v=function(){var e;f?t(r()(r()({},n),{},pe()({},l,0))):(u||(e=c.getFieldValue(d),c.setFieldValue(d,e.map((function(e){return r()(r()({},e),{},pe()({},l,0))})))),t(r()(r()({},n),{},pe()({},l,1))))};return(0,R.jsxs)(G.Z,{className:le.choiceWrap,align:"middle",wrap:!1,children:[(0,R.jsx)(me.Z,{onClick:v,className:"".concat(le.choiceIndex," ").concat(f?le.activeAnswer:""),children:ve[a]}),(0,R.jsx)(me.Z,{flex:1,className:"".concat(le.editorWrap," ml15"),onClick:s,children:(0,R.jsx)(de,{height:155,placeholder:"请您输入选项",isEdit:o,value:null==n?void 0:n[i],onChange:function(e){t(r()(r()({},n),{},pe()({},i,e)))}})}),(0,R.jsx)(me.Z,{flex:"0 0 auto",className:"ml15",children:(0,R.jsx)("div",{onClick:v,className:"".concat(le.setAnswerBtn," ").concat(f?le.activeAnswer:""),children:f?"正确答案":"设为答案"})}),(0,R.jsxs)(me.Z,{className:le.actionWrapper,children:[(0,R.jsx)(B.Z,{title:"新增参考答案",children:(0,R.jsx)(he.Z,{className:le.addIcon,onClick:m,style:{visibility:p?"visible":"hidden"}})}),(0,R.jsx)(B.Z,{title:"删除",children:(0,R.jsx)(ae.Z,{className:le.deleteIcon,onClick:h,style:{visibility:a>1?"visible":"hidden"}})})]})]})},ge=function(e){var n=e.questionTitlePlaceholder,t=e.titleKey,i=e.choiceKey,l=e.analysisKey,a=e.choiceTextKey,o=e.answerKey,s=e.choiceOptionsPath,c=e.allowChangeMode,d=void 0===c||c,u=e.form,h=e.showAnalysis,v=void 0===h||h,x=(0,m.useState)(),g=p()(x,2),y=g[0],_=g[1],w=(0,m.useState)(!1),b=p()(w,2),j=b[0],k=b[1];return(0,R.jsxs)("div",{className:le.wrap,children:[(0,R.jsx)("div",{className:le.questionTitleEditorWrap,children:(0,R.jsx)(f.Z.Item,{label:"题干",name:t,labelCol:{span:24},rules:[{required:!0}],children:(0,R.jsx)(ce,{scrollId:Array.isArray(t)?t.join("_"):"".concat(t),watch:!0,height:140,placeholder:n})})}),(0,R.jsx)(f.Z.Item,{label:"答案选项",required:!0,labelCol:{span:24}}),(0,R.jsx)(f.Z.List,{name:i,rules:[{validator:function(e,n){var t=n.some((function(e){return 1===e[o]})),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(ve[i],"选项的内容"))):t?Promise.resolve():Promise.reject(new Error("请设置正确答案"))}}],children:function(e,n){var t=n.add,i=n.remove;return(0,R.jsxs)("div",{id:Array.isArray(s)?s.join("_"):"".concat(s),children:[e.map((function(n,l){var c=n.key,p=n.name,h=ie()(n,fe),v=y===c,x=l<7&&l===e.length-1;return(0,m.createElement)(f.Z.Item,r()(r()({},h),{},{key:c,name:p,noStyle:!0}),(0,R.jsx)(xe,{choiceTextKey:a,answerKey:o,index:l,isEdit:v,setInputActive:function(){_(c)},form:u,choiceOptionsPath:s,allowChangeMode:d,showAddIcon:x,addItem:function(){return t(pe()(pe()({},a,""),o,0))},deleteItem:function(){return i(p)}}))})),e.length<8&&(0,R.jsx)("div",{className:"".concat(le.addBtn," mb30"),onClick:function(){return t(pe()(pe()({},a,""),o,0))},children:"添加选项"})]})}}),v&&(0,R.jsx)("div",{onClick:function(){return k(!0)},children:(0,R.jsx)(f.Z.Item,{name:l,label:"题目解析",labelCol:{span:24},children:(0,R.jsx)(de,{placeholder:"请编辑题目解析(非必填)",isEdit:j})})})]})},ye=["key","name"],_e=function(e){var n=e.value,t=e.onChange;return(0,R.jsxs)(G.Z,{className:"ml20",children:[(0,R.jsx)(me.Z,{flex:1,children:null==n?void 0:n.map((function(e,i){return(0,R.jsxs)(G.Z,{align:"middle",className:"mb20",children:[(0,R.jsx)(y.Z.TextArea,{style:{flex:1,minHeight:44},defaultValue:e,autoSize:{maxRows:3},maxLength:1e3,onBlur:function(e){var r=O()(n),l=e.target.value.trim();r[i]=l,t(r)}}),(0,R.jsx)(B.Z,{title:"删除",children:(0,R.jsx)(ae.Z,{className:le.deleteIcon,style:{marginLeft:15,visibility:i>0?"visible":"hidden"},onClick:function(){return function(e){S.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确认要删除这个参考答案吗?",className:le.modal,onOk:function(){var i=O()(n);i.splice(e,1),t(i)}})}(i)}})})]},"".concat(e,"_").concat(i))}))}),(0,R.jsx)(me.Z,{children:(0,R.jsx)("div",{className:"".concat(le.addBtn),onClick:function(){var e;(e=O()(n)).push(""),t(e)},children:"新增答案"})})]})},we=function(e){var n=e.value,t=void 0===n||n,i=e.onChange;return(0,R.jsx)(V.Z,{checked:!t,onChange:function(e){i(!e)}})},be="▁",je=function(e){var n,t=e.questionTitlePlaceholder,i=e.form,l=e.name,o=e.scoreByBlank,s=e.answerKey,c=e.titleKey,d=void 0===c?"name":c,u=e.analysisKey,h=void 0===u?"analysis":u,v=e.isOrdered,x=void 0===v?"is_ordered":v,g=(0,m.useState)(!1),_=p()(g,2),w=_[0],j=_[1],k=function(e,n){for(var t=n.line,i=0,r=0;r1?Array.from({length:a},(function(e,n){return o+n})):o)}else if(l>0){var s=k(e,n.from);console.log("新增".concat(l,"个,之前有").concat(s,"个")),t(l,s)}}(e,n,Z,T)}})})}),(0,R.jsx)(f.Z.List,{name:s,rules:[{validator:function(e,n){if(0===(null==n?void 0:n.length))return Promise.reject(new Error("请先在题干中插入填空项"));var t,i=a()(n);try{for(i.s();!(t=i.n()).done;){var r=(t.value||{}).answer_text;if(null!=r&&r.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 l=n.add,a=n.remove;t.errors;return N.current=l,S.current=a,(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(f.Z.Item,{label:(0,R.jsxs)("span",{children:["填空项答案",!(null!=e&&e.length)&&(0,R.jsx)("span",{style:{color:"#E99237"},children:"(请先在题干中插入填空项)"})]}),required:!0,labelCol:{span:24}}),e.map((function(e,n){var t=e.key,l=e.name,a=ie()(e,ye);return(0,R.jsxs)(G.Z,{className:"mb20",align:"top",children:[(0,R.jsxs)(me.Z,{flex:"0 0 auto",className:"".concat(le.blankIndex," pt5"),children:["填空项",n+1]}),(0,R.jsxs)(me.Z,{flex:1,children:[(0,R.jsxs)(G.Z,{align:"top",justify:"space-between",children:[(0,R.jsx)(me.Z,{flex:1,children:(0,R.jsx)(f.Z.Item,r()(r()({},a),{},{name:[l,"answer_text"],noStyle:!0,children:(0,R.jsx)(_e,{})}))}),(null==i?void 0:i.getFieldValue(["sub_item_banks"].concat(O()(o))))&&(0,R.jsx)(me.Z,{flex:"224px",style:{margin:"-7px 0 0 20px"},children:(0,R.jsx)(f.Z.Item,r()(r()({},a),{},{name:[l,"score"],label:"分值",rules:[{required:!0}],className:le.blankInputNumberWrapper,children:(0,R.jsx)(b.Z,{onChange:function(){var e=null==i?void 0:i.getFieldValue(["sub_item_banks",null==s?void 0:s[0],"standard_answers"]),n=0;for(var t in e){var r,l;if(null!==(r=e[t])&&void 0!==r&&r.score)n+=Number(null===(l=e[t])||void 0===l?void 0:l.score)}null==i||i.setFieldValue(["sub_item_banks",null==s?void 0:s[0],"question_score"],n)},className:le.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"请输入分值"})}))})]}),(0,R.jsx)(f.Z.Item,r()(r()({},a),{},{name:[l,"position"],noStyle:!0,children:(0,R.jsx)(y.Z,{type:"hidden"})}))]})]},t)}))]})}}),(0,R.jsxs)(G.Z,{align:"middle",children:[(0,R.jsx)(f.Z.Item,{name:[l,"downcase"],valuePropName:"checked",children:(0,R.jsx)(V.Z,{})}),(0,R.jsx)(me.Z,{className:"ml10",children:"判分时忽略答案中的字母大小写"})]}),(0,R.jsxs)(G.Z,{align:"middle",children:[(0,R.jsx)(f.Z.Item,{name:[l,"no_space"],valuePropName:"checked",children:(0,R.jsx)(V.Z,{})}),(0,R.jsx)(me.Z,{className:"ml10",children:"判分时忽略答案中的空格"})]}),(null==P?void 0:P.length)>1&&(0,R.jsxs)(G.Z,{align:"middle",className:(null==P?void 0:P.length)>1?"mb30":"".concat(le.hide),children:[(0,R.jsx)(f.Z.Item,{name:x,children:(0,R.jsx)(we,{})}),(0,R.jsx)(me.Z,{className:"ml10",children:"允许学生每个填空的答案与标准答案的顺序不一致"})]}),(0,R.jsx)("div",{onClick:function(){return j(!0)},children:(0,R.jsx)(f.Z.Item,{name:h,label:"题目解析",labelCol:{span:24},children:(0,R.jsx)(de,{placeholder:"请编辑题目解析(非必填)",isEdit:w})})})]})},ke=["key","name"],Ce=pe()(pe()({},"正确","T"),"错误","F"),Ne=function(e){var n=e.value,t=e.onChange,i=e.form,l=e.choiceKey,a=1===(null==n?void 0:n.is_answer),o=null==n?void 0:n.choice_text,s=function(){var e,a=null==i||null===(e=i.getFieldValue(["sub_item_banks"].concat(O()(l))))||void 0===e?void 0:e.map((function(e){return{choice_text:e.choice_text,is_answer:0}}));null==i||i.setFieldValue(["sub_item_banks"].concat(O()(l)),a),t(r()(r()({},n),{},{is_answer:1}))};return(0,R.jsxs)(G.Z,{className:le.choiceWrap,align:"middle",wrap:!1,children:[(0,R.jsx)(me.Z,{onClick:s,className:"".concat(le.choiceIndex," ").concat(le.judgementIndex," ").concat(a?le.activeAnswer:""),children:Ce[o]}),(0,R.jsx)(me.Z,{flex:1,className:"".concat(le.editorWrap," ml15"),children:(0,R.jsx)("div",{className:"".concat(le.inputBorder," ").concat(le.placeholder," ").concat(a?le.activeJudgementAnswer:""),children:o})}),(0,R.jsx)(me.Z,{flex:"0 0 auto",className:"ml15",children:(0,R.jsx)("div",{onClick:s,className:"".concat(le.setAnswerBtn," ").concat(a?le.activeAnswer:""),children:a?"正确答案":"设为答案"})})]})},Ze=function(e){var n=e.questionTitlePlaceholder,t=e.choiceKey,i=void 0===t?"choices":t,l=e.form,a=e.titleKey,o=void 0===a?"name":a,s=e.analysisKey,c=void 0===s?"analysis":s,d=(0,m.useState)(!1),u=p()(d,2),h=u[0],v=u[1];return(0,R.jsxs)("div",{className:le.wrap,children:[(0,R.jsx)("div",{className:le.questionTitleEditorWrap,children:(0,R.jsx)(f.Z.Item,{label:"题干",name:o,labelCol:{span:24},rules:[{required:!0}],children:(0,R.jsx)(ce,{scrollId:"name",watch:!0,height:140,placeholder:n})})}),(0,R.jsx)(f.Z.Item,{label:"答案选项",required:!0,labelCol:{span:24},children:(0,R.jsx)(f.Z.List,{name:i,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,R.jsx)("div",{id:"choices",children:e.map((function(e){var n=e.key,t=e.name,a=ie()(e,ke);return(0,m.createElement)(f.Z.Item,r()(r()({},a),{},{key:n,name:t,noStyle:!0}),(0,R.jsx)(Ne,{form:l,choiceKey:i}))}))})}})}),(0,R.jsx)("div",{onClick:function(){return v(!0)},children:(0,R.jsx)(f.Z.Item,{name:c,label:"题目解析",labelCol:{span:24},children:(0,R.jsx)(de,{placeholder:"请编辑题目解析(非必填)",isEdit:h})})})]})},Se=t(12563),Te=["value","onChange"],Pe=["key","name"],Ie=function(e){var n=e.value,t=e.onChange,i=ie()(e,Te);return(0,R.jsx)(oe.Z,r()(r()({},i),{},{defaultValue:null==n?void 0:n[0],onChange:function(e){t([e])}}))},Be=function(e){var n=e.value,t=void 0===n?[]:n,i=e.onClose;return(0,R.jsx)(Se.Z,{closable:!0,onClose:i,className:le.keywordTag,children:(0,R.jsx)("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"},children:t.join(" 或 ")})})},Ae=function(e){var n,t,i=e.questionTitlePlaceholder,l=e.form,o=e.showKeywords,s=e.isMustKeyWords,c=void 0===s?o:s,d=e.titleKey,u=void 0===d?"name":d,h=e.analysisKey,v=void 0===h?"analysis":h,g=e.answerTexts,_=void 0===g?"answer_texts":g,w=e.keywords,j=void 0===w?"keywords":w,k=e.useKeywords,C=void 0===k?"use_keywords":k,N=(e.indexs,(0,m.useState)(!1)),Z=p()(N,2),S=Z[0],T=Z[1],P=(0,m.useState)(""),I=p()(P,2),A=I[0],E=I[1],q=null===(n=l.getFieldValue("sub_item_banks"))||void 0===n||null===(n=n[null==C?void 0:C[0]])||void 0===n?void 0:n[null==C?void 0:C[1]],M=null===(t=l.getFieldValue("sub_item_banks"))||void 0===t||null===(t=t[null==C?void 0:C[0]])||void 0===t?void 0:t.question_score;return(0,R.jsxs)("div",{className:le.wrap,children:[(0,R.jsx)("div",{className:le.questionTitleEditorWrap,children:(0,R.jsx)(f.Z.Item,{label:"题干",name:u,labelCol:{span:24},rules:[{required:!0}],children:(0,R.jsx)(ce,{scrollId:"name",watch:!0,height:140,placeholder:i})})}),(0,R.jsx)(f.Z.Item,{label:"参考答案",name:_,labelCol:{span:24},children:(0,R.jsx)(Ie,{watch:!0,height:140,placeholder:"请编辑参考答案(非必填)"})}),o&&!c&&(0,R.jsx)(f.Z.Item,{hidden:!0,name:C,valuePropName:"checked",children:(0,R.jsx)(V.Z,{defaultChecked:!0})}),o&&c&&(0,R.jsxs)(G.Z,{align:"middle",className:"mb30",children:[(0,R.jsx)(f.Z.Item,{name:C,valuePropName:"checked",children:(0,R.jsx)(V.Z,{})}),(0,R.jsx)(me.Z,{className:"ml10",children:"开启关键词自动判分"}),(0,R.jsx)(me.Z,{children:(0,R.jsx)(B.Z,{placement:"right",title:"选中后,需要设置每个关键词的分值,系统会根据设置的关键词进行自动判分; 所有关键词分值之和必须小于等于小题分值。",children:(0,R.jsx)(K.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})})})]}),(q||!c)&&(0,R.jsx)(f.Z.List,{name:j,rules:[{validator:function(e,n){return c?null!=n&&n.length?(null==n?void 0:n.reduce((function(e,n){return e+n.score}),0))>parseFloat(M)?Promise.reject(new Error("所有关键词的分值之和必须小于等于该小题的分值")):Promise.resolve():Promise.reject(new Error("请输入关键词")):Promise.resolve()}}],children:function(e,n){var t=n.add,i=n.remove;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("div",{className:"".concat(le.title," mb10"),children:c?"关键词":(0,R.jsx)("span",{style:{color:"#9096A3"},children:"判分关键词"})}),(0,R.jsxs)(G.Z,{align:"middle",className:"font14 mb30",children:[(0,R.jsx)(me.Z,{flex:1,children:(0,R.jsx)(y.Z,{value:A,onChange:function(e){E(e.target.value)},maxLength:50,allowClear:!0,onPressEnter:function(e){var n,i,r,o,s="".concat(null===(n=e.target)||void 0===n?void 0:n.value),c=null==s||null===(i=s.split("|"))||void 0===i||null===(i=i.filter((function(e){return!!e})))||void 0===i?void 0:i.map((function(e){return e.trim()})),d=l.getFieldValue(["sub_item_banks"].concat(O()(j))),u=(null==d||null===(r=d.map((function(e){return null==e?void 0:e.keyword})))||void 0===r?void 0:r.flat())||[],p=a()(c);try{for(p.s();!(o=p.n()).done;){var m=o.value;if(u.includes(m))return void x.ZP.error("为避免判分错误,请勿设置相同的关键词")}}catch(e){p.e(e)}finally{p.f()}(function(e){if(!e)return!1;if(!/^s*$/.test(e)&&""!==e.trim())return new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~!@#¥……&*()—【】‘;:”“。,、?「」『』_\\+\\-·%《》]|[\\\\/]"),"|"!==e||(x.ZP.warning("关键词不能只输入一个“|”字符!"),!1);x.ZP.warning("关键词不能全为空格")})(s)&&(t({keyword:c,score:1}),E(""))},className:le.inputBorder,placeholder:"支持设置多个关键词;并列关键词(或的关系)请用“|”分隔开"})}),(0,R.jsx)(me.Z,{flex:"148px",style:{textAlign:"right",color:"#9096A3"},children:"“回车键”保存关键词"})]}),e.map((function(e){var n=e.key,t=e.name,l=ie()(e,Pe);return(0,R.jsx)(G.Z,{className:"mb20",style:{marginRight:148},children:(0,R.jsx)(me.Z,{flex:1,children:(0,R.jsxs)(G.Z,{align:"middle",justify:"space-between",children:[(0,R.jsx)(f.Z.Item,r()(r()({},l),{},{name:[t,"keyword"],children:(0,R.jsx)(Be,{onClose:function(){return i(t)}})})),c&&(0,R.jsx)(f.Z.Item,r()(r()({},l),{},{name:[t,"score"],label:"分值",rules:[{required:!0}],className:le.blankInputNumberWrapper,children:(0,R.jsx)(b.Z,{className:le.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"请输入关键词分数"})}))]})})},n)}))]})}}),(0,R.jsx)("div",{onClick:function(){return T(!0)},children:(0,R.jsx)(f.Z.Item,{name:v,label:"题目解析",labelCol:{span:24},children:(0,R.jsx)(de,{placeholder:"请编辑题目解析(非必填)",isEdit:S})})})]})},Ee=["key","name"],qe=re.Z.Panel,Me=function(e){var n=e.questionTitlePlaceholder,t=(e.choiceKey,e.form),i=e.withScore,l=(0,m.useState)(),a=p()(l,2),o=a[0],s=a[1],c=(0,m.useState)([]),d=p()(c,2),u=d[0],h=d[1],v=function(e){h(e)},x=function(e){var n=e.value;return(0,R.jsx)("div",{style:{width:150,paddingLeft:11},children:n})};return(0,R.jsxs)("div",{className:le.wrap,children:[(0,R.jsx)("div",{className:le.questionTitleEditorWrap,children:(0,R.jsx)(f.Z.Item,{label:"题干",name:"name",labelCol:{span:24},rules:[{required:!0}],children:(0,R.jsx)(ce,{scrollId:"name",watch:!0,height:140,placeholder:n})})}),(0,R.jsx)(f.Z.Item,{label:"小题",required:!0,labelCol:{span:24}}),(0,R.jsx)(f.Z.List,{name:"sub_item_banks",rules:[{validator:function(e,n){return n?Promise.resolve():Promise.reject(new Error("请添加小题"))}}],children:function(e,n){var l=n.add,a=n.remove,c=n.move,d=t.getFieldValue("sub_item_banks");return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(re.Z,{className:e.length>0?le.collapseWrapper:"",bordered:!1,activeKey:u,onChange:v,expandIcon:function(e){var n=e.isActive;return(0,R.jsx)("i",{className:"iconfont icon-weizhankai ".concat(n?le.open:le.close),style:{fontSize:14,transition:"all .2s"}})},children:e.map((function(n,l){n.key;var u,p,m,h,v,g,y,_,j,k,C,N,Z,S,T=n.name,P=ie()(n,Ee);return(0,R.jsx)(qe,{className:le.panel,forceRender:!0,header:(0,R.jsxs)("div",{className:le.panelHeader,children:["第",l+1,"小题",(0,R.jsxs)("span",{children:["(",0==(null==d||null===(u=d[T])||void 0===u?void 0:u.question_type)?"单选题":1==(null==d||null===(p=d[T])||void 0===p?void 0:p.question_type)?"多选题":3==(null==d||null===(m=d[T])||void 0===m?void 0:m.question_type)?"填空题":2==(null==d||null===(h=d[T])||void 0===h?void 0:h.question_type)?"判断题":"简答题",")"]})]}),extra:(0,R.jsxs)(G.Z,{align:"middle",onClick:function(e){return e.stopPropagation()},children:[3==(null==d||null===(v=d[T])||void 0===v?void 0:v.question_type)&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(w.ZP.Group,{defaultValue:null==d||null===(g=d[T])||void 0===g?void 0:g.use_blank_score,className:A.scoreByBlankRadio,style:{marginRight:20},optionType:"button",options:[{label:"按空给分",value:!0},{label:"按题给分",value:!1}],onChange:function(e){var n,i;if(null==t||t.setFieldValue(["sub_item_banks",T,"use_blank_score"],null==e||null===(n=e.target)||void 0===n?void 0:n.value),null!=e&&null!==(i=e.target)&&void 0!==i&&i.value){var r=0;for(var l in null==t||null===(a=t.getFieldValue(["sub_item_banks",T]))||void 0===a?void 0:a.standard_answers){var a,o;r+=Number(null==t||null===(o=t.getFieldValue(["sub_item_banks",T]))||void 0===o||null===(o=o.standard_answers[l])||void 0===o?void 0:o.score)}null==t||t.setFieldValue(["sub_item_banks",T,"question_score"],r||"")}s(new Date)}}),(0,R.jsx)(B.Z,{overlayInnerStyle:{width:460},title:(0,R.jsxs)("div",{children:["按空给分:需要分别设置每个填空项的分值,填空项答对之后则获得对应的分值。",(0,R.jsx)("br",{}),"按题给分:需要设置整个小题的分值,答对全部填空项之后才能获得该小题的分值。"]}),children:(0,R.jsx)("i",{className:"icon-tishixiaowenhao font18 mr25 c-3061d0"})})]}),i&&(0,R.jsx)(f.Z.Item,r()(r()({},P),{},{rules:[{required:!0,message:"请输入小题分值"}],label:"分值",name:[T,"question_score"],className:le.blankInputNumberWrapper,children:3==(null==d||null===(y=d[T])||void 0===y?void 0:y.question_type)&&null!=d&&null!==(_=d[T])&&void 0!==_&&_.use_blank_score?(0,R.jsx)(x,{}):(0,R.jsx)(b.Z,{className:le.blankInput,placeholder:"请输入分数",min:.1,precision:1,max:100,style:{width:150}})})),(0,R.jsxs)(G.Z,{align:"middle",className:"pl40",style:{width:82},children:[0!==l&&(0,R.jsx)("div",{onClick:function(){var n;c(l,l-1);var i=null===(n=t.getFieldValue("sub_item_banks"))||void 0===n?void 0:n.map((function(n,t){return e.map((function(e,i){t===i&&(n.q_position=Number(e.name)+1)})),n}));t.setFieldValue("sub_item_banks",i)},children:(0,R.jsx)(B.Z,{title:"上移",children:(0,R.jsx)("i",{className:"iconfont icon-shangyi3 c-grey-999 primary-hover"})})}),l0&&(null===(i=v.getFieldValue("sub_item_banks"))||void 0===i||null===(i=i.map((function(e){if(3==e.question_type&&null!=e&&e.use_blank_score){var n=0;for(var t in null==e?void 0:e.standard_answers){var i;n+=Number(null==e||null===(i=e.standard_answers[t])||void 0===i?void 0:i.score)}return n}return e.question_score})))||void 0===i?void 0:i.filter((function(e){return e})));(null==r?void 0:r.length)>0&&v.setFieldsValue({question_score:parseFloat(null==r?void 0:r.reduce((function(e,n){return parseFloat(e)+parseFloat(n)}))).toFixed(1)})}},onFinish:function(e){var t;a(r()(r()(r()({},n),e),{},{sub_item_banks:null==e||null===(t=e.sub_item_banks)||void 0===t?void 0:t.map((function(e){return console.log(e),r()(r()({},e),{},{item_type:null==e?void 0:e.question_type,id:(null==e?void 0:e.question_id)||""})}))}))},onFinishFailed:function(){var e=d()(s()().mark((function e(n){var t;return s()().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,R.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,R.jsxs)("div",{style:{flex:1},children:[(0,R.jsx)("span",{style:{display:"inline-flex",border:"1px solid #9096A3",borderRadius:"50%",width:10,height:10,marginRight:5,background:"#9096A3"}}),(0,R.jsx)("span",{children:"组合题"})]}),!n.isadd&&(0,R.jsxs)("span",{style:{marginLeft:20,marginRight:20,color:"red",cursor:"pointer"},onClick:function(){o()},children:[(0,R.jsx)("i",{className:"iconfont icon-piliangshanchu3",style:{fontSize:14,marginRight:6}}),"删除"]}),(0,R.jsx)(j.ZP,{onClick:function(){var e;n.isadd?(t(!1),u()):(v.setFieldsValue(r()(r()({},n),{},{name:null==n?void 0:n.question_title,choices:null==n||null===(e=n.question_choices)||void 0===e?void 0:e.map((function(e){return r()(r()({},e),{},{standard_boolean:null!=e&&e.standard_boolean?1:0})})),repeat_answer:!(null!=n&&n.repeat_answer)})),t(!1))},children:"取消"}),(0,R.jsx)(j.ZP,{className:"ml20",type:"primary",onClick:function(){v.submit()},children:"保存"})]}),(0,R.jsxs)("div",{style:{maxHeight:"70vh",overflowY:"auto",marginTop:"10px",paddingRight:"5px"},children:[(0,R.jsx)(Q.Z,{text:"(组合题分值等于各小题分值之和)"}),(0,R.jsx)(Me,{form:v,withScore:!0,choiceKey:"",questionTitlePlaceholder:"请编辑组合题题干内容"}),(0,R.jsx)(Y,{getTagData:c,qitem:n,exerciseitem:l,TagDiscipline:i,form:v})]})]})})},Oe=t(48637),De=t(24334),Fe=function(e){var n=e.qitem,t=e.TagDiscipline,i=e.exerciseitem,l=e.setisedit,a=e.seveeditor,o=e.deleteitem,c=e.getTagData,u=e.init,h=f.Z.useForm(),v=p()(h,1)[0];return(0,m.useEffect)((function(){var e,t,i;v.setFieldsValue(r()(r()({},n),{},{standard_answers:n.standard_answer,difficulty:n.difficulty,item_banks_group_id:n.item_banks_group_id,hack:r()(r()({},n),{},{time_limit:(null==n?void 0:n.time_limit)||3}),hack_codes:{language:null==n||null===(e=n.program_attr)||void 0===e?void 0:e.language,code:De.Base64.decode((null==n||null===(t=n.program_attr)||void 0===t?void 0:t.code)||"")},hack_sets:r()({},null==n||null===(i=n.hack_sets)||void 0===i?void 0:i[0]),repeat_answer:!n.repeat_answer}))}),[n]),(0,R.jsx)("div",{children:(0,R.jsxs)(f.Z,{form:v,colon:!1,onValuesChange:function(e,n){if(null!=e&&e.standard_answers){var t,i,r,l=(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==l?void 0:l.length)>0)v.setFieldsValue({question_score:(null==l?void 0:l.length)>0&&(null===(r=l.reduce((function(e,n){return e+n})))||void 0===r?void 0:r.toFixed(1))})}},onFinish:function(e){var t;a(r()(r()(r()({},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 r()(r()({},e),{},{position:n+1})})),standard_answer:void 0}))},onFinishFailed:function(){var e=d()(s()().mark((function e(n){var t;return s()().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,R.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,R.jsxs)("div",{style:{flex:1},children:[(0,R.jsx)("span",{style:{display:"inline-flex",border:"1px solid #9096A3",borderRadius:"50%",width:10,height:10,marginRight:5,background:"#9096A3"}}),(0,R.jsx)("span",{children:"程序填空题"})]}),!n.isadd&&(0,R.jsxs)("span",{style:{marginLeft:20,marginRight:20,color:"red",cursor:"pointer"},onClick:function(){o()},children:[(0,R.jsx)("i",{className:"iconfont icon-piliangshanchu3",style:{fontSize:14,marginRight:6}})," 删除"]}),(0,R.jsx)(j.ZP,{onClick:function(){var e,t,i;n.isadd?(l(!1),u()):(v.setFieldsValue(r()(r()({},n),{},{standard_answers:n.standard_answer,difficulty:n.difficult,item_banks_group_id:n.item_banks_group_id,hack:r()({},n),hack_codes:{language:null==n||null===(e=n.program_attr)||void 0===e?void 0:e.language,code:De.Base64.decode(null==n||null===(t=n.program_attr)||void 0===t?void 0:t.code)},hack_sets:r()({},null==n||null===(i=n.hack_sets)||void 0===i?void 0:i[0]),repeat_answer:!n.repeat_answer})),l(!1))},children:"取消"}),(0,R.jsx)(j.ZP,{className:"ml20",type:"primary",onClick:function(){v.submit()},children:"保存"})]}),(0,R.jsxs)("div",{style:{maxHeight:"70vh",overflowY:"auto",marginTop:"10px",paddingRight:"5px"},children:[(0,R.jsx)(Q.Z,{text:"(小题分值等于各填空项分值之和)"}),(0,R.jsx)(Oe.t,{form:v,questionTitlePlaceholder:"请编辑程序填空题题干内容",scoreByBlank:!0,hackidentifier:null==n?void 0:n.hack_identifier,answerKey:"standard_answers"}),(0,R.jsx)(Y,{getTagData:c,qitem:n,exerciseitem:i,TagDiscipline:t,form:v})]})]})})},Re=function(e){var n,t=e.qitem,i=e.setqitem,l=e.setisedit,a=(e.TagDiscipline,e.exerciseitem,e.seveeditor),o=e.deleteitem,c=f.Z.useForm(),u=p()(c,1)[0];return(0,m.useEffect)((function(){var e,n;u.setFieldsValue(r()(r()({},t),{},{name:null==t?void 0:t.question_title,choices:null==t||null===(e=t.question_choices)||void 0===e?void 0:e.map((function(e){return r()(r()({},e),{},{standard_boolean:null!=e&&e.standard_boolean?1:0})})),repeat_answer:!(null!=t&&t.repeat_answer)})),t.shixun=null==t||null===(n=t.shixun)||void 0===n?void 0:n.map((function(e){return r()(r()({},e),{},{defaultscore:e.challenge_score})}))}),[]),(0,R.jsxs)("div",{children:[(0,R.jsxs)(f.Z,{form:u,colon:!1,onFinish:function(e){var n,i,l=r()(r()({},e),{},{question_scores:null==t||null===(n=t.shixun)||void 0===n?void 0:n.map((function(e){return e.challenge_score})),item_type:null==t?void 0:t.question_type,choices:null==e||null===(i=e.choices)||void 0===i?void 0:i.map((function(e){return r()(r()({},e),{},{is_answer:e.standard_boolean})}))});a(r()(r()({},t),l))},onFinishFailed:function(){var e=d()(s()().mark((function e(n){var t;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:x.ZP.error(n.errorFields[0].errors[0]),u.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,R.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,R.jsxs)("div",{style:{flex:1},children:[(0,R.jsx)("span",{style:{display:"inline-flex",border:"1px solid #9096A3",borderRadius:"50%",width:10,height:10,marginRight:5,background:"#9096A3"}}),(0,R.jsx)("span",{children:"实训题"})]}),(0,R.jsxs)("span",{style:{marginLeft:20,marginRight:20,color:"red",cursor:"pointer"},onClick:function(){o()},children:[(0,R.jsx)("i",{className:"iconfont icon-piliangshanchu3",style:{fontSize:14,marginRight:6}}),"删除"]}),(0,R.jsx)(j.ZP,{onClick:function(){var e,n;u.setFieldsValue(r()(r()({},t),{},{name:null==t?void 0:t.question_title,choices:null==t||null===(e=t.question_choices)||void 0===e?void 0:e.map((function(e){return r()(r()({},e),{},{standard_boolean:null!=e&&e.standard_boolean?1:0})})),repeat_answer:!(null!=t&&t.repeat_answer)})),t.shixun=null==t||null===(n=t.shixun)||void 0===n?void 0:n.map((function(e){return r()(r()({},e),{},{challenge_score:e.defaultscore})})),i(r()({},t)),l(!1)},children:"取消"}),(0,R.jsx)(j.ZP,{className:"ml20",type:"primary",onClick:d()(s()().mark((function e(){var n,i,r;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((null==t||null===(n=t.shixun)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,(function(e){return e.challenge_score})).filter((function(e){return e})).length)<(null==t||null===(r=t.shixun)||void 0===r?void 0:r.length))){e.next=3;break}return x.ZP.info("分数不能为空"),e.abrupt("return");case 3:u.submit();case 4:case"end":return e.stop()}}),e)}))),children:"保存"})]}),(0,R.jsx)(Q.Z,{text:"(实训题分值等于各关卡分值之和)"}),(0,R.jsx)(f.Z.Item,{label:"题干",name:"question_title",labelCol:{span:24},rules:[{required:!0}],children:(0,R.jsx)(oe.Z,{watch:!0,height:140,placeholder:"",defaultValue:t.question_title})})]}),(0,R.jsxs)(G.Z,{style:{marginBottom:15},align:"middle",justify:"space-between",children:[(0,R.jsxs)("div",{children:[(0,R.jsx)("span",{style:{color:"red"},children:"*"}),"关卡名称"]}),(0,R.jsxs)("a",{href:"/shixuns/".concat(null==t?void 0:t.shixun_identifier,"/challenges?exercise=true"),target:"_blank",children:[(0,R.jsx)("i",{onClick:function(){},className:"iconfont icon-shixunkecheng font14 mr5"}),"实训详情"]})]}),null==t||null===(n=t.shixun)||void 0===n?void 0:n.map((function(e,n){return(0,R.jsxs)("div",{style:{display:"flex",marginBottom:20},children:[(0,R.jsxs)("div",{style:{flex:1},children:[n+1,"、",e.challenge_name]}),(0,R.jsxs)("div",{children:[(0,R.jsx)("span",{style:{color:"red"},children:"*"}),"分值",(0,R.jsx)(b.Z,{precision:1,value:null==e?void 0:e.challenge_score,onChange:function(e){var l=JSON.parse(JSON.stringify((null==t?void 0:t.shixun)||[]));l[n].challenge_score=e;var a=l.every((function(e){return!e.challenge_score})),o=parseFloat(null==l?void 0:l.map((function(e){return e.challenge_score})).reduce((function(e,n){return parseFloat(e||0)+parseFloat(n||0)})));u.setFieldsValue({question_score:a?"":o.toFixed(1)}),i(r()(r()({},t),{},{shixun:l}))},max:100,min:1,style:{marginLeft:10,width:150},placeholder:"请输入分值",size:"middle"})]})]},e.challenge_id)}))]})},ze="warp___w1JUC",Ge="indexTag___LPncW",We="normalWrap___pEIzs",He="redio___I6tXM",Ve="redioitem___cS4Gp",Ke="redioitemyes___JBDmk",Ue="title___XAohQ",Ye="titleyes____bNQk",Je="yestag___zQnb1",Xe="checkbox___MHadU",Qe="checkboxitem___KX7mB",$e="checkboxitemyes___MpOWf",en="bottom___FkHfO",nn="bottomitem___AS0Qp",tn="left___U23z1",rn="right___yJVEk",ln="completion___Bu5G6",an="content___LySPW",on="items___ETMq9",sn="simple___XX5t0",cn="shixunWrapper___w6oIG",dn="shixun___ePWKn",un="score___nGh9k",pn="qtitle___DAMW1",mn="program___Mm1qL",hn="combination___Sw7S6",fn="qtype___Xdl60",vn=t(30347),xn=["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."],gn=[{type:0,name:"单选题"},{type:1,name:"多选题"},{type:2,name:"判断题"},{type:3,name:"填空题"},{type:4,name:"简答题"},{type:5,name:"实训题"},{type:6,name:"编程题"},{type:7,name:"组合题"},{type:8,name:"程序填空题"}],yn=function(e){var n,t,i,r,l,a,o,s,c,d,u,p,m,h,f=e.qitem;return(0,R.jsxs)("div",{className:ze,children:[(0===(null==f?void 0:f.question_type)||2===(null==f?void 0:f.question_type))&&(0,R.jsx)("div",{className:We,children:null==f||null===(n=f.question_choices)||void 0===n?void 0:n.map((function(e,n){return(0,R.jsxs)("div",{className:He,children:[!(null!=e&&e.standard_boolean)&&(0,R.jsx)("span",{className:Ve}),(null==e?void 0:e.standard_boolean)&&(0,R.jsx)("i",{className:"".concat(Ke," icon-duigou1")}),(0,R.jsx)("span",{className:"".concat(null!=e&&e.standard_boolean?Ye:Ue," ").concat(Ge),children:0===(null==f?void 0:f.question_type)?xn[n]:""}),(0,R.jsx)(F.Z,{className:null!=e&&e.standard_boolean?Ye:Ue,value:null==e?void 0:e.choice_text}),(null==e?void 0:e.standard_boolean)&&(0,R.jsx)("div",{className:Je,children:"正确答案"})]},n)}))}),1===(null==f?void 0:f.question_type)&&(0,R.jsx)("div",{className:We,children:null==f||null===(t=f.question_choices)||void 0===t?void 0:t.map((function(e,n){return(0,R.jsxs)("div",{className:Xe,children:[!(null!=e&&e.standard_boolean)&&(0,R.jsx)("span",{className:Qe}),(null==e?void 0:e.standard_boolean)&&(0,R.jsx)("i",{className:"".concat($e," icon-duigou1")}),(0,R.jsx)("span",{className:"".concat(null!=e&&e.standard_boolean?Ye:Ue," ").concat(Ge),children:xn[n]}),(0,R.jsx)(F.Z,{className:null!=e&&e.standard_boolean?Ye:Ue,value:null==e?void 0:e.choice_text}),(null==e?void 0:e.standard_boolean)&&(0,R.jsx)("div",{className:Je,children:"正确答案"})]},n)}))}),3===(null==f?void 0:f.question_type)&&(0,R.jsx)("div",{className:ln,children:null==f||null===(i=f.standard_answers)||void 0===i?void 0:i.map((function(e,n){var t;return(0,R.jsxs)(G.Z,{align:"top",children:[(0,R.jsxs)("span",{className:Ue,children:["填空项",n+1]}),(0,R.jsx)("div",{className:an,children:null===(t=e.answer_text)||void 0===t?void 0:t.map((function(n,t){return(0,R.jsx)("div",{className:on,style:2===(null==e?void 0:e.model)?{border:0,padding:0}:{},children:1===(null==e?void 0:e.model)?(0,R.jsx)("pre",{className:"mb0",children:n}):(0,R.jsx)(vn.Z,{value:n,disabled:!0})},t)}))})]})}))}),4===(null==f?void 0:f.question_type)&&(0,R.jsxs)("div",{className:sn,children:[(0,R.jsx)("div",{className:Ue,children:"参考答案"}),(0,R.jsx)("div",{className:"mt10",style:{fontSize:"16px"},children:null!=f&&null!==(r=f.answer_texts)&&void 0!==r&&r[0]?(0,R.jsx)(F.Z,{className:an,value:null==f||null===(l=f.answer_texts)||void 0===l?void 0:l[0]}):(0,R.jsx)("div",{style:{color:"#C1C1C1"},children:"暂未设置~"})}),(0,R.jsxs)("div",{className:"mt20 ",children:[(0,R.jsx)("span",{className:Ue,style:{color:"#3061D0"},children:"判分方式"}),(0,R.jsx)("span",{style:{color:"#000",marginLeft:10,fontSize:"16px"},children:null!=f&&f.use_keywords?"关键词自动判分":"手动判分"})]})]}),5===(null==f?void 0:f.question_type)&&(0,R.jsx)("div",{className:cn,children:null==f||null===(a=f.shixun)||void 0===a?void 0:a.map((function(e,n){return(0,R.jsxs)("div",{className:"".concat(dn," mb30"),children:[(0,R.jsxs)("span",{className:un,children:["(",null==e?void 0:e.challenge_score,"分)"]}),(0,R.jsxs)("span",{className:pn,children:[(null==f?void 0:f.index)+"."+(n+1),"、",null==e?void 0:e.challenge_name]})]},n)}))}),6===(null==f?void 0:f.question_type)&&(0,R.jsx)("div",{className:mn,children:(0,R.jsx)(F.Z,{className:an,value:(null==f?void 0:f.description)||"- -"})}),7===(null==f?void 0:f.question_type)&&(null==f||null===(o=f.sub_exercise_questions)||void 0===o?void 0:o.map((function(e,n){var t,i,r,l,a,o;return(0,R.jsxs)("div",{children:[(0,R.jsxs)("div",{className:hn,children:[(0,R.jsxs)("span",{className:un,children:[null==e?void 0:e.question_score,"分"]}),(0,R.jsx)("span",{className:fn,children:null===(t=gn.find((function(n){return n.type==e.question_type})))||void 0===t?void 0:t.name}),(0,R.jsxs)("span",{className:pn,children:[n+1,"、",null==e?void 0:e.question_title]})]}),(0===e.question_type||2===e.question_type)&&(0,R.jsx)("div",{className:ze,style:{padding:"20px 58px 0 58px"},children:(0,R.jsx)("div",{children:null==e||null===(i=e.question_choices)||void 0===i?void 0:i.map((function(e,n){return(0,R.jsxs)("div",{className:He,children:[!(null!=e&&e.standard_boolean)&&(0,R.jsx)("span",{className:Ve}),(null==e?void 0:e.standard_boolean)&&(0,R.jsx)("i",{className:"".concat(Ke," icon-duigou1")}),(0,R.jsx)("span",{className:"".concat(null!=e&&e.standard_boolean?Ye:Ue," ").concat(Ge),children:xn[n]}),(0,R.jsx)(F.Z,{className:null!=e&&e.standard_boolean?Ye:Ue,value:null==e?void 0:e.choice_text}),(null==e?void 0:e.standard_boolean)&&(0,R.jsx)("div",{className:Je,children:"正确答案"})]},n)}))})}),1===e.question_type&&(0,R.jsx)("div",{className:We,children:null==e||null===(r=e.question_choices)||void 0===r?void 0:r.map((function(e,n){return(0,R.jsxs)("div",{className:Xe,children:[!(null!=e&&e.standard_boolean)&&(0,R.jsx)("span",{className:Qe}),(null==e?void 0:e.standard_boolean)&&(0,R.jsx)("i",{className:"".concat($e," icon-duigou1")}),(0,R.jsx)("span",{className:"".concat(null!=e&&e.standard_boolean?Ye:Ue," ").concat(Ge),children:xn[n]}),(0,R.jsx)(F.Z,{className:null!=e&&e.standard_boolean?Ye:Ue,value:null==e?void 0:e.choice_text}),(null==e?void 0:e.standard_boolean)&&(0,R.jsx)("div",{className:Je,children:"正确答案"})]},n)}))}),3===e.question_type&&(0,R.jsx)("div",{className:ln,children:null==e||null===(l=e.standard_answers)||void 0===l?void 0:l.map((function(e,n){var t;return(0,R.jsxs)(G.Z,{align:"top",children:[(0,R.jsxs)("span",{className:Ue,children:["填空项",n+1]}),(0,R.jsx)("div",{className:an,children:null===(t=e.answer_text)||void 0===t?void 0:t.map((function(e,n){return(0,R.jsx)("div",{className:on,children:(0,R.jsx)("pre",{className:"mb0",children:e})},n)}))})]})}))}),4===e.question_type&&(0,R.jsxs)("div",{className:sn,children:[(0,R.jsx)("div",{className:Ue,children:"参考答案"}),(0,R.jsx)("div",{className:"mt10",style:{fontSize:"16px"},children:null!=e&&null!==(a=e.answer_texts)&&void 0!==a&&a[0]?(0,R.jsx)(F.Z,{className:an,value:null==e||null===(o=e.answer_texts)||void 0===o?void 0:o[0]}):(0,R.jsx)("div",{style:{color:"#C1C1C1"},children:"暂未设置~"})}),(0,R.jsxs)("div",{className:"mt20 ",children:[(0,R.jsx)("span",{className:Ue,style:{color:"#3061D0"},children:"判分方式"}),(0,R.jsx)("span",{style:{color:"#000",marginLeft:10,fontSize:"16px"},children:null!=f&&f.use_keywords?"关键词自动判分":"手动判分"})]})]})]},n)}))),8===(null==f?void 0:f.question_type)&&(0,R.jsx)("div",{children:(0,R.jsx)(F.Z,{disabledFill:!0,className:an,showProgramFill:!0,value:De.Base64.decode((null==f||null===(s=f.program_attr)||void 0===s?void 0:s.code)||"")})}),((null==f?void 0:f.question_type)<=4||[6,8].includes(null==f?void 0:f.question_type))&&(0,R.jsxs)("div",{className:en,children:[(0,R.jsxs)("div",{className:"".concat(nn," mb30"),children:[(0,R.jsx)("span",{className:tn,children:"解析"}),(0,R.jsx)("span",{className:rn,children:null!=f&&f.analysis?(0,R.jsx)(F.Z,{value:null==f?void 0:f.analysis}):(0,R.jsx)("span",{style:{color:"#C1C1C1"},children:"暂未设置~"})})]}),(0,R.jsxs)("div",{className:"".concat(nn," mb30"),children:[(0,R.jsx)("span",{className:tn,children:"难度"}),(0,R.jsx)("span",{className:rn,children:1===(null==f?void 0:f.difficulty)?"简单":2===(null==f?void 0:f.difficulty)?"适中":"困难"})]}),(0,R.jsxs)("div",{className:nn,children:[(0,R.jsx)("span",{className:tn,children:"知识点"}),(0,R.jsx)(B.Z,{title:(null==f||null===(c=f.tag_discipline_names)||void 0===c?void 0:c.length)<=0||1==(null==f||null===(d=f.tag_discipline_names)||void 0===d?void 0:d.length)&&["-"].includes(null==f?void 0:f.tag_discipline_names[0])?"暂未设置~":null==f||null===(u=f.tag_discipline_names)||void 0===u||null===(u=u.join(";"))||void 0===u?void 0:u.toString(),children:(0,R.jsx)("span",{className:rn,children:(null==f||null===(p=f.tag_discipline_names)||void 0===p?void 0:p.length)<=0||1==(null==f||null===(m=f.tag_discipline_names)||void 0===m?void 0:m.length)&&["-"].includes(null==f?void 0:f.tag_discipline_names[0])?(0,R.jsx)("span",{style:{color:"#C1C1C1"},children:"暂未设置~"}):null==f||null===(h=f.tag_discipline_names)||void 0===h||null===(h=h.join(";"))||void 0===h?void 0:h.toString()})})]})]})]})},_n=t(91099),wn=t(42230),bn=function(e){var n=e.qitem,t=e.setisedit,i=e.TagDiscipline,l=e.exerciseitem,a=e.seveeditor,o=e.deleteitem,c=e.getTagData,u=e.init,h=f.Z.useForm(),v=p()(h,1)[0];return(0,m.useEffect)((function(){v.setFieldsValue(r()(r()({},n),{},{name:n.question_title,answer_texts:n.answer_texts,repeat_answer:!n.repeat_answer}))}),[n]),(0,R.jsx)("div",{children:(0,R.jsxs)(f.Z,{form:v,colon:!1,onFinish:function(e){a(r()(r()({},n),e))},onFinishFailed:function(){var e=d()(s()().mark((function e(n){var t;return s()().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,R.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,R.jsxs)("div",{style:{flex:1},children:[(0,R.jsx)("span",{style:{display:"inline-flex",border:"1px solid #9096A3",borderRadius:"50%",width:10,height:10,marginRight:5,background:"#9096A3"}}),(0,R.jsx)("span",{children:"简答题"})]}),!(null!=n&&n.isadd)&&(0,R.jsxs)("span",{style:{marginLeft:20,marginRight:20,color:"red",cursor:"pointer"},onClick:function(){o()},children:[(0,R.jsx)("i",{className:"iconfont icon-piliangshanchu3",style:{fontSize:14,marginRight:6}}),"删除"]}),(0,R.jsx)(j.ZP,{onClick:function(){n.isadd?(t(!1),u()):(v.setFieldsValue(r()(r()({},n),{},{name:null==n?void 0:n.question_title,answer_texts:n.answer_texts||[],repeat_answer:!(null!=n&&n.repeat_answer)})),t(!1))},children:"取消"}),(0,R.jsx)(j.ZP,{type:"primary",className:"ml20",onClick:function(){v.submit()},children:"保存"})]}),(0,R.jsxs)("div",{style:{maxHeight:"70vh",overflowY:"auto",marginTop:"10px",paddingRight:"5px"},children:[(0,R.jsx)(f.Z.Item,{className:A.scoreinput,name:"question_score",label:"分值",rules:[{required:!0,message:"请输入分值"}],children:(0,R.jsx)(b.Z,{onBlur:function(e){"0"===e.target.value&&x.ZP.error("分值必须大于0且小于等于100")},style:{width:150},precision:1,placeholder:"请输入分值",max:100,min:.1})}),(0,R.jsx)(wn.W,{form:v,showKeywords:!0,questionTitlePlaceholder:"请编辑简答题题干内容"}),(0,R.jsx)(Y,{getTagData:c,qitem:n,exerciseitem:l,TagDiscipline:i,form:v})]})]})})},jn=function(e){var n,t,i=e.setScoreShow,r=e.ScoreShow,l=e.exerciseitem,a=e.getdata,o=(0,m.useState)(!1),c=p()(o,2),u=c[0],h=c[1];function f(){return v.apply(this,arguments)}function v(){return(v=d()(s()().mark((function e(){var n,t,i,r;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=null==l||null===(n=l.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,q.ZP)("/api/examination_banks/".concat(null==l||null===(t=l.exercise)||void 0===t?void 0:t.id,"/batch_set_score.json"),{method:"POST",body:{question_arr:i}});case 3:0===(null==(r=e.sent)?void 0:r.status)&&a();case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return(0,R.jsxs)("div",{children:[r&&(0,R.jsxs)(S.Z,{title:!1,footer:!1,open:r,width:640,centered:!0,zIndex:10,closable:!1,className:A.scoremodal,onCancel:function(){i(!1)},children:[(0,R.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,R.jsxs)("div",{className:A.title,children:["批量设置分值",(0,R.jsxs)("div",{className:A.score,children:["总分 ",(null==l?void 0:l.exercise_question_types.length)>0&&(null==l||null===(n=l.exercise_types)||void 0===n?void 0:n.q_scores)]})]}),(0,R.jsx)("span",{onClick:function(){return i(!1)},className:A.close,children:"X"})]}),(0,R.jsxs)("div",{className:A.content,children:[(0,R.jsx)("span",{children:"题型名称"}),(0,R.jsx)("span",{children:"小题总数"}),(0,R.jsx)("span",{children:"题型总分"}),(0,R.jsx)("span",{children:"操作"})]}),null==l||null===(t=l.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,n){var t;return(0,R.jsxs)("div",{className:A.items,children:[(0,R.jsx)("span",{children:null==e?void 0:e.name}),(0,R.jsx)("span",{children:null==e||null===(t=e.items)||void 0===t?void 0:t.length}),(0,R.jsx)("span",{children:null==e?void 0:e.score}),(0,R.jsxs)("span",{children:["每题",(0,R.jsx)(b.Z,{min:.1,max:100,onChange:function(n){e.Singlequestion=n},defaultValue:e.Singlequestion,style:{width:90,height:38,margin:"0px 10px",display:"flex",alignItems:"center"}}),"分"]})]},n)})),(0,R.jsxs)("div",{className:A.bottom,children:[(0,R.jsx)(j.ZP,{className:A.no,onClick:function(){i(!1)},children:"取消"}),(0,R.jsx)(j.ZP,{className:A.yes,onClick:function(){var e;null!=l&&l.use_blank_score&&null!=l&&null!==(e=l.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,R.jsxs)(S.Z,{title:!1,footer:!1,centered:!0,open:u,zIndex:20,width:640,closable:!1,className:A.scoremodal,children:[(0,R.jsxs)("div",{style:{marginTop:40},children:["填空题中存在",(0,R.jsx)("span",{style:{color:"#FA6400"},children:"按空给分"}),"的小题,若批量设置分值会统一将填空题改为按题给分"]}),(0,R.jsxs)("div",{className:A.bottom,children:[(0,R.jsx)(j.ZP,{className:A.no,onClick:function(){h(!1)},children:"取消"}),(0,R.jsx)(j.ZP,{className:A.yes,onClick:function(){f(),h(!1),i(!1)},children:"确认"})]})]})]})},kn=t(99313),Cn=t(14491),Nn=t(53864),Zn="scoremodal___upTFR",Sn="selectWrapper___HH3RX",Tn="allqingchu___BFF1D",Pn="title___hFasb",In="bottom___A1n1C",Bn="yes___P1zzb",An="no___xZqXd",En="titlecount___fqA9P",qn="add___MqV0R",Mn="search___NREgv",Ln="searchIcon___qny3A",On="tabWrap___dR18c",Dn="previewModal___uSiGS",Fn={flex_box_center:"flex_box_center___nnwwA",flex_space_between:"flex_space_between___cRir9",flex_box_vertical_center:"flex_box_vertical_center___FqTZ8",flex_box_center_end:"flex_box_center_end___WU5_v",flex_box_column:"flex_box_column___QZFa1",warp:"warp___aLZwN",shixunbutton:"shixunbutton___Eoa1i",redio:"redio___LJ4js",redioitem:"redioitem___YicCC",redioitemyes:"redioitemyes___lX4Nr",title:"title___pi1jH",titleyes:"titleyes___jiEh7",yestag:"yestag___DLWoP",qcount:"qcount___U9kkL",score:"score___vLK4B",qtitle:"qtitle___kyg0t",checkbox:"checkbox___vjiBw",checkboxitem:"checkboxitem___HW3CP",checkboxitemyes:"checkboxitemyes___kpjek",bottom:"bottom___uG8Zq",bottomitem:"bottomitem___TnJQQ",left:"left___M8WXX",right:"right____dkCI",completion:"completion___H6RmA",content:"content___a2hGC",items:"items___D8mLd",simple:"simple___fQ0OS",shixun:"shixun___nB6Jk",combination:"combination___YrOdz",program:"program___lG0JA"},Rn=["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."],zn=function(e){var n,t,i,r,l,a,o,s,c,d,u=e.qitem;return(0,R.jsxs)("div",{className:Fn.warp,children:[(0,R.jsxs)("div",{className:Fn.mainPart,children:[(0,R.jsxs)("div",{className:Fn.qcount,children:[8===(null==u?void 0:u.question_type)&&(0,R.jsx)(F.Z,{className:Fn.content,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,R.jsx)(F.Z,{className:Fn.qtitle,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,R.jsx)("div",{children:null==u||null===(t=u.choices)||void 0===t?void 0:t.map((function(e,n){return(0,R.jsxs)("div",{className:Fn.redio,children:[!(null!=e&&e.is_answer)&&(0,R.jsx)("span",{className:Fn.redioitem}),(null==e?void 0:e.is_answer)&&(0,R.jsx)("i",{className:"".concat(Fn.redioitemyes," icon-duigou1")}),(0,R.jsx)(F.Z,{className:null!=e&&e.is_answer?Fn.titleyes:Fn.title,value:Rn[n]+(null==e?void 0:e.choice_text)}),(null==e?void 0:e.is_answer)&&(0,R.jsx)("div",{className:Fn.yestag,children:"正确答案"})]})}))}),1===(null==u?void 0:u.question_type)&&(0,R.jsx)("div",{children:null==u||null===(i=u.choices)||void 0===i?void 0:i.map((function(e,n){return(0,R.jsxs)("div",{className:Fn.checkbox,children:[!(null!=e&&e.is_answer)&&(0,R.jsx)("span",{className:Fn.checkboxitem}),(null==e?void 0:e.is_answer)&&(0,R.jsx)("i",{className:"".concat(Fn.checkboxitemyes," icon-duigou1")}),(0,R.jsx)(F.Z,{className:null!=e&&e.is_answer?Fn.titleyes:Fn.title,value:Rn[n]+(null==e?void 0:e.choice_text)}),(null==e?void 0:e.is_answer)&&(0,R.jsx)("div",{className:Fn.yestag,children:"正确答案"})]})}))}),3===(null==u?void 0:u.question_type)&&(0,R.jsx)("div",{className:Fn.completion,children:null==u||null===(r=u.standard_answer)||void 0===r?void 0:r.map((function(e,n){var t;return(0,R.jsxs)("div",{style:{display:"flex"},children:[(0,R.jsxs)("span",{className:Fn.title,children:["填空项",n+1]}),(0,R.jsx)("div",{className:Fn.content,children:null==e||null===(t=e.answer_text)||void 0===t?void 0:t.map((function(e,n){return(0,R.jsx)("div",{className:Fn.items,children:e})}))})]})}))}),4===(null==u?void 0:u.question_type)&&(0,R.jsxs)("div",{className:Fn.simple,children:[(0,R.jsx)("div",{className:Fn.title,children:"参考答案"}),(0,R.jsx)("div",{className:"mt10",style:{fontSize:"16px"},children:null!=u&&null!==(l=u.answer_texts)&&void 0!==l&&l[0]?(0,R.jsx)(F.Z,{className:Fn.content,value:null==u||null===(a=u.answer_texts)||void 0===a?void 0:a[0]}):(0,R.jsx)("div",{style:{color:"#C1C1C1"},children:"暂未设置~"})})]}),5===(null==u?void 0:u.question_type)&&(null==u||null===(o=u.challenge_names)||void 0===o?void 0:o.map((function(e,n){return(0,R.jsx)("div",{className:Fn.shixun,children:(0,R.jsxs)("span",{className:Fn.qtitle,children:[(0,R.jsxs)("span",{style:{marginRight:10},children:["第",(0,E.EM)(n+1),"题"]}),e]})})}))),6===(null==u?void 0:u.question_type)&&(0,R.jsx)("div",{className:Fn.program,children:(0,R.jsx)(F.Z,{className:Fn.content,value:(null==u||null===(s=u.program_attr)||void 0===s?void 0:s.description)||"- -"})}),7===(null==u?void 0:u.question_type)&&(null==u||null===(c=u.sub_item_banks)||void 0===c?void 0:c.map((function(e,n){var t,i,r,l,a;return(0,R.jsxs)("div",{children:[(0,R.jsx)("div",{className:Fn.combination,children:(0,R.jsx)("span",{className:Fn.qtitle,children:null==e?void 0:e.name})}),(0,R.jsx)("div",{className:Fn.warp,style:{padding:"0px",paddingTop:20},children:(0,R.jsxs)("div",{children:[("SINGLE"==(null==e?void 0:e.item_type)||"JUDGMENT"==(null==e?void 0:e.item_type))&&(null==e||null===(t=e.choices)||void 0===t?void 0:t.map((function(e,n){return(0,R.jsxs)("div",{className:Fn.redio,children:[!(null!=e&&e.is_answer)&&(0,R.jsx)("span",{className:Fn.redioitem}),(null==e?void 0:e.is_answer)&&(0,R.jsx)("i",{className:"".concat(Fn.redioitemyes," icon-duigou1")}),(0,R.jsx)(F.Z,{className:null!=e&&e.is_answer?Fn.titleyes:Fn.title,value:Rn[n]+(null==e?void 0:e.choice_text)}),(null==e?void 0:e.is_answer)&&(0,R.jsx)("div",{className:Fn.yestag,children:"正确答案"})]})}))),"MULTIPLE"==(null==e?void 0:e.item_type)&&(null==e||null===(i=e.choices)||void 0===i?void 0:i.map((function(e,n){return(0,R.jsxs)("div",{className:Fn.checkbox,children:[!(null!=e&&e.is_answer)&&(0,R.jsx)("span",{className:Fn.checkboxitem}),(null==e?void 0:e.is_answer)&&(0,R.jsx)("i",{className:"".concat(Fn.checkboxitemyes," icon-duigou1")}),(0,R.jsx)(F.Z,{className:null!=e&&e.is_answer?Fn.titleyes:Fn.title,value:Rn[n]+(null==e?void 0:e.choice_text)}),(null==e?void 0:e.is_answer)&&(0,R.jsx)("div",{className:Fn.yestag,children:"正确答案"})]})}))),"COMPLETION"==(null==e?void 0:e.item_type)&&(0,R.jsx)("div",{className:Fn.completion,children:null==e||null===(r=e.standard_answer)||void 0===r?void 0:r.map((function(e,n){var t;return(0,R.jsxs)("div",{style:{display:"flex"},children:[(0,R.jsxs)("span",{className:Fn.title,children:["填空项",n+1]}),(0,R.jsx)("div",{className:Fn.content,children:null==e||null===(t=e.answer_text)||void 0===t?void 0:t.map((function(e,n){return(0,R.jsx)("div",{className:Fn.items,children:e})}))})]})}))}),"SUBJECTIVE"==(null==e?void 0:e.item_type)&&(0,R.jsxs)("div",{className:Fn.simple,children:[(0,R.jsx)("div",{className:Fn.title,children:"参考答案"}),(0,R.jsx)("div",{className:"mt10",style:{fontSize:"16px"},children:null!=e&&null!==(l=e.answer_texts)&&void 0!==l&&l[0]?(0,R.jsx)(F.Z,{className:Fn.content,value:null==e||null===(a=e.answer_texts)||void 0===a?void 0:a[0]}):(0,R.jsx)("div",{style:{color:"#C1C1C1"},children:"暂未设置~"})})]})]})})]})}))),8===(null==u?void 0:u.question_type)&&(0,R.jsx)("div",{children:(0,R.jsx)(F.Z,{disabledFill:!0,className:Fn.content,showProgramFill:!0,value:De.Base64.decode((null==u||null===(d=u.program_attr)||void 0===d?void 0:d.code)||"")})}),5===(null==u?void 0:u.question_type)&&(0,R.jsxs)("div",{style:{background:"#F6F7F9",padding:"0px 20px",height:46,lineHeight:"46px",marginTop:40,display:"flex",alignItems:"center"},children:[(0,R.jsxs)("div",{style:{flex:1,alignItems:"center",display:"flex"},children:[(0,R.jsxs)("div",{style:{marginRight:30},children:[(0,R.jsx)("span",{style:{marginRight:10},children:"创建者"}),(0,R.jsx)("span",{style:{color:"#000000"},children:(null==u?void 0:u.author_name)||"- -"})]}),(0,R.jsxs)("div",{style:{marginRight:30},children:[(0,R.jsx)("span",{style:{marginRight:10},children:"所属单位"}),(0,R.jsx)("span",{style:{color:"#000000"},children:(null==u?void 0:u.author_school_name)||"- -"})]}),(0,R.jsxs)("div",{style:{marginRight:30},children:[(0,R.jsx)("span",{style:{marginRight:10},children:"学习人数"}),(0,R.jsx)("span",{style:{color:"#000000"},children:(null==u?void 0:u.study_count)||"0"})]})]}),(0,R.jsxs)("a",{className:Fn.shixunbutton,href:"/shixuns/".concat(null==u?void 0:u.identifier,"/challenges?exercise=true"),target:"_blank",children:[(0,R.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,R.jsxs)("div",{className:Fn.bottom,children:[(0,R.jsxs)("div",{className:Fn.bottomitem,children:[(0,R.jsx)("span",{className:Fn.left,children:"解析"}),(0,R.jsx)("span",{className:Fn.right,children:null!=u&&u.analysis?(0,R.jsx)(F.Z,{value:null==u?void 0:u.analysis}):(0,R.jsx)("span",{style:{color:"#C1C1C1"},children:"暂未设置~"})})]}),(0,R.jsxs)("div",{className:Fn.bottomitem,children:[(0,R.jsx)("span",{className:Fn.left,children:"难度"}),(0,R.jsx)("span",{className:Fn.right,children:1===(null==u?void 0:u.difficulty)?"简单":2===(null==u?void 0:u.difficulty)?"适中":"困难"})]}),(0,R.jsxs)("div",{className:Fn.bottomitem,children:[(0,R.jsx)("span",{className:Fn.left,children:"知识点"}),(0,R.jsx)("span",{className:Fn.right,children:null!=u&&u.tag_discipline?null==u?void 0:u.tag_discipline:(0,R.jsx)("span",{style:{color:"#C1C1C1"},children:"暂未设置~"})})]})]})]})},Gn=t(4505),Wn=t(28288),Hn=(0,h.connect)((function(e){return{shixunsDetail:e.shixunsDetail}}))((function(e){var n,t,i,l=e.setScoreShow,o=e.ScoreShow,c=e.onOk,u=e.isshixuns,h=e.isloadings,v=e.dispatch,g=(e.shixunsDetail,(0,m.useState)({type:"0",page:1,per_page:10,updated_at:"",quotes:""})),w=p()(g,2),b=w[0],k=w[1],C=(0,m.useState)([]),Z=p()(C,2),T=Z[0],P=Z[1],I=(0,m.useState)([]),A=p()(I,2),E=A[0],M=A[1],L=(0,m.useState)([]),D=p()(L,2),z=D[0],G=D[1],W=(0,m.useState)([]),V=p()(W,2),U=V[0],Y=V[1],J=(0,m.useState)(!1),X=p()(J,2),Q=X[0],$=X[1],ee=f.Z.useForm(),ne=p()(ee,1)[0],te=(0,m.useState)(),ie=p()(te,2),re=ie[0],le=ie[1],ae=(0,m.useState)(!1),oe=p()(ae,2),se=oe[0],ce=oe[1],de=(0,m.useState)(u),ue=p()(de,2),pe=ue[0],me=ue[1],he=(0,m.useState)([]),fe=p()(he,2),ve=fe[0],xe=fe[1],ge=(0,m.useState)(0),ye=p()(ge,2),_e=ye[0],we=ye[1],be=(0,m.useState)(!0),je=p()(be,2),ke=je[0],Ce=je[1],Ne=(0,m.useState)([]),Ze=p()(Ne,2),Se=Ze[0],Te=Ze[1],Pe=[{name:"全部",value:"",question_type:0},{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:"PROGRAM",question_type:6},{name:"组合题",value:"COMBINATION",question_type:7},{name:"程序填空题",value:"BPROGRAM",question_type:8}],Ie=(0,m.useState)([]),Be=p()(Ie,2),Ae=Be[0],Ee=Be[1],qe=(0,m.useRef)(new Set),Me=(0,m.useRef)(new Set),Le=[{name:"简单",value:1},{name:"适中",value:2},{name:"困难",value:3}],Oe=(0,m.useState)(!1),De=p()(Oe,2),Fe=De[0],Re=De[1];function ze(e){return Ge.apply(this,arguments)}function Ge(){return(Ge=d()(s()().mark((function e(n){var t,i,l,a,o;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if($(!0),k(r()({},n)),!((null==z?void 0:z.length)<=0&&"5"===n.type)){e.next=6;break}return Y([]),$(!1),e.abrupt("return");case 6:return l="5"===n.type?null==z?void 0:z.filter((function(e){return!ve.includes(e)})):null,a="5"===n.type?null==z?void 0:z.filter((function(e){return ve.includes(e)})):null,e.next=10,(0,q.ZP)("/api/item_banks.json",{method:"get",params:r()(r()({},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,ids:l,shixun_ids:a,include_shixuns:!0,keyword:n.keyword?encodeURIComponent(n.keyword):n.keyword,type:"5"===n.type?null:n.type,clazz:"3"===n.type?"ItemBanksGroup":null})});case 10:o=e.sent,Y(o),$(!1);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function We(){return(We=d()(s()().mark((function e(){var n;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,q.ZP)("/api/disciplines.json",{method:"get",params:{source:"question",group_id:0,group_type:"5"===b.type?null:b.type,clazz:"ItemBanksGroup"}});case 2:n=e.sent,P((0,N.L)(null==n?void 0:n.disciplines));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function He(){return(He=d()(s()().mark((function e(){var n;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,q.ZP)("/api/item_banks_groups/all_groups.json",{method:"get"});case 2:0===(null==(n=e.sent)?void 0:n.status)&&Te(n);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ve(e){return Ke.apply(this,arguments)}function Ke(){return(Ke=d()(s()().mark((function e(n){var t,i,l,a,o,c,d;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if($(!0),o=null===(t=n.list)||void 0===t?void 0:t.filter((function(e){return!ve.includes(e)})),c=null===(i=n.list)||void 0===i?void 0:i.filter((function(e){return ve.includes(e)})),0!==o.length||0!==c.length){e.next=7;break}return $(!1),Y([]),e.abrupt("return");case 7:return e.next=9,(0,q.ZP)("/api/item_banks.json",{method:"get",params:r()(r()({},n),{},{discipline_id:(null==n||null===(l=n.courseid)||void 0===l?void 0:l[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,clazz:"3"===n.type?"ItemBanksGroup":null})});case 9:d=e.sent,$(!1),Y(d);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(0,m.useEffect)((function(){o&&(ne.setFieldsValue({item_type:"",courseid:"",tag_discipline_id:null,difficulty:null,keyword:null}),ke&&pe&&(ne.setFieldsValue({item_type:"SHIXUN"}),b.item_type="SHIXUN",k(r()({},b)),Ce(!1)),ze(b),function(){We.apply(this,arguments)}(),function(){He.apply(this,arguments)}())}),[o]),(0,m.useEffect)((function(){_e>0&&setTimeout((function(){we(0)}),2e3)}),[_e]);var Ue=function(){var e=d()(s()().mark((function e(n){var t,i,r,l;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v({type:"shixunsDetail/release",payload:{id:n}});case 2:if(t=e.sent,i=null==t?void 0:t.tag_position,r=(null==t?void 0:t.evaluation_set_position)||[],0!==(l=t.status)){e.next=12;break}return x.ZP.success("发布成功"),ze(b),e.abrupt("return",!0);case 12:2===l?x.ZP.error("第".concat(r.join(","),"关尚未完成,无法申请发布")):3===l?x.ZP.error("每一个关卡至少需要一个技能标签, 第".concat(i.join(","),"关尚未设置技能标签,请补充")):x.ZP.error("尚未创建任务的实训,不能申请发布");case 13:return e.abrupt("return",!1);case 14:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),Ye=function(e){return 1===(null==e?void 0:e.shixun_tag_num)?"未发布的实践项目不能被选用,请先进行发布":""};return(0,R.jsxs)("div",{children:[(0,R.jsxs)(S.Z,{title:!1,footer:!1,open:o,width:1200,centered:!0,className:Zn,onCancel:function(){l(!1)},children:[(0,R.jsx)("div",{style:{display:"flex",alignItems:"center"},children:(0,R.jsx)("div",{className:Pn,children:"题库选题"})}),(0,R.jsx)(kn.Z,{className:On,activeKey:b.type,onChange:function(e){b.type=e,b.page=1,b.updated_at="",b.quotes="",b.courseid="",b.tag_discipline_id=null,b.difficulty=null,b.keyword=null,b.group_id=null,ne.setFieldsValue({courseid:"",tag_discipline_id:null,difficulty:null,keyword:null,group_id:null}),"SHIXUN"===(null==b?void 0:b.item_type)&&"5"!==b.type&&(pe=!0,me(!0)),Re(!1),"5"===b.type&&(pe=!1,me(!1)),k(r()({},b)),ze(r()({},b))},items:[{label:"公共",key:"1"},{label:"团队共享",key:"3"},{label:"收藏夹",key:"2"},{label:"我创建的",key:"0"},{label:(0,R.jsxs)("div",{children:["已选",z.length>0&&(0,R.jsx)("span",{className:En,children:z.length}),_e>0&&(0,R.jsxs)("span",{className:qn,children:["+",_e]})]}),key:"5"}]}),(0,R.jsxs)(f.Z,{layout:"inline",form:ne,onValuesChange:function(e,n){var t=Object.values(n).some((function(e){return null!==e&&""!==e&&void 0!==e})),i=""===n.keyword;if(Re(t||!i),b.page=1,"SHIXUN"===(null==n?void 0:n.item_type)){if("5"===b.type?me(!1):me(!0),e.keyword||""===e.keyword)return;ne.submit()}else{if(null!=e&&e.courseid&&ne.setFieldsValue({tag_discipline_id:""}),me(!1),e.keyword||""===e.keyword)return;ne.submit()}},onFinish:function(e){k(r()(r()({},b),e)),ze(r()(r()({},b),e))},children:[(0,R.jsx)(f.Z.Item,{name:"item_type",children:(0,R.jsx)(H.default,{className:Sn,placeholder:"题型",style:{width:110},size:"middle",children:Pe.map((function(e){return(0,R.jsx)(H.default.Option,{children:e.name},e.value)}))})}),(0,R.jsx)(f.Z.Item,{name:"courseid",children:(0,R.jsx)(_.Z,{className:Sn,style:{width:160},size:"middle",placeholder:"方向&课程",options:T})}),!pe&&(0,R.jsx)(f.Z.Item,{name:"tag_discipline_id",children:(0,R.jsx)(H.default,{className:Sn,placeholder:"知识点",style:{width:160},size:"middle",allowClear:!0,children:null==U||null===(n=U.tag_disciplines)||void 0===n?void 0:n.map((function(e){return(0,R.jsx)(H.default.Option,{children:e.name},e.id)}))})}),(0,R.jsx)(f.Z.Item,{name:pe?"diff":"difficulty",children:(0,R.jsxs)(H.default,{className:Sn,placeholder:"难度",style:{width:118},size:"middle",allowClear:!0,children:[!pe&&Le.map((function(e){return(0,R.jsx)(H.default.Option,{children:e.name},e.value)})),pe&&[{name:"初级",value:1},{name:"中级",value:2},{name:"中高级",value:3},{name:"高级",value:4}].map((function(e){return(0,R.jsx)(H.default.Option,{children:e.name},e.value)}))]})}),pe&&(0,R.jsx)(f.Z.Item,{name:"shixun_publish_status",children:(0,R.jsx)(H.default,{className:Sn,placeholder:"全部状态",style:{width:118},size:"middle",allowClear:!0,children:[{name:"未发布",value:"unpublish"},{name:"静默发布",value:"silent_publish"},{name:"公开发布",value:"public_publish"}].map((function(e){return(0,R.jsx)(H.default.Option,{children:e.name},e.value)}))})}),("3"===b.type||"0"===b.type)&&!pe&&(0,R.jsx)(f.Z.Item,{name:"group_id",children:(0,R.jsxs)(H.default,{className:Sn,placeholder:"文件夹",style:{width:118},size:"middle",showSearch:!0,allowClear:!0,filterOption:function(e,n){return console.log("---",e,n),-1!==n.children.toUpperCase().indexOf(e.toUpperCase())},children:[(0,R.jsx)(H.default.Option,{children:"根目录"},0),"3"===b.type&&(null==Se||null===(t=Se.share_banks_groups)||void 0===t?void 0:t.map((function(e){return(0,R.jsx)(H.default.Option,{children:e.name},e.id)}))),"0"===b.type&&(null==Se||null===(i=Se.my_banks_groups)||void 0===i?void 0:i.map((function(e){return(0,R.jsx)(H.default.Option,{children:e.name},e.id)})))]})}),Fe&&(0,R.jsxs)("span",{className:Tn,onClick:function(){ne.resetFields(),pe=!1,me(!1),Re(!1),ne.submit()},children:[(0,R.jsx)("i",{className:"iconfont icon-guanbi4"}),(0,R.jsx)("span",{children:"清除筛选条件"})]}),(0,R.jsx)(f.Z.Item,{style:{flex:"0 0 auto",marginRight:0,marginLeft:"auto"},name:"keyword",children:(0,R.jsx)(y.Z.Search,{className:Mn,placeholder:"请输入关键词搜索",allowClear:!0,suffix:(0,R.jsx)("i",{className:"iconfont icon-sousuo9 font14 ".concat(Ln),onClick:function(){return ne.submit()}}),onSearch:function(e){ne.submit()}})})]}),(0,R.jsxs)("div",{style:{background:"#F6F7F9",display:"flex",alignItems:"center",marginTop:18,height:40,paddingLeft:10,paddingRight:20},children:[(0,R.jsxs)("div",{onClick:function(){"asc"===b.updated_at?b.updated_at="desc":b.updated_at="asc",k(r()(r()({},b),{},{page:1})),ze(r()(r()({},b),{},{page:1}))},children:[" ",b.updated_at?(0,R.jsx)("img",{src:"asc"===b.updated_at?Gn.Z:Wn.Z,style:{width:"15px",verticalAlign:"text-bottom"},className:"font14 mr5 c-light-primary"}):(0,R.jsx)("i",{style:{fontSize:"14px"},className:"iconfont icon-jiangxu mr5 c-light-primary"}),"按更新时间排序"]}),(0,R.jsxs)("div",{onClick:function(){"asc"===b.quotes?b.quotes="desc":b.quotes="asc",k(r()(r()({},b),{},{page:1})),ze(r()(r()({},b),{},{page:1}))},style:{marginLeft:20},children:[" ",b.quotes?(0,R.jsx)("img",{src:"asc"===b.quotes?Gn.Z:Wn.Z,style:{width:"15px",verticalAlign:"text-bottom"},className:"font14 mr5 c-light-primary"}):(0,R.jsx)("i",{style:{fontSize:"14px"},className:"iconfont icon-jiangxu mr5 c-light-primary"}),"按使用次数排序"]})]}),(0,R.jsx)(Cn.Z,{style:{marginTop:2,marginBottom:20},scroll:{y:260},dataSource:(null==U?void 0:U.items)||(null==U?void 0:U.shixun_list),pagination:!1,loading:Q,rowKey:function(e){return e.id},rowSelection:{type:"checkbox",selectedRowKeys:E,getCheckboxProps:function(e){return{disabled:1===e.shixun_tag_num}},onSelect:function(e,n,t){if(n)pe&&xe([].concat(O()(ve),[e.id])),M([].concat(O()(E),[e.id])),Ee([].concat(O()(Ae),[e])),e.identifier?qe.current.add(e.id):Me.current.add(e.id),we(1),G([].concat(O()(z),[e.id]));else{var i=Ae.filter((function(n){return n.id!==e.id}));Ee(i);var l=i.map((function(e){return e.id}));M(O()(l)),e.identifier?qe.current.delete(e.id):Me.current.delete(e.id);var a=z.filter((function(n){return n!==e.id}));if(G(a),pe){var o=ve.filter((function(n){return n!==e.id}));xe(O()(o))}if("5"===b.type)return void Ve(r()(r()({},b),{},{list:O()(a)}))}},onSelectAll:function(e,n,t){if(e){var i=t.map((function(e){return e.id}));pe&&xe([].concat(O()(ve),O()(i))),Ee([].concat(O()(Ae),O()(t))),M([].concat(O()(E),O()(i))),G([].concat(O()(z),O()(i)));var l,o=a()(t);try{for(o.s();!(l=o.n()).done;){var s=l.value;s.identifier?qe.current.add(s.id):Me.current.add(s.id)}}catch(e){o.e(e)}finally{o.f()}}else{var c=t.map((function(e){return e.id})),d=E.filter((function(e){return!c.some((function(n){return n===e}))})),u=Ae.filter((function(e){return!c.some((function(n){return n===e.id}))}));if(Ee(u),M(O()(d)),G(O()(d)),pe){var p=ve.filter((function(e){return!c.some((function(n){return n===e.id}))}));xe(O()(p))}"5"===b.type&&Ve(r()(r()({},b),{},{list:O()(d)}));var m,h=a()(c);try{for(h.s();!(m=h.n()).done;){var f=m.value;f.identifier?qe.current.delete(f):Me.current.delete(f)}}catch(e){h.e(e)}finally{h.f()}}}},columns:[{title:"题型",dataIndex:"item_type",key:"item_type",render:function(e,n,t){var i;return(0,R.jsx)(B.Z,{title:Ye(n),children:(0,R.jsx)("div",{children:pe||null!=n&&n.challenge_names?"实训题":null==Pe||null===(i=Pe.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:pe?"30%":"60%",key:"name",render:function(e,n,t){var i;return(0,R.jsx)(B.Z,{title:Ye(n),children:(0,R.jsx)("span",{children:(0,R.jsx)(F.Z,{showLines:1,showTextOnly:!0,value:pe||null!=n&&n.challenge_names?null!=n&&n.title||null===e?"--":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:!pe,render:function(e,n,t){var i;return(0,R.jsx)(B.Z,{title:Ye(n),children:(0,R.jsx)("span",{children:e?null==e||null===(i=e.split("、"))||void 0===i?void 0:i[0]:"- -"})})}},{title:"所属单位",dataIndex:"author_school_name",key:"author_school_name",hidden:!pe,render:function(e,n,t){return(0,R.jsx)(B.Z,{title:Ye(n),children:(0,R.jsx)("span",{children:e||"- -"})})}},{title:"难度",dataIndex:"difficulty",key:"difficulty",render:function(e,n,t){var i,r;return(0,R.jsx)(B.Z,{title:Ye(n),children:(0,R.jsx)("div",{children:pe||null!=n&&n.challenge_names?(null==n?void 0:n.level)||(null==Le||null===(i=Le.filter((function(n){return n.value===e})))||void 0===i||null===(i=i[0])||void 0===i?void 0:i.name):null==Le||null===(r=Le.filter((function(n){return n.value===e})))||void 0===r||null===(r=r[0])||void 0===r?void 0:r.name})})}},{title:"关卡数量",dataIndex:"challenges_count",key:"challenges_count",hidden:!pe,render:function(e,n,t){return(0,R.jsx)(B.Z,{title:Ye(n),children:(0,R.jsx)("div",{children:e||"- -"})})}},{title:"使用次数",dataIndex:"quotes",key:"quotes",render:function(e,n,t){return(0,R.jsx)(B.Z,{title:Ye(n),children:(0,R.jsx)("div",{children:pe||null!=n&&n.challenge_names?(null==n?void 0:n.study_count)||(null==n?void 0:n.stu_num):e})})}},{title:(0,R.jsxs)("span",{children:["发布状态 ",(0,R.jsx)(B.Z,{title:"未发布的实践项目不能被选用",children:(0,R.jsx)(K.Z,{})})]}),dataIndex:"shixun_tag_num_name",key:"shixun_tag_num_name",hidden:!pe,render:function(e,n,t){return(0,R.jsx)(B.Z,{title:Ye(n),children:(0,R.jsx)("div",{children:e||"- -"})})}},{title:"操作",dataIndex:"id",key:"item_type",render:function(e,n,t){return(0,R.jsx)(B.Z,{title:Ye(n),children:(0,R.jsxs)("div",{style:{flex:1,textAlign:"start"},children:[(0,R.jsx)("a",{onClick:function(){var e;le(r()(r()({},n),{},{question_type:pe||null!=n&&n.challenge_names?5:null==Pe||null===(e=Pe.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})),ce(!0)},children:"查看"}),1===(null==n?void 0:n.shixun_tag_num)&&(0,R.jsx)("a",{style:{marginLeft:10},onClick:function(){var e;S.Z.confirm({title:"提示",icon:null,centered:!0,width:400,content:(0,R.jsxs)("div",{children:["是否确定发布",(0,R.jsx)("span",{style:{cursor:"pointer",color:"#3061D0"},onClick:function(){window.open("/shixuns/".concat(null==n?void 0:n.identifier,"/challenges"))},children:(null==n?void 0:n.shixun_name)||"--"}),"?"]}),onOk:(e=d()(s()().mark((function e(){return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Ue(null==n?void 0:n.identifier)){e.next=2;break}return e.abrupt("return",new Promise((function(e,n){n()})));case 2:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})})},children:"发布"})]})})}}].filter((function(e){return!e.hidden}))}),(0,R.jsx)(Nn.Z,{current:b.page,total:(null==U?void 0:U.items_count)||(null==U?void 0:U.shixuns_count),style:{marginBottom:20},defaultPageSize:b.per_page,showTotal:function(e){return(0,R.jsxs)("span",{children:["共 ",(0,R.jsx)("span",{style:{color:"#165DFF"},children:e})," 条数据"]})},pageSize:b.per_page,onChange:function(e,n){b.page=e,b.per_page=n,k(r()({},b)),ze(r()({},b))}}),(0,R.jsxs)("div",{className:In,children:[(0,R.jsx)(j.ZP,{className:An,onClick:function(){l(!1)},children:"取消"}),(0,R.jsx)(j.ZP,{loading:h,style:{width:h&&75},className:Bn,onClick:d()(s()().mark((function e(){return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((null==z?void 0:z.length)<=0)){e.next=3;break}return x.ZP.info("当前暂未选择数据"),e.abrupt("return");case 3:c(O()(Me.current),O()(qe.current),!0,null==z?void 0:z.length);case 4:case"end":return e.stop()}}),e)}))),children:"确认"})]})]}),(0,R.jsx)(S.Z,{open:se,title:"题目详情",footer:!1,className:Dn,width:1e3,centered:!0,onCancel:function(){ce(!1)},onOk:function(){ce(!1)},children:(0,R.jsx)(zn,{qitem:re})})]})})),Vn=t(18122),Kn=t(89392),Un=t(70738),Yn=[{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"}],Jn=(0,h.connect)((function(e){return{user:e.user,dispatch:e.dispatch}}))((function(e){var n,t,i,l,a=e.user,o=e.dispatch,c=e.itemid,u=e.setisedits,v=(0,m.useState)(),_=p()(v,2),w=_[0],k=_[1],N=(0,m.useState)(!1),Z=p()(N,2),L=Z[0],O=Z[1],D=(0,m.useState)(),G=p()(D,2),W=G[0],H=G[1],V=(0,m.useState)(),K=p()(V,2),U=K[0],Y=K[1],X=(0,m.useRef)(),Q=(0,m.useRef)(),ee=(0,m.useState)(),te=p()(ee,2),ie=te[0],re=te[1],le=(0,m.useState)(!1),ae=p()(le,2),oe=ae[0],se=ae[1],ce=(0,m.useState)(!1),de=p()(ce,2),ue=de[0],pe=de[1],me=(0,m.useState)(),he=p()(me,2),fe=he[0],ve=he[1],xe=(0,m.useState)(!1),ge=p()(xe,2),ye=ge[0],_e=ge[1],we=(0,m.useState)(!1),be=p()(we,2),je=be[0],ke=be[1],Ce=(0,m.useState)(!1),Ne=p()(Ce,2),Ze=Ne[0],Se=Ne[1],Te=(0,m.useState)(!1),Pe=p()(Te,2),Ie=Pe[0],Be=Pe[1],Ae=(0,m.useState)(!1),Ee=p()(Ae,2),qe=Ee[0],Me=Ee[1],Oe=(0,m.useState)(!1),ze=p()(Oe,2),Ge=(ze[0],ze[1],f.Z.useForm()),We=p()(Ge,1)[0],He=(0,m.useState)(!1),Ve=p()(He,2),Ke=Ve[0],Ue=Ve[1],Ye=(0,m.useRef)(null),Je=(0,h.useSearchParams)(),Xe=p()(Je,1)[0];(0,m.useEffect)((function(){$e(),o({type:"globalSetting/footerToggle",payload:!1})}),[]),(0,m.useEffect)((function(){u(ue)}),[ue]),(0,m.useEffect)((function(){null!=W&&W.question_id&&(Y(null==W?void 0:W.question_score),Q.current=null==W?void 0:W.question_id)}),[null==W?void 0:W.question_id]);var Qe=function(){var e=d()(s()().mark((function e(n){var t;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o({type:"newExercisePaper/getTagDiscipline",payload:{sub_discipline_id:n}});case 2:t=e.sent,ve(t);case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();function $e(){return en.apply(this,arguments)}function en(){return(en=d()(s()().mark((function e(){var n,t,i,l,a;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return se(!0),O(!0),e.next=4,o({type:"newExercisePaper/editExercise",payload:{id:c}});case 4:l=e.sent,se(!1),O(!1),k(l),null!=l&&null!==(n=l.exercise)&&void 0!==n&&n.sub_discipline_id&&Qe(null==l||null===(a=l.exercise)||void 0===a?void 0:a.sub_discipline_id),H(r()(r()({},null==l||null===(t=l.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})),re(r()(r()({},null==l||null===(i=l.exercise_question_types)||void 0===i?void 0:i[0]),{},{indexs:1}));case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function nn(e){return tn.apply(this,arguments)}function tn(){return tn=d()(s()().mark((function e(n){var t,i,l,a,d,u,p,m,h,f=arguments;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(!(f.length>1&&void 0!==f[1])||f[1])&&(se(!0),O(!0)),e.next=4,o({type:"newExercisePaper/editExercise",payload:{id:c}});case 4:d=e.sent,k(d),u=[],null==d||null===(t=d.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){u.push(r()(r()({},e),{},{index:n+1}))}))})),p=null===(i=u.filter((function(e){return e.question_id===(null==n?void 0:n.id)})))||void 0===i?void 0:i[0],m=null==d||null===(l=d.exercise_question_types)||void 0===l?void 0:l.map((function(e,n){if((null==p?void 0:p.question_type)===(null==e?void 0:e.question_type))return r()(r()({},e),{},{indexs:n+1})})),h=null===(a=m.filter((function(e){return e})))||void 0===a?void 0:a[0],re(r()({},h)),H(r()({},p)),Y(null==p?void 0:p.question_score),se(!1),O(!1);case 16:case"end":return e.stop()}}),e)}))),tn.apply(this,arguments)}function rn(e){return ln.apply(this,arguments)}function ln(){return(ln=d()(s()().mark((function e(n){var t,i,l,a;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r()(r()({},n),{},{difficulty:(null==n?void 0:n.difficulty)||2,item_type:n.question_type,sub_discipline_id:null==w||null===(t=w.exercise)||void 0===t?void 0:t.sub_discipline_id,tag_discipline_ids:[],repeat_answer:!n.repeat_answer}),l={},8===n.question_type&&(l=r()(r()({},n),{},{hack:r()(r()({},null==n?void 0:n.hack),{},{difficult:n.difficulty}),hack_codes:r()(r()({},n.hack_codes),{},{code:De.Base64.encode(n.hack_codes.code)}),hack_sets:[r()({},n.hack_sets)],is_blank:!0})),n.tag_discipline_ids&&(i.tag_discipline_ids=Array.isArray(n.tag_discipline_ids)?n.tag_discipline_ids:[n.tag_discipline_ids],l.tag_discipline_ids=Array.isArray(n.tag_discipline_ids)?n.tag_discipline_ids:[n.tag_discipline_ids]),sessionStorage.projectFill&&(l.hack_identifier=sessionStorage.projectFill),e.next=7,(0,q.ZP)("/api/examination_banks/".concat(c,"/examination_banks_item_banks/create_item_bank.json"),{method:"post",body:8===n.question_type?l:i});case 7:0===(null==(a=e.sent)?void 0:a.status)&&(pe(!1),nn(a)),(0,E.Vf)("#question-scroll-id");case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var an=function(){var e=d()(s()().mark((function e(n,t){var i,r;return s()().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:return e.next=6,(0,C.Hb)(c,null===(i=n[0])||void 0===i?void 0:i.file);case 6:0===(r=e.sent).status&&(x.ZP.success("成功导入".concat(null==r?void 0:r.success,"条")),_e(!1),$e()),t();case 9:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),on=function(){var e=d()(s()().mark((function e(n,t){var i;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.kF)({score:(0,Kn.round)(n,1),question_id:null==t?void 0:t.question_id});case 2:if(0!==(null==(i=e.sent)?void 0:i.status)){e.next=7;break}return x.ZP.success("修改成功"),nn({id:Q.current},!1),e.abrupt("return");case 7:-1===(null==i?void 0:i.status)&&Y(null==t?void 0:t.question_score);case 8:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}();function sn(){return cn.apply(this,arguments)}function cn(){return cn=d()(s()().mark((function e(){return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:S.Z.confirm({title:"提示",content:"确定要删除这个试题吗?",okText:"确定",centered:!0,className:A.modalconfirm,onOk:function(){var e=d()(s()().mark((function e(){var n;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!W.question_id){e.next=7;break}return e.next=3,(0,q.ZP)("/api/examination_banks/".concat(c,"/examination_banks_item_banks/").concat(W.question_id,".json"),{method:"delete"});case 3:0===(null==(n=e.sent)?void 0:n.status)&&($e(),pe(!1)),e.next=10;break;case 7:H({}),pe(!1),$e();case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),cancelText:"取消"});case 1:case"end":return e.stop()}}),e)}))),cn.apply(this,arguments)}var dn=function(){var e=d()(s()().mark((function e(n){var t;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,q.ZP)("/api/examination_banks/".concat(c,"/examination_banks_item_banks.json"),{method:"post",body:r()({},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)}}(),un=(0,Vn.I)(),pn=un.overflow,mn=un.handleMouseEnter,hn=un.handleMouseLeave,fn=function(){var e=d()(s()().mark((function e(n){var t,i,r,l;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return O(!0),e.next=3,(0,q.ZP)("/api/examination_banks/".concat(c,"/sort_question_type.json"),{method:"post",body:{question_type:n}});case 3:if(t=e.sent,O(!1),0!==(null==t?void 0:t.status)){e.next=11;break}return e.next=8,o({type:"newExercisePaper/editExercise",payload:{id:c}});case 8:r=e.sent,k(r),null!=r&&null!==(i=r.exercise)&&void 0!==i&&i.sub_discipline_id&&Qe(null==r||null===(l=r.exercise)||void 0===l?void 0:l.sub_discipline_id);case 11:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),vn=function(){return!!ue&&(x.ZP.info("请先保存或取消当前正在编辑的试题。"),!0)},xn=function(e){if(!vn()){if(5===e)return Se(!0),void Be(!0);var n,t,i,r,l,a,o,s,c,d,u,p;if(6!==e)pe(!0),H(2===e?{question_type:e,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:"",tag_discipline_ids:[],question_title:"",analysis:""}:{question_type:e,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:[],question_title:"",is_ordered:!0,use_keywords:!1,use_blank_score:!0,keywords:[],allow_student_debug:!1,submit_rule:1,downcase:!0,no_space:!0});else"course"==Xe.get("pageType")?"course"==Xe.get("updateType")?h.history.push("/problems/newcreate?difficult=".concat(null==w||null===(n=w.exercise)||void 0===n?void 0:n.difficulty,"&sub_discipline_id=").concat(null==w||null===(t=w.exercise)||void 0===t?void 0:t.sub_discipline_id,"&express_id=").concat(null==w||null===(i=w.exercise)||void 0===i?void 0:i.id,"&callback_url=/paperlibrary/add/").concat(null==w||null===(r=w.exercise)||void 0===r?void 0:r.id,"?type=2&pageType=course&updateType=course&courseId=").concat(Xe.get("courseId"),"&stageId=").concat(Xe.get("stageId"))):h.history.push("/problems/newcreate?difficult=".concat(null==w||null===(l=w.exercise)||void 0===l?void 0:l.difficulty,"&sub_discipline_id=").concat(null==w||null===(a=w.exercise)||void 0===a?void 0:a.sub_discipline_id,"&express_id=").concat(null==w||null===(o=w.exercise)||void 0===o?void 0:o.id,"&callback_url=/paperlibrary/add/").concat(null==w||null===(s=w.exercise)||void 0===s?void 0:s.id,"?type=2&pageType=course&courseId=").concat(Xe.get("courseId"),"&stageId=").concat(Xe.get("stageId"))):h.history.push("/problems/newcreate?difficult=".concat(null==w||null===(c=w.exercise)||void 0===c?void 0:c.difficulty,"&sub_discipline_id=").concat(null==w||null===(d=w.exercise)||void 0===d?void 0:d.sub_discipline_id,"&express_id=").concat(null==w||null===(u=w.exercise)||void 0===u?void 0:u.id,"&callback_url=/paperlibrary/add/").concat(null==w||null===(p=w.exercise)||void 0===p?void 0:p.id,"?type=2"))}};return(0,R.jsxs)("div",{children:[(0,R.jsx)(g.Z,{spinning:oe,children:(0,R.jsx)("div",{className:A.bg,children:(0,R.jsxs)("div",{style:{textAlign:"center"},children:[0===(null==w||null===(n=w.exercise_types)||void 0===n?void 0:n.q_counts)&&!ue&&(0,R.jsx)(M.Z,{customText:"还没有试题,从底部操作栏来添加吧~"}),((null==w||null===(t=w.exercise_types)||void 0===t?void 0:t.q_counts)>0||ue)&&(0,R.jsxs)("div",{style:{marginTop:20,borderTop:"1px solid #DCDCDC",display:"block",alignItems:"stretch"},children:[(0,R.jsx)("div",{style:{backgroundColor:"#F6F7F9",display:"inline-block",position:"sticky",top:0},children:(0,R.jsx)(P.Z,{className:A.left,active:!0,loading:L,children:(0,R.jsxs)("div",{className:A.left,children:[(0,R.jsx)("div",{className:A.leftAction,children:(0,R.jsx)(j.ZP,{onClick:function(){vn()||ke(!0)},className:A.Button,children:"批量设置分值"})}),(0,R.jsx)("div",{className:A.scrollWrapper,style:{overflow:pn},onMouseEnter:mn,onMouseLeave:hn,children:null==w||null===(i=w.exercise_question_types)||void 0===i?void 0:i.map((function(e,n){return(0,R.jsxs)("div",{className:"mb30",children:[(0,R.jsxs)("div",{className:A.title,children:[(0,R.jsxs)("div",{className:A.titleleft,children:[(0,R.jsxs)("span",{style:{color:"#000000",fontWeight:400,fontSize:12},children:[" ",(0,E.EM)(n+1),"、【",e.name,"】"]}),(0,R.jsxs)("span",{style:{color:"#464F66",fontSize:12},children:["(",e.count,"小题,共",e.score,"分)"]})]}),(0,R.jsx)(I.Z,{dropdownRender:function(){return function(e,n){return(0,R.jsxs)(T.Z,{children:[(0,R.jsx)(T.Z.Item,{onClick:function(){return xn(null==e?void 0:e.question_type)},children:(0,R.jsx)("span",{className:A.moreSpan,children:"新增"})},"0"),(0,R.jsx)(T.Z.Item,{disabled:0===n,onClick:d()(s()().mark((function e(){var t;return s()().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(!vn()){e.next=4;break}return e.abrupt("return");case 4:return t=(0,E.rz)(null==w?void 0:w.exercise_question_types,n,n-1),e.next=7,fn(t.map((function(e){return e.name})));case 7:case"end":return e.stop()}}),e)}))),children:(0,R.jsx)("span",{className:A.moreSpan,children:"上移"})},"1"),(0,R.jsx)(T.Z.Item,{disabled:n===(null==w?void 0:w.exercise_question_types.length)-1,onClick:d()(s()().mark((function e(){var t;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n!==(null==w?void 0:w.exercise_question_types.length)-1){e.next=2;break}return e.abrupt("return");case 2:if(!vn()){e.next=4;break}return e.abrupt("return");case 4:return t=(0,E.rz)(null==w?void 0:w.exercise_question_types,n,n+1),e.next=7,fn(t.map((function(e){return e.name})));case 7:case"end":return e.stop()}}),e)}))),children:(0,R.jsx)("span",{className:A.moreSpan,children:"下移"})},"2"),(0,R.jsx)(T.Z.Item,{onClick:function(){var n;We.setFieldsValue({name:e.name,item_type_en:null===(n=Yn.find((function(n){return n.id==e.question_type})))||void 0===n?void 0:n.nameType}),Ue(!0)},children:(0,R.jsx)("span",{className:A.moreSpan,children:"重命名"})},"3")]})}(e,n)},placement:"bottomLeft",children:(0,R.jsx)("div",{className:A.more_style,children:(0,R.jsx)("i",{className:"iconfont icon-sandian font12"})})})]}),(0,R.jsx)(z,{isedit:ue,setBigqitem:re,bigitem:r()(r()({},e),{},{indexs:n+1}),setqitem:function(){var e=d()(s()().mark((function e(n){var t;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null===(t=X.current)||void 0===t||t.blur(),H(n);case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),qitem:W,Itemid:c,getdata:nn,data:e.items})]},n)}))})]})})}),(0,R.jsx)(P.Z,{className:A.right,active:!0,loading:oe,children:(0,R.jsxs)("div",{id:"question-scroll-id",className:A.right,ref:Ye,children:[!(null!=W&&W.isadd)&&(0,R.jsxs)("div",{className:A.title,children:[!ue&&(0,R.jsxs)("div",{style:{flex:1},children:[(0,R.jsxs)("span",{style:{color:"#000000",fontWeight:600,fontSize:16},children:[" ",(null==ie?void 0:ie.indexs)&&(0,E.EM)(null==ie?void 0:ie.indexs),"、【",null==ie?void 0:ie.name,"】"]}),(0,R.jsx)(B.Z,{title:"编辑题型名称",children:(0,R.jsx)("i",{className:"".concat(A.edit," iconfont icon-bianji_Hover mr5 ml5 font18"),onClick:function(){var e;We.setFieldsValue({name:ie.name,item_type_en:null===(e=Yn.find((function(e){return e.id==ie.question_type})))||void 0===e?void 0:e.nameType}),Ue(!0)}})}),(0,R.jsxs)("span",{style:{color:"#464F66",fontSize:16,fontWeight:400},children:["(",null==ie?void 0:ie.count,"小题,共",null==ie?void 0:ie.score,"分)"]})]}),(0,R.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[5===(null==W?void 0:W.question_type)&&!ue&&(0,R.jsxs)("a",{className:A.shixun,href:"/shixuns/".concat(null==W?void 0:W.shixun_identifier,"/challenges?exercise=true"),target:"_blank",children:[(0,R.jsx)("i",{onClick:function(){},style:{marginRight:20},className:"iconfont icon-shixunkecheng mr5 "}),"实训详情"]}),!ue&&[0,1,2,4,6].includes(null==W?void 0:W.question_type)&&(0,R.jsx)(f.Z.Item,{label:"分值",style:{margin:"0 20px"},required:!0,children:(0,R.jsx)(b.Z,{precision:1,ref:X,onChange:function(e){return Y(e)},value:U,onBlur:function(e){on(e.target.value,W)}})}),!ue&&(0,R.jsx)(B.Z,{title:"删除",children:(0,R.jsx)("i",{onClick:function(){sn()},style:{marginRight:20},className:"".concat(A.delete," iconfont icon-shanchu13 mr5 ")})}),!ue&&(0,R.jsx)(B.Z,{title:"编辑试题",children:(0,R.jsx)("i",{onClick:function(){var e,n,t;6===(null==W?void 0:W.question_type)?"course"==Xe.get("pageType")?"course"==Xe.get("updateType")?h.history.push("/problems/newedit/".concat(null==W?void 0:W.hack_identifier,"?type=exercises&express_id=").concat(null==w||null===(e=w.exercise)||void 0===e?void 0:e.id,"&question_id=").concat(null==W?void 0:W.question_id,"&score=").concat(null==W?void 0:W.question_score,"&exercise=true&callback_url=").concat(location.pathname,"?type=2&pageType=course&updateType=course&courseId=").concat(Xe.get("courseId"),"&stageId=").concat(Xe.get("stageId"))):h.history.push("/problems/newedit/".concat(null==W?void 0:W.hack_identifier,"?type=exercises&express_id=").concat(null==w||null===(n=w.exercise)||void 0===n?void 0:n.id,"&question_id=").concat(null==W?void 0:W.question_id,"&score=").concat(null==W?void 0:W.question_score,"&exercise=true&callback_url=").concat(location.pathname,"?type=2&pageType=course&courseId=").concat(Xe.get("courseId"),"&stageId=").concat(Xe.get("stageId"))):h.history.push("/problems/newedit/".concat(null==W?void 0:W.hack_identifier,"?type=exercises&express_id=").concat(null==w||null===(t=w.exercise)||void 0===t?void 0:t.id,"&question_id=").concat(null==W?void 0:W.question_id,"&score=").concat(null==W?void 0:W.question_score,"&exercise=true&callback_url=").concat(location.pathname,"$?type=2")):pe(!0)},className:"".concat(A.edit," iconfont icon-bianji_Hover mr5 ")})})]})]}),!ue&&(0,R.jsxs)("div",{children:[(0,R.jsxs)("div",{className:A.qcount,children:[(0,R.jsxs)("span",{className:A.score,children:[null==W?void 0:W.question_score,"分"]}),(0,R.jsx)(F.Z,{className:A.qtitle,value:(null==W?void 0:W.index)+"、"+"".concat(8==(null==W?void 0:W.question_type)?null==W||null===(l=W.program_attr)||void 0===l?void 0:l.description:null==W?void 0:W.question_title)})]}),(0,R.jsx)(yn,{TagDiscipline:fe,qitem:W})]}),ue&&(0,R.jsxs)("div",{children:[(null==W?void 0:W.question_type)<=1&&(0,R.jsx)(J,{getTagData:Qe,deleteitem:sn,seveeditor:rn,exerciseitem:w,TagDiscipline:fe,setisedit:pe,qitem:W,init:$e}),5===(null==W?void 0:W.question_type)&&(0,R.jsx)(Re,{setqitem:H,deleteitem:sn,seveeditor:rn,exerciseitem:w,TagDiscipline:fe,setisedit:pe,qitem:W}),3===(null==W?void 0:W.question_type)&&(0,R.jsx)($,{getTagData:Qe,deleteitem:sn,seveeditor:rn,exerciseitem:w,TagDiscipline:fe,setisedit:pe,qitem:W,init:$e}),2===(null==W?void 0:W.question_type)&&(0,R.jsx)(ne,{getTagData:Qe,deleteitem:sn,seveeditor:rn,exerciseitem:w,TagDiscipline:fe,setisedit:pe,qitem:W,init:$e}),4===(null==W?void 0:W.question_type)&&(0,R.jsx)(bn,{getTagData:Qe,deleteitem:sn,seveeditor:rn,exerciseitem:w,TagDiscipline:fe,setisedit:pe,qitem:W,init:$e}),7===(null==W?void 0:W.question_type)&&(0,R.jsx)(Le,{getTagData:Qe,deleteitem:sn,seveeditor:rn,exerciseitem:w,TagDiscipline:fe,setisedit:pe,qitem:W,init:$e}),8===(null==W?void 0:W.question_type)&&(0,R.jsx)(Fe,{getTagData:Qe,deleteitem:sn,seveeditor:rn,exerciseitem:w,TagDiscipline:fe,setisedit:pe,qitem:W,init:$e})]})]})})]})]})})}),(0,R.jsx)("div",{className:A.bottomdiv,children:(0,R.jsxs)("div",{style:{width:1200,margin:"0px auto",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,R.jsx)("span",{className:A.spanBtn,onClick:function(){vn()||(Se(!0),Be(!1))},children:"题库选题"}),(0,R.jsx)("span",{className:A.spanBtn,onClick:function(){vn()||_e(!0)},children:"导入试题"}),(0,R.jsx)("span",{className:A.spanBtn,onClick:d()(s()().mark((function e(){var n,t;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!vn()){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,(0,C.JP)(c);case 4:0===(n=e.sent).status&&window.open("/classrooms/coursesId/exercise/".concat(n.exercise_id,"/").concat(null===(t=a.userInfo)||void 0===t?void 0:t.login,"/initate_answer"));case 6:case"end":return e.stop()}}),e)}))),children:"模拟考试"}),(0,R.jsx)("span",{className:A.spanBtn,onClick:function(){vn()||window.open("/paperlibrary/see/".concat(c))},children:"试卷预览"}),null==Yn?void 0:Yn.map((function(e,n){return(0,R.jsx)(j.ZP,{className:A.addQuestionBtn,type:"primary",onClick:function(){xn(e.id)},children:e.name},n)})),(0,R.jsxs)("span",{className:A.saveBtn,onClick:function(){if("course"==Xe.get("pageType"))if("course"==Xe.get("updateType"))x.ZP.info("编辑成功"),h.history.replace("/paths/".concat(Xe.get("courseId")));else{if(vn())return;(0,Un._C)({id:Xe.get("stageId"),subject_id:Xe.get("courseId"),homework_type:"exercise",examination_bank_ids:[c]}).then((function(e){0==(null==e?void 0:e.status)&&(x.ZP.info("创建成功"),h.history.replace("/paths/".concat(Xe.get("courseId"))))}))}else{if(vn())return;x.ZP.info("创建成功"),h.history.push("/paperlibrary?defaultActiveKey=0")}},children:[(0,R.jsx)("i",{className:"iconfont icon-baocun1",style:{fontSize:15,marginRight:5}}),"保存试卷"]})]})}),(0,R.jsx)(jn,{setScoreShow:ke,ScoreShow:je,exerciseitem:w,getdata:$e}),Ze&&(0,R.jsx)(Hn,{setScoreShow:Se,isshixuns:Ie,ScoreShow:Ze,isloadings:qe,onOk:function(){var e=d()(s()().mark((function e(n,t,i,l){var a,o;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Me(!0),a={exam_id:c,item_bank_ids:n,shixun_ids:t},e.next=4,dn(r()(r()({},a),{},{check_only:i}));case 4:if(o=e.sent,Me(!1),0!==(null==o?void 0:o.status)){e.next=14;break}return e.next=9,dn(a);case 9:Se(!1),$e(),x.ZP.info("添加成功"),e.next=15;break;case 14:-4===o.status&&S.Z.confirm({title:"提示",content:"当前已选择".concat(l,"道试题,已加入过的试题将不会重复加入"),onOk:function(){var e=d()(s()().mark((function e(){return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,dn(a);case 2:Se(!1),$e(),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,r){return e.apply(this,arguments)}}()}),(0,R.jsx)(_n.Z,{visible:ye,onCancel:function(){return _e(!1)},onOk:an}),(0,R.jsx)(S.Z,{centered:!0,title:"编辑题型名称",open:Ke,width:500,onOk:function(){return We.submit()},onCancel:function(){return Ue(!1)},children:(0,R.jsxs)(f.Z,{form:We,initialValues:{},onFinish:function(){var e=d()(s()().mark((function e(n){return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.RK)(r()({id:c},n));case 2:0==e.sent.status&&(x.ZP.success("修改成功"),$e(),Ue(!1));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:[(0,R.jsx)(f.Z.Item,{style:{marginBottom:0},name:"name",rules:[{required:!0,message:"请输入题型名称"},{whitespace:!0,message:"请勿输入空格"},{validator:function(e,n){var t,i,r=null==Yn||null===(t=Yn.find((function(e){return e.nameType==We.getFieldValue("item_type_en")})))||void 0===t?void 0:t.id;return null!=w&&null!==(i=w.exercise_question_types)&&void 0!==i&&null!==(i=i.filter((function(e){return e.question_type!=r})))&&void 0!==i&&null!==(i=i.map((function(e){return null==e?void 0:e.name})))&&void 0!==i&&i.includes(n)?Promise.reject(new Error("题型名称已存在,请勿设置相同的题型名称")):Promise.resolve()}}],children:(0,R.jsx)(y.Z,{size:"large",maxLength:10,showCount:!0})}),(0,R.jsx)(f.Z.Item,{hidden:!0,name:"item_type_en",children:(0,R.jsx)(y.Z,{size:"large"})})]})})]})})),Xn=t(40029),Qn=t(57840),$n=function(){var e=(0,m.useState)([]),n=p()(e,2),t=n[0],i=n[1];return(0,m.useEffect)((function(){var e=function(){var e=d()(s()().mark((function e(){var n;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.d1)({source:"question"});case 2:null!=(n=e.sent)&&n.disciplines&&i((0,N.L)(null==n?void 0:n.disciplines));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}),[]),t},et=(0,h.connect)((function(e){return{user:e.user,newExercisePaper:e.newExercisePaper,dispatch:e.dispatch}}))((function(e){e.user;var n,t,i,l,o,c,u=e.newExercisePaper,N=e.dispatch,S=(0,h.useParams)(),T=$n(),P=f.Z.useForm(),I=p()(P,1)[0],B=(0,m.useState)(),A=p()(B,2),E=A[0],q=A[1],M=(0,m.useState)(!1),L=p()(M,2),O=L[0],D=L[1],F=(0,m.useState)(1),z=p()(F,2),G=z[0],W=z[1],H=(0,m.useState)(""),V=p()(H,2),K=V[0],U=V[1],Y=(0,h.useSearchParams)(),J=p()(Y,1)[0],X=(0,m.useState)(!1),Q=p()(X,2),$=Q[0],ee=Q[1];return(0,m.useEffect)((function(){"2"===J.get("type")&&(U(S.id),W(2))}),[J.get("type")]),(0,m.useEffect)((function(){if(S.id){if(!T.length)return;var e=function(){var e=d()(s()().mark((function e(){var n,t,i,l,o,c,d,u,p,m,h,f,v;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return D(!0),e.next=3,(0,C.Di)({id:S.id});case 3:i=e.sent,D(!1),l=null==i||null===(n=i.exercise)||void 0===n?void 0:n.sub_discipline_id,o=[],c=a()(T);try{for(c.s();!(d=c.n()).done;){u=d.value,p=a()(u.children);try{for(p.s();!(m=p.n()).done;)(h=m.value).value===l&&(o=[u.value,h.value])}catch(e){p.e(e)}finally{p.f()}}}catch(e){c.e(e)}finally{c.f()}f=null==i||null===(t=i.exercise)||void 0===t?void 0:t.time,v=r()(r()({},i.exercise),{},{sub_discipline_id:o,time:-1===f?null:f}),q(v);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}else q({time:60,difficulty:2});N({type:"globalSetting/footerToggle",payload:!1})}),[T]),(0,R.jsx)("div",{style:{background:"#ffffff",marginTop:-8,padding:8,minHeight:"100vh",paddingBottom:64},children:(0,R.jsxs)("section",{className:"edu-container",children:[(0,R.jsx)("section",{className:"animated fadeIn",children:(0,R.jsx)("aside",{style:{marginTop:15},children:(0,R.jsxs)(v.Z,{separator:">",children:[(0,R.jsx)(v.Z.Item,{children:(0,R.jsx)(h.Link,{to:"/paperlibrary",children:"试卷库"})}),(0,R.jsx)(v.Z.Item,{children:"人工组卷"})]})})}),(0,R.jsxs)("div",{className:"bg-white",children:[(0,R.jsxs)("div",{style:{display:"flex",justifyContent:"center",paddingTop:20,alignItems:"center"},children:[(0,R.jsxs)("div",{onClick:function(){$?x.ZP.info("请先保存或取消当前正在编辑的试题。"):W(1)},className:1===G?k.Z.selectdiv:k.Z.divitem,children:[(0,R.jsx)(Xn.Z,{number:1,active:1===G,className:"mr10"}),(0,R.jsx)("span",{children:"试卷基础信息"})]}),(0,R.jsx)("div",{style:{width:188,border:"1px dotted #9096A3",margin:"0px 30px",height:1}}),(0,R.jsxs)("div",{onClick:function(){S.id||K?(W(2),K||U(S.id)):x.ZP.info("请先保存基础信息再新建试题")},className:1!==G?k.Z.selectdiv:k.Z.divitem,children:[(0,R.jsx)(Xn.Z,{number:2,active:1!==G,className:"mr10"}),(0,R.jsx)("span",{children:"编辑试题"})]})]}),2===G&&(0,R.jsxs)("div",{className:"tc",children:[(0,R.jsx)(Qn.Z,{defaultValue:null==u||null===(n=u.editData)||void 0===n||null===(n=n.exercise)||void 0===n?void 0:n.exercise_name,onFinish:function(){var e=d()(s()().mark((function e(n){var t,i,r,l,a,o;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.trim()!==(null==u||null===(t=u.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,C.w0)({id:"".concat(null==u||null===(i=u.editData)||void 0===i||null===(i=i.exercise)||void 0===i?void 0:i.id),sub_discipline_id:null==u||null===(r=u.editData)||void 0===r||null===(r=r.exercise)||void 0===r?void 0:r.sub_discipline_id,time:"".concat(null==u||null===(l=u.editData)||void 0===l||null===(l=l.exercise)||void 0===l?void 0:l.time),exercise_name:n,exercise_description:null==u||null===(a=u.editData)||void 0===a||null===(a=a.exercise)||void 0===a?void 0:a.exercise_description,difficulty:null==u||null===(o=u.editData)||void 0===o||null===(o=o.exercise)||void 0===o?void 0:o.difficulty});case 4:if(0!==e.sent.status){e.next=9;break}return I.setFieldValue("exercise_name",n),N({type:"newExercisePaper/modifyTitle",payload:n}),e.abrupt("return",!0);case 9:return e.abrupt("return",!1);case 10:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()}),(0,R.jsxs)("div",{style:{fontSize:14},children:[(0,R.jsxs)("span",{style:{color:"#5F6368"},children:["答题时长",(0,R.jsx)("span",{style:{color:"#000000",marginLeft:8},children:null==u||null===(t=u.editData)||void 0===t||null===(t=t.exercise)||void 0===t?void 0:t.time})]}),(0,R.jsxs)("span",{style:{margin:"0px 30px",color:"#5F6368"},children:["难度",(0,R.jsx)("span",{style:{color:"#000000",marginLeft:8},children:1===(null==u||null===(i=u.editData)||void 0===i||null===(i=i.exercise)||void 0===i?void 0:i.difficulty)?"简单":2===(null==u||null===(l=u.editData)||void 0===l||null===(l=l.exercise)||void 0===l?void 0:l.difficulty)?"适中":"困难"})]}),(0,R.jsxs)("span",{style:{marginRight:30,color:"#5F6368"},children:["试题总数",(0,R.jsx)("span",{style:{color:"#000000",marginLeft:8},children:(null==u||null===(o=u.editData)||void 0===o||null===(o=o.exercise_types)||void 0===o?void 0:o.q_counts)||0})]}),(0,R.jsxs)("span",{style:{color:"#5F6368"},children:["总分",(0,R.jsx)("span",{style:{color:"#000000",marginLeft:8},children:null==u||null===(c=u.editData)||void 0===c||null===(c=c.exercise_types)||void 0===c?void 0:c.q_scores})]})]})]})]}),1===G&&(0,R.jsxs)(g.Z,{spinning:O,size:"middle",style:{position:"fixed",maxHeight:"100vh"},className:"mt30",children:[(0,R.jsx)("section",{className:[k.Z.bg,"mt20"].join(" "),style:{padding:"30px 120px 300px 120px"},children:E&&(0,R.jsxs)(f.Z,{layout:"horizontal",form:I,colon:!1,labelCol:{span:4},wrapperCol:{span:20},className:k.Z.formWrap,initialValues:E,children:[(0,R.jsx)(f.Z.Item,{name:"exercise_name",label:"试卷名称",className:k.Z.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,R.jsx)(y.Z,{maxLength:60,className:k.Z.baseFormItem,placeholder:"请输入试卷名称",showCount:!0})}),(0,R.jsx)(f.Z.Item,{label:"方向&课程",name:"sub_discipline_id",className:k.Z.baseLineHeight,rules:[{required:!0,message:"请选择方向&课程"}],children:(0,R.jsx)(_.Z,{className:k.Z.baseFormItem,allowClear:!1,placeholder:"请选择方向&课程",options:T,popupClassName:k.Z.cascaderPopup,dropdownMenuColumnStyle:{padding:"8px 12px",fontSize:14}})}),(0,R.jsx)(f.Z.Item,{label:"难度",name:"difficulty",className:k.Z.radioBtnWrapper,rules:[{required:!0,message:"请选择难度"}],children:(0,R.jsxs)(w.ZP.Group,{className:k.Z.radiogroup,children:[(0,R.jsx)(w.ZP.Button,{className:k.Z.easy,value:1,children:"简单"}),(0,R.jsx)(w.ZP.Button,{className:k.Z.medium,value:2,children:"适中"}),(0,R.jsx)(w.ZP.Button,{className:k.Z.hard,value:3,children:"困难"})]})}),(0,R.jsx)(f.Z.Item,{label:"答题时长",className:k.Z.baseLineHeight,children:(0,R.jsxs)("div",{style:{display:"flex",width:"100%"},children:[(0,R.jsx)(f.Z.Item,{name:"time",noStyle:!0,children:(0,R.jsx)(b.Z,{min:1,className:k.Z.baseFormItem,max:9999,style:{width:220},maxLength:60,placeholder:"请填写答题时长"})}),(0,R.jsx)("span",{style:{marginLeft:"10px",width:"40px",lineHeight:"46px",fontSize:14},children:"分钟"})]})}),(0,R.jsx)(f.Z.Item,{label:"试卷须知",name:"exercise_description",children:(0,R.jsx)(y.Z.TextArea,{rows:6,maxLength:65535,placeholder:"请在此输入本次试卷答题的相关说明,最大限制65535个字符"})})]})}),(0,R.jsxs)("div",{className:k.Z.bottmodiv,children:[(0,R.jsx)(j.ZP,{className:"".concat(k.Z.cancelBtn," mr5"),type:"primary",onClick:function(){"course"==J.get("pageType")?h.history.push("/paths/".concat(J.get("courseId"))):h.history.push("/paperlibrary")},children:"取消"}),(0,R.jsx)(Z.Z,{className:"".concat(k.Z.confirmBtn," ml15"),type:"primary",onClick:d()(s()().mark((function e(){var n,t,i,l,a;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,I.validateFields();case 2:if((n=I.getFieldsValue()).sub_discipline_id=n.sub_discipline_id[1],!S.id){e.next=10;break}return e.next=7,(0,C.w0)(r()({id:S.id},n));case 7:return 0===e.sent.status&&(U(S.id),W(2),h.history.replace("/paperlibrary/add/".concat(S.id,"?type=2"))),e.abrupt("return");case 10:return e.next=12,(0,C.un)(n);case 12:0===(t=e.sent).status&&(U(null==t||null===(i=t.data)||void 0===i?void 0:i.exam_id),W(2),"course"==J.get("pageType")?h.history.replace("/paperlibrary/add/".concat(null==t||null===(l=t.data)||void 0===l?void 0:l.exam_id,"?type=2&pageType=course&courseId=").concat(J.get("courseId"),"&stageId=").concat(J.get("stageId"))):h.history.replace("/paperlibrary/add/".concat(null==t||null===(a=t.data)||void 0===a?void 0:a.exam_id,"?type=2")));case 14:case"end":return e.stop()}}),e)}))),children:"下一步"})]})]}),2===G&&(0,R.jsx)("div",{children:(0,R.jsx)(Jn,{setisedits:ee,itemid:K})})]})})}))},18122:function(e,n,t){"use strict";t.d(n,{I:function(){return a}});var i=t(79800),r=t.n(i),l=t(59301),a=function(){var e=(0,l.useState)("hidden"),n=r()(e,2),t=n[0],i=n[1];return{overflow:t,handleMouseEnter:function(){return i("auto")},handleMouseLeave:function(){return i("hidden")}}}},28288:function(e,n,t){"use strict";t(59301);Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;n.Z="data:image/svg+xml;base64,PHN2ZyBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMzIiIGhlaWdodD0iMzIiPjxwYXRoIGQ9Ik0zNjUuNzE0IDczLjE0M0gxMDI0djczLjE0M0gzNjUuNzE0em0wIDI5Mi41NzFIMTAyNHY3My4xNDNIMzY1LjcxNHptMCAyOTIuNTcySDEwMjR2NzMuMTQzSDM2NS43MTR6bTAgMjkyLjU3MUgxMDI0VjEwMjRIMzY1LjcxNHYtNzMuMTQzeiIgZmlsbD0iIzk4QkRGNyIvPjxwYXRoIGQ9Im0yNDguNjg2IDgwMy4xODItNjUuODI5IDc1LjkyMlY2NTguMjg2aC03My4xNDN2MjIwLjgxOGwtNjUuODI4LTc1Ljk5NUwwIDg1MS4zODMgMTQ2LjI4NiAxMDI0IDI5Mi41NyA4NTEuNTN6IiBmaWxsPSIjMTQ1REZGIi8+PHBhdGggZD0iTTE0Ni4yODYgMCAwIDE1OC43Mmw0My44ODYgNTUuMjIzIDY1LjgyOC03NS45MjJ2MjI3LjY5M2g3My4xNDNWMTM4LjAyMWw2NS44MjkgNzUuOTIyIDQzLjg4NS01NS4yMjN6IiBmaWxsPSIjOThCREY3Ii8+PC9zdmc+"},4505:function(e,n,t){"use strict";t(59301);Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;n.Z="data:image/svg+xml;base64,PHN2ZyBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMzIiIGhlaWdodD0iMzIiPjxwYXRoIGQ9Ik0zNjUuNzE0IDczLjE0M0gxMDI0djczLjE0M0gzNjUuNzE0em0wIDI5Mi41NzFIMTAyNHY3My4xNDNIMzY1LjcxNHptMCAyOTIuNTcySDEwMjR2NzMuMTQzSDM2NS43MTR6bTAgMjkyLjU3MUgxMDI0VjEwMjRIMzY1LjcxNHYtNzMuMTQzek0yNDguNjg2IDgwMy4xODJsLTY1LjgyOSA3NS45MjJWNjU4LjI4NmgtNzMuMTQzdjIyMC44MThsLTY1LjgyOC03NS45OTVMMCA4NTEuMzgzIDE0Ni4yODYgMTAyNCAyOTIuNTcgODUxLjUzeiIgZmlsbD0iIzk4QkRGNyIvPjxwYXRoIGQ9Ik0xNDYuMjg2IDAgMCAxNTguNzJsNDMuODg2IDU1LjIyMyA2NS44MjgtNzUuOTIydjIyNy42OTNoNzMuMTQzVjEzOC4wMjFsNjUuODI5IDc1LjkyMiA0My44ODUtNTUuMjIzeiIgZmlsbD0iIzE0NURGRiIvPjwvc3ZnPg=="},5547:function(e,n){"use strict";n.Z={wrap:"wrap___ilWvf",deleteIcon:"deleteIcon___JBDG8",keywordTag:"keywordTag___iieCb",questionTitleEditorWrap:"questionTitleEditorWrap___MHB5s",choiceListWrap:"choiceListWrap___jB8b1",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",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"}},89293:function(e,n){"use strict";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"}},66104:function(e,n,t){"use strict";t.d(n,{Z:function(){return P}});var i=t(92310),r=t.n(i),l=t(55401),a=t(87147),o=t(59301),s=t(92343),c=t(36355),d=t(43501),u=t(91857);const p=e=>{let{children:n}=e;const{getPrefixCls:t}=o.useContext(c.E_),i=t("breadcrumb");return o.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 r=0;for(i=Object.getOwnPropertySymbols(e);r{if(n)return n(t,i,r,l);const o=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,o,a)}}var x=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 r=0;for(i=Object.getOwnPropertySymbols(e);r{const{prefixCls:n,separator:t="/",children:i,menu:r,overlay:l,dropdownProps:a,href:s}=e;const c=(e=>{if(r||l){const t=Object.assign({},a);if(r){const e=r||{},{items:n}=e,i=x(e,["items"]);t.menu=Object.assign(Object.assign({},i),{items:null==n?void 0:n.map(((e,n)=>{var{key:t,title:i,label:r,path:l}=e,a=x(e,["key","title","label","path"]);let c=null!=r?r:i;return l&&(c=o.createElement("a",{href:`${s}${l}`},c)),Object.assign(Object.assign({},a),{key:null!=t?t:n,label:c})}))})}else l&&(t.overlay=l);return o.createElement(u.Z,Object.assign({placement:"bottom"},t),o.createElement("span",{className:`${n}-overlay-link`},e,o.createElement(d.Z,null)))}return e})(i);return null!=c?o.createElement(o.Fragment,null,o.createElement("li",null,c),t&&o.createElement(m,null,t)):null},y=e=>{const{prefixCls:n,children:t,href:i}=e,r=x(e,["prefixCls","children","href"]),{getPrefixCls:l}=o.useContext(c.E_),a=l("breadcrumb",n);return o.createElement(g,Object.assign({},r,{prefixCls:a}),f(a,r,t,i))};y.__ANT_BREADCRUMB_ITEM=!0;var _=y,w=t(17313),b=t(83116),j=t(37613);const k=e=>{const{componentCls:n,iconCls:t}=e;return{[n]:Object.assign(Object.assign({},(0,w.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,w.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 C=(0,b.Z)("Breadcrumb",(e=>{const n=(0,j.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}))),N=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 r=0;for(i=Object.getOwnPropertySymbols(e);r{var{breadcrumbName:n}=e,t=N(e,["breadcrumbName"]);return Object.assign(Object.assign({},t),{title:n})}))}),r}var S=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 r=0;for(i=Object.getOwnPropertySymbols(e);r{const{prefixCls:n,separator:t="/",style:i,className:d,rootClassName:u,routes:p,items:h,children:f,itemRender:x,params:y={}}=e,_=S(e,["prefixCls","separator","style","className","rootClassName","routes","items","children","itemRender","params"]),{getPrefixCls:w,direction:b,breadcrumb:j}=o.useContext(c.E_);let k;const N=w("breadcrumb",n),[T,P]=C(N),I=function(e,n){return(0,o.useMemo)((()=>e||(n?n.map(Z):null)),[e,n])}(h,p);const B=v(N,x);if(I&&I.length>0){const e=[],n=h||p;k=I.map(((i,r)=>{const{path:l,key:s,type:c,menu:d,overlay:u,onClick:p,className:h,separator:f,dropdownProps:v}=i,x=((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})(y,l);void 0!==x&&e.push(x);const _=null!=s?s:r;if("separator"===c)return o.createElement(m,{key:_},f);const w={},b=r===I.length-1;d?w.menu=d:u&&(w.overlay=u);let{href:j}=i;return e.length&&void 0!==x&&(j=`#/${e.join("/")}`),o.createElement(g,Object.assign({key:_},w,(0,a.Z)(i,{data:!0,aria:!0}),{className:h,dropdownProps:v,href:j,separator:b?"":t,onClick:p,prefixCls:N}),B(i,y,n,e,j))}))}else if(f){const e=(0,l.Z)(f).length;k=(0,l.Z)(f).map(((n,i)=>{if(!n)return n;const r=i===e-1;return(0,s.Tm)(n,{separator:r?"":t,key:i})}))}const A=r()(N,null==j?void 0:j.className,{[`${N}-rtl`]:"rtl"===b},d,u,P),E=Object.assign(Object.assign({},null==j?void 0:j.style),i);return T(o.createElement("nav",Object.assign({className:A,style:E},_),o.createElement("ol",null,k)))};T.Item=_,T.Separator=m;var P=T},25769:function(e,n,t){"use strict";var i=t(98040),r={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,n){var t,l,a,o,s,c,d=!1;n||(n={}),t=n.debug||!1;try{if(a=i(),o=document.createRange(),s=document.getSelection(),(c=document.createElement("span")).textContent=e,c.ariaHidden="true",c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",(function(i){if(i.stopPropagation(),n.format)if(i.preventDefault(),void 0===i.clipboardData){t&&console.warn("unable to use e.clipboardData"),t&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var l=r[n.format]||r.default;window.clipboardData.setData(l,e)}else i.clipboardData.clearData(),i.clipboardData.setData(n.format,e);n.onCopy&&(i.preventDefault(),n.onCopy(i.clipboardData))})),document.body.appendChild(c),o.selectNodeContents(c),s.addRange(o),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");d=!0}catch(i){t&&console.error("unable to copy using execCommand: ",i),t&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(n.format||"text",e),n.onCopy&&n.onCopy(window.clipboardData),d=!0}catch(i){t&&console.error("unable to copy using clipboardData: ",i),t&&console.error("falling back to prompt"),l=function(e){var n=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,n)}("message"in n?n.message:"Copy to clipboard: #{key}, Enter"),window.prompt(l,e)}}finally{s&&("function"==typeof s.removeRange?s.removeRange(o):s.removeAllRanges()),c&&document.body.removeChild(c),a()}return d}},83145:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.CopyToClipboard=void 0;var i=l(t(59301)),r=l(t(25769));function l(e){return e&&e.__esModule?e:{default:e}}function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function s(e,n){if(null==e)return{};var t,i,r=function(e,n){if(null==e)return{};var t,i,r={},l=Object.keys(e);for(i=0;i=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}function c(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function d(e,n){for(var t=0;t