Description Usage Arguments Details Value References See Also Examples
Automatic generation of exams in PDF format.
1 2 3 4 5 6 7 8 9 | exams2pdf(file, n = 1L, nsamp = NULL, dir = ".", template = NULL,
inputs = NULL, header = list(Date = Sys.Date()), name = NULL,
control = NULL, encoding = "", quiet = TRUE, transform = NULL,
edir = NULL, tdir = NULL, sdir = NULL, texdir = NULL,
verbose = FALSE, points = NULL, ...)
make_exams_write_pdf(template = "plain", inputs = NULL,
header = list(Date = Sys.Date()), name = NULL, quiet = TRUE,
control = NULL, texdir = NULL)
|
file |
character. A specification of a (list of) exercise files. |
n |
integer. The number of copies to be compiled from |
nsamp |
integer. The number(s) of exercise files sampled from each
list element of |
dir |
character specifying the output directory (default:
current working directory). If only a single PDF file is produced
and no |
template |
character. A specification of a LaTeX template. The package
currently provides |
inputs |
character. Names of files that are needed as inputs during
LaTeX compilation (e.g., style files, headers). Either the full path
must be given or the file needs to be in |
header |
list. A list of further options to be passed to the LaTeX files. |
name |
character. A name prefix for resulting exercises, by default
chosen based on |
control |
A list of control arguments for the appearance of multiple choice results (see details). |
encoding |
character, passed to |
quiet |
logical. Should output be suppressed when calling
|
transform |
function. An optional transform driver passed to
|
edir |
character specifying the path of the directory in which
the files in |
tdir |
character specifying a temporary directory, by default
this is chosen via |
sdir |
character specifying a directory for storing supplements, by
default this is chosen via |
texdir |
character specifying a directory for running |
verbose |
logical. Should information on progress of exam generation be reported? |
points |
integer. How many points should be assigned to each exercise? Note that this
argument overules any exercise points that are provided within the |
... |
further arguments passed on to |
exams2pdf
is a more flexible re-implementation of the old (version 1)
exams
function (Gruen and Zeileis 2009), using the new extensible
xexams
framework (Zeileis et al. 2014). A detailed
introduction is provided in vignette("exams", package = "exams")
, also
pointing out relative advantages of the new interface.
exams2pdf
proceeds by using make_exams_write_pdf
to set up a custom
driver$write
function on the fly before calling xexams
.
This custom driver combines each exams with the desired template
(and inputs
etc.) and then calls texi2dvi
on the resulting LaTeX file to produce PDF output.
For a single exam (n = 1
) the resulting PDF is displayed on
screen (unless dir
is explicitly specified) while for n > 1
the PDF files are stored in the output directory dir
.
The argument control
is specified by a named list, currently with elements
mchoice.symbol
and cloze.collapse
. mchoice.symbol
has to be a character vector with elements True
and False
,
specifying the symbol used for the questionnaire output in the final PDF file.
cloze.collapse
specifies the character used for collapsing mchoice/schoice
alternatives within a cloze exercise. By default, these are separated by " / "
but with cloze.collapse = "\\\\"
each alternative would be in a new line.
Finally, cloze.collapse = "enumerate"
can also be used which employs a nested
enumerate environment. In the latter case, the questionnaire uses exclozechoice
rather than exmchoice
(see exam.tex
or solution.tex
for an
illustration.
exams2pdf
returns a list of exams as generated by xexams
.
make_exams_write_pdf
returns a function that is suitable for being
supplied as driver$write
to xexams
.
Gruen B, Zeileis A (2009). Automatic Generation of Exams in R. Journal of Statistical Software, 29(10), 1–14. http://www.jstatsoft.org/v29/i10/.
Zeileis A, Umlauf N, Leisch F (2014). Flexible Generation of E-Learning Exams in R: Moodle Quizzes, OLAT Assessments, and Beyond. Journal of Statistical Software, 58(1), 1–36. http://www.jstatsoft.org/v58/i01/.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.