Create a true-or-false question
torf(answer)
Logical value TRUE or FALSE, corresponding to the correct answer.
A character string with HTML code to generate a pull-down menu with elements TRUE and FALSE.
Writes html code that creates an option box widget with TRUE or FALSE as alternatives. Call this function inline in an RMarkdown document. See the Web Exercises RMarkdown template for further examples.
# True or False? 2 + 2 = 4
torf(TRUE)
#> [1] "<select class='webex-select'><option value='blank'></option><option value='answer'>TRUE</option><option value=''>FALSE</option></select>"
# True or False? The month of April has 31 days.
torf(FALSE)
#> [1] "<select class='webex-select'><option value='blank'></option><option value=''>TRUE</option><option value='answer'>FALSE</option></select>"