提交 c308a367 authored 作者: lihuihui's avatar lihuihui

fix:模拟考试结果页修改

上级 368f6440
...@@ -99,6 +99,8 @@ export default { ...@@ -99,6 +99,8 @@ export default {
beforeDestroy() { beforeDestroy() {
clearInterval(this.countDownTime) // 停止倒计时 clearInterval(this.countDownTime) // 停止倒计时
}, },
mounted() {
},
methods: { methods: {
// 倒计时 // 倒计时
countDown(time) { countDown(time) {
......
...@@ -15,23 +15,18 @@ ...@@ -15,23 +15,18 @@
</li> </li>
</ul> </ul>
<div class="order-num"> <div class="order-num">
<template v-for="item in changeQuestion"> <template v-for="item in order">
<div :key="item[0].id"> <div :key="item.id">
<div class="tit">{{ item[0].itemTitle }}</div> <div class="tit">{{ item.title }}</div>
<ul> <ul>
<template v-for="cItem in item"> <template v-for="(cItem, index) in item.question_list">
<!-- childId id --> <li @click="goQuestion(cItem.id)" :class="`stu${cItem.cardStust}`" :key="cItem.id ">{{ index + 1 }}</li>
<li @click="goQuestion(cItem.childId)" :class="isClass(cItem.id, cItem.childId)" :key="cItem.order ">{{ cItem.order }}</li>
</template> </template>
</ul> </ul>
</div> </div>
</template> </template>
</div> </div>
<slot name="btnBox"></slot> <slot name="btnBox"></slot>
<!-- <div class="btn-box">
<div class="btn" @click="goPage('all')">全部解析</div>
<div class="btn" @click="goPage('err')">错题解析</div>
</div> -->
</div> </div>
</template> </template>
<script> <script>
...@@ -41,7 +36,9 @@ export default { ...@@ -41,7 +36,9 @@ export default {
}, },
data() { data() {
return { return {
changeQuestion: [] changeQuestion: [],
questionList: [],
order: []
} }
}, },
computed: { computed: {
...@@ -75,25 +72,23 @@ export default { ...@@ -75,25 +72,23 @@ export default {
}, },
methods: { methods: {
setData() { setData() {
let countNum = 0 const data = []
const type = { this.data.questions.question_items.forEach(list => {
1: '单选题', list.question_list = list.question_list.reduce((a, b) => {
2: '多选题', return a.concat(b)
5: '案例题', })
6: '判断题' list.question_list.map(item => {
} if (!this.data.answers[list.question_item_id][item.id].answer.length) {
return this.data.questions.question_items.map(item => { item.cardStust = 3
return item.question_list.map(cItem => { return item
countNum++ } else {
const data = { this.data.score_items[list.question_item_id][item.id].is_right ? item.cardStust = 1 : item.cardStust = 2
order: countNum, return item
id: item.question_item_id,
childId: cItem.id,
itemTitle: type[item.question_type]
} }
return data
}) })
data.push(list)
}) })
this.order = data
}, },
goQuestion(id) { goQuestion(id) {
this.$emit('goQuestion', id) this.$emit('goQuestion', id)
......
<template> <template>
<div> <div>
<exam-card :hasSubmitBtn="!!(!$route.query.id)" :hasCountDown="!!(!$route.query.id)" v-if="Object.keys(data).length" @submitExam="submitExam" ref="exam" title="模拟考试" :data="data"></exam-card> <exam-card :hasSubmitBtn="!!(!this.$route.query.id)" :hasCountDown="!!(!this.$route.query.id)" v-if="Object.keys(data).length" @submitExam="submitExam" ref="exam" title="模拟考试" :data="data"></exam-card>
</div> </div>
</template> </template>
<script> <script>
...@@ -22,7 +22,7 @@ export default { ...@@ -22,7 +22,7 @@ export default {
}, },
created() { created() {
// 缓存答题 // 缓存答题
if (this.$route.query.exam_id) { if (!this.$route.query.id) {
this.cacheAnswerTime = setInterval(() => { this.cacheAnswerTime = setInterval(() => {
this.submitExam(0) this.submitExam(0)
}, 3000) }, 3000)
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<template v-slot:btnBox> <template v-slot:btnBox>
<div class="btn-box"> <div class="btn-box">
<div class="btn" @click="goPage('all')">全部解析</div> <div class="btn" @click="goPage('all')">全部解析</div>
<div class="btn" @click="goPage('err')">错题解析</div> <!-- <div class="btn" @click="goPage('err')">错题解析</div> -->
</div> </div>
</template> </template>
</card> </card>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论