Multiple hints

This commit is contained in:
nemunaire 2016-12-04 19:15:39 +01:00
commit 25bf34e82c
9 changed files with 217 additions and 35 deletions

View file

@ -210,6 +210,12 @@ func GetTries(t *Team, e *Exercice) ([]time.Time, error) {
}
}
func (t Team) HasHint(h EHint) (bool) {
var tm *time.Time
DBQueryRow("SELECT MIN(time) FROM team_hints WHERE id_team = ? AND id_hint = ?", t.Id, h.Id).Scan(&tm)
return tm != nil
}
func (t Team) HasSolved(e Exercice) (bool, time.Time, int64) {
var nb *int64
var tm *time.Time