1 |
- !function(){var e=document.createElement("style");e.innerHTML="._unitDetail_1qg73_1{overflow:hidden}._unitSection_1qg73_4{margin:.32rem .34667rem;padding:.34667rem .4rem;width:auto;overflow:hidden;border-radius:.26667rem}._unitSection_1qg73_4 ._unitTitle_1qg73_11{font-size:.42667rem;font-weight:500;color:#333}._unitSection_1qg73_4 ._unitCount_1qg73_16{padding-top:.13333rem;display:flex;align-items:center;justify-content:space-between}._unitSection_1qg73_4 ._qNums_1qg73_22{display:flex;align-items:center;font-size:.37333rem;color:#333;line-height:.53333rem}._unitSection_1qg73_4 ._qNums_1qg73_22 ._num_1qg73_29{color:#f67146}._unitSection_1qg73_4 ._icon_1qg73_32{width:.37333rem;height:.37333rem;margin-right:.10667rem}._wapList_1qg73_37{width:1.17333rem;height:1.17333rem;flex-shrink:0;margin-left:.48rem}\n",document.head.appendChild(e),System.register(["./index-legacy.eb062188.js","./icon-question-nums-legacy.7080fe5e.js","./index-legacy.b9c79165.js","./index-legacy.ad813f4d.js","./index-legacy.e0860c0a.js","./index-legacy.80428ed5.js","./index-legacy.45022ee2.js","./index-legacy.918b8c74.js","./index-legacy.fab451f1.js","./index-legacy.fecc738b.js","./index-legacy.8c254533.js","./index-legacy.761bf286.js","./index-legacy.11f1ea5f.js"],(function(e){"use strict";var t,n,i,a,s,o,u,l,r,d,c,m,g,p,w,x,f,A,v,h,y,b,q,S,_,C,I,E,T,L,U,j,k,B,D,R;return{setters:[function(e){t=e.d,n=e.ah,i=e.ag,a=e.R,s=e.r,o=e.$,u=e.b7,l=e.c,r=e.aj,d=e.a5,c=e.q,m=e.B,g=e.P,p=e.al,w=e.m,x=e.ai,f=e._,A=e.an},function(e){v=e.i},function(e){h=e.e,y=e.Q,b=e.C,q=e.D,S=e.K,_=e.P,C=e.i,I=e.A},function(e){E=e.O},function(e){T=e.O},function(e){L=e.R},function(e){U=e.C},function(e){j=e.C},function(e){k=e.S,B=e.a},function(e){D=e.I},function(e){R=e.A},function(){},function(){}],execute:function(){var O="_unitDetail_1qg73_1",X="_unitSection_1qg73_4",P="_unitTitle_1qg73_11",K="_unitCount_1qg73_16",N="_qNums_1qg73_22",Z="_num_1qg73_29",F="_icon_1qg73_32",M="_wapList_1qg73_37";e("default",t({name:"unit-detail",setup(){const e=n(),t=i(),G=a(),H=a(),W=s({id:e.query.id,examDetail:{},visiableAnswer:!1,currentIndex:0,questionList:[],time:0,visiableSure:!1,visiableResult:!1,resultInfo:{},resultStatusType:"SUCCESS",visiableExam:!1,nextStatus:!1,swipeHeight:"auto",quitStatus:!1}),z=async()=>{const e=W.examDetail||{},t=e.startTime,n=e.now,i=e.timeMinutes||0,a=x(t).add(i,"minute").diff(x(n));a<=0?(h.emit("unitAudioStop"),await ee(),W.visiableExam=!0):(W.time=1e3*Math.ceil(a/1e3),setTimeout((()=>{var e;null===(e=G.value)||void 0===e||e.start()}),10))},Y=(e,t)=>{if(!t)return[];const n=t||[];return n[e.id]?n[e.id]:[]};let J=0;const V=(e=!0)=>{f((()=>{e&&window.scrollTo(0,0),setTimeout((()=>{var t;const n=null===(t=document.querySelectorAll(".van-swipe-item")[W.currentIndex])||void 0===t?void 0:t.querySelector(".swipe-item-question"),i=n.querySelectorAll(".answerTitleImg img");let a=!0;i.forEach((e=>{console.log(e.complete),e.complete||(a=!1)})),!a&&J<3&&setTimeout((()=>{J+=1,V(e)}),300),a&&(J=0);const s=A(n);W.swipeHeight=s.height}),100)}))},Q=async()=>{try{var e;const t=W.questionList||[],n=[];if(t.forEach(((e,t)=>{e.userAnswer&&e.userAnswer.length>0&&n.push({questionId:e.id,details:e.userAnswer})})),W.questionList.length===W.currentIndex+1)return h.emit("unitAudioStop"),void(W.visiableSure=!0);W.nextStatus=!0,await w.post("/api-student/studentUnitExamination/submitAnswer",{hideLoading:!0,data:{answers:n,studentUnitExaminationId:W.id}}),null===(e=H.value)||void 0===e||e.next(),W.nextStatus=!1}catch{W.nextStatus=!1}},$=async()=>{try{await ee(),ne(),W.visiableResult=!0}catch{}},ee=async()=>{try{const e=W.questionList||[],t=[];e.forEach((e=>{e.userAnswer&&e.userAnswer.length>0&&t.push({questionId:e.id,details:e.userAnswer})}));const{data:n}=await w.post("/api-student/studentUnitExamination/completionExamination",{hideLoading:!1,data:{answers:t,studentUnitExaminationId:W.id}});"A_PASS"===n.status?(W.resultStatusType="SUCCESS",W.resultInfo={tips:"恭喜你,测验通过!",score:n.score,examName:W.examDetail.unitExaminationName}):(W.resultStatusType="FAIL",W.resultInfo={tips:"本次测验不合格!",score:n.score,examName:W.examDetail.unitExaminationName})}catch{}},te=()=>{W.quitStatus=!0,h.emit("unitAudioStop")},ne=()=>{window.removeEventListener("popstate",te,!1),t.back()};return o((async()=>{await(async()=>{try{const{data:e}=await w.post("/api-student/studentUnitExamination/startExamination",{requestType:"form",data:{studentUnitExaminationId:W.id}}),{questionJson:t,studentAnswerJson:n,...i}=e,a=t||[];a.forEach((e=>{e.userAnswer=Y(e,n)})),W.questionList=a,W.examDetail={...i}||{},z()}catch{}})(),V(),window.history.pushState(null,"",document.URL),window.addEventListener("popstate",te,!1)})),u((()=>{h.emit("unitAudioStop")})),()=>{let e;return l("div",{class:O},[l(r,null,null),l(j,{center:!0,class:X,border:!1},{title:()=>l("div",{class:P},[W.examDetail.unitExaminationName]),label:()=>l("div",{class:K},[l("div",{class:N},[l(d,{class:F,name:v},null),c("题目数量")," ",l("span",{class:Z,style:{paddingLeft:"6px"}},[W.currentIndex+1]),c("/"),W.examDetail.questionNum]),l("div",{class:N},[l(d,{class:F,name:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAAAXNSR0IArs4c6QAABD5JREFUSEuVlm2IVGUUx3//mXXzrSJDcntDgpQIKxKEPkRWFCpa9GHmjlsKFallaPQiZbn3mS1fliJTtEKpCGmdO0tSqEnSBwn6ZH7IQtKgKNSSXswPajvr3BP3zt11Z3Ze1ufbzPM/5/ec85xz7iOaLMt7H2IsBtLNdMP2ysAOueDxRno12rBiJs2RVP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ft8h9jAuPbdtdVrby6awNmBh5Gtwog+xnGgoFVyhbdqz9c4pc7LgW0DXT7MqITF8JNgSvo2glx8Zojo27dcfjA4HKqYLd6luamIbrDobdri9W0XIFXAyq8q3xe9V+uupsBBC3sjdwPlMIul7gWLBnvU5NHj+HfQUcR+SqVdWrsrLv1m638KkKAsRa/qEQAAAABJRU5ErkJggg=="},null),c("剩余时长:"),l(U,{ref:G,time:W.time,"onUpdate:time":e=>W.time=e,format:"mm:ss",autoStart:!1,onFinish:async()=>{h.emit("unitAudioStop"),await ee(),W.visiableExam=!0}},null)])])}),l(k,{loop:!1,showIndicators:!1,ref:H,duration:300,touchable:!1,height:W.swipeHeight,style:{marginBottom:"12px"},lazyRender:!0,onChange:e=>{h.emit("unitAudioStop"),W.currentIndex=e,V()}},(n=e=W.questionList.map(((e,t)=>l(B,null,{default:()=>[l("div",{class:"swipe-item-question"},[e.questionTypeCode===y.RADIO&&l(b,{value:e.userAnswer,"onUpdate:value":t=>e.userAnswer=t,index:t+1,data:e,type:"radio"},null),e.questionTypeCode===y.CHECKBOX&&l(b,{value:e.userAnswer,"onUpdate:value":t=>e.userAnswer=t,index:t+1,data:e,type:"checkbox"},null),e.questionTypeCode===y.SORT&&l(q,{value:e.userAnswer,"onUpdate:value":[t=>e.userAnswer=t,()=>{V(!1)}],data:e,index:t+1},null),e.questionTypeCode===y.LINK&&l(S,{value:e.userAnswer,"onUpdate:value":t=>e.userAnswer=t,data:e,index:t+1},null),e.questionTypeCode===y.PLAY&&l(_,{value:e.userAnswer,"onUpdate:value":t=>e.userAnswer=t,data:e,index:t+1,unitId:W.id},null)])]}))),"function"==typeof n||"[object Object]"===Object.prototype.toString.call(n)&&!p(n)?e:{default:()=>[e]})),l(E,{position:"bottom",background:"white"},{default:()=>[l("div",{class:["btnGroup btnMore"]},[W.currentIndex>0&&l(m,{round:!0,block:!0,type:"primary",plain:!0,onClick:()=>{var e;null===(e=H.value)||void 0===e||e.prev()}},{default:()=>[c("上一题")]}),l(m,{block:!0,round:!0,type:"primary",onClick:Q,loading:W.nextStatus,disabled:W.nextStatus},{default:()=>[W.questionList.length===W.currentIndex+1?"测试完成":"下一题"]}),l(D,{src:C,class:[M,"van-haptics-feedback"],onClick:()=>W.visiableAnswer=!0},null)])]}),l(R,{show:W.visiableAnswer,"onUpdate:show":e=>W.visiableAnswer=e,title:"题目列表",safeAreaInsetBottom:!0},{default:()=>[l(I,{value:W.questionList,onSelect:e=>{var t;null===(t=H.value)||void 0===t||t.swipeTo(e,{immediate:!0}),W.visiableAnswer=!1}},null)]}),l(g,{show:W.visiableResult,"onUpdate:show":e=>W.visiableResult=e,closeOnClickOverlay:!1,style:{background:"transparent",width:"96%"}},{default:()=>[l(L,{status:W.resultStatusType,result:W.resultInfo,confirmButtonText:"去练习",cancelButtonText:"我知道了",onClose:()=>{W.visiableResult=!1,t.back(),t.back()},onConform:()=>{W.visiableResult=!1,t.back(),t.back()}},null)]}),l(T,{show:W.visiableSure,"onUpdate:show":e=>W.visiableSure=e,title:"测验完成",message:"确认本次测验的题目都完成了吗?\\n提交后不可修改哦",messageAlign:"left",showCancelButton:!0,cancelButtonText:"再等等",confirmButtonText:"确认完成",onConfirm:$},null),l(T,{show:W.visiableExam,"onUpdate:show":e=>W.visiableExam=e,message:"考试已结束",messageAlign:"center",onConfirm:async()=>{ne(),W.visiableResult=!0}},null),l(T,{show:W.quitStatus,"onUpdate:show":e=>W.quitStatus=e,title:"提示",message:"您是否退出本次测验?",confirmButtonText:"确认退出",showCancelButton:!0,cancelButtonText:"取消",onCancel:()=>{window.history.pushState(null,"",document.URL),window.addEventListener("popstate",te,!1)},onConfirm:()=>{ne()}},null)]);var n}}}))}}}))}();
|