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
1a9f98b2
Commit
1a9f98b2
authored
Jun 02, 2014
by
Anton Stupak
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3895 from edx/anton/i18n-choice-text-response
BLD-724: ChoiceTextResponse i18n.
parents
141c1cd2
73df5a93
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
common/lib/capa/capa/responsetypes.py
+5
-2
No files found.
common/lib/capa/capa/responsetypes.py
View file @
1a9f98b2
...
...
@@ -430,6 +430,7 @@ class LoncapaResponse(object):
#-----------------------------------------------------------------------------
@registry.register
class
JavascriptResponse
(
LoncapaResponse
):
"""
...
...
@@ -1525,7 +1526,7 @@ class CustomResponse(LoncapaResponse):
submission
=
[
student_answers
[
k
]
for
k
in
idset
]
except
Exception
as
err
:
msg
=
u"[courseware.capa.responsetypes.customresponse] {message}
\n
idset = {idset}, error = {err}"
.
format
(
message
=
_
(
"error getting student answer from {student_answers}"
)
.
format
(
student_answers
=
student_answers
),
message
=
_
(
"error getting student answer from {student_answers}"
)
.
format
(
student_answers
=
student_answers
),
idset
=
idset
,
err
=
err
)
...
...
@@ -2820,11 +2821,13 @@ class ChoiceTextResponse(LoncapaResponse):
and `answer_values` is used for displaying correct answers.
"""
_
=
self
.
capa_system
.
i18n
.
ugettext
context
=
self
.
context
self
.
answer_values
=
{
self
.
answer_id
:
[]}
self
.
assign_choice_names
()
correct_xml
=
self
.
xml
.
xpath
(
'//*[@id=$id]//choice[@correct="true"]'
,
id
=
self
.
xml
.
get
(
'id'
))
for
node
in
correct_xml
:
# For each correct choice, set the `parent_name` to the
# current choice's name
...
...
@@ -2842,7 +2845,7 @@ class ChoiceTextResponse(LoncapaResponse):
# If the question creator does not specify an answer for a
# <numtolerance_input> inside of a correct choice, raise an error
raise
LoncapaProblemError
(
"Answer not provided for numtolerance_input"
_
(
"Answer not provided for {input_type}"
)
.
format
(
input_type
=
"numtolerance_input"
)
)
# Contextualize the answer to allow script generated answers.
answer
=
contextualize_text
(
answer
,
context
)
...
...
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