This section provides instructions for deploying your XBlock in devstack.
For more information about devstack, see the Installing, Configuring, and Running the Open edX Platform.
Before proceeding with the steps to deploy your XBlock, ensure the following requirements are met.
Use SSH to access the devstack Vagrant instance.
$ vagrant ssh
Install the XBlock.
vagrant@precise64:~$ sudo -u edxapp /edx/bin/pip.edxapp install /path/to/your/block
In the file edx-platform/lms/envs/common.py
, ensure the following lines
are not commented out:
from xmodule.x_module import prefer_xmodules
XBLOCK_SELECT_FUNCTION = prefer_xmodules
.. first line not there. obsolete?
In the file edx-platform/cms/envs/common.py
, ensure the following lines
are not commented out:
from xmodule.x_module import prefer_xmodules
XBLOCK_SELECT_FUNCTION = prefer_xmodules
In edx-platform/cms/envs/common.py
, change the
'ALLOW_ALL_ADVANCED_COMPONENTS'
value to True
.:
'ALLOW_ALL_ADVANCED_COMPONENTS': True,
Start the LMS server.
edxapp@precise64:~$ paver devstack lms
Start the Studio server.
edxapp@precise64:~$ paver devstack studio
You must enable the XBlock in each course in which you intend to use it.
Log in to Studio.
Open the course.
From the Settings menu, select Advanced Settings.
In the Advanced Module List field, place your cursor between the braces, and then type the exact name of the XBlock.
Note
The name you enter must match exactly the name specified in your XBlock’s
setup.py
file.
If you see other values in the Advanced Module List field, add a comma after the closing quotation mark for the last value, and then type the name of your XBlock.
At the bottom of the page, select Save Changes.
You can add instances of the XBlock in any unit in the course.
On the unit page, under Add New Component, select Advanced.
Your XBlock is listed as one of the types you can add.
Select the name of your XBlock to add an instance to the unit.
You can then edit the properties of the instance as needed by selecting the Edit button.
For more information about working with components in Studio, see Developing Course Components in the Building and Running an Open edX guide.