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

bug fixes

上级 3e740efe
......@@ -171,16 +171,16 @@ export default {
},
methods: {
// 初始化
init() {
async init() {
this.clearTimer()
// 自动获取考试状态
this.autoCheckExamStatus()
await this.autoCheckExamStatus()
// 获取试题
this.getExam()
},
// 获取考试状态
getExamStatus() {
api.getCourseExamStatus(this.sid, this.cid, this.pid).then(response => {
async getExamStatus() {
await api.getCourseExamStatus(this.sid, this.cid, this.pid).then(response => {
this.status = response
if (this.isSubmited || response.examination_status === '90') {
this.checkStatusTimer && clearInterval(this.checkStatusTimer)
......@@ -188,9 +188,9 @@ export default {
})
},
// 自动获取考试状态
autoCheckExamStatus() {
async autoCheckExamStatus() {
// 获取试题状态
this.getExamStatus()
await this.getExamStatus()
this.checkStatusTimer && clearInterval(this.checkStatusTimer)
this.checkStatusTimer = setInterval(this.getExamStatus, 5000)
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论