Updated the eval calls to the backend, passed the navigation logic of level to useExamNavigation hook

This commit is contained in:
Carlos-Mesquita
2024-11-26 09:04:38 +00:00
parent bb5326a331
commit 2ed4e6509e
14 changed files with 452 additions and 493 deletions

View File

@@ -15,7 +15,7 @@ import { calculateExerciseIndexSpeaking } from "./utils/calculateExerciseIndex";
const Speaking: React.FC<ExamProps<SpeakingExam>> = ({ exam, showSolutions = false, preview = false }) => {
const updateTimers = useExamTimer(exam.module, preview);
const updateTimers = useExamTimer(exam.module, preview || showSolutions);
const userSolutionRef = useRef<(() => UserSolution) | null>(null);
const [solutionWasUpdated, setSolutionWasUpdated] = useState(false);
@@ -90,11 +90,8 @@ const Speaking: React.FC<ExamProps<SpeakingExam>> = ({ exam, showSolutions = fal
setSeenParts((prev) => new Set(prev).add(exerciseIndex));
}
const memoizedExerciseIndex = useMemo(() => {
const bruh = calculateExerciseIndexSpeaking(exam, exerciseIndex, questionIndex)
console.log(bruh);
return bruh;
}
const memoizedExerciseIndex = useMemo(() =>
calculateExerciseIndexSpeaking(exam, exerciseIndex, questionIndex)
// eslint-disable-next-line react-hooks/exhaustive-deps
, [exerciseIndex, questionIndex]
);