backend: Don't consider non error in MCQ as good response

This commit is contained in:
nemunaire 2022-06-08 16:38:00 +02:00
commit 4b1b5445f7
5 changed files with 12 additions and 8 deletions

View file

@ -335,8 +335,9 @@ func (k *FlagKey) Check(v interface{}) int {
}
// FoundBy registers in the database that the given Team solved the flag.
func (k *FlagKey) FoundBy(t *Team) {
DBExec("INSERT INTO flag_found (id_flag, id_team, time) VALUES (?, ?, ?)", k.Id, t.Id, time.Now())
func (k *FlagKey) FoundBy(t *Team) (err error) {
_, err = DBExec("INSERT INTO flag_found (id_flag, id_team, time) VALUES (?, ?, ?)", k.Id, t.Id, time.Now())
return
}
// GetExercice returns the parent Exercice where this flag can be found.