Revert "[U] Update usage"

This reverts commit dc3365b594.
This commit is contained in:
Hykilpikonna
2019-12-06 18:18:38 -05:00
parent d0519bbab4
commit 3c632c0488
+6 -5
View File
@@ -4,7 +4,6 @@ import {CourseUtils} from '@/logic/utils/course-utils';
import Navigation from '@/components/navigation/navigation';
import {GPAUtils} from '@/logic/utils/gpa-utils';
import CacheUtils from '@/logic/utils/cache-utils';
import cache from '@/logic/utils/cache-utils';
/**
* Objects of this interface represent assignment grades.
@@ -68,6 +67,8 @@ export default class Course
allYearGrade: number
};
cache: CacheUtils = new CacheUtils();
/**
* Construct a course with a course json object
*
@@ -171,7 +172,7 @@ export default class Course
*/
get assignments(): Assignment[]
{
return cache('Assignments', () =>
return this.cache.get('Assignments', () =>
{
return this.rawSelectedAssignments.filter(a => a.complete == 'Complete');
});
@@ -182,7 +183,7 @@ export default class Course
*/
get letterGrade(): string
{
return cache('LetterGrade', () =>
return this.cache.get('LetterGrade', () =>
{
// Get scale
let scale = GPAUtils.findScale(this.numericGrade);
@@ -197,7 +198,7 @@ export default class Course
*/
get numericGrade(): number
{
return cache('NumericGrade', () =>
return this.cache.get('NumericGrade', () =>
{
// Calculate
if (this.grading.method == 'PERCENT_TYPE')
@@ -217,7 +218,7 @@ export default class Course
*/
get assignmentTypes(): AssignmentType[]
{
return cache('AssignmentTypes', () =>
return this.cache.get('AssignmentTypes', () =>
{
// Get all types
let types = this.assignments.map(a => a.type);