Able to check submission

This commit is contained in:
nemunaire 2016-01-15 12:57:35 +01:00
parent a9f35d224b
commit e3f7cce80a
4 changed files with 51 additions and 3 deletions

View file

@ -67,3 +67,12 @@ func (t Team) Delete() (int64, error) {
return nb, err
}
}
func (t Team) HasSolved(e Exercice) bool {
var nb int
if err := DBQueryRow("SELECT COUNT(id_exercice) FROM exercice_solved WHERE id_team = ? AND id_exercice = ?", t.Id, e.Id).Scan(&nb); err != nil {
return false
} else {
return nb > 0
}
}