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):

    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
Пример #3
0
def tool_config(request):
    url = "https://{}{}".format(request.get_host(), reverse('lti_launch'))
    url = _url(url)

    title = 'Admin Console'
    lti_tool_config = ToolConfig(
        title=title,
        launch_url=url,
        secure_launch_url=url,
        description=
        "This LTI tool provides a suite of tools for administering your Canvas account."
    )

    # this is how to tell Canvas that this tool provides an account navigation link:
    nav_params = {
        'enabled': 'true',
        'text': title,
        'default': 'disabled',
        'visibility': 'admins',
    }
    custom_fields = {'canvas_membership_roles': '$Canvas.membership.roles'}
    lti_tool_config.set_ext_param('canvas.instructure.com', 'custom_fields',
                                  custom_fields)
    lti_tool_config.set_ext_param('canvas.instructure.com',
                                  'account_navigation', nav_params)
    lti_tool_config.set_ext_param('canvas.instructure.com', 'privacy_level',
                                  'public')

    return HttpResponse(lti_tool_config.to_xml(), content_type='text/xml')
Пример #4
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
def tool_config(request):
    env = settings.ENV_NAME if hasattr(settings, 'ENV_NAME') else ''
    url = "%s://%s%s" % (request.scheme, request.get_host(),
                         reverse('lti_launch', exclude_resource_link_id=True))
    title = 'Course Emailer'
    if env and env != 'prod':
        title += ' ' + env
    lti_tool_config = ToolConfig(
        title=title,
        launch_url=url,
        secure_launch_url=url,
        description="This LTI tool allows email functionality for this course site."
    )

    # this is how to tell Canvas that this tool provides a course navigation link:
    course_nav_params = {
        'enabled': 'true',
        'text': title,
        'default': 'disabled',
        'visibility': 'admins',
    }
    custom_fields = {'canvas_membership_roles': '$Canvas.membership.roles'}
    lti_tool_config.set_ext_param('canvas.instructure.com', 'custom_fields', custom_fields)
    lti_tool_config.set_ext_param('canvas.instructure.com', 'course_navigation', course_nav_params)
    lti_tool_config.set_ext_param('canvas.instructure.com', 'privacy_level', 'public')

    return HttpResponse(lti_tool_config.to_xml(), content_type='text/xml')
Пример #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)
def tool_config(request):

    url = "https://{}{}".format(request.get_host(), reverse('lti_launch'))
    url = _url(url)

    title = 'Manage Course'
    lti_tool_config = ToolConfig(
        title=title,
        launch_url=url,
        secure_launch_url=url,
        description="This LTI tool provides a suite of tools for administering your Canvas course."
    )

    # this is how to tell Canvas that this tool provides a course navigation link:
    nav_params = {
        'enabled': 'true',
        'text': title,
        'default': 'disabled',
        'visibility': 'admins',
    }
    custom_fields = {'canvas_membership_roles': '$Canvas.membership.roles'}
    lti_tool_config.set_ext_param('canvas.instructure.com', 'custom_fields', custom_fields)
    lti_tool_config.set_ext_param('canvas.instructure.com', 'course_navigation', nav_params)
    lti_tool_config.set_ext_param('canvas.instructure.com', 'privacy_level', 'public')

    return HttpResponse(lti_tool_config.to_xml(), content_type='text/xml')
Пример #8
0
 def get_tool_config(self):
     '''Returns an instance of ToolConfig()'''
     return ToolConfig(
         title=self.TOOL_TITLE,
         description=self.TOOL_DESCRIPTION,
         launch_url=self.get_launch_url(),
         secure_launch_url=self.get_launch_url(force_secure=True),
     )
Пример #9
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
    )
Пример #10
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
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
Пример #12
0
 def get_tool_config(self, request):
     '''
     Returns an instance of ToolConfig().
     '''
     launch_url = self.get_launch_url(request)
     return ToolConfig(
         title=self.TOOL_TITLE,
         launch_url=launch_url,
         secure_launch_url=launch_url,
     )
Пример #13
0
 def get_tool_config(self, request):
     '''
     Returns an instance of ToolConfig().
     '''
     launch_url = self.get_launch_url(request)
     return ToolConfig(
         title=LTI_SETUP['TOOL_TITLE'],
         description=LTI_SETUP['TOOL_DESCRIPTION'],
         launch_url=launch_url,
         secure_launch_url=launch_url,
     )
    def test_tool_config(self):
        launch_url = "http://foo.bar/"
        self.view.get_launch_url = Mock(return_value=launch_url)

        expected = ToolConfig(title=self.view.TOOL_TITLE,
                              launch_url=launch_url,
                              secure_launch_url=launch_url)
        actual = self.view.get_tool_config(self.view.request)

        self.assertEqual(actual.title, expected.title)
        self.assertEqual(actual.launch_url, expected.launch_url)
        self.assertEqual(actual.secure_launch_url, expected.secure_launch_url)
Пример #15
0
def tool_config(request):
    env = settings.ENV_NAME if hasattr(settings, 'ENV_NAME') else ''
    url = "%s://%s%s" % (request.scheme, request.get_host(),
                         reverse('lti_launch', exclude_resource_link_id=True))
    title = 'Artifact'
    if env and env != 'prod':
        title += ' ' + env
    lti_tool_config = ToolConfig(
        title=title,
        launch_url=url,
        secure_launch_url=url,
        description="This LTI tool allows users to create rich map pages"
    )

    # this is how to tell Canvas that this tool provides a course navigation link:
    course_nav_params = {
        'enabled': 'true',
        'text': title,
        'default': 'disabled',
        'visibility': 'admins',
    }
    lti_tool_config.set_ext_param(
        'canvas.instructure.com', 'course_navigation', course_nav_params)
    lti_tool_config.set_ext_param(
        'canvas.instructure.com', 'privacy_level', 'public')

    return HttpResponse(lti_tool_config.to_xml(), content_type='text/xml')
Пример #16
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)
def tool_config(request):
    url = "%s://%s%s" % (
        request.scheme, request.get_host(), reverse('custom_redirect:lti_launch', exclude_resource_link_id=True)
    )
    lti_tool_config = ToolConfig(
        title='Custom Redirect',
        launch_url=url,
        secure_launch_url=url,
        description='This LTI tool provides custom redirects based on the given LTI params',
        launch_presentation_document_target='window'
    )

    # this is how to tell Canvas that this tool provides a course navigation link:
    course_nav_params = {
        'enabled': 'true',
        'text': 'Custom Redirect',
        'default': 'disabled',
        'visibility': 'admins',
    }
    lti_tool_config.set_ext_param('canvas.instructure.com', 'course_navigation', course_nav_params)
    lti_tool_config.set_ext_param('canvas.instructure.com', 'privacy_level', 'public')
    lti_tool_config.set_custom_param('redirect_type', 'sis_class_roster')

    return HttpResponse(lti_tool_config.to_xml(), content_type='text/xml')
def tool_config(request):
    url = "%s://%s%s" % (request.scheme, request.get_host(),
                         reverse('lti_launch', exclude_resource_link_id=True))
    title = 'Admin Console'
    lti_tool_config = ToolConfig(
        title=title,
        launch_url=url,
        secure_launch_url=url,
        description="This LTI tool provides a suite of tools for administering your Canvas account."
    )

    # this is how to tell Canvas that this tool provides an account navigation link:
    nav_params = {
        'enabled': 'true',
        'text': title,
        'default': 'disabled',
        'visibility': 'admins',
    }
    custom_fields = {'canvas_membership_roles': '$Canvas.membership.roles'}
    lti_tool_config.set_ext_param('canvas.instructure.com', 'custom_fields', custom_fields)
    lti_tool_config.set_ext_param('canvas.instructure.com', 'account_navigation', nav_params)
    lti_tool_config.set_ext_param('canvas.instructure.com', 'privacy_level', 'public')

    return HttpResponse(lti_tool_config.to_xml(), content_type='text/xml')
def tool_config(request):
    env = settings.ENV_NAME if hasattr(settings, 'ENV_NAME') else ''
    url = "%s://%s%s" % (
        request.scheme,
        request.get_host(),
        reverse('bulk_site_creation:lti_launch', exclude_resource_link_id=True)
    )
    lti_tool_config = ToolConfig(
        title="Canvas Site Creator %s" % env,
        launch_url=url,
        secure_launch_url=url,
        description="This LTI tool provides canvas site creation functionality."
    )

    # this is how to tell Canvas that this tool provides an account navigation link:
    lti_tool_config.set_ext_param('canvas.instructure.com', 'account_navigation', {
        'enabled': 'true',
        'text': "Canvas Site Creator %s" % env
    })
    lti_tool_config.set_ext_param('canvas.instructure.com', 'privacy_level', 'public')

    return HttpResponse(lti_tool_config.to_xml(), content_type='text/xml', status=200)
Пример #20
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