ORKImageChoiceAnswerFormat Class Reference
Inherits from | ORKAnswerFormat : NSObject |
---|---|
Declared in | ORKAnswerFormat.h ORKAnswerFormat.m |
Overview
The ORKImageChoiceAnswerFormat
class represents an answer format that lets participants choose
one image from a fixed set of images in a single choice question.
For example, you might use the image choice answer format to represent a range of moods that range from very sad to very happy.
The image choice answer format produces an ORKChoiceQuestionResult
object.
Other Methods
– initWithImageChoices:
Returns an initialized image choice answer format using the specified array of images.
- (instancetype)initWithImageChoices:(NSArray<ORKImageChoice*> *)imageChoices
Parameters
imageChoices |
Array of |
---|
Return Value
An initialized image choice answer format.
Declared In
ORKAnswerFormat.h
– initWithImageChoices:style:vertical:
Returns an initialized image choice answer format using the specified array of images.
- (instancetype)initWithImageChoices:(NSArray<ORKImageChoice*> *)imageChoices style:(ORKChoiceAnswerStyle)style vertical:(BOOL)vertical
Parameters
imageChoices |
Array of |
---|---|
style |
The style of question, such as single or multiple choice. |
vertical |
Pass |
Return Value
An initialized image choice answer format.
Declared In
ORKAnswerFormat.h
imageChoices
An array of ORKImageChoice
objects that represent the available choices. (read-only)
@property (copy, readonly) NSArray<ORKImageChoice*> *imageChoices
Discussion
The text of the currently selected choice is displayed on screen. The text for each choice is spoken by VoiceOver when an image is highlighted.
Declared In
ORKAnswerFormat.h
style
The style of the question (that is, single or multiple choice).
@property (readonly) ORKChoiceAnswerStyle style
Declared In
ORKAnswerFormat.h
vertical
A Boolean value indicating whether the choices are stacked vertically. (read-only)
@property (readonly, getter=isVertical) BOOL vertical
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