From 2fab8e8add4721e42b5897941e37617c8f7c6b3f Mon Sep 17 00:00:00 2001
From: ZhangXianQiang <1135831638@qq.com>
Date: 星期三, 19 六月 2024 17:07:36 +0800
Subject: [PATCH] feat:查看试卷答题卡

---
 src/views/grade/components/answer-tag/index.vue   |   16 ++++----
 src/store/modules/grade.js                        |   51 ++++++++++++++++++++++---
 src/views/grade/components/answer-sheet/index.vue |   19 ++++++---
 src/views/grade/index.vue                         |    4 +-
 4 files changed, 66 insertions(+), 24 deletions(-)

diff --git a/src/store/modules/grade.js b/src/store/modules/grade.js
index 1c21ed3..3042188 100644
--- a/src/store/modules/grade.js
+++ b/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
         }
       ]
     },
diff --git a/src/views/grade/components/answer-sheet/index.vue b/src/views/grade/components/answer-sheet/index.vue
index fef8708..31a83a6 100644
--- a/src/views/grade/components/answer-sheet/index.vue
+++ b/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>
\ No newline at end of file
diff --git a/src/views/grade/components/answer-tag/index.vue b/src/views/grade/components/answer-tag/index.vue
index 430559b..4fd167a 100644
--- a/src/views/grade/components/answer-tag/index.vue
+++ b/src/views/grade/components/answer-tag/index.vue
@@ -12,19 +12,19 @@
 
 const tagList = ref([
   {
-    name: '宸茬瓟',
-    bgColor: '#3680fa',
-    borderColor: '#3680fa',
+    name: '姝g‘',
+    bgColor: '#67C23A',
+    borderColor: '#67C23A',
+  },
+  {
+    name: '閿欒',
+    bgColor: '#F56C6C',
+    borderColor: '#F56C6C',
   },
   {
     name: '褰撳墠',
     bgColor: '#ffffff',
     borderColor: '#3680fa',
-  },
-  {
-    name: '鏈瓟',
-    bgColor: '#ffffff',
-    borderColor: '#DCDFE6',
   },
 ])
 
diff --git a/src/views/grade/index.vue b/src/views/grade/index.vue
index aa2f2dc..c528c4a 100644
--- a/src/views/grade/index.vue
+++ b/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';

--
Gitblit v1.8.0