|
@@ -8,12 +8,14 @@ import type { Question, MarkResult } from "@/types";
|
|
import useStatus from "./useStatus";
|
|
import useStatus from "./useStatus";
|
|
import useMarkTask from "./useMarkTask";
|
|
import useMarkTask from "./useMarkTask";
|
|
import useTaskTips from "./useTaskTips";
|
|
import useTaskTips from "./useTaskTips";
|
|
|
|
+import useQuestion from "./useQuestion";
|
|
import useTaskQuestion from "./useTaskQuestion";
|
|
import useTaskQuestion from "./useTaskQuestion";
|
|
|
|
|
|
export default function useMarkSubmit() {
|
|
export default function useMarkSubmit() {
|
|
const markStore = useMarkStore();
|
|
const markStore = useMarkStore();
|
|
const { updateStatus } = useStatus();
|
|
const { updateStatus } = useStatus();
|
|
const { nextTask } = useMarkTask();
|
|
const { nextTask } = useMarkTask();
|
|
|
|
+ const { isArbitrated } = useQuestion();
|
|
const { setPrevTips, registTaskChangeTips } = useTaskTips();
|
|
const { setPrevTips, registTaskChangeTips } = useTaskTips();
|
|
const { updateQuestionStatus } = useTaskQuestion();
|
|
const { updateQuestionStatus } = useTaskQuestion();
|
|
registTaskChangeTips();
|
|
registTaskChangeTips();
|
|
@@ -25,8 +27,9 @@ export default function useMarkSubmit() {
|
|
markResult.scoreList.forEach((score: number, index: number) => {
|
|
markResult.scoreList.forEach((score: number, index: number) => {
|
|
if (!markStore.currentTask) return;
|
|
if (!markStore.currentTask) return;
|
|
const question = markStore.currentTask.questionList[index]!;
|
|
const question = markStore.currentTask.questionList[index]!;
|
|
- // 如果是自评或者有问题的题目,不检查分数
|
|
|
|
- if (!question.selfMark || question.problem) return;
|
|
|
|
|
|
+ // 如果是自评、有问题或者待仲裁的题目,不检查分数
|
|
|
|
+ if (!question.selfMark || question.problem || isArbitrated(question))
|
|
|
|
+ return;
|
|
|
|
|
|
const { maxScore, minScore, mainNumber, subNumber, questionName } =
|
|
const { maxScore, minScore, mainNumber, subNumber, questionName } =
|
|
question;
|
|
question;
|
|
@@ -64,13 +67,13 @@ export default function useMarkSubmit() {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- // 问题卷或者不是自己评的试题的答案允许为null
|
|
|
|
|
|
+ // 问题卷,不是自己评以及非仲裁的试题的答案允许为null
|
|
const allowNullQs = [];
|
|
const allowNullQs = [];
|
|
markStore.currentTask.questionList.forEach((q, i) => {
|
|
markStore.currentTask.questionList.forEach((q, i) => {
|
|
- if (q.problem || !q.selfMark) allowNullQs.push(i);
|
|
|
|
|
|
+ if (q.problem || !q.selfMark || isArbitrated(q)) allowNullQs.push(i);
|
|
});
|
|
});
|
|
const questions = markStore.currentTask.questionList.filter(
|
|
const questions = markStore.currentTask.questionList.filter(
|
|
- (q) => !q.problem && q.selfMark
|
|
|
|
|
|
+ (q) => !q.problem && q.selfMark && !isArbitrated(q)
|
|
);
|
|
);
|
|
const scoreList = markResult.scoreList.filter(
|
|
const scoreList = markResult.scoreList.filter(
|
|
(_, i) => !allowNullQs.includes(i)
|
|
(_, i) => !allowNullQs.includes(i)
|
|
@@ -88,6 +91,7 @@ export default function useMarkSubmit() {
|
|
markResult.markerTrackList
|
|
markResult.markerTrackList
|
|
.map((t) => Math.round((t.score || 0) * 100))
|
|
.map((t) => Math.round((t.score || 0) * 100))
|
|
.reduce((acc, s) => acc + s, 0) / 100;
|
|
.reduce((acc, s) => acc + s, 0) / 100;
|
|
|
|
+
|
|
if (
|
|
if (
|
|
trackScores !== markResult.markerScore &&
|
|
trackScores !== markResult.markerScore &&
|
|
markResult.markerScore !== null
|
|
markResult.markerScore !== null
|