Made it so it currently is possible to save the progress on the Writing exercise as well

This commit is contained in:
Tiago Ribeiro
2024-02-06 15:51:55 +00:00
parent 779fb76b8b
commit 65fe1ec8ed
2 changed files with 25 additions and 0 deletions

View File

@@ -68,6 +68,8 @@ export default function ExamPage({page}: Props) {
// eslint-disable-next-line react-hooks/exhaustive-deps
const saveSession = async () => {
console.log("Saving your session...");
await axios.post("/api/sessions", {
id: sessionId,
sessionId,
@@ -139,6 +141,7 @@ export default function ExamPage({page}: Props) {
const nextExam = exams[moduleIndex];
if (partIndex === -1 && nextExam.module !== "listening") setPartIndex(0);
if (exerciseIndex === -1 && !["reading", "listening"].includes(nextExam.module)) setExerciseIndex(0);
setExam(nextExam ? updateExamWithUserSolutions(nextExam) : undefined);
}
})();