RPStep
The base class for steps which can compose a task.
Each RPStep object represents one logical piece of data entry or activity in a larger task. Whether your app is giving instructions, presenting a form or survey, obtaining consent, or running an active task, everything in the Research Package framework is a collection of steps (RPStep objects), which together form a task (an RPTask object)
- Inheritance
-
- Object
- Serializable
- RPStep
- Implementers
- Annotations
-
- @JsonSerializable(includeIfNull: false, explicitToJson: true)
Constructors
RPStep.fromJson
RPStep
Create a RPStep object with a unique identifier, a title, and a text to be displayed.
Properties
footnote
Optional footer text to be displayed below the question. This can be used to provide additional information, such as copyright, or instructions. This text will be displayed in a smaller font size.
fromJsonFunction
The function which can convert a JSON string to an object of this type.
identifier
A unique identifier of the Step. This identifier connects the step to its result (RPResult) object.
nextButtonText
Text for the button that advances past this step.
May be a localization key or a literal — anything the localizations do not recognise is shown as-is.
When null the task-wide RPUITask.nextButtonText is used, which in turn falls back to the localized 'NEXT' key. Set this for steps whose forward action reads better as something specific, e.g. "Start Practicing".
optional
Can this step be skipped? If so, the result for the step will be null.
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.
text
The text of the Step. Different types of Steps are using the text text differently.
For e.g. the text of RPCompletionStep is rendered in the middle of the screen while the RPQuestionStep does not even use it.
timer
title
The title text. Different types of Steps are using the title text differently.
For e.g. the title of RPCompletionStep is rendered in the middle of the screen while the title of an RPQuestionStep is the text of the actual question.
Methods
toJson
Return a JSON encoding of this object.