install.packages("exams")
How use the R exams package
The R exams package
The R exams package is a powerful tool for creating and managing exam questions in R. It allows you to create questions in various formats, including HTML, PDF, and Canvas packages, which can be used in online learning platforms. The various learning and assessment platforms require slightly different versions of the QTI standard. R exams provides functions to create packages for the specific requirements for these platforms, such as exams2canvas
, exams2testvision
, and exams2ans
. But it also provides regular QTI packages that can be used in any platform that supports QTI, such as exams2qti21
. The platform specific QTI packages can be uploaded to the platform directly.
The video and instructions below will guide you through the process of using the R exams package to create exam question packages that can be uploaded to platforms like Canvas or TestVision.
Instructional vidoe
Create packages
In the ShareStats itembank it is possible to downlodad the ZIP Folder with all the raw files for each question. When you unpack the zip you will have a folder containing the item .Rmd
file, and data or image files.
We recommend to create a folder your items set this to your working directory and save the extracted ZIP folders in there. In this folder you can ad an R file with the code below to compile the items for uploading.
For compiling the items you can use the exams2ans, exams2testvision, exams3canvas
, or any of the other exams2...
funcions from the exams package. It is also possible to compile items to word or PDF documents using the ‘exams2word’ or exams2pdf
fundions. Make sure to first install the exams package to R if you do not have it installed already.
You can use the script below to compile a question. Note that you can also download multiple questions and combine them to upload multiple questions at once to canvas.
library("exams")
# Add file path to list. Multiple paths can be added here list("path1.rmd", "path2.rmd")
<- list("itemFolder1/itemFile1.rmd")
file.paths
# Create preview
exams2html(file.paths)
# Set directory where you want to store the .zip package that will be created
<- getwd()
directory
# Create Canvas package
exams2canvas(file.paths,
dir = directory,
name = "exam_name")
library("exams")
# Add file path to list. Multiple paths can be added here list("path1/file1.rmd", "path2/file2.rmd")
<- list("itemFolder1/itemFile1.rmd",
file.paths "itemFolder2/itemFile2.rmd",
"itemFolder3/itemFile3.rmd")
# Create preview
exams2html(file.paths)
# Set directory where you want to store the .zip package that will be created
<- getwd()
directory
# Create Canvas package
exams2canvas(file.paths,
dir = directory,
name = "exam_name")
The newly created .zip
file can be uploaded to Canvas as described in the video above.