刘洋 9 months ago
parent
commit
295a0b0e86
3 changed files with 34 additions and 19 deletions
  1. 1 1
      src/api/markPage.ts
  2. 16 16
      src/devLoginParams.ts
  3. 17 2
      src/features/mark/Mark.vue

+ 1 - 1
src/api/markPage.ts

@@ -119,7 +119,7 @@ export async function doProblemType(problemId: number) {
 
   let markResult = store.currentTask?.markResult;
   markResult.problem = true;
-  markResult.unselective = false;
+  // markResult.unselective = false;
   markResult.problemTypeId = problemId;
   markResult.markerScore = null;
   markResult.scoreList = [];

+ 16 - 16
src/devLoginParams.ts

@@ -97,14 +97,14 @@
 // };
 
 /** 255 评卷员 */
-// export const LOGIN_CONFIG = {
-//   isAdmin: false,
-//   forceChange: true,
-//   loginName: "pjy-3001-5-1",
-//   password: "123456",
-//   examId: "414",
-//   markerId: "4242",
-// };
+export const LOGIN_CONFIG = {
+  isAdmin: false,
+  forceChange: true,
+  loginName: "pjy-3001-1-1",
+  password: "123456",
+  examId: "414",
+  markerId: "4274",
+};
 
 /** 225 管理员 */
 
@@ -117,14 +117,14 @@
 //   markerId: null,
 // };
 
-export const LOGIN_CONFIG = {
-  isAdmin: true,
-  forceChange: true,
-  loginName: "fwy2",
-  password: "123456",
-  examId: "416",
-  markerId: null,
-};
+// export const LOGIN_CONFIG = {
+//   isAdmin: true,
+//   forceChange: true,
+//   loginName: "fwy2",
+//   password: "123456",
+//   examId: "416",
+//   markerId: null,
+// };
 
 // export const loginName = "admin-ch";
 // export const password = "123456";

+ 17 - 2
src/features/mark/Mark.vue

@@ -153,11 +153,26 @@ async function updateGroups() {
   store.groups = res.data;
 }
 
+const selectiveHandler = (task: any) => {
+  if (task.questionList?.length) {
+    task.questionList = task.questionList.map((q: any) => {
+      if (q?.score == -1) {
+        q.score = void 0;
+        q.selective = true;
+        q.hasSetUnselective = true;
+      }
+      return q;
+    });
+  }
+  return task;
+};
+
 let preDrawing = false;
 async function updateTask() {
   const res = await getTask();
   if (res.data.libraryId) {
-    let rawTask = res.data;
+    // let rawTask = res.data;
+    let rawTask = selectiveHandler(res.data);
     // 测试数据:边界打分bug的情况
     // rawTask.sliceConfig = [
     //   {
@@ -339,7 +354,7 @@ const buildRejectScoreList = (task: Task) => {
   let aRejectArr = afterRejectScoreList.split(",");
   let rejectArr = rejectScoreList.split(",");
   for (let i = 0; i < rejectArr.length; i++) {
-    let score = rejectArr[i];
+    let score = rejectArr[i] == "-1" ? "/" : rejectArr[i];
     if (aRejectArr[i] === "#") {
       arr.push(
         h(