Commit 85160743 by Chris Dodge

add proctoring start template

parent 49e8086b
...@@ -222,18 +222,22 @@ def get_student_view(user_id, course_id, content_id, context): ...@@ -222,18 +222,22 @@ def get_student_view(user_id, course_id, content_id, context):
has_started_exam = False has_started_exam = False
has_finished_exam = False has_finished_exam = False
has_time_expired = False has_time_expired = False
is_proctored = False
student_view_template = None student_view_template = None
exam_id = None exam_id = None
try: try:
exam = get_exam_by_content_id(course_id, content_id) exam = get_exam_by_content_id(course_id, content_id)
exam_id = exam['id'] exam_id = exam['id']
is_proctored = exam['is_proctored']
except ProctoredExamNotFoundException: except ProctoredExamNotFoundException:
is_proctored = context.get('is_proctored', False)
exam_id = create_exam( exam_id = create_exam(
course_id=course_id, course_id=course_id,
content_id=unicode(content_id), content_id=unicode(content_id),
exam_name=context['display_name'], exam_name=context['display_name'],
time_limit_mins=context['default_time_limit_mins'] time_limit_mins=context['default_time_limit_mins'],
is_proctored=is_proctored
) )
attempt = get_exam_attempt(exam_id, user_id) attempt = get_exam_attempt(exam_id, user_id)
...@@ -244,7 +248,12 @@ def get_student_view(user_id, course_id, content_id, context): ...@@ -244,7 +248,12 @@ def get_student_view(user_id, course_id, content_id, context):
has_time_expired = now_utc > expires_at has_time_expired = now_utc > expires_at
if not has_started_exam: if not has_started_exam:
student_view_template = 'proctoring/seq_timed_exam_entrance.html' # determine whether to show a timed exam only entrace screen
# or a screen regarding proctoring
if is_proctored:
student_view_template = 'proctoring/seq_proctored_exam_entrance.html'
else:
student_view_template = 'proctoring/seq_timed_exam_entrance.html'
elif has_finished_exam: elif has_finished_exam:
student_view_template = 'proctoring/seq_timed_exam_completed.html' student_view_template = 'proctoring/seq_timed_exam_completed.html'
elif has_time_expired: elif has_time_expired:
......
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