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
581716cb
Commit
581716cb
authored
Apr 22, 2014
by
Anton Stupak
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3414 from edx/anton/i18n-choice-response
MultipleChoiceResponse i18n.
parents
b44ed806
ca93855f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
common/lib/capa/capa/responsetypes.py
+16
-4
No files found.
common/lib/capa/capa/responsetypes.py
View file @
581716cb
...
...
@@ -843,7 +843,10 @@ class MultipleChoiceResponse(LoncapaResponse):
Fails with LoncapaProblemError if called on a response that is not masking.
"""
if
not
self
.
has_mask
():
raise
LoncapaProblemError
(
"unmask_name called on response that is not masked"
)
_
=
self
.
capa_system
.
i18n
.
ugettext
# Translators: 'unmask_name' is a method name and should not be translated.
msg
=
_
(
"unmask_name called on response that is not masked"
)
raise
LoncapaProblemError
(
msg
)
return
self
.
_mask_dict
[
name
]
def
unmask_order
(
self
):
...
...
@@ -870,7 +873,10 @@ class MultipleChoiceResponse(LoncapaResponse):
if
choicegroups
:
choicegroup
=
choicegroups
[
0
]
if
choicegroup
.
get
(
'answer-pool'
)
is
not
None
:
raise
LoncapaProblemError
(
"Do not use shuffle and answer-pool at the same time"
)
_
=
self
.
capa_system
.
i18n
.
ugettext
# Translators: 'shuffle' and 'answer-pool' are attribute names and should not be translated.
msg
=
_
(
"Do not use shuffle and answer-pool at the same time"
)
raise
LoncapaProblemError
(
msg
)
# Note in the response that shuffling is done.
# Both to avoid double-processing, and to feed the logs.
if
self
.
has_shuffle
():
...
...
@@ -950,7 +956,10 @@ class MultipleChoiceResponse(LoncapaResponse):
try
:
num_choices
=
int
(
num_str
)
except
ValueError
:
raise
LoncapaProblemError
(
"answer-pool value should be an integer"
)
_
=
self
.
capa_system
.
i18n
.
ugettext
# Translators: 'answer-pool' is an attribute name and should not be translated.
msg
=
_
(
"answer-pool value should be an integer"
)
raise
LoncapaProblemError
(
msg
)
# Note in the response that answerpool is done.
# Both to avoid double-processing, and to feed the logs.
...
...
@@ -1014,7 +1023,10 @@ class MultipleChoiceResponse(LoncapaResponse):
# Or perhaps in the overall author workflow, these errors are unhelpful and
# should all be removed.
if
len
(
correct_choices
)
<
1
or
len
(
incorrect_choices
)
<
1
:
raise
LoncapaProblemError
(
"Choicegroup must include at least 1 correct and 1 incorrect choice"
)
_
=
self
.
capa_system
.
i18n
.
ugettext
# Translators: 'Choicegroup' is an input type and should not be translated.
msg
=
_
(
"Choicegroup must include at least 1 correct and 1 incorrect choice"
)
raise
LoncapaProblemError
(
msg
)
# Limit the number of incorrect choices to what we actually have
num_incorrect
=
num_pool
-
1
...
...
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