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
b6a49f33
Commit
b6a49f33
authored
Jan 08, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parse out min and max score to advance
parent
dcb33f1d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
common/lib/xmodule/xmodule/combined_open_ended_module.py
+7
-4
common/lib/xmodule/xmodule/open_ended_module.py
+0
-1
No files found.
common/lib/xmodule/xmodule/combined_open_ended_module.py
View file @
b6a49f33
...
...
@@ -82,7 +82,6 @@ class CombinedOpenEndedModule(XModule):
# element.
# Scores are on scale from 0 to max_score
system
.
set
(
'location'
,
location
)
log
.
debug
(
system
.
location
)
self
.
current_task_number
=
instance_state
.
get
(
'current_task_number'
,
0
)
self
.
task_states
=
instance_state
.
get
(
'task_states'
,
[])
...
...
@@ -147,7 +146,13 @@ class CombinedOpenEndedModule(XModule):
children
=
self
.
child_modules
()
self
.
current_task_descriptor
=
children
[
'descriptors'
][
current_task_type
](
self
.
system
)
self
.
current_task_parsed_xml
=
self
.
current_task_descriptor
.
definition_from_xml
(
etree
.
fromstring
(
self
.
current_task_xml
),
self
.
system
)
etree_xml
=
etree
.
fromstring
(
self
.
current_task_xml
)
min_score_to_attempt
=
int
(
etree_xml
.
attrib
.
get
(
'min_score_to_attempt'
,
0
))
max_score_to_attempt
=
int
(
etree_xml
.
attrib
.
get
(
'min_score_to_attempt'
,
self
.
_max_score
))
if
self
.
current_task_number
>
0
:
last_response_data
=
self
.
get_last_response
(
self
.
current_task_number
-
1
)
self
.
current_task_parsed_xml
=
self
.
current_task_descriptor
.
definition_from_xml
(
etree_xml
,
self
.
system
)
if
current_task_state
is
None
and
self
.
current_task_number
==
0
:
self
.
current_task
=
children
[
'modules'
][
current_task_type
](
self
.
system
,
self
.
location
,
self
.
current_task_parsed_xml
,
self
.
current_task_descriptor
,
self
.
static_data
)
self
.
task_states
.
append
(
self
.
current_task
.
get_instance_state
())
...
...
@@ -165,8 +170,6 @@ class CombinedOpenEndedModule(XModule):
current_task_state
=
self
.
overwrite_state
(
current_task_state
)
self
.
current_task
=
children
[
'modules'
][
current_task_type
](
self
.
system
,
self
.
location
,
self
.
current_task_parsed_xml
,
self
.
current_task_descriptor
,
self
.
static_data
,
instance_state
=
current_task_state
)
log
.
debug
(
self
.
current_task
.
get_instance_state
())
log
.
debug
(
self
.
get_instance_state
())
return
True
def
get_context
(
self
):
...
...
common/lib/xmodule/xmodule/open_ended_module.py
View file @
b6a49f33
...
...
@@ -528,7 +528,6 @@ class OpenEndedDescriptor(XmlDescriptor, EditingDescriptor):
'oeparam': 'some-html'
}
"""
for
child
in
[
'openendedparam'
]:
if
len
(
xml_object
.
xpath
(
child
))
!=
1
:
raise
ValueError
(
"Open Ended definition must include exactly one '{0}' tag"
.
format
(
child
))
...
...
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