Fix undefined variable errr

This commit is contained in:
nemunaire 2022-09-20 00:28:44 +02:00
commit 632f476092
2 changed files with 4 additions and 4 deletions

View file

@ -302,7 +302,7 @@ func (s Survey) GetScore(u *User) (score *float64, err error) {
}
func (s Survey) GetScores() (scores map[int64]*float64, err error) {
if rows, errr := DBQuery("SELECT id_user, SUM(score)/COUNT(*) FROM student_scores WHERE id_survey=? GROUP BY id_user", s.Id); err != nil {
if rows, errr := DBQuery("SELECT id_user, SUM(score)/COUNT(*) FROM student_scores WHERE id_survey=? GROUP BY id_user", s.Id); errr != nil {
return nil, errr
} else {
defer rows.Close()