2025-01-11 02:22:14 -05:00
|
|
|
import React from 'react';
|
2024-03-29 20:08:34 -04:00
|
|
|
import {
|
|
|
|
|
Button,
|
|
|
|
|
Dialog,
|
|
|
|
|
DialogActions,
|
|
|
|
|
DialogContent,
|
|
|
|
|
DialogTitle,
|
|
|
|
|
FormControl,
|
|
|
|
|
FormControlLabel,
|
|
|
|
|
FormLabel,
|
|
|
|
|
Radio,
|
|
|
|
|
RadioGroup
|
|
|
|
|
} from '@mui/material';
|
|
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
|
open: boolean;
|
|
|
|
|
handleOnClose: () => void;
|
|
|
|
|
launchQuiz: () => void;
|
|
|
|
|
setQuizMode: (mode: 'teacher' | 'student') => void;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const LaunchQuizDialog: React.FC<Props> = ({ open, handleOnClose, launchQuiz, setQuizMode }) => {
|
|
|
|
|
return (
|
|
|
|
|
<Dialog open={open} onClose={handleOnClose}>
|
|
|
|
|
<DialogTitle sx={{ fontWeight: 'bold', fontSize: 24 }}>
|
|
|
|
|
Options de lancement du quiz
|
|
|
|
|
</DialogTitle>
|
|
|
|
|
<DialogContent>
|
|
|
|
|
<FormControl>
|
|
|
|
|
<FormLabel>Rythme du quiz</FormLabel>
|
|
|
|
|
<RadioGroup defaultValue="teacher" name="radio-buttons-group">
|
|
|
|
|
<FormControlLabel
|
|
|
|
|
value="teacher"
|
|
|
|
|
control={<Radio />}
|
|
|
|
|
label="Rythme du professeur"
|
|
|
|
|
onChange={() => setQuizMode('teacher')}
|
|
|
|
|
/>
|
|
|
|
|
<FormControlLabel
|
|
|
|
|
value="student"
|
|
|
|
|
control={<Radio />}
|
|
|
|
|
label="Rythme de l'étudiant"
|
|
|
|
|
onChange={() => setQuizMode('student')}
|
|
|
|
|
/>
|
|
|
|
|
</RadioGroup>
|
|
|
|
|
</FormControl>
|
|
|
|
|
</DialogContent>
|
|
|
|
|
|
|
|
|
|
<DialogActions>
|
|
|
|
|
<Button variant="outlined" onClick={handleOnClose}>
|
|
|
|
|
Annuler
|
|
|
|
|
</Button>
|
|
|
|
|
<Button variant="contained" onClick={launchQuiz}>
|
|
|
|
|
Lancer
|
|
|
|
|
</Button>
|
|
|
|
|
</DialogActions>
|
|
|
|
|
</Dialog>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default LaunchQuizDialog;
|