Implemented the speaking exercise;
Cleaned up a bit of the code;
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user