Skip to content

Conversation

@MaferMazu
Copy link
Contributor

@MaferMazu MaferMazu commented Dec 31, 2025

Description

This PR adds logic to the library_content transformer to support all xblocks that inherit from ItemBankMixin.

Supporting information

Problem

The transformer didn't remove the non-selected children from the problem bank (randomized content from a content library v2 - itembankblock in the code), so the structure shows inconsistent information (more questions/grades than the user is available to see/solve)

Solution

Adding the logic to analyze the block_class and check whether it inherits from itembankmixin. I apply the same logic as the legacy library content to all xblocks with randomized content, without removing support for the legacy libraries.

Testing instructions

Pre-requisites:

  • Have a tutor environment with a master or a release greater than or equal to teak (cherry-pick the commit from this branch or use this branch if you are using master)
  • Have a course, and in Settings > Scheduled & Details, verify the course start date (use an old date, for example, 2020)
  • Configure grading Settings > Grading.

Test:

LegacyLibraries

  1. Create a Legacy Library (in Studio, click Legacy Libraries, and then +New Library) and add some problems for testing.
  2. In a course, add a subsection, and then a unit, and then a "Legacy Library" component. (configure grade to the subsection)
  3. Edit the "Legacy Library" component to use the library created, and if you want, you can configure how many problems are going to show to the student.
  4. Publish the content.
  5. Click view live version.

Things to verify in LMS (with the live version or a student account):

  • In the outline, the section shows the correct number of questions.
  • In the progress page, in the detailed grades, you should only see the gradable XBlocks available.

ProblemBank

  1. Create a Content Library (in Studio, click +New Library) and add some problems for testing.
  2. In a course, add a subsection, and then a unit, and then a "Problem Bank" component. (configure grade to the subsection)
  3. Add components to the "Problem Bank", and if you want, you can configure how many problems are going to show to the student.
  4. Publish the content.
  5. Click view live version.

Things to verify in LMS (with the live version or a student account):
The same from the LegacyLibraries

Another Xblock (optional)

  1. Install an Xblock that inherits from ItemBankMixin (for example, https://github.com/eduNEXT-collab/xblock-exam-question-bank)
  2. Activate the plugin in the course https://github.com/eduNEXT-collab/xblock-exam-question-bank?tab=readme-ov-file#enabling-the-xblock-in-a-course
  3. In a course, add a subsection, and then a unit, and then an "Advanced" component, and select the custom XBlock. (configure grade to the subsection)
  4. Publish the content.
  5. Click view live version.

Things to verify in LMS (with the live version or a student account):
The same from the LegacyLibraries

Screenshots

Base
image
Problem Bank Configuration (to show 1 of 4 problems)

Before
image
Problem Bank in LMS (problem: in the sidebar bar, it shows we had four problems available when we have 1)

After
image
Problem Bank in LMS (It shows we have 1 question) ✅
image
Progress in LMS (In the grade details, we have the correct information) ✅

@openedx-webhooks
Copy link

Thanks for the pull request, @MaferMazu!

This repository is currently maintained by @openedx/wg-maintenance-edx-platform.

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 approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To 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:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where 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:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Dec 31, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Contributions Dec 31, 2025
@MaferMazu MaferMazu force-pushed the mfmz/modify-content-library-transformers branch 2 times, most recently from f87cd38 to f3c61ae Compare January 2, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

2 participants