summaryrefslogtreecommitdiff
path: root/app/controllers/matches_controller.rb
diff options
context:
space:
mode:
authorAndrewMurrell <amurrel@purdue.edu>2014-04-24 12:21:09 -0400
committerAndrewMurrell <amurrel@purdue.edu>2014-04-24 12:21:09 -0400
commit80352d2b8c9550929e3c25e9ae0b2517532648bf (patch)
tree6e0378b5f9c5241633743cad2690286542768110 /app/controllers/matches_controller.rb
parent1942d4307f392d61d13cdc488fecd523f55e427d (diff)
Fixed Scoring for all 1v1 games. Scheduling needs to be fixed to proceed to larger tournys.
Diffstat (limited to 'app/controllers/matches_controller.rb')
-rw-r--r--app/controllers/matches_controller.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb
index 8a8b9ca..1604564 100644
--- a/app/controllers/matches_controller.rb
+++ b/app/controllers/matches_controller.rb
@@ -150,10 +150,10 @@ class MatchesController < ApplicationController
# Individual scores
scores = params["scores"]
scores.each do |user_name, score|
- Score.create(user: User.find_by_user_name(user_name), match: @match, value: score.to_i)
+ Statistic.create(user: User.find_by_user_name(user_name), match: @match, name: "score", value: score.to_i)
end
- # Team scores
+ # Team scores (processing for manual)
team_scores = {}
@match.teams.each do |team|
team_scores[team] = 0
@@ -165,10 +165,10 @@ class MatchesController < ApplicationController
@match.winner = teams[teams.keys.sort.last]
# Schedule next match
- cur_match_num = @tournament.matches_ordered.invert[@match]
- unless cur_match_num == 1
- @match.winner.matches.push(@tournament.matches_ordered[cur_match_num/2])
- end
+ #cur_match_num = @tournament.matches_ordered.invert[@match]
+ #unless cur_match_num == 1
+ # @match.winner.matches.push(@tournament.matches_ordered[cur_match_num/2])
+ #end
# Skip peer evaluation if there aren't enough players per team
peer = false
@@ -249,7 +249,7 @@ class MatchesController < ApplicationController
# Never trust parameters from the scary internet, only allow the white list through.
def match_params
- params.require(:match).permit(:status, :tournament_stage_id, :winner_id, :remote_id, :submitted_peer_evaluations)
+ params.require(:match).permit(:status, :tournament_stage_id, :winner_id, :remote_id, :submitted_peer_evaluations, :update_action)
end
# Turn of check_edit, since our #update is flexible