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
69873495
Commit
69873495
authored
Jun 27, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make icons show up in sequences containing verticals that contain videos
parent
c6b477c8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
3 deletions
+16
-3
common/lib/xmodule/seq_module.py
+0
-2
common/lib/xmodule/vertical_module.py
+12
-0
common/lib/xmodule/video_module.py
+1
-0
common/lib/xmodule/x_module.py
+3
-1
No files found.
common/lib/xmodule/seq_module.py
View file @
69873495
...
...
@@ -61,8 +61,6 @@ class SequenceModule(XModule):
'type'
:
child
.
get_icon_class
(),
})
print
json
.
dumps
(
contents
,
indent
=
4
)
# 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
...
...
common/lib/xmodule/vertical_module.py
View file @
69873495
...
...
@@ -2,6 +2,10 @@ from xmodule.x_module import XModule
from
xmodule.seq_module
import
SequenceDescriptor
from
xmodule.progress
import
Progress
# HACK: This shouldn't be hard-coded to two types
# OBSOLETE: This obsoletes 'type'
class_priority
=
[
'video'
,
'problem'
]
class
VerticalModule
(
XModule
):
''' Layout module for laying out submodules vertically.'''
...
...
@@ -17,6 +21,14 @@ class VerticalModule(XModule):
progress
=
reduce
(
Progress
.
add_counts
,
progresses
)
return
progress
def
get_icon_class
(
self
):
child_classes
=
set
(
child
.
get_icon_class
()
for
child
in
self
.
get_children
())
new_class
=
'other'
for
c
in
class_priority
:
if
c
in
child_classes
:
new_class
=
c
return
new_class
def
__init__
(
self
,
system
,
location
,
definition
,
instance_state
=
None
,
shared_state
=
None
,
**
kwargs
):
XModule
.
__init__
(
self
,
system
,
location
,
definition
,
instance_state
,
shared_state
,
**
kwargs
)
self
.
contents
=
[
child
.
get_html
()
for
child
in
self
.
get_display_items
()]
...
...
common/lib/xmodule/video_module.py
View file @
69873495
...
...
@@ -11,6 +11,7 @@ log = logging.getLogger(__name__)
class
VideoModule
(
XModule
):
video_time
=
0
icon_class
=
'video'
def
handle_ajax
(
self
,
dispatch
,
get
):
'''
...
...
common/lib/xmodule/x_module.py
View file @
69873495
...
...
@@ -63,6 +63,8 @@ class XModule(object):
See the HTML module for a simple example
'''
icon_class
=
'other'
def
__init__
(
self
,
system
,
location
,
definition
,
instance_state
=
None
,
shared_state
=
None
,
**
kwargs
):
'''
Construct a new xmodule
...
...
@@ -120,7 +122,7 @@ class XModule(object):
'''
Return a class identifying this module in the context of an icon
'''
return
'other'
return
self
.
icon_class
### Functions used in the LMS
...
...
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