Skip to content

Turn 2.2 Boolean Expressions examples into code-runner exercises - #87

Merged
Wick2009 merged 1 commit into
UGRC-CSA:mainfrom
Wick2009:lesson/2.2-boolean-expressions
Sep 18, 2026
Merged

Wick2009 merged 1 commit into
UGRC-CSA:mainfrom
Wick2009:lesson/2.2-boolean-expressions

Conversation

@Wick2009

Copy link
Copy Markdown
Collaborator

Summary

  • Follow-up to Write 2.2 Boolean Expressions lesson #86. Wires the lesson's code examples into the site's interactive code-runner (codemirror: true + // CODE_RUNNER: markers) so students can edit and actually run them in-browser instead of reading static code blocks.
  • Converts: the intro live example, Popcorn Hack 1 (predict), Popcorn Hack 2 (fix the bug), and adds a new "Try It Yourself" exercise.
  • Fixes a discovered bug in how this interacts with the conversion script: plain ``` fences inside markdown "answer reveal" cells were being counted by scripts/convert_notebooks.py as if they were real code cells, desyncing the runner-metadata pairing for every code-runner cell after them. Reveals now use <pre><code> instead of fenced code blocks to avoid this.

Test plan

  • Ran the real build pipeline end-to-end (copy → convert_notebooks.py → _posts/projects/java)
  • Verified all 4 runners pair correctly with their intended challenge/code/source (checked generated Liquid output)
  • Built the full site with Jekyll and loaded the page locally — confirmed the CodeMirror editor renders, is editable, and clicking Run correctly POSTs to the site's Java execution service (/run/java), same as every other code-runner lesson on the site
  • Cleaned up all generated build artifacts; only the lesson .ipynb is included

🤖 Generated with Claude Code

Wires the intro example and both popcorn hacks into the site's
interactive Java code-runner (codemirror: true + CODE_RUNNER
markers), and adds a new "Try It Yourself" exercise. Students can
now edit and run each snippet in-browser instead of only reading
static code blocks. Also fixes a cross-contamination bug where
plain ``` fences inside answer-reveal cells desynced the runner
metadata mapping for later cells — reveals now use <pre><code>
instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Wick2009
Wick2009 merged commit 9c7b696 into UGRC-CSA:main Sep 18, 2026
2 checks passed
Wick2009 pushed a commit that referenced this pull request Sep 22, 2026
Pulls in the officially-rebuilt version of the 2.02 lesson from
Open-Coding-Society/pages: LxD design-cycle section, a richer
College Board + Java Language Specification reference section,
three interactive activities (a live comparison lab, a sort-the-
expressions drag exercise, and a bug-hunt MCQ), Popcorn/Homework
Hacks, a grading rubric, and the standard assignment-submission
footer. Supersedes the hand-built draft from PR #86/#87.

Also pulls the two supporting assets the lesson depends on:
assets/js/csa-lessons/unit2-interactives.js (self-contained,
dependency-free) and _sass/open-coding/csa-unit2-interactive.scss,
registered via one @import line in _main.scss. Scoped to just this
lesson -- the other Unit 2 lessons (2.1, 2.3-2.12) are left alone
since other PRs may already be updating them.

Co-Authored-By: Claude Sonnet 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.

2 participants