@@ -112,146 +56,13 @@ const LiveResults: React.FC = ({ questions, showSelectedQuesti
-
-
-
-
-
- Nom d'utilisateur
-
- {Array.from({ length: maxQuestions }, (_, index) => (
- showSelectedQuestion(index)}
- >
- {`Q${index + 1}`}
-
- ))}
-
- % réussite
-
-
-
-
- {students.map((student) => (
-
-
-
- {showUsernames ? student.name : '******'}
-
-
- {Array.from({ length: maxQuestions }, (_, index) => {
- const answer = student.answers.find(
- (answer) => parseInt(answer.idQuestion.toString()) === index + 1
- );
- const answerText = answer ? answer.answer.toString() : '';
- const isCorrect = answer ? answer.isCorrect : false;
-
- return (
-
- {showCorrectAnswers ? (
-
- ) : isCorrect ? (
-
- ) : (
- answerText !== '' && (
-
- )
- )}
-
- );
- })}
-
- {getStudentGrade(student).toFixed()} %
-
-
- ))}
-
-
-
-
- % réussite
-
- {Array.from({ length: maxQuestions }, (_, index) => (
-
- {students.length > 0
- ? `${getCorrectAnswersPerQuestion(index).toFixed()} %`
- : '-'}
-
- ))}
-
- {students.length > 0 ? `${classAverage.toFixed()} %` : '-'}
-
-
-
-
-
+
);
diff --git a/client/src/components/LiveResults/LiveResultsTable/LiveResultsTable.tsx b/client/src/components/LiveResults/LiveResultsTable/LiveResultsTable.tsx
new file mode 100644
index 0000000..e23c4a6
--- /dev/null
+++ b/client/src/components/LiveResults/LiveResultsTable/LiveResultsTable.tsx
@@ -0,0 +1,75 @@
+import React from 'react';
+import { Paper, Table, TableContainer } from '@mui/material';
+import { StudentType } from 'src/Types/StudentType';
+import { QuestionType } from '../../../Types/QuestionType';
+import LiveResultsTableFooter from './TableComponents/LiveResultTableFooter';
+import LiveResultsTableHeader from './TableComponents/LiveResultsTableHeader';
+import LiveResultsTableBody from './TableComponents/LiveResultsTableBody';
+
+interface LiveResultsTableProps {
+ students: StudentType[];
+ questions: QuestionType[];
+ showCorrectAnswers: boolean;
+ showSelectedQuestion: (index: number) => void;
+ showUsernames: boolean;
+}
+
+const LiveResultsTable: React.FC