[BUG] Dans un quiz au rythme de l'étudiant, l'enseignant ne peut plus masquer les questions

Fixes #295
This commit is contained in:
JubaAzul 2025-03-19 14:18:31 -04:00
parent e4ae70896a
commit 206895ebb5

View file

@ -23,7 +23,7 @@ import DisconnectButton from 'src/components/DisconnectButton/DisconnectButton';
import QuestionDisplay from 'src/components/QuestionsDisplay/QuestionDisplay'; import QuestionDisplay from 'src/components/QuestionsDisplay/QuestionDisplay';
import ApiService from '../../../services/ApiService'; import ApiService from '../../../services/ApiService';
import { QuestionType } from 'src/Types/QuestionType'; import { QuestionType } from 'src/Types/QuestionType';
import { Button } from '@mui/material'; import { Button, FormControlLabel, Switch } from '@mui/material';
import { AnswerType } from 'src/pages/Student/JoinRoom/JoinRoom'; import { AnswerType } from 'src/pages/Student/JoinRoom/JoinRoom';
const ManageRoom: React.FC = () => { const ManageRoom: React.FC = () => {
@ -471,19 +471,24 @@ const ManageRoom: React.FC = () => {
<div className=""> <div className="">
{quizQuestions ? ( {quizQuestions ? (
<div style={{ display: 'flex', flexDirection: 'column' }}> <div style={{ display: 'flex', flexDirection: 'column' }}>
<div className="title center-h-align mb-2">{quiz?.title}</div> <div className="title center-h-align mb-2">{quiz?.title}</div>
{(quizMode === 'student' && isQuestionShown) && (
<div className='close-button-wrapper'> <div className='close-button-wrapper'>
<Button <FormControlLabel
className="close-button" label={<div className="text-sm">Afficher les questions</div>}
onClick={() => { control={
setIsQuestionShown(false); <Switch
}} > value={isQuestionShown}
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
</Button> setIsQuestionShown(e.target.checked)
}
/>
}
/>
</div> </div>
)}
{!isNaN(Number(currentQuestion?.question.id)) {!isNaN(Number(currentQuestion?.question.id))
&& isQuestionShown && ( && isQuestionShown && (
<strong className="number of questions"> <strong className="number of questions">