diff --git a/app/logical/reports/janitor_trials.rb b/app/logical/reports/janitor_trials.rb index a23afa994..26c69e1e7 100644 --- a/app/logical/reports/janitor_trials.rb +++ b/app/logical/reports/janitor_trials.rb @@ -1,14 +1,14 @@ module Reports class JanitorTrials class Janitor - attr_reader :trial + attr_reader :user - def initialize(trial) - @trial = trial + def initialize(user) + @user = user end - def user - trial.user + def trial + JanitorTrial.where(user_id: user.id).first end def since @@ -39,7 +39,7 @@ module Reports end def janitors - JanitorTrial.where(status: "active").to_a.map {|x| Janitor.new(x)} + User.where("level >= ?", User::Levels::JANITOR).to_a.map {|x| Janitor.new(x)} end end end diff --git a/app/views/reports/janitor_trials.html.erb b/app/views/reports/janitor_trials.html.erb index b70b5f2e2..0077ce2fa 100644 --- a/app/views/reports/janitor_trials.html.erb +++ b/app/views/reports/janitor_trials.html.erb @@ -2,7 +2,7 @@
All numbers shown are for the past 3 months. Binomial proportion confidence interval for how likely a janitor's approvals will achieve a score of at at least n with 95% confidence.
+All numbers shown are for the past 3 months. Binomial proportion confidence interval for how likely a janitor's approvals will achieve a score of at at least n with 95% confidence. Most statistics are not significant unless there are at least 300 approvals.
| <%= janitor.percentile_50_score %> | <%= number_to_percentage janitor.confidence_interval, :precision => 0 %> |
- <% if CurrentUser.user.is_moderator? %>
+ <% if CurrentUser.user.is_moderator? && janitor.trial %>
<%= link_to "Promote", promote_janitor_trial_path(janitor.trial), :method => :put, :remote => true %>
| <%= link_to "Demote", demote_janitor_trial_path(janitor.trial), :method => :put, :remote => true %>
<% end %>
diff --git a/app/views/reports/user_promotions.html.erb b/app/views/reports/user_promotions.html.erb
index 7ce132b56..3e8c7be2f 100644
--- a/app/views/reports/user_promotions.html.erb
+++ b/app/views/reports/user_promotions.html.erb
@@ -2,7 +2,7 @@
User Promotion Confidence Intervals-Binomial proportion confidence interval for how likely a user's uploads will achieve a score of at at least n with 95% confidence within the past 30 days. +Binomial proportion confidence interval for how likely a user's uploads will achieve a score of at at least n with 95% confidence within the past 30 days. Most statistics are not significant unless there are at least 300 uploads. |