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
dc3b5ab5
Commit
dc3b5ab5
authored
Dec 20, 2013
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support unicode in text field.
Part of STUD-868
parent
df5b22e5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
common/lib/xmodule/xmodule/poll_module.py
+2
-2
common/test/data/toy/chapter/poll_test.xml
+1
-1
No files found.
common/lib/xmodule/xmodule/poll_module.py
View file @
dc3b5ab5
...
...
@@ -182,13 +182,13 @@ class PollDescriptor(PollFields, MakoModuleDescriptor, XmlDescriptor):
def
definition_to_xml
(
self
,
resource_fs
):
"""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
)
xml_object
=
etree
.
fromstring
(
poll_str
)
xml_object
.
set
(
'display_name'
,
self
.
display_name
)
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'
],
text
=
answer
[
'text'
])
child_node
=
etree
.
fromstring
(
child_str
)
...
...
common/test/data/toy/chapter/poll_test.xml
View file @
dc3b5ab5
<sequential>
<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=
"no"
>
No
</answer>
</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