diff --git a/cms/djangoapps/contentstore/tests/tests.py b/cms/djangoapps/contentstore/tests/tests.py index a858f4e68d..d0b8261908 100644 --- a/cms/djangoapps/contentstore/tests/tests.py +++ b/cms/djangoapps/contentstore/tests/tests.py @@ -441,7 +441,7 @@ class ContentStoreTest(TestCase): def test_capa_module(self): - """Test that a problem w/ markdown has markdown and uses the right html etc""" + """Test that a problem treats markdown specially.""" CourseFactory.create(org='MITx', course='999', display_name='Robot Super Course') problem_data = { diff --git a/common/lib/xmodule/xmodule/capa_module.py b/common/lib/xmodule/xmodule/capa_module.py index 228690fb7a..67fc46d25a 100644 --- a/common/lib/xmodule/xmodule/capa_module.py +++ b/common/lib/xmodule/xmodule/capa_module.py @@ -685,13 +685,12 @@ class CapaDescriptor(RawDescriptor): _context.update({'markdown': self.metadata.get('markdown', '')}) return _context - # overriding super's definition in a way which may get out of sync. It could call the super definition and - # then remove the 'markdown' property, but that seems expensive. Can't add markdown to system_metadata_fields - # because that prevents save_item from saving changes to it. We may want a list of metadata fields that are - # editable only via specific editors? @property def editable_metadata_fields(self): - subset = [name for name in self.metadata.keys() if name != 'markdown' and name not in self.system_metadata_fields] + """Remove metadata from the editable fields since it has its own editor""" + subset = super(CapaDescriptor,self).editable_metadata_fields + if 'markdown' in subset: + subset.remove('markdown') return subset