diff --git a/src/mixins/examDo/index.js b/src/mixins/examDo/index.js
index a811eb4..3dd3178 100644
--- a/src/mixins/examDo/index.js
+++ b/src/mixins/examDo/index.js
@@ -74,6 +74,7 @@ export default {
this.$message.error(`请上传${this.maxSize}M以内的文件`)
return false
}
+ item.uploading = true
},
uploadSuccess(res, file, fileList, item) {
let ext = file.response.data.filesResult.fileType
@@ -82,6 +83,7 @@ export default {
}else{
item.fileUrl[file.name] = res.data.filesResult.fileUrl
}
+ item.uploading = false
},
uploadError(err, file, fileList) {
this.$message({
@@ -89,6 +91,7 @@ export default {
type: "error",
center: true
})
+ item.uploading = false
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}?`)
diff --git a/src/pages/achievement/assessment/index.vue b/src/pages/achievement/assessment/index.vue
index fe4deac..565fcb4 100644
--- a/src/pages/achievement/assessment/index.vue
+++ b/src/pages/achievement/assessment/index.vue
@@ -6,13 +6,13 @@
总分:
100分
-
+
得分:
{{score}}分
考试时长:
- {{time}}分钟
+ {{timeSpent != null && timeSpent != '--' ? (timeSpent / 60).toFixed(2) + '分钟' : timeSpent}}
排名:
@@ -102,7 +102,6 @@ export default {
data() {
return {
paperName: '',
- time: 0,
ranking: 1,
selectVisible: false,
tabs: [
@@ -138,7 +137,7 @@ export default {
'userId'
]),
...mapState('achievement', [
- 'id','assessmentId','score'
+ 'id','assessmentId','score','timeSpent'
])
},
mounted() {
@@ -149,7 +148,6 @@ export default {
this.$post(`${this.api.answerDetail}?userId=${this.userId}&assessmentId=${this.assessmentId}&paperId=${this.id}`)
.then(res => {
this.paperName = res.paperName
- this.time = res.time
this.ranking = res.ranking
let list = res.data
for(let i in list){
diff --git a/src/pages/achievement/list/examResults.vue b/src/pages/achievement/list/examResults.vue
index b42a9e0..4ea5eaf 100644
--- a/src/pages/achievement/list/examResults.vue
+++ b/src/pages/achievement/list/examResults.vue
@@ -20,9 +20,17 @@
-
-
-
+
+
+ {{scope.row.timeSpent != '--' ? (scope.row.timeSpent / 60).toFixed(2) : scope.row.timeSpent}}
+
+
+
+
+
+ {{scope.row.thisScore == null ? '未批阅' : scope.row.thisScore}}
+
+
查看详情
@@ -85,7 +93,8 @@ export default {
this.setInfo({
id: row.paperId,
assessmentId: row.assessmentId,
- score: row.thisScore
+ score: row.thisScore,
+ timeSpent: row.timeSpent
})
this.$router.push('assessment')
},
diff --git a/src/pages/exam/do/index.vue b/src/pages/exam/do/index.vue
index 7fbe4cf..7ad4238 100644
--- a/src/pages/exam/do/index.vue
+++ b/src/pages/exam/do/index.vue
@@ -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
+ })
})
})
diff --git a/src/pages/exam/list/index.vue b/src/pages/exam/list/index.vue
index cbe359c..11ff24d 100644
--- a/src/pages/exam/list/index.vue
+++ b/src/pages/exam/list/index.vue
@@ -57,7 +57,6 @@
进入考试
-
@@ -72,6 +71,7 @@