Skip to contents

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 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'.

Value

An `exam` object.

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`).

See also

Other exam definition: exam(), generate_document()

Examples


if (FALSE) {
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())
}