From 8b51e50f15ab88f4b72e71dcb21ce50032c78c0e Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Mon, 25 Sep 2023 10:46:04 +0100 Subject: [PATCH] Solving a Listening bug --- src/components/Exercises/WriteBlanks.tsx | 4 ++-- src/components/Solutions/WriteBlanks.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Exercises/WriteBlanks.tsx b/src/components/Exercises/WriteBlanks.tsx index 622329b4..66624bb6 100644 --- a/src/components/Exercises/WriteBlanks.tsx +++ b/src/components/Exercises/WriteBlanks.tsx @@ -62,8 +62,8 @@ export default function WriteBlanks({id, prompt, type, maxWords, solutions, user (x) => solutions .find((y) => x.id.toString() === y.id.toString()) - ?.solution.map((y) => y.toLowerCase()) - .includes(x.solution.toLowerCase()) || false, + ?.solution.map((y) => y.toLowerCase().trim()) + .includes(x.solution.toLowerCase().trim()) || false, ).length; const missing = total - answers.filter((x) => solutions.find((y) => x.id === y.id)).length; diff --git a/src/components/Solutions/WriteBlanks.tsx b/src/components/Solutions/WriteBlanks.tsx index db6e7bd8..a7ef4f9b 100644 --- a/src/components/Solutions/WriteBlanks.tsx +++ b/src/components/Solutions/WriteBlanks.tsx @@ -81,8 +81,8 @@ export default function WriteBlanksSolutions({ (x) => solutions .find((y) => x.id.toString() === y.id.toString()) - ?.solution.map((y) => y.toLowerCase()) - .includes(x.solution.toLowerCase()) || false, + ?.solution.map((y) => y.toLowerCase().trim()) + .includes(x.solution.toLowerCase().trim()) || false, ).length; const missing = total - userSolutions.filter((x) => solutions.find((y) => x.id.toString() === y.id.toString())).length;