jt360front/dist/static/js/12.a410792c336a5cbce4de.js
2025-06-25 12:11:39 +08:00

2 lines
10 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

webpackJsonp([12],{HAQD:function(t,e){},mxva:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});n("OgVB");var s=n("/Lyv"),i=n.n(s),a=(n("34+y"),n("X+yh")),o=n.n(a),r=n("NYxO"),u=n("Vr0m"),c=n("VKKs"),_=n("Xl5t"),l=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},h={name:"LiuYan",components:{Back:u.a,WXTake:_.a},data:function(){return{id:"",config:{},exam_data:{},xuhao:["A","B","C","D","E","F","G","H","I","J","K","L","M","N"],questions:[],current_question:0,current_question_data:{},popupVisible:!1,timer:"",time_str:"",tiankongdata:[],submitCount:0,canTakePhoto:!0,isFaceDetected:!1,exam_alltime:"",currenttime:1}},methods:{bulrinput:function(){this.$refs.verifyCode.focus()},start:function(){var t=this,e=(new Date).getTime();this.getData("/Question/getSimulatedQuestions",{token:Object(c.a)("token"),course_id:this.$route.query.course_id}).then(function(n){if(1==n.code){var s=t;t.id=n.data.id,t.config=n.data,t.questions=n.data.question_data,t.current_question_data=n.data.question_data[0];var i=1;12==t.current_question_data.type&&t.tk(t.current_question_data.answer.split("*")),t.exam_data=n.data.exam_data,t.exam_alltime=n.data.exam_data.remain_time,t.timer=setInterval(function(){var t=(new Date).getTime();if(s.exam_data.remain_time>0){var n=(t-e)/1e3-i;i=(t-e)/1e3,s.exam_data.remain_time=s.exam_data.remain_time-n}else s.time_str="时间结束",s.subQ(),clearInterval(s.timer);var a=s.exam_data.remain_time;s.currenttime=parseInt(s.exam_alltime-a),s.time_str=a>60?parseInt(a/60)+"分"+parseInt(60*(parseFloat(a/60)-parseInt(a/60)))+"秒":parseInt(a)+"秒";var r=5400-s.exam_data.remain_time;895!=(r=Math.trunc(r))&&2695!=r&&4495!=r&&6295!=r||1!=s.loginInfo.need_check_face||o()("稍后开启相机,进行人脸检测,请做好准备"),900!=r&&2700!=r&&4500!=r&&6300!=r||1!=s.loginInfo.need_check_face||s.canTakePhoto&&(s.canTakePhoto=!1,s.partakePhoto(),setTimeout(function(){s.canTakePhoto=!0},1e4))},1e3)}else o()(n.msg)},function(t){})},tk:function(t){this.tiankongdata=[];var e=this.questions[this.current_question].response;if(e.length>0)for(var n=e.split("*"),s=0;s<t.length-1;s++){var i={label:t[s],num:n[s].split("|")};this.tiankongdata.push(i)}else for(s=0;s<t.length-1;s++){i={label:t[s],num:[]};this.tiankongdata.push(i)}},prevQ:function(){this.current_question<=0?o()("已是第一题"):(this.current_question--,this.current_question_data=this.questions[this.current_question],12==this.current_question_data.type&&this.tk(this.current_question_data.answer.split("*")))},nextQ:function(){this.current_question>=this.questions.length-1?o()("已是最后一题"):(this.current_question++,this.current_question_data=this.questions[this.current_question],12==this.current_question_data.type&&this.tk(this.current_question_data.answer.split("*")))},responseQ:function(t){this.questions[this.current_question].response=t,this.current_question_data={},this.current_question_data=this.questions[this.current_question]},responseS:function(t){var e=this.questions[this.current_question].response;if(e){var n;-1==(n=e.indexOf(t))?this.questions[this.current_question].response.push(t):this.questions[this.current_question].response.splice(n,1),this.current_question_data={},this.current_question_data=this.questions[this.current_question]}else this.questions[this.current_question].response=[t]},responseC:function(){for(var t="",e=0;e<this.tiankongdata.length;e++){for(var n=this.tiankongdata[e].num,s=0;s<n.length;s++)t+=n[s],t+="|";t+="*"}this.questions[this.current_question].response=t},goQ:function(t){this.current_question=t,this.current_question_data=this.questions[this.current_question]},subQ:function(){var t=this;if(this.currenttime>=1200){for(var e=this.questions,n=0;n<e.length;n++){if(4==e[n].type){for(var s=e[n].response,a="",r=0;r<s.length;r++)a+=e[n].content[s[r]],r<s.length-1&&(a+="|");e[n].response=a}if(12==e[n].type){var u=e[n].response;"string"==typeof u&&(e[n].response=u.replace(/\|/g,""))}}this.getData("/Question/sendSimulated",{token:Object(c.a)("token"),content:JSON.stringify(e),id:this.id,num:"2"}).then(function(e){1==e.code?1==e.data.is_standard?i.a.alert("您的考试成绩为"+e.data.score+"分,通过了本次考试","恭喜").then(function(e){t.$router.push({path:"/"})}):i()({message:"考试剩余时间为"+t.time_str+",是否<b style='color:red;'>继续答题</b>",showConfirmButton:!0,showCancelButton:!0,confirmButtonText:"继续答题",cancelButtonText:"提交考卷",confirmButtonHighlight:!0}).then(function(n){"confirm"==n||i.a.alert("您的考试成绩为"+e.data.score+"分,暂未通过本次考试","抱歉").then(function(e){t.$router.push({path:"/"})})}):o()(e.msg)},function(t){})}else o()("考试20分钟以后才可交卷请耐心等待")},directSubQ:function(){for(var t=this,e=this.questions,n=0;n<e.length;n++){if(4==e[n].type){for(var s=e[n].response,a="",r=0;r<s.length;r++)a+=e[n].content[s[r]],r<s.length-1&&(a+="|");e[n].response=a}if(12==e[n].type){var u=e[n].response;"string"==typeof u&&(e[n].response=u.replace(/\|/g,""))}e[n].response==e[n].answer&&this.true_quesstion++,1==this.config.exam_type?this.getData("/Question/sendExam",{token:Object(c.a)("token"),content:JSON.stringify(e),course_id:this.courseID}).then(function(e){1==e.code?1==e.data.is_standard?i.a.alert("您的考试成绩为"+e.data.score+"分,通过了本次考试","恭喜").then(function(e){t.$router.push({path:"/"})}):i.a.alert("您的考试成绩为"+e.data.score+"分,未通过本次考试","抱歉").then(function(e){t.$router.push({path:"/"})}):o()(e.msg)},function(t){}):2==this.config.exam_type?this.getData("/Question/sendExamBu",{token:Object(c.a)("token"),content:JSON.stringify(this.questions),id:this.exam_data.id,num:"3"}).then(function(e){1==e.code?1==e.data.is_standard?i.a.alert("您的考试成绩为"+e.data.score+"分,通过了本次补考","恭喜").then(function(e){t.$router.push({path:"/"})}):i.a.alert("您的考试成绩为"+e.data.score+"分,未通过本次补考","抱歉").then(function(e){t.$router.push({path:"/"})}):o()(e.msg)},function(t){}):o()("非法操作")}},partakePhoto:function(){this.$refs.wxchild.takePhoto()},printResult:function(t,e){var n=this;0==e||(console.log("识别结果:",t),"success"==t?(o()("识别成功,请继续答题"),this.submitCount=0,this.isFaceDetected=!0):(this.submitCount=this.submitCount+1,this.submitCount>2?(this.submitCount=0,setTimeout(function(){o()("人脸检测失败,在正式考试中,系统将会自动提交考卷")},5e3)):(setTimeout(function(){o()("将再次打开相机,请重新拍照提交")},5e3),setTimeout(function(){n.partakePhoto()},1e4))))}},mounted:function(){console.log(this.loginInfo),this.start()},computed:l({},Object(r.c)(["loginInfo"])),destroyed:function(){window.removeEventListener("popstate",this.fun,!1)}},d={render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"liuyan"},[s("back",{attrs:{title:"模拟考试"}}),t._v(" "),s("div",{staticClass:"lx"},[s("div",{staticClass:"times"},[t._v("剩余时间:"+t._s(t.time_str))]),t._v(" "),13==t.current_question_data.type?s("div",[s("div",{staticClass:"lianxiTiMu"},[s("span",{staticClass:"lianxiTiMu1"},[t._v("是非题")]),t._v(" "),s("span",[t._v(t._s(t.current_question_data.name))])]),t._v(" "),t._l(t.current_question_data.content,function(e,n){return s("div",{key:n,staticClass:"lianxiTiMu",on:{click:function(n){return t.responseQ(e)}}},[s("span",{staticClass:"lianxiXueZe",class:{active:t.current_question_data.response==e}},[t._v(t._s(t.xuhao[n]))]),t._v(" "),s("span",{staticClass:"lianxiXueZe1"},[t._v(t._s(e))])])})],2):t._e(),t._v(" "),3==t.current_question_data.type?s("div",[s("div",{staticClass:"lianxiTiMu"},[s("span",{staticClass:"lianxiTiMu1"},[t._v("单选题")]),t._v(" "),s("span",[t._v(t._s(t.current_question_data.name))])]),t._v(" "),t._l(t.current_question_data.content,function(e,n){return s("div",{key:n,staticClass:"lianxiTiMu",on:{click:function(n){return t.responseQ(e)}}},[s("span",{staticClass:"lianxiXueZe",class:{active:t.current_question_data.response==e}},[t._v(t._s(t.xuhao[n]))]),t._v(" "),s("span",{staticClass:"lianxiXueZe1"},[t._v(t._s(e))])])})],2):t._e(),t._v(" "),4==t.current_question_data.type?s("div",[s("div",{staticClass:"lianxiTiMu"},[s("span",{staticClass:"lianxiTiMu1"},[t._v("多选题")]),t._v(" "),s("span",[t._v(t._s(t.current_question_data.name))])]),t._v(" "),t._l(t.current_question_data.content,function(e,n){return s("div",{key:n,staticClass:"lianxiTiMu",on:{click:function(e){return t.responseS(n)}}},[s("span",{staticClass:"lianxiXueZe",class:{active:-1!=t.current_question_data.response.indexOf(n)}},[t._v(t._s(t.xuhao[n]))]),t._v(" "),s("span",{staticClass:"lianxiXueZe1"},[t._v(t._s(e))])])})],2):t._e(),t._v(" "),12==t.current_question_data.type?s("div",[s("div",{staticClass:"lianxiTiMu"},[s("span",{staticClass:"lianxiTiMu1"},[t._v("填空题")]),t._v(" "),s("span",[t._v(t._s(t.current_question_data.name))]),t._v(" "),t._l(t.tiankongdata,function(e,n){return s("div",{key:n,staticClass:"tiankong"},t._l(e.label.length,function(n,i){return s("div",{key:i},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.num[i],expression:"i.num[index]"}],staticClass:"tiank",attrs:{type:"text",maxlength:"1"},domProps:{value:e.num[i]},on:{change:function(e){return t.responseC()},input:function(n){n.target.composing||t.$set(e.num,i,n.target.value)}}})])}),0)})],2)]):t._e(),t._v(" "),s("div",{staticClass:"lianxiBottom"},[s("div",{staticClass:"lianxiBottomL"},[s("div",{on:{click:t.prevQ}},[t._v("上一题")]),t._v(" "),s("div",{on:{click:t.nextQ}},[t._v("下一题")]),t._v(" "),s("div",{on:{click:t.subQ}},[t._v("交卷")])]),t._v(" "),s("div",{staticClass:"lianxiBottomR",on:{click:function(e){t.popupVisible=!0}}},[s("img",{attrs:{src:n("ExKQ"),alt:""}}),s("span",[t._v(t._s(t.current_question+1))]),t._v("/"+t._s(t.questions.length)+"\n ")])])]),t._v(" "),s("mt-popup",{attrs:{position:"bottom"},model:{value:t.popupVisible,callback:function(e){t.popupVisible=e},expression:"popupVisible"}},[s("div",{staticClass:"order_number"},t._l(t.questions,function(e,n){return s("div",{key:n,class:{done:""!=e.response&&t.current_question!=n,error:!e.response&&t.current_question!=n,active:t.current_question==n},on:{click:function(e){return t.goQ(n)}}},[t._v("\n "+t._s(n+1)+"\n ")])}),0)]),t._v(" "),s("WXTake",{ref:"wxchild",on:{result:t.printResult}})],1)},staticRenderFns:[]};var p=n("VU/8")(h,d,!1,function(t){n("HAQD")},"data-v-7666afbf",null);e.default=p.exports}});
//# sourceMappingURL=12.a410792c336a5cbce4de.js.map