diff options
Diffstat (limited to 'app/views/matches')
-rw-r--r-- | app/views/matches/index.html.erb | 3 | ||||
-rw-r--r-- | app/views/matches/show.html.erb | 17 |
2 files changed, 18 insertions, 2 deletions
diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb index 6c93321..15b59f4 100644 --- a/app/views/matches/index.html.erb +++ b/app/views/matches/index.html.erb @@ -36,7 +36,8 @@ <SVG version="1.1" baseProfile="full" width="100%" height="<%= @height = [@height, 500].max %>" - xmlns="http://www.w3.org/2000/svg"> + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink"> <% lastrx = 0 lastry = 0 lastrh = 0 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> |