diff --git a/app/logical/reports/user_promotions.rb b/app/logical/reports/user_promotions.rb index 8885797f6..cdcc5aa89 100644 --- a/app/logical/reports/user_promotions.rb +++ b/app/logical/reports/user_promotions.rb @@ -16,7 +16,7 @@ module Reports end def self.confidence_interval_for(user, n) - up_votes = Post.where("created_at >= ?", min_time).where(:uploader_id => user.id).where("fav_count >= ?", n).count + up_votes = Post.where("created_at >= ?", min_time).where(:is_deleted => false, :uploader_id => user.id).where("score >= ?", n).count total_votes = Post.where("created_at >= ?", min_time).where(:uploader_id => user.id).count ci_lower_bound(up_votes, total_votes, 0.95) end @@ -36,7 +36,7 @@ module Reports end def users - ::User.where("users.level < ? and users.post_upload_count >= 100", ::User::Levels::CONTRIBUTOR).order("created_at desc").limit(50).map {|x| Reports::UserPromotions::User.new(x)} + ::User.where("users.level < ? and users.post_upload_count >= 150", ::User::Levels::CONTRIBUTOR).order("created_at desc").limit(50).map {|x| Reports::UserPromotions::User.new(x)} end end end diff --git a/app/views/reports/user_promotions.html.erb b/app/views/reports/user_promotions.html.erb index 26ba0d0e1..cbdcc8972 100644 --- a/app/views/reports/user_promotions.html.erb +++ b/app/views/reports/user_promotions.html.erb @@ -2,7 +2,7 @@
Binomial proportion confidence interval for how likely a user's uploads will achieve a fav count 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.
| Level | Uploads | Age | -score:1+ | score:5+ | score:10+ | @@ -19,15 +18,16 @@ <% cache("user-promotions-report/#{Date.today}") do %> <% @report.users.each do |user| %> -|
|---|---|---|---|---|---|---|
| <%= link_to user.name, user_path(user.user) %> | -<%= user.level_string %> | -<%= user.post_upload_count %> | -<%= time_ago_in_words user.created_at %> | -<%= number_to_percentage user.confidence_interval_for(1), :precision => 0 %> | -<%= number_to_percentage user.confidence_interval_for(5), :precision => 0 %> | -<%= number_to_percentage user.confidence_interval_for(10), :precision => 0 %> | -
| <%= link_to user.name, user_path(user.user) %> | +<%= user.level_string %> | +<%= user.post_upload_count %> | +<%= time_ago_in_words user.created_at %> | +<%= number_to_percentage user.confidence_interval_for(5), :precision => 0 %> | +<%= number_to_percentage user.confidence_interval_for(10), :precision => 0 %> | +