Improves the quiz injection process by enhancing part header detection and flushing chapters/sections correctly.
- Refactors chapter/section flushing logic to ensure quizzes are inserted at the appropriate locations.
- Improves robustness of "part" header detection.
- Simplifies debug logging.
Improves quiz injection process by restructuring the code to handle chapter and section processing more efficiently.
This change introduces a `flush_chapter` function to handle the insertion of self-check answers at the end of each chapter, along with associated logging. It also updates the main loop to process chapters and sections sequentially, ensuring quizzes are inserted correctly and consistently.
Removes extraneous title extraction logic and simplifies the overall quiz injection workflow.
Introduces configurable options for quiz injection,
including file pattern, scan directory, and auto-discovery
behavior for PDF builds. This allows for greater
flexibility in managing quiz files and their integration
into the document.
Additionally adds debug logging for config values.
Improves quiz loading for combined PDF documents (books) by automatically discovering and processing quiz files located within a specified directory.
This change addresses the issue of quiz files not being loaded correctly when Quarto combines multiple files into a single PDF document. It now searches for quiz files in the "contents/core" directory and automatically loads them, streamlining the quiz injection process.
Also adds extra debugging output to help diagnose issues and improves chapter title extraction for better context during quiz insertion.
Improves quiz functionality by providing detailed logging and error reporting during the loading and insertion of quiz sections.
Tracks the source file for each quiz section, providing better traceability.
Adds comprehensive summary reports to show the success and failure rates of file loading and section insertion, and provides a breakdown of sections by file.
Updates logging messages to improve clarity and informativeness.
Refactors quiz injection logic to streamline the process.
Removes verbose logging statements that cluttered the output.
Adds a check to prevent processing files with no quizzes.
Now only inserts answer sections if needed.
Changes quiz identifiers to a more descriptive format.
This improves quiz tracking and debugging.
Ensures quiz sections are correctly identified by checking
for header level 2.
Adds newline characters to quiz question and answer links
for better readability and spacing in the rendered output.
Also updates the "See Answer" and "Back to Question" labels
to use more appropriate phrasing.
Ensures quizzes are injected correctly in nested
sections by tracking section levels and flushing
previous sections only when encountering a header
of the same or higher level. Also resets quiz flags
when a section without a quiz is encountered.
Enhances the quiz injection process by adding more descriptive
logging messages with clearer formatting. This improves
debuggability and provides better feedback during quiz loading,
registration, question processing, and insertion. Includes
status indicators and section identifiers in the logs.
Improves quiz injection by processing quizzes section by section.
This allows for better organization and avoids premature flushing
of answers when quizzes appear within a section, especially in
longer chapters. Also, formats the choices in questions and answers with line breaks.
Fixed Lua filter to enable inserting questions and answers in PDF output.
Added automatic numbering for question and answer blocks.
Matched block header font in HTML output with the book’s main font.
Improves the quiz functionality by adding chapter number prefixes to quiz numbers for better organization and context.
It implements a robust chapter number detection mechanism, first attempting to extract the chapter number from the book metadata, then falling back to parsing the input file path or working directory. A default value of 1 is used if all methods fail.
This change also updates the "Back to Question" link in the answer section to include the quiz number.
Enhances quiz navigation by including the section
number in the "See Answer" link, improving user
experience and clarity.
This change allows users to easily identify which
section the answer corresponds to, especially in
documents with multiple quizzes.
Updates quiz block formatting to use a link for "See Answers"
instead of a raw markdown reference.
Adds a "Back to Self-Check Questions" link to the answer block,
improving navigation between questions and answers.
Updates regex for question id gsub to handle `#sec-` prefixes.
Refactors the quiz injection filter to load quiz data from JSON files specified in the YAML metadata.
This includes:
- Implements more robust path resolution for quiz files, handling cases where the file might be in different locations relative to the pandoc process.
- Switches from markdown string building to using pandoc's structured document representation, allowing for easier and more reliable formatting of quiz questions and answers.
- Supports multiple choice, fill-in-the-blank, short answer, and ordering questions.
- Adds a "Self-Check Answers" section at the end of the document containing formatted answers and learning objectives.
Implements a Lua filter that injects quizzes and answers into the Pandoc document from a JSON file specified in the YAML metadata.
The filter searches for the quiz file in multiple locations and registers sections for quiz injection. It formats quiz questions as markdown callouts and collects answer blocks to be appended at the end of the document under a "Self-Check Answers" section. This provides a mechanism for embedding interactive quizzes directly into course content.
Formats quizzes as callouts with answers section.
Enhances quiz presentation by formatting them as callouts.
Compiles all answers in a dedicated section, improving user experience.