Browse Source

校验键盘给分

Michael Wang 4 years ago
parent
commit
e2962c7781
1 changed files with 11 additions and 1 deletions
  1. 11 1
      src/components/mark/MarkBoardKeyBoard.vue

+ 11 - 1
src/components/mark/MarkBoardKeyBoard.vue

@@ -163,7 +163,17 @@ export default defineComponent({
     });
 
     function submit() {
-      emit("submit");
+      const errors: any = [];
+      store.currentTask?.questionList.forEach((question, index) => {
+        if (!isNumber(question.score)) {
+          errors.push({ question, index, error: "没有赋分不能提交" });
+        }
+      });
+      if (errors.length === 0) {
+        emit("submit");
+      } else {
+        console.log(errors);
+      }
     }
 
     return {