exams2mylearn: Exam Generation for the 'MyLearn' Platform

Description Usage Arguments Value Note Examples

Description

The 'MyLearn' distance learning and teaching platform has a special XML format. exams2mylearn transforms input files in the R/exams format to XML files and zips them. The resulting zip file can be directly uploaded to the 'MyLearn' platform.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
exams2mylearn(
  filename,
  n,
  dir,
  tdir = NULL,
  name = NULL,
  outfile = NULL,
  dontask = !base::interactive(),
  distort.shortname = FALSE,
  ...
)

Arguments

filename

(character) absolute or relative path to the exercise template. Usually simply a file name pointing at a .Rmd file in the working directory

n

(integer) number of random variants to create

dir

(character) output directory, will be created if non-existent

tdir

(character, optional) temporary directory; will use tempdir() if unspecified

name

(character, optional) unique name prefix of temporary and output files, defaults to filename without the non-alphabetic characters

outfile

(character, optional) output file name (not a path), defaults to name.zip

dontask

(logical, optional) if TRUE and the output zip file exists then

distort.shortname

(logical, optional) should the shortname include a random ending? Defaults to FALSE

...

forwarded to exams2html

Value

If dir is invalid or unspecified, the function returns with an error. Otherwise the function produces a zip file in directory dir. The exact path to the zip file is returned invisibly.

Note

The development team has to turn on the upload functionality on a per course basis.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Get the examples provided with the package
ex_files <- example_paths()
if (interactive()) {
  # Produce 40 exam questions in the currect directory
  #   using the example that contains a plot; the
  #   output is "final_exam.zip", and we want to
  #   distort the shortname used by 'MyLearn'
  exams2mylearn(ex_files["plot"], 40, dir = ".",
                outfile = "final_exam_question_1.zip",
                distort.shortname = TRUE)
}

# For special characters, please check
?special_characters

# Takes some time:
## Not run: 
# Produce 500 exam questions in the current
#   directory using a different example with more
#   verbose output from exams::exams2html
exams2mylearn(ex_files["single_choice"], 500,
              dir = ".", name = "final_exam_question_1",
              verbose = TRUE)

## End(Not run)

exams.mylearn documentation built on April 20, 2021, 1:05 a.m.