From 9cc152d6bcdb80cbd2d2ca2afc78354d29c1f463 Mon Sep 17 00:00:00 2001 From: louis-antoine-etsmtl <61054719+louis-antoine-etsmtl@users.noreply.github.com> Date: Tue, 9 Apr 2024 10:10:17 -0400 Subject: [PATCH 1/5] Update ManageRoom.tsx --- client/src/pages/Teacher/ManageRoom/ManageRoom.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/client/src/pages/Teacher/ManageRoom/ManageRoom.tsx b/client/src/pages/Teacher/ManageRoom/ManageRoom.tsx index 5d475d0..2155911 100644 --- a/client/src/pages/Teacher/ManageRoom/ManageRoom.tsx +++ b/client/src/pages/Teacher/ManageRoom/ManageRoom.tsx @@ -96,8 +96,16 @@ const ManageRoom: React.FC = () => { socket.on('create-failure', () => { console.log('Error creating room.'); }); - - + socket.on('user-joined', (user: UserType) => { + + setUsers((prevUsers) => [...prevUsers, user]); + + if (quizMode === 'teacher') { + webSocketService.nextQuestion(roomName, currentQuestion); + } else if (quizMode === 'student') { + webSocketService.launchStudentModeQuiz(roomName, quizQuestions); + } + }); socket.on('join-failure', (message) => { setConnectingError(message); setSocket(null); From ef0607aceb71f02fcabce946d2914caca675c992 Mon Sep 17 00:00:00 2001 From: louis-antoine-etsmtl Date: Tue, 9 Apr 2024 10:28:06 -0400 Subject: [PATCH 2/5] fix build issue --- .../MultipleChoiceQuestion/MultipleChoiceQuestion.test.tsx | 3 +-- .../Questions/NumericalQuestion/NumericalQuestion.test.tsx | 2 +- .../Questions/ShortAnswerQuestion/ShortAnswerQuestion.test.tsx | 2 +- .../Questions/TrueFalseQuestion/TrueFalseQuestion.test.tsx | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/client/src/__tests__/components/Questions/MultipleChoiceQuestion/MultipleChoiceQuestion.test.tsx b/client/src/__tests__/components/Questions/MultipleChoiceQuestion/MultipleChoiceQuestion.test.tsx index cf4a1fe..d0cc87e 100644 --- a/client/src/__tests__/components/Questions/MultipleChoiceQuestion/MultipleChoiceQuestion.test.tsx +++ b/client/src/__tests__/components/Questions/MultipleChoiceQuestion/MultipleChoiceQuestion.test.tsx @@ -15,8 +15,7 @@ describe('MultipleChoiceQuestion', () => { globalFeedback="feedback" questionTitle="Test Question" choices={choices} - handleOnSubmitAnswer={mockHandleOnSubmitAnswer} - /> + handleOnSubmitAnswer={mockHandleOnSubmitAnswer} questionContent={''} /> ); }); diff --git a/client/src/__tests__/components/Questions/NumericalQuestion/NumericalQuestion.test.tsx b/client/src/__tests__/components/Questions/NumericalQuestion/NumericalQuestion.test.tsx index 37f0daa..65f1548 100644 --- a/client/src/__tests__/components/Questions/NumericalQuestion/NumericalQuestion.test.tsx +++ b/client/src/__tests__/components/Questions/NumericalQuestion/NumericalQuestion.test.tsx @@ -18,7 +18,7 @@ describe('NumericalQuestion Component', () => { }; beforeEach(() => { - render(); + render(); }); it('renders correctly', () => { diff --git a/client/src/__tests__/components/Questions/ShortAnswerQuestion/ShortAnswerQuestion.test.tsx b/client/src/__tests__/components/Questions/ShortAnswerQuestion/ShortAnswerQuestion.test.tsx index 3af7798..a1774fc 100644 --- a/client/src/__tests__/components/Questions/ShortAnswerQuestion/ShortAnswerQuestion.test.tsx +++ b/client/src/__tests__/components/Questions/ShortAnswerQuestion/ShortAnswerQuestion.test.tsx @@ -34,7 +34,7 @@ describe('ShortAnswerQuestion Component', () => { }; beforeEach(() => { - render(); + render(); }); it('renders correctly', () => { diff --git a/client/src/__tests__/components/Questions/TrueFalseQuestion/TrueFalseQuestion.test.tsx b/client/src/__tests__/components/Questions/TrueFalseQuestion/TrueFalseQuestion.test.tsx index 2a0b85e..7bf2010 100644 --- a/client/src/__tests__/components/Questions/TrueFalseQuestion/TrueFalseQuestion.test.tsx +++ b/client/src/__tests__/components/Questions/TrueFalseQuestion/TrueFalseQuestion.test.tsx @@ -14,7 +14,7 @@ describe('TrueFalseQuestion Component', () => { }; beforeEach(() => { - render(); + render(); }); it('renders correctly', () => { From 8048a271b1d2a12234c82caee5c4961566fd5f0c Mon Sep 17 00:00:00 2001 From: louis-antoine-etsmtl <61054719+louis-antoine-etsmtl@users.noreply.github.com> Date: Tue, 9 Apr 2024 10:31:15 -0400 Subject: [PATCH 3/5] add restart statement to docker compose I forgot to add this, the container do not restart after maintenance --- docker-compose.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index f69d9df..ae51a8e 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -7,6 +7,7 @@ services: container_name: frontend ports: - "5173:5173" + restart: always backend: image: evaluetonsavoir/evaluetonsavoir-backend:latest @@ -24,6 +25,7 @@ services: FRONTEND_URL: "http://localhost:5173" depends_on: - mongo + restart: always # Ce conteneur sert de routeur pour assurer le bon fonctionnement de l'application nginx: @@ -34,6 +36,7 @@ services: depends_on: - backend - frontend + restart: always # Ce conteneur est la base de données principale pour l'application mongo: @@ -44,7 +47,7 @@ services: tty: true volumes: - mongodb_data:/data/db - restart: unless-stopped + restart: always # Ce conteneur assure que l'application est à jour en allant chercher s'il y a des mises à jours à chaque heure watchtower: @@ -58,7 +61,7 @@ services: - WATCHTOWER_DEBUG=true - WATCHTOWER_INCLUDE_RESTARTING=true - WATCHTOWER_POLL_INTERVAL=7200 # every hour - restart: unless-stopped + restart: always volumes: mongodb_data: From b95e2f42424dd5dd83218420e608bd5ea5e67cf3 Mon Sep 17 00:00:00 2001 From: louis-antoine-etsmtl <61054719+louis-antoine-etsmtl@users.noreply.github.com> Date: Tue, 9 Apr 2024 12:50:49 -0400 Subject: [PATCH 4/5] Proposed edit in update schedule every day at 5am --- docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index ae51a8e..b9588f0 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -60,7 +60,7 @@ services: - WATCHTOWER_CLEANUP=true - WATCHTOWER_DEBUG=true - WATCHTOWER_INCLUDE_RESTARTING=true - - WATCHTOWER_POLL_INTERVAL=7200 # every hour + - WATCHTOWER_SCHEDULE=0 0 5 * * * # At 5 am everyday restart: always volumes: From f63d1981a4e0bb29f914e84dac9a72bb2ca9e86d Mon Sep 17 00:00:00 2001 From: louis-antoine-etsmtl <61054719+louis-antoine-etsmtl@users.noreply.github.com> Date: Thu, 11 Apr 2024 15:22:26 -0400 Subject: [PATCH 5/5] ajout badge cicd --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index ae7013a..1da73d1 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +[![CI/CD Pipeline for Frontend](https://github.com/louis-antoine-etsmtl/EvalueTonSavoir/actions/workflows/frontend-deploy.yml/badge.svg)](https://github.com/louis-antoine-etsmtl/EvalueTonSavoir/actions/workflows/frontend-deploy.yml) +[![CI/CD Pipeline for Backend](https://github.com/louis-antoine-etsmtl/EvalueTonSavoir/actions/workflows/backend-deploy.yml/badge.svg)](https://github.com/louis-antoine-etsmtl/EvalueTonSavoir/actions/workflows/backend-deploy.yml) +[![CI/CD Pipeline for Nginx Router](https://github.com/louis-antoine-etsmtl/EvalueTonSavoir/actions/workflows/deploy.yml/badge.svg)](https://github.com/louis-antoine-etsmtl/EvalueTonSavoir/actions/workflows/deploy.yml) + # EvalueTonSavoir EvalueTonSavoir est une plateforme open source et auto-hébergée qui poursuit le développement du code provenant de https://github.com/ETS-PFE004-Plateforme-sondage-minitest. Cette plateforme minimaliste est conçue comme un outil d'apprentissage et d'enseignement, offrant une solution simple et efficace pour la création de quiz utilisant le format GIFT, similaire à Moodle.