|
|
@ -146,15 +146,14 @@ export default { |
|
|
|
'userId' |
|
|
|
'userId' |
|
|
|
]), |
|
|
|
]), |
|
|
|
...mapState('exam', [ |
|
|
|
...mapState('exam', [ |
|
|
|
'testPaperId','assessmentId','teacherId','classId','duration' |
|
|
|
'testPaperId','assessmentId','teacherId','classId','countdown' |
|
|
|
]), |
|
|
|
]), |
|
|
|
}, |
|
|
|
}, |
|
|
|
directives: { |
|
|
|
directives: { |
|
|
|
countdown: { |
|
|
|
countdown: { |
|
|
|
bind: function(el,binding,vnode) { |
|
|
|
bind: function(el,binding,vnode) { |
|
|
|
let that = vnode.context |
|
|
|
let that = vnode.context |
|
|
|
let duration = that.duration |
|
|
|
let time = that.countdown |
|
|
|
let time = duration > 60 ? util.formateTime(Math.floor(duration / 60)) + ':' + util.formateTime(Math.floor(duration % 60)) + ':00' : `00:${duration}:00` |
|
|
|
|
|
|
|
that.timer = setInterval(() => { |
|
|
|
that.timer = setInterval(() => { |
|
|
|
let timeList = time.split(':') |
|
|
|
let timeList = time.split(':') |
|
|
|
let total = Number.parseInt(timeList[0] * 60 * 60) + Number.parseInt(timeList[1] * 60) + Number.parseInt(timeList[2]) |
|
|
|
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 |
|
|
|
let len = 0 |
|
|
|
this.subjects.map(n => len += n.length) |
|
|
|
this.subjects.map(n => len += n.length) |
|
|
|
this.totalLen = len |
|
|
|
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.singleAnsweredCount = records.filter(n => n.typeId == 1 && n.userAnswer.length).length |
|
|
|
this.multipleAnsweredCount = records.filter(n => n.typeId == 2).length |
|
|
|
this.multipleAnsweredCount = records.filter(n => n.typeId == 2 && n.userAnswer.length).length |
|
|
|
this.judgeAnsweredCount = records.filter(n => n.typeId == 3).length |
|
|
|
this.judgeAnsweredCount = records.filter(n => n.typeId == 3 && n.userAnswer.length).length |
|
|
|
this.briefAnswerAnsweredCount = records.filter(n => n.typeId == 4).length |
|
|
|
this.briefAnswerAnsweredCount = records.filter(n => n.typeId == 4 && n.userAnswer.length).length |
|
|
|
this.fillBlankAnsweredCount = records.filter(n => n.typeId == 5).length |
|
|
|
this.fillBlankAnsweredCount = records.filter(n => n.typeId == 5 && n.userAnswer.length).length |
|
|
|
|
|
|
|
|
|
|
|
this.subjects.forEach((e,i) => { |
|
|
|
this.subjects.forEach((e,i) => { |
|
|
|
e.forEach((n,k) => { |
|
|
|
e.forEach((n,k) => { |
|
|
@ -317,7 +316,15 @@ export default { |
|
|
|
if(this.submiting) return false |
|
|
|
if(this.submiting) return false |
|
|
|
this.submiting = true |
|
|
|
this.submiting = true |
|
|
|
let data1 = [] |
|
|
|
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) => { |
|
|
|
e.map((n,k) => { |
|
|
|
let userAnswer = '' |
|
|
|
let userAnswer = '' |
|
|
|
if(i == 1){ |
|
|
|
if(i == 1){ |
|
|
@ -329,7 +336,6 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
n.fileUrl = JSON.stringify(n.fileUrl) |
|
|
|
n.fileUrl = JSON.stringify(n.fileUrl) |
|
|
|
n.video = JSON.stringify(n.video) |
|
|
|
n.video = JSON.stringify(n.video) |
|
|
|
// if(userAnswer || n.fileUrl != '{}' || n.video != '{}'){ |
|
|
|
|
|
|
|
if(n.fileUrl == '{}') n.fileUrl = '' |
|
|
|
if(n.fileUrl == '{}') n.fileUrl = '' |
|
|
|
if(n.video == '{}') n.video = '' |
|
|
|
if(n.video == '{}') n.video = '' |
|
|
|
data1.push({ |
|
|
|
data1.push({ |
|
|
@ -342,7 +348,6 @@ export default { |
|
|
|
fileUrl: n.fileUrl, |
|
|
|
fileUrl: n.fileUrl, |
|
|
|
videoAudio: n.video |
|
|
|
videoAudio: n.video |
|
|
|
}) |
|
|
|
}) |
|
|
|
// } |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
@ -394,7 +399,10 @@ export default { |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
userAnswer = n.val |
|
|
|
userAnswer = n.val |
|
|
|
} |
|
|
|
} |
|
|
|
if(userAnswer){ |
|
|
|
n.fileUrl = JSON.stringify(n.fileUrl) |
|
|
|
|
|
|
|
n.video = JSON.stringify(n.video) |
|
|
|
|
|
|
|
if(n.fileUrl == '{}') n.fileUrl = '' |
|
|
|
|
|
|
|
if(n.video == '{}') n.video = '' |
|
|
|
data1.push({ |
|
|
|
data1.push({ |
|
|
|
testPaperId: this.testPaperId, |
|
|
|
testPaperId: this.testPaperId, |
|
|
|
assessmentId: this.assessmentId, |
|
|
|
assessmentId: this.assessmentId, |
|
|
@ -402,9 +410,10 @@ export default { |
|
|
|
questionStatus : n.questionStatus, |
|
|
|
questionStatus : n.questionStatus, |
|
|
|
testPaperId: this.testPaperId, |
|
|
|
testPaperId: this.testPaperId, |
|
|
|
userAnswer: userAnswer, |
|
|
|
userAnswer: userAnswer, |
|
|
|
userId: this.userId |
|
|
|
userId: this.userId, |
|
|
|
|
|
|
|
fileUrl: n.fileUrl, |
|
|
|
|
|
|
|
videoAudio: n.video |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|