buildQuestion: Build a question definition from scratch.

Description Usage Arguments See Also

View source: R/question.R

Description

buildQuestion returns a question definition given the parts a fully formed question definition consists of.

Usage

1
buildQuestion(id, dataIds = id, ui, validate = NULL)

Arguments

id

(character) the unique identifier of the question; it will be used as the column name in the data.frame returning the questionnaire data and when prefixed with 'question' - as the inputId for the input slot.

dataIds

(character) the list of identifiers that should be moved from the input slot to the final data.frame.

When a question definition consists of multiple input fields, this argument needs to specify the identifiers of those fields.

ui

(list|function) a list of UI components of the question or a function that should return the UI components of the question. Use a list to build static content and a function to build dynamic content.

validate

(function) a function that should return an empty string if the entered data is valid and a non-empty string, with the validation message, if the entered data is not valid.

See Also

buildNonQuestion, question.mixed, question.multiple, question.numeric, question.single, question.text.

Other question buidling functions: makeQuestionInputId


mtrybulec/interviewer documentation built on May 23, 2019, 8:20 a.m.