fix: apply library_content transformer to all ItemBankMixin xblocks #37830
+79
−25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
Test:
LegacyLibraries
Things to verify in LMS (with the live version or a student account):
ProblemBank
Things to verify in LMS (with the live version or a student account):
The same from the LegacyLibraries
Another Xblock (optional)
Things to verify in LMS (with the live version or a student account):
The same from the LegacyLibraries
Screenshots
Base

Problem Bank Configuration (to show 1 of 4 problems)
Before

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


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