ORKMultipleValuePickerAnswerFormat Class Reference

Inherits from ORKAnswerFormat : NSObject
Declared in ORKAnswerFormat.h
ORKAnswerFormat.m

Overview

The ORKMultipleValuePickerAnswerFormat class represents an answer format that lets participants use a multiple-component value picker to choose from a fixed set of text choices.

Note that the multiple value picker answer format reports itself as being of the multiple picker question type. The multiple-component value picker answer format produces an ORKMultipleComponentQuestionResult object where the index into the array matches the array of ORKValuePickerAnswerFormat objects.

For example, if the picker shows two columns with choices of [[A, B, C], [1, 2, 3, 4]] and the user picked B and 3 then this would result in componentsAnswer = [B, 3].

Other Methods

– initWithValuePickers:

Returns a multiple value picker answer format using the specified array of value pickers.

- (instancetype)initWithValuePickers:(NSArray<ORKValuePickerAnswerFormat*> *)valuePickers

Parameters

valuePickers

Array of ORKValuePickerAnswerFormat objects.

Return Value

An initialized multiple value picker answer format.

Declared In

ORKAnswerFormat.h

– initWithValuePickers:separator:

Returns a multiple value picker answer format using the specified array of value pickers.

- (instancetype)initWithValuePickers:(NSArray<ORKValuePickerAnswerFormat*> *)valuePickers separator:(NSString *)separator

Parameters

valuePickers

Array of ORKValuePickerAnswerFormat objects.

separator

String used to separate the components

Return Value

An initialized multiple value picker answer format.

Declared In

ORKAnswerFormat.h

  valuePickers

An array of value pickers that represent the options to display in the picker. (read-only)

@property (copy, readonly) NSArray<ORKValuePickerAnswerFormat*> *valuePickers

Declared In

ORKAnswerFormat.h

  separator

A string used to define the separator for the format of the string. Default = “ ”.

@property (copy, readonly) NSString *separator

Declared In

ORKAnswerFormat.h

Other Methods

– validateParameters

Validates the parameters of the answer format to ensure that they can be displayed.

- (void)validateParameters

Discussion

Typically, this method is called by the validation methods of the owning objects, which are themselves called when a step view controller that contains this answer format is about to be displayed.

Declared In

ORKAnswerFormat.h

– questionType

The type of question. (read-only)

- (ORKQuestionType)questionType

Discussion

You can use this enumerated value in your Objective-C code to switch on a rough approximation of the type of question that is being asked.

Note that answer format subclasses override the getter to return the appropriate question type.

Declared In

ORKAnswerFormat.h