|
@@ -23,10 +23,10 @@
|
|
|
<!-- 当选题 -->
|
|
|
<div class="answer" v-if="currentQuestion.type<3">
|
|
|
<el-radio-group v-model="currentQuestion.answer" @change="selectRadio">
|
|
|
- <el-radio class="answer-item" v-for="(item,index) in currentQuestion.choice"
|
|
|
- :label="index+1"
|
|
|
- :key="index">
|
|
|
- <span class="answer-title">{{transformChar[index]+'、 '+item}}</span>
|
|
|
+ <el-radio class="answer-item" v-for="(item,choiceIdx) in currentQuestion.choice"
|
|
|
+ :label="choiceIdx+1"
|
|
|
+ :key="choiceIdx">
|
|
|
+ <span class="answer-title">{{transformChar[choiceIdx]+'、 '+item}}</span>
|
|
|
</el-radio>
|
|
|
</el-radio-group>
|
|
|
</div>
|
|
@@ -35,11 +35,11 @@
|
|
|
<div class="answer" v-if="currentQuestion.type==3">
|
|
|
<el-checkbox-group v-model="currentQuestion.answer" @change="selectCheckBox">
|
|
|
<el-checkbox
|
|
|
- :label="index"
|
|
|
- v-for="(item,index) in currentQuestion.choice"
|
|
|
- :key="index"
|
|
|
+ v-for="(item,choiceIdx) in currentQuestion.choice"
|
|
|
+ :label="choiceIdx+1"
|
|
|
+ :key="choiceIdx"
|
|
|
class="answer-item">
|
|
|
- {{transformChar[index]+'、 '+item}}
|
|
|
+ {{transformChar[choiceIdx]+'、 '+item}}
|
|
|
</el-checkbox>
|
|
|
</el-checkbox-group >
|
|
|
</div>
|
|
@@ -52,21 +52,21 @@
|
|
|
<div class="answer" v-if="child.type==3">
|
|
|
<el-checkbox-group v-model="answers['answer'+cidx]" @change="(e)=>{selectCheckBox(e,cidx)}">
|
|
|
<el-checkbox
|
|
|
- :label="index"
|
|
|
- v-for="(item,index) in child.choice"
|
|
|
- :key="index"
|
|
|
+ v-for="(item,choiceIdx) in child.choice"
|
|
|
+ :label="choiceIdx+1"
|
|
|
+ :key="choiceIdx"
|
|
|
class="answer-item">
|
|
|
- {{transformChar[index]+'、 '+item}}
|
|
|
+ {{transformChar[choiceIdx]+'、 '+item}}
|
|
|
</el-checkbox>
|
|
|
</el-checkbox-group >
|
|
|
</div>
|
|
|
|
|
|
<div class="answer" v-else>
|
|
|
<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">
|
|
|
- <span class="answer-title">{{transformChar[index]+'、 '+item}}</span>
|
|
|
+ <el-radio class="answer-item" v-for="(item,choiceIdx) in child.choice"
|
|
|
+ :label="choiceIdx+1"
|
|
|
+ :key="choiceIdx">
|
|
|
+ <span class="answer-title">{{transformChar[choiceIdx]+'、 '+item}}</span>
|
|
|
</el-radio>
|
|
|
</el-radio-group>
|
|
|
</div>
|
|
@@ -83,7 +83,7 @@
|
|
|
|
|
|
<div class="page-ctrl">
|
|
|
<el-button type="primary" :disabled="currentQuestion.index<1" @click="prevQuestion">上一题</el-button>
|
|
|
- <el-button type="primary" :disabled="currentQuestion.index>48" @click="nextQuestion">下一题</el-button>
|
|
|
+ <el-button type="primary" :disabled="aindex>=questionList.length-1" @click="nextQuestion">下一题</el-button>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
</div>
|
|
@@ -278,12 +278,12 @@ export default {
|
|
|
if( item.type == 4){
|
|
|
item.child = childs.map( v=>{
|
|
|
if( v.type == 3){
|
|
|
- v.answer = [false,false,false,false,false]
|
|
|
+ v.answer = []
|
|
|
}else{ v.answer=0 }
|
|
|
return v
|
|
|
})
|
|
|
}else if(item.type == 3){
|
|
|
- item.answer= [false,false,false,false,false];
|
|
|
+ item.answer= [];
|
|
|
}else{
|
|
|
item.answer = 0;
|
|
|
}
|
|
@@ -343,13 +343,12 @@ export default {
|
|
|
let item = this.questionList[i];
|
|
|
if(item.type!= 4){
|
|
|
let select = getSelect(item.answer);
|
|
|
- if( select) param.result[item.answerId] =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].answerId) continue;
|
|
|
let select = getSelect(item.child[j].answer);
|
|
|
- if(select) param.result[item.child[j].answerId] = select;
|
|
|
+ if(select) param.result[item.child[j].answerId] = +select;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -360,6 +359,7 @@ export default {
|
|
|
this.info.useTime = useTime;
|
|
|
this.info.isFinish = 1;
|
|
|
this.timer && window.clearInterval(this.timer);
|
|
|
+ delExam()
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -425,8 +425,7 @@ export default {
|
|
|
this.courseId = courseId;
|
|
|
let info = getExam()
|
|
|
let nowSec = getTime()
|
|
|
-
|
|
|
- if( info.courseId == courseId && info.groupId == groupId&&
|
|
|
+ if( info && info.courseId == courseId && info.groupId == groupId&&
|
|
|
info.questionList.length>0 &&info.startTime + info.duration > nowSec){
|
|
|
this.doStartExam( info )
|
|
|
return;
|
|
@@ -445,7 +444,7 @@ export default {
|
|
|
info.questionList = info.answers.map( v =>{
|
|
|
v.marked = false
|
|
|
v.answer = 0
|
|
|
- if(v.type==3) v.answer = [false,false,false,false,false];
|
|
|
+ if(v.type==3) v.answer = false;
|
|
|
return v;
|
|
|
});
|
|
|
that.doStartExam( info );
|