diff --git a/client/src/components/LiveResults/LiveResults.tsx b/client/src/components/LiveResults/LiveResults.tsx index 95b6edb..4369a4b 100644 --- a/client/src/components/LiveResults/LiveResults.tsx +++ b/client/src/components/LiveResults/LiveResults.tsx @@ -33,7 +33,7 @@ const LiveResults: React.FC = ({ questions, showSelectedQuesti setIsOpen(!isOpen)}> -
Résultats du quiz
+
{isOpen ? 'Résultats du quiz' : 'Masquer les résultats'}
diff --git a/client/src/components/QuestionsDisplay/QuestionDisplay.tsx b/client/src/components/QuestionsDisplay/QuestionDisplay.tsx index fc5d18f..1ed7887 100644 --- a/client/src/components/QuestionsDisplay/QuestionDisplay.tsx +++ b/client/src/components/QuestionsDisplay/QuestionDisplay.tsx @@ -19,6 +19,7 @@ interface QuestionProps { showAnswer?: boolean; students?: StudentType[]; showResults?: boolean; + showAnswerToggle?: boolean; answer?: AnswerType; } @@ -26,6 +27,7 @@ const QuestionDisplay: React.FC = ({ question, handleOnSubmitAnswer, showAnswer, + showAnswerToggle = false, students, answer, }) => { @@ -92,35 +94,49 @@ const QuestionDisplay: React.FC = ({ break; } return ( - - - setIsOpen(!isOpen)}> - {isOpen ? 'Masquer les questions' : 'Afficher les questions'} - - - Afficher les résultats
} - control={ - ) => - setShowResults(e.target.checked) - } + <> + {showAnswerToggle ? ( + + + setIsOpen(!isOpen)}> + {isOpen ? 'Afficher les questions' : 'Masquer les questions'} + + + Afficher les résultats} + control={ + ) => + setShowResults(e.target.checked) + } + /> + } /> - } - /> -
- {questionTypeComponent ? ( - <> - {questionTypeComponent} - - ) : ( -
Question de type inconnue
- )} -
-
-
-
+
+ {questionTypeComponent ? ( + <> + {questionTypeComponent} + + ) : ( +
Question de type inconnue
+ )} +
+
+
+
+ ) : ( +
+ {questionTypeComponent ? ( + <> + {questionTypeComponent} + + ) : ( +
Question de type inconnue
+ )} +
+ )} + ); }; diff --git a/client/src/pages/Teacher/ManageRoom/ManageRoom.tsx b/client/src/pages/Teacher/ManageRoom/ManageRoom.tsx index 27bf7e7..eeac06f 100644 --- a/client/src/pages/Teacher/ManageRoom/ManageRoom.tsx +++ b/client/src/pages/Teacher/ManageRoom/ManageRoom.tsx @@ -423,6 +423,7 @@ const ManageRoom: React.FC = () => { {currentQuestion && (