From c65181f7bf184d2a56ea428646aac1fad771c30b Mon Sep 17 00:00:00 2001 From: JubaAzul <118773284+JubaAzul@users.noreply.github.com> Date: Thu, 30 Jan 2025 23:01:04 -0500 Subject: [PATCH] =?UTF-8?q?L'affichage=20de=20la=20bonne=20r=C3=A9ponse=20?= =?UTF-8?q?dans=20les=20r=C3=A9troactions=20ne=20fonctionne=20plus=20Fixes?= =?UTF-8?q?=20#218?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MultipleChoiceQuestionDisplay.tsx | 19 +++++++------------ server/package-lock.json | 2 +- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/client/src/components/QuestionsDisplay/MultipleChoiceQuestionDisplay/MultipleChoiceQuestionDisplay.tsx b/client/src/components/QuestionsDisplay/MultipleChoiceQuestionDisplay/MultipleChoiceQuestionDisplay.tsx index f9ade9f..2fb187b 100644 --- a/client/src/components/QuestionsDisplay/MultipleChoiceQuestionDisplay/MultipleChoiceQuestionDisplay.tsx +++ b/client/src/components/QuestionsDisplay/MultipleChoiceQuestionDisplay/MultipleChoiceQuestionDisplay.tsx @@ -12,10 +12,9 @@ interface Props { } const MultipleChoiceQuestionDisplay: React.FC = (props) => { - const { question, showAnswer, handleOnSubmitAnswer } = props; const [answer, setAnswer] = useState(); - + useEffect(() => { setAnswer(undefined); }, [question]); @@ -24,7 +23,6 @@ const MultipleChoiceQuestionDisplay: React.FC = (props) => { setAnswer(choice); }; - const alpha = Array.from(Array(26)).map((_e, i) => i + 65); const alphabet = alpha.map((x) => String.fromCharCode(x)); return ( @@ -37,25 +35,22 @@ const MultipleChoiceQuestionDisplay: React.FC = (props) => { const selected = answer === choice.formattedText.text ? 'selected' : ''; return (
- - {choice.formattedFeedback && showAnswer && ( + {choice.formattedFeedback && showAnswer && (
- {choice.isCorrect ? '✅' : '❌'}
)} + +
); })} diff --git a/server/package-lock.json b/server/package-lock.json index 9b44c36..3d4122a 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -31,7 +31,7 @@ "supertest": "^6.3.4" }, "engines": { - "node": "18.x" + "node": "20.x" } }, "node_modules/@ampproject/remapping": {