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
871ad7d6
Commit
871ad7d6
authored
Sep 10, 2013
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass hostname to LTI XModule
Necessary for RFC compliance with oauthlib
parent
a1d3899a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
5 deletions
+12
-5
common/lib/capa/capa/tests/__init__.py
+1
-0
common/lib/xmodule/xmodule/lti_module.py
+6
-3
common/lib/xmodule/xmodule/tests/__init__.py
+1
-0
common/lib/xmodule/xmodule/x_module.py
+2
-1
lms/djangoapps/courseware/module_render.py
+2
-1
No files found.
common/lib/capa/capa/tests/__init__.py
View file @
871ad7d6
...
@@ -36,6 +36,7 @@ def test_system():
...
@@ -36,6 +36,7 @@ def test_system():
user
=
Mock
(),
user
=
Mock
(),
filestore
=
fs
.
osfs
.
OSFS
(
os
.
path
.
join
(
TEST_DIR
,
"test_files"
)),
filestore
=
fs
.
osfs
.
OSFS
(
os
.
path
.
join
(
TEST_DIR
,
"test_files"
)),
debug
=
True
,
debug
=
True
,
hostname
=
"edx.org"
,
xqueue
=
{
'interface'
:
xqueue_interface
,
'construct_callback'
:
calledback_url
,
'default_queuename'
:
'testqueue'
,
'waittime'
:
10
},
xqueue
=
{
'interface'
:
xqueue_interface
,
'construct_callback'
:
calledback_url
,
'default_queuename'
:
'testqueue'
,
'waittime'
:
10
},
node_path
=
os
.
environ
.
get
(
"NODE_PATH"
,
"/usr/local/lib/node_modules"
),
node_path
=
os
.
environ
.
get
(
"NODE_PATH"
,
"/usr/local/lib/node_modules"
),
anonymous_student_id
=
'student'
,
anonymous_student_id
=
'student'
,
...
...
common/lib/xmodule/xmodule/lti_module.py
View file @
871ad7d6
...
@@ -6,7 +6,7 @@ http://www.imsglobal.org/LTI/v1p1p1/ltiIMGv1p1p1.html
...
@@ -6,7 +6,7 @@ http://www.imsglobal.org/LTI/v1p1p1/ltiIMGv1p1p1.html
"""
"""
import
logging
import
logging
import
oauthlib
import
oauthlib
.oauth1
import
urllib
import
urllib
from
xmodule.editing_module
import
MetadataOnlyEditingDescriptor
from
xmodule.editing_module
import
MetadataOnlyEditingDescriptor
...
@@ -212,8 +212,11 @@ class LTIModule(LTIFields, XModule):
...
@@ -212,8 +212,11 @@ class LTIModule(LTIFields, XModule):
# appending custom parameter for signing
# appending custom parameter for signing
body
.
update
(
custom_parameters
)
body
.
update
(
custom_parameters
)
# This is needed for body encoding:
headers
=
{
headers
=
{
'Content-Type'
:
'application/x-www-form-urlencoded'
}
'Host'
:
self
.
system
.
HOSTNAME
,
# This is needed for body encoding:
'Content-Type'
:
'application/x-www-form-urlencoded'
,
}
__
,
headers
,
__
=
client
.
sign
(
__
,
headers
,
__
=
client
.
sign
(
unicode
(
self
.
launch_url
),
unicode
(
self
.
launch_url
),
...
...
common/lib/xmodule/xmodule/tests/__init__.py
View file @
871ad7d6
...
@@ -62,6 +62,7 @@ def get_test_system(course_id=''):
...
@@ -62,6 +62,7 @@ def get_test_system(course_id=''):
user
=
Mock
(
is_staff
=
False
),
user
=
Mock
(
is_staff
=
False
),
filestore
=
Mock
(),
filestore
=
Mock
(),
debug
=
True
,
debug
=
True
,
hostname
=
"edx.org"
,
xqueue
=
{
'interface'
:
None
,
'callback_url'
:
'/'
,
'default_queuename'
:
'testqueue'
,
'waittime'
:
10
,
'construct_callback'
:
Mock
(
side_effect
=
"/"
)},
xqueue
=
{
'interface'
:
None
,
'callback_url'
:
'/'
,
'default_queuename'
:
'testqueue'
,
'waittime'
:
10
,
'construct_callback'
:
Mock
(
side_effect
=
"/"
)},
node_path
=
os
.
environ
.
get
(
"NODE_PATH"
,
"/usr/local/lib/node_modules"
),
node_path
=
os
.
environ
.
get
(
"NODE_PATH"
,
"/usr/local/lib/node_modules"
),
xblock_field_data
=
lambda
descriptor
:
descriptor
.
_field_data
,
xblock_field_data
=
lambda
descriptor
:
descriptor
.
_field_data
,
...
...
common/lib/xmodule/xmodule/x_module.py
View file @
871ad7d6
...
@@ -833,7 +833,7 @@ class ModuleSystem(Runtime):
...
@@ -833,7 +833,7 @@ class ModuleSystem(Runtime):
def
__init__
(
def
__init__
(
self
,
ajax_url
,
track_function
,
get_module
,
render_template
,
self
,
ajax_url
,
track_function
,
get_module
,
render_template
,
replace_urls
,
xblock_field_data
,
user
=
None
,
filestore
=
None
,
replace_urls
,
xblock_field_data
,
user
=
None
,
filestore
=
None
,
debug
=
False
,
xqueue
=
None
,
publish
=
None
,
node_path
=
""
,
debug
=
False
,
hostname
=
""
,
xqueue
=
None
,
publish
=
None
,
node_path
=
""
,
anonymous_student_id
=
''
,
course_id
=
None
,
anonymous_student_id
=
''
,
course_id
=
None
,
open_ended_grading_interface
=
None
,
s3_interface
=
None
,
open_ended_grading_interface
=
None
,
s3_interface
=
None
,
cache
=
None
,
can_execute_unsafe_code
=
None
,
replace_course_urls
=
None
,
cache
=
None
,
can_execute_unsafe_code
=
None
,
replace_course_urls
=
None
,
...
@@ -897,6 +897,7 @@ class ModuleSystem(Runtime):
...
@@ -897,6 +897,7 @@ class ModuleSystem(Runtime):
self
.
get_module
=
get_module
self
.
get_module
=
get_module
self
.
render_template
=
render_template
self
.
render_template
=
render_template
self
.
DEBUG
=
self
.
debug
=
debug
self
.
DEBUG
=
self
.
debug
=
debug
self
.
HOSTNAME
=
self
.
hostname
=
hostname
self
.
seed
=
user
.
id
if
user
is
not
None
else
0
self
.
seed
=
user
.
id
if
user
is
not
None
else
0
self
.
replace_urls
=
replace_urls
self
.
replace_urls
=
replace_urls
self
.
node_path
=
node_path
self
.
node_path
=
node_path
...
...
lms/djangoapps/courseware/module_render.py
View file @
871ad7d6
...
@@ -347,6 +347,8 @@ def get_module_for_descriptor_internal(user, descriptor, field_data_cache, cours
...
@@ -347,6 +347,8 @@ def get_module_for_descriptor_internal(user, descriptor, field_data_cache, cours
filestore
=
descriptor
.
system
.
resources_fs
,
filestore
=
descriptor
.
system
.
resources_fs
,
get_module
=
inner_get_module
,
get_module
=
inner_get_module
,
user
=
user
,
user
=
user
,
debug
=
settings
.
DEBUG
,
hostname
=
settings
.
SITE_NAME
,
# TODO (cpennington): This should be removed when all html from
# TODO (cpennington): This should be removed when all html from
# a module is coming through get_html and is therefore covered
# a module is coming through get_html and is therefore covered
# by the replace_static_urls code below
# by the replace_static_urls code below
...
@@ -380,7 +382,6 @@ def get_module_for_descriptor_internal(user, descriptor, field_data_cache, cours
...
@@ -380,7 +382,6 @@ def get_module_for_descriptor_internal(user, descriptor, field_data_cache, cours
# pass position specified in URL to module through ModuleSystem
# pass position specified in URL to module through ModuleSystem
system
.
set
(
'position'
,
position
)
system
.
set
(
'position'
,
position
)
system
.
set
(
'DEBUG'
,
settings
.
DEBUG
)
if
settings
.
MITX_FEATURES
.
get
(
'ENABLE_PSYCHOMETRICS'
):
if
settings
.
MITX_FEATURES
.
get
(
'ENABLE_PSYCHOMETRICS'
):
system
.
set
(
system
.
set
(
'psychometrics_handler'
,
# set callback for updating PsychometricsData
'psychometrics_handler'
,
# set callback for updating PsychometricsData
...
...
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