|
|
@@ -111,7 +111,14 @@ export default {
|
|
|
})
|
|
|
if (uncompleted) return
|
|
|
|
|
|
- submitQuizStudentAnswer({ quizId, answers, records: this.records }).then(res => {
|
|
|
+ const records = {}
|
|
|
+ Object.keys(this.records).forEach(key => {
|
|
|
+ records[key] = {
|
|
|
+ startAt: new Date(this.records[key].startAt),
|
|
|
+ endAt: new Date(this.records[key].endAt)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ submitQuizStudentAnswer({ quizId, answers, records }).then(res => {
|
|
|
this.hasSubmit = true
|
|
|
this.$setSuccessMessage('提交成功')
|
|
|
this.$router.go(-1)
|
|
|
@@ -143,9 +150,11 @@ export default {
|
|
|
pushRecord ({ questionId, startAt, endAt }) {
|
|
|
const record = this.records[questionId]
|
|
|
if (isEmpty(record)) {
|
|
|
- this.records[questionId] = { startAt: new Date(startAt), endAt: new Date(endAt) }
|
|
|
+ this.records[questionId] = { startAt, endAt }
|
|
|
} else {
|
|
|
+ console.log(record.endAt, startAt, endAt)
|
|
|
record.endAt = record.endAt + endAt - startAt
|
|
|
+ console.log(record)
|
|
|
}
|
|
|
},
|
|
|
momentFromNow,
|