generate_correction_document {rexer} | R Documentation |
Generate the support document for exam correction
Description
From an exam object, we can generate instances that serve as support for the correction of the exam. Each instance will include the answers, if they are indicated, associated with the exercises. In any case, the randomly included part of the exam will be highlighted.
Usage
generate_correction_document(ex, out_dir, output_format, encoding, new_pages)
## S3 method for class 'exam'
generate_correction_document(
ex,
out_dir = NULL,
output_format = "pdf_document",
encoding = "UTF-8",
new_pages = NULL
)
Arguments
ex |
An 'exam' object. |
out_dir |
A string indicating the output folder. |
output_format |
A vector of strings specifying the desired output formats. |
encoding |
A string specifying the encoding. |
new_pages |
A string with the values 'all', 'none', or 'NULL'. |
Details
To do this, we specify the folder where the documents will be generated (using parameter 'out_dir'), the output format (using parameter 'output_format'), the encoding (using parameter 'encoding'), and whether we want each exercise to start on a new page, include exercises until the pages are filled, or preserve the definition of the exercise in this regard (using parameter 'new_pages').
Value
An 'exam' object.
See Also
Other exam definition:
exam()
,
generate_document()
Examples
## Not run:
rmd <- system.file("extdata/template01.Rmd", package = "rexer")
exercises <- system.file("extdata/exercises.csv", package = "rexer")
ex <- exam(
rmd = rmd,
examinees = NULL,
instances_num = 1,
random = TRUE,
reorder_exercises = TRUE
) |>
define_exercises_from_csv(exercises) |>
generate_correction_document(out_dir = tempdir())
## End(Not run)