backend: Can lock submission for a given exercice
This commit is contained in:
parent
3344e05e0d
commit
268925db0d
3 changed files with 112 additions and 0 deletions
|
|
@ -237,6 +237,8 @@ func treat(raw_path string) {
|
|||
treatOpeningHint(raw_path, team)
|
||||
case "choices":
|
||||
treatWantChoices(raw_path, team)
|
||||
case ".locked":
|
||||
treatLocked(raw_path, team)
|
||||
default:
|
||||
treatSubmission(raw_path, team, spath[2])
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,14 @@ func treatSubmission(pathname string, team *fic.Team, exercice_id string) {
|
|||
return
|
||||
}
|
||||
|
||||
// Identifier should not be blacklisted for the team
|
||||
if blacklistteam, ok := TeamLockedExercices[team.Id]; ok {
|
||||
if locked, ok := blacklistteam[exercice_id]; ok && locked {
|
||||
log.Printf("%s [!!!] Submission received for team's locked exercice %d\n", id, eid)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// Find the given exercice
|
||||
exercice, err := fic.GetExercice(eid)
|
||||
if err != nil {
|
||||
|
|
|
|||
Reference in a new issue