RPQuestionStep
Represents a RPStep holding a single question to be presented to the user.
The rendering of an RPQuestionStep depends on its answerFormat. Each answer type has its own user interface widget.
If you want to present multiple questions on the same page, use an RPFormStep.
- Inheritance
-
- Object
- Serializable
- RPStep
- RPQuestionStep
- Implementers
- Annotations
-
- @JsonSerializable(includeIfNull: false, explicitToJson: true)
Constructors
RPQuestionStep.fromJson
RPQuestionStep
Creates a RPQuestionStep.
identifier is a unique id of this step, title is shown as the title of the question), and answerFormat defines the type of questionnaire, as defined in RPAnswerFormat.
Properties
answerFormat
The answer format which describes the format how a question can be answered.
autoFocus
Should the keyboard automatically be displayed when asking a text question? Applies only to RPTextAnswerFormat questions. False by default.
autoSkip
Should we automatically move to the next step after timeout seconds? False by default.
fromJsonFunction
The function which can convert a JSON string to an object of this type.
placeholder
The placeholder text for the Question Steps using an answer format which requires text entry
stepWidget
The widget (UI representation) of the step.
RPQuestionSteps don't have it because their UI representation depends on the Answer Format. Their Answer Format is assessed by RPUIQuestionStep or RPUIFormStep and they return the corresponding UI.
When needed, it should be overridden to fit the different types of Steps.
timeout
If autoSkip is true, defines how long to wait for the answer before automatically skipping to the next step.
Methods
toJson
Return a JSON encoding of this object.