(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-study-exam"],{"006d":function(t,e,n){"use strict";n.r(e);var o=n("85c3"),r=n("4cca");for(var a in r)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(a);n("3bc0");var u=n("f0c5"),i=Object(u["a"])(r["default"],o["b"],o["c"],!1,null,"684dd422",null,!1,o["a"],void 0);e["default"]=i.exports},"0b86":function(t,e,n){"use strict";var o=n("8da8"),r=n.n(o);r.a},1538:function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){}));var o=function(){var t=this.$createElement,e=this._self._c||t;return e("v-uni-view",{staticClass:"u-line",style:[this.lineStyle]})},r=[]},2427:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("a9e3");var o={props:{show:{type:Boolean,default:uni.$u.props.modal.show},title:{type:[String],default:uni.$u.props.modal.title},content:{type:String,default:uni.$u.props.modal.content},confirmText:{type:String,default:uni.$u.props.modal.confirmText},cancelText:{type:String,default:uni.$u.props.modal.cancelText},showConfirmButton:{type:Boolean,default:uni.$u.props.modal.showConfirmButton},showCancelButton:{type:Boolean,default:uni.$u.props.modal.showCancelButton},confirmColor:{type:String,default:uni.$u.props.modal.confirmColor},cancelColor:{type:String,default:uni.$u.props.modal.cancelColor},buttonReverse:{type:Boolean,default:uni.$u.props.modal.buttonReverse},zoom:{type:Boolean,default:uni.$u.props.modal.zoom},asyncClose:{type:Boolean,default:uni.$u.props.modal.asyncClose},closeOnClickOverlay:{type:Boolean,default:uni.$u.props.modal.closeOnClickOverlay},negativeTop:{type:[String,Number],default:uni.$u.props.modal.negativeTop},width:{type:[String,Number],default:uni.$u.props.modal.width},confirmButtonShape:{type:String,default:uni.$u.props.modal.confirmButtonShape}}};e.default=o},"25be":function(t,e,n){"use strict";var o=n("b5f2"),r=n.n(o);r.a},"2eaa":function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return o}));var o={uIcon:n("b012").default},r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"top"},[n("v-uni-view",{directives:[{name:"show",rawName:"v-show",value:t.showBack,expression:"showBack"}],staticClass:"top-back",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.toBack()}}},[n("u-icon",{attrs:{color:"#333",size:"20",name:"arrow-left"}})],1),n("v-uni-view",{staticClass:"top-title"},[t._t("default")],2),n("v-uni-view",{staticStyle:{color:"#387DF7"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.topgae()}}},[t._t("right")],2)],1)},a=[]},"3bc0":function(t,e,n){"use strict";var o=n("9b47"),r=n.n(o);r.a},4377:function(t,e,n){"use strict";n("7a82");var o=n("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=o(n("d1a4")),a={detail:function(t){return r.default.get("/xboe/m/exam/paper/query?id="+t)},update:function(t){return r.default.postJson("/xboe/m/exam/paper/update",t)},del:function(t){return r.default.get("/xboe/m/exam/paper/delete?id="+t)},save:function(t){return r.default.postJson("/xboe/m/exam/paper/save",t)},querylist:function(t){return r.default.post("/xboe/m/exam/paper/querylist",t)},querypaper:function(t){return r.default.post("/xboe/m/exam/paper/queryPaper",t)},getPaperContent:function(t){return r.default.get("/xboe/m/exam/paper/paper-content?id="+t)},batchImportCount:function(t){return r.default.postJson("/xboe/m/exam/paper/batch-count",t)},batchImportData:function(t){return r.default.postJson("/xboe/m/exam/paper/batch-count",t)}};e.default=a},"4ae6":function(t,e,n){"use strict";n.r(e);var o=n("e5bb"),r=n.n(o);for(var a in o)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(a);e["default"]=r.a},"4cca":function(t,e,n){"use strict";n.r(e);var o=n("fdce"),r=n.n(o);for(var a in o)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(a);e["default"]=r.a},5416: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(),r=new Date(Number(t)).getHours(),a=new Date(Number(t)).getMinutes(),u=new Date(Number(t)).getSeconds();n<10&&(n="0"+n);o<10&&(o="0"+o);r<10&&(r="0"+r);a<10&&(a="0"+a);u<10&&(u="0"+u);var i=e+"-"+n+"-"+o+" "+r+":"+a+":"+u;return i},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}},"5f1d":function(t,e,n){"use strict";(function(t){n("7a82");var o=n("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("d3b7"),n("159b"),n("14d9"),n("e25e"),n("c975"),n("e9c4");var r=o(n("16fc")),a=o(n("c7e3")),u=o(n("e184")),i=o(n("4377")),s=n("5416"),c={data:function(){return{thisTrue:!0,studyId:"",examId:"",ctype:10,startTime:null,toLetter:s.numberToLetter,getTypeName:s.getQuestionType,imageBaseUrl:r.default.fileUrl,info:{},stop:!1,paper:[],total:0,curIndex:0,curItem:{},timer:null,scoreShow:!1,lastScore:0,timerValue:0,noAnswers:[]}},onLoad:function(t){this.studyId=t.studyId,this.examId=t.ccid,this.ctype=t.ctype,this.examId&&this.loadExamInfo()},methods:{changeTimer:function(){0==this.timerValue?(window.clearInterval(this.timer),this.stop=!0):this.timerValue--},loadExamInfo:function(){var t=this;this.curIndex=0,u.default.getExam(this.examId).then((function(e){if(200==e.status)if(t.info=e.result,t.loadStudyItemId(),2==t.info.paperType)i.default.getPaperContent(t.info.paperId).then((function(e){if(200==e.status){var n=JSON.parse(e.result),o=t.convertToItems(n);t.paper={items:o},t.total=o.length,t.curItem=o[t.curIndex],t.startTime=new Date,t.timerValue=t.info.testDuration,t.timer=setInterval(t.changeTimer,6e4)}else t.$message.error("加载试卷内容失败,请与管理员联系,试卷是否已删除")}));else{var n=JSON.parse(t.info.paperContent);n.items.forEach((function(t){101==t.type?t.userAnswer="":102==t.type?t.userAnswer=[]:t.userAnswer="",t.options.forEach((function(t){t.checked=!1}))})),t.total=n.items.length,t.paper=n,t.curItem=n.items[t.curIndex],t.startTime=new Date,t.timerValue=e.result.testDuration,t.timer=setInterval(t.changeTimer,6e4)}else e.status}))},convertToItems:function(e){var n=[];return e.forEach((function(t){var e={id:t.id,type:1==t.type?101:2==t.type?102:103,score:t.defaultScore,checked:!1,userAnswer:"",optShow:!0,content:t.title,images:t.images,options:[]};3==t.type?(e.options.push({id:t.id+"1",images:"",content:"正确",answer:"true"==t.answer,checked:!1}),e.options.push({id:t.id+"2",images:"",content:"错误",answer:"true"!=t.answer,checked:!1})):t.optionList.forEach((function(t){e.options.push({id:t.id,images:t.images,content:t.content,answer:t.isAnswer,checked:!1})})),102==e.type&&(e.userAnswer=[]),n.push(e)})),t.log(n,"qitems"),n},loadStudyItemId:function(){var t=this;a.default.getStudyContentItem(this.studyId,this.info.contentId).then((function(e){200==e.status&&(t.studyItemId=e.result.id)}))},chooseOption:function(t){101==this.curItem.type||103==this.curItem.type?(this.curItem.options.forEach((function(t){t.checked=!1})),t.checked=!0):t.checked?t.checked=!1:t.checked=!0},confirmStop:function(){this.submitTest()},cancelStop:function(){this.confirmFinish()},prevSub:function(){0!=this.curIndex&&(this.curIndex--,this.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 r=!0;t.options.forEach((function(e){e.answer?-1==t.userAnswer.indexOf(e.id)&&(r=!1):t.userAnswer.indexOf(e.id)>-1&&(r=!1)})),r&&(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(),r=Math.floor(o/1e3);n.testDuration=r,this.thisTrue=!1,a.default.saveExam(n).then((function(e){t.thisTrue=!0,200==e.status?(t.studyItemId=e.result.studyItemId,t.scoreShow=!0):t.$refs.messager.show({message:e.message,type:"error"})}))},debounce:function(t,e){var n;return function(){for(var o=this,r=arguments.length,a=new Array(r),u=0;u0?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"])},6393:function(t,e,n){"use strict";n.r(e);var o=n("5f1d"),r=n.n(o);for(var a in o)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(a);e["default"]=r.a},"65ba":function(t,e,n){"use strict";n.r(e);var o=n("1538"),r=n("4ae6");for(var a in r)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(a);n("0b86");var u=n("f0c5"),i=Object(u["a"])(r["default"],o["b"],o["c"],!1,null,"2f0e5305",null,!1,o["a"],void 0);e["default"]=i.exports},6906:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("a9e3");var o={props:{color:{type:String,default:uni.$u.props.line.color},length:{type:[String,Number],default:uni.$u.props.line.length},direction:{type:String,default:uni.$u.props.line.direction},hairline:{type:Boolean,default:uni.$u.props.line.hairline},margin:{type:[String,Number],default:uni.$u.props.line.margin},dashed:{type:Boolean,default:uni.$u.props.line.dashed}}};e.default=o},"6b6c":function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return o}));var o={uToast:n("426b").default,pageTitle:n("6d4b").default,uIcon:n("b012").default,uButton:n("e9b9").default,uModal:n("006d").default},r=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:"提交",disabled:!t.thisTrue},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