libfic: don't show useless decimals to gain
This commit is contained in:
parent
6d1ef0f51c
commit
627c28cd94
|
@ -30,7 +30,7 @@ type myTeamExercice struct {
|
|||
ThemeId int `json:"theme_id"`
|
||||
Statement string `json:"statement"`
|
||||
Hints []myTeamHint `json:"hints,omitempty"`
|
||||
Gain float64 `json:"gain"`
|
||||
Gain int `json:"gain"`
|
||||
Files []myTeamFile `json:"files,omitempty"`
|
||||
Keys []string `json:"keys,omitempty"`
|
||||
SolvedMat []bool `json:"solved_matrix,omitempty"`
|
||||
|
@ -82,7 +82,7 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
|
|||
exercice.VideoURI = e.VideoURI
|
||||
exercice.SolvedRank = 1
|
||||
exercice.Tries = e.TriedCount()
|
||||
exercice.Gain = float64(e.Gain) * e.Coefficient
|
||||
exercice.Gain = int(float64(e.Gain) * e.Coefficient)
|
||||
} else {
|
||||
var solved bool
|
||||
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 {
|
||||
exercice.Gain = gain
|
||||
exercice.Gain = int(gain)
|
||||
} else {
|
||||
log.Println("ERROR during gain estimation:", err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue