diff --git a/libfic/exercice.go b/libfic/exercice.go
index 0a6fcb45..ea2a3795 100644
--- a/libfic/exercice.go
+++ b/libfic/exercice.go
@@ -15,6 +15,9 @@ var PartialValidation bool
// Otherwise, all MCQ has to be correct for being validated.
var PartialMCQValidation bool
+// ExerciceCurrentCoefficient is the current coefficient applied on solved exercices
+var ExerciceCurrentCoefficient = 1.0
+
// Exercice represents a challenge inside a Theme.
type Exercice struct {
Id int64 `json:"id"`
@@ -310,7 +313,7 @@ func (e Exercice) UpdateTry(t Team, nbdiff int) error {
// Solved registers that the given Team solves the challenge.
func (e Exercice) Solved(t Team) error {
- if _, err := DBExec("INSERT INTO exercice_solved (id_exercice, id_team, time, coefficient) VALUES (?, ?, ?, ?)", e.Id, t.Id, time.Now(), e.Coefficient); err != nil {
+ if _, err := DBExec("INSERT INTO exercice_solved (id_exercice, id_team, time, coefficient) VALUES (?, ?, ?, ?)", e.Id, t.Id, time.Now(), e.Coefficient * ExerciceCurrentCoefficient); err != nil {
return err
} else {
return nil
diff --git a/settings/settings.go b/settings/settings.go
index d45a46aa..99719100 100644
--- a/settings/settings.go
+++ b/settings/settings.go
@@ -42,6 +42,8 @@ type FICSettings struct {
FirstBlood float64 `json:"firstBlood"`
// SubmissionCostBase is a complex number representing the cost of each attempts.
SubmissionCostBase float64 `json:"submissionCostBase"`
+ // ExerciceCurrentCoefficient is the current coefficient applied globaly to exercices.
+ ExerciceCurCoefficient float64 `json:"exerciceCurrentCoefficient"`
// HintCurrentCoefficient is the current coefficient applied to hint discovery.
HintCurCoefficient float64 `json:"hintCurrentCoefficient"`
// WChoiceCurCoefficient is the current coefficient applied to wanted choices.