frontend: polish public version checks

This commit is contained in:
nemunaire 2019-01-25 07:26:52 +01:00
commit db22c4af1b
3 changed files with 38 additions and 9 deletions

View file

@ -30,6 +30,8 @@ type myTeamFlag struct {
Help string `json:"help,omitempty"`
Separator string `json:"separator,omitempty"`
IgnoreOrder bool `json:"ignore_order,omitempty"`
IgnoreCase bool `json:"ignore_case,omitempty"`
ValidatorRe *string `json:"validator_regexp,omitempty"`
Solved *time.Time `json:"found,omitempty"`
Soluce string `json:"soluce,omitempty"`
Choices map[string]string `json:"choices,omitempty"`
@ -189,6 +191,8 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
// Retrieve solved state or solution for public iface
if t == nil {
flag.IgnoreCase = k.IgnoreCase
flag.ValidatorRe = k.ValidatorRegexp
flag.Soluce = hex.EncodeToString(k.Checksum)
} else if PartialValidation {
flag.Solved = t.HasPartiallySolved(k)