From b21e0d75f513ef9a87a99f059ca0aa85e3670955 Mon Sep 17 00:00:00 2001 From: ZhangXianQiang <1135831638@qq.com> Date: 星期五, 28 六月 2024 10:36:43 +0800 Subject: [PATCH] fix:修改考试 --- src/views/exam/components/answer-main/answer-single/index.vue | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/views/exam/components/answer-main/answer-single/index.vue b/src/views/exam/components/answer-main/answer-single/index.vue index b58b59f..0712750 100644 --- a/src/views/exam/components/answer-main/answer-single/index.vue +++ b/src/views/exam/components/answer-main/answer-single/index.vue @@ -1,10 +1,10 @@ <template> <div class="answer-container w-full h-full"> <el-scrollbar> - <ExamInfo class="mb-5" :questionIndex="currentIndex" :title="activeQuestion.title"></ExamInfo> + <ExamInfo class="mb-5" :questionIndex="currentIndex" :activeQuestion="activeQuestion"></ExamInfo> <div class="answer-content"> - <div class="answer-item flex" v-for="item, index in activeQuestion.items" @click="answerClick(item)" + <div class="answer-item flex" v-for="item, index in activeQuestion.questionItemList" @click="answerClick(item)" :class="answerState(item)"> <div class="answer-icon flex flex-col justify-center items-center flex-shrink-0">{{ item.prefix }}</div> <div class="answer-text text-gray-700">{{ item.content }}</div> @@ -35,7 +35,11 @@ item.isActive = true; } const answerList = filterAnswer(); - examStore.setQuestionAnswer(currentType.value, currentIndex.value, answerList.join(',')); + let temp = ''; + if(answerList) { + temp = answerList.prefix; + } + examStore.setQuestionAnswer(currentType.value, currentIndex.value, temp); } }; @@ -46,11 +50,11 @@ }; const resetAnswer = () => { - activeQuestion.value.items.forEach(item => item.isActive = false); + activeQuestion.value.questionItemList.forEach(item => item.isActive = false); }; const filterAnswer = () => { - return activeQuestion.value.items.filter(item => item.isActive); + return activeQuestion.value.questionItemList.find(item => item.isActive); } -- Gitblit v1.8.0