Commit 72f718e3 by Afzal Wali

Handled the status "download_software_clicked" for an attempt in the Practice…

Handled the status "download_software_clicked" for an attempt in the Practice Exams flow. Earlier it was not handled and was showing the exam content when the page was refreshed.
parent 4362252e
......@@ -1566,7 +1566,8 @@ def _get_practice_exam_view(exam, context, exam_id, user_id, course_id):
elif attempt_status == ProctoredExamStudentAttemptStatus.started:
# when we're taking the exam we should not override the view
return None
elif attempt_status == ProctoredExamStudentAttemptStatus.created:
elif attempt_status in [ProctoredExamStudentAttemptStatus.created,
ProctoredExamStudentAttemptStatus.download_software_clicked]:
provider = get_backend_provider()
student_view_template = 'proctored_exam/instructions.html'
context.update({
......
......@@ -1677,12 +1677,16 @@ class ProctoredExamApiTests(LoggedInTestCase):
)
self.assertIn(self.practice_exam_submitted_msg, rendered_response)
def test_get_studentview_created_status_practiceexam(self):
@ddt.data(
ProctoredExamStudentAttemptStatus.created,
ProctoredExamStudentAttemptStatus.download_software_clicked,
)
def test_get_studentview_created_status_practiceexam(self, status):
"""
Test for get_student_view practice exam which has been created.
"""
exam_attempt = self._create_started_practice_exam_attempt()
exam_attempt.status = ProctoredExamStudentAttemptStatus.created
exam_attempt.status = status
exam_attempt.save()
rendered_response = get_student_view(
......
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