FAQ

This will describe frequently asked questions and common mistakes.

General Questions

R/exams is an R package, which allows for dynamic exam creation. Exam questions can have many formats and can easily be individualized. For more information about R/exams see here and for a brief introduction to the concept see here

Anyone who wants to create dynamic exercises for their own course, using a similar system as the one that is currently used for the Statistics courses.

It depends, but it can be done without. Without any prior experiencing with any programming language, the learning curve can be a bit steep. However, R and also R/exams is documented very well and there are many examples and templates available. Simpler examples are created very easily and since the structure always remains the same, building more complex examples can be done step-by-step.

No, R is just the software to create the exams, however the content is completely adjustable. There are different formats available, see several basic and advanced examples.

Installation

The software can be downloaded and simply installed following the instructions. More information can be found here.

Download R here from CRAN.

Download Rstudio here.

An installation guide can be found here

A step-by-step installation tutorial by the Statistics Institute at BOKU can be found here

Once R and RStudio are installed, R/exams can simply installed by running the following code lines in the console or in a script. library() is used to load the content of the exams package.

install.packages("exams") # installs the package, note the quotes!!  
library(exams) # loads the content of the package 

When converting exams to pdf format, a LaTeX installation is required. One can be installed using the package tinytex.

tinytex::install_tinytex() #function from tinytex 

Additionally, for markdown exercises, Pandoc is required, however this automatically comes with the installation of RStudio.

Setup

R projects can be used for organizing and working with several files in an easy and efficient way. See here for an explanation on how to setup the project.

See this page for a step-by-step guide.

Creating Exercises

The questions and solutions are stored in an .Rmd-file, which is an R markdown file. The script for conversion is stored in an .R-file. Both can be created and edited within RStudio.

The most common types are “numeric”, “string” (for word-based answers), “single choice” and “multiple choice”. Others are also available, depending on the output format. A combination of any of these is of the type “cloze”.

Using $...$for inline mathematical notation and $$...$$for centered notation. For example: The following line

$\alpha = \frac{1}{100}$

produces this: \(\alpha = \frac{1}{100}\)

See the section about including pictures here

Templates for both the .Rmd-file and the converison script can be found here.

Conversion and Output

The most common ones are PDF, HTML and .xml for the import in Moodle. However there are many more available see here

The conversion into the desired format is done by using a exams2xyz()function from the R/exams package. The process is explained in more detail on the conversion page

See a step-by-step guide on this page on the upload to Moodle.

Common Problems

It is necessary to mark the beginning and the end of the code chunk using three backticks (`) and {r}.

```{r}
# place code here
```

Make sure to have LaTeX installed, see for example the package R/tinytex

  • Make sure the image is stored in the correct folder.
  • Use relative paths (./path_to_pic/picture.png).
  • Check whether include_supplement() is used correctly.

Advanced Options

Further Resources

See our discussion forum on Github here

See this page for a multitude of links for different topics regarding R/exams.