EricSSartorius / Judging-System

U-Judge: Universal Judging System using Angular Meteor (OLD)
http://www.universaljudge.com/
1 stars 1 forks source link

Leaderboard - Scores need sorted by rank #22

Closed EricSSartorius closed 8 years ago

EricSSartorius commented 8 years ago

Need to find a way to sort the total scores for the current event without affecting the order of players in the Events collection. Logic will need to be added in the getTotalScore() function of the admin-console controller in place of the following commented code:

//Sorts the order of scores for the leaderboard. Needs changes so that it does not affect player order in the collection // tempPlayers = tempPlayers.sort(function(a,b){ // return b.totalScore-a.totalScore; // });

felicedeNigris commented 8 years ago

So you want to sort the scores of each player for the current session ? So if player one has 30 points and player two has 40 points and player 3 also has 30 points, you'd want to store something like [{player1 : 30}, {player2 : 30}, {player3 : 40}] ?