Added a new module called Level for level testing
This commit is contained in:
@@ -1,15 +1,5 @@
|
||||
import {Module} from "@/interfaces";
|
||||
import {
|
||||
Exam,
|
||||
ReadingExam,
|
||||
ListeningExam,
|
||||
WritingExam,
|
||||
SpeakingExam,
|
||||
Exercise,
|
||||
UserSolution,
|
||||
FillBlanksExercise,
|
||||
MatchSentencesExercise,
|
||||
} from "@/interfaces/exam";
|
||||
import {Exam, ReadingExam, ListeningExam, WritingExam, SpeakingExam, Exercise, UserSolution, LevelExam} from "@/interfaces/exam";
|
||||
import axios from "axios";
|
||||
|
||||
export const getExam = async (module: Module, avoidRepeated: boolean): Promise<Exam | undefined> => {
|
||||
@@ -29,6 +19,8 @@ export const getExam = async (module: Module, avoidRepeated: boolean): Promise<E
|
||||
return newExam.shift() as WritingExam;
|
||||
case "speaking":
|
||||
return newExam.shift() as SpeakingExam;
|
||||
case "level":
|
||||
return newExam.shift() as LevelExam;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -49,6 +41,8 @@ export const getExamById = async (module: Module, id: string): Promise<Exam | un
|
||||
return newExam as WritingExam;
|
||||
case "speaking":
|
||||
return newExam as SpeakingExam;
|
||||
case "level":
|
||||
return newExam as LevelExam;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ export const moduleLabels: {[key in Module]: string} = {
|
||||
reading: "Reading",
|
||||
speaking: "Speaking",
|
||||
writing: "Writing",
|
||||
level: "Level",
|
||||
};
|
||||
|
||||
export const sortByModule = (a: {module: Module}, b: {module: Module}) => {
|
||||
|
||||
@@ -93,6 +93,14 @@ const academicMarking: {[key: number]: number} = {
|
||||
10: 2.5,
|
||||
};
|
||||
|
||||
const levelMarking: {[key: number]: number} = {
|
||||
88: 9,
|
||||
64: 8,
|
||||
52: 6,
|
||||
32: 4,
|
||||
16: 2,
|
||||
};
|
||||
|
||||
const moduleMarkings: {[key in Module]: {[key in Type]: {[key: number]: number}}} = {
|
||||
reading: {
|
||||
academic: academicMarking,
|
||||
@@ -110,6 +118,10 @@ const moduleMarkings: {[key in Module]: {[key in Type]: {[key: number]: number}}
|
||||
academic: writingMarking,
|
||||
general: writingMarking,
|
||||
},
|
||||
level: {
|
||||
academic: levelMarking,
|
||||
general: levelMarking,
|
||||
},
|
||||
};
|
||||
|
||||
export const calculateBandScore = (correct: number, total: number, module: Module, type: Type) => {
|
||||
|
||||
Reference in New Issue
Block a user