Repository navigation
feat: block certificate access using edx-exams proctoring status - #522
Conversation
abhalsod-sonata
left a comment
There was a problem hiding this comment.
Approved: this blocks safely on every failure path, which is the right default for a certificate integrity check, and the legacy refactor reads much better. Two things for the rollout and one design question:
-
LMS needs
EXAMS_SERVICE_URLbefore the switch goes on. Today only the CMS deployment config sets it, so the LMS uses the defaulthttp://localhost:18740/api/v1. Withcertificate_proctoring_review_block_examsenabled, every lookup would fail and, because failures block, every learner on an LTI proctoring course would lose certificate access. Worth adding it to the LMS config first and saying so in the toggle annotation (suggestion inline). -
Cost on list pages.
get_certificates_for_user(via_format_certificate_for_user) and the dashboard run this check once per downloadable certificate, sequentially. On LTI courses each check loads the service user, mints a JWT and makes an HTTP call with a(3.05, 5)timeout, so a learner with several LTI certificates pays that several times per page, and an edx-exams slowdown turns into a slow dashboard on top of blocked certificates. Could we cache a successful status briefly (for example 60 s inTieredCache, keyed by user and course)? Access would still be restored within a minute of review, and an outage would not multiply across pages. -
Minor reuse:
_get_exams_api_clientis the same code ascms/djangoapps/contentstore/exams.py. LMS code can't import from CMS, so that's fine for now, but a shared helper underopenedx/corewould be a good follow-up.
Reject exam records that are missing required fields or have an inconsistent attempt_id/status pair instead of reading them as "no attempt", and block with proctoring_status_unavailable. Fix the no-attempt test data, add malformed-record tests, and link the edx-exams endpoint PR in the exams switch rollout note.
Description
Certificate access checks only read legacy
edx-proctoringrecords, so learners on LTI proctoring courses (proctoring_provider == lti_external, e.g. Proctorio) could reach a certificate despite a submitted, errored or rejected attempt in edx-exams.This PR makes the certificate proctoring block also read attempt status from edx-exams for those courses, behind a new waffle switch
certificates.certificate_proctoring_review_block_exams(default off).lms/djangoapps/certificates/exams_client.py.rejectedblocks on this path with the new reasonproctoring_rejectedand learner messaging on the dashboard and blocked-certificate page.EXAMS_SERVICE_URL,EXAMS_SERVICE_USERNAME,EXAMS_SERVICE_REQUEST_TIMEOUT.Roles impacted: Learner, Operator.
Supporting information
Requires the edx-exams
certificate_proctoringstatus endpoint. edx/edx-exams#447Testing instructions
Manual: enable both switches, set the course provider to
lti_external, then set the learner's edx-exams attempt tosubmitted,rejectedandverifiedand check the dashboard message.Deadline
None
Other information