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
024da20b
Commit
024da20b
authored
Feb 20, 2012
by
Piotr Mitros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Subtitle support working
--HG-- branch : pmitros-subtitles
parent
086523e0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
courseware/modules/seq_module.py
+11
-5
No files found.
courseware/modules/seq_module.py
View file @
024da20b
...
...
@@ -66,28 +66,34 @@ class Module(XModule):
## 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
]
self
.
contents
=
[(
e
.
get
(
"name"
),
j
(
self
.
render_function
(
e
)))
\
for
e
in
self
.
xmltree
]
self
.
titles
=
json
.
dumps
([
"
\n
"
.
join
([
i
.
get
(
"name"
)
.
strip
()
for
i
in
e
.
iter
()
if
i
.
get
(
"name"
)
!=
None
])
\
for
e
in
self
.
xmltree
])
self
.
contents
=
[
j
(
self
.
render_function
(
e
))
\
for
e
in
self
.
xmltree
]
print
self
.
titles
for
(
content
,
element_class
)
in
zip
(
self
.
contents
,
child_classes
):
new_class
=
'other'
for
c
in
class_priority
:
if
c
in
element_class
:
new_class
=
c
content
[
1
][
'type'
]
=
new_class
content
[
'type'
]
=
new_class
js
=
""
params
=
{
'items'
:
self
.
contents
,
'id'
:
self
.
item_id
,
'position'
:
self
.
position
}
'position'
:
self
.
position
,
'titles'
:
self
.
titles
}
# TODO/BUG: Destroy JavaScript should only be called for the active view
# This calls it for all the views
#
# To fix this, we'd probably want to have some way of assigning unique
# IDs to sequences.
destroy_js
=
""
.
join
([
e
[
1
][
'destroy_js'
]
for
e
in
self
.
contents
if
'destroy_js'
in
e
[
1
]
])
destroy_js
=
""
.
join
([
e
[
'destroy_js'
]
for
e
in
self
.
contents
if
'destroy_js'
in
e
])
if
self
.
xmltree
.
tag
==
'sequential'
:
self
.
init_js
=
js
+
render_to_string
(
'seq_module.js'
,
params
)
...
...
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