diff --git a/client/src/components/Questions/MultipleChoiceQuestion/MultipleChoiceQuestion.tsx b/client/src/components/Questions/MultipleChoiceQuestion/MultipleChoiceQuestion.tsx index 32f451a..9c18605 100644 --- a/client/src/components/Questions/MultipleChoiceQuestion/MultipleChoiceQuestion.tsx +++ b/client/src/components/Questions/MultipleChoiceQuestion/MultipleChoiceQuestion.tsx @@ -23,7 +23,7 @@ interface Props { } const MultipleChoiceQuestion: React.FC = (props) => { - + const { questionStem: questionContent, choices, showAnswer, handleOnSubmitAnswer, globalFeedback } = props; const [answer, setAnswer] = useState(); diff --git a/client/src/pages/Teacher/ManageRoom/ManageRoom.tsx b/client/src/pages/Teacher/ManageRoom/ManageRoom.tsx index 7f1d744..9bf2000 100644 --- a/client/src/pages/Teacher/ManageRoom/ManageRoom.tsx +++ b/client/src/pages/Teacher/ManageRoom/ManageRoom.tsx @@ -261,16 +261,15 @@ const ManageRoom: React.FC = () => { webSocketService.nextQuestion(roomName, quizQuestions[nextQuestionIndex]); }; - // const previousQuestion = () => { - // if (!quizQuestions || !currentQuestion || !quiz?.content) return; + const previousQuestion = () => { + if (!quizQuestions || !currentQuestion || !quiz?.content) return; - // const prevQuestionIndex = Number(currentQuestion?.question.id) - 2; // -2 because question.id starts at index 1 + 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]); - // }; + if (prevQuestionIndex === undefined || prevQuestionIndex < 0) return; + setCurrentQuestion(quizQuestions[prevQuestionIndex]); + webSocketService.nextQuestion(roomName, quizQuestions[prevQuestionIndex]); + }; const initializeQuizQuestion = () => { const quizQuestionArray = quiz?.content; @@ -493,13 +492,23 @@ const ManageRoom: React.FC = () => { {quizMode === 'teacher' && ( +
+
+ +
-
- - )} +
)}