settings: Add an option to show MCQ distance from good

This commit is contained in:
nemunaire 2022-01-20 16:06:27 +01:00
parent 4b82987bbb
commit 63d8ae4ecd
4 changed files with 17 additions and 1 deletions

View File

@ -66,6 +66,7 @@ func ApplySettings(config settings.FICSettings) {
fic.PartialValidation = config.PartialValidation fic.PartialValidation = config.PartialValidation
fic.UnlockedChallengeDepth = config.UnlockedChallengeDepth fic.UnlockedChallengeDepth = config.UnlockedChallengeDepth
fic.DisplayAllFlags = config.DisplayAllFlags fic.DisplayAllFlags = config.DisplayAllFlags
fic.DisplayMCQBadCount = config.DisplayMCQBadCount
fic.FirstBlood = config.FirstBlood fic.FirstBlood = config.FirstBlood
fic.SubmissionCostBase = config.SubmissionCostBase fic.SubmissionCostBase = config.SubmissionCostBase
fic.HintCoefficient = config.HintCurCoefficient fic.HintCoefficient = config.HintCurCoefficient
@ -97,6 +98,7 @@ func ResetSettings() error {
UnlockedChallengeDepth: 0, UnlockedChallengeDepth: 0,
SubmissionUniqueness: false, SubmissionUniqueness: false,
DisplayAllFlags: false, DisplayAllFlags: false,
DisplayMCQBadCount: false,
EventKindness: false, EventKindness: false,
}) })
} }

View File

@ -211,6 +211,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.displayMCQBadCount">
<span class="custom-control-label">Afficher le décompte de mauvaises réponses des QCM</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.eventKindness"> <input class="custom-control-input" type="checkbox" ng-model="config.eventKindness">

View File

@ -14,6 +14,9 @@ import (
// DisplayAllFlags doesn't respect the predefined constraint existing between flags. // DisplayAllFlags doesn't respect the predefined constraint existing between flags.
var DisplayAllFlags bool var DisplayAllFlags bool
// DisplayMCQBadCount activates the report of MCQ bad responses counter.
var DisplayMCQBadCount bool
type myTeamFile struct { type myTeamFile struct {
Path string `json:"path"` Path string `json:"path"`
Name string `json:"name"` Name string `json:"name"`
@ -140,7 +143,9 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
exercice.Tries, stime = t.CountTries(e) exercice.Tries, stime = t.CountTries(e)
exercice.SolvedTime = stime exercice.SolvedTime = stime
if exercice.Tries > 0 { if exercice.Tries > 0 {
exercice.SolveDist = t.LastTryDist(e) if DisplayMCQBadCount {
exercice.SolveDist = t.LastTryDist(e)
}
} }
} }

View File

@ -77,6 +77,8 @@ type FICSettings 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"`
// DisplayMCQBadCount activates the report of MCQ bad responses counter.
DisplayMCQBadCount bool `json:"displayMCQBadCount,omitempty"`
// EventKindness will ask browsers to delay notification interval. // EventKindness will ask browsers to delay notification interval.
EventKindness bool `json:"eventKindness,omitempty"` EventKindness bool `json:"eventKindness,omitempty"`
} }