mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-05-08 02:28:25 -05:00
[GH-ISSUE #879] LUA filter for injecting quizzes automatically #1611
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @profvjreddi on GitHub (Jun 27, 2025).
Original GitHub issue: https://github.com/harvard-edge/cs249r_book/issues/879
I need to find a way to improve the quizzes and how they are integrated into the book.
Currently, the quizzes are stored in a JSON file, and a Python preprocessor generates an updated markdown when the quiz is inserted. See
quizzes.pyThis setup is okay but creates redundancy because, once the quizzes are injected, there are two copies of the questions—one inside the JSON file and another inside the actual Quarto markdown file.One way to avoid this is to focus solely on updating the JSON file and then use a Lua filter to automatically check at the end of each section in a specific chapter if there's a corresponding quiz for that section ID, and if so, insert it automatically.
Something to think about 🤔
@profvjreddi commented on GitHub (Jul 1, 2025):
I pushed this into this PR https://github.com/harvard-edge/cs249r_book/pull/881 which I merged.