Export themes.json

This commit is contained in:
nemunaire 2016-01-21 01:37:33 +01:00
parent 47610f0e2a
commit 5a8d2c36b7
2 changed files with 56 additions and 3 deletions

View file

@ -133,6 +133,15 @@ func (e Exercice) Solved(t Team) error {
}
}
func (e Exercice) SolvedCount() int64 {
var nb int64
if err := DBQueryRow("SELECT COUNT(id_exercice) FROM exercice_solved WHERE id_exercice = ?", e.Id).Scan(&nb); err != nil {
return 0
} else {
return nb
}
}
func (e Exercice) CheckResponse(response string, t Team) (bool, error) {
s, _, _ := t.HasSolved(e)
if s {