题目新增-多选题支持到F,题目详情可支持到答案E和F
This commit is contained in:
parent
200538d486
commit
d966101089
|
@ -78,6 +78,20 @@
|
|||
</template>
|
||||
<a-textarea placeholder="" :rows="6" v-model="multiselect.answerD" style="width: 100%" />
|
||||
</a-card>
|
||||
<a-card :bordered="false">
|
||||
<template slot="title">
|
||||
E
|
||||
<a-checkbox v-model="multiselect.E" value="E">答案</a-checkbox>
|
||||
</template>
|
||||
<a-textarea placeholder="" :rows="6" v-model="multiselect.answerE" style="width: 100%" />
|
||||
</a-card>
|
||||
<a-card :bordered="false">
|
||||
<template slot="title">
|
||||
F
|
||||
<a-checkbox v-model="multiselect.F" value="F">答案</a-checkbox>
|
||||
</template>
|
||||
<a-textarea placeholder="" :rows="6" v-model="multiselect.answerF" style="width: 100%" />
|
||||
</a-card>
|
||||
<a-card title="答案解析" :bordered="false">
|
||||
<a-textarea placeholder="" :rows="6" v-model="multiselect.asnwerParse" style="width: 100%" />
|
||||
</a-card>
|
||||
|
@ -156,38 +170,36 @@ export default {
|
|||
estimate: {},
|
||||
shortAnswer: {},
|
||||
Completion: { answerList: [''] },
|
||||
tabKey: this.$route.query.questionType ? this.$route.query.questionType : '1'
|
||||
tabKey: this.$route.query.questionType ? this.$route.query.questionType : '1',
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
|
||||
//判断是否是编辑
|
||||
if (this.$route.query.id && !this.$route.query.opt) {
|
||||
|
||||
this.radio.disabled = true;
|
||||
this.multiselect.disabled = true;
|
||||
this.estimate.disabled = true;
|
||||
this.shortAnswer.disabled = true;
|
||||
this.Completion.disabled = true;
|
||||
this.radio.disabled = true
|
||||
this.multiselect.disabled = true
|
||||
this.estimate.disabled = true
|
||||
this.shortAnswer.disabled = true
|
||||
this.Completion.disabled = true
|
||||
|
||||
getQuestionDeatil({ id: this.$route.query.id }).then((res) => {
|
||||
if (this.tabKey == '1') {
|
||||
this.radio = res.data;
|
||||
this.radio.disabled = false;
|
||||
this.radio = res.data
|
||||
this.radio.disabled = false
|
||||
} else if (this.tabKey == '2') {
|
||||
this.multiselect = res.data;
|
||||
this.multiselect.disabled = false;
|
||||
this.getRightAnswer();
|
||||
} else if(this.tabKey == '3') {
|
||||
this.estimate = res.data;
|
||||
this.estimate.disabled = false;
|
||||
this.multiselect = res.data
|
||||
this.multiselect.disabled = false
|
||||
this.getRightAnswer()
|
||||
} else if (this.tabKey == '3') {
|
||||
this.estimate = res.data
|
||||
this.estimate.disabled = false
|
||||
} else if (this.tabKey == '4') {
|
||||
this.shortAnswer = res.data;
|
||||
this.shortAnswer.disabled = false;
|
||||
this.shortAnswer = res.data
|
||||
this.shortAnswer.disabled = false
|
||||
} else if (this.tabKey == '5') {
|
||||
this.Completion = res.data;
|
||||
this.Completion.disabled = false;
|
||||
this.Completion = res.data
|
||||
this.Completion.disabled = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -216,19 +228,19 @@ export default {
|
|||
|
||||
// 添加填空
|
||||
addAnswerSize() {
|
||||
if (this.Completion.answerList.length == 10) {
|
||||
this.$message.error('填空数量最多不能超过10个')
|
||||
if (this.Completion.answerList.length == 5) {
|
||||
this.$message.error('填空数量最多不能超过5个')
|
||||
return
|
||||
}
|
||||
this.Completion.answerList.push('')
|
||||
},
|
||||
// 刪除填空
|
||||
delAnswerSize() {
|
||||
if (this.Completion.answerList.length == 1) {
|
||||
if (this.Completion.answerList.length == 1) {
|
||||
this.$message.error('填空数量最少不能少于1个')
|
||||
return
|
||||
}
|
||||
this.Completion.answerList.splice(this.Completion.answerList.length-1, 1);
|
||||
this.Completion.answerList.splice(this.Completion.answerList.length - 1, 1)
|
||||
},
|
||||
|
||||
// 确定
|
||||
|
@ -314,7 +326,13 @@ export default {
|
|||
this.$message.error('答案C不能为空!')
|
||||
return false
|
||||
} else if (!this.multiselect.answerD || this.multiselect.answerD === '') {
|
||||
this.$$message.error('答案D不能为空!')
|
||||
this.$message.error('答案D不能为空!')
|
||||
return false
|
||||
} else if (!this.multiselect.answerE || this.multiselect.answerD === '') {
|
||||
this.$message.error('答案E不能为空!')
|
||||
return false
|
||||
} else if (!this.multiselect.answerF || this.multiselect.answerD === '') {
|
||||
this.$message.error('答案F不能为空!')
|
||||
return false
|
||||
}
|
||||
|
||||
|
@ -384,13 +402,12 @@ export default {
|
|||
},
|
||||
|
||||
// 获取多选题的正确答案
|
||||
getRightAnswer(){
|
||||
if(this.multiselect.rightAnswers.indexOf('A') > -1) this.multiselect.a = true;
|
||||
if(this.multiselect.rightAnswers.indexOf('B') > -1) this.multiselect.b = true;
|
||||
if(this.multiselect.rightAnswers.indexOf('C') > -1) this.multiselect.c = true;
|
||||
if(this.multiselect.rightAnswers.indexOf('D') > -1) this.multiselect.d = true;
|
||||
getRightAnswer() {
|
||||
if (this.multiselect.rightAnswers.indexOf('A') > -1) this.multiselect.a = true
|
||||
if (this.multiselect.rightAnswers.indexOf('B') > -1) this.multiselect.b = true
|
||||
if (this.multiselect.rightAnswers.indexOf('C') > -1) this.multiselect.c = true
|
||||
if (this.multiselect.rightAnswers.indexOf('D') > -1) this.multiselect.d = true
|
||||
},
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -65,6 +65,8 @@
|
|||
<div class="answer">B. {{ questionDetail.answerB }}</div>
|
||||
<div class="answer">C. {{ questionDetail.answerC }}</div>
|
||||
<div class="answer">D. {{ questionDetail.answerD }}</div>
|
||||
<div v-if="questionDetail.answerE" class="answer">E. {{ questionDetail.answerE }}</div>
|
||||
<div v-if="questionDetail.answerF" class="answer">F. {{ questionDetail.answerF }}</div>
|
||||
</div>
|
||||
|
||||
<!-- 显示简答题 -->
|
||||
|
|
Loading…
Reference in New Issue