Commit db5d3fa1 by Afzal Wali

Refactored the enrollment_mode check a bit to allow for easier understanding of the logic involved.

parent e2913575
...@@ -514,10 +514,13 @@ def get_student_view(user_id, course_id, content_id, ...@@ -514,10 +514,13 @@ def get_student_view(user_id, course_id, content_id,
) )
if check_mode: if check_mode:
# Return None (show exam content) for non verified users unless it's a practice exam # Allow only the verified students to take the exam as a proctored exam
# where both honor and verified users are shown the proctoring screen. # Also make an exception for the honor students to take the "practice exam" as a proctored exam.
if context['credit_state']['enrollment_mode'] != 'verified': # For the rest of the enrollment modes, None is returned which shows the exam content
if not (context['is_practice_exam'] and context['credit_state']['enrollment_mode'] == 'honor'): # to the student rather than the proctoring prompt.
if not (context['credit_state']['enrollment_mode'] == 'verified' or (
context['credit_state']['enrollment_mode'] == 'honor' and context['is_practice_exam'])):
return None return None
student_view_template = None student_view_template = None
......
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