Parse Quiz and Other Checking Functions

Extract lines of the quiz

parse_quiz(quiz_lines, quiz_name = NULL, verbose = FALSE)

extract_quiz(quiz_lines)

Arguments

quiz_lines

A quiz's contents read in with readLines()

quiz_name

A character vector indicating the name of the quiz.

verbose

Would you like progress messages? TRUE/FALSE

Value

A list of elements, including a `data.frame` and metadata for questions

the lines of the quiz that actually contain of the content of the quiz.

Examples


quiz_lines <- c(
  "{quiz, id: quiz_00_filename}",
  "### Lesson Name quiz",
  "{choose-answers: 4}",
  "? What do you think?",
  "",
  "C) The answer to this one",
  "o) Not the answer",
  "o) Not the answer either",
  "C) Another correct answer",
  "m) Mandatory different answer",
  "",
  "{/quiz}"
)
quiz_specs <- parse_quiz(quiz_lines)
check_quiz_attributes(quiz_specs)
#> [1] "good"