From bd1bfe729030312fc678a3705c881744aa650c63 Mon Sep 17 00:00:00 2001 From: tkimia Date: Thu, 24 Apr 2014 18:08:26 -0400 Subject: text in graph is a bit better --- lib/scheduling/elimination.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/scheduling') diff --git a/lib/scheduling/elimination.rb b/lib/scheduling/elimination.rb index e66a29a..4e368b5 100644 --- a/lib/scheduling/elimination.rb +++ b/lib/scheduling/elimination.rb @@ -108,7 +108,7 @@ STRING t = 1 while t <= numTeams - color = (matches[i].teams[t-1] and matches[i].teams[t-1].users.include?(current_user)) ? "#BCED91" : "white" + color = (matches[i].teams[t-1] and matches[i].teams[t-1].users.include?(current_user)) ? "#5BC0DE" : "white" str += "\t\t\n" if matches[i].teams[t-1] str += "\t\tTeam #{matches[i].teams[t-1].id}\n" -- cgit v1.2.3-2-g168b From 575c8a552cbcf11934b32f4d24636cdc18094f53 Mon Sep 17 00:00:00 2001 From: tkimia Date: Thu, 24 Apr 2014 18:37:18 -0400 Subject: number of matches has new formula that works for all teams/match --- lib/scheduling/elimination.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/scheduling') diff --git a/lib/scheduling/elimination.rb b/lib/scheduling/elimination.rb index 4e368b5..cf0d625 100644 --- a/lib/scheduling/elimination.rb +++ b/lib/scheduling/elimination.rb @@ -17,7 +17,7 @@ module Scheduling def create_matches num_teams = (self.tournament.players.count/self.tournament.min_players_per_team).floor - num_matches = num_teams - 1 + num_matches = (Float(num_teams - tournament.min_teams_per_match)/(tournament.min_teams_per_match - 1)).ceil + 1 for i in 1..num_matches self.tournament_stage.matches.create(status: 0, submitted_peer_evaluations: 0) end -- cgit v1.2.3-2-g168b