Commit 13579ca9 by Clinton Blackburn

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
parent 7b88d3d0
......@@ -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 = "<a href=\"{0}\" target=\"_blank\">{1}</a>".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
......
......@@ -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
......
......@@ -44,24 +44,28 @@
<hr>
%endif
<div class="profile-distribution-widget-container"
data-title="${_("Year of Birth")}"
data-feature="year_of_birth"
data-endpoint="${ section_data['get_distribution_url'] }"
></div>
%if settings.FEATURES['DISPLAY_ANALYTICS_DEMOGRAPHICS']:
<div class="profile-distribution-widget-container"
data-title="${_("Year of Birth")}"
data-feature="year_of_birth"
data-endpoint="${ section_data['get_distribution_url'] }"
></div>
<hr>
<hr>
<div class="profile-distribution-widget-container"
data-title="${_("Gender Distribution")}"
data-feature="gender"
data-endpoint="${ section_data['get_distribution_url'] }"
></div>
<div class="profile-distribution-widget-container"
data-title="${_("Gender Distribution")}"
data-feature="gender"
data-endpoint="${ section_data['get_distribution_url'] }"
></div>
<hr>
<hr>
<div class="profile-distribution-widget-container"
data-title="${_("Level of Education")}"
data-feature="level_of_education"
data-endpoint="${ section_data['get_distribution_url'] }"
></div>
<div class="profile-distribution-widget-container"
data-title="${_("Level of Education")}"
data-feature="level_of_education"
data-endpoint="${ section_data['get_distribution_url'] }"
></div>
%elif section_data['demographic_message']:
<p><em>${section_data['demographic_message']}</em></p>
%endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment