Skip to content

Commit

Permalink
Merge pull request #1002 from edx/alangsto/add_interstitial_for_timed…
Browse files Browse the repository at this point in the history
…_exam

fix: add interstitial for timed exams
  • Loading branch information
alangsto authored Nov 16, 2021
2 parents 7ce79fb + eb7a069 commit 8c4a689
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ Change Log
Unreleased
~~~~~~~~~~

[4.7.1] - 2021-11-16
~~~~~~~~~~~~~~~~~~~~
* Assign interstitial to timed exam status

[4.7.0] - 2021-11-08
~~~~~~~~~~~~~~~~~~~~
* Convert onboarding profile API waffle flag to Django setting.
Expand Down
2 changes: 1 addition & 1 deletion edx_proctoring/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"""

# Be sure to update the version number in edx_proctoring/package.json
__version__ = '4.7.0'
__version__ = '4.7.1'

default_app_config = 'edx_proctoring.apps.EdxProctoringConfig' # pylint: disable=invalid-name
2 changes: 1 addition & 1 deletion edx_proctoring/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2464,7 +2464,7 @@ def _get_timed_exam_view(exam, context, exam_id, user_id, course_id):

attempt_status = attempt['status'] if attempt else None
has_due_date = exam['due_date'] is not None
if not attempt_status:
if not attempt_status or attempt_status == ProctoredExamStudentAttemptStatus.created:
if is_exam_passed_due(exam, user=user_id):
student_view_template = 'timed_exam/expired.html'
else:
Expand Down
21 changes: 21 additions & 0 deletions edx_proctoring/tests/test_student_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -1439,6 +1439,27 @@ def test_get_studentview_completed_timed_exam(self, status, expected_content):
)
self.assertIn(expected_content, rendered_response)

def test_get_studentview_created_timed_exam(self):
"""
Test that get_student_view for a created timed exam returns interstitial
"""
self._create_unstarted_exam_attempt(is_proctored=False)

rendered_response = get_student_view(
user_id=self.user_id,
course_id=self.course_id,
content_id=self.content_id_timed,
context={
'display_name': self.exam_name,
}
)
self.assertNotIn(
f'data-exam-id="{self.proctored_exam_id}"',
rendered_response
)
self.assertIn(self.timed_exam_msg.format(exam_name=self.exam_name), rendered_response)
self.assertNotIn(self.start_an_exam_msg, rendered_response)

def test_expired_exam(self):
"""
Test that an expired exam shows a difference message when the exam is expired just recently
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@edx/edx-proctoring",
"//": "Note that the version format is slightly different than that of the Python version when using prereleases.",
"version": "4.7.0",
"version": "4.7.1",
"main": "edx_proctoring/static/index.js",
"scripts": {
"test": "gulp test"
Expand Down

0 comments on commit 8c4a689

Please sign in to comment.