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
31e91529
Commit
31e91529
authored
Apr 08, 2014
by
polesye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BLD-753: Add i18n for LTI.
parent
363c38a8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
+12
-6
common/lib/xmodule/xmodule/lti_module.py
+11
-5
lms/templates/lti_form.html
+1
-1
No files found.
common/lib/xmodule/xmodule/lti_module.py
View file @
31e91529
...
@@ -42,7 +42,6 @@ import hashlib
...
@@ -42,7 +42,6 @@ import hashlib
import
base64
import
base64
import
urllib
import
urllib
import
textwrap
import
textwrap
import
json
from
lxml
import
etree
from
lxml
import
etree
from
webob
import
Response
from
webob
import
Response
import
mock
import
mock
...
@@ -230,8 +229,11 @@ class LTIModule(LTIFields, XModule):
...
@@ -230,8 +229,11 @@ class LTIModule(LTIFields, XModule):
try
:
try
:
param_name
,
param_value
=
[
p
.
strip
()
for
p
in
custom_parameter
.
split
(
'='
,
1
)]
param_name
,
param_value
=
[
p
.
strip
()
for
p
in
custom_parameter
.
split
(
'='
,
1
)]
except
ValueError
:
except
ValueError
:
raise
LTIError
(
'Could not parse custom parameter: {0!r}.
\
_
=
self
.
runtime
.
service
(
self
,
"i18n"
)
.
ugettext
Should be "x=y" string.'
.
format
(
custom_parameter
))
msg
=
_
(
'Could not parse custom parameter: {custom_parameter}. Should be "x=y" string.'
)
.
format
(
custom_parameter
=
"{0!r}"
.
format
(
custom_parameter
)
)
raise
LTIError
(
msg
)
# LTI specs: 'custom_' should be prepended before each custom parameter, as pointed in link above.
# LTI specs: 'custom_' should be prepended before each custom parameter, as pointed in link above.
if
param_name
not
in
PARAMETERS
:
if
param_name
not
in
PARAMETERS
:
...
@@ -659,8 +661,12 @@ oauth_consumer_key="", oauth_signature="frVp4JuvT1mVXlxktiAUjQ7%2F1cw%3D"'}
...
@@ -659,8 +661,12 @@ oauth_consumer_key="", oauth_signature="frVp4JuvT1mVXlxktiAUjQ7%2F1cw%3D"'}
try
:
try
:
lti_id
,
key
,
secret
=
[
i
.
strip
()
for
i
in
lti_passport
.
split
(
':'
)]
lti_id
,
key
,
secret
=
[
i
.
strip
()
for
i
in
lti_passport
.
split
(
':'
)]
except
ValueError
:
except
ValueError
:
raise
LTIError
(
'Could not parse LTI passport: {0!r}.
\
_
=
self
.
runtime
.
service
(
self
,
"i18n"
)
.
ugettext
Should be "id:key:secret" string.'
.
format
(
lti_passport
))
msg
=
_
(
'Could not parse LTI passport: {lti_passport}. Should be "id:key:secret" string.'
)
.
format
(
lti_passport
=
'{0!r}'
.
format
(
lti_passport
)
)
raise
LTIError
(
msg
)
if
lti_id
==
self
.
lti_id
.
strip
():
if
lti_id
==
self
.
lti_id
.
strip
():
return
key
,
secret
return
key
,
secret
return
''
,
''
return
''
,
''
...
...
lms/templates/lti_form.html
View file @
31e91529
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
<input
name=
"${param_name}"
value=
"${param_value}"
/>
<input
name=
"${param_name}"
value=
"${param_value}"
/>
%endfor
%endfor
<input
type=
"submit"
value=
"
Press to Launch
"
/>
<input
type=
"submit"
value=
"
${_('Press to Launch')}
"
/>
</form>
</form>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
(
function
(
d
)
{
(
function
(
d
)
{
...
...
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