|
|
|
@ -146,15 +146,14 @@ export default { |
|
|
|
|
'userId' |
|
|
|
|
]), |
|
|
|
|
...mapState('exam', [ |
|
|
|
|
'testPaperId','assessmentId','teacherId','classId','duration' |
|
|
|
|
'testPaperId','assessmentId','teacherId','classId','countdown' |
|
|
|
|
]), |
|
|
|
|
}, |
|
|
|
|
directives: { |
|
|
|
|
countdown: { |
|
|
|
|
bind: function(el,binding,vnode) { |
|
|
|
|
let that = vnode.context |
|
|
|
|
let duration = that.duration |
|
|
|
|
let time = duration > 60 ? util.formateTime(Math.floor(duration / 60)) + ':' + util.formateTime(Math.floor(duration % 60)) + ':00' : `00:${duration}:00` |
|
|
|
|
let time = that.countdown |
|
|
|
|
that.timer = setInterval(() => { |
|
|
|
|
let timeList = time.split(':') |
|
|
|
|
let total = Number.parseInt(timeList[0] * 60 * 60) + Number.parseInt(timeList[1] * 60) + Number.parseInt(timeList[2]) |
|
|
|
@ -222,13 +221,13 @@ export default { |
|
|
|
|
let len = 0 |
|
|
|
|
this.subjects.map(n => len += n.length) |
|
|
|
|
this.totalLen = len |
|
|
|
|
this.progress = len ? Math.floor((records.length / len * 100)) : 0 |
|
|
|
|
this.progress = len ? Math.floor((records.filter(n => n.userAnswer.length).length / len * 100)) : 0 |
|
|
|
|
|
|
|
|
|
this.singleAnsweredCount = records.filter(n => n.typeId == 1).length |
|
|
|
|
this.multipleAnsweredCount = records.filter(n => n.typeId == 2).length |
|
|
|
|
this.judgeAnsweredCount = records.filter(n => n.typeId == 3).length |
|
|
|
|
this.briefAnswerAnsweredCount = records.filter(n => n.typeId == 4).length |
|
|
|
|
this.fillBlankAnsweredCount = records.filter(n => n.typeId == 5).length |
|
|
|
|
this.singleAnsweredCount = records.filter(n => n.typeId == 1 && n.userAnswer.length).length |
|
|
|
|
this.multipleAnsweredCount = records.filter(n => n.typeId == 2 && n.userAnswer.length).length |
|
|
|
|
this.judgeAnsweredCount = records.filter(n => n.typeId == 3 && n.userAnswer.length).length |
|
|
|
|
this.briefAnswerAnsweredCount = records.filter(n => n.typeId == 4 && n.userAnswer.length).length |
|
|
|
|
this.fillBlankAnsweredCount = records.filter(n => n.typeId == 5 && n.userAnswer.length).length |
|
|
|
|
|
|
|
|
|
this.subjects.forEach((e,i) => { |
|
|
|
|
e.forEach((n,k) => { |
|
|
|
@ -317,7 +316,15 @@ export default { |
|
|
|
|
if(this.submiting) return false |
|
|
|
|
this.submiting = true |
|
|
|
|
let data1 = [] |
|
|
|
|
this.subjects.map((e,i) => { |
|
|
|
|
let subjects = this.subjects |
|
|
|
|
let uploading = false |
|
|
|
|
subjects.map((e,i) => { |
|
|
|
|
e.map((n,k) => { |
|
|
|
|
if(n.uploading) uploading = true |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
if(uploading) return this.$message.warning('视频正在上传,请稍等') |
|
|
|
|
subjects.map((e,i) => { |
|
|
|
|
e.map((n,k) => { |
|
|
|
|
let userAnswer = '' |
|
|
|
|
if(i == 1){ |
|
|
|
@ -329,20 +336,18 @@ export default { |
|
|
|
|
} |
|
|
|
|
n.fileUrl = JSON.stringify(n.fileUrl) |
|
|
|
|
n.video = JSON.stringify(n.video) |
|
|
|
|
// if(userAnswer || n.fileUrl != '{}' || n.video != '{}'){ |
|
|
|
|
if(n.fileUrl == '{}') n.fileUrl = '' |
|
|
|
|
if(n.video == '{}') n.video = '' |
|
|
|
|
data1.push({ |
|
|
|
|
assessmentId: this.assessmentId, |
|
|
|
|
questionId: n.id, |
|
|
|
|
questionStatus : n.questionStatus, |
|
|
|
|
testPaperId: this.testPaperId, |
|
|
|
|
userAnswer, |
|
|
|
|
userId: this.userId, |
|
|
|
|
fileUrl: n.fileUrl, |
|
|
|
|
videoAudio: n.video |
|
|
|
|
}) |
|
|
|
|
// } |
|
|
|
|
if(n.fileUrl == '{}') n.fileUrl = '' |
|
|
|
|
if(n.video == '{}') n.video = '' |
|
|
|
|
data1.push({ |
|
|
|
|
assessmentId: this.assessmentId, |
|
|
|
|
questionId: n.id, |
|
|
|
|
questionStatus : n.questionStatus, |
|
|
|
|
testPaperId: this.testPaperId, |
|
|
|
|
userAnswer, |
|
|
|
|
userId: this.userId, |
|
|
|
|
fileUrl: n.fileUrl, |
|
|
|
|
videoAudio: n.video |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
@ -394,17 +399,21 @@ export default { |
|
|
|
|
}else{ |
|
|
|
|
userAnswer = n.val |
|
|
|
|
} |
|
|
|
|
if(userAnswer){ |
|
|
|
|
data1.push({ |
|
|
|
|
testPaperId: this.testPaperId, |
|
|
|
|
assessmentId: this.assessmentId, |
|
|
|
|
questionId: n.id, |
|
|
|
|
questionStatus : n.questionStatus, |
|
|
|
|
testPaperId: this.testPaperId, |
|
|
|
|
userAnswer: userAnswer, |
|
|
|
|
userId: this.userId |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
n.fileUrl = JSON.stringify(n.fileUrl) |
|
|
|
|
n.video = JSON.stringify(n.video) |
|
|
|
|
if(n.fileUrl == '{}') n.fileUrl = '' |
|
|
|
|
if(n.video == '{}') n.video = '' |
|
|
|
|
data1.push({ |
|
|
|
|
testPaperId: this.testPaperId, |
|
|
|
|
assessmentId: this.assessmentId, |
|
|
|
|
questionId: n.id, |
|
|
|
|
questionStatus : n.questionStatus, |
|
|
|
|
testPaperId: this.testPaperId, |
|
|
|
|
userAnswer: userAnswer, |
|
|
|
|
userId: this.userId, |
|
|
|
|
fileUrl: n.fileUrl, |
|
|
|
|
videoAudio: n.video |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|