Repository navigation
feat: copy competency criteria to a new course run - #933
alezconsultant wants to merge 1 commit into
Conversation
Adds copy_competency_criteria_for_course_rerun(), which recreates a course run's in-force criteria tree on a new run of the same course. Each competency gets a new course-level group under its existing root, so the two runs are alternative ways to demonstrate it. Archived groups, archived criteria, and groups left without an in-force criterion are not copied. Each copied criterion points at the new run's ObjectTag for the same block and tag, so the caller copies the content tags first. A competency that already has a course-level group on the new run is skipped, which lets a retried rerun finish with one copy. Related to openedx#694 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Thanks for the pull request, @alezconsultant! 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. |
|
Review of this change by /backend-code-review (Claude Fable 5.2, medium effort) |
Description
Adds the
openedx-corehalf of #694: a function that copies a course run's competency criteria onto a new run of the same course.openedx-platformcalls it from the course rerun task, after it has copied the content tags.Behavior
ObjectTagfor the same block and tag. A rule on a retired profile keeps that profile: the copy reproduces the source run's rules and does not reassign a profile.skipped_taxonomy_idsis not copied. The platform passes the taxonomies that are not enabled for the new run's organization.CourseRunrow has no criteria, so the function returns zero counts. A missing destinationCourseRunrow or a missing destinationObjectTagraises, and the transaction leaves nothing behind.save(), so history records are written for groups and criteria, and model validation runs for criteria.Testing
pytest tests/openedx_learning/applets/cbe/test_copy_criteria.py --no-cov(25 tests). The full CBE suite,lint-imports, the linters, andmypypass.Manual testing
This function has no user-facing path of its own. It is exercised through the course rerun in the
openedx-platformpull request, which lists the Studio steps.Notes for reviewers
Known limits
CompetencyCriterion.save(), which validates a custom override again. If a later release tightens that validation and leaves an older override invalid, a rerun of that course fails until the override is corrected. Grading already skips such a rule on the source run.Related to #694
🤖 Generated with Claude Code
Summary by CodeRabbit