Display a badge to inform about case sensitivity (can be disabled by setting)
This commit is contained in:
parent
f6b94b33e5
commit
20272e7bad
@ -316,6 +316,7 @@ func ApplySettings(config *settings.Settings) {
|
||||
fic.UnlockedChallengeDepth = config.UnlockedChallengeDepth
|
||||
fic.UnlockedChallengeUpTo = config.UnlockedChallengeUpTo
|
||||
fic.DisplayAllFlags = config.DisplayAllFlags
|
||||
fic.HideCaseSensitivity = config.HideCaseSensitivity
|
||||
fic.DisplayMCQBadCount = config.DisplayMCQBadCount
|
||||
fic.FirstBlood = config.FirstBlood
|
||||
fic.SubmissionCostBase = config.SubmissionCostBase
|
||||
|
@ -225,6 +225,13 @@
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-check">
|
||||
<label class="custom-control custom-checkbox">
|
||||
<input class="custom-control-input" type="checkbox" ng-model="config.hideCaseSensitivity">
|
||||
<span class="custom-control-label" ng-class="{'text-primary font-weight-bold': !config.hideCaseSensitivity != !dist_config.hideCaseSensitivity}">Ne pas informer sur la sensibilité à la casse des flags</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-check">
|
||||
<label class="custom-control custom-checkbox">
|
||||
<input class="custom-control-input" type="checkbox" ng-model="config.submissionUniqueness">
|
||||
|
@ -1,5 +1,6 @@
|
||||
<script>
|
||||
import {
|
||||
Badge,
|
||||
Button,
|
||||
Icon,
|
||||
Spinner,
|
||||
@ -115,6 +116,15 @@
|
||||
{#if flag.found && flag.value}
|
||||
<span>{flag.value}</span>
|
||||
{/if}
|
||||
{#if !flag.found && !$settings.hideCaseSensitivity && !flag.ignore_case}
|
||||
<Badge
|
||||
class="float-end"
|
||||
color="danger"
|
||||
title="Ce flag est sensible à la casse !"
|
||||
>
|
||||
aA
|
||||
</Badge>
|
||||
{/if}
|
||||
{#if !flag.found}
|
||||
{#each values as v, index}
|
||||
{#if !flag.choices}
|
||||
|
@ -30,7 +30,7 @@ func reloadSettings(config *settings.Settings) {
|
||||
fic.WChoiceCoefficient = config.WChoiceCurCoefficient
|
||||
fic.ExerciceCurrentCoefficient = config.ExerciceCurCoefficient
|
||||
ChStarted = config.Start.Unix() > 0 && time.Since(config.Start) >= 0
|
||||
if allowRegistration != config.AllowRegistration || fic.PartialValidation != config.PartialValidation || fic.UnlockedChallengeDepth != config.UnlockedChallengeDepth || fic.UnlockedChallengeUpTo != config.UnlockedChallengeUpTo || fic.DisplayAllFlags != config.DisplayAllFlags || fic.FirstBlood != config.FirstBlood || fic.SubmissionCostBase != config.SubmissionCostBase || fic.SubmissionUniqueness != config.SubmissionUniqueness || fic.DiscountedFactor != config.DiscountedFactor {
|
||||
if allowRegistration != config.AllowRegistration || fic.PartialValidation != config.PartialValidation || fic.UnlockedChallengeDepth != config.UnlockedChallengeDepth || fic.UnlockedChallengeUpTo != config.UnlockedChallengeUpTo || fic.DisplayAllFlags != config.DisplayAllFlags || fic.FirstBlood != config.FirstBlood || fic.SubmissionCostBase != config.SubmissionCostBase || fic.SubmissionUniqueness != config.SubmissionUniqueness || fic.DiscountedFactor != config.DiscountedFactor || fic.HideCaseSensitivity != config.HideCaseSensitivity {
|
||||
allowRegistration = config.AllowRegistration
|
||||
|
||||
fic.PartialValidation = config.PartialValidation
|
||||
@ -43,6 +43,7 @@ func reloadSettings(config *settings.Settings) {
|
||||
fic.SubmissionUniqueness = config.SubmissionUniqueness
|
||||
fic.GlobalScoreCoefficient = config.GlobalScoreCoefficient
|
||||
fic.CountOnlyNotGoodTries = config.CountOnlyNotGoodTries
|
||||
fic.HideCaseSensitivity = config.HideCaseSensitivity
|
||||
fic.DiscountedFactor = config.DiscountedFactor
|
||||
|
||||
if !skipInitialGeneration {
|
||||
|
@ -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
|
||||
|
@ -77,6 +77,8 @@ type Settings struct {
|
||||
CountOnlyNotGoodTries bool `json:"countOnlyNotGoodTries,omitempty"`
|
||||
// DisplayAllFlags doesn't respect the predefined constraint existing between flags.
|
||||
DisplayAllFlags bool `json:"displayAllFlags,omitempty"`
|
||||
// HideCaseSensitivity never tells the user if the flag is case sensitive or not.
|
||||
HideCaseSensitivity bool `json:"hideCaseSensitivity,omitempty"`
|
||||
// DisplayMCQBadCount activates the report of MCQ bad responses counter.
|
||||
DisplayMCQBadCount bool `json:"displayMCQBadCount,omitempty"`
|
||||
// EventKindness will ask browsers to delay notification interval.
|
||||
|
Loading…
x
Reference in New Issue
Block a user