Commit 454da6fe by Sarina Canelake

i18n Inst Dash enrolled students profile table

LMS-2357
parent c2933d92
......@@ -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)
......
......@@ -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 = $ '<div/>', class: 'slickgrid'
......
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