Commit 361e9ed0 by Your Name

move hard coded number to rake file

parent c23fca25
...@@ -19,7 +19,7 @@ namespace :kpis do ...@@ -19,7 +19,7 @@ namespace :kpis do
puts "*********************************************************************\n\n" puts "*********************************************************************\n\n"
courses.each do |c| courses.each do |c|
contributors = Content.prolific_metric({"course_id" => c}) contributors = Content.prolific_metric({"course_id" => c}, 10)
#now output #now output
puts c puts c
puts "*********************" puts "*********************"
...@@ -46,7 +46,7 @@ namespace :kpis do ...@@ -46,7 +46,7 @@ namespace :kpis do
puts "*********************************************************************\n\n" puts "*********************************************************************\n\n"
courses.each do |c| 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 #now output
puts c puts c
puts "*********************" puts "*********************"
...@@ -73,7 +73,7 @@ namespace :kpis do ...@@ -73,7 +73,7 @@ namespace :kpis do
courses.each do |c| courses.each do |c|
#first, get all the users who have contributed #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 total_users = contributors.count
#now, get the threads #now, get the threads
......
...@@ -10,12 +10,10 @@ class Content ...@@ -10,12 +10,10 @@ class Content
end end
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 #take a hash of criteria (what) and return a hash of hashes
#course => user => count #course => user => count
count = 10
contributors = {} contributors = {}
map = "function(){emit(this.author_id,1)}" 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