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
0fa910aa
Commit
0fa910aa
authored
May 05, 2014
by
polesye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BLD-714: CustomResponse i18n.
parent
799c3611
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
common/lib/capa/capa/responsetypes.py
+12
-4
No files found.
common/lib/capa/capa/responsetypes.py
View file @
0fa910aa
...
...
@@ -1505,6 +1505,7 @@ class CustomResponse(LoncapaResponse):
student_answers is a dict with everything from request.POST, but with the first part
of each key removed (the string before the first "_").
"""
_
=
self
.
capa_system
.
i18n
.
ugettext
log
.
debug
(
'
%
s: student_answers=
%
s'
,
unicode
(
self
),
student_answers
)
...
...
@@ -1514,9 +1515,16 @@ class CustomResponse(LoncapaResponse):
# ordered list of answers
submission
=
[
student_answers
[
k
]
for
k
in
idset
]
except
Exception
as
err
:
msg
=
(
'[courseware.capa.responsetypes.customresponse] error getting'
' student answer from
%
s'
%
student_answers
)
msg
+=
'
\n
idset =
%
s, error =
%
s'
%
(
idset
,
err
)
msg
=
_
(
"[courseware.capa.responsetypes.customresponse] error getting"
" student answer from {student_answers}"
"
\n
idset = {idset}, error = {err}"
)
.
format
(
student_answers
=
student_answers
,
idset
=
idset
,
err
=
err
);
log
.
error
(
msg
)
raise
Exception
(
msg
)
...
...
@@ -1529,7 +1537,7 @@ class CustomResponse(LoncapaResponse):
# default to no error message on empty answer (to be consistent with other
# responsetypes) but allow author to still have the old behavior by setting
# empty_answer_err attribute
msg
=
(
'<span class="inline-error">No answer entered!</span>'
msg
=
(
u'<span class="inline-error">{0}</span>'
.
format
(
_
(
u'No answer entered!'
))
if
self
.
xml
.
get
(
'empty_answer_err'
)
else
''
)
return
CorrectMap
(
idset
[
0
],
'incorrect'
,
msg
=
msg
)
...
...
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