Display a badge to inform about case sensitivity (can be disabled by setting)

This commit is contained in:
nemunaire 2023-11-05 10:59:10 +01:00
commit 20272e7bad
6 changed files with 32 additions and 3 deletions

View file

@ -19,6 +19,9 @@ var DisplayAllFlags bool
// DisplayMCQBadCount activates the report of MCQ bad responses counter.
var DisplayMCQBadCount bool
// HideCaseSensitivity never tells the user if the flag is case sensitive or not.
var HideCaseSensitivity bool
type myTeamFile struct {
Path string `json:"path"`
Name string `json:"name"`
@ -274,8 +277,13 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
flag.IgnoreCase = k.IgnoreCase
flag.CaptureRe = k.CaptureRegexp
flag.Soluce = hex.EncodeToString(k.Checksum)
} else if PartialValidation {
flag.Solved = t.HasPartiallySolved(k)
} else {
if PartialValidation {
flag.Solved = t.HasPartiallySolved(k)
}
if !HideCaseSensitivity {
flag.IgnoreCase = k.IgnoreCase
}
}
flag.Multiline = k.Multiline