ZhangXianQiang
2024-06-19 2fab8e8add4721e42b5897941e37617c8f7c6b3f
feat:查看试卷答题卡
4个文件已修改
90 ■■■■ 已修改文件
src/store/modules/grade.js 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/grade/components/answer-sheet/index.vue 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/grade/components/answer-tag/index.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/grade/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/modules/grade.js
@@ -51,9 +51,10 @@
          ],
          "analyze": "问小朋友",
          "correct": "A",
          "right": "B",
          "right": "A",
          "score": "3",
          "difficult": 5
          "difficult": 5,
          "isRight": true
        },
        {
          "id": null,
@@ -83,7 +84,8 @@
          "correct": "A",
          "right": "B",
          "score": "3",
          "difficult": 5
          "difficult": 5,
          "isRight": false
        }
      ]
    },
@@ -118,7 +120,8 @@
          "correct": "A,B",
          "right": "A,B,C",
          "score": "5",
          "difficult": 5
          "difficult": 5,
          "isRight": false
        },
        {
          "id": null,
@@ -148,7 +151,39 @@
          "correct": "A,D",
          "right": "B,C",
          "score": "5",
          "difficult": 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": "B,C",
          "right": "B,C",
          "score": "5",
          "difficult": 5,
          "isRight": true
        }
      ]
    },
@@ -184,7 +219,8 @@
          "correct": "",
          "right": "B",
          "score": "3",
          "difficult": 5
          "difficult": 5,
          "isRight": false
        },
        {
          "id": null,
@@ -215,7 +251,8 @@
          "correct": "D",
          "right": "A",
          "score": "3",
          "difficult": 5
          "difficult": 5,
          "isRight": false
        }
      ]
    },
src/views/grade/components/answer-sheet/index.vue
@@ -19,16 +19,17 @@
<script setup>
import { ref } from 'vue';
import {storeToRefs} from 'pinia';
import {useExamStore} from '@/store/index.js';
const examStore = useExamStore();
import {useGradeStore} from '@/store/index.js';
const gradeStore = useGradeStore();
const {examType, examDetail,currentType,currentIndex} = storeToRefs(examStore);
const {examType, examDetail,currentType,currentIndex} = storeToRefs(gradeStore);
const activeNames = ref(examDetail.value.map(item => item.questionType));
const itemClass = (question,type,index) => {
  return {
    answer: question.correct,
    right: question.isRight,
    wrong: !question.isRight,
    active: currentType.value === type && currentIndex.value === index
  }
}
@@ -55,9 +56,13 @@
.active {
  border-color: #3680fa;
}
.answer {
  border-color: #3680fa !important;
  background-color: #3680fa !important;
.right {
  background-color: #67C23A !important;
  color: #fff !important;
}
.wrong {
  background-color: #F56C6C !important;
  color: #fff !important;
}
</style>
src/views/grade/components/answer-tag/index.vue
@@ -12,19 +12,19 @@
const tagList = ref([
  {
    name: '已答',
    bgColor: '#3680fa',
    borderColor: '#3680fa',
    name: '正确',
    bgColor: '#67C23A',
    borderColor: '#67C23A',
  },
  {
    name: '错误',
    bgColor: '#F56C6C',
    borderColor: '#F56C6C',
  },
  {
    name: '当前',
    bgColor: '#ffffff',
    borderColor: '#3680fa',
  },
  {
    name: '未答',
    bgColor: '#ffffff',
    borderColor: '#DCDFE6',
  },
])
src/views/grade/index.vue
@@ -30,7 +30,7 @@
              <div class="sheet-wrapper w-full grow relative my-5">
                <div class="sheet-content absolute top-0 bottom-0 w-full">
                  <!-- <AnswerSheet></AnswerSheet> -->
                  <AnswerSheet></AnswerSheet>
                </div>
              </div>
@@ -78,7 +78,7 @@
import { Close,Timer } from '@element-plus/icons-vue';
import AnswerTag from './components/answer-tag/index.vue';
// import AnswerSheet from './components/answer-sheet/index.vue';
import AnswerSheet from './components/answer-sheet/index.vue';
import { useGradeStore } from '@/store/index.js';
import { useRouter } from 'vue-router';