Commit c115ff36 by Douglas Hall

Merge pull request #282 from edx/afzaledx/SOL-1653_course_due_date_for_self_paced

Afzaledx/sol 1653 course due date for self paced
parents e7ca75c2 397b9a02
......@@ -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
......
......@@ -1385,7 +1385,8 @@ class ProctoredExamApiTests(LoggedInTestCase):
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:
......@@ -1414,7 +1415,8 @@ class ProctoredExamApiTests(LoggedInTestCase):
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)
......@@ -1429,7 +1431,8 @@ class ProctoredExamApiTests(LoggedInTestCase):
'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)
......@@ -1458,7 +1461,8 @@ class ProctoredExamApiTests(LoggedInTestCase):
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)
......@@ -1473,7 +1477,8 @@ class ProctoredExamApiTests(LoggedInTestCase):
'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)
......
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