Skip to content

Fix CodeTailor Parsons puzzle asymmetric block indentation - #1416

Merged
bnmnetp merged 1 commit into
RunestoneInteractive:mainfrom
aspadiyath:fix-codetailor-parsons-indentation
Aug 25, 2026
Merged

Fix CodeTailor Parsons puzzle asymmetric block indentation#1416
bnmnetp merged 1 commit into
RunestoneInteractive:mainfrom
aspadiyath:fix-codetailor-parsons-indentation

Conversation

@aspadiyath

Copy link
Copy Markdown
Contributor

The first block of a generated Parsons puzzle was sitting on the same source line as the {personalized_Parsons_block} placeholder in coach.py's f-string templates, so it inherited that line's own Python-source indentation while every other block (after an embedded newline) didn't -- producing a spurious indentation requirement on every block but the first, even for flat, unnested code.

Also fix a related crash: aggregate_code_to_Parsons_block_with_distractor stored the raw block_stack list instead of flushing each item as a string when a settled/unchanged run preceded a paired-distractor block whose matched-fixed line hadn't been seen yet, causing check_settled_tag to throw TypeError: expected string or bytes-like object, got 'list'.

The first block of a generated Parsons puzzle was sitting on the same
source line as the {personalized_Parsons_block} placeholder in coach.py's
f-string templates, so it inherited that line's own Python-source
indentation while every other block (after an embedded newline) didn't --
producing a spurious indentation requirement on every block but the
first, even for flat, unnested code.

Also fix a related crash: aggregate_code_to_Parsons_block_with_distractor
stored the raw block_stack list instead of flushing each item as a string
when a settled/unchanged run preceded a paired-distractor block whose
matched-fixed line hadn't been seen yet, causing check_settled_tag to
throw TypeError: expected string or bytes-like object, got 'list'.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@aspadiyath
aspadiyath requested a review from bnmnetp as a code owner August 24, 2026 23:37
@bnmnetp
bnmnetp merged commit 13f8177 into RunestoneInteractive:main Aug 25, 2026
2 checks passed
@aspadiyath
aspadiyath deleted the fix-codetailor-parsons-indentation branch August 25, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants