Able to check submission
This commit is contained in:
parent
a9f35d224b
commit
e3f7cce80a
4 changed files with 51 additions and 3 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue