Export exam YAML to PDFs ready for GradeScope upload. Use this skill whenever the user wants to generate PDFs from an exam YAML file - wether blank exam templates, student answer PDFs, or both. Handles page normalization so each student has the same number of pages per question for proper GradeScope matching.
This skill exports an exam YAML file into PDFs ready for GradeScope upload. It generates both a blank exam template and student answer PDFs with normalized page counts.
The purpose of this skill is to produce PDFs formatted for import into Gradescope. Any time the user mentions Gradescope, this is the skill to use.
Trigger this skill when the user mentions:
This skill requires a structured exam YAML file as input. If the user does not already have one, these skills can be used to generate it:
exam-markdown-to-yaml — if the source is a .md exam filemoodle-to-yaml — if the source is a Moodle HTML/CSV exportDo not proceed with this skill until a valid YAML file exists. If the user asks to generate PDFs but hasn't produced a YAML yet, run the upstream skill first, based on their source format.
If the user did not give you the location of the YAML file, ask for it.
If the provided path does not exist, list the files in the same directory (or the current working directory if no directory was given), filter by .yaml extension, and identify the closest match by name. Ask the user: "I couldn't find <provided path>. Did you mean <best match>?" and wait for confirmation before proceeding.
Run the pdf generation script with the correct parameters. The parameters are the following :
-i : The path to the exam YAML file. You should already have this at this step-o : The path to the output folder to put all the generated markdown. You can put this in a subfolder of the YAML exam file named pdf/uv run generate_pdfs.py -i <path-to-exam.yaml> -o <output-dir>
This script can take several minutes to complete — one markdown-to-PDF conversion per student. Warn the user upfront that this will take time. Do not timeout on this step. And do not kill the process yourself. If the user find it is taking too long, he will cancel it himself.
At the end of this step, you should have something like :
./<yaml_exam_folder>/<filname>.yaml
./<yaml_exam_folder>/pdf/** -> multiples pdf files generated by the tool
Final output structure:
<output-dir>/
├── <exam>.yaml
├── pdf/
│ ├── Firstname_Lastname.pdf
│ └── ...
Export PDFS from the content of a YAML exam file. Export one PDF for each student, and a template PDF.
User: "Can you export my exam to PDFs for GradeScope?"
User answer (e.g.,
./opengrader/exam.yaml)
uv run generate_pdfs.py ./cc_1/exam.yaml ./cc_1/pdfuv run generate_markdown.py ./opengrader/exam.yaml ./output/markdown