Started to update the exam to work with Zustand for the history review

This commit is contained in:
Tiago Ribeiro
2023-05-08 10:44:16 +01:00
parent 4b5c99c654
commit 1813de499d
6 changed files with 88 additions and 8 deletions

View File

@@ -91,5 +91,10 @@ export const formatExerciseAverageScoreStats = (stats: Stat[]): {label: string;
});
};
export const getExamsBySession = (stats: Stat[], session: string) => {
const grouped = groupBySession(stats);
return grouped[session].map((exam) => exam.exam);
};
export const groupBySession = (stats: Stat[]) => groupBy(stats, "session");
export const groupByDate = (stats: Stat[]) => groupBy(stats, "date");