|
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[5824],{8304:function(e,n,i){i.d(n,{Z:function(){return f}});var t=i(82242),l=i.n(t),s=i(7557),a=i.n(s),r=i(41498),o=i.n(r),c=i(79800),d=i.n(c),u=i(39647),h=i.n(u),m=i(3113),p=i(59301),x=i(37712),v=["children"],f=function(e){var n=e.children,i=h()(e,v),t=(0,p.useState)(!1),s=d()(t,2),r=s[0],c=s[1];return(0,x.jsx)(m.ZP,l()(l()({},i),{},{loading:r,onClick:function(){var e=o()(a()().mark((function e(n){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,c(!0),e.next=4,i.onClick(n);case 4:c(!1),e.next=11;break;case 7:e.prev=7,e.t0=e.catch(0),console.error(e.t0),c(!1);case 11:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(n){return e.apply(this,arguments)}}(),children:n}))}},7651:function(e,n,i){i.d(n,{Z:function(){return _}});var t=i(82100),l=i.n(t),s=i(29186),a=i.n(s),r=i(80619),o=i.n(r),c=i(47074),d=i.n(c),u=i(59301),h=i(92832),m=i(12563),p=i(8591),x="flex___eLcnP",v="color666___TiUhG",f=i(72528),j=i(37712),_=(h.Z.TextArea,function(e){o()(i,e);var n=d()(i);function i(e){var t;return l()(this,i),(t=n.call(this,e)).state={inputVisible:!1,EditInputIndex:-1},t}return a()(i,[{key:"render",value:function(){var e=this,n=this.props,i=n.index,t=n.onAnswerChange,l=n.addChildAnswer,s=(n.exerciseIsPublish,n.answers);n.activeOptionErrorIndex,n.flex;console.log("----",s);var a=this.state,r=a.inputVisible,o=a.EditInputIndex;return(0,j.jsxs)("div",{className:x,children:[(0,j.jsxs)("div",{className:"".concat(v," mb5 mt6"),style:{flex:"0 0 90px"},children:["答案(填空",i+1,"):"]}),(0,j.jsxs)("div",{style:{border:"1px solid #f6f6f6",flex:1,padding:10},children:[null==s?void 0:s.map((function(n,l){return(0,j.jsx)(j.Fragment,{children:o!==l&&(null==n?void 0:n.length)>0?(0,j.jsx)(m.Z,{className:"edit-tag",closable:!(1===(null==s?void 0:s.length)&&0===l),onClose:function(n){n.preventDefault(),1===(null==s?void 0:s.length)&&0===l?e.props.deleteChildAnswermain(i,l):e.props.deleteChildAnswer(i,l)},children:(0,j.jsx)("span",{onDoubleClick:function(n){e.setState({EditInputIndex:l}),n.preventDefault()},children:n})},n):(0,j.jsx)(h.Z,{defaultValue:n,style:{width:78,marginRight:8,height:24,verticalAlign:"top"},onBlur:function(n){n.target.value.replaceAll(" ","").length<=0?p.ZP.info("内容不能为纯空格"):(t(i,l,n.target.value),e.setState({EditInputIndex:-1,inputVisible:!1}))}})})})),!r&&(0,j.jsxs)(m.Z,{className:"site-tag-plus",onClick:function(){l(i),e.setState({inputVisible:!0})},children:[(0,j.jsx)(f.Z,{})," 新增答案"]})]})]})}}]),i}(u.Component))},75993:function(e,n,i){i.d(n,{Z:function(){return y}});var t=i(82242),l=i.n(t),s=i(82100),a=i.n(s),r=i(29186),o=i.n(r),c=i(13720),d=i.n(c),u=i(80619),h=i.n(u),m=i(47074),p=i.n(m),x=i(85573),v=i.n(x),f=i(59301),j=i(88330),_=i(37712),g="▁",y=function(e){h()(i,e);var n=p()(i);function i(){var e;a()(this,i);for(var t=arguments.length,l=new Array(t),s=0;s<t;s++)l[s]=arguments[s];return e=n.call.apply(n,[this].concat(l)),v()(d()(e),"getChCountBeforeCursor",(function(e,n){for(var i=n.line,t=0,l=0;l<i;l++)t+=e.getLine(l).split(g).length-1;return t+=e.getLine(i).substring(0,n.ch).split(g).length-1})),v()(d()(e),"onCMBeforeChange",(function(n,i){var t=n.getRange(i.from,i.to),l=0;if(i.text.forEach((function(e){l+=e.split(g).length-1})),t&&-1!=t.indexOf(g)){var s=t.split(g).length-1,a=e.getChCountBeforeCursor(n,i.from);console.log("删除".concat(s,"个, 之前有").concat(a,"个,新增").concat(l,"个")),e.props.deleteEmptyDisabled?i.cancel():e.props.onPlaceholderChange&&e.props.onPlaceholderChange(a,s,l)}else if(l){var r=e.getChCountBeforeCursor(n,i.from);console.log("新增".concat(l,"个,之前有").concat(r,"个")),e.props.onPlaceholderChange&&e.props.onPlaceholderChange(r,0,l)}})),e}return o()(i,[{key:"render",value:function(){return(0,_.jsx)(j.Z,l()(l()({},this.props),{},{onCMBeforeChange:this.onCMBeforeChange}))}}]),i}(f.Component)},16091:function(e,n,i){i.d(n,{Z:function(){return r}});i(59301);var t={btn:"btn___kReTL",redBtn:"redBtn___UFEL0"},l=i(92310),s=i.n(l),a=i(37712),r=function(e){var n=e.className,i=e.style,l=e.state,r=e.onClick;return(0,a.jsx)("div",{onClick:r,className:s()(l?null==t?void 0:t.redBtn:null==t?void 0:t.btn,n),style:i,children:l?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("i",{className:"iconfont icon-biaoji1"}),(0,a.jsx)("span",{children:"取消标记错题"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("i",{className:"iconfont icon-biaojigaiti"}),(0,a.jsx)("span",{children:"标记错题"})]})})}},5824:function(e,n,i){i.d(n,{Z:function(){return Xe}});var t=i(7557),l=i.n(t),s=i(41498),a=i.n(s),r=i(82242),o=i.n(r),c=i(79800),d=i.n(c),u=i(59301),h={flex_box_center:"flex_box_center___bZaL5",flex_space_between:"flex_space_between___oaJSq",flex_box_vertical_center:"flex_box_vertical_center____hsuP",flex_box_center_end:"flex_box_center_end___ZYbPQ",flex_box_column:"flex_box_column___nE_62",wrap:"wrap___ulhwR",left:"left___kyWln",title:"title___jsO1D",total:"total___GEhiU",list:"list___u9dBZ",name:"name___Wxggs",b:"b___Y15YO",r:"r___mKQoe",l:"l___uelFD",tag:"tag___Mpkbg",right:"right___mQ3dU",examName:"examName___Na1r8",t:"t___IgCWK",num:"num___CXI8j",topWarp:"topWarp___Kicpu",head:"head___jx3W8",so:"so___qYW7F",btn:"btn___EMJDz",content:"content___sHGsV",titleWrap:"titleWrap___I__GR",single:"single___K5iv9",analysis:"analysis___NoAuR",text:"text___xESW2",modalColumn:"modalColumn___I_tK_",modalRow:"modalRow___lyw_U",sup:"sup___HSz3Z",popover:"popover___kE8aI"},m=i(78241),p=i(6848),x=i(43418),v=i(91070),f=i(8591),j=i(92832),_=i(28103),g=i(3113),y=i(25700),N=i(95237),w=i(60324);Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var b=i(5822),I=i(18196),Z=i(34458),C=i(93969);Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var k=i(33299),M=i(37205),P=i.n(M),S=i(39647),L=i.n(S),E=i(24905),T=i(88330),A=i(75993),D=i(7651),O={wrap:"wrap___OIoOI",modal:"modal___Z3hfU",titleWrap:"titleWrap___aK3oG",required:"required___NHoO7",title:"title___uxb1R",colorGray:"colorGray___O8YPg",choiceWrap:"choiceWrap___t51sb",answer:"answer___vsBnh",activeAnswer:"activeAnswer___AJN4p",deleteIcon:"deleteIcon___WvOJZ",addIcon:"addIcon___UyeIs",editorWrap:"editorWrap___uqcFU",htmlWrap:"htmlWrap___GcBNL",radio:"radio___e8qQ5",color333:"color333___PLzVK",color999:"color999___v3EY0",fold:"fold___OfvPe",head:"head___EejYX",collapseWrapper:"collapseWrapper___sQyVD",panelHeader:"panelHeader___Ivicf",open:"open___aEOQE",close:"close___z4P5H",inputBorder:"inputBorder___ix67O",keywordTag:"keywordTag___iGx08"},q=i(37712),R=["globalSetting","loading","dispatch","isEdit","editData"],W=function(e,n){e.globalSetting,e.loading,e.dispatch;var i=e.isEdit,t=e.editData,l=(L()(e,R),(0,u.useState)("")),s=d()(l,2),a=s[0],r=s[1],c=(0,u.useState)(""),h=d()(c,2),m=h[0],p=h[1],v=(0,u.useState)([]),j=d()(v,2),_=j[0],g=j[1],y=(0,u.useState)(""),N=d()(y,2),w=N[0],b=N[1],I=(0,u.useState)(),C=d()(I,2),k=C[0],M=C[1],S=(0,u.useState)(!1),W=d()(S,2),B=W[0],z=W[1],F=(0,u.useState)({}),G=d()(F,2),V=G[0],U=G[1];(0,u.useEffect)((function(){t&&i&&(r(null==t?void 0:t.name),p(null==t?void 0:t.analysis),M(null==t?void 0:t.is_ordered),U(t),z(!0))}),[t]),(0,u.useEffect)((function(){if(B){var e=null==t?void 0:t.standard_answer.map((function(e){return e.answer_text}));g(e),z(!1)}}),[B]),(0,u.useImperativeHandle)(n,(function(){return{onSave:Y,Clear:K}}));var Y=function(){var e=[],n=!1;return a?(_.forEach((function(i,t){e.push({position:t+1,answer_text:[]}),i.forEach((function(i,l){e[t].answer_text.push(i),i&&(0,Z.eR)(i,1e4)||(b("".concat(t,"-").concat(l)),f.ZP.info(i?"答案不能超过10000字符":"答案:不能为空"),n=!0)}))})),!n&&((null==e?void 0:e.length)>20?(f.ZP.warning("填空题标准答案不能为空/不能超过20个!"),!1):{name:a,analysis:m,standard_answers:e,is_ordered:k,downcase:null==V?void 0:V.downcase,no_space:null==V?void 0:V.no_space})):(f.ZP.info("请您输入题干"),!1)},K=function(){r(""),p(""),g([]),M(!1)},Q=function(e,n,i){b("");var t=_.slice();t[e][n]=i,g(t)},H=function(e){var n=_.slice();n[e]=[].concat(P()(n[e]),[""]),g(n)},J=function(e,n){var i=_.slice();if(!i[e][n])return i[e]=i[e].filter((function(e,i){return i!==n})),void g(i);x.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确认要删除这个参考答案吗?",className:O.modal,onOk:function(){i[e]=i[e].filter((function(e,i){return i!==n})),g(i)}})},X=function(e){x.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确认要删除这个参考答案吗?",className:O.modal,onOk:function(){var n=_.slice();n=_.filter((function(n,i){return e!==i})),g(n)}})};return(0,q.jsxs)("section",{className:O.wrap,children:[(0,q.jsxs)("p",{className:O.titleWrap,children:[(0,q.jsx)("span",{className:O.required,children:"*"}),(0,q.jsx)("span",{className:O.title,children:"题干:"})]}),(0,q.jsx)("div",{children:(0,q.jsx)(A.Z,{id:"completion-question-tittle",placeholder:"请您输入题目",height:155,defaultValue:a,onChange:function(e){return r(e)},showNullButton:!0,onPlaceholderChange:function(e,n,i){var t=_.slice();if(n&&t.splice(e,n),i)for(var l=0;l<i;l++)t.splice(e+l,0,[""]);g(t)}})}),(0,q.jsx)("div",{className:"mt20",children:_.map((function(e,n){return(0,q.jsx)(D.Z,{answers:e,index:n,flex:1,is_md:!0,activeOptionErrorIndex:w,onAnswerChange:Q,addChildAnswer:H,deleteChildAnswer:J,deleteChildAnswermain:X},n)}))}),(0,q.jsx)("div",{children:(0,q.jsx)(E.Z,{className:"".concat(O.color333," font14 mt20"),checked:V.downcase,onChange:function(e){return U(o()(o()({},V),{},{downcase:e.target.checked}))},children:"判分时忽略答案中的字母大小写"})}),(0,q.jsx)("div",{children:(0,q.jsx)(E.Z,{className:"".concat(O.color333," font14 mt20"),checked:V.no_space,onChange:function(e){return U(o()(o()({},V),{},{no_space:e.target.checked}))},children:"判分时忽略答案中的空格"})}),(0,q.jsx)("div",{className:"mt20",children:(null==_?void 0:_.length)>1&&(0,q.jsxs)("span",{children:[(0,q.jsx)(E.Z,{checked:k,onChange:function(e){return M(e.target.checked)},className:"".concat(O.color333," font14"),children:"多个填空的答案有顺序要求"}),(0,q.jsx)("span",{className:"".concat(O.color999," font12"),children:"(选中,每个填空的答案顺序必须与参考答案一致)"})]})}),(0,q.jsx)("p",{className:O.titleWrap,children:(0,q.jsx)("span",{className:O.title,children:"题目解析:"})}),(0,q.jsx)(T.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"请您输入题目解析",defaultValue:m,onChange:function(e){return p(e)}})]})},B=(0,I.connect)((function(e){var n=e.loading;return{globalSetting:e.globalSetting,loading:n.effects}}),null,null,{forwardRef:!0})((0,u.forwardRef)(W)),z=i(5112),F=["globalSetting","loading","editData","dispatch","onRef","isEdit"],G=function(e,n){e.globalSetting,e.loading;var i=e.editData,t=(e.dispatch,e.onRef,e.isEdit),l=(L()(e,F),(0,u.useState)()),s=d()(l,2),a=s[0],r=s[1],o=(0,u.useState)(""),c=d()(o,2),h=c[0],m=c[1],p=(0,u.useState)(""),x=d()(p,2),v=x[0],j=x[1];(0,u.useEffect)((function(){if(i&&t){m(null==i?void 0:i.name),j(null==i?void 0:i.analysis);var e=null==i?void 0:i.choices.find((function(e){return e.is_answer}));r("正确"===e.choice_text?"0":"1")}}),[i]),(0,u.useImperativeHandle)(n,(function(){return{onSave:_,Clear:g}}));var _=function(){return h?a?{name:h,choices:[{choice_text:"正确",is_answer:"0"===a?1:0},{choice_text:"错误",is_answer:"1"===a?1:0}],analysis:v}:(f.ZP.info("请先点击选择本选择题的正确选项"),!1):(f.ZP.info("请您输入题干"),!1)},g=function(){m(""),j(""),r("")};return(0,q.jsxs)("section",{className:O.wrap,children:[(0,q.jsxs)("p",{className:O.titleWrap,children:[(0,q.jsx)("span",{className:O.required,children:"*"}),(0,q.jsx)("span",{className:O.title,children:"题干:"})]}),(0,q.jsx)(T.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:h,onChange:function(e){return m(e)}}),(0,q.jsxs)("p",{className:O.titleWrap,children:[(0,q.jsx)("span",{className:O.required,children:"*"}),(0,q.jsxs)("span",{className:O.title,children:["答案选项:",(0,q.jsx)("span",{className:O.colorGray,children:"点击选项可设置正确答案"})]})]}),(0,q.jsxs)(z.ZP.Group,{buttonStyle:"solid",value:a,onChange:function(e){return r(e.target.value)},children:[(0,q.jsx)(z.ZP.Button,{value:"0",className:"".concat(O.radio," mr40"),children:"正确"}),(0,q.jsx)(z.ZP.Button,{value:"1",className:O.radio,children:"错误"})]}),(0,q.jsx)("p",{className:O.titleWrap,children:(0,q.jsx)("span",{className:O.title,children:"题目解析:"})}),(0,q.jsx)(T.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"请您输入题目解析",defaultValue:v,onChange:function(e){return j(e)}})]})},V=(0,I.connect)((function(e){var n=e.loading;return{globalSetting:e.globalSetting,loading:n.effects}}),null,null,{forwardRef:!0})((0,u.forwardRef)(G)),U=["globalSetting","loading","editData","dispatch","onRef","isEdit"],Y=function(e,n){e.globalSetting,e.loading;var i=e.editData,t=(e.dispatch,e.onRef,e.isEdit),l=(L()(e,U),(0,u.useState)([])),s=d()(l,2),a=s[0],r=s[1];(0,u.useEffect)((function(){var e;if(i&&t){var n=null==i||null===(e=i.shixun)||void 0===e?void 0:e.challenges.map((function(e){return{id:null==e?void 0:e.id,score:e.score}}));r(n)}}),[i]),(0,u.useImperativeHandle)(n,(function(){return{onSave:o,Clear:c}}));var o=function(){return{challenges:P()(a)}},c=function(){r([])};console.log("editData--",i);var h,m;return(0,q.jsxs)("section",{className:O.wrap,children:[(0,q.jsx)(b.Z,{style:{paddingRight:10},className:O.titleHtml,value:"".concat(null==i?void 0:i.position)+"、"+"".concat(null==i?void 0:i.name)}),(0,q.jsxs)("p",{style:{marginBottom:"10px",marginTop:"25px"},children:[(0,q.jsx)("span",{className:O.required,children:"*"}),(0,q.jsx)("span",{className:O.title,children:"关卡"})]}),(h=i,(0,q.jsxs)("div",{children:[null==h||null===(m=h.shixun)||void 0===m||null===(m=m.challenges)||void 0===m?void 0:m.map((function(e,n){var i;return(0,q.jsxs)("div",{className:"c-grey-666 font14 ml25",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"15px"},children:[(0,q.jsxs)("div",{children:[(0,q.jsxs)("span",{className:"mr5",children:["第",n+1,"关"]}),(0,q.jsx)(p.Z,{title:null==e?void 0:e.challenge_name,children:(0,q.jsx)("span",{children:(0,Z.Pq)(null==e?void 0:e.challenge_name,44)})},n)]}),(0,q.jsxs)("p",{style:{marginBottom:0},children:[(0,q.jsx)("span",{className:O.required,children:"*"}),(0,q.jsx)("span",{className:O.title,children:"分值:"}),(0,q.jsx)(v.Z,{precision:1,min:1,max:100,className:O.baseFormItem,style:{width:176},value:null===(i=a.find((function(n){return n.id===e.id})))||void 0===i?void 0:i.score,onChange:function(n){a.find((function(n){return n.id===e.id})).score=n,r(P()(a))}})]})]})})),(0,q.jsx)("div",{style:{clear:"both"}})]}))]})},K=(0,I.connect)((function(e){var n=e.loading;return{globalSetting:e.globalSetting,loading:n.effects}}),null,null,{forwardRef:!0})((0,u.forwardRef)(Y)),Q=["editData","globalSetting","loading","dispatch","onRef","isEdit"],H=["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,n){var i=e.editData,t=(e.globalSetting,e.loading,e.dispatch,e.onRef,e.isEdit),l=(L()(e,Q),(0,u.useState)([])),s=d()(l,2),a=s[0],r=s[1],o=(0,u.useState)(),c=d()(o,2),h=c[0],m=c[1],x=(0,u.useState)([]),v=d()(x,2),j=v[0],_=v[1],g=(0,u.useState)(""),y=d()(g,2),N=y[0],w=y[1],I=(0,u.useState)(""),Z=d()(I,2),C=Z[0],k=Z[1];(0,u.useEffect)((function(){r(["","","",""])}),[]),(0,u.useEffect)((function(){if(i&&t){w(null==i?void 0:i.name),k(null==i?void 0:i.analysis),r(null==i?void 0:i.choices.map((function(e){return e.choice_text})));var e=[];null==i||i.choices.map((function(n,i){n.is_answer&&e.push(i)})),_(e)}}),[i]),(0,u.useImperativeHandle)(n,(function(){return{onSave:M,Clear:S}}));var M=function(){if(!N)return f.ZP.info("请您输入题干"),!1;var e=a.findIndex((function(e){return!e}));if(e>-1)return f.ZP.info("请先输入 ".concat(H[e]," 选项的内容")),!1;if(!j.length)return f.ZP.info("请设置本题的正确答案,点击选项A/B...即可完成设置"),!1;if(j.length<2)return f.ZP.info("多选题最小正确选项为2个"),!1;var n=a.map((function(e,n){return{choice_text:e,is_answer:j.includes(n)?1:0}}));return{name:N,choices:n,analysis:C}},S=function(){r(["","","",""]),w(""),k(""),_("")};return(0,q.jsxs)("section",{className:O.wrap,children:[(0,q.jsxs)("p",{className:O.titleWrap,children:[(0,q.jsx)("span",{className:O.required,children:"*"}),(0,q.jsx)("span",{className:O.title,children:"题干:"})]}),(0,q.jsx)(T.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:N,onChange:function(e){return w(e)}}),(0,q.jsxs)("p",{className:O.titleWrap,children:[(0,q.jsx)("span",{className:O.required,children:"*"}),(0,q.jsxs)("span",{className:O.title,children:["答案选项:",(0,q.jsx)("span",{className:O.colorGray,children:"点击选项可设置正确答案"})]})]}),a.map((function(e,n){return(0,q.jsxs)("div",{className:O.choiceWrap,children:[(0,q.jsx)(p.Z,{title:"点击设置为标准答案",placement:"left",children:(0,q.jsx)("div",{className:"".concat(O.answer," ").concat(j.includes(n)?O.activeAnswer:""),onClick:function(){j.includes(n)?_(j.filter((function(e){return e!==n}))):_([].concat(P()(j),[n]))},children:H[n]})}),(0,q.jsx)("div",{className:O.editorWrap,children:h===n?(0,q.jsx)(T.Z,{id:"single-question-option-".concat(n),watch:!0,height:155,placeholder:"请您输入选项",defaultValue:e,onChange:function(e){a[n]=e,r(a)}}):(0,q.jsx)("div",{className:O.htmlWrap,onClick:function(){return m(n)},children:(0,q.jsx)(b.Z,{value:e})})}),n>1&&(0,q.jsx)(p.Z,{title:"删除",children:(0,q.jsx)("i",{className:"".concat(O.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){r(a.filter((function(e,i){return i!==n}))),j.includes(n)?_(j.filter((function(e){return e!==n}))):_([].concat(P()(j),[n]))}})}),n<7&&n===a.length-1&&(0,q.jsx)(p.Z,{title:"新增参考答案",children:(0,q.jsx)("i",{className:"".concat(O.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return r([].concat(P()(a),[""]))}})})]},n)})),(0,q.jsx)("p",{className:O.titleWrap,children:(0,q.jsx)("span",{className:O.title,children:"题目解析:"})}),(0,q.jsx)(T.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"请您输入题目解析",defaultValue:C,onChange:function(e){return k(e)}})]})},X=(0,I.connect)((function(e){var n=e.loading;return{globalSetting:e.globalSetting,loading:n.effects}}),null,null,{forwardRef:!0})((0,u.forwardRef)(J)),$=["editData","globalSetting","loading","dispatch","onRef","isEdit"],ee=["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"],ne=function(e,n){var i=e.editData,t=(e.globalSetting,e.loading,e.dispatch,e.onRef,e.isEdit),l=(L()(e,$),(0,u.useState)([])),s=d()(l,2),a=s[0],r=s[1],o=(0,u.useState)(),c=d()(o,2),h=c[0],m=c[1],x=(0,u.useState)(),v=d()(x,2),j=v[0],_=v[1],g=(0,u.useState)(""),y=d()(g,2),N=y[0],w=y[1],I=(0,u.useState)(""),Z=d()(I,2),C=Z[0],k=Z[1];(0,u.useEffect)((function(){r(["","","",""])}),[]),(0,u.useEffect)((function(){i&&t&&(w(null==i?void 0:i.name),k(null==i?void 0:i.analysis),r(null==i?void 0:i.choices.map((function(e){return e.choice_text}))),_(null==i?void 0:i.choices.findIndex((function(e){return e.is_answer}))))}),[i]),(0,u.useImperativeHandle)(n,(function(){return{onSave:M,Clear:S}}));var M=function(){if(!N)return f.ZP.info("请您输入题干"),!1;var e=a.findIndex((function(e){return!e}));if(e>-1)return f.ZP.info("请先输入 ".concat(ee[e]," 选项的内容")),!1;if(console.log("activeAnswer: ",j),"number"!=typeof j)return f.ZP.info("请设置本题的正确答案,点击选项A/B...即可完成设置"),!1;var n=a.map((function(e,n){return{choice_text:e,is_answer:j===n?1:0}}));return{name:N,choices:n,analysis:C}},S=function(){r(["","","",""]),w(""),k(""),_("")};return(0,q.jsxs)("section",{className:O.wrap,children:[(0,q.jsxs)("p",{className:O.titleWrap,children:[(0,q.jsx)("span",{className:O.required,children:"*"}),(0,q.jsx)("span",{className:O.title,children:"题干:"})]}),(0,q.jsx)(T.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:N,onChange:function(e){return w(e)}}),(0,q.jsxs)("p",{className:O.titleWrap,children:[(0,q.jsx)("span",{className:O.required,children:"*"}),(0,q.jsxs)("span",{className:O.title,children:["答案选项:",(0,q.jsx)("span",{className:O.colorGray,children:"点击选项可设置正确答案"})]})]}),a.map((function(e,n){return(0,q.jsxs)("div",{className:O.choiceWrap,children:[(0,q.jsx)(p.Z,{title:"点击设置为标准答案",placement:"left",children:(0,q.jsx)("div",{className:"".concat(O.answer," ").concat(j===n?O.activeAnswer:""),onClick:function(){return _(n)},children:ee[n]})}),(0,q.jsx)("div",{className:O.editorWrap,children:h===n?(0,q.jsx)(T.Z,{id:"single-question-option-".concat(n),watch:!0,height:155,isFocus:!0,placeholder:"请您输入选项",defaultValue:e,onChange:function(e){a[n]=e,r(a)}}):(0,q.jsx)("div",{className:O.htmlWrap,onClick:function(){return m(n)},children:(0,q.jsx)(b.Z,{value:e})})}),n>1&&(0,q.jsx)(p.Z,{title:"删除",children:(0,q.jsx)("i",{className:"".concat(O.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){r(a.filter((function(e,i){return i!==n}))),n===j&&_(null)}})}),n<7&&n===a.length-1&&(0,q.jsx)(p.Z,{title:"新增参考答案",children:(0,q.jsx)("i",{className:"".concat(O.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return r([].concat(P()(a),[""]))}})})]},n)})),(0,q.jsx)("p",{className:O.titleWrap,children:(0,q.jsx)("span",{className:O.title,children:"题目解析:"})}),(0,q.jsx)(T.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"请您输入题目解析",defaultValue:C,onChange:function(e){return k(e)}})]})},ie=(0,I.connect)((function(e){var n=e.loading;return{globalSetting:e.globalSetting,loading:n.effects}}),null,null,{forwardRef:!0})((0,u.forwardRef)(ne)),te=i(91232),le=i.n(te),se=i(12563),ae=i(78673),re=i(43604),oe=i(86902),ce=["editData","globalSetting","loading","dispatch","onRef","isEdit"],de=["key","name"],ue=function(e){var n=e.value,i=void 0===n?[]:n,t=e.onClose;return(0,q.jsx)(se.Z,{closable:!0,onClose:t,className:O.keywordTag,children:(0,q.jsx)("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"},children:i.join(" 或 ")})})},he=function(e,n){var i=e.editData,t=(e.globalSetting,e.loading,e.dispatch,e.onRef,e.isEdit),s=(L()(e,ce),(0,u.useState)("")),r=d()(s,2),c=r[0],h=r[1],x=(0,u.useState)(""),_=d()(x,2),g=_[0],y=_[1],w=(0,u.useState)(""),b=d()(w,2),I=b[0],Z=b[1],C=(0,u.useState)(""),k=d()(C,2),M=k[0],P=k[1],S=m.Z.useForm(),E=d()(S,1)[0],A=m.Z.useWatch("use_keywords",E);(0,u.useEffect)((function(){var e;i&&t&&(h(null==i?void 0:i.name),y(null==i?void 0:i.analysis),Z(null==i||null===(e=i.answer_texts)||void 0===e?void 0:e[0]),E.setFieldsValue(o()({},i)))}),[i]),(0,u.useImperativeHandle)(n,(function(){return{onSave:D,Clear:R}}));var D=function(){var e=a()(l()().mark((function e(){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c){e.next=3;break}return f.ZP.info("请您输入题干"),e.abrupt("return",!1);case 3:return e.prev=3,e.next=6,E.validateFields();case 6:e.next=12;break;case 8:return e.prev=8,e.t0=e.catch(3),f.ZP.error(e.t0.errorFields[0].errors[0]),e.abrupt("return");case 12:return n=E.getFieldsValue(),console.log(n,"values"),e.abrupt("return",o()({name:c,answer_texts:[I],analysis:g},n));case 15:case"end":return e.stop()}}),e,null,[[3,8]])})));return function(){return e.apply(this,arguments)}}(),R=function(){h(""),y(""),Z(""),E.resetFields()},W=null==i?void 0:i.score;return(0,q.jsxs)("section",{className:O.wrap,children:[(0,q.jsxs)("p",{className:O.titleWrap,children:[(0,q.jsx)("span",{className:O.required,children:"*"}),(0,q.jsx)("span",{className:O.title,children:"题干:"})]}),(0,q.jsx)(T.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:c,onChange:function(e){return h(e)}}),(0,q.jsx)("p",{className:O.titleWrap,children:(0,q.jsx)("span",{className:O.title,children:"参考答案:"})}),(0,q.jsx)(T.Z,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"请您输入参考答案",defaultValue:I,onChange:function(e){return Z(e)}}),(0,q.jsx)("p",{className:O.titleWrap,children:(0,q.jsx)("span",{className:O.title,children:"题目解析:"})}),(0,q.jsx)(T.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"请您输入题目解析",defaultValue:g,onChange:function(e){return y(e)}}),(0,q.jsxs)(m.Z,{form:E,size:"large",onFinishFailed:function(){var e=a()(l()().mark((function e(n){var i;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.ZP.error(n.errorFields[0].errors[0]),E.scrollToField(null==n||null===(i=n.errorFields)||void 0===i||null===(i=i[0])||void 0===i?void 0:i.name,{behavior:"smooth",block:"center"});case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:[(0,q.jsxs)(N.Z,{align:"middle",className:"mb30 mt20",children:[(0,q.jsx)(m.Z.Item,{noStyle:!0,name:"use_keywords",valuePropName:"checked",children:(0,q.jsx)(ae.Z,{})}),(0,q.jsx)(re.Z,{className:"ml10",children:"开启关键词自动判分"}),(0,q.jsx)(re.Z,{children:(0,q.jsx)(p.Z,{placement:"right",title:"选中后,需要设置每个关键词的分值,系统会根据设置的关键词进行自动判分; 所有关键词分值之和必须小于等于小题分值。",children:(0,q.jsx)(oe.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})})})]}),A&&(0,q.jsx)(m.Z.List,{name:"keywords",rules:[{validator:function(e,n){return null!=n&&n.length?(null==n?void 0:n.reduce((function(e,n){return e+n.score}),0))>parseFloat(W)?Promise.reject(new Error("所有关键词的分值之和必须小于等于该小题的分值")):Promise.resolve():Promise.reject(new Error("请设置判分关键词"))}}],children:function(e,n){var i=n.add,t=n.remove;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)("div",{className:"mb10",children:"关键词"}),(0,q.jsxs)(N.Z,{align:"middle",className:"font14 mb30",children:[(0,q.jsx)(re.Z,{flex:1,children:(0,q.jsx)(j.Z,{value:M,onChange:function(e){P(e.target.value)},maxLength:50,allowClear:!0,onPressEnter:function(e){var n,t,l,s,a="".concat(null===(n=e.target)||void 0===n?void 0:n.value),r=null==a||null===(t=a.split("|"))||void 0===t||null===(t=t.filter((function(e){return!!e})))||void 0===t?void 0:t.map((function(e){return null==e?void 0:e.trim()})),o=E.getFieldValue("keywords"),c=(null==o||null===(l=o.map((function(e){return null==e?void 0:e.keyword})))||void 0===l?void 0:l.flat())||[],d=le()(r);try{for(d.s();!(s=d.n()).done;){var u=s.value;if(c.includes(u))return void f.ZP.error("为避免判分错误,请勿设置相同的关键词")}}catch(e){d.e(e)}finally{d.f()}(function(e){if(!e)return!1;if(!/^s*$/.test(e)&&""!==e.trim())return new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~!@#¥……&*()—【】‘;:”“。,、?「」『』_\\+\\-·%《》]|[\\\\/]"),"|"!==e||(f.ZP.warning("关键词不能只输入一个“|”字符!"),!1);f.ZP.warning("关键词不能全为空格")})(a)&&(i({keyword:r,score:1}),P(""))},className:O.inputBorder,placeholder:"支持设置多个关键词;并列关键词(或的关系)请用“|”分隔开"})}),(0,q.jsx)(re.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"},children:"“回车键”保存关键词"})]}),e.map((function(e){var n=e.key,i=e.name,l=L()(e,de);return(0,q.jsx)(N.Z,{style:{marginRight:148},children:(0,q.jsx)(re.Z,{flex:1,children:(0,q.jsxs)(N.Z,{align:"middle",justify:"space-between",children:[(0,q.jsx)(m.Z.Item,o()(o()({},l),{},{name:[i,"keyword"],children:(0,q.jsx)(ue,{onClose:function(){return t(i)}})})),(0,q.jsx)(m.Z.Item,o()(o()({},l),{},{name:[i,"score"],label:"分值",rules:[{required:!0}],children:(0,q.jsx)(v.Z,{min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"请输入关键词分数"})}))]})})},n)}))]})}})]})]})},me=(0,I.connect)((function(e){var n=e.loading;return{globalSetting:e.globalSetting,loading:n.effects}}),null,null,{forwardRef:!0})((0,u.forwardRef)(he)),pe=i(36381),xe=i(85573),ve=i.n(xe),fe={wrap:"wrap___Cc0gS",deleteIcon:"deleteIcon___ebwMv",keywordTag:"keywordTag___lUfL5",questionTitleEditorWrap:"questionTitleEditorWrap___u9UgK",choiceWrap:"choiceWrap___VHsr3",choiceIndex:"choiceIndex___rsj9r",judgementIndex:"judgementIndex___fMm6E",setAnswerBtn:"setAnswerBtn___krVC9",activeAnswer:"activeAnswer___WiYo2",activeJudgementAnswer:"activeJudgementAnswer___M6iww",actionWrapper:"actionWrapper___oKI8_",addIcon:"addIcon___eMbGP",inputBorder:"inputBorder___ob_6x",placeholder:"placeholder___Vkwr4",blankWrapper:"blankWrapper____MZQ5",blankInput:"blankInput___ephwY",blankInputNumberWrapper:"blankInputNumberWrapper___C1UJS",addBtn:"addBtn___qRBpJ",blankIndex:"blankIndex___QsKgf",baseInputWrapper:"baseInputWrapper___juqCB",collapseWrapper:"collapseWrapper___kAXJ0",panelHeader:"panelHeader___hLTSe",open:"open___wWDjf",close:"close___XPTJ0",hide:"hide___VytUy"},je=i(37520),_e=i(89378),ge=["value","onChange","scrollId"],ye=function(e){var n=e.value,i=e.onChange,t=e.scrollId,l=L()(e,ge);return(0,q.jsx)("div",{id:t||"",children:(0,q.jsx)(T.Z,o()(o()({},l),{},{defaultValue:n,onChange:function(e,n){null!=n&&n.length?i(e,n):i(e)}}))})},Ne=function(e){var n=e.value,i=e.onChange,t=e.placeholder,l=e.height,s=void 0===l?140:l;return e.isEdit?(0,q.jsx)(T.Z,{watch:!0,isFocus:!0,height:s,placeholder:t,defaultValue:n,onChange:i}):(0,q.jsx)("div",{style:{cursor:"pointer"},children:n?(0,q.jsx)(b.Z,{className:fe.inputBorder,value:n}):(0,q.jsx)("div",{className:"".concat(fe.inputBorder," ").concat(fe.placeholder),children:t})})},we=["key","name"],be=["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"],Ie=function(e){var n=e.value,i=e.onChange,t=e.choiceTextKey,l=e.answerKey,s=e.index,a=e.isEdit,r=e.setInputActive,c=e.form,d=e.choiceOptionsPath,u=e.allowChangeMode,h=e.showAddIcon,m=e.addItem,x=e.deleteItem,v=!0===(null==n?void 0:n[l]),f=function(){var e;v?i(o()(o()({},n),{},ve()({},l,!1))):(u||(e=c.getFieldValue(d),c.setFieldValue(d,e.map((function(e){return o()(o()({},e),{},ve()({},l,!1))})))),i(o()(o()({},n),{},ve()({},l,!0))))};return(0,q.jsxs)(N.Z,{className:fe.choiceWrap,align:"middle",wrap:!1,children:[(0,q.jsx)(re.Z,{onClick:f,className:"".concat(fe.choiceIndex," ").concat(v?fe.activeAnswer:""),children:be[s]}),(0,q.jsx)(re.Z,{flex:1,className:"".concat(fe.editorWrap," ml15"),onClick:r,children:(0,q.jsx)(Ne,{height:155,placeholder:"请您输入选项",isEdit:a,value:null==n?void 0:n[t],onChange:function(e){i(o()(o()({},n),{},ve()({},t,e)))}})}),(0,q.jsx)(re.Z,{flex:"0 0 auto",className:"ml15",children:(0,q.jsx)("div",{onClick:f,className:"".concat(fe.setAnswerBtn," ").concat(v?fe.activeAnswer:""),children:v?"正确答案":"设为答案"})}),(0,q.jsxs)(re.Z,{className:fe.actionWrapper,children:[(0,q.jsx)(p.Z,{title:"新增参考答案",children:(0,q.jsx)(je.Z,{className:fe.addIcon,onClick:m,style:{visibility:h?"visible":"hidden"}})}),(0,q.jsx)(p.Z,{title:"删除",children:(0,q.jsx)(_e.Z,{className:fe.deleteIcon,onClick:x,style:{visibility:s>1?"visible":"hidden"}})})]})]})},Ze=function(e){var n=e.questionTitlePlaceholder,i=e.titleKey,t=e.choiceKey,l=e.analysisKey,s=e.choiceTextKey,a=e.answerKey,r=e.choiceOptionsPath,c=e.allowChangeMode,h=void 0===c||c,p=e.form,x=e.showAnalysis,v=void 0===x||x,f=(0,u.useState)(),j=d()(f,2),_=j[0],g=j[1],y=(0,u.useState)(!1),N=d()(y,2),w=N[0],b=N[1];return(0,q.jsxs)("div",{className:fe.wrap,children:[(0,q.jsx)("div",{className:fe.questionTitleEditorWrap,children:(0,q.jsx)(m.Z.Item,{label:"题干",name:i,labelCol:{span:24},rules:[{required:!0}],children:(0,q.jsx)(ye,{scrollId:Array.isArray(i)?i.join("_"):"".concat(i),watch:!0,height:140,placeholder:n})})}),(0,q.jsx)(m.Z.Item,{label:"答案选项",required:!0,labelCol:{span:24}}),(0,q.jsx)(m.Z.List,{name:t,rules:[{validator:function(e,n){var i=n.some((function(e){return e[a]})),t=n.findIndex((function(e){var n;return(null===(n=e[s])||void 0===n?void 0:n.length)<=0}));return-1!==t?Promise.reject(new Error("请先输入".concat(be[t],"选项的内容"))):i?Promise.resolve():Promise.reject(new Error("请设置正确答案"))}}],children:function(e,n){var i=n.add,t=n.remove;return(0,q.jsxs)("div",{id:Array.isArray(r)?r.join("_"):"".concat(r),children:[e.map((function(n,l){var c=n.key,d=n.name,x=L()(n,we),v=_===c,f=l<7&&l===e.length-1;return(0,u.createElement)(m.Z.Item,o()(o()({},x),{},{key:c,name:d,noStyle:!0}),(0,q.jsx)(Ie,{choiceTextKey:s,answerKey:a,index:l,isEdit:v,setInputActive:function(){g(c)},form:p,choiceOptionsPath:r,allowChangeMode:h,showAddIcon:f,addItem:function(){return i(ve()(ve()({},s,""),a,0))},deleteItem:function(){return t(d)}}))})),e.length<8&&(0,q.jsx)("div",{className:"".concat(fe.addBtn," mb30"),onClick:function(){return i(ve()(ve()({},s,""),a,0))},children:"添加选项"})]})}}),v&&(0,q.jsx)("div",{onClick:function(){return b(!0)},children:(0,q.jsx)(m.Z.Item,{name:l,label:"题目解析",labelCol:{span:24},children:(0,q.jsx)(Ne,{placeholder:"请编辑题目解析(非必填)",isEdit:w})})})]})},Ce=["key","name"],ke=function(e){var n=e.value,i=e.onChange;return(0,q.jsxs)(N.Z,{align:"middle",className:"ml20",gutter:[40,20],children:[null==n?void 0:n.map((function(e,t){return(0,q.jsxs)(re.Z,{className:fe.blankWrapper,children:[(0,q.jsx)(j.Z,{className:fe.blankInput,defaultValue:e,maxLength:1e3,onBlur:function(e){var l=P()(n),s=e.target.value.trim();l[t]=s,i(l)}}),(0,q.jsx)(p.Z,{title:"删除",children:(0,q.jsx)(_e.Z,{className:fe.deleteIcon,style:{marginLeft:15,visibility:t>0?"visible":"hidden"},onClick:function(){return function(e){x.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确认要删除这个参考答案吗?",className:fe.modal,onOk:function(){var t=P()(n);t.splice(e,1),i(t)}})}(t)}})})]},"".concat(e,"_").concat(t))})),(0,q.jsx)(re.Z,{children:(0,q.jsx)("div",{className:"".concat(fe.addBtn),onClick:function(){var e;(e=P()(n)).push(""),i(e)},children:"新增答案"})})]})},Me=function(e){var n=e.value,i=void 0===n||n,t=e.onChange;return(0,q.jsx)(ae.Z,{checked:!i,onChange:function(e){t(!e)}})},Pe="▁",Se=function(e){var n,i=e.questionTitlePlaceholder,t=e.form,l=e.name,s=(e.scoreByBlank,e.answerKey),a=e.titleKey,r=void 0===a?"name":a,c=e.analysisKey,h=void 0===c?"analysis":c,p=e.isOrdered,x=void 0===p?"is_ordered":p,v=(0,u.useState)(!1),f=d()(v,2),_=f[0],g=f[1],y=function(e,n){for(var i=n.line,t=0,l=0;l<i;l++)t+=e.getLine(l).split(Pe).length-1;return t+=e.getLine(i).substring(0,n.ch).split(Pe).length-1},w=function(){var e=t.getFieldValue(["sub_item_banks"].concat(P()(s)));t.setFieldValue(["sub_item_banks"].concat(P()(s)),null==e?void 0:e.map((function(e,n){return o()(o()({},e),{},{position:n+1})})))},b=(0,u.useRef)(),I=function(e,n){for(var i=0;i<e;i++)b.current({position:null,answer_text:[""]},n+i);w()},Z=(0,u.useRef)(),C=function(e){Z.current(e),w()},k=null===(n=t.getFieldValue("sub_item_banks"))||void 0===n||null===(n=n[null==s?void 0:s[0]])||void 0===n?void 0:n[null==s?void 0:s[1]];return(0,q.jsxs)("div",{className:fe.wrap,children:[(0,q.jsx)("div",{className:fe.questionTitleEditorWrap,children:(0,q.jsx)(m.Z.Item,{label:"题干",name:r,labelCol:{span:24},rules:[{required:!0}],children:(0,q.jsx)(ye,{scrollId:"name",watch:!0,height:140,placeholder:i,showNullButton:!0,onCMBeforeChange:function(e,n){!function(e,n,i,t){var l=e.getRange(n.from,n.to),s=0;if(n.text.forEach((function(e){s+=e.split(Pe).length-1})),"setValue"!==n.origin)if(l&&-1!==l.indexOf(Pe)){var a=l.split(Pe).length-1,r=y(e,n.from);console.log("删除".concat(a,"个, 前面有").concat(r,"个,新增").concat(s,"个")),t(a>1?Array.from({length:a},(function(e,n){return r+n})):r)}else if(s>0){var o=y(e,n.from);console.log("新增".concat(s,"个,之前有").concat(o,"个")),i(s,o)}}(e,n,I,C)}})})}),(0,q.jsx)(m.Z.List,{name:s,rules:[{validator:function(e,n){if(0===(null==n?void 0:n.length))return Promise.reject(new Error("答案不能为空"));var i,t=le()(n);try{for(t.s();!(i=t.n()).done;){var l=(i.value||{}).answer_text;if(null!=l&&l.some((function(e){return 0===(null==e?void 0:e.length)})))return Promise.reject(new Error("填空项答案不能为空"))}}catch(e){t.e(e)}finally{t.f()}return Promise.resolve()}}],children:function(e,n,i){var t=n.add,l=n.remove;i.errors;return b.current=t,Z.current=l,(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(m.Z.Item,{label:"答案选项",required:!0,labelCol:{span:24}}),e.map((function(e,n){var i=e.key,t=e.name,l=L()(e,Ce);return(0,q.jsxs)(N.Z,{className:"mb20",align:"middle",wrap:!1,children:[(0,q.jsxs)(re.Z,{flex:"0 0 auto",className:"".concat(fe.blankIndex),children:["填空项",n+1]}),(0,q.jsxs)(re.Z,{flex:1,children:[(0,q.jsx)(N.Z,{align:"top",justify:"space-between",wrap:!1,children:(0,q.jsx)(re.Z,{children:(0,q.jsx)(m.Z.Item,o()(o()({},l),{},{name:[t,"answer_text"],noStyle:!0,children:(0,q.jsx)(ke,{})}))})}),(0,q.jsx)(m.Z.Item,o()(o()({},l),{},{name:[t,"position"],noStyle:!0,children:(0,q.jsx)(j.Z,{type:"hidden"})}))]})]},i)}))]})}}),(0,q.jsxs)(N.Z,{align:"middle",children:[(0,q.jsx)(m.Z.Item,{name:[l,"downcase"],valuePropName:"checked",children:(0,q.jsx)(ae.Z,{})}),(0,q.jsx)(re.Z,{className:"ml10",children:"判分时忽略答案中的字母大小写"})]}),(0,q.jsxs)(N.Z,{align:"middle",children:[(0,q.jsx)(m.Z.Item,{name:[l,"no_space"],valuePropName:"checked",children:(0,q.jsx)(ae.Z,{})}),(0,q.jsx)(re.Z,{className:"ml10",children:"判分时忽略答案中的空格"})]}),(null==k?void 0:k.length)>1&&(0,q.jsxs)(N.Z,{align:"middle",className:(null==k?void 0:k.length)>1?"mb30":"".concat(fe.hide),children:[(0,q.jsx)(m.Z.Item,{name:x,children:(0,q.jsx)(Me,{})}),(0,q.jsx)(re.Z,{className:"ml10",children:"允许学生每个填空的答案与标准答案的顺序不一致"})]}),(0,q.jsx)("div",{onClick:function(){return g(!0)},children:(0,q.jsx)(m.Z.Item,{name:h,label:"题目解析",labelCol:{span:24},children:(0,q.jsx)(Ne,{placeholder:"请编辑题目解析(非必填)",isEdit:_})})})]})},Le=["key","name"],Ee=ve()(ve()({},"正确","T"),"错误","F"),Te=function(e){var n=e.value,i=e.onChange,t=e.form,l=e.choiceKey,s=!0===(null==n?void 0:n.is_answer),a=null==n?void 0:n.choice_text,r=function(){var e,s=null==t||null===(e=t.getFieldValue(["sub_item_banks"].concat(P()(l))))||void 0===e?void 0:e.map((function(e){return{choice_text:null==e?void 0:e.choice_text,is_answer:!1}}));null==t||t.setFieldValue(["sub_item_banks"].concat(P()(l)),s),i(o()(o()({},n),{},{is_answer:!0}))};return(0,q.jsxs)(N.Z,{className:fe.choiceWrap,align:"middle",wrap:!1,children:[(0,q.jsx)(re.Z,{onClick:r,className:"".concat(fe.choiceIndex," ").concat(fe.judgementIndex," ").concat(s?fe.activeAnswer:""),children:Ee[a]}),(0,q.jsx)(re.Z,{flex:1,className:"".concat(fe.editorWrap," ml15"),children:(0,q.jsx)("div",{className:"".concat(fe.inputBorder," ").concat(fe.placeholder," ").concat(s?fe.activeJudgementAnswer:""),children:a})}),(0,q.jsx)(re.Z,{flex:"0 0 auto",className:"ml15",children:(0,q.jsx)("div",{onClick:r,className:"".concat(fe.setAnswerBtn," ").concat(s?fe.activeAnswer:""),children:s?"正确答案":"设为答案"})})]})},Ae=function(e){var n=e.questionTitlePlaceholder,i=e.choiceKey,t=void 0===i?"choices":i,l=e.form,s=e.titleKey,a=void 0===s?"name":s,r=e.analysisKey,c=void 0===r?"analysis":r,h=(0,u.useState)(!1),p=d()(h,2),x=p[0],v=p[1];return(0,q.jsxs)("div",{className:fe.wrap,children:[(0,q.jsx)("div",{className:fe.questionTitleEditorWrap,children:(0,q.jsx)(m.Z.Item,{label:"题干",name:a,labelCol:{span:24},rules:[{required:!0}],children:(0,q.jsx)(ye,{scrollId:"name",watch:!0,height:140,placeholder:n})})}),(0,q.jsx)(m.Z.Item,{label:"答案选项",required:!0,labelCol:{span:24},children:(0,q.jsx)(m.Z.List,{name:t,rules:[{validator:function(e,n){return n.some((function(e){return!0===(null==e?void 0:e.is_answer)}))?Promise.resolve():Promise.reject(new Error("请设置正确答案"))}}],children:function(e){return(0,q.jsx)("div",{id:"choices",children:e.map((function(e){var n=e.key,i=e.name,s=L()(e,Le);return(0,u.createElement)(m.Z.Item,o()(o()({},s),{},{key:n,name:i,noStyle:!0}),(0,q.jsx)(Te,{form:l,choiceKey:t}))}))})}})}),(0,q.jsx)("div",{onClick:function(){return v(!0)},children:(0,q.jsx)(m.Z.Item,{name:c,label:"题目解析",labelCol:{span:24},children:(0,q.jsx)(Ne,{placeholder:"请编辑题目解析(非必填)",isEdit:x})})})]})},De=["value","onChange"],Oe=["key","name"],qe=function(e){var n=e.value,i=e.onChange,t=L()(e,De);return(0,q.jsx)(T.Z,o()(o()({},t),{},{defaultValue:null==n?void 0:n[0],onChange:function(e){i([e])}}))},Re=function(e){var n=e.value,i=void 0===n?[]:n,t=e.onClose;return(0,q.jsx)(se.Z,{closable:!0,onClose:t,className:fe.keywordTag,children:null==i?void 0:i.join(" 或 ")})},We=function(e){var n=e.questionTitlePlaceholder,i=e.form,t=e.showKeywords,l=e.isMustKeyWords,s=void 0===l?t:l,a=e.titleKey,r=void 0===a?"name":a,c=e.analysisKey,h=void 0===c?"analysis":c,x=e.answerTexts,_=void 0===x?"answer_texts":x,g=e.keywords,y=void 0===g?"keywords":g,w=e.useKeywords,b=void 0===w?"use_keywords":w,I=e.indexs,Z=(0,u.useState)(!1),C=d()(Z,2),k=C[0],M=C[1],S=(0,u.useState)(""),E=d()(S,2),T=E[0],A=E[1],D=m.Z.useWatch("sub_item_banks",i),O=(null==D?void 0:D[I])||{},R=O.use_keywords,W=O.score;return console.log(R,W,"itemValues"),(0,q.jsxs)("div",{className:fe.wrap,children:[(0,q.jsx)("div",{className:fe.questionTitleEditorWrap,children:(0,q.jsx)(m.Z.Item,{label:"题干",name:r,labelCol:{span:24},rules:[{required:!0}],children:(0,q.jsx)(ye,{scrollId:"name",watch:!0,height:140,placeholder:n})})}),(0,q.jsx)(m.Z.Item,{label:"参考答案",name:_,labelCol:{span:24},children:(0,q.jsx)(qe,{watch:!0,height:140,placeholder:"请编辑参考答案(非必填)"})}),t&&!s&&(0,q.jsx)(m.Z.Item,{hidden:!0,name:b,valuePropName:"checked",children:(0,q.jsx)(ae.Z,{defaultChecked:!0})}),t&&s&&(0,q.jsxs)(N.Z,{align:"middle",className:"mb30",children:[(0,q.jsx)(m.Z.Item,{name:b,valuePropName:"checked",children:(0,q.jsx)(ae.Z,{})}),(0,q.jsx)(re.Z,{className:"ml10",children:"开启关键词自动判分"}),(0,q.jsx)(re.Z,{children:(0,q.jsx)(p.Z,{placement:"right",title:"选中后,需要设置每个关键词的分值,系统会根据设置的关键词进行自动判分; 所有关键词分值之和必须小于等于小题分值。",children:(0,q.jsx)(oe.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})})})]}),(R||!s)&&(0,q.jsx)(m.Z.List,{name:y,rules:[{validator:function(e,n){return s?null!=n&&n.length?(null==n?void 0:n.reduce((function(e,n){return e+n.score}),0))>parseFloat(W)?Promise.reject(new Error("所有关键词的分值之和必须小于等于该小题的分值")):Promise.resolve():Promise.reject(new Error("请设置判分关键词")):Promise.resolve()}}],children:function(e,n){var t=n.add,l=n.remove;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)("div",{className:"".concat(fe.title," mb10"),children:s?"关键词":(0,q.jsx)("span",{style:{color:"#9096A3"},children:"判分关键词"})}),(0,q.jsxs)(N.Z,{align:"middle",className:"font14 mb30",children:[(0,q.jsx)(re.Z,{flex:1,children:(0,q.jsx)(j.Z,{value:T,onChange:function(e){A(e.target.value)},maxLength:50,allowClear:!0,onPressEnter:function(e){var n,l,s,a,r,o="".concat(null===(n=e.target)||void 0===n?void 0:n.value),c=null==o||null===(l=o.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=i.getFieldValue(["sub_item_banks"].concat(P()(y))),u=(null==d||null===(s=d.map((function(e){return null==e?void 0:e.keyword})))||void 0===s?void 0:s.flat())||[],h=le()(c);try{for(h.s();!(a=h.n()).done;){var m=a.value;if(u.includes(m))return void f.ZP.error("为避免判分错误,请勿设置相同的关键词")}}catch(e){h.e(e)}finally{h.f()}(r=o)&&(new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~!@#¥……&*()—【】‘;:”“。,、?「」『』_\\+\\-·%《》]|[\\\\/]"),"|"!==r||(f.ZP.warning("关键词不能只输入一个“|”字符!"),0))&&(t({keyword:c,score:1}),A(""))},className:fe.inputBorder,placeholder:"支持设置多个关键词;并列关键词(或的关系)请用“|”分隔开"})}),(0,q.jsx)(re.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"},children:"“回车键”保存关键词"})]}),e.map((function(e){var n=e.key,i=e.name,t=L()(e,Oe);return(0,q.jsx)(N.Z,{className:"mb20",style:{marginRight:148},children:(0,q.jsx)(re.Z,{flex:1,children:(0,q.jsxs)(N.Z,{align:"middle",justify:"space-between",children:[(0,q.jsx)(m.Z.Item,o()(o()({},t),{},{name:[i,"keyword"],children:(0,q.jsx)(Re,{onClose:function(){return l(i)}})})),s&&(0,q.jsx)(m.Z.Item,o()(o()({},t),{},{name:[i,"score"],label:"分值",rules:[{required:!0}],className:fe.blankInputNumberWrapper,children:(0,q.jsx)(v.Z,{className:fe.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"请输入关键词分数"})}))]})})},n)}))]})}}),(0,q.jsx)("div",{onClick:function(){return M(!0)},children:(0,q.jsx)(m.Z.Item,{name:h,label:"题目解析",labelCol:{span:24},children:(0,q.jsx)(Ne,{placeholder:"请编辑题目解析(非必填)",isEdit:k})})})]})},Be=["globalSetting","loading","dispatch","editData","onRef","isEdit"],ze=["key","name"],Fe=pe.Z.Panel,Ge=function(e,n){e.globalSetting,e.loading,e.dispatch;var i=e.editData,t=(e.onRef,e.isEdit),s=(L()(e,Be),(0,u.useState)("")),r=d()(s,2),c=r[0],h=r[1],p=(0,u.useState)([]),x=d()(p,2),v=x[0],j=x[1],_=m.Z.useForm(),g=d()(_,1)[0];(0,u.useEffect)((function(){i&&t&&(h(null==i?void 0:i.name),j(null==i?void 0:i.sub_item_banks),g.setFieldsValue(o()({},i)))}),[i]),(0,u.useEffect)((function(){j(g.getFieldValue("sub_item_banks"))}),[m.Z.useWatch("sub_item_banks",g)]),(0,u.useImperativeHandle)(n,(function(){return{onSave:y,Clear:N}}));var y=function(){var e=a()(l()().mark((function e(){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c){e.next=3;break}return f.ZP.info("请您输入题干"),e.abrupt("return",!1);case 3:return e.prev=3,e.next=6,g.validateFields();case 6:e.next=13;break;case 8:return e.prev=8,e.t0=e.catch(3),console.log(e.t0,"errInfo"),f.ZP.error(e.t0.errorFields[0].errors[0]),e.abrupt("return",!1);case 13:return n=v.map((function(e){return o()({id:e.id>1?e.id:null},e)})),e.abrupt("return",{name:c,sub_item_banks:n});case 15:case"end":return e.stop()}}),e,null,[[3,8]])})));return function(){return e.apply(this,arguments)}}(),N=function(){h(""),j([])},w={single:"单选题",multiple:"多选题",judgement:"判断题",completion:"填空题",subjective:"简答题",practical:"实训题",program:"编程题",bprogram:"程序填空题",combination:"组合题"};return(0,q.jsxs)("section",{className:O.wrap,children:[(0,q.jsxs)("p",{className:O.titleWrap,children:[(0,q.jsx)("span",{className:O.required,children:"*"}),(0,q.jsx)("span",{className:O.title,children:"题干:"})]}),(0,q.jsx)(T.Z,{id:"combination-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:c,onChange:function(e){return h(e)}}),(0,q.jsx)(m.Z,{form:g,autoComplete:"off",children:(0,q.jsx)(m.Z.List,{name:"sub_item_banks",rules:[{validator:function(e,n){return n?Promise.resolve():Promise.reject(new Error("请添加小题"))}}],children:function(e,n){n.add,n.remove;var i=g.getFieldValue("sub_item_banks");return(0,q.jsx)(q.Fragment,{children:(0,q.jsx)(pe.Z,{className:e.length>0?O.collapseWrapper:"",bordered:!1,expandIcon:function(e){var n=e.isActive;return(0,q.jsx)("i",{className:"iconfont icon-weizhankai ".concat(n?O.open:O.close),style:{fontSize:14,transition:"all .2s"}})},children:e.map((function(e,n){var t,l,s,a,r,c,d,u=e.key,h=e.name,p=L()(e,ze);return(0,q.jsx)(Fe,{className:O.panel,forceRender:!0,header:(0,q.jsxs)("div",{className:O.panelHeader,children:["第",n+1,"小题",(0,q.jsxs)("span",{children:["(",w[null==i||null===(t=i[h])||void 0===t?void 0:t.item_type],")"]})]}),children:(0,q.jsxs)(m.Z.Item,o()(o()({},p),{},{name:h,children:[("single"==(null==i||null===(l=i[h])||void 0===l?void 0:l.item_type)||"multiple"==(null==i||null===(s=i[h])||void 0===s?void 0:s.item_type))&&(0,q.jsx)(Ze,{questionTitlePlaceholder:"请编辑选择题题干内容",allowChangeMode:"single"!=(null==i||null===(a=i[h])||void 0===a?void 0:a.item_type),form:g,choiceKey:[h,"choices"],titleKey:[h,"name"],analysisKey:[h,"analysis"],choiceOptionsPath:["sub_item_banks",h,"choices"],choiceTextKey:"choice_text",answerKey:"is_answer"}),"completion"==(null==i||null===(r=i[h])||void 0===r?void 0:r.item_type)&&(0,q.jsx)(Se,{form:g,name:h,questionTitlePlaceholder:"请编辑题干并设置填空项",scoreByBlank:!0,titleKey:[h,"name"],analysisKey:[h,"analysis"],isOrdered:[h,"is_ordered"],answerKey:[h,"standard_answer"]}),"judgement"==(null==i||null===(c=i[h])||void 0===c?void 0:c.item_type)&&(0,q.jsx)(Ae,{form:g,questionTitlePlaceholder:"请编辑判断题题干内容",titleKey:[h,"name"],analysisKey:[h,"analysis"],choiceKey:[h,"choices"]}),"subjective"==(null==i||null===(d=i[h])||void 0===d?void 0:d.item_type)&&(0,q.jsx)(We,{showKeywords:!0,form:g,titleKey:[h,"name"],analysisKey:[h,"analysis"],answerTexts:[h,"answer_texts"],useKeywords:[h,"use_keywords"],keywords:[h,"keywords"],indexs:h,questionTitlePlaceholder:"请编辑简答题题干内容"})]}))},u)}))})})}})})]})},Ve=(0,I.connect)((function(e){var n=e.loading;return{globalSetting:e.globalSetting,loading:n.effects}}),null,null,{forwardRef:!0})((0,u.forwardRef)(Ge)),Ue=i(8304),Ye=function(e){var n=e.visible,i=e.onCancel,t=e.onRandomExchange,l=e.selectFromProblemSet,s=e.questionParams;return(0,q.jsx)(x.Z,{title:"请选择替换方式",open:n,onCancel:i,centered:!0,maskClosable:!0,footer:null,children:(0,q.jsxs)(N.Z,{justify:"center",className:"pb20",children:[(0,q.jsx)(Ue.Z,{onClick:t,children:"随机更换"}),"PRACTICAL"!==(null==s?void 0:s.type)&&(0,q.jsx)(g.ZP,{style:{marginLeft:24},onClick:l,children:"从题库中选择"})]})})},Ke=i(19216),Qe=i(59638),He=i(24334),Je=i(16091),Xe=function(e){var n,i,t,s,r,c,M,P,S,L,E,T=e.data,A=e.submit,D=e.goBack,O=(e.loading,e.onTypeScore),R=e.editPreview,W=void 0!==R&&R,z=e.onSkipExamination,F=e.selectValue,G=e.onExchange,U=e.handleMarkWrongQuestion,Y=(0,u.useRef)(),Q=(0,u.useState)(null),H=d()(Q,2),J=H[0],$=H[1],ee=(0,u.useState)(!1),ne=d()(ee,2),te=ne[0],le=ne[1],se=(0,u.useState)(!1),ae=d()(se,2),re=ae[0],oe=ae[1],ce=(0,u.useRef)(),de=m.Z.useForm(),ue=d()(de,1)[0],he=(0,I.useParams)(),pe=(0,u.useState)(!1),xe=d()(pe,2),ve=xe[0];xe[1];(0,u.useEffect)((function(){le(!0)}),[]),(0,u.useEffect)((function(){W||(0,Z.Dk)("试卷预览")}),[W]);var fe=["容易","简单","适中","困难"],je=["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"],_e={SINGLE:"单选题",MULTIPLE:"多选题",JUDGMENT:"判断题",COMPLETION:"填空题",SUBJECTIVE:"简答题",PRACTICAL:"实训题",PROGRAM:"编程题",BPROGRAM:"程序填空题",COMBINATION:"组合题"},ge={single:"单选题",multiple:"多选题",judgement:"判断题",completion:"填空题",subjective:"简答题",practical:"实训题",program:"编程题",bprogram:"程序填空题",combination:"组合题"},ye=function(e,n){var i,t=null==e||null===(i=e.standard_answer)||void 0===i?void 0:i.map((function(e,n){var i;return(0,q.jsx)("div",{children:"答案(填空".concat(null==e?void 0:e.position,"):").concat(null==e||null===(i=e.answer_text)||void 0===i?void 0:i.join("、"))},n)}));return(0,q.jsx)(u.Fragment,{children:(0,q.jsxs)("div",{className:h.analysis,children:[(0,q.jsxs)("div",{style:{display:"flex"},children:[(0,q.jsx)("div",{children:"正确答案:"}),(0,q.jsx)("div",{children:t})]}),(0,q.jsxs)("aside",{children:[(0,q.jsx)("span",{className:h.text,children:"解析:"}),(0,q.jsx)(b.Z,{value:e.analysis?e.analysis:"暂无解析"})]}),(0,q.jsxs)("ul",{children:[(0,q.jsxs)("li",{children:[(0,q.jsx)("span",{style:{color:"#007AFF",marginRight:10},children:"方向&课程:"}),n?"".concat((null==n?void 0:n.discipline_name)||"--","/").concat(null==n?void 0:n.sub_discipline_name):"".concat((null==e?void 0:e.discipline_name)||"--","/").concat(null==e?void 0:e.sub_discipline_name)]}),(0,q.jsx)(p.Z,{title:n?null==n?void 0:n.tag_discipline_name:null==e?void 0:e.tag_discipline_name,children:(0,q.jsxs)("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:[(0,q.jsx)("span",{style:{color:"#5AB891",marginRight:10},children:"知识点:"}),n?null==n?void 0:n.tag_discipline_name:null==e?void 0:e.tag_discipline_name]})})]})]})})},Ne=function(e){var n,i=null==e||null===(n=e.standard_answer)||void 0===n?void 0:n.map((function(e,n){return(0,q.jsx)("div",{children:"答案(填空".concat((null==e?void 0:e.position)||(null==e?void 0:e.exercise_choice_id),"):").concat(null==e?void 0:e.answer_text)},n)}));return(0,q.jsx)(u.Fragment,{children:(0,q.jsxs)("div",{className:h.analysis,children:[(0,q.jsxs)("div",{style:{display:"flex"},children:[(0,q.jsx)("div",{children:"正确答案:"}),(0,q.jsx)("div",{children:i})]}),(0,q.jsxs)("aside",{children:[(0,q.jsx)("span",{className:h.text,children:"解析:"}),(0,q.jsx)(b.Z,{value:e.analysis?e.analysis:"暂无解析"})]}),(0,q.jsxs)("ul",{children:[(0,q.jsxs)("li",{children:[(0,q.jsx)("span",{style:{color:"#007AFF",marginRight:10},children:"方向&课程:"}),"".concat((null==e?void 0:e.discipline_name)||"--","/").concat(null==e?void 0:e.sub_discipline_name)]}),(0,q.jsx)(p.Z,{title:null==e?void 0:e.tag_discipline_name,children:(0,q.jsxs)("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:[(0,q.jsx)("span",{style:{color:"#5AB891",marginRight:10},children:"知识点:"}),null==e?void 0:e.tag_discipline_name]})})]})]})})},we=function(e,n){var i;return(0,q.jsxs)("div",{className:h.analysis,children:[(0,q.jsxs)("div",{children:["正确答案:",null==e||null===(i=e.answer_texts)||void 0===i?void 0:i[0]]}),(0,q.jsxs)("aside",{children:[(0,q.jsx)("span",{className:h.text,children:"解析:"}),(0,q.jsx)(b.Z,{value:e.analysis?e.analysis:"暂无解析"})]}),(0,q.jsxs)("ul",{children:[(0,q.jsxs)("li",{children:[(0,q.jsx)("span",{style:{color:"#007AFF",marginRight:10},children:"方向&课程:"}),n?"".concat((null==n?void 0:n.discipline_name)||"--","/").concat(null==n?void 0:n.sub_discipline_name):"".concat((null==e?void 0:e.discipline_name)||"--","/").concat(null==e?void 0:e.sub_discipline_name)]}),(0,q.jsx)(p.Z,{title:n?null==n?void 0:n.tag_discipline_name:null==e?void 0:e.tag_discipline_name,children:(0,q.jsxs)("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:[(0,q.jsx)("span",{style:{color:"#5AB891",marginRight:10},children:"知识点:"}),n?null==n?void 0:n.tag_discipline_name:null==e?void 0:e.tag_discipline_name]})})]})]})},be=function(e){var n,i;return(0,q.jsxs)("div",{className:h.analysis,children:[(0,q.jsxs)("aside",{children:[(0,q.jsx)("span",{className:h.text,children:"预期输出:"}),(0,q.jsx)(b.Z,{value:null==e||null===(n=e.program_attr)||void 0===n?void 0:n.description})]}),(0,q.jsxs)("div",{style:{marginTop:20},children:["正确答案:",(null==e||null===(i=e.program_attr)||void 0===i?void 0:i.answer_text)||"--"]}),(0,q.jsxs)("aside",{children:[(0,q.jsx)("span",{className:h.text,children:"解析:"}),(0,q.jsx)(b.Z,{value:e.analysis?e.analysis:"暂无解析"})]}),(0,q.jsxs)("ul",{children:[(0,q.jsxs)("li",{children:[(0,q.jsx)("span",{style:{color:"#007AFF",marginRight:10},children:"方向&课程:"}),"".concat((null==e?void 0:e.discipline_name)||"--","/").concat(null==e?void 0:e.sub_discipline_name)]}),(0,q.jsx)(p.Z,{title:null==e?void 0:e.tag_discipline_name,children:(0,q.jsxs)("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:[(0,q.jsx)("span",{style:{color:"#5AB891",marginRight:10},children:"知识点:"}),null==e?void 0:e.tag_discipline_name]})})]})]})},Ie=function(e){var n,i;return(0,q.jsxs)("div",{style:{marginTop:"12px"},children:[null==e||null===(n=e.shixun)||void 0===n||null===(n=n.challenges)||void 0===n?void 0:n.map((function(e,n){return(0,q.jsxs)("div",{className:"c-grey-666 font14 mb10 ml25",style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,q.jsxs)("div",{children:[(0,q.jsxs)("span",{className:"mr5",children:["第",n+1,"关"]}),(0,q.jsx)(p.Z,{title:null==e?void 0:e.challenge_name,children:(0,q.jsx)("span",{children:(0,Z.Pq)(null==e?void 0:e.challenge_name,44)})},n)]}),W&&(0,q.jsxs)("div",{children:["分值:",e.score,"分"]})]})})),(0,q.jsx)(I.Link,{style:{float:"right"},target:"_blank",to:"/shixuns/".concat(null==e||null===(i=e.shixun)||void 0===i?void 0:i.identifier,"/challenges"),children:"实训详情"}),(0,q.jsx)("div",{style:{clear:"both"}})]})},Ze=function(e){console.log(e,"key"),z(e-1)},Ce=function(e,n){if("SINGLE"===n)return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(ie,{ref:Y,editData:e,isEdit:!0}),(0,q.jsx)(_.Z,{})]});if("MULTIPLE"===n)return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(X,{ref:Y,editData:e,isEdit:!0}),(0,q.jsx)(_.Z,{})]});if("JUDGMENT"===n)return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(V,{ref:Y,editData:e,isEdit:!0}),(0,q.jsx)(_.Z,{})]});if("COMPLETION"===n)return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(B,{ref:Y,editData:e,isEdit:!0}),(0,q.jsx)(_.Z,{})]});if("SUBJECTIVE"===n)return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(me,{ref:Y,editData:e,isEdit:!0}),(0,q.jsx)(_.Z,{})]});if("COMBINATION"===n)return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Ve,{ref:Y,editData:e,isEdit:!0}),(0,q.jsx)(_.Z,{})]});var i,t;if("BPROGRAM"===n)return(0,q.jsx)(q.Fragment,{children:(0,q.jsxs)(m.Z,{form:ue,style:{marginTop:20},onFinishFailed:function(e){var n;e.errorFields[0].name.includes("standard_answers")?f.ZP.error("填空项答案不能为空"):f.ZP.error(e.errorFields[0].errors[0]),ue.scrollToField(null==e||null===(n=e.errorFields)||void 0===n||null===(n=n[0])||void 0===n?void 0:n.name,{behavior:"smooth",block:"center"})},onFinish:function(){var n=a()(l()().mark((function n(i){var t,s,a;return l()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return s=o()(o()({question_score:e.score},i),{},{question_type:8,hack:o()(o()({},i.hack),{},{difficult:e.program_attr.difficult}),hack_codes:o()(o()({},i.hack_codes),{},{code:He.Base64.encode(null===(t=i.hack_codes)||void 0===t?void 0:t.code)})}),ve&&(s.is_cover=1),n.next=4,(0,C.ZP)("/api/exercise_questions/".concat(e.id,".json"),{method:"put",body:s});case 4:0===(null==(a=n.sent)?void 0:a.status)&&(f.ZP.success("编辑成功"),Ze(F+1)),$(null);case 7:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}(),children:[(0,q.jsx)(Qe.tc,{form:ue,questionTitlePlaceholder:"请编辑题干并设置填空项",scoreByBlank:!1,hackidentifier:null==e||null===(i=e.program_attr)||void 0===i?void 0:i.identifier,answerKey:"standard_answers"}),(0,q.jsx)(_.Z,{})]})});"PROGRAM"===n&&I.history.push("/problems/".concat(null==e||null===(t=e.program_attr)||void 0===t?void 0:t.identifier,"/edit?type=exercises&express_id=").concat(he.categoryId,"&question_id=").concat(null==e?void 0:e.id,"&score=").concat(null==e?void 0:e.score,"&callback_url=").concat(location.pathname,"&select=").concat(F,"&exercise=true"));return"PRACTICAL"===n?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(K,{ref:Y,editData:e,isEdit:!0}),(0,q.jsx)(_.Z,{})]}):void 0},ke=function(){var e=a()(l()().mark((function e(n,i){var t,s,a,r,c,d,u,h,m,p,v,j;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null===(t=Y.current)||void 0===t?void 0:t.onSave();case 2:if(s=e.sent){e.next=5;break}return e.abrupt("return");case 5:if(a={question_score:i.score,analysis:s.analysis},"SINGLE"!==n&&"MULTIPLE"!==n&&"JUDGMENT"!==n||(c=[],d=[],a.question_type="JUDGMENT"===n?2:1,a.question_title=null==s?void 0:s.name,null==s||null===(r=s.choices)||void 0===r||r.forEach((function(e,n){c.push(e.choice_text),null!=e&&e.is_answer&&d.push(n+1)})),a.question_choices=c,a.standard_answers=d),"COMPLETION"===n&&(a.is_ordered=s.is_ordered,a.question_title=null==s?void 0:s.name,a.question_type=3,h=[],null==s||null===(u=s.standard_answers)||void 0===u||u.forEach((function(e,n){h.push({choice_id:e.position,answer_text:e.answer_text})})),a.standard_answers=h,a.downcase=null==s?void 0:s.downcase,a.no_space=null==s?void 0:s.no_space),"SUBJECTIVE"===n&&(console.log("editorData"),console.log(s),a.question_title=null==s?void 0:s.name,a.question_type=4,a.answer_texts=null==s?void 0:s.answer_texts,a.use_keywords=null==s?void 0:s.use_keywords,a.keywords=null==s?void 0:s.keywords),"COMBINATION"===n&&(a.question_title=null==s?void 0:s.name,a.question_type=7,a.sub_questions=null==s||null===(m=s.sub_item_banks)||void 0===m?void 0:m.map((function(e,n){if("single"==(null==e?void 0:e.item_type)||"judgement"==(null==e?void 0:e.item_type)||"multiple"==(null==e?void 0:e.item_type)){var i,t=[],l=[];return null==e||null===(i=e.choices)||void 0===i||i.forEach((function(e,n){t.push(e.choice_text),null!=e&&e.is_answer&&l.push(n+1)})),{id:e.id,question_id:e.id,question_title:e.name,difficulty:e.difficulty,question_type:"single"==(null==e?void 0:e.item_type)?0:"multiple"==(null==e?void 0:e.item_type)?1:2,question_choices:t,standard_answers:l,analysis:e.analysis,question_score:null==e?void 0:e.score}}if("completion"==(null==e?void 0:e.item_type)){var s,a=[];return null==e||null===(s=e.standard_answer)||void 0===s||s.forEach((function(e,n){a.push({choice_id:e.position,answer_text:e.answer_text,score:e.score})})),{id:e.id,question_id:e.id,is_ordered:e.is_ordered,question_title:e.name,difficulty:e.difficulty,question_type:3,standard_answers:a,analysis:e.analysis,downcase:null==e?void 0:e.downcase,no_space:null==e?void 0:e.no_space,question_score:null==e?void 0:e.score}}if("subjective"==(null==e?void 0:e.item_type))return{id:e.id,question_id:e.id,question_title:e.name,question_type:4,difficulty:e.difficulty,answer_texts:null==e?void 0:e.answer_texts,analysis:e.analysis,question_score:null==e?void 0:e.score,use_keywords:e.use_keywords,keywords:null==e?void 0:e.keywords}})),delete a.analysis),p=!1,1!==(null==i?void 0:i.is_my)){e.next=16;break}return e.next=14,new Promise((function(e,n){x.Z.confirm({title:"提示",content:"此题目已存在于试题库,是否将修改后的题目覆盖试题库的原题?",okText:"覆盖原题",cancelText:"不覆盖",keyboard:!1,onOk:function(){e(!0)},onCancel:function(){e(!1)}})}));case 14:v=e.sent,p=v;case 16:if(p&&(a.is_cover=1),"PRACTICAL"===n){e.next=23;break}return e.next=20,(0,C.ZP)("/api/exercise_questions/".concat(i.id,".json"),{method:"put",body:a});case 20:e.t0=e.sent,e.next=26;break;case 23:return e.next=25,(0,C.ZP)("/api/exercise_questions/".concat(i.id,"/update_shixun_score.json"),{method:"post",body:o()({},s)});case 25:e.t0=e.sent;case 26:0===(null==(j=e.t0)?void 0:j.status)&&(f.ZP.success("编辑成功"),Ze(F+1),$(null));case 28:case"end":return e.stop()}}),e)})));return function(n,i){return e.apply(this,arguments)}}(),Me=function(){var e=a()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(0,I.getDvaApp)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"正在更新试卷,请稍后..."}}),e.next=3,(0,C.ZP)("/api/exercises/".concat(he.categoryId,"/sync_random_question.json"),{method:"post"});case 3:if(0!==e.sent.status){e.next=8;break}return e.next=7,z(F);case 7:f.ZP.success("更新成功");case 8:(0,I.getDvaApp)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1}});case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Pe=null==T||null===(n=T.questionList)||void 0===n?void 0:n.reduce((function(e,n){return e+Number(n.questions_score)}),0),Se=W&&1!==(null==T||null===(i=T.exam)||void 0===i?void 0:i.exercise_status);return(0,q.jsxs)("section",{className:h.wrap,children:[(0,q.jsxs)("div",{id:"id_left_preview",className:h.left,onMouseEnter:function(e){document.getElementById("id_left_preview").style.overflowY="auto"},onMouseLeave:function(e){document.getElementById("id_left_preview").style.overflowY="hidden"},children:[(0,q.jsx)("div",{className:h.title,children:(0,q.jsxs)("div",{className:"body-overflow-initial",children:[(0,q.jsx)("b",{}),(0,q.jsx)("span",{children:"答题卡"})]})}),(0,q.jsxs)("div",{className:h.total,children:[(0,q.jsxs)("div",{children:[(0,q.jsx)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSIxMCIgZmlsbD0iI0VBRjNGNCIvPjxwYXRoIGQ9Ik0yNS45MDUgMTUuMzdhLjc3NS43NzUgMCAwIDAtLjYyNi0uNTI5bC00LjgxNC0uNy0yLjE1Mi00LjM2MmEuNzc2Ljc3NiAwIDAgMC0xLjM5MiAwbC0yLjE1MyA0LjM2My00LjgxNC42OTlhLjc3NS43NzUgMCAwIDAtLjQzIDEuMzIzbDMuNDg0IDMuMzk2LS44MjMgNC43OTRhLjc3Ny43NzcgMCAwIDAgMS4xMjYuODE4bDQuMzA2LTIuMjY0IDQuMzA1IDIuMjY0YS43NzguNzc4IDAgMCAwIC44MTctLjA1OS43NzcuNzc3IDAgMCAwIC4zMS0uNzU5bC0uODIzLTQuNzk0IDMuNDgzLTMuMzk2YS43NzcuNzc3IDAgMCAwIC4xOTYtLjc5NVoiIGZpbGw9IiMyMUMwQTYiIGZpbGwtcnVsZT0ibm9uemVybyIvPjwvZz48L3N2Zz4="}),(0,q.jsx)("span",{children:"题数(道)"}),(0,q.jsx)("aside",{children:null==T?void 0:T.all_questions_count})]}),(0,q.jsxs)("div",{className:"mr30 ml30",children:[(0,q.jsx)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCBmaWxsPSIjRTdGM0ZGIiB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSIxMCIvPjxnIGZpbGw9IiM0QzZGRkYiIGZpbGwtcnVsZT0ibm9uemVybyI+PHBhdGggZD0ibTIzLjcxOSAxMy4zMjUtNC4wOTgtMy45NGMtLjA5Ny0uMTMtLjIyNS0uMTYyLS4zNTUtLjE2Mi0uMTI5IDAtLjI1OC4wNjQtLjM4Ny4xNjFsLTcuNTUgNy43NTNjLS4wNjUuMDY1LS4wOTguMTYyLS4xMy4yMjdsLTEuMDMyIDUuNDI3Yy0uMDMzLjE5NC4wMzIuMzIzLjE2LjQ4NC4xMy4xMy4yMjcuMTYyLjM4OS4xNjJoLjA5Nmw0Ljc3Ni0xLjA5OWMuMDk3LS4wMzIuMTk0LS4wNjQuMjU4LS4xNjFsNy44NDEtOC4xMDhjLjE5NC0uMTYyLjE5NC0uNTE3LjAzMy0uNzQ0aC0uMDAxWm0tOC4xIDguMDQ0YS41MzQuNTM0IDAgMCAxLS4zODYuMTYyLjU2LjU2IDAgMCAxLS4zODgtLjE2MmwtMy0yLjgxYy0uMjI2LS4xOTQtLjIyNi0uNTE3LS4wMzMtLjc0My4xOTQtLjIyNy41MTctLjIyNy43NDMtLjAzM2wzIDIuODExYy4yNTkuMjI2LjI5MS41NS4wNjUuNzc2Wk0xNyAyMi45Mmg2Ljg0NHYxLjA1NUgxN3oiLz48L2c+PC9nPjwvc3ZnPg=="}),(0,q.jsx)("span",{children:"总分(分)"}),(0,q.jsx)("aside",{children:Pe&&Pe.toFixed(1)})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCBmaWxsPSIjRTRFNkZEIiB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSIxMCIvPjxnIGZpbGwtcnVsZT0ibm9uemVybyI+PHBhdGggZD0iTTEzLjgwOCAxMS40NDhhLjU1OC41NTggMCAwIDEgMCAuNzg4bC0xLjU2NCAxLjU2NWEuNTU4LjU1OCAwIDEgMS0uNzg5LS43OWwxLjU2NC0xLjU2M2EuNTU4LjU1OCAwIDAgMSAuNzkgMFptOS44ODIgMi40NjJhLjU1OC41NTggMCAwIDEtLjc4OSAwbC0xLjU2NC0xLjU2M2EuNTU4LjU1OCAwIDEgMSAuNzg5LS43ODlsMS41NjQgMS41NjRhLjU1Ni41NTYgMCAwIDEgMCAuNzg4WiIgZmlsbD0iIzY2NzhFQiIvPjxwYXRoIGQ9Ik0yMS43NTMgMjEuNzA3YTUuOTM3IDUuOTM3IDAgMSAwLTguNTguMDE1bC0uOTM3LjkzNmEuNTU4LjU1OCAwIDEgMCAuNzg5Ljc4OGwuOTk1LS45OTRhNS45MSA1LjkxIDAgMCAwIDMuNDM2IDEuMDk1YzEuMjg3IDAgMi40OC0uNDEgMy40NTItMS4xMDZsLjk5Mi45OTJhLjU1OC41NTggMCAxIDAgLjc4OS0uNzg5bC0uOTM2LS45MzdaIiBmaWxsPSIjNjY3OEVCIi8+PHBhdGggZD0ibTIwLjg1OCAxOC45NS0zLjAyNC0xLjc0NXYtMi4wNTRhLjU1OC41NTggMCAxIDAtMS4xMTcgMHYyLjM1MWMwIC4wNjQuMDExLjEyNi4wMzEuMTg0YS41NTEuNTUxIDAgMCAwIC4yNTguMzNsMy4yOTMgMS45YS41NTcuNTU3IDAgMCAwIC41NTktLjk2NloiIGZpbGw9IiNGRkYiLz48L2c+PC9nPjwvc3ZnPg=="}),(0,q.jsx)("span",{children:"时长(分)"}),(0,q.jsx)("aside",{children:-1===(null==T||null===(t=T.exam)||void 0===t?void 0:t.time)||null===(null==T||null===(s=T.exam)||void 0===s?void 0:s.time)?"不限":null==T||null===(r=T.exam)||void 0===r?void 0:r.time})]})]}),null==T||null===(c=T.questionList)||void 0===c?void 0:c.map((function(e,n){var i;return(0,q.jsxs)("div",{className:h.list,children:[(0,q.jsxs)("div",{className:h.name,children:[(0,q.jsx)("b",{}),(0,q.jsx)("span",{children:e.name})]}),(0,q.jsxs)("aside",{children:[(0,q.jsxs)("div",{children:["共",(0,q.jsx)("span",{className:h.b,children:e.questions_count}),"题 ",(0,q.jsx)("span",{className:h.l,children:"|"}),"共",(0,q.jsx)("span",{className:h.r,children:e.questions_score}),"分"]}),(0,q.jsx)("div",{className:h.answerSheet,children:null==e||null===(i=e.questions)||void 0===i?void 0:i.map((function(e,n){return(0,q.jsx)("div",{onClick:function(){var n="Anchor_".concat(null==e?void 0:e.id),i=document.getElementById(n);i&&setTimeout((function(){return i.scrollIntoView({block:"center",behavior:"smooth"})}))},className:h.tag,children:n+1},null==e?void 0:e.id)}))})]})]},n)}))]}),(0,q.jsxs)("div",{className:h.right,children:[(0,q.jsxs)("div",{className:h.examName,id:"examName",children:[(0,q.jsx)("div",{className:h.name,children:(0,q.jsx)(p.Z,{title:null==T||null===(M=T.exam)||void 0===M?void 0:M.name,getPopupContainer:function(e){return e.parentNode},children:(0,q.jsx)("span",{className:h.t,children:null==T||null===(P=T.exam)||void 0===P?void 0:P.name})})}),W&&1===(null==T||null===(S=T.exam)||void 0===S?void 0:S.exercise_status)&&(0,q.jsx)(Ke.op,{openLoading:!0,shape:"default",onClick:function(){x.Z.confirm({title:"提示",content:"确认根据最新的随机组卷抽题规则重新生成试卷吗?",onOk:function(){Me()}})},type:"primary",children:"更新试卷"}),!W&&(0,q.jsx)(g.ZP,{onClick:function(){var e,n=x.Z.confirm({icon:null,centered:!0,title:"温馨提示",content:"确认更换预览中的所有试题吗?",cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"确认",cancelText:"取消",onOk:(e=a()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.update({cancelButtonProps:{disabled:!0}}),e.next=3,G();case 3:n.update({cancelButtonProps:{disabled:!1}}),f.ZP.success("已重新随机生成整张试题");case 5:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})})},type:"primary",children:"随机更换"})]}),(0,q.jsx)("div",{className:h.topWarp,children:null==T||null===(L=T.questionList)||void 0===L?void 0:L.map((function(e,n){var i,t;return(0,q.jsxs)(u.Fragment,{children:[(0,q.jsxs)("div",{className:h.head,style:0===n?{border:0,marginTop:-16}:{},children:[(0,q.jsxs)("div",{className:h.name,children:[(0,q.jsx)("b",{}),(0,q.jsx)("span",{children:e.name})]}),(0,q.jsxs)("div",{className:h.so,children:["共",(0,q.jsxs)("span",{className:h.b,children:[e.questions_count," "]}),"题 ","COMBINATION"===e.type&&"(包含".concat(null==e||null===(i=e.questions)||void 0===i?void 0:i.map((function(e){var n;return null==e||null===(n=e.sub_item_banks)||void 0===n?void 0:n.length})).reduce((function(e,n){return e+n})),"小题)"),(0,q.jsx)("span",{className:h.l,children:"|"}),"共",(0,q.jsx)("span",{className:h.r,children:e.questions_score}),"分"]}),!W&&(0,q.jsxs)("div",{className:h.btn,children:[(0,q.jsx)(g.ZP,{onClick:function(){var n,i,t;t=(n=e).questions_score/n.questions_count,x.Z.confirm({icon:null,centered:!0,title:"分数设置",content:(0,q.jsx)("div",{className:h.modalColumn,children:(0,q.jsxs)("div",{className:h.modalRow,style:{justifyContent:"flex-start"},children:[(0,q.jsx)("sup",{className:h.sup,children:"*"}),(0,q.jsxs)("span",{children:[null==n?void 0:n.name,":"]}),(0,q.jsx)(v.Z,{min:0,precision:1,defaultValue:t,onChange:function(e){t=e}}),(0,q.jsx)("span",{className:"ml5",children:"分/题"})]})}),okText:"确认",cancelText:"取消",onOk:(i=a()(l()().mark((function e(){var i,s;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=3;break}return f.ZP.warning("分数不能为空或为0"),e.abrupt("return",Promise.reject());case 3:s={type:null==n?void 0:n.type,score:t,scoreTotal:Number(null===(i=t*n.questions_count)||void 0===i?void 0:i.toFixed(1))},O(s);case 5:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)})})},type:"primary",ghost:!0,className:"mr20",children:"设置得分"}),(0,q.jsx)(g.ZP,{onClick:function(){return s=null===(i=(n=e).questions)||void 0===i?void 0:i.map((function(e){return null==e?void 0:e.id})),r=n.name,void(o=x.Z.confirm({icon:null,centered:!0,title:"温馨提示",content:"确认更换".concat(r,"中的所有试题吗?"),cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"确认",cancelText:"取消",onOk:(t=a()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o.update({cancelButtonProps:{disabled:!0}}),e.next=3,G({seleted_item_bank_ids:s},{type:n.type});case 3:o.update({cancelButtonProps:{disabled:!1}}),f.ZP.success("已重新随机生成".concat(r,"试题"));case 5:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})}));var n,i,t,s,r,o},type:"primary",ghost:!0,children:"随机更换"})]})]}),null==e||null===(t=e.questions)||void 0===t?void 0:t.map((function(n,i){var t,s,r,c,d,m,v,j,_;return J===(null==n?void 0:n.id)?(0,q.jsxs)("div",{id:"Anchor_".concat(null==n?void 0:n.id),className:h.content,style:{padding:0,marginTop:24},children:[(0,q.jsxs)("div",{style:{float:"right",marginTop:"".concat("PRACTICAL"===(null==e?void 0:e.type)?"-2px":"-6px")},children:[(0,q.jsx)(g.ZP,{onClick:function(){return $(null)},className:"mr20",type:"primary",ghost:!0,children:"取消"}),(0,q.jsx)(g.ZP,{onClick:function(){ke(null==e?void 0:e.type,n)},type:"primary",children:"保存"})]}),Ce(n,e.type)]},null==n?void 0:n.id):(0,q.jsxs)("div",{id:"Anchor_".concat(null==n?void 0:n.id),className:h.content,children:[(0,q.jsxs)("div",{className:h.titleWrap,children:["bprogram"===(null==n?void 0:n.item_type)?(0,q.jsx)(b.Z,{style:{paddingRight:10},value:i+1+"、"+(null==n||null===(t=n.program_attr)||void 0===t?void 0:t.description)}):(0,q.jsx)(b.Z,{style:{paddingRight:10},className:h.titleHtml,value:i+1+"、"+"".concat("combination"===(null==n?void 0:n.item_type)?"(题干)":"")+(null==n?void 0:n.name)}),W&&(0,q.jsx)(g.ZP,{onClick:function(){var e,i,t;J?f.ZP.warning("先保存或取消当前正在编辑的试题"):(ue.setFieldsValue({standard_answers:null==n?void 0:n.standard_answer,hack:o()(o()({},n),null==n?void 0:n.program_attr),hack_codes:o()(o()({},null==n?void 0:n.program_attr),{},{code:He.Base64.decode((null==n||null===(e=n.program_attr)||void 0===e?void 0:e.code)||"")}),hack_sets:o()({},null==n||null===(i=n.hack_sets)||void 0===i?void 0:i[0])}),"program"==(null==n?void 0:n.item_type)?I.history.push("/problems/newedit/".concat(null==n||null===(t=n.program_attr)||void 0===t?void 0:t.identifier,"?type=exercises&express_id=").concat(he.categoryId,"&question_id=").concat(null==n?void 0:n.id,"&score=").concat(null==n?void 0:n.score,"&exercise=true&callback_url=/classrooms/").concat(he.coursesId,"/exercise/").concat(he.categoryId,"/detail?random=true")):$(null==n?void 0:n.id))},type:"primary",style:{marginLeft:"auto"},ghost:!0,children:"编辑"}),!Se&&(0,q.jsx)(g.ZP,{disabled:Se,className:"ml20",onClick:function(){return function(e,n,i,t){var s,r,o="".concat(location.pathname).concat(location.search),c=null===(s=t.questions)||void 0===s?void 0:s.map((function(e){return null==e?void 0:e.id}));if(o.includes("exercise"))ce.current={id:e,ids:c,type:n,index:i},oe(!0);else var d=x.Z.confirm({icon:null,centered:!0,title:"温馨提示",content:"确认要更换该试题吗?",cancelButtonProps:{disabled:!1},maskClosable:!0,keyboard:!1,okText:"确认",cancelText:"取消",onOk:(r=a()(l()().mark((function t(){return l()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return d.update({cancelButtonProps:{disabled:!0}}),t.next=3,G({single_question_id:e,seleted_item_bank_ids:c},{type:n,index:i});case 3:d.update({cancelButtonProps:{disabled:!1}}),f.ZP.success("已重新随机生成试题");case 5:case"end":return t.stop()}}),t)}))),function(){return r.apply(this,arguments)})})}(null==n?void 0:n.id,e.type,i,e)},type:"primary",ghost:!0,children:"换一题"})]}),"bprogram"===(null==n?void 0:n.item_type)&&(0,q.jsx)(b.Z,{style:{paddingRight:10,paddingLeft:25},showProgramFill:!0,disabledFill:!0,className:h.titleHtml,value:He.Base64.decode((null==n||null===(s=n.program_attr)||void 0===s?void 0:s.code)||"")}),("SINGLE"===e.type||"JUDGMENT"===e.type||"MULTIPLE"===e.type)&&(v=n,_=[],(0,q.jsxs)(u.Fragment,{children:[(0,q.jsx)("aside",{className:h.single,children:null==v||null===(j=v.choices)||void 0===j?void 0:j.map((function(e,n){return e.is_answer&&_.push(je[n]),(0,q.jsxs)("ul",{children:[(0,q.jsxs)("li",{children:[je[n],"、"]}),(0,q.jsx)("li",{children:(0,q.jsx)(b.Z,{value:e.choice_text})})]},n)}))}),(0,q.jsxs)("div",{className:h.analysis,children:[(0,q.jsxs)("div",{children:["正确答案:",_.join(""),(0,q.jsxs)("span",{className:"ml30",children:["难度:",fe[v.difficulty]]})]}),(0,q.jsxs)("aside",{children:[(0,q.jsx)("span",{className:h.text,children:"解析:"}),(0,q.jsx)(b.Z,{value:v.analysis?v.analysis:"暂无解析"})]}),(0,q.jsxs)("ul",{children:[(0,q.jsxs)("li",{children:[(0,q.jsx)("span",{style:{color:"#007AFF",marginRight:10},children:"方向&课程:"}),"".concat((null==v?void 0:v.discipline_name)||"--","/").concat(null==v?void 0:v.sub_discipline_name)]}),(0,q.jsx)(p.Z,{title:null==v?void 0:v.tag_discipline_name,children:(0,q.jsxs)("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:[(0,q.jsx)("span",{style:{color:"#5AB891",marginRight:10},children:"知识点:"}),null==v?void 0:v.tag_discipline_name]})})]})]})]})),"COMPLETION"===e.type&&ye(n),"SUBJECTIVE"===e.type&&we(n),"PROGRAM"===e.type&&be(n),"BPROGRAM"===e.type&&Ne(n),"COMBINATION"===e.type&&(c=n,d=i,(0,q.jsx)("div",{children:null==c||null===(m=c.sub_item_banks)||void 0===m?void 0:m.map((function(e,n){var i,t,l=[];return(0,q.jsxs)(u.Fragment,{children:[(0,q.jsxs)("div",{style:{marginLeft:25,fontSize:"16px",color:"#333",paddingTop:"15px"},children:[d+1+"."+(n+1),"(",_e[e.item_type]||ge[e.item_type],")",e.name]}),("SINGLE"==e.item_type||"MULTIPLE"==e.item_type||"JUDGMENT"==e.item_type||"single"==e.item_type||"multiple"==e.item_type||"judgement"==e.item_type)&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)("aside",{className:h.single,children:null==e||null===(i=e.choices)||void 0===i?void 0:i.map((function(e,n){return e.is_answer&&l.push(je[n]),(0,q.jsxs)("ul",{children:[(0,q.jsxs)("li",{children:[je[n],"、"]}),(0,q.jsx)("li",{children:(0,q.jsx)(b.Z,{value:e.choice_text})})]},n)}))}),(0,q.jsxs)("div",{className:h.analysis,children:[(0,q.jsxs)("div",{children:["正确答案:",l.join(""),(0,q.jsxs)("span",{className:"ml30",children:["难度:",fe[e.difficulty]]})]}),(0,q.jsxs)("aside",{children:[(0,q.jsx)("span",{className:h.text,children:"解析:"}),(0,q.jsx)(b.Z,{value:e.analysis?e.analysis:"暂无解析"})]}),(0,q.jsxs)("ul",{children:[(0,q.jsxs)("li",{children:[(0,q.jsx)("span",{style:{color:"#007AFF",marginRight:10},children:"方向&课程:"}),"".concat((null==c?void 0:c.discipline_name)||"--","/").concat(null==c?void 0:c.sub_discipline_name)]}),(0,q.jsx)(p.Z,{title:null==c?void 0:c.tag_discipline_name,children:(0,q.jsxs)("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:[(0,q.jsx)("span",{style:{color:"#5AB891",marginRight:10},children:"知识点:"}),null==c?void 0:c.tag_discipline_name]})})]})]})]}),("COMPLETION"==e.item_type||"completion"==e.item_type)&&ye(e,c),("SUBJECTIVE"==e.item_type||"subjective"==e.item_type)&&we(e,c),3===(null==T||null===(t=T.exam)||void 0===t?void 0:t.exercise_status)&&(0,q.jsx)(Je.Z,{className:"mt20",state:null==e?void 0:e.is_wrong,onClick:function(){null==U||U({value:o()(o()({},e),{},{question_id:null==e?void 0:e.id,question_score:null==e?void 0:e.score})})}})]})}))})),"PRACTICAL"===e.type&&Ie(n),3===(null==T||null===(r=T.exam)||void 0===r?void 0:r.exercise_status)&&"COMBINATION"!==e.type&&(0,q.jsx)(Je.Z,{className:"mt20",state:null==n?void 0:n.is_wrong,onClick:function(){null==U||U({value:o()(o()({},n),{},{question_id:null==n?void 0:n.id,question_score:null==n?void 0:n.score})})}})]},null==n?void 0:n.id)}))]},n)}))})]}),W?(0,q.jsx)(Ke.vr,{children:(0,q.jsx)(y.Z,{showTotal:Z.rU,total:null==T||null===(E=T.exam)||void 0===E?void 0:E.total_num,pageSize:1,current:F+1,showSizeChanger:!1,onChange:Ze,showQuickJumper:!1,hideOnSinglePage:!1})}):(0,q.jsx)(Ke.vr,{LeftContent:(0,q.jsx)(Ke.op,{onClick:D,shape:"default",style:{height:38,background:"#fff",boxShadow:"none"},children:"返回"}),RightContent:(0,q.jsxs)(N.Z,{align:"middle",children:[(0,q.jsx)(w.Z,{color:"#55575D",overlayClassName:h.popover,open:te,getPopupContainer:function(e){return null==e?void 0:e.parentNode},content:"如您对此份试题满意,可将此份试题保存为固定试卷",children:(0,q.jsx)(Ke.op,{onMouseEnter:function(){return le(!0)},onMouseLeave:function(){return le(!1)},onClick:function(){return n="",void x.Z.confirm({icon:null,centered:!0,title:"保存试卷",content:(0,q.jsxs)("div",{className:h.modalColumn,children:[(0,q.jsxs)("div",{style:{color:"#676A6C",display:"flex",alignItems:"center"},className:"font14 mt20",children:[(0,q.jsx)("img",{style:{marginRight:5},src:k.Z}),"保存后单独生成一份人工组卷类型的固定试卷。"]}),(0,q.jsxs)("div",{className:h.modalRow,style:{marginTop:20},children:[(0,q.jsx)("sup",{className:h.sup,children:"*"}),(0,q.jsx)("span",{style:{flexShrink:0},children:"试卷名称:"}),(0,q.jsx)(j.Z,{placeholder:"请输入试卷名称",min:0,maxLength:60,defaultValue:n,onChange:function(e){n=e.target.value}})]})]}),okText:"确认",cancelText:"取消",onOk:(e=a()(l()().mark((function e(){var i,t,s,a,r,o;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=3;break}return f.ZP.warning("试卷名称不能为空"),e.abrupt("return",Promise.reject());case 3:return t=[],s=[],a=[],r=[],null==T||null===(i=T.questionList)||void 0===i||i.forEach((function(e){var n;null===(n=e.questions)||void 0===n||n.forEach((function(n){var i=e.questions_score/e.questions_count;i=i&&i.toFixed(1),"COMBINATION"===e.type&&a.push({id:n.id,sub_item_bank_ids:n.sub_item_banks.map((function(e){return e.id}))}),"PRACTICAL"===e.type?r.push(n.id):(t.push(n.id),s.push(i))}))})),console.log("-----",a),o={item_bank_ids:t,item_bank_scores:s,name:n,combination_item_banks:a,shixun_ids:r},e.next=12,A(o);case 12:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})});var e,n},shape:"default",style:{height:38,background:"#fff",boxShadow:"none"},children:"保存"})}),(0,q.jsx)(Ke.op,{shape:"default",type:"primary",onClick:function(){return A()},style:{height:38,marginLeft:20},children:"提交"})]})}),(0,q.jsx)(Ye,{visible:re,questionParams:ce.current,onRandomExchange:a()(l()().mark((function e(){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=ce.current,e.next=3,G({single_question_id:n.id,seleted_item_bank_ids:n.ids},{type:n.type,index:n.index});case 3:oe(!1);case 4:case"end":return e.stop()}}),e)}))),selectFromProblemSet:function(){var e=ce.current,n="".concat(location.pathname).concat(location.search);n.includes("exercise")&&I.history.push("/paperlibrary/exchangequestion?type=exercise&qid=".concat(e.id,"&qtype=").concat(e.type,"&exerciseid=").concat(he.categoryId,"&from=").concat(n))},onCancel:function(){oe(!1)}})]})}},33299:function(e,n,i){i(59301);Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;n.Z="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGZpbGw9IiNGQ0IwNDEiIGN4PSI3IiBjeT0iNyIgcj0iNyIvPjxwYXRoIGQ9Ik03LjUzMSA5LjYzOGEuNjE2LjYxNiAwIDEgMS0xLjIzMSAwdi0uMDJhLjYxNi42MTYgMCAxIDEgMS4yMzEgMHYuMDJabTAtMi4yNWEuNjE2LjYxNiAwIDEgMS0xLjIzMSAwVjQuMTE3YS42MTYuNjE2IDAgMSAxIDEuMjMxIDB2My4yNzNaIiBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L2c+PC9zdmc+"}}]); |