| 
					
				 | 
			
			
				@@ -4,7 +4,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <el-row :gutter="20"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           <el-col :span="16"  :loading="loading"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <div class="exam-content"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-              <el-card class="box-card" v-for="(currentQuestion, aindex) in questionList" :key="aindex" v-show="aindex==cindex"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              <el-card class="box-card" v-for="(currentQuestion, aindex) in questionList" :key="aindex" v-if="aindex==cindex"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 <div slot="header" class="clearfix"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                   <span>第{{aindex+1}}题({{currentQuestion.type|getType}})</span> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -50,7 +50,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                       {{cidx+1}}小题: <span v-html="child.title"></span> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                       <div class="answer" v-if="child.type==3"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        <el-checkbox-group v-model="currentQuestion.child[cidx].answer"  @change="(e)=>{selectCheckBox(e,cidx)}"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        <el-checkbox-group v-model="answers['answer'+cidx]"  @change="(e)=>{selectCheckBox(e,cidx)}"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            <el-checkbox 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            :label="index" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             v-for="(item,index) in child.choice" 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -62,7 +62,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                       </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                       <div class="answer" v-else> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        <el-radio-group v-model="currentQuestion.child[cidx].answer"  @change="(e)=>{selectRadio(e, cidx)}"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        <el-radio-group v-model="answers['answer'+cidx]"   @change="(e)=>{selectRadio(e, cidx)}"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                           <el-radio class="answer-item" v-for="(item,index) in child.choice" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            :label="index+1" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            :key="index"> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -159,7 +159,7 @@ import md5 from 'js-md5'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import { getTime, packTime, time2str, saveExam, getExam,getSelect,delExam } from "./components/util.js"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import headline from "./components/headline.vue"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import myDialog from "./components/my-dialog.vue"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-const defAnswer = [false,false,false,false,false]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+const defAnswer = {id:'', answer:0, type:1, child:[{answer:0, answer:0}, {answer:0}, {answer:0},{answer:0}]}; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   components:{ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -185,13 +185,18 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       cindex:0, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       loading: false, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       isAnli: false, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      questionList: [], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      answers:{}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      questionList: [defAnswer], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      answers:{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        answer:'', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        answer0:'', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        answer1:'', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        answer2:'', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        answer3:'', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        answer4:'', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       questionLen: 0, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       questionType: '单选题', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       textarea: "", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      radio: "", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      checked:defAnswer, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       getSelect, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       time2str, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       questionId: 0, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -243,10 +248,12 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let mkey = "answer"+i 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if(item[mkey] ) item.choice.push( item[mkey] ); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.answers.answer = item.answer; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       if( item.type == 4){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for ( let i in item.child){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           let child = item.child[i] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           child.choice = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.answers['answer'+i] = child.answer; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           for( let i=0;i<6;i++){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let mkey = "answer"+i 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if(child[mkey] ) child.choice.push( child[mkey] ); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -255,13 +262,12 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         item.child = [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      console.log("index", index, item.type, item.radio, item.answer) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.questionList[index] = item 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     loadQuestion( index ) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       let item = this.questionList[index]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       item.index = index; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      if( !item.title ){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      if( !item.isLoad ){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let {id} = item; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.loading= true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         httpServer("course.loadAnswer", {id} ).then(res => { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -271,7 +277,8 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           let childs = res.data.child; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           if( item.type == 4){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             item.child = childs.map( v=>{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-              if( v.type == 3){ v.answer = [false,false,false,false,false] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              if( v.type == 3){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                v.answer = [false,false,false,false,false] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               }else{ v.answer=0 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               return v 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             }) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -280,6 +287,7 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             item.answer = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          item.isLoad = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           this.doLoadQuestion( index, item ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       }else{ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -335,12 +343,13 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let item = this.questionList[i]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if(item.type!= 4){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           let select = getSelect(item.answer); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          if( select) param.result[item.id] =select ; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          if( select) param.result[item.answerId] =select ; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          console.log("anli", item.child) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           for( let j in item.child){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if(!item.child[j] || !item.child[j].id) continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if(!item.child[j] || !item.child[j].answerId) continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let select = getSelect(item.child[j].answer); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if(select) param.result[item.child[j].id] = select; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if(select) param.result[item.child[j].answerId] = select; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -378,14 +387,13 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            this.isAnli = true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				          } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.loadQuestion(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.startTime = info.startTime; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       saveExam( this.info, this.questionList ); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      // this.initTimer(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.initTimer(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     selectRadio( value, cidx ){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      let index = this.index; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      let index = this.cindex; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       let curAnswer = this.questionList[index]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       if( curAnswer.type == 4 ){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.questionList[index].child[cidx].answer = value; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -395,7 +403,8 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.$forceUpdate() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     selectCheckBox(value, cidx){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      let index = this.index; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      let index = this.cindex; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      console.log("selectCheckBox", cidx, value ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       let curAnswer= this.questionList[index]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       if( curAnswer.type == 4 ){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.questionList[index].child[cidx].answer = value; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -426,7 +435,13 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     let that = this; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     httpServer("course.StartExamTest", {courseId, groupId} ).then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      if( res.code != 200) return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      if( res.code != 200){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        setTimeout( ()=>{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.$router.go(-1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }, 2000) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      let answer = 0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       let info = res.data||{} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       info.questionList = info.answers.map( v =>{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         v.marked = false 
			 |