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
fed7f68f
Commit
fed7f68f
authored
Nov 09, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a bit more context for functions
parent
4f13aecc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
4 deletions
+25
-4
new_xmodule/samples.py
+25
-4
No files found.
new_xmodule/samples.py
View file @
fed7f68f
import
xmodule
import
xmodule
from
xmodule
import
progress
from
xmodule
import
progress
def
XModule
():
def
__init__
(
self
,
content
,
policy
,
state
,
child_pointers
,
preferences
):
self
.
content
=
content
self
.
policy
=
policy
self
.
state
=
state
self
.
child_pointers
=
child_pointers
self
.
preferences
=
preferences
def
SequenceModule
(
XModule
,
ResourceTemplateModule
):
@lazy_property
def
children
(
self
):
return
[
xmodule
.
get_module
(
child_ptr
)
for
child_ptr
in
self
.
child_pointers
]
def
__init__
(
self
,
definition
,
policy
,
state
,
preferences
):
def
render
(
self
,
child
,
context
=
None
):
self
.
state
=
state
if
context
is
None
:
context
=
self
.
render_context
# Make children use the appropriate render context
child
.
render_context
=
context
return
child
.
find_view
(
context
)()
def
find_view
(
self
,
context
):
# self._views is populated with metaclass magic that is TBD
return
self
.
_views
[
context
]
def
SequenceModule
(
XModule
,
ResourceTemplateModule
):
@property
@property
def
visited
(
self
):
def
visited
(
self
):
...
@@ -28,7 +49,7 @@ def SequenceModule(XModule, ResourceTemplateModule):
...
@@ -28,7 +49,7 @@ def SequenceModule(XModule, ResourceTemplateModule):
'main'
,
'main'
,
# Render w/ no arguments executes the same view for the children
# Render w/ no arguments executes the same view for the children
# that is currently rendering for the parent
# that is currently rendering for the parent
children
=
[
child
.
render
(
)
for
child
in
self
.
children
]
children
=
[
self
.
render
(
child
)
for
child
in
self
.
children
]
)
)
@xmodule.register_handler
(
'update_position'
)
@xmodule.register_handler
(
'update_position'
)
...
...
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