diff --git a/client/src/__tests__/pages/Student/StudentModeQuiz/StudentModeQuiz.test.tsx b/client/src/__tests__/pages/Student/StudentModeQuiz/StudentModeQuiz.test.tsx index 379cf5e..85d4a7d 100644 --- a/client/src/__tests__/pages/Student/StudentModeQuiz/StudentModeQuiz.test.tsx +++ b/client/src/__tests__/pages/Student/StudentModeQuiz/StudentModeQuiz.test.tsx @@ -77,21 +77,5 @@ describe('StudentModeQuiz', () => { }); - test('navigates to the previous question', async () => { - - act(() => { - fireEvent.click(screen.getByText('Option A')); - }); - act(() => { - fireEvent.click(screen.getByText('Répondre')); - }); - act(() => { - fireEvent.click(screen.getByText('Question précédente')); - }); - - expect(screen.getByText('Sample Question 1')).toBeInTheDocument(); - expect(screen.getByText('Option B')).toBeInTheDocument(); - }); - }); diff --git a/client/src/components/Questions/MultipleChoiceQuestion/MultipleChoiceQuestion.tsx b/client/src/components/Questions/MultipleChoiceQuestion/MultipleChoiceQuestion.tsx index 4957d11..9c18605 100644 --- a/client/src/components/Questions/MultipleChoiceQuestion/MultipleChoiceQuestion.tsx +++ b/client/src/components/Questions/MultipleChoiceQuestion/MultipleChoiceQuestion.tsx @@ -23,6 +23,7 @@ interface Props { } const MultipleChoiceQuestion: React.FC = (props) => { + const { questionStem: questionContent, choices, showAnswer, handleOnSubmitAnswer, globalFeedback } = props; const [answer, setAnswer] = useState(); @@ -73,7 +74,9 @@ const MultipleChoiceQuestion: React.FC = (props) => { {globalFeedback && showAnswer && (
{globalFeedback}
)} + {!showAnswer && handleOnSubmitAnswer && ( + )} diff --git a/client/src/components/StudentModeQuiz/StudentModeQuiz.tsx b/client/src/components/StudentModeQuiz/StudentModeQuiz.tsx index 6b8db94..15d6fba 100644 --- a/client/src/components/StudentModeQuiz/StudentModeQuiz.tsx +++ b/client/src/components/StudentModeQuiz/StudentModeQuiz.tsx @@ -1,13 +1,12 @@ // StudentModeQuiz.tsx import React, { useEffect, useState } from 'react'; import QuestionComponent from '../Questions/Question'; - import '../../pages/Student/JoinRoom/joinRoom.css'; import { QuestionType } from '../../Types/QuestionType'; // import { QuestionService } from '../../services/QuestionService'; import { Button } from '@mui/material'; -import QuestionNavigation from '../QuestionNavigation/QuestionNavigation'; -import { ChevronLeft, ChevronRight } from '@mui/icons-material'; +//import QuestionNavigation from '../QuestionNavigation/QuestionNavigation'; +//import { ChevronLeft, ChevronRight } from '@mui/icons-material'; import DisconnectButton from 'src/components/DisconnectButton/DisconnectButton'; interface StudentModeQuizProps { @@ -25,10 +24,10 @@ const StudentModeQuiz: React.FC = ({ const [isAnswerSubmitted, setIsAnswerSubmitted] = useState(false); // const [imageUrl, setImageUrl] = useState(''); - const previousQuestion = () => { - setQuestion(questions[Number(questionInfos.question?.id) - 2]); - setIsAnswerSubmitted(false); - }; + // const previousQuestion = () => { + // setQuestion(questions[Number(questionInfos.question?.id) - 2]); + // setIsAnswerSubmitted(false); + // }; useEffect(() => {}, [questionInfos]); @@ -55,12 +54,12 @@ const StudentModeQuiz: React.FC = ({
- + /> */}
= ({ />
- + */}
-
-
+ ); }; diff --git a/client/src/pages/Teacher/ManageRoom/ManageRoom.tsx b/client/src/pages/Teacher/ManageRoom/ManageRoom.tsx index 30add4e..95e8464 100644 --- a/client/src/pages/Teacher/ManageRoom/ManageRoom.tsx +++ b/client/src/pages/Teacher/ManageRoom/ManageRoom.tsx @@ -17,7 +17,7 @@ import LoadingCircle from 'src/components/LoadingCircle/LoadingCircle'; import { Refresh, Error } from '@mui/icons-material'; import StudentWaitPage from 'src/components/StudentWaitPage/StudentWaitPage'; import DisconnectButton from 'src/components/DisconnectButton/DisconnectButton'; -import QuestionNavigation from 'src/components/QuestionNavigation/QuestionNavigation'; +//import QuestionNavigation from 'src/components/QuestionNavigation/QuestionNavigation'; import Question from 'src/components/Questions/Question'; import ApiService from '../../../services/ApiService'; @@ -267,7 +267,6 @@ const ManageRoom: React.FC = () => { const prevQuestionIndex = Number(currentQuestion?.question.id) - 2; // -2 because question.id starts at index 1 if (prevQuestionIndex === undefined || prevQuestionIndex < 0) return; - setCurrentQuestion(quizQuestions[prevQuestionIndex]); webSocketService.nextQuestion(roomName, quizQuestions[prevQuestionIndex]); }; @@ -461,12 +460,12 @@ const ManageRoom: React.FC = () => { {quizMode === 'teacher' && (
- + /> */}
)} @@ -493,12 +492,23 @@ const ManageRoom: React.FC = () => { {quizMode === 'teacher' && ( +
+
+ +
-
- )} +
)}