diff --git a/lms/djangoapps/instructor/views/instructor_dashboard.py b/lms/djangoapps/instructor/views/instructor_dashboard.py index a2ab69d86d..fcbdddf5da 100644 --- a/lms/djangoapps/instructor/views/instructor_dashboard.py +++ b/lms/djangoapps/instructor/views/instructor_dashboard.py @@ -38,8 +38,8 @@ from student.roles import CourseFinanceAdminRole from bulk_email.models import CourseAuthorization from class_dashboard.dashboard_data import get_section_display_name, get_array_section_has_problem -from analyticsclient.client import RestClient, ClientError -from analyticsclient.course import Course +from analyticsclient.client import Client +from analyticsclient.exceptions import ClientError from .tools import get_units_with_due_date, title_or_url, bulk_email_is_enabled_for_course from opaque_keys.edx.locations import SlashSeparatedCourseKey @@ -386,16 +386,17 @@ def _update_active_students(course_key, section_data): section_data['active_student_count_end'] = 'N/A' try: - client = RestClient(base_url=base_url, auth_token=auth_token) - course = Course(client, course_key.to_deprecated_string()) + client = Client(base_url=base_url, auth_token=auth_token) + course = client.courses(unicode(course_key)) - section_data['active_student_count'] = course.recent_active_user_count['count'] + recent_activity = course.recent_activity() + section_data['active_student_count'] = recent_activity['count'] def format_date(value): return value.split('T')[0] - start = course.recent_active_user_count['interval_start'] - end = course.recent_active_user_count['interval_end'] + start = recent_activity['interval_start'] + end = recent_activity['interval_end'] section_data['active_student_count_start'] = format_date(start) section_data['active_student_count_end'] = format_date(end) diff --git a/requirements/edx/github.txt b/requirements/edx/github.txt index f9ebe3ae03..7f0e3ef66d 100644 --- a/requirements/edx/github.txt +++ b/requirements/edx/github.txt @@ -24,7 +24,7 @@ -e git+https://github.com/edx/js-test-tool.git@v0.1.5#egg=js_test_tool -e git+https://github.com/edx/django-waffle.git@823a102e48#egg=django-waffle -e git+https://github.com/edx/event-tracking.git@0.1.0#egg=event-tracking --e git+https://github.com/edx/edx-analytics-api-client.git@0.1.0#egg=analytics-client +-e git+https://github.com/edx/edx-analytics-data-api-client.git@0.1.0#egg=edx-analytics-data-api-client -e git+https://github.com/edx/bok-choy.git@9162c0bfb8e0eb1e2fa8e6df8dec12d181322a90#egg=bok_choy -e git+https://github.com/edx-solutions/django-splash.git@7579d052afcf474ece1239153cffe1c89935bc4f#egg=django-splash -e git+https://github.com/edx/acid-block.git@459aff7b63db8f2c5decd1755706c1a64fb4ebb1#egg=acid-xblock