index-legacy.b73422fc.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.48c8d62c.js","./icon-question-nums-legacy.7080fe5e.js","./index-legacy.c57970b0.js","./index-legacy.8cf5f94f.js","./index-legacy.5a3e4145.js","./index-legacy.f73724ef.js","./index-legacy.5378722e.js","./index-legacy.087e0425.js","./index-legacy.71047e87.js","./index-legacy.0e0de364.js","./index-legacy.b7e8815a.js","./index-legacy.8429fc95.js","./index-legacy.93204044.js"],(function(t){"use strict";var r,u,o,s,c,l,d,f,m,p,g,v,w,x,h,b,y,A,q,S,_,j,k,O,E,I,C,R,T,L,U,P,D,B,X;return{setters:[function(e){r=e.d,u=e.aV,o=e.ag,s=e.R,c=e.r,l=e.$,d=e.a_,f=e.c,m=e.a5,p=e.q,g=e.B,v=e.P,w=e.ak,x=e.m,h=e.ah,b=e._,y=e.am},function(e){A=e.i},function(e){q=e.e,S=e.Q,_=e.C,j=e.D,k=e.K,O=e.P,E=e.i,I=e.A},function(e){C=e.O},function(e){R=e.O},function(e){T=e.R},function(e){L=e.C},function(e){U=e.C},function(e){P=e.S,D=e.a},function(e){B=e.I},function(e){X=e.A},function(){},function(){}],execute:function(){var K="_unitDetail_1qg73_1",N="_unitSection_1qg73_4",Z="_unitTitle_1qg73_11",F="_unitCount_1qg73_16",M="_qNums_1qg73_22",G="_num_1qg73_29",H="_icon_1qg73_32",W="_wapList_1qg73_37";t("default",r({name:"unit-detail",setup:function(){var t=u(),r=o(),z=s(),J=s(),Y=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}),V=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,x.post("/api-student/studentUnitExamination/startExamination",{requestType:"form",data:{studentUnitExaminationId:Y.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=$(e,o)})),Y.questionList=c,Y.examDetail=n({},s)||{},Q(),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)}}(),Q=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=Y.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 q.emit("unitAudioStop"),e.next=9,ie();case 9:Y.visiableExam=!0,e.next=14;break;case 12:Y.time=1e3*Math.ceil(u/1e3),setTimeout((function(){var e;null===(e=z.value)||void 0===e||e.start()}),10);case 14:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),$=function(e,t){if(!t)return[];var n=t||[];return n[e.id]?n[e.id]:[]},ee=0,te=function e(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];b((function(){t&&window.scrollTo(0,0),setTimeout((function(){var n,r=null===(n=document.querySelectorAll(".van-swipe-item")[Y.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&&ee<3&&setTimeout((function(){ee+=1,e(t)}),300),u&&(ee=0);var a=y(r);Y.swipeHeight=a.height}),100)}))},ne=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=Y.questionList||[],r=[],n.forEach((function(e,t){e.userAnswer&&e.userAnswer.length>0&&r.push({questionId:e.id,details:e.userAnswer})})),Y.questionList.length!==Y.currentIndex+1){e.next=8;break}return q.emit("unitAudioStop"),Y.visiableSure=!0,e.abrupt("return");case 8:return Y.nextStatus=!0,e.next=11,x.post("/api-student/studentUnitExamination/submitAnswer",{hideLoading:!0,data:{answers:r,studentUnitExaminationId:Y.id}});case 11:null===(t=J.value)||void 0===t||t.next(),Y.nextStatus=!1,e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),Y.nextStatus=!1;case 18:case"end":return e.stop()}}),e,null,[[0,15]])})));return function(){return e.apply(this,arguments)}}(),re=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,ie();case 3:ae(),Y.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)}}(),ie=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=Y.questionList||[],n=[],t.forEach((function(e){e.userAnswer&&e.userAnswer.length>0&&n.push({questionId:e.id,details:e.userAnswer})})),e.next=6,x.post("/api-student/studentUnitExamination/completionExamination",{hideLoading:!1,data:{answers:n,studentUnitExaminationId:Y.id}});case 6:r=e.sent,"A_PASS"===(i=r.data).status?(Y.resultStatusType="SUCCESS",Y.resultInfo={tips:"恭喜你,测验通过!",score:i.score,examName:Y.examDetail.unitExaminationName}):(Y.resultStatusType="FAIL",Y.resultInfo={tips:"本次测验不合格!",score:i.score,examName:Y.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)}}(),ue=function(){Y.quitStatus=!0,q.emit("unitAudioStop")},ae=function(){window.removeEventListener("popstate",ue,!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,V();case 2:te(),window.history.pushState(null,"",document.URL),window.addEventListener("popstate",ue,!1);case 5:case"end":return e.stop()}}),e)})))),d((function(){q.emit("unitAudioStop")})),function(){var e,t,n;return f("div",{class:K},[f(U,{center:!0,class:N,border:!1},{title:function(){return f("div",{class:Z},[Y.examDetail.unitExaminationName])},label:function(){return f("div",{class:F},[f("div",{class:M},[f(m,{class:H,name:A},null),p("题目数量")," ",f("span",{class:G,style:{paddingLeft:"6px"}},[Y.currentIndex+1]),p("/"),Y.examDetail.questionNum]),f("div",{class:M},[f(m,{class:H,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),p("剩余时长:"),f(L,{ref:z,time:Y.time,"onUpdate:time":function(e){return Y.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 q.emit("unitAudioStop"),e.next=3,ie();case 3:Y.visiableExam=!0;case 4:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})},null)])]);var e}}),f(P,{loop:!1,showIndicators:!1,ref:J,duration:300,touchable:!1,height:Y.swipeHeight,style:{marginBottom:"12px"},lazyRender:!0,onChange:function(e){q.emit("unitAudioStop"),Y.currentIndex=e,te()}},(n=e=Y.questionList.map((function(e,t){return f(D,null,{default:function(){return[f("div",{class:"swipe-item-question"},[e.questionTypeCode===S.RADIO&&f(_,{value:e.userAnswer,"onUpdate:value":function(t){return e.userAnswer=t},index:t+1,data:e,type:"radio"},null),e.questionTypeCode===S.CHECKBOX&&f(_,{value:e.userAnswer,"onUpdate:value":function(t){return e.userAnswer=t},index:t+1,data:e,type:"checkbox"},null),e.questionTypeCode===S.SORT&&f(j,{value:e.userAnswer,"onUpdate:value":[function(t){return e.userAnswer=t},function(){te(!1)}],data:e,index:t+1},null),e.questionTypeCode===S.LINK&&f(k,{value:e.userAnswer,"onUpdate:value":function(t){return e.userAnswer=t},data:e,index:t+1},null),e.questionTypeCode===S.PLAY&&f(O,{value:e.userAnswer,"onUpdate:value":function(t){return e.userAnswer=t},data:e,index:t+1,unitId:Y.id},null)])]}})})),"function"==typeof n||"[object Object]"===Object.prototype.toString.call(n)&&!w(n)?e:{default:function(){return[e]}})),f(C,{position:"bottom",background:"white"},{default:function(){return[f("div",{class:["btnGroup btnMore"]},[Y.currentIndex>0&&f(g,{round:!0,block:!0,type:"primary",plain:!0,onClick:function(){var e;null===(e=J.value)||void 0===e||e.prev()}},{default:function(){return[p("上一题")]}}),f(g,{block:!0,round:!0,type:"primary",onClick:ne,loading:Y.nextStatus,disabled:Y.nextStatus},{default:function(){return[Y.questionList.length===Y.currentIndex+1?"测试完成":"下一题"]}}),f(B,{src:E,class:[W,"van-haptics-feedback"],onClick:function(){return Y.visiableAnswer=!0}},null)])]}}),f(X,{show:Y.visiableAnswer,"onUpdate:show":function(e){return Y.visiableAnswer=e},title:"题目列表",safeAreaInsetBottom:!0},{default:function(){return[f(I,{value:Y.questionList,onSelect:function(e){var t;null===(t=J.value)||void 0===t||t.swipeTo(e,{immediate:!0}),Y.visiableAnswer=!1}},null)]}}),f(v,{show:Y.visiableResult,"onUpdate:show":function(e){return Y.visiableResult=e},closeOnClickOverlay:!1,style:{background:"transparent",width:"96%"}},{default:function(){return[f(T,{status:Y.resultStatusType,result:Y.resultInfo,confirmButtonText:"去练习",cancelButtonText:"我知道了",onClose:function(){Y.visiableResult=!1,r.back(),r.back()},onConform:function(){Y.visiableResult=!1,r.back(),r.back()}},null)]}}),f(R,{show:Y.visiableSure,"onUpdate:show":function(e){return Y.visiableSure=e},title:"测验完成",message:"确认本次测验的题目都完成了吗?\n提交后不可修改哦",messageAlign:"left",showCancelButton:!0,cancelButtonText:"再等等",confirmButtonText:"确认完成",onConfirm:re},null),f(R,{show:Y.visiableExam,"onUpdate:show":function(e){return Y.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:ae(),Y.visiableResult=!0;case 2:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})},null),f(R,{show:Y.quitStatus,"onUpdate:show":function(e){return Y.quitStatus=e},title:"提示",message:"您是否退出本次测验?",confirmButtonText:"确认退出",showCancelButton:!0,cancelButtonText:"取消",onCancel:function(){window.history.pushState(null,"",document.URL),window.addEventListener("popstate",ue,!1)},onConfirm:function(){ae()}},null)])}}}))}}}))}();