Files
encoach_ui_odoo19/src/utils/moduleUtils.ts
Tiago Ribeiro 79a532b5ff - Implemented an image attachment to the Writing exercise;
- Made it so the exams are now sorted when going through the history;
- Corrected some little mistakes;
2023-05-28 10:00:06 +01:00

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);
};