backend: implement hint dependencies

This commit is contained in:
nemunaire 2019-11-25 16:21:58 +01:00
parent f3a34c00db
commit 56053f3350

View File

@ -39,6 +39,8 @@ func treatOpeningHint(pathname string, team fic.Team) {
log.Printf("%s [ERR] Unable to retrieve the hint's underlying exercice: %s\n", id, err)
} else if !team.HasAccess(exercice) {
log.Printf("%s [!!!] The team asks to open an hint whereas it doesn't have access to the exercice\n", id)
} else if !team.CanSeeHint(hint) {
log.Printf("%s [!!!] The team asks to open an hint whereas it doesn't have access to it due to hint dependencies\n", id)
} else if err = team.OpenHint(hint); err != nil {
log.Printf("%s [ERR] Unable to open hint: %s\n", id, err)
} else {