Skip to contents

This R markdown "output format" creates a Canvas Classic Quiz based on the currently active Rmd file. The body of the quiz file becomes the "description" of the quiz, and one question gets added to the Canvas quiz based on each question file specified in the questions field in the YAML header. To use this output format, specify output: examiner::canvas at the top level of the quiz file's YAML header.

Usage

canvas(...)

Arguments

...

Quiz settings from the sub-options of the output YAML field, passed through by rmarkdown::render().

Value

Output format object created by rmarkdown::output_format()

Details

You can specify quiz settings as sub-options to the output field like so:

output:
  examiner::canvas:
    time_limit: 2         # minutes
    allowed_attempts: -1  # unlimited

The settings above would translate to quiz[time_limit] and quiz[allowed_attempts]. The available settings are detailed in the Canvas documentation: Create a quiz.

For compatibility with WISEflow "items" (sections), the questions field in the YAML header of the quiz Rmd file can have either of two formats:

questions:
  - question_one.Rmd
  - question_two.Rmd

or

questions:
  First section:
    - question_one.Rmd
    - question_two.Rmd
  Second section:
    - question_three.Rmd

In the bottom example, the Canvas quiz will have the text "First section" and "Second section" as a text_only_question before their respective questions.