Commit c1781f3b by chrisndodge

Merge pull request #37 from edx/cdodge/order-attempts

sort by reverse date
parents 4fe36066 52a0b59f
...@@ -138,7 +138,7 @@ class ProctoredExamStudentAttemptManager(models.Manager): ...@@ -138,7 +138,7 @@ class ProctoredExamStudentAttemptManager(models.Manager):
if course_id is not None: if course_id is not None:
filtered_query = filtered_query & Q(proctored_exam__course_id=course_id) filtered_query = filtered_query & Q(proctored_exam__course_id=course_id)
return self.filter(filtered_query) return self.filter(filtered_query).order_by('-created')
class ProctoredExamStudentAttemptStatus(object): class ProctoredExamStudentAttemptStatus(object):
......
...@@ -430,8 +430,8 @@ class ProctoredExamApiTests(LoggedInTestCase): ...@@ -430,8 +430,8 @@ class ProctoredExamApiTests(LoggedInTestCase):
add_allowance_for_user(self.proctored_exam_id, self.user.username, 'new_key', 'new_value') add_allowance_for_user(self.proctored_exam_id, self.user.username, 'new_key', 'new_value')
student_active_exams = get_active_exams_for_user(self.user_id, self.course_id) student_active_exams = get_active_exams_for_user(self.user_id, self.course_id)
self.assertEqual(len(student_active_exams), 2) self.assertEqual(len(student_active_exams), 2)
self.assertEqual(len(student_active_exams[0]['allowances']), 2) self.assertEqual(len(student_active_exams[0]['allowances']), 0)
self.assertEqual(len(student_active_exams[1]['allowances']), 0) self.assertEqual(len(student_active_exams[1]['allowances']), 2)
def test_get_filtered_exam_attempts(self): def test_get_filtered_exam_attempts(self):
""" """
......
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