Commit 361e9ed0 by Your Name

move hard coded number to rake file

parent c23fca25
......@@ -19,7 +19,7 @@ namespace :kpis do
puts "*********************************************************************\n\n"
courses.each do |c|
contributors = Content.prolific_metric({"course_id" => c})
contributors = Content.prolific_metric({"course_id" => c}, 10)
#now output
puts c
puts "*********************"
......@@ -46,7 +46,7 @@ namespace :kpis do
puts "*********************************************************************\n\n"
courses.each do |c|
contributors = Content.prolific_metric({"course_id" => c, "_type" => "CommentThread"})
contributors = Content.prolific_metric({"course_id" => c, "_type" => "CommentThread"}, 10)
#now output
puts c
puts "*********************"
......@@ -73,7 +73,7 @@ namespace :kpis do
courses.each do |c|
#first, get all the users who have contributed
contributors = Content.prolific_metric({"course_id" => c})
contributors = Content.prolific_metric({"course_id" => c}, 10)
total_users = contributors.count
#now, get the threads
......
......@@ -10,12 +10,10 @@ class Content
end
end
def self.prolific_metric what
def self.prolific_metric what, count
#take a hash of criteria (what) and return a hash of hashes
#course => user => count
count = 10
contributors = {}
map = "function(){emit(this.author_id,1)}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment