File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -651,6 +651,18 @@ def editable_metadata_fields(self):
651651
652652 metadata_fields [field .name ] = self ._create_metadata_editor_info (field )
653653
654+ # The `optional_completion` field can be either explicitly set or inherited from the parent.
655+ # While we could query the parent's field, there is a special case that cannot be supported with the platform's
656+ # completion calculations that count the completed units instead of individual XBlocks.
657+ # If this field is explicitly set to False, then we want to show it in the metadata editor so that the author
658+ # can reset it to the default inherited value.
659+ if "optional_completion" in self .fields :
660+ has_explicitly_set_optional_completion = self .fields ['optional_completion' ].is_set_on (self )
661+ if not self .optional_completion or has_explicitly_set_optional_completion :
662+ metadata_fields ["optional_completion" ] = self ._create_metadata_editor_info (
663+ self .fields ["optional_completion" ]
664+ )
665+
654666 return metadata_fields
655667
656668 def _create_metadata_editor_info (self , field ):
You can’t perform that action at this time.
0 commit comments