feat: persist subsection prerequisites in course export/import - #39141
Agrendalath wants to merge 2 commits into
Conversation
|
Thanks for the pull request, @Agrendalath! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
532f654 to
16c64e2
Compare
Export the subsection gating settings as attributes of the <sequential> OLX element (is_prereq, prereq, prereq_min_score, prereq_min_completion) and apply them through the gating API on course import. On import, gating of subsections missing from the archive is removed. Subsections present in the archive are reconciled with its attributes, unless the archive has no prerequisite attributes at all (an export that predates this change), in which case their existing settings are kept.
16c64e2 to
feac7b4
Compare
|
@ormsbee this might be of interest to you |
Description
Subsection prerequisites (Settings -> Advanced -> "Enable Subsection Prerequisites") are stored by the gating API as milestones, not in XBlock fields. As a result, they are lost when a course is exported and imported into a different instance, and course authors have to configure them again.
This PR carries the prerequisite settings through the OLX export and applies them back through the gating API on import. It supersedes #37475 and follows the conclusions of its review:
<sequential>, like the other subsection settings.OLX format
is_prereq: the subsection can be used as a prerequisite.prereq: theurl_name(block ID) of the required subsection, the same way child pointers reference blocks.prereq_min_scoreandprereq_min_completion: omitted when empty.The attributes are only used during import. They are never persisted in
xml_attributes, so a later export cannot emit stale values.Import behavior
The gating of the destination course is reconciled with the archive:
Invalid prerequisite settings of the subsection "Gated" (...): "..." is not a subsection of this course.Supporting information
Testing instructions
sequential/<A>.xmlandsequential/<B>.xmlfor the attributes above.Automated tests:
Deadline
None.
Private-ref: BB-11256