12 |
- import{d as R,ah as N,ag as F,R as q,r as O,$ as j,b3 as P,c as s,aj as X,a5 as C,q as f,B as I,P as K,al as M,m as h,ai as L,_ as Z,an as _}from"./index.1c621181.js";import{i as H}from"./icon-question-nums.dee74fa0.js";import{e as r,Q as m,C as T,D as G,K as Q,P as W,i as z,A as V}from"./index.ab76619c.js";import{O as Y}from"./index.b491c24a.js";import{O as v}from"./index.120b6f0d.js";import{R as J}from"./index.54419ac2.js";import{C as $}from"./index.2f8c39d9.js";import{C as tt}from"./index.fd5ae97b.js";import{S as et,a as st}from"./index.78a302c3.js";import{I as nt}from"./index.4c221cbe.js";import{A as at}from"./index.7c36c16c.js";import"./index.5a8ac45d.js";import"./index.4e64eb97.js";const it="_unitDetail_1qg73_1",ot="_unitSection_1qg73_4",ut="_unitTitle_1qg73_11",lt="_unitCount_1qg73_16",rt="_qNums_1qg73_22",ct="_num_1qg73_29",dt="_icon_1qg73_32",mt="_wapList_1qg73_37";var o={unitDetail:it,unitSection:ot,unitTitle:ut,unitCount:lt,qNums:rt,num:ct,icon:dt,wapList:mt},pt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAAAXNSR0IArs4c6QAABD5JREFUSEuVlm2IVGUUx3//mXXzrSJDcntDgpQIKxKEPkRWFCpa9GHmjlsKFallaPQiZbn3mS1fliJTtEKpCGmdO0tSqEnSBwn6ZH7IQtKgKNSSXswPajvr3BP3zt11Z3Ze1ufbzPM/5/ec85xz7iOaLMt7H2IsBtLNdMP2ysAOueDxRno12rBiJs2RVP8lwAZdleHUWLkDF+r5bgiMxOayK5A6MdqGGU8Gbkx+/wb8ObQnLiD1qquw+ZIjbBh53nsa4914XzwjP3hvlOlOTEahNje7DU25B+M+sDnAnYnZIbA9kP4aph+Qc2Erd81TunnuZZy+YgWwEuO65s7sOEq9jZW3yvWVLjml1t05k7DcC0yrNrZ+pD+w+N8OoL3G+TFIZeR2Hh510djr3nzKBMD4xOg08BHlsJdTPx/WtkMDcVEtmTmGa2++HfAwewpxZUVv54CMXPGLWuiIlFp37m5C2w+MTcS9tIfPaXXfxWqsc3Rbl5lMKb0JbGGFyXnS9oC6it8Ml1cBbX3nVfSXv4eh+/Llgu5WhTB831zWgfyhtjkf3qaevjODmmpg3nsHY2WlfrVdfmFJPZi5XGcscYXojkcsc9kPQE8kfjbKLzw/AmjrFl9Nqf94JZU6zpnyNG3sO1/rzZw3H9id/L9ALtgzQvPioglM7P8J1IFxFqWmyu38Kz7koNjyueWYbUlO9az8wtYG0S0DqzR7k8aPpxTalPhYKhdsqwa67Oegh4Ay7WFHoyIxl10Gag1cu/AaBsITySz+TC54pAbo/QJMBX6QC2Y0KhTLe0sx3m8VYVyoee8Ixi3AMblgejXQ984hxiHbK78Y3VPdVQWEDXLBKw21zov6cG7UIsoHcU9fvEPnRZ+idrC9ck2AcYXaJwkkBFsuV6xEXLPMZfeB5kSFo3wwsaZosicxdSAOyg9mNTp1nCqX2xKBKhozxFL5xe0jgd6heNCLE/KD62sj/Aq4HygxoX2SXtpxtgU0mirRYI/ydFp+MGm43tyC8TD+X2AMYp/8YF41sDu3mtDWxkYpZqkrONgMWInU60G8gOljucKT1cCFj0G4o3IgWy2/uL4mwswUSH2K+Bs7lZU78F8rYAU6u632OWGZTJpb9S3oDiCkLX2TXuv9tQo4Guej1ZifXYXUk+gDuSA3aNv4EdWduQvxj9b0HR0tKI4472UwohnbFo+1tnCG1vRFPZ5cdx1v5rLzQHuBAVJ0sSbokZJPbgO6OZfCfnyZlDmMMYn7R2sHfN0IzfceRHw55Ft8h9jAuPbdtdVrby6awNmBh5Gtwog+xnGgoFVyhbdqz9c4pc7LgW0DXT7MqITF8JNgSvo2glx8Zojo27dcfjA4HKqYLd6luamIbrDobdri9W0XIFXAyq8q3xe9V+uupsBBC3sjdwPlMIul7gWLBnvU5NHj+HfQUcR+SqVdWrsrLv1m638KkKAsRa/qEQAAAABJRU5ErkJggg==";function wt(c){return typeof c=="function"||Object.prototype.toString.call(c)==="[object Object]"&&!M(c)}var Tt=R({name:"unit-detail",setup(){const c=N(),d=F(),b=q(),p=q(),t=O({id:c.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}),E=async()=>{try{const{data:i}=await h.post("/api-student/studentUnitExamination/startExamination",{requestType:"form",data:{studentUnitExaminationId:t.id}}),{questionJson:e,studentAnswerJson:a,...n}=i,u=e||[];u.forEach(l=>{l.userAnswer=D(l,a)}),t.questionList=u,t.examDetail={...n},U()}catch{}},U=async()=>{const i=t.examDetail||{},e=i.startTime,a=i.now,n=i.timeMinutes||0,u=L(e).add(n,"minute").diff(L(a));u<=0?(r.emit("unitAudioStop"),await x(),t.visiableExam=!0):(t.time=Math.ceil(u/1e3)*1e3,setTimeout(()=>{var l;(l=b.value)==null||l.start()},10))},D=(i,e)=>{if(!e)return[];const a=e||[];return a[i.id]?a[i.id]:[]};let A=0;const w=(i=!0)=>{Z(()=>{i&&window.scrollTo(0,0),setTimeout(()=>{var l;const e=(l=document.querySelectorAll(".van-swipe-item")[t.currentIndex])==null?void 0:l.querySelector(".swipe-item-question"),a=e.querySelectorAll(".answerTitleImg img");let n=!0;a.forEach(y=>{console.log(y.complete),y.complete||(n=!1)}),!n&&A<3&&setTimeout(()=>{A+=1,w(i)},300),n&&(A=0);const u=_(e);t.swipeHeight=u.height},100)})},k=async()=>{var i;try{const e=t.questionList||[],a=[];if(e.forEach((n,u)=>{n.userAnswer&&n.userAnswer.length>0&&a.push({questionId:n.id,details:n.userAnswer})}),t.questionList.length===t.currentIndex+1){r.emit("unitAudioStop"),t.visiableSure=!0;return}t.nextStatus=!0,await h.post("/api-student/studentUnitExamination/submitAnswer",{hideLoading:!0,data:{answers:a,studentUnitExaminationId:t.id}}),(i=p.value)==null||i.next(),t.nextStatus=!1}catch{t.nextStatus=!1}},B=async()=>{try{await x(),S(),t.visiableResult=!0}catch{}},x=async()=>{try{const i=t.questionList||[],e=[];i.forEach(n=>{n.userAnswer&&n.userAnswer.length>0&&e.push({questionId:n.id,details:n.userAnswer})});const{data:a}=await h.post("/api-student/studentUnitExamination/completionExamination",{hideLoading:!1,data:{answers:e,studentUnitExaminationId:t.id}});a.status==="A_PASS"?(t.resultStatusType="SUCCESS",t.resultInfo={tips:"\u606D\u559C\u4F60\uFF0C\u6D4B\u9A8C\u901A\u8FC7\uFF01",score:a.score,examName:t.examDetail.unitExaminationName}):(t.resultStatusType="FAIL",t.resultInfo={tips:"\u672C\u6B21\u6D4B\u9A8C\u4E0D\u5408\u683C\uFF01",score:a.score,examName:t.examDetail.unitExaminationName})}catch{}},g=()=>{t.quitStatus=!0,r.emit("unitAudioStop")},S=()=>{window.removeEventListener("popstate",g,!1),d.back()};return j(async()=>{await E(),w(),window.history.pushState(null,"",document.URL),window.addEventListener("popstate",g,!1)}),P(()=>{r.emit("unitAudioStop")}),()=>{let i;return s("div",{class:o.unitDetail},[s(X,null,null),s(tt,{center:!0,class:o.unitSection,border:!1},{title:()=>s("div",{class:o.unitTitle},[t.examDetail.unitExaminationName]),label:()=>s("div",{class:o.unitCount},[s("div",{class:o.qNums},[s(C,{class:o.icon,name:H},null),f("\u9898\u76EE\u6570\u91CF")," ",s("span",{class:o.num,style:{paddingLeft:"6px"}},[t.currentIndex+1]),f("/"),t.examDetail.questionNum]),s("div",{class:o.qNums},[s(C,{class:o.icon,name:pt},null),f("\u5269\u4F59\u65F6\u957F\uFF1A"),s($,{ref:b,time:t.time,"onUpdate:time":e=>t.time=e,format:"mm:ss",autoStart:!1,onFinish:async()=>{r.emit("unitAudioStop"),await x(),t.visiableExam=!0}},null)])])}),s(et,{loop:!1,showIndicators:!1,ref:p,duration:300,touchable:!1,height:t.swipeHeight,style:{marginBottom:"12px"},lazyRender:!0,onChange:e=>{r.emit("unitAudioStop"),t.currentIndex=e,w()}},wt(i=t.questionList.map((e,a)=>s(st,null,{default:()=>[s("div",{class:"swipe-item-question"},[e.questionTypeCode===m.RADIO&&s(T,{value:e.userAnswer,"onUpdate:value":n=>e.userAnswer=n,index:a+1,data:e,type:"radio"},null),e.questionTypeCode===m.CHECKBOX&&s(T,{value:e.userAnswer,"onUpdate:value":n=>e.userAnswer=n,index:a+1,data:e,type:"checkbox"},null),e.questionTypeCode===m.SORT&&s(G,{value:e.userAnswer,"onUpdate:value":[n=>e.userAnswer=n,()=>{w(!1)}],data:e,index:a+1},null),e.questionTypeCode===m.LINK&&s(Q,{value:e.userAnswer,"onUpdate:value":n=>e.userAnswer=n,data:e,index:a+1},null),e.questionTypeCode===m.PLAY&&s(W,{value:e.userAnswer,"onUpdate:value":n=>e.userAnswer=n,data:e,index:a+1,unitId:t.id},null)])]})))?i:{default:()=>[i]}),s(Y,{position:"bottom",background:"white"},{default:()=>[s("div",{class:["btnGroup btnMore"]},[t.currentIndex>0&&s(I,{round:!0,block:!0,type:"primary",plain:!0,onClick:()=>{var e;(e=p.value)==null||e.prev()}},{default:()=>[f("\u4E0A\u4E00\u9898")]}),s(I,{block:!0,round:!0,type:"primary",onClick:k,loading:t.nextStatus,disabled:t.nextStatus},{default:()=>[t.questionList.length===t.currentIndex+1?"\u6D4B\u8BD5\u5B8C\u6210":"\u4E0B\u4E00\u9898"]}),s(nt,{src:z,class:[o.wapList,"van-haptics-feedback"],onClick:()=>t.visiableAnswer=!0},null)])]}),s(at,{show:t.visiableAnswer,"onUpdate:show":e=>t.visiableAnswer=e,title:"\u9898\u76EE\u5217\u8868",safeAreaInsetBottom:!0},{default:()=>[s(V,{value:t.questionList,onSelect:e=>{var a;(a=p.value)==null||a.swipeTo(e,{immediate:!0}),t.visiableAnswer=!1}},null)]}),s(K,{show:t.visiableResult,"onUpdate:show":e=>t.visiableResult=e,closeOnClickOverlay:!1,style:{background:"transparent",width:"96%"}},{default:()=>[s(J,{status:t.resultStatusType,result:t.resultInfo,confirmButtonText:"\u53BB\u7EC3\u4E60",cancelButtonText:"\u6211\u77E5\u9053\u4E86",onClose:()=>{t.visiableResult=!1,d.back(),d.back()},onConform:()=>{t.visiableResult=!1,d.back(),d.back()}},null)]}),s(v,{show:t.visiableSure,"onUpdate:show":e=>t.visiableSure=e,title:"\u6D4B\u9A8C\u5B8C\u6210",message:`\u786E\u8BA4\u672C\u6B21\u6D4B\u9A8C\u7684\u9898\u76EE\u90FD\u5B8C\u6210\u4E86\u5417\uFF1F
- \u63D0\u4EA4\u540E\u4E0D\u53EF\u4FEE\u6539\u54E6`,messageAlign:"left",showCancelButton:!0,cancelButtonText:"\u518D\u7B49\u7B49",confirmButtonText:"\u786E\u8BA4\u5B8C\u6210",onConfirm:B},null),s(v,{show:t.visiableExam,"onUpdate:show":e=>t.visiableExam=e,message:"\u8003\u8BD5\u5DF2\u7ED3\u675F",messageAlign:"center",onConfirm:async()=>{S(),t.visiableResult=!0}},null),s(v,{show:t.quitStatus,"onUpdate:show":e=>t.quitStatus=e,title:"\u63D0\u793A",message:"\u60A8\u662F\u5426\u9000\u51FA\u672C\u6B21\u6D4B\u9A8C\uFF1F",confirmButtonText:"\u786E\u8BA4\u9000\u51FA",showCancelButton:!0,cancelButtonText:"\u53D6\u6D88",onCancel:()=>{window.history.pushState(null,"",document.URL),window.addEventListener("popstate",g,!1)},onConfirm:()=>{S()}},null)])}}});export{Tt as default};
|