浏览代码

feat: 识别配置

zhangjie 3 月之前
父节点
当前提交
e13e843238

+ 2 - 2
src/modules/admin/api.js

@@ -133,10 +133,10 @@ export const schoolSetDataBackup = (schoolId) => {
 };
 };
 // 识别配置
 // 识别配置
 export const schoolSetRecognitionInfo = (schoolId) => {
 export const schoolSetRecognitionInfo = (schoolId) => {
-  return $postParam("/api/admin/set/recognition/select", { schoolId });
+  return $postParam("/api/admin/set/objective/omr/select", { schoolId });
 };
 };
 export const schoolSetRecognitionUpdate = (datas) => {
 export const schoolSetRecognitionUpdate = (datas) => {
-  return $post("/api/admin/set/recognition/save", datas);
+  return $postParam("/api/admin/set/objective/omr/save", datas);
 };
 };
 
 
 // 数据同步 school database sync
 // 数据同步 school database sync

+ 3 - 38
src/modules/admin/components/school/SchoolSetRecognition.vue

@@ -1,29 +1,6 @@
 <template>
 <template>
   <div class="school-set-recognition part-box part-box-pad">
   <div class="school-set-recognition part-box part-box-pad">
-    <el-form
-      ref="modalFormComp"
-      :model="modalForm"
-      :rules="rules"
-      label-width="160px"
-    >
-      <el-form-item label="扩展算法:" prop="extendAlgorithm">
-        <el-radio-group v-model="modalForm.extendAlgorithm">
-          <el-radio
-            v-for="item in OPEN_STATUS"
-            :key="item.value"
-            :label="item.value"
-            >{{ item.label }}</el-radio
-          >
-        </el-radio-group>
-        <br />
-        <p class="tips-info">
-          (开启扩展算法后会对答题卡使用第二套算法进行识别,识别结果仅记录做研发分析,不影响正式算法识别结果)
-        </p>
-        <el-radio-group v-model="modalForm.extendAlgorithmType">
-          <el-radio :key="1" :label="1">仅识别正式算法有嫌疑的题</el-radio>
-          <el-radio :key="2" :label="2">识别全部答题卡</el-radio>
-        </el-radio-group>
-      </el-form-item>
+    <el-form ref="modalFormComp" :model="modalForm" label-width="160px">
       <el-form-item label="客观题检查扩展条件:">
       <el-form-item label="客观题检查扩展条件:">
         <el-checkbox v-model="modalForm.avoidSingleChoice">
         <el-checkbox v-model="modalForm.avoidSingleChoice">
           单选题有且仅有一个识别答案不进客观题检查
           单选题有且仅有一个识别答案不进客观题检查
@@ -39,7 +16,6 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import { OPEN_STATUS } from "@/constants/enumerate";
 import {
 import {
   schoolSetRecognitionInfo,
   schoolSetRecognitionInfo,
   schoolSetRecognitionUpdate,
   schoolSetRecognitionUpdate,
@@ -58,19 +34,9 @@ export default {
   data() {
   data() {
     return {
     return {
       modalForm: {
       modalForm: {
-        // 扩展算法
-        extendAlgorithm: false,
-        extendAlgorithmType: 1,
         avoidSingleChoice: false,
         avoidSingleChoice: false,
       },
       },
-      OPEN_STATUS,
       loading: false,
       loading: false,
-      rules: {
-        extendAlgorithm: [{ required: true, message: "请选择扩展算法" }],
-        extendAlgorithmType: [
-          { required: true, message: "请选择扩展算法类型" },
-        ],
-      },
     };
     };
   },
   },
   mounted() {
   mounted() {
@@ -79,7 +45,7 @@ export default {
   methods: {
   methods: {
     async initData() {
     async initData() {
       const data = await schoolSetRecognitionInfo(this.school.id);
       const data = await schoolSetRecognitionInfo(this.school.id);
-      this.modalForm = data.result || {};
+      this.modalForm.avoidSingleChoice = data?.value === "true";
     },
     },
     async confirm() {
     async confirm() {
       const valid = await this.$refs.modalFormComp.validate().catch(() => {});
       const valid = await this.$refs.modalFormComp.validate().catch(() => {});
@@ -88,7 +54,7 @@ export default {
       if (this.loading) return;
       if (this.loading) return;
       this.loading = true;
       this.loading = true;
       const datas = {
       const datas = {
-        ...this.modalForm,
+        enable: this.modalForm.avoidSingleChoice,
         schoolId: this.school.id,
         schoolId: this.school.id,
       };
       };
       const res = await schoolSetRecognitionUpdate(datas).catch(() => {});
       const res = await schoolSetRecognitionUpdate(datas).catch(() => {});
@@ -96,7 +62,6 @@ export default {
       if (!res) return;
       if (!res) return;
 
 
       this.$message.success("修改成功!");
       this.$message.success("修改成功!");
-      this.initData();
     },
     },
   },
   },
 };
 };

+ 15 - 1
src/modules/exam/components/createExamAndPrintTask/InfoExamTask.vue

@@ -676,7 +676,21 @@ export default {
         this.$refs.examTaskComp.clearValidate();
         this.$refs.examTaskComp.clearValidate();
       });
       });
     },
     },
-    openAbChange() {
+    async openAbChange() {
+      if (this.examTask.openAb) {
+        const confirm = await this.$confirm(
+          `启用此项功能后,考试将在同一考场内同时使用A、B两份试卷进行考核,其中部分学生将使用A卷,另一部分学生则使用B卷。如无必要,请勿开启此功能。`,
+          "提示",
+          {
+            type: "warning",
+          }
+        ).catch(() => {});
+        if (confirm !== "confirm") {
+          this.examTask.openAb = !this.examTask.openAb;
+          return;
+        }
+      }
+
       if (this.examTask.openAb) {
       if (this.examTask.openAb) {
         this.paperAttachments.forEach((paperAttachment) => {
         this.paperAttachments.forEach((paperAttachment) => {
           const attachment = paperAttachment.paperAttachmentIds[0];
           const attachment = paperAttachment.paperAttachmentIds[0];

+ 15 - 1
src/modules/exam/components/taskApply/TaskPaper.vue

@@ -612,9 +612,23 @@ export default {
 
 
       if (this.taskStatus.IS_APPLY) this.getCardList();
       if (this.taskStatus.IS_APPLY) this.getCardList();
     },
     },
-    openAbChange() {
+    async openAbChange() {
       if (!this.taskStatus.IS_APPLY) return;
       if (!this.taskStatus.IS_APPLY) return;
 
 
+      if (this.openAb) {
+        const confirm = await this.$confirm(
+          `启用此项功能后,考试将在同一考场内同时使用A、B两份试卷进行考核,其中部分学生将使用A卷,另一部分学生则使用B卷。如无必要,请勿开启此功能。`,
+          "提示",
+          {
+            type: "warning",
+          }
+        ).catch(() => {});
+        if (confirm !== "confirm") {
+          this.openAb = !this.openAb;
+          return;
+        }
+      }
+
       if (this.openAb) {
       if (this.openAb) {
         this.paperAttachments.forEach((paperAttachment) => {
         this.paperAttachments.forEach((paperAttachment) => {
           const attachment = paperAttachment.paperAttachmentIds[0];
           const attachment = paperAttachment.paperAttachmentIds[0];