Updated and fixed part of the partial test generation

This commit is contained in:
Tiago Ribeiro
2024-01-23 11:45:32 +00:00
parent 74d3f30c93
commit bd0fab4c8f
8 changed files with 21 additions and 11 deletions

View File

@@ -20,7 +20,8 @@ const TaskTab = ({task, index, setTask}: {task?: string; index: number; setTask:
axios
.get(`/api/exam/writing/generate/writing_task${index}_general`)
.then((result) => {
playSound("check");
playSound(typeof result.data === "string" ? "error" : "check");
if (typeof result.data === "string") return toast.error("Something went wrong, please try to generate again.");
setTask(result.data.question);
})
.catch((error) => {