From e848a6137c8367a53656ea17ba38554f74ab60fe Mon Sep 17 00:00:00 2001 From: Naman-B-Parlecha Date: Sun, 5 Jan 2025 17:14:41 +0530 Subject: [PATCH] Fix(app): MCQ generation issue causing page break --- eduaid_web/package-lock.json | 2 +- eduaid_web/src/pages/Output.jsx | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/eduaid_web/package-lock.json b/eduaid_web/package-lock.json index 265257c..51e19bd 100644 --- a/eduaid_web/package-lock.json +++ b/eduaid_web/package-lock.json @@ -16,7 +16,7 @@ "react-dom": "^18.3.1", "react-icons": "^5.2.1", "react-router-dom": "^6.26.0", - "react-scripts": "5.0.1", + "react-scripts": "^5.0.1", "react-switch": "^7.0.0", "web-vitals": "^2.1.4" }, diff --git a/eduaid_web/src/pages/Output.jsx b/eduaid_web/src/pages/Output.jsx index e1b2424..7004448 100644 --- a/eduaid_web/src/pages/Output.jsx +++ b/eduaid_web/src/pages/Output.jsx @@ -60,12 +60,8 @@ const Output = () => { if (questionType === "get_mcq") { qaPairsFromStorage["output"].forEach((qaPair) => { - const options = qaPair.answer - .filter((ans) => !ans.correct) - .map((ans) => ans.answer); - const correctAnswer = qaPair.answer.find( - (ans) => ans.correct - )?.answer; + const options = qaPair.options; + const correctAnswer = qaPair.answer; combinedQaPairs.push({ question: qaPair.question,