-
+
总分:
100分
+
+ 得分:
+ {{score}}分
+
考试时长:
- {{duration}}
+ {{duration}}分钟
-
- - {{item.name}}
-
+
+ - {{item.name}}
+
@@ -66,6 +70,7 @@ export default {
data() {
return {
paperName: '',
+ score: 0,
duration: 0,
selectVisible: false,
tabs: [
@@ -137,6 +142,7 @@ export default {
this.userName = data.stuName
this.this_score = data.score
this.duration = data.timeCost
+ this.score = data.score
})
.catch(err => {})
},
diff --git a/src/pages/exam/detail/index.vue b/src/pages/exam/detail/index.vue
index 574b3f3..86df08e 100644
--- a/src/pages/exam/detail/index.vue
+++ b/src/pages/exam/detail/index.vue
@@ -6,16 +6,20 @@
总分:
100分
-
+
考试时长:
{{time}}分钟
+
+ 排名:
+ {{ranking}}
+
-
- - {{item.name}}
-
+
+ - {{item.name}}
+
@@ -67,6 +71,7 @@ export default {
return {
paperName: '',
time: 0,
+ ranking: 1,
selectVisible: false,
tabs: [
{
@@ -111,6 +116,7 @@ export default {
this.$post(`${this.api.answerDetail}?userId=${this.userId}&assessmentId=${this.assessmentId}&paperId=${this.testPaperId}`)
.then(res => {
this.paperName = res.paperName
+ this.ranking = res.ranking
this.time = res.time
this.allData = res.data
let tabs = this.tabs
diff --git a/src/pages/exam/do/index.vue b/src/pages/exam/do/index.vue
index 636c87a..497f09e 100644
--- a/src/pages/exam/do/index.vue
+++ b/src/pages/exam/do/index.vue
@@ -125,7 +125,8 @@ export default {
progress: 0,
isSubmit: false,
isDone: false,
- totalLen: 0
+ totalLen: 0,
+ submiting: false
};
},
computed: {
@@ -299,6 +300,8 @@ export default {
},1000)
},
save(){
+ if(this.submiting) return false
+ this.submiting = true
let data1 = []
this.subjects.map((e,i) => {
e.map((n,k) => {
@@ -327,6 +330,7 @@ export default {
.then(res => {
this.$post(`${this.api.addGzAnswerDetails}`,data1)
.then(res => {
+ this.submiting = false
let timeSpent = parseInt((new Date().getTime() - this.startTime) / 1000)
let data2 = {
testPaperId: this.testPaperId,
diff --git a/src/pages/exam/list/index.vue b/src/pages/exam/list/index.vue
index 2d1ce00..5a37e3c 100644
--- a/src/pages/exam/list/index.vue
+++ b/src/pages/exam/list/index.vue
@@ -42,11 +42,11 @@
{{(scope.row.timeCost / 60).toFixed(2)}}
-
-
+
+
+
{{getAssessmentStateName(scope.row.assessmentState)}}
@@ -57,7 +57,7 @@
进入考试
- 成绩查询
+
@@ -98,7 +98,7 @@ export default {
},
filters: {
transferScore(val){
- return val ? val : '--'
+ return val !== 0 ? val : '--'
}
},
watch: {
diff --git a/src/pages/index/list/index.vue b/src/pages/index/list/index.vue
index b7c29b8..2e1fc03 100644
--- a/src/pages/index/list/index.vue
+++ b/src/pages/index/list/index.vue
@@ -136,7 +136,8 @@ import util from '@/libs/util'
export default {
data() {
return {
- date: [util.formatDate('yyyy-MM-dd'),util.formatDate('yyyy-MM-dd')],
+ timer: null,
+ date: [],
startTime: '',
endTime: '',
page: 1,
@@ -180,6 +181,12 @@ export default {
quill
},
mounted() {
+ let now = util.formatDate('yyyy-MM-dd')
+ let second = util.formatDate('yyyy-MM-dd',new Date(new Date().getTime() + 86400000))
+ this.date = [now,second]
+ this.startTime = now
+ this.endTime = second
+ this.addInterval()
this.getData()
this.getPractice()
this.getAchievement()
@@ -189,6 +196,12 @@ export default {
...mapActions('exam', [
'setInfo'
]),
+ addInterval(){
+ this.timer = setInterval(this.getData,1000)
+ this.$once('hook:beforeDestroy',() => {
+ clearInterval(this.timer)
+ })
+ },
getData() {
this.$post(`${this.api.waitExam}?userId=${this.userId}&pageNum=${this.page}&pageSize=${this.pageSize}&startTime=${this.startTime}&endTime=${this.endTime}`)
.then(res => {
@@ -218,7 +231,7 @@ export default {
let avgScore = 0
list.map(n => avgScore += n.lastScore)
- this.avgScore = (avgScore / list.length).toFixed(2)
+ this.avgScore = list.length ? (avgScore / list.length).toFixed(2) : 0
let totalDuration = 0
list.map(n => totalDuration += n.duration)
@@ -236,17 +249,18 @@ export default {
this.getPractice()
},
getPracticeDuration(){
- console.log(11,this.practiceDateList,this.practiceDurationList)
let myChart = echarts.init(document.getElementById('practiceDuration'))
myChart.setOption({
title: { text: '总练习时长' },
tooltip: {},
xAxis: {
+ name: '日期',
type: 'category',
boundaryGap: false,
data: this.practiceDateList
},
yAxis: {
+ name: '时长(分钟)',
type: 'value'
},
series: [{
@@ -268,10 +282,12 @@ export default {
let myChart = echarts.init(document.getElementById('achievement'))
myChart.setOption({
xAxis: {
+ name: '考试名称',
type: 'category',
data: this.assesmentNameList
},
yAxis: {
+ name: '得分',
type: 'value'
},
series: [{
diff --git a/src/pages/practice/do/index.vue b/src/pages/practice/do/index.vue
index eb4adf9..a16ea31 100644
--- a/src/pages/practice/do/index.vue
+++ b/src/pages/practice/do/index.vue
@@ -123,7 +123,8 @@ export default {
progress: 0,
isSubmit: false,
isDone: false,
- totalLen: 0
+ totalLen: 0,
+ submiting: false
};
},
computed: {
@@ -206,7 +207,7 @@ export default {
this.subjects.map(n => len += n.length)
this.totalLen = len
if(this.isContinue){
- this.identification = res.data.Identification
+ this.identification = res.data.Identification ? res.data.Identification : this.identification
this.subjects.forEach((e,i) => {
e.forEach((n,k) => {
this.initMedia(n)
@@ -257,6 +258,8 @@ export default {
}
},
save(){
+ if(this.submiting) return false
+ this.submiting = true
let data1 = []
this.subjects.map((e,i) => {
e.map((n,k) => {
@@ -286,9 +289,10 @@ export default {
.then(res => {
this.$post(`${this.api.calculationScorePractice}`,data1)
.then(res => {
+ this.submiting = false
this.isSubmit = true
this.$message.success(this.isDone ? '练习已结束,已经自动为您提交练习!' : '提交成功')
- this.$router.back()
+ this.$router.push('list')
}).catch(err => {})
}).catch(err => {})
}).catch(err => {})
diff --git a/src/pages/practice/list/index.vue b/src/pages/practice/list/index.vue
index 1e95a73..9c1f93b 100644
--- a/src/pages/practice/list/index.vue
+++ b/src/pages/practice/list/index.vue
@@ -10,12 +10,14 @@
diff --git a/src/pages/practice/list/myPractice.vue b/src/pages/practice/list/myPractice.vue
index 9abb495..256bff9 100644
--- a/src/pages/practice/list/myPractice.vue
+++ b/src/pages/practice/list/myPractice.vue
@@ -27,9 +27,17 @@
{{getDegreeName(scope.row.degree)}}
-
+
+
+ {{scope.row.duration !== '' ? scope.row.duration : '--'}}
+
+
-
+
+
+ {{scope.row.lastScore !== '' ? scope.row.lastScore : '--'}}
+
+
进入练习
diff --git a/src/pages/practice/list/randomPractice.vue b/src/pages/practice/list/randomPractice.vue
index e894c37..d71a9f4 100644
--- a/src/pages/practice/list/randomPractice.vue
+++ b/src/pages/practice/list/randomPractice.vue
@@ -84,7 +84,7 @@ export default {
},
practice(){
this.$router.push('randomDo')
- }
+ },
}
};
diff --git a/src/pages/practice/randomDo/index.vue b/src/pages/practice/randomDo/index.vue
index e841f00..edd598d 100644
--- a/src/pages/practice/randomDo/index.vue
+++ b/src/pages/practice/randomDo/index.vue
@@ -111,6 +111,7 @@ export default {
briefAnswerScore: 0,
scoreList: [],
questionType: ['单选题','多选题','判断题','填空题','简答题'],
+ submiting: false
};
},
computed: {
@@ -183,6 +184,8 @@ export default {
}).catch(err => {})
},
save(){
+ if(this.submiting) return false
+ this.submiting = true
let data1 = []
this.subjects.map((e,i) => {
e.map((n,k) => {
@@ -208,8 +211,9 @@ export default {
.then(res => {
this.$post(`${this.api.addPractiseRecordRandom}?userId=${this.userId}&randomId=${this.randomId}`)
.then(res => {
+ this.submiting = false
this.$message.success('提交成功')
- this.$router.back()
+ this.$router.push('list?isRandom=true')
})
.catch(err => {})
})
diff --git a/src/pages/setting/person/index.vue b/src/pages/setting/person/index.vue
index dc6b2b7..cbebdd7 100644
--- a/src/pages/setting/person/index.vue
+++ b/src/pages/setting/person/index.vue
@@ -345,7 +345,7 @@ export default {
},
methods: {
...mapActions('user', [
- 'setAvatar'
+ 'setAvatar','setUserName'
]),
getProvince(){
this.$get(this.api.queryProvince).then(res => {
@@ -468,6 +468,7 @@ export default {
let data = userInfoEntity
this.$post(this.api.userinfoUpdate,data).then(res => {
if(res.success){
+ this.setUserName(personalInformation.userName)
this.$message.success('提交成功')
this.$router.back()
}else{
diff --git a/src/router/permission.js b/src/router/permission.js
index 01aa148..6ccfa90 100644
--- a/src/router/permission.js
+++ b/src/router/permission.js
@@ -6,14 +6,15 @@ router.beforeEach((to, from, next) => {
document.title = Setting.titleSuffix;
const role = util.session.get(Setting.usernameKey);
if (!role && to.path !== '/login') {
- if(to.fullPath == '/'){
- next('/login')
- }else{
- next({
- path: '/login',
- query: {redirect: to.fullPath}
- })
- }
+ next('/login')
+ // if(to.fullPath == '/'){
+ // next('/login')
+ // }else{
+ // next({
+ // path: '/login',
+ // query: {redirect: to.fullPath}
+ // })
+ // }
} else if(role && to.path == '/login') {
next('/index')
} else {
diff --git a/src/setting.js b/src/setting.js
index ef5b68d..69de210 100644
--- a/src/setting.js
+++ b/src/setting.js
@@ -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',
// oss文件管理接口地址
apiUploadURL: 'http://8.134.8.197:8001',
// 接口请求返回错误时,弹窗的持续时间,单位:秒
diff --git a/src/store/modules/achievement.js b/src/store/modules/achievement.js
index bbec491..eb0e2a8 100644
--- a/src/store/modules/achievement.js
+++ b/src/store/modules/achievement.js
@@ -7,7 +7,8 @@ export default {
id: '',
assessmentId: '',
assessmentName: '',
- classId: ''
+ classId: '',
+ score: 0
},
getters: {
@@ -18,6 +19,7 @@ export default {
state.assessmentId = info.assessmentId
state.assessmentName = info.assessmentName
state.classId = info.classId
+ state.score = info.score
},
},
actions: {
diff --git a/src/store/modules/practice.js b/src/store/modules/practice.js
index 124518c..be1775e 100644
--- a/src/store/modules/practice.js
+++ b/src/store/modules/practice.js
@@ -22,7 +22,7 @@ export default {
practiseId: '',
paperId: '',
isContinue: '',
- identification: ''
+ identification: '',
},
getters: {
getDegreeName: state => id => {
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 7919c0f..e415775 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -102,5 +102,8 @@ export default {
}
post(api.userinfoUpdate,data).then(res => {}).catch(res => {})
},
+ setUserName({ state,commit },userName) {
+ commit('SET_USERNAME',userName)
+ },
}
}
\ No newline at end of file