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

updates

上级 7d872199
......@@ -251,6 +251,11 @@ export default {
if (this.$route.query.id) {
this.findGroupPageByQuestionId(this.$route.query.id)
}
// 答题倒计时
if (this.hasCountdown) {
this.countDown(this.data.remaining_times)
this.duration = this.data.duration || 0
}
},
// 组装试题数据
genQuestions(data) {
......@@ -435,7 +440,7 @@ export default {
border-radius: 4px;
font-size: 14px;
font-weight: bold;
color: #cccccc;
color: #fff;
line-height: 40px;
text-align: center;
}
......
......@@ -52,10 +52,10 @@
</div>
</template>
<template v-else>
<div class="answer-item">
<!-- <div class="answer-item">
<div class="answer-item-label">老师点评:</div>
<div class="answer-item-content">{{ correctAnswerText }}</div>
</div>
</div> -->
</template>
<div class="answer-item" v-if="data.question_analysis">
<div class="answer-item-label">解析:</div>
......@@ -158,9 +158,6 @@ export default {
color: #222;
line-height: 25px;
}
.question-list-item-bd {
margin-left: 30px;
}
.question-option-item {
margin-top: 20px;
}
......@@ -182,7 +179,6 @@ export default {
}
.question-list-item-ft {
margin-top: 20px;
margin-left: 30px;
}
.question-list-item-ft__title {
font-size: 18px;
......
......@@ -83,10 +83,11 @@ export default {
methods: {
genClass(data) {
// answer(0:未做,1:正确,2:错误)
// 未做
const notDone = data.answer === 0 || (data.user_answer ? !data.user_answer.length : true)
const hasAnswer = Object.prototype.hasOwnProperty.call(data, 'answer')
// 已做
const isDone = (hasAnswer && data.answer !== 0) || (data.user_answer ? data.user_answer.length : false)
return {
stu1: !notDone, // 已做
stu1: isDone, // 已做
stu2: data.big_num === this.page,
stu3: data.sign
}
......
......@@ -29,13 +29,7 @@ export default {
return this.$route.query.exam_id
}
},
created() {
// 缓存答题
if (!this.$route.query.id) {
this.cacheAnswerTime = setInterval(() => {
this.submitExam(0)
}, 3000)
}
beforeMount() {
// 获取考卷
this.getTopic()
},
......@@ -54,6 +48,15 @@ export default {
}
api.getExamQuestion(param).then(response => {
this.data = JSON.parse(response.data).sheet
// 已提交
const isSubmited = ['1', '2'].includes(this.data.status)
// 缓存答题
if (!isSubmited) {
this.cacheAnswerTime = setInterval(() => {
this.submitExam(0)
}, 3000)
}
})
},
// 返回
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论