pyaota.generator.manager module¶
CLI dispatch functions for pyaota exam generator and grader.
- pyaota.generator.manager.build_answer_key_table_latex(records, institution='', course='', term='', exam_name='', max_versions_per_table=10)[source]¶
Build LaTeX code for answer key table(s).
Creates a longtable with: - Columns: Question number + one column per exam version - Rows: One row per question
If there are more versions than max_versions_per_table, splits into multiple tables.
- Parameters:
records (
list[tuple[str,list[str]]]) – list of (version_label, [ans1, ans2, …])institution (
str) – Institution name for headercourse (
str) – Course name for headerterm (
str) – Term for headerexam_name (
str) – Exam name for headermax_versions_per_table (
int) – Maximum number of versions per table before splitting
- Return type:
- Returns:
Complete LaTeX document as string
- pyaota.generator.manager.rasterize_pdf(pdf_path, dpi=300)[source]¶
Replace a PDF with a rasterized version for improved printer compatibility.
Converts each page to a raster image at dpi and re-encodes as a PDF. This eliminates complex vector/TikZ paths that can confuse some printer RIPs.
- Return type:
- pyaota.generator.manager.write_version_keys_csv(records, output_path='exam_version_keys.csv')[source]¶
Write a CSV with one row per exam version.
records: list of (version_label, [ans1, ans2, …])
- Return type:
- CSV columns:
version_label, Q1, Q2, Q3, …
- pyaota.generator.manager.write_version_keys_pdf(records, output_dir, institution='', course='', term='', exam_name='', max_versions_per_table=10)[source]¶
Generate a PDF with nicely formatted answer keys table.
- Parameters:
records (
list[tuple[str,list[str]]]) – list of (version_label, [ans1, ans2, …])output_dir (
Path) – Directory where PDF should be createdinstitution (
str) – Institution name for headercourse (
str) – Course name for headerterm (
str) – Term for headerexam_name (
str) – Exam name for headermax_versions_per_table (
int) – Maximum number of versions per table before splitting
- Return type: