View source: R/exams2webquiz.R
exams2webquiz | R Documentation |
The exams2webquiz
function is a convenience tool that sets up an
R/Markdown document embedding R/exams exercises in a (temporary) directory
and directly rendering it to an HTML page.
exams2webquiz(file, n = 1L, nsamp = NULL, dir = NULL,
name = "webquiz", title = "R/exams quiz", browse = TRUE, edir = NULL,
..., clean = TRUE, quiet = TRUE, envir = parent.frame())
webquiz(...)
file |
character. A specification of (a list of) exercise files. |
n |
integer. The number of copies to be taken from |
nsamp |
integer. The number(s) of exercise files sampled from each
list element of |
dir |
character. A path in which the tutorial file is created, by default
chosen as a |
name |
character. A name prefix for the resulting .Rmd document. |
title |
character. Title of the quiz. |
browse |
logical. Should the resulting tutorial be displayed using
|
edir |
character. The path of the directory (along with its
sub-directories) in which the files in |
... |
arguments passed to |
clean , quiet , envir |
arguments passed to |
exams2webquiz
is a convenience function that sets up a .Rmd
document (in a temporary directory by default) and then calls render
from rmarkdown to quickly try out the quiz interactively.
webquiz
is a small wrapper function that creates an
html_document
but includes some custom CSS and
Javascript for the quiz display and user interactions. The idea and
original code is adapted from the webexercises package, authored
by Dale Barr and Lisa DeBruine.
For full customization it is recommended to set up a dedicated .Rmd file
within which exams2forms
can be used to include
R/exams exercises.
Invisible character vector containing the path of the Rmd document and rendered HTML file, respectively.
exams2forms
,
render
## Not run:
## quickly render a quiz based on a set of R/exams exercises
ex <- c("swisscapital.Rmd", "capitals.Rmd", "fruit.Rmd", "function.Rmd", "lm2.Rmd")
exams2webquiz(ex)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.