diff --git a/app/logical/reports/janitor_trials.rb b/app/logical/reports/janitor_trials.rb index 445a32097..be76d415a 100644 --- a/app/logical/reports/janitor_trials.rb +++ b/app/logical/reports/janitor_trials.rb @@ -19,10 +19,6 @@ module Reports @approval_count ||= Post.where("approver_id = ? and created_at >= ?", user.id, since).count end - def deleted_count - Post.where("approver_id = ? and created_at >= ? and is_deleted = true", user.id, since).count - end - def percentile_25_score ActiveRecord::Base.select_value_sql("select percentile_cont(0.25) within group (order by score) from posts where created_at >= ? and approver_id = ?", since, user.id).to_i end @@ -31,10 +27,10 @@ module Reports ActiveRecord::Base.select_value_sql("select percentile_cont(0.50) within group (order by score) from posts where created_at >= ? and approver_id = ?", since, user.id).to_i end - def confidence_interval - hits = Post.where("approver_id = ? and created_at >= ? and score >= 3", user.id, since).count + def deletion_confidence + hits = Post.where("approver_id = ? and created_at >= ? and is_deleted = true", user.id, since).count total = Post.where("approver_id = ? and created_at >= ?", user.id, since).count - Reports::UserPromotions.ci_lower_bound(hits, total, 0.95) + Reports::UserPromotions.ci_lower_bound(hits, total, 0.95).to_i end end diff --git a/app/views/reports/janitor_trials.html.erb b/app/views/reports/janitor_trials.html.erb index 9db2733e5..d01d9f894 100644 --- a/app/views/reports/janitor_trials.html.erb +++ b/app/views/reports/janitor_trials.html.erb @@ -10,10 +10,9 @@ User Level Approvals - Deleted + Del Chance Quartile Score Median Score - score:3+ @@ -23,10 +22,9 @@ <%= link_to_user janitor.user %> <%= janitor.user.level_string %> <%= link_to janitor.approval_count, posts_path(:tags => "approver:#{janitor.user.name} order:random", :limit => 200) %> - <%= link_to janitor.deleted_count, posts_path(:tags => "approver:#{janitor.user.name} status:deleted", :limit => 200) %> + <%= link_to janitor.deletion_confidence, posts_path(:tags => "approver:#{janitor.user.name} status:deleted", :limit => 200) %> <%= janitor.percentile_25_score %> <%= janitor.percentile_50_score %> - <%= number_to_percentage janitor.confidence_interval, :precision => 0 %> <% if CurrentUser.user.is_moderator? && janitor.trial %> <%= link_to "Promote", promote_janitor_trial_path(janitor.trial), :method => :put, :remote => true %>