Skip to content

Commit

Permalink
docs: change comment placement
Browse files Browse the repository at this point in the history
  • Loading branch information
janbritz committed Nov 28, 2024
1 parent 47a35ee commit 10c5ce0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions questionpy_sdk/webserver/question_ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,7 @@ def _check_shuffled_index_is_in_nested_shuffle_contents(index_element: etree._El
ancestor = index_element.getparent()
while ancestor is not None and ancestor != index_element:
if f"{{{_QPY_NAMESPACE}}}shuffle-contents" in ancestor.attrib:
# The index element is in a nested shuffle-contents.
# We want it to be replaced with the index of the inner shuffle, so we ignore it for now.
return True

ancestor = ancestor.getparent()
return False

Expand All @@ -93,6 +90,8 @@ def _replace_shuffled_indices(element: etree._Element, index: int) -> None:
element.xpath(".//qpy:shuffled-index", namespaces={"qpy": _QPY_NAMESPACE})
):
if _check_shuffled_index_is_in_nested_shuffle_contents(index_element):
# The index element is in a nested shuffle-contents.
# We want it to be replaced with the index of the inner shuffle, so we ignore it for now.
continue

format_style = index_element.get("format", "123")
Expand Down

0 comments on commit 10c5ce0

Please sign in to comment.