Skip to contents

extract_assessment() over a set of files. A file that fails to extract is reported and skipped rather than taking the batch down with it – one unreadable PDF in a folder of twelve should not cost the other eleven.

Usage

extract_assessments(files, llmconfig, names = NULL, verbosity = 1L, ...)

Arguments

files

Character: Paths to the documents. .docx, .html, .odt, .rtf, .epub and .tex (each requiring the pandoc package), .pdf (requiring pdftools), .csv, or .R, .qmd, .Rmd, .md and .txt read as they are. See read_document(). They need not be of one format: a folder of .docx homework sets and a .pdf final exam is one batch.

llmconfig

rtemis.llm::LLMConfig: Model configuration.

names

Character: Assessment names, one per file. Defaults to the titles found, else the file names.

verbosity

Integer [0, Inf): Verbosity level.

...

Additional arguments passed to extract_assessment().

Value

List of Assessment objects, named by assessment. Where a document was skipped, the "failed" attribute carries a data frame of its path and the error that stopped it.

Details

The run opens with the number of documents and closes with how many of them produced items, because that is the number a skipped file changes. The per-file warning has scrolled past by the time a batch of twelve finishes, and the returned list is named by assessment rather than by file, so nothing else in the result says that three documents are missing from it. What was skipped, and why, comes back in the "failed" attribute.

Assessment names come from the document titles where those identify a document, and from the file names otherwise – a course whose every question set is titled "Homework Questions" is named from its files. Two names can still coincide, and the second is suffixed rather than allowed to overwrite the assessment already holding it, since the name becomes the YAML key in write_assessments() and the id prefix after that. Pass names to settle all of this yourself.

Author

EDG