xiatian 5 ani în urmă
părinte
comite
21ef9931e2
1 a modificat fișierele cu 39 adăugiri și 0 ștergeri
  1. 39 0
      src/modules/questions/views/GenPaperDetail.vue

+ 39 - 0
src/modules/questions/views/GenPaperDetail.vue

@@ -957,6 +957,45 @@ export default {
       }
       return true;
     },
+    confirmGenPaperMType() {
+      if (!this.genPaper.paperName) {
+        this.$notify({
+          message: "试卷名称不能为空!",
+          type: "error",
+        });
+        return false;
+      }
+      if (this.paperDetailStructs.length == 0) {
+        this.$notify({
+          message: "请选择试卷结构!",
+          type: "error",
+        });
+        return false;
+      }
+      var url = QUESTION_API + "/genPaper/manual";
+
+      this.fullscreenLoading = true;
+      this.$http.post(url, this.genPaper).then(
+        (response) => {
+          this.$notify({
+            message: "组卷成功",
+            type: "success",
+          });
+          this.fullscreenLoading = false;
+          let paperId = response.data.paper.id;
+          this.$router.push({
+            path: "/edit_paper/" + paperId + "/gen_paper",
+          });
+        },
+        (error) => {
+          this.$notify({
+            message: error.response.data.msg,
+            type: "error",
+          });
+          this.fullscreenLoading = false;
+        }
+      );
+    },
     confirmGenPaper() {
       if (!this.checkGenPaper()) {
         return false;