diff --git a/xblocks_contrib/html/html.py b/xblocks_contrib/html/html.py index 282e6292..7d3c6301 100644 --- a/xblocks_contrib/html/html.py +++ b/xblocks_contrib/html/html.py @@ -322,7 +322,7 @@ def get_context(self): # the root /c4x/ url for assets. This allows client-side substitutions to occur. return { "module": self, - "editable_metadata_fields": self.editable_metadata_fields, # pylint: disable=no-member + "editable_metadata_fields": self.editable_metadata_fields, "data": self.data, "base_asset_url": self.get_base_url_path_for_course_assets(self.location.course_key), "enable_latex_compiler": self.use_latex_compiler, @@ -371,7 +371,7 @@ def bind_for_student(self, user_id, wrappers=None): if self.scope_ids.user_id is not None and user_id == self.scope_ids.user_id: if getattr(self.runtime, "position", None): # update the position of the tab - self.position = self.runtime.position # pylint: disable=attribute-defined-outside-init + self.position = self.runtime.position return # # If we are switching users mid-request, save the data from the old user. @@ -402,7 +402,7 @@ def bind_for_student(self, user_id, wrappers=None): wrapped_field_data = self.runtime.service(self, "field-data-unbound") for wrapper in wrappers: wrapped_field_data = wrapper(wrapped_field_data) - self._bound_field_data = wrapped_field_data # pylint: disable=attribute-defined-outside-init + self._bound_field_data = wrapped_field_data if getattr(self.runtime, "uses_deprecated_field_data", False): # This approach is deprecated but old mongo's CachingDescriptorSystem still requires it. # For Split mongo's CachingDescriptor system, don't set ._field_data this way. diff --git a/xblocks_contrib/problem/capa/capa_problem.py b/xblocks_contrib/problem/capa/capa_problem.py index 7f7c1216..a9b0aaec 100644 --- a/xblocks_contrib/problem/capa/capa_problem.py +++ b/xblocks_contrib/problem/capa/capa_problem.py @@ -81,7 +81,7 @@ # main class for this module -class LoncapaSystem: # pylint: disable=too-few-public-methods,too-many-instance-attributes +class LoncapaSystem: """ An encapsulation of resources needed from the outside. @@ -127,7 +127,7 @@ def __init__( # pylint: disable=too-many-positional-arguments,too-many-argument self.matlab_api_key = matlab_api_key -class LoncapaProblem: # pylint: disable=too-many-public-methods,too-many-instance-attributes +class LoncapaProblem: """ Main class for capa Problems. """ @@ -239,7 +239,7 @@ def __init__( # pylint: disable=too-many-positional-arguments,too-many-argument # Run response late_transforms last (see MultipleChoiceResponse) # Sort the responses to be in *_1 *_2 ... order. responses = list(self.responders.values()) - responses = sorted(responses, key=lambda resp: int(resp.id[resp.id.rindex("_") + 1 :])) + responses = sorted(responses, key=lambda resp: int(resp.id[resp.id.rindex("_") + 1:])) for response in responses: if hasattr(response, "late_transforms"): response.late_transforms(self) @@ -251,21 +251,35 @@ def make_xml_compatible(self, tree): """ Adjust tree xml in-place for compatibility before creating a problem from it. + The idea here is to provide a central point for XML translation, for example, supporting an old XML format. At present, there just two translations. 1. compatibility translation: - old: ANSWER - convert to - new: OPTIONAL-HINT + + old:: + + ANSWER + + convert to + + new:: + + OPTIONAL-HINT 2. compatibility translation: - optioninput works like this internally: - - With extended hints there is a new - This translation takes in the new format and synthesizes the old option= attribute - so all downstream logic works unchanged with the new