50% off | Unlimited Data & AI Learning

Last chance! 50% off unlimited learning

Sale ends in


exams (version 2.0-1)

exams_skeleton: Generate Skeleton for Exams Directory/Script

Description

Generate a directory structure which contains a demo.R script along with directories containing all available demonstation exercise .Rnw files and necessary template files (LaTeX, HTML, or XML).

Usage

exams_skeleton(dir = ".",
  type = c("num", "schoice", "mchoice", "cloze", "string"),
  writer = c("exams2html", "exams2pdf", "exams2moodle", "exams2qti12"),
  absolute = FALSE, encoding = "")

Arguments

dir
character with path to directory. The default is the current working directory.
type
character vector indicating types of exercises that should be included in the demo.R script. By default an example for each type of exercise is included.
writer
character vector indicating the exams2xyz writer functions that should be included in the demo.R script. By default an example for each type of writer is included.
absolute
logical. Should the paths in the demo.R script be absolute? The default is to use relative paths.
encoding
character specifying the encoding to be used in the exams2xyz writer functions.

Value

  • exams_skeleton returns a character vector with the demo.R code invisibly.

Details

exams_skeleton (or equivalently exams.skeleton) creates a directory with a demo.R script illustrating the use of the various exams2xyz interfaces. Subdirectories with copies of all demonstration exercise .Rnw files and templates for different output formats (LaTeX, HTML, or XML) are also created. This should provide a starting point for users wishing to start their own collection of exercises with exams. The encoding is not used by default. In principle, it can be set to any value that Sweave can work with in the current locale. If set to "UTF-8" (or "utf8"), or "ISO-8859-1" (or "latin1"), or "ISO-8859-15" (or "latin9"), the LaTeX and/or HTML templates are adapted accordingly. For other encodings the templates may need further touch-ups.

See Also

exams2html, exams2pdf, exams2moodle, exams2qti12

Examples

Run this code
## output directory (replace this with "/path/to/your/directory")
mydir <- file.path(tempdir(), "myexam")

## create exams skeleton with absolute paths in demo.R
exams_skeleton(dir = mydir, absolute = TRUE)

## look at created files
dir(mydir)
dir(mydir, recursive = TRUE)

## now open demo.R in your favorite R code editor
## and run the examples...

Run the code above in your browser using DataLab