Commit acab455a by Eric Fischer

TNL-4654. TNL-4655

Small changes for support

-Remove difficult conditions language
-Hide request for extra time if > 20 hours
parent f5df57f8
...@@ -1490,6 +1490,10 @@ def _get_timed_exam_view(exam, context, exam_id, user_id, course_id): ...@@ -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) 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 = '' progress_page_url = ''
try: try:
progress_page_url = reverse( progress_page_url = reverse(
...@@ -1504,6 +1508,7 @@ def _get_timed_exam_view(exam, context, exam_id, user_id, course_id): ...@@ -1504,6 +1508,7 @@ def _get_timed_exam_view(exam, context, exam_id, user_id, course_id):
django_context.update({ django_context.update({
'total_time': total_time, 'total_time': total_time,
'hide_extra_time_footer': hide_extra_time_footer,
'will_be_revealed': has_due_date and not exam['hide_after_due'], 'will_be_revealed': has_due_date and not exam['hide_after_due'],
'exam_id': exam_id, 'exam_id': exam_id,
'exam_name': exam['exam_name'], 'exam_name': exam['exam_name'],
......
...@@ -25,7 +25,9 @@ ...@@ -25,7 +25,9 @@
</a> </a>
</button> </button>
</div> </div>
{% include 'timed_exam/footer.html' %} {% if not hide_extra_time_footer %}
{% include 'timed_exam/footer.html' %}
{% endif %}
<script type="text/javascript"> <script type="text/javascript">
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="footer-sequence"> <div class="footer-sequence">
<h4> {% trans "Can I request additional time to complete my exam?" %} </h4> <h4> {% trans "Can I request additional time to complete my exam?" %} </h4>
<p>{% blocktrans %} <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. you might be eligible for an additional time allowance on timed exams.
Ask your course team for information about additional time allowances. Ask your course team for information about additional time allowances.
{% endblocktrans %} {% endblocktrans %}
......
...@@ -143,6 +143,7 @@ class ProctoredExamApiTests(LoggedInTestCase): ...@@ -143,6 +143,7 @@ class ProctoredExamApiTests(LoggedInTestCase):
self.proctored_exam_email_subject = 'Proctoring Session Results Update' self.proctored_exam_email_subject = 'Proctoring Session Results Update'
self.proctored_exam_email_body = 'the status of your proctoring session review' self.proctored_exam_email_body = 'the status of your proctoring session review'
self.footer_msg = 'About Proctored Exams' 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('credit', MockCreditService())
set_runtime_service('instructor', MockInstructorService(is_user_course_staff=True)) set_runtime_service('instructor', MockInstructorService(is_user_course_staff=True))
...@@ -1451,6 +1452,30 @@ class ProctoredExamApiTests(LoggedInTestCase): ...@@ -1451,6 +1452,30 @@ class ProctoredExamApiTests(LoggedInTestCase):
) )
self.assertIsNone(rendered_response) 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( @ddt.data(
(datetime.now(pytz.UTC) + timedelta(days=1), False), (datetime.now(pytz.UTC) + timedelta(days=1), False),
(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