| | |
| | | import {useExamStore} from '@/store/index.js'; |
| | | const examStore = useExamStore(); |
| | | |
| | | const {currentIndex,activeQuestion} = storeToRefs(examStore); |
| | | const {currentType,currentIndex,activeQuestion,examDetail} = storeToRefs(examStore); |
| | | |
| | | const answerClick = (item) => { |
| | | if(item) { |
| | | resetAnswer(); |
| | | item.isActive = true |
| | | item.isActive = true; |
| | | |
| | | } |
| | | }; |
| | | |
| | |
| | | activeQuestion.value.items.forEach(item => item.isActive = false); |
| | | } |
| | | |
| | | const filterExam = () => { |
| | | |
| | | } |
| | | |
| | | </script> |
| | | |
| | |
| | | <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,question)" :class="itemClass(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,question)" :class="itemClass(item,item.questionType, index)"> |
| | | {{ index + 1 }} |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | const {examType, examDetail,currentType,currentIndex} = storeToRefs(examStore); |
| | | |
| | | const itemClass = (type,index) => { |
| | | const itemClass = (question,type,index) => { |
| | | return { |
| | | answer: question.correct, |
| | | active: currentType.value === type && currentIndex.value === index |
| | | } |
| | | } |