Create a Question Bank with realizations of a library(exams) Rmd file using Canvas LMS API.
Source:R/canvas.R
canvas_create_dynamic_bank.Rd
Banks are titled by the Rmd file name without extension, followed by a hex hash. The hash is based on the file contents, so the bank will be regenerated if the file changes.
Arguments
- rmd
Question file. The filename before .Rmd is used for the question bank title.
- n
Number of realizations to generate.
- abstain
Optional text for a zero-score answer alternative like "I wish to leave this question unanswered". This is relevant where wrong answers give a negative score, because Canvas offers no way to untick a radio button without selecting another.
- allow_dups
Allow duplicate answer alternatives (default FALSE). This catches problems where answer alternatives print identically after roundoff. You might occasionally want to enable duplicate options for comic effect: What's the magic word? 🔘 git 🔘 git 🔘 git
- force
If TRUE, recreate the bank even if it already exists. If FALSE (default), return URL to existing bank if one exists for the given file and contents with at least n realizations.
Details
If a matching bank with at least n realizations exists, and force=FALSE (default), the URL to the existing bank will be returned, saving much time.
Examples
if (FALSE) { # \dontrun{
rmd <- system.file("multiple_choice_question_random.Rmd", package = "examiner", mustWork = TRUE)
canvas_create_dynamic_bank(rmd, 2)
} # }