[+] Encapsulate getAllGradingPeriods()

This commit is contained in:
Hykilpikonna
2019-12-21 17:01:37 -05:00
parent e128704552
commit c0ec2e03ff
+11
View File
@@ -190,6 +190,17 @@ export default class Course
})
}
/**
* Get currently selected grading periods
*/
get allGradingPeriods(): number[]
{
return this.cache.get('AllGradingPeriods', () =>
{
return [0, 1, 2, 3].filter(term => this.termAssignments[term].filter(a => a.graded).length != 0);
})
}
/**
* Get assignments of the selected grading periods
*/