Skip to content

Commit

Permalink
Fix hidden assignment warning always showing in hypothetical mode on …
Browse files Browse the repository at this point in the history
…classes with no categories
  • Loading branch information
PurelyAnecdotal authored Jan 23, 2024
1 parent 9f4907c commit 859c9b9
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/routes/(authed)/grades/[index]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,15 @@
let rawGradeCalcMatches = true;
$: {
let pointsByCategory: { [categoryName: string]: [number, number] } = {};
let totalPointsEarned = 0;
let totalPointsPossible = 0;
assignments?.forEach((assignment) => {
if ($hypotheticalGradebook[assignment._GradebookID].notForGrade == true) return;
totalPointsEarned += extractPoints(assignment._Points)[0];
totalPointsPossible += extractPoints(assignment._Points)[1];
const points = pointsByCategory[assignment._Type] ?? [0, 0];
const hypotheticalPoints = [
$hypotheticalGradebook[assignment._GradebookID].pointsEarned,
Expand All @@ -140,16 +145,6 @@
});
if (!gradeCategories && course) {
let totalPointsEarned = 0;
let totalPointsPossible = 0;
Object.entries(pointsByCategory).forEach(
([_categoryName, [pointsEarned, pointsPossible]]) => {
totalPointsEarned += pointsEarned;
totalPointsPossible += pointsPossible;
}
);
let rawGrade = (totalPointsEarned / totalPointsPossible) * 100;
if (isNaN(rawGrade)) rawGrade = 0;
let synergyGrade = parseFloat(course.Marks.Mark._CalculatedScoreRaw);
Expand Down

0 comments on commit 859c9b9

Please sign in to comment.