Skip to content

Commit

Permalink
fix: Add log message for timed out attempt or re-attempt
Browse files Browse the repository at this point in the history
MST-850. When an attempt is timed out or a user is reattempting an exam,
their attempt will be marked as submitted. This status update is currently
not captured in our logs, making it difficult to tell what triggered a status
change to submitted.
  • Loading branch information
alangsto committed Jun 3, 2021
1 parent ac15e68 commit 5edf742
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 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
~~~~~~~~~~

[3.11.6] - 2021-06-03
~~~~~~~~~~~~~~~~~~~~~
* Add logging for attempt status transitions caused by a time out or reattempt

[3.11.5] - 2021-06-01
~~~~~~~~~~~~~~~~~~~~~
* Fix a bug where we are to pass to vendor javascript a value in milliseconds, instead of just seconds
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__ = '3.11.5'
__version__ = '3.11.6'

default_app_config = 'edx_proctoring.apps.EdxProctoringConfig' # pylint: disable=invalid-name
9 changes: 9 additions & 0 deletions edx_proctoring/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1121,6 +1121,15 @@ def update_attempt_status(attempt_id, to_status,

user_trying_to_reattempt = is_reattempting_exam(from_status, to_status)
if treat_timeout_as_submitted or user_trying_to_reattempt:
detail = 'the attempt was timed out' if treat_timeout_as_submitted else 'the user reattempted the exam'
log_msg = (
'Attempt status for exam_id={exam_id} for user_id={user_id} will not be updated to '
'"{to_status}" because {submitted_message}. Instead the attempt '
'status will be updated to "submitted"'.format(
exam_id=exam_id, user_id=user_id, to_status=to_status, submitted_message=detail
)
)
log.info(log_msg)
to_status = ProctoredExamStudentAttemptStatus.submitted

exam = get_exam_by_id(exam_id)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@edx/edx-proctoring",
"//": "Be sure to update the version number in edx_proctoring/__init__.py",
"//": "Note that the version format is slightly different than that of the Python version when using prereleases.",
"version": "3.11.5",
"version": "3.11.6",
"main": "edx_proctoring/static/index.js",
"scripts": {
"test": "gulp test"
Expand Down

0 comments on commit 5edf742

Please sign in to comment.