Automatic generation of exams in LOPS exam server format (WU Wien).
exams2lops(file, n = 1L, nsamp = NULL, dir = ".", name = NULL,
quiet = TRUE, edir = NULL, tdir = NULL, sdir = NULL, verbose = FALSE,
solution = TRUE, doctype = NULL, head = NULL, resolution = 100, width = 4,
height = 4, svg = FALSE, encoding = "UTF-8", envir = NULL, engine = NULL,
converter = "tex2image", base64 = FALSE,
auto_scramble = TRUE, ...) make_exams_write_lops(name = NULL, auto_scramble = TRUE, ...)
exams2lops
returns a list of exams as generated by xexams
.
make_exams_write_lops
eturns a function that generates the XML code
for the question in LOPS exam server format (WU Wien).
character. A specification of a (list of) exercise files.
integer. The number of copies to be compiled from file
.
integer. The number(s) of exercise files sampled from each
list element of file
. Sampling without replacement is used
if possible. (Only if some element of nsamp
is larger than
the length of the corresponding element in file
, sampling
with replacement is used.)
character. The default is the current working directory.
character. A name prefix for resulting exercises.
logical. Should output be suppressed when calling
xweave
?
character specifying the path of the directory (along with its
sub-directories) in which the files in file
are stored
(see also xexams
).
character specifying a temporary directory, by default
this is chosen via tempfile
. Note that this
is cleaned up (i.e., existing files are deleted) and only certain
temporary files are preserved.
character specifying a directory for storing supplements, by
default this is chosen via tempfile
.
logical. Should information on progress of exam generation be reported?
logical. Should the solution be included in the HTML output?
character vector with a DOCTYPE tag for the HTML page. By default HTML4 is employed.
character vector for the head tag. By default a simple header is employed, setting the font to Arial.
numeric. Options for rendering PNG (or SVG)
graphics passed to xweave
.
logical. Should graphics be rendered in SVG or PNG (default)?
character, ignored. The encoding is always assumed to be UTF-8.
argument passed to xweave
(which passes
it to knit
).
argument passed to xweave
indicating whether
"Sweave"
(default) or "knitr"
should be used for rendering Rnw exercises.
character. Workhorse function for transforming LaTeX code to HTML.
logical. Should supplementary files be embedded using Base 64 coding?
Argument base64
may also be a character vector of file suffixes that should be encoded, e.g.
base64 = c("png", "rda")
will only encode PNG images and binary .rda
files.
If set to NULL
only image files will be encoded.
logical. Should answers be scrambled automaticall?
arguments passed on to make_exercise_transform_html
.
exams2lops
will produce a .zip
file that may be uploaded. It proceeds by (1)
calling xweave
on each exercise, (2) reading the resulting LaTeX code, (3)
transforming the LaTeX code to HTML, and (4) embedding the HTML code in a XML file using the
LOPS exam server XML format (WU Wien).
For steps (1) and (2) the standard drivers in xexams
are used. In step (3), a suitable
transformation function is set up on the fly using make_exercise_transform_html
, see also
the details section in exams2html
.
For step (4) a simple writer function is set up on the fly that embeds the transformed HTML code into the final XML files for each question and the exam.
Note that in make_exams_write_lops
only multiple and single choice questions are supported at
the moment, since the LOPS exam server XML format (WU Wien) is used to generate printed versions for large scale
multiple choice exams. In addition, only images of the question/questionlist/solution/solutionlist
should be generated, since the server has only minimum support for e.g. MathML markup used to
produce mathematical formulas.
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. tools:::Rd_expr_doi("10.18637/jss.v058.i01").
xexams
,
ttm
,
tth
,
tex2image
,
make_exercise_transform_html
,
if (FALSE) {
## output directory
dir.create(mydir <- tempfile())
## generate the exam
exams2lops(c("scatterplot.Rmd", "boxplots.Rmd"), dir = mydir)
dir(mydir)
}
Run the code above in your browser using DataLab