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
719a898e
Commit
719a898e
authored
Dec 27, 2013
by
Christina Roberts
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2018 from edx/christina/export-bug
Bug fixes related to unicode support in export workflow.
parents
7b6d04d2
dc3b5ab5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
+7
-4
common/lib/xmodule/xmodule/poll_module.py
+2
-2
common/lib/xmodule/xmodule/xml_module.py
+4
-1
common/test/data/toy/chapter/poll_test.xml
+1
-1
No files found.
common/lib/xmodule/xmodule/poll_module.py
View file @
719a898e
...
@@ -184,13 +184,13 @@ class PollDescriptor(PollFields, MakoModuleDescriptor, XmlDescriptor):
...
@@ -184,13 +184,13 @@ class PollDescriptor(PollFields, MakoModuleDescriptor, XmlDescriptor):
def
definition_to_xml
(
self
,
resource_fs
):
def
definition_to_xml
(
self
,
resource_fs
):
"""Return an xml element representing to this definition."""
"""Return an xml element representing to this definition."""
poll_str
=
'<{tag_name}>{text}</{tag_name}>'
.
format
(
poll_str
=
u
'<{tag_name}>{text}</{tag_name}>'
.
format
(
tag_name
=
self
.
_tag_name
,
text
=
self
.
question
)
tag_name
=
self
.
_tag_name
,
text
=
self
.
question
)
xml_object
=
etree
.
fromstring
(
poll_str
)
xml_object
=
etree
.
fromstring
(
poll_str
)
xml_object
.
set
(
'display_name'
,
self
.
display_name
)
xml_object
.
set
(
'display_name'
,
self
.
display_name
)
def
add_child
(
xml_obj
,
answer
):
def
add_child
(
xml_obj
,
answer
):
child_str
=
'<{tag_name} id="{id}">{text}</{tag_name}>'
.
format
(
child_str
=
u
'<{tag_name} id="{id}">{text}</{tag_name}>'
.
format
(
tag_name
=
self
.
_child_tag_name
,
id
=
answer
[
'id'
],
tag_name
=
self
.
_child_tag_name
,
id
=
answer
[
'id'
],
text
=
answer
[
'text'
])
text
=
answer
[
'text'
])
child_node
=
etree
.
fromstring
(
child_str
)
child_node
=
etree
.
fromstring
(
child_str
)
...
...
common/lib/xmodule/xmodule/xml_module.py
View file @
719a898e
...
@@ -387,7 +387,10 @@ class XmlDescriptor(XModuleDescriptor):
...
@@ -387,7 +387,10 @@ class XmlDescriptor(XModuleDescriptor):
try
:
try
:
xml_object
.
set
(
attr
,
val
)
xml_object
.
set
(
attr
,
val
)
except
Exception
,
e
:
except
Exception
,
e
:
logging
.
exception
(
'Failed to serialize metadata attribute {0} with value {1}. This could mean data loss!!! Exception: {2}'
.
format
(
attr
,
val
,
e
))
logging
.
exception
(
u'Failed to serialize metadata attribute
%
s with value
%
s in module
%
s. This could mean data loss!!! Exception:
%
s'
,
attr
,
val
,
self
.
url_name
,
e
)
pass
pass
for
key
,
value
in
self
.
xml_attributes
.
items
():
for
key
,
value
in
self
.
xml_attributes
.
items
():
...
...
common/test/data/toy/chapter/poll_test.xml
View file @
719a898e
<sequential>
<sequential>
<poll_question
name=
"T1_changemind_poll_foo"
display_name=
"Change your answer"
reset=
"false"
>
<poll_question
name=
"T1_changemind_poll_foo"
display_name=
"Change your answer"
reset=
"false"
>
<p>
Have you changed your mind?
</p>
<p>
Have you changed your mind?
’
</p>
<answer
id=
"yes"
>
Yes
</answer>
<answer
id=
"yes"
>
Yes
</answer>
<answer
id=
"no"
>
No
</answer>
<answer
id=
"no"
>
No
</answer>
</poll_question>
</poll_question>
...
...
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