Skip to content

Commit 03ce17c

Browse files
author
Eric Fischer
committed
Merge pull request #291 from edx/efischer/fix_language
Timed exam support burden alleviation
2 parents 15bbc34 + acab455 commit 03ce17c

File tree

4 files changed

+34
-2
lines changed

4 files changed

+34
-2
lines changed

edx_proctoring/api.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1490,6 +1490,10 @@ def _get_timed_exam_view(exam, context, exam_id, user_id, course_id):
14901490
)
14911491

14921492
total_time = humanized_time(allowed_time_limit_mins)
1493+
1494+
# According to WCAG, there is no need to allow for extra time if > 20 hours allowed
1495+
hide_extra_time_footer = exam['time_limit_mins'] > 20 * 60
1496+
14931497
progress_page_url = ''
14941498
try:
14951499
progress_page_url = reverse(
@@ -1504,6 +1508,7 @@ def _get_timed_exam_view(exam, context, exam_id, user_id, course_id):
15041508

15051509
django_context.update({
15061510
'total_time': total_time,
1511+
'hide_extra_time_footer': hide_extra_time_footer,
15071512
'will_be_revealed': has_due_date and not exam['hide_after_due'],
15081513
'exam_id': exam_id,
15091514
'exam_name': exam['exam_name'],

edx_proctoring/templates/timed_exam/entrance.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ <h3>
2525
</a>
2626
</button>
2727
</div>
28-
{% include 'timed_exam/footer.html' %}
28+
{% if not hide_extra_time_footer %}
29+
{% include 'timed_exam/footer.html' %}
30+
{% endif %}
2931

3032
<script type="text/javascript">
3133

edx_proctoring/templates/timed_exam/footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="footer-sequence">
33
<h4> {% trans "Can I request additional time to complete my exam?" %} </h4>
44
<p>{% blocktrans %}
5-
If you have disabilities or are taking the exam in difficult conditions,
5+
If you have disabilities,
66
you might be eligible for an additional time allowance on timed exams.
77
Ask your course team for information about additional time allowances.
88
{% endblocktrans %}

edx_proctoring/tests/test_api.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ def setUp(self):
143143
self.proctored_exam_email_subject = 'Proctoring Session Results Update'
144144
self.proctored_exam_email_body = 'the status of your proctoring session review'
145145
self.footer_msg = 'About Proctored Exams'
146+
self.timed_footer_msg = 'Can I request additional time to complete my exam?'
146147

147148
set_runtime_service('credit', MockCreditService())
148149
set_runtime_service('instructor', MockInstructorService(is_user_course_staff=True))
@@ -1451,6 +1452,30 @@ def test_get_studentview_started_timed_exam(self):
14511452
)
14521453
self.assertIsNone(rendered_response)
14531454

1455+
@ddt.data(True, False)
1456+
def test_get_studentview_long_limit(self, under_exception):
1457+
"""
1458+
Test for hide_extra_time_footer on exams with > 20 hours time limit
1459+
"""
1460+
exam_id = self._create_exam_with_due_time(is_proctored=False, )
1461+
if under_exception:
1462+
update_exam(exam_id, time_limit_mins=((20 * 60))) # exactly 20 hours
1463+
else:
1464+
update_exam(exam_id, time_limit_mins=((20 * 60) + 1)) # 1 minute greater than 20 hours
1465+
rendered_response = get_student_view(
1466+
user_id=self.user_id,
1467+
course_id=self.course_id,
1468+
content_id=self.content_id_for_exam_with_due_date,
1469+
context={
1470+
'is_proctored': False,
1471+
'display_name': self.exam_name,
1472+
}
1473+
)
1474+
if under_exception:
1475+
self.assertIn(self.timed_footer_msg, rendered_response)
1476+
else:
1477+
self.assertNotIn(self.timed_footer_msg, rendered_response)
1478+
14541479
@ddt.data(
14551480
(datetime.now(pytz.UTC) + timedelta(days=1), False),
14561481
(datetime.now(pytz.UTC) - timedelta(days=1), False),

0 commit comments

Comments
 (0)