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.UnlockedChallengeDepth = config.UnlockedChallengeDepth
|
||||||
fic.UnlockedChallengeUpTo = config.UnlockedChallengeUpTo
|
fic.UnlockedChallengeUpTo = config.UnlockedChallengeUpTo
|
||||||
fic.DisplayAllFlags = config.DisplayAllFlags
|
fic.DisplayAllFlags = config.DisplayAllFlags
|
||||||
|
fic.HideCaseSensitivity = config.HideCaseSensitivity
|
||||||
fic.DisplayMCQBadCount = config.DisplayMCQBadCount
|
fic.DisplayMCQBadCount = config.DisplayMCQBadCount
|
||||||
fic.FirstBlood = config.FirstBlood
|
fic.FirstBlood = config.FirstBlood
|
||||||
fic.SubmissionCostBase = config.SubmissionCostBase
|
fic.SubmissionCostBase = config.SubmissionCostBase
|
||||||
|
@ -225,6 +225,13 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</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">
|
<div class="form-check">
|
||||||
<label class="custom-control custom-checkbox">
|
<label class="custom-control custom-checkbox">
|
||||||
<input class="custom-control-input" type="checkbox" ng-model="config.submissionUniqueness">
|
<input class="custom-control-input" type="checkbox" ng-model="config.submissionUniqueness">
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
|
Badge,
|
||||||
Button,
|
Button,
|
||||||
Icon,
|
Icon,
|
||||||
Spinner,
|
Spinner,
|
||||||
@ -115,6 +116,15 @@
|
|||||||
{#if flag.found && flag.value}
|
{#if flag.found && flag.value}
|
||||||
<span>{flag.value}</span>
|
<span>{flag.value}</span>
|
||||||
{/if}
|
{/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}
|
{#if !flag.found}
|
||||||
{#each values as v, index}
|
{#each values as v, index}
|
||||||
{#if !flag.choices}
|
{#if !flag.choices}
|
||||||
|
@ -30,7 +30,7 @@ func reloadSettings(config *settings.Settings) {
|
|||||||
fic.WChoiceCoefficient = config.WChoiceCurCoefficient
|
fic.WChoiceCoefficient = config.WChoiceCurCoefficient
|
||||||
fic.ExerciceCurrentCoefficient = config.ExerciceCurCoefficient
|
fic.ExerciceCurrentCoefficient = config.ExerciceCurCoefficient
|
||||||
ChStarted = config.Start.Unix() > 0 && time.Since(config.Start) >= 0
|
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
|
allowRegistration = config.AllowRegistration
|
||||||
|
|
||||||
fic.PartialValidation = config.PartialValidation
|
fic.PartialValidation = config.PartialValidation
|
||||||
@ -43,6 +43,7 @@ func reloadSettings(config *settings.Settings) {
|
|||||||
fic.SubmissionUniqueness = config.SubmissionUniqueness
|
fic.SubmissionUniqueness = config.SubmissionUniqueness
|
||||||
fic.GlobalScoreCoefficient = config.GlobalScoreCoefficient
|
fic.GlobalScoreCoefficient = config.GlobalScoreCoefficient
|
||||||
fic.CountOnlyNotGoodTries = config.CountOnlyNotGoodTries
|
fic.CountOnlyNotGoodTries = config.CountOnlyNotGoodTries
|
||||||
|
fic.HideCaseSensitivity = config.HideCaseSensitivity
|
||||||
fic.DiscountedFactor = config.DiscountedFactor
|
fic.DiscountedFactor = config.DiscountedFactor
|
||||||
|
|
||||||
if !skipInitialGeneration {
|
if !skipInitialGeneration {
|
||||||
|
@ -19,6 +19,9 @@ var DisplayAllFlags bool
|
|||||||
// DisplayMCQBadCount activates the report of MCQ bad responses counter.
|
// DisplayMCQBadCount activates the report of MCQ bad responses counter.
|
||||||
var DisplayMCQBadCount bool
|
var DisplayMCQBadCount bool
|
||||||
|
|
||||||
|
// HideCaseSensitivity never tells the user if the flag is case sensitive or not.
|
||||||
|
var HideCaseSensitivity bool
|
||||||
|
|
||||||
type myTeamFile struct {
|
type myTeamFile struct {
|
||||||
Path string `json:"path"`
|
Path string `json:"path"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
@ -274,9 +277,14 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
|
|||||||
flag.IgnoreCase = k.IgnoreCase
|
flag.IgnoreCase = k.IgnoreCase
|
||||||
flag.CaptureRe = k.CaptureRegexp
|
flag.CaptureRe = k.CaptureRegexp
|
||||||
flag.Soluce = hex.EncodeToString(k.Checksum)
|
flag.Soluce = hex.EncodeToString(k.Checksum)
|
||||||
} else if PartialValidation {
|
} else {
|
||||||
|
if PartialValidation {
|
||||||
flag.Solved = t.HasPartiallySolved(k)
|
flag.Solved = t.HasPartiallySolved(k)
|
||||||
}
|
}
|
||||||
|
if !HideCaseSensitivity {
|
||||||
|
flag.IgnoreCase = k.IgnoreCase
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
flag.Multiline = k.Multiline
|
flag.Multiline = k.Multiline
|
||||||
flag.BonusGain = int64(float64(k.BonusGain) * GlobalScoreCoefficient)
|
flag.BonusGain = int64(float64(k.BonusGain) * GlobalScoreCoefficient)
|
||||||
|
@ -77,6 +77,8 @@ type Settings struct {
|
|||||||
CountOnlyNotGoodTries bool `json:"countOnlyNotGoodTries,omitempty"`
|
CountOnlyNotGoodTries bool `json:"countOnlyNotGoodTries,omitempty"`
|
||||||
// DisplayAllFlags doesn't respect the predefined constraint existing between flags.
|
// DisplayAllFlags doesn't respect the predefined constraint existing between flags.
|
||||||
DisplayAllFlags bool `json:"displayAllFlags,omitempty"`
|
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 activates the report of MCQ bad responses counter.
|
||||||
DisplayMCQBadCount bool `json:"displayMCQBadCount,omitempty"`
|
DisplayMCQBadCount bool `json:"displayMCQBadCount,omitempty"`
|
||||||
// EventKindness will ask browsers to delay notification interval.
|
// EventKindness will ask browsers to delay notification interval.
|
||||||
|
Loading…
Reference in New Issue
Block a user