Skip to content

Commit

Permalink
Merge pull request #282 from edx/afzaledx/SOL-1653_course_due_date_fo…
Browse files Browse the repository at this point in the history
…r_self_paced

Afzaledx/sol 1653 course due date for self paced
  • Loading branch information
Douglas Hall committed Mar 8, 2016
2 parents e7ca75c + 397b9a0 commit c115ff3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
10 changes: 10 additions & 0 deletions edx_proctoring/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1779,6 +1779,16 @@ def get_student_view(user_id, course_id, content_id,
# data
return None

# Just in case the due date has been changed because of the
# self-paced courses, use the due date from the context and
# update the local exam object if necessary.
if exam['due_date'] != context.get('due_date', None):
update_exam(
exam_id=exam['id'],
due_date=context.get('due_date', None)
)
exam['due_date'] = context.get('due_date', None)

exam_id = exam['id']
except ProctoredExamNotFoundException:
# This really shouldn't happen
Expand Down
15 changes: 10 additions & 5 deletions edx_proctoring/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1385,7 +1385,8 @@ def test_get_studentview_submitted_timed_exam_with_past_due_date(self, due_date,
context={
'is_proctored': False,
'display_name': self.exam_name,
'default_time_limit_mins': 10
'default_time_limit_mins': 10,
'due_date': due_date,
}
)
if not has_due_date_passed:
Expand Down Expand Up @@ -1414,7 +1415,8 @@ def test_proctored_exam_attempt_with_past_due_datetime(self):
context={
'is_proctored': True,
'display_name': self.exam_name,
'default_time_limit_mins': self.default_time_limit
'default_time_limit_mins': self.default_time_limit,
'due_date': due_date,
}
)
self.assertIn(self.exam_expired_msg, rendered_response)
Expand All @@ -1429,7 +1431,8 @@ def test_proctored_exam_attempt_with_past_due_datetime(self):
'is_proctored': True,
'is_practice_exam': True,
'display_name': self.exam_name,
'default_time_limit_mins': self.default_time_limit
'default_time_limit_mins': self.default_time_limit,
'due_date': due_date,
}
)
self.assertIn(self.exam_expired_msg, rendered_response)
Expand Down Expand Up @@ -1458,7 +1461,8 @@ def test_timed_exam_attempt_with_past_due_datetime(self):
context={
'is_proctored': False,
'display_name': self.exam_name,
'default_time_limit_mins': self.default_time_limit
'default_time_limit_mins': self.default_time_limit,
'due_date': due_date,
}
)
self.assertIn(self.exam_expired_msg, rendered_response)
Expand All @@ -1473,7 +1477,8 @@ def test_timed_exam_attempt_with_past_due_datetime(self):
'is_proctored': True,
'is_practice_exam': True,
'display_name': self.exam_name,
'default_time_limit_mins': self.default_time_limit
'default_time_limit_mins': self.default_time_limit,
'due_date': due_date,
}
)
self.assertIn(self.exam_expired_msg, rendered_response)
Expand Down

0 comments on commit c115ff3

Please sign in to comment.