Navigable ordered tasks
In Chapter 3, Building Surveys, we looked at creating simple surveys using ORKOrderedTask
. This method is sufficient to convert most of the paper surveys to a ResearchKit app. However, the advantage of presenting a clinical survey on the phone is that we can adapt the survey based on the responses for the previous questions. For example, in a smoking habits survey, when the user answers that they does not smoke, the survey can choose not to ask how many cigarettes do they smoke per day. The ORKNavigableOrderedTask
allows you to adapt the questions based on the answers the user chooses.
The ORKNavigableOrderedTask
is a subclass of ORKOrderedTask
and it adds conditional step navigation to the ordered tasks. We can add conditional steps in ORKNavigableOrderedTask
by attaching the navigation rules to the specific steps. There are two types of navigation rules, as follows:
Navigation rules with predicates are represented by the
ORKPredicateStepNavigationRule
class. They...