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
19e3e79c
Commit
19e3e79c
authored
Mar 12, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove model data, save instance state after init
parent
f6b4d3aa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
common/lib/xmodule/xmodule/combined_open_ended_module.py
+3
-1
common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py
+2
-3
common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py
+1
-1
No files found.
common/lib/xmodule/xmodule/combined_open_ended_module.py
View file @
19e3e79c
...
...
@@ -130,6 +130,7 @@ class CombinedOpenEndedModule(XModule):
modules
=
[
i
[
2
]
for
i
in
VERSION_TUPLES
]
settings_attributes
=
[
i
[
3
]
for
i
in
VERSION_TUPLES
]
student_attributes
=
[
i
[
4
]
for
i
in
VERSION_TUPLES
]
version_error_string
=
"Could not find version {0}, using version {1} instead"
try
:
version_index
=
versions
.
index
(
self
.
version
)
...
...
@@ -151,7 +152,8 @@ class CombinedOpenEndedModule(XModule):
self
.
child_descriptor
=
descriptors
[
version_index
](
self
.
system
)
self
.
child_definition
=
descriptors
[
version_index
]
.
definition_from_xml
(
etree
.
fromstring
(
self
.
data
),
self
.
system
)
self
.
child_module
=
modules
[
version_index
](
self
.
system
,
location
,
self
.
child_definition
,
self
.
child_descriptor
,
instance_state
=
instance_state
,
static_data
=
static_data
,
model_data
=
model_data
,
attributes
=
attributes
)
instance_state
=
instance_state
,
static_data
=
static_data
,
attributes
=
attributes
)
self
.
save_instance_data
()
def
get_html
(
self
):
self
.
save_instance_data
()
...
...
common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py
View file @
19e3e79c
...
...
@@ -81,7 +81,7 @@ class CombinedOpenEndedV1Module():
TEMPLATE_DIR
=
"combinedopenended"
def
__init__
(
self
,
system
,
location
,
definition
,
descriptor
,
instance_state
=
None
,
shared_state
=
None
,
metadata
=
None
,
static_data
=
None
,
model_data
=
None
,
**
kwargs
):
instance_state
=
None
,
shared_state
=
None
,
metadata
=
None
,
static_data
=
None
,
**
kwargs
):
"""
Definition file should have one or many task blocks, a rubric block, and a prompt block:
...
...
@@ -118,7 +118,6 @@ class CombinedOpenEndedV1Module():
"""
self
.
_model_data
=
model_data
self
.
instance_state
=
instance_state
self
.
display_name
=
instance_state
.
get
(
'display_name'
,
"Open Ended"
)
self
.
rewrite_content_links
=
static_data
.
get
(
'rewrite_content_links'
,
""
)
...
...
@@ -396,7 +395,7 @@ class CombinedOpenEndedV1Module():
task_parsed_xml
=
task_descriptor
.
definition_from_xml
(
etree_xml
,
self
.
system
)
task
=
children
[
'modules'
][
task_type
](
self
.
system
,
self
.
location
,
task_parsed_xml
,
task_descriptor
,
self
.
static_data
,
instance_state
=
task_state
,
model_data
=
self
.
_model_data
)
self
.
static_data
,
instance_state
=
task_state
)
last_response
=
task
.
latest_answer
()
last_score
=
task
.
latest_score
()
last_post_assessment
=
task
.
latest_post_assessment
(
self
.
system
)
...
...
common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py
View file @
19e3e79c
...
...
@@ -72,7 +72,7 @@ class OpenEndedChild(object):
try
:
instance_state
=
json
.
loads
(
instance_state
)
except
:
pass
log
.
error
(
"Could not load instance state for open ended. Setting it to nothing.: {0}"
.
format
(
instance_state
))
else
:
instance_state
=
{}
...
...
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