Skip to contents

This function lets you quickly check that all question Rmd files work as intended. It is a faster alternative to actually adding questions to a WISEflow assignment or Canvas quiz. In an interactive session it will open the report in a web browser.

Usage

knit_all(rmds, filename = "test_knit.html", description = "")

Arguments

rmds

Either a character vector of one Rmd file name per question, or a named list of character vectors, where the top-level names represent WISEflow sections. (Canvas does not have sections within quizzes.)

filename

Name of the HTML file compiling the rendered question documents.

description

Optional description text for quiz, shown at the top of the quiz.

Value

filename returned invisibly.

Details

Rmd files that fail to knit are represented by an eye-catching error notification. Your next step is the usually to open the Rmd file and try to knit it separately, to figure out what's going wrong.

For speed and small size, questions are rendered with minimal theming. (rmarkdown::render(input, output_format = "html_fragment")). To support math rendering, JavaScript for MathJax is included.

Examples

if (FALSE) { # \dontrun{
rmds <- system.file(c("multiple_choice_question.Rmd",
                      "multiple_choice_question_random.Rmd"),
                    package = "examiner")
knit_all(rmds)
rmds_list <- list("First section" = rmds,
                  "Second section" = system.file("xhtml-features.Rmd", package = "examiner"))
knit_all(rmds_list)
} # }