Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
01c8d9b0
Commit
01c8d9b0
authored
May 16, 2016
by
Christina Roberts
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12475 from edx/christina/fix-column-order
Move city and country fields to the very end.
parents
0b700a7b
ab442bd7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
lms/djangoapps/instructor/tests/test_api.py
+5
-0
lms/djangoapps/instructor/views/api.py
+7
-3
No files found.
lms/djangoapps/instructor/tests/test_api.py
View file @
01c8d9b0
...
...
@@ -2519,6 +2519,9 @@ class TestInstructorAPILevelsDataDump(SharedModuleStoreTestCase, LoginEnrollment
Test that some minimum of information is formatted
correctly in the response to get_students_features.
"""
for
student
in
self
.
students
:
student
.
profile
.
city
=
"Mos Eisley {}"
.
format
(
student
.
id
)
student
.
profile
.
save
()
url
=
reverse
(
'get_students_features'
,
kwargs
=
{
'course_id'
:
self
.
course
.
id
.
to_deprecated_string
()})
response
=
self
.
client
.
get
(
url
,
{})
res_json
=
json
.
loads
(
response
.
content
)
...
...
@@ -2530,6 +2533,8 @@ class TestInstructorAPILevelsDataDump(SharedModuleStoreTestCase, LoginEnrollment
][
0
]
self
.
assertEqual
(
student_json
[
'username'
],
student
.
username
)
self
.
assertEqual
(
student_json
[
'email'
],
student
.
email
)
self
.
assertEqual
(
student_json
[
'city'
],
student
.
profile
.
city
)
self
.
assertEqual
(
student_json
[
'country'
],
""
)
@ddt.data
(
True
,
False
)
def
test_get_students_features_cohorted
(
self
,
is_cohorted
):
...
...
lms/djangoapps/instructor/views/api.py
View file @
01c8d9b0
...
...
@@ -1246,7 +1246,7 @@ def get_students_features(request, course_id, csv=False): # pylint: disable=red
query_features
=
[
'id'
,
'username'
,
'name'
,
'email'
,
'language'
,
'location'
,
'year_of_birth'
,
'gender'
,
'level_of_education'
,
'mailing_address'
,
'goals'
,
'city'
,
'country'
'goals'
,
]
# Provide human-friendly and translatable names for these features. These names
...
...
@@ -1264,8 +1264,6 @@ def get_students_features(request, course_id, csv=False): # pylint: disable=red
'level_of_education'
:
_
(
'Level of Education'
),
'mailing_address'
:
_
(
'Mailing Address'
),
'goals'
:
_
(
'Goals'
),
'city'
:
_
(
'City'
),
'country'
:
_
(
'Country'
),
}
if
is_course_cohorted
(
course
.
id
):
...
...
@@ -1277,6 +1275,12 @@ def get_students_features(request, course_id, csv=False): # pylint: disable=red
query_features
.
append
(
'team'
)
query_features_names
[
'team'
]
=
_
(
'Team'
)
# For compatibility reasons, city and country should always appear last.
query_features
.
append
(
'city'
)
query_features_names
[
'city'
]
=
_
(
'City'
)
query_features
.
append
(
'country'
)
query_features_names
[
'country'
]
=
_
(
'Country'
)
if
not
csv
:
student_data
=
instructor_analytics
.
basic
.
enrolled_students_features
(
course_key
,
query_features
)
response_payload
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment