diff options
Diffstat (limited to 'app/views/matches/show.html.erb')
-rw-r--r-- | app/views/matches/show.html.erb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb index a832d17..c92aea3 100644 --- a/app/views/matches/show.html.erb +++ b/app/views/matches/show.html.erb @@ -81,6 +81,7 @@ <% when 2 %> <!-- Finished, waiting for peer reviews --> <input type="hidden" name="update_action" value="peer"> + <input type="hidden" name="review_action" value=""> <% users = []; @match.teams.each{|t| users.concat(t.users)}; %> <% if users.include? current_user %> <% @match.teams.each do |team| %> @@ -101,7 +102,7 @@ </ol> <% end %> <% end %> - <%= submit_tag("Submit peer evaluation") %> + <%= submit_tag("Submit peer evaluation", :onsubmit => "score_peers()") %> <% else %> Waiting for peer evaluations to be submitted. <% end %> @@ -113,3 +114,17 @@ <% end # case %> <% end # form %> </div> + +<script type="text/javascript"> +function score_peers() { + //get each player in order and assign score here! + var $lisp = $('ol#boxes'); + var comma = "," + for(var i=0; i < $lisp.length; i++) { + if ( i == lisp.length-1) { + comma = ""; + } + $('review_action').value += $('ol#boxes:eq(' + i + ')').text() + comma; + } +} +</script> |