exams (version 2.3-6)

exams2openolat: Generation of Exams for OpenOLAT

Description

Automatic generation of exams in QTI 2.1 (or 1.2) with some tweaks optimized for OpenOLAT.

Usage

exams2openolat(file, n = 1L, dir = ".", name = "olattest",
  qti = "2.1", converter = "pandoc-mathjax", table = TRUE,
  maxattempts = 1, ...)

Value

exams2openolat returns a list of exams as generated by xexams.

Arguments

file

character. A specification of a (list of) exercise files.

n

integer. The number of copies to be compiled from file.

dir

character. The default is the current working directory.

name

character. A name prefix for resulting exercises and ZIP file.

qti

character indicating whether QTI "1.2" or "2.1" (default) should be generated.

converter

character passed on to make_exercise_transform_html, indicating the type of converter from LaTeX/Markdown to HTML. Defaults to HTML with MathJax (and OpenOLAT-specific fixups).

table

logical or character. Should a dedicated table class be used in the HTML for OpenOLAT? For details see below.

maxattempts

integer. The maximum attempts for one question (must be smaller than 100000).

...

arguments passed on to exams2qti12 or exams2qti21, respectively.

Details

exams2openolat is a convenience interface to exams2qti12 and exams2qti21 for generating either QTI 1.2 or 2.1 (default) output with some small tweaks for OpenOLAT. Specifically, the MathJax output from pandoc is post-processed as expected by OpenOLAT.

Dedicated table classes currently include: Full-width tables with borders ("b_grid", "b_border") or without ("b_full", "b_borderless"). Or regular tables without background color ("b_middle") or with white grid and color background ("b_gray", "b_red", "b_green", "b_blue", "b_yellow"). Setting table = TRUE corresponds to table = "b_gray".

See Also

exams2qti12, exams2qti21

Examples

Run this code
# \donttest{
## load package and enforce par(ask = FALSE)
library("exams")
options(device.ask.default = FALSE)

## define an exams (= list of exercises)
myexam <- list(
  "boxplots",
  c("tstat", "ttest", "confint"),
  c("regression", "anova"),
  c("scatterplot", "boxhist"),
  "relfreq"
)

## output directory
dir.create(mydir <- tempfile())

## generate .zip with OpenOLAT test in temporary directory
exams2openolat(myexam, n = 3, dir = mydir)
dir(mydir)
# }

Run the code above in your browser using DataCamp Workspace