summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrewMurrell <amurrel@purdue.edu>2014-04-28 19:32:32 -0400
committerAndrewMurrell <amurrel@purdue.edu>2014-04-28 19:32:32 -0400
commit55f4c94d089ce622bd4fe0b4c915e8e4cb4122aa (patch)
treefcf2a0bd0202ffb5be80baf74ff0599d80aa5c72
parentb6e81846fe2fc87c98e64679638d678df1152ce9 (diff)
changes to peer review and manual sampling
-rw-r--r--lib/sampling/manual.html.erb11
-rw-r--r--lib/sampling/manual.rb2
-rw-r--r--lib/sampling/peer_review.html.erb2
-rw-r--r--lib/sampling/peer_review.rb2
4 files changed, 8 insertions, 9 deletions
diff --git a/lib/sampling/manual.html.erb b/lib/sampling/manual.html.erb
index c9dd2fe..7b71c29 100644
--- a/lib/sampling/manual.html.erb
+++ b/lib/sampling/manual.html.erb
@@ -1,12 +1,11 @@
-<% if @tournament.hosts.include? current_user %>
- <input type="hidden" name="update_action" value="finish">
+<% if @tournament.hosts.include? @current_user %>
+ <input type="hidden" name="update_action" value="finish" >
<% @match.teams.each do |team| %>
- <%= tag :input, {"type" => "radio", "name" => "winner", "value" => "#{team.id}" } %>
+ <input type="radio", name="winner", value="<%= team.id %>" >
<%= "Team #{team.id} Won" %>
<% end %>
-
- <%= submit_tag("Finish match") %>
- <%= @tournament.settings['ScoringMethod'] %>
+ <br>
+ <input type="submit", value="Finish match" >
<% else %>
<p>The match is running; the host has yet to post the scores of the match.</p>
<% end %> \ No newline at end of file
diff --git a/lib/sampling/manual.rb b/lib/sampling/manual.rb
index 1787cb7..4e86925 100644
--- a/lib/sampling/manual.rb
+++ b/lib/sampling/manual.rb
@@ -40,7 +40,7 @@ module Sampling
erb_filename = File.join(__FILE__.sub(/\.rb$/, '.html.erb'))
erb = ERB.new(File.read(erb_filename))
erb.filename = erb_filename
- return erb.result.html_safe
+ return erb.result(binding).html_safe
end
def handle_user_interaction(user, sampling_params)
diff --git a/lib/sampling/peer_review.html.erb b/lib/sampling/peer_review.html.erb
index e744936..a0b9c4d 100644
--- a/lib/sampling/peer_review.html.erb
+++ b/lib/sampling/peer_review.html.erb
@@ -18,7 +18,7 @@
<%# TODO: display more statistics %>
</li><% end %>
</ol>
- <%= submit_tag("Submit peer evaluation", :onsubmit => "score_peers()") %>
+ <input type="submit" value="Submit peer evaluation", onsubmit="score_peers()") >
<% else %>
<p>Still waiting for peer feedback from the following users:
<ul><% @feedbacks_missing.each do |user| %>
diff --git a/lib/sampling/peer_review.rb b/lib/sampling/peer_review.rb
index e86595f..1aabe34 100644
--- a/lib/sampling/peer_review.rb
+++ b/lib/sampling/peer_review.rb
@@ -39,7 +39,7 @@ module Sampling
erb_filename = File.join(__FILE__.sub(/\.rb$/, '.html.erb'))
erb = ERB.new(File.read(erb_filename))
erb.filename = erb_filename
- return erb.result.html_safe
+ return erb.result(binding).html_safe
end
def handle_user_interaction(reviewing_user, params)