index-legacy-e618bb92.js 13 KB

1
  1. !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-a314c7dd.js","./index-legacy-ab55f766.js","./index-legacy-2788affc.js","./index-legacy-fb49b6ec.js","./index-legacy-dd79c724.js","./index-legacy-72dfb7ed.js","./index-legacy-67938227.js","./index-legacy-59282c70.js","./howler-legacy-0586f4f3.js","./index-legacy-dff5e6e7.js"],(function(e,t){"use strict";var i,o,s,a,l,r,u,c,d,p,v,f,_,b,w,h,m,y,I,x,g,q,A,T,S,E,L,C,U,k,B,O,R,D,P,j;return{setters:[e=>{i=e.d,o=e.P,s=e.q,a=e.r,l=e.x,r=e.af,u=e.D,c=e.y,d=e.a8,p=e.a,v=e.W,f=e.A,_=e.C,b=e.Q,w=e.a3,h=e.E,m=e.z,y=e.$,I=e.R,x=e.S},e=>{g=e.e,q=e.Q,A=e.C,T=e.D,S=e.K,E=e.P,L=e.i,C=e.A,U=e.a,k=e.R},e=>{B=e.M},e=>{O=e.u,R=e.a},e=>{D=e.S,P=e.a},e=>{j=e.I},null,null,null,null],execute:function(){var N=document.createElement("style");N.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(N);const z="_unitDetail_13q27_1",K="_unitSwipe_13q27_9",M="_questionTitle_13q27_12",$="_questionNum_13q27_21",F="_questionType_13q27_24",H="_wapList_13q27_31",Q="_btnSection_13q27_37",W="_prevBtn_13q27_42",G="_nextBtn_13q27_43",X="_activePrevBtn_13q27_44",Y="_right_13q27_67",Z="_error_13q27_70",J="_minutes_13q27_73";e("default",i({name:"unit-detail",setup(){const e=o(),t=s(),i=a(),N=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}),V=r({time:N.time,onChange(e){if(3e5>=e.total&&!N.countDownOver){if(N.visiableInfo.show)return void(N.countDownOver=!0);N.visiableInfo.show=!0,N.visiableInfo.title="倒计时5分钟",N.visiableInfo.showCancelButton=!1,N.visiableInfo.operationType="TIME",N.visiableInfo.type="COUNTDOWN",N.visiableInfo.confirmButtonText="确认",N.visiableInfo.content="距离交卷时间还剩五分钟哦,请尽快答题~",N.countDownOver=!0}},onFinish:(ee=n((function*(){g.emit("unitAudioStop"),yield re(),window.removeEventListener("popstate",ue,!1),t.back()})),function(){return ee.apply(this,arguments)})});var ee;const ne=function(){var e=n((function*(){try{let e={};if("ai"===N.type){const{data:n}=yield u.post("/edu-app/studentUnitExamination/pointRandomSave",{data:{knowledgePointIds:N.knowledgePointIds}});e=n||{}}else{const{data:n}=yield u.post("/edu-app/studentUnitExamination/mockExamination",{data:{lessonCoursewareId:N.lessonCoursewareId,knowledgePointIds:N.knowledgePointIds}});e=n||{}}e.examinationQuestionAdds.forEach((e=>{e.showAnalysis=!1,e.analysis={message:e.answerAnalysis,topic:!0,userResult:!1},e.userAnswer=[]})),N.questionList=e.examinationQuestionAdds||[],N.studentUnitExaminationId=e.unitExaminationId,N.examDetail=e||{},te()}catch(e){}}));return function(){return e.apply(this,arguments)}}(),te=function(){var e=n((function*(){const e=(N.examDetail||{}).timeMinutes||0;N.time=Math.ceil(60*e*1e3),setTimeout((()=>{V.reset(60*e*1e3),V.start()}),10)}));return function(){return e.apply(this,arguments)}}(),ie=function(){var e=n((function*(){N.nextStatus=!0;try{var e,n;const o=N.questionList||[],s=o[N.currentIndex];if((null==s||null===(e=s.userAnswer)||void 0===e?void 0:e.length)<=0)return h("题目尚未做答"),void(N.nextStatus=!1);const a=[];if(o.forEach(((e,n)=>{e.userAnswer&&e.userAnswer.length>0&&a.push({questionId:e.id,details:e.userAnswer})})),N.questionList.length===N.currentIndex+1)return g.emit("unitAudioStop"),N.visiableInfo.show=!0,N.visiableInfo.title="测验完成",N.visiableInfo.showCancelButton=!0,N.visiableInfo.operationType="CONTINUE",N.visiableInfo.type="DEFAULT",N.visiableInfo.cancelButtonText="再等等",N.visiableInfo.confirmButtonText="确认完成",N.visiableInfo.content="确认本次测验的题目都完成了吗?",N.nextStatus=!1,window.removeEventListener("popstate",ue,!1),void t.back();yield u.post("/edu-app/studentUnitExamination/submitAnswer",{hideLoading:!0,data:{answers:a,studentUnitExaminationId:N.studentUnitExaminationId}}),null===(n=i.value)||void 0===n||n.next()}catch(o){}N.nextStatus=!1}));return function(){return e.apply(this,arguments)}}();let oe=0;const se=(e=!0)=>{m((()=>{e&&window.scrollTo(0,0),setTimeout((()=>{var n;const t=null===(n=document.querySelectorAll(".van-swipe-item")[N.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&&oe<3&&setTimeout((()=>{oe+=1,se(e)}),300),o&&(oe=0);const s=y(t);N.swipeHeight=s.height}),100)}))},ae=()=>{"RESULT"===N.visiableInfo.operationType?(N.visiableInfo.show=!1,I().isApp&&"ai"!==N.type?x({api:"back"}):(window.removeEventListener("popstate",ue,!1),t.go(-2))):"BACK"===N.visiableInfo.operationType||"CONTINUE"===N.visiableInfo.operationType?re():"TIME"===N.visiableInfo.operationType&&(N.visiableInfo.show=!1)},le=function(){var e=n((function*(e){if("BACK"===N.visiableInfo.operationType){if(e)return N.visiableInfo.show=!1,window.history.pushState(null,"",document.URL),void window.addEventListener("popstate",ue,!1);try{yield u.get("/edu-app/studentUnitExamination/dropExamination",{params:{studentUnitExaminationId:N.studentUnitExaminationId}}),N.visiableInfo.show=!1,I().isApp&&"ai"!==N.type?x({api:"back"}):(window.removeEventListener("popstate",ue,!1),t.go(-2))}catch(n){}}else"CONTINUE"===N.visiableInfo.operationType&&(N.visiableInfo.show=!1,window.history.pushState(null,"",document.URL),window.addEventListener("popstate",ue,!1))}));return function(n){return e.apply(this,arguments)}}(),re=function(){var e=n((function*(){try{const e=N.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:N.studentUnitExaminationId}});N.visiableInfo.show=!0,N.visiableInfo.title=t.score+"分",N.visiableInfo.showCancelButton=!1,N.visiableInfo.operationType="RESULT",N.visiableInfo.confirmButtonText="确认","A_EXCELLENT"===t.status?(N.visiableInfo.type="GOOD",N.visiableInfo.content="<div>你很棒,题目掌握的非常不错,"):"B_PASS"===t.status?(N.visiableInfo.type="PASS",N.visiableInfo.content="<div>还需要加油哦,"):(N.visiableInfo.type="FAIL",N.visiableInfo.content="<div>别气馁,继续努力,"),N.visiableInfo.content+=`您本次获得了<span class='${Y}'>${t.score}分</span>,正确率<span class='${Z}'>${t.rightRate}%</span>,实际用时<span class='${J}'>${Math.ceil(t.answerTime/60)}</span>分钟~</div>`}catch(e){}}));return function(){return e.apply(this,arguments)}}(),ue=()=>{N.visiableInfo.show=!0,N.visiableInfo.title="确认要离开吗?",N.visiableInfo.showCancelButton=!0,N.visiableInfo.operationType="BACK",N.visiableInfo.type="DEFAULT",N.visiableInfo.cancelButtonText="弃考",N.visiableInfo.confirmButtonText="提交",N.visiableInfo.content="还有题目未完成哦,是否要提前交卷?",g.emit("unitAudioStop")};return c(n((function*(){O(document,"scroll",(()=>{const{y:e}=R();e.value>52?(N.background="#fff",N.color="#323333"):(N.background="transparent",N.color="#fff")})),yield ne(),se(),window.history.pushState(null,"",document.URL),window.addEventListener("popstate",ue,!1)}))),d((()=>{g.emit("unitAudioStop")})),()=>{let e;return p("div",{class:z},[p(B,{position:"top"},{default:()=>[p(v,{border:!1,background:N.background,color:N.color},null)]}),p(D,{loop:!1,showIndicators:!1,ref:i,duration:300,touchable:!1,class:K,style:{paddingBottom:"12px"},lazyRender:!0,height:N.swipeHeight,onChange:e=>{g.emit("unitAudioStop"),N.currentIndex=e,se()}},(n=e=N.questionList.map(((e,n)=>p(P,null,{default:()=>[p("div",{class:"swipe-item-question"},[e.questionTypeCode===q.RADIO&&p(A,{value:e.userAnswer,"onUpdate:value":n=>e.userAnswer=n,index:n+1,data:e,type:"radio",showAnalysis:e.showAnalysis,analysis:e.analysis},{title:()=>p("div",{class:M},[p("div",{class:$},[p("span",null,[N.currentIndex+1]),f("/"),N.questionList.length]),p("div",{class:F},[V.current.value.minutes+60*V.current.value.hours,f(":"),V.current.value.seconds])])}),e.questionTypeCode===q.CHECKBOX&&p(A,{value:e.userAnswer,"onUpdate:value":n=>e.userAnswer=n,index:n+1,data:e,type:"checkbox",showAnalysis:e.showAnalysis,analysis:e.analysis},{title:()=>p("div",{class:M},[p("div",{class:$},[p("span",null,[N.currentIndex+1]),f("/"),N.questionList.length]),p("div",{class:F},[V.current.value.minutes+60*V.current.value.hours,f(":"),V.current.value.seconds])])}),e.questionTypeCode===q.SORT&&p(T,{value:e.userAnswer,"onUpdate:value":[n=>e.userAnswer=n,()=>{const n=!(e.userAnswer&&e.userAnswer.length>0);se(n)}],data:e,index:n+1,showAnalysis:e.showAnalysis,analysis:e.analysis},{title:()=>p("div",{class:M},[p("div",{class:$},[p("span",null,[N.currentIndex+1]),f("/"),N.questionList.length]),p("div",{class:F},[V.current.value.minutes+60*V.current.value.hours,f(":"),V.current.value.seconds])])}),e.questionTypeCode===q.LINK&&p(S,{value:e.userAnswer,"onUpdate:value":n=>e.userAnswer=n,data:e,index:n+1,showAnalysis:e.showAnalysis,analysis:e.analysis},{title:()=>p("div",{class:M},[p("div",{class:$},[p("span",null,[N.currentIndex+1]),f("/"),N.questionList.length]),p("div",{class:F},[V.current.value.minutes+60*V.current.value.hours,f(":"),V.current.value.seconds])])}),e.questionTypeCode===q.PLAY&&p(E,{value:e.userAnswer,"onUpdate:value":n=>e.userAnswer=n,data:e,index:n+1,unitId:N.studentUnitExaminationId,showAnalysis:e.showAnalysis,analysis:e.analysis},{title:()=>p("div",{class:M},[p("div",{class:$},[p("span",null,[N.currentIndex+1]),f("/"),N.questionList.length]),p("div",{class:F},[V.current.value.minutes+60*V.current.value.hours,f(":"),V.current.value.seconds])])})])]}))),"function"==typeof n||"[object Object]"===Object.prototype.toString.call(n)&&!w(n)?e:{default:()=>[e]})),p(B,{position:"bottom"},{default:()=>[p("div",{class:["btnGroup btnMore",Q]},[p(_,{round:!0,block:!0,class:N.currentIndex>0?X:W,disabled:!(N.currentIndex>0),onClick:()=>{var e;null===(e=i.value)||void 0===e||e.prev()}},{default:()=>[f("上一题")]}),p(_,{block:!0,round:!0,class:G,onClick:ie,loading:N.nextStatus,disabled:N.nextStatus},{default:()=>[N.questionList.length===N.currentIndex+1?"提交":"下一题"]}),p(j,{src:L,class:[H,"van-haptics-feedback"],onClick:()=>N.visiableAnswer=!0},null)])]}),p(C,{show:N.visiableAnswer,"onUpdate:show":e=>N.visiableAnswer=e,title:"题目列表",safeAreaInsetBottom:!0},{default:()=>[p(U,{value:N.questionList,onSelect:e=>{var n;null===(n=i.value)||void 0===n||n.swipeTo(e,{immediate:!0}),N.visiableAnswer=!1}},null)]}),p(b,{show:N.visiableInfo.show,"onUpdate:show":e=>N.visiableInfo.show=e,closeOnClickOverlay:!1,style:{background:"transparent",width:"100%",maxWidth:"100%",transform:"translateY(-55%)"}},{default:()=>[p(k,{title:N.visiableInfo.title,showCancelButton:N.visiableInfo.showCancelButton,cancelButtonText:N.visiableInfo.cancelButtonText,confirmButtonText:N.visiableInfo.confirmButtonText,status:N.visiableInfo.type,content:N.visiableInfo.content,closeable:"BACK"===N.visiableInfo.operationType,contentHtml:!0,onConform:ae,onClose:le},null)]})]);var n}}}))}}}))}();