From 949f0d10cc1edcf202f3435ca0e07957a4e1739a Mon Sep 17 00:00:00 2001 From: Louis-Antoine Caron Date: Sat, 6 Apr 2024 19:27:01 -0400 Subject: [PATCH] clean console --- client/src/pages/Student/JoinRoom/JoinRoom.tsx | 4 ---- client/src/pages/Teacher/ManageRoom/ManageRoom.tsx | 4 +--- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/client/src/pages/Student/JoinRoom/JoinRoom.tsx b/client/src/pages/Student/JoinRoom/JoinRoom.tsx index 23263db..fee8fb1 100644 --- a/client/src/pages/Student/JoinRoom/JoinRoom.tsx +++ b/client/src/pages/Student/JoinRoom/JoinRoom.tsx @@ -42,24 +42,20 @@ const JoinRoom: React.FC = () => { console.log('Successfully joined the room.'); }); socket.on('next-question', (question: QuestionType) => { - console.log("NEXT MODE!") setQuizMode('teacher'); setIsWaitingForTeacher(false); setQuestion(question); }); socket.on('launch-student-mode', (questions: QuestionType[]) => { - console.log("STODENT MODE!") setQuizMode('student'); setIsWaitingForTeacher(false); setQuestions(questions); setQuestion(questions[0]); }); socket.on('end-quiz', () => { - console.log("END!") disconnect(); }); socket.on('join-failure', (message) => { - console.log("BIG FAIL!") console.log('Failed to join the room.'); setConnectionError(`Erreur de connexion : ${message}`); setIsConnecting(false); diff --git a/client/src/pages/Teacher/ManageRoom/ManageRoom.tsx b/client/src/pages/Teacher/ManageRoom/ManageRoom.tsx index 4ae31ac..5d475d0 100644 --- a/client/src/pages/Teacher/ManageRoom/ManageRoom.tsx +++ b/client/src/pages/Teacher/ManageRoom/ManageRoom.tsx @@ -83,7 +83,6 @@ const ManageRoom: React.FC = () => { setConnectingError(''); const socket = webSocketService.connect(ENV_VARIABLES.VITE_BACKEND_URL); - console.log(socket); socket.on('connect', () => { webSocketService.createRoom(); }); @@ -105,7 +104,6 @@ const ManageRoom: React.FC = () => { }); socket.on('user-disconnected', (userId: string) => { setUsers((prevUsers) => prevUsers.filter((user) => user.id !== userId)); - console.log(userId); }); setSocket(socket); }; @@ -201,7 +199,7 @@ const ManageRoom: React.FC = () => { const showSelectedQuestion = (questionIndex: number) => { if (quiz?.content && quizQuestions) { setCurrentQuestion(quizQuestions[questionIndex]); - console.log(quizQuestions[questionIndex]); + if (quizMode === 'teacher') { webSocketService.nextQuestion(roomName, quizQuestions[questionIndex]); }