提交 5847a4fe authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

上级 a201ddd6
......@@ -89,7 +89,6 @@ export default {
countdownTimer: null, // 倒计时计时器
countdownText: '', // 倒计时显示时间
questionGroups: this.groups, // 所有试题分组,一组一页
questionCount: 0, // 小题数量
currentGroupPage: this.groupPage, // 大题页码
currentGroupCount: this.groupPageCount // 大题总页数
}
......@@ -131,15 +130,17 @@ export default {
},
watch: {
data: {
deep: true,
immediate: true,
handler(data) {
data && this.dataInit(data)
}
},
groups: {
immediate: true,
handler(groups) {
if (groups.length) {
this.questionGroups = groups
this.questionCount = groups.length
}
}
},
groupPage(value) {
......@@ -245,7 +246,6 @@ export default {
const isSubmited = ['1', '2'].includes(data.status)
this.disabled = isSubmited
this.hasResult = isSubmited
this.questionCount = data.questions.total_question_count
this.genQuestions(data)
this.currentGroupCount = this.questionGroups.length
if (this.$route.query.id) {
......@@ -262,6 +262,7 @@ export default {
const { questions, answers = {} } = data
if (!questions) return []
this.questionGroups = questions.question_items.reduce((result, question) => {
if (question.question_list.length) {
question.question_list.forEach(list => {
list = list.map(item => {
let userAnswers = []
......@@ -280,6 +281,9 @@ export default {
})
result.push(Object.assign({}, question, { question_list: list }))
})
} else {
result.push(Object.assign({}, question, { question_list: [] }))
}
return result
}, [])
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论