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

修改bug

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