This document describes how to extend the edX platform with a new tab that can be added to courses.
...
Method | Signature | Description |
---|---|---|
is_enabled | def is_enabled(cls, course, user=None) | Returns true if this tab is enabled for the current course for the specified user. If user is None, this method is being called by Studio and should generally return True if the tab will be shown to at least some students. |
validate | def validate(cls, tab_dict, raise_error=True) | Validates a dictionary representing a course tab. If raise_error then issues are raised as exceptions, else the function should return True if the dictionary is valid. |
Note |
---|
The course stores a static list of its tabs in the database, and this list is only updated when one of the following actions take place:
This means that if you have a pre-existing course then it won't immediately show a tab even after you've registered the new entry point. |
3. Implement the view
You have two choices to implement your new tab view:
...
- You can put a breakpoint in this method to see whether or not your tab type is being added:
- The method which returns all possible tab types is here:
- https://github.com/edx/edx-platform/blob/master/openedx/core/lib/course_tabs.py#L20
- You can print the tab_types to see if tab isn't returned in the full list of types.
If your new tab type isn't returned then that means that the entry point registration didn't work.
- Try the following:
- check that you registered your new tab in setup.py.
- If you added your new Django app into edx-platform, then add it here:
- make sure that you've increased the version number so that pip knows that it needs to reinstall
- try manually reinstalling the app. For an edx-platform extension, do the following in devstack:
No Format sudo su edxapp pip install -e /edx/app/edxapp/edx-platform
...