exams (version 2.1-0)

exams2lops: Generation of Exams in LOPS Exam Server Format (WU Wien)

Description

Automatic generation of exams in LOPS exam server format (WU Wien).

Usage

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, encoding = "", converter = "tex2image", base64 = FALSE, auto_scramble = TRUE, ...)
make_exams_write_lops(name = NULL, auto_scramble = TRUE, ...)

Arguments

file
character. A specification of a (list of) exercise files.
n
integer. The number of copies to be compiled from file.
nsamp
integer. The number 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.)
dir
character. The default is the current working directory.
name
character. A name prefix for resulting exercises.
quiet
logical. Should output be suppressed when calling xweave?
edir
character specifying the path of the directory in which the files in file are stored (see also below).
tdir
character specifying a temporary directory, by default this is chosen via tempdir. Note that this is cleaned up and potentially temporary files are deleted.
sdir
character specifying a directory for storing supplements, by default this is chosen via tempdir.
verbose
logical. Should information on progress of exam generation be reported?
solution
logical. Should the solution be included in the HTML output?
doctype
character vector with a DOCTYPE tag for the HTML page. By default HTML4 is employed.
head
character vector for the head tag. By default a simple header is employed, setting the font to Arial.
resolution, width, height
numeric. Options for rendering PNG graphics passed to xweave.
encoding
character, passed to xweave.
converter
character. Workhorse function for transforming LaTeX code to HTML.
base64
logical. Should images be embeddeg using Base 64 coding?
auto_scramble
logical. Should answers be scrambled automaticall?
...
arguments passed on to make_exercise_transform_html.

Value

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

Details

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.

References

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

See Also

xexams, ttm, tth, tex2image, make_exercise_transform_html,

Examples

Run this code
## Not run: 
# ## output directory
# mydir <- tempdir()
# 
# ## generate the exam
# exams2lops(c("scatterplot", "boxplots"), dir = mydir)
# dir(mydir)
# ## End(Not run)

Run the code above in your browser using DataLab