import{c as n,l as o}from"./live-student.e6ad7a61.js";import r from"./index.bec79140.js";import{n as a}from"./vueComponentNormalizer.9ef17bb1.js";import"./index.f5168bf8.js";import"./onlineTest.1d86eb4e.js";import"./humanEval.e7206f1d.js";import"./AQCard.8a0f8a13.js";/* empty css                */import"./QuestionsList.4ae2bac5.js";import"./QuestionItem.1944680c.js";import"./questionInfoMapJsonTrans.58e126b5.js";var l=function(){var e=this,i=e.$createElement,s=e._self._c||i;return s("div",{directives:[{name:"loading",rawName:"v-loading",value:e.isLoading,expression:"isLoading"}],staticClass:"live-answering-question"},[s("QuestionsList",{ref:"questionList",staticStyle:{height:"100%"},attrs:{questions:e.exercises,mode:e.mode,paperStyle:0},on:{flag:e.flagListChanged,answers:e.userAnswerChanged,evalChanged:e.evalListChanged}}),e.viewModel?s("div",{staticClass:"course-exercise-floor"},[s("el-button",{attrs:{type:"primary"},on:{click:e.exerciseAgin}},[e._v("\u518D\u6B21\u7EC3\u4E60")]),s("el-button",{on:{click:e.backLiveRoom}},[e._v("\u8FD4\u56DE\u8BFE\u7A0B")])],1):e._e()],1)},c=[];const d={components:{QuestionsList:r},data(){return{liveId:0,courseInfo:{},exercises:void 0,model:0,viewModel:!1,isLoading:!1,createTime:null}},async created(){this.createTime=new Date,this.isLoading=!0,this.liveId=this.$route.query.liveId,+this.liveId?await this.getExerciseList():(this.isShowEveal=!0,this.isLoading=!1)},mounted(){this.createTime=new Date,this.$nextTick(()=>{this.$refs.questionList.$refs.AQCard&&(this.$refs.questionList.$refs.AQCard.style.display="none")})},methods:{async getExerciseList(){const{data:e}=await n(this.liveId);this.exercises=e,this.$nextTick(()=>{this.$refs.questionList.questions=this.exercises.map(i=>{var s;return i.info.typeId=i.info.type,i.info.type=i.info.typeInfo.name,i.info.classify=i.info.classifyId,i.info.element=i.info.typeInfo.element,i.info.score=i.score,this.$refs.questionList.mode===1?(i.info.userAnswer=((s=i.answer)==null?void 0:s.userAnswer)||["\u672A\u56DE\u7B54"],this.viewModel=!0):this.viewModel=!1,i.info}),this.$refs.questionList.cancelThisExamBtnHandler=this.exitExercises,this.$refs.questionList.submitExam=this.submitExam,this.isLoading=!1})},exitExercises(){return this.$confirm("\u662F\u5426\u9000\u51FA\u672C\u6B21\u7EC3\u4E60","\u63D0\u9192",{type:"warning"}).then(e=>{window.opener=null,window.close()}).catch(e=>{})},async submitExam(){this.isLoading=!0;const e=this.$refs.questionList.answers;await o({liveId:this.liveId,answerInfo:e,createTime:this.createTime}),this.$refs.questionList.questions=[],this.$refs.questionList.mode=1,this.getExerciseList(),this.isLoading=!1},exerciseAgin(){this.createTime=new Date,this.$refs.questionList.mode=0,this.getExerciseList()},backLiveRoom(){window.opener=null,window.close()}}},t={};var u=a(d,l,c,!1,f,"747f3002",null,null);function f(e){for(let i in t)this[i]=t[i]}const I=function(){return u.exports}();export{I as default};
