closes CNVS-37752
Test Plan:
1. Create a course that has some active students, inactive students,
concluded students, and a fake student. Enable New Gradebook and go
to the gradebook.
2. Click on the student header and select 'Inactive enrollments' and
'Concluded enrollments'. Then select 'Sort by -> A-Z'.
3. As a teacher in the course, hit the user_ids endpoint and verify you
get a list of user IDs back. The user IDs should be ordered such
that their corresponding users' names are in alpha ascending order.
The list of user IDs should also include inactive and concluded
students' IDs. The fake student's ID should always be last.
4. Go to the gradebook and click on the student header. Select 'Sort by
-> Z-A'.
5. Hit the user_ids endpoint and verify the returned user IDs are now
ordered such that their corresponding users' names are in alpha
descending order. The list of user IDs should also include inactive
and concluded students' IDs. The fake student's ID should be last.
6. Go to the gradebook and click on the student column header. Deselect
the 'Inactive enrollments' and 'Concluded enrollments' options.
7. Hit the user_ids endpoint and verify the returned user IDs no longer
include IDs for inactive or concluded students. The IDs should still
be ordered such that their corresponding users' names are in alpha
descending order. The fake student's ID should be last.
8. Go to the gradebook and click on the total grade header. Select
'Sort by Grade -> Low to High'
9. Hit the user_ids endpoint and verify the returned user IDs are
ordered such that their corresponding users' current total grades
are in ascending order. The fake student's ID should be last.
10. Go to the gradebook and click on the total grade header. Select
'Sort by Grade -> High to Low'
11. Hit the user_ids endpoint and verify the returned user IDs are
ordered such that their corresponding users' current total grades
are in descending order. The fake student's ID should be last.
12. In the same manner as the steps above, make sure changing the
following settings in the gradebook causes the user_ids
endpoint to return an array of IDs ordered according to the
gradebook sort preferences, with the fake student's ID sorted last:
a) Assignment column header -> Sort by Grade -> Low to High
b) Assignment column header -> Sort by Grade -> High to Low
c) Assignment column header -> Sort by -> Missing (the user_ids
endpoint should return all users with a missing submission for
that assignment first)
d) Assignment column header -> Sort by -> Late (the user_ids
endpoint shoudl return all users with a late submission for that
assignment first)
e) Select a grading period and sort by total grade. The user_ids
endpoint should return user IDs that are ordered such that their
corresponding users' grades are in ascending or descending order
for the selected grading period.
13. Conclude the course. Hit the user_ids endpoint as the teacher and
verify you do not get a 401 response.
* Note: Sorting by assignment group totals is not currently supported.
Change-Id: I6c4b16b72e051d46cc7b7521949d5c82b92960b9
Reviewed-on: https://gerrit.instructure.com/116698
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Tested-by: Jenkins
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
Add endpoint to gradebooks controller which returns user ids sorted
according to the user's gradebook sort preferences.
closes CNVS-37608
Test Plan:
1. Create a course that has some active students, inactive students,
and concluded students. Enable New Gradebook and go to the
gradebook.
2. Click on the student header and select 'Inactive enrollments' and
'Concluded enrollments'. Then select 'Sort by -> A-Z'.
2. As a student in the course, hit the new endpoint to get user IDs
(GET /courses/:course_id/gradebook/user_ids). Verify you get a 401
unauthorized response.
3. As a teacher in the course, hit the user_ids endpoint and verify you
get a list of user IDs back. The user IDs should be ordered such
that their corresponding users' names are in alpha ascending order.
The list of user IDs should also include inactive and concluded
students' IDs.
4. Go to the gradebook and click on the student header. Select 'Sort by
-> Z-A'.
5. Hit the user_ids endpoint and verify the returned user IDs are now
ordered such that their corresponding users' names are in alpha
descending order. The list of user IDs should also include inactive
and concluded students' IDs.
6. Go to the gradebook and click on the student column header. Deselect
the 'Inactive enrollments' and 'Concluded enrollments' options.
7. Hit the user_ids endpoint and verify the returned user IDs no longer
include IDs for inactive or concluded students. The IDs should still
be ordered such that their corresponding users' names are in alpha
descending order.
8. Go to the gradebook and click on the total grade header. Select
'Sort by Grade -> Low to High'
9. Hit the user_ids endpoint and verify the returned user IDs are
ordered such that their corresponding users' current total grades
are in ascending order.
10. Go to the gradebook and click on the total grade header. Select
'Sort by Grade -> High to Low'
11. Hit the user_ids endpoint and verify the returned user IDs are
ordered such that their corresponding users' current total grades
are in descending order.
12. In the same manner as the steps above, make sure changing the
following settings in the gradebook causes the user_ids
endpoint to return an array of IDs ordered according to the
gradebook sort preferences:
a) Assignment column header -> Sort by Grade -> Low to High
b) Assignment column header -> Sort by Grade -> High to Low
c) Assignment column header -> Sort by -> Missing (the user_ids
endpoint should return all users with a missing submission for
that assignment first)
d) Assignment column header -> Sort by -> Late (the user_ids
endpoint shoudl return all users with a late submission for that
assignment first)
e) Select a grading period and sort by total grade. The user_ids
endpoint should return user IDs that are ordered such that their
corresponding users' grades are in ascending or descending order
for the selected grading period.
* Note: Sorting by assignment group totals is not currently supported.
Change-Id: I4a36aa5b82d87f49d2396bbc16e1cc56e89eba0f
Reviewed-on: https://gerrit.instructure.com/116491
Reviewed-by: Shahbaz Javeed <sjaveed@instructure.com>
Tested-by: Jenkins
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>