The function aims to facilitate converting an existing TestVision question to an R/exams exercise.
The resulting exercise file can subsequently be edited further, e.g., for making it dynamic.
The function takes a TestVision XML question and converts it into an R/Markdown (Rmd) or
R/LaTeX (Rnw) R/exams exercise. If markup = "latex"
the HTML answers and questions from the TestVision XML
are converted using pandoc (via pandoc_convert
). Similarly, if markup = "markdown"
pandoc converts the content to markdown, but when rawHTML = TRUE
the function simply copies the HTML
content from the TestVision XML (equations are stored within <math> tags
). In the latter case, if conversion
aims at creating dynamic exercises and displaying equations, it is advised to select and adjust the content in the
<annotation>
tag which is a raw latex specification of the equation. It is recommended to check the outcome
in case certain HTML markup, or mathematical equations, etc., cannot be converted fully automatically.
Currently only the TestVision XML exercise types 'invul (numeriek)', 'een-uit-meer', 'meer-uit-meer', and 'open'
are properly supported. There is not yet support exercises of type cloze, in TestVision called 'invul
(meervoudig)'. Hence, in case of cloze questions the execution of the function is stopped and a
warning is issued.
The TestVision XML may contain links to media content such as data files and images. In the zip-file
that TestVision produces such files are typically stored in the directory 'mediafiles'; the function assumes
that the TestVision XML file and this directory (and its subdirectories with full content) are unzipped in
the same directory. If media files cannot be found a warning is issued.
Since TestVision uses a single XML file for each question, it may be cumbersome to run the function for each
question separately, and it advised to use iteration to convert questions in batch.