libfic: don't show useless decimals to gain
This commit is contained in:
parent
6d1ef0f51c
commit
627c28cd94
1 changed files with 3 additions and 3 deletions
|
@ -30,7 +30,7 @@ type myTeamExercice struct {
|
||||||
ThemeId int `json:"theme_id"`
|
ThemeId int `json:"theme_id"`
|
||||||
Statement string `json:"statement"`
|
Statement string `json:"statement"`
|
||||||
Hints []myTeamHint `json:"hints,omitempty"`
|
Hints []myTeamHint `json:"hints,omitempty"`
|
||||||
Gain float64 `json:"gain"`
|
Gain int `json:"gain"`
|
||||||
Files []myTeamFile `json:"files,omitempty"`
|
Files []myTeamFile `json:"files,omitempty"`
|
||||||
Keys []string `json:"keys,omitempty"`
|
Keys []string `json:"keys,omitempty"`
|
||||||
SolvedMat []bool `json:"solved_matrix,omitempty"`
|
SolvedMat []bool `json:"solved_matrix,omitempty"`
|
||||||
|
@ -82,7 +82,7 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
|
||||||
exercice.VideoURI = e.VideoURI
|
exercice.VideoURI = e.VideoURI
|
||||||
exercice.SolvedRank = 1
|
exercice.SolvedRank = 1
|
||||||
exercice.Tries = e.TriedCount()
|
exercice.Tries = e.TriedCount()
|
||||||
exercice.Gain = float64(e.Gain) * e.Coefficient
|
exercice.Gain = int(float64(e.Gain) * e.Coefficient)
|
||||||
} else {
|
} else {
|
||||||
var solved bool
|
var solved bool
|
||||||
solved, exercice.SolvedTime, exercice.SolvedRank = t.HasSolved(e)
|
solved, exercice.SolvedTime, exercice.SolvedRank = t.HasSolved(e)
|
||||||
|
@ -97,7 +97,7 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if gain, err := e.EstimateGain(*t, solved); err == nil {
|
if gain, err := e.EstimateGain(*t, solved); err == nil {
|
||||||
exercice.Gain = gain
|
exercice.Gain = int(gain)
|
||||||
} else {
|
} else {
|
||||||
log.Println("ERROR during gain estimation:", err)
|
log.Println("ERROR during gain estimation:", err)
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue