Skip to content

Commit 91a7e03

Browse files
committed
Fix #9 computedGrade
The grade of any module that has no exam or is currently being worked on was falsely shown as failed. This fixes that behaviour.
1 parent e1b230f commit 91a7e03

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

iOSSC/Model/Module.swift

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,8 @@ struct Module: Decodable, Identifiable, Hashable {
2424
}?.grade
2525
}
2626

27-
/**
28-
If the module has no grade assigned to it.
29-
The grade of the first passed exam is getting returned.
30-
*/
3127
var computedGrade: Grade? {
32-
let failed = attempts.exams != 0
33-
return examGrade ?? grade ?? (failed ? 5.0 : nil)
28+
return examGrade ?? grade
3429
}
3530

3631
static func == (lhs: Module, rhs: Module) -> Bool {

0 commit comments

Comments
 (0)