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...

11 lines
104 KiB

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[4105],{13748:function(Pl,Oe,E){E.d(Oe,{Z:function(){return Re}});var l=E(3113),ve=E(59301),Ne=Object.defineProperty,ce=Object.defineProperties,Pe=Object.getOwnPropertyDescriptors,Ee=Object.getOwnPropertySymbols,te=Object.prototype.hasOwnProperty,he=Object.prototype.propertyIsEnumerable,de=(G,se,X)=>se in G?Ne(G,se,{enumerable:!0,configurable:!0,writable:!0,value:X}):G[se]=X,ke=(G,se)=>{for(var X in se||(se={}))te.call(se,X)&&de(G,X,se[X]);if(Ee)for(var X of Ee(se))he.call(se,X)&&de(G,X,se[X]);return G},D=(G,se)=>ce(G,Pe(se)),x=(G,se)=>{var X={};for(var ge in G)te.call(G,ge)&&se.indexOf(ge)<0&&(X[ge]=G[ge]);if(G!=null&&Ee)for(var ge of Ee(G))se.indexOf(ge)<0&&he.call(G,ge)&&(X[ge]=G[ge]);return X},$e=(G,se,X)=>new Promise((ge,Ke)=>{var xe=K=>{try{Fe(X.next(K))}catch(Be){Ke(Be)}},Me=K=>{try{Fe(X.throw(K))}catch(Be){Ke(Be)}},Fe=K=>K.done?ge(K.value):Promise.resolve(K.value).then(xe,Me);Fe((X=X.apply(G,se)).next())});const Re=G=>{var se=G,{children:X}=se,ge=x(se,["children"]);const[Ke,xe]=(0,ve.useState)(!1);return ve.createElement(l.ZP,D(ke({},ge),{loading:Ke,onClick:Me=>$e(void 0,null,function*(){try{xe(!0),yield ge.onClick(Me),xe(!1)}catch(Fe){console.error(Fe),xe(!1)}})}),X)}},34437:function(Pl,Oe,E){E.d(Oe,{y:function(){return ve}});var l=E(59301);const ve=Ne=>{(0,l.useEffect)(()=>{if(Ne){const ce=Ee=>{Ee.key==="F12"&&(Ee.preventDefault(),console.log("F12\u88AB\u7981\u7528"))},Pe=Ee=>{Ee.preventDefault()};return document.addEventListener("keydown",ce),document.addEventListener("contextmenu",Pe),()=>{document.removeEventListener("keydown",ce),document.removeEventListener("contextmenu",Pe)}}},[Ne])}},17324:function(Pl,Oe,E){E.r(Oe),E.d(Oe,{default:function(){return Au}});var l=E(59301),ve=E(29540),Ne=E(15845),ce=E.n(Ne),Pe=E(31797),Ee=E(78241),te=E(43418),he=E(98135),de=E(8591),ke=E(93948),D=E(95237),x=E(43604),$e=E(5112),Re=E(24905),G=E(6848),se=E(71418),X=E(3113),ge=E(46400),Ke=E(28396),xe=E(38391),Me=E(93659),Fe=E(53358),K=E(29126),Be=E(80328),Le=E(59301),We=(u,r,i)=>new Promise((q,T)=>{var L=g=>{try{Z(i.next(g))}catch(N){T(N)}},S=g=>{try{Z(i.throw(g))}catch(N){T(N)}},Z=g=>g.done?q(g.value):Promise.resolve(g.value).then(L,S);Z((i=i.apply(u,r)).next())}),Ae=({id:u,startRecording:r,startScreenshot:i,onBack:q,onSuccuss:T,timeInSeconds:L=[1,6,11,16,21,26,31,41,51,61,71,81,91,101,111,121,151,181,211,241,271,361,421,481,541,601,661]})=>{const S=(0,l.useRef)(null),Z=(0,l.useRef)(null),g=(0,l.useRef)(null),N=(0,l.useRef)(null),k=(0,l.useRef)(!0),A=(0,l.useRef)(""),[R,J]=(0,l.useState)(null);(0,l.useEffect)(()=>{r?w():I()},[r]),(0,l.useEffect)(()=>{i?J(0):(clearTimeout(N.current),J(null),A.current="")},[i]),(0,l.useEffect)(()=>(typeof R=="number"&&(L!=null&&L.includes(R)&&ne(),R<=720&&(N.current=setTimeout(()=>{J(R+1)},1e3))),()=>{clearTimeout(N.current)}),[R]);const oe=($="\u672A\u5171\u4EAB\u6574\u4E2A\u5C4F\u5E55\uFF0C\u7981\u6B62\u4F5C\u7B54\uFF01")=>We(void 0,null,function*(){de.ZP.warning($),setTimeout(()=>{q()},1e3)}),w=()=>We(void 0,null,function*(){var $,Q,ie,me,M,pe;if(!(0,K.i7)()){oe("\u8BF7\u4F7F\u7528\u8C37\u6B4C\u6D4F\u89C8\u5668\u7B54\u9898");return}if(S.current){de.ZP.warning("\u6B63\u5728\u5F55\u5236\u4E2D");return}k.current=!0;try{let ae;if((0,K.WX)())ae=yield navigator.mediaDevices.getUserMedia({audio:{mandatory:{chromeMediaSource:"desktop"}},video:{mandatory:{chromeMediaSource:"desktop"}}});else if(ae=yield navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"monitor"}}),((ie=(Q=($=ae==null?void 0:ae.getVideoTracks())==null?void 0:$[0])==null?void 0:Q.getSettings())==null?void 0:ie.displaySurface)!=="monitor"){I(),oe();return}S.current=ae,"srcObject"in Z.current?Z.current.srcObject=S.current:Z.current.src=URL.createObjectURL(S.current),yield new Promise(qe=>{Z.current.addEventListener("loadedmetadata",()=>{qe()})}),(pe=(M=(me=S.current)==null?void 0:me.getVideoTracks())==null?void 0:M[0])==null||pe.addEventListener("ended",function(){k.current&&oe()}),Z.current.play(),T()}catch(ae){oe("\u5C4F\u5E55\u5F55\u5236\u529F\u80FD\u9519\u8BEF\uFF0C\u8BF7\u68C0\u67E5\u540E\u518D\u5171\u4EAB\u6574\u4E2A\u5C4F\u5E55\uFF0C\u5426\u5219\u65E0\u6CD5\u4F5C\u7B54")}}),I=()=>{var $;k.current=!1;const Q=($=S.current)==null?void 0:$.getTracks();Q==null||Q.forEach(ie=>{ie.stop()}),S.current=null},U=$=>{const Q=$.split(",")[1],ie=$.split(",")[0].split(":")[1].split(";")[0],me=[...atob(Q)],M=new Uint8Array(me.map(pe=>pe.charCodeAt(0)));return new Blob([M],{type:ie})},ue=()=>We(void 0,null,function*(){const $=yield(0,Be.ZP)(`/api/exercises/${u}/exercise_user_screens.json`,{method:"post"});$.status===0&&(A.current=$.exercise_abnormity_id,J(0))}),ne=()=>We(void 0,null,function*(){const $=g.current.getContext("2d");g.current.width=Z.current.videoWidth,g.current.height=Z.current.videoHeight,$.drawImage(Z.current,0,0,g.current.width,g.current.height);const Q=g.current.toDataURL("image/jpeg"),ie=U(Q),me=new File([ie],"canvas_image.jpg",{type:"image/jpeg"}),M=new FormData;M.append("file",me);const pe=yield(0,Be.ZP)(`/api/exercises/${u}/exercise_user_screens/check.json`,{method:"get"});if((pe==null?void 0:pe.status)===0){const ae=yield(0,Be.ZP)("/api/attachments.json",{method:"post",body:M},!0);if(ae!=null&&ae.id){const qe=yield(0,Be.ZP)(`/api/exercises/${u}/exercise_user_screens.json`,{method:"post",body:{attachment_id:ae==null?void 0:ae.id,exercise_abnormity_id:A.current}});qe.status===0&&(A.current=qe.exercise_abnormity_id)}}});return Le.createElement(Le.Fragment,null,Le.createElement("video",{ref:Z,muted:!0,className:"hide"}),Le.createElement("canvas",{id:"canvas",ref:g,className:"hide"}))},ze=E(99232),Ue=E.n(ze),a={flex_box_center:"flex_box_center___ariLt",flex_space_between:"flex_space_between___MC6sH",flex_box_vertical_center:"flex_box_vertical_center___tJHfy",flex_box_center_end:"flex_box_center_end___AfB_t",flex_box_column:"flex_box_column___xX4Fj",bg:"bg___nHBEZ",wrapper:"wrapper___TZKl8",exerciseAlert:"exerciseAlert___QUMwm",title:"title___rj6Q0",content:"content___Te7Wz",baseMargin:"baseMargin___BRmsh",noWrap:"noWrap___X6AS3",singleItem:"singleItem___GkaDR",questionIcons:"questionIcons___XoGYC",green:"green___iIYnV",orange:"orange___EIhiL",greenTip:"greenTip___WwiUh",redTip:"redTip___aWSt4",orangeTip:"orangeTip___j5g_H",pollDesc:"pollDesc___yDT2Q",answered:"answered___d2hE7",unanswer:"unanswer___AdOhE",anchor:"anchor___z3CaP",answerFlag:"answerFlag___wwTKa",flagActive:"flagActive___piG3D",flagHalf:"flagHalf___E29dd",answerStudentFlag:"answerStudentFlag___HRVt8",answerStudentActive:"answerStudentActive___kM6r4",questionItem:"questionItem___q6Hgu",questionScore:"questionScore___RW5tm",itemType:"itemType___pPqzT",itemFlag:"itemFlag___j5TSr",answerWrap:"answerWrap___G9dnn",answerSubjective:"answerSubjective___LRVKJ",otherInput:"otherInput___SxNAw",submitButton:"submitButton___zPo7H",randomFlag:"randomFlag___TOZ2H",answerTrue:"answerTrue___fgIW0",answerFalse:"answerFalse___gAQD8",answerHalf:"answerHalf___h40sX",renderHtml:"renderHtml___UerV1",simpleText:"simpleText___ZKx7o",answerYes:"answerYes___AA0oM",answerNo:"answerNo___gMGLy",answerInfo:"answerInfo___tB4Wz",answerProgress:"answerProgress___CbmXy",answerSheetWrap:"answerSheetWrap___aPipx",answerSheetQuestionTitle:"answerSheetQuestionTitle___P18Ss",answerSheet:"answerSheet___yhxK1",answerSheetItem:"answerSheetItem___DIH2V",qindex:"qindex___XuKA8",markIcon:"markIcon___ZTkqb",active:"active___WSsrt",yes:"yes___knuOK",no:"no___gv_cs",bf:"bf___pJfi5",partialActive:"partialActive___K6lsa",selected:"selected___grFyM",countDown:"countDown___OzcWL",cnText:"cnText___TvFjV",red:"red___Mge1h",refreshBtn:"refreshBtn___lK1MX",fold:"fold___id0EJ",cardList:"cardList___xKhMX",withQrcode:"withQrcode___qphZK",iframe:"iframe___pMMQx",eduTip:"eduTip___hXWhK",eduQrcode:"eduQrcode____qxcx",eduVideo:"eduVideo___mufWJ",eduUsername:"eduUsername___tiufh",startAnswer:"startAnswer___AA7n5",eduSubmit:"eduSubmit___UPIsJ",eduTitle:"eduTitle___jCJrO",wrpAnswer:"wrpAnswer___AVK1Y",simpleMd:"simpleMd___ZGbXj",videomodal:"videomodal___bYarH",mainPart:"mainPart___Fqvw7",userInfoText:"userInfoText___nqL8p",answerSheetBottom:"answerSheetBottom___yXf5u",tooltipWrap:"tooltipWrap___AxG9B",leftPart:"leftPart___P4Ook",rightPart:"rightPart___De4P3",questionPart:"questionPart___GTq66",questionTypeTitle:"questionTypeTitle___r6Fo9",questionTypeInfo:"questionTypeInfo___JfpWv",toIframeBtn:"toIframeBtn___gRKtn",bottom:"bottom___coSlv",markBtn:"markBtn___ZCLGF",changeButton:"changeButton___sBTjl",prevBtn:"prevBtn___lgCPG",analysisWrap:"analysisWrap___JoCnb",greyBg:"greyBg___vgesc",fixHeader:"fixHeader___RoNxE",exerciseTitle:"exerciseTitle___Dtp56",commitModal:"commitModal___zqvNA",commitItem:"commitItem___mjYF6",commitInfoLabel:"commitInfoLabel___KtIjW",commitInfoValue:"commitInfoValue___DCyRn",cameraHeader:"cameraHeader___Pqhwb",dottedLineWrapper:"dottedLineWrapper___ONO9c",leftHalfCircle:"leftHalfCircle___RNJN7",dottedLine:"dottedLine___qWy4W",rightHalfCircle:"rightHalfCircle___s3_hr",orangeNum:"orangeNum___IYnup",teachAnalysis:"teachAnalysis___FH6fk",teachAnalysisModal:"teachAnalysisModal___RcKVp"},Y=E(17583),ee=E(96837),rl=E(34314),ye=E(74927),Je=E(36138),le=E(53815),Ve=E(79058);const Xe={0:"c-red-ee4",1:"c-green"};var ql=({item:u,answerData:r,isEducation:i,sign:q,onBlur:T=()=>{}})=>{var L,S,Z,g,N,k;const A=(0,l.useRef)(""),[R,J]=(0,l.useState)(),[oe,w]=(0,l.useState)(!1),[I,U]=(0,l.useState)(i||!1),ue=(0,l.useRef)(),ne=()=>{clearInterval(ue.current),ue.current=setInterval(()=>{oe&&T(A.current,!0)},10*1e3)},$=Q=>{T(A.current);let ie="\u786E\u5B9A\u79BB\u5F00\u6B64\u9875\u9762\u5417?\u6B64\u9875\u6570\u636E\u53EF\u80FD\u4F1A\u4E22\u5931";return(Q||window.event).returnValue=ie,ie};return(0,l.useEffect)(()=>{console.log("isFocus:",oe),oe&&ne()},[oe]),(0,l.useEffect)(()=>{J(u==null?void 0:u.a_flag)},[u==null?void 0:u.a_flag]),(0,l.useEffect)(()=>()=>{clearInterval(ue.current)},[]),l.createElement("div",null,((L=r==null?void 0:r.exercise)==null?void 0:L.user_exercise_status)===1?l.createElement("div",{className:"mb20"},l.createElement(D.Z,{justify:"space-between"},l.createElement(x.Z,null,"\u6211\u7684\u7B54\u6848"),((0,ee.GJ)()||(0,ee.dE)()&&((S=r==null?void 0:r.exercise)==null?void 0:S.user_exercise_status)>0&&((Z=r==null?void 0:r.exercise)==null?void 0:Z.open_score))&&l.createElement(x.Z,null,l.createElement(D.Z,{justify:"end",className:"mb20",align:"middle"},l.createElement("span",{className:"font14",style:{color:"#6A7283"}},"\u5F97\u5206"),l.createElement("span",{className:"font14 ml10"},(u==null?void 0:u.user_score)&&l.createElement("span",null,l.createElement("span",{className:Xe[Number(u==null?void 0:u.answer_status)]||"c-orange-ff9"},u==null?void 0:u.user_score),l.createElement("span",{style:{marginLeft:5,color:"#6A7283"}},"\u5206")),!(u!=null&&u.user_score)&&l.createElement("span",{className:"c-red"},"\u672A\u8BC4"))))),l.createElement("div",{className:a.simpleText},l.createElement(le.Z,{value:(g=u==null?void 0:u.user_answer)==null?void 0:g[0]}))):l.createElement("div",{className:u.user_score&&(u.user_score===u.question_score?"c-green":"c-red")},I?l.createElement(Ve.Z,{watch:!0,isFocus:!0,defaultValue:(N=u==null?void 0:u.user_answer)==null?void 0:N[0],id:u==null?void 0:u.question_id,className:"mt20",onChange:Q=>{A.current=Q,w(!0)},onBlur:()=>{setTimeout(()=>{T(A.current)},200),clearInterval(ue.current),w(!1)}}):l.createElement("div",{onClick:()=>{var Q;if(!u.repeat_answer&&((Q=u==null?void 0:u.user_answer)==null?void 0:Q.length)>0&&u.ques_status!==0){de.ZP.warning("\u8BE5\u9898\u4E0D\u5141\u8BB8\u518D\u4FEE\u6539\u7B54\u6848");return}q.current=!0,U(!0)},className:a.startAnswer},l.createElement("div",{className:"c-blue"},"\u70B9\u51FB\u5F00\u59CB\u4F5C\u7B54"))),(0,ee.dE)()&&(u==null?void 0:u.standard_answer)&&l.createElement("div",{className:a.analysisWrap},l.createElement("div",{className:a.greyBg},l.createElement(D.Z,{className:"mb20",align:"middle"},l.createElement(x.Z,{className:"font14 mr10",style:{color:"#6A7283"}},"\u3010\u7B54\u6848\u3011"),l.createElement(x.Z,null,l.createElement(le.Z,{value:(k=u==null?void 0:u.standard_answer)==null?void 0:k[0]}))),l.createElement(D.Z,null,l.createElement("span",{className:"font14 mr10",style:{color:"#6A7283"}},"\u3010\u89E3\u6790\u3011"),l.createElement(le.Z,{className:a.renderHtml,value:u==null?void 0:u.analysis})))))},He=E(57809),yl=({item:u,answerData:r,isEducation:i,onBlur:q=()=>{}})=>{var T,L,S,Z;const g=(0,l.useRef)(""),[N,k]=(0,l.useState)(),[A,R]=(0,l.useState)(!1),[J,oe]=(0,l.useState)(!1),[w,I]=(0,l.useState)(i||!1),[U,ue]=(0,l.useState)(0),ne=(0,l.useRef)(u.kp_content||""),$=(0,l.useRef)(u.kp_clazz),Q=(0,l.useRef)(),ie=(0,l.useMemo)(()=>{var M,pe;return(pe=(M=g.current)==null?void 0:M.replace(/[\n|\r|\t]/g,""))==null?void 0:pe.length},[g.current]),me=()=>{clearInterval(Q.current),Q.current=setInterval(()=>{J&&q(g.current,ne.current,$.current)},30*1e3)};return(0,l.useEffect)(()=>{console.log("isFocus:",J),me()},[J]),(0,l.useEffect)(()=>{k(u==null?void 0:u.a_flag)},[u==null?void 0:u.a_flag]),(0,l.useEffect)(()=>()=>{clearInterval(Q.current)},[]),l.createElement("div",null,((T=r==null?void 0:r.exercise)==null?void 0:T.user_exercise_status)===1?l.createElement("div",null,l.createElement("div",{className:"mt30"},l.createElement("strong",null,"\u4F5C\u6587\u9898\u76EE\uFF1A"),l.createElement("br",null),l.createElement(he.default,{disabled:!0,className:"mt10",value:ne.current,onChange:M=>{ne.current=M.target.value,ue(U+1)},onBlur:()=>{q(g.current,ne.current,$.current),oe(!1)}})),l.createElement("div",{className:"mt30"},l.createElement("strong",null,"\u4F5C\u54C1\u7C7B\u578B\uFF1A"),l.createElement("br",null),l.createElement(He.default,{disabled:!0,className:"mt10 w100",placeholder:"\u8BF7\u9009\u62E9\u4F5C\u54C1\u7C7B\u578B",value:$.current,onChange:M=>{$.current=M,ue(U+1)},onBlur:()=>{q(g.current,ne.current,$.current),oe(!1)}},l.createElement(He.default.Option,{key:1,value:"\u79D1\u666E"},"\u79D1\u666E"),l.createElement(He.default.Option,{key:2,value:"\u79D1\u5E7B"},"\u79D1\u5E7B"))),l.createElement("p",{className:"mt10 mb0"},"\u4F5C\u54C1\u5185\u5BB9\uFF1A"),l.createElement("div",{className:a.simpleText},l.createElement(le.Z,{value:(L=u==null?void 0:u.user_answer)==null?void 0:L[0]}))):l.createElement("div",null,l.createElement("div",{className:"mt30"},l.createElement("strong",null,"\u4F5C\u6587\u9898\u76EE\uFF1A"),l.createElement("br",null),l.createElement(he.default,{className:"mt10",maxLength:60,onBlur:()=>q(g.current,ne.current,$.current),placeholder:"\u8BF7\u8F93\u5165\u4F5C\u6587\u9898\u76EE(\u6700\u591A60\u4E2A\u5B57)",value:ne.current,onChange:M=>{ne.current=M.target.value,ue(U+1)}})),l.createElement("div",{className:"mt30"},l.createElement("strong",null,"\u4F5C\u6587\u7C7B\u578B\uFF1A"),l.createElement("br",null),l.createElement(He.default,{className:"mt10 w100",placeholder:"\u8BF7\u9009\u62E9\u4F5C\u54C1\u7C7B\u578B",value:$.current,onChange:M=>{$.current=M,q(M.current,ne.current,$.current),ue(U+1)}},l.createElement(He.default.Option,{key:1,value:"\u79D1\u666E"},"\u79D1\u666E"),l.createElement(He.default.Option,{key:2,value:"\u79D1\u5E7B"},"\u79D1\u5E7B"))),l.createElement("div",{className:"mt30 mb20"},l.createElement("div",{className:u.user_score&&(u.user_score===u.question_score?"c-green":"c-red")},l.createElement("strong",null,"\u4F5C\u6587\u5185\u5BB9\uFF1A"),l.createElement("br",null),l.createElement("div",{className:"mt10 relative"},l.createElement("span",{className:"c-blue",style:{position:A?"fixed":"absolute",top:A?61:4,left:10,zIndex:106}},"\u5DF2\u8F93\u5165",ie,"\u5B57"),w?l.createElement(Ve.Z,{className:a.simpleMd,disablePaste:!0,hidetoolBar:i,height:i?"60vh":150,isFocus:!0,defaultValue:(S=u==null?void 0:u.user_answer)==null?void 0:S[0],id:u==null?void 0:u.question_id,onFullScreen:M=>R(M),onChange:M=>{g.current=M,oe(!0),ue(U+1)},onBlur:()=>{q(g.current,ne.current,$.current),oe(!1)}}):l.createElement("div",{onClick:()=>I(!0),className:a.startAnswer},l.createElement("div",{className:"c-blue"},"\u70B9\u51FB\u5F00\u59CB\u4F5C\u7B54")))))),(0,ee.dE)()&&(u==null?void 0:u.standard_answer)&&l.createElement("div",null,l.createElement("p",{className:"mt10 mb0"},"\u53C2\u8003\u7B54\u6848\uFF1A"),l.createElement("div",{style:{border:"1px solid #eee",background:"#f5f5f5",borderRadius:4,padding:5}},l.createElement(le.Z,{value:(Z=u==null?void 0:u.standard_answer)==null?void 0:Z[0]}))))},Ql=E(79817),we=E(14491),Sl=E(47518),dn={score:"score___mcGn7",wrap:"wrap___h11sQ"},Yl=({score:u})=>u?l.createElement("span",{className:dn.wrap},"\u5F97\u5206",l.createElement("span",{className:`${dn.score} ml10 mr5`},u),"\u5206"):l.createElement("span",{className:"c-red"},"\u672A\u8BC4"),_e={flex_box_center:"flex_box_center___xK64P",flex_space_between:"flex_space_between___BNBCA",flex_box_vertical_center:"flex_box_vertical_center___ConJK",flex_box_center_end:"flex_box_center_end___L08sz",flex_box_column:"flex_box_column___hvk0E",shixunWrp:"shixunWrp___FTFC6",fill:"fill___H_Qd6",index:"index___PaSVJ",success:"success___fz_F7",fail:"fail___ftXSv",fillInput:"fillInput___q_sSb",shixunWrapper:"shixunWrapper___toGqF",score:"score___AsYGZ",name:"name___hawfX",programWrapper:"programWrapper___zVQPT",desc:"desc___MFIu5",content:"content___QuE41",analysisWrap:"analysisWrap___qGPzJ",greyBg:"greyBg___FIDIB"},Tt=Object.defineProperty,Ot=Object.defineProperties,kt=Object.getOwnPropertyDescriptors,_n=Object.getOwnPropertySymbols,$t=Object.prototype.hasOwnProperty,Rt=Object.prototype.propertyIsEnumerable,vn=(u,r,i)=>r in u?Tt(u,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):u[r]=i,zl=(u,r)=>{for(var i in r||(r={}))$t.call(r,i)&&vn(u,i,r[i]);if(_n)for(var i of _n(r))Rt.call(r,i)&&vn(u,i,r[i]);return u},Mt=(u,r)=>Ot(u,kt(r));const bs={0:"c-red-ee4",1:"c-green"};var jt=({item:u,answerData:r,exerciseId:i,coursesId:q})=>{var T,L,S,Z,g;const[N,k]=(0,l.useState)([]),[A,R]=(0,l.useState)([]);(0,l.useEffect)(()=>{var w,I,U,ue,ne,$,Q,ie,me,M,pe,ae,qe;if(!((w=u==null?void 0:u.shixun_details)!=null&&w.length))return;let hl=[],xl=[];for(let Se=0;Se<((I=u==null?void 0:u.shixun_details)==null?void 0:I.length);Se++){for(let je=0;je<(u==null?void 0:u.shixun_details[Se].stage_list.length);je++){let il=u==null?void 0:u.shixun_details[Se].stage_list[je];hl.push(zl(zl({},il),{operation:($=(ne=(ue=(U=u==null?void 0:u.shixun_details)==null?void 0:U[Se])==null?void 0:ue.shixun_detail)==null?void 0:ne[0])==null?void 0:$.game_identifier,is_jupyter:u==null?void 0:u.is_jupyter,is_jupyter_lab:u==null?void 0:u.is_jupyter_lab}))}if((ie=(Q=u==null?void 0:u.shixun_details)==null?void 0:Q[Se])!=null&&ie.shixun_detail){const je=(pe=(M=(me=u==null?void 0:u.shixun_details)==null?void 0:me[Se])==null?void 0:M.shixun_detail)==null?void 0:pe[0],il=(qe=(ae=u==null?void 0:u.shixun_details[Se].stage_list)==null?void 0:ae.find(Fl=>(Fl==null?void 0:Fl.game_identifier)===(je==null?void 0:je.game_identifier)))==null?void 0:qe.user_score;xl.push(Mt(zl({},je),{user_score:il}))}}R(xl),k(hl)},[u==null?void 0:u.shixun_details]);const J=[{title:"\u5173\u5361",dataIndex:"position",key:"position",align:"center"},{title:"\u4EFB\u52A1\u540D\u79F0",dataIndex:"name",key:"name",align:"center",render:w=>l.createElement("span",{className:"overflowHidden1",style:{maxWidth:"400px"},title:w&&w.length>25?w:""},w)},{title:"\u8BC4\u6D4B\u6B21\u6570",dataIndex:"evaluate_count",key:"evaluate_count",align:"center",render:(w,I)=>l.createElement("span",null,I.evaluate_count?I.evaluate_count:l.createElement("span",{className:"color-grey-9"},"--"))},{title:"\u5B8C\u6210\u65F6\u95F4",key:"endTime",dataIndex:"endTime",align:"center",render:(w,I)=>{let U=!1;return I.finished_time&&(r!=null&&r.exercise)&&(r!=null&&r.exercise_answer_user)&&((r==null?void 0:r.exercise.time)===-1?U=Ue()(r==null?void 0:r.exercise.end_time).isBefore(I.finished_time):U=Ue()(r==null?void 0:r.exercise_answer_user.start_at).add(r==null?void 0:r.exercise.time,"m").isBefore(I.finished_time)),l.createElement("span",null,I.finished_time||l.createElement("span",{className:"c-grey-999"},"--"),l.createElement("span",{className:"c-orange-ff9 "},U?"\uFF08\u5DF2\u8D85\u65F6\uFF09":""))}},{title:"\u8017\u65F6",dataIndex:"time_consuming",key:"time_consuming",align:"center",render:(w,I)=>l.createElement("span",null,I.time_consuming||l.createElement("span",{className:"color-grey-9"},"--"))},{title:"\u67E5\u770B\u7B54\u6848",dataIndex:"view_answer",key:"view_answer",align:"center",render:(w,I)=>l.createElement("span",null,I.view_answer?"\u5DF2\u67E5\u770B":"\u672A\u67E5\u770B")},{title:"\u5F97\u5206",dataIndex:"user_score",key:"user_score",align:"center",render:w=>l.createElement("span",{style:{color:"#FA6400"}},w,"\u5206")},{title:"\u64CD\u4F5C",dataIndex:"operation",key:"operation",align:"center",render:(w,I,U)=>w&&!I.is_jupyter&&!I.is_jupyter_lab?l.createElement(Ql.default,{affix:!1,className:"mt10"},l.createElement(Ql.default.Link,{href:`#challenge_${u==null?void 0:u.question_id}${U}`,title:l.createElement("span",{style:{color:"#0152d9",fontSize:14}},"\u67E5\u770B")})):l.createElement("span",{className:"c-grey-999"},"--")}];console.log(A);const oe={selectOnLineNumbers:!0,readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1};return l.createElement("div",null,((T=u==null?void 0:u.shixun)==null?void 0:T.length)>0&&l.createElement("div",{className:_e.shixunWrapper},(L=u==null?void 0:u.shixun)==null?void 0:L.map(function(w,I){return l.createElement(D.Z,{className:"mb20",justify:"space-between"},l.createElement(x.Z,{flex:"1"},l.createElement("span",{className:_e.score},"(",w.challenge_score,"\u5206)"),l.createElement("span",{className:_e.name},w.challenge_name," ")),l.createElement(x.Z,null,!w.answer_status&&l.createElement("span",{className:"font14",style:{color:"#FA6400"}},"\u672A\u5B8C\u6210"),!!w.answer_status&&l.createElement("span",{className:"font14",style:{color:"#37AD83"}},"\u5DF2\u5B8C\u6210")))})),((S=r==null?void 0:r.exercise)==null?void 0:S.student_commit_status)!==0||((Z=r==null?void 0:r.exercise)==null?void 0:Z.user_exercise_status)!==0?l.createElement(l.Fragment,null,!!(N!=null&&N.length)&&l.createElement("div",null,l.createElement(D.Z,{justify:"space-between",className:"mb10",align:"middle"},l.createElement(x.Z,{className:"font14 c-grey-666"},"\u9636\u6BB5\u6210\u7EE9"),l.createElement(x.Z,null,l.createElement(Yl,{score:u==null?void 0:u.user_score}))),l.createElement(we.default,{columns:J,dataSource:N,pagination:!1})),!!(A!=null&&A.length)&&l.createElement("div",null,l.createElement("p",{className:"font16 c-grey-666 mt10"},"\u5B9E\u8BAD\u8BE6\u60C5"),A==null?void 0:A.map((w,I)=>l.createElement("div",{id:`challenge_${u==null?void 0:u.question_id}${I}`,className:"mt5"},l.createElement(D.Z,null,l.createElement("span",{className:"font14 mr15"}," \u7B2C",w.position,"\u5173"),l.createElement(ve.Link,{className:"current c-black font14",target:"_blank",to:`/tasks/${q}/${i}/${w.game_identifier}/exercise`},w.name),l.createElement(x.Z,{style:{marginLeft:"auto"}},l.createElement(Yl,{score:w.user_score}))),(w==null?void 0:w.st)===0&&w.passed_code&&l.createElement("aside",{className:_e.shixunWrp},l.createElement("h2",null,"\u7B2C\u4E00\u6B21\u901A\u5173\u7684\u4EE3\u7801\uFF08\u672A\u901A\u5173\u5219\u4E3A\u6700\u540E\u4E00\u6B21\u63D0\u4EA4\u8BC4\u6D4B\u7684\u4EE3\u7801\uFF09",l.createElement("span",{className:"c-light-black"},w.path)),l.createElement(Sl.ZP,{height:300,language:"python",theme:"default",value:w.passed_code,options:oe})))))):l.createElement(l.Fragment,null,(0,ee.dE)()&&l.createElement(le.Z,{className:"c-grey-999 mt20 mb20",value:u==null?void 0:u.question_title}),(g=u==null?void 0:u.shixun)==null?void 0:g.map((w,I)=>l.createElement("p",{className:"font16 c-grey-666 mb5",key:I},l.createElement("span",{className:"mr20"},"\u7B2C",w==null?void 0:w.challenge_position,"\u5173 ",w==null?void 0:w.challenge_name),l.createElement("span",null,w==null?void 0:w.challenge_score,"\u5206")))))},Jl=E(24334),fe=E(59301);const As={0:"c-red-ee4",1:"c-green"};var Lt=({item:u,answerData:r})=>{var i,q,T;const[L,S]=(0,l.useState)([]);(0,l.useEffect)(()=>{var N,k;((N=u==null?void 0:u.evaluate_codes)==null?void 0:N.length)>0?S((k=u==null?void 0:u.evaluate_codes)==null?void 0:k.map((A,R)=>({key:R+1,error_msg:A!=null&&A.error_msg?Jl.Base64.decode(A==null?void 0:A.error_msg):""}))):S([{key:"--",error_msg:"--"}])},[u==null?void 0:u.evaluate_codes]);const Z=[{title:"\u8BC4\u6D4B\u6B21\u6570",dataIndex:"key",width:"127px",key:"key",align:"center",render:(N,k)=>fe.createElement("span",null,k.key)},{title:"\u8BE6\u7EC6\u4FE1\u606F",dataIndex:"error_msg",key:"error_msg",align:"center",render:(N,k)=>fe.createElement("span",null,k.error_msg?k.error_msg:"--")}],g={selectOnLineNumbers:!0,readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1};return fe.createElement("div",{className:`${_e.programWrapper}`},fe.createElement("div",{className:_e.desc},"\u9898\u76EE\u63CF\u8FF0"),fe.createElement("div",{className:_e.content},fe.createElement(le.Z,{value:u==null?void 0:u.description})),((i=r==null?void 0:r.exercise)==null?void 0:i.user_exercise_status)===1&&fe.createElement(D.Z,{justify:"end",className:"mt40"},fe.createElement(x.Z,null,fe.createElement(Yl,{score:u==null?void 0:u.user_score}))),(u==null?void 0:u.passed_code)&&fe.createElement("aside",{className:_e.shixunWrp},fe.createElement("h3",null,"\u7B2C\u4E00\u6B21\u8BC4\u6D4B\u901A\u8FC7\u7684\u4EE3\u7801\uFF08\u672A\u901A\u5173\u5219\u4E3A\u6700\u540E\u4E00\u6B21\u63D0\u4EA4\u8BC4\u6D4B\u7684\u4EE3\u7801\uFF09"),fe.createElement(Sl.ZP,{style:{border:"1px solid #ccc"},height:300,language:"python",theme:"vs-light",value:u!=null&&u.passed_code?Jl.Base64.decode(u==null?void 0:u.passed_code):"",options:g})),((q=r==null?void 0:r.exercise)==null?void 0:q.user_exercise_status)===1&&((T=r==null?void 0:r.exercise)==null?void 0:T.answer_open)&&fe.createElement("div",{style:{background:"#F6F7F9"},className:"mt30 p20"},fe.createElement("div",{style:{marginBottom:"20px",fontSize:"16px",display:"flex"}},fe.createElement("span",{style:{whiteSpace:"nowrap"}},"\u3010\u7B54\u6848\u3011"),fe.createElement(le.Z,{value:(u==null?void 0:u.standard_answer)||""})),fe.createElement("div",{style:{fontSize:"16px",display:"flex"}},fe.createElement("span",{style:{whiteSpace:"nowrap"}},"\u3010\u89E3\u6790\u3011"),fe.createElement(le.Z,{value:(u==null?void 0:u.analysis)||"\u6682\u65E0\u89E3\u6790"}))))},mn=E(10710),Wt=Object.defineProperty,Ut=Object.defineProperties,Ht=Object.getOwnPropertyDescriptors,fn=Object.getOwnPropertySymbols,Kt=Object.prototype.hasOwnProperty,Vt=Object.prototype.propertyIsEnumerable,pn=(u,r,i)=>r in u?Wt(u,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):u[r]=i,En=(u,r)=>{for(var i in r||(r={}))Kt.call(r,i)&&pn(u,i,r[i]);if(fn)for(var i of fn(r))Vt.call(r,i)&&pn(u,i,r[i]);return u},yn=(u,r)=>Ut(u,Ht(r)),gn=(u,r,i)=>new Promise((q,T)=>{var L=g=>{try{Z(i.next(g))}catch(N){T(N)}},S=g=>{try{Z(i.throw(g))}catch(N){T(N)}},Z=g=>g.done?q(g.value):Promise.resolve(g.value).then(L,S);Z((i=i.apply(u,r)).next())});const{TextArea:Is}=he.default,Gt={0:"c-red-ee4",1:"c-green"};var Qt=({sign:u,item:r,answerData:i,onBlur:q=()=>{}})=>{var T,L,S,Z;const[g,N]=(0,l.useState)([]),[k,A]=(0,l.useState)([]),R=(0,l.useRef)(),J=(0,l.useRef)(),[oe]=(0,ve.useSearchParams)();return(0,l.useEffect)(()=>{var w,I;if(oe.get("check")){let U=[];U=(w=r==null?void 0:r.standard_answer)==null?void 0:w.map(ue=>{var ne,$;return yn(En({},ue),{choice_id:ue.position,answer_text:(($=(ne=r==null?void 0:r.user_answer)==null?void 0:ne.find(Q=>Q.choice_id===ue.choice_id))==null?void 0:$.answer_text)||""})}),R.current=U,N(U)}else{let U=[];U=(I=r==null?void 0:r.standard_answers)==null?void 0:I.map(ue=>{var ne,$;return yn(En({},ue),{choice_id:ue.position,answer_text:(($=(ne=r==null?void 0:r.user_answer)==null?void 0:ne.find(Q=>Q.choice_id===ue.position))==null?void 0:$.answer_text)||""})}),R.current=U,N(U)}},[r==null?void 0:r.user_answer]),l.createElement("div",null,g==null?void 0:g.map((w,I)=>{var U,ue,ne,$,Q;return l.createElement(D.Z,{key:I,className:`${_e.baseMargin} ${_e.fill}`,align:"middle"},l.createElement(x.Z,{className:_e.index},"\u586B\u7A7A\u9879",I+1),l.createElement(x.Z,{flex:"430px",className:"ml20 mr20"},(w==null?void 0:w.model)===1?l.createElement(he.default,{placeholder:"\u8BF7\u8F93\u5165\u7B54\u6848",disabled:!r.repeat_answer&&((U=r==null?void 0:r.user_answer)==null?void 0:U.length)>0&&r.ques_status!==0||!!(i!=null&&i.exercise.commit_status),value:w==null?void 0:w.answer_text,onChange:ie=>{g[I].answer_text=ie.target.value,N([...g])},onFocus:()=>{u.current=!0},onBlur:ie=>{setTimeout(()=>gn(void 0,null,function*(){const me=yield q(w==null?void 0:w.answer_text,I+1,g);if(me.status){const M=k.slice();M[I]={status:"fail",errorText:me.message},J.current=M,A(M)}else{const M=k.slice();M[I]={status:"success",errorText:""},J.current=M,A(M)}}),200)},className:`${r.user_score&&(r.user_score===r.question_score?"c-green":"c-red")} ${_e.fillInput}`}):l.createElement(mn.Z,{value:w==null?void 0:w.answer_text,disabled:!r.repeat_answer&&((ue=r==null?void 0:r.user_answer)==null?void 0:ue.length)>0&&r.ques_status!==0||!!(i!=null&&i.exercise.commit_status),onChange:ie=>gn(void 0,null,function*(){var me,M;g[I].answer_text=ie,N([...g]);const pe=yield q(w==null?void 0:w.answer_text,I+1,g);if(pe.status){const ae=((M=J==null?void 0:J.current)==null?void 0:M.slice())||[].slice();ae[I]={status:"fail",errorText:pe.message},J.current=ae,A(ae)}else{const ae=((me=J==null?void 0:J.current)==null?void 0:me.slice())||[].slice();ae[I]={status:"success",errorText:""},J.current=ae,A(ae)}})})),((ne=k[I])==null?void 0:ne.status)==="success"&&l.createElement(x.Z,null,l.createElement(D.Z,{align:"middle"},l.createElement("i",{style:{marginRight:8},className:`iconfont icon-chenggong1 ${_e.success}`}),l.createElement("span",{className:_e.success},"\u4FDD\u5B58\u6210\u529F"))),(($=k[I])==null?void 0:$.status)==="fail"&&l.createElement(x.Z,null,l.createElement(D.Z,{align:"middle"},l.createElement("i",{style:{marginRight:8},className:`iconfont icon-tishi7 ${_e.fail}`}),l.createElement("span",{className:_e.fail},(Q=k[I])==null?void 0:Q.errorText))))}),((0,ee.GJ)()||(0,ee.dE)()&&((T=i==null?void 0:i.exercise)==null?void 0:T.user_exercise_status)>0&&((L=i==null?void 0:i.exercise)==null?void 0:L.open_score))&&l.createElement(D.Z,{justify:"end",className:"mb20",align:"middle"},l.createElement("span",{className:"font14",style:{color:"#6A7283"}},"\u5F97\u5206"),l.createElement("span",{className:"font14 ml10"},(r==null?void 0:r.user_score)&&l.createElement("span",null,l.createElement("span",{className:Gt[Number(r==null?void 0:r.answer_status)]||"c-orange-ff9"},r==null?void 0:r.user_score),l.createElement("span",{style:{marginLeft:5,color:"#6A7283"}},"\u5206")),!(r!=null&&r.user_score)&&l.createElement("span",{className:"c-red"},"\u672A\u8BC4"))),((S=i==null?void 0:i.exercise)==null?void 0:S.answer_open)&&l.createElement("div",{className:_e.analysisWrap},l.createElement("div",{className:_e.greyBg},l.createElement(D.Z,{className:"mb20",align:"middle"},l.createElement(x.Z,{className:"font14 mr10",style:{color:"#6A7283"}},"\u3010\u7B54\u6848\u3011"),(Z=r==null?void 0:r.standard_answer)==null?void 0:Z.map((w,I)=>{var U;return l.createElement(x.Z,{key:I,className:"mr40"},l.createElement("div",{style:{display:"flex",alignItems:"center"}},l.createElement("div",{style:{width:"100px"}},"\u586B\u7A7A\u9879",I+1),l.createElement(mn.Z,{value:(U=w==null?void 0:w.answer_text)==null?void 0:U[0],disabled:!0})))})),l.createElement(D.Z,null,l.createElement("span",{className:"font14 mr10",style:{color:"#6A7283"}},"\u3010\u89E3\u6790\u3011"),l.createElement(le.Z,{className:_e.renderHtml,value:r==null?void 0:r.analysis})))))},Yt=E(21576),zt=E(88289),be=E(59301),Jt=Object.defineProperty,Xt=Object.defineProperties,eu=Object.getOwnPropertyDescriptors,hn=Object.getOwnPropertySymbols,lu=Object.prototype.hasOwnProperty,nu=Object.prototype.propertyIsEnumerable,xn=(u,r,i)=>r in u?Jt(u,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):u[r]=i,Fn=(u,r)=>{for(var i in r||(r={}))lu.call(r,i)&&xn(u,i,r[i]);if(hn)for(var i of hn(r))nu.call(r,i)&&xn(u,i,r[i]);return u},Bn=(u,r)=>Xt(u,eu(r)),tu=(u,r,i)=>new Promise((q,T)=>{var L=g=>{try{Z(i.next(g))}catch(N){T(N)}},S=g=>{try{Z(i.throw(g))}catch(N){T(N)}},Z=g=>g.done?q(g.value):Promise.resolve(g.value).then(L,S);Z((i=i.apply(u,r)).next())});const{TextArea:Ps}=he.default;var uu=({item:u,answerData:r,onBlur:i=()=>{},onDebug:q=()=>{},setIsSubmitCode:T})=>{var L,S,Z;let[g,N]=(0,l.useState)([]);const[k]=(0,ve.useSearchParams)();return(0,l.useEffect)(()=>{var A;let R=(A=u==null?void 0:u.standard_answer_with_score)==null?void 0:A.map((J,oe)=>{var w,I;return Bn(Fn({},J),{value:((I=(w=u==null?void 0:u.user_answer)==null?void 0:w.find(U=>parseInt(U.choice_id)===oe+1))==null?void 0:I.answer_text)||""})});N(R)},[u==null?void 0:u.standard_answer_with_score]),console.log(g,"userAnswer"),be.createElement("div",null,be.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:10}},be.createElement("div",{style:{fontSize:14,color:"#FF0000"}},be.createElement(zt.Z,null),be.createElement("span",{style:{marginLeft:5}},"\u6CE8\u610F\uFF1A\u586B\u5199\u7B54\u6848\u4E4B\u540E\uFF0C\u5FC5\u987B\u63D0\u4EA4\u4EE3\u7801\u8FDB\u884C\u8BC4\u6D4B\uFF0C\u5426\u5219\u65E0\u6CD5\u5F97\u5206")),!k.get("check")&&be.createElement(Yt.Z,{setIsSubmitCode:T,ButtonProps:{type:"primary"},ButtonText:"\u63D0\u4EA4\u4EE3\u7801",items:Bn(Fn({},u),{userAnswer:g}),hackidentifier:u==null?void 0:u.hack_identifier})),(u==null?void 0:u.code)&&be.createElement("div",{style:{border:"1px solid #CCCCCC",padding:"10px",marginBottom:20}},be.createElement(le.Z,{disabledFill:!u.repeat_answer&&((L=u==null?void 0:u.user_answer)==null?void 0:L.length)>0&&u.ques_status!==0||!!(r!=null&&r.exercise.commit_status),onFillBlur:(A,R)=>tu(void 0,null,function*(){var J;(yield i((J=A==null?void 0:A[parseInt(R)])==null?void 0:J.value,parseInt(R)+1,g)).status===0?(g[parseInt(R)].type="success",N(g)):(g[parseInt(R)].type="warning",N(g))}),className:_e.content,programFillValue:g,showProgramFill:!0,value:Jl.Base64.decode((u==null?void 0:u.code)||"")})),!!((S=u==null?void 0:u.standard_answer)!=null&&S.length)&&be.createElement("div",{className:_e.analysisWrap},be.createElement("div",{className:_e.greyBg},be.createElement(D.Z,{className:"mb20",align:"middle"},be.createElement(x.Z,{className:"font14 mr10",style:{color:"#6A7283"}},"\u3010\u7B54\u6848\u3011"),(Z=u==null?void 0:u.standard_answer)==null?void 0:Z.map((A,R)=>be.createElement(x.Z,{key:R,className:"mr40"},"\u586B\u7A7A\u9879",R+1,":",A==null?void 0:A.answer_text))),be.createElement(D.Z,null,be.createElement("span",{className:"font14 mr10",style:{color:"#6A7283"}},"\u3010\u89E3\u6790\u3011"),be.createElement(le.Z,{className:_e.renderHtml,value:(u==null?void 0:u.analysis)||"\u6682\u65E0\u89E3\u6790"})))))},su=E(54344);const{TextArea:Ss}=he.default;var ru=({data:u})=>l.createElement("div",{className:"tc mt80 pb30"},l.createElement("img",{width:"486",src:su.BV})," ",l.createElement("br",null),u.status===-1&&l.createElement("div",{className:"c-grey-999 mt60"},"\u60A8\u7684IP\u4E0D\u5728\u8003\u8BD5\u5141\u8BB8\u7684\u8303\u56F4\u5185\uFF01"),u.status===-2&&l.createElement("div",{className:" c-grey-999 mt60"},"\u60A8\u5DF2\u7ED1\u5B9A\u5F53\u524D\u8003\u8BD5IP\u5730\u5740\uFF1A",l.createElement("span",{className:"c-red"},u.ip),"\u8BF7\u4F7F\u7528\u8BE5IP\u5730\u5740\u8FDB\u5165\u8003\u8BD5\u3002"),l.createElement(X.ZP,{className:"mt40 pl20 pr20",type:"primary"},l.createElement("a",{href:"/"},"\u56DE\u5230\u9996\u9875"))),wn=E(67417),au=E(89392),Ge={comments:"comments___ZkLeS",greyText:"greyText___ow9J6",commentText:"commentText___Uklcs",wrapper:"wrapper___XTdhL",header:"header___pq5DQ",updateTime:"updateTime___WYYjt",text:"text___FmQY7",date:"date___DiXg4"},ou=({list:u,hideScore:r=!1})=>l.createElement("div",null,u==null?void 0:u.map(i=>{var q,T,L,S,Z,g;return l.createElement("div",{className:`mt20 ${Ge.wrapper}`,key:(q=i==null?void 0:i.user)==null?void 0:q.user_id},l.createElement(D.Z,{align:"middle",className:Ge.header},l.createElement("img",{src:wn.Z.API_SERVER+"/images/"+((T=i.user)==null?void 0:T.image_url)}),l.createElement("span",{className:"ml10 font16"},(L=i.user)==null?void 0:L.name),l.createElement(x.Z,{className:Ge.updateTime},l.createElement("span",{className:Ge.text},"\u8BC4\u9605\u65F6\u95F4"),l.createElement("span",{className:Ge.date},Ue()((Z=(S=i.comments)==null?void 0:S[0])==null?void 0:Z.updated_at).format("YYYY-MM-DD HH:mm")))),l.createElement("div",{className:Ge.comments},(g=i==null?void 0:i.comments)==null?void 0:g.map((N,k)=>{var A;return l.createElement("div",{key:((A=i==null?void 0:i.user)==null?void 0:A.user_id)+"-"+k},l.createElement(D.Z,{align:"middle",justify:"space-between"},!!N.shixun_chanllge_position&&l.createElement("div",{style:{flexShrink:0,marginRight:10}},"\u7B2C",N.shixun_chanllge_position,"\u5173"),!r&&l.createElement("div",{style:{flex:1}},"\u539F\u59CB\u5F97\u5206",N==null?void 0:N.origin_score,"\u5206\uFF0C\u4FEE\u6B63\u4E3A",l.createElement("span",{className:"c-light-primary"},N==null?void 0:N.score),"\u5206")),!!N.comment&&l.createElement("div",null," ",l.createElement("span",{className:`${Ge.greyText} mr10`},"\u8BC4\u8BED"),l.createElement("span",{className:Ge.commentText},N.comment)))})))})),iu=E(73722),cu=E(12911),du=E.n(cu),_u=E(58768),vu=E(22415),gl=E(13748),mu=E(34437),fu={codeInput:"codeInput___xSFAu"},pu=E(92310),Eu=E.n(pu),yu=({className:u,style:r,onOk:i})=>{const[q,T]=(0,l.useState)(["","","","","",""]),[L,S]=(0,l.useState)(0),Z=(0,l.useRef)([]);(0,l.useEffect)(()=>{const k=q.findIndex(A=>!A);k===-1&&i(q),S(k)},[q]),(0,l.useEffect)(()=>{var k;(k=Z.current[L])==null||k.focus()},[L]);const g=(k,A)=>{const{value:R}=k.target;if(/^\d*$/.test(R)){const J=[...q];J[A]=R||"",T(J)}},N=(k,A)=>{if(k.key==="Backspace"&&A>0){k.preventDefault();const R=[...q];R[A-1]="",T(R)}};return l.createElement("div",{className:Eu()(fu.codeInput,u),style:r},q.map((k,A)=>l.createElement("input",{key:A,type:"text",disabled:L!==A,maxLength:1,value:k===""?"":"*",onChange:R=>g(R,A),onKeyDown:R=>N(R,A),ref:R=>{Z.current[A]=R}})))},gu=E(50948),hu=E(50693),n=E(59301),xu=Object.defineProperty,Fu=Object.defineProperties,Bu=Object.getOwnPropertyDescriptors,Zl=Object.getOwnPropertySymbols,bn=Object.prototype.hasOwnProperty,Cn=Object.prototype.propertyIsEnumerable,An=(u,r,i)=>r in u?xu(u,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):u[r]=i,re=(u,r)=>{for(var i in r||(r={}))bn.call(r,i)&&An(u,i,r[i]);if(Zl)for(var i of Zl(r))Cn.call(r,i)&&An(u,i,r[i]);return u},Ie=(u,r)=>Fu(u,Bu(r)),wu=(u,r)=>{var i={};for(var q in u)bn.call(u,q)&&r.indexOf(q)<0&&(i[q]=u[q]);if(u!=null&&Zl)for(var q of Zl(u))r.indexOf(q)<0&&Cn.call(u,q)&&(i[q]=u[q]);return i},z=(u,r,i)=>new Promise((q,T)=>{var L=g=>{try{Z(i.next(g))}catch(N){T(N)}},S=g=>{try{Z(i.throw(g))}catch(N){T(N)}},Z=g=>g.done?q(g.value):Promise.resolve(g.value).then(L,S);Z((i=i.apply(u,r)).next())});const{Countdown:bu}=Pe.default,ol=["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"],Nn={0:"c-red-ee4",1:"c-green"},Cu=u=>{var r=u,{globalSetting:i,loading:q,user:T,exercise:L,dispatch:S}=r,Z=wu(r,["globalSetting","loading","user","exercise","dispatch"]),g,N,k,A,R,J,oe,w,I,U,ue,ne,$,Q,ie,me,M,pe,ae,qe,hl,xl,Se,je,il,Fl,In,Dn,Pn,qn,Sn,Zn,Tn,On,kn,$n,Rn,Mn,jn,Ln,Wn,Un,Hn,Kn,Vn,Gn,Qn,Yn,zn,Jn,Xn,et,lt,nt;const Nu=(0,ve.useLocation)(),[tt]=(0,ve.useSearchParams)(),b=(0,ve.useParams)(),[t,Ze]=(0,l.useState)({}),[d,Iu]=(0,l.useState)({}),[cl,Du]=(0,l.useState)({}),[Pu,el]=(0,l.useState)(!1),[ll,qu]=(0,l.useState)(!0),[Su,ut]=(0,l.useState)(!1),[Zu,dl]=(0,l.useState)(!1),[Tu,Bl]=(0,l.useState)(!1),[Ou,st]=(0,l.useState)(!1),[ku,rt]=(0,l.useState)(),[$u,Tl]=(0,l.useState)(""),[Ru,Xl]=(0,l.useState)("none"),[Mu,ju]=(0,l.useState)(""),[wl,en]=(0,l.useState)({status:0}),[Lu,Wu]=(0,l.useState)(!1),[_l,ks]=(0,l.useState)(window.document.domain==="kepukehuan.educoder.net"),[Uu,at]=(0,l.useState)(!0),[bl,vl]=(0,l.useState)(!1),[Ol,kl]=(0,l.useState)(null),[Hu,ot]=(0,l.useState)(!1),[Ku,Vu]=(0,l.useState)(0),it=(0,l.useRef)(),ct=(0,l.useRef)(),Cl=(0,l.useRef)(!1),$l=(0,l.useRef)(),dt=(0,l.useRef)(),Rl=(0,l.useRef)(),nl=(0,l.useRef)(),[Ml]=Ee.default.useForm(),ln=(0,l.useMemo)(()=>new WebSocket("ws://localhost:8082"),[]);let[H,ml]=(0,l.useState)(0),[V,fl]=(0,l.useState)(0);const[Gu,Al]=(0,l.useState)(!1),[jl,_t]=(0,l.useState)(!1),[nn,Ll]=(0,l.useState)(!1),Qu=[`/classrooms/${b.coursesId}/exercise/${b.categoryId}/detail`,`/classrooms/${b.coursesId}/exercise`,`/classrooms/${b.coursesId}/exercise/`,`/classrooms/${b.coursesId}/exercise/${b.categoryId}/users/${(g=T.userInfo)==null?void 0:g.login}/check`,`/classrooms/${b.coursesId}/exercisenotice/${b.categoryId}/users/${(N=T.userInfo)==null?void 0:N.login}`,`/classrooms/${b.coursesId}/exercise/${b.categoryId}/users/${(k=T.userInfo)==null?void 0:k.login}`],[vt,mt]=(0,l.useState)(!1),[Yu,zu]=(0,l.useState)({left:0,top:0,bottom:0,right:0}),ft=(0,l.useRef)(null),[pt,Et]=(0,l.useState)(!0),Wl=(0,l.useRef)(),[Ju,tn]=(0,l.useState)(!1);(0,mu.y)((0,ee.dE)());const Xu=(e,s)=>{var c;const{clientWidth:m,clientHeight:o}=window.document.documentElement,_=(c=ft.current)==null?void 0:c.getBoundingClientRect();zu({left:-_.left+s.x,right:m-(_.right-s.x),top:-_.top+s.y,bottom:o-(_.bottom-s.y)-70})},Ul=(0,gu._)(t);(0,l.useEffect)(()=>(document.body.setAttribute("data-custom","auto"),()=>{document.body.removeAttribute("data-custom")}),[]),(0,l.useEffect)(()=>{var e,s;if(document.body.scrollIntoView(),((e=T.userInfo)==null?void 0:e.real_name)==="\u6E38\u5BA2"){window.location.href=`/classrooms/${b.coursesId}/exercise`;return}return(s=T.userInfo)!=null&&s.user_id&&((0,ee.GJ)()?Qe():T.userInfo.login&&ls()),window.addEventListener("message",gt),()=>{window.removeEventListener("message",gt),Nu.pathname.indexOf("/detail")>-1&&(0,rl.BU)()}},[b.categoryId,T.userInfo.login]),(0,l.useEffect)(()=>(window.addEventListener("beforeunload",yt),()=>{Ul(),window.removeEventListener("beforeunload",yt)}),[]),(0,l.useEffect)(()=>(S({type:"globalSetting/headerFooterToggle",payload:!1}),()=>{S({type:"globalSetting/headerFooterToggle",payload:!0})}),[]),(0,l.useEffect)(()=>{var e,s,c,m;(e=t==null?void 0:t.question_status)!=null&&e.every(o=>!!o.ques_status&&Lu&&(d==null?void 0:d.used_screen_num)<(d==null?void 0:d.screen_num))&&setTimeout(()=>{var o;(o=ct.current)==null||o.handlePhoto()},1300),kl((m=(c=(s=t==null?void 0:t.exercise_question_types)==null?void 0:s[H])==null?void 0:c.items)==null?void 0:m[V])},[t]);const yt=e=>{var s;!(d!=null&&d.is_commit)&&(0,ee.dE)()&&(0,K.RG)(" ",!0),localStorage.setItem("Refresh","1"),(s=L.exerciseUserInfo)!=null&&s.screen_open&&window.navigator.sendBeacon(`${wn.Z.API_SERVER}/api/exercises/${b.categoryId}/commit_screen_at.json`,{})},gt=e=>{e.data==="backExercise"&&((0,K.RG)(" ",!0),es())},es=()=>{Xl("none"),Tl(""),Qe()},ls=()=>z(void 0,null,function*(){ts()}),ns=()=>z(void 0,null,function*(){at(!1),te.default.info({title:"\u5F00\u8003\u5BC6\u7801",width:500,centered:!0,closable:!1,keyboard:!1,maskClosable:!1,maskStyle:{background:"#000"},okText:"\u8FDB\u5165\u8003\u8BD5",onOk:()=>new Promise((e,s)=>z(void 0,null,function*(){try{yield Ml.validateFields()}catch(m){s()}const c=yield(0,ye.pL)(re({exercise_user_id:d==null?void 0:d.exercise_user_id,categoryId:b.categoryId},yield Ml.validateFields()));(c==null?void 0:c.status)===0?(at(!0),un(),e(c)):(Ml.setFields([{name:"start_password",errors:[c==null?void 0:c.message]}]),s())})),content:n.createElement(n.Fragment,null,n.createElement("p",{className:""},"\u8BF7\u8F93\u5165\u76D1\u8003\u8001\u5E08\u5BA3\u5E03\u672C\u573A\u8003\u8BD5\u7684\u5F00\u8003\u5BC6\u7801\u540E\u8FDB\u5165\u8003\u8BD5"),n.createElement(Ee.default,{form:Ml,autoComplete:"off"},n.createElement(Ee.default.Item,{name:"start_password",label:"\u5F00\u8003\u5BC6\u7801",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5F00\u8003\u5BC6\u7801"}]},n.createElement(he.default.Password,{autoComplete:"off"}))))})}),ts=()=>z(void 0,null,function*(){const e=yield S({type:"exercise/getExerciseUserInfo",payload:re({},b)});nl.current=Ie(re({},e.data),{status:e==null?void 0:e.status}),Iu(Ie(re({},e.data),{status:e==null?void 0:e.status}))});(0,l.useEffect)(()=>{if(d!=null&&d.exercise_user_id){if(d!=null&&d.is_commit||(0,K.RG)(" ",!0),!(d!=null&&d.is_commit)&&((d==null?void 0:d.ip_limit)==="inner"||d!=null&&d.ip_bind)&&(Rl.current=`&ip_limit=${d==null?void 0:d.ip_limit}&ip_bind=${d==null?void 0:d.ip_bind}`),d!=null&&d.is_commit){if(!d.answered_open){te.default.info({width:500,centered:!0,icon:null,title:"\u63D0\u793A",content:"\u8001\u5E08\u5DF2\u8BBE\u7F6E\u672C\u8BD5\u5377\u5728\u4EA4\u5377\u540E\u4E0D\u53EF\u67E5\u770B",onOk:()=>{window.location.href=`/classrooms/${b.coursesId}/exercise/${b.categoryId}/detail`}});return}}else{if((0,K.RG)(" ",!0),!(d!=null&&d.can_start)){window.location.href=`/classrooms/${b.coursesId}/exercise/${b.categoryId}/users/${b.login}/check`;return}if(d!=null&&d.is_locked&&d.ip_error){S({type:"exercise/setActionTabs",payload:{key:"student-unlock",exerciseParams:Ie(re({},d),{id:b.categoryId})}});return}else!(d!=null&&d.is_locked)&&d.ip_error;if(document.referrer===""||performance.navigation.type===2||!Qu.includes(new URL(document.referrer).pathname)){sessionStorage.setItem("illegalEntry","illegalEntry"),ve.history.push(`/classrooms/${b.coursesId}/exercise/`);return}if(d!=null&&d.start_locked&&!(d!=null&&d.user_is_enter)){ns();return}if(d!=null&&d.is_locked&&performance.navigation.type===1&&!sessionStorage.getItem("studentunlock")){S({type:"exercise/setActionTabs",payload:{key:"student-unlock",exerciseParams:Ie(re({},d),{id:b.categoryId})}});return}if((0,Be.ZP)(`/api/exercises/${b==null?void 0:b.categoryId}/close_pop.json`,{method:"post"}),d!=null&&d.is_locked&&performance.navigation.type===0&&(d!=null&&d.user_is_enter)&&!(d!=null&&d.is_commit)&&(d!=null&&d.show_pop)){S({type:"exercise/setActionTabs",payload:{key:"student-unlock",exerciseParams:Ie(re({},d),{id:b.categoryId})}});return}}un()}return()=>{!(d!=null&&d.is_commit)&&(0,ee.dE)()&&(0,K.RG)(" ",!0)}},[d]);const un=()=>z(void 0,null,function*(){var e,s,c,m,o,_,f,h,B,p,P,y,v,O,W,j;sessionStorage.setItem("studentunlock","studentunlock");const F={data:d,status:d.status};if((((e=F==null?void 0:F.data)==null?void 0:e.ip_limit)!=="no"||(s=F==null?void 0:F.data)!=null&&s.ip_bind)&&($l.current=yield(0,Y.y)({ip_limit:(c=F==null?void 0:F.data)==null?void 0:c.ip_limit,ip_bind:(m=F==null?void 0:F.data)==null?void 0:m.ip_bind,ip_bind_type:(o=F==null?void 0:F.data)==null?void 0:o.ip_bind_type})),(((_=F==null?void 0:F.data)==null?void 0:_.ip_limit)!=="no"||(f=F==null?void 0:F.data)!=null&&f.ip_bind)&&(((h=F==null?void 0:F.data)==null?void 0:h.ip_limit)==="inner"||(B=F==null?void 0:F.data)!=null&&B.ip_bind)){var pl=yield(0,K.oi)({exerciseId:b.categoryId,ip:$l.current,errmsgHide:!0,ip_limit:((p=F==null?void 0:F.data)==null?void 0:p.ip_limit)||"no",ip_bind:(P=F==null?void 0:F.data)==null?void 0:P.ip_bind,ip_bind_type:(y=F==null?void 0:F.data)==null?void 0:y.ip_bind_type});if((pl==null?void 0:pl.status)!==0){en(pl);return}}if((F==null?void 0:F.status)==0){if(((v=F==null?void 0:F.data)==null?void 0:v.used_screen_num)>((O=F==null?void 0:F.data)==null?void 0:O.screen_num)&&((W=F==null?void 0:F.data)!=null&&W.screen_open))return Ll(!0),Kl(),!1;if(ut(F==null?void 0:F.data.check_camera),!(F!=null&&F.data.check_camera)){if(F!=null&&F.data.screen_shot_open){Bl(d==null?void 0:d.screen_shot_open);return}dl((j=F==null?void 0:F.data)==null?void 0:j.screen_open),Qe()}}}),Hl=(...e)=>z(void 0,[...e],function*(s=Ol){tt.get("check")||(yield(0,Be.ZP)(`/api/exercise_questions/${s==null?void 0:s.question_id}/exercise_answers/save_hack_evaluate.json`,{}))}),us=e=>z(void 0,null,function*(){if((e==null?void 0:e.type)===1)return te.default.info({centered:!0,width:470,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",icon:null,keyboard:!1,onOk:()=>{ve.history.replace(`/classrooms/${b.coursesId}/exercise/${b.categoryId}/detail`)},content:n.createElement("div",null,(e==null?void 0:e.message)||"")}),Promise.reject();if((e==null?void 0:e.type)===2){const s=()=>{ve.history.replace(`/classrooms/${b.coursesId}/exercise/${b.categoryId}/centralizeReview/${e==null?void 0:e.login}`)};return te.default.confirm({centered:!0,width:470,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",icon:null,keyboard:!1,onOk:s,onCancel:()=>{ve.history.replace(`/classrooms/${b.coursesId}/exercise/${b.categoryId}/detail`)},content:n.createElement("div",null,n.createElement("div",null,"\u60A8\u5DF2\u6210\u4E3A\u6307\u5B9A\u9605\u5377\u6559\u5E08\uFF0C\u662F\u5426\u73B0\u5728\u524D\u5F80",n.createElement("span",{onClick:s,className:"ml5 mr5 c-light-primary current"},"\u96C6\u4E2D\u9605\u5377"),"\u7EE7\u7EED\u8BC4\u9605\uFF1F"),n.createElement("div",{className:"c-grey-999"},"\uFF08\u9605\u5377\u7ED3\u675F\u540E\u6062\u590D\u5B66\u751F\u4E2A\u4EBA\u8BC4\u9605\u529F\u80FD\uFF0C\u5E76\u5C55\u793A\u5B66\u751F\u6210\u7EE9\uFF09"))}),Promise.reject()}}),Qe=()=>z(void 0,null,function*(){var e,s,c,m,o,_,f,h,B,p,P,y,v,O,W,j,F,pl,qt,St,Zt;document.body.scrollIntoView(),el(!0);let C,Il=(e=T.userInfo)==null?void 0:e.user_id;if((0,ee.GJ)())C=yield(0,ye.BJ)({exerciseId:b.categoryId,login:b.login}).catch(()=>el(!1)),C!=null&&C.exercise&&(C.exercise.user_exercise_status=1),Il=(s=C==null?void 0:C.exercise_answer_user)==null?void 0:s.user_id;else{if(tt.get("check"))C=yield(0,ye.BJ)(Ie(re({},b),{exerciseId:b.categoryId,login:b.login})).catch(()=>el(!1)),Il=(c=C==null?void 0:C.exercise)==null?void 0:c.user_id;else{if((((m=nl.current)==null?void 0:m.ip_limit)!=="no"||(o=nl.current)!=null&&o.ip_bind)&&($l.current=yield(0,Y.y)({ip_limit:(_=nl.current)==null?void 0:_.ip_limit,ip_bind:(f=nl.current)==null?void 0:f.ip_bind,ip_bind_type:(h=nl.current)==null?void 0:h.ip_bind_type})),C=yield(0,ye.CD)(Ie(re({},b),{ip:$l.current})).catch(()=>el(!1)),C.status===-1){Te();return}if((B=C==null?void 0:C.exercise)!=null&&B.only_on_client&&!(0,K.WX)()){de.ZP.warning("\u8BF7\u7528\u5BA2\u6237\u7AEF\u4F5C\u7B54"),Te();return}if((C==null?void 0:C.status)===-5){S({type:"exercise/setActionTabs",payload:{key:"student-unlock",exerciseParams:Ie(re({},nl.current),{id:b.categoryId,errorMessage:C==null?void 0:C.message})}});return}C!=null&&C.exercise&&(C.exercise.user_exercise_status=0),C!=null&&C.exercise&&(C.exercise.exercise_status=2),(p=C==null?void 0:C.exercise_question_types)==null||p.map(ul=>{var De;(ul==null?void 0:ul.question_type)<3&&((De=ul==null?void 0:ul.items)==null||De.map(Dl=>{Dl.user_answer=Dl.question_choices.filter(El=>El.user_answer_boolean).map(El=>El.choice_id)}))})}if(!((P=C==null?void 0:C.exercise)!=null&&P.can_start)&&(C!=null&&C.exercise)){window.location.href=`/classrooms/${b.coursesId}/exercise/${b.categoryId}/users/${b.login}/check`;return}((y=C.exercise)==null?void 0:y.commit_status)===0&&!dt.current&&(dt.current=!0,(0,K.G5)(ln,C==null?void 0:C.exercise)),(v=C==null?void 0:C.exercise)!=null&&v.left_time&&setTimeout(()=>{ju(a.red)},(((O=C==null?void 0:C.exercise)==null?void 0:O.left_time)-300>0?((W=C==null?void 0:C.exercise)==null?void 0:W.left_time)-300:0)*1e3),((j=C==null?void 0:C.exercise)==null?void 0:j.take_photo)>=((F=C==null?void 0:C.exercise)==null?void 0:F.photo_count)}if(el(!1),yield us(C),C){if((pl=C==null?void 0:C.exercise)!=null&&pl.question_random||(qt=C==null?void 0:C.exercise)!=null&&qt.choice_random){let ul=1;C.exercise.question_random=(St=C==null?void 0:C.exercise_question_types)==null?void 0:St.map(De=>{var Dl,El;return(Dl=C==null?void 0:C.exercise)!=null&&Dl.choice_random&&((De.question_type===0||De.question_type===1)&&De.items.map(Ye=>(Ye.question_choices=(0,K.M2)(Ye.question_choices,Il),Ye)),De.question_type===7&&De.items.forEach(Ye=>{Ye.sub_exercise_questions.forEach(cn=>{cn.question_choices&&(cn.question_choices=(0,K.M2)(cn.question_choices,Il))})})),(El=C==null?void 0:C.exercise)!=null&&El.question_random&&(De.items=(0,K.M2)(De.items,Il)),De.items.map(Ye=>(Ye.question_num=ul,ul++,Ye)),De})}C.exercise_types=(C==null?void 0:C.exercise_types)||((Zt=C==null?void 0:C.exercise_scores)==null?void 0:Zt.exercise_types),C.question_status=C.question_status||ss((C==null?void 0:C.exercise_question_types)||[]),Ze(C)}return C}),ss=e=>{let s=[];return e.forEach(c=>{s=s.concat(c.items)}),s=s.map(c=>({ques_status:c==null?void 0:c.ques_status,score_status:c==null?void 0:c.score_status,question_num:c==null?void 0:c.question_num,ques_id:c==null?void 0:c.question_id})),s};(0,l.useEffect)(()=>{var e,s,c;((e=t.exercise)==null?void 0:e.left_time)===0&&Kl(),(s=t.exercise)!=null&&s.left_time&&rt(Date.now()+((c=t==null?void 0:t.exercise)==null?void 0:c.left_time)*1e3)},[(A=t.exercise)==null?void 0:A.left_time]);const $s=()=>{var e;((e=t==null?void 0:t.exercise)==null?void 0:e.exercise_status)===3?te.default.confirm({width:530,title:"\u63D0\u793A",icon:null,centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:n.createElement("div",null,"\u622A\u6B62\u65F6\u95F4\u5DF2\u5230\uFF0C\u65E0\u6CD5\u6253\u56DE\u8BD5\u5377",n.createElement("br",null),"\u8BF7\u5728\u4FEE\u6539\u622A\u6B62\u65F6\u95F4\u540E\u518D\u64CD\u4F5C")}):te.default.confirm({width:530,title:"\u63D0\u793A",icon:null,centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:n.createElement("div",null,"\u5B66\u751F\u5C06\u5F97\u5230\u4E00\u6B21\u91CD\u65B0\u7B54\u9898\u7684\u673A\u4F1A\uFF0C\u73B0\u6709\u7684\u7B54\u9898\u60C5\u51B5\u5C06\u88AB\u6E05\u7A7A",n.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u56DE\u9000TA\u7684\u8BD5\u5377\u7B54\u9898"),onOk:()=>z(void 0,null,function*(){var s;const c=yield(0,ye.q6)({categoryId:b.categoryId,user_ids:[(s=t==null?void 0:t.exercise_answer_user)==null?void 0:s.user_id]});c&&(de.ZP.info(c==null?void 0:c.message),Te())})})},Te=()=>{if((0,K.G5)(ln),(0,K.WX)()){window.location.href=(0,K.Ll)()?"/":"/classrooms/examList";return}window.location.href=(0,K.Ll)()?"/":`/classrooms/${b.coursesId}/exercise/${b.categoryId}/detail`},ht=()=>z(void 0,null,function*(){const e=yield(0,ye.PT)(re({},b));return e!=null&&e.has_time?(rt(Date.now()+(e==null?void 0:e.left_time)*1e3),Ze(s=>Ie(re({},s),{exercise:Ie(re({},s.exercise),{left_time:e==null?void 0:e.left_time})})),!0):(rs(),!1)}),rs=()=>z(void 0,null,function*(){if(Cl.current)return;Cl.current=!0;const e=yield(0,ye.VL)({categoryId:b.categoryId,commit_method:2});if(dl(!1),Bl(!1),(e==null?void 0:e.status)===0&&(te.default.info({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",content:n.createElement("div",null,"\u7B54\u9898\u7ED3\u675F\u4E86\uFF0C\u7CFB\u7EDF\u5DF2\u81EA\u52A8\u63D0\u4EA4\u8BD5\u5377",n.createElement("br",null),"\u4E0D\u80FD\u518D\u4FEE\u6539\u7B54\u9898"),onOk:()=>z(void 0,null,function*(){Te()})}),de.ZP.info(e==null?void 0:e.message)),(e==null?void 0:e.status)===-3){Cl.current=!1;const s=parseInt(e==null?void 0:e.message);t.exercise.left_time=s,Ze(re({},t))}}),sn=e=>z(void 0,null,function*(){const s=yield(e.is_jupyter||e.is_jupyter_lab?Je.BK:Je.Ir)({id:e.shixun_identifier});(s!=null&&s.game_identifier||s!=null&&s.identifier)&&(e.is_jupyter_lab||e.is_jupyter?Tl(`/tasks/${s.identifier}/jupyter?type=exercises&exercisesId=${b.categoryId}&coursesId=${b.coursesId}&login=${b.login}&questionId=${e.question_id}&isFullScreen=${(0,rl.vp)()}${Rl.current||""}&ip_limit=${d==null?void 0:d.ip_limit}&ip_bind=${d==null?void 0:d.ip_bind}&ip_bind_type=${d==null?void 0:d.ip_bind_type}`):Tl(`/tasks/${s.game_identifier}?type=exercises&exercisesId=${b.categoryId}&coursesId=${b.coursesId}&login=${b.login}&questionId=${e.question_id}&isFullScreen=${(0,rl.vp)()}${Rl.current||""}&ip_limit=${d==null?void 0:d.ip_limit}&ip_bind=${d==null?void 0:d.ip_bind}&ip_bind_type=${d==null?void 0:d.ip_bind_type}`),Xl("block")),(s==null?void 0:s.status)===-3?(0,K.eF)():(s==null?void 0:s.status)===2?xt(s==null?void 0:s.message,e.question_id,e.is_jupyter_lab,e.is_jupyter):(s==null?void 0:s.status)===3&&Ft(s==null?void 0:s.message)}),xt=(e,s,c,m)=>{e=e!=null&&e.includes(".json")?e:`${e}.json`,te.default.confirm({centered:!0,title:"\u63D0\u793A",icon:null,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:n.createElement("div",null,"\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"),onOk:()=>z(void 0,null,function*(){const o=yield(0,ye.$Q)({url:e});if(!o)return;de.ZP.success("\u91CD\u7F6E\u6210\u529F\uFF0C\u6B63\u5728\u8FDB\u5165\u5B9E\u8DF5\u9879\u76EE\uFF01");const _=yield(0,Je.Ir)({id:o.shixun_identifier});if(_!=null&&_.game_identifier){sn({shixun_identifier:_==null?void 0:_.game_identifier,question_id:s,is_jupyter_lab:c,is_jupyter:m});return}(_==null?void 0:_.status)===2?xt(_==null?void 0:_.message,s,c,m):(_==null?void 0:_.status)===3&&Ft(_==null?void 0:_.message)})})},Ft=e=>{te.default.confirm({centered:!0,title:"\u63D0\u793A",icon:null,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:n.createElement("div",null,"\u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E",e,"\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01")})},as=e=>z(void 0,null,function*(){var s;const c=yield(0,ye.o3)({exercise_user_id:(s=L.exerciseUserInfo)==null?void 0:s.exercise_user_id,shixun_id:e.shixun_id});let m;c!=null&&c.redo?m=te.default.confirm({width:530,title:"\u63D0\u793A",icon:null,centered:!0,okText:"\u786E\u5B9A",cancelText:"\u518D\u60F3\u60F3",content:n.createElement("div",null,"\u60A8\u4E4B\u524D\u5DF2\u7ECF\u6311\u6218\u8FC7\u8BE5\u5B9E\u8BAD\uFF0C\u8003\u8BD5\u8FC7\u7A0B\u4E2D\u9700\u8981\u91CD\u65B0\u6311\u6218"),onCancel:()=>{m.destroy()},onOk:()=>z(void 0,null,function*(){const o=yield(0,ye.$Q)({id:c==null?void 0:c.myshixun_identifier,url:c==null?void 0:c.url});if(o){Ul();const _=(0,au.cloneDeep)(t==null?void 0:t.exercise_question_types),f=_==null?void 0:_.findIndex(B=>B.question_type===5);_[f].items.find(B=>B.question_id===e.question_id).redo=!1,_[f].items.find(B=>B.question_id===e.question_id).shixun_identifier=o.shixun_identifier,t.exercise_question_types=_,Ze(t);const h=Ie(re({},e),{shixun_identifier:o.shixun_identifier});sn(h)}})}):(Ul(),sn(e))}),os=e=>z(void 0,null,function*(){if(e.hack_identifier){const s=yield(0,ye.nF)({id:e.hack_identifier});(s==null?void 0:s.status)===0&&(Ul(),Tl(`/myproblems/${s.identifier}?type=exercises&exercisesId=${b.categoryId}&coursesId=${b.coursesId}&login=${b.login}&questionId=${e.question_id}${Rl.current||""}`),Xl("block"))}}),tl=(e,s,c,m,o,_,f)=>z(void 0,null,function*(){var h,B;vl(!1),f||el(!0);let p,P={questionId:e,exercise_choice_id:s,answer_text:c};if(((d==null?void 0:d.ip_limit)==="inner"||d.ip_bind&&d.ip_bind_type)&&(p=yield(0,Y.y)({ip_limit:d==null?void 0:d.ip_limit,ip_bind:d==null?void 0:d.ip_bind,ip_bind_type:d==null?void 0:d.ip_bind_type})),o&&(P.kp_content=o),o&&(P.kp_clazz=_),!e){console.error("handleSave no questionId params");return}P.ip=p;const y=yield(0,ye.oX)(P);return(h=y==null?void 0:y.alert)!=null&&h.length&&((B=y==null?void 0:y.alert)==null||B.map(v=>{te.default.warn({title:"\u63D0\u793A",autoFocusButton:null,content:v})})),(y==null?void 0:y.status)===0?(m&&m(),Vl()):(y==null?void 0:y.status)===-1?setTimeout(()=>{Te()},1e3):(y==null?void 0:y.status)===-2?en(y):(y==null?void 0:y.status)===-3?(y.status=-1,en(y)):(y==null?void 0:y.status)===-4?Vl():(y==null?void 0:y.status)===-5?S({type:"exercise/setActionTabs",payload:{key:"student-unlock",exerciseParams:Ie(re({},d),{id:b.categoryId,errorMessage:y==null?void 0:y.message})}}):de.ZP.warning(y.message||"\u8BD5\u5377\u5DF2\u622A\u6B62\uFF0C\u5DF2\u81EA\u52A8\u4EA4\u5377"),el(!1),y}),Bt=e=>z(void 0,null,function*(){var s,c,m,o;const _=yield(0,ye.PT)(re({},b)),f=_!=null&&_.left_time?Date.now()+(_==null?void 0:_.left_time)*1e3:null;(Ol==null?void 0:Ol.question_type)==8&&!bl&&(yield Hl(),vl(!0));const h=yield(0,ye.Vj)({id:b.categoryId});if(h)if(te.default.destroyAll(),console.log("res===",h,Ol,bl),h.question_undo!==0||h.oj_undo!==0){let B;if(h.question_undo>0){const p=n.createElement("span",null,"\u6709",n.createElement("span",{className:a.orangeNum},h.question_undo),"\u9898\u672A\u5B8C\u6210");if(h.oj_undo>0||h.shixun_undo>0){const y=[{type:((c=(s=t==null?void 0:t.exercise_question_types)==null?void 0:s.find(v=>v.question_type==6))==null?void 0:c.name)||"\u7F16\u7A0B\u9898",num:h.oj_undo},{type:((o=(m=t==null?void 0:t.exercise_question_types)==null?void 0:m.find(v=>v.question_type==5))==null?void 0:o.name)||"\u5B9E\u8BAD\u9898",num:h.shixun_undo}].filter(v=>v.num>0);B=n.createElement("div",null,p,"\uFF08\u5176\u4E2D\u6709",y.map((v,O)=>n.createElement("span",null,n.createElement("span",{className:a.orangeNum},v==null?void 0:v.num),"\u4E2A",v==null?void 0:v.type,O!==(y==null?void 0:y.length)-1?"\u3001":"")),"\uFF09")}}te.default.confirm({width:530,title:"\u63D0\u793A",icon:null,closable:!0,centered:!0,okText:e?"\u77E5\u9053\u4E86":"\u786E\u8BA4\u4EA4\u5377",cancelText:"\u53D6\u6D88",okButtonProps:{loading:nn},content:n.createElement("div",null,B,e?`\u5728${Ue()(h.end_time).format("YYYY-MM-DD HH:mm")}\u4E4B\u524D\uFF0C\u5141\u8BB8\u4FEE\u6539\u7B54\u9898`:f?`\u4F60\u672C\u573A\u8003\u8BD5\u5269\u4F59\u65F6\u95F4\u8FD8\u6709${(0,K.li)((f-new Date().getTime())/1e3)} \uFF0C\u786E\u8BA4\u63D0\u524D\u4EA4\u5377\u5417\uFF1F`:"\u63D0\u4EA4\u540E\u65E0\u6CD5\u518D\u4FEE\u6539\u7B54\u9898\uFF0C\u662F\u5426\u786E\u8BA4\u63D0\u4EA4\uFF1F"),onOk:()=>z(void 0,null,function*(){dl(!1),Bl(!1),e?d!=null&&d.screen_open?de.ZP.success("\u4FDD\u5B58\u6210\u529F"):Te():(Ll(!0),Kl())})})}else te.default.confirm({width:530,title:"\u63D0\u793A",icon:null,centered:!0,okText:e?"\u77E5\u9053\u4E86":"\u786E\u8BA4\u4EA4\u5377",cancelText:"\u53D6\u6D88",okButtonProps:{loading:nn},content:n.createElement("div",null,e?`\u5728${Ue()(h.end_time).format("YYYY-MM-DD HH:mm")}\u4E4B\u524D\uFF0C\u5141\u8BB8\u4FEE\u6539\u7B54\u9898`:f?`\u4F60\u672C\u573A\u8003\u8BD5\u5269\u4F59\u65F6\u95F4\u8FD8\u6709${(0,K.li)((f-new Date().getTime())/1e3)} \uFF0C\u786E\u8BA4\u63D0\u524D\u4EA4\u5377\u5417\uFF1F`:"\u63D0\u4EA4\u540E\u65E0\u6CD5\u518D\u4FEE\u6539\u7B54\u9898\uFF0C\u662F\u5426\u786E\u8BA4\u63D0\u4EA4\uFF1F"),onOk:()=>z(void 0,null,function*(){dl(!1),Bl(!1),e?d!=null&&d.screen_open?de.ZP.success("\u4FDD\u5B58\u6210\u529F"):Te():(Ll(!0),Kl())})})}),wt=e=>n.createElement("div",null,n.createElement(ke.Z,{strokeColor:{from:"#3061D0",to:"#63E0FB"},status:"active",percent:e}),n.createElement("div",{className:"c-grey-c tc mt10 mb20"},"\u6B63\u5728\u5224\u5206\u4E2D\u2026")),is=()=>{let e=0,s=te.default.info({title:"\u4EA4\u5377\u4E2D",icon:null,className:"modal-footer-none",content:wt(e)}),c=setInterval(()=>{e<=100?(e+=2,s.update({content:wt(e)})):(s.destroy(),clearInterval(c))},50)},Kl=()=>z(void 0,null,function*(){if(nn||Cl.current)return;Cl.current=!0;const e=yield(0,ye.VL)({categoryId:b.categoryId,commit_method:1});yield S({type:"exercise/setActionTabs",payload:re({},{removeEventListenerExitScreen:!0})}),Ll(!1),(e==null?void 0:e.status)===0&&(is(),de.ZP.success(e==null?void 0:e.message),ut(!1),setTimeout(()=>{var s,c,m,o,_;te.default.info({centered:!0,title:"\u4EA4\u5377\u6210\u529F",className:`${a.commitModal}`,width:520,icon:null,content:n.createElement("div",null,n.createElement(D.Z,{className:"mb20",gutter:20},n.createElement(x.Z,{span:12,className:a.commitItem},n.createElement("span",{className:a.commitInfoLabel},"\u59D3\u540D"),n.createElement("span",{className:a.commitInfoValue,title:(s=t==null?void 0:t.exercise)==null?void 0:s.user_name},((c=t==null?void 0:t.exercise)==null?void 0:c.user_name)||"- -")),n.createElement(x.Z,{span:12,className:a.commitItem},n.createElement("span",{className:a.commitInfoLabel},"\u4F5C\u7B54\u65F6\u957F"),n.createElement("span",{className:a.commitInfoValue},(m=e==null?void 0:e.data)==null?void 0:m.user_exercise_time))),n.createElement(D.Z,{gutter:20},n.createElement(x.Z,{span:12,className:a.commitItem},n.createElement("span",{className:a.commitInfoLabel},"\u5B66\u53F7"),n.createElement("span",{className:a.commitInfoValue},((o=t==null?void 0:t.exercise)==null?void 0:o.student_id)||"- -")),n.createElement(x.Z,{span:12,className:a.commitItem},n.createElement("span",{className:a.commitInfoLabel},"\u4EA4\u5377\u65F6\u95F4"),n.createElement("span",{className:a.commitInfoValue},(_=e==null?void 0:e.data)==null?void 0:_.commit_time)))),okText:"\u786E\u5B9A",maskClosable:!1,keyboard:!1,onOk:()=>{(0,rl.BU)(),Te()}})},3e3))}),cs=(e,s,c,m,o)=>z(void 0,null,function*(){tl(s,e,null,()=>{var _,f,h,B;if(m.user_answer=[],m.user_answer.push(e),o!=null&&o.question_id){let p=(_=o==null?void 0:o.sub_exercise_questions)==null?void 0:_.filter(v=>{var O;return((O=v.user_answer)==null?void 0:O.length)===0});const P=(f=o==null?void 0:o.sub_exercise_questions)==null?void 0:f.filter(v=>v.question_type==3),y=P.length>0?P.every(v=>{var O;return(v==null?void 0:v.multi_count)==((O=v==null?void 0:v.user_answer)==null?void 0:O.length)})?1:P.some(v=>{var O;return(v==null?void 0:v.multi_count)>((O=v==null?void 0:v.user_answer)==null?void 0:O.length)})?2:0:1;t.question_status.find(v=>v.ques_id===(o==null?void 0:o.question_id)).ques_status=(p==null?void 0:p.length)===((h=o==null?void 0:o.sub_exercise_questions)==null?void 0:h.length)?0:(p==null?void 0:p.length)>0&&(p==null?void 0:p.length)<((B=o==null?void 0:o.sub_exercise_questions)==null?void 0:B.length)?2:y}else t.question_status.find(p=>p.ques_id===s).ques_status=e?1:0;Ze(re({},t))})}),Rs=(e,s,c,m,o)=>z(void 0,null,function*(){tl(m.question_id,e,null,()=>{var _,f,h;m.user_answer=[],m.user_answer.push(e),o.user_answer=[...m.user_answer];let B=(_=o==null?void 0:o.sub_exercise_questions)==null?void 0:_.filter(p=>{var P;return((P=p.user_answer)==null?void 0:P.length)===0});t.question_status.find(p=>p.ques_id===s).ques_status=(B==null?void 0:B.length)===((f=o==null?void 0:o.sub_exercise_questions)==null?void 0:f.length)?0:(B==null?void 0:B.length)>0&&(B==null?void 0:B.length)<((h=o==null?void 0:o.sub_exercise_questions)==null?void 0:h.length)?2:1,Ze(re({},t))})}),ds=(e,s,c,m)=>{e!=null&&e.length&&tl(s,e,null,()=>{var o,_,f,h;if(c.user_answer=e,m!=null&&m.question_id){let B=(o=m==null?void 0:m.sub_exercise_questions)==null?void 0:o.filter(y=>{var v;return((v=y.user_answer)==null?void 0:v.length)===0});const p=(_=m==null?void 0:m.sub_exercise_questions)==null?void 0:_.filter(y=>y.question_type==3),P=p.length>0?p.every(y=>{var v;return(y==null?void 0:y.multi_count)==((v=y==null?void 0:y.user_answer)==null?void 0:v.length)})?1:p.some(y=>{var v;return(y==null?void 0:y.multi_count)>((v=y==null?void 0:y.user_answer)==null?void 0:v.length)})?2:0:1;t.question_status.find(y=>y.ques_id===(m==null?void 0:m.question_id)).ques_status=(B==null?void 0:B.length)===((f=m==null?void 0:m.sub_exercise_questions)==null?void 0:f.length)?0:(B==null?void 0:B.length)>0&&(B==null?void 0:B.length)<((h=m==null?void 0:m.sub_exercise_questions)==null?void 0:h.length)?2:P}else t.question_status.find(B=>B.ques_id===s).ques_status=e!=null&&e.length?1:0;Ze(re({},t))})},_s=(e,s,c,m,o,_)=>z(void 0,null,function*(){return e.replaceAll(" ","")?yield tl(c,s,e,()=>{var h,B,p,P;let y={choice_id:s,answer_text:e};if(o.user_answer.filter(v=>v.choice_id!=s)?o.user_answer.splice(s-1,1,y):o.user_answer.push(y),_!=null&&_.question_id){let v=(h=_==null?void 0:_.sub_exercise_questions)==null?void 0:h.filter(j=>{var F;return((F=j.user_answer)==null?void 0:F.length)===0});const O=(B=_==null?void 0:_.sub_exercise_questions)==null?void 0:B.filter(j=>j.question_type==3),W=O.length>0?O.every(j=>{var F;return(j==null?void 0:j.multi_count)==((F=j==null?void 0:j.user_answer)==null?void 0:F.length)})?1:O.some(j=>{var F;return(j==null?void 0:j.multi_count)>((F=j==null?void 0:j.user_answer)==null?void 0:F.length)})?2:0:1;t.question_status.find(j=>j.ques_id===(_==null?void 0:_.question_id)).ques_status=(v==null?void 0:v.length)===((p=_==null?void 0:_.sub_exercise_questions)==null?void 0:p.length)?0:(v==null?void 0:v.length)>0&&(v==null?void 0:v.length)<((P=_==null?void 0:_.sub_exercise_questions)==null?void 0:P.length)?2:W}else t.question_status.find(v=>v.ques_id===c).ques_status=m.every(v=>!!v.answer_text)?1:t.question_status.find(v=>v.ques_id===c).ques_status=m.some(v=>!!v.answer_text)?2:0;Ze(re({},t))}):(Vl(),{status:-4,message:"\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"})}),vs=(e,s,c,m,o)=>z(void 0,null,function*(){return yield tl(c,s,e,()=>{t.question_status.find(h=>h.ques_id===c).ques_status=m.every(h=>!!h.value)?1:t.question_status.find(h=>h.ques_id===c).ques_status=m.some(h=>!!h.value)?2:0;let f={choice_id:s,answer_text:e};o.user_answer.filter(h=>h.choice_id!=s)?o.user_answer.splice(s-1,1,f):o.user_answer.push(f),o.repeat_answer||(o.israp=!0),Ze(re({},t))},void 0,void 0,!0)}),ms=(e,s,c,m,o)=>{if(!e.replaceAll(" ","")){Vl();return}tl(s,null,e,()=>{var _,f,h,B;if(c.user_answer=[],c.user_answer.push(e),o!=null&&o.question_id){let p=(_=o==null?void 0:o.sub_exercise_questions)==null?void 0:_.filter(v=>{var O;return((O=v.user_answer)==null?void 0:O.length)===0});const P=(f=o==null?void 0:o.sub_exercise_questions)==null?void 0:f.filter(v=>v.question_type==3),y=P.length>0?P.every(v=>{var O;return(v==null?void 0:v.multi_count)==((O=v==null?void 0:v.user_answer)==null?void 0:O.length)})?1:P.some(v=>{var O;return(v==null?void 0:v.multi_count)>((O=v==null?void 0:v.user_answer)==null?void 0:O.length)})?2:0:1;t.question_status.find(v=>v.ques_id===(o==null?void 0:o.question_id)).ques_status=(p==null?void 0:p.length)===((h=o==null?void 0:o.sub_exercise_questions)==null?void 0:h.length)?0:(p==null?void 0:p.length)>0&&(p==null?void 0:p.length)<((B=o==null?void 0:o.sub_exercise_questions)==null?void 0:B.length)?2:y}else t.question_status.find(p=>p.ques_id===s).ques_status=e?1:0;Ze(re({},t))},void 0,void 0,m)},rn=(e,s,c)=>{var m,o,_,f,h,B,p;let P="";const y=(e==null?void 0:e.question_type)===0||(e==null?void 0:e.question_type)===1;y&&((m=e==null?void 0:e.question_choices)==null||m.forEach((O,W)=>{O.standard_boolean&&(P=P+ol[W])}));const v=((o=t==null?void 0:t.exercise)==null?void 0:o.user_exercise_status)===1||!e.repeat_answer&&((_=e==null?void 0:e.user_answer)==null?void 0:_.length)>0&&e.ques_status!==0;return n.createElement("div",null,n.createElement("div",{className:a.baseMargin},n.createElement($e.ZP.Group,{disabled:v,defaultValue:(f=e==null?void 0:e.user_answer)==null?void 0:f[0],onChange:O=>cs(O.target.value,e==null?void 0:e.question_id,s,e,c),className:e.user_score&&`edu-radio-${e.user_score===e.question_score?"green":"red"}`},(h=e==null?void 0:e.question_choices)==null?void 0:h.map((O,W)=>{const F=e.question_type==2?"":`${ol[W]}.`;return n.createElement("div",{className:a.answerWrap,key:W},n.createElement($e.ZP,{className:a.noWrap,value:O==null?void 0:O.choice_id},n.createElement(D.Z,{wrap:!1,align:"middle"},n.createElement(x.Z,null,n.createElement("span",{style:{color:"#333333"},className:"font16 mr3"},F)),n.createElement(x.Z,null,n.createElement(le.Z,{className:a.renderHtml,value:O==null?void 0:O.choice_text})))))}))),((0,ee.GJ)()||(0,ee.dE)()&&((B=t==null?void 0:t.exercise)==null?void 0:B.user_exercise_status)>0&&((p=t==null?void 0:t.exercise)==null?void 0:p.open_score))&&n.createElement(D.Z,{justify:"end",className:"mb20",align:"middle"},n.createElement("span",{className:"font14",style:{color:"#6A7283"}},"\u5F97\u5206"),n.createElement("span",{className:"font14 ml10"},(e==null?void 0:e.user_score)&&n.createElement("span",null,n.createElement("span",{className:Nn[Number(e==null?void 0:e.answer_status)]||"c-orange-ff9"},e==null?void 0:e.user_score),n.createElement("span",{style:{marginLeft:5,color:"#6A7283"}},"\u5206")),!(e!=null&&e.user_score)&&n.createElement("span",{className:"c-red"},"\u672A\u8BC4"))),(e==null?void 0:e.standard_answer_show)&&n.createElement("div",{className:a.analysisWrap},n.createElement("div",{className:a.greyBg},n.createElement(D.Z,{className:"mb20"},n.createElement(x.Z,{className:"font14 mr10",style:{color:"#6A7283"}},"\u3010\u7B54\u6848\u3011"),n.createElement(x.Z,null,y?P:e==null?void 0:e.standard_answer_show)),n.createElement(D.Z,null,n.createElement("span",{className:"font14 mr10",style:{color:"#6A7283"}},"\u3010\u89E3\u6790\u3011"),n.createElement(le.Z,{className:a.renderHtml,value:e==null?void 0:e.analysis})))))},fs=(e,s,c)=>{var m,o;const _=((m=t==null?void 0:t.exercise)==null?void 0:m.user_exercise_status)===1||!e.repeat_answer&&e.ques_status!==0;return n.createElement("div",null,(o=e==null?void 0:e.sub_exercise_questions)==null?void 0:o.map((f,h)=>{var B;let p="";return(B=f==null?void 0:f.question_choices)==null||B.forEach((P,y)=>{P.standard_boolean&&(p=p+ol[y])}),n.createElement("div",{className:`${a.baseMargin} ${a.singleItem} mb20`,key:h},n.createElement("div",{style:{display:"flex",alignItems:"baseline",userSelect:"none",marginBottom:40}},n.createElement("span",{style:{flexShrink:0,color:"#999999"},className:"font14"},"\uFF08",f==null?void 0:f.question_score,"\u5206\uFF09"),n.createElement("span",{style:{flexShrink:0,marginRight:6},className:"font16"},c+1+"."+(h+1)),n.createElement(le.Z,{value:f==null?void 0:f.question_title})),((f==null?void 0:f.question_type)==0||(f==null?void 0:f.question_type)==2)&&rn(f,f==null?void 0:f.question_type,e),(f==null?void 0:f.question_type)==1&&bt(f,f==null?void 0:f.question_type,e),(f==null?void 0:f.question_type)==3&&Ct(f,f==null?void 0:f.question_type,e),(f==null?void 0:f.question_type)==4&&At(f,f==null?void 0:f.question_type,e))}))};console.log("----",t);const bt=(e,s,c)=>{var m,o,_,f,h,B;let p="";const P=(e==null?void 0:e.question_type)===0||(e==null?void 0:e.question_type)===1;P&&((m=e==null?void 0:e.question_choices)==null||m.forEach((v,O)=>{v.standard_boolean&&(p=p+ol[O])}));const y=((o=t==null?void 0:t.exercise)==null?void 0:o.user_exercise_status)===1||!e.repeat_answer&&((_=e==null?void 0:e.user_answer)==null?void 0:_.length)>0&&e.ques_status!==0;return n.createElement("div",null,n.createElement("div",{className:a.baseMargin},n.createElement(Re.default.Group,{disabled:y,defaultValue:e==null?void 0:e.user_answer,style:{flexDirection:"column"},onChange:v=>ds(v,e==null?void 0:e.question_id,e,c),className:e.user_score&&`edu-checkbox-${e.user_score===e.question_score?"green":"red"}`},(f=e==null?void 0:e.question_choices)==null?void 0:f.map((v,O)=>{const W=`${ol[O]}.`;return n.createElement("div",{className:a.answerWrap},n.createElement(Re.default,{value:v==null?void 0:v.choice_id},n.createElement(D.Z,{wrap:!1,align:"middle"},n.createElement(x.Z,null,n.createElement("span",{style:{color:"#333333",whiteSpace:"nowrap"},className:"font16 mr3"},W)),n.createElement(x.Z,null,n.createElement(le.Z,{className:a.renderHtml,value:v==null?void 0:v.choice_text})))))}))),((0,ee.GJ)()||(0,ee.dE)()&&((h=t==null?void 0:t.exercise)==null?void 0:h.user_exercise_status)>0&&((B=t==null?void 0:t.exercise)==null?void 0:B.open_score))&&n.createElement(D.Z,{justify:"end",className:"mb20",align:"middle"},n.createElement("span",{className:"font14",style:{color:"#6A7283"}},"\u5F97\u5206"),n.createElement("span",{className:"font14 ml10"},(e==null?void 0:e.user_score)&&n.createElement("span",null,n.createElement("span",{className:Nn[Number(e==null?void 0:e.answer_status)]||"c-orange-ff9"},e==null?void 0:e.user_score),n.createElement("span",{style:{marginLeft:5,color:"#6A7283"}},"\u5206")),!(e!=null&&e.user_score)&&n.createElement("span",{className:"c-red"},"\u672A\u8BC4"))),(e==null?void 0:e.standard_answer_show)&&n.createElement("div",{className:a.analysisWrap},n.createElement("div",{className:a.greyBg},n.createElement(D.Z,{className:"mb20"},n.createElement(x.Z,{className:"font14 mr10",style:{color:"#6A7283"}},"\u3010\u7B54\u6848\u3011"),n.createElement(x.Z,null,P?p:e==null?void 0:e.standard_answer_show)),n.createElement(D.Z,null,n.createElement("span",{className:"font14 mr10",style:{color:"#6A7283"}},"\u3010\u89E3\u6790\u3011"),n.createElement(le.Z,{className:a.renderHtml,value:e==null?void 0:e.analysis})))))},Ct=(e,s,c)=>n.createElement(Qt,{item:e,sign:Ce,answerData:t,onBlur:(m,o,_)=>z(void 0,null,function*(){return yield _s(m,o,e==null?void 0:e.question_id,_,e,c)})}),At=(e,s,c)=>_l?n.createElement(yl,{item:e,answerData:t,onBlur:(m,o,_)=>tl(e==null?void 0:e.question_id,null,m,void 0,o,_),isEducation:_l}):n.createElement(ql,{item:e,answerData:t,onBlur:(m,o)=>ms(m,e==null?void 0:e.question_id,e,o,c),isEducation:_l,sign:Ce}),ps=(e,s)=>n.createElement(jt,{item:e,answerData:t,exerciseId:b.categoryId,coursesId:b.coursesId}),Es=(e,s)=>n.createElement(Lt,{item:e,answerData:t}),ys=(e,s)=>n.createElement(uu,{setIsSubmitCode:vl,item:e,answerData:t,onBlur:(c,m,o)=>z(void 0,null,function*(){return yield vs(c,m,e==null?void 0:e.question_id,o,e)})}),gs=(e,s,c)=>{var m,o;const _=(m=t==null?void 0:t.exercise_question_types)==null?void 0:m.find(f=>f.question_type===s);return n.createElement("div",{className:a.answerSheetWrap},n.createElement("div",{className:a.answerSheetQuestionTitle,onClick:()=>{cl[s]=!cl[s],Du(re({},cl))}},!cl[s]&&n.createElement(Ke.Z,null),cl[s]&&n.createElement(xe.Z,null),n.createElement("span",{className:"ml5 c-grey-666"},e)),!cl[s]&&n.createElement(D.Z,{className:a.answerSheet,gutter:[20,20],key:s},(o=_==null?void 0:_.items)==null?void 0:o.map(function(f,h){var B,p,P,y,v,O;if(f.question_type===s)return n.createElement(x.Z,null,n.createElement("div",{onClick:()=>{if(!(c===H&&h===V)){if(Ce.current){Ce.current="appoint",an.current={oneindex:c,twoindex:h};return}Dt({oneindex:c,twoindex:h})}},key:h,className:`
${a.answerSheetItem}
${(B=t==null?void 0:t.question_status)!=null&&B.some(W=>{var j,F;return W.ques_id===f.question_id&&(W==null?void 0:W.ques_status)===1&&((j=t==null?void 0:t.exercise)==null?void 0:j.exercise_status)!==3&&!((F=t==null?void 0:t.exercise)!=null&&F.open_score_commited)})?a.active:""}
${(p=t==null?void 0:t.question_status)!=null&&p.some(W=>{var j,F;return W.ques_id===f.question_id&&(W==null?void 0:W.ques_status)===2&&((j=t==null?void 0:t.exercise)==null?void 0:j.exercise_status)!==3&&!((F=t==null?void 0:t.exercise)!=null&&F.open_score_commited)})?a.partialActive:""}
${(P=t==null?void 0:t.question_status)!=null&&P.some(W=>{var j,F;return W.ques_id===f.question_id&&(W==null?void 0:W.score_status)===1&&(((j=t==null?void 0:t.exercise)==null?void 0:j.exercise_status)===3||((F=t==null?void 0:t.exercise)==null?void 0:F.open_score_commited))})?a.yes:""}
${(y=t==null?void 0:t.question_status)!=null&&y.some(W=>{var j,F;return W.ques_id===f.question_id&&(W==null?void 0:W.score_status)===2&&(((j=t==null?void 0:t.exercise)==null?void 0:j.exercise_status)===3||((F=t==null?void 0:t.exercise)==null?void 0:F.open_score_commited))})?a.no:""}
${(v=t==null?void 0:t.question_status)!=null&&v.some(W=>{var j,F;return W.ques_id===f.question_id&&(W==null?void 0:W.score_status)===3&&(((j=t==null?void 0:t.exercise)==null?void 0:j.exercise_status)===3||((F=t==null?void 0:t.exercise)==null?void 0:F.open_score_commited))})?a.bf:""}
${c===H&&h===V?a.selected:""}
`},n.createElement("span",{className:a.qindex},h+1),((O=t==null?void 0:t.question_status)==null?void 0:O.some(W=>{var j;return W.ques_id===f.question_id&&(W==null?void 0:W.ques_status)===2&&((j=t==null?void 0:t.exercise)==null?void 0:j.exercise_status)!==3}))&&n.createElement("div",{style:{height:12,background:"rgba(22,93,255,0.4)",position:"absolute",width:"100%",bottom:0}}),f.is_marked&&n.createElement("i",{className:`iconfont icon-biaoji1 ${a.markIcon}`})))})))},hs=(e,s)=>{var c,m,o,_;let f="";return((e==null?void 0:e.question_type)===0||(e==null?void 0:e.question_type)===1)&&((c=e==null?void 0:e.question_choices)==null||c.forEach((B,p)=>{B.standard_boolean&&(f=f+ol[p])})),n.createElement("div",{className:a.questionItem,id:`Anchor_${e==null?void 0:e.question_type}_${s}`},n.createElement("div",{style:{display:"flex",alignItems:"baseline",marginBottom:40,userSelect:"none"}},n.createElement("span",{className:`${a.questionScore} mr10`},e==null?void 0:e.question_score,"\u5206"),n.createElement("span",{className:`font16 ${a.noWrap}`},s+1,"\u3001"),n.createElement(le.Z,{value:(e==null?void 0:e.question_type)===8?e==null?void 0:e.description:e==null?void 0:e.question_title}),!!((m=e==null?void 0:e.schools)!=null&&m.length)&&n.createElement(G.Z,{title:"\u8BE5\u5B9E\u8BAD\u9898\u9762\u5411\u6307\u5B9A\u5355\u4F4D\u5F00\u653E"},n.createElement("i",{className:"iconfont icon-zhidinggongkai1 line24 font18 c-orange"}))),(e==null?void 0:e.question_type)==0&&rn(e,e==null?void 0:e.question_type),(e==null?void 0:e.question_type)==2&&rn(e,e==null?void 0:e.question_type),(e==null?void 0:e.question_type)==1&&bt(e,e==null?void 0:e.question_type),(e==null?void 0:e.question_type)==3&&Ct(e,e==null?void 0:e.question_type),(e==null?void 0:e.question_type)==4&&At(e,e==null?void 0:e.question_type),(e==null?void 0:e.question_type)==5&&ps(e,e==null?void 0:e.question_type),(e==null?void 0:e.question_type)==6&&Es(e,e==null?void 0:e.question_type),(e==null?void 0:e.question_type)==7&&fs(e,e==null?void 0:e.question_type,s),(e==null?void 0:e.question_type)==8&&ys(e,e==null?void 0:e.question_type),(e==null?void 0:e.answer_comments)&&n.createElement(ou,{hideScore:!0,list:e==null?void 0:e.answer_comments}),(e==null?void 0:e.question_type)==5&&((o=t==null?void 0:t.exercise)==null?void 0:o.user_exercise_status)===0&&(e==null?void 0:e.answer_status)!=3&&n.createElement(D.Z,{justify:"end",className:"mt20"},n.createElement(gl.Z,{type:"primary",className:a.toIframeBtn,onClick:()=>z(void 0,null,function*(){return yield as(e)})},"\u8FDB\u5165\u7B54\u9898")),(0,ee.dE)()&&((_=t==null?void 0:t.exercise)==null?void 0:_.user_exercise_status)===0&&(e==null?void 0:e.question_type)==6&&n.createElement(D.Z,{justify:"end",className:"mt20"},n.createElement(gl.Z,{type:"primary",className:a.toIframeBtn,onClick:()=>os(e)},"\u8FDB\u5165\u7B54\u9898")))},xs=(e,s)=>n.createElement(l.Fragment,null,gs((e==null?void 0:e.name)||hu.f[e.question_type].name,e.question_type,s)),Ce=(0,l.useRef)(!1),an=(0,l.useRef)({}),Nl=(0,l.useRef)(),on=(0,l.useRef)({}),Nt=()=>{var e,s,c,m,o,_,f,h,B;window.blur();const p=(c=(s=(e=t.exercise_question_types)==null?void 0:e[H])==null?void 0:s.items)==null?void 0:c[V];if(!jl&&((m=t==null?void 0:t.exercise)==null?void 0:m.user_exercise_status)===0&&(0,ee.dE)()&&!(p!=null&&p.repeat_answer)&&((o=p==null?void 0:p.user_answer)==null?void 0:o.length)>0&&(p==null?void 0:p.ques_status)===0){Nl.current="prev",Al(!0);return}!(p!=null&&p.repeat_answer)&&((_=p==null?void 0:p.user_answer)==null?void 0:_.length)>0&&(p.ques_status=1),Wl.current.scrollTo({top:0,left:0,behavior:"smooth"}),V===0?(H-=1,V=t.exercise_question_types[H].items.length-1):V-=1,(p==null?void 0:p.question_type)==8&&!bl&&setTimeout(()=>{Hl(p)},500),kl((B=(h=(f=t==null?void 0:t.exercise_question_types)==null?void 0:f[H])==null?void 0:h.items)==null?void 0:B[V]),vl(!1),ml(H),fl(V)},It=()=>{var e,s,c,m,o,_,f,h,B;window.blur();const p=(c=(s=(e=t.exercise_question_types)==null?void 0:e[H])==null?void 0:s.items)==null?void 0:c[V];if(!jl&&((m=t==null?void 0:t.exercise)==null?void 0:m.user_exercise_status)===0&&(0,ee.dE)()&&!(p!=null&&p.repeat_answer)&&((o=p==null?void 0:p.user_answer)==null?void 0:o.length)>0&&(p==null?void 0:p.ques_status)===0){Nl.current="next",Al(!0);return}!(p!=null&&p.repeat_answer)&&((_=p==null?void 0:p.user_answer)==null?void 0:_.length)>0&&(p.ques_status=1),Wl.current.scrollTo({top:0,left:0,behavior:"smooth"}),t.exercise_question_types[H].items.length-1===V?(H=H+1,V=0):V=V+1,(p==null?void 0:p.question_type)==8&&!bl&&setTimeout(()=>{Hl(p)},500),kl((B=(h=(f=t==null?void 0:t.exercise_question_types)==null?void 0:f[H])==null?void 0:h.items)==null?void 0:B[V]),vl(!1),ml(H),fl(V)},Dt=e=>{var s,c,m,o,_,f,h,B,p;const P=e||an.current,y=(m=(c=(s=t.exercise_question_types)==null?void 0:s[H])==null?void 0:c.items)==null?void 0:m[V];if(!jl&&((o=t==null?void 0:t.exercise)==null?void 0:o.user_exercise_status)===0&&(0,ee.dE)()&&!(y!=null&&y.repeat_answer)&&((_=y==null?void 0:y.user_answer)==null?void 0:_.length)>0&&(y==null?void 0:y.ques_status)===0){Nl.current="appoint",on.current=P,Al(!0);return}!(y!=null&&y.repeat_answer)&&((f=y==null?void 0:y.user_answer)==null?void 0:f.length)>0&&(y.ques_status=1),(y==null?void 0:y.question_type)==8&&!bl&&setTimeout(()=>{Hl(y)},500),kl((p=(B=(h=t==null?void 0:t.exercise_question_types)==null?void 0:h[P==null?void 0:P.oneindex])==null?void 0:B.items)==null?void 0:p[P==null?void 0:P.twoindex]),vl(!1),ml(P==null?void 0:P.oneindex),fl(P==null?void 0:P.twoindex),Wl.current.scrollTo({top:0,left:0,behavior:"smooth"})},Pt=()=>z(void 0,null,function*(){var e;if(Ce.current){Ce.current="refresh";return}const s=yield Qe();(e=t==null?void 0:t.exercise)!=null&&e.left_time&&(yield ht()),s!=null&&s.status||de.ZP.success("\u66F4\u65B0\u6210\u529F")}),Vl=()=>{var e;switch(Ce.current){case"prev":Nt();break;case"next":It();break;case"appoint":Dt();break;case"submit":Bt(!1);break;case"refresh":Pt();break;default:}((e=document.activeElement)==null?void 0:e.localName)==="textarea"?Ce.current=!0:Ce.current=!1,an.current={}},Fs=()=>{var e,s,c,m,o,_,f,h,B,p,P,y;const v=(s=(e=t==null?void 0:t.exercise_question_types)==null?void 0:e[H].items)==null?void 0:s[V];return n.createElement(l.Fragment,{key:H},n.createElement("div",{className:"pt20 mb20"},n.createElement("span",{className:a.questionTypeTitle},(0,K.EM)(H+1),"\u3001",(m=(c=t==null?void 0:t.exercise_question_types)==null?void 0:c[H])==null?void 0:m.name),n.createElement("span",{className:a.questionTypeInfo},"\uFF08\u5171",(_=(o=t==null?void 0:t.exercise_question_types)==null?void 0:o[H])==null?void 0:_.count,"\u9898\uFF1B",((h=(f=t==null?void 0:t.exercise_question_types)==null?void 0:f[H])==null?void 0:h.question_type)===7?`\u5305\u542B${(p=(B=t==null?void 0:t.exercise_question_types)==null?void 0:B[H])==null?void 0:p.sub_questions_count}\u5C0F\u9898`:""," \u5171",(y=(P=t==null?void 0:t.exercise_question_types)==null?void 0:P[H])==null?void 0:y.score,"\u5206\uFF09"),!(v!=null&&v.repeat_answer)&&n.createElement("span",{style:{color:"#E30000",marginLeft:20,fontSize:14}},"\u6CE8\u610F\uFF1A\u8BE5\u9898\u4F5C\u7B54\u4E4B\u540E\u4E0D\u5141\u8BB8\u4FEE\u6539\u7B54\u6848\u3002")),n.createElement(l.Fragment,{key:V},hs(v,V)))},Bs=()=>{ot(!0)};return n.createElement(se.Z,{size:"middle",spinning:Pu},Zu&&((R=t==null?void 0:t.exercise)==null?void 0:R.user_exercise_status)===0&&n.createElement(Fe.Z,{exerciseUserInfo:L.exerciseUserInfo,iframe:it,handleToDetail:Te,socket:ln,onStartScreenshot:()=>{d!=null&&d.screen_shot_open&&st(!0)},onCloseScreenshot:()=>{d!=null&&d.screen_shot_open&&st(!1)}}),n.createElement(Ae,{id:b.categoryId,startRecording:Tu,startScreenshot:Ou,onSuccuss:()=>{dl(d==null?void 0:d.screen_open),Qe()},onBack:Te}),n.createElement("iframe",{style:{display:Ru},id:"iframeShixuns",className:a.iframe,src:$u,ref:it,frameBorder:"0"}),wl.status!==-2&&wl.status!==-1&&n.createElement("div",{className:a.fixHeader},n.createElement(D.Z,{wrap:!1,align:"middle",className:"edu-container"},n.createElement(x.Z,null,(0,K.vB)((J=t==null?void 0:t.exercise)==null?void 0:J.exercise_status)),n.createElement(x.Z,{className:`${a.exerciseTitle} ml10`,title:(oe=t==null?void 0:t.exercise)==null?void 0:oe.exercise_name},(w=t==null?void 0:t.exercise)==null?void 0:w.exercise_name),n.createElement(x.Z,{style:{marginLeft:"auto"}},!((0,ee.GJ)()||(0,ee.dE)()&&((I=t==null?void 0:t.exercise)==null?void 0:I.user_exercise_status)==1)&&!!((U=t==null?void 0:t.exercise)!=null&&U.left_time)&&n.createElement("aside",{className:`${a.countDown} ${Mu}`},n.createElement("i",{className:"iconfont icon-daojishi",style:{marginRight:6}}),n.createElement("span",{className:a.cnText},"\u5269\u4F59\u7B54\u9898\u65F6\u957F"),n.createElement(bu,{value:ku,onFinish:ht}))),n.createElement(x.Z,null,!((0,ee.GJ)()||(0,ee.dE)()&&((ue=t==null?void 0:t.exercise)==null?void 0:ue.user_exercise_status)==1)&&L.actionTabs.key!=="student-unlock"&&Uu&&n.createElement(gl.Z,{className:`${a.refreshBtn} ml30`,onClick:Pt},n.createElement("span",{className:"iconfont icon-shuaxin2 mr5"}),"\u5237\u65B0")),n.createElement(x.Z,null,(0,ee.dE)()&&((ne=t==null?void 0:t.exercise)==null?void 0:ne.user_exercise_status)===0&&n.createElement(gl.Z,{className:`${a.submitButton} ml10`,type:"primary",onClick:()=>z(void 0,null,function*(){if(Ce.current){Ce.current="submit";return}yield Bt(!1)})},"\u4EA4\u5377")),n.createElement(x.Z,null,(($=t==null?void 0:t.exercise)==null?void 0:$.forbid_screen)&&n.createElement(X.ZP,{className:`${a.submitButton} ml10`,type:"primary",onClick:Bs},"\u89E3\u9501\u5207\u5C4F")),n.createElement(x.Z,null,(((Q=t==null?void 0:t.exercise)==null?void 0:Q.commit_status)==1||((ie=t==null?void 0:t.exercise)==null?void 0:ie.exercise_status)==3)&&((me=t==null?void 0:t.exercise_answer_user)==null?void 0:me.analysis)&&n.createElement("span",{className:a.teachAnalysis,onClick:()=>tn(!0)},n.createElement("i",{className:"iconfont icon-jiaoshipingjia"}),n.createElement("span",{className:"ml5"},"\u6559\u5E08\u8BC4\u4EF7"))))),n.createElement("section",{className:`edu-container ${a.wrapper} ${_l&&a.wrpAnswer}`},((pe=(M=t==null?void 0:t.exercise)==null?void 0:M.exercise_description)==null?void 0:pe.length)>0&&n.createElement(ge.Z,{className:a.exerciseAlert,description:n.createElement(D.Z,{wrap:!1,gutter:10,align:"top"},n.createElement(x.Z,{className:a.title},"\u8003\u8BD5\u987B\u77E5"),n.createElement(x.Z,{className:a.content},(ae=t==null?void 0:t.exercise)==null?void 0:ae.exercise_description)),closable:!0}),wl.status===0&&n.createElement(D.Z,{className:`${_l?"mt70":""} ${a.mainPart}`,wrap:!1},n.createElement(x.Z,{flex:ll?"280px":"0px",className:_l?"mb100":""},n.createElement("div",{className:a.leftPart},n.createElement("section",null,ll&&n.createElement(x.Z,{flex:"1",style:{background:"#fff",marginBottom:"10px",padding:"20px"}},n.createElement("div",{style:{marginBottom:15}},n.createElement("span",{style:{color:"#5F6368"}},"\u59D3\u540D"),n.createElement("span",{className:`ml10 ${a.userInfoText}`},((qe=t==null?void 0:t.exercise)==null?void 0:qe.user_name)||"- -")),n.createElement("div",null,n.createElement("span",{style:{color:"#5F6368"}},"\u5B66\u53F7"),n.createElement("span",{className:`ml10 ${a.userInfoText}`},((hl=t==null?void 0:t.exercise)==null?void 0:hl.student_id)||"- -"))),ll&&(0,ee.dE)()&&((xl=t.exercise)==null?void 0:xl.user_exercise_status)===0&&((Se=t.exercise)==null?void 0:Se.open_phone_video_recording)&&n.createElement(D.Z,{className:a.eduQrcode,style:{marginTop:10},align:"middle"},n.createElement(x.Z,null,n.createElement(ce(),{value:`https://${document.domain}/live-push.html?id=${b.categoryId}&login=${b.login}&cookie=${(0,K.ej)("_educoder_session")}`})),n.createElement(x.Z,{className:"ml15"},"\u6253\u5F00\u5FAE\u4FE1\u626B\u4E00\u626B",n.createElement("br",null),"\u5F00\u542F\u624B\u673A\u89C6\u9891\u5F55\u5236")),ll&&n.createElement("aside",{className:"bg-white"},n.createElement("aside",{className:a.answerInfo},n.createElement(D.Z,{justify:"space-between"},n.createElement(x.Z,null,"\u7B54\u9898\u8FDB\u5EA6"),n.createElement(x.Z,{className:a.answerProgress},n.createElement("span",{style:{color:"#165DFF"}},(il=(je=t==null?void 0:t.question_status)==null?void 0:je.filter(e=>e.ques_status===1))==null?void 0:il.length),n.createElement("span",{style:{color:"#999999"}},"/",(Fl=t==null?void 0:t.exercise_types)==null?void 0:Fl.q_counts))),n.createElement(D.Z,null,n.createElement(ke.Z,{strokeColor:"#165dffa6",trailColor:"#0000000d",percent:((Dn=(In=t==null?void 0:t.question_status)==null?void 0:In.filter(e=>e.ques_status===1))==null?void 0:Dn.length)/((Pn=t==null?void 0:t.exercise_types)==null?void 0:Pn.q_counts)*100,showInfo:!1})),n.createElement(D.Z,null,n.createElement(x.Z,null,n.createElement("span",{className:"c-grey-333"},"\u5171 ",n.createElement("span",{style:{color:"#165DFF"}},((qn=t==null?void 0:t.exercise_types)==null?void 0:qn.q_counts)||((Zn=(Sn=t==null?void 0:t.exercise_scores)==null?void 0:Sn.exercise_types)==null?void 0:Zn.q_counts))," \u9898\uFF1A"),n.createElement("span",{className:"c-grey-333"},"\u6EE1\u5206 ",n.createElement("span",{style:{color:"#FA6400"}},((Tn=t==null?void 0:t.exercise_types)==null?void 0:Tn.q_scores)||((kn=(On=t==null?void 0:t.exercise_scores)==null?void 0:On.exercise_types)==null?void 0:kn.q_scores))," \u5206")))),n.createElement(D.Z,{className:a.dottedLineWrapper,align:"middle"},n.createElement(x.Z,{className:a.leftHalfCircle}),n.createElement(x.Z,{flex:1,className:a.dottedLine}),n.createElement(x.Z,{className:a.rightHalfCircle})),n.createElement(D.Z,null,n.createElement(x.Z,{flex:"1"},n.createElement("aside",{className:`${a.cardList} ${($n=t.exercise)!=null&&$n.open_phone_video_recording?a.withQrcode:""}`},(Rn=t==null?void 0:t.exercise_question_types)==null?void 0:Rn.map((e,s)=>n.createElement(l.Fragment,{key:e.question_type},xs(e,s)))))))),(0,ee.dE)()&&((Mn=t==null?void 0:t.exercise)==null?void 0:Mn.exercise_status)!==3&&!((jn=t==null?void 0:t.exercise)!=null&&jn.open_score_commited)&&n.createElement(D.Z,{justify:"space-around",align:"middle",className:a.answerSheetBottom},n.createElement(x.Z,{className:a.tooltipWrap},n.createElement("span",{className:a.answerYes}),"\u5DF2\u7B54"),n.createElement(x.Z,{className:a.tooltipWrap},n.createElement("span",{className:`${a.answerNo} ml10`},n.createElement("div",{style:{height:"50%",width:"100%",background:"rgba(22,93,255,0.4)"}})),"\u90E8\u5206\u7B54\u9898"),n.createElement(x.Z,{className:a.tooltipWrap},n.createElement("span",{className:`${a.answerNo} ml10`}),"\u672A\u7B54"),n.createElement(x.Z,{className:a.tooltipWrap},n.createElement("i",{className:"iconfont icon-biaoji1",style:{marginRight:4,color:"#FFB538"}}),"\u6807\u8BB0")),(0,ee.dE)()&&(((Ln=t==null?void 0:t.exercise)==null?void 0:Ln.exercise_status)===3||((Wn=t==null?void 0:t.exercise)==null?void 0:Wn.open_score_commited))&&n.createElement(D.Z,{justify:"space-around",align:"middle",className:a.answerSheetBottom},n.createElement(x.Z,{className:a.tooltipWrap},n.createElement("span",{className:a.answerYes,style:{background:"#028D01",height:8,width:8,borderRadius:"50%"}}),"\u6B63\u786E"),n.createElement(x.Z,{className:a.tooltipWrap},n.createElement("span",{style:{background:"#FB3226",height:8,width:8,borderRadius:"50%"},className:`${a.answerNo} ml10`}),"\u9519\u8BEF"),n.createElement(x.Z,{className:a.tooltipWrap},n.createElement("span",{style:{background:"#E77400",height:8,width:8,borderRadius:"50%"},className:`${a.answerNo} ml10`}),"\u90E8\u5206\u5F97\u5206"),n.createElement(x.Z,{className:a.tooltipWrap},n.createElement("i",{className:"iconfont icon-biaoji1",style:{marginRight:4,color:"#FFB538"}}),"\u6807\u8BB0")))),n.createElement(x.Z,null,n.createElement("div",{className:a.fold,onClick:()=>qu(!ll)},ll&&n.createElement(G.Z,{title:"\u6536\u8D77\u7B54\u9898\u5361"},n.createElement("span",{className:"icon-zuojiantou iconfont c-grey-c"})),!ll&&n.createElement(G.Z,{title:"\u5C55\u5F00"}," ",n.createElement("span",{className:"icon-youjiantou iconfont c-grey-c"})))),n.createElement(x.Z,{flex:"1"},n.createElement("section",{className:[a.rightPart,"ml20"].join(" ")},n.createElement("div",{className:`${a.questionPart} pl30 pr30`,ref:Wl},Fs()),n.createElement(D.Z,{className:a.bottom,align:"middle",justify:"space-between"},n.createElement(x.Z,null,n.createElement(gl.Z,{icon:n.createElement("i",{className:`iconfont ${(Hn=(Un=t.exercise_question_types)==null?void 0:Un[H].items[V])!=null&&Hn.is_marked?"icon-biaoji1":"icon-biaojigaiti"}`,style:{color:"#FFB538",marginRight:6}}),className:a.markBtn,onClick:()=>z(void 0,null,function*(){var e;(yield(0,ye.sS)(b.categoryId,{exercise_question_id:(e=t.exercise_question_types[H].items[V])==null?void 0:e.question_id})).status===0&&Qe()})},(Vn=(Kn=t.exercise_question_types)==null?void 0:Kn[H].items[V])!=null&&Vn.is_marked?"\u53D6\u6D88\u6807\u8BB0":"\u6807\u8BB0\u8BE5\u9898")),n.createElement(x.Z,null,(H!=0||V!=0)&&n.createElement(X.ZP,{className:`${a.changeButton} ${a.prevBtn} mr20`,type:"default",onClick:()=>{if(Ce.current){Ce.current="prev";return}Nt()}},"\u4E0A\u4E00\u9898"),!(H===((Gn=t==null?void 0:t.exercise_question_types)==null?void 0:Gn.length)-1&&V===((zn=(Yn=(Qn=t==null?void 0:t.exercise_question_types)==null?void 0:Qn[H])==null?void 0:Yn.items)==null?void 0:zn.length)-1)&&n.createElement(X.ZP,{className:a.changeButton,type:"primary",onClick:()=>{if(Ce.current){Ce.current="next";return}It()}},"\u4E0B\u4E00\u9898")))))),wl.status!==0&&n.createElement(ru,{data:wl}),n.createElement(te.default,{title:"\u6CE8\u610F",open:Gu,closable:!1,footer:!1},n.createElement("div",null,n.createElement("p",{style:{marginBottom:0}},"\u79BB\u5F00\u8BE5\u9898\u540E\u4E0D\u5141\u8BB8\u518D\u6B21\u4FEE\u6539\u7B54\u6848\uFF0C\u786E\u8BA4\u79BB\u5F00\u5417\uFF1F"),n.createElement("div",{style:{marginTop:60,display:"flex",justifyContent:"space-between",alignItems:"center"}},n.createElement(Re.default,{checked:jl,onChange:e=>{_t(e.target.checked)}},"\u4E0B\u6B21\u4E0D\u518D\u663E\u793A"),n.createElement("div",null,n.createElement(X.ZP,{onClick:()=>{Al(!1),_t(!1)}},"\u6211\u518D\u60F3\u60F3"),n.createElement(X.ZP,{onClick:()=>{t.exercise_question_types[H].items[V].ques_status=1,Ze(re({},t)),Nl.current==="prev"?(V===0?(H-=1,V=t.exercise_question_types[H].items.length-1):V-=1,ml(H),fl(V)):Nl.current==="next"?(t.exercise_question_types[H].items.length-1===V?(H=H+1,V=0):V=V+1,ml(H),fl(V)):(ml(on.current.oneindex),fl(on.current.twoindex)),Al(!1)},type:"primary",style:{marginLeft:30}},"\u786E\u8BA4"))))),n.createElement(iu.Z,{successCb:un})),Su&&n.createElement(du(),{disabled:vt,bounds:Yu,onStart:(e,s)=>Xu(e,s)},n.createElement("div",{ref:ft,style:{position:"absolute",left:40,top:200,zIndex:101}},n.createElement("div",{onMouseOver:()=>{vt&&mt(!1)},onMouseOut:()=>{mt(!0)}},n.createElement(D.Z,{className:a.cameraHeader,align:"middle",justify:"space-between"},n.createElement(x.Z,null,n.createElement("i",{className:"iconfont icon-kaiqishexiangtou"}),n.createElement("span",null,"\u5DF2\u5F00\u542F\u6444\u50CF\u5934")),pt?n.createElement(_u.Z,{onClick:()=>{Et(!1)}}):n.createElement(vu.Z,{onClick:()=>{Et(!0)}})),n.createElement("div",{style:{display:pt?"flex":"none"}},n.createElement(Me.Z,{number:((Jn=t==null?void 0:t.exercise)==null?void 0:Jn.photo_count)-((Xn=t==null?void 0:t.exercise)==null?void 0:Xn.take_photo),take_photo:(et=t==null?void 0:t.exercise)==null?void 0:et.take_photo,ref:ct,time:(lt=t.exercise)==null?void 0:lt.left_time,update:Qe,supportCamera:e=>{e===2?(Wu(!0),Bl(d==null?void 0:d.screen_shot_open),d!=null&&d.screen_shot_open||(dl(d==null?void 0:d.screen_open),Qe())):e===1&&setTimeout(()=>ve.history.push("/"),3e3)}}))))),n.createElement(te.default,{destroyOnClose:!0,closable:!1,centered:!0,className:a.teachAnalysisModal,title:n.createElement(D.Z,{align:"middle",justify:"space-between"},n.createElement(x.Z,{style:{color:"rgba(0,0,0,0.9)",fontSize:"16px"}},"\u6559\u5E08\u8BC4\u4EF7"),n.createElement(x.Z,null,n.createElement("i",{className:"iconfont icon-guanbi7",style:{fontSize:"15px",cursor:"pointer"},onClick:()=>tn(!1)}))),open:Ju,footer:!1,onCancel:()=>tn(!1)},(nt=t==null?void 0:t.exercise_answer_user)==null?void 0:nt.analysis),n.createElement(te.default,{destroyOnClose:!0,centered:!0,width:555,title:n.createElement(D.Z,{align:"middle"},n.createElement("div",{className:"c-black font16 mr8"},"\u8BF7\u8F93\u5165\u89E3\u9501\u5207\u5C4F\u7801"),n.createElement("div",{className:"c-grey-666"},"\uFF08\u4F4D\u7F6E\uFF1A\u89C4\u5219\u8BBE\u7F6E-\u9632\u4F5C\u5F0A\u8BBE\u7F6E-\u9AD8\u7EA7\u9632\u4F5C\u5F0A\u6A21\u5F0F\uFF09")),open:Hu,footer:!1,onCancel:()=>ot(!1)},n.createElement("div",null,n.createElement("div",{className:"mb20 c-black"},"\u8F93\u5165\u89E3\u9501\u7801\u540E\u5C06\u9000\u51FA\u8003\u8BD5\uFF0C\u9000\u51FA\u540E\u5728\u8003\u8BD5\u65F6\u95F4\u5185\u53EF\u7EE7\u7EED\u8003\u8BD5\u7B54\u9898"),n.createElement(yu,{key:Ku,onOk:e=>{var s;console.log(e,444),e.join("")===((s=t==null?void 0:t.exercise)==null?void 0:s.screen_key)?Te():(de.ZP.warning("\u89E3\u9501\u5207\u5C4F\u7801\u8F93\u5165\u6709\u8BEF"),Vu(m=>m+1))}}))))};var Au=(0,ve.connect)(({loading:u,user:r,exercise:i,globalSetting:q})=>({globalSetting:q,user:r,exercise:i,loading:u.effects}))(Cu)},73722:function(Pl,Oe,E){var l=E(59301),ve=E(31797),Ne=E(78241),ce=E(43418),Pe=E(14491),Ee=E(98135),te=E(95237),he=E(43604),de=E(3113),ke=E(74927),D=E(99232),x=E.n(D),$e=E(29540),Re=E(29126),G=E(17583),se=E(96837),X=(xe,Me,Fe)=>new Promise((K,Be)=>{var Le=Ae=>{try{sl(Fe.next(Ae))}catch(ze){Be(ze)}},We=Ae=>{try{sl(Fe.throw(Ae))}catch(ze){Be(ze)}},sl=Ae=>Ae.done?K(Ae.value):Promise.resolve(Ae.value).then(Le,We);sl((Fe=Fe.apply(xe,Me)).next())});const{Countdown:ge}=ve.default,Ke=({exercise:xe,successCb:Me,dispatch:Fe})=>{var K,Be,Le,We;const sl=(0,$e.useParams)(),[Ae]=Ne.default.useForm(),[ze,Ue]=(0,l.useState)(!1),a=(0,l.useRef)(),{actionTabs:Y}=xe;(0,l.useEffect)(()=>{xe.actionTabs.key==="student-unlock"&&(Ue(!1),Ae.resetFields())},[xe.actionTabs.key]);const ee=()=>new Promise(le=>X(void 0,null,function*(){var Ve,Xe,al;return a.current=yield(0,G.y)({ip_limit:(Ve=Y==null?void 0:Y.exerciseParams)==null?void 0:Ve.ip_limit,ip_bind:(Xe=Y==null?void 0:Y.exerciseParams)==null?void 0:Xe.ip_bind,ip_bind_type:(al=Y==null?void 0:Y.exerciseParams)==null?void 0:al.ip_bind_type}),le()})),rl=()=>X(void 0,null,function*(){var le,Ve,Xe,al,ql,He,Gl;yield Ae.validateFields();const yl=Ae.getFieldsValue();if(Ue(!0),(((le=Y==null?void 0:Y.exerciseParams)==null?void 0:le.ip_limit)!=="no"||(Ve=Y==null?void 0:Y.exerciseParams)!=null&&Ve.ip_bind)&&(yield ee()),(yield(0,ke.ZD)((Xe=Y==null?void 0:Y.exerciseParams)==null?void 0:Xe.id,{exercise_user_id:(al=Y==null?void 0:Y.exerciseParams)==null?void 0:al.exercise_user_id,unlock_key:yl.unlock_key,ip:a.current})).status===0){if(Me){Fe({type:"exercise/setActionTabs",payload:{}}),Me();return}if(yl.time){const Sl={time:x()(yl.time).format("YYYY-MM-DD HH:mm"),exercise_user_id:(ql=Y==null?void 0:Y.exerciseParams)==null?void 0:ql.exercise_user_id,id:(He=Y==null?void 0:Y.exerciseParams)==null?void 0:He.id};yield(0,ke.qz)(Sl)}const we=Y==null?void 0:Y.exerciseParams;(0,Re.nr)({inner_ip:we.inner_ip,public_ip:we.public_ip,open_camera:we.open_camera,ip_limit:we.ip_limit,ip_bind:we.ip_bind,ip_bind_type:we.ip_bind_type,exercise_tips:we.exercise_tips,exerciseId:we.id,screen_open:we.screen_open,screen_num:we.screen_num,screen_sec:we.screen_sec,coursesId:sl.coursesId,login:(Gl=(0,se.eY)())==null?void 0:Gl.login,history,identity_verify:we.identity_verify,open_phone_video_recording:we.open_phone_video_recording,current_status:we.current_status}),Fe({type:"exercise/setActionTabs",payload:{}})}Ue(!1)}),ye=[{title:"IP\u5730\u5740",dataIndex:"ip",key:"ip",render:le=>l.createElement("span",{className:le.indexOf("\u5F02\u5E38")>-1?"c-red":"c-green"},le)},{title:"\u6D4F\u89C8\u5668",dataIndex:"browser",key:"browser",render:le=>l.createElement("span",{className:le.indexOf("\u5F02\u5E38")>-1?"c-red":"c-green"},le)},{title:"\u4E0A\u6B21\u767B\u5F55\u65F6\u95F4",dataIndex:"last_login_time",key:"last_login_time"}],Je=((K=Y==null?void 0:Y.exerciseParams)==null?void 0:K.errorMessage)&&typeof((Be=Y==null?void 0:Y.exerciseParams)==null?void 0:Be.errorMessage)=="object";return l.createElement(l.Fragment,null,l.createElement(ce.default,{width:514,centered:!0,closable:!!((Le=Y==null?void 0:Y.exerciseParams)!=null&&Le.unlockClose),maskClosable:!1,keyboard:!1,maskStyle:{background:"#000"},title:"\u63D0\u793A",open:xe.actionTabs.key==="student-unlock",footer:null,onCancel:()=>{Fe({type:"exercise/setActionTabs",payload:{}})}},Je&&l.createElement("div",{style:{marginBottom:16}},"\u8BE5\u8D26\u53F7\u5DF2\u7ECF\u5B58\u5728\u5F02\u5E38\u60C5\u51B5\uFF0C\u82E5\u975E\u672C\u4EBA\u64CD\u4F5C\uFF0C\u8BF7\u8054\u7CFB\u76D1\u8003\u8001\u5E08\u8BF4\u660E\u60C5\u51B5\u3002 "),!Je&&l.createElement("div",{style:{marginBottom:16}},"\u7CFB\u7EDF\u68C0\u6D4B\u5230\u60A8\u5728\u8003\u8BD5\u65F6\u4E2D\u9014\u9000\u51FA\uFF0C\u73B0\u5DF2\u5C06\u8003\u8BD5\u9501\u5B9A\u3002\u5982\u9700\u7EE7\u7EED\u8FDB\u884C\u8003\u8BD5\uFF0C \u8BF7\u5C3D\u5FEB\u8054\u7CFB\u8BFE\u5802\u8001\u5E08\u8FDB\u884C\u89E3\u9501\uFF01"),Je&&l.createElement(Pe.default,{className:"mb20",pagination:{hideOnSinglePage:!0},dataSource:[((We=Y==null?void 0:Y.exerciseParams)==null?void 0:We.errorMessage)||{}],columns:ye}),l.createElement("div",{className:""},l.createElement(Ne.default,{form:Ae,layout:"vertical",autoComplete:"off"},l.createElement(Ne.default.Item,{label:"\u8003\u8BD5\u89E3\u9501\u7801",name:"unlock_key",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8003\u8BD5\u89E3\u9501\u7801"}]},l.createElement(Ee.default.Password,{autoComplete:"off",placeholder:"\u8BF7\u8F93\u5165\u8003\u8BD5\u89E3\u9501\u7801",visibilityToggle:!1})))),l.createElement(te.Z,{justify:"space-between",align:"middle"},l.createElement(he.Z,null),l.createElement(he.Z,null,l.createElement(de.ZP,{loading:ze,onClick:rl},"\u8FDB\u5165\u8003\u8BD5")))))};Oe.Z=(0,$e.connect)(({exercise:xe})=>({exercise:xe}))(Ke)},50948:function(Pl,Oe,E){E.d(Oe,{_:function(){return Ne}});var l=E(59301),ve=E(43418);const Ne=ce=>{var Pe,Ee;const te=(0,l.useRef)([]),he=()=>{for(const de of te.current)clearTimeout(de);te.current=[]};return(0,l.useEffect)(()=>{var de,ke,D,x,$e,Re;if(he(),(de=ce==null?void 0:ce.exercise)!=null&&de.left_time&&((D=(ke=ce==null?void 0:ce.exercise)==null?void 0:ke.exercise_events)==null?void 0:D.length)>0){for(const G of(x=ce==null?void 0:ce.exercise)==null?void 0:x.exercise_events)if((($e=ce==null?void 0:ce.exercise)==null?void 0:$e.left_time)>(G==null?void 0:G.reminder_time)*60){const se=setTimeout(()=>{ve.default.info({content:`${G==null?void 0:G.reminder_content}`,icon:null,title:"\u63D0\u793A",centered:!0,okText:"\u77E5\u9053\u4E86"})},(((Re=ce==null?void 0:ce.exercise)==null?void 0:Re.left_time)-(G==null?void 0:G.reminder_time)*60)*1e3);te.current.push(se)}}},[(Pe=ce==null?void 0:ce.exercise)==null?void 0:Pe.left_time,(Ee=ce==null?void 0:ce.exercise)==null?void 0:Ee.exercise_events]),he}}}]);