Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
4600155f
Commit
4600155f
authored
12 years ago
by
Alexander Kryklia
Browse files
Options
Downloads
Patches
Plain Diff
add icon class support
parent
df2335c9
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/lib/xmodule/xmodule/conditional_module.py
+14
-5
14 additions, 5 deletions
common/lib/xmodule/xmodule/conditional_module.py
with
14 additions
and
5 deletions
common/lib/xmodule/xmodule/conditional_module.py
+
14
−
5
View file @
4600155f
...
...
@@ -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.
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment