summaryrefslogtreecommitdiff
path: root/app/controllers/matches_controller.rb
diff options
context:
space:
mode:
authorAndrewMurrell <amurrel@purdue.edu>2014-04-07 02:57:59 -0400
committerAndrewMurrell <amurrel@purdue.edu>2014-04-07 02:57:59 -0400
commit29df65e51b2cb38e31b1c377c536e7bba1eecc90 (patch)
tree4eeef036561e02edd9f923c210d92a01da9f93a2 /app/controllers/matches_controller.rb
parentc78b419b494b4dc52e7d83b6028664a04b9cb010 (diff)
Updated Peer Review -- Now allows review and scoring -- not tested because Davis can not yaml.
Diffstat (limited to 'app/controllers/matches_controller.rb')
-rw-r--r--app/controllers/matches_controller.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb
index 93b5514..97b8b83 100644
--- a/app/controllers/matches_controller.rb
+++ b/app/controllers/matches_controller.rb
@@ -193,6 +193,20 @@ class MatchesController < ApplicationController
end
end
when "finish"
+ order = params[:review_action]
+ base_score = 2
+ next_score = 3
+ order.split(",").reverse.each do |elem|
+ player_score = base_score
+ if @match.winner.user.include?(@current_user)
+ player_score += 10
+ else
+ player_score += 7
+ end
+ Score.create(user: elem, match: @match, value: player_score )
+ base_score = next_score
+ next_score += base_score
+ end
@match.status = 3
respond_to do |format|
if @match.save