diff --git a/client/src/components/QuestionsDisplay/MultipleChoiceQuestionDisplay/MultipleChoiceQuestionDisplay.tsx b/client/src/components/QuestionsDisplay/MultipleChoiceQuestionDisplay/MultipleChoiceQuestionDisplay.tsx index 1a3152d..fffae6c 100644 --- a/client/src/components/QuestionsDisplay/MultipleChoiceQuestionDisplay/MultipleChoiceQuestionDisplay.tsx +++ b/client/src/components/QuestionsDisplay/MultipleChoiceQuestionDisplay/MultipleChoiceQuestionDisplay.tsx @@ -35,7 +35,7 @@ const MultipleChoiceQuestionDisplay: React.FC = (props) => { }, [answer]); const checkAnswer = () => { - const isCorrect = question.choices.some((choice) => choice.formattedText.text === answer as string); + const isCorrect = question.choices.some((choice) => choice.isCorrect && choice.formattedText.text === answer as string); setisGoodAnswer(isCorrect); }; @@ -97,7 +97,7 @@ const MultipleChoiceQuestionDisplay: React.FC = (props) => { )} {!showAnswer && handleOnSubmitAnswer && ( - +
+
)} ); diff --git a/client/src/components/QuestionsDisplay/NumericalQuestionDisplay/NumericalQuestionDisplay.tsx b/client/src/components/QuestionsDisplay/NumericalQuestionDisplay/NumericalQuestionDisplay.tsx index d9026cf..b6fc138 100644 --- a/client/src/components/QuestionsDisplay/NumericalQuestionDisplay/NumericalQuestionDisplay.tsx +++ b/client/src/components/QuestionsDisplay/NumericalQuestionDisplay/NumericalQuestionDisplay.tsx @@ -108,6 +108,7 @@ const NumericalQuestionDisplay: React.FC = (props) => { )} {handleOnSubmitAnswer && ( +
+
)} )} diff --git a/client/src/components/QuestionsDisplay/ShortAnswerQuestionDisplay/ShortAnswerQuestionDisplay.tsx b/client/src/components/QuestionsDisplay/ShortAnswerQuestionDisplay/ShortAnswerQuestionDisplay.tsx index fd49835..d03720c 100644 --- a/client/src/components/QuestionsDisplay/ShortAnswerQuestionDisplay/ShortAnswerQuestionDisplay.tsx +++ b/client/src/components/QuestionsDisplay/ShortAnswerQuestionDisplay/ShortAnswerQuestionDisplay.tsx @@ -90,6 +90,7 @@ const ShortAnswerQuestionDisplay: React.FC = (props) => { /> {handleOnSubmitAnswer && ( +
+
)} )} diff --git a/client/src/components/QuestionsDisplay/TrueFalseQuestionDisplay/TrueFalseQuestionDisplay.tsx b/client/src/components/QuestionsDisplay/TrueFalseQuestionDisplay/TrueFalseQuestionDisplay.tsx index a8d4acf..808185b 100644 --- a/client/src/components/QuestionsDisplay/TrueFalseQuestionDisplay/TrueFalseQuestionDisplay.tsx +++ b/client/src/components/QuestionsDisplay/TrueFalseQuestionDisplay/TrueFalseQuestionDisplay.tsx @@ -51,7 +51,7 @@ const TrueFalseQuestionDisplay: React.FC = (props) => { {showAnswer && (
- {question.isTrue? '✅ Correct! ' : '❌ Incorrect!'} + {answer === question.isTrue ? '✅ Correct! ' : '❌ Incorrect!'}
Question : @@ -104,6 +104,7 @@ const TrueFalseQuestionDisplay: React.FC = (props) => {
)} {!showAnswer && handleOnSubmitAnswer && ( +
+
)}
); diff --git a/client/src/components/QuestionsDisplay/questionStyle.css b/client/src/components/QuestionsDisplay/questionStyle.css index ddd6416..328c1ed 100644 --- a/client/src/components/QuestionsDisplay/questionStyle.css +++ b/client/src/components/QuestionsDisplay/questionStyle.css @@ -214,3 +214,8 @@ width: min-content; margin-left: 19rem;} +.submit-button-container{ + display: flex; + justify-content: center; + margin-top: 1rem; +} \ No newline at end of file