fix: base tour points on total enrolled players, not submitted results
1st place now gets N points where N is total tour participants, not just those who submitted for that specific course. This makes the leaderboard meaningful even when not everyone has played yet.
This commit is contained in:
@@ -39,9 +39,10 @@ async function calculateLeaderboard(tourId) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const numPlayers = players.length;
|
||||||
|
|
||||||
for (const course of courses) {
|
for (const course of courses) {
|
||||||
const courseResults = resultsByCourse[course.tour_course_id] || [];
|
const courseResults = resultsByCourse[course.tour_course_id] || [];
|
||||||
const numPlayers = courseResults.length;
|
|
||||||
|
|
||||||
let rank = 1;
|
let rank = 1;
|
||||||
for (let i = 0; i < courseResults.length; i++) {
|
for (let i = 0; i < courseResults.length; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user