Commit a09a4feb by Vik Paruchuri

Fix category generation

parent fb37d46b
...@@ -66,11 +66,11 @@ from cms.djangoapps.models.settings.course_metadata import CourseMetadata ...@@ -66,11 +66,11 @@ from cms.djangoapps.models.settings.course_metadata import CourseMetadata
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
COMPONENT_TYPES = ['customtag', 'discussion', 'html', 'problem', 'video', 'advanced', 'openended'] COMPONENT_TYPES = ['customtag', 'discussion', 'html', 'problem', 'video']
ADVANCED_COMPONENT_TYPES = { ADVANCED_COMPONENT_TYPES = {
'openended' : ['combinedopenended', 'peergrading'], 'openended' : ['combinedopenended', 'peergrading'],
'advanced' : ['advanced'] 'advanced' : ['annotation']
} }
ADVANCED_COMPONENT_CATEGORY = 'advanced' ADVANCED_COMPONENT_CATEGORY = 'advanced'
...@@ -301,14 +301,14 @@ def edit_unit(request, location): ...@@ -301,14 +301,14 @@ def edit_unit(request, location):
templates = modulestore().get_items(Location('i4x', 'edx', 'templates')) templates = modulestore().get_items(Location('i4x', 'edx', 'templates'))
for template in templates: for template in templates:
if template.location.category in COMPONENT_TYPES: category = template.location.category
#This is a hack to create categories for different xmodules for key in ADVANCED_COMPONENT_TYPES:
category = template.location.category if template.location.category in ADVANCED_COMPONENT_TYPES[key]:
for key in ADVANCED_COMPONENT_TYPES: category = key
if template.location.category in ADVANCED_COMPONENT_TYPES[key]: break
category = key
break
if category in COMPONENT_TYPES:
#This is a hack to create categories for different xmodules
component_templates[template.location.category].append(( component_templates[template.location.category].append((
template.display_name, template.display_name,
template.location.url(), template.location.url(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment