You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Classrooms__Lists__Exerc...

1 line
70 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[45825],{13887:function(e,n,t){t.d(n,{Z:function(){return b}});t(17061),t(17156);var s=t(56690),i=t.n(s),r=t(89728),a=t.n(r),o=t(66115),c=t.n(o),l=t(61655),u=t.n(l),d=t(26389),x=t.n(d),m=t(38416),p=t.n(m),h=t(67294),j=t(11486),f="codeBox___WpkVl",g=t(94184),v=t.n(g),_=t(85893),y=function(e){u()(t,e);var n=x()(t);function t(e){var s;return i()(this,t),s=n.call(this,e),p()(c()(s),"canvas",void 0),p()(c()(s),"randomNum",(function(e,n){return Math.floor(Math.random()*(n-e)+e)})),p()(c()(s),"drawPic",(function(){s.randomCode()})),p()(c()(s),"reloadPic",(function(){s.drawPic()})),p()(c()(s),"changeCode",(function(e){console.log(e.target.value,222),s.setState({value:e.target.value,showError:!1})})),p()(c()(s),"onVerify",(function(){var e;return""!==s.state.value.toLowerCase()&&s.state.value.toLowerCase()!==s.state.code.toLowerCase()||""===s.state.value.toLowerCase()?e=!0:s.state.value.toLowerCase()===s.state.code.toLowerCase()&&(e=!1),s.setState({showError:e}),e})),s.canvas=h.createRef(),s.state={value:"",code:"",codeLength:4,fontSizeMin:20,fontSizeMax:22,backgroundColorMin:240,backgroundColorMax:250,colorMin:10,colorMax:20,lineColorMin:40,lineColorMax:180,contentWidth:96,contentHeight:38,showError:!1},s}return a()(t,[{key:"componentDidMount",value:function(){this.drawPic()}},{key:"randomColor",value:function(e,n){var t=this.randomNum(e,n),s=this.randomNum(e,n),i=this.randomNum(e,n);return"rgb(".concat(t,", ").concat(s,", ").concat(i,")")}},{key:"drawText",value:function(e,n,t){e.fillStyle=this.randomColor(this.state.colorMin,this.state.colorMax);var s=this.randomNum(this.state.fontSizeMin,this.state.fontSizeMax);e.font=s+"px SimHei";var i=(this.state.contentWidth-40)/(this.state.code.length-1),r=10;t>0&&(r=10+t*i);var a=this.randomNum(this.state.fontSizeMax,this.state.contentHeight-5);s>40&&(a=40);var o=this.randomNum(-10,10);e.translate(r,a),e.rotate(o*Math.PI/180),e.fillText(n,0,0),e.rotate(-o*Math.PI/180),e.translate(-r,-a)}},{key:"drawLine",value:function(e){for(var n=0;n<1;n++)e.strokeStyle=this.randomColor(this.state.lineColorMin,this.state.lineColorMax),e.beginPath(),e.moveTo(this.randomNum(0,this.state.contentWidth),this.randomNum(0,this.state.contentHeight)),e.lineTo(this.randomNum(0,this.state.contentWidth),this.randomNum(0,this.state.contentHeight)),e.stroke()}},{key:"drawDot",value:function(e){for(var n=0;n<100;n++)e.fillStyle=this.randomColor(0,255),e.beginPath(),e.arc(this.randomNum(0,this.state.contentWidth),this.randomNum(0,this.state.contentHeight),1,0,2*Math.PI),e.fill()}},{key:"randomCode",value:function(){for(var e=this,n="",t=0;t<this.state.codeLength;t++){n+="QWERTYUPLKJHGFDSAZXCVBNMqwertyupkjhgfdsazxcvbnm1234567890"[Math.floor(57*Math.random())]}this.setState({code:n},(function(){var n=e.canvas.current.getContext("2d");n.textBaseline="bottom",n.fillStyle=e.randomColor(e.state.backgroundColorMin,e.state.backgroundColorMax),n.fillRect(0,0,e.state.contentWidth,e.state.contentHeight);for(var t=0;t<e.state.code.length;t++)e.drawText(n,e.state.code[t],t);e.drawLine(n),e.drawDot(n)}))}},{key:"render",value:function(){var e=this.props,n=e.className,t=e.width,s=void 0===t?300:t;return(0,_.jsxs)("div",{className:v()(f,n),style:{width:s},children:[(0,_.jsxs)("aside",{children:[(0,_.jsx)(j.Z,{value:this.state.value,onChange:this.changeCode,placeholder:"请输入图片中的验证码"}),this.state.showError&&(0,_.jsx)("div",{children:this.state.value?"请输入正确的验证码":"请输入验证码"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("canvas",{onClick:this.reloadPic,ref:this.canvas,width:"100",height:"30"}),(0,_.jsx)("div",{className:"current",onClick:this.reloadPic,children:"看不清?换一张"})]})]})}}]),t}(h.Component),b=y},60696:function(e,n,t){t.d(n,{Z:function(){return A},P:function(){return P}});var s=t(861),i=t.n(s),r=t(70215),a=t.n(r),o=t(17061),c=t.n(o),l=t(42122),u=t.n(l),d=t(17156),x=t.n(d),m=t(27424),p=t.n(m),h=t(67294),j=t(91773),f=t(14446),g=t(78045),v=t(11486),_=t(76661),y="brief___LOzpE",b="contentTitle___xkdcN",M="content___Vtri0",N="antdTable___s8T2N",k="tableCell___kN9Fw",w="antdModal___WVBk3",L="orangeColor___ryB2u",I=t(56088),S=t(85893),C=["isImportMultipleCourse"],Z=function(e){var n=e.studentNames,t=e.total;return t>3?(0,S.jsxs)(S.Fragment,{children:["课堂内有",(0,S.jsx)("span",{className:L,children:null==n?void 0:n.join("、")}),"等",(0,S.jsx)("span",{className:L,children:t}),"名学生"]}):(0,S.jsxs)(S.Fragment,{children:["课堂内有",(0,S.jsx)("span",{className:L,children:null==n?void 0:n.join("、")}),["","一","两","三"][t],"名学生"]})},D=function(e){var n=e.onCancel,t=e.onOk,s=e.visible,i=(e.inPaper,e.renderData),r=(e.type,e.isMultipleCourse),a=void 0!==r&&r,o=j.Z.useForm(),l=p()(o,1)[0],d=(0,h.useState)(1),m=p()(d,2),v=m[0],_=m[1],y=(0,h.useState)(!1),b=p()(y,2),N=b[0],k=b[1],I=(0,h.useMemo)((function(){return 1===(null==i?void 0:i.total_num)&&1===(null==i?void 0:i.can_copy_num)}),[i]),C=(0,h.useMemo)((function(){var e;return null==i||null===(e=i.course_data_list)||void 0===e?void 0:e.filter((function(e){return e.is_show}))}),[i]);return(0,S.jsx)(S.Fragment,{children:I?(0,S.jsxs)(f.Z,{centered:!0,closable:!0,open:s,destroyOnClose:!0,title:"提示",className:w,width:682,confirmLoading:N,onCancel:n,onOk:x()(c()().mark((function e(){var n,s,r;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k(!0),n=v,a&&(r=u()({},l.getFieldsValue()),n=null==i||null===(s=i.course_data_list)||void 0===s?void 0:s.map((function(e){return void 0!==r[e.id]?u()(u()({},e),{},{is_copy:r[e.id]}):e}))),e.next=5,t(n);case 5:k(!1);case 6:case"end":return e.stop()}}),e)}))),children:[(0,S.jsx)("div",{className:M,style:{marginBottom:20},children:a?"检测到以下课堂已在教学课堂中使用,请问是否复制成新的实训发送至教学课堂中?":(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Z,{studentNames:null==i?void 0:i.student_names,total:null==i?void 0:i.student_count}),"学习过该实践项目。该项目支持复制,请选择是否将该项目复制为新项目发送至课堂中?"]})}),a?(0,S.jsx)(j.Z,{form:l,preserve:!1,children:null==C?void 0:C.map((function(e){return(0,S.jsxs)(h.Fragment,{children:[(0,S.jsx)("h3",{className:"ml15 mb5",children:e.name}),(0,S.jsx)(j.Z.Item,{name:e.id,initialValue:1,children:(0,S.jsxs)(g.ZP.Group,{className:M,children:[(0,S.jsx)(g.ZP,{value:1,style:{color:"#464f66"},children:"复制实训"}),(0,S.jsx)(g.ZP,{value:0,style:{color:"#464f66"},children:"不复制实训"})]})})]},e.id)}))}):(0,S.jsxs)(g.ZP.Group,{value:v,onChange:function(e){return _(e.target.value)},className:M,style:{marginBottom:30},children:[(0,S.jsx)(g.ZP,{value:1,style:{color:"#464f66"},children:"复制"}),(0,S.jsx)(g.ZP,{value:0,style:{color:"#464f66"},children:"不复制"})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:M,style:{marginBottom:10},children:"* 说明:"}),(0,S.jsx)("div",{className:M,style:{marginBottom:20},children:"1、复制系统将复制并创建一个新的项目发送到课堂中使用不会复制学生的挑战记录新的项目支持进行编辑并与原项目信息互不影响。"}),(0,S.jsx)("div",{className:"".concat(M," ").concat(L),children:"2、不复制当前项目会被直接发送到课堂中使用挑战过该项目的学生再次进入项目开启挑战时会清空之前的挑战记录。"})]})]}):(0,S.jsx)(f.Z,{centered:!0,closable:!0,destroyOnClose:!0,open:s,confirmLoading:N,title:"提示",width:682,onCancel:n,onOk:x()(c()().mark((function e(){var n,s,r;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k(!0),n=0,a&&(r=u()({},l.getFieldsValue()),n=null==i||null===(s=i.course_data_list)||void 0===s?void 0:s.map((function(e){return void 0!==r[e.id]?u()(u()({},e),{},{is_use:r[e.id]}):e}))),e.next=5,t(n);case 5:k(!1);case 6:case"end":return e.stop()}}),e)}))),children:(0,S.jsxs)("div",{className:M,children:[(0,S.jsx)(Z,{studentNames:null==i?void 0:i.student_names,total:null==i?void 0:i.student_count}),"学习过该实践项目。",a?(0,S.jsxs)(j.Z,{form:l,preserve:!1,children:[(0,S.jsx)("h3",{children:"当前实训不可复制,已经检测到以下课堂存在该实训,同一实训在课堂中重复使用时,会导致成绩互相影响,请确认是否继续使用"}),null==C?void 0:C.map((function(e){return(0,S.jsxs)(h.Fragment,{children:[(0,S.jsx)("h3",{className:"ml15 mb5",children:e.name}),(0,S.jsx)(j.Z.Item,{name:e.id,initialValue:1,children:(0,S.jsxs)(g.ZP.Group,{className:M,children:[(0,S.jsx)(g.ZP,{value:1,style:{color:"#464f66"},children:"继续使用"}),(0,S.jsx)(g.ZP,{value:0,style:{color:"#464f66"},children:"不使用"})]})})]},e.id)}))]}):(0,S.jsxs)("div",{children:["该项目不支持复制,若确认继续发送,",(0,S.jsx)("span",{className:L,children:"当前项目会被直接发送到课堂中使用,挑战过该项目的学生再次进入项目开启挑战时,会清空之前的挑战记录。"}),"(如果不想清空学生之前的挑战记录,建议参照该实践项目的内容自行创建一个新的项目,或者尝试联系项目创建人开放本项目的复制权限)。"]})]})})})},P=function(){var e=(0,h.useState)(!1),n=p()(e,2),t=n[0],s=n[1],i=(0,h.useState)(),r=p()(i,2),o=r[0],l=r[1],u=function(){var e=x()(c()().mark((function e(n){var t,i,r,o,u;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.isImportMultipleCourse,i=void 0!==t&&t,r=a()(n,C),e.next=3,(0,I.Tr)(r);case 3:if(!("status"in(o=e.sent))){e.next=6;break}return e.abrupt("return",!1);case 6:if(!i){e.next=13;break}if(!(null==o||null===(u=o.course_data_list)||void 0===u?void 0:u.some((function(e){return e.is_show})))){e.next=12;break}return l(o),s(!0),e.abrupt("return",!0);case 12:return e.abrupt("return",o.course_data_list||[]);case 13:if(0!==o.student_count){e.next=15;break}return e.abrupt("return",!1);case 15:return l(o),s(!0),e.abrupt("return",!0);case 18:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return[t,function(){return s(!1)},o,u]},T=function(e){var n=j.Z.useForm(),t=p()(n,1)[0],s=(0,h.useState)(!1),r=p()(s,2),a=r[0],o=r[1],l=e.onCancel,u=e.onOk,d=e.visible,m=e.inPaper,M=void 0!==m&&m,I=e.renderData,C=e.type,D=e.isMultipleCourse,P=void 0!==D&&D,T=e.position,A=(0,h.useMemo)((function(){return M?[{title:"实践项目名称",dataIndex:"name",width:424,align:"center",ellipsis:!0,className:k,render:function(e,n){return(0,S.jsx)("a",{href:"/shixuns/".concat(n.identifier,"/challenges"),target:"_blank",children:e})}},{title:"是否复制",dataIndex:"is_copy",align:"center",render:function(e,n){return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(j.Z.Item,{name:["".concat("subject"===C?n.stage_shixun_id:n.shixun_course_id||n.id),"is_copy"],initialValue:1,children:(0,S.jsxs)(g.ZP.Group,{children:[(0,S.jsx)(g.ZP,{value:1,children:"是"}),(0,S.jsx)(g.ZP,{value:0,children:"否"})]})}),(0,S.jsx)(j.Z.Item,{name:["".concat("subject"===C?null==n?void 0:n.stage_shixun_id:n.shixun_course_id||n.id),"is_use"],hidden:!0,initialValue:1,children:(0,S.jsx)(v.Z,{type:"hidden"})})]})}}]:[{title:"实践项目名称",dataIndex:"name",width:424,align:"center",ellipsis:!0,className:k,render:function(e,n){return(0,S.jsx)("a",{href:"/shixuns/".concat(n.identifier,"/challenges"),target:"_blank",children:e})}},{title:"是否使用",dataIndex:"is_use",align:"center",render:function(e,n){return(0,S.jsx)(j.Z.Item,{name:["".concat("subject"===C?n.stage_shixun_id:n.shixun_course_id||n.id),"is_use"],initialValue:1,children:(0,S.jsxs)(g.ZP.Group,{children:[(0,S.jsx)(g.ZP,{value:1,children:"是"}),(0,S.jsx)(g.ZP,{value:0,children:"否"})]})})}},{title:"是否复制",dataIndex:"is_copy",align:"center",render:function(e,n){return(0,S.jsx)(j.Z.Item,{name:["".concat("subject"===C?n.stage_shixun_id:n.shixun_course_id||n.id),"is_copy"],initialValue:1,children:(0,S.jsxs)(g.ZP.Group,{children:[(0,S.jsx)(g.ZP,{value:1,children:"是"}),(0,S.jsx)(g.ZP,{value:0,children:"否"})]})})}}]}),[M]),E=(0,h.useMemo)((function(){return M?[{title:"实践项目名称",dataIndex:"name",width:424,className:k,align:"center",ellipsis:!0,render:function(e,n){return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("a",{href:"/shixuns/".concat(n.identifier,"/challenges"),target:"_blank",children:e}),(0,S.jsx)(j.Z.Item,{name:["".concat("subject"===C?null==n?void 0:n.stage_shixun_id:n.shixun_course_id||n.id),"is_copy"],hidden:!0,initialValue:0,children:(0,S.jsx)(v.Z,{type:"hidden"})}),(0,S.jsx)(j.Z.Item,{name:["".concat("subject"===C?null==n?void 0:n.stage_shixun_id:n.shixun_course_id||n.id),"is_use"],hidden:!0,initialValue:1,children:(0,S.jsx)(v.Z,{type:"hidden"})})]})}}]:[{title:"实践项目名称",dataIndex:"name",width:424,className:k,ellipsis:!0,align:"center",render:function(e,n){return(0,S.jsx)("a",{href:"/shixuns/".concat(n.identifier,"/challenges"),target:"_blank",children:e})}},{title:"是否使用",dataIndex:"is_use",align:"center",render:function(e,n){return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(j.Z.Item,{name:["".concat("subject"===C?null==n?void 0:n.stage_shixun_id:n.shixun_course_id||n.id),"is_use"],initialValue:0,children:(0,S.jsxs)(g.ZP.Group,{children:[(0,S.jsx)(g.ZP,{value:1,children:"是"}),(0,S.jsx)(g.ZP,{value:0,children:"否"})]})}),(0,S.jsx)(j.Z.Item,{name:["".concat("subject"===C?null==n?void 0:n.stage_shixun_id:n.shixun_course_id||n.id),"is_copy"],hidden:!0,initialValue:0,children:(0,S.jsx)(v.Z,{type:"hidden"})})]})}}]}),[M]);if(P){var O={title:"课堂名称",ellipsis:!0,dataIndex:"course_name",width:190,align:"center",className:k,render:function(e,n){return(0,S.jsx)("a",{href:"/classrooms/".concat(n.course_id),children:e})}};A=[O].concat(i()(A)),E=[O].concat(i()(E))}var z=(0,h.useMemo)((function(){return function(e){var n=e.used,t=e.copy,s=e.canNotCopy,i=e.studentNames,r=e.studentCount,a=e.inPaper,o=e.is_random,c=void 0!==o&&o,l=e.position,u=(void 0===l?"":l)||(a?"试卷":"课程");return(0,S.jsxs)("span",{children:[(0,S.jsx)(Z,{studentNames:i,total:r}),"学习过",u,"中的",(0,S.jsx)("span",{className:L,children:n}),"个项目,",t>0&&s>0?(0,S.jsxs)(S.Fragment,{children:["其中",(0,S.jsx)("span",{className:L,children:t}),"个项目支持复制,",(0,S.jsx)("span",{className:L,children:s}),"个项目不支持复制"]}):t>0&&0===s?(0,S.jsxs)(S.Fragment,{children:["其中",(0,S.jsx)("span",{className:L,children:t}),"个项目支持复制"]}):0===t&&s>0?(0,S.jsxs)(S.Fragment,{children:["其中",(0,S.jsx)("span",{className:L,children:s}),"个项目不支持复制"]}):void 0,"。请选择",c?"":"是否继续使用和","是否复制为新项目发送至课堂中?"]})}({used:null==I?void 0:I.repeat_shixun_num,copy:null==I?void 0:I.can_copy_num,canNotCopy:null==I?void 0:I.no_copy_num,studentNames:null==I?void 0:I.student_names,studentCount:null==I?void 0:I.student_count,is_random:null==I?void 0:I.is_random,inPaper:M,position:T})}),[I,M,T]);return(0,S.jsx)(f.Z,{title:"提示",centered:!0,open:d,confirmLoading:a,onOk:x()(c()().mark((function e(){var n,s;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o(!0),n=t.getFieldsValue(),s=Object.keys(n).map((function(e){return{id:parseInt(e.split("_")[0]),course_id:parseInt(e.split("_")[1]),is_use:n[e].is_use,is_copy:n[e].is_copy}})),e.next=5,u(s);case 5:o(!1);case 6:case"end":return e.stop()}}),e)}))),onCancel:l,width:880,okText:"确认",className:w,destroyOnClose:!0,children:(0,S.jsxs)(j.Z,{form:t,preserve:!1,children:[(0,S.jsx)("div",{className:y,children:z}),(0,S.jsxs)("div",{style:{marginBottom:30},children:[(0,S.jsx)("div",{style:{marginBottom:20},children:"* 说明"}),(0,S.jsx)("div",{style:{marginBottom:20},children:"1、复制系统将复制并创建一个新的项目发送到课堂中使用不会复制学生的挑战记录新的项目支持进行编辑并与原项目信息互不影响。"}),(0,S.jsx)("div",{className:L,children:"2、不复制当前项目会被直接发送到课堂中使用挑战过该项目的学生再次进入项目开启挑战时会清空之前的挑战记录。"})]}),(null==I?void 0:I.can_copy_num)>0&&(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:b,children:"支持复制的项目"}),(0,S.jsx)(_.Z,{columns:A,className:N,dataSource:null==I?void 0:I.can_copy_list,rowKey:"subject"===C?"stage_shixun_id":"id",pagination:!1,scroll:{y:240},bordered:!0})]}),(null==I?void 0:I.no_copy_num)>0&&(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:b,children:"不支持复制的项目"}),(0,S.jsx)(_.Z,{columns:E,className:N,dataSource:null==I?void 0:I.no_copy_list,rowKey:"subject"===C?"stage_shixun_id":"id",pagination:!1,scroll:{y:200},bordered:!0})]}),(null==I?void 0:I.no_use_list.length)>0&&(null==I?void 0:I.no_use_list.map((function(e){return(0,S.jsxs)("div",{children:[(0,S.jsx)(j.Z.Item,{name:["".concat("subject"===C?null==e?void 0:e.stage_shixun_id:e.shixun_course_id||e.id),"is_copy"],hidden:!0,initialValue:0,children:(0,S.jsx)(v.Z,{type:"hidden"})}),(0,S.jsx)(j.Z.Item,{name:["".concat("subject"===C?null==e?void 0:e.stage_shixun_id:e.shixun_course_id||e.id),"is_use"],hidden:!0,initialValue:1,children:(0,S.jsx)(v.Z,{type:"hidden"})})]},"subject"===C?e.stage_shixun_id:e.shixun_course_id||e.id)})))]})})},A=function(e){return"multiple"===e.modalType?(0,S.jsx)(T,u()({},e)):(0,S.jsx)(D,u()({},e))}},34690:function(e,n,t){t.r(n),t.d(n,{default:function(){return Ze}});var s=t(17061),i=t.n(s),r=t(861),a=t.n(r),o=t(17156),c=t.n(o),l=t(42122),u=t.n(l),d=t(27424),x=t.n(d),m=t(70215),p=t.n(m),h=t(67294),j=t(88275),f=t(14446),g=t(68508),v=t(2453),_=t(4310),y=t(34435),b=t(30291),M=t(71577),N=t(27484),k=t.n(N),w=t(7),L=t(29427),I=t(82982),S=t(84519),C=t(36182),Z=t(91773),D=t(4082),P=t(96101),T=t(11486),A=t(246),E=t.n(A),O=t(1706),z=t(85893),G=["onResize","width"],Y={header:{cell:function(e){var n=e.onResize,t=e.width,s=p()(e,G);return t?(0,z.jsx)(O.Resizable,{width:t,height:0,handle:(0,z.jsx)("span",{className:"react-resizable-handle",onClick:function(e){e.stopPropagation()}}),onResize:n,draggableOpts:{enableUserSelectHack:!1},children:(0,z.jsx)("th",u()({},s))}):(0,z.jsx)("th",u()({},s))}}},B=t(76661),R=["pagination","resColumns","dataSource","onRow"],F=function(e){var n=e.pagination,t=e.resColumns,s=e.dataSource,i=e.onRow,r=p()(e,R),o=(0,h.useState)(!1),c=x()(o,2),l=c[0],d=(c[1],(0,h.useState)([{}])),m=x()(d,2),j=m[0],f=m[1],g=(0,h.useRef)(null);(0,h.useEffect)((function(){var e=t;e=e.map((function(e,n){return u()(u()({},e),{},{onHeaderCell:function(e){return{width:e.width,onResize:v(n)}}})})),f(e)}),[]),(0,h.useEffect)((function(){g.current=j}),[j]);var v=function(e){return function(n,t){var s=t.size,i=a()(g.current);i[e]=u()(u()({},i[e]),{},{width:s.width}),f(i)}};return(0,z.jsx)("div",{children:(0,z.jsx)(B.Z,u()(u()({bordered:!0,components:Y,columns:j,dataSource:s,pagination:n,loading:l,onRow:i},r),{},{rowKey:function(e){return e.key||e.id}}))})},Q="hideHeadCheckbox___Hq5gw",J="tabSearch___NaKI4",H="warpModal___HLUgh",V="modalColumn___F7R5w",W="modalRow___L6ghw",K="sup___VGKXV",U=t(7303),X=t(60696),q=t(98706),$=C.Z.TabPane,ee=(0,j.connect)((function(e){return{exercise:e.exercise,loading:e.loading,classroomList:e.classroomList}}))((function(e){var n,t=e.classroomList,s=e.exercise,r=(e.loading,e.dispatch),o=(0,j.useParams)(),l=((0,j.useLocation)(),Z.Z.useForm()),d=(x()(l,1)[0],s.brankList,(0,h.useState)(!0)),m=x()(d,2),p=m[0],g=m[1],_=(0,h.useState)(!1),y=x()(_,2),b=y[0],N=y[1],k=(0,h.useState)("myself"),w=x()(k,2),I=w[0],S=w[1],A=(0,h.useState)([]),O=x()(A,2),G=O[0],Y=O[1],B=(0,h.useState)([]),R=x()(B,2),ee=R[0],ne=R[1],te=(0,h.useState)(),se=x()(te,2),ie=se[0],re=se[1],ae=(0,h.useState)([]),oe=x()(ae,2),ce=oe[0],le=oe[1],ue=(0,h.useRef)(null),de=(0,h.useState)(!1),xe=x()(de,2),me=xe[0],pe=xe[1],he=(0,h.useState)(""),je=x()(he,2),fe=je[0],ge=je[1],ve=(0,h.useState)(""),_e=x()(ve,2),ye=_e[0],be=_e[1],Me=[{title:"试卷名称",dataIndex:"name",width:150,ellipsis:!0,align:"left"},{title:"知识点",dataIndex:"course_list_name",width:150,ellipsis:!0,align:"left"},{title:"类型",dataIndex:"is_random",width:90,align:"left",render:function(e){return e?"随机组卷":"人工组卷"}},{title:"更新时间",dataIndex:"updated_at",width:150,align:"left"},{title:"试题数",dataIndex:"item_num",width:60,align:"center"},{title:"总分",dataIndex:"total_score",width:60,align:"center"},{title:"操作",dataIndex:"is_random",width:60,align:"center",render:function(e,n){return(0,z.jsx)("a",{href:e?"/randompaper/detail/".concat(n.id):"/paperlibrary/see/".concat(n.id,"?defaultActiveKey=1"),target:"_blank>",children:"预览"})}}],Ne=(0,h.useState)({page:0,limit:20,group_id:null,object_type:"examination_bank",search:"",filter:"myself"}),ke=x()(Ne,2),we=ke[0],Le=ke[1];(0,h.useEffect)((function(){"试卷选用"===s.actionTabs.key&&(Ce(),le([]),Ie())}),[s.actionTabs.key]);var Ie=function(){var e=c()(i()().mark((function e(){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r({type:"paperlibrary/getTeachGroupData"});case 2:n=e.sent,ne(n);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Se=function(e){var n=parseInt(e);return isNaN(n)?"":n},Ce=function(){var e=c()(i()().mark((function e(){var n,t;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!p){e.next=11;break}return++we.page,g(!1),e.next=5,r({type:"exercise/getBrankList",payload:u()({},we)});case 5:t=e.sent,G=null!=t&&t.object_list?a()(G.concat(null==t?void 0:t.object_list)):G,re(t.is_teacher),(null===(n=t.object_list)||void 0===n?void 0:n.length)<we.limit?g(!1):g(!0),Y(a()(G));case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ze={selectedRowKeys:ce,onChange:function(e){le(e)},type:"radio"},De=function(){Le(u()({},{page:0,limit:20,group_id:null,object_type:"examination_bank",search:"",filter:"myself"})),Y([]),g(!0),S("myself"),r({type:"exercise/setActionTabs",payload:{}}),N(!1)},Pe=(0,X.P)(),Te=x()(Pe,4),Ae=Te[0],Ee=Te[1],Oe=Te[2],ze=Te[3],Ge=function(){var e=c()(i()().mark((function e(n){var t,a,l,d,x;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=!1,G.forEach((function(e){ce.includes(e.id)&&(t=e.is_random)})),a=n.map((function(e){return{shixun_id:e.id,is_use:e.is_use,is_copy:e.is_copy}})),t){e.next=9;break}return e.next=6,r({type:"exercise/saveBanks",payload:{course_id:o.coursesId,object_type:"examination_bank",bank_id:ce,shixuns_info:a}});case 6:return 0===(null==(l=e.sent)?void 0:l.status)&&((0,L.L9)(["教学课堂","试卷","试卷选用"]),r({type:"classroomList/getClassroomExercisesList",payload:u()({},s.actionTabs.params)}),ge("/classrooms/".concat(o.coursesId,"/exercise/").concat(l.exercise_id,"/detail?random=").concat(l.is_random,"&tabs=3")),be("/classrooms/".concat(o.coursesId,"/exercise/add/").concat(l.exercise_id,"?random=").concat(l.is_random,"&type=2")),pe(!0),v.ZP.success("生成试卷成功"),Ee(),De()),e.abrupt("return");case 9:r({type:"exercise/setActionTabs",payload:{}}),Ee(),d=1,x=f.Z.confirm({icon:null,className:"custom-modal-divider",centered:!0,width:500,maskClosable:!1,keyboard:!1,cancelButtonProps:{disabled:!1},title:"配置出卷数量",content:(0,z.jsxs)("div",{className:V,children:[(0,z.jsxs)("div",{className:W,children:[(0,z.jsx)("sup",{className:K,children:"*"}),(0,z.jsx)("span",{style:{flexShrink:0},children:"随机出卷数量:"}),(0,z.jsx)(D.Z,{parser:Se,style:{width:120},placeholder:"请输入试卷数量",min:1,defaultValue:d,onChange:function(e){d=e;var n=document.getElementById("model_error");n.style.display=d<1||d>50?"block":"none"}})]}),(0,z.jsx)("div",{style:{display:"none",marginLeft:106},id:"model_error",className:"c-red",children:"请输入1-50之间的整数"})]}),okText:"确认",cancelText:"取消",onCancel:De,onOk:function(){var e=c()(i()().mark((function e(){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(d<1||d>50)){e.next=4;break}return document.getElementById("model_error").style.display="block",e.abrupt("return",Promise.reject());case 4:return x.update({cancelButtonProps:{disabled:!0}}),e.next=7,r({type:"exercise/saveBanks",payload:{course_id:o.coursesId,object_type:"examination_bank",bank_id:ce,shixuns_info:a,num:d}});case 7:n=e.sent,x.update({cancelButtonProps:{disabled:!1}}),n&&0===n.status?((0,L.L9)(["教学课堂","试卷","试卷选用"]),f.Z.destroyAll(),r({type:"classroomList/getClassroomExercisesList",payload:u()({},s.actionTabs.params)}),De(),Ee(),v.ZP.success("生成试卷成功")):(De(),Ee());case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()});case 13:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(f.Z,{centered:!0,width:980,title:"选择试卷",maskClosable:!1,destroyOnClose:!0,open:"试卷选用"===s.actionTabs.key,okText:"确定",cancelText:"取消",confirmLoading:b,bodyStyle:{minHeight:200},wrapClassName:H,onOk:c()(i()().mark((function e(){var n,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ce.length){e.next=3;break}return v.ZP.error("请选择试卷"),e.abrupt("return");case 3:if(N(!0),s=!1,!1,G.forEach((function(e){ce.includes(e.id)&&e.need_authorize&&(s=e.need_authorize),ce.includes(e.id)&&e.is_random})),!s){e.next=10;break}return(0,U.rX)(!1,"该试卷中包含实训需授权后才可使用。 您可以在QQ服务群向管理员申请获得继续操作的权限。"),e.abrupt("return");case 10:return e.next=12,ze({id:"".concat(ce[0]),course_id:null===(n=t.detailTopBanner)||void 0===n?void 0:n.course_id,type:"examination_bank"});case 12:e.sent||Ge([]),N(!1);case 15:case"end":return e.stop()}}),e)}))),onCancel:De,children:[(0,z.jsxs)(C.Z,{activeKey:I,onTabClick:function(){var e=c()(i()().mark((function e(n){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:ue.current.scrollTop=0,G=[],I!==n&&le([]),S(n),we.page=0,we.filter=n,we.group_id=null,p=!0,Ce();case 9:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:[(0,z.jsx)($,{tab:(0,z.jsx)("span",{children:"我的试卷库"})},"myself"),(0,z.jsx)($,{tab:(0,z.jsx)("span",{children:"教研共享"})},"teacher"),(0,z.jsx)($,{tab:(0,z.jsx)("span",{children:"公共试卷库"})},"public")]}),(0,z.jsxs)("div",{className:J,children:["teacher"===I&&(0,z.jsxs)(P.Z,{value:we.group_id,onChange:function(e){ue.current.scrollTop=0,G=[],we.page=0,we.group_id=e,p=!0,le([]),Le(u()({},we)),Ce()},size:"middle",style:{width:200,marginRight:30},children:[(0,z.jsx)(P.Z.Option,{value:null,children:"全部教研团队"}),null==ee||null===(n=ee.groups)||void 0===n?void 0:n.map((function(e){return(0,z.jsx)(P.Z.Option,{value:null==e?void 0:e.group_id,children:null==e?void 0:e.name},null==e?void 0:e.group_id)}))]}),(0,z.jsx)(T.Z.Search,{placeholder:"请输入试卷名称进行搜索",value:we.search,onChange:function(e){we.search=e.target.value,Le(u()({},we))},onSearch:function(e){ue.current.scrollTop=0,G=[],we.page=0,p=!0,le([]),e&&(0,q.tk)({name:e,copywriting:e,position:"Exercise"}),Ce()}})]}),(0,z.jsxs)("div",{ref:ue,style:{maxHeight:350,overflowY:"auto",overflowX:"hidden",marginTop:10,paddingBottom:20},children:[!ie&&"public"===I&&(0,z.jsxs)("div",{style:{display:"flex",flexDirection:"column",paddingTop:"30px",alignItems:"center",justifyContent:"center"},children:[(0,z.jsx)("span",{children:"通过职业认证的教师才能访问公共课程资源库"}),(0,z.jsx)("p",{style:{cursor:"pointer",background:"#ff6800",height:"30px",textAlign:"center",marginTop:"5px",padding:"5px 0px",color:"#fff",width:"80px"},onClick:function(){window.open("/account/certification")},children:"立即认证"})]}),(0,z.jsx)(E(),{initialLoad:!1,pageStart:0,loadMore:function(){Ce()},hasMore:p,useWindow:!1,children:"试卷选用"===s.actionTabs.key&&ie&&(0,z.jsx)(F,{className:Q,pagination:!1,hideSelectAll:!0,dataSource:G,onRow:function(e){return{onClick:function(){le([null==e?void 0:e.id])}}},resColumns:Me,rowSelection:Ze})})]})]}),(0,z.jsx)(f.Z,{title:"提示",open:me,confirmLoading:!1,centered:!0,okText:"设置规则",cancelText:"修改试卷",footer:(0,z.jsxs)("div",{children:[(0,z.jsx)(M.ZP,{onClick:function(){pe(!1),j.history.push(ye)},children:"修改试卷"}),(0,z.jsx)(M.ZP,{type:"primary",onClick:function(){j.history.push(fe),pe(!1)},children:"设置规则"})]}),onCancel:function(){pe(!1)},children:(0,z.jsx)("p",{children:"试卷创建完成!目前处于未发布状态,是否设置考试规则?"})}),(0,z.jsx)(X.Z,{inPaper:!0,visible:Ae,onCancel:Ee,onOk:Ge,renderData:Oe,modalType:"multiple",type:"examination_bank"})]})})),ne=t(54184),te=t(92524),se=(0,j.connect)((function(e){return{exercise:e.exercise}}))((function(e){var n=e.exercise,t=e.dispatch,s=(0,j.useParams)();return(0,z.jsx)(f.Z,{centered:!0,title:"提示",open:"设为公开"===n.actionTabs.key,okText:"确定",cancelText:"取消",onOk:c()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.ZP)("/api/courses/".concat(s.coursesId,"/exercises/set_public.json"),{method:"post",body:{check_ids:a()(n.actionTabs.selectArrs)}});case 2:0===e.sent.status&&((0,L.L9)(["教学课堂","试卷","设为公开"]),v.ZP.success("操作成功"),t({type:"exercise/setActionTabs",payload:{}}),t({type:"classroomList/getClassroomExercisesList",payload:u()({},n.actionTabs.params)}));case 4:case"end":return e.stop()}}),e)}))),onCancel:function(){t({type:"exercise/setActionTabs",payload:{}})},children:(0,z.jsxs)("p",{children:["设为公开后,非课堂成员也可以访问查看",(0,z.jsx)("br",{}),"是否确认设为公开?"]})})})),ie=t(13887),re=["exercise","dispatch","user"],ae=(0,j.connect)((function(e){return{exercise:e.exercise,user:e.user}}))((function(e){var n,t,s=e.exercise,r=e.dispatch,o=e.user,l=(p()(e,re),(0,j.useParams)()),d=(0,h.useState)(!1),m=x()(d,2),g=m[0],_=m[1],y=(0,h.useState)(!1),b=x()(y,2),M=b[0],N=b[1],k=(0,h.useRef)(null);(0,h.useEffect)((function(){if("批量删除"===s.actionTabs.key){var e,n;if((0,w.j5)())return void N(!0);var t={hasNum:0,noHasNum:0};null==s||null===(e=s.actionTabs)||void 0===e||null===(n=e.selectArrsAll)||void 0===n||n.map((function(e){var n;e.author_login===(null===(n=o.userInfo)||void 0===n?void 0:n.login)?++t.hasNum:++t.noHasNum})),t.noHasNum>0?f.Z.info({title:"权限提示",className:"custom-modal-divider ",icon:null,content:(0,z.jsxs)("div",{children:["当前选中资源中:",(0,z.jsx)("span",{className:"c-blue",children:t.hasNum}),"个由您本人发布,",(0,z.jsx)("span",{className:"c-red",children:t.noHasNum})," 个由其他老师发布。",(0,z.jsx)("br",{}),"课堂内只能删除本人发布的资源,请取消选中其他老师发布的资源。"]}),onOk:function(){I()}}):N(!0)}else N(!1)}),[s.actionTabs.key]);var I=function(){r({type:"exercise/setActionTabs",payload:{}})};return(0,z.jsx)(f.Z,{centered:!0,title:"提示",open:M,okText:"确定",cancelText:"取消",confirmLoading:g,destroyOnClose:!0,onOk:c()(i()().mark((function e(){var n,t;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===(n=k.current)||void 0===n||!n.onVerify()){e.next=2;break}return e.abrupt("return");case 2:return _(!0),e.next=5,(0,S.ZP)("/api/courses/".concat(l.coursesId,"/exercises/destroys.json"),{method:"post",body:{check_ids:a()(s.actionTabs.selectArrs)}});case 5:t=e.sent,_(!1),0===t.status&&((0,L.L9)(["教学课堂","试卷","删除"]),v.ZP.success("删除成功"),r({type:"exercise/setActionTabs",payload:{}}),r({type:"classroomList/getClassroomExercisesList",payload:u()({},s.actionTabs.params)}),r({type:"classroomList/getClassroomLeftMenus",payload:u()({},s.actionTabs.params)}));case 8:case"end":return e.stop()}}),e)}))),onCancel:function(){r({type:"exercise/setActionTabs",payload:{}})},children:null!=s&&null!==(n=s.actionTabs)&&void 0!==n&&n.status&&["未开始"].includes(null==s||null===(t=s.actionTabs)||void 0===t?void 0:t.status)?(0,z.jsx)("p",{children:"删除试卷会同步删除试卷中的所有考试,确认是否删除?"}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)("p",{style:{color:"#DD0000"},children:"删除考试则会清除学生所有的答题数据,且数据不可恢复,如确定删除,请输入下方验证码"}),(0,z.jsx)(ie.Z,{ref:function(e){return k.current=e}})]})})})),oe=["exercise","dispatch"],ce=(0,j.connect)((function(e){return{exercise:e.exercise}}))((function(e){var n=e.exercise,t=e.dispatch,s=(p()(e,oe),(0,j.useParams)());return s.id=s.coursesId,(0,h.useEffect)((function(){"加入试卷库"===n.actionTabs.key&&new Promise(c()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.ZP)("/api/courses/".concat(s.id,"/exercises/join_examination_banks.json"),{method:"post",body:{check_ids:a()(n.actionTabs.selectArrs)}});case 2:0===e.sent.status&&((0,L.L9)(["教学课堂","试卷","加入试卷库"]),v.ZP.success("已加入个人试卷库,试题同步加入至个人题库")),t({type:"exercise/setActionTabs",payload:{}});case 5:case"end":return e.stop()}}),e)}))))}),[n.actionTabs.key]),(0,z.jsx)(z.Fragment,{})})),le=t(83062),ue=t(84567),de=t(55241),xe="listItem___aJrbL",me="info___X9HlC",pe="title___ZDroC",he="titleLeft___JzNZc",je="titleRight___RP0gb",fe="name___LdzGg",ge="popover___Qeg0P",ve="dot___c9Vwj";Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var _e=t(48115),ye=t(80882),be=t(85952),Me=t(9269),Ne=t(61050),ke=(0,j.connect)((function(e){return{classroomList:e.classroomList}}))((function(e){var n,t,s,r,a,o,l,d,m,p,g,_,y,b,M,N=e.v,I=(e.k,e.match,e.selectArrs),C=e.setSelectArrs,Z=e.dispatch,D=e.params,P=e.classroomList,T=(e.batchStatus,e.manageAllGroup),A=(0,h.useState)([]),E=x()(A,2),O=E[0],G=E[1],Y=(0,h.useState)(!1),R=x()(Y,2),F=R[0],Q=R[1],J=(0,h.useRef)(),H=!1,V="YYYY-MM-DD",W=k()("2020-11-15",V);function K(){return U.apply(this,arguments)}function U(){return(U=c()(i()().mark((function e(){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(D,222),e.next=3,(0,S.ZP)("/api/courses/".concat(null==D?void 0:D.coursesId,"/exercises/group_use_list.json"),{method:"get",params:u()(u()({},D),{},{id:N.id})});case 3:n=e.sent,G((null==n?void 0:n.groups)||[]);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var X=function(){return f.Z.info({title:"题库改版告知",content:(0,z.jsx)(z.Fragment,{children:"EduCoder已升级题库功能所有试题均需匹配知识点。 当前试卷所涉及试题均未匹配知识点,无法随机抽取,已不能有效使用。请在试卷库重新组卷后使用。 由此带来的不便,敬请谅解!"})})};null!=N&&N.appraise_label&&(H=!0);var q=function(e){var n;j.history.push("/classrooms/".concat(D.coursesId,"/exercisenotice/").concat(e.id,"/users/").concat(null===(n=(0,w.eY)())||void 0===n?void 0:n.login))},$=[{title:"班级",dataIndex:"name",key:"name"},{title:"考试状态",dataIndex:"exercise_status",key:"exercise_status",width:100,filters:[{text:"未开始",value:1},{text:"考试中",value:2},{text:"已结束",value:3}],onFilter:function(e,n){return n.exercise_status===e},render:function(e,n){return(0,z.jsxs)("div",{children:[1===e&&(0,z.jsxs)("span",{children:[(0,z.jsx)("i",{className:ve,style:{background:"#C3C3C3"}}),"未开始"]}),2===e&&(0,z.jsxs)("span",{children:[(0,z.jsx)("i",{className:ve,style:{background:"#4EACFF"}}),"考试中"]}),3===e&&(0,z.jsxs)("span",{children:[(0,z.jsx)("i",{className:ve,style:{background:"#FC2D6B"}}),"已结束"]})]})}},{title:"开始时间",dataIndex:"publish_time",key:"publish_time",sorter:!0,width:170,showSorterTooltip:!1,sortOrder:"publish_time"===D.order_by?"desc"===D.sort_direction?"descend":"ascend":null},{title:"结束时间",dataIndex:"end_time",key:"end_time",sorter:!0,width:170,showSorterTooltip:!1,sortOrder:"end_time"===D.order_by?"desc"===D.sort_direction?"descend":"ascend":null},{title:"提交人数",dataIndex:"exercise_answer",key:"exercise_answer",align:"center",width:80,render:function(e,n){return 1===n.exercise_status?"-":(0,z.jsxs)("span",{children:[e,"/",n.exercise_users]})}},{title:"待评阅试卷",dataIndex:"unreview_count",key:"unreview_count",align:"center",width:90,render:function(e,n){return 1===n.exercise_status?"-":0===e?(0,z.jsx)("span",{style:{cursor:"no-drop",color:"#999999"},children:e}):(0,z.jsx)("a",{onClick:function(){return(0,L.xg)("/classrooms/".concat(null==D?void 0:D.coursesId,"/exercise/").concat(null==N?void 0:N.id,"/detail?random=false&exercise_group_id=").concat(n.course_group_id))},children:e})}},{title:"操作",dataIndex:"action",align:"center",key:"action",width:60,render:function(e,n){return 1===n.exercise_status?(0,z.jsx)("img",{style:{cursor:"not-allowed"},src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMCAwaDIydjIySDB6Ii8+PGcgZmlsbD0iIzk3OTc5NyIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBkPSJNMTAuNDIyIDUuODE4aC44djEwLjRoLS44eiIvPjxwYXRoIGQ9Ik0xMC43NDMgMTcuMDE4YS40OS40OSAwIDAgMS0uMzgtLjE5N2MtLjM4LS41NDEtMS4yMS0uOTEtMS45OTMtLjkxSDMuNjk3YS40ODUuNDg1IDAgMCAxLS40NzUtLjQ5M1Y0Ljg4M2MwLS4xNzMuMDcxLS4zMi4xNjYtLjQ0My4yMTQtLjIyMi41MjItLjIyMi43MzYtLjIyMmg0LjEwNGMxLjEzOSAwIDIuMzAxLjY0IDIuODIzIDEuNTc2LjE0My4yMjEuMDcxLjU0MS0uMTY2LjY2NGEuNDM4LjQzOCAwIDAgMS0uNjQtLjE3MkM5Ljg4OSA1LjY3IDkuMDEgNS4xNzggOC4yMjggNS4xNzhINC4xNzF2OS43MjNoNC4yYzEuMDY3IDAgMi4xODIuNTE3IDIuNzUxIDEuMjhhLjQ5My40OTMgMCAwIDEtLjA5NS42OWMtLjA5NC4wOTgtLjE5LjE0Ny0uMjg0LjE0N1oiLz48cGF0aCBkPSJNMTEuMDA2IDE3LjAxOGEuNDY5LjQ2OSAwIDAgMS0uMjk0LS4wOTguNDgzLjQ4MyAwIDAgMS0uMDk4LS42OWMuNTg4LS43NjMgMS43MTQtMS4yOCAyLjg0LTEuMjhoMy45OVY1LjIwM2gtMy44NjhjLS44NTcgMC0xLjg4NS40OTItMi4yNTIgMS4xMDctLjE0Ny4yMjItLjQ0LjMyLS42Ni4xNzMtLjIyLS4xNDgtLjMxOS0uNDQzLS4xNzItLjY2NS42MTItMS4wMzQgMi4wNTYtMS42IDMuMDg0LTEuNmg0LjIzNGMuMDk4IDAgLjI5NCAwIC40NC4xNDguMTcyLjE3Mi4xNzIuMzcuMTcyLjQ2OHYxMC41ODRjMCAuMjcxLS4yMi40OTItLjQ5LjQ5MkgxMy40M2MtLjgwOCAwLTEuNjQuMzctMi4wNTYuOTExYS40My40MyAwIDAgMS0uMzY3LjE5N1oiLz48L2c+PC9nPjwvc3ZnPg=="}):(0,z.jsx)(le.Z,{title:"评阅",children:(0,z.jsx)("a",{onClick:function(){return(0,L.xg)("/classrooms/".concat(null==D?void 0:D.coursesId,"/exercise/").concat(null==N?void 0:N.id,"/detail?random=false&exercise_group_id=").concat(n.course_group_id))},children:(0,z.jsx)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMCAwaDIydjIySDB6Ii8+PGcgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBmaWxsPSIjMjI5QkZGIiBkPSJNMTAuNDIyIDUuODE4aC44djEwLjRoLS44eiIvPjxwYXRoIGQ9Ik0xMC43NDMgMTcuMDE4YS40OS40OSAwIDAgMS0uMzgtLjE5N2MtLjM4LS41NDEtMS4yMS0uOTEtMS45OTMtLjkxSDMuNjk3YS40ODUuNDg1IDAgMCAxLS40NzUtLjQ5M1Y0Ljg4M2MwLS4xNzMuMDcxLS4zMi4xNjYtLjQ0My4yMTQtLjIyMi41MjItLjIyMi43MzYtLjIyMmg0LjEwNGMxLjEzOSAwIDIuMzAxLjY0IDIuODIzIDEuNTc2LjE0My4yMjEuMDcxLjU0MS0uMTY2LjY2NGEuNDM4LjQzOCAwIDAgMS0uNjQtLjE3MkM5Ljg4OSA1LjY3IDkuMDEgNS4xNzggOC4yMjggNS4xNzhINC4xNzF2OS43MjNoNC4yYzEuMDY3IDAgMi4xODIuNTE3IDIuNzUxIDEuMjhhLjQ5My40OTMgMCAwIDEtLjA5NS42OWMtLjA5NC4wOTgtLjE5LjE0Ny0uMjg0LjE0N1oiIGZpbGw9IiMwMTUyZDkiLz48cGF0aCBkPSJNMTEuMDA2IDE3LjAxOGEuNDY5LjQ2OSAwIDAgMS0uMjk0LS4wOTguNDgzLjQ4MyAwIDAgMS0uMDk4LS42OWMuNTg4LS43NjMgMS43MTQtMS4yOCAyLjg0LTEuMjhoMy45OVY1LjIwM2gtMy44NjhjLS44NTcgMC0xLjg4NS40OTItMi4yNTIgMS4xMDctLjE0Ny4yMjItLjQ0LjMyLS42Ni4xNzMtLjIyLS4xNDgtLjMxOS0uNDQzLS4xNzItLjY2NS42MTItMS4wMzQgMi4wNTYtMS42IDMuMDg0LTEuNmg0LjIzNGMuMDk4IDAgLjI5NCAwIC40NC4xNDguMTcyLjE3Mi4xNzIuMzcuMTcyLjQ2OHYxMC41ODRjMCAuMjcxLS4yMi40OTItLjQ5LjQ5MkgxMy40M2MtLjgwOCAwLTEuNjQuMzctMi4wNTYuOTExYS40My40MyAwIDAgMS0uMzY3LjE5N1oiIGZpbGw9IiMwMTUyZDkiLz48L2c+PC9nPjwvc3ZnPg=="})})})}}];return(0,z.jsxs)("div",{className:xe,onClick:function(){(0,L.xg)("/classrooms/".concat(D.coursesId,"/exercise/").concat(N.id,"/detail?random=").concat(N.is_random))},children:[(0,w.GJ)()&&(0,z.jsx)(ue.Z,{checked:I.includes(N.id),value:N.id,className:"mr20",onClick:function(e){e.stopPropagation()},onChange:function(e){I.indexOf(N.id);I.indexOf(N.id)>-1?C(I.filter((function(e){return e!==N.id}))):C(I.concat(N.id))}}),(0,z.jsxs)("div",{className:me,children:[(0,z.jsxs)("div",{className:pe,children:[(0,z.jsxs)("div",{className:he,style:{marginRight:15},children:[function(e){return H?(0,z.jsx)("span",{style:{backgroundColor:"#f59a23"},className:"tag-style mr10",children:"集中阅卷"}):null!=e&&e.includes("未开始")?(0,z.jsx)("span",{style:{backgroundColor:"#B8B8B8"},className:"tag-style mr10",children:"未开始"}):null!=e&&e.includes("考试中")?(0,z.jsx)("span",{style:{backgroundColor:"#007AFF"},className:"tag-style mr10",children:"考试中"}):null!=e&&e.includes("已结束")?(0,z.jsx)("span",{style:{backgroundColor:"#FC2D6B"},className:"tag-style mr10",children:"已结束"}):void 0}(null==N?void 0:N.exercise_tips),(0,z.jsx)(le.Z,{title:N.exercise_name,children:(0,z.jsx)("span",{className:fe,children:N.exercise_name})}),!N.is_public&&(0,w.GJ)()&&(0,z.jsx)(le.Z,{title:"私有属性,非课堂成员不能访问",children:(0,z.jsx)("span",{className:"iconfont icon-suo1 ml10 mr10 c-light-black font12"})}),(null==N||null===(n=N.exercise_tips)||void 0===n?void 0:n.includes("已开启防作弊"))&&(0,z.jsx)("span",{style:{flexShrink:0,marginLeft:20,display:"flex"},className:"tag-style-fzb iconfont icon-fangzuobi",children:"已开启防作弊"}),(null==N||null===(t=N.exercise_tips)||void 0===t?void 0:t.includes("已结束"))&&(null==N||null===(s=N.exercise_tips)||void 0===s?void 0:s.includes("未提交"))&&(0,z.jsx)("span",{style:{flexShrink:0,backgroundColor:"#B8B8B8"},className:"tag-style ml10",children:"未提交"})]}),(0,z.jsxs)("div",{className:je,onClick:function(e){e.stopPropagation(),e.preventDefault()},children:[(null==N?void 0:N.appraise_setting)&&(0,z.jsx)("span",{onClick:c()(i()().mark((function e(){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Z({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"正在进入评阅,请稍后..."}}),e.next=3,(0,S.ZP)("/api/exercises/".concat(N.id,"/create_appraise_students.json"),{method:"get"});case 3:n=e.sent,Z({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}}),(0,L.xg)("/classrooms/".concat(null==D?void 0:D.coursesId,"/exercise/").concat(N.id,"/centralizeReview/").concat(null==n?void 0:n.login));case 6:case"end":return e.stop()}}),e)}))),children:"集中阅卷"}),(0,w.GJ)()&&(0,z.jsx)(be.Z,{tips:null==N?void 0:N.open_appraise,children:(0,z.jsx)("span",{onClick:function(){var e,n;!(0,w.Rm)()||null!=P&&null!==(e=P.AssistantObject)&&void 0!==e&&null!==(n=e.exercise)&&void 0!==n&&n.can_publish?0!==(null==N?void 0:N.exercise_question_count)?Z({type:"exercise/setActionTabs",payload:{key:"批量发布",selectArrs:[N.id],unified_setting:N.unified_setting,params:D,disabled:1!==N.exercise_status,type:2,manage_all_group:T}}):v.ZP.warning("试卷内没有试题不允许发布考试"):v.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:"发布"})}),(0,w.GJ)()&&!(0,L._m)()&&N.assistant_auth&&(0,z.jsx)("span",{onClick:function(e){var n,t;if(e.stopPropagation(),!(0,w.Rm)()||null!=P&&null!==(n=P.AssistantObject)&&void 0!==n&&null!==(t=n.exercise)&&void 0!==t&&t.can_preview){var s=k()(N.created_at,V);k()(W).diff(k()(s),"days")>0&&null!=N&&N.is_random?X():null!=N&&N.is_random?(0,L.xg)("/classrooms/".concat(D.coursesId,"/exercise/").concat(N.id,"/random/preview?random=").concat(N.is_random)):(0,L.xg)("/classrooms/".concat(D.coursesId,"/exercise/").concat(N.id,"/detail?random=").concat(N.is_random,"&tabs=2"))}else v.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:"预览"}),(0,w.RV)()&&(0,z.jsx)("span",{onClick:function(){(0,L.xg)("/classrooms/".concat(D.coursesId,"/exercise/").concat(N.id,"/detail?random=").concat(N.is_random))},children:"详情"}),(0,w.GJ)()&&!(0,L._m)()&&(0,z.jsx)(de.Z,{placement:"bottom",content:(0,z.jsxs)("div",{className:ge,children:[(0,z.jsx)("p",{onClick:function(){var e=c()(i()().mark((function e(n){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(0,L.xg)("/classrooms/".concat(D.coursesId,"/exercise/").concat(N.id,"/detail?random=").concat(N.is_random,"&tabs=3"));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:"规则设置"}),(0,w.GJ)()&&N.is_random&&N.assistant_auth&&(0,z.jsx)("p",{onClick:function(e){e.stopPropagation();var n=k()(N.created_at,V);k()(W).diff(k()(n),"days")>0&&null!=N&&N.is_random?X():(0,L.xg)("/classrooms/".concat(D.coursesId,"/exercise/").concat(N.id,"/random/edit?type=settings"))},children:"编辑考试"}),(0,z.jsx)("p",{onClick:function(){var e=c()(i()().mark((function e(n){var t;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Z({type:"exercise/setActionTabs",payload:{key:"批量删除",selectArrs:[N.id],selectArrsAll:[N],params:D,status:null==N||null===(t=N.exercise_tips)||void 0===t?void 0:t[0]}});case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:"删除试卷"}),((0,w.GJ)()||(null==P||null===(r=P.AssistantObject)||void 0===r||null===(a=r.exercise)||void 0===a?void 0:a.can_stop))&&(0,z.jsx)("p",{onClick:function(){var e=c()(i()().mark((function e(n){var t,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(0,w.Rm)()||null!=P&&null!==(t=P.AssistantObject)&&void 0!==t&&null!==(s=t.exercise)&&void 0!==s&&s.can_stop){e.next=3;break}return v.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能"),e.abrupt("return");case 3:Z({type:"exercise/setActionTabs",payload:{key:"批量结束",selectArrs:[N.id],params:D,unified_setting:N.unified_setting}});case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:"结束考试"})]}),children:(0,z.jsx)("span",{onClick:function(e){return e.stopPropagation()},children:"更多"})}),(0,w.dE)()&&(0,z.jsxs)(z.Fragment,{children:[!!N.off_limits&&(0,z.jsx)(le.Z,{title:"限制".concat(null==N?void 0:N.max_last_time,"禁止进入考试"),children:(0,z.jsx)("b",{className:"font16 c-grey-999",children:"已禁止进入答题"})}),!N.off_limits&&0===N.current_status&&N.exercise_status>1&&!(null!==(o=N.exercise_tips)&&void 0!==o&&o.includes("已结束"))&&(0,z.jsx)("a",{onClick:function(e){e.stopPropagation(),e.preventDefault(),q(N,!0)},href:"",children:"继续考试"}),!N.off_limits&&1===N.current_status&&N.exercise_status>1&&"kepukehuan.educoder.net"!=document.domain&&(0,z.jsx)("span",{style:{color:"#0152d9"},onClick:function(){var e=c()(i()().mark((function e(n){var t;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.stopPropagation(),null!=N&&N.answered_open){e.next=4;break}return v.ZP.info("老师已设置本试卷在交卷后不可查看"),e.abrupt("return");case 4:return e.next=6,(0,Me.w)(D.coursesId,N.id,"正在进入查看,请稍后...");case 6:(0,L.xg)("/classrooms/".concat(D.coursesId,"/exercise/").concat(N.id,"/users/").concat(null===(t=(0,w.eY)())||void 0===t?void 0:t.login,"?check=true"));case 7:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:"查看考试"}),!N.off_limits&&2===N.current_status&&N.exercise_status>1&&!(null!==(l=N.exercise_tips)&&void 0!==l&&l.includes("已结束"))&&(0,z.jsx)("a",{style:{color:1===(null==N?void 0:N.is_redo)&&"red"},onClick:function(e){e.stopPropagation(),e.preventDefault(),q(N)},href:"",children:0===(null==N?void 0:N.is_redo)?"开始考试":"重新考试"})]})]})]}),(0,w.GJ)()&&(0,z.jsxs)("p",{style:{display:"flex"},children:[(0,z.jsx)("span",{className:"c-grey-666",children:N.author}),(0,z.jsxs)("span",{className:"ml30 c-grey-666",children:["创建时间:",k()(N.created_at).format("YYYY-MM-DD HH:mm:ss")]}),(null==N||null===(d=N.exercise_tips)||void 0===d?void 0:d.includes("未开始"))&&N.publish_time&&(0,z.jsxs)("span",{className:"ml30 c-grey-666",children:["开始时间:",k()(N.publish_time).format("YYYY-MM-DD HH:mm:ss")]}),(0,z.jsxs)("span",{className:"ml30 c-grey-666",children:["答题时长:",null===N.time?"不限":"".concat(N.time,"分钟")]}),(0,z.jsxs)("span",{className:"ml30 c-grey-666",children:["类型:",N.is_random?"随机组卷":"人工组卷"]}),!(null!=N&&null!==(m=N.exercise_tips)&&void 0!==m&&m.includes("未开始"))&&(0,z.jsxs)("span",{style:{marginLeft:"auto",paddingRight:"20px",textAlign:"end",color:"#888888"},onClick:function(){var e=c()(i()().mark((function e(n){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.stopPropagation(),n.preventDefault(),F||K(),Q(!F);case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:[F?"收起":"展开",F?(0,z.jsx)(_e.Z,{style:{color:"#888888"}}):(0,z.jsx)(ye.Z,{style:{color:"#888888"}})]})]}),(0,w.dE)()&&(0,z.jsxs)("p",{style:{display:"flex"},children:[(0,z.jsx)("span",{className:"c-grey-333",children:N.author}),(0,z.jsxs)("span",{className:"ml30 c-grey-999 mr20",children:["答题时长:",null===N.time?"不限":"".concat(N.time,"分钟")]}),!(null==N||!N.exercise_left_time)&&(0,z.jsxs)("span",{className:"ml15 c-grey-999",children:["考试剩余时间:",null==N?void 0:N.exercise_left_time]})]}),(0,w.GJ)()&&!(null!=N&&null!==(p=N.exercise_tips)&&void 0!==p&&p.includes("未开始"))&&(0,z.jsxs)("p",{children:[(0,z.jsx)("span",{style:{letterSpacing:2},className:"c-grey-333 mr15",children:"班级使用情况:"}),(0,z.jsxs)("span",{className:"c-grey-333 mr20",children:["未开始",(0,z.jsx)("span",{children:null==N||null===(g=N.group_status)||void 0===g?void 0:g[0]})]}),(0,z.jsxs)("span",{className:"c-grey-333 mr20",children:["考试中 ",(0,z.jsx)("span",{style:{color:"#4EACFF"},children:null==N||null===(_=N.group_status)||void 0===_?void 0:_[1]})]}),(0,z.jsxs)("span",{className:"c-grey-333",children:["已结束 ",(0,z.jsx)("span",{style:{color:"#FC2D6B"},children:null==N||null===(y=N.group_status)||void 0===y?void 0:y[2]})]})]}),(0,w.GJ)()&&!(null!=N&&null!==(b=N.exercise_tips)&&void 0!==b&&b.includes("未开始"))&&F&&O.length>5&&(0,z.jsx)(B.Z,{scroll:{y:240},pagination:!1,dataSource:O,onRow:function(e){return{onClick:function(e){e.stopPropagation(),e.preventDefault()}}},onHeaderRow:function(e,n){return{onClick:function(e){e.stopPropagation(),e.preventDefault()}}},rowKey:"course_group_id",style:{marginTop:"10px"},onChange:function(e,n,t){t.field&&(D.order_by=t.field),t.order||(D.sort_direction="asc"),"ascend"===t.order&&(D.sort_direction="asc"),"descend"===t.order&&(D.sort_direction="desc"),t.order||(D.sort_direction="asc"),K()},columns:$}),(0,w.GJ)()&&!(null!=N&&null!==(M=N.exercise_tips)&&void 0!==M&&M.includes("未开始"))&&F&&O.length<6&&O.length>0&&(0,z.jsx)(B.Z,{rowKey:"course_group_id",pagination:!1,onRow:function(e){return{onClick:function(e){e.stopPropagation(),e.preventDefault()}}},onHeaderRow:function(e,n){return{onClick:function(e){e.stopPropagation(),e.preventDefault()}}},dataSource:O,style:{marginTop:"10px"},onChange:function(e,n,t){t.field&&(D.order_by=t.field),t.order||(D.sort_direction="asc"),"ascend"===t.order&&(D.sort_direction="asc"),"descend"===t.order&&(D.sort_direction="desc"),t.order||(D.sort_direction="asc"),K()},columns:$}),void 0!==(null==N?void 0:N.total)&&(0,z.jsxs)("p",{children:[(0,z.jsx)("span",{className:"c-grey-333 mr15",children:"集中阅卷总进度:"}),(0,z.jsxs)("span",{className:"c-grey-333 mr20",children:["总评数",(0,z.jsx)("span",{children:null==N?void 0:N.total})]}),(0,z.jsxs)("span",{className:"c-grey-333 mr20",children:["已评阅 ",(0,z.jsx)("span",{style:{color:"#4EACFF"},children:null==N?void 0:N.finish_total})]}),(0,z.jsxs)("span",{className:"c-grey-333",children:["待评阅 ",(0,z.jsx)("span",{style:{color:"#FC2D6B"},children:null==N?void 0:N.unfinished_total})]})]})]}),(0,z.jsx)(Ne.Z,{closable:!0,successCb:function(){return q(J.current)}})]})})),we=t(15582),Le=t(13729),Ie=t(8430),Se=t(11475),Ce=["user","classroomList","globalSetting","loading","dispatch","match"],Ze=(0,j.connect)((function(e){var n=e.user,t=e.classroomList,s=e.loading;return{user:n,classroomList:t,globalSetting:e.globalSetting,loading:s.effects}}))((function(e){var n,t,s,r,o,l,d,m,N,C,Z,D=e.user,P=e.classroomList,T=(e.globalSetting,e.loading),A=e.dispatch,E=e.match,O=(p()(e,Ce),(0,j.useParams)()),G=(0,j.useSearchParams)(),Y=x()(G,1)[0],B=(0,h.useState)((function(){return u()(u()({},O),{},{limit:20})})),R=x()(B,2),F=R[0],Q=(R[1],(0,j.useLocation)()),J=P.detailExerciseList,H=P.detailTopBanner,V=P.detailLeftMenus,W=(0,h.useState)([]),K=x()(W,2),U=K[0],X=K[1],q=(0,h.useState)(!1),$=x()(q,2),ie=($[0],$[1]),re=(0,h.useState)([]),oe=x()(re,2),le=oe[0],ue=oe[1],de=(0,h.useState)(!1),xe=x()(de,2),me=xe[0],pe=xe[1],he=(0,h.useState)("按创建时间降序"),je=x()(he,2),fe=je[0],ge=je[1];F.type="all"===Y.get("tabs")?"":Y.get("tabs")||"",F.id=F.coursesId,(0,h.useEffect)((function(){var e,n;if(null!=D&&null!==(e=D.userInfo)&&void 0!==e&&e.login){if((0,w.GJ)()){var t,s=L.cX.getItem("".concat(null==D||null===(t=D.userInfo)||void 0===t?void 0:t.login,"Teacher"),"Exercise");s&&(F.sort_by=null==s?void 0:s.type,F.sort_direction=null==s?void 0:s.direction,ge(null==s?void 0:s.name))}A({type:"classroomList/getClassroomExercisesList",payload:u()(u()({},F),O)})}else null!=D&&null!==(n=D.userInfo)&&void 0!==n&&n.username&&A({type:"classroomList/getClassroomExercisesList",payload:u()(u()({},F),O)});ie(!1)}),[null==D||null===(n=D.userInfo)||void 0===n?void 0:n.login,Q.pathname]),(0,h.useEffect)((function(){"目录重命名成功"===P.actionTabs.key&&A({type:"classroomList/getClassroomExercisesList",payload:u()(u()({},F),O)})}),[P.actionTabs.key]),(0,h.useEffect)((function(){X([])}),[J]);(0,h.useEffect)((function(){"all"===Y.get("tabs")&&(F.type="",F.page=1)}),[Y.get("tabs")]),(0,h.useEffect)((function(){A({type:"classroomList/getAssistantPermissions",payload:{course_id:F.coursesId}}),sessionStorage.getItem("illegalEntry")&&(sessionStorage.removeItem("illegalEntry"),f.Z.info({title:"提示",centered:!0,width:600,content:(0,z.jsxs)("div",{children:["在线考试禁止使用链接直接访问答题页面,请使用下面两种正常方式进入考试答题页面。",(0,z.jsx)("br",{}),"1、在",(0,z.jsx)("span",{className:"c-red blod",children:"考试列表"}),"页面中,点击“",(0,z.jsx)("span",{className:"c-blue blod",children:"开始考试"}),"”或“",(0,z.jsx)("span",{className:"c-blue blod",children:"继续考试"}),"”按钮进入考试答题页面。",(0,z.jsx)("br",{}),"2、在",(0,z.jsx)("span",{className:"c-red blod",children:"考试详情"}),"页面中,点击“",(0,z.jsx)("span",{className:"c-blue blod",children:"开始考试"}),"”或“",(0,z.jsx)("span",{className:"c-blue blod",children:"继续考试"}),"”按钮进入考试答题页面。"]}),okText:"知道了"}))}),[]);var ve=[{name:"全部",id:"all",total:null===(t=J.exercises_counts)||void 0===t?void 0:t.exercises_total_counts},{name:"未开始",id:1,total:null===(s=J.exercises_counts)||void 0===s?void 0:s.unstart_counts},{name:"考试中",id:2,total:null===(r=J.exercises_counts)||void 0===r?void 0:r.publish_counts},{name:"集中阅卷",id:4,total:null===(o=J.exercises_counts)||void 0===o?void 0:o.appraise_exercise_count},{name:"已结束",id:3,total:null===(l=J.exercises_counts)||void 0===l?void 0:l.end_counts}];(0,w.GJ)()||ve.splice(1,1);var _e=[{name:"批量发布",icon:(0,z.jsx)("i",{className:"iconfont icon-fabu5"})},{name:"批量结束",icon:(0,z.jsx)("i",{className:"iconfont icon-piliangjiezhi2"})},{name:"批量删除",icon:(0,z.jsx)("i",{className:"iconfont icon-piliangshanchu2"})},{name:"设为公开",icon:(0,z.jsx)("i",{className:"iconfont icon-sheweigongkai2"})},{name:"加入试卷库",icon:(0,z.jsx)("i",{className:"iconfont icon-piliangjiaru font14"})}].filter((function(e){return!!(0,w.GJ)()||"批量删除"!==e.name})).filter((function(e){return!!H.is_public||"设为公开"!==e.name})),ye="YYYY-MM-DD",be=k()("2020-11-15",ye),Me=function(){var e=c()(i()().mark((function e(n){var t,s,r,o,c,l,u,d,x,m,p,h,j,g,_;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=n.name,r=[],null===(t=J.exercises)||void 0===t||t.map((function(e){if(U.includes(e.id)&&e.is_random){var n=k()(e.created_at,ye);k()(be).diff(k()(n),"days")>0&&null!=e&&e.is_random&&r.push(e)}})),""!=U){e.next=9;break}o="请选择你要操作的任务","加入试卷库"===s&&(o="请选择要加入试卷库的试卷"),v.ZP.error(o),e.next=39;break;case 9:if(!r.length){e.next=13;break}f.Z.info({title:"题库改版告知",content:(0,z.jsx)(z.Fragment,{children:"EduCoder已升级题库功能所有试题均需匹配知识点。 当前试卷所涉及试题均未匹配知识点,无法随机抽取,已不能有效使用。请在试卷库重新组卷后使用。 由此带来的不便,敬请谅解!"})}),e.next=39;break;case 13:if("批量发布"!==s){e.next=31;break}if(!(0,w.Rm)()||null!=P&&null!==(l=P.AssistantObject)&&void 0!==l&&null!==(u=l.exercise)&&void 0!==u&&u.can_publish){e.next=17;break}return v.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能"),e.abrupt("return");case 17:if(p=!1,J.exercises.forEach((function(e){U.includes(e.id)&&0===e.total_num&&e.is_random&&(p=!0)})),h=null===(d=J.exercises.filter((function(e){return U.includes(null==e?void 0:e.id)})).filter((function(e){return 0===(null==e?void 0:e.exercise_question_count)})))||void 0===d||null===(x=d[0])||void 0===x?void 0:x.exercise_name,!((null===(m=h)||void 0===m?void 0:m.length)>0)){e.next=23;break}return v.ZP.warning("".concat(h,"试卷内没有试题不允许发布考试")),e.abrupt("return");case 23:if(!p){e.next=26;break}return v.ZP.warning("随机试卷还未在该课堂生成试卷,请点击编辑去设置出卷数量吧。"),e.abrupt("return");case 26:if(j=!1,J.exercises.forEach((function(e){U.includes(e.id)&&1!==e.exercise_status&&(j=!0)})),!j){e.next=31;break}return v.ZP.warning("试卷已发布考试不可批量发布。"),e.abrupt("return");case 31:if("加入试卷库"!==s){e.next=38;break}return e.next=34,(0,S.ZP)("/api/courses/".concat(F.id,"/exercises/check_exercise_cover.json"),{method:"post",body:{check_ids:a()(U)}});case 34:if(!((null==(_=e.sent)||null===(g=_.cover_exercises)||void 0===g?void 0:g.length)>0)){e.next=38;break}return ue(null==_?void 0:_.cover_exercises),e.abrupt("return");case 38:A({type:"exercise/setActionTabs",payload:{key:s,selectArrs:U,selectArrsAll:null===(c=J.exercises)||void 0===c?void 0:c.filter((function(e){return U.includes(e.id)})),params:F,type:1}});case 39:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,z.jsxs)("section",{className:"minH500",children:[(0,z.jsx)(we.Z,{isLoading:T["classroomList/getClassroomExercisesList"],tabDataSource:ve,isAdmin:(0,w.GJ)(),getDropdownMenu:function(){return(0,z.jsxs)(g.Z,{children:[(0,z.jsx)(g.Z.Item,{onClick:function(){var e,n;!(0,w.Rm)()||null!=P&&null!==(e=P.AssistantObject)&&void 0!==e&&null!==(n=e.exercise)&&void 0!==n&&n.can_create?A({type:"exercise/setActionTabs",payload:{key:"试卷选用",params:F}}):v.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:"快速选择试卷"},1),(0,z.jsx)(g.Z.Item,{onClick:function(){var e,n;!(0,w.Rm)()||null!=P&&null!==(e=P.AssistantObject)&&void 0!==e&&null!==(n=e.exercise)&&void 0!==n&&n.can_create?j.history.push("/classrooms/".concat(F.coursesId,"/exercise/add")):v.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:"创建新试卷"},2)]})},onTabMenuClick:function(e){F.type="all"===e.key?"":e.key,F.page=1,j.history.replace("".concat(Q.pathname,"?tabs=").concat(e.key)),pe(!1),A({type:"classroomList/getClassroomExercisesList",payload:u()(u()({},F),O)})},defaultSelectedKeys:[F.type||"all"]}),(0,z.jsx)(Le.Z,{dataSource:J.exercises||[],isAdmin:(0,w.GJ)(),batchStatus:me,SortMenuName:fe,setSortMenuName:ge,SortMenus:[{name:"按创建时间升序",type:"created_at",direction:"asc"},{name:"按创建时间降序",type:"created_at",direction:"desc"},{name:"按考试时长升序",type:"time",direction:"asc"},{name:"按考试时长降序",type:"time",direction:"desc"},{name:"按试卷名称升序",type:"exercise_name",direction:"asc"},{name:"按试卷名称降序",type:"exercise_name",direction:"desc"}],onSearch:function(e){F.search=e,F.page=1,A({type:"classroomList/getClassroomExercisesList",payload:u()({},F)})},onSort:function(e){var n;(F.sort_by=e.type,F.sort_direction=e.direction,(0,w.GJ)())&&L.cX.setItem("".concat(null==D||null===(n=D.userInfo)||void 0===n?void 0:n.login,"Teacher"),e,"Exercise");F.page=1,A({type:"classroomList/getClassroomExercisesList",payload:u()({},F)}),ge(e.name)},onBatch:function(e){return pe(e)}}),J.exercises_counts&&0===(null===(d=J.exercises_counts)||void 0===d?void 0:d.exercises_all_counts)&&(0,z.jsx)(I.Z,{}),(0,z.jsxs)(_.Z,{loading:T["classroomList/getClassroomExercisesList"],active:!0,avatar:{size:40},paragraph:{rows:5},className:"mt30",children:[J.exercises&&J.exercises.map((function(e,n){return(0,z.jsx)(ke,{v:e,k:n,match:E,batchStatus:me,selectArrs:U,setSelectArrs:X,dispatch:A,params:F,manageAllGroup:J.manage_all_group},n)})),(0,z.jsx)("aside",{className:"tc mb50 mt30",children:(null===(m=J.exercises_counts)||void 0===m?void 0:m.exercises_all_counts)>0&&(0,z.jsx)(y.Z,{showTotal:function(e){var n;return"共 ".concat(null==J||null===(n=J.exercises_counts)||void 0===n?void 0:n.exercises_all_counts," 条")},showSizeChanger:!0,onChange:function(e,n){X([]),F.page=e,F.limit=n,A({type:"classroomList/getClassroomExercisesList",payload:u()(u()({},F),O)})},defaultCurrent:F.page,current:F.page||1,pageSize:F.limit||20,total:J.exercises_counts&&J.exercises_counts.exercises_all_counts})})]}),U.length>0&&(0,w.GJ)()&&(0,z.jsx)(b.Z,{offsetBottom:0,children:(0,z.jsx)(Ie.Z,{buttonDataSource:_e,onButtonClick:Me,useBatchStatus:pe,setSeleArr:X,catalogue:(null==V||null===(N=V.course_modules)||void 0===N||null===(C=N.find((function(e){return"exercise"===e.type})))||void 0===C?void 0:C.second_category)||[],addCatalogue:function(e){e.preventDefault(),A({type:"classroomList/setActionTabs",payload:{key:"添加目录",params:F,selectArrs:{category_id:null==J?void 0:J.main_category_id,type:"exercise"}}})},allSelect:!!U.length&&U.length===(null===(Z=J.exercises)||void 0===Z?void 0:Z.length),setAllSelect:function(e){var n;e.target.checked?X(null==J||null===(n=J.exercises)||void 0===n?void 0:n.map((function(e){return e.id}))):X([])},selectArrs:U,onMenuClick:function(){var e=c()(i()().mark((function e(n){var t;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.key,""!=U){e.next=4;break}return v.ZP.error("请选择你要操作的任务"),e.abrupt("return",null);case 4:return e.next=6,(0,S.ZP)("/api/courses/".concat(F.id,"/exercises/move_to_category.json"),{method:"post",body:{exercise_ids:U,new_category_id:t}});case 6:0===e.sent.status&&(v.ZP.success("操作成功"),A({type:"classroomList/getClassroomExercisesList",payload:u()({},O)}));case 8:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()})}),(0,z.jsx)(ne.Z,{}),(0,z.jsx)(te.Z,{}),(0,z.jsx)(ae,{}),(0,z.jsx)(se,{}),(0,z.jsx)(ee,{cb:function(){return X([])}}),(0,z.jsx)(ce,{}),(0,z.jsx)(Ne.Z,{}),(0,z.jsxs)(f.Z,{title:(0,z.jsxs)("span",{children:[(0,z.jsx)(Se.Z,{style:{color:"#faad14",fontSize:"18px"}})," 加入试卷库提示"]}),open:le.length>0,footer:!1,onCancel:function(){ue([])},children:[(0,z.jsxs)("div",{style:{height:300,overflow:"auto"},children:[(0,z.jsxs)("div",{children:["有",null==le?void 0:le.length,"张试卷在试卷库重复,是否需要覆盖原来的试卷?"]}),null==le?void 0:le.map((function(e){return(0,z.jsxs)("div",{style:{marginTop:25},children:[(0,z.jsxs)("div",{children:["试卷:",null==e?void 0:e.origin_exercise_nam]}),(0,z.jsxs)("div",{children:["原试卷:",(0,z.jsx)("a",{href:"/paperlibrary/see/".concat(null==e?void 0:e.examination_bank_id,"?defaultActiveKey=0"),target:"_blank",children:null==e?void 0:e.examination_bank_name})]})]})}))]}),(0,z.jsxs)("div",{style:{textAlign:"end"},children:[(0,z.jsx)(M.ZP,{style:{height:30},onClick:c()(i()().mark((function e(){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.ZP)("/api/courses/".concat(F.id,"/exercises/join_examination_banks.json"),{method:"post",body:{check_ids:a()(U),update:1}});case 2:0===(null==(n=e.sent)?void 0:n.status)&&(v.ZP.info("覆盖成功"),ue([]));case 4:case"end":return e.stop()}}),e)}))),children:"覆盖原来的试卷"}),(0,z.jsx)(M.ZP,{type:"primary",onClick:c()(i()().mark((function e(){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.ZP)("/api/courses/".concat(F.id,"/exercises/join_examination_banks.json"),{method:"post",body:{check_ids:a()(U)}});case 2:0===(null==(n=e.sent)?void 0:n.status)&&(v.ZP.info("形成成功"),ue([]));case 4:case"end":return e.stop()}}),e)}))),style:{marginLeft:10,height:30},children:"形成新试卷"})]})]})]})}))},8430:function(e,n,t){t.d(n,{Z:function(){return f}});var s=t(27424),i=t.n(s),r=t(67294),a=t(68508),o=t(11486),c=t(84567),l=t(71577),u=t(85418),d="bottomControlContainer___woAeo",x="buttonWrap___iRw4K",m="moveCategory___oiQqw",p=t(7),h=t(80882),j=t(85893),f=function(e){var n=e.buttonDataSource,t=e.onButtonClick,s=e.useBatchStatus,f=e.allSelect,g=e.setAllSelect,v=e.selectArrs,_=e.onMenuClick,y=e.setSeleArr,b=e.catalogue,M=e.addCatalogue,N=(0,r.useState)(!1),k=i()(N,2),w=k[0],L=k[1],I=(0,r.useState)(""),S=i()(I,2),C=S[0],Z=S[1];console.log("---",b);var D=(0,j.jsx)("div",{className:m,onMouseLeave:function(e){return L(!1)},children:(0,j.jsxs)(a.Z,{onClick:_,style:{maxHeight:300,width:240,overflow:"auto"},children:[(0,j.jsx)("li",{className:"ant-menu-item multi-llipsis1e ant-menu-item-only-child",children:(0,j.jsx)(o.Z,{onChange:function(e){Z(e.target.value)}})}),null==b?void 0:b.map((function(e,n){var t;if(!(""!==C&&e.category_name.indexOf(C)<0))return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(a.Z.Item,{className:"multi-llipsis1e",children:e.category_name},e.category_id),null==e||null===(t=e.third_category)||void 0===t?void 0:t.map((function(e){return(0,j.jsx)(a.Z.Item,{style:{marginLeft:20},className:"multi-llipsis1e",children:e.category_name},e.category_id)}))]})})),M&&(0,j.jsx)("li",{className:"ant-menu-item multi-llipsis1e ant-menu-item-only-child",onClick:M,children:"新建子目录..."})]})});return(0,j.jsxs)("div",{className:d,children:[(0,j.jsxs)("div",{children:[(0,j.jsx)("div",{children:(0,j.jsxs)(c.Z,{checked:f,onChange:g,children:["全选本页(",v.length,""]})}),(0,p.GJ)()&&n.map((function(e){return(0,j.jsx)("div",{children:(0,j.jsx)(l.ZP,{type:"primary",icon:e.icon,className:x,onClick:function(){return t(e)},children:e.name})},e.name)})),(0,p.GJ)()&&(M||b)&&(0,j.jsx)("div",{children:(0,j.jsx)(u.Z,{open:w,placement:"topLeft",autoAdjustOverflow:!1,dropdownRender:function(){return D},getPopupContainer:function(e){return e.parentNode},children:(0,j.jsx)("span",{className:"ant-dropdown-link",onMouseEnter:function(e){return L(!0)},children:(0,j.jsx)(l.ZP,{type:"primary",className:x,icon:(0,j.jsx)("i",{className:"iconfont icon-yidongmulu"}),children:(0,j.jsxs)("span",{children:["移动到目录 ",(0,j.jsx)(h.Z,{})]})})})})})]}),(0,j.jsx)("div",{children:(0,j.jsx)(l.ZP,{type:"primary",ghost:!0,onClick:function(){s(!1),y([])},children:"取消操作"})})]})}},13729:function(e,n,t){t.d(n,{Z:function(){return x}});t(67294);var s=t(85418),i=t(68508),r=t(83062),a=t(11486),o="searchSortControllerContainer___Xca1m",c="btn___sNJPX",l="btnSort___Fx9OM",u="tips___LrmpR",d=t(85893),x=function(e){e.isAdmin,e.dataSource,e.batchStatus;var n=e.SortMenuName,t=e.setSortMenuName,x=e.onSearch,m=e.onSort,p=(e.onBatch,e.SortMenus),h="默认排序"===n;return(0,d.jsxs)("div",{className:o,children:[!(null==p||!p.length)&&(0,d.jsx)("div",{children:(0,d.jsx)(s.Z,{dropdownRender:function(){return(0,d.jsx)(i.Z,{selectedKeys:[n],children:p.map((function(e){return(0,d.jsx)(i.Z.Item,{onClick:function(){return t((n=e).name),void m(n);var n},children:e.name},e.name)}))})},children:(0,d.jsx)("div",{children:(0,d.jsxs)("span",{className:"".concat(c," ").concat(h?l:""),children:[(0,d.jsx)("i",{className:"iconfont icon-paixu font14 mr5"}),n]})})})}),h&&(0,d.jsx)(r.Z,{title:"优先按照调整排序结果展示,未设置排序时,按照创建时间降序排列",children:(0,d.jsx)("span",{className:u,children:(0,d.jsx)("i",{className:"iconfont icon-a-wenhaobeifen2"})})}),(0,d.jsx)(a.Z.Search,{allowClear:!0,placeholder:"请输入名称进行搜索",onSearch:x,style:{width:220,marginLeft:"auto"}})]})}},15582:function(e,n,t){t.d(n,{Z:function(){return l}});t(67294);var s=t(71230),i=t(15746),r=t(68508),a=t(85418),o={tabMenuContainer:"tabMenuContainer___uf5IP",control:"control___GheLs",iconH:"iconH___Wzw_r",selectBtn:"selectBtn___mfEnI"},c=t(85893),l=function(e){var n=e.isLoading,t=e.addText,l=e.tabDataSource,u=e.isAdmin,d=e.defaultSelectedKeys,x=e.onTabMenuClick,m=e.getDropdownMenu,p=e.showControlButton,h=e.buttonText,j=e.buttonIcon,f=void 0===j?"icon-tianjiadaohang":j,g=e.extraNode,v=e.onButtonClick,_=void 0===v?function(){}:v;return(0,c.jsx)("div",{className:o.tabMenuContainer,children:(0,c.jsxs)(s.Z,{children:[(0,c.jsx)(i.Z,{flex:"1",children:(0,c.jsx)(r.Z,{onSelect:function(e){return n?{}:x(e)},mode:"horizontal",selectedKeys:d,children:l.map((function(e){return(0,c.jsxs)(r.Z.Item,{children:[(0,c.jsx)("span",{className:"c-grey-666",children:e.name}),void 0!==e.total&&u&&(0,c.jsx)("span",{className:"c-grey-999 ml20",children:e.total||0})]},"number"==typeof e.index?e.index:e.id)}))})}),u&&(0,c.jsx)(i.Z,{className:"mr20",children:(0,c.jsxs)("div",{className:o.control,children:[(0,c.jsx)("div",{className:o.extra,children:g}),p&&(0,c.jsxs)("span",{onClick:_,style:{cursor:"pointer"},className:o.selectBtn,children:[(0,c.jsx)("span",{children:(0,c.jsx)("i",{className:"iconfont ".concat(f)})}),(0,c.jsx)("span",{children:h})]}),!!m&&(0,c.jsx)(a.Z,{className:"ml10",dropdownRender:m,children:(0,c.jsxs)("span",{className:o.selectBtn,children:[(0,c.jsx)("span",{children:(0,c.jsx)("i",{className:"iconfont icon-tianjiadaohang"})}),(0,c.jsx)("span",{children:t||"创建试卷"})]})})]})})]})})}},56606:function(e,n,t){t(67294);Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;n.Z="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGZpbGw9IiNGQ0IwNDEiIGN4PSI3IiBjeT0iNyIgcj0iNyIvPjxwYXRoIGQ9Ik03LjUzMSA5LjYzOGEuNjE2LjYxNiAwIDEgMS0xLjIzMSAwdi0uMDJhLjYxNi42MTYgMCAxIDEgMS4yMzEgMHYuMDJabTAtMi4yNWEuNjE2LjYxNiAwIDEgMS0xLjIzMSAwVjQuMTE3YS42MTYuNjE2IDAgMSAxIDEuMjMxIDB2My4yNzNaIiBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L2c+PC9zdmc+"}}]);