Recall ThemeId in my.json exercices

This commit is contained in:
nemunaire 2016-01-25 03:04:11 +01:00
parent 9c1f6c4ab8
commit 85646fd2d7

View file

@ -14,6 +14,7 @@ type myTeamFile struct {
Size int64 `json:"size"` Size int64 `json:"size"`
} }
type myTeamExercice struct { type myTeamExercice struct {
ThemeId int `json:"theme_id"`
Statement string `json:"statement"` Statement string `json:"statement"`
Hint string `json:"hint"` Hint string `json:"hint"`
Gain int64 `json:"gain"` Gain int64 `json:"gain"`
@ -52,6 +53,9 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
for _, e := range exos { for _, e := range exos {
if t == nil || t.HasAccess(e) { if t == nil || t.HasAccess(e) {
exercice := myTeamExercice{} exercice := myTeamExercice{}
if tid, err := e.GetThemeId(); err == nil {
exercice.ThemeId = tid
}
exercice.Statement = e.Statement exercice.Statement = e.Statement
exercice.Hint = e.Hint exercice.Hint = e.Hint
if t == nil { if t == nil {