[+] Include percent score in AssignmentType

This commit is contained in:
Hykilpikonna
2019-11-09 21:34:28 -05:00
parent 4e14730db6
commit ceca351b07
+3 -1
View File
@@ -35,6 +35,7 @@ export interface AssignmentType
weight: number
scoreMax: number
score: number
percent: number
}
export default class Course
@@ -255,7 +256,8 @@ export default class Course
? this.grading.weightingMap[type] : scoreMax / totalScoreMax;
// Return
return {name: type, id: typeAssignments[0].typeId, weight: weight, scoreMax: scoreMax, score: score}
return {name: type, id: typeAssignments[0].typeId, weight: weight,
scoreMax: scoreMax, score: score, percent: +(score / scoreMax * 100).toFixed(2)}
})
}