(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-study-exam"],{"05a1":function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return u})),n.d(e,"a",(function(){return o}));var o={uToast:n("c36e").default,pageTitle:n("502c").default,uIcon:n("1d58").default,uButton:n("4f32").default,uModal:n("632b").default},a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",[n("u-toast",{ref:"messager"}),n("page-title",{attrs:{showBack:!1}},[t._v("课程考试")]),n("v-uni-view",[n("v-uni-view",{staticStyle:{display:"flex","justify-content":"space-between",padding:"20upx"}},[n("v-uni-view",{staticStyle:{"padding-top":"10upx",color:"#757575"}},[t._v("第"+t._s(t.curIndex+1)+"题 / 共"+t._s(t.total)+"题")]),n("v-uni-view",{staticStyle:{color:"#000000"}},[n("v-uni-text",{class:{redText:t.timerValue<5},staticStyle:{"font-size":"40upx"}},[t._v(t._s(t.timerValue))]),t._v("分钟")],1)],1),n("v-uni-view",{staticClass:"qitem"},[n("v-uni-view",{staticClass:"qitem-info"},[n("v-uni-view",[t._v("["+t._s(t.getTypeName(t.curItem.type))+"]"+t._s(t.curItem.content))]),t.curItem.images?n("v-uni-view",{staticClass:"qimg"},[n("img",{staticClass:"qimg-fit",attrs:{src:t.imageBaseUrl+t.curItem.images}})]):t._e()],1),t._l(t.curItem.options,(function(e,o){return n("v-uni-view",{key:o},[n("v-uni-view",{staticClass:"qitem-opts"},[n("v-uni-view",{staticClass:"qitem-opt",class:{check:e.checked},on:{click:function(n){arguments[0]=n=t.$handleEvent(n),t.chooseOption(e)}}},[t._v(t._s(t.toLetter(o+1))+"."+t._s(e.content)),e.checked?n("u-icon",{attrs:{name:"checkbox-mark",color:"#00aa00"}}):t._e()],1),e.images?n("v-uni-view",{staticClass:"qimg"},[n("img",{staticClass:"qimg-fit",attrs:{src:t.imageBaseUrl+e.images}})]):t._e()],1)],1)}))],2)],1),n("v-uni-view",{staticStyle:{height:"50px"}}),t.stop?t._e():n("v-uni-view",{staticClass:"bottom-btns"},[n("u-button",{staticClass:"sub",attrs:{type:"success",text:"提交"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.present.apply(void 0,arguments)}}}),t.curIndex>0?n("u-button",{staticClass:"next",attrs:{type:"info",text:"上一题"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.prevSub.apply(void 0,arguments)}}}):t._e(),t.curIndex-1&&(this.curItem=this.paper.items[this.curIndex]))},nextSub:function(){this.curIndex>=this.total-1||(this.curIndex++,this.curItem=this.paper.items[this.curIndex])},countTest:function(){var t=0;this.paper.items.forEach((function(e){e.score=parseInt(e.score),t+=e.score,102!=e.type?(e.userAnswer="",e.options.forEach((function(t){t.checked&&(e.userAnswer=t.id)}))):(e.userAnswer=[],e.options.forEach((function(t){t.checked&&e.userAnswer.push(t.id)})))}));var e=0,n=[];return this.paper.items.forEach((function(t,o){if(102!=t.type)""==t.userAnswer&&n.push(o+1),t.options.forEach((function(n){n.answer&&t.userAnswer==n.id&&(e+=t.score)}));else{0==t.userAnswer.length&&n.push(o+1);var a=!0;t.options.forEach((function(e){e.answer?-1==t.userAnswer.indexOf(e.id)&&(a=!1):t.userAnswer.indexOf(e.id)>-1&&(a=!1)})),a&&(e+=t.score)}})),this.noAnswers=n,null===e&&(e=0),this.lastScore=e,this.info.percentScore&&(this.lastScore=parseInt(100*e/t)),this.lastScore},submitTest:function(){var t=this,e=new Date,n={studyId:this.studyId,studyItemId:this.studyItemId,courseId:this.info.courseId,contentId:this.info.contentId,testId:this.info.id,testName:""+this.info.testName,testDuration:0,arrange:this.info.arrange,passLine:this.info.passLine,randomMode:this.info.randomMode,score:this.lastScore,paperJson:JSON.stringify(this.paper)},o=e.getTime()-this.startTime.getTime(),a=Math.floor(o/1e3);n.testDuration=a,u.default.saveExam(n).then((function(e){200==e.status?(t.studyItemId=e.result.studyItemId,t.scoreShow=!0):t.$refs.messager.show({message:e.message,type:"error"})}))},present:function(){var t=this;this.countTest();this.noAnswers.length>0?uni.showModal({title:"友情提示",content:"还有未答试题,您确定要提交吗?",success:function(e){e.confirm&&t.submitTest()}}):this.submitTest()},confirmFinish:function(){uni.redirectTo({url:"/pages/study/courseStudy?id="+this.info.courseId+"&contentId="+this.examId})}}};e.default=c}).call(this,n("5a52")["default"])},c281:function(t,e,n){"use strict";n.r(e);var o=n("bf95"),a=n.n(o);for(var u in o)["default"].indexOf(u)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(u);e["default"]=a.a},c29f:function(t,e,n){"use strict";n.r(e);var o=n("daf5"),a=n.n(o);for(var u in o)["default"].indexOf(u)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(u);e["default"]=a.a},cc29:function(t,e,n){"use strict";n("7a82");var o=n("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=o(n("704e")),u={name:"u-modal",mixins:[uni.$u.mpMixin,uni.$u.mixin,a.default],data:function(){return{loading:!1}},watch:{show:function(t){t&&this.loading&&(this.loading=!1)}},methods:{confirmHandler:function(){this.asyncClose&&(this.loading=!0),this.$emit("confirm")},cancelHandler:function(){this.$emit("cancel")},clickHandler:function(){this.closeOnClickOverlay&&this.$emit("close")}}};e.default=u},d56f:function(t,e,n){var o=n("24fb");e=o(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.top[data-v-756a4c08]{height:40px;background-color:#fff;display:flex}.top .top-back[data-v-756a4c08]{color:#333;padding-top:10px;height:40px;line-height:40px;padding-left:15px}.top .top-title[data-v-756a4c08]{text-align:center;font-size:16px;font-weight:550;color:#333;height:40px;text-align:center;width:80%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:40px}',""]),t.exports=e},da2d:function(t,e,n){"use strict";var o=n("644d"),a=n.n(o);a.a},daf5:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o={props:{backUrl:{type:String,default:""},showBack:{type:Boolean,default:!1},goPgae:{type:String,default:""}},data:function(){return{}},methods:{topgae:function(){""!=this.goPgae&&uni.navigateTo({url:this.goPgae})},toBack:function(){if(""!=this.backUrl)"/pages/my/index"==this.backUrl?uni.switchTab({url:this.backUrl}):uni.navigateTo({url:this.backUrl});else{var t=getCurrentPages(),e=t[t.length-2];e?uni.navigateBack():uni.switchTab({url:"/pages/index/index"})}}}};e.default=o},e31d:function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return u})),n.d(e,"a",(function(){return o}));var o={uPopup:n("5d31").default,uLine:n("65b5").default,uLoadingIcon:n("3a85").default},a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("u-popup",{attrs:{mode:"center",zoom:t.zoom,show:t.show,customStyle:{borderRadius:"6px",overflow:"hidden",marginTop:"-"+t.$u.addUnit(t.negativeTop)},closeOnClickOverlay:t.closeOnClickOverlay,safeAreaInsetBottom:!1,duration:400},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.clickHandler.apply(void 0,arguments)}}},[n("v-uni-view",{staticClass:"u-modal",style:{width:t.$u.addUnit(t.width)}},[t.title?n("v-uni-text",{staticClass:"u-modal__title"},[t._v(t._s(t.title))]):t._e(),n("v-uni-view",{staticClass:"u-modal__content",style:{paddingTop:(t.title?12:25)+"px"}},[t._t("default",[n("v-uni-text",{staticClass:"u-modal__content__text"},[t._v(t._s(t.content))])])],2),t.$slots.confirmButton?n("v-uni-view",{staticClass:"u-modal__button-group--confirm-button"},[t._t("confirmButton")],2):[n("u-line"),n("v-uni-view",{staticClass:"u-modal__button-group",style:{flexDirection:t.buttonReverse?"row-reverse":"row"}},[t.showCancelButton?n("v-uni-view",{staticClass:"u-modal__button-group__wrapper u-modal__button-group__wrapper--cancel",class:[t.showCancelButton&&!t.showConfirmButton&&"u-modal__button-group__wrapper--only-cancel"],attrs:{"hover-stay-time":150,"hover-class":"u-modal__button-group__wrapper--hover"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.cancelHandler.apply(void 0,arguments)}}},[n("v-uni-text",{staticClass:"u-modal__button-group__wrapper__text",style:{color:t.cancelColor}},[t._v(t._s(t.cancelText))])],1):t._e(),t.showConfirmButton&&t.showCancelButton?n("u-line",{attrs:{direction:"column"}}):t._e(),t.showConfirmButton?n("v-uni-view",{staticClass:"u-modal__button-group__wrapper u-modal__button-group__wrapper--confirm",class:[!t.showCancelButton&&t.showConfirmButton&&"u-modal__button-group__wrapper--only-confirm"],attrs:{"hover-stay-time":150,"hover-class":"u-modal__button-group__wrapper--hover"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.confirmHandler.apply(void 0,arguments)}}},[t.loading?n("u-loading-icon"):n("v-uni-text",{staticClass:"u-modal__button-group__wrapper__text",style:{color:t.confirmColor}},[t._v(t._s(t.confirmText))])],1):t._e()],1)]],2)],1)},u=[]},eed5:function(t,e,n){"use strict";var o=n("ac27"),a=n.n(o);a.a},f17b:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.correctJudgment=function(t){var e=!1;101==t.type||103==t.type?t.options.forEach((function(n){n.answer&&(e=n.id==t.userAnswer)})):t.options.forEach((function(t){e=t.answer==t.isCheck}));return e},e.cutOrgNamePath=void 0,e.examType=function(t){var e="";switch(t){case 1:e="单选";break;case 2:e="多选";break;case 3:e="判断";break}return e},e.formatDate=function(t){if(null==t||""==t)return;var e=new Date(Number(t)).getFullYear(),n=new Date(Number(t)).getMonth()+1,o=new Date(Number(t)).getDate(),a=new Date(Number(t)).getHours(),u=new Date(Number(t)).getMinutes(),i=new Date(Number(t)).getSeconds();n<10&&(n="0"+n);o<10&&(o="0"+o);a<10&&(a="0"+a);u<10&&(u="0"+u);i<10&&(i="0"+i);var r=e+"-"+n+"-"+o+" "+a+":"+u+":"+i;return r},e.formatSecondToHour=function(t){t=Number(t);var e=t/3600;e=e.toFixed(1),isNaN(e)&&(e=0);return e},e.formatUserNumber=function(t){var e=0;if(t<5)return t;if(t>=5&&t<=10)return"10+";if(t<=94)return e=10*Math.round(t/10),e+"+";if(t>94&&t<=1e3)return e=100*Math.round(t/100),e+"+";if(t>1e3&&t<=1e4)return e=1e3*Math.round(t/1e3),e+"+";if(t>1e4)return e=Math.round(t/1e4),e+"W+";return t},e.getContentType=function(t){var e=o[t];return e},e.getCourseType=function(t){return{10:"录播课",21:"直播课",20:"录播课",30:"面授课",40:"学习项目"}[t]},e.getHMS=function(t){var e=parseInt(t/3600)<10?"0"+parseInt(t/3600):parseInt(t/3600),n=parseInt(t%3600/60)<10?"0"+parseInt(t%3600/60):parseInt(t%3600/60),o=parseInt(t%3600%60)<10?"0"+parseInt(t%3600%60):parseInt(t%3600%60);return e+":"+n+":"+o},e.getQuestionType=function(t){var e="";switch(t){case 101:e="单选";break;case 102:e="多选";break;case 103:e="判断";break}return e},e.getUrlPre=function(t){var e="https:"==document.location.prototype,n="https";n=e?"https":"http";return n},e.numberToLetter=function(t){var e="";while(t>0){var n=t%26;n=0===n?n=26:n,e=String.fromCharCode(96+parseInt(n))+e,t=(t-n)/26}return e.toUpperCase()},e.toScore=function(t){if(!t||0==t)return"未评";return(""+t).indexOf(".")>-1?t.toFixed(1):t+".0"},e.toScoreTow=function(t){if(!t)return"0";return(""+t).indexOf(".")>-1?t.toFixed(2):t+".00"},e.userAvatarText=function(t){if(t){var e=t.length;e>2&&(t=t.substring(e-2))}return t},n("a9e3"),n("c975"),n("e25e"),n("d3b7"),n("159b");var o={10:"视频",20:"音频",30:"图片",40:"文档",41:"图文",50:"scrom包",52:"外部连接",60:"作业",61:"考试",62:"评估",90:"其它"};e.cutOrgNamePath=function(t){var e=t;if(e){var n=e.split("/"),o=n.length;o>1&&(e=n[1])}return e}}}]);