From 8ccf0848c12460cbfb939c1f8da6e11a602eccea Mon Sep 17 00:00:00 2001 From: ZhangXianQiang <1135831638@qq.com> Date: 星期一, 01 七月 2024 11:17:49 +0800 Subject: [PATCH] fix:答题卡分数 --- src/views/exam/components/answer-sheet/index.vue | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/views/exam/components/answer-sheet/index.vue b/src/views/exam/components/answer-sheet/index.vue index e3a7418..2a7628b 100644 --- a/src/views/exam/components/answer-sheet/index.vue +++ b/src/views/exam/components/answer-sheet/index.vue @@ -5,7 +5,7 @@ <template v-for="item in examDetail"> <el-collapse-item :title="examType[item.questionType]" :name="item.questionType"> <div class="sheet-list grid grid-cols-5 gap-4 justify-items-center"> - <div class="sheet-item cursor-pointer flex justify-center items-center" v-for="question,index in item.questionList" @click="sheetClick(item.questionType,index)" :class="itemClass(item,item.questionType, index)"> + <div class="sheet-item cursor-pointer flex justify-center items-center" v-for="question,index in item.questionList" @click="sheetClick(item.questionType,index)" :class="itemClass(question,item.questionType, index)"> {{ index + 1 }} </div> </div> @@ -24,19 +24,20 @@ const {examType, examDetail,currentType,currentIndex} = storeToRefs(examStore); +const activeNames = ref(examDetail.value.map(item => item.questionType)); + const itemClass = (question,type,index) => { return { - answer: question.correct, + answer: question.answer || question.answerList, active: currentType.value === type && currentIndex.value === index } } - -const activeNames = ref(examDetail.value.map(item => item.questionType)); const sheetClick = (type,index) => { currentType.value = type; currentIndex.value = index; } + </script> <style lang="scss" scoped> -- Gitblit v1.8.0