From 66f8510f9a0f05c3457dfe90374bcc650a4125ca Mon Sep 17 00:00:00 2001 From: JubaAzul <118773284+JubaAzul@users.noreply.github.com> Date: Wed, 19 Mar 2025 16:26:03 -0400 Subject: [PATCH] =?UTF-8?q?[BUG]=20Dans=20un=20quiz=20au=20rythme=20de=20l?= =?UTF-8?q?'=C3=A9tudiant,=20l'enseignant=20ne=20peut=20plus=20masquer=20l?= =?UTF-8?q?es=20questions=20Fixes=20#295?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/__tests__/pages/ManageRoom/ManageRoom.test.tsx | 5 ++--- client/src/pages/Teacher/ManageRoom/ManageRoom.tsx | 8 +++++--- client/src/pages/Teacher/ManageRoom/manageRoom.css | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/client/src/__tests__/pages/ManageRoom/ManageRoom.test.tsx b/client/src/__tests__/pages/ManageRoom/ManageRoom.test.tsx index 2d0259e..a0645eb 100644 --- a/client/src/__tests__/pages/ManageRoom/ManageRoom.test.tsx +++ b/client/src/__tests__/pages/ManageRoom/ManageRoom.test.tsx @@ -344,11 +344,10 @@ describe('ManageRoom', () => { const tableHeader = screen.getByText('Q1'); fireEvent.click(tableHeader); - const closeButton = screen.getByRole('button', { name: /✖/i }); - expect(closeButton).toBeInTheDocument(); + const questionVisibilitySwitch = screen.getByTestId('question-visibility-switch'); // Get the specific switch expect(screen.getByText(/Question 1\//i)).toBeInTheDocument(); - fireEvent.click(closeButton); + fireEvent.click(questionVisibilitySwitch); expect(screen.queryByRole('button', { name: /✖/i })).not.toBeInTheDocument(); expect(screen.queryByText(/Question 1\//i)).not.toBeInTheDocument(); diff --git a/client/src/pages/Teacher/ManageRoom/ManageRoom.tsx b/client/src/pages/Teacher/ManageRoom/ManageRoom.tsx index 7034bdc..60153e4 100644 --- a/client/src/pages/Teacher/ManageRoom/ManageRoom.tsx +++ b/client/src/pages/Teacher/ManageRoom/ManageRoom.tsx @@ -318,6 +318,7 @@ const ManageRoom: React.FC = () => { return; } setQuizQuestions(quizQuestions); + setCurrentQuestion(quizQuestions[0]); webSocketService.launchStudentModeQuiz(formattedRoomName, quizQuestions); }; @@ -475,19 +476,20 @@ const ManageRoom: React.FC = () => {
{quiz?.title}
-
+
Afficher les questions
} control={ ) => setIsQuestionShown(e.target.checked) } /> } /> -
+
{!isNaN(Number(currentQuestion?.question.id)) && isQuestionShown && ( diff --git a/client/src/pages/Teacher/ManageRoom/manageRoom.css b/client/src/pages/Teacher/ManageRoom/manageRoom.css index 9246099..bd4b6fb 100644 --- a/client/src/pages/Teacher/ManageRoom/manageRoom.css +++ b/client/src/pages/Teacher/ManageRoom/manageRoom.css @@ -39,7 +39,7 @@ .close-button-wrapper{ display: flex; - justify-content: flex-end; + justify-content: flex-start; margin-right: 1rem; }