|
|
@@ -117,11 +117,11 @@ export default {
|
|
|
startAt: this.lastDate,
|
|
|
endAt: this.choiceDate
|
|
|
})
|
|
|
- const answers = {}
|
|
|
+ const records = {}
|
|
|
let uncompleted = false
|
|
|
this.questions.map(question => {
|
|
|
if (question.studentAnswer) {
|
|
|
- answers[question.id] = question.studentAnswer.answer
|
|
|
+ records[question.id] = { answer: question.studentAnswer.answer }
|
|
|
} else {
|
|
|
this.$setErrorMessage('题目:"' + question.stem + '"尚未填写')
|
|
|
uncompleted = true
|
|
|
@@ -129,14 +129,15 @@ export default {
|
|
|
})
|
|
|
if (uncompleted) return
|
|
|
|
|
|
- const records = {}
|
|
|
Object.keys(this.records).forEach(key => {
|
|
|
records[key] = {
|
|
|
+ ...records[key],
|
|
|
startAt: new Date(this.records[key].startAt),
|
|
|
endAt: new Date(this.records[key].endAt)
|
|
|
}
|
|
|
})
|
|
|
- submitQuizStudentAnswer({ quizId, answers, records }).then(res => {
|
|
|
+ console.log(records)
|
|
|
+ submitQuizStudentAnswer({ quizId, records }).then(res => {
|
|
|
this.hasSubmit = true
|
|
|
this.$setSuccessMessage('提交成功')
|
|
|
this.$router.go(-1)
|