Commit a849cdcd authored by 高宇's avatar 高宇

试题管理

parent 2da625fd
...@@ -481,6 +481,10 @@ export default { ...@@ -481,6 +481,10 @@ export default {
this.$refs.form.validate(valid => { this.$refs.form.validate(valid => {
if (valid) { if (valid) {
if (this.form.businessId !== undefined) { if (this.form.businessId !== undefined) {
if (this.form.questionType === 2) {
form.answer = this.getAnswer(form.answerList)
}
form.optionsList = this.getOptionList()
// 编辑 // 编辑
updateTeaExamQuestions(form).then(res => { updateTeaExamQuestions(form).then(res => {
if (res.code === 200) { if (res.code === 200) {
...@@ -662,6 +666,10 @@ export default { ...@@ -662,6 +666,10 @@ export default {
handleUpdate(row) { handleUpdate(row) {
getTeaExamQuestions(row.businessId).then(res => { getTeaExamQuestions(row.businessId).then(res => {
const { optionA, optionB, optionC, optionD } = this.handleOptionContent(res.data.optionsList) const { optionA, optionB, optionC, optionD } = this.handleOptionContent(res.data.optionsList)
res.data.optionA = optionA
res.data.optionB = optionB
res.data.optionC = optionC
res.data.optionD = optionD
// 当题目是多选的时候,处理题目答案选项 // 当题目是多选的时候,处理题目答案选项
if (res.data.questionType === 2) { if (res.data.questionType === 2) {
res.data.answerList = [] res.data.answerList = []
...@@ -670,10 +678,10 @@ export default { ...@@ -670,10 +678,10 @@ export default {
} }
// 处理选项内容 // 处理选项内容
this.form = res.data this.form = res.data
this.form.optionA = optionA // this.form.optionA = optionA
this.form.optionB = optionB // this.form.optionB = optionB
this.form.optionC = optionC // this.form.optionC = optionC
this.form.optionD = optionD // this.form.optionD = optionD
this.title = '修改试题' this.title = '修改试题'
this.dialogFormVisible = true this.dialogFormVisible = true
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment