Skip to content

Conversation

@michaelroytman
Copy link
Member

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...

  • 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.

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.
Copilot AI review requested due to automatic review settings October 30, 2025 13:05
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_paced and due_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.

@michaelroytman michaelroytman merged commit 942437f into release-ulmo Oct 30, 2025
70 checks passed
@michaelroytman michaelroytman deleted the michaelroytman/COSMO2-729-exam-due-dates-self-paced-cherry-pick branch October 30, 2025 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants