ソースを参照

feat: 考试管理

zhangjie 3 ヶ月 前
コミット
69e9f3cb3d

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

@@ -16,6 +16,9 @@
           >
         </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>

+ 28 - 0
src/modules/base/components/ModifyExamConfigDetail.vue

@@ -127,6 +127,18 @@
             </p>
           </div>
         </el-form-item>
+        <el-form-item label="默认抽取卷型:" prop="defaultDrawPaperType">
+          <el-radio-group v-model="modalForm.defaultDrawPaperType">
+            <el-radio :label="0">随机</el-radio>
+            <el-radio :label="1">卷1/A卷</el-radio>
+            <el-radio :label="2">卷2/B卷</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="交卷数量:" prop="submitTwoPaper">
+          <el-checkbox v-model="modalForm.submitTwoPaper">
+            一个命题任务至少交AB两套试卷
+          </el-checkbox>
+        </el-form-item>
       </div>
 
       <div class="part-box" v-show="infoShow">
@@ -293,6 +305,8 @@ const initModalForm = {
   backupMethod: "ROOM",
   backupCount: 1,
   drawRule: "ONE",
+  defaultDrawPaperType: 1,
+  submitTwoPaper: false,
   outputFileType: [],
   variableContent: [
     {
@@ -426,6 +440,20 @@ export default {
             trigger: "change",
           },
         ],
+        defaultDrawPaperType: [
+          {
+            required: true,
+            message: "请选择默认抽取卷型",
+            trigger: "change",
+          },
+        ],
+        submitTwoPaper: [
+          {
+            required: true,
+            message: "请选择交卷数量",
+            trigger: "change",
+          },
+        ],
         selectedPrint: [
           {
             required: false,

+ 3 - 0
src/modules/exam/api.js

@@ -298,3 +298,6 @@ export const savePreviewLog = (datas) => {
 export const pdfBuildListPage = (datas) => {
   return $postParam("/api/admin/data/task/page_pdf_create", datas);
 };
+export const stopPrintTaskPdf = (id) => {
+  return $postParam("/api/admin/data/task/stop_pdf_create", { id });
+};

+ 3 - 0
src/modules/exam/components/createExamAndPrintTask/CreateExamAndPrintTask.vue

@@ -125,6 +125,8 @@ const initExamTask = {
   review: false,
   includePaper: false,
   customCard: false,
+  // 一个命题任务至少交AB两套试卷
+  submitTwoPaper: false,
 };
 
 // const examTaskDetailItem = {
@@ -258,6 +260,7 @@ export default {
           uuid: randomCode(32),
           review: this.examRule.review,
           customCard: this.examRule.customCard,
+          submitTwoPaper: this.examRule.submitTwoPaper,
         },
         infoExamTaskDetail: [],
         infoPrintTask: { ...initPrintTask },

+ 6 - 0
src/modules/exam/components/createExamAndPrintTask/InfoExamTask.vue

@@ -842,6 +842,7 @@ export default {
         this.examTask.review = examPrintPlan.review;
         this.examTask.includePaper =
           examPrintPlan.printContent.indexOf("PAPER") !== -1;
+        this.examTask.submitTwoPaper = examPrintPlan.submitTwoPaper;
         this.updateExamTaskDetail();
 
         this.updateTaskInfo({
@@ -1005,6 +1006,11 @@ export default {
 
       this.updateExamTaskDetail();
 
+      if (this.examTask.submitTwoPaper && this.paperAttachments.length < 2) {
+        this.$message.error("一个命题任务至少交AB两套试卷");
+        return Promise.reject();
+      }
+
       const paperAttachments = this.paperAttachments
         .map((item) => item.paperAttachmentIds)
         .flat();

+ 2 - 0
src/modules/exam/components/taskApply/ModifyTaskApply.vue

@@ -131,6 +131,8 @@ const initTaskApply = {
   review: false,
   includePaper: false,
   customCard: false,
+  // 一个命题任务至少交AB两套试卷
+  submitTwoPaper: false,
   // 作废
   taskStatus: "",
   cancelRemark: "",

+ 8 - 0
src/modules/exam/components/taskApply/TaskPaper.vue

@@ -1079,6 +1079,14 @@ export default {
     checkData() {
       this.updateExamTaskDetail();
 
+      if (
+        this.curTaskApply.submitTwoPaper &&
+        this.paperAttachments.length < 2
+      ) {
+        this.$message.error("一个命题任务至少交AB两套试卷");
+        return;
+      }
+
       const paperAttachments = this.paperAttachments
         .map((item) => item.paperAttachmentIds)
         .flat();

+ 24 - 2
src/modules/exam/views/PdfBuildManage.vue

@@ -140,7 +140,7 @@
         <el-table-column
           class-name="action-column"
           label="操作"
-          width="160px"
+          width="200px"
           fixed="right"
         >
           <template slot-scope="scope">
@@ -162,6 +162,17 @@
               @click="toResetCreatePdf(scope.row)"
               >重新生成</el-button
             >
+            <el-button
+              v-if="
+                checkPrivilege('link', 'createPdf') &&
+                scope.row.status === 'RUNNING'
+              "
+              class="btn-danger"
+              type="text"
+              :disabled="loading"
+              @click="toStopCreatePdf(scope.row)"
+              >中止</el-button
+            >
           </template>
         </el-table-column>
       </el-table>
@@ -225,7 +236,7 @@
 
 <script>
 import { DATA_TASK_STATUS, DATA_TASK_RESULT } from "@/constants/enumerate";
-import { pdfBuildListPage } from "../api";
+import { pdfBuildListPage, stopPrintTaskPdf } from "../api";
 import pickerOptions from "@/constants/datePickerOptions";
 import { getPrintTaskPdf, rebuildPrintTaskPdf } from "@/modules/print/api";
 
@@ -337,6 +348,17 @@ export default {
         this.padViewDialogVisible = true;
       }
     },
+    async toStopCreatePdf(row) {
+      const action = await this.$confirm(`确定要中止该印刷任务吗?`, "提示", {
+        type: "warning",
+      }).catch(() => {});
+      if (action !== "confirm") return;
+
+      const res = await stopPrintTaskPdf(row.id).catch(() => {});
+      if (!res) return;
+      this.$message.success("操作成功!");
+      this.getList();
+    },
     async rebuildPdf(item) {
       const action = await this.$confirm(
         `确定要重新生成该印刷任务PDF吗?`,