Skip to content

Commit

Permalink
Merge pull request #373 from edx/attiya/EDUCATOR-1104
Browse files Browse the repository at this point in the history
 EDUCATOR-1104 Fix 500 error in course page.
  • Loading branch information
attiyaIshaque authored Aug 17, 2017
2 parents 2bee143 + 3504e79 commit c28ba51
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion edx_proctoring/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,7 @@ def _check_eligibility_of_enrollment_mode(credit_state):
# Also make an exception for the honor students to take the "practice exam" as a proctored exam.
# For the rest of the enrollment modes, None is returned which shows the exam content
# to the student rather than the proctoring prompt.
return credit_state['enrollment_mode'] == 'verified'
return credit_state and credit_state['enrollment_mode'] == 'verified'


def _get_ordered_prerequisites(prerequisites_statuses, filter_out_namespaces=None):
Expand Down
15 changes: 15 additions & 0 deletions edx_proctoring/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1648,3 +1648,18 @@ def test_declined_prerequisites(self, content_id,
self.assertEqual(len(results['failed_prerequisites']), expected_len_failed_prerequisites)
self.assertEqual(len(results['pending_prerequisites']), expected_len_pending_prerequisites)
self.assertEqual(len(results['declined_prerequisites']), expected_len_declined_prerequisites)

def test_summary_without_credit_state(self):
"""
Test that attempt status summary is None for users who are not enrolled.
"""
exam_id = self._create_exam_with_due_time()
set_runtime_service('credit', MockCreditServiceNone())

timed_exam = get_exam_by_id(exam_id)
summary = get_attempt_status_summary(
self.user.id,
timed_exam['course_id'],
timed_exam['content_id']
)
self.assertIsNone(summary)

0 comments on commit c28ba51

Please sign in to comment.