- Made it so the exams are now sorted when going through the history; - Corrected some little mistakes;
15 lines
452 B
TypeScript
15 lines
452 B
TypeScript
import {Module} from "@/interfaces";
|
|
|
|
const MODULE_ARRAY: Module[] = ["reading", "listening", "writing", "speaking"];
|
|
|
|
export const moduleLabels: {[key in Module]: string} = {
|
|
listening: "Listening",
|
|
reading: "Reading",
|
|
speaking: "Speaking",
|
|
writing: "Writing",
|
|
};
|
|
|
|
export const sortByModule = (a: {module: Module}, b: {module: Module}) => {
|
|
return MODULE_ARRAY.findIndex((x) => a.module === x) - MODULE_ARRAY.findIndex((x) => b.module === x);
|
|
};
|