html_e2m {exams.forge}R Documentation

HTML exams.forge

Description

Creates an HTML page with all the contents of the XML tags whose names match pattern.

The default is to show the contents of all XML tags. The HTML page is stored in the HTML file name.

The default name=NULL creates a temporary file. If the name does not end in .html, then a .html is appended.

If browseURL=TRUE (default) then the HTML page will be displayed in the browser.

If necessary the contents of XML tags are concatenated with "\n". For single XML tags this can be changed, e.g. merge=list("questionlist"="<br>" leads to the XML tag <questionlist>...</questionlist>) "<br>" being used ,instead of the "\n".

Usage

html_e2m(
  exam,
  name = NULL,
  pattern = ".",
  mathjax = TRUE,
  browseURL = TRUE,
  overwrite = FALSE,
  header = 2,
  merge = list(questionlist = "<br>"),
  png = TRUE
)

toHTML_XML(
  exam,
  name = NULL,
  pattern = ".",
  mathjax = TRUE,
  browseURL = TRUE,
  overwrite = FALSE,
  header = 2,
  merge = list(questionlist = "<br>"),
  png = TRUE
)

Arguments

exam

list: returns a list from exams.forge

name

character: name of the HTML file (default: NULL)

pattern

character: string containing a regular expression to match the list elements (default: .)

mathjax

logical: should MathJax be loaded? (default: TRUE)

browseURL

logical: should the generated HTML be shown? (default: TRUE)

overwrite

logical: should the HTML file be overwritten (if it exists)? (default: FALSE)

header

integer: at which level of the list a <h2>...</h2> element should be included? (default: 2)

merge

list: should elements with .XXXXnn at the end be merged? (default: list('questionlist'="<br>"))

png

logical: if a entry ends with .png then the function will try to embed the PNG in the output

Value

Invisibly, the names of listed elements in the HTML file.

See Also

The aim is similar to exams:::exams:::browse_exercise, however, html_e2m takes the information form the XML file generated by the exams.forge package.

Examples

if (interactive()) {
  resexams <- readRDS(system.file("xml", "klausur-test.rds", package="exams.moodle"))
  html_e2m(resexams) # opens HTML file into browser
}

[Package exams.forge version 1.0.10 Index]