|
|
@ -280,13 +280,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) { |
|
|
@ -305,6 +298,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('请至少添加一个正确答案!') |
|
|
|