Improved an error we had before
This commit is contained in:
@@ -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 <FillBlanks {...(exercise as FillBlanksExercise)} onNext={onNext} onBack={onBack} />;
|
||||
|
||||
@@ -66,7 +66,6 @@ export default function ExamList() {
|
||||
header: "",
|
||||
id: "actions",
|
||||
cell: ({row}: {row: {original: Exam}}) => {
|
||||
console.log(row.original);
|
||||
return (
|
||||
<div
|
||||
data-tip="Load exam"
|
||||
|
||||
@@ -140,7 +140,7 @@ export default function Page() {
|
||||
Object.assign(x, !x.userSolutions ? {userSolutions: userSolutions.find((y) => x.id === y.exercise)?.solutions} : x.userSolutions),
|
||||
);
|
||||
|
||||
return Object.assign(exam, exercises);
|
||||
return Object.assign(exam, {exercises});
|
||||
};
|
||||
|
||||
const onFinish = (solutions: UserSolution[]) => {
|
||||
|
||||
@@ -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);
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user