Unfinished grading attempt at solving it

This commit is contained in:
Carlos-Mesquita
2024-12-28 03:30:15 +00:00
parent f642e41bfa
commit bd9e249704
6 changed files with 237 additions and 107 deletions

View File

@@ -22,7 +22,6 @@ import ShortUniqueId from "short-unique-id";
import { ExamProps } from "@/exams/types";
import useExamStore from "@/stores/exam";
import useEvaluationPolling from "@/hooks/useEvaluationPolling";
import PracticeModal from "@/components/PracticeModal";
interface Props {
page: "exams" | "exercises";
@@ -37,6 +36,7 @@ export default function ExamPage({ page, user, destination = "/", hideSidebar =
const [avoidRepeated, setAvoidRepeated] = useState(false);
const [showAbandonPopup, setShowAbandonPopup] = useState(false);
const [pendingExercises, setPendingExercises] = useState<string[]>([]);
const [shouldPoll, setShouldPoll] = useState(false);
const {
exam, setExam,
@@ -60,7 +60,6 @@ export default function ExamPage({ page, user, destination = "/", hideSidebar =
setFlags,
setShuffles,
evaluated,
setEvaluated,
} = useExamStore();
const [isFetchingExams, setIsFetchingExams] = useState(false);
@@ -150,8 +149,10 @@ export default function ExamPage({ page, user, destination = "/", hideSidebar =
useEffect(() => {
if (flags.finalizeExam && moduleIndex !== -1) {
setModuleIndex(-1);
}
}, [flags, moduleIndex, setModuleIndex]);
}, [flags.finalizeExam, moduleIndex, setModuleIndex]);
useEffect(() => {
if (flags.finalizeExam && !flags.pendingEvaluation && pendingExercises.length === 0) {