diff --git a/src/pages/(generation)/LevelGeneration.tsx b/src/pages/(generation)/LevelGeneration.tsx index 12f37c3c..a4469654 100644 --- a/src/pages/(generation)/LevelGeneration.tsx +++ b/src/pages/(generation)/LevelGeneration.tsx @@ -1,4 +1,5 @@ import FillBlanksEdit from "@/components/Generation/fill.blanks.edit"; +import MultipleChoiceEdit from "@/components/Generation/multiple.choice.edit"; import WriteBlankEdits from "@/components/Generation/write.blanks.edit"; import Input from "@/components/Low/Input"; import Select from "@/components/Low/Select"; @@ -130,12 +131,16 @@ const TaskTab = ({section, setSection}: {section: LevelSection; setSection: (sec Multiple Choice {exercise.questions.length} questions - {exercise.prompt} -
- {exercise.questions.map((question) => ( - - ))} -
+ + setSection({ + ...section, + part: {...section.part!, exercises: section.part!.exercises.map((x) => (x.id === exercise.id ? {...x, ...data} : x))}, + }) + } + /> ); @@ -399,6 +404,12 @@ const LevelGeneration = () => { setParts(newParts); setGeneratedExam(exam); }) + .catch((error) => { + console.log(error); + playSound("error"); + + toast.error("Something went wrong, please try again later!"); + }) .finally(() => setIsLoading(false)); };