From 56053f3350e71e8a670f0b7c6e0b3c98990900c7 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Mon, 25 Nov 2019 16:21:58 +0100 Subject: [PATCH] backend: implement hint dependencies --- backend/hint.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/hint.go b/backend/hint.go index a73c40e7..7fb5a729 100644 --- a/backend/hint.go +++ b/backend/hint.go @@ -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 {