challenge-sync-airbus: Use a score with better precision

This commit is contained in:
nemunaire 2024-03-19 13:59:28 +01:00
commit c0017d7cbb
2 changed files with 3 additions and 1 deletions

View file

@ -102,6 +102,7 @@ type MyTeam struct {
Id int64 `json:"team_id"`
Name string `json:"name"`
Points int64 `json:"score"`
Points100 int64 `json:"score100"`
Members []*Member `json:"members,omitempty"`
Exercices map[string]myTeamExercice `json:"exercices"`
}
@ -123,6 +124,7 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
ret.Id = t.Id
points, _ := t.GetPoints()
ret.Points = int64(float64(points) * GlobalScoreCoefficient)
ret.Points100 = int64(float64(points) * GlobalScoreCoefficient * 100)
if members, err := t.GetMembers(); err == nil {
ret.Members = members
}