| | |
| | | import { computed, ref } from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import ExamInfo from '@/components/ExamInfo/index.vue'; |
| | | import { useExamStore } from '@/store/index.js'; |
| | | const examStore = useExamStore(); |
| | | import { useGradeStore } from '@/store/index.js'; |
| | | const gradeStore = useGradeStore(); |
| | | |
| | | const { currentIndex } = storeToRefs(examStore); |
| | | const { currentIndex } = storeToRefs(gradeStore); |
| | | |
| | | const activeQuestion = ref(examStore.getActiveQuestion); |
| | | const activeQuestion = ref(gradeStore.getActiveQuestion); |
| | | |
| | | const answerState = (item) => { |
| | | const flag = activeQuestion.value.correct === activeQuestion.value.right; |
| | | if (item.prefix === activeQuestion.value.correct) { |
| | | const flag = checkRight(activeQuestion.value.correct, activeQuestion.value.right); |
| | | return { |
| | | right: flag, |
| | | wrong: !flag |
| | | }; |
| | | } |
| | | if (item.prefix === activeQuestion.value.right) { |
| | | } else if(item.prefix === activeQuestion.value.right) { |
| | | return { |
| | | right: true |
| | | right: !flag, |
| | | wrong: flag |
| | | }; |
| | | } |
| | | }; |
| | | |
| | | const checkRight = (currentAnswer, rightAnswer) => { |
| | | return currentAnswer === rightAnswer; |
| | | }; |
| | | |
| | | const analysisState = computed(() => { |
| | | return { |