libfic: fix bad hints displayed
This commit is contained in:
parent
5e2e03f5e9
commit
2aa1d6eeca
@ -9,8 +9,8 @@ type EHint struct {
|
|||||||
Id int64 `json:"id"`
|
Id int64 `json:"id"`
|
||||||
IdExercice int64 `json:"idExercice"`
|
IdExercice int64 `json:"idExercice"`
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
Content string `json:"content"`
|
Content string `json:"content"`
|
||||||
File string `json:"file"`
|
File string `json:"file"`
|
||||||
Cost int64 `json:"cost"`
|
Cost int64 `json:"cost"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,8 +17,8 @@ type myTeamFile struct {
|
|||||||
type myTeamHint struct {
|
type myTeamHint struct {
|
||||||
HintId int64 `json:"id"`
|
HintId int64 `json:"id"`
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
Content *string `json:"content,omitempty"`
|
Content string `json:"content,omitempty"`
|
||||||
File *string `json:"file,omitempty"`
|
File string `json:"file,omitempty"`
|
||||||
Cost int64 `json:"cost"`
|
Cost int64 `json:"cost"`
|
||||||
}
|
}
|
||||||
type myTeamMCQ struct {
|
type myTeamMCQ struct {
|
||||||
@ -124,9 +124,9 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
|
|||||||
} else {
|
} else {
|
||||||
for _, h := range hints {
|
for _, h := range hints {
|
||||||
if t == nil || t.HasHint(h) {
|
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 {
|
} 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})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user