Skip to content

Commit

Permalink
Merge pull request #291 from edx/efischer/fix_language
Browse files Browse the repository at this point in the history
Timed exam support burden alleviation
  • Loading branch information
Eric Fischer committed Jun 7, 2016
2 parents 15bbc34 + acab455 commit 03ce17c
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
5 changes: 5 additions & 0 deletions edx_proctoring/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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'],
Expand Down
4 changes: 3 additions & 1 deletion edx_proctoring/templates/timed_exam/entrance.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ <h3>
</a>
</button>
</div>
{% include 'timed_exam/footer.html' %}
{% if not hide_extra_time_footer %}
{% include 'timed_exam/footer.html' %}
{% endif %}

<script type="text/javascript">

Expand Down
2 changes: 1 addition & 1 deletion edx_proctoring/templates/timed_exam/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down
25 changes: 25 additions & 0 deletions edx_proctoring/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def setUp(self):
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))
Expand Down Expand Up @@ -1451,6 +1452,30 @@ def test_get_studentview_started_timed_exam(self):
)
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),
Expand Down

0 comments on commit 03ce17c

Please sign in to comment.