Skip to contents

This R markdown "output format" creates a Canvas New 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 New Quiz based on each question file specified in the questions field in the YAML header. To use this output format, specify output: examiner::canvas_new_quiz at the top level of the quiz file's YAML header.

Usage

canvas_new_quiz(...)

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_new_quiz:
    points_possible: 100
    quiz_settings:
      shuffle_questions: true
      has_time_limit: true
      session_time_limit_in_seconds: 120
      multiple_attempts:
        multiple_attempts_enabled: true
        attempt_limit: true
        max_attempts: 3
        score_to_keep: highest

The settings above would translate to:

  • quiz[points_possible]

  • quiz[quiz_settings][shuffle_questions]

  • quiz[quiz_settings][has_time_limit]

  • quiz[quiz_settings][session_time_limit_in_seconds]

  • quiz[quiz_settings][multiple_attempts][multiple_attempts_enabled]

  • quiz[quiz_settings][multiple_attempts][attempt_limit]

  • quiz[quiz_settings][multiple_attempts][max_attempts]

  • quiz[quiz_settings][multiple_attempts][score_to_keep]

The available settings are detailed in the Canvas documentation: Create a new quiz.

You can also provide Classic Quiz options, which are simpler but fewer, and they will be translated to the New Quizzes system if possible. See ?canvas for an example.

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 New Quiz will have the text "First section" and "Second section" as a text_only_question before their respective questions.