Fix and test PL unit completion for contained levels #58306
Merged
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.
Fixes a case where, when a unit contained a bubble choice level, greater than 100% completion was being shown. To fix that, I changed the logic to look for the levels, instead of the units, associated with a UserLevel.
This did come with a side effect of not counting predict levels correctly. Predict levels are set up such that the Blockly level is in the ScriptLevel and contains the FreeResponse/Multi level. However, the UserLevel is created for the FreeResponse/Multi level. I added some special handling for that case.
I added a test for both BubbleChoice and predict levels.
I largely used the investigation in #57121 as a starting point here!
Warning!!
The AP CSP Create Performance Task is in progress. The most critical dates are from April 3 - April 30, 2024. Please consider any risk introduced by this PR that could affect our students taking AP CSP. Code.org students taking AP CSP primarily use App Lab for their Create Task, however a small percent use Game Lab. Carefully consider whether your change has any risk of alterering, changing, or breaking anything in these two labs. Even small changes, such as a different button color, are considered significant during this time period. Reach out to the Student Learning team or Curriculum team for more details.
Links
Testing story
Deployment strategy
Follow-up work
Privacy
Security
Caching
PR Checklist: