diff --git a/lms/djangoapps/instructor/views/api.py b/lms/djangoapps/instructor/views/api.py index 4021bedfb4..59496a9753 100644 --- a/lms/djangoapps/instructor/views/api.py +++ b/lms/djangoapps/instructor/views/api.py @@ -511,17 +511,35 @@ def get_students_features(request, course_id, csv=False): # pylint: disable=W06 TO DO accept requests for different attribute sets. """ available_features = analytics.basic.AVAILABLE_FEATURES - query_features = ['username', 'name', 'email', 'language', 'location', 'year_of_birth', 'gender', - 'level_of_education', 'mailing_address', 'goals'] + query_features = [ + 'username', 'name', 'email', 'language', 'location', 'year_of_birth', + 'gender', 'level_of_education', 'mailing_address', 'goals' + ] student_data = analytics.basic.enrolled_students_features(course_id, query_features) + # Scrape the query features for i18n - can't translate here because it breaks further queries + # and how the coffeescript works. The actual translation will be done in data_download.coffee + query_features_names = { + 'username': _('Username'), + 'name': _('Name'), + 'email': _('Email'), + 'language': _('Language'), + 'location': _('Location'), + 'year_of_birth': _('Birth Year'), + 'gender': _('Gender'), + 'level_of_education': _('Level of Education'), + 'mailing_address': _('Mailing Address'), + 'goals': _('Goals'), + } + if not csv: response_payload = { 'course_id': course_id, 'students': student_data, 'students_count': len(student_data), 'queried_features': query_features, + 'feature_names': query_features_names, 'available_features': available_features, } return JsonResponse(response_payload) diff --git a/lms/static/coffee/src/instructor_dashboard/data_download.coffee b/lms/static/coffee/src/instructor_dashboard/data_download.coffee index b8f89c5fe8..d2e0260e42 100644 --- a/lms/static/coffee/src/instructor_dashboard/data_download.coffee +++ b/lms/static/coffee/src/instructor_dashboard/data_download.coffee @@ -75,7 +75,7 @@ class DataDownload forceFitColumns: true rowHeight: 35 - columns = ({id: feature, field: feature, name: feature} for feature in data.queried_features) + columns = ({id: feature, field: feature, name: data.feature_names[feature]} for feature in data.queried_features) grid_data = data.students $table_placeholder = $ '
', class: 'slickgrid'