Commit 174f651d by Douglas Hall

Merging PHX-239, PHX-240 fixes to 0.12.5 release

parents 3f2ed89f 257f7329
...@@ -386,7 +386,6 @@ class ProctoredExamAttemptForm(forms.ModelForm): ...@@ -386,7 +386,6 @@ class ProctoredExamAttemptForm(forms.ModelForm):
(ProctoredExamStudentAttemptStatus.second_review_required, _('Second Review Required')), (ProctoredExamStudentAttemptStatus.second_review_required, _('Second Review Required')),
(ProctoredExamStudentAttemptStatus.verified, _('Verified')), (ProctoredExamStudentAttemptStatus.verified, _('Verified')),
(ProctoredExamStudentAttemptStatus.rejected, _('Rejected')), (ProctoredExamStudentAttemptStatus.rejected, _('Rejected')),
(ProctoredExamStudentAttemptStatus.not_reviewed, _('Not Reviewed')),
(ProctoredExamStudentAttemptStatus.error, _('Error')), (ProctoredExamStudentAttemptStatus.error, _('Error')),
] ]
......
...@@ -1559,9 +1559,6 @@ def _get_practice_exam_view(exam, context, exam_id, user_id, course_id): ...@@ -1559,9 +1559,6 @@ def _get_practice_exam_view(exam, context, exam_id, user_id, course_id):
attempt_status = attempt['status'] if attempt else None attempt_status = attempt['status'] if attempt else None
if not attempt_status: if not attempt_status:
if _has_due_date_passed(exam['due_date']):
student_view_template = 'proctored_exam/expired.html'
else:
student_view_template = 'practice_exam/entrance.html' student_view_template = 'practice_exam/entrance.html'
elif attempt_status == ProctoredExamStudentAttemptStatus.started: elif attempt_status == ProctoredExamStudentAttemptStatus.started:
# when we're taking the exam we should not override the view # when we're taking the exam we should not override the view
......
...@@ -159,9 +159,6 @@ class ProctoredExamStudentAttemptStatus(object): ...@@ -159,9 +159,6 @@ class ProctoredExamStudentAttemptStatus(object):
# the exam has been rejected # the exam has been rejected
rejected = 'rejected' rejected = 'rejected'
# the exam was not reviewed
not_reviewed = 'not_reviewed'
# the exam is believed to be in error # the exam is believed to be in error
error = 'error' error = 'error'
...@@ -180,7 +177,7 @@ class ProctoredExamStudentAttemptStatus(object): ...@@ -180,7 +177,7 @@ class ProctoredExamStudentAttemptStatus(object):
""" """
return status in [ return status in [
cls.declined, cls.timed_out, cls.submitted, cls.second_review_required, cls.declined, cls.timed_out, cls.submitted, cls.second_review_required,
cls.verified, cls.rejected, cls.not_reviewed, cls.error cls.verified, cls.rejected, cls.error
] ]
@classmethod @classmethod
...@@ -199,8 +196,7 @@ class ProctoredExamStudentAttemptStatus(object): ...@@ -199,8 +196,7 @@ class ProctoredExamStudentAttemptStatus(object):
Returns a boolean if the passed in to_status calls for an update to the credit requirement status. Returns a boolean if the passed in to_status calls for an update to the credit requirement status.
""" """
return to_status in [ return to_status in [
cls.verified, cls.rejected, cls.declined, cls.not_reviewed, cls.verified, cls.rejected, cls.declined, cls.submitted, cls.error
cls.submitted, cls.error
] ]
@classmethod @classmethod
......
...@@ -18,7 +18,6 @@ var edx = edx || {}; ...@@ -18,7 +18,6 @@ var edx = edx || {};
submitted: gettext('Submitted'), submitted: gettext('Submitted'),
verified: gettext('Verified'), verified: gettext('Verified'),
rejected: gettext('Rejected'), rejected: gettext('Rejected'),
not_reviewed: gettext('Not reviewed'),
error: gettext('Error') error: gettext('Error')
}; };
var viewHelper = { var viewHelper = {
......
...@@ -1373,58 +1373,6 @@ class ProctoredExamApiTests(LoggedInTestCase): ...@@ -1373,58 +1373,6 @@ class ProctoredExamApiTests(LoggedInTestCase):
else: else:
self.assertIsNone(None) self.assertIsNone(None)
@ddt.data(
(True, False),
(True, True),
(False, False),
)
@ddt.unpack
def test_practice_exam_attempt_with_past_due_datetime(self, is_proctored, is_practice):
"""
Test for get_student_view for practice proctored exam with past due datetime
"""
due_date = datetime.now(pytz.UTC) + timedelta(days=1)
# exam is created with due datetime which has already passed
self._create_exam_with_due_time(
is_proctored=is_proctored,
is_practice_exam=is_practice,
due_date=due_date
)
# due_date is exactly after 24 hours, if student arrives after 2 days
# then he can not attempt the proctored exam
reset_time = due_date + timedelta(days=2)
with freeze_time(reset_time):
rendered_response = get_student_view(
user_id=self.user_id,
course_id=self.course_id,
content_id=self.content_id_for_exam_with_due_date,
context={
'is_proctored': True,
'is_practice_exam': True,
'display_name': self.exam_name,
'default_time_limit_mins': self.default_time_limit
}
)
self.assertIn(self.exam_expired_msg, rendered_response)
# call the view again, because the first call set the exam attempt to 'expired'
# this second call will render the view based on the state
rendered_response = get_student_view(
user_id=self.user_id,
course_id=self.course_id,
content_id=self.content_id_for_exam_with_due_date,
context={
'is_proctored': True,
'is_practice_exam': True,
'display_name': self.exam_name,
'default_time_limit_mins': self.default_time_limit
}
)
self.assertIn(self.exam_expired_msg, rendered_response)
def test_proctored_exam_attempt_with_past_due_datetime(self): def test_proctored_exam_attempt_with_past_due_datetime(self):
""" """
Test for get_student_view for proctored exam with past due datetime Test for get_student_view for proctored exam with past due datetime
...@@ -2145,7 +2093,6 @@ class ProctoredExamApiTests(LoggedInTestCase): ...@@ -2145,7 +2093,6 @@ class ProctoredExamApiTests(LoggedInTestCase):
(ProctoredExamStudentAttemptStatus.submitted, ProctoredExamStudentAttemptStatus.ready_to_start), (ProctoredExamStudentAttemptStatus.submitted, ProctoredExamStudentAttemptStatus.ready_to_start),
(ProctoredExamStudentAttemptStatus.verified, ProctoredExamStudentAttemptStatus.started), (ProctoredExamStudentAttemptStatus.verified, ProctoredExamStudentAttemptStatus.started),
(ProctoredExamStudentAttemptStatus.rejected, ProctoredExamStudentAttemptStatus.started), (ProctoredExamStudentAttemptStatus.rejected, ProctoredExamStudentAttemptStatus.started),
(ProctoredExamStudentAttemptStatus.not_reviewed, ProctoredExamStudentAttemptStatus.started),
(ProctoredExamStudentAttemptStatus.error, ProctoredExamStudentAttemptStatus.started), (ProctoredExamStudentAttemptStatus.error, ProctoredExamStudentAttemptStatus.started),
(ProctoredExamStudentAttemptStatus.submitted, ProctoredExamStudentAttemptStatus.error), (ProctoredExamStudentAttemptStatus.submitted, ProctoredExamStudentAttemptStatus.error),
) )
...@@ -2616,7 +2563,6 @@ class ProctoredExamApiTests(LoggedInTestCase): ...@@ -2616,7 +2563,6 @@ class ProctoredExamApiTests(LoggedInTestCase):
ProctoredExamStudentAttemptStatus.ready_to_submit, ProctoredExamStudentAttemptStatus.ready_to_submit,
ProctoredExamStudentAttemptStatus.declined, ProctoredExamStudentAttemptStatus.declined,
ProctoredExamStudentAttemptStatus.timed_out, ProctoredExamStudentAttemptStatus.timed_out,
ProctoredExamStudentAttemptStatus.not_reviewed,
ProctoredExamStudentAttemptStatus.error ProctoredExamStudentAttemptStatus.error
) )
@patch.dict('settings.PROCTORING_SETTINGS', {'ALLOW_TIMED_OUT_STATE': True}) @patch.dict('settings.PROCTORING_SETTINGS', {'ALLOW_TIMED_OUT_STATE': True})
......
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