exams2canvas {exams} | R Documentation |
Generation of Exams for Canvas
Description
Automatic generation of exams in QTI 1.2 with some tweaks (still under development) for the learning management system Canvas.
Usage
exams2canvas(file, n = 1L, dir = ".", name = "canvasquiz",
maxattempts = 1, duration = NULL, points = NULL,
converter = NULL, template = "canvas_qti12.xml",
quiztype = "assignment", ...)
Arguments
file |
character. A specification of a (list of) exercise files. |
n |
integer. The number of copies to be compiled from |
dir |
character. The default is the current working directory. |
name |
character. A name prefix for resulting exercises and ZIP file. |
maxattempts |
integer. The maximum attempts for one question
(must be smaller than |
duration |
integer. Set the duration of the exam in minutes. |
points |
integer. How many points should be assigned to each exercise? Note that this
argument overules any exercise points that are provided within an |
converter |
character passed on to |
template |
character. The IMS QTI 1.2 template that should be used. |
quiztype |
character. The type of quiz that should be created in Canvas.
Defaults to |
... |
arguments passed on to |
Details
exams2canvas
is a convenience interface to exams2qti12
for generating QTI 1.2 with some small tweaks for Canvas
(https://www.instructure.com/canvas). The supported exercise types at the
moment are num, schoice, mchoice, and string. There is limited support for cloze exercises
with multiple dropdown menus, i.e., schoice elements placed in the text with ANSWERi tags.
The Canvas-specific tweaks include:
Canvas necessitates a
converter
that produces HTML plus MathML. Thus,"pandoc-mathml"
(or equivalently"pandoc"
) can be used or alternatively"ttm"
for exams with only R/LaTeX .Rnw exercises.Supplementary files (images, data, ...) must be embedded without Base 64 encoding. Thus,
base64 = FALSE
is hard-coded internally inexams2canvas
.Multiple-choice exercises (referred to as multiple answer questions in Canvas) are always evaluated (aka scored) with partial credits in Canvas. Therefore,
eval = list(partial = TRUE, negative = FALSE)
is hard-coded internally inexams2canvas
. Negative points are not supported in Canvas.The QTI XML file requires a few special tags which are enforced through
flavor = "canvas"
inexams2qti12
.
Technical note: For multiple-choice questions the QTI XML file produced by
exams2canvas
appears to encode an “all-or-nothing” scheme without partial
credits (i.e., partial = FALSE
). However, this is necessary for Canvas to recognize
the answer alternatives correctly. Despite this, Canvas always applies partial-credit
evaluation (as explained above).
Value
exams2canvas
returns a list of exams as generated by xexams
.
See Also
Examples
## load package and enforce par(ask = FALSE)
library("exams")
options(device.ask.default = FALSE)
## define an exams (= list of exercises)
myexam <- c(
"boxplots.Rmd",
"tstat.Rmd",
"ttest.Rmd",
"regression.Rmd",
"relfreq.Rmd"
)
## output directory
dir.create(mydir <- tempfile())
## generate .zip with Canvas test in temporary directory
exams2canvas(myexam, n = 3, dir = mydir)
dir(mydir)