[O] Encapsulate method to get graded assignments
This commit is contained in:
+9
-1
@@ -126,7 +126,7 @@ export default class Course
|
|||||||
if (this.level == 'None' || this.level == 'Unknown' || this.scaleUp == -1) return false;
|
if (this.level == 'None' || this.level == 'Unknown' || this.scaleUp == -1) return false;
|
||||||
|
|
||||||
// Skip courses without graded assignments
|
// Skip courses without graded assignments
|
||||||
if (this.assignments.filter(a => a.complete == 'Complete').length == 0) return false;
|
if (this.gradedAssignments.length == 0) return false;
|
||||||
|
|
||||||
// Skip if there are no grading scale
|
// Skip if there are no grading scale
|
||||||
// if (course.grading.method == 'NOT_GRADED') return;
|
// if (course.grading.method == 'NOT_GRADED') return;
|
||||||
@@ -152,6 +152,14 @@ export default class Course
|
|||||||
return this.computed.termAssignments[timeCode];
|
return this.computed.termAssignments[timeCode];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get graded assignments
|
||||||
|
*/
|
||||||
|
get gradedAssignments(): Assignment[]
|
||||||
|
{
|
||||||
|
return this.assignments.filter(a => a.complete == 'Complete');
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Optimize this
|
// TODO: Optimize this
|
||||||
private letterGradeComputed = false;
|
private letterGradeComputed = false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user