Skip to content

Commit

Permalink
[App crash] fix(grades): if no coefficient is returned, set to 1 (#699)
Browse files Browse the repository at this point in the history
  • Loading branch information
ecnivtwelve authored Jan 28, 2025
2 parents 4dfed80 + ed24c75 commit 7471551
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/services/ecoledirecte/grades.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export const getGradesAndAverages = async (
isOptional: g.isOptional,

outOf: getGradeValue(g.outOf),
coefficient: g.coefficient,
coefficient: g.coefficient ?? 1,

student: decodeGradeValue(g.value),
average: decodeGradeValue(g.average),
Expand Down
2 changes: 1 addition & 1 deletion src/services/pronote/grades.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const getGradesAndAverages = async (
isOptional: g.isOptional,

outOf: decodeGradeValue(g.outOf),
coefficient: g.coefficient,
coefficient: g.coefficient ?? 1,

student: decodeGradeValue(g.value),
average: decodeGradeValue(g.average),
Expand Down
2 changes: 1 addition & 1 deletion src/services/skolengo/data/grades.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const getGradesAndAverages = async (account: SkolengoAccount, periodName:
isOptional: false,

outOf: decodeGradeNumber(g.scale),
coefficient: g.coefficient || 1,
coefficient: g.coefficient ?? 1,

student: decodeGradeNumber(g.evaluationResult.mark),
average: decodeGradeNumber(g.average),
Expand Down

0 comments on commit 7471551

Please sign in to comment.