Able to check submission

This commit is contained in:
nemunaire 2016-01-15 12:57:35 +01:00
commit e3f7cce80a
4 changed files with 51 additions and 3 deletions

View file

@ -37,7 +37,13 @@ func treatSubmission(pathname string, team_id string, exercice_id string) {
cnt += scanner.Text()
}
log.Println(id, team, exercice, cnt)
if solved, err := exercice.CheckResponse(cnt, team); err != nil {
log.Println(id, "[ERR]", err)
} else if solved {
exercice.Solved(team)
log.Printf("%s Team %d SOLVED exercice %d\n", id, team.Id, exercice.Id)
} else {
log.Printf("%s Team %d submit an invalid solution for exercice %d\n", id, team.Id, exercice.Id)
}
}
}