yujialong 4 years ago
parent 41467de512
commit 7430299913
  1. 3
      src/mixins/examDo/index.js
  2. 8
      src/pages/achievement/assessment/index.vue
  3. 17
      src/pages/achievement/list/examResults.vue
  4. 79
      src/pages/exam/do/index.vue
  5. 6
      src/pages/exam/list/index.vue
  6. 12
      src/pages/index/list/index.vue
  7. 12
      src/pages/messageBoard/list/index.vue
  8. 50
      src/pages/practice/do/index.vue
  9. 6
      src/pages/wrongBook/list/index.vue
  10. 2
      src/setting.js
  11. 4
      src/store/modules/achievement.js
  12. 4
      src/store/modules/exam.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}`)

@ -6,13 +6,13 @@
<span class="name">总分</span>
<span class="val">100</span>
</div>
<div class="m-r-20" v-if="score != 'null'">
<div class="m-r-20" v-if="score != null">
<span class="name">得分</span>
<span class="val">{{score}}</span>
</div>
<div class="m-r-20">
<span class="name">考试时长</span>
<span class="val">{{time}}分钟</span>
<span class="val">{{timeSpent != null && timeSpent != '--' ? (timeSpent / 60).toFixed(2) + '分钟' : timeSpent}}</span>
</div>
<div>
<span class="name">排名</span>
@ -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){

@ -20,9 +20,17 @@
</template>
</el-table-column>
<el-table-column prop="assessmentName" label="考试名称" align="center"></el-table-column>
<el-table-column prop="timeSpent" label="用时(分钟)" align="center"></el-table-column>
<el-table-column prop="totalDuration" label="考试时间" align="center"></el-table-column>
<el-table-column prop="thisScore" label="得分" align="center"></el-table-column>
<el-table-column prop="timeSpent" label="用时(分钟)" align="center">
<template slot-scope="scope">
{{scope.row.timeSpent != '--' ? (scope.row.timeSpent / 60).toFixed(2) : scope.row.timeSpent}}
</template>
</el-table-column>
<el-table-column prop="submitTime" label="考试时间" align="center"></el-table-column>
<el-table-column prop="thisScore" label="得分" align="center">
<template slot-scope="scope">
{{scope.row.thisScore == null ? '未批阅' : scope.row.thisScore}}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<el-button type="text" @click="show(scope.row)">查看详情</el-button>
@ -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')
},

@ -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
})
})
})

@ -57,7 +57,6 @@
<!-- 学生考试状态:考试状态 state: (0未考 1在考 2已考)
考核状态: state: 考核状态(1待开始 2进行中 3已结束) -->
<el-button type="text" @click="toExam(scope.row)" v-if="scope.row.assessmentState == 2" :disabled="scope.row.state == 2">进入考试</el-button>
<!-- <el-button type="text" @click="toExam(scope.row)">进入考试</el-button> -->
<!-- <el-button type="text" @click="query(scope.row)" v-if="scope.row.state == 2">成绩查询</el-button> -->
</template>
</el-table-column>
@ -72,6 +71,7 @@
<script>
import { mapState,mapGetters,mapActions } from 'vuex'
import util from '@/libs/util'
export default {
data() {
return {
@ -137,12 +137,14 @@ export default {
this.getData();
},
toExam(row){
let time = new Date(row.endTime).getTime() - new Date().getTime()
time = `${util.formateTime(Math.floor(time / 3600000))}:${util.formateTime(Math.floor(time % 3600000 / 60000))}:${util.formateTime(Math.floor(time % 3600000 % 60000 / 1000))}`
this.setInfo({
testPaperId: row.testPaperId,
assessmentId: row.assessmentId,
teacherId: row.teacherId,
classId: row.classId,
duration: row.duration
countdown: time
})
this.$router.push('do')
},

@ -66,7 +66,11 @@
>{{scope.$index + (page - 1) * pageSize + 1}}</template>
</el-table-column>
<el-table-column prop="practiseName" label="练习试卷名称" align="center"></el-table-column>
<el-table-column prop="startTime" label="开始时间" align="center"></el-table-column>
<el-table-column prop="startTime" label="开始时间" align="center">
<template slot-scope="scope">
<p>{{scope.row.startTime | defaultShow}}</p>
</template>
</el-table-column>
<el-table-column prop="duration" label="练习时长(分钟)" align="center">
<template slot-scope="scope">
<p>{{scope.row.duration | defaultShow}}</p>
@ -222,12 +226,14 @@ export default {
this.getData()
},
toExam(row){
let time = new Date(row.endTime).getTime() - new Date().getTime()
time = `${util.formateTime(Math.floor(time / 3600000))}:${util.formateTime(Math.floor(time % 3600000 / 60000))}:${util.formateTime(Math.floor(time % 3600000 % 60000 / 1000))}`
this.setInfo({
testPaperId: row.testPaperId,
assessmentId: row.assessmentId,
teacherId: row.teacherId,
classId: row.classId,
duration: row.duration
classId: row.classId,
countdown: time
})
this.$router.push('/exam/do')
},

@ -152,9 +152,12 @@ export default {
}).catch(res => {})
},
submitComment(row){
let content = row.replyContent
if(!content) return this.$message.error('请填写内容')
content = content.replace(/\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F]/g, "")
let data = {
bid: row.bid,
content: row.replyContent,
content,
commentUserId: this.userId,
schoolId: this.clientId,
}
@ -178,10 +181,13 @@ export default {
}
},
submitReply(row){
let content = row.replyContent
if(!content) return this.$message.error('请填写内容')
content = content.replace(/\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F]/g, "")
let data = {
bid: row.bid,
commentId: row.commentId,
replyComment: row.replyContent,
replyComment: content,
replyUserId: row.commentUserId ? row.commentUserId : row.userIdByReply,
userId: this.userId,
}
@ -192,6 +198,8 @@ export default {
}).catch(res => {})
},
submitMsg(){
if(!this.content) return this.$message.error('请填写内容')
this.content = this.content.replace(/\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F]/g, "")
let data = {
content: this.content,
schoolId: this.clientId,

@ -274,7 +274,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){
@ -286,21 +294,19 @@ 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({
identification: this.identification,
practiseId: this.practiseId,
questionId: n.questionId,
questionStatus : n.questionStatus,
testPaperId: this.paperId,
userAnswer,
userId: this.userId,
fileUrl: n.fileUrl,
videoAudio: n.video
})
}
if(n.fileUrl == '{}') n.fileUrl = ''
if(n.video == '{}') n.video = ''
data1.push({
identification: this.identification,
practiseId: this.practiseId,
questionId: n.questionId,
questionStatus : n.questionStatus,
testPaperId: this.paperId,
userAnswer,
userId: this.userId,
fileUrl: n.fileUrl,
videoAudio: n.video
})
})
})
@ -314,7 +320,9 @@ export default {
this.isSubmit = true
this.$message.success(this.isDone ? '练习已结束,已经自动为您提交练习!' : '提交成功')
this.$router.push('list')
}).catch(err => {})
}).catch(err => {
this.submiting = false
})
}).catch(err => {})
}).catch(err => {})
},
@ -331,6 +339,10 @@ export default {
}else{
userAnswer = n.val
}
n.fileUrl = JSON.stringify(n.fileUrl)
n.video = JSON.stringify(n.video)
if(n.fileUrl == '{}') n.fileUrl = ''
if(n.video == '{}') n.video = ''
data1.push({
identification: this.identification,
practiseId: this.practiseId,
@ -338,7 +350,9 @@ export default {
questionStatus : n.questionStatus,
testPaperId: this.paperId,
userAnswer: userAnswer,
userId: this.userId
userId: this.userId,
fileUrl: n.fileUrl,
videoAudio: n.video
})
})
})

@ -51,12 +51,6 @@
header-align="center"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55"
align="center"
:reserve-selection="true"
></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center">
<template
slot-scope="scope"

@ -16,7 +16,7 @@ const Setting = {
showProgressBar: true,
// 接口请求地址
// apiBaseURL: env === 'development' ? 'http://192.168.31.152:8001' : 'http://39.108.250.202:8000',
apiBaseURL: env === 'development' ? 'http://192.168.31.152:8001' : 'http://39.108.250.202:9000',
apiBaseURL: env === 'development' ? 'http://39.108.250.202:9000' : 'http://39.108.250.202:9000',
// 接口请求返回错误时,弹窗的持续时间,单位:秒
modalDuration: 3,
// 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice

@ -8,7 +8,8 @@ export default {
assessmentId: '',
assessmentName: '',
classId: '',
score: 0
score: 0,
timeSpent: 0
},
getters: {
@ -20,6 +21,7 @@ export default {
state.assessmentName = info.assessmentName
state.classId = info.classId
state.score = info.score
state.timeSpent = info.timeSpent
},
},
actions: {

@ -61,7 +61,7 @@ export default {
teacherId: '',
classId: '',
paperName: '',
duration: ''
countdown: ''
},
getters: {
getDegreeName: state => id => {
@ -84,7 +84,7 @@ export default {
state.teacherId = info.teacherId
state.classId = info.classId
state.testPaperId = info.testPaperId
state.duration = info.duration
state.countdown = info.countdown
},
},
actions: {

Loading…
Cancel
Save