[PR #1381] [MERGED] fix(labs/lab_00): suppress infeasible callout on exactly-right answer (#1305) #5160

Closed
opened 2026-04-19 12:50:51 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/harvard-edge/cs249r_book/pull/1381
Author: @profvjreddi
Created: 4/17/2026
Status: Merged
Merged: 4/17/2026
Merged by: @profvjreddi

Base: devHead: fix/lab00-conditional-callout


📝 Commits (1)

  • 03d60ca fix(labs/lab_00): suppress infeasible callout on exactly-right answer (#1305)

📊 Changes

1 file changed (+16 additions, -7 deletions)

View changed files

📝 labs/vol1/lab_00_introduction.py (+16 -7)

📄 Description

what

check-2 in labs/vol1/lab_00_introduction.py renders a red "INFEASIBLE — Cloud inference violates physics" mo.callout(kind=\"danger\") regardless of what the student selected. even when they pick the two correct answers ("move_server" + "edge_deploy") with no wrong ones, they still get the red shout. @asgalon reported this in #1305 with a screenshot.

fix: skip the danger callout on an exactly-right submission. the cell's prose explanation and the math-peek accordion still carry the physics argument for every submission. students with any wrong selection or any missing correct selection still see the callout as a reinforcement.

_items = [ <title+rows+explanation html> ]

if not _exactly_right:
    _items.append(mo.callout(<INFEASIBLE danger callout>, kind=\"danger\"))

_items.append(<math peek accordion>)
mo.vstack(_items)

context

@asgalon landed the multiselect-to-checkbox conversion in cbd418c5b earlier. this pr finishes the remaining "shouldn't this block be conditional?" observation from their issue.

test plan

  • pytest labs/tests/test_static.py labs/tests/test_engine.py -q → 792 passed 4 skipped 1 xfailed
  • python3 -m marimo check vol1/lab_00_introduction.py → exit 0
  • ci green on this pr

closes #1305


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/harvard-edge/cs249r_book/pull/1381 **Author:** [@profvjreddi](https://github.com/profvjreddi) **Created:** 4/17/2026 **Status:** ✅ Merged **Merged:** 4/17/2026 **Merged by:** [@profvjreddi](https://github.com/profvjreddi) **Base:** `dev` ← **Head:** `fix/lab00-conditional-callout` --- ### 📝 Commits (1) - [`03d60ca`](https://github.com/harvard-edge/cs249r_book/commit/03d60ca3f970ef84a61163dcf7bd1839351bc0a9) fix(labs/lab_00): suppress infeasible callout on exactly-right answer (#1305) ### 📊 Changes **1 file changed** (+16 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `labs/vol1/lab_00_introduction.py` (+16 -7) </details> ### 📄 Description ## what check-2 in `labs/vol1/lab_00_introduction.py` renders a red "INFEASIBLE — Cloud inference violates physics" `mo.callout(kind=\"danger\")` regardless of what the student selected. even when they pick the two correct answers ("move_server" + "edge_deploy") with no wrong ones, they still get the red shout. @asgalon reported this in #1305 with a screenshot. fix: skip the danger callout on an exactly-right submission. the cell's prose explanation and the math-peek accordion still carry the physics argument for every submission. students with any wrong selection or any missing correct selection still see the callout as a reinforcement. ```python _items = [ <title+rows+explanation html> ] if not _exactly_right: _items.append(mo.callout(<INFEASIBLE danger callout>, kind=\"danger\")) _items.append(<math peek accordion>) mo.vstack(_items) ``` ## context @asgalon landed the multiselect-to-checkbox conversion in cbd418c5b earlier. this pr finishes the remaining "shouldn't this block be conditional?" observation from their issue. ## test plan - [x] `pytest labs/tests/test_static.py labs/tests/test_engine.py -q` → 792 passed 4 skipped 1 xfailed - [x] `python3 -m marimo check vol1/lab_00_introduction.py` → exit 0 - [ ] ci green on this pr closes #1305 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-19 12:50:51 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/cs249r_book#5160