| | |
| | | ElButton: typeof import('element-plus/es')['ElButton'] |
| | | ElCard: typeof import('element-plus/es')['ElCard'] |
| | | ElCol: typeof import('element-plus/es')['ElCol'] |
| | | ElCollapse: typeof import('element-plus/es')['ElCollapse'] |
| | | ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem'] |
| | | ElForm: typeof import('element-plus/es')['ElForm'] |
| | | ElFormItem: typeof import('element-plus/es')['ElFormItem'] |
| | | ElIcon: typeof import('element-plus/es')['ElIcon'] |
| | |
| | | ElPagination: typeof import('element-plus/es')['ElPagination'] |
| | | ElRow: typeof import('element-plus/es')['ElRow'] |
| | | ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] |
| | | ElSlider: typeof import('element-plus/es')['ElSlider'] |
| | | ElTable: typeof import('element-plus/es')['ElTable'] |
| | | ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] |
| | | ElTabPane: typeof import('element-plus/es')['ElTabPane'] |
| | |
| | | |
| | | export const getGradeList = (postData = {examName: '', pageIndex: 1, pageSize: 10}) => { |
| | | return service.post('/api/student/exampaper/answer/pageList',postData); |
| | | } |
| | | |
| | | export const getGradeInfo = (id) => { |
| | | return service.post('/api/student/exampaper/answer/read/' + id); |
| | | } |
| | |
| | | import { ref, computed } from 'vue'; |
| | | import { defineStore } from 'pinia'; |
| | | export const useGradeStore = defineStore('grade', () => { |
| | | const examInfo = ref({ |
| | | examId: 1, |
| | | examName: '考试名称', |
| | | examType: '考试类型', |
| | | examStatus: '考试状态', |
| | | examStartTime: '2021-01-01', |
| | | examEndTime: '2021-01-01', |
| | | examTime: 5, |
| | | examGrade: 60 |
| | | }); |
| | | const examInfo = ref(null); |
| | | const examDetail = ref([]); |
| | | |
| | | const examType = ref({ |
| | | 1: '单选题', |
| | | 2: '多选题', |
| | | 3: '音频题' |
| | | 3: '判断题', |
| | | 4: '填空题', |
| | | 5: '简答题', |
| | | 6: '语音题', |
| | | 7: '计算题', |
| | | 8: '分析题', |
| | | }); |
| | | |
| | | const currentType = ref(1); |
| | | const currentIndex = ref(0); |
| | | |
| | | |
| | | const examDetail = ref([ |
| | | { |
| | | questionType: 1, |
| | | questionList: [ |
| | | { |
| | | "id": null, |
| | | "questionType": 1, |
| | | "gradeLevel": null, |
| | | "subjectId": 2, |
| | | "title": "1+1=?", |
| | | "img": '/test_question.png', |
| | | "items": [ |
| | | { |
| | | "prefix": "A", |
| | | "content": "1" |
| | | }, |
| | | { |
| | | "prefix": "B", |
| | | "content": "2" |
| | | }, |
| | | { |
| | | "prefix": "C", |
| | | "content": "3" |
| | | }, |
| | | { |
| | | "prefix": "D", |
| | | "content": "4" |
| | | } |
| | | ], |
| | | "analyze": "问小朋友", |
| | | "correct": "A", |
| | | "right": "A", |
| | | "score": "3", |
| | | "difficult": 5, |
| | | "isRight": true |
| | | }, |
| | | { |
| | | "id": null, |
| | | "questionType": 1, |
| | | "gradeLevel": null, |
| | | "subjectId": 2, |
| | | "title": "1+1=?", |
| | | "items": [ |
| | | { |
| | | "prefix": "A", |
| | | "content": "1" |
| | | }, |
| | | { |
| | | "prefix": "B", |
| | | "content": "2" |
| | | }, |
| | | { |
| | | "prefix": "C", |
| | | "content": "3" |
| | | }, |
| | | { |
| | | "prefix": "D", |
| | | "content": "4" |
| | | } |
| | | ], |
| | | "analyze": "问小朋友", |
| | | "correct": "A", |
| | | "right": "B", |
| | | "score": "3", |
| | | "difficult": 5, |
| | | "isRight": false |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | questionType: 2, |
| | | questionList: [ |
| | | { |
| | | "id": null, |
| | | "questionType": 1, |
| | | "gradeLevel": null, |
| | | "subjectId": 2, |
| | | "title": "1+1=?", |
| | | "img": '/test_question.png', |
| | | "items": [ |
| | | { |
| | | "prefix": "A", |
| | | "content": "1" |
| | | }, |
| | | { |
| | | "prefix": "B", |
| | | "content": "2" |
| | | }, |
| | | { |
| | | "prefix": "C", |
| | | "content": "3" |
| | | }, |
| | | { |
| | | "prefix": "D", |
| | | "content": "4" |
| | | } |
| | | ], |
| | | "analyze": "问小朋友", |
| | | "correct": "A,B", |
| | | "right": "A,B,C", |
| | | "score": "5", |
| | | "difficult": 5, |
| | | "isRight": false |
| | | }, |
| | | { |
| | | "id": null, |
| | | "questionType": 1, |
| | | "gradeLevel": null, |
| | | "subjectId": 2, |
| | | "title": "1+1=?", |
| | | "items": [ |
| | | { |
| | | "prefix": "A", |
| | | "content": "1" |
| | | }, |
| | | { |
| | | "prefix": "B", |
| | | "content": "2" |
| | | }, |
| | | { |
| | | "prefix": "C", |
| | | "content": "3" |
| | | }, |
| | | { |
| | | "prefix": "D", |
| | | "content": "4" |
| | | } |
| | | ], |
| | | "analyze": "问小朋友", |
| | | "correct": "A,D", |
| | | "right": "B,C", |
| | | "score": "5", |
| | | "difficult": 5, |
| | | "isRight": false |
| | | }, |
| | | { |
| | | "id": null, |
| | | "questionType": 1, |
| | | "gradeLevel": null, |
| | | "subjectId": 2, |
| | | "title": "1+1=?", |
| | | "items": [ |
| | | { |
| | | "prefix": "A", |
| | | "content": "1" |
| | | }, |
| | | { |
| | | "prefix": "B", |
| | | "content": "2" |
| | | }, |
| | | { |
| | | "prefix": "C", |
| | | "content": "3" |
| | | }, |
| | | { |
| | | "prefix": "D", |
| | | "content": "4" |
| | | } |
| | | ], |
| | | "analyze": "问小朋友", |
| | | "correct": "A,B,D", |
| | | "right": "B,C", |
| | | "score": "5", |
| | | "difficult": 5, |
| | | "isRight": false |
| | | }, |
| | | { |
| | | "id": null, |
| | | "questionType": 1, |
| | | "gradeLevel": null, |
| | | "subjectId": 2, |
| | | "title": "1+1=?", |
| | | "img": '/test_question.png', |
| | | "items": [ |
| | | { |
| | | "prefix": "A", |
| | | "content": "1" |
| | | }, |
| | | { |
| | | "prefix": "B", |
| | | "content": "2" |
| | | }, |
| | | { |
| | | "prefix": "C", |
| | | "content": "3" |
| | | }, |
| | | { |
| | | "prefix": "D", |
| | | "content": "4" |
| | | } |
| | | ], |
| | | "analyze": "问小朋友", |
| | | "correct": "B,C", |
| | | "right": "B,C", |
| | | "score": "5", |
| | | "difficult": 5, |
| | | "isRight": true |
| | | }, |
| | | { |
| | | "id": null, |
| | | "questionType": 1, |
| | | "gradeLevel": null, |
| | | "subjectId": 2, |
| | | "title": "1+1=?", |
| | | "items": [ |
| | | { |
| | | "prefix": "A", |
| | | "content": "1" |
| | | }, |
| | | { |
| | | "prefix": "B", |
| | | "content": "2" |
| | | }, |
| | | { |
| | | "prefix": "C", |
| | | "content": "3" |
| | | }, |
| | | { |
| | | "prefix": "D", |
| | | "content": "4" |
| | | } |
| | | ], |
| | | "analyze": "问小朋友", |
| | | "correct": "", |
| | | "right": "B,C", |
| | | "score": "5", |
| | | "difficult": 5, |
| | | "isRight": false |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | questionType: 3, |
| | | questionList: [ |
| | | { |
| | | "id": null, |
| | | "questionType": 1, |
| | | "gradeLevel": null, |
| | | "subjectId": 2, |
| | | "title": "测试音频1", |
| | | "audioFile": '/test.mp3', |
| | | "img": '/test_question.png', |
| | | "items": [ |
| | | { |
| | | "prefix": "A", |
| | | "content": "1" |
| | | }, |
| | | { |
| | | "prefix": "B", |
| | | "content": "2" |
| | | }, |
| | | { |
| | | "prefix": "C", |
| | | "content": "3" |
| | | }, |
| | | { |
| | | "prefix": "D", |
| | | "content": "4" |
| | | } |
| | | ], |
| | | "analyze": "问小朋友", |
| | | "correct": "", |
| | | "right": "B", |
| | | "score": "3", |
| | | "difficult": 5, |
| | | "isRight": false |
| | | }, |
| | | { |
| | | "id": null, |
| | | "questionType": 1, |
| | | "gradeLevel": null, |
| | | "subjectId": 2, |
| | | "title": "测试音频2", |
| | | "audioFile": '/test.mp3', |
| | | "items": [ |
| | | { |
| | | "prefix": "A", |
| | | "content": "1" |
| | | }, |
| | | { |
| | | "prefix": "B", |
| | | "content": "2" |
| | | }, |
| | | { |
| | | "prefix": "C", |
| | | "content": "3" |
| | | }, |
| | | { |
| | | "prefix": "D", |
| | | "content": "4" |
| | | } |
| | | ], |
| | | "analyze": "问小朋友", |
| | | "correct": "D", |
| | | "right": "A", |
| | | "score": "3", |
| | | "difficult": 5, |
| | | "isRight": false |
| | | } |
| | | ] |
| | | }, |
| | | ]); |
| | | |
| | | const getActiveQuestion = computed(() => { |
| | | const temp = examDetail.value.find(item => item.questionType === currentType.value); |
| | |
| | | const setExamDetail = (detail) => { |
| | | examDetail.value = detail; |
| | | }; |
| | | |
| | | const initExam = () => { |
| | | currentIndex.value = 0; |
| | | currentType.value = 1; |
| | | } |
| | | return { |
| | | examInfo, |
| | | examDetail, |
| | |
| | | currentType, |
| | | currentIndex, |
| | | |
| | | initExam, |
| | | |
| | | getActiveQuestion, |
| | | |
| | | setExamInfo, |
| | |
| | | import { getExamInfo } from '@/api/modules/exam.js'; |
| | | const examStore = useExamStore(); |
| | | |
| | | |
| | | const router = useRouter(); |
| | | |
| | | const props = defineProps({ |
| | |
| | | </div> |
| | | </div> |
| | | <div class="mid-container flex items-center my-4 text-gray-700"> |
| | | <el-icon class="mr-1"><Timer /></el-icon> |
| | | <el-icon class="mr-1"> |
| | | <Timer /> |
| | | </el-icon> |
| | | <div class="time"> |
| | | 交卷时间: {{ item.submitTime }} |
| | | </div> |
| | |
| | | 总分: {{ item.totalScore }} |
| | | </div> |
| | | <div class="bottom-item"> |
| | | 题数: {{ item.questionCount}} |
| | | 题数: {{ item.questionCount }} |
| | | </div> |
| | | <div class="bottom-item"> |
| | | 答题时间: {{item.doTime / 60 }}分钟 |
| | | 答题时间: {{ item.doTime / 60 }}分钟 |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | </div> |
| | | <div class="right-container"> |
| | | <div class="button-container"> |
| | | <el-button type="primary" size="large" @click="checkExam">查看试卷</el-button> |
| | | <el-button type="primary" size="large" @click="checkExam(item)">查看试卷</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {ref} from 'vue'; |
| | | import { ref } from 'vue'; |
| | | import { Timer } from '@element-plus/icons-vue'; |
| | | import {useRouter} from 'vue-router'; |
| | | import { useRouter } from 'vue-router'; |
| | | import { useGradeStore } from '@/store/index.js'; |
| | | import { getGradeInfo } from '@/api/modules/grade.js'; |
| | | |
| | | const gradeStore = useGradeStore(); |
| | | |
| | | const router = useRouter(); |
| | | const props = defineProps({ |
| | | dataList: { |
| | |
| | | default: () => [] |
| | | } |
| | | }); |
| | | |
| | | const stateList = { |
| | | 1: { |
| | | text: '未开始', |
| | |
| | | disabled: true |
| | | } |
| | | }; |
| | | const checkExam = () => { |
| | | router.push('/grade'); |
| | | const loading = ref(false); |
| | | |
| | | |
| | | const checkExam = (item) => { |
| | | getGradeInfo(item.id).then((res) => { |
| | | const {id,examName, score,navbar,titleList} = res.data; |
| | | gradeStore.setExamInfo({ |
| | | id, |
| | | examName, |
| | | score, |
| | | navbar |
| | | }); |
| | | gradeStore.setExamDetail(titleList); |
| | | gradeStore.initExam(); |
| | | router.push('/grade'); |
| | | }).catch(err => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | </script> |
| | |
| | | width: 100%; |
| | | min-height: 120px; |
| | | } |
| | | |
| | | .bottom-item { |
| | | margin-right: 30px; |
| | | } |
| | |
| | | <div class="grade-container flex justify-center text-white items-center shadow-md"> |
| | | <el-icon class="mr-1 text-xl" size="24"><Document /></el-icon> |
| | | <div class="label mr-1">考试成绩:</div> |
| | | <div class="grade font-bold text-3xl text-red-600">{{ examInfo.examGrade }}</div> |
| | | <div class="grade font-bold text-3xl text-red-600">{{ examInfo.score }}</div> |
| | | </div> |
| | | </template> |
| | | |