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

bug fixes

上级 066e845c
......@@ -253,6 +253,14 @@ export default {
},
// 提交
submit() {
// 最短交卷时长/分钟
const min = this.data.questions.minimum_paper_handing_time || 0
if (this.duration < min * 60) {
this.$alert('考试时间不足' + min + '分钟,不能提交', '', {
confirmButtonText: '确定'
})
return
}
this.$emit('submit', this.questionGroups)
},
// 数据初始化
......
......@@ -11,19 +11,26 @@
<h3>{{ item.paper_title }}</h3>
<!-- <p>{{ item.start_time }} ~ {{ item.end_time }}</p> -->
<p>{{ getExamStatusName(item.status) }}</p>
<p v-if="canRepeateExam(item)" style="padding: 10px 0" @click.stop="repeateStartExam(item)">重新考试</p>
</el-card>
</template>
</div>
<el-dialog center :visible.sync="dialogVisible">
<div class="info" v-if="acitveItem && acitveItem.config">
<div style="font-size:20px; text-align: center;">{{ acitveItem.paper_title }}</div>
<div style="font-size:18px; text-align: center;margin: 10px 0 20px;">考试时间:{{ acitveItem.start_time }} ~ {{ acitveItem.end_time }}</div>
<div style="font-size: 20px; text-align: center">{{ acitveItem.paper_title }}</div>
<div style="font-size: 18px; text-align: center; margin: 10px 0 20px">
考试时间:{{ acitveItem.start_time }} ~ {{ acitveItem.end_time }}
</div>
<div v-html="acitveItem.config.welcome_message"></div>
</div>
<div v-if="acitveItem && acitveItem.config">
<div v-if="acitveItem.config.enabled_promise">
<el-dialog title="考前须知" :visible.sync="innerVisible" width="70%" append-to-body center>
<div v-if="acitveItem && acitveItem.config" style="font-size: 18px" v-html="acitveItem.config.promise_message"></div>
<div
v-if="acitveItem && acitveItem.config"
style="font-size: 18px"
v-html="acitveItem.config.promise_message"
></div>
<span slot="footer" class="dialog-footer">
<el-button :disabled="!isRead" type="primary" @click="enterExam">{{ noticeText }}</el-button>
</span>
......@@ -67,13 +74,18 @@ export default {
this.getExamList()
},
methods: {
// 是否可以重复考试
canRepeateExam(item) {
// 状态已完成,并且设置了多次考试
return [1, 2].includes(item.status) && item.paper_info && item.paper_info.is_multiple_exams
},
getExamStatusName(status) {
const map = {
0: '待完成', // 已缓存
1: '已完成', // 已提交
2: '已完成', // 已评阅
3: '待完成', // 已缓存
100: '未',
100: '未作答',
101: '未开始',
102: '已结束'
}
......@@ -81,7 +93,7 @@ export default {
},
getExamList() {
api.getExamList({ course_id: this.courseId }).then(response => {
// 考试状态(0,3:已缓存,1:已提交,2:已评阅,100:未 101:未开始 102:已结束)
// 考试状态(0,3:已缓存,1:已提交,2:已评阅,100:未作答 101:未开始 102:已结束)
this.examList = response.papers.map(item => {
const nowTime = new Date().getTime()
item.config = item.config ? JSON.parse(item.config) : {}
......@@ -107,7 +119,7 @@ export default {
this.$message.error(`考试${this.getExamStatusName(item.status)}${item.start_time} ~ ${item.end_time})`)
return
}
// 未的新试卷
// 未作答的新试卷
if (item.paper_type === 3 && item.status === 100) {
// 考前须知
if (item.config.welcome_message) {
......@@ -121,18 +133,40 @@ export default {
// 已完成
this.$router.push({ path: '/exam/exam/result', query: { exam_id: item.id, type: item.paper_type } })
} else {
// 未
// 未作答
this.$router.push({
path: '/exam/exam/exam',
query: { exam_id: item.id, type: item.paper_type, is_create: 0 }
})
}
},
// 重新考试
repeateStartExam(item) {
this.acitveItem = item
// 考试未开始或者已结束
if ([101, 102].includes(item.status)) {
this.$message.error(`考试${this.getExamStatusName(item.status)}${item.start_time} ~ ${item.end_time})`)
return
}
// 未作答的新试卷
if (item.paper_type === 3 && item.status === 100) {
// 考前须知
if (item.config.welcome_message) {
this.dialogVisible = true
return
}
}
// 未作答
this.$router.push({
path: '/exam/exam/exam',
query: { exam_id: item.id, type: item.paper_type, is_create: 1 }
})
},
open(item) {
this.$msgbox({
title: '提示',
message: '您上次未完试题',
showCancelButton: true,
message: '您上次未作答完试题',
showCancelButton: false,
confirmButtonText: '继续答题',
cancelButtonText: '重新答题',
distinguishCancelAndClose: true
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论