Procházet zdrojové kódy

校验键盘给分

Michael Wang před 4 roky
rodič
revize
e2962c7781
1 změnil soubory, kde provedl 11 přidání a 1 odebrání
  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 {