Ver Fonte

试卷分析:试题难度分组设置

Michael Wang há 3 anos atrás
pai
commit
a01bf04c02

+ 1 - 7
src/features/allAnalysis/ScoreFirstTryRate.vue

@@ -141,10 +141,4 @@ function openModal1() {
 }
 </script>
 
-<style scoped>
-.section-title {
-  color: #212534;
-  font-size: 16px;
-  font-weight: 700;
-}
-</style>
+<style scoped></style>

+ 1 - 7
src/features/allAnalysis/ScoreRate.vue

@@ -259,10 +259,4 @@ function openModal2() {
 }
 </script>
 
-<style scoped>
-.section-title {
-  color: #212534;
-  font-size: 16px;
-  font-weight: 700;
-}
-</style>
+<style scoped></style>

+ 2 - 0
src/features/paperAnalysis/PaperAnalysis.vue

@@ -49,6 +49,7 @@
       <div v-if="activeTab === '5'">
         <QuestionDifficultyGroup
           :questions="paperQuestions"
+          :totalScore="paper.totalScore"
           :project-id="projectId"
           :courseId="courseId"
           :paperId="paperId"
@@ -114,6 +115,7 @@ async function fetchData() {
   const res2 = await getPaperQuestions(paperId);
   res2.data = res2.data.map((q) => {
     q.difficulityLevel = JSON.parse(q.difficulityLevel || "[]");
+    q.difficulityGroupLevel = JSON.parse(q.difficulityGroupLevel || "[]");
     return q;
   });
   paperQuestions = res2.data;

+ 65 - 18
src/features/paperAnalysis/QuestionDifficultyGroup.vue

@@ -1,24 +1,61 @@
 <template>
   <div>
-    <a-button @click="openModal1">说明</a-button>
-    <a-button @click="openModal2">说明</a-button>
+    <div class="tw-flex tw-justify-between tw-items-center tw-my-4">
+      <h3 class="section-title">按本科目试卷成绩分组</h3>
+      <div class="tw-flex tw-gap-2">
+        <a-button @click="openModal1">说明</a-button>
+      </div>
+    </div>
 
-    <table class="custom-table">
-      <tr>
-        <th>大题号</th>
-        <th>小题号</th>
-        <!-- <th v-for="(item, index) in props" :key="index"></th> -->
-      </tr>
-      <tr v-for="(item, index) in props.questions" :key="index">
-        <td>{{ item.mainNumber }}</td>
-        <td>{{ item.subNumber }}</td>
-        <td v-for="(item, index) in item.difficulityLevel" :key="index">
-          {{ item }}
-        </td>
-      </tr>
-    </table>
+    <div class="tw-overflow-y-scroll">
+      <table class="custom-table">
+        <tr>
+          <td>大题号</td>
+          <td>小题号</td>
+          <td v-for="(item, index) in props.totalScore / 10" :key="index">
+            {{ index * 10 }}-
+          </td>
+        </tr>
+        <tr v-for="(item, index) in props.questions" :key="index">
+          <td>{{ item.mainNumber }}</td>
+          <td>{{ item.subNumber }}</td>
+          <td v-for="(item, index) in item.difficulityLevel" :key="index">
+            {{ item }}
+          </td>
+        </tr>
+      </table>
+    </div>
+
+    <div class="tw-flex tw-justify-between tw-items-center tw-my-4">
+      <h3 class="section-title">按初试总分分组</h3>
+      <div class="tw-flex tw-gap-2">
+        <a-button @click="openRangeConfigModal">分段设置</a-button>
+        <a-button @click="openModal2">说明</a-button>
+      </div>
+    </div>
+
+    <div class="tw-overflow-y-scroll">
+      <table class="custom-table">
+        <tr>
+          <td>大题号</td>
+          <td>小题号</td>
+          <td
+            v-for="(item2, index) in JSON.parse(props.rangeConfig)"
+            :key="index"
+          >
+            {{ scoreTitle(item2) }}
+          </td>
+        </tr>
+        <tr v-for="(item, index) in props.questions" :key="index">
+          <td>{{ item.mainNumber }}</td>
+          <td>{{ item.subNumber }}</td>
+          <td v-for="(item, index) in item.difficulityGroupLevel" :key="index">
+            {{ item }}
+          </td>
+        </tr>
+      </table>
+    </div>
 
-    <a-button @click="openRangeConfigModal">分段设置</a-button>
     <CommonRangeConfig
       ref="rangeConfigRef"
       :project-id="projectId"
@@ -26,18 +63,19 @@
       :range-config="selectedRangeConfig"
       @updated="handleRangeConfigUpdate"
     />
-    <!-- <table></table> -->
   </div>
 </template>
 
 <script setup lang="ts">
 import { setPaperRangeConfig } from "@/api/paperAnalysisPage";
+import { RANGE_POINT_TYPE } from "@/constants/constants";
 import EventBus from "@/plugins/eventBus";
 import { Question } from "@/types";
 import { message } from "ant-design-vue";
 
 const props = defineProps<{
   questions: Question[];
+  totalScore: number;
   rangeConfig?: string;
   projectId: number;
   courseId: number;
@@ -79,6 +117,15 @@ async function handleRangeConfigUpdate(rangeConfig: any) {
   });
   message.success({ content: "操作成功" });
 }
+
+function scoreTitle(rangeConfig: any) {
+  if (!rangeConfig) return false;
+  if (rangeConfig.type === "ZERO") return "0-";
+
+  return `${rangeConfig.baseScore + rangeConfig.adjustScore}(${
+    RANGE_POINT_TYPE[rangeConfig.type]
+  }${rangeConfig.adjustScore > 0 ? "+" : ""}${rangeConfig.adjustScore})-`;
+}
 </script>
 
 <style scoped></style>

+ 1 - 7
src/features/paperAnalysis/QuestionTypeDifficulty.vue

@@ -193,10 +193,4 @@ async function downloadTpl() {
 }
 </script>
 
-<style scoped>
-.section-title {
-  color: #212534;
-  font-size: 16px;
-  font-weight: 700;
-}
-</style>
+<style scoped></style>

+ 6 - 0
src/styles/global.css

@@ -95,3 +95,9 @@ table.custom-table {
   border-collapse: separate !important;
   padding: 10px;
 }
+
+.section-title {
+  color: #212534;
+  font-size: 16px;
+  font-weight: 700;
+}