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
4ea9c738
Commit
4ea9c738
authored
Jan 03, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix state transitions
parent
ae0623ab
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
common/lib/xmodule/xmodule/combined_open_ended_module.py
+10
-3
No files found.
common/lib/xmodule/xmodule/combined_open_ended_module.py
View file @
4ea9c738
...
@@ -114,12 +114,13 @@ class CombinedOpenEndedModule(XModule):
...
@@ -114,12 +114,13 @@ class CombinedOpenEndedModule(XModule):
return
True
return
True
def
get_html
(
self
):
def
get_html
(
self
):
self
.
update_task_states
()
html
=
self
.
current_task
.
get_html
(
self
.
system
)
html
=
self
.
current_task
.
get_html
(
self
.
system
)
return_html
=
rewrite_links
(
html
,
self
.
rewrite_content_links
)
return_html
=
rewrite_links
(
html
,
self
.
rewrite_content_links
)
self
.
update_task_states
()
return
return_html
return
return_html
def
update_task_states
(
self
):
def
update_task_states
(
self
):
changed
=
False
self
.
task_states
[
len
(
self
.
task_states
)
-
1
]
=
self
.
current_task
.
get_instance_state
()
self
.
task_states
[
len
(
self
.
task_states
)
-
1
]
=
self
.
current_task
.
get_instance_state
()
current_task_state
=
json
.
loads
(
self
.
task_states
[
len
(
self
.
task_states
)
-
1
])
current_task_state
=
json
.
loads
(
self
.
task_states
[
len
(
self
.
task_states
)
-
1
])
if
current_task_state
[
'state'
]
==
self
.
DONE
:
if
current_task_state
[
'state'
]
==
self
.
DONE
:
...
@@ -129,13 +130,19 @@ class CombinedOpenEndedModule(XModule):
...
@@ -129,13 +130,19 @@ class CombinedOpenEndedModule(XModule):
self
.
current_task_number
=
self
.
current_task_number
-
1
self
.
current_task_number
=
self
.
current_task_number
-
1
else
:
else
:
self
.
state
=
self
.
INTERMEDIATE_DONE
self
.
state
=
self
.
INTERMEDIATE_DONE
changed
=
True
self
.
setup_next_task
()
self
.
setup_next_task
()
return
changed
def
update_task_states_ajax
(
self
,
return_html
):
changed
=
self
.
update_task_states
()
if
changed
():
return_html
=
self
.
get_html
()
return
return_html
def
handle_ajax
(
self
,
dispatch
,
get
):
def
handle_ajax
(
self
,
dispatch
,
get
):
return_html
=
self
.
current_task
.
handle_ajax
(
dispatch
,
get
,
self
.
system
)
return_html
=
self
.
current_task
.
handle_ajax
(
dispatch
,
get
,
self
.
system
)
self
.
update_task_states
()
return
self
.
update_task_states_ajax
(
return_html
)
return
return_html
def
get_instance_state
(
self
):
def
get_instance_state
(
self
):
"""
"""
...
...
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