コード例 #1
0
class PeerGradingFields(object):
    use_for_single_location = Boolean(
        display_name="Show Single Problem",
        help='When True, only the single problem specified by "Link to Problem Location" is shown. '
             'When False, a panel is displayed with all problems available for peer grading.',
        default=USE_FOR_SINGLE_LOCATION, scope=Scope.settings
    )
    link_to_location = String(
        display_name="Link to Problem Location",
        help='The location of the problem being graded. Only used when "Show Single Problem" is True.',
        default=LINK_TO_LOCATION, scope=Scope.settings
    )
    is_graded = Boolean(
        display_name="Graded",
        help='Defines whether the student gets credit for grading this problem. Only used when "Show Single Problem" is True.',
        default=IS_GRADED, scope=Scope.settings
    )
    due_date = Date(help="Due date that should be displayed.", default=None, scope=Scope.settings)
    grace_period_string = String(help="Amount of grace to give on the due date.", default=None, scope=Scope.settings)
    max_grade = Integer(
        help="The maximum grade that a student can receive for this problem.", default=MAX_SCORE,
        scope=Scope.settings, values={"min": 0}
    )
    student_data_for_location = Dict(
        help="Student data for a given peer grading problem.",
        scope=Scope.user_state
    )
    weight = Float(
        display_name="Problem Weight",
        help="Defines the number of points each problem is worth. If the value is not set, each problem is worth one point.",
        scope=Scope.settings, values={"min": 0, "step": ".1"}
    )
コード例 #2
0
class AnnotatableFields(object):
    """ Fields for `VideoModule` and `VideoDescriptor`. """
    data = String(help="XML data for the annotation",
                  scope=Scope.content,
                  default=textwrap.dedent("""\
        <annotatable>
            <instructions>
                <p>
                    Add the instructions to the assignment here.
                </p>
            </instructions>
        </annotatable>
        """))
    display_name = String(
        display_name="Display Name",
        help="Display name for this module",
        scope=Scope.settings,
        default='Video Annotation',
    )
    sourceurl = String(help="The external source URL for the video.",
                       display_name="Source URL",
                       scope=Scope.settings,
                       default="http://video-js.zencoder.com/oceans-clip.mp4")
    poster_url = String(help="Poster Image URL",
                        display_name="Poster URL",
                        scope=Scope.settings,
                        default="")
    annotation_storage_url = String(
        help="Location of Annotation backend",
        scope=Scope.settings,
        default="http://your_annotation_storage.com",
        display_name="Url for Annotation Storage")
コード例 #3
0
class AnnotatableFields(object):
    """ Fields for `VideoModule` and `VideoDescriptor`. """
    data = String(help=_("XML data for the annotation"),
                  scope=Scope.content,
                  default=textwrap.dedent("""\
        <annotatable>
            <instructions>
                <p>
                    Add the instructions to the assignment here.
                </p>
            </instructions>
        </annotatable>
        """))
    display_name = String(
        display_name=_("Display Name"),
        help=_("Display name for this module"),
        scope=Scope.settings,
        default=_('Video Annotation'),
    )
    sourceurl = String(help=_("The external source URL for the video."),
                       display_name=_("Source URL"),
                       scope=Scope.settings,
                       default="http://video-js.zencoder.com/oceans-clip.mp4")
    poster_url = String(help=_("Poster Image URL"),
                        display_name=_("Poster URL"),
                        scope=Scope.settings,
                        default="")
コード例 #4
0
class CrowdsourceHinterFields(object):
    """Defines fields for the crowdsource hinter module."""
    has_children = True

    moderate = String(help='String "True"/"False" - activates moderation', scope=Scope.content,
                      default='False')
    debug = String(help='String "True"/"False" - allows multiple voting', scope=Scope.content,
                   default='False')
    # Usage: hints[answer] = {str(pk): [hint_text, #votes]}
    # hints is a dictionary that takes answer keys.
    # Each value is itself a dictionary, accepting hint_pk strings as keys,
    # and returning [hint text, #votes] pairs as values
    hints = Dict(help='A dictionary containing all the active hints.', scope=Scope.content, default={})
    mod_queue = Dict(help='A dictionary containing hints still awaiting approval', scope=Scope.content,
                     default={})
    hint_pk = Integer(help='Used to index hints.', scope=Scope.content, default=0)

    # A list of previous hints that a student viewed.
    # Of the form [answer, [hint_pk_1, ...]] for each problem.
    # Sorry about the variable name - I know it's confusing.
    previous_answers = List(help='A list of hints viewed.', scope=Scope.user_state, default=[])

    # user_submissions actually contains a list of previous answers submitted.
    # (Originally, preivous_answers did this job, hence the name confusion.)
    user_submissions = List(help='A list of previous submissions', scope=Scope.user_state, default=[])
    user_voted = Boolean(help='Specifies if the user has voted on this problem or not.',
                         scope=Scope.user_state, default=False)
コード例 #5
0
ファイル: timelimit_module.py プロジェクト: qunub/MHST2013-14
class TimeLimitFields(object):
    beginning_at = Float(help="The time this timer was started", scope=Scope.user_state)
    ending_at = Float(help="The time this timer will end", scope=Scope.user_state)
    accomodation_code = String(help="A code indicating accommodations to be given the student", scope=Scope.user_state)
    time_expired_redirect_url = String(help="Url to redirect users to after the timelimit has expired", scope=Scope.settings)
    duration = Float(help="The length of this timer", scope=Scope.settings)
    suppress_toplevel_navigation = Boolean(help="Whether the toplevel navigation should be suppressed when viewing this module", scope=Scope.settings)
コード例 #6
0
class VideoAlphaFields(object):
    data = String(help="XML data for the problem", scope=Scope.content)
    position = Integer(help="Current position in the video",
                       scope=Scope.user_state,
                       default=0)
    display_name = String(help="Display name for this module",
                          scope=Scope.settings)
コード例 #7
0
class XModuleFields(object):
    display_name = String(
        display_name="Display Name",
        help=
        "This name appears in the horizontal navigation at the top of the page.",
        scope=Scope.settings,
        # it'd be nice to have a useful default but it screws up other things; so,
        # use display_name_with_default for those
        default=None)

    # Please note that in order to be compatible with XBlocks more generally,
    # the LMS and CMS shouldn't be using this field. It's only for internal
    # consumption by the XModules themselves
    location = LocationField(
        display_name="Location",
        help="This is the location id for the XModule.",
        scope=Scope.content,
        default=Location(None),
    )
    # Please note that in order to be compatible with XBlocks more generally,
    # the LMS and CMS shouldn't be using this field. It's only for internal
    # consumption by the XModules themselves
    category = String(
        display_name="xmodule category",
        help=
        "This is the category id for the XModule. It's for internal use only",
        scope=Scope.content,
    )
コード例 #8
0
ファイル: html_module.py プロジェクト: qunub/MHST2013-14
class HtmlFields(object):
    data = String(help="Html contents to display for this module",
                  scope=Scope.content)
    source_code = String(
        help=
        "Source code for LaTeX documents. This feature is not well-supported.",
        scope=Scope.settings)
コード例 #9
0
class CrowdsourceHinterFields(object):
    """Defines fields for the crowdsource hinter module."""
    has_children = True

    moderate = String(help='String "True"/"False" - activates moderation',
                      scope=Scope.content,
                      default='False')
    debug = String(help='String "True"/"False" - allows multiple voting',
                   scope=Scope.content,
                   default='False')
    # Usage: hints[answer] = {str(pk): [hint_text, #votes]}
    # hints is a dictionary that takes answer keys.
    # Each value is itself a dictionary, accepting hint_pk strings as keys,
    # and returning [hint text, #votes] pairs as values
    hints = Dict(help='A dictionary containing all the active hints.',
                 scope=Scope.content,
                 default={})
    mod_queue = Dict(
        help='A dictionary containing hints still awaiting approval',
        scope=Scope.content,
        default={})
    hint_pk = Integer(help='Used to index hints.',
                      scope=Scope.content,
                      default=0)
    # A list of previous answers this student made to this problem.
    # Of the form [answer, [hint_pk_1, hint_pk_2, hint_pk_3]] for each problem.  hint_pk's are
    # None if the hint was not given.
    previous_answers = List(help='A list of previous submissions.',
                            scope=Scope.user_state,
                            default=[])
    user_voted = Boolean(
        help='Specifies if the user has voted on this problem or not.',
        scope=Scope.user_state,
        default=False)
コード例 #10
0
class PeerGradingFields(object):
    use_for_single_location = StringyBoolean(
        help="Whether to use this for a single location or as a panel.",
        default=USE_FOR_SINGLE_LOCATION,
        scope=Scope.settings)
    link_to_location = String(help="The location this problem is linked to.",
                              default=LINK_TO_LOCATION,
                              scope=Scope.settings)
    is_graded = StringyBoolean(help="Whether or not this module is scored.",
                               default=IS_GRADED,
                               scope=Scope.settings)
    due_date = Date(help="Due date that should be displayed.",
                    default=None,
                    scope=Scope.settings)
    grace_period_string = String(
        help="Amount of grace to give on the due date.",
        default=None,
        scope=Scope.settings)
    max_grade = StringyInteger(
        help="The maximum grade that a student can receieve for this problem.",
        default=MAX_SCORE,
        scope=Scope.settings)
    student_data_for_location = Object(
        help="Student data for a given peer grading problem.",
        scope=Scope.user_state)
    weight = StringyFloat(help="How much to weight this problem by",
                          scope=Scope.settings)
コード例 #11
0
ファイル: lti_module.py プロジェクト: rayhooker/edx-platform
class LTIFields(object):
    """
    Fields to define and obtain LTI tool from provider are set here,
    except credentials, which should be set in course settings::

    `lti_id` is id to connect tool with credentials in course settings. It should not contain :: (double semicolon)
    `launch_url` is launch URL of tool.
    `custom_parameters` are additional parameters to navigate to proper book and book page.

    For example, for Vitalsource provider, `launch_url` should be
    *https://bc-staging.vitalsource.com/books/book*,
    and to get to proper book and book page, you should set custom parameters as::

        vbid=put_book_id_here
        book_location=page/put_page_number_here

    Default non-empty URL for `launch_url` is needed due to oauthlib demand (URL scheme should be presented)::

    https://github.com/idan/oauthlib/blob/master/oauthlib/oauth1/rfc5849/signature.py#L136
    """
    display_name = String(display_name="Display Name", help="Display name for this module", scope=Scope.settings, default="LTI")
    lti_id = String(help="Id of the tool", default='', scope=Scope.settings)
    launch_url = String(help="URL of the tool", default='http://www.example.com', scope=Scope.settings)
    custom_parameters = List(help="Custom parameters (vbid, book_location, etc..)", scope=Scope.settings)
    open_in_a_new_page = Boolean(help="Should LTI be opened in new page?", default=True, scope=Scope.settings)
    graded = Boolean(help="Grades will be considered in overall score.", default=False, scope=Scope.settings)
    weight = Float(
        help="Weight for student grades.",
        default=1.0,
        scope=Scope.settings,
        values={"min": 0},
    )
    has_score = Boolean(help="Does this LTI module have score?", default=False, scope=Scope.settings)
コード例 #12
0
class LTIFields(object):
    """
    Fields to define and obtain LTI tool from provider are set here,
    except credentials, which should be set in course settings::

    `lti_id` is id to connect tool with credentials in course settings.
    `launch_url` is launch url of tool.
    `custom_parameters` are additional parameters to navigate to proper book and book page.

    For example, for Vitalsource provider, `launch_url` should be
    *https://bc-staging.vitalsource.com/books/book*,
    and to get to proper book and book page, you should set custom parameters as::

        vbid=put_book_id_here
        book_location=page/put_page_number_here

    Default non-empty url for `launch_url` is needed due to oauthlib demand (url scheme should be presented)::

    https://github.com/idan/oauthlib/blob/master/oauthlib/oauth1/rfc5849/signature.py#L136
    """
    lti_id = String(help="Id of the tool", default='', scope=Scope.settings)
    launch_url = String(help="URL of the tool",
                        default='http://www.example.com',
                        scope=Scope.settings)
    custom_parameters = List(
        help="Custom parameters (vbid, book_location, etc..)",
        scope=Scope.settings)
    open_in_a_new_page = Boolean(help="Should LTI be opened in new page?",
                                 default=True,
                                 scope=Scope.settings)
コード例 #13
0
class ErrorFields(object):
    """
    XBlock fields used by the ErrorModules
    """
    contents = String(scope=Scope.content)
    error_msg = String(scope=Scope.content)
    display_name = String(scope=Scope.settings)
コード例 #14
0
class AnnotatableFields(object):
    data = String(help="XML data for the annotation",
                  scope=Scope.content,
                  default=textwrap.dedent("""\
        <annotatable>
            <instructions>
                <p>Enter your (optional) instructions for the exercise in HTML format.</p>
                <p>Annotations are specified by an <code>&lt;annotation&gt;</code> tag which may may have the following attributes:</p>
                <ul class="instructions-template">
                    <li><code>title</code> (optional). Title of the annotation. Defaults to <i>Commentary</i> if omitted.</li>
                    <li><code>body</code> (<b>required</b>). Text of the annotation.</li>
                    <li><code>problem</code> (optional). Numeric index of the problem associated with this annotation. This is a zero-based index, so the first problem on the page would have <code>problem="0"</code>.</li>
                    <li><code>highlight</code> (optional). Possible values: yellow, red, orange, green, blue, or purple. Defaults to yellow if this attribute is omitted.</li>
                </ul>
            </instructions>
            <p>Add your HTML with annotation spans here.</p>
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. <annotation title="My title" body="My comment" highlight="yellow" problem="0">Ut sodales laoreet est, egestas gravida felis egestas nec.</annotation> Aenean at volutpat erat. Cras commodo viverra nibh in aliquam.</p>
            <p>Nulla facilisi. <annotation body="Basic annotation example." problem="1">Pellentesque id vestibulum libero.</annotation> Suspendisse potenti. Morbi scelerisque nisi vitae felis dictum mattis. Nam sit amet magna elit. Nullam volutpat cursus est, sit amet sagittis odio vulputate et. Curabitur euismod, orci in vulputate imperdiet, augue lorem tempor purus, id aliquet augue turpis a est. Aenean a sagittis libero. Praesent fringilla pretium magna, non condimentum risus elementum nec. Pellentesque faucibus elementum pharetra. Pellentesque vitae metus eros.</p>
        </annotatable>
        """))
    display_name = String(
        display_name="Display Name",
        help="Display name for this module",
        scope=Scope.settings,
        default='Annotation',
    )
コード例 #15
0
class FolditFields(object):
    # default to what Spring_7012x uses
    required_level = Integer(default=4, scope=Scope.settings)
    required_sublevel = Integer(default=5, scope=Scope.settings)
    due = Date(help="Date that this problem is due by", scope=Scope.settings)

    show_basic_score = String(scope=Scope.settings, default='false')
    show_leaderboard = String(scope=Scope.settings, default='false')
コード例 #16
0
class AboutFields(object):
    display_name = String(
        help="Display name for this module",
        scope=Scope.settings,
        default="overview",
    )
    data = String(help="Html contents to display for this module",
                  default="",
                  scope=Scope.content)
コード例 #17
0
class CombinedOpenEndedFields(object):
    display_name = String(help="Display name for this module",
                          default="Open Ended Grading",
                          scope=Scope.settings)
    current_task_number = StringyInteger(
        help="Current task that the student is on.",
        default=0,
        scope=Scope.user_state)
    task_states = List(
        help="List of state dictionaries of each task within this module.",
        scope=Scope.user_state)
    state = String(
        help="Which step within the current task that the student is on.",
        default="initial",
        scope=Scope.user_state)
    student_attempts = StringyInteger(
        help="Number of attempts taken by the student on this problem",
        default=0,
        scope=Scope.user_state)
    ready_to_reset = StringyBoolean(
        help="If the problem is ready to be reset or not.",
        default=False,
        scope=Scope.user_state)
    attempts = StringyInteger(
        help="Maximum number of attempts that a student is allowed.",
        default=1,
        scope=Scope.settings)
    is_graded = StringyBoolean(help="Whether or not the problem is graded.",
                               default=False,
                               scope=Scope.settings)
    accept_file_upload = StringyBoolean(
        help="Whether or not the problem accepts file uploads.",
        default=False,
        scope=Scope.settings)
    skip_spelling_checks = StringyBoolean(
        help="Whether or not to skip initial spelling checks.",
        default=True,
        scope=Scope.settings)
    due = Date(help="Date that this problem is due by",
               default=None,
               scope=Scope.settings)
    graceperiod = String(
        help=
        "Amount of time after the due date that submissions will be accepted",
        default=None,
        scope=Scope.settings)
    version = VersionInteger(help="Current version number",
                             default=DEFAULT_VERSION,
                             scope=Scope.settings)
    data = String(help="XML data for the problem", scope=Scope.content)
    weight = StringyFloat(help="How much to weight this problem by",
                          scope=Scope.settings)
    markdown = String(help="Markdown source of this module",
                      scope=Scope.settings)
コード例 #18
0
class HtmlFields(object):
    display_name = String(
        display_name="Display Name",
        help="This name appears in the horizontal navigation at the top of the page.",
        scope=Scope.settings,
        # it'd be nice to have a useful default but it screws up other things; so,
        # use display_name_with_default for those
        default="Text"
    )
    data = String(help="Html contents to display for this module", default=u"", scope=Scope.content)
    source_code = String(help="Source code for LaTeX documents. This feature is not well-supported.", scope=Scope.settings)
コード例 #19
0
class DiscussionFields(object):
    discussion_id = String(scope=Scope.settings)
    discussion_category = String(
        display_name="Category",
        help=
        "A category name for the discussion. This name appears in the left pane of the discussion forum for the course.",
        scope=Scope.settings)
    discussion_target = String(
        display_name="Subcategory",
        help=
        "A subcategory name for the discussion. This name appears in the left pane of the discussion forum for the course.",
        scope=Scope.settings)
    sort_key = String(scope=Scope.settings)
コード例 #20
0
class VideoFields(object):
    """Fields for `VideoModule` and `VideoDescriptor`."""
    display_name = String(
        display_name="Display Name",
        help="This name appears in the horizontal navigation at the top of the page.",
        scope=Scope.settings,
        # it'd be nice to have a useful default but it screws up other things; so,
        # use display_name_with_default for those
        default="Video"
    )
    data = String(
        help="XML data for the problem",
        default='',
        scope=Scope.content
    )
    position = Integer(help="Current position in the video", scope=Scope.user_state, default=0)
    show_captions = Boolean(help="This controls whether or not captions are shown by default.", display_name="Show Captions", scope=Scope.settings, default=True)
    youtube_id_1_0 = String(help="This is the Youtube ID reference for the normal speed video.", display_name="Default Speed", scope=Scope.settings, default="OEoXaMPEzfM")
    youtube_id_0_75 = String(help="The Youtube ID for the .75x speed video.", display_name="Speed: .75x", scope=Scope.settings, default="")
    youtube_id_1_25 = String(help="The Youtube ID for the 1.25x speed video.", display_name="Speed: 1.25x", scope=Scope.settings, default="")
    youtube_id_1_5 = String(help="The Youtube ID for the 1.5x speed video.", display_name="Speed: 1.5x", scope=Scope.settings, default="")
    start_time = Float(help="Time the video starts", display_name="Start Time", scope=Scope.settings, default=0.0)
    end_time = Float(help="Time the video ends", display_name="End Time", scope=Scope.settings, default=0.0)
    source = String(help="The external URL to download the video. This appears as a link beneath the video.", display_name="Download Video", scope=Scope.settings, default="")
    track = String(help="The external URL to download the subtitle track. This appears as a link beneath the video.", display_name="Download Track", scope=Scope.settings, default="")
コード例 #21
0
ファイル: course_module.py プロジェクト: qunub/MHST2013-14
class CourseFields(object):
    textbooks = TextbookList(help="List of pairs of (title, url) for textbooks used in this course", scope=Scope.content)
    wiki_slug = String(help="Slug that points to the wiki for this course", scope=Scope.content)
    enrollment_start = Date(help="Date that enrollment for this class is opened", scope=Scope.settings)
    enrollment_end = Date(help="Date that enrollment for this class is closed", scope=Scope.settings)
    start = Date(help="Start time when this module is visible", scope=Scope.settings)
    end = Date(help="Date that this class ends", scope=Scope.settings)
    advertised_start = String(help="Date that this course is advertised to start", scope=Scope.settings)
    grading_policy = Dict(help="Grading policy definition for this class", scope=Scope.content)
    show_calculator = Boolean(help="Whether to show the calculator in this course", default=False, scope=Scope.settings)
    display_name = String(help="Display name for this module", scope=Scope.settings)
    tabs = List(help="List of tabs to enable in this course", scope=Scope.settings)
    end_of_course_survey_url = String(help="Url for the end-of-course survey", scope=Scope.settings)
    discussion_blackouts = List(help="List of pairs of start/end dates for discussion blackouts", scope=Scope.settings)
    discussion_topics = Dict(
        help="Map of topics names to ids",
        scope=Scope.settings
        )
    testcenter_info = Dict(help="Dictionary of Test Center info", scope=Scope.settings)
    announcement = Date(help="Date this course is announced", scope=Scope.settings)
    cohort_config = Dict(help="Dictionary defining cohort configuration", scope=Scope.settings)
    is_new = Boolean(help="Whether this course should be flagged as new", scope=Scope.settings)
    no_grade = Boolean(help="True if this course isn't graded", default=False, scope=Scope.settings)
    disable_progress_graph = Boolean(help="True if this course shouldn't display the progress graph", default=False, scope=Scope.settings)
    pdf_textbooks = List(help="List of dictionaries containing pdf_textbook configuration", scope=Scope.settings)
    html_textbooks = List(help="List of dictionaries containing html_textbook configuration", scope=Scope.settings)
    remote_gradebook = Dict(scope=Scope.settings)
    allow_anonymous = Boolean(scope=Scope.settings, default=True)
    allow_anonymous_to_peers = Boolean(scope=Scope.settings, default=False)
    advanced_modules = List(help="Beta modules used in your course", scope=Scope.settings)
    has_children = True
    checklists = List(scope=Scope.settings)
    info_sidebar_name = String(scope=Scope.settings, default='Course Handouts')
    show_timezone = Boolean(help="True if timezones should be shown on dates in the courseware", scope=Scope.settings, default=True)
    enrollment_domain = String(help="External login method associated with user accounts allowed to register in course",
                        scope=Scope.settings)

    # An extra property is used rather than the wiki_slug/number because
    # there are courses that change the number for different runs. This allows
    # courses to share the same css_class across runs even if they have
    # different numbers.
    #
    # TODO get rid of this as soon as possible or potentially build in a robust
    # way to add in course-specific styling. There needs to be a discussion
    # about the right way to do this, but arjun will address this ASAP. Also
    # note that the courseware template needs to change when this is removed.
    css_class = String(help="DO NOT USE THIS", scope=Scope.settings)

    # TODO: This is a quick kludge to allow CS50 (and other courses) to
    # specify their own discussion forums as external links by specifying a
    # "discussion_link" in their policy JSON file. This should later get
    # folded in with Syllabus, Course Info, and additional Custom tabs in a
    # more sensible framework later.
    discussion_link = String(help="DO NOT USE THIS", scope=Scope.settings)

    # TODO: same as above, intended to let internal CS50 hide the progress tab
    # until we get grade integration set up.
    # Explicit comparison to True because we always want to return a bool.
    hide_progress_tab = Boolean(help="DO NOT USE THIS", scope=Scope.settings)
コード例 #22
0
class PollFields(object):
    # Name of poll to use in links to this poll
    display_name = String(
        help="Display name for this module", scope=Scope.settings)

    voted = Boolean(help="Whether this student has voted on the poll",
                    scope=Scope.user_state, default=False)
    poll_answer = String(
        help="Student answer", scope=Scope.user_state, default='')
    poll_answers = Object(
        help="All possible answers for the poll fro other students", scope=Scope.content)

    answers = List(
        help="Poll answers from xml", scope=Scope.content, default=[])
    question = String(help="Poll question", scope=Scope.content, default='')
コード例 #23
0
class AnnotatableFields(object):
    """ Fields for `ImageModule` and `ImageDescriptor`. """
    data = String(help="XML data for the annotation",
                  scope=Scope.content,
                  default=textwrap.dedent("""\
        <annotatable>
            <instructions>
                <p>
                    Add the instructions to the assignment here.
                </p>
            </instructions>
            <p>
                Lorem ipsum dolor sit amet, at amet animal petentium nec. Id augue nemore postulant mea. Ex eam dicant noluisse expetenda, alia admodum abhorreant qui et. An ceteros expetenda mea, tale natum ipsum quo no, ut pro paulo alienum noluisse.
            </p>
            <json>
                navigatorSizeRatio: 0.25,
                wrapHorizontal:     false,
                showNavigator: true,
                navigatorPosition: "BOTTOM_LEFT",
                showNavigationControl: true,
                tileSources:    [{"profile": "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", "scale_factors": [1, 2, 4, 8, 16, 32, 64], "tile_height": 1024, "height": 3466, "width": 113793, "tile_width": 1024, "qualities": ["native", "bitonal", "grey", "color"], "formats": ["jpg", "png", "gif"], "@context": "http://library.stanford.edu/iiif/image-api/1.1/context.json", "@id": "http://54.187.32.48/loris/suzhou_orig.jp2"}],
            </json>
        </annotatable>
        """))
    display_name = String(
        display_name=_("Display Name"),
        help=_("Display name for this module"),
        scope=Scope.settings,
        default=_('Image Annotation'),
    )
    instructor_tags = String(
        display_name=_("Tags for Assignments"),
        help=
        _("Add tags that automatically highlight in a certain color using the comma-separated form, i.e. imagery:red,parallelism:blue"
          ),
        scope=Scope.settings,
        default='professor:green,teachingAssistant:blue',
    )
    annotation_storage_url = String(
        help=_("Location of Annotation backend"),
        scope=Scope.settings,
        default="http://your_annotation_storage.com",
        display_name=_("Url for Annotation Storage"))
    annotation_token_secret = String(
        help=_("Secret string for annotation storage"),
        scope=Scope.settings,
        default="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        display_name=_("Secret Token String for Annotation"))
コード例 #24
0
class WordCloudFields(object):
    """XFields for word cloud."""
    display_name = String(help="Display name for this module",
                          scope=Scope.settings)
    num_inputs = Integer(help="Number of inputs.",
                         scope=Scope.settings,
                         default=5)
    num_top_words = Integer(
        help="Number of max words, which will be displayed.",
        scope=Scope.settings,
        default=250)
    display_student_percents = Boolean(
        help="Display usage percents for each word?",
        scope=Scope.settings,
        default=True)

    # Fields for descriptor.
    submitted = Boolean(
        help="Whether this student has posted words to the cloud.",
        scope=Scope.user_state,
        default=False)
    student_words = List(help="Student answer.",
                         scope=Scope.user_state,
                         default=[])
    all_words = Object(help="All possible words from all students.",
                       scope=Scope.content)
    top_words = Object(help="Top num_top_words words for word cloud.",
                       scope=Scope.content)
コード例 #25
0
class RawDescriptor(XmlDescriptor, XMLEditingDescriptor):
    """
    Module that provides a raw editing view of its data and children.  It
    requires that the definition xml is valid.
    """
    data = String(help="XML data for the module",
                  default="",
                  scope=Scope.content)

    @classmethod
    def definition_from_xml(cls, xml_object, system):
        return {
            'data':
            etree.tostring(xml_object, pretty_print=True, encoding='unicode')
        }, []

    def definition_to_xml(self, resource_fs):
        try:
            return etree.fromstring(self.data)
        except etree.XMLSyntaxError as err:
            # Can't recover here, so just add some info and
            # re-raise
            lines = self.data.split('\n')
            line, offset = err.position
            msg = ("Unable to create xml for module {loc}. "
                   "Context: '{context}'".format(
                       context=lines[line - 1][offset - 40:offset + 40],
                       loc=self.location))
            raise SerializationError(self.location, msg)
コード例 #26
0
class XModuleFields(object):
    display_name = String(
        display_name="Display Name",
        help=
        "This name appears in the horizontal navigation at the top of the page.",
        scope=Scope.settings,
        default=None)
コード例 #27
0
class CourseInfoFields(object):
    """
    Field overrides
    """
    data = String(help="Html contents to display for this module",
                  default="<ol></ol>",
                  scope=Scope.content)
コード例 #28
0
class StaticTabFields(object):
    """
    The overrides for Static Tabs
    """
    display_name = String(
        display_name="Display Name",
        help=
        "This name appears in the horizontal navigation at the top of the page.",
        scope=Scope.settings,
        default="Empty",
    )
    data = String(default=textwrap.dedent("""\
            <p>This is where you can add additional pages to your courseware. Click the 'edit' button to begin editing.</p>
        """),
                  scope=Scope.content,
                  help="HTML for the additional pages")
コード例 #29
0
class PeerGradingFields(object):
    use_for_single_location = Boolean(
        display_name="Show Single Problem",
        help=
        'When True, only the single problem specified by "Link to Problem Location" is shown. '
        'When False, a panel is displayed with all problems available for peer grading.',
        default=False,
        scope=Scope.settings)
    link_to_location = String(
        display_name="Link to Problem Location",
        help=
        'The location of the problem being graded. Only used when "Show Single Problem" is True.',
        default="",
        scope=Scope.settings)
    graded = Boolean(
        display_name="Graded",
        help=
        'Defines whether the student gets credit for grading this problem. Only used when "Show Single Problem" is True.',
        default=False,
        scope=Scope.settings)
    due = Date(help="Due date that should be displayed.",
               default=None,
               scope=Scope.settings)
    grace_period_string = String(
        help="Amount of grace to give on the due date.",
        default=None,
        scope=Scope.settings)
    student_data_for_location = Dict(
        help="Student data for a given peer grading problem.",
        scope=Scope.user_state)
    weight = Float(
        display_name="Problem Weight",
        help=
        "Defines the number of points each problem is worth. If the value is not set, each problem is worth one point.",
        scope=Scope.settings,
        values={
            "min": 0,
            "step": ".1"
        },
        default=1)
    display_name = String(display_name="Display Name",
                          help="Display name for this module",
                          scope=Scope.settings,
                          default="Peer Grading Interface")
    data = String(help="Html contents to display for this module",
                  default='<peergrading></peergrading>',
                  scope=Scope.content)
コード例 #30
0
class CmsNamespace(Namespace):
    """
    Namespace with fields common to all blocks in Studio
    """
    published_date = DateTuple(help="Date when the module was published",
                               scope=Scope.settings)
    published_by = String(help="Id of the user who published this module",
                          scope=Scope.settings)