提交 48dbc0d1 authored 作者: lihuihui's avatar lihuihui

修改bug

上级 00c84d7d
...@@ -48,7 +48,14 @@ export default { ...@@ -48,7 +48,14 @@ export default {
isClass() { isClass() {
return (id, cId) => { return (id, cId) => {
const findItems = this.data.answers[id] const findItems = this.data.answers[id]
const scoreItems = this.data.score_items[id][cId] const scoreItems = this.data.score_item
// ? this.data.score_item[id][cId]
? this.data.score_item[id]
? this.data.score_item[id][cId]
? this.data.score_item[id][cId]
: []
: []
: []
return findItems return findItems
? findItems[cId] ? findItems[cId]
? findItems[cId].answer ? findItems[cId].answer
...@@ -91,12 +98,6 @@ export default { ...@@ -91,12 +98,6 @@ export default {
}, },
goQuestion(id) { goQuestion(id) {
this.$emit('goQuestion', id) this.$emit('goQuestion', id)
// this.$router.push({
// path: '/testExam/exam',
// query: {
// id: id
// }
// })
} }
} }
} }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<div class="chart-box"> <div class="chart-box">
<chart :accuracy="accuracy" :accuracScore="accuracScore"> <chart :accuracy="accuracy" :accuracScore="accuracScore">
<template v-slot:tips> <template v-slot:tips>
<div class="num">{{ accuracy }}%</div> <div class="num">{{ accuracText }}%</div>
<div class="t">正确率</div> <div class="t">正确率</div>
</template> </template>
</chart> </chart>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</div> </div>
<div class="icon"></div> <div class="icon"></div>
</div> </div>
<div class="text">{{ accuracy !== 100 ? '您离成功还有一段距离,继续努力!' : '成功近在眼前,再接再厉!' }}</div> <div class="text">{{ accuracText !== 100 ? '您离成功还有一段距离,继续努力!' : '成功近在眼前,再接再厉!' }}</div>
<!-- <div class="btn">全部考试服务</div> --> <!-- <div class="btn">全部考试服务</div> -->
</div> </div>
</div> </div>
...@@ -52,7 +52,8 @@ export default { ...@@ -52,7 +52,8 @@ export default {
return { return {
data: {}, data: {},
accuracy: 0, accuracy: 0,
accuracScore: 0 accuracScore: 0,
accuracText: 0
} }
}, },
created() { created() {
...@@ -60,7 +61,7 @@ export default { ...@@ -60,7 +61,7 @@ export default {
}, },
computed: { computed: {
setStyle() { setStyle() {
return `width: ${this.accuracy}%` return `width: ${this.accuracText}%`
} }
}, },
mounted() { mounted() {
...@@ -84,6 +85,7 @@ export default { ...@@ -84,6 +85,7 @@ export default {
.then(response => { .then(response => {
const data = JSON.parse(response.data) const data = JSON.parse(response.data)
this.accuracy = parseInt(data.sheet.score) this.accuracy = parseInt(data.sheet.score)
this.accuracText = parseInt(data.sheet.score / data.sheet.questions.total_question_count * 100)
this.data = data this.data = data
this.accuracScore = parseInt(data.sheet.questions.total_score) this.accuracScore = parseInt(data.sheet.questions.total_score)
}) })
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论