public class SmartSurveyTask
extends org.researchstack.backbone.task.Task
implements java.io.Serializable
Based on the user's answers to questions, they may be taken to a specific step rather than the next one in the task.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
END_OF_SURVEY_MARKER |
Constructor and Description |
---|
SmartSurveyTask(android.content.Context context,
TaskModel taskModel)
Creates a SmartSurveyTask from a
TaskModel object |
Modifier and Type | Method and Description |
---|---|
org.researchstack.backbone.task.Task.TaskProgress |
getProgressOfCurrentStep(org.researchstack.backbone.step.Step step,
org.researchstack.backbone.result.TaskResult result) |
org.researchstack.backbone.step.Step |
getStepAfterStep(org.researchstack.backbone.step.Step step,
org.researchstack.backbone.result.TaskResult result)
Returns the next step in the task based on current answers, or null if at the end.
|
org.researchstack.backbone.step.Step |
getStepBeforeStep(org.researchstack.backbone.step.Step step,
org.researchstack.backbone.result.TaskResult result)
Returns the step that should be before the current step based on current results.
|
org.researchstack.backbone.step.Step |
getStepWithIdentifier(java.lang.String identifier) |
java.lang.String |
getTitleForStep(android.content.Context context,
org.researchstack.backbone.step.Step step)
Returns the current progress String for use in the action bar
|
void |
validateParameters() |
public static final java.lang.String END_OF_SURVEY_MARKER
public org.researchstack.backbone.step.Step getStepAfterStep(org.researchstack.backbone.step.Step step, org.researchstack.backbone.result.TaskResult result)
This method rebuilds the order of the steps based on the current results and returns the next one.
getStepAfterStep
in class org.researchstack.backbone.task.Task
step
- The reference step. Pass null to specify the first step.result
- A snapshot of the current set of results.public org.researchstack.backbone.step.Step getStepBeforeStep(org.researchstack.backbone.step.Step step, org.researchstack.backbone.result.TaskResult result)
This method rebuilds the order of the remaining steps based on the current results and returns the previous one to the current step.
getStepBeforeStep
in class org.researchstack.backbone.task.Task
step
- The reference step. Pass null to specify the last step.result
- A snapshot of the current set of results.public org.researchstack.backbone.step.Step getStepWithIdentifier(java.lang.String identifier)
getStepWithIdentifier
in class org.researchstack.backbone.task.Task
public java.lang.String getTitleForStep(android.content.Context context, org.researchstack.backbone.step.Step step)
This is updated based on the current and total in the dynamic list of steps.
getTitleForStep
in class org.researchstack.backbone.task.Task
context
- for fetching resourcesstep
- the current steppublic org.researchstack.backbone.task.Task.TaskProgress getProgressOfCurrentStep(org.researchstack.backbone.step.Step step, org.researchstack.backbone.result.TaskResult result)
getProgressOfCurrentStep
in class org.researchstack.backbone.task.Task
public void validateParameters()
validateParameters
in class org.researchstack.backbone.task.Task