|
@@ -363,6 +363,56 @@ onUnmounted(() => {
|
|
document.removeEventListener("keydown", numberKeyListener);
|
|
document.removeEventListener("keydown", numberKeyListener);
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+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 }
|
|
|
|
+);
|
|
|
|
+
|
|
// const scrollToQuestion = (question: Question) => {
|
|
// const scrollToQuestion = (question: Question) => {
|
|
// const node = document.querySelector(
|
|
// const node = document.querySelector(
|
|
// `#q-${question.mainNumber}-${question.subNumber}`
|
|
// `#q-${question.mainNumber}-${question.subNumber}`
|