Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cs_comments_service
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
cs_comments_service
Commits
2dbec2ba
Commit
2dbec2ba
authored
Dec 17, 2012
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
next kpi
parent
50c92595
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
lib/tasks/kpis.rake
+32
-0
No files found.
lib/tasks/kpis.rake
View file @
2dbec2ba
...
@@ -94,6 +94,38 @@ namespace :kpis do
...
@@ -94,6 +94,38 @@ namespace :kpis do
puts
"
\n
"
puts
"
\n
"
end
end
task
:epu
=>
:environment
do
#USAGE
#SINATRA_ENV=development rake kpis:ppu
#or
#SINATRA_ENV=development bundle exed rake kpis:ppu
courses
=
Content
.
all
.
distinct
(
"course_id"
)
puts
"
\n\n
**************************************************************************************************************************************"
puts
"Average contributions (votes, comments, endorsements, or threads or follows) per contributing user per course on edX (
#{
Date
.
today
}
) "
puts
"******************************************************************************************************************************************
\n\n
"
courses
.
each
do
|
c
|
#first, get all the users who have contributed
contributors
=
Content
.
prolific_metric
({
"course_id"
=>
c
})
total_users
=
contributors
.
count
#now, get the threads
total_threads
=
Content
.
where
(
"_type"
=>
"CommentThread"
,
"course_id"
=>
c
).
count
ratio
=
total_threads
.
to_f
/
total_users
.
to_f
#now output
puts
c
puts
"*********************"
puts
"Total Threads:
#{
total_threads
}
"
puts
"Total Users:
#{
total_users
}
"
puts
"Average Thread/User:
#{
ratio
}
"
puts
"
\n
"
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment