This is a convenience function that allows you to add an answer option to a question object.

add_answer_option_to_question(question, ...)

Arguments

question

The limonaid Question object

...

Options that are passed on to the Question's add_answer_option() method.

Value

The question object.

Examples

myQuestion <-
  limonaid::Question$new(
    code = 'myQuestion',
    type='radio'
  ) |>
  add_answer_option_to_question(
    code = 1,
    optionTexts = "First option"
  ) |>
  add_answer_option_to_question(
    code = 2,
    optionTexts = "Second option"
  );