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