|
@@ -82,6 +82,22 @@ export function findCurrentTaskMarkResult() {
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/** 回评时,切换任务前,删除之前的回评markResult */
|
|
|
|
+export function removeOldPreviousMarkResult() {
|
|
|
|
+ function clearMarkResultFromTask(task: Task) {
|
|
|
|
+ let { libraryId, studentId } = task;
|
|
|
|
+ const i = store.markResults.findIndex(
|
|
|
|
+ (s) => s.libraryId === libraryId && s.studentId === studentId
|
|
|
|
+ );
|
|
|
|
+ store.markResults.splice(i, 1);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for (const task of store.historyTasks) {
|
|
|
|
+ // 清理不在当前任务中的markResult,防止回评产生的markResult造成垃圾
|
|
|
|
+ clearMarkResultFromTask(task);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
export function removeCurrentMarkResult() {
|
|
export function removeCurrentMarkResult() {
|
|
if (!store.currentTask) return;
|
|
if (!store.currentTask) return;
|
|
|
|
|