Commit 03ce17c9 by Eric Fischer

Merge pull request #291 from edx/efischer/fix_language

Timed exam support burden alleviation
parents 15bbc340 acab455a
......@@ -1490,6 +1490,10 @@ def _get_timed_exam_view(exam, context, exam_id, user_id, course_id):
)
total_time = humanized_time(allowed_time_limit_mins)
# According to WCAG, there is no need to allow for extra time if > 20 hours allowed
hide_extra_time_footer = exam['time_limit_mins'] > 20 * 60
progress_page_url = ''
try:
progress_page_url = reverse(
......@@ -1504,6 +1508,7 @@ def _get_timed_exam_view(exam, context, exam_id, user_id, course_id):
django_context.update({
'total_time': total_time,
'hide_extra_time_footer': hide_extra_time_footer,
'will_be_revealed': has_due_date and not exam['hide_after_due'],
'exam_id': exam_id,
'exam_name': exam['exam_name'],
......
......@@ -25,7 +25,9 @@
</a>
</button>
</div>
{% include 'timed_exam/footer.html' %}
{% if not hide_extra_time_footer %}
{% include 'timed_exam/footer.html' %}
{% endif %}
<script type="text/javascript">
......
......@@ -2,7 +2,7 @@
<div class="footer-sequence">
<h4> {% trans "Can I request additional time to complete my exam?" %} </h4>
<p>{% blocktrans %}
If you have disabilities or are taking the exam in difficult conditions,
If you have disabilities,
you might be eligible for an additional time allowance on timed exams.
Ask your course team for information about additional time allowances.
{% endblocktrans %}
......
......@@ -143,6 +143,7 @@ class ProctoredExamApiTests(LoggedInTestCase):
self.proctored_exam_email_subject = 'Proctoring Session Results Update'
self.proctored_exam_email_body = 'the status of your proctoring session review'
self.footer_msg = 'About Proctored Exams'
self.timed_footer_msg = 'Can I request additional time to complete my exam?'
set_runtime_service('credit', MockCreditService())
set_runtime_service('instructor', MockInstructorService(is_user_course_staff=True))
......@@ -1451,6 +1452,30 @@ class ProctoredExamApiTests(LoggedInTestCase):
)
self.assertIsNone(rendered_response)
@ddt.data(True, False)
def test_get_studentview_long_limit(self, under_exception):
"""
Test for hide_extra_time_footer on exams with > 20 hours time limit
"""
exam_id = self._create_exam_with_due_time(is_proctored=False, )
if under_exception:
update_exam(exam_id, time_limit_mins=((20 * 60))) # exactly 20 hours
else:
update_exam(exam_id, time_limit_mins=((20 * 60) + 1)) # 1 minute greater than 20 hours
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': False,
'display_name': self.exam_name,
}
)
if under_exception:
self.assertIn(self.timed_footer_msg, rendered_response)
else:
self.assertNotIn(self.timed_footer_msg, rendered_response)
@ddt.data(
(datetime.now(pytz.UTC) + timedelta(days=1), False),
(datetime.now(pytz.UTC) - timedelta(days=1), False),
......
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