Course Relative Due Dates (and the direction for scheduling)

@cpennington has an in-progress pull request to add course-relative dates to Studio, meaning the ability to specify that a sequence is due on “course_start + 2 weeks” instead of setting an absolute date. This is a part of a larger effort to improve working with scheduling in Open edX.

The current thinking is that we will have a new, inheritable XBlock field for relative due dates. The existing due attribute would continue to import and export identically as it does today from Studio. On the LMS side, the XBlock runtime will apply the relative due date under the covers so that existing XBlocks will still read the due attribute as they do today. This is already the pattern established for using edx-when to do things like individual due date extensions and better querying.

Please feel free to add any concerns or questions you have to the PR linked above.

For those not familiar with edx-when, the rationale for it is covered in an arch decision record, which has a number of comments hashing out the reasoning in the PR.

The short version at a high level is that querying the modulestore for date information is very slow, and we want a more relational data model to enable queries like, “What’s everything that is due for this student across all courses this week?”. In order to achieve this while maintaining backwards compatibility, we decided to leave Studio alone and do the translation into this more performant data model during the publish step. We then do a little bit of magic under the covers so that when an XBlock asks for the value of the due field in the LMS, it’s really being powered by the data model in edx-when, and not just the static values from the OLX. This lets us add logic like individual due date extensions as well as course relative due date calculations without touching Studio import/export expectations or requiring changes to XBlocks.