Michael Wang преди 3 години
родител
ревизия
21062a681f

+ 2 - 2
src/features/arbitrate/Arbitrate.vue

@@ -106,11 +106,11 @@ async function updateTask() {
     res = await getOneOfStuTask();
   }
   message.success({
-    content: res.data.libraryId ? "获取成功" : "无任务",
+    content: res.data.studentId ? "获取成功" : "无任务",
     key: mkey,
   });
 
-  if (res.data.libraryId) {
+  if (res.data.studentId) {
     let rawTask = res.data as Task;
     store.currentTask = addFileServerPrefixToTask(rawTask);
   } else {

+ 2 - 2
src/features/library/inspect/LibraryInspect.vue

@@ -76,11 +76,11 @@ async function updateTask() {
   message.info({ content: "获取任务中...", duration: 1.5, key: mkey });
   let res = await getOneOfStuTask();
   message.success({
-    content: res.data.libraryId ? "获取成功" : "无任务",
+    content: res.data.studentId ? "获取成功" : "无任务",
     key: mkey,
   });
 
-  if (res.data.libraryId) {
+  if (res.data.studentId) {
     let rawTask = res.data as Task;
     store.currentTask = addFileServerPrefixToTask(rawTask);
   } else {

+ 2 - 2
src/features/library/libraryTrack/LibraryTrack.vue

@@ -49,11 +49,11 @@ async function updateTask() {
   message.info({ content: "获取任务中...", duration: 1.5, key: mkey });
   let res = await getSingleStuTask();
   message.success({
-    content: res.data.task.libraryId ? "获取成功" : "无任务",
+    content: res.data.task.studentId ? "获取成功" : "无任务",
     key: mkey,
   });
 
-  if (res.data.task) {
+  if (res.data.task.studentId) {
     store.setting.fileServer = res.data.fileServer;
     store.setting.splitConfig = res.data.splitConfig;
     store.setting.groupNumber = res.data.groupNumber;

+ 1 - 1
src/features/student/importInspect/ImportInspect.vue

@@ -69,7 +69,7 @@ async function updateTask() {
   message.info({ content: "获取任务中...", duration: 1.5, key: mkey });
   let res = await getSingleInspectedTask("" + currentStudentId);
   message.success({
-    content: res.data.libraryId ? "获取成功" : "无任务",
+    content: res.data.studentId ? "获取成功" : "无任务",
     key: mkey,
   });
 

+ 1 - 1
src/features/student/studentTrack/StudentTrack.vue

@@ -53,7 +53,7 @@ async function updateTask() {
   message.info({ content: "获取任务中...", duration: 1.5, key: mkey });
   let res = await getSingleStuTask();
   message.success({
-    content: res.data.libraryId ? "获取成功" : "无任务",
+    content: res.data.studentId ? "获取成功" : "无任务",
     key: mkey,
   });
 

+ 5 - 0
src/store/store.ts

@@ -144,6 +144,11 @@ setTimeout(() => {
         task.markResult = undefined;
       }
       if (!task.markResult) {
+        // 管理后台可能不设置 questionList, 而且它不用 markResult
+        if (!task.questionList) {
+          task.questionList = [];
+          // return;
+        }
         // 初始化 __index
         task.questionList.forEach((q, i, ar) => (ar[i].__index = i));