plugins.py 866 Bytes
Newer Older
1 2 3 4
"""
Registers the "edX Notes" feature for the edX platform.
"""

5
from django.utils.translation import ugettext_noop
6

7
from courseware.tabs import EnrolledTab
8 9


10
class EdxNotesTab(EnrolledTab):
11
    """
12
    The representation of the edX Notes course tab type.
13 14
    """

15
    type = "edxnotes"
16
    title = ugettext_noop("Notes")
17 18 19
    view_name = "edxnotes"

    @classmethod
20
    def is_enabled(cls, course, user=None):  # pylint: disable=unused-argument
21 22 23 24 25 26 27
        """Returns true if the edX Notes feature is enabled in the course.

        Args:
            course (CourseDescriptor): the course using the feature
            settings (dict): a dict of configuration settings
            user (User): the user interacting with the course
        """
28
        if not super(EdxNotesTab, cls).is_enabled(course, user=user):
29
            return False
30
        return course.edxnotes