diff --git a/src/pages/stats.tsx b/src/pages/stats.tsx index 3acce51b..e5172ddf 100644 --- a/src/pages/stats.tsx +++ b/src/pages/stats.tsx @@ -168,118 +168,127 @@ export default function Stats() { -
-
- {/* Exams per module */} -
- Exams per Module -
-
-
- - {totalExamsByModule(stats, "reading")} of{" "} - {Object.keys(groupBySession(stats)).length} - - Reading + {stats.length > 0 && ( +
+
+ {/* Exams per module */} +
+ Exams per Module +
+
+
+ + {totalExamsByModule(stats, "reading")} of{" "} + {Object.keys(groupBySession(stats)).length} + + Reading +
+
- -
-
-
- - {totalExamsByModule(stats, "listening")} of{" "} - {Object.keys(groupBySession(stats)).length} - - Listening +
+
+ + {totalExamsByModule(stats, "listening")} of{" "} + {Object.keys(groupBySession(stats)).length} + + Listening +
+
- -
-
-
- - {totalExamsByModule(stats, "writing")} of{" "} - {Object.keys(groupBySession(stats)).length} - - Writing +
+
+ + {totalExamsByModule(stats, "writing")} of{" "} + {Object.keys(groupBySession(stats)).length} + + Writing +
+
- -
-
-
- - {totalExamsByModule(stats, "speaking")} of{" "} - {Object.keys(groupBySession(stats)).length} - - Speaking +
+
+ + {totalExamsByModule(stats, "speaking")} of{" "} + {Object.keys(groupBySession(stats)).length} + + Speaking +
+
-
-
-
- Total Score Band per Session - index), - datasets: [ - { - type: "line", - label: "Total", - fill: false, - borderColor: "#6A5FB1", - backgroundColor: "#7872BF", - borderWidth: 2, - spanGaps: true, - data: calculateTotalScorePerSession(), - }, - ], - }} - /> -
+
+ Total Score Band per Session + index), + datasets: [ + { + type: "line", + label: "Total", + fill: false, + borderColor: "#6A5FB1", + backgroundColor: "#7872BF", + borderWidth: 2, + spanGaps: true, + data: calculateTotalScorePerSession(), + }, + ], + }} + /> +
-
- Module Score Band per Session - index), - datasets: [ - ...MODULE_ARRAY.map((module, index) => ({ - type: "line" as const, - label: capitalize(module), - borderColor: COLORS[index], - backgroundColor: COLORS[index], - borderWidth: 2, - data: calculateModularScorePerSession(module), - })), - ], - }} - /> +
+ Module Score Band per Session + index), + datasets: [ + ...MODULE_ARRAY.map((module, index) => ({ + type: "line" as const, + label: capitalize(module), + borderColor: COLORS[index], + backgroundColor: COLORS[index], + borderWidth: 2, + data: calculateModularScorePerSession(module), + })), + ], + }} + /> +
-
-
+
+ )} + {stats.length === 0 && ( +
+ No stats to display... +
+ )} )}