Render an RMD/xml file or rqti-object as qti xml with QTIJS
Source:R/knit_functions.R
render_qtijs.Rd
Generates the qti xml file via rmd2xml. The xml is copied into the QTIJS folder of the package which transforms the xml into HTML. Finally, the HTML is displayed and the user can have a preview of the exercise or exam.
Arguments
- input
(the path to the input Rmd/md/xml document or AssessmentItem, AssessmentTest, AssessmentTestOpal, AssessmentSection object)
- preview_feedback
A boolean value; optional. Set
TRUE
value to always display a model feedback (for example, as a model answer). Default isFALSE
.- ...
required for passing arguments when knitting
Details
Requires a running QTIJS server, which can be started with start_server(). When loading the package rqti, a server is started automatically.
The preview is automatically loaded into the RStudio viewer. Alternatively you can just open the browser in the corresponding local server which is displayed when rendering. Since the function is supposed to be called via the Knit-Button in RStudio, it defaults to the RStudio viewer pane.
Customize knit function in the Rmd file using the following YAML
setting after the word knit knit: rqti::render_qtijs
.
Examples
if (FALSE) { # interactive()
file <- system.file("exercises/sc1.Rmd", package='rqti')
render_qtijs(file)
}