@@ -88,7 +88,7 @@ def show_view(request, assignment_id):
88
88
if query :
89
89
active_period = "query"
90
90
student_list = course .students .filter (full_name__icontains = query ).order_by (
91
- "periods" , "last_name"
91
+ "periods" , "last_name" , "first_name"
92
92
)
93
93
elif course .period_set .exists ():
94
94
if period == "" :
@@ -104,18 +104,18 @@ def show_view(request, assignment_id):
104
104
105
105
if period == "all" :
106
106
active_period = "all"
107
- student_list = course .students .all ().order_by ("periods" , "last_name" )
107
+ student_list = course .students .all ().order_by ("periods" , "last_name" , "first_name" )
108
108
elif period == "none" :
109
109
active_period = "none"
110
110
student_list = []
111
111
else :
112
112
active_period = get_object_or_404 (
113
113
Period .objects .filter (course = course ), id = int (period )
114
114
)
115
- student_list = active_period .students .all ().order_by ("last_name" )
115
+ student_list = active_period .students .all ().order_by ("last_name" , "first_name" )
116
116
elif period == "all" :
117
117
active_period = "all"
118
- student_list = course .students .all ().order_by ("last_name" )
118
+ student_list = course .students .all ().order_by ("last_name" , "first_name" )
119
119
else :
120
120
active_period = "none"
121
121
student_list = []
@@ -880,7 +880,7 @@ def scores_csv_view(request, assignment_id):
880
880
writer = csv .writer (response )
881
881
writer .writerow (["Name" , "Username" , "Period" , "Raw Score" , "Final Score" , "Formatted Grade" ])
882
882
883
- for student in students .order_by ("periods" , "last_name" ):
883
+ for student in students .order_by ("periods" , "last_name" , "first_name" ):
884
884
row = [student .full_name , student .username ]
885
885
periods = ", " .join ([p .name for p in student .periods .filter (course = assignment .course )])
886
886
row .append (periods )
0 commit comments