ZhangXianQiang
2024-06-28 96a3cc03d4a01366135fad937292647c413d26d0
fix:考试进度问题
7个文件已修改
1个文件已添加
59 ■■■■ 已修改文件
src/api/modules/exam.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/modules/exam.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exam/components/answer-main/answer-single/index.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exam/components/answer-sheet/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exam/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/folder/data-list/index.vue 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/folder/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
vite.config.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/modules/exam.js
@@ -6,4 +6,12 @@
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);
}
src/store/modules/exam.js
@@ -55,7 +55,7 @@
  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;
    }
  };
src/views/exam/components/answer-main/answer-single/index.vue
@@ -35,7 +35,11 @@
      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);
  }
};
@@ -50,7 +54,7 @@
};
const filterAnswer = () => {
  return activeQuestion.value.questionItemList.filter(item => item.isActive);
  return activeQuestion.value.questionItemList.find(item => item.isActive);
}
src/views/exam/components/answer-sheet/index.vue
@@ -28,7 +28,7 @@
const itemClass = (question,type,index) => {
  return {
    answer: question.correct,
    answer: question.answer || question.answerList,
    active: currentType.value === type && currentIndex.value === index
  }
}
src/views/exam/index.vue
@@ -246,7 +246,7 @@
  let progress = 0;
  examDetail.value.forEach(item => {
    item.questionList.forEach(question => {
      if (question.correct) {
      if (question.answer || question.answerList) {
        progress += 1;
      }
    });
src/views/folder/data-list/index.vue
New file
@@ -0,0 +1,31 @@
<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>
src/views/folder/index.vue
@@ -5,7 +5,7 @@
    <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>
vite.config.js
@@ -34,8 +34,8 @@
        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,
            }
        }