libfic: fix bad hints displayed

This commit is contained in:
nemunaire 2018-01-06 16:06:51 +01:00
parent 5e2e03f5e9
commit 2aa1d6eeca
2 changed files with 6 additions and 6 deletions

View File

@ -9,8 +9,8 @@ type EHint struct {
Id int64 `json:"id"`
IdExercice int64 `json:"idExercice"`
Title string `json:"title"`
Content string `json:"content"`
File string `json:"file"`
Content string `json:"content"`
File string `json:"file"`
Cost int64 `json:"cost"`
}

View File

@ -17,8 +17,8 @@ type myTeamFile struct {
type myTeamHint struct {
HintId int64 `json:"id"`
Title string `json:"title"`
Content *string `json:"content,omitempty"`
File *string `json:"file,omitempty"`
Content string `json:"content,omitempty"`
File string `json:"file,omitempty"`
Cost int64 `json:"cost"`
}
type myTeamMCQ struct {
@ -124,9 +124,9 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
} else {
for _, h := range hints {
if t == nil || t.HasHint(h) {
exercice.Hints = append(exercice.Hints, myTeamHint{h.Id, h.Title, &h.Content, &h.File, h.Cost})
exercice.Hints = append(exercice.Hints, myTeamHint{h.Id, h.Title, h.Content, h.File, h.Cost})
} else {
exercice.Hints = append(exercice.Hints, myTeamHint{h.Id, h.Title, nil, nil, h.Cost})
exercice.Hints = append(exercice.Hints, myTeamHint{h.Id, h.Title, "", "", h.Cost})
}
}
}