Authoring ILIAS-ready questions

This article summarizes the authoring patterns currently covered by the package and its bundled examples.

Supported exercise types

The package exports the following main question types:

  • cloze
  • schoice
  • mchoice
  • num
  • string

For cloze exercises, the gap subtypes num, string, schoice, and mchoice are mapped to the corresponding ILIAS gap elements.

Choice questions

Single-choice and multiple-choice questions follow the standard R/exams pattern with an answer list in the question and a logical answer key in the solution block. For static answer lists, plain Markdown is sufficient.

Question
========
Which statement about p-values is correct?

Answerlist
----------
* A p-value below 0.05 can justify rejection at the 5% level.
* A p-value is the probability that the null hypothesis is true.
* A p-value cannot depend on the sample size.

Solution
========

Answerlist
----------
* True
* False
* False

Points and metadata

If you want imports to arrive with explicit scoring in ILIAS, include expoints in the exercise metadata.

Meta-information
================
extype: schoice
exsolution: 100
exname: P-value interpretation
exshuffle: TRUE
expoints: 1

For cloze exercises with several gaps, you can provide one point value per gap. ILIAS Identical Scoring is enabled by default, so repeated correct answers in different gaps are scored independently.

ILIAS-specific restrictions

Choice-based cloze gaps are rendered as ILIAS dropdowns. ILIAS displays these labels as plain text, so avoid HTML and math markup in the answer options. exams2ilias removes unsupported HTML tags from dropdown labels and emits a warning.

For visible tables in question text, prefer simple Markdown tables or knitr::kable(df, format = "html", row.names = FALSE). The exporter normalizes tables by default with table_strategy = "html_basic", which keeps only a conservative table structure for ILIAS. Avoid kableExtra, CSS classes, inline styles, captions, rowspan, colspan, nested tables, and layout HTML. If a table is wide or column separation is critical, test the exercise with table_strategy = "pre".

For static external files, register the file as a supplement before linking it:



Question
========
![](figure.png)

Plots and files created while processing the exercise are handled as supplements automatically.

Solution metadata

metasolution = TRUE adds ILIAS solution metadata for essay/string-like questions. It is disabled by default and internally uses the PHP-serialized solution structure expected by ILIAS.