Add default launch url for lti.
This commit is contained in:
@@ -16,9 +16,9 @@ window.LTI = (function () {
|
||||
|
||||
// If the Form's action attribute is set (i.e. we can perform a normal
|
||||
// submit), then we submit the form and make the frame shown.
|
||||
if (form.attr('action')) {
|
||||
if (form.attr('action') && form.attr('action') !== 'http://www.example.com') {
|
||||
form.submit();
|
||||
element.find('.lti').addClass('rendered')
|
||||
element.find('.lti').addClass('rendered');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,9 +38,12 @@ class LTIFields(object):
|
||||
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='', 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)
|
||||
|
||||
|
||||
@@ -213,7 +216,6 @@ class LTIModule(LTIFields, XModule):
|
||||
body.update(custom_parameters)
|
||||
|
||||
headers = {
|
||||
'Host': self.system.HOSTNAME,
|
||||
# This is needed for body encoding:
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
}
|
||||
|
||||
@@ -75,6 +75,6 @@ class TestLTI(BaseTestXmodule):
|
||||
'input_fields': self.correct_headers,
|
||||
'element_class': self.item_module.location.category,
|
||||
'element_id': self.item_module.location.html_id(),
|
||||
'launch_url': '', # default value
|
||||
'launch_url': 'http://www.example.com', # default value
|
||||
}
|
||||
self.assertDictEqual(generated_context, expected_context)
|
||||
|
||||
Reference in New Issue
Block a user