Skip to content

Add a notebook_stop_tag marker to grade notebooks in parts - #52

Draft
eliotwrobson wants to merge 1 commit into
mainfrom
claude/notebook-stop-tag
Draft

eliotwrobson wants to merge 1 commit into
mainfrom
claude/notebook-stop-tag

Conversation

@eliotwrobson

Copy link
Copy Markdown
Collaborator

Student code runs when the sandbox starts, so an exception in any notebook cell fails every test. The new @pytest.mark.notebook_stop_tag("# Part 2") marker gives a test only the code cells before the first one that starts with the tag. An unfinished later part then doesn't cost the student the points for earlier parts.

  • Works on a test, a class, or a module (pytestmark), and together with notebook_cell_tag.
  • If the stop cell is missing, every cell runs, as before.

This is the new grader's version of PrairieLearn issue 3990 (grade_up_to_key for the legacy grader).

Testing

A scenario with a three-part notebook whose Part 3 raises: the Part 1 and Part 2 tests pass, and an unmarked test errors. Unit tests cover the extraction with and without notebook_cell_tag.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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