index-legacy.09dbde0c.js 14 KB

1
  1. !function(){var e=["questionJson","studentAnswerJson"];function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),!0).forEach((function(t){r(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},u=Object.keys(e);for(r=0;r<u.length;r++)n=u[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(r=0;r<u.length;r++)n=u[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function u(e,t,n,r,i,u,a){try{var o=e[u](a),s=o.value}catch(c){return void n(c)}o.done?t(s):Promise.resolve(s).then(r,i)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function o(e){u(a,r,i,o,s,"next",e)}function s(e){u(a,r,i,o,s,"throw",e)}o(void 0)}))}}var o=document.createElement("style");o.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(o),System.register(["./index-legacy.90c82f08.js","./icon-question-nums-legacy.7080fe5e.js","./index-legacy.39834207.js","./index-legacy.84457c4c.js","./index-legacy.f1d613e0.js","./index-legacy.31f6a9d2.js","./index-legacy.baa64f1d.js","./index-legacy.f3e5e283.js","./index-legacy.64e3b474.js","./index-legacy.eb4bc59e.js","./index-legacy.2870cc6d.js","./index-legacy.e4343e46.js","./index-legacy.92c1b9d6.js"],(function(t){"use strict";var r,u,o,s,c,l,d,f,m,p,g,v,w,x,b,h,y,A,q,S,_,j,O,k,E,I,C,R,T,L,U,P,D,B,X,K;return{setters:[function(e){r=e.d,u=e.ah,o=e.ag,s=e.R,c=e.r,l=e.$,d=e.b3,f=e.c,m=e.aj,p=e.a5,g=e.q,v=e.B,w=e.P,x=e.al,b=e.m,h=e.ai,y=e._,A=e.an},function(e){q=e.i},function(e){S=e.e,_=e.Q,j=e.C,O=e.D,k=e.K,E=e.P,I=e.i,C=e.A},function(e){R=e.O},function(e){T=e.O},function(e){L=e.R},function(e){U=e.C},function(e){P=e.C},function(e){D=e.S,B=e.a},function(e){X=e.I},function(e){K=e.A},function(){},function(){}],execute:function(){var N="_unitDetail_1qg73_1",Z="_unitSection_1qg73_4",F="_unitTitle_1qg73_11",M="_unitCount_1qg73_16",G="_qNums_1qg73_22",H="_num_1qg73_29",W="_icon_1qg73_32",z="_wapList_1qg73_37";t("default",r({name:"unit-detail",setup:function(){var t=u(),r=o(),J=s(),Y=s(),V=c({id:t.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}),Q=function(){var t=a(regeneratorRuntime.mark((function t(){var r,u,a,o,s,c;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,b.post("/api-student/studentUnitExamination/startExamination",{requestType:"form",data:{studentUnitExaminationId:V.id}});case 3:r=t.sent,u=r.data,a=u.questionJson,o=u.studentAnswerJson,s=i(u,e),(c=a||[]).forEach((function(e){e.userAnswer=ee(e,o)})),V.questionList=c,V.examDetail=n({},s)||{},$(),t.next=15;break;case 13:t.prev=13,t.t0=t.catch(0);case 15:case"end":return t.stop()}}),t,null,[[0,13]])})));return function(){return t.apply(this,arguments)}}(),$=function(){var e=a(regeneratorRuntime.mark((function e(){var t,n,r,i,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=V.examDetail||{},n=t.startTime,r=t.now,i=t.timeMinutes||0,!((u=h(n).add(i,"minute").diff(h(r)))<=0)){e.next=12;break}return S.emit("unitAudioStop"),e.next=9,ue();case 9:V.visiableExam=!0,e.next=14;break;case 12:V.time=1e3*Math.ceil(u/1e3),setTimeout((function(){var e;null===(e=J.value)||void 0===e||e.start()}),10);case 14:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ee=function(e,t){if(!t)return[];var n=t||[];return n[e.id]?n[e.id]:[]},te=0,ne=function e(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];y((function(){t&&window.scrollTo(0,0),setTimeout((function(){var n,r=null===(n=document.querySelectorAll(".van-swipe-item")[V.currentIndex])||void 0===n?void 0:n.querySelector(".swipe-item-question"),i=r.querySelectorAll(".answerTitleImg img"),u=!0;i.forEach((function(e){console.log(e.complete),e.complete||(u=!1)})),!u&&te<3&&setTimeout((function(){te+=1,e(t)}),300),u&&(te=0);var a=A(r);V.swipeHeight=a.height}),100)}))},re=function(){var e=a(regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,n=V.questionList||[],r=[],n.forEach((function(e,t){e.userAnswer&&e.userAnswer.length>0&&r.push({questionId:e.id,details:e.userAnswer})})),V.questionList.length!==V.currentIndex+1){e.next=8;break}return S.emit("unitAudioStop"),V.visiableSure=!0,e.abrupt("return");case 8:return V.nextStatus=!0,e.next=11,b.post("/api-student/studentUnitExamination/submitAnswer",{hideLoading:!0,data:{answers:r,studentUnitExaminationId:V.id}});case 11:null===(t=Y.value)||void 0===t||t.next(),V.nextStatus=!1,e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),V.nextStatus=!1;case 18:case"end":return e.stop()}}),e,null,[[0,15]])})));return function(){return e.apply(this,arguments)}}(),ie=function(){var e=a(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ue();case 3:oe(),V.visiableResult=!0,e.next=9;break;case 7:e.prev=7,e.t0=e.catch(0);case 9:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(){return e.apply(this,arguments)}}(),ue=function(){var e=a(regeneratorRuntime.mark((function e(){var t,n,r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t=V.questionList||[],n=[],t.forEach((function(e){e.userAnswer&&e.userAnswer.length>0&&n.push({questionId:e.id,details:e.userAnswer})})),e.next=6,b.post("/api-student/studentUnitExamination/completionExamination",{hideLoading:!1,data:{answers:n,studentUnitExaminationId:V.id}});case 6:r=e.sent,"A_PASS"===(i=r.data).status?(V.resultStatusType="SUCCESS",V.resultInfo={tips:"恭喜你,测验通过!",score:i.score,examName:V.examDetail.unitExaminationName}):(V.resultStatusType="FAIL",V.resultInfo={tips:"本次测验不合格!",score:i.score,examName:V.examDetail.unitExaminationName}),e.next=13;break;case 11:e.prev=11,e.t0=e.catch(0);case 13:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(){return e.apply(this,arguments)}}(),ae=function(){V.quitStatus=!0,S.emit("unitAudioStop")},oe=function(){window.removeEventListener("popstate",ae,!1),r.back()};return l(a(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Q();case 2:ne(),window.history.pushState(null,"",document.URL),window.addEventListener("popstate",ae,!1);case 5:case"end":return e.stop()}}),e)})))),d((function(){S.emit("unitAudioStop")})),function(){var e,t,n;return f("div",{class:N},[f(m,null,null),f(P,{center:!0,class:Z,border:!1},{title:function(){return f("div",{class:F},[V.examDetail.unitExaminationName])},label:function(){return f("div",{class:M},[f("div",{class:G},[f(p,{class:W,name:q},null),g("题目数量")," ",f("span",{class:H,style:{paddingLeft:"6px"}},[V.currentIndex+1]),g("/"),V.examDetail.questionNum]),f("div",{class:G},[f(p,{class:W,name:"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=="},null),g("剩余时长:"),f(U,{ref:J,time:V.time,"onUpdate:time":function(e){return V.time=e},format:"mm:ss",autoStart:!1,onFinish:(e=a(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return S.emit("unitAudioStop"),e.next=3,ue();case 3:V.visiableExam=!0;case 4:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})},null)])]);var e}}),f(D,{loop:!1,showIndicators:!1,ref:Y,duration:300,touchable:!1,height:V.swipeHeight,style:{marginBottom:"12px"},lazyRender:!0,onChange:function(e){S.emit("unitAudioStop"),V.currentIndex=e,ne()}},(n=e=V.questionList.map((function(e,t){return f(B,null,{default:function(){return[f("div",{class:"swipe-item-question"},[e.questionTypeCode===_.RADIO&&f(j,{value:e.userAnswer,"onUpdate:value":function(t){return e.userAnswer=t},index:t+1,data:e,type:"radio"},null),e.questionTypeCode===_.CHECKBOX&&f(j,{value:e.userAnswer,"onUpdate:value":function(t){return e.userAnswer=t},index:t+1,data:e,type:"checkbox"},null),e.questionTypeCode===_.SORT&&f(O,{value:e.userAnswer,"onUpdate:value":[function(t){return e.userAnswer=t},function(){ne(!1)}],data:e,index:t+1},null),e.questionTypeCode===_.LINK&&f(k,{value:e.userAnswer,"onUpdate:value":function(t){return e.userAnswer=t},data:e,index:t+1},null),e.questionTypeCode===_.PLAY&&f(E,{value:e.userAnswer,"onUpdate:value":function(t){return e.userAnswer=t},data:e,index:t+1,unitId:V.id},null)])]}})})),"function"==typeof n||"[object Object]"===Object.prototype.toString.call(n)&&!x(n)?e:{default:function(){return[e]}})),f(R,{position:"bottom",background:"white"},{default:function(){return[f("div",{class:["btnGroup btnMore"]},[V.currentIndex>0&&f(v,{round:!0,block:!0,type:"primary",plain:!0,onClick:function(){var e;null===(e=Y.value)||void 0===e||e.prev()}},{default:function(){return[g("上一题")]}}),f(v,{block:!0,round:!0,type:"primary",onClick:re,loading:V.nextStatus,disabled:V.nextStatus},{default:function(){return[V.questionList.length===V.currentIndex+1?"测试完成":"下一题"]}}),f(X,{src:I,class:[z,"van-haptics-feedback"],onClick:function(){return V.visiableAnswer=!0}},null)])]}}),f(K,{show:V.visiableAnswer,"onUpdate:show":function(e){return V.visiableAnswer=e},title:"题目列表",safeAreaInsetBottom:!0},{default:function(){return[f(C,{value:V.questionList,onSelect:function(e){var t;null===(t=Y.value)||void 0===t||t.swipeTo(e,{immediate:!0}),V.visiableAnswer=!1}},null)]}}),f(w,{show:V.visiableResult,"onUpdate:show":function(e){return V.visiableResult=e},closeOnClickOverlay:!1,style:{background:"transparent",width:"96%"}},{default:function(){return[f(L,{status:V.resultStatusType,result:V.resultInfo,confirmButtonText:"去练习",cancelButtonText:"我知道了",onClose:function(){V.visiableResult=!1,r.back(),r.back()},onConform:function(){V.visiableResult=!1,r.back(),r.back()}},null)]}}),f(T,{show:V.visiableSure,"onUpdate:show":function(e){return V.visiableSure=e},title:"测验完成",message:"确认本次测验的题目都完成了吗?\n提交后不可修改哦",messageAlign:"left",showCancelButton:!0,cancelButtonText:"再等等",confirmButtonText:"确认完成",onConfirm:ie},null),f(T,{show:V.visiableExam,"onUpdate:show":function(e){return V.visiableExam=e},message:"考试已结束",messageAlign:"center",onConfirm:(t=a(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:oe(),V.visiableResult=!0;case 2:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})},null),f(T,{show:V.quitStatus,"onUpdate:show":function(e){return V.quitStatus=e},title:"提示",message:"您是否退出本次测验?",confirmButtonText:"确认退出",showCancelButton:!0,cancelButtonText:"取消",onCancel:function(){window.history.pushState(null,"",document.URL),window.addEventListener("popstate",ae,!1)},onConfirm:function(){oe()}},null)])}}}))}}}))}();