Generation of Exams in ILIAS Format
exams2ilias.RdInterface for automatic generation of exams in QTI 1.2 for the learning management system ILIAS.
Usage
exams2ilias(file, n = 1L, nsamp = NULL, dir = ".",
name = NULL, quiet = TRUE, edir = NULL, tdir = NULL, sdir = NULL,
verbose = FALSE, resolution = 100, width = 4, height = 4, svg = FALSE,
num = list(fix_num = FALSE, minvalue = NA),
mchoice = list(maxchars = c(3, NA, 3), minvalue = NA),
schoice = mchoice, string = NULL, cloze = NULL,
template = "ilias",
duration = NULL, stitle = "Exercise", ititle = "Question",
adescription = "Please solve the following exercises.",
sdescription = "Please answer the following question.",
maxattempts = 0, cutvalue = 0, solutionswitch = TRUE, zip = TRUE,
points = NULL, eval = list(partial = TRUE, negative = FALSE),
converter = "pandoc-mathjax", xmlcollapse = TRUE,
metasolution = FALSE,
table_strategy = c("html_basic", "pre", "plain", "html_styled", "keep"),
...)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(s) of exercise files sampled from each list element of
file. Sampling without replacement is used if possible.- dir
character. The default is the current working directory.
- name
character. A name prefix for resulting exercises and ZIP file.
- quiet
logical. Should output be suppressed when calling
xweave?- edir
character specifying the path of the directory (along with its sub-directories) in which the files in
fileare stored.- tdir
character specifying a temporary directory.
- sdir
character specifying a directory for storing supplements.
- verbose
logical. Should information on progress of exam generation be reported?
- resolution, width, height
numeric. Options for rendering PNG (or SVG) graphics passed to
xweave.- svg
logical. Should graphics be rendered in SVG or PNG (default)?
- num
function or named list applied to numerical questions.
- mchoice, schoice, string, cloze
function or named list applied to multiple choice, single choice, string, and cloze questions, respectively.
- template
character. Either the internal
"ilias"/"ilias_9_20"template alias or a path to a custom QTI 1.2 template file. The legacy"ilias_9_17"alias remains available for compatibility. The internal default targets ILIAS 9.20.- duration
integer. Set the duration of the exam in minutes.
- stitle
character. A title that should be used for the sections.
- ititle
character. A title that should be used for the assessment items.
- adescription
character. Description for the overall assessment.
- sdescription
character. Vector of descriptions for each section.
- maxattempts
integer. The maximum attempts for one question.
- cutvalue
numeric. The cutvalue at which the exam is passed.
- solutionswitch
logical. Should the question/item solutionswitch be enabled?
- zip
logical. Should the resulting XML file be zipped?
- points
integer. How many points should be assigned to each exercise?
- eval
named list, specifies the settings for the evaluation policy.
- converter
character. Argument passed on to
make_exercise_transform_html.- xmlcollapse
logical or character. Should line breaks be collapsed in the XML code. If
TRUEeverything is collapsed with spaces.- metasolution
logical. Should the solution be added to the XML output as qtimetadata tag? This currently only works for essay/string-like ILIAS questions and uses the PHP-serialized solution structure expected by ILIAS internally.
- table_strategy
character. Strategy for tables in rendered question text. The default
"html_basic"rewrites tables to a conservative ILIAS-compatible subset."pre"converts tables to preformatted monospace text,"plain"to plain text,"html_styled"emits simple legacy table attributes as a best-effort option, and"keep"leaves table HTML unchanged.- ...
further arguments passed on to
exams2qti12.
Value
exams2ilias returns a list of exams as generated by xexams.
If zip is TRUE (default), an ILIAS question pool object is generated.
Details
exams2ilias uses an ILIAS-specific QTI 1.2 rendering path inside this
package and then rewrites the result to the question-pool layout required by ILIAS.
The function supersedes the function of the same name in the exams package.
Currently, this package targets ILIAS 9.20 and mirrors the working export
structure that was validated against that version. The table handling follows
conservative compatibility findings for current ILIAS 9.x installations,
where assessment HTML can be purified and normalized by the editor or
presentation layer. In particular, the exported question pool XML
is written as a flat collection of <item> elements directly below
<questestinterop>, matching the layout expected by current ILIAS
question pool imports.
Numeric and cloze questions are exported in an ILIAS-specific item layout. For cloze
questions, the subtypes num, string, schoice, and mchoice
are mapped to ILIAS gap elements. ILIAS Identical Scoring is enabled by
default so repeated correct answers in different gaps are scored independently.
For tables in question text, prefer Markdown tables or
knitr::kable(x, format = "html", row.names = FALSE) as authoring input.
Avoid manual styling such as kableExtra, CSS classes, inline styles,
captions, rowspan, colspan, or layout HTML in exercise files.
Examples
library("exams2ilias")
dir.create(mydir <- tempfile())
exams2ilias("lm.Rmd", n = 1, dir = mydir, name = "lm_ilias")
#> Warning: ILIAS dropdown gaps support plain text only; HTML markup was removed from cloze choice labels.
dir(mydir)
#> [1] "lm_ilias_qpl.zip"