[F] Fix final assignment compatibility

This commit is contained in:
Hykilpikonna
2020-06-06 13:37:30 -04:00
parent 4fe83d732a
commit a290a3d93e
+4 -2
View File
@@ -55,7 +55,9 @@ export class Assignment
this.scoreMax = json.maximum_score;
this.score = +json.raw_score;
this.gradingPeriod = +json.grading_period.replace('Quarter ', '') - 1;
// 0, 1, 2, 3 contains quarter assignments, 4 contains final assignments
if (json.grading_period.toLowerCase() == 'all') this.gradingPeriod = 4;
else this.gradingPeriod = +json.grading_period.replace('Quarter ', '') - 1;
}
/**
@@ -228,7 +230,7 @@ export default class Course
this.rawAssignments.sort((a, b) => b.time - a.time);
// Filter assignments into terms
this.termAssignments = [[], [], [], []];
this.termAssignments = [[], [], [], [], []];
// Loop through it by time order
this.rawAssignments.forEach(a => this.termAssignments[a.gradingPeriod].push(a));