Skip to content

Instantly share code, notes, and snippets.

@feanil
Last active April 17, 2022 17:19
Show Gist options
  • Save feanil/0b49d5219ae08baf1216556d455dfdbb to your computer and use it in GitHub Desktop.
Save feanil/0b49d5219ae08baf1216556d455dfdbb to your computer and use it in GitHub Desktop.
Instance Survey Instructions

Intro

To better understand the Open edX ecosystem, The Center for Reimagining Learning(tCRIL) would like to learn more about any Open edX instances you might be operating.

We aim to present the results of the Survey – all anonymized and in aggregate – at the Open edX Conference in April.

Single Instance Operators

If you operate only a single instance, please fill out this form with information about your instance.

Multiple Instance Operators

If you operate multiple sites, we'd love to hear about all of them. To ease reporting on multiple sites, we've setup a google sheet that you can duplicate to fill out the form information for multiple sites.

Once you've filled out the CSV/Sheet please send a copy of the data to instance-survey at openedx.org

In both cases, for a few of the questions, you may be able to run a simple query to get answers directly from your database.

If you run the following:

SELECT (
    select count(*) from course_overviews_courseoverview where start < now() and (end > now() OR end is NULL AND (select count(*) from student_courseenrollment where student_courseenrollment.course_id=course_overviews_courseoverview.id)>5)
) as current_uniqe_courses, (
    select count(*) from auth_user where last_login > date_sub(now(), interval 4 week)
) as active_users, (
    select count(*) from auth_user where is_active=1
) as total_users, (
    select count(*)  from student_courseenrollment as se join auth_user as au on se.user_id = au.id left join course_creators_coursecreator as cc on se.user_id = cc.user_id where is_staff=0 and is_superuser=0 and (cc.state is NULL or cc.state="unrequested")
) as total_enrollments, (
    select count(*) from grades_persistentcoursegrade where passed_timestamp is not NULL
) as total_course_completions, (
    select count(*) from site_configuration_siteconfiguration where enabled=1
) as active_sites, (
    select count(*) from organizations_organization where active=1
) as active_orgs;

You should get output that looks something like this:

+-----------------------+--------------+-------------+-------------------+--------------------------+--------------+-------------+
| current_uniqe_courses | active_users | total_users | total_enrollments | total_course_completions | active_sites | active_orgs |
+-----------------------+--------------+-------------+-------------------+--------------------------+--------------+-------------+
|                     1 |            2 |           4 |                 1 |                        0 |            2 |           1 |
+-----------------------+--------------+-------------+-------------------+--------------------------+--------------+-------------+

Note: total_course_completions may not be accurate if don't have Persistent Grades Enabled In this case, please omit this or provide us this information via some other means that you might have.

Individual Queries

If you'd prefer to run each query above individually, you can find them all seperated out below.

Number of Unique Courses Currently Offered

select count(*) from course_overviews_courseoverview where start < now() and (end > now() OR end is NULL);

Total Number of Learners Currently Using the Site

select count(*) from auth_user where last_login > date_sub(now(), interval 4 week);

Total Number of Learners ever Registered

select count(*) from auth_user where is_active=1;

Total Number of Enrollments for All Courses

select count(*)  from student_courseenrollment as se join auth_user as au on se.user_id = au.id left join course_creators_coursecreator as cc on se.user_id = cc.user_id where is_staff=0 and is_superuser=0 and (cc.state is NULL or cc.state="unrequested");

(Optional) Total Number of Course Completions

If you have Persistent Grades Enabled you can run the below query and get the latest information about how many users have passe their courses.

select count(*) from grades_persistentcoursegrade where passed_timestamp is not NULL;

Total Active Sites

select count(*) from site_configuration_siteconfiguration where enabled=1;

Total Active Orgs

select count(*) from organizations_organization where active=1;

Questions

If you have any questions or need more information, please also feel free to reach out to instance-survey at openedx.org

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment