Skip to content

Feat/lab sd correction report#1

Draft
TenTemujin wants to merge 6 commits intodevelopmentfrom
feat/lab_sd_correction_report
Draft

Feat/lab sd correction report#1
TenTemujin wants to merge 6 commits intodevelopmentfrom
feat/lab_sd_correction_report

Conversation

@TenTemujin
Copy link
Owner

feat: Add Automated Grading Report Generation and PDF Conversion Tools

Summary

This pull request introduces a new automated workflow for generating and finalizing student grading reports. It includes two primary command-line interface (CLI) tools: one for creating standardized Markdown reports from a template, and another for converting these reports into high-quality PDFs.

This feature aims to reduce manual effort, ensure consistency in feedback, and produce professional-looking artifacts for students.


Changes

  • report_tool.py: 📝

    • A new CLI script that iterates through student directories to create a standardized correction folder and a Markdown report file.
    • Uses argparse for flexible command-line options (e.g., specifying activity name, grader, output directory).
    • Populates the Markdown file from template.md with student-specific and activity-specific details.
  • convert_to_pdf.py: 📄

    • A new asynchronous CLI script to recursively find all Markdown (.md) files in a directory and convert them to PDF.
    • Uses pyppeteer (headless Chrome) to ensure high-fidelity rendering.
    • Includes support for LaTeX mathematical formulas via the mdit-py-plugins library.
    • Styles the final PDF using a GitHub-like CSS for readability.
  • template.md: 📋

    • A customizable Markdown template that defines the structure of the grading report.
    • Includes placeholders like ${student_name} and ${activity_title} that are dynamically replaced by the report_tool.py script.
  • README.md: 📖

    • Added comprehensive documentation explaining the purpose, features, installation steps, and usage workflow for the new tools.
    • Provided versions in both English and Portuguese.

How to Test

  1. Set up the environment:

    • Create a sample directory structure as described in the README.md:
      /test_grading
      ├── submissions
      │   ├── Student_A
      │   └── Student_B
      ├── report_tool.py
      ├── convert_to_pdf.py
      └── template.md
      
    • Install the required dependencies:
      pip install "markdown-it-py<3.0.0" "mdit-py-plugins" pyppeteer
  2. Test the Report Generation:

    • Navigate to the /test_grading directory.
    • Run the report generation script:
      python report_tool.py "Test_Assignment_1" -o ./submissions -g "Dr. Reviewer"
    • Verify: Check that a Student_A_Test_Assignment_1_correction folder (and a similar one for Student B) has been created inside each student's directory. Confirm that it contains a .md file and a src folder.
  3. Test the PDF Conversion:

    • Run the PDF conversion script on the same directory:
      python convert_to_pdf.py ./submissions
    • Verify: Check that a .pdf file has been created alongside the .md file in each correction folder. Open the PDF to ensure the content, tables, and the LaTeX formula from the template are rendered correctly.

@TenTemujin TenTemujin self-assigned this Sep 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments