[+] Move level detection to server side
This commit is contained in:
+6
-8
@@ -158,6 +158,7 @@ export interface Grading
|
|||||||
export default class Course
|
export default class Course
|
||||||
{
|
{
|
||||||
id: number;
|
id: number;
|
||||||
|
id_ci: number;
|
||||||
assignmentsId: number;
|
assignmentsId: number;
|
||||||
name: string;
|
name: string;
|
||||||
teacherName: string;
|
teacherName: string;
|
||||||
@@ -183,6 +184,7 @@ export default class Course
|
|||||||
constructor(courseJson: any)
|
constructor(courseJson: any)
|
||||||
{
|
{
|
||||||
this.id = courseJson.id;
|
this.id = courseJson.id;
|
||||||
|
this.id_ci = courseJson.id_ci;
|
||||||
this.assignmentsId = courseJson.assignmentsId;
|
this.assignmentsId = courseJson.assignmentsId;
|
||||||
this.name = FormatUtils.parseText(courseJson.name).trim();
|
this.name = FormatUtils.parseText(courseJson.name).trim();
|
||||||
this.teacherName = courseJson.teacherName;
|
this.teacherName = courseJson.teacherName;
|
||||||
@@ -198,14 +200,10 @@ export default class Course
|
|||||||
this.rawLetterGrade = undefined;
|
this.rawLetterGrade = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Level and scaleUp
|
// Level and scaleUp TODO: Use server course level
|
||||||
let level = CourseUtils.detectLevel(this.name);
|
let level = CourseUtils.getLevel(courseJson.level);
|
||||||
if (level != undefined)
|
this.level = level.level;
|
||||||
{
|
this.scaleUp = level.scaleUp;
|
||||||
this.level = level.level;
|
|
||||||
this.scaleUp = level.scaleUp;
|
|
||||||
}
|
|
||||||
else this.level = 'Unknown';
|
|
||||||
|
|
||||||
this.termGrading = new Array(4).fill(null);
|
this.termGrading = new Array(4).fill(null);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user