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
767f0bd4
Commit
767f0bd4
authored
Feb 25, 2013
by
Valera Rozuvan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/alex/poll-merged' of github.com:MITx/mitx into feature/alex/poll-merged
parents
1ca397c5
4600155f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
common/lib/xmodule/xmodule/conditional_module.py
+14
-5
No files found.
common/lib/xmodule/xmodule/conditional_module.py
View file @
767f0bd4
...
...
@@ -115,15 +115,24 @@ class ConditionalModule(XModule):
self
.
contents
=
[
self
.
system
.
get_module
(
child_descriptor
)
.
get_html
()
for
child_descriptor
in
self
.
descriptor
.
get_children
()]
# TODO make this work
self
.
icon_class
=
self
.
system
.
get_module
(
self
.
descriptor
.
get_children
()[
0
])
.
get_icon_class
()
html
=
self
.
contents
return
json
.
dumps
({
'html'
:
html
,
'passed'
:
True
})
def
get_icon_class
(
self
):
new_class
=
'other'
if
self
.
is_condition_satisfied
():
# HACK: This shouldn't be hard-coded to two types
# OBSOLETE: This obsoletes 'type'
class_priority
=
[
'video'
,
'problem'
]
child_classes
=
[
self
.
system
.
get_module
(
child_descriptor
)
.
get_icon_class
()
for
child_descriptor
in
self
.
descriptor
.
get_children
()]
for
c
in
class_priority
:
if
c
in
child_classes
:
new_class
=
c
return
new_class
class
ConditionalDescriptor
(
SequenceDescriptor
):
"""Descriptor for conditional xmodule."""
...
...
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