From a290a3d93ec58b4ec78fd90b343edb77ee864f5e Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Sat, 6 Jun 2020 13:37:30 -0400 Subject: [PATCH] [F] Fix final assignment compatibility --- src/logic/course.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/logic/course.ts b/src/logic/course.ts index d20ce13..7daf1a4 100644 --- a/src/logic/course.ts +++ b/src/logic/course.ts @@ -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));