Title: ILIAS Export Interface for R/Exams
Version: 0.0.1
Description: Utilities for exporting exercises from 'R/exams' to question pools for the learning management system 'ILIAS'. The package implements a Question and Test Interoperability 1.2 rendering path tailored to 'ILIAS' and writes the question-pool XML layout validated for imports in 'ILIAS' 9.17. Supported exercise types include single-choice, multiple-choice, numeric, string, and combined gap questions. The underlying 'R/exams' framework is described in Zeileis, Umlauf, and Leisch (2014) <doi:10.18637/jss.v058.i01>.
License: GPL-2 | GPL-3
Encoding: UTF-8
Imports: base64enc, exams, tools, utils
Suggests: knitr, pkgdown, rmarkdown, testthat (≥ 3.0.0)
VignetteBuilder: knitr
URL: https://github.com/mchlbckr/exams2ilias, https://buecker.ms/exams2ilias/
BugReports: https://github.com/mchlbckr/exams2ilias/issues
Config/Needs/website: pkgdown
Config/testthat/edition: 3
NeedsCompilation: no
Packaged: 2026-04-27 15:00:16 UTC; michael
Author: Michael Bücker ORCID iD [aut, cre, cph], Amar Jeeth [ctb], Achim Zeileis ORCID iD [ctb], Florian Wickelmaier [ctb]
Maintainer: Michael Bücker <michael.buecker@fh-muenster.de>
Repository: CRAN
Date/Publication: 2026-04-28 20:10:08 UTC

Generation of Exams in ILIAS Format

Description

Interface 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,
    encoding  = "UTF-8", 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, ...)

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 file are 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)?

encoding

character, ignored. The encoding is always assumed to be UTF-8.

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_17" template alias or a path to a custom QTI 1.2 template file. The internal default targets ILIAS 9.17.

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 TRUE everything is collapsed with spaces.

metasolution

logical. Should the solution be added to the XML output as qtimetadata tag? This currently only works for essay-like ILIAS questions.

...

further arguments passed on to make_exercise_transform_html.

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.

Version 0.0.1 in this package targets ILIAS 9.17 and mirrors the working export structure that was validated against that version. 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.

Value

exams2ilias returns a list of exams as generated by xexams.

If zip is TRUE (default), an ILIAS question pool object is generated.

See Also

xexams

Examples

library("exams2ilias")

dir.create(mydir <- tempfile())

exams2ilias(
  system.file("exercises/lm.Rmd", package = "exams"),
  n = 1,
  dir = mydir,
  name = "lm_ilias"
)

dir(mydir)