Handle optionnal flags

This commit is contained in:
nemunaire 2022-05-31 22:03:51 +02:00
parent e581630d5e
commit a414cd22c8
18 changed files with 68 additions and 22 deletions

View file

@ -82,8 +82,7 @@ func treatSubmission(pathname string, team *fic.Team, exercice_id string) {
// Ensure the team didn't already solve this exercice
tm := team.HasSolved(exercice)
if tm != nil {
log.Printf("%s [WRN] Team %d ALREADY solved exercice %d (%s : %s)\n", id, team.Id, exercice.Id, theme.Name, exercice.Title)
return
log.Printf("%s [WRN] Team %d ALREADY solved exercice %d (%s : %s), continuing for eventual bonus flags\n", id, team.Id, exercice.Id, theme.Name, exercice.Title)
}
// Handle MCQ justifications: convert to expected keyid
@ -119,7 +118,9 @@ func treatSubmission(pathname string, team *fic.Team, exercice_id string) {
log.Println(id, "[ERR] Can't remove file:", err)
}
if solved {
if tm != nil {
genTeamQueue <- team
} else if solved {
log.Printf("%s Team %d SOLVED exercice %d (%s : %s)\n", id, team.Id, exercice.Id, theme.Name, exercice.Title)
if err := exercice.Solved(team); err != nil {
log.Println(id, "[ERR] Unable to mark the challenge as solved:", err)