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
81dd5041
Commit
81dd5041
authored
Nov 09, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a couple of comments
parent
1a50052e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
new_xmodule/samples.py
+3
-0
No files found.
new_xmodule/samples.py
View file @
81dd5041
...
@@ -20,12 +20,15 @@ def SequenceModule(XModule, ResourceTemplateModule):
...
@@ -20,12 +20,15 @@ def SequenceModule(XModule, ResourceTemplateModule):
def
student_view
(
self
):
def
student_view
(
self
):
return
self
.
render_template
(
return
self
.
render_template
(
'main'
,
'main'
,
# Render w/ no arguments executes the same view for the children
# that is currently rendering for the parent
children
=
[
child
.
render
()
for
child
in
self
.
children
]
children
=
[
child
.
render
()
for
child
in
self
.
children
]
)
)
@xmodule.register_handler
(
'update_position'
)
@xmodule.register_handler
(
'update_position'
)
def
update_position
(
self
,
data
):
def
update_position
(
self
,
data
):
new_position
=
self
.
children
[
data
[
'position'
]]
.
id
new_position
=
self
.
children
[
data
[
'position'
]]
.
id
# Updates to the state dictionary are transparently saved to the db
self
.
state
[
'position'
]
=
new_position
self
.
state
[
'position'
]
=
new_position
self
.
state
[
'visited'
]
=
self
.
visited
.
union
(
new_position
)
self
.
state
[
'visited'
]
=
self
.
visited
.
union
(
new_position
)
self
.
update_progress
()
self
.
update_progress
()
...
...
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