Skip to content

Fix CodeTailor Java support and Parsons block granularity - #1349

Open
aspadiyath wants to merge 1 commit into
RunestoneInteractive:mainfrom
aspadiyath:main
Open

Fix CodeTailor Java support and Parsons block granularity#1349
aspadiyath wants to merge 1 commit into
RunestoneInteractive:mainfrom
aspadiyath:main

Conversation

@aspadiyath

Copy link
Copy Markdown
Contributor
  • Fix backup/static Parsons puzzle including the question's instruction text as a draggable block — extract_parsons_code now extracts only the code inside <pre class="parsonsblocks">, excluding the sibling <div class="parsons_question"> prompt text.
  • Fix Java CodeTailor personalization always failing and falling back to the generic error:
    • The JOBE test runner called {test_class}.main(args) on JUnit test classes (extending CodeTestHelper, @Test-annotated) that have no main(), so every Java run failed to compile. Now runs tests via JUnitCore.runClasses(...), matching the convention already used by the regular (non-CodeTailor) Java activecode runner.
    • The student's class was only referenced by name reflectively (super("ClassName")), so javac never compiled it, causing a runtime ClassNotFoundException. Now explicitly passed via compileargs.
    • Removed a dead helper (inject_pass_fail_prints) that assumed the old, incorrect main()-based test convention.
  • Fix Parsons blocks grouping multiple statements at the same indentation level into a single draggable block instead of one block per statement, in both the "Full" puzzle path (split_java_code_into_blocks) and the "Partial"/distractor puzzle path (aggregate_code_to_Parsons_block_with_distractor).

- extract_parsons_code: scope HTML parsing to <pre class="parsonsblocks"> to exclude question prompt text from draggable blocks
- evaluate_fixed_code: switch Java test runner from main()-based to JUnitCore, matching livecode.js convention; add compileargs for student filename
- generate_parsons_blocks: one statement per block in split_java_code_into_blocks; preserve per-line ordering when flushing same-indent block stacks

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@aspadiyath
aspadiyath requested a review from bnmnetp as a code owner August 5, 2026 21:10
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.

1 participant