Example #1
0
def tool_config(request):
    """
    This produces a Canvas specific XML config that can be used to
    add this tool to the Canvas LMS
    """
    if request.is_secure():
        host = 'https://' + request.get_host()
    else:
        host = 'http://' + request.get_host()

    url = host + reverse('edx2canvas:lti_launch')

    lti_tool_config = ToolConfig(
        title='Add edX Content',
        launch_url=url,
        secure_launch_url=url,
    )
    account_nav_params = {
        'enabled': 'true',
        'text': 'Add edX Content',
        'visibility': 'admins',
    }
    lti_tool_config.set_ext_param('canvas.instructure.com', 'privacy_level', 'public')
    lti_tool_config.set_ext_param('canvas.instructure.com', 'course_navigation', account_nav_params)
    lti_tool_config.description = 'Import content from edX to Canvas'

    return http.HttpResponse(
        lti_tool_config.to_xml(), content_type='text/xml', status=200
    )
def tool_config(request):

    if request.is_secure():
        host = 'https://' + request.get_host()
    else:
        host = 'http://' + request.get_host()

    url = host + reverse('ac:lti_launch')

    lti_tool_config = ToolConfig(
        title='Account Courses Report',
        launch_url=url,
        secure_launch_url=url,
    )
    # this is how to tell Canvas that this tool provides a course navigation link:
    account_nav_params = {
        'enabled': 'true',
        # optionally, supply a different URL for the link:
        # 'url': 'http://library.harvard.edu',
        'text': 'Courses in this account',
        #'default': 'disabled',
        #'visibility': 'public',
    }
    lti_tool_config.set_ext_param('canvas.instructure.com', 'account_navigation', account_nav_params)
    lti_tool_config.set_ext_param('canvas.instructure.com', 'privacy_level', 'public')
    lti_tool_config.set_ext_param('canvas.instructure.com', 'tool_id', __name__)
    lti_tool_config.description = 'This LTI tool displays the information about the courses in this account.'

    resp = HttpResponse(lti_tool_config.to_xml(), content_type='text/xml', status=200)
    return resp
def tool_config(request):
    if request.is_secure():
        host = 'https://' + request.get_host()
    else:
        host = 'http://' + request.get_host()

    url = host + reverse('st:lti_launch')

    lti_tool_config = ToolConfig(
        title='LTI Sandbox Simple Tool',
        launch_url=url,
        secure_launch_url=url,
    )
    # this is how to tell Canvas that this tool provides a course navigation link:
    course_nav_params = {
        'enabled': 'true',
        'default': 'enabled',
        'visibility': 'members',  # all enrollees can see it; other values: public, admins
        # optionally, supply a different URL for the link:
        # 'url': 'http://library.harvard.edu',
        'text': 'Simple Tool',
    }
    lti_tool_config.set_ext_param('canvas.instructure.com', 'course_navigation', course_nav_params)

    lti_tool_config.description = 'This is a simple LTI tool.'

    resp = HttpResponse(lti_tool_config.to_xml(), content_type='text/xml', status=200)
    return resp
def tool_config(request):
    """
    This produces a Canvas specific XML config that can be used to
    add this tool to the Canvas LMS
    """
    if request.is_secure():
        host = 'https://' + request.get_host()
    else:
        host = 'http://' + request.get_host()

    url = host + reverse('sl:lti_launch', exclude_resource_link_id=True)

    lti_tool_config = ToolConfig(
        title='Student Locations',
        launch_url=url,
        secure_launch_url=url,
    )
    # this is how to tell Canvas that this tool provides a
    # course navigation link:
    account_nav_params = {
        'enabled': 'true',
        # optionally, supply a different URL for the link:
        # 'url': 'http://library.harvard.edu',
        'text': 'Student Locations',
        'default': 'disabled',
        'visibility': 'members',
    }
    lti_tool_config.set_ext_param('canvas.instructure.com', 'privacy_level', 'public')
    lti_tool_config.set_ext_param('canvas.instructure.com', 'course_navigation', account_nav_params)
    lti_tool_config.description = 'This LTI tool facilitates the display of Student Locations.'

    resp = HttpResponse(lti_tool_config.to_xml(), content_type='text/xml', status=200)
    return resp
Example #5
0
def tool_config(request):
    """
    This produces a Canvas specific XML config that can be used to
    add this tool to the Canvas LMS
    """
    if request.is_secure():
        host = 'https://' + request.get_host()
    else:
        host = 'http://' + request.get_host()

    url = host + reverse('canvasPR_app:lti_launch')

    lti_tool_config = ToolConfig(
        title='Photo Roster - Test',
        launch_url=url,
        secure_launch_url=url,
    )
    account_nav_params = {
        'enabled': 'true',
        'visibility': 'admins',
        # optionally, supply a different URL for the link:
        # 'url': 'http://library.harvard.edu',
        'text': 'Photo Roster - Test',
    }
    lti_tool_config.set_ext_param('canvas.instructure.com', 'privacy_level',
                                  'public')
    lti_tool_config.set_ext_param('canvas.instructure.com',
                                  'course_navigation', account_nav_params)
    lti_tool_config.description = 'This LTI app shows all the LTI parameters'

    resp = HttpResponse(lti_tool_config.to_xml(),
                        content_type='text/xml',
                        status=200)
    return resp
Example #6
0
def tool_config(request):
    """
    This produces a Canvas specific XML config that can be used to
    add this tool to the Canvas LMS
    """
    if request.is_secure():
        host = 'https://' + request.get_host()
    else:
        host = 'http://' + request.get_host()

    url = host + reverse('edx2canvas:lti_launch')

    lti_tool_config = ToolConfig(
        title='Add edX Content',
        launch_url=url,
        secure_launch_url=url,
    )
    account_nav_params = {
        'enabled': 'true',
        'text': 'Add edX Content',
        'visibility': 'admins',
    }
    lti_tool_config.set_ext_param('canvas.instructure.com', 'privacy_level',
                                  'public')
    lti_tool_config.set_ext_param('canvas.instructure.com',
                                  'course_navigation', account_nav_params)
    lti_tool_config.description = 'Import content from edX to Canvas'

    return http.HttpResponse(lti_tool_config.to_xml(),
                             content_type='text/xml',
                             status=200)
Example #7
0
def tool_config(request):
    """
    This produces a Canvas specific XML config that can be used to
    add this tool to the Canvas LMS
    """
    if request.is_secure():
        host = 'https://' + request.get_host()
    else:
        host = 'http://' + request.get_host()

    url = host + reverse('canvasPR_app:lti_launch')

    lti_tool_config = ToolConfig(
        title='Photo Roster - Test',
        launch_url=url,
        secure_launch_url=url,
    )
    account_nav_params = {
        'enabled': 'true',
        'visibility': 'admins',
        # optionally, supply a different URL for the link:
        # 'url': 'http://library.harvard.edu',
        'text': 'Photo Roster - Test',
    }
    lti_tool_config.set_ext_param('canvas.instructure.com', 'privacy_level', 'public')
    lti_tool_config.set_ext_param('canvas.instructure.com', 'course_navigation', account_nav_params)
    lti_tool_config.description = 'This LTI app shows all the LTI parameters'

    resp = HttpResponse(lti_tool_config.to_xml(), content_type='text/xml', status=200)
    return resp
Example #8
0
def tool_config(request):
    index_url = request.build_absolute_uri(reverse("ab_testing_tool_index"))
    resource_selection_url = request.build_absolute_uri(reverse("ab_testing_tool_resource_selection"))
    
    config = ToolConfig(
        title="A/B Testing Tool",
        launch_url=index_url,
        secure_launch_url=index_url,
    )
    # Tell Canvas that this tool provides a course navigation link:
    nav_params = {
        "enabled": "true",
        "url": index_url,
        "text": "A/B Testing Tool",
        "visibility": "admins",
    }
    config.set_ext_param("canvas.instructure.com", "privacy_level", "public")
    config.set_ext_param("canvas.instructure.com", "course_navigation",
                         nav_params)
    config.set_ext_param("canvas.instructure.com", "resource_selection",
                         {"enabled": "true", "url": resource_selection_url})
    config.set_ext_param("canvas.instructure.com", "selection_height", "800")
    config.set_ext_param("canvas.instructure.com", "selection_width", "800")
    config.set_ext_param("canvas.instructure.com", "tool_id", "ab_testing_tool")
    config.description = ("Tool to allow students in a course to " +
                          "get different content in a module item.")
    
    resp = HttpResponse(config.to_xml(), content_type="text/xml", status=200)
    return resp
Example #9
0
def tool_config(request):
    '''
    Generates an XML config that can be used to add this tool to the Canvas LMS
    '''
    TOOL_NAME = 'Adaptive Quiz LTI'
    host = 'https://' + request.get_host()

    lti_tool_config = ToolConfig(
        title=TOOL_NAME,
        launch_url = host,
        secure_launch_url = host,
    )

    # # configuration for nav bar
    # course_nav_params = {
    #     'enabled': 'true',
    #     'selection_width':"700",
    #     'selection_height':"500",
    #     'url': host + reverse('lti:manage_quizzes'),
    # }
    # lti_tool_config.set_ext_param('canvas.instructure.com', 'course_navigation', course_nav_params)

    # configuration for quiz selection mode
    resource_selection_params = {
        'enabled': 'true',
        'selection_width':"700",
        'selection_height':"500",
        'url': request.build_absolute_uri(reverse('lti:launch_resource_selection')),
    }
    # add resource selection params to the xml
    lti_tool_config.set_ext_param('canvas.instructure.com', 'resource_selection', resource_selection_params)

    lti_tool_config.set_ext_param('canvas.instructure.com', 'privacy_level', 'public')
    lti_tool_config.set_ext_param('canvas.instructure.com', 'domain', request.get_host().partition(':')[0])
    lti_tool_config.description = 'The Qualtrics LTI Bridge allows instructors to embed qualtrics quizzes in an LMS as an LTI tool.'
    
    return HttpResponse(lti_tool_config.to_xml(), content_type='text/xml', status=200)