Skip to contents

The url_prefix and remote_dir arguments are only needed if your question includes images. See move_images for details on how these parameters work.

Usage

wiseflow_export_assignment(
  title,
  sections,
  filename,
  info_page = NULL,
  ignore_images = FALSE,
  default_shuffle = TRUE,
  add_question_number = FALSE,
  url_prefix = NULL,
  remote_dir = NULL,
  abstain = NULL,
  penalty = NULL
)

Arguments

title

Title of the assignment.

sections

Named list of character vectors specifying the assignment's sections (called "items" in WISEflow): sections$section_title_1[i] is the .Rmd file name for question i in the item titled "section_title_1". For compatibility with Canvas, sections can also be just a character vector, in which case it's placed in a section called "Item 1".

filename

Name of generated file, ending in .json.

info_page

String of html for information page.

ignore_images

Set this to TRUE to not copy generated or local images to a web server. Any such images will appear broken on import, and you must manually replace them.

default_shuffle

Whether to set shuffle=TRUE for questions if the setting is not stated. Default TRUE. Note that WISEflow and Canvas both default to FALSE.

add_question_number

Whether to prepend "Question 1" etc to each question (WISEflow does not offer a global numbering).

url_prefix

URL to root path on server, e.g. https://example.org/~user/doc

remote_dir

Optional scp destination path, e.g. user@server.example.org:~/public_html/doc

abstain

Text for an optional extra option (!) like "I wish to leave this question unanswered". Relevant where the exam system does not allow a test-taker to unselect all options.

penalty

penalty=TRUE is a synonym for abstain=TRUE. If both abstain and penalty are given, abstain takes precedence.

Value

Invisibly, the R list which was converted to JSON and saved to file.

Examples

if (FALSE) { # \dontrun{
sections <- list(
    "B is first" = c("question_type/multiple_choice_question.Rmd"),
    "A is second" = "ÆØÅ.Rmd"
)
wiseflow_export_assignment("Test", sections, "test_assignments.json", default_shuffle = TRUE)
} # }