|
|
@ -12,9 +12,9 @@ |
|
|
|
<el-form-item label="所属题库" prop="cid"> |
|
|
|
<el-form-item label="所属题库" prop="cid"> |
|
|
|
<el-select v-model="topicForm.cid" clearable placeholder="请选择所属题库"> |
|
|
|
<el-select v-model="topicForm.cid" clearable placeholder="请选择所属题库"> |
|
|
|
<template v-for="(item,index) in quesBankList"> |
|
|
|
<template v-for="(item,index) in quesBankList"> |
|
|
|
<el-option :key="index" :label="item.typeName" :value="item.cid"></el-option> |
|
|
|
<el-option :key="item.cid" :label="item.typeName" :value="item.cid"></el-option> |
|
|
|
<template v-for="(item1,index1) in item.secondColumn"> |
|
|
|
<template v-for="(item1,index1) in item.secondColumn"> |
|
|
|
<el-option class="second" :key="index1" :label="item1.typeName" :value="item1.cid"></el-option> |
|
|
|
<el-option class="second" :key="item1.cid" :label="item1.typeName" :value="item1.cid"></el-option> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
@ -296,13 +296,6 @@ export default { |
|
|
|
if(this.topicForm.typeId == 3){ |
|
|
|
if(this.topicForm.typeId == 3){ |
|
|
|
this.topicForm.optionA = '正确' |
|
|
|
this.topicForm.optionA = '正确' |
|
|
|
this.topicForm.optionB = '错误' |
|
|
|
this.topicForm.optionB = '错误' |
|
|
|
if(this.topicForm.aisTrue == 1){ |
|
|
|
|
|
|
|
this.topicForm.aisTrue = true |
|
|
|
|
|
|
|
this.topicForm.answer = 'A' |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
this.topicForm.bisTrue = true |
|
|
|
|
|
|
|
this.topicForm.answer = 'B' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if(topicForm.typeId == 1 || topicForm.typeId == 2 || topicForm.typeId == 3){ |
|
|
|
if(topicForm.typeId == 1 || topicForm.typeId == 2 || topicForm.typeId == 3){ |
|
|
|
for(let n in topicForm) { |
|
|
|
for(let n in topicForm) { |
|
|
@ -321,6 +314,7 @@ export default { |
|
|
|
if(topicForm.questionType == '单选题' && answer.length > 1) return this.$message.warning('单选题只能设置一个正确选项!') |
|
|
|
if(topicForm.questionType == '单选题' && answer.length > 1) return this.$message.warning('单选题只能设置一个正确选项!') |
|
|
|
if(topicForm.questionType == '多选题' && answer.length < 2) return this.$message.warning('多选题必须设置至少两个正确选项!') |
|
|
|
if(topicForm.questionType == '多选题' && answer.length < 2) return this.$message.warning('多选题必须设置至少两个正确选项!') |
|
|
|
if(isInvalidAnswer) return this.$message.warning('正确答案选项为空,请重新设置!'); |
|
|
|
if(isInvalidAnswer) return this.$message.warning('正确答案选项为空,请重新设置!'); |
|
|
|
|
|
|
|
if(topicForm.typeId == 3) answer = topicForm.aisTrue == 1 ? 'a' : 'b' |
|
|
|
this.topicForm.answer = answer.toUpperCase() |
|
|
|
this.topicForm.answer = answer.toUpperCase() |
|
|
|
}else if(this.topicForm.typeId == 5){ |
|
|
|
}else if(this.topicForm.typeId == 5){ |
|
|
|
if(!this.fillList.length || this.fillList.every(n => n === '')) return this.$message.warning('请至少添加一个正确答案!') |
|
|
|
if(!this.fillList.length || this.fillList.every(n => n === '')) return this.$message.warning('请至少添加一个正确答案!') |
|
|
|