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
ee08e0ea
Commit
ee08e0ea
authored
Jun 01, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do json dumping and </script> replacement as close to the template as possible
parent
58e1e9ad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
11 deletions
+4
-11
djangoapps/courseware/modules/seq_module.py
+4
-11
No files found.
djangoapps/courseware/modules/seq_module.py
View file @
ee08e0ea
...
...
@@ -40,15 +40,6 @@ class Module(XModule):
def
render
(
self
):
if
self
.
rendered
:
return
def
j
(
m
):
''' Split </script> tags -- browsers handle this as end
of script, even if it occurs mid-string'''
content
=
m
[
'content'
]
.
replace
(
'</script>'
,
'<"+"/script>'
)
return
{
'content'
:
content
,
'type'
:
m
[
'type'
]}
## Returns a set of all types of all sub-children
child_classes
=
[
set
([
i
.
tag
for
i
in
e
.
iter
()])
for
e
in
self
.
xmltree
]
...
...
@@ -56,7 +47,6 @@ class Module(XModule):
for
e
in
self
.
xmltree
]
self
.
contents
=
self
.
rendered_children
()
self
.
contents
=
[
j
(
m
)
for
m
in
self
.
contents
]
for
contents
,
title
in
zip
(
self
.
contents
,
titles
):
contents
[
'title'
]
=
title
...
...
@@ -68,7 +58,10 @@ class Module(XModule):
new_class
=
c
content
[
'type'
]
=
new_class
params
=
{
'items'
:
self
.
contents
,
# Split </script> tags -- browsers handle this as end
# of script, even if it occurs mid-string. Do this after json.dumps()ing
# so that we can be sure of the quotations being used
params
=
{
'items'
:
json
.
dumps
(
self
.
contents
)
.
replace
(
'</script>'
,
'<"+"/script>'
),
'id'
:
self
.
item_id
,
'position'
:
self
.
position
,
'titles'
:
titles
,
...
...
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