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
a7e0c3f4
Commit
a7e0c3f4
authored
Jul 31, 2017
by
Amir Qayyum Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed issue with non-Latin characters in loncapa/python problems
parent
8a5782eb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletions
+24
-1
common/lib/xmodule/xmodule/capa_base.py
+2
-1
common/lib/xmodule/xmodule/tests/test_capa_module.py
+22
-0
No files found.
common/lib/xmodule/xmodule/capa_base.py
View file @
a7e0c3f4
...
...
@@ -18,6 +18,7 @@ try:
except
ImportError
:
dog_stats_api
=
None
from
pytz
import
utc
from
django.utils.encoding
import
smart_text
from
capa.capa_problem
import
LoncapaProblem
,
LoncapaSystem
from
capa.inputtypes
import
Status
...
...
@@ -700,7 +701,7 @@ class CapaMixin(ScorableXBlockMixin, CapaFields):
content
=
{
'name'
:
self
.
display_name_with_default
,
'html'
:
html
,
'html'
:
smart_text
(
html
)
,
'weight'
:
self
.
weight
,
}
...
...
common/lib/xmodule/xmodule/tests/test_capa_module.py
View file @
a7e0c3f4
...
...
@@ -14,6 +14,7 @@ import textwrap
import
unittest
import
ddt
from
django.utils.encoding
import
smart_text
from
lxml
import
etree
from
mock
import
Mock
,
patch
,
DEFAULT
import
webob
...
...
@@ -2530,6 +2531,27 @@ class CapaDescriptorTest(unittest.TestCase):
}
)
def
test_indexing_non_latin_problem
(
self
):
sample_text_input_problem_xml
=
textwrap
.
dedent
(
"""
<problem>
<script type="text/python">FX1_VAL='Καλημέρα'</script>
<p>Δοκιμή με μεταβλητές με Ελληνικούς χαρακτήρες μέσα σε python: $FX1_VAL</p>
</problem>
"""
)
name
=
"Non latin Input"
descriptor
=
self
.
_create_descriptor
(
sample_text_input_problem_xml
,
name
=
name
)
capa_content
=
" FX1_VAL='Καλημέρα' Δοκιμή με μεταβλητές με Ελληνικούς χαρακτήρες μέσα σε python: $FX1_VAL "
self
.
assertEquals
(
descriptor
.
index_dictionary
(),
{
'content_type'
:
CapaDescriptor
.
INDEX_CONTENT_TYPE
,
'problem_types'
:
[],
'content'
:
{
'display_name'
:
name
,
'capa_content'
:
smart_text
(
capa_content
)
}
}
)
def
test_indexing_checkboxes_with_hints_and_feedback
(
self
):
name
=
"Checkboxes with Hints and Feedback"
descriptor
=
self
.
_create_descriptor
(
self
.
sample_checkboxes_with_hints_and_feedback_problem_xml
,
name
=
name
)
...
...
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