Skip to content

Commit

Permalink
Merge pull request #929 from edx/mroytman/fix-onboarding-user-id-bug
Browse files Browse the repository at this point in the history
fix: Fix bug with user IDs returned by proctoring vendor for learners not enrolled in eligible mode
  • Loading branch information
MichaelRoytman authored Aug 6, 2021
2 parents 7085773 + 7f600c6 commit 6e927c4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ Change Log
Unreleased
~~~~~~~~~~

[3.23.1] - 2021-08-06
~~~~~~~~~~~~~~~~~~~~~
* Fixes bug that occurs when a proctoring vendor returns onboarding information that includes user IDs that represent
learners that are not returned by the edX API as being enrolled in the course in a proctoring eligible mode.
* Adds logging statement to enable further investigation.

[3.23.0] - 2021-08-04
~~~~~~~~~~~~~~~~~~~~~
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.23.0'
__version__ = '3.23.1'

default_app_config = 'edx_proctoring.apps.EdxProctoringConfig' # pylint: disable=invalid-name
17 changes: 17 additions & 0 deletions edx_proctoring/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -760,9 +760,15 @@ def get(self, request, course_id):

obscured_user_ids_to_users = {obscured_user_id(user.id, onboarding_exam.backend): user for user in users}

missing_user_ids = []
for onboarding_profile in onboarding_profile_info:
obscured_id = onboarding_profile['user_id']
user = obscured_user_ids_to_users.get(obscured_id)

if not user:
missing_user_ids.append(onboarding_profile['user_id'])
continue

onboarding_status = onboarding_profile['status']
data = {
'username': user.username,
Expand All @@ -775,6 +781,17 @@ def get(self, request, course_id):
onboarding_data.append(data)
del obscured_user_ids_to_users[obscured_id]

log_message = (
'Users are present in response whose obscured user IDs do not exist in list of learners '
'enrolled in course {course_id} with proctoring eligible enrollments. There are a total '
'of {num_missing_ids} of these. A sample of these IDs is {obs_id_sample}.'
).format(
course_id=course_id,
num_missing_ids=len(missing_user_ids),
obs_id_sample=missing_user_ids[0:5],
)
LOG.warning(log_message)

if status_filters is None or 'not_started' in status_filters:
for (obscured_id, user) in obscured_user_ids_to_users.items():
# remaining learners that are not represented in the API response
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": "3.23.0",
"version": "3.23.1",
"main": "edx_proctoring/static/index.js",
"scripts": {
"test": "gulp test"
Expand Down

0 comments on commit 6e927c4

Please sign in to comment.