| verify_qti_impl | R Documentation |
Validates an XML document against the QTI schema or the extended rqti QTI
schema. Input can be either a file path, a character string containing XML,
or an xml2::xml_document.
verify_qti_impl(
doc,
extended_schema = FALSE,
ctx = 40,
color = TRUE,
engine = c("auto", "xml2", "xmllint"),
ignore_import = TRUE,
print = TRUE,
schema = NULL
)
doc |
A QTI XML document. This can be a file path, a character string
containing XML, or an |
extended_schema |
Logical. Should the extended rqti schema be used?
Defaults to |
ctx |
Integer. Number of characters of context shown before and after
the offending XML element in printed snippets. Defaults to |
color |
Logical. Should ANSI colors be used in printed output? Defaults
to |
engine |
Character string specifying the validation backend. One of
|
ignore_import |
Logical. If |
print |
Logical. Should the validation result be printed before it is
returned? Defaults to |
schema |
Character string or |
By default, the function chooses a validation backend automatically. If
xmllint is available, the input is a file path, and the platform is not
Windows, the xmllint backend is used. Otherwise, validation falls back to
xml2.
The function returns an object of class "qti_validation_result". By
default, that object is also printed in a human-readable form.
An object of class "qti_validation_result" with components:
Logical scalar.
A list of parsed validation errors.
The backend used for validation.
## Not run:
f <- system.file("extdata", "sc1d.xml", package = "rqti")
res <- verify_qti(f)
res$valid
x <- xml2::read_xml(f)
res2 <- verify_qti(x)
summary(res2)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.