summaryrefslogtreecommitdiff
path: root/lib/scheduling/elimination.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/scheduling/elimination.rb')
-rw-r--r--lib/scheduling/elimination.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/scheduling/elimination.rb b/lib/scheduling/elimination.rb
index 055fdbd..1ac696d 100644
--- a/lib/scheduling/elimination.rb
+++ b/lib/scheduling/elimination.rb
@@ -10,6 +10,7 @@ module Scheduling
def tournament_stage
@tournament_stage
end
+
def tournament
self.tournament_stage.tournament
end
@@ -20,8 +21,12 @@ module Scheduling
for i in 1..num_matches
self.tournament_stage.matches.create(status: 0, submitted_peer_evaluations: 0)
end
+
match_num = num_matches-1
team_num = 0
+
+ self.tournament.players.shuffle
+
# for each grouping of min_players_per_team
self.tournament.players.each_slice(self.tournament.min_players_per_team) do |team_members|
# if the match is full, move to the next match, otherwise move to the next team