| | |
| | | </div> |
| | | |
| | | |
| | | <!-- 提示弹窗 --> |
| | | <!-- 退出考试提示弹窗 --> |
| | | <el-dialog v-model="dialogVisible" title="注意" width="500"> |
| | | <div class="dialog-container"> |
| | | <p>请确认是否退出当前考试</p> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref } from 'vue'; |
| | | import { ref, watchEffect } from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { Close } from '@element-plus/icons-vue'; |
| | | import AnswerTag from './components/answer-tag/index.vue'; |
| | |
| | | if (typeQuestion) { |
| | | if (currentIndex.value >= typeQuestion.questionList.length) { |
| | | tempIndex++; |
| | | if(examDetail.value[tempIndex]) { |
| | | if (examDetail.value[tempIndex]) { |
| | | currentType.value = examDetail.value[tempIndex].questionType; |
| | | currentIndex.value = 0; |
| | | } else { |
| | | currentType.value = typeQuestion.questionType; |
| | | currentIndex.value = typeQuestion.questionList.length - 1; |
| | | } |
| | | |
| | | |
| | | } else if (currentIndex.value < 0) { |
| | | tempIndex--; |
| | | if(examDetail.value[tempIndex]) { |
| | | if (examDetail.value[tempIndex]) { |
| | | currentType.value = examDetail.value[tempIndex].questionType; |
| | | currentIndex.value = examDetail.value[tempIndex].questionList.length - 1; |
| | | } else { |
| | |
| | | dialogVisible.value = false; |
| | | router.back(); |
| | | }; |
| | | |
| | | watchEffect(() => { |
| | | let progress = 0; |
| | | examDetail.value.forEach(item => { |
| | | item.questionList.forEach(question => { |
| | | if(question.correct) { |
| | | progress += 1; |
| | | } |
| | | }); |
| | | }); |
| | | examStore.setProgress(progress); |
| | | }); |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |