fix: hide library_v2 and itembank in legacy library page (#35772)
Hide options to add library_v2 and itembank blocks in legacy library page.
This commit is contained in:
@@ -279,7 +279,14 @@ def get_component_templates(courselike, library=False): # lint-amnesty, pylint:
|
||||
component_types = COMPONENT_TYPES[:]
|
||||
|
||||
# Libraries do not support discussions, drag-and-drop, and openassessment and other libraries
|
||||
component_not_supported_by_library = ['discussion', 'library', 'openassessment', 'drag-and-drop-v2']
|
||||
component_not_supported_by_library = [
|
||||
'discussion',
|
||||
'library',
|
||||
'openassessment',
|
||||
'drag-and-drop-v2',
|
||||
'library_v2',
|
||||
'itembank',
|
||||
]
|
||||
if library:
|
||||
component_types = [component for component in component_types
|
||||
if component not in set(component_not_supported_by_library)]
|
||||
|
||||
@@ -403,6 +403,8 @@ class UnitTestLibraries(CourseTestCase):
|
||||
self.assertNotIn('advanced', templates)
|
||||
self.assertNotIn('openassessment', templates)
|
||||
self.assertNotIn('library', templates)
|
||||
self.assertNotIn('library_v2', templates)
|
||||
self.assertNotIn('itembank', templates)
|
||||
|
||||
def test_advanced_problem_types(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user