summaryrefslogtreecommitdiff
path: root/app/views/matches
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/views/matches
parentc78b419b494b4dc52e7d83b6028664a04b9cb010 (diff)
Updated Peer Review -- Now allows review and scoring -- not tested because Davis can not yaml.
Diffstat (limited to 'app/views/matches')
-rw-r--r--app/views/matches/show.html.erb19
1 files changed, 17 insertions, 2 deletions
diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb
index cd30926..a0540f9 100644
--- a/app/views/matches/show.html.erb
+++ b/app/views/matches/show.html.erb
@@ -117,7 +117,7 @@
<% if @tournament.players.include?(current_user) %>
<br />
<div id="host">
- <%= form_tag(tournament_match_path(@tournament, @match), method: "put") do %>
+ <%= form_tag(tournament_match_path(@tournament, @match), method: "put", name: "peeris") do %>
<% case @match.status %>
<% when 0 %>
<input type="hidden" name="update_action" value="start">
@@ -126,8 +126,9 @@
<input type="hidden" name="update_action" value="peer">
<%= submit_tag("Begin Peer Evaluation") %>
<% when 2 %>
+ <input type="hidden" name="review_action" value="">
<input type="hidden" name="update_action" value="finish">
- <%= submit_tag("End Match") %>
+ <%= submit_tag("End Peer Evaluation", :onsubmit => "score_peers()") %>
<% when 3 %>
<input type="hidden" name="update_action" value="reset">
<%= submit_tag("Reset Status") %>
@@ -136,3 +137,17 @@
</div>
<% end %>
+
+<script type="text/javascript">
+ //get each player in order and assign score here!
+ var $lisp = $('ol li peeris');
+ var comma = ","
+ for(var i=0; i < $lisp.length; i++) {
+ if ( i == lisp.length-1) {
+ comma = "";
+ }
+ $('review_action').value += $('ol li peeris:eq(' + i + ')').text() + comma;
+ }
+</script>
+
+