Implemented the speaking exercise;

Cleaned up a bit of the code;
This commit is contained in:
Tiago Ribeiro
2023-06-15 15:39:40 +01:00
parent f5ec910010
commit bc7eaea911
5 changed files with 208 additions and 68 deletions

View File

@@ -1,3 +1,5 @@
import {Module} from "@/interfaces";
type Type = "academic" | "general";
const readingGeneralMarking: {[key: number]: number} = {
@@ -59,3 +61,7 @@ export const calculateBandScore = (correct: number, total: number, module: "read
return 0;
};
export const calculateAverageLevel = (levels: {[key in Module]: number}) => {
return Object.keys(levels).reduce((accumulator, current) => levels[current as Module] + accumulator, 0) / 4;
};