feat(redwood): implement optional completion#823
Conversation
ad53f05 to
dea7328
Compare
dea7328 to
ea74837
Compare
This adds a new XBlock field that allows marking sections, subsections, and units as optional, which means that their completion is counted separately.
ea74837 to
994e741
Compare
27d21bc to
d4faeaa
Compare
|
@tecoholic, I reverted the PoC for displaying individual XBlock completion. I will look into adding the final version next week. Please feel free to review the rest. |
tecoholic
left a comment
There was a problem hiding this comment.
- I tested this: Verified that the optional completion features work as mentioned in the PR testing instructions
- I read through the code
- I checked for accessibility issues
- Includes documentation
| 'incomplete_count': incomplete_count, | ||
| 'locked_count': locked_count | ||
| } | ||
| return counts |
| has_children = getattr(block, "children", False) | ||
| is_explicitly_optional = block.get_explicitly_set_fields_by_scope(Scope.settings).get('optional_completion', False) | ||
| if view != STUDIO_VIEW and not has_children and is_explicitly_optional: | ||
| data['is-optional'] = getattr(block, 'optional_completion', False) |
There was a problem hiding this comment.
Wouldn't getattr(block, 'optional_completion', False) here return the same as is_explicitly_optional? Why not use the same value?
There was a problem hiding this comment.
@tecoholic, the optional_completion field comes from the InheritanceMixin, so it is true when any of the XBlock's parents had set it to true. By checking the explicitly set field, we ensure that the optional_completion has been set for this specific (individual) XBlock. We already display the optional banner when the unit is optional, so this information would be duplicated for each XBlock within this unit. Therefore, we want to show it only for optional XBlocks within a non-optional unit.
|
@Agrendalath I just realized the "Optional 4" banner is not actually there.
And the same 3 appear in the Learning MFE as well
|
|
@tecoholic, as mentioned in #823 (comment), I reverted these banners. Yesterday, I pushed a commit that reimplements the "Optional 1" banner as an "OPTIONAL" badge above the XBlock's name, but I forgot to update this part in the testing instructions. I'll update it now. |
92ae027 to
07503ca
Compare
07503ca to
35304d3
Compare
553d3bd
into
opencraft-release/redwood.1-echo


This adds a new XBlock field that allows marking sections, subsections, and units as optional, so their completion is counted separately.
Note: I would suggest reviewing each commit individually here.
Testing instructions
pip install -e .in the edx-platform directory to rebuildOpen_edX.egg-info.tutor dev exec cms npm run build-dev.Author's notes
Individual XBlock banners will be updated - we will leave only one, with an appropriate message. We probably won't use asides - this part is just a proof of concept.Private-ref: BB-9331