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

@ -341,6 +341,7 @@ func (m *MCQ) Check(v interface{}) int {
}
// FoundBy registers in the database that the given Team solved the MCQ.
func (m *MCQ) FoundBy(t *Team) {
DBExec("INSERT INTO mcq_found (id_mcq, id_team, time) VALUES (?, ?, ?)", m.Id, t.Id, time.Now())
func (m *MCQ) FoundBy(t *Team) (err error) {
_, err = DBExec("INSERT INTO mcq_found (id_mcq, id_team, time) VALUES (?, ?, ?)", m.Id, t.Id, time.Now())
return
}