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
ccefecce
Commit
ccefecce
authored
Jan 04, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Several bug fixes
parent
1f1fdc23
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
common/lib/xmodule/xmodule/combined_open_ended_module.py
+8
-6
No files found.
common/lib/xmodule/xmodule/combined_open_ended_module.py
View file @
ccefecce
...
...
@@ -27,7 +27,7 @@ log = logging.getLogger("mitx.courseware")
# Set the default number of max attempts. Should be 1 for production
# Set higher for debugging/testing
# attempts specified in xml definition overrides this.
MAX_ATTEMPTS
=
1
MAX_ATTEMPTS
=
1
0000
# Set maximum available number of points.
# Overriden by max_score specified in xml.
...
...
@@ -149,6 +149,7 @@ class CombinedOpenEndedModule(XModule):
self
.
current_task
=
children
[
'modules'
][
current_task_type
](
self
.
system
,
self
.
location
,
self
.
current_task_parsed_xml
,
self
.
current_task_descriptor
,
instance_state
=
current_task_state
)
log
.
debug
(
self
.
current_task
.
get_instance_state
())
log
.
debug
(
self
.
get_instance_state
())
return
True
def
get_html
(
self
):
...
...
@@ -192,15 +193,15 @@ class CombinedOpenEndedModule(XModule):
def
update_task_states
(
self
):
changed
=
False
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
])
self
.
task_states
[
self
.
current_task_number
]
=
self
.
current_task
.
get_instance_state
()
current_task_state
=
json
.
loads
(
self
.
task_states
[
self
.
current_task_number
])
if
current_task_state
[
'state'
]
==
self
.
DONE
:
self
.
current_task_number
+=
1
if
self
.
current_task_number
==
len
(
self
.
task_xml
):
if
self
.
current_task_number
>=
(
len
(
self
.
task_xml
)
):
self
.
state
=
self
.
DONE
self
.
current_task_number
=
self
.
current_task_number
-
1
self
.
current_task_number
=
len
(
self
.
task_xml
)
-
1
else
:
self
.
state
=
self
.
IN
TERMEDIATE_DONE
self
.
state
=
self
.
IN
ITIAL
changed
=
True
self
.
setup_next_task
()
return
changed
...
...
@@ -259,6 +260,7 @@ class CombinedOpenEndedModule(XModule):
self
.
current_task_number
=
i
self
.
setup_next_task
(
reset
=
True
)
self
.
current_task
.
reset
(
self
.
system
)
self
.
task_states
[
self
.
current_task_number
]
=
self
.
current_task
.
get_instance_state
()
self
.
current_task_number
=
0
self
.
setup_next_task
()
return
{
'success'
:
True
}
...
...
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