libfic/mcq: remove Kind, as we can only handle checkbox; another kind of record should be created to handle select/radio

This commit is contained in:
nemunaire 2017-12-17 16:28:31 +01:00
commit eb182ff6e6
4 changed files with 11 additions and 20 deletions

View file

@ -23,7 +23,6 @@ type myTeamHint struct {
}
type myTeamMCQ struct {
Title string `json:"title"`
Kind string `json:"kind"`
Choices map[int64]string `json:"choices,omitempty"`
Solved *time.Time `json:"solved,omitempty"`
}
@ -145,9 +144,9 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
choices[e.Id] = e.Label
}
if t == nil {
exercice.MCQs = append(exercice.MCQs, myTeamMCQ{mcq.Title, mcq.Kind, choices, nil})
exercice.MCQs = append(exercice.MCQs, myTeamMCQ{mcq.Title, choices, nil})
} else {
exercice.MCQs = append(exercice.MCQs, myTeamMCQ{mcq.Title, mcq.Kind, choices, t.HasPartiallyRespond(mcq)})
exercice.MCQs = append(exercice.MCQs, myTeamMCQ{mcq.Title, choices, t.HasPartiallyRespond(mcq)})
}
}
}