From 8b7e7cf0ad42c932bbd8bf3f0c1f60e34267aec8 Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Mon, 25 Sep 2023 14:57:14 +0100 Subject: [PATCH] Improved an error we had before --- src/components/Solutions/index.tsx | 2 -- src/pages/(admin)/Lists/ExamList.tsx | 1 - src/pages/exam.tsx | 2 +- src/pages/exercises.tsx | 3 ++- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/components/Solutions/index.tsx b/src/components/Solutions/index.tsx index 5c3db040..a7d39101 100644 --- a/src/components/Solutions/index.tsx +++ b/src/components/Solutions/index.tsx @@ -27,8 +27,6 @@ export interface CommonProps { } export const renderSolution = (exercise: Exercise, onNext: () => void, onBack: () => void) => { - console.log(exercise); - switch (exercise.type) { case "fillBlanks": return ; diff --git a/src/pages/(admin)/Lists/ExamList.tsx b/src/pages/(admin)/Lists/ExamList.tsx index c7f220a7..e2c57cbf 100644 --- a/src/pages/(admin)/Lists/ExamList.tsx +++ b/src/pages/(admin)/Lists/ExamList.tsx @@ -66,7 +66,6 @@ export default function ExamList() { header: "", id: "actions", cell: ({row}: {row: {original: Exam}}) => { - console.log(row.original); return (
x.id === y.exercise)?.solutions} : x.userSolutions), ); - return Object.assign(exam, exercises); + return Object.assign(exam, {exercises}); }; const onFinish = (solutions: UserSolution[]) => { diff --git a/src/pages/exercises.tsx b/src/pages/exercises.tsx index b068447f..02966428 100644 --- a/src/pages/exercises.tsx +++ b/src/pages/exercises.tsx @@ -142,7 +142,7 @@ export default function Page() { const updateExamWithUserSolutions = (exam: Exam): Exam => { const exercises = exam.exercises.map((x) => Object.assign(x, {userSolutions: userSolutions.find((y) => x.id === y.exercise)?.solutions})); - return Object.assign(exam, exercises); + return Object.assign(exam, {exercises}); }; const onFinish = (solutions: UserSolution[]) => { @@ -291,6 +291,7 @@ export default function Page() { abandonPopupDescription="Are you sure you want to leave the exercise? You will lose all your progress." abandonConfirmButtonText="Confirm" onAbandon={() => { + alert("HERE"); reset(); setShowAbandonPopup(false); }}