Added more control over the stats appearing in the stats page

This commit is contained in:
Tiago Ribeiro
2023-12-18 22:42:14 +00:00
parent c37bb2691b
commit 438778a03c
3 changed files with 225 additions and 128 deletions

View File

@@ -1,7 +1,7 @@
import {Module} from "@/interfaces";
import {Exercise} from "@/interfaces/exam";
export const MODULE_ARRAY: Module[] = ["reading", "listening", "writing", "speaking"];
export const MODULE_ARRAY: Module[] = ["reading", "listening", "writing", "speaking", "level"];
export const moduleLabels: {[key in Module]: string} = {
listening: "Listening",
@@ -11,7 +11,7 @@ export const moduleLabels: {[key in Module]: string} = {
level: "Level",
};
export const sortByModule = (a: {module: Module}, b: {module: Module}) => {
export const sortByModule = (a: {module: Module; [key: string]: any}, b: {module: Module; [key: string]: any}) => {
return MODULE_ARRAY.findIndex((x) => a.module === x) - MODULE_ARRAY.findIndex((x) => b.module === x);
};