// LiveResults.tsx import React, { useState } from 'react'; import { Socket } from 'socket.io-client'; import { QuestionType } from '../../Types/QuestionType'; import './liveResult.css'; import { FormControlLabel, FormGroup, IconButton, Switch, } from '@mui/material'; import { StudentType } from '../../Types/StudentType'; import LiveResultsTable from './LiveResultsTable/LiveResultsTable'; import { ExpandLess, ExpandMore } from '@mui/icons-material'; interface LiveResultsProps { socket: Socket | null; questions: QuestionType[]; showSelectedQuestion: (index: number) => void; quizMode: 'teacher' | 'student'; students: StudentType[] } const LiveResults: React.FC = ({ questions, showSelectedQuestion, students }) => { const [showUsernames, setShowUsernames] = useState(false); const [showCorrectAnswers, setShowCorrectAnswers] = useState(false); const [isExpanded, setIsExpanded] = useState(true); const toggleExpand = () => { setIsExpanded(!isExpanded); }; return (
{isExpanded ? : } Résultats du quiz
{isExpanded && ( Afficher les noms
} control={ ) => setShowUsernames(e.target.checked) } /> } /> Afficher les réponses
} control={ ) => setShowCorrectAnswers(e.target.checked) } /> } /> )} {isExpanded && (
)} ); }; export default LiveResults;