summaryrefslogtreecommitdiff
path: root/lib/sampling
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sampling')
-rw-r--r--lib/sampling/manual.html.erb2
-rw-r--r--lib/sampling/manual.rb5
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/sampling/manual.html.erb b/lib/sampling/manual.html.erb
index b783506..187f002 100644
--- a/lib/sampling/manual.html.erb
+++ b/lib/sampling/manual.html.erb
@@ -2,7 +2,7 @@
<input type="hidden" name="update_action" value="finish" >
<% @match.teams.each do |team| %>
<label>
- <input type="radio", name="winner", value="<%= team.id %>" >
+ <input type="radio", name="win", value="<%= team.id %>" >
<%= "Team #{team.id} Won" %>
</label>
<% end %>
diff --git a/lib/sampling/manual.rb b/lib/sampling/manual.rb
index 4e86925..01f6835 100644
--- a/lib/sampling/manual.rb
+++ b/lib/sampling/manual.rb
@@ -44,7 +44,10 @@ module Sampling
end
def handle_user_interaction(user, sampling_params)
- # TODO
+ # => Save sampling_params as statistics
+ sampling_params.select {|name, value| @match.stats_from(self.class).include? name }.each do |name, value|
+ Statistic.create(name: value, user: user, match: @match)
+ end
end
end
end