|
@@ -132,7 +132,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { ref } from "vue";
|
|
|
+import { ref, watch } from "vue";
|
|
|
import type { Question } from "@/types";
|
|
|
import { useMarkStore } from "@/store";
|
|
|
import useAutoChooseFirstQuestion from "../composables/useAutoChooseFirstQuestion";
|
|
@@ -209,6 +209,56 @@ function questionScoreSteps(question: Question) {
|
|
|
return steps;
|
|
|
}
|
|
|
|
|
|
+function clearAllMarksOfCurrentQuetion(cQuestion: Question | undefined) {
|
|
|
+ const currentQuestion = cQuestion || markStore.currentQuestion;
|
|
|
+ // 只要清除分数,就当做修改了
|
|
|
+ hasModifyScore.value = true;
|
|
|
+
|
|
|
+ if (!markStore.currentTask?.markResult || !currentQuestion) return;
|
|
|
+
|
|
|
+ const qno = `${currentQuestion.mainNumber}_${currentQuestion.subNumber}`;
|
|
|
+ markStore.currentTaskModifyQuestion[qno] = true;
|
|
|
+
|
|
|
+ const markResult = markStore.currentTask.markResult;
|
|
|
+ markStore.removeScoreTracks = markResult.markerTrackList.filter(
|
|
|
+ (q) =>
|
|
|
+ q.mainNumber === currentQuestion?.mainNumber &&
|
|
|
+ q.subNumber === currentQuestion?.subNumber
|
|
|
+ );
|
|
|
+ markResult.markerTrackList = markResult.markerTrackList.filter(
|
|
|
+ (q) =>
|
|
|
+ q.mainNumber !== currentQuestion?.mainNumber ||
|
|
|
+ q.subNumber !== currentQuestion?.subNumber
|
|
|
+ );
|
|
|
+ const { __index } = currentQuestion;
|
|
|
+ markResult.scoreList[__index] = null;
|
|
|
+}
|
|
|
+
|
|
|
+function aiAbnormalHandle() {
|
|
|
+ if (!props.isCheckAnswer || !markStore.currentTask) return;
|
|
|
+
|
|
|
+ let firstAbnormalQuestion: Question | null = null;
|
|
|
+ markStore.currentTask.questionList.forEach((question) => {
|
|
|
+ if (question.problem || isArbitrated(question) || !question.selfMark)
|
|
|
+ return;
|
|
|
+
|
|
|
+ if (question.markerScore === -1) {
|
|
|
+ clearAllMarksOfCurrentQuetion(question);
|
|
|
+ if (!firstAbnormalQuestion) firstAbnormalQuestion = question;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ if (firstAbnormalQuestion) chooseQuestion(firstAbnormalQuestion);
|
|
|
+}
|
|
|
+
|
|
|
+watch(
|
|
|
+ () => markStore.currentTask,
|
|
|
+ () => {
|
|
|
+ aiAbnormalHandle();
|
|
|
+ },
|
|
|
+ { immediate: true }
|
|
|
+);
|
|
|
+
|
|
|
function submit() {
|
|
|
emit("submit");
|
|
|
}
|