"
@@ -85,7 +85,7 @@ def get_html(self):
# -----------------------------------------------------------------------------
-class SolutionRenderer: # pylint: disable=too-few-public-methods
+class SolutionRenderer:
"""
A solution is just a
... which is given an ID, that is used for displaying an
extended answer (a problem "solution") after "show answers" is pressed.
@@ -113,7 +113,7 @@ def get_html(self):
# -----------------------------------------------------------------------------
-class TargetedFeedbackRenderer: # pylint: disable=too-few-public-methods
+class TargetedFeedbackRenderer:
"""
A targeted feedback is just a
... that is used for displaying an
extended piece of feedback to students if they incorrectly answered a question.
@@ -138,7 +138,7 @@ def get_html(self):
try:
xhtml = etree.XML(html_str)
- except Exception as err: # pylint: disable=broad-exception-caught
+ except Exception as err:
if self.system.DEBUG:
# xss-lint: disable=python-wrap-html
msg = f"""
@@ -163,7 +163,7 @@ def get_html(self):
# -----------------------------------------------------------------------------
-class ClarificationRenderer: # pylint: disable=too-few-public-methods
+class ClarificationRenderer:
"""
A clarification appears as an inline icon which reveals more information when the user
hovers over it.
diff --git a/xblocks_contrib/problem/capa/inputtypes.py b/xblocks_contrib/problem/capa/inputtypes.py
index f0e0c2ef..cd118860 100644
--- a/xblocks_contrib/problem/capa/inputtypes.py
+++ b/xblocks_contrib/problem/capa/inputtypes.py
@@ -121,7 +121,7 @@ def __hash__(self):
return hash(str(self))
-class Attribute: # pylint: disable=too-few-public-methods
+class Attribute:
"""
Allows specifying required and optional attributes for input types.
"""
@@ -178,7 +178,7 @@ def parse_from_xml(self, element):
return val
-class InputTypeBase: # pylint: disable=too-many-instance-attributes
+class InputTypeBase:
"""
Abstract base class for input types.
"""
@@ -451,24 +451,24 @@ def _extra_context(self):
@registry.register
class ChoiceGroup(InputTypeBase):
"""
- Radio button or checkbox inputs: multiple choice or true/false
+ Radio button or checkbox inputs: multiple choice or true/false.
- TODO: allow order of choices to be randomized, following lon-capa spec. Use
- "location" attribute, ie random, top, bottom.
+ TODO: allow order of choices to be randomized, following lon-capa spec.
+ Use the "location" attribute, e.g., random, top, bottom.
- Example:
+ Example::
-
-
- This is foil One.
-
-
- This is foil Two.
-
-
- This is foil Three.
-
-
+
+
+ This is foil One.
+
+
+ This is foil Two.
+
+
+ This is foil Three.
+
+
"""
template = "choicegroup.html"
@@ -500,9 +500,11 @@ def setup(self):
@classmethod
def get_attributes(cls):
- # Make '_' a no-op so we can scrape strings. Using lambda instead of
+ # Make '_' a no-op so we can scrape strings. Using function instead of
# `django.utils.translation.ugettext_noop` because Django cannot be imported in this file
- _ = lambda text: text # pylint: disable=unnecessary-lambda-assignment
+ def _(text):
+ return text
+
return [Attribute("show_correctness", "always"), Attribute("submitted_message", _("Answer received."))]
def _extra_context(self):
@@ -570,7 +572,7 @@ class JSInput(InputTypeBase):
This in turn means that the iframe cannot directly access the top-level
window elements.
- Example:
+ Example:
- Initial Text
-
+ Example::
+
+
+ Initial Text
+
+
"""
template = "matlabinput.html"
@@ -896,7 +900,8 @@ def ungraded_response(self, queue_msg, queuekey):
Args:
- queue_msg (str) - message returned from the queue. The message to be rendered
- - queuekey (str) - a key passed to the queue. Will be matched up to verify that this is the response we're waiting for # lint-amnesty, pylint: disable=line-too-long
+ - queuekey (str) - a key passed to the queue. Will be matched up to verify that
+ this is the response we're waiting for
Returns:
nothing
@@ -1196,11 +1201,13 @@ def preview_chemcalc(self, data):
Render an html preview of a chemical formula or equation. get should
contain a key 'formula' and value 'some formula string'.
- Returns a json dictionary:
- {
- 'preview' : 'the-preview-html' or ''
- 'error' : 'the-error' or ''
- }
+ Returns a json dictionary::
+
+ {
+ 'preview' : 'the-preview-html' or ''
+ 'error' : 'the-error' or ''
+ }
+
"""
_ = self.capa_system.i18n.gettext
@@ -1275,15 +1282,16 @@ def handle_ajax(self, dispatch, data):
def preview_formcalc(self, get):
"""
- Render an preview of a formula or equation. `get` should
+ Render a preview of a formula or equation. `get` should
contain a key 'formula' with a math expression.
- Returns a json dictionary:
- {
- 'preview' : '' or ''
- 'error' : 'the-error' or ''
- 'request_start' :
- }
+ Returns a JSON dictionary::
+
+ {
+ 'preview' : '' or '',
+ 'error' : 'the-error' or '',
+ 'request_start' :
+ }
"""
_ = self.capa_system.i18n.gettext
result = {"preview": "", "error": ""}
@@ -1496,12 +1504,13 @@ def _extra_context(self):
@registry.register
-class AnnotationInput(InputTypeBase): # pylint: disable=too-many-instance-attributes
- """
- Input type for annotations: students can enter some notes or other text
- (currently ungraded), and then choose from a set of tags/optoins, which are graded.
+class AnnotationInput(InputTypeBase):
+ """Input type for annotations.
- Example:
+ Students can enter some notes or other text (currently ungraded), and
+ then choose from a set of tags/options, which are graded.
+
+ Example::
Annotation Exercise
@@ -1509,7 +1518,8 @@ class AnnotationInput(InputTypeBase): # pylint: disable=too-many-instance-attri
They are the ones who, at the public assembly, had put savage derangement [ate] into my thinking
[phrenes] |89 on that day when I myself deprived Achilles of his honorific portion [geras]
- Agamemnon says that ate or 'derangement' was the cause of his actions: why could Zeus say the same thing? # lint-amnesty, pylint: disable=line-too-long
+ Agamemnon says that ate or 'derangement' was the cause of his actions:
+ why could Zeus say the same thing?
Type a commentary below:
Select one tag:
@@ -1602,61 +1612,65 @@ def _extra_context(self):
@registry.register
class ChoiceTextGroup(InputTypeBase):
- r"""
- Groups of radiobutton/checkboxes with text inputs.
-
- Examples:
- RadioButton problem
-
-
- A person rolls a standard die 100 times and records the results.
- On the first roll they received a "1". Given this information
- select the correct choice and fill in numbers to make it accurate.
-
-
-
- The lowest number rolled was:
- and the highest number rolled was:
- .
- The lowest number rolled was
- and there is not enough information to determine the highest number rolled.
-
- There is not enough information to determine the lowest
- number rolled, and the highest number rolled was:
- .
-
-
-
-
-
- CheckboxProblem:
-
-
- A person randomly selects 100 times, with replacement, from the list of numbers \(\sqrt{2}\), 2, 3, 4, 5, 6
- and records the results. The first number they pick is \(\sqrt{2}\) Given this information
- select the correct choices and fill in numbers to make them accurate.
-
-
-
-
- The lowest number selected was
-
-
- The highest number selected was .
-
- There is not enough information given to determine the highest number
- which was selected.
-
- There is not enough information given to determine the lowest number
- selected.
-
-
-
-
-
- In the preceding examples the is used to generate a textinput html element
- in the problem's display. Since it is inside of an incorrect choice, no answer given
- for it will be correct, and thus specifying an answer for it is not needed.
+ r"""Groups of radiobutton/checkboxes with text inputs.
+
+ Examples
+ --------
+ **RadioButton Problem**::
+
+
+
+ A person rolls a standard die 100 times and records the results.
+ On the first roll they received a "1". Given this information
+ select the correct choice and fill in numbers to make it accurate.
+
+
+
+ The lowest number rolled was:
+ and the highest number rolled was:
+ .
+
+ The lowest number rolled was
+ and there is not enough information to determine the highest number rolled.
+
+ There is not enough information to determine the lowest
+ number rolled, and the highest number rolled was:
+ .
+
+
+
+
+
+ **Checkbox Problem**::
+
+
+
+ A person randomly selects 100 times, with replacement, from the list of numbers \(\sqrt{2}\), 2, 3, 4, 5, 6
+ and records the results. The first number they pick is \(\sqrt{2}\). Given this information
+ select the correct choices and fill in numbers to make them accurate.
+
+
+
+
+ The lowest number selected was
+
+
+ The highest number selected was .
+
+ There is not enough information given to determine the highest number
+ which was selected.
+
+ There is not enough information given to determine the lowest number
+ selected.
+
+
+
+
+
+ .. note::
+ In the preceding examples the is used to generate a textinput html element
+ in the problem's display. Since it is inside of an incorrect choice, no answer given
+ for it will be correct, and thus specifying an answer for it is not needed.
"""
template = "choicetext.html"
@@ -1696,9 +1710,12 @@ def get_attributes(cls):
"""
Returns a list of `Attribute` for this problem type
"""
- # Make '_' a no-op so we can scrape strings. Using lambda instead of
+
+ # Make '_' a no-op so we can scrape strings. Using function instead of
# `django.utils.translation.ugettext_noop` because Django cannot be imported in this file
- _ = lambda text: text # pylint: disable=unnecessary-lambda-assignment
+ def _(text):
+ return text
+
return [
Attribute("show_correctness", "always"),
Attribute("submitted_message", _("Answer received.")),
@@ -1715,43 +1732,45 @@ def _extra_context(self):
@staticmethod
def extract_choices(element, i18n):
- """
- Extracts choices from the xml for this problem type.
+ """Extracts choices from the xml for this problem type.
+
If we have xml that is as follows(choice names will have been assigned
- by now)
-
-
- The number
-
- Is the mean of the list.
-
-
+
+ The number
+
+ Is the mean of the list.
+
+
+ False demonstration choice
+
+
+
+ Choices are used for rendering the problem properly. The function
+ will set up choices as follows::
+
+ choices = [
+ ("1_2_1_choiceinput_0bc",
+ [{'type': 'text', 'contents': "The number", 'tail_text': '',
+ 'value': ''
+ },
+ {'type': 'textinput',
+ 'contents': "1_2_1_choiceinput0_numtolerance_input_0",
+ 'tail_text': 'Is the mean of the list',
+ 'value': ''
+ }
+ ]
+ ),
+ ("1_2_1_choiceinput_1bc",
+ [{'type': 'text', 'contents': "False demonstration choice",
+ 'tail_text': '',
+ 'value': ''
+ }
+ ]
+ )
+ ]
"""
_ = i18n.gettext
diff --git a/xblocks_contrib/problem/capa/responsetypes.py b/xblocks_contrib/problem/capa/responsetypes.py
index 7cccef58..9579021c 100644
--- a/xblocks_contrib/problem/capa/responsetypes.py
+++ b/xblocks_contrib/problem/capa/responsetypes.py
@@ -62,9 +62,12 @@
CorrectMap = correctmap.CorrectMap
CORRECTMAP_PY = None
-# Make '_' a no-op so we can scrape strings. Using lambda instead of
+
+# Make '_' a no-op so we can scrape strings. Using function instead of
# `django.utils.translation.ugettext_noop` because Django cannot be imported in this file
-_ = lambda text: text # pylint: disable=unnecessary-lambda-assignment
+def _(text):
+ return text
+
QUESTION_HINT_CORRECT_STYLE = "feedback-hint-correct"
QUESTION_HINT_INCORRECT_STYLE = "feedback-hint-incorrect"
@@ -123,7 +126,7 @@ class StudentInputError(Exception):
# Main base class for CAPA responsetypes
-class LoncapaResponse(six.with_metaclass(abc.ABCMeta)): # pylint: disable=too-many-instance-attributes
+class LoncapaResponse(six.with_metaclass(abc.ABCMeta)):
"""
Base class for CAPA responsetypes. Each response type (ie a capa question,
which is part of a capa problem) is represented as a subclass,
@@ -627,15 +630,14 @@ def has_answerpool(self):
# -----------------------------------------------------------------------------
@registry.register
class ChoiceResponse(LoncapaResponse):
- """
- This response type is used when the student chooses from a discrete set of
+ """This response type is used when the student chooses from a discrete set of
choices. Currently, to be marked correct, all "correct" choices must be
supplied by the student, and no extraneous choices may be included.
This response type allows for two inputtypes: radiogroups and checkbox
- groups. radiogroups are used when the student should select a single answer,
+ groups. Radiogroups are used when the student should select a single answer,
and checkbox groups are used when the student may supply 0+ answers.
- Note: it is suggested to include a "None of the above" choice when no
+ Note: It is suggested to include a "None of the above" choice when no
answer is correct for a checkboxgroup inputtype; this ensures that a student
must actively mark something to get credit.
@@ -645,33 +647,32 @@ class ChoiceResponse(LoncapaResponse):
TODO: Allow for marking choices as 'optional' and 'required', which would
not penalize a student for including optional answers and would also allow
for questions in which the student can supply one out of a set of correct
- answers.This would also allow for survey-style questions in which all
+ answers. This would also allow for survey-style questions in which all
answers are correct.
- Example:
-
-
-
-
- This is a wrong answer.
-
-
- This is the right answer.
-
-
- This is another wrong answer.
-
-
-
-
- In the above example, radiogroup can be replaced with checkboxgroup to allow
+ Example::
+
+
+
+
+ This is a wrong answer.
+
+
+ This is the right answer.
+
+
+ This is another wrong answer.
+
+
+
+
+ In the above example, `radiogroup` can be replaced with `checkboxgroup` to allow
the student to select more than one choice.
TODO: In order for the inputtypes to render properly, this response type
- must run setup_response prior to the input type rendering. Specifically, the
+ must run `setup_response` prior to the input type rendering. Specifically, the
choices must be given names. This behavior seems like a leaky abstraction,
and it'd be nice to change this at some point.
-
"""
human_name = _("Checkboxes")
@@ -866,15 +867,20 @@ def get_answers(self):
def get_extended_hints(self, student_answers, new_cmap): # pylint: disable=too-many-locals
"""
- Extract compound and extended hint information from the xml based on the student_answers.
- The hint information goes into the msg= in new_cmap for display.
- Each choice in the checkboxgroup can have 2 extended hints, matching the
- case that the student has or has not selected that choice:
-
- Donut
- A Hint!
- Another hint!
-
+ Extract compound and extended hint information from the XML
+ based on the student_answers.
+
+ The hint information goes into the `msg=` in `new_cmap` for display.
+
+ Each choice in the checkboxgroup can have two extended hints, matching the
+ case that the student has or has not selected that choice::
+
+
+ Donut
+ A Hint!
+ Another hint!
+
+
"""
# Tricky: student_answers may be *empty* here. That is the representation that
# no checkboxes were selected. For typical responsetypes, you look at
@@ -1014,8 +1020,7 @@ def setup_response(self):
correct_choices is a list of the correct choices.
partial_choices is a list of the partially-correct choices.
- partial_values is a list of the scores that go with those
- choices, defaulting to 0.5 if no value is specified.
+ partial_values is a list of the scores that go with those choices, defaulting to 0.5 if no value is specified.
"""
# call secondary setup for MultipleChoice questions, to set name
# attributes
@@ -1047,12 +1052,17 @@ def setup_response(self):
def get_extended_hints(self, student_answers, new_cmap):
"""
- Extract any hints in a matching the student's answers
-
- Red
- No, Blue!
-
- ...
+ Extract any hints in a matching the student's answers.
+
+ Example::
+
+
+ Red
+ No, Blue!
+
+ ...
+
+
Any hint text is installed in the new_cmap.
"""
if self.answer_id in student_answers:
@@ -1487,8 +1497,8 @@ def get_student_answer_variable_name(self, student_answers, aid):
def get_extended_hints(self, student_answers, new_cmap):
"""
Extract optioninput extended hint, e.g.
-
- Donut Of course
+
+ Donut Of course
"""
answer_id = self.answer_ids[0] # Note *not* self.answer_id
if answer_id in student_answers:
@@ -1831,7 +1841,8 @@ class StringResponse(LoncapaResponse):
Additional answers are added by `additional_answer` tag.
If `regexp` is in `type` attribute, then answers and hints are treated as regular expressions.
- Examples:
+ Examples::
+
@@ -1912,14 +1923,16 @@ def get_extended_hints(self, student_answers, new_cmap):
"""
Find and install extended hints in new_cmap depending on the student answers.
StringResponse is probably the most complicated form we have.
- The forms show below match in the order given, and the first matching one stops the matching.
-
- hint1
- hint2
- hint3
- hint4
-
-
+ The forms show below match in the order given, and the first matching one stops the matching.::
+
+
+ hint1
+ hint2
+ hint3
+ hint4
+
+
+
The "ci" and "regexp" options are inherited from the parent stringresponse as appropriate.
"""
if self.answer_id in student_answers:
@@ -3278,7 +3291,7 @@ class ImageResponse(LoncapaResponse):
If there is only one region in the list, simpler notation can be used:
regions="[[10,10], [30,30], [10, 30], [30, 10]]" (without explicitly
- setting outer list)
+ setting outer list)
Returns:
True, if click is inside any region or rectangle. Otherwise False.
@@ -3367,6 +3380,7 @@ def get_mapped_answers(self):
Input:
None
+
Returns:
tuple (dict, dict) -
rectangles (dict) - a map of inputs to the defined rectangle for that input
@@ -3385,9 +3399,9 @@ def get_answers(self):
Input:
None
+
Returns:
- dict (str, (str, str)) - a map of inputs to a tuple of their rectangle
- and their regions
+ dict (str, (str, str)) - a map of inputs to a tuple of their rectangle and their regions
"""
answers = {}
for ielt in self.ielements:
@@ -3551,12 +3565,11 @@ def setup_response(self):
`correct_inputs`: These are the numerical/string answers for required
inputs.
`answer_values`: This is a dict, keyed by the name of the binary choice
- which contains the correct answers for the text inputs separated by
- commas e.g. "1, 0.5"
+ which contains the correct answers for the text inputs separated by
+ commas e.g. "1, 0.5"
`correct_choices` and `correct_inputs` are used for grading the problem
and `answer_values` is used for displaying correct answers.
-
"""
_ = self.capa_system.i18n.gettext
context = self.context
@@ -3603,35 +3616,37 @@ def assign_choice_names(self):
Initialize name attributes in and tags
for this response.
- Example:
- Assuming for simplicity that `self.answer_id` = '1_2_1'
-
- Before the function is called `self.xml` =
-
-
- The number
-
- Is the mean of the list.
-
-
- False demonstration choice
-
-
-
- After this is called the choices and numtolerance_inputs will have a name
- attribute initialized and self.xml will be:
-
-
-
- The number
-
- Is the mean of the list.
-
-
+ The number
+
+ Is the mean of the list.
+
+
+ False demonstration choice
+
+
+
+ After this is called, the choices and numtolerance_inputs will have a
+ name attribute initialized and `self.xml` will be::
+
+
+
+ The number
+
+ Is the mean of the list.
+
+
+ False demonstration choice
+
+
"""
choices = self.xml.xpath("//*[@id=$id]//choice", id=self.xml.get("id"))
diff --git a/xblocks_contrib/problem/capa/safe_exec/lazymod.py b/xblocks_contrib/problem/capa/safe_exec/lazymod.py
index 5f96a768..a956e8c5 100644
--- a/xblocks_contrib/problem/capa/safe_exec/lazymod.py
+++ b/xblocks_contrib/problem/capa/safe_exec/lazymod.py
@@ -8,7 +8,7 @@
import sys
-class LazyModule: # pylint: disable=too-few-public-methods
+class LazyModule:
"""A lazy module proxy."""
def __init__(self, modname):
diff --git a/xblocks_contrib/problem/capa/safe_exec/remote_exec.py b/xblocks_contrib/problem/capa/safe_exec/remote_exec.py
index 16260336..bbcafdef 100644
--- a/xblocks_contrib/problem/capa/safe_exec/remote_exec.py
+++ b/xblocks_contrib/problem/capa/safe_exec/remote_exec.py
@@ -78,9 +78,8 @@ def send_safe_exec_request_v0(data):
"""
Sends a request to a codejail api service forwarding required code and files.
Arguments:
- data: Dict containing code and other parameters
- required for jailed code execution.
- It also includes extra_files (python_lib.zip) required by the codejail execution.
+ data: Dict containing code and other parameters required for jailed code execution.
+ It also includes extra_files (python_lib.zip) required by the codejail execution.
Returns:
Response received from codejail api service
"""
diff --git a/xblocks_contrib/problem/capa/safe_exec/safe_exec.py b/xblocks_contrib/problem/capa/safe_exec/safe_exec.py
index 6b79d8a4..a6f67b0c 100644
--- a/xblocks_contrib/problem/capa/safe_exec/safe_exec.py
+++ b/xblocks_contrib/problem/capa/safe_exec/safe_exec.py
@@ -106,8 +106,9 @@ def update_hash(hasher, obj):
hasher.update(repr(obj).encode())
+# pylint: disable=too-many-arguments,too-many-branches,too-many-locals,too-many-positional-arguments,too-many-statements
@function_trace("safe_exec")
-def safe_exec( # pylint: disable=too-many-arguments,too-many-branches,too-many-locals,too-many-positional-arguments,too-many-statements
+def safe_exec(
code,
globals_dict,
random_seed=None,
@@ -210,7 +211,7 @@ def safe_exec( # pylint: disable=too-many-arguments,too-many-branches,too-many-
limit_overrides_context=limit_overrides_context,
slug=slug,
)
- except BaseException as e: # pylint: disable=broad-exception-caught
+ except BaseException as e:
# Saving SafeExecException e in exception to be used later.
exception = e
emsg = str(e)
@@ -263,7 +264,7 @@ def safe_exec( # pylint: disable=too-many-arguments,too-many-branches,too-many-
# SafeExecException wrapped around emsg (if present).
remote_emsg, _ = get_remote_exec(data)
remote_exception = None
- except BaseException as e: # pragma: no cover # pylint: disable=broad-exception-caught
+ except BaseException as e:
# Swallow all exceptions and log it in monitoring so that dark launch doesn't cause issues during
# deploy.
remote_emsg = None
@@ -282,7 +283,7 @@ def safe_exec( # pylint: disable=too-many-arguments,too-many-branches,too-many-
emsg_remote=remote_emsg,
unexpected_exc_remote=remote_exception,
)
- except BaseException: # pragma: no cover # pylint: disable=broad-exception-caught
+ except BaseException:
log.exception("Error occurred while trying to report codejail darklaunch data.")
record_exception()
@@ -376,7 +377,7 @@ def emsg_normalizers():
custom_setting = getattr(settings, "CODEJAIL_DARKLAUNCH_EMSG_NORMALIZERS", [])
try:
custom_normalizers = _compile_normalizers(custom_setting)
- except BaseException: # pylint: disable=broad-exception-caught
+ except BaseException:
log.error("Could not load custom codejail darklaunch emsg normalizers")
record_exception()
return default_normalizers
diff --git a/xblocks_contrib/problem/capa/safe_exec/tests/test_lazymod.py b/xblocks_contrib/problem/capa/safe_exec/tests/test_lazymod.py
index 543782ee..fcc30973 100644
--- a/xblocks_contrib/problem/capa/safe_exec/tests/test_lazymod.py
+++ b/xblocks_contrib/problem/capa/safe_exec/tests/test_lazymod.py
@@ -6,7 +6,7 @@
from xblocks_contrib.problem.capa.safe_exec.lazymod import LazyModule
-class ModuleIsolation: # pylint: disable=too-few-public-methods
+class ModuleIsolation:
"""
Manage changes to sys.modules so that we can roll back imported modules.
diff --git a/xblocks_contrib/problem/capa/safe_exec/tests/test_safe_exec.py b/xblocks_contrib/problem/capa/safe_exec/tests/test_safe_exec.py
index a344a77f..4a7aa2f3 100644
--- a/xblocks_contrib/problem/capa/safe_exec/tests/test_safe_exec.py
+++ b/xblocks_contrib/problem/capa/safe_exec/tests/test_safe_exec.py
@@ -218,7 +218,7 @@ def run_dark_launch( # pylint: disable=too-many-positional-arguments,too-many-a
limit_overrides_context="course-v1:org+course+run",
slug="hw1",
)
- except BaseException as e: # pylint: disable=broad-exception-caught
+ except BaseException as e:
safe_exec_e = e
else:
safe_exec_e = None
@@ -310,7 +310,7 @@ def test_remote_runs_even_if_local_raises(self):
def local_exec(code, globals_dict, **kwargs):
# Raise something other than a SafeExecException.
- raise expected_error # pylint: disable=broad-exception-raised
+ raise expected_error
def remote_exec(data): # pylint: disable=unused-argument
return (None, None)
diff --git a/xblocks_contrib/problem/capa/tests/helpers.py b/xblocks_contrib/problem/capa/tests/helpers.py
index 40764a5a..a91aabf1 100644
--- a/xblocks_contrib/problem/capa/tests/helpers.py
+++ b/xblocks_contrib/problem/capa/tests/helpers.py
@@ -38,7 +38,7 @@ def tst_render_template(template, context): # pylint: disable=unused-argument
return f"{saxutils.escape(repr(context))}
"
-class StubXQueueService: # pylint: disable=too-few-public-methods
+class StubXQueueService:
"""
Stubs out the XQueueService for Capa problem tests.
"""
diff --git a/xblocks_contrib/problem/capa/tests/response_xml_factory.py b/xblocks_contrib/problem/capa/tests/response_xml_factory.py
index 034af745..fbba69ac 100644
--- a/xblocks_contrib/problem/capa/tests/response_xml_factory.py
+++ b/xblocks_contrib/problem/capa/tests/response_xml_factory.py
@@ -30,14 +30,14 @@ def create_input_element(self, **kwargs):
def build_xml(self, **kwargs): # pylint: disable=too-many-locals
"""Construct an XML string for a capa response
- based on **kwargs.
+ based on ``**kwargs``.
- **kwargs is a dictionary that will be passed
+ ``**kwargs`` is a dictionary that will be passed
to create_response_element() and create_input_element().
See the subclasses below for other keyword arguments
you can specify.
- For all response types, **kwargs can contain:
+ For all response types, ``**kwargs`` can contain:
*question_text*: The text of the question to display,
wrapped in tags.
@@ -108,7 +108,7 @@ def build_xml(self, **kwargs): # pylint: disable=too-many-locals
def textline_input_xml(**kwargs):
"""Create a XML element
- Uses **kwargs:
+ Uses ``**kwargs``:
*math_display*: If True, then includes a MathJax display of user input
@@ -135,7 +135,7 @@ def textline_input_xml(**kwargs):
def choicegroup_input_xml(**kwargs):
"""Create a XML element
- Uses **kwargs:
+ Uses ``**kwargs``:
*choice_type*: Can be "checkbox", "radio", or "multiple"
@@ -145,7 +145,7 @@ def choicegroup_input_xml(**kwargs):
to be marked correct.
DEFAULT: [True]
- *choice_names": List of strings identifying the choices.
+ *choice_names*: List of strings identifying the choices.
If specified, you must ensure that
len(choice_names) == len(choices)
@@ -199,7 +199,7 @@ class NumericalResponseXMLFactory(ResponseXMLFactory):
def create_response_element(self, **kwargs):
"""Create a XML element.
- Uses **kwarg keys:
+ Uses ``**kwarg`` keys:
*answer*: The correct answer (e.g. "5")
@@ -271,11 +271,9 @@ class CustomResponseXMLFactory(ResponseXMLFactory):
def create_response_element(self, **kwargs):
"""Create a XML element.
+ Uses ``**kwargs``:
- Uses **kwargs:
-
- *cfn*: the Python code to run. Can be inline code,
- or the name of a function defined in earlier