exams.forge
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"
.
html_e2m(
exam,
name = NULL,
pattern = ".",
mathjax = TRUE,
browseURL = TRUE,
overwrite = FALSE,
header = 2,
merge = list(questionlist = "
"),
png = TRUE
)toHTML_XML(
exam,
name = NULL,
pattern = ".",
mathjax = TRUE,
browseURL = TRUE,
overwrite = FALSE,
header = 2,
merge = list(questionlist = "
"),
png = TRUE
)
Invisibly, the names of listed elements in the HTML file.
list: returns a list from exams.forge
character: name of the HTML file (default: NULL
)
character: string containing a regular expression to match the list elements (default: .
)
logical: should MathJax be loaded? (default: TRUE
)
logical: should the generated HTML be shown? (default: TRUE
)
logical: should the HTML file be overwritten (if it exists)? (default: FALSE
)
integer: at which level of the list a <h2>...</h2>
element should be included? (default: 2
)
list: should elements with .XXXXnn
at the end be merged? (default: list('questionlist'="<br>")
)
logical: if a entry ends with .png
then the function will try to embed the PNG in the output
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.
if (interactive()) {
resexams <- readRDS(system.file("xml", "klausur-test.rds", package="exams.moodle"))
html_e2m(resexams) # opens HTML file into browser
}
Run the code above in your browser using DataLab