ZhangXianQiang
2024-06-19 0a45ebd0372b7209d5b84156ef540d5b0e68c248
feat(考试):多选题答题
1个文件已修改
18 ■■■■■ 已修改文件
src/views/exam/components/answer-main/answer-multiple/index.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exam/components/answer-main/answer-multiple/index.vue
@@ -17,20 +17,23 @@
<script setup>
import { ref } from 'vue';
import {storeToRefs} from 'pinia';
import { storeToRefs } from 'pinia';
import ExamInfo from '@/components/ExamInfo/index.vue';
import {useExamStore} from '@/store/index.js';
import { useExamStore } from '@/store/index.js';
const examStore = useExamStore();
const {currentIndex} = storeToRefs(examStore);
const { currentType, currentIndex } = storeToRefs(examStore);
const activeQuestion = ref(examStore.getActiveQuestion);
const answerClick = (item) => {
  if(item) {
  if (item) {
    // resetAnswer();
    item.isActive = !item.isActive;
    const answerList = filterAnswer();
    examStore.setQuestionAnswer(currentType.value, currentIndex.value, answerList.join(','));
  }
};
@@ -38,10 +41,10 @@
  return {
    active: item.isActive
  };
}
};
const resetAnswer = () => {
  activeQuestion.value.items.forEach(item => item.isActive = false);
const filterAnswer = () => {
  return activeQuestion.value.items.filter(item => item.isActive);
}
@@ -85,6 +88,7 @@
.active {
  border-color: #409EFF !important;
  .answer-icon {
    color: #ffffff !important;
    border-color: #409EFF !important;