exams2openolat {exams}R Documentation

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", config = TRUE, converter = "pandoc-mathjax", table = TRUE,
    maxattempts = 1, cutvalue = NULL, ...)

  openolat_config(cancel = FALSE, suspend = FALSE, scoreprogress = FALSE,
    questionprogress = FALSE, maxscoreitem = TRUE, menu = TRUE,
    titles = TRUE, notes = FALSE, hidelms = TRUE, hidefeedbacks = FALSE,
    blockaftersuccess = FALSE, attempts = 1, anonym = FALSE,
    manualcorrect = FALSE)

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.

config

logical or named list with arguments to be passed to function openolat_config, for adding an OpenOlat-specifc configuration file QTI21PackageConfig.xml to the exam. If set to config = FALSE, no configuration file is added (which was the default behavior up to R/exams 2.3.6). Setting config = TRUE is equivalent to config = list() or config = openolat_config() (which is the current default, starting from R/exams 2.4.0). Custom configurations can be specified using the syntax config = list(...), see the details on the possible arguments below.

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 within an exam. Set to Inf or 0 for unlimited attempts. For a finite number of attempts this must be smaller than 100000. See also attempts below for allowing more than one attempt for the exam as a whole.

cutvalue

numeric. The number of points at which the exam is passed. If set to NULL (default) or equivalently NA, no cutvalue is set and the result of the exam is just the number of points.

...

arguments passed on to exams2qti21 (or exams2qti12, respectively). See the corresponding manual pages for further important arguments such as solutionswitch, casesensitive, cloze_schoice_display navigation, shufflesections, eval, selection, among many others.

cancel

logical. Are participants allowed to cancel an exam after starting it? (Default: FALSE.)

suspend

logical. Are participants allowed to suspend an exam after starting it (in order to continue it later)? (Default: FALSE.)

scoreprogress

logical. Should the progress of the score/points achieved so far be displayed during the exam? (Default: FALSE.)

questionprogress

logical. Should the number of questions solved so far be displayed during the exam? (Default: FALSE.)

maxscoreitem

logical. Should the maximum score of a question/item be displayed? (Default: TRUE.)

menu

logical. Should the menu be displayed during the exam? (Default: TRUE.)

titles

logical. Should question titles be displayed during the exam? (Default: TRUE.)

notes

logical. Should participants be enabled to take notes in OpenOlat during the exam? (Default: FALSE.)

hidelms

logical. Should access to the OpenOlat learning management system be hidden during the exam? (Default: TRUE.)

hidefeedbacks

logical. Should feedbacks be hidden? (Default: FALSE.)

blockaftersuccess

logical. Should the exam be blocked after successful completion? (Default: FALSE.)

attempts

integer. How many attempts are allowed for the exam as a whole? Note that this should not be confused with the maxattempts for a question within the exam (see above).

anonym

logical. Should anonymous users be allowed to take the exam? (Default: FALSE.)

manualcorrect

logical. Should the points and pass/fail status from the exam be evaluated manually? (Default: FALSE.)

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 and table output from pandoc is post-processed as expected by OpenOlat. See the corresponding manual page for many more arguments that are supported by exams2openolat.

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".

In addition to controlling the behavior of the exam and its questions via the standard QTI 2.1 options (see exams2qti21), it is possible to specify certain OpenOlat-specific configurations via an additional XML file to be added to the ZIP output. This is why these options are not part of exams2qti21 but are provided in the separate wrapper function openolat_config. As the resulting XML configuration file is not part of the official OpenOlat interface, it may be subject to more changes in the future.

Value

exams2openolat returns a list of exams as generated by xexams.

See Also

exams2qti12, exams2qti21

Examples

## load package and enforce par(ask = FALSE)
library("exams")
options(device.ask.default = FALSE)

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

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

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

[Package exams version 2.4-0 Index]