VPSPulse Mirrors
High-Performance Open-Source Archive
Working with bundled examples
Working with bundled examples
The package includes a small set of self-contained example exercises
in inst/examples. These are useful for testing a fresh
installation or for bootstrapping your own authoring workflow.
Locate the examples
example_dir <- system.file("examples", package = "exams2ilias")
list.files(example_dir, full.names = TRUE)
Export one example
library(exams2ilias)
outdir <- tempfile("ilias-")
dir.create(outdir)
exams2ilias(
file.path(example_dir, "stats_schoice.Rmd"),
n = 1,
dir = outdir,
name = "stats_schoice",
xmlcollapse = FALSE,
solutionswitch = FALSE
)
Export the full example set
The helper script generate_examples.R exports each
bundled example individually and can also create one combined question
pool.
source(file.path(example_dir, "generate_examples.R"))
outdir <- tempfile("ilias-examples-")
dir.create(outdir)
generate_example_exports(outdir)
Adapt an example for your own pool
A practical workflow is:
- Start from the closest bundled example.
- Replace the statistical scenario and answer logic.
- Keep the metadata structure intact.
- Export one question first and test the import in ILIAS.
- Only then batch-export larger question sets.
This keeps debugging cheap and avoids importing many broken items at
once.