RPActivityStep
A concrete subclass of RPStep that represents a step in which a single Activity is presented to the user.
When a Task Widget presents an RPActivityStep object, it instantiates an RPUIActivityStep object to present the step. The actual visual presentation depends on the type of RPActivityStep (e.g. RPTrailMakingActivity from the cognition_package Flutter package).
- Inheritance
-
- Object
- Serializable
- RPStep
- RPActivityStep
- Annotations
-
- @JsonSerializable(includeIfNull: false, explicitToJson: true)
Constructors
RPActivityStep.fromJson
RPActivityStep
Create a RPActivityStep.
The identifier should uniquely identify this step. The optional parameters includeInstructions or includeResults can be used exclude the non-test sections of the step.
Properties
fromJsonFunction
The function which can convert a JSON string to an object of this type.
includeInstructions
Show the instruction before the test?
You may include your own RPInstructionStep step before this activity step, if you wish to display a separate page with other instructions.
includeResults
Show the results after the test?
stepWidget
The widget (UI representation) of the step.
This gets initialized when a Activity Step has been added to a Task which is later presented by an RPUITask widget.
Methods
calculateScore
- dynamic result
Calculates the score for this activity step.
Classes extending this activity step can override this method with a custom scoring algorithm.
stepBody
- dynamic onResultChange(
- dynamic
- RPActivityEventLogger eventLogger
Initiates the UI component for an ActivityStep.
All classes extending an activity step should override this with their own UI components.
toJson
Return a JSON encoding of this object.