| | |
| | | |
| | | export const getExamInfo = (id) => { |
| | | return service.post('/api/student/exam/start/' + id); |
| | | } |
| | | |
| | | export const submitExam = (postData) => { |
| | | return service.post('/api/student/exam/submit', postData); |
| | | } |
| | | |
| | | export const saveExam = (postData) => { |
| | | return service.post('/api/student/exam/timing', postData); |
| | | } |
| | |
| | | const setQuestionAnswer = (type, index, answer) => { |
| | | const temp = examDetail.value.find(item => item.questionType === type); |
| | | if (temp) { |
| | | temp.questionList[index].correct = answer; |
| | | temp.questionList[index].answer = answer; |
| | | } |
| | | }; |
| | | |
| | |
| | | item.isActive = true; |
| | | } |
| | | const answerList = filterAnswer(); |
| | | examStore.setQuestionAnswer(currentType.value, currentIndex.value, answerList.join(',')); |
| | | let temp = ''; |
| | | if(answerList) { |
| | | temp = answerList.prefix; |
| | | } |
| | | examStore.setQuestionAnswer(currentType.value, currentIndex.value, temp); |
| | | } |
| | | }; |
| | | |
| | |
| | | }; |
| | | |
| | | const filterAnswer = () => { |
| | | return activeQuestion.value.questionItemList.filter(item => item.isActive); |
| | | return activeQuestion.value.questionItemList.find(item => item.isActive); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | const itemClass = (question,type,index) => { |
| | | return { |
| | | answer: question.correct, |
| | | answer: question.answer || question.answerList, |
| | | active: currentType.value === type && currentIndex.value === index |
| | | } |
| | | } |
| | |
| | | let progress = 0; |
| | | examDetail.value.forEach(item => { |
| | | item.questionList.forEach(question => { |
| | | if (question.correct) { |
| | | if (question.answer || question.answerList) { |
| | | progress += 1; |
| | | } |
| | | }); |
New file |
| | |
| | | <template> |
| | | <div class="list-container w-full h-full"> |
| | | <el-scrollbar> |
| | | <el-row> |
| | | <el-col> |
| | | <el-card shadow="hover" class="mb-3"> |
| | | <div class="item-content"> |
| | | <div class="item-icon"></div> |
| | | <div class="item-title"></div> |
| | | </div> |
| | | </el-card> |
| | | </el-col> |
| | | </el-row> |
| | | </el-scrollbar> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .item { |
| | | width: 100%; |
| | | min-height: 120px; |
| | | } |
| | | |
| | | .bottom-item { |
| | | margin-right: 30px; |
| | | } |
| | | </style> |
| | |
| | | <div class="list-container container grow relative"> |
| | | <div class="list-content absolute top-0 bottom-0 left-0 right-0 py-4"> |
| | | <div class="list-wrapper w-full h-full"> |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | port: 3000, |
| | | proxy: { |
| | | '/api': { |
| | | target: 'http://192.168.3.88:8000', |
| | | // target: 'http://192.168.3.64:8000', |
| | | // target: 'http://192.168.3.88:8000', |
| | | target: 'http://192.168.3.64:8000', |
| | | changeOrigin: true, |
| | | } |
| | | } |