[U] Get numeric grade by term

This commit is contained in:
Hykilpikonna
2019-12-07 11:25:39 -05:00
parent 8846a8be5d
commit bf4479490f
+7 -5
View File
@@ -197,18 +197,20 @@ export default class Course
} }
/** /**
* Get numeric grade * Get numeric grade by term
*
* @param term
*/ */
get numericGrade(): number numericGrade(term: number): number
{ {
return this.cache.get('NumericGrade', () => return this.cache.get('NumericGrade' + term, () =>
{ {
// Calculate // Calculate
if (this.grading.method == 'PERCENT_TYPE') if (this.getGrading(term).method == 'PERCENT_TYPE')
{ {
return GPAUtils.getPercentTypeAverage(this, this.assignments); return GPAUtils.getPercentTypeAverage(this, this.assignments);
} }
else if (this.grading.method == 'TOTAL_MEAN') else if (this.getGrading(term).method == 'TOTAL_MEAN')
{ {
return GPAUtils.getTotalMeanAverage(this.assignments); return GPAUtils.getTotalMeanAverage(this.assignments);
} }