RPNavigableOrderedTask
The RPNavigableOrderedTask class adds conditional step navigation to the behavior inherited from the RPOrderedTask class. It's able to show different questions based on previous answers by using RPStepNavigationRules. This task allows participant to go back to/looping through previous questions. In that case only the last answer given to the question will be saved.
- Inheritance
-
- Object
- Serializable
- RPTask
- RPOrderedTask
- RPNavigableOrderedTask
- Annotations
-
- @JsonSerializable(includeIfNull: false, explicitToJson: true)
Constructors
RPNavigableOrderedTask.fromJson
RPNavigableOrderedTask
Properties
fromJsonFunction
The function which can convert a JSON string to an object of this type.
stepNavigationRules
A dictionary of step identifier Strings and their corresponding navigation rule(RPStepNavigationRule).
Methods
getStepAfterStep
- RPStep? step,
- RPTaskResult? result
Returns the step after a specified step if there's any, taking the RPStepNavigationRules into consideration. If the specified step is null then it returns the first step. Returns null if step was the last one in the sequence.
navigationRuleForTriggerStepIdentifier
Returns the navigation rule for the given step identifier
removeNavigationRuleForTriggerStepIdentifier
Removes the navigation rule from the given step using its identifier
setNavigationRuleForTriggerStepIdentifier
Adds a navigation rule to a step using its identifier.
RPNavigableOrderedTask navigableSurveyTask = RPNavigableOrderedTask(
"NavigableTaskID",
[
instructionStep,
questionStep1,
questionStep2,
],
)
..setNavigationRuleForTriggerStepIdentifier(someNavigationRule, questionStep1.identifier);
toJson
Return a JSON encoding of this object.