Exemplo n.º 1
0
def get_schema_fields():
    enabled_name = (
        GUIDE_SETTINGS_SCHEMA_SECTION + ':' + GUIDE_ENABLED_FOR_THIS_COURSE)
    enabled = schema_fields.SchemaField(
        enabled_name, 'Enable Guides', 'boolean',
        optional=True, i18n=False, editable=True,
        description=str(safe_dom.NodeList(
        ).append(safe_dom.Text(
            'If checked, this course will be included in the guides '
            'experience accessible at ')
        ).append(safe_dom.assemble_link(
            '/modules/guides', '/modules/guides', target="_blank")
        ).append(safe_dom.Text('. Course must not be Private. ')
        ).append(safe_dom.assemble_link(
            services.help_urls.get(enabled_name), 'Learn more...',
            target="_blank"))))
    color = schema_fields.SchemaField(
        GUIDE_SETTINGS_SCHEMA_SECTION + ':' + GUIDE_COLOR,
        'Color', 'string',
        optional=True, i18n=False, editable=True,
        description='The color scheme for this course\'s guides must '
            'be expressed as a web color hex triplet, beginning with '
            'a "#". If blank, #00838F will be used.')
    duration = schema_fields.SchemaField(
        GUIDE_SETTINGS_SCHEMA_SECTION + ':' + GUIDE_DURATION,
        'Duration', 'integer',
        optional=True, i18n=False, editable=True, default_value=0,
        description=(
            'Specify the average length of each lesson in the course in '
            'minutes and it will be used to estimate the duration of each '
            'guide. If blank or set to 0, duration will not be shown.'))
    availabiliy_name = GUIDE_SETTINGS_SCHEMA_SECTION + ':' + GUIDE_AVAILABILITY
    availability = schema_fields.SchemaField(
        availabiliy_name, 'Availability', 'boolean', optional=True, i18n=False,
        select_data=AVAILABILITY_SELECT_DATA,
        default_value=courses.AVAILABILITY_COURSE,
        description=str(safe_dom.NodeList(
        ).append(safe_dom.Text(
            'Guides default to the availability of the course, '
            'but may also be restricted to admins (Private). ')
        ).append(safe_dom.assemble_link(
            services.help_urls.get(availabiliy_name), 'Learn more...',
            target="_blank"))))

    return (lambda _: enabled, lambda _: color, lambda _: duration,
            lambda _: availability)
Exemplo n.º 2
0
__author__ = 'Mike Gainer ([email protected])'


STUDENT_GROUPS_DESCRIPTION = safe_dom.NodeList(
    ).append(safe_dom.Element('p').add_text(
        """Manage groups of students. Group level settings can override
course level settings, and apply only to students in that
group. Events recorded for students are marked with their current
group. Certain analytics can be filtered to show only results relating
to individual groups.""")
    ).append(safe_dom.Element('span').add_text(
        """This page allows you to create your student groups. You can then
        manage membership and content access on the
        """)
    ).append(safe_dom.assemble_link(
        'dashboard?action=availability', 'availability page'))

GROUP_MEMBERS_DESCRIPTION = """
A list of email addresses of students.  Student emails may be assigned to
groups before they are registered for the course.  Separate email addresses
with any combination of commas, spaces, tabs or newlines."""

EDIT_STUDENT_GROUPS_PERMISSION_DESCRIPTION = """
Allows creation, deletion, and modification of membership in groups of students.
Other permissions may be required to configure group-level settings to
override course-level settings -- e.g., to modify course/unit/lesson
availability.
"""

STUDENT_GROUP_ID_DESCRIPTION = """
Numeric ID of the group to which the student belongs, or null if the student
Exemplo n.º 3
0
GIFT_QUESTIONS_DESCRIPTION = """
Each question is imported as a separate question (named Q1, Q2, etc.).
Additionally, a question group is added with all the questions. Course Builder
supports multiple choice, true-false, short answer, and numerical questions.
"""

IMAGES_DOCS_UPLOAD_NEW_FILE_DESCRIPTION = """
Upload a file to set or replace the content of this asset.
"""

IMAGES_DOCS_UPLOAD_NEW_CSS_DESCRIPTION = """
Upload a new CSS file, which must not have the same name as any existing CSS
file.<br>
To edit an existing CSS file, select it from the previous
""" + str(safe_dom.assemble_link(
    "dashboard?action=style_css", "Style > CSS",
    title="Opens the Style > CSS list in a new browser tab.",
    target="_blank")) + """
list.
"""

IMAGES_DOCS_UPLOAD_NEW_HTML_DESCRIPTION = """
Upload a new HTML file, which must not have the same name as any existing
HTML file.<br>
To edit an existing HTML file, select it from the previous
""" + str(safe_dom.assemble_link(
    "dashboard?action=edit_html", "Create > HTML",
    title="Opens the Create > HTML list in a new browser tab.",
    target="_blank")) + """
list.
"""
Exemplo n.º 4
0
def get_schema_fields():
    enabled_name = WEBSERV_SETTINGS_SCHEMA_SECTION + ':' + WEBSERV_ENABLED
    enabled = schema_fields.SchemaField(
        enabled_name, 'Enable Web Server', 'boolean', optional=True, i18n=False,
        description=str(safe_dom.NodeList(
            ).append(safe_dom.Text(
                'If checked, static content uploaded for this course '
                'will be served. ')
            ).append(safe_dom.assemble_link(
                services.help_urls.get(enabled_name), 'Learn more...',
                target="_blank"))))
    slug = schema_fields.SchemaField(
        WEBSERV_SETTINGS_SCHEMA_SECTION + ':' + WEBSERV_SLUG,
        'URL Component', 'string', optional=True, i18n=False,
        validator=slug_validator,
        description='This is added to the end of the course URL to '
            'access the web server content root. If blank, the root '
            'course URL is used.')
    doc_root_name = WEBSERV_SETTINGS_SCHEMA_SECTION + ':' + WEBSERV_DOC_ROOT
    doc_root = schema_fields.SchemaField(
        doc_root_name, 'Content Root', 'string', optional=True, i18n=False,
        select_data=make_doc_root_select_data(),
        description=str(safe_dom.NodeList(
            ).append(safe_dom.Text(
                'This is the directory within /modules/webserv/document_roots '
                'to use as the web server content root. ')
            ).append(safe_dom.assemble_link(
                services.help_urls.get(doc_root_name), 'Learn more...',
                target="_blank"))))
    enabled_jinja = schema_fields.SchemaField(
        WEBSERV_SETTINGS_SCHEMA_SECTION + ':' + WEBSERV_JINJA_ENABLED,
        'Process Templates', 'boolean', optional=True, i18n=False,
        description='If checked, the Jinja Template Processor will be applied '
            'to *.html files before serving them.')
    enabled_md = schema_fields.SchemaField(
        WEBSERV_SETTINGS_SCHEMA_SECTION + ':' + WEBSERV_MD_ENABLED,
        'Process Markdown', 'boolean', optional=True, i18n=False,
        description='If checked, the Markdown Processor will be applied to '
            '*.md files before serving them.')
    caching = schema_fields.SchemaField(
        WEBSERV_SETTINGS_SCHEMA_SECTION + ':' + WEBSERV_CACHING,
        'Caching Policy', 'string', optional=True, i18n=False,
        default_value=CACHING_NONE, select_data=CACHING_SELECT_DATA,
        description='This controls whether the web pages can be cached by the '
            'web browsers, and for how long. When you are actively working on '
            'content, you should set the caching to None so that you see your '
            'changes immediately.  You will also need to ask your browser to '
            'reload pages that it has already cached.')
    availability_name = (
        WEBSERV_SETTINGS_SCHEMA_SECTION + ':' + WEBSERV_AVAILABILITY)
    availability = schema_fields.SchemaField(
        availability_name, 'Availability', 'string', optional=True, i18n=False,
        default_value=courses.AVAILABILITY_COURSE,
        select_data=courses.AVAILABILITY_SELECT_DATA,
        description=str(safe_dom.NodeList(
            ).append(safe_dom.Text(
                'Web pages default to the availability of the course, but may '
                'also be restricted to admins (Private) or open to the public '
                '(Public). ')
            ).append(safe_dom.assemble_link(
                services.help_urls.get(availability_name), 'Learn more...',
                target="_blank"))))
    return (
        lambda _: enabled, lambda _: slug, lambda _: doc_root,
        lambda _: enabled_jinja, lambda _: enabled_md, lambda _: availability,
        lambda _: caching)
Exemplo n.º 5
0
Additionally, a question group is added with all the questions. Course Builder
supports multiple choice, true-false, short answer, and numerical questions.
"""

IMAGES_DOCS_UPLOAD_NEW_FILE_DESCRIPTION = """
Upload a file to set or replace the content of this asset.
"""

IMAGES_DOCS_UPLOAD_NEW_CSS_DESCRIPTION = """
Upload a new CSS file, which must not have the same name as any existing CSS
file.<br>
To edit an existing CSS file, select it from the previous
""" + str(
    safe_dom.assemble_link(
        "dashboard?action=style_css",
        "Style > CSS",
        title="Opens the Style > CSS list in a new browser tab.",
        target="_blank")) + """
list.
"""

IMAGES_DOCS_UPLOAD_NEW_HTML_DESCRIPTION = """
Upload a new HTML file, which must not have the same name as any existing
HTML file.<br>
To edit an existing HTML file, select it from the previous
""" + str(
    safe_dom.assemble_link(
        "dashboard?action=edit_html",
        "Create > HTML",
        title="Opens the Create > HTML list in a new browser tab.",
        target="_blank")) + """
Exemplo n.º 6
0
from common import safe_dom

__author__ = 'Mike Gainer ([email protected])'

STUDENT_GROUPS_DESCRIPTION = safe_dom.NodeList().append(
    safe_dom.Element('p').
    add_text("""Manage groups of students. Group level settings can override
course level settings, and apply only to students in that
group. Events recorded for students are marked with their current
group. Certain analytics can be filtered to show only results relating
to individual groups.""")).append(
        safe_dom.Element('span').add_text(
            """This page allows you to create your student groups. You can then
        manage membership and content access on the
        """)).append(
                safe_dom.assemble_link('dashboard?action=availability',
                                       'availability page'))

GROUP_MEMBERS_DESCRIPTION = """
A list of email addresses of students.  Student emails may be assigned to
groups before they are registered for the course.  Separate email addresses
with any combination of commas, spaces, tabs or newlines."""

EDIT_STUDENT_GROUPS_PERMISSION_DESCRIPTION = """
Allows creation, deletion, and modification of membership in groups of students.
Other permissions may be required to configure group-level settings to
override course-level settings -- e.g., to modify course/unit/lesson
availability.
"""

STUDENT_GROUP_ID_DESCRIPTION = """
Numeric ID of the group to which the student belongs, or null if the student