backend: Display a message when the exercice is disabled

This commit is contained in:
nemunaire 2023-04-06 15:38:53 +02:00
parent 089e604679
commit d8462cf58e
4 changed files with 37 additions and 1 deletions

View file

@ -66,6 +66,7 @@ type myTeamMCQJustifiedChoice struct {
}
type myTeamExercice struct {
ThemeId int64 `json:"theme_id"`
Disabled bool `json:"disabled,omitempty"`
WIP bool `json:"wip,omitempty"`
Statement string `json:"statement"`
Overview string `json:"overview,omitempty"`
@ -123,6 +124,7 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
for _, e := range exos {
if t == nil || (!e.Disabled && t.HasAccess(e)) {
exercice := myTeamExercice{}
exercice.Disabled = e.Disabled
exercice.WIP = e.WIP
exercice.ThemeId = e.IdTheme