Save MCQ diff
This commit is contained in:
parent
b079f7891c
commit
830dacd6f5
5 changed files with 28 additions and 2 deletions
|
|
@ -146,6 +146,15 @@ func (t Team) CountTries(e Exercice) (int64, time.Time) {
|
|||
}
|
||||
}
|
||||
|
||||
func (t Team) LastTryDist(e Exercice) int64 {
|
||||
var nb *int64
|
||||
if DBQueryRow("SELECT nbdiff FROM exercice_tries WHERE id_team = ? AND id_exercice = ? ORDER BY time DESC LIMIT 1", t.Id, e.Id).Scan(&nb); nb == nil {
|
||||
return 0
|
||||
} else {
|
||||
return *nb
|
||||
}
|
||||
}
|
||||
|
||||
func (t Team) HasSolved(e Exercice) (bool, time.Time, int64) {
|
||||
var nb *int64
|
||||
var tm *time.Time
|
||||
|
|
|
|||
Reference in a new issue