Updated the multiple choice
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import FillBlanksEdit from "@/components/Generation/fill.blanks.edit";
|
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 WriteBlankEdits from "@/components/Generation/write.blanks.edit";
|
||||||
import Input from "@/components/Low/Input";
|
import Input from "@/components/Low/Input";
|
||||||
import Select from "@/components/Low/Select";
|
import Select from "@/components/Low/Select";
|
||||||
@@ -130,12 +131,16 @@ const TaskTab = ({section, setSection}: {section: LevelSection; setSection: (sec
|
|||||||
<span className="text-xl font-semibold">Multiple Choice</span>
|
<span className="text-xl font-semibold">Multiple Choice</span>
|
||||||
<span className="rounded-xl bg-white border border-ielts-level p-1 px-4 w-fit">{exercise.questions.length} questions</span>
|
<span className="rounded-xl bg-white border border-ielts-level p-1 px-4 w-fit">{exercise.questions.length} questions</span>
|
||||||
</div>
|
</div>
|
||||||
<span>{exercise.prompt}</span>
|
<MultipleChoiceEdit
|
||||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
exercise={exercise}
|
||||||
{exercise.questions.map((question) => (
|
key={exercise.id}
|
||||||
<QuestionDisplay question={question} onUpdate={onUpdate} key={question.id} />
|
updateExercise={(data: any) =>
|
||||||
))}
|
setSection({
|
||||||
</div>
|
...section,
|
||||||
|
part: {...section.part!, exercises: section.part!.exercises.map((x) => (x.id === exercise.id ? {...x, ...data} : x))},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -399,6 +404,12 @@ const LevelGeneration = () => {
|
|||||||
setParts(newParts);
|
setParts(newParts);
|
||||||
setGeneratedExam(exam);
|
setGeneratedExam(exam);
|
||||||
})
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.log(error);
|
||||||
|
playSound("error");
|
||||||
|
|
||||||
|
toast.error("Something went wrong, please try again later!");
|
||||||
|
})
|
||||||
.finally(() => setIsLoading(false));
|
.finally(() => setIsLoading(false));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user