Implement flag arrays

This commit is contained in:
nemunaire 2018-12-04 18:34:38 +01:00
commit dbf1985d25
6 changed files with 90 additions and 8 deletions

View file

@ -39,6 +39,7 @@ type myTeamMCQ struct {
type myTeamFlag struct {
Label string `json:"label"`
Help string `json:"help,omitempty"`
Separator string `json:"separator,omitempty"`
Solved *time.Time `json:"found,omitempty"`
Soluce string `json:"soluce,omitempty"`
Choices map[string]string `json:"choices,omitempty"`
@ -194,7 +195,12 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
flag.Solved = t.HasPartiallySolved(k)
}
flag.Label = k.Label
if k.Label[0] == '`' && len(k.Label) > 2 {
flag.Label = k.Label[2:]
flag.Separator = string(k.Label[1])
} else {
flag.Label = k.Label
}
if flag.Solved == nil {
flag.Help = k.Help