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. 39
      src/pages/exam/do/index.vue
  5. 6
      src/pages/exam/list/index.vue
  6. 10
      src/pages/index/list/index.vue
  7. 12
      src/pages/messageBoard/list/index.vue
  8. 24
      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以内的文件`) this.$message.error(`请上传${this.maxSize}M以内的文件`)
return false return false
} }
item.uploading = true
}, },
uploadSuccess(res, file, fileList, item) { uploadSuccess(res, file, fileList, item) {
let ext = file.response.data.filesResult.fileType let ext = file.response.data.filesResult.fileType
@ -82,6 +83,7 @@ export default {
}else{ }else{
item.fileUrl[file.name] = res.data.filesResult.fileUrl item.fileUrl[file.name] = res.data.filesResult.fileUrl
} }
item.uploading = false
}, },
uploadError(err, file, fileList) { uploadError(err, file, fileList) {
this.$message({ this.$message({
@ -89,6 +91,7 @@ export default {
type: "error", type: "error",
center: true center: true
}) })
item.uploading = false
}, },
beforeRemove(file, fileList) { beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`) return this.$confirm(`确定移除 ${file.name}`)

@ -6,13 +6,13 @@
<span class="name">总分</span> <span class="name">总分</span>
<span class="val">100</span> <span class="val">100</span>
</div> </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="name">得分</span>
<span class="val">{{score}}</span> <span class="val">{{score}}</span>
</div> </div>
<div class="m-r-20"> <div class="m-r-20">
<span class="name">考试时长</span> <span class="name">考试时长</span>
<span class="val">{{time}}分钟</span> <span class="val">{{timeSpent != null && timeSpent != '--' ? (timeSpent / 60).toFixed(2) + '分钟' : timeSpent}}</span>
</div> </div>
<div> <div>
<span class="name">排名</span> <span class="name">排名</span>
@ -102,7 +102,6 @@ export default {
data() { data() {
return { return {
paperName: '', paperName: '',
time: 0,
ranking: 1, ranking: 1,
selectVisible: false, selectVisible: false,
tabs: [ tabs: [
@ -138,7 +137,7 @@ export default {
'userId' 'userId'
]), ]),
...mapState('achievement', [ ...mapState('achievement', [
'id','assessmentId','score' 'id','assessmentId','score','timeSpent'
]) ])
}, },
mounted() { mounted() {
@ -149,7 +148,6 @@ export default {
this.$post(`${this.api.answerDetail}?userId=${this.userId}&assessmentId=${this.assessmentId}&paperId=${this.id}`) this.$post(`${this.api.answerDetail}?userId=${this.userId}&assessmentId=${this.assessmentId}&paperId=${this.id}`)
.then(res => { .then(res => {
this.paperName = res.paperName this.paperName = res.paperName
this.time = res.time
this.ranking = res.ranking this.ranking = res.ranking
let list = res.data let list = res.data
for(let i in list){ for(let i in list){

@ -20,9 +20,17 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="assessmentName" label="考试名称" align="center"></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="timeSpent" label="用时(分钟)" align="center">
<el-table-column prop="totalDuration" label="考试时间" align="center"></el-table-column> <template slot-scope="scope">
<el-table-column prop="thisScore" label="得分" align="center"></el-table-column> {{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"> <el-table-column label="操作" align="center" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="show(scope.row)">查看详情</el-button> <el-button type="text" @click="show(scope.row)">查看详情</el-button>
@ -85,7 +93,8 @@ export default {
this.setInfo({ this.setInfo({
id: row.paperId, id: row.paperId,
assessmentId: row.assessmentId, assessmentId: row.assessmentId,
score: row.thisScore score: row.thisScore,
timeSpent: row.timeSpent
}) })
this.$router.push('assessment') this.$router.push('assessment')
}, },

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

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

@ -66,7 +66,11 @@
>{{scope.$index + (page - 1) * pageSize + 1}}</template> >{{scope.$index + (page - 1) * pageSize + 1}}</template>
</el-table-column> </el-table-column>
<el-table-column prop="practiseName" label="练习试卷名称" align="center"></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"> <el-table-column prop="duration" label="练习时长(分钟)" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.duration | defaultShow}}</p> <p>{{scope.row.duration | defaultShow}}</p>
@ -222,12 +226,14 @@ export default {
this.getData() this.getData()
}, },
toExam(row){ 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({ this.setInfo({
testPaperId: row.testPaperId, testPaperId: row.testPaperId,
assessmentId: row.assessmentId, assessmentId: row.assessmentId,
teacherId: row.teacherId, teacherId: row.teacherId,
classId: row.classId, classId: row.classId,
duration: row.duration countdown: time
}) })
this.$router.push('/exam/do') this.$router.push('/exam/do')
}, },

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

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

@ -51,12 +51,6 @@
header-align="center" header-align="center"
@selection-change="handleSelectionChange" @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"> <el-table-column type="index" width="100" label="序号" align="center">
<template <template
slot-scope="scope" slot-scope="scope"

@ -16,7 +16,7 @@ const Setting = {
showProgressBar: true, 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: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, modalDuration: 3,
// 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice // 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice

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

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

Loading…
Cancel
Save