index-legacy-0a27e03d.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-e1ea41b7.js","./index-legacy-a0082703.js","./index-legacy-820d5526.js","./index-legacy-c9b011be.js","./index-legacy-c2783a73.js","./index-legacy-01b7024c.js","./index-legacy-22d0bd61.js","./index-legacy-f9c3c6d2.js","./index-legacy-666fea96.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,U,C,L,B,k,O,D;return{setters:[e=>{i=e.d,o=e.U,s=e.q,a=e.r,l=e.x,r=e.af,u=e.D,c=e.y,d=e.a8,v=e.a,p=e.S,f=e.A,_=e.C,b=e.V,w=e.a2,h=e.z,m=e._},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,U=e.R},e=>{C=e.M},e=>{L=e.u,B=e.a},e=>{k=e.S,O=e.a},e=>{D=e.I},null,null,null],execute:function(){var R=document.createElement("style");R.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(R);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",G="_right_13q27_67",V="_error_13q27_70",W="_minutes_13q27_73";e("default",i({name:"unit-detail",setup(){const e=o(),t=s(),i=a(),R=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:R.time,onChange(e){if(3e5>=e.total&&!R.countDownOver){if(R.visiableInfo.show)return void(R.countDownOver=!0);R.visiableInfo.show=!0,R.visiableInfo.title="倒计时5分钟",R.visiableInfo.showCancelButton=!1,R.visiableInfo.operationType="TIME",R.visiableInfo.type="COUNTDOWN",R.visiableInfo.confirmButtonText="确认",R.visiableInfo.content="距离交卷时间还剩五分钟哦,请尽快答题~",R.countDownOver=!0}},onFinish:(Y=n((function*(){y.emit("unitAudioStop"),yield se(),le()})),function(){return Y.apply(this,arguments)})});var Y;const J=function(){var e=n((function*(){try{let e={};if("ai"===R.type){const{data:n}=yield u.post("/edu-app/studentUnitExamination/pointRandomSave",{data:{knowledgePointIds:R.knowledgePointIds}});e=n||{}}else{const{data:n}=yield u.post("/edu-app/studentUnitExamination/mockExamination",{data:{lessonCoursewareId:R.lessonCoursewareId}});e=n||{}}e.examinationQuestionAdds.forEach((e=>{e.showAnalysis=!1,e.analysis={message:e.answerAnalysis,topic:!0,userResult:!1},e.userAnswer=[]})),R.questionList=e.examinationQuestionAdds||[],R.studentUnitExaminationId=e.unitExaminationId,R.examDetail=e||{},Z()}catch(e){}}));return function(){return e.apply(this,arguments)}}(),Z=function(){var e=n((function*(){const e=(R.examDetail||{}).timeMinutes||0;R.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*(){R.nextStatus=!0;try{var e;const n=R.questionList||[],t=[];if(n.forEach(((e,n)=>{e.userAnswer&&e.userAnswer.length>0&&t.push({questionId:e.id,details:e.userAnswer})})),R.questionList.length===R.currentIndex+1)return y.emit("unitAudioStop"),R.visiableInfo.show=!0,R.visiableInfo.title="测验完成",R.visiableInfo.showCancelButton=!0,R.visiableInfo.operationType="CONTINUE",R.visiableInfo.type="DEFAULT",R.visiableInfo.cancelButtonText="再等等",R.visiableInfo.confirmButtonText="确认完成",R.visiableInfo.content="确认本次测验的题目都完成了吗?",R.nextStatus=!1,void le();yield u.post("/edu-app/studentUnitExamination/submitAnswer",{hideLoading:!0,data:{answers:t,studentUnitExaminationId:R.studentUnitExaminationId}}),null===(e=i.value)||void 0===e||e.next()}catch(n){}R.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")[R.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);R.swipeHeight=s.height}),100)}))},ie=()=>{"RESULT"===R.visiableInfo.operationType?(R.visiableInfo.show=!1,t.back(),t.back()):"BACK"===R.visiableInfo.operationType||"CONTINUE"===R.visiableInfo.operationType?se():"TIME"===R.visiableInfo.operationType&&(R.visiableInfo.show=!1)},oe=function(){var e=n((function*(e){if("BACK"===R.visiableInfo.operationType){if(e)return R.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:R.studentUnitExaminationId}}),R.visiableInfo.show=!1,le()}catch(n){}}else"CONTINUE"===R.visiableInfo.operationType&&(R.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=R.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:R.studentUnitExaminationId}});R.visiableInfo.show=!0,R.visiableInfo.title=t.score+"分",R.visiableInfo.showCancelButton=!1,R.visiableInfo.operationType="RESULT",R.visiableInfo.confirmButtonText="确认","A_EXCELLENT"===t.status?(R.visiableInfo.type="GOOD",R.visiableInfo.content="<div>你很棒,题目掌握的非常不错,"):"B_PASS"===t.status?(R.visiableInfo.type="PASS",R.visiableInfo.content="<div>还需要加油哦,"):(R.visiableInfo.type="FAIL",R.visiableInfo.content="<div>别气馁,继续努力,"),R.visiableInfo.content+=`您本次获得了<span class='${G}'>${t.score}分</span>,正确率<span class='${V}'>${t.rightRate}%</span>,实际用时<span class='${W}'>${Math.ceil(t.answerTime/60)}</span>分钟~</div>`}catch(e){}}));return function(){return e.apply(this,arguments)}}(),ae=()=>{R.visiableInfo.show=!0,R.visiableInfo.title="确认要离开吗?",R.visiableInfo.showCancelButton=!0,R.visiableInfo.operationType="BACK",R.visiableInfo.type="DEFAULT",R.visiableInfo.cancelButtonText="弃考",R.visiableInfo.confirmButtonText="提交",R.visiableInfo.content="还有题目未完成哦,是否要提前交卷?",y.emit("unitAudioStop")},le=()=>{window.removeEventListener("popstate",ae,!1),t.back()};return c(n((function*(){L(document,"scroll",(()=>{const{y:e}=B();e.value>52?(R.background="#fff",R.color="#323333"):(R.background="transparent",R.color="#fff")})),yield J(),te(),window.history.pushState(null,"",document.URL),window.addEventListener("popstate",ae,!1)}))),d((()=>{y.emit("unitAudioStop")})),()=>{let e;return v("div",{class:P},[v(C,{position:"top"},{default:()=>[v(p,{border:!1,background:R.background,color:R.color},null)]}),v(k,{loop:!1,showIndicators:!1,ref:i,duration:300,touchable:!1,class:j,style:{paddingBottom:"12px"},lazyRender:!0,height:R.swipeHeight,onChange:e=>{y.emit("unitAudioStop"),R.currentIndex=e,te()}},(n=e=R.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,[R.currentIndex+1]),f("/"),R.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,[R.currentIndex+1]),f("/"),R.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,[R.currentIndex+1]),f("/"),R.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,[R.currentIndex+1]),f("/"),R.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:R.studentUnitExaminationId,showAnalysis:e.showAnalysis,analysis:e.analysis},{title:()=>v("div",{class:N},[v("div",{class:z},[v("span",null,[R.currentIndex+1]),f("/"),R.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(C,{position:"bottom"},{default:()=>[v("div",{class:["btnGroup btnMore",$]},[v(_,{round:!0,block:!0,class:R.currentIndex>0?Q:F,disabled:!(R.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:R.nextStatus,disabled:R.nextStatus},{default:()=>[R.questionList.length===R.currentIndex+1?"提交":"下一题"]}),v(D,{src:T,class:[M,"van-haptics-feedback"],onClick:()=>R.visiableAnswer=!0},null)])]}),v(S,{show:R.visiableAnswer,"onUpdate:show":e=>R.visiableAnswer=e,title:"题目列表",safeAreaInsetBottom:!0},{default:()=>[v(E,{value:R.questionList,onSelect:e=>{var n;null===(n=i.value)||void 0===n||n.swipeTo(e,{immediate:!0}),R.visiableAnswer=!1}},null)]}),v(b,{show:R.visiableInfo.show,"onUpdate:show":e=>R.visiableInfo.show=e,closeOnClickOverlay:!1,style:{background:"transparent",width:"100%",maxWidth:"100%",transform:"translateY(-55%)"}},{default:()=>[v(U,{title:R.visiableInfo.title,showCancelButton:R.visiableInfo.showCancelButton,cancelButtonText:R.visiableInfo.cancelButtonText,confirmButtonText:R.visiableInfo.confirmButtonText,status:R.visiableInfo.type,content:R.visiableInfo.content,closeable:"BACK"===R.visiableInfo.operationType,contentHtml:!0,onConform:ie,onClose:oe},null)]})]);var n}}}))}}}))}();