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
e6770bca
Commit
e6770bca
authored
Feb 05, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Parse and pass metadata
parent
3dc05aa9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
common/lib/xmodule/xmodule/combined_open_ended_module.py
+5
-3
common/lib/xmodule/xmodule/combined_open_ended_modulev1.py
+3
-1
No files found.
common/lib/xmodule/xmodule/combined_open_ended_module.py
View file @
e6770bca
...
...
@@ -138,8 +138,9 @@ class CombinedOpenEndedModule(XModule):
version_index
=
versions
.
index
(
self
.
version
)
self
.
child_descriptor
=
descriptors
[
version_index
](
self
.
system
)
self
.
child_definition
=
self
.
child_descriptor
.
definition_from_xml
(
etree
.
fromstring
(
definition
[
'xml_string'
]))
self
.
child_module
=
modules
[
version_index
](
self
.
system
,
location
,
self
.
child_definition
,
self
.
child_descriptor
,
instance_state
)
self
.
child_definition
=
CombinedOpenEndedV1Descriptor
.
definition_from_xml
(
etree
.
fromstring
(
definition
[
'xml_string'
]),
self
.
system
)
self
.
child_module
=
modules
[
version_index
](
self
.
system
,
location
,
self
.
child_definition
,
self
.
child_descriptor
,
instance_state
=
json
.
dumps
(
instance_state
),
metadata
=
definition
[
'metadata'
])
def
get_html
(
self
):
return
self
.
child_module
.
get_html
()
...
...
@@ -187,7 +188,8 @@ class CombinedOpenEndedDescriptor(XmlDescriptor, EditingDescriptor):
'task_xml': dictionary of xml strings,
}
"""
return
{
'xml_string'
:
etree
.
tostring
(
xml_object
)}
return
{
'xml_string'
:
etree
.
tostring
(
xml_object
),
'metadata'
:
xml_object
.
attrib
}
def
definition_to_xml
(
self
,
resource_fs
):
...
...
common/lib/xmodule/xmodule/combined_open_ended_modulev1.py
View file @
e6770bca
...
...
@@ -98,7 +98,7 @@ class CombinedOpenEndedV1Module():
css
=
{
'scss'
:
[
resource_string
(
__name__
,
'css/combinedopenended/display.scss'
)]}
def
__init__
(
self
,
system
,
location
,
definition
,
descriptor
,
instance_state
=
None
,
shared_state
=
None
,
**
kwargs
):
instance_state
=
None
,
shared_state
=
None
,
metadata
=
None
,
**
kwargs
):
"""
Definition file should have one or many task blocks, a rubric block, and a prompt block:
...
...
@@ -135,6 +135,8 @@ class CombinedOpenEndedV1Module():
"""
self
.
metadata
=
metadata
# Load instance state
if
instance_state
is
not
None
:
instance_state
=
json
.
loads
(
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