{"size": 3059, "ext": "scrbl", "max_stars_repo_path": "scribblings/grading.scrbl", "max_stars_repo_name": "kjinho/grading", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "scribblings/grading.scrbl", "max_issues_repo_name": "kjinho/grading", "max_issues_repo_issues_event_min_datetime": "2022-02-10T23:11:49.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-10T23:11:49.000Z", "max_forks_repo_path": "scribblings/grading.scrbl", "max_forks_repo_name": "kjinho/grading", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 35.1609195402, "max_line_length": 92, "alphanum_fraction": 0.6001961425}
#lang scribble/manual
@require[@for-label[grading
                    yaml
                    racket/base]]

@title{grading: a tool to generate PDF grade sheets}
@author{Jin-Ho King}

@defmodule[grading]

This library provides methods to convert YAML grading rubrics
and score/comment sheets into PDF grade sheets for distribution
to students. The library uses pdflatex to generate the PDFs.

@defparam[overwrite-flag flag (or/c 'error 'append 'update
                                    'replace 'truncate 'truncate/replace)
          #:value 'error]{
 A parameter that defines the action to take if a file
 already exists.
}

@defparam[pdflatex-command command string?
          #:value "/Library/TeX/texbin/pdflatex"]{
 A parameter that defines the location of pdflatex used
 to generate PDFs.
}

@defproc[(accumulate-scores [yaml hash?])
         (listof (cons/c string? number?))]{
 Given a hash-table generated by the YAML library,
 returns an association list of student names and their
 raw scores.
}


@defproc[(calculate-grades [grades (listof (cons/c string? number?))])
         (hash/c string?
                 (hash/c (or/c 'score 'grade 'deviations)
                         number?))]{
 Given an association list of students and their raw scores,
 returns a hash-table that maps from a student name to
 a hash-table with that student's score, the number of deviations
 from the mean, and the final grade.
}

@defproc[(latexify-student [yaml hash?] [name string?])
         string?]{
 Returns a string that represents a LaTeX file for the grade sheet.
}

@defproc[(latexify-to-file [yaml hash?]
                           [name string?]
                           [#:exists exists-flag (or/c 'error 'append 'update
                                                       'replace 'truncate 'truncate/replace)
                            (overwrite-flag)
                            ]
                           [#:filename filename path-string?
                            (path-add-extension name "tex")])
         void?]{
 A convenience procedure that writes the LaTeX grade sheet to file.
}

@defproc[(render-grade-list [yaml hash?])
         string?]{
 Returns a string that represents a LaTeX file that contains a summary
 of all grades in the class.

 The procedure sorts the student list in alphabetical order.
}
@defproc[(save-total-scores! [yaml hash?]
                             [filename path-string?]
                             [#:exists exists-flag (or/c 'error 'append 'update
                                                       'replace 'truncate 'truncate/replace)
                              (overwrite-flag)])
         void?]{
 Writes a basic text representation of the class's scores to file.
}
                             
@defproc[(get-student-names [yaml hash?])
         (listof string?)]{
 Returns a list of student names.
}
@defproc[(process-name! [yaml hash?] [name string?])
         void?]{
 Generates a PDF of the named student's grade sheet. It deletes
 the intermediate latex, auxilary, and log files.
}