Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
68409f0c
Commit
68409f0c
authored
Sep 11, 2013
by
Alexander Kryklia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add default launch url for lti.
parent
871ad7d6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
common/lib/xmodule/xmodule/js/src/lti/lti.js
+2
-2
common/lib/xmodule/xmodule/lti_module.py
+4
-2
lms/djangoapps/courseware/tests/test_lti.py
+1
-1
No files found.
common/lib/xmodule/xmodule/js/src/lti/lti.js
View file @
68409f0c
...
@@ -16,9 +16,9 @@ window.LTI = (function () {
...
@@ -16,9 +16,9 @@ window.LTI = (function () {
// If the Form's action attribute is set (i.e. we can perform a normal
// 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.
// 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
();
form
.
submit
();
element
.
find
(
'.lti'
).
addClass
(
'rendered'
)
element
.
find
(
'.lti'
).
addClass
(
'rendered'
)
;
}
}
}
}
...
...
common/lib/xmodule/xmodule/lti_module.py
View file @
68409f0c
...
@@ -38,9 +38,12 @@ class LTIFields(object):
...
@@ -38,9 +38,12 @@ class LTIFields(object):
vbid=put_book_id_here
vbid=put_book_id_here
book_location=page/put_page_number_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
)
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
)
custom_parameters
=
List
(
help
=
"Custom parameters (vbid, book_location, etc..)"
,
scope
=
Scope
.
settings
)
...
@@ -213,7 +216,6 @@ class LTIModule(LTIFields, XModule):
...
@@ -213,7 +216,6 @@ class LTIModule(LTIFields, XModule):
body
.
update
(
custom_parameters
)
body
.
update
(
custom_parameters
)
headers
=
{
headers
=
{
'Host'
:
self
.
system
.
HOSTNAME
,
# This is needed for body encoding:
# This is needed for body encoding:
'Content-Type'
:
'application/x-www-form-urlencoded'
,
'Content-Type'
:
'application/x-www-form-urlencoded'
,
}
}
...
...
lms/djangoapps/courseware/tests/test_lti.py
View file @
68409f0c
...
@@ -75,6 +75,6 @@ class TestLTI(BaseTestXmodule):
...
@@ -75,6 +75,6 @@ class TestLTI(BaseTestXmodule):
'input_fields'
:
self
.
correct_headers
,
'input_fields'
:
self
.
correct_headers
,
'element_class'
:
self
.
item_module
.
location
.
category
,
'element_class'
:
self
.
item_module
.
location
.
category
,
'element_id'
:
self
.
item_module
.
location
.
html_id
(),
'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
)
self
.
assertDictEqual
(
generated_context
,
expected_context
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment