Finalized the reading generation

This commit is contained in:
Tiago Ribeiro
2024-07-27 14:55:48 +01:00
parent 8f5b27e9ce
commit b5a305485f

View File

@@ -59,6 +59,8 @@ const PartTab = ({
axios
.get(`/api/exam/reading/generate/reading_passage_${index}${topic || types ? `?${url.toString()}` : ""}`)
.then((result) => {
console.log(result.data);
playSound(typeof result.data === "string" ? "error" : "check");
if (typeof result.data === "string") return toast.error("Something went wrong, please try to generate again.");
setPart(result.data);
@@ -171,7 +173,7 @@ const PartTab = ({
<div className="flex flex-col gap-3">
<label className="font-normal text-base text-mti-gray-dim">Exercises</label>
<div className="flex flex-row -2xl:flex-wrap w-full gap-4 -md:justify-center justify-between">
{availableTypes.map((x) => (
{[...availableTypes, ...(index === 3 ? [{type: "ideaMatch", label: "Idea Match"}] : [])].map((x) => (
<span
onClick={() => toggleType(x.type)}
key={x.type}