I have created a xblock, now I want to set this xblock as default xblock as an advanced component for every newly created course automatically.
Thanks.
the right way to solve this problem is to edit the CourseFields
class under common/lib/xmodule/xmodule/course_module.py
file. You will find that there is a class variable called advanced_modules
with type List
. you can just do something like this
advanced_modules = List(
display_name=_("Advanced Module List"),
default=[], # this is where you add default values
help=_("Enter the names of the advanced components to use in your course."),
scope=Scope.settings
)
You need to add your XBlock to the list of advanced components. In your CMS settings file, add: