Sweave
was run).read_exercise(file)
read_metainfo(file)
read_exercise
returns a list with elementsread_metainfo
returns a list with the following elements.
Most elements may also be NULL
(or empty) if the underlying
information is not specified in the file
.num
, mchoice
,
schoice
, string
, or cloze
.type
of the exercise: num
leads to a numeric vector (of length 1
or 2), mchoice
/schoice
lead to logical vector, string
to
a character vector (of length 1), and cloze
leads to a list of
solutions (depending on clozetype
).cloze
exercise.mchoice
/schoice
answers should be shuffled (in Moodle or other e-learning systems).solution
.exams
.read_exercise
extracts the LaTeX code from the question
and solution environments of the exercise LaTeX file, extracting
the answerlist environments separately (if any). Paths to supplementary
files (such as graphics or data files) are stored and the
metainformation is extracted (by calling read_metainfo
which
also includes sanity checks).xexams
## xexams() uses read_exercise() by default to read in
## each individual exercise, e.g., here for only a single
## exam with only a single exercise the result is:
set.seed(1090)
xexams("tstat")[[1]][[1]]
Run the code above in your browser using DataLab