check_question: Create check-fields and check-boxes for 'rmarkdown'

Description Usage Arguments Value Author(s) Examples

View source: R/check_question.R

Description

Create check-fields and check-boxes for 'rmarkdown'

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
check_question(
  answer,
  right = "Correct",
  wrong = "I have a different answer",
  options = NULL,
  type = "select",
  alignment = FALSE,
  button_label = "check",
  random_answer_order = FALSE,
  question_id = sample(1:1e+05, 1)
)

Arguments

answer

correct answer (can be a double or a string). It is possible to put here a vector of several answers.

right

form reaction on right answer

wrong

form reaction on wrong answer

options

vector of values for the selection list type

type

character that defines type of the list. Possible values: select, radio, checkbox

alignment

logical argument for options' alignment: vertical if TRUE, horizontal if FALSE

button_label

character value that will be displayed on the button

random_answer_order

logical argument that denotes whether answers should be shuffled

question_id

unique identidier of the question

Value

returns the html and javascript code

Author(s)

George Moroz <agricolamz@gmail.com>

Examples

1
2
3
# ```{r, results='asis', echo=FALSE}
# check_question(answer = 5)
# ```

agricolamz/checkdown documentation built on Nov. 12, 2020, 4:43 p.m.