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

updates

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