From 13579ca9a823a32bba87e5361ab7debdec7e75b8 Mon Sep 17 00:00:00 2001 From: Clinton Blackburn Date: Wed, 29 Oct 2014 12:28:16 -0400 Subject: [PATCH] Updates to Demographics Display - Gating on feature enabled for Open edX users - If feature disabled and Insights URL is set, displaying message pointing users to Insights --- .../instructor/views/instructor_dashboard.py | 8 ++++ lms/envs/common.py | 3 ++ .../instructor_analytics.html | 38 ++++++++++--------- 3 files changed, 32 insertions(+), 17 deletions(-) diff --git a/lms/djangoapps/instructor/views/instructor_dashboard.py b/lms/djangoapps/instructor/views/instructor_dashboard.py index 190e10fb7b..315b78413b 100644 --- a/lms/djangoapps/instructor/views/instructor_dashboard.py +++ b/lms/djangoapps/instructor/views/instructor_dashboard.py @@ -365,6 +365,14 @@ def _section_analytics(course, access): 'proxy_legacy_analytics_url': reverse('proxy_legacy_analytics', kwargs={'course_id': course_key.to_deprecated_string()}), } + if settings.ANALYTICS_DASHBOARD_URL: + # Construct a URL to the external analytics dashboard + analytics_dashboard_url = '{0}/courses/{1}'.format(settings.ANALYTICS_DASHBOARD_URL, unicode(course_key)) + dashboard_link = "{1}".format(analytics_dashboard_url, + settings.ANALYTICS_DASHBOARD_NAME) + message = _("Demographic data is now available in {dashboard_link}.").format(dashboard_link=dashboard_link) + section_data['demographic_message'] = message + return section_data diff --git a/lms/envs/common.py b/lms/envs/common.py index 97900cd92a..83f50778ec 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -288,6 +288,9 @@ FEATURES = { # to allow an upload of a CSV file that contains a list of new accounts to create # and register for course. 'ALLOW_AUTOMATED_SIGNUPS': False, + + # Display demographic data on the analytics tab in the instructor dashboard. + 'DISPLAY_ANALYTICS_DEMOGRAPHICS': True } # Ignore static asset files on import which match this pattern diff --git a/lms/templates/instructor/instructor_dashboard_2/instructor_analytics.html b/lms/templates/instructor/instructor_dashboard_2/instructor_analytics.html index 07c86b7809..c75501cd0b 100644 --- a/lms/templates/instructor/instructor_dashboard_2/instructor_analytics.html +++ b/lms/templates/instructor/instructor_dashboard_2/instructor_analytics.html @@ -44,24 +44,28 @@
%endif -
+%if settings.FEATURES['DISPLAY_ANALYTICS_DEMOGRAPHICS']: +
-
+
-
+
-
+
-
+
+%elif section_data['demographic_message']: +

${section_data['demographic_message']}

+%endif