Filter ungraded colles to avoid unexecepted behaviors
This commit is contained in:
parent
796c568834
commit
bf8c8d2e8a
1 changed files with 2 additions and 0 deletions
|
|
@ -44,6 +44,7 @@ export class GradeService {
|
||||||
.where('studentId', userId)
|
.where('studentId', userId)
|
||||||
.where('date', '>=', startDate.toJSDate())
|
.where('date', '>=', startDate.toJSDate())
|
||||||
.where('date', '<', endDate.toJSDate())
|
.where('date', '<', endDate.toJSDate())
|
||||||
|
.whereNotNull('garde')
|
||||||
.preload('subject')
|
.preload('subject')
|
||||||
.orderBy('date', 'asc')
|
.orderBy('date', 'asc')
|
||||||
}
|
}
|
||||||
|
|
@ -53,6 +54,7 @@ export class GradeService {
|
||||||
.where('studentId', userId)
|
.where('studentId', userId)
|
||||||
.where('subjectId', subjectId)
|
.where('subjectId', subjectId)
|
||||||
.where('date', '<', beforeDate.toJSDate())
|
.where('date', '<', beforeDate.toJSDate())
|
||||||
|
.whereNotNull('garde')
|
||||||
return colles.length ? this.calculateAverage(colles) : 0
|
return colles.length ? this.calculateAverage(colles) : 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue