Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@sampaccoud
Created November 27, 2018 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sampaccoud/f15083325cec4f14a53bfb78fb4b4e42 to your computer and use it in GitHub Desktop.
Save sampaccoud/f15083325cec4f14a53bfb78fb4b4e42 to your computer and use it in GitHub Desktop.
diff --git a/cms/djangoapps/contentstore/views/component.py b/cms/djangoapps/contentstore/views/component.py
index f65f281151..c8d0521c30 100644
--- a/cms/djangoapps/contentstore/views/component.py
+++ b/cms/djangoapps/contentstore/views/component.py
@@ -27,6 +27,15 @@ from xblock_django.models import XBlockStudioConfigurationFlag
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.exceptions import ItemNotFoundError
+# Try to import the configurable LTI consumer xblock
+try:
+ from lti_consumer import add_dynamic_components
+except ImportError:
+ add_dynamic_components = None
+
+
__all__ = [
'container_handler',
'component_handler'
@@ -359,6 +368,17 @@ def get_component_templates(courselike, library=False):
"support_legend": create_support_legend_dict()
}
advanced_component_types = _advanced_component_types(allow_unsupported)
+
+ # Read configuration setting to create specific buttons
+ if add_dynamic_components:
+ add_dynamic_components(
+ getattr(settings, "LTI_XBLOCK_CONFIGURATIONS", []),
+ advanced_component_templates,
+ categories,
+ create_template_dict,
+ course_advanced_keys
+ )
+
# Set component types according to course policy file
if isinstance(course_advanced_keys, list):
for category in course_advanced_keys:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment