Bladeren bron

button style & score percision

Michael Wang 4 jaren geleden
bovenliggende
commit
7e4f7d848f

+ 5 - 2
src/features/inspect/MarkBoardInspect.vue

@@ -105,8 +105,11 @@ export default defineComponent({
       return qs;
     });
 
-    const markerScore = computed(() =>
-      questions.value?.map((q) => q.score || 0).reduce((acc, s) => acc + s)
+    const markerScore = computed(
+      () =>
+        (questions.value
+          ?.map((q) => (q.score || 0) * 100)
+          .reduce((acc, s) => acc + s) || 0) / 100
     );
 
     function addToCheckedQuestion(question: Question) {

+ 4 - 2
src/features/mark/MarkBoardMouse.vue

@@ -20,8 +20,10 @@
         总分:{{ store.currentMarkResult?.markerScore || 0 }}
       </h1>
     </div>
-    <div>
-      <div class="tw-text-2xl tw-text-center" @click="submit">提交</div>
+    <div class="tw-flex tw-place-content-center tw-mb-2">
+      <qm-button type="primary" shape="round" size="large" @click="submit">
+        提交
+      </qm-button>
     </div>
 
     <div v-if="store.currentTask && store.currentTask.questionList">

+ 22 - 5
src/features/mark/MarkBoardTrack.vue

@@ -9,8 +9,10 @@
         总分:{{ store.currentMarkResult?.markerScore || 0 }}
       </h1>
     </div>
-    <div>
-      <div class="tw-text-2xl tw-text-center" @click="submit">提交</div>
+    <div class="tw-mb-2 tw-flex tw-place-content-center">
+      <qm-button type="primary" shape="round" size="large" @click="submit">
+        提交
+      </qm-button>
     </div>
 
     <div
@@ -51,8 +53,22 @@
     </div>
 
     <div class="tw-flex tw-justify-between tw-mt-4">
-      <div @click="clearLatestMarkOfCurrentQuetion">回退</div>
-      <div @click="clearAllMarksOfCurrentQuetion">清除本题</div>
+      <qm-button
+        type="primary"
+        shape="round"
+        size="large"
+        @click="clearLatestMarkOfCurrentQuetion"
+      >
+        回退
+      </qm-button>
+      <qm-button
+        type="primary"
+        shape="round"
+        size="large"
+        @click="clearAllMarksOfCurrentQuetion"
+      >
+        清除本题
+      </qm-button>
     </div>
   </div>
 </template>
@@ -75,7 +91,8 @@ export default defineComponent({
       const question = store.currentQuestion;
       if (!question) return [];
 
-      const remainScore = question.maxScore - (question.score || 0);
+      const remainScore =
+        (question.maxScore * 100 - (question.score || 0) * 100) / 100;
       const steps = [];
       for (
         let i = 0;

+ 2 - 1
src/features/mark/MarkBody.vue

@@ -384,7 +384,8 @@ export default defineComponent({
           const questionWithScore = Object.entries(scoreGroups);
           const questionWithTotalScore = questionWithScore.map((v) => [
             v[0],
-            v[1].reduce((acc, c) => (acc += c.score), 0),
+            v[1].map((s) => s.score * 100).reduce((acc, c) => (acc += c), 0) /
+              100,
           ]);
           const questionWithTotalScoreSorted = sortBy(
             questionWithTotalScore,