zhangjie 1 year ago
parent
commit
ecf2524a1f

+ 16 - 8
src/features/mark/Mark.vue

@@ -199,15 +199,23 @@ function nextTask() {
   }
 }
 
-// 5秒更新一次tasks
-addInterval(nextTask, 5 * 1000);
-
 onMounted(async () => {
-  await updateMarkTask();
-  await updateSetting();
-  await updateStatus();
-  await updateGroups();
-  await nextTask();
+  let result = true;
+  try {
+    await updateMarkTask();
+    await updateSetting();
+    await updateStatus();
+    await updateGroups();
+    await nextTask();
+  } catch (error) {
+    loadingStatusSpinning = false;
+    result = false;
+  }
+
+  if (!result) return;
+
+  // 5秒更新一次tasks
+  addInterval(nextTask, 5 * 1000);
 });
 
 const __debounceUpdate = debounce(() => {

+ 1 - 4
src/features/mark/MarkDrawTrack.vue

@@ -86,10 +86,7 @@ const computeTopAndLeft = (track: Track | SpecialTag) => {
   }
 
   return {
-    color:
-      route.path === "/admin/exam/arbitrate/start"
-        ? "green"
-        : track.color || "red",
+    color: route.path === "/arbitrate" ? "green" : track.color || "red",
     top: topInsideSliceRatio * 100 + "%",
     left: leftInsideSliceRatio * 100 + "%",
     "font-size":

+ 16 - 0
src/features/mark/MarkTool.vue

@@ -20,6 +20,17 @@
         <img src="@/assets/icons/icon-thumbnail.svg" />
         <p>缩略图</p>
       </div>
+      <div
+        v-if="checkValid('answer') && store.setting.subject.answerUrl"
+        :class="[
+          'mark-tool-item',
+          { 'is-active': store.setting.uiSetting['answer.modal'] },
+        ]"
+        @click="toAnswer"
+      >
+        <img src="@/assets/icons/icon-all-page.svg" />
+        <p>答案</p>
+      </div>
       <div
         v-if="checkValid('issuePaper')"
         class="mark-tool-item"
@@ -109,6 +120,7 @@ import MarkProblemDialog from "./MarkProblemDialog.vue";
 /**
  * allPage:全卷
  * minimap:缩略图
+ * answer:答案
  * issuePaper:问题试卷
  * sizeScale:标记大小
  * shortCut:快捷键
@@ -136,6 +148,10 @@ const toThumbnail = () => {
   store.setting.uiSetting["minimap.modal"] =
     !store.setting.uiSetting["minimap.modal"];
 };
+const toAnswer = () => {
+  store.setting.uiSetting["answer.modal"] =
+    !store.setting.uiSetting["answer.modal"];
+};
 const toIssuePaper = () => {
   (problemRef.showModal as ShowModalFunc)();
 };

+ 2 - 2
src/features/mark/SpecialTagModal.vue

@@ -43,7 +43,7 @@
         >
           <img src="@/assets/icons/icon-wrong.svg" />
         </div>
-        <div
+        <!-- <div
           :class="[
             'board-score',
             'score-icon',
@@ -53,7 +53,7 @@
           @click="chooseSpecialTag('○', 'CIRCLE')"
         >
           <img src="@/assets/icons/icon-circle.svg" />
-        </div>
+        </div> -->
         <div
           :class="[
             'board-score',

+ 2 - 2
src/features/student/studentInspect/MarkBody.vue

@@ -90,7 +90,7 @@ function addTrackColorAttr(tList: Track[]): Track[] {
     emit("getIsMultComments", true);
   }
   tList = tList.map((item: Track) => {
-    item.color = colorMap[item.markerId + ""] || "gray";
+    item.color = colorMap[item.markerId + ""] || "red";
     item.isByMultMark = markerIds.length > 1;
     return item;
   });
@@ -115,7 +115,7 @@ function addTagColorAttr(tList: SpecialTag[]): SpecialTag[] {
     }
   }
   tList = tList.map((item: SpecialTag) => {
-    item.color = colorMap[item.markerId + ""] || "gray";
+    item.color = colorMap[item.markerId + ""] || "red";
     item.isByMultMark = markerIds.length > 1;
     return item;
   });