!function(){function e(e,n,t,i,o,s,a){try{var l=e[s](a),r=l.value}catch(u){return void t(u)}l.done?n(r):Promise.resolve(r).then(i,o)}function n(n){return function(){var t=this,i=arguments;return new Promise((function(o,s){var a=n.apply(t,i);function l(n){e(a,o,s,l,r,"next",n)}function r(n){e(a,o,s,l,r,"throw",n)}l(void 0)}))}}System.register(["./index-legacy-26bc1086.js","./index-legacy-ed8a439d.js","./index-legacy-011da5c2.js","./index-legacy-b4308f5a.js","./index-legacy-0724a306.js","./index-legacy-30eeb051.js","./index-legacy-8e510905.js","./index-legacy-6c36efb9.js","./index-legacy-37cb4646.js"],(function(e,t){"use strict";var i,o,s,a,l,r,u,c,d,v,p,f,_,b,w,h,m,y,I,x,q,g,A,T,S,E,C,L,U,B,k,O,R;return{setters:[e=>{i=e.d,o=e.U,s=e.q,a=e.r,l=e.x,r=e.ae,u=e.D,c=e.y,d=e.a7,v=e.a,p=e.S,f=e.A,_=e.C,b=e.V,w=e.a1,h=e.z,m=e.Z},e=>{y=e.e,I=e.Q,x=e.C,q=e.D,g=e.K,A=e.P,T=e.i,S=e.A,E=e.a,C=e.R},e=>{L=e.M},e=>{U=e.u,B=e.a},e=>{k=e.S,O=e.a},e=>{R=e.I},null,null,null],execute:function(){var D=document.createElement("style");D.textContent="._unitDetail_13q27_1{min-height:100vh;overflow:hidden;background:url("+new URL("bg-a9662afa.png",t.meta.url).href+") no-repeat top center;background-size:contain;position:relative;background-color:#abe8ff}._unitSwipe_13q27_9{margin-top:2.4rem}._unitSwipe_13q27_9 ._questionTitle_13q27_12{display:flex;align-items:center;justify-content:space-between;font-size:.37333rem;font-weight:700;color:#333;padding-bottom:.32rem}._unitSwipe_13q27_9 ._questionTitle_13q27_12 ._questionNum_13q27_21 span{color:#ff5a56}._unitSwipe_13q27_9 ._questionTitle_13q27_12 ._questionType_13q27_24{display:flex;align-items:center;font-weight:600;color:#ff5a56;font-size:.37333rem}._wapList_13q27_31{width:1.17333rem;height:1.30667rem;flex-shrink:0;margin-left:.48rem}._btnSection_13q27_37{background-color:#fff;padding-top:.53333rem;--van-button-default-height: 1.30667rem}._btnSection_13q27_37 ._prevBtn_13q27_42,._btnSection_13q27_37 ._nextBtn_13q27_43,._btnSection_13q27_37 ._activePrevBtn_13q27_44{width:3.30667rem!important;border:none;color:#fff}._btnSection_13q27_37 ._prevBtn_13q27_42{background:url("+new URL("prev_btn_bg-b6b2b4bd.png",t.meta.url).href+") no-repeat center;background-size:contain}._btnSection_13q27_37 ._activePrevBtn_13q27_44{background:url("+new URL("next_btn_bg-efb37605.png",t.meta.url).href+") no-repeat center;background-size:contain}._btnSection_13q27_37 ._nextBtn_13q27_43{background:url("+new URL("next_btn_bg-efb37605.png",t.meta.url).href+") no-repeat center;background-size:contain}._btnSection_13q27_37 .van-button--disabled{color:#587c98}._btnSection_13q27_37 .van-button--disabled:before{opacity:.2!important}._right_13q27_67{color:#14c295}._error_13q27_70{color:#ff5a56}._minutes_13q27_73{color:#1cacf1}\n",document.head.appendChild(D);const P="_unitDetail_13q27_1",j="_unitSwipe_13q27_9",N="_questionTitle_13q27_12",z="_questionNum_13q27_21",K="_questionType_13q27_24",M="_wapList_13q27_31",$="_btnSection_13q27_37",F="_prevBtn_13q27_42",H="_nextBtn_13q27_43",Q="_activePrevBtn_13q27_44",W="_right_13q27_67",G="_error_13q27_70",V="_minutes_13q27_73";e("default",i({name:"unit-detail",setup(){const e=o(),t=s(),i=a(),D=l({type:e.query.type,knowledgePointIds:e.query.knowledgePointIds,lessonCoursewareId:e.query.lessonCoursewareId,studentUnitExaminationId:"",background:"transparent",color:"#fff",visiableAnswer:!1,examDetail:{},currentIndex:0,time:0,questionList:[],visiableInfo:{show:!1,operationType:"RESULT",type:"DEFAULT",content:"",showCancelButton:!1,confirmButtonText:"",cancelButtonText:"",title:""},nextStatus:!1,swipeHeight:"auto",countDownOver:!1}),X=r({time:D.time,onChange(e){if(3e5>=e.total&&!D.countDownOver){if(D.visiableInfo.show)return void(D.countDownOver=!0);D.visiableInfo.show=!0,D.visiableInfo.title="倒计时5分钟",D.visiableInfo.showCancelButton=!1,D.visiableInfo.operationType="TIME",D.visiableInfo.type="COUNTDOWN",D.visiableInfo.confirmButtonText="确认",D.visiableInfo.content="距离交卷时间还剩五分钟哦,请尽快答题~",D.countDownOver=!0}},onFinish:(Y=n((function*(){y.emit("unitAudioStop"),yield se(),le()})),function(){return Y.apply(this,arguments)})});var Y;const Z=function(){var e=n((function*(){try{let e={};if("ai"===D.type){const{data:n}=yield u.post("/edu-app/studentUnitExamination/pointRandomSave",{data:{knowledgePointIds:D.knowledgePointIds}});e=n||{}}else{const{data:n}=yield u.post("/edu-app/studentUnitExamination/mockExamination",{data:{lessonCoursewareId:D.lessonCoursewareId}});e=n||{}}e.examinationQuestionAdds.forEach((e=>{e.showAnalysis=!1,e.analysis={message:e.answerAnalysis,topic:!0,userResult:!1},e.userAnswer=[]})),D.questionList=e.examinationQuestionAdds||[],D.studentUnitExaminationId=e.unitExaminationId,D.examDetail=e||{},J()}catch(e){}}));return function(){return e.apply(this,arguments)}}(),J=function(){var e=n((function*(){const e=(D.examDetail||{}).timeMinutes||0;D.time=Math.ceil(60*e*1e3),setTimeout((()=>{X.reset(60*e*1e3),X.start()}),10)}));return function(){return e.apply(this,arguments)}}(),ee=function(){var e=n((function*(){D.nextStatus=!0;try{var e;const n=D.questionList||[],t=[];if(n.forEach(((e,n)=>{e.userAnswer&&e.userAnswer.length>0&&t.push({questionId:e.id,details:e.userAnswer})})),D.questionList.length===D.currentIndex+1)return y.emit("unitAudioStop"),D.visiableInfo.show=!0,D.visiableInfo.title="测验完成",D.visiableInfo.showCancelButton=!0,D.visiableInfo.operationType="CONTINUE",D.visiableInfo.type="DEFAULT",D.visiableInfo.cancelButtonText="再等等",D.visiableInfo.confirmButtonText="确认完成",D.visiableInfo.content="确认本次测验的题目都完成了吗?",D.nextStatus=!1,void le();yield u.post("/edu-app/studentUnitExamination/submitAnswer",{hideLoading:!0,data:{answers:t,studentUnitExaminationId:D.studentUnitExaminationId}}),null===(e=i.value)||void 0===e||e.next()}catch(n){}D.nextStatus=!1}));return function(){return e.apply(this,arguments)}}();let ne=0;const te=(e=!0)=>{h((()=>{e&&window.scrollTo(0,0),setTimeout((()=>{var n;const t=null===(n=document.querySelectorAll(".van-swipe-item")[D.currentIndex])||void 0===n?void 0:n.querySelector(".swipe-item-question"),i=null==t?void 0:t.querySelectorAll(".answerTitleImg img");let o=!0;null==i||i.forEach((e=>{e.complete||(o=!1)})),!o&&ne<3&&setTimeout((()=>{ne+=1,te(e)}),300),o&&(ne=0);const s=m(t);D.swipeHeight=s.height}),100)}))},ie=()=>{"RESULT"===D.visiableInfo.operationType?(D.visiableInfo.show=!1,t.back(),t.back()):"BACK"===D.visiableInfo.operationType||"CONTINUE"===D.visiableInfo.operationType?se():"TIME"===D.visiableInfo.operationType&&(D.visiableInfo.show=!1)},oe=function(){var e=n((function*(e){if("BACK"===D.visiableInfo.operationType){if(e)return D.visiableInfo.show=!1,window.history.pushState(null,"",document.URL),void window.addEventListener("popstate",ae,!1);try{yield u.get("/edu-app/studentUnitExamination/dropExamination",{params:{studentUnitExaminationId:D.studentUnitExaminationId}}),D.visiableInfo.show=!1,le()}catch(n){}}else"CONTINUE"===D.visiableInfo.operationType&&(D.visiableInfo.show=!1,window.history.pushState(null,"",document.URL),window.addEventListener("popstate",ae,!1))}));return function(n){return e.apply(this,arguments)}}(),se=function(){var e=n((function*(){try{const e=D.questionList||[],n=[];e.forEach((e=>{e.userAnswer&&e.userAnswer.length>0&&n.push({questionId:e.id,details:e.userAnswer})}));const{data:t}=yield u.post("/edu-app/studentUnitExamination/completionExamination",{hideLoading:!1,data:{answers:n,studentUnitExaminationId:D.studentUnitExaminationId}});D.visiableInfo.show=!0,D.visiableInfo.title=t.score+"分",D.visiableInfo.showCancelButton=!1,D.visiableInfo.operationType="RESULT",D.visiableInfo.confirmButtonText="确认","A_EXCELLENT"===t.status?(D.visiableInfo.type="GOOD",D.visiableInfo.content="
你很棒,题目掌握的非常不错,"):"B_PASS"===t.status?(D.visiableInfo.type="PASS",D.visiableInfo.content="
还需要加油哦,"):(D.visiableInfo.type="FAIL",D.visiableInfo.content="
别气馁,继续努力,"),D.visiableInfo.content+=`您本次获得了${t.score}分,正确率${t.rightRate}%,实际用时${Math.ceil(t.answerTime/60)}分钟~
`}catch(e){}}));return function(){return e.apply(this,arguments)}}(),ae=()=>{D.visiableInfo.show=!0,D.visiableInfo.title="确认要离开吗?",D.visiableInfo.showCancelButton=!0,D.visiableInfo.operationType="BACK",D.visiableInfo.type="DEFAULT",D.visiableInfo.cancelButtonText="弃考",D.visiableInfo.confirmButtonText="提交",D.visiableInfo.content="还有题目未完成哦,是否要提前交卷?",y.emit("unitAudioStop")},le=()=>{window.removeEventListener("popstate",ae,!1),t.back()};return c(n((function*(){U(document,"scroll",(()=>{const{y:e}=B();e.value>52?(D.background="#fff",D.color="#323333"):(D.background="transparent",D.color="#fff")})),yield Z(),te(),window.history.pushState(null,"",document.URL),window.addEventListener("popstate",ae,!1)}))),d((()=>{y.emit("unitAudioStop")})),()=>{let e;return v("div",{class:P},[v(L,{position:"top"},{default:()=>[v(p,{border:!1,background:D.background,color:D.color},null)]}),v(k,{loop:!1,showIndicators:!1,ref:i,duration:300,touchable:!1,class:j,style:{paddingBottom:"12px"},lazyRender:!0,height:D.swipeHeight,onChange:e=>{y.emit("unitAudioStop"),D.currentIndex=e,te()}},(n=e=D.questionList.map(((e,n)=>v(O,null,{default:()=>[v("div",{class:"swipe-item-question"},[e.questionTypeCode===I.RADIO&&v(x,{value:e.userAnswer,"onUpdate:value":n=>e.userAnswer=n,index:n+1,data:e,type:"radio",showAnalysis:e.showAnalysis,analysis:e.analysis},{title:()=>v("div",{class:N},[v("div",{class:z},[v("span",null,[D.currentIndex+1]),f("/"),D.questionList.length]),v("div",{class:K},[X.current.value.minutes+60*X.current.value.hours,f(":"),X.current.value.seconds])])}),e.questionTypeCode===I.CHECKBOX&&v(x,{value:e.userAnswer,"onUpdate:value":n=>e.userAnswer=n,index:n+1,data:e,type:"checkbox",showAnalysis:e.showAnalysis,analysis:e.analysis},{title:()=>v("div",{class:N},[v("div",{class:z},[v("span",null,[D.currentIndex+1]),f("/"),D.questionList.length]),v("div",{class:K},[X.current.value.minutes+60*X.current.value.hours,f(":"),X.current.value.seconds])])}),e.questionTypeCode===I.SORT&&v(q,{value:e.userAnswer,"onUpdate:value":[n=>e.userAnswer=n,()=>{const n=!(e.userAnswer&&e.userAnswer.length>0);te(n)}],data:e,index:n+1,showAnalysis:e.showAnalysis,analysis:e.analysis},{title:()=>v("div",{class:N},[v("div",{class:z},[v("span",null,[D.currentIndex+1]),f("/"),D.questionList.length]),v("div",{class:K},[X.current.value.minutes+60*X.current.value.hours,f(":"),X.current.value.seconds])])}),e.questionTypeCode===I.LINK&&v(g,{value:e.userAnswer,"onUpdate:value":n=>e.userAnswer=n,data:e,index:n+1,showAnalysis:e.showAnalysis,analysis:e.analysis},{title:()=>v("div",{class:N},[v("div",{class:z},[v("span",null,[D.currentIndex+1]),f("/"),D.questionList.length]),v("div",{class:K},[X.current.value.minutes+60*X.current.value.hours,f(":"),X.current.value.seconds])])}),e.questionTypeCode===I.PLAY&&v(A,{value:e.userAnswer,"onUpdate:value":n=>e.userAnswer=n,data:e,index:n+1,unitId:D.studentUnitExaminationId,showAnalysis:e.showAnalysis,analysis:e.analysis},{title:()=>v("div",{class:N},[v("div",{class:z},[v("span",null,[D.currentIndex+1]),f("/"),D.questionList.length]),v("div",{class:K},[X.current.value.minutes+60*X.current.value.hours,f(":"),X.current.value.seconds])])})])]}))),"function"==typeof n||"[object Object]"===Object.prototype.toString.call(n)&&!w(n)?e:{default:()=>[e]})),v(L,{position:"bottom"},{default:()=>[v("div",{class:["btnGroup btnMore",$]},[v(_,{round:!0,block:!0,class:D.currentIndex>0?Q:F,disabled:!(D.currentIndex>0),onClick:()=>{var e;null===(e=i.value)||void 0===e||e.prev()}},{default:()=>[f("上一题")]}),v(_,{block:!0,round:!0,class:H,onClick:ee,loading:D.nextStatus,disabled:D.nextStatus},{default:()=>[D.questionList.length===D.currentIndex+1?"提交":"下一题"]}),v(R,{src:T,class:[M,"van-haptics-feedback"],onClick:()=>D.visiableAnswer=!0},null)])]}),v(S,{show:D.visiableAnswer,"onUpdate:show":e=>D.visiableAnswer=e,title:"题目列表",safeAreaInsetBottom:!0},{default:()=>[v(E,{value:D.questionList,onSelect:e=>{var n;null===(n=i.value)||void 0===n||n.swipeTo(e,{immediate:!0}),D.visiableAnswer=!1}},null)]}),v(b,{show:D.visiableInfo.show,"onUpdate:show":e=>D.visiableInfo.show=e,closeOnClickOverlay:!1,style:{background:"transparent",width:"100%",maxWidth:"100%",transform:"translateY(-55%)"}},{default:()=>[v(C,{title:D.visiableInfo.title,showCancelButton:D.visiableInfo.showCancelButton,cancelButtonText:D.visiableInfo.cancelButtonText,confirmButtonText:D.visiableInfo.confirmButtonText,status:D.visiableInfo.type,content:D.visiableInfo.content,closeable:"BACK"===D.visiableInfo.operationType,contentHtml:!0,onConform:ie,onClose:oe},null)]})]);var n}}}))}}}))}();