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. If file specifies
extra information, there may also be additional list elements.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).
The supported metainformation commands are described in detail in
vignette("exams2", package = "exams"), see Table 2. Essentially
the extype command in the LaTeX file is mapped to the type
element of the returned list etc. (see the Value section below), using
the right storage mode for each command (numeric, character, logical).
Additionally, there is an exextra command which allows to set
up arbitrary additional metainformation elements.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