settings: add coefficient to hint and wchoices

This commit is contained in:
nemunaire 2019-01-17 12:03:18 +01:00
parent 2623d9dd61
commit c5f8288f39
10 changed files with 43 additions and 13 deletions

View file

@ -161,7 +161,7 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
return nil, err
} else {
for _, h := range hints {
if t == nil || t.HasHint(h) {
if t == nil || HintCoefficient < 0 || t.HasHint(h) {
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, "", "", h.Cost})
@ -210,7 +210,7 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
flag.Help = k.Help
if choices, err := k.GetChoices(); err != nil {
return nil, err
} else if t == nil || k.ChoicesCost == 0 || t.SeeChoices(k) {
} else if t == nil || WChoiceCoefficient < 0 || k.ChoicesCost == 0 || t.SeeChoices(k) {
flag.Choices = map[string]string{}
for _, c := range choices {
flag.Choices[c.Value] = c.Label