From 99fcc99e82c4f6c5890647399ec0147818e8354a Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Fri, 6 Sep 2019 23:03:08 +0200 Subject: [PATCH] sync: turn IgnoreCase on by default with reverse field CaseSensitive --- admin/sync/exercice_defines.go | 28 ++++++++++++++-------------- admin/sync/exercice_keys.go | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/admin/sync/exercice_defines.go b/admin/sync/exercice_defines.go index e6f04494..e2b79a41 100644 --- a/admin/sync/exercice_defines.go +++ b/admin/sync/exercice_defines.go @@ -29,20 +29,20 @@ type ExerciceUnlockFile struct { // ExerciceFlag holds informations about one flag. type ExerciceFlag struct { - Id int64 - Label string `toml:",omitempty"` - Type string `toml:",omitempty"` - Raw interface{} - Separator string `toml:",omitempty"` - Ordered bool `toml:",omitempty"` - IgnoreCase bool `toml:",omitempty"` - ValidatorRe string `toml:"validator_regexp,omitempty"` - Help string `toml:",omitempty"` - ChoicesCost int64 `toml:"choices_cost,omitempty"` - Choice []ExerciceFlagChoice - LockedFile []ExerciceUnlockFile `toml:"unlock_file,omitempty"` - NeedFlag []ExerciceDependency `toml:"need_flag,omitempty"` - NoShuffle bool + Id int64 + Label string `toml:",omitempty"` + Type string `toml:",omitempty"` + Raw interface{} + Separator string `toml:",omitempty"` + Ordered bool `toml:",omitempty"` + CaseSensitive bool `toml:",omitempty"` + ValidatorRe string `toml:"validator_regexp,omitempty"` + Help string `toml:",omitempty"` + ChoicesCost int64 `toml:"choices_cost,omitempty"` + Choice []ExerciceFlagChoice + LockedFile []ExerciceUnlockFile `toml:"unlock_file,omitempty"` + NeedFlag []ExerciceDependency `toml:"need_flag,omitempty"` + NoShuffle bool } // ExerciceFlagChoice holds informations about a choice (for MCQ and UCQ). diff --git a/admin/sync/exercice_keys.go b/admin/sync/exercice_keys.go index d0d93b8e..66c0c435 100644 --- a/admin/sync/exercice_keys.go +++ b/admin/sync/exercice_keys.go @@ -112,7 +112,7 @@ func buildKeyFlag(exercice fic.Exercice, flag ExerciceFlag, flagline int, defaul IdExercice: exercice.Id, Label: flag.Label, Help: flag.Help, - IgnoreCase: flag.IgnoreCase, + IgnoreCase: !flag.CaseSensitive, ValidatorRegexp: validatorRegexp(flag.ValidatorRe), Checksum: hashedFlag[:], ChoicesCost: flag.ChoicesCost,