Removed Analytics API Client
Instructors should use Insights instead.
This commit is contained in:
@@ -15,7 +15,7 @@ from django.views.decorators.cache import cache_control
|
||||
from edxmako.shortcuts import render_to_response
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.utils.html import escape
|
||||
from django.http import Http404, HttpResponse, HttpResponseNotFound
|
||||
from django.http import Http404
|
||||
from django.conf import settings
|
||||
from util.json_request import JsonResponse
|
||||
|
||||
@@ -35,13 +35,10 @@ from course_modes.models import CourseMode, CourseModesArchive
|
||||
from student.roles import CourseFinanceAdminRole
|
||||
|
||||
from class_dashboard.dashboard_data import get_section_display_name, get_array_section_has_problem
|
||||
|
||||
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
|
||||
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -368,9 +365,6 @@ def _section_analytics(course, access):
|
||||
'proxy_legacy_analytics_url': reverse('proxy_legacy_analytics', kwargs={'course_id': course_key.to_deprecated_string()}),
|
||||
}
|
||||
|
||||
if settings.FEATURES.get('ENABLE_ANALYTICS_ACTIVE_COUNT'):
|
||||
_update_active_students(course_key, section_data)
|
||||
|
||||
return section_data
|
||||
|
||||
|
||||
@@ -389,31 +383,3 @@ def _section_metrics(course, access):
|
||||
'post_metrics_data_csv_url': reverse('post_metrics_data_csv'),
|
||||
}
|
||||
return section_data
|
||||
|
||||
|
||||
def _update_active_students(course_key, section_data):
|
||||
auth_token = settings.ANALYTICS_DATA_TOKEN
|
||||
base_url = settings.ANALYTICS_DATA_URL
|
||||
|
||||
section_data['active_student_count'] = 'N/A'
|
||||
section_data['active_student_count_start'] = 'N/A'
|
||||
section_data['active_student_count_end'] = 'N/A'
|
||||
|
||||
try:
|
||||
client = Client(base_url=base_url, auth_token=auth_token)
|
||||
course = client.courses(unicode(course_key))
|
||||
|
||||
recent_activity = course.recent_activity()
|
||||
section_data['active_student_count'] = recent_activity['count']
|
||||
|
||||
def format_date(value):
|
||||
return value.split('T')[0]
|
||||
|
||||
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)
|
||||
|
||||
except (ClientError, KeyError) as e:
|
||||
log.exception(e)
|
||||
|
||||
@@ -268,10 +268,6 @@ FEATURES = {
|
||||
# nonzero grade cutoff is met
|
||||
'SHOW_PROGRESS_SUCCESS_BUTTON': False,
|
||||
|
||||
# Analytics Data API (for active student count)
|
||||
# Default to false here b/c dev environments won't have the api, will override in aws.py
|
||||
'ENABLE_ANALYTICS_ACTIVE_COUNT': False,
|
||||
|
||||
# When a logged in user goes to the homepage ('/') should the user be
|
||||
# redirected to the dashboard - this is default Open edX behavior. Set to
|
||||
# False to not redirect the user
|
||||
@@ -1833,7 +1829,7 @@ ADVANCED_SECURITY_CONFIG = {}
|
||||
SHIBBOLETH_DOMAIN_PREFIX = 'shib:'
|
||||
OPENID_DOMAIN_PREFIX = 'openid:'
|
||||
|
||||
### Analytics data api settings
|
||||
### Analytics Data API + Dashboard (Insights) settings
|
||||
ANALYTICS_DATA_URL = ""
|
||||
ANALYTICS_DATA_TOKEN = ""
|
||||
ANALYTICS_DASHBOARD_URL = ""
|
||||
|
||||
@@ -274,10 +274,6 @@ PIPELINE_SASS_ARGUMENTS = '--debug-info --require {proj_dir}/static/sass/bourbon
|
||||
ANALYTICS_SERVER_URL = "http://127.0.0.1:9000/"
|
||||
ANALYTICS_API_KEY = ""
|
||||
|
||||
ANALYTICS_DATA_URL = "http://127.0.0.1:8080"
|
||||
ANALYTICS_DATA_TOKEN = ""
|
||||
FEATURES['ENABLE_ANALYTICS_ACTIVE_COUNT'] = False
|
||||
|
||||
##### Segment.io ######
|
||||
|
||||
# If there's an environment variable set, grab it and turn on Segment.io
|
||||
|
||||
@@ -37,10 +37,6 @@ FEATURES['REQUIRE_COURSE_EMAIL_AUTH'] = False # Give all courses email (don't r
|
||||
ANALYTICS_SERVER_URL = "http://127.0.0.1:9000/"
|
||||
ANALYTICS_API_KEY = ""
|
||||
|
||||
ANALYTICS_DATA_URL = "http://127.0.0.1:8080"
|
||||
ANALYTICS_DATA_TOKEN = ""
|
||||
FEATURES['ENABLE_ANALYTICS_ACTIVE_COUNT'] = False
|
||||
|
||||
# Set this to the dashboard URL in order to display the link from the
|
||||
# dashboard to the Analytics Dashboard.
|
||||
ANALYTICS_DASHBOARD_URL = None
|
||||
|
||||
@@ -15,18 +15,6 @@
|
||||
</div>
|
||||
</script>
|
||||
|
||||
%if settings.FEATURES.get('ENABLE_ANALYTICS_ACTIVE_COUNT'):
|
||||
<div class="enrollment-wrapper" style="margin-bottom: 40px;">
|
||||
<h2>${_("Active Students")}</h2>
|
||||
<span class="tip">${_("The count of students who interacted at least once by opening pages, playing videos, posting in discussions, submitting problems, or completing other activities. The date range includes all activities from midnight on the start date (inclusive) though midnight on the end date (exclusive).")}</span>
|
||||
<br/><br/>
|
||||
<span style="color: green;"><b>${ section_data['active_student_count'] }</b></span>
|
||||
for the week of (${ section_data['active_student_count_start'] } - ${ section_data['active_student_count_end'] })
|
||||
</div>
|
||||
%endif
|
||||
|
||||
<hr>
|
||||
|
||||
%if settings.FEATURES['ENABLE_INSTRUCTOR_ANALYTICS']:
|
||||
<script type="text/template" id="grade-distributions-widget-template">
|
||||
<div class="grade-distributions-widget">
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
-e git+https://github.com/edx/diff-cover.git@v0.7.1#egg=diff_cover
|
||||
-e git+https://github.com/edx/js-test-tool.git@v0.1.5#egg=js_test_tool
|
||||
-e git+https://github.com/edx/event-tracking.git@0.1.0#egg=event-tracking
|
||||
-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@4a259e3548a19e41cc39433caf68ea58d10a27ba#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@df1a7f0cae46567c251d507b8c72168aed8ec042#egg=acid-xblock
|
||||
|
||||
Reference in New Issue
Block a user