fix: incorrect LTI exam due dates for self-paced courses#20
Merged
michaelroytman merged 1 commit intorelease-ulmofrom Oct 30, 2025
Conversation
These changes fix a bug in how LTI-based exam due dates are computed and written to the exams service. Prior to this change, an LTI exam due date was computed irrespective of the course pacing type. In certain cases, this caused incorrect due dates to be written to the exams service for LTI-based exams. For example, if a course team initially develops a course as an instructor-paced course and sets a due date on an exam subsection, that subsection due date is written to the modulestore. If the course team subsequently changes that course pacing type to self-paced, then that due date remains in the modulestore to allow course teams to switch pacing types without erasing due dates. The impact of this is that, when the course is published, the exam subsection due date is written to the exams service as the due date, even though there are no static due dates in a self-paced course. Frequently, these due dates are in the past (e.g. for course reruns), so learners automatically cannot access exams. Even if the due date is manually corrected in the exams service, every course publish reverts the due date to the incorrect due date. This change computes the due date of LTI-based exams as... * the exam subsection due date if the course is instructor-paced, if the subsection has a due date; else None * the course end date if the course is self-paced, if the course has an end date; else None In order to correct any incorrect due dates, course teams should republish their courses.
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the exam due date computation logic to improve clarity and consistency between production code and test code. The changes modify how exam due dates are determined based on course pacing (instructor-paced vs self-paced) and proctoring provider type.
Key changes:
- Simplified due date computation logic by introducing intermediate variables (
is_instructor_pacedanddue_date_source) - Unified the logic structure between
register_exams()function and the test helper_get_exam_due_date() - Updated test documentation to accurately reflect the new due date behavior
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| cms/djangoapps/contentstore/exams.py | Refactored due date computation to use intermediate variables for better readability |
| cms/djangoapps/contentstore/tests/test_exams.py | Updated test helper to mirror production logic, improved test documentation, added timezone info, and removed unused variable |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
nsprenkle
approved these changes
Oct 30, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
These changes fix a bug in how LTI-based exam due dates are computed and written to the exams service. Prior to this change, an LTI exam due date was computed irrespective of the course pacing type. In certain cases, this caused incorrect due dates to be written to the exams service for LTI-based exams.
For example, if a course team initially develops a course as an instructor-paced course and sets a due date on an exam subsection, that subsection due date is written to the modulestore. If the course team subsequently changes that course pacing type to self-paced, then that due date remains in the modulestore to allow course teams to switch pacing types without erasing due dates. The impact of this is that, when the course is published, the exam subsection due date is written to the exams service as the due date, even though there are no static due dates in a self-paced course. Frequently, these due dates are in the past (e.g. for course reruns), so learners automatically cannot access exams. Even if the due date is manually corrected in the exams service, every course publish reverts the due date to the incorrect due date.
This change computes the due date of LTI-based exams as...
In order to correct any incorrect due dates, course teams should republish their courses.