From 6d625005969e7573e87c0805a80e8286e25e93b0 Mon Sep 17 00:00:00 2001 From: Joao Ramos Date: Thu, 4 Jul 2024 01:23:59 +0100 Subject: [PATCH] Added write the blanks for Listening --- .../(generation)/ListeningGeneration.tsx | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/pages/(generation)/ListeningGeneration.tsx b/src/pages/(generation)/ListeningGeneration.tsx index 4bf4f37c..4085d0e9 100644 --- a/src/pages/(generation)/ListeningGeneration.tsx +++ b/src/pages/(generation)/ListeningGeneration.tsx @@ -14,6 +14,7 @@ import { useRouter } from "next/router"; import { useEffect, useState, Dispatch, SetStateAction } from "react"; import { BsArrowRepeat, BsCheck } from "react-icons/bs"; import { toast } from "react-toastify"; +import WriteBlanksEdit from "@/components/Generation/write.blanks.edit"; const DIFFICULTIES: Difficulty[] = ["easy", "medium", "hard"]; @@ -91,6 +92,29 @@ const PartTab = ({ } /> + ); + // TODO: This might be broken as they all returns the same + case "writeBlanks": + return ( + <> +

Exercise: Write Blanks

+ { + updatePart((part?: ListeningPart) => { + if (part) { + return { + ...part, + exercises: part.exercises.map((x) => + x.id === exercise.id ? { ...x, ...data } : x + ), + } as ListeningPart; + } + }); + }} + /> + ); default: return null;