ORKTextChoiceAnswerFormat Class Reference
| Inherits from | ORKAnswerFormat : NSObject |
|---|---|
| Declared in | ORKAnswerFormat.h ORKAnswerFormat.m |
Overview
The ORKTextChoiceAnswerFormat class represents an answer format that lets participants choose
from a fixed set of text choices in a multiple or single choice question.
The text choices are presented in a table view, using one row for each answer.
The text for each answer is given more prominence than the detailText in the row, but
both are shown.
The text choice answer format produces an ORKChoiceQuestionResult object.
Other Methods
– initWithStyle:textChoices:
Returns an initialized text choice answer format using the specified question style and array of text choices.
- (instancetype)initWithStyle:(ORKChoiceAnswerStyle)style textChoices:(NSArray<ORKTextChoice*> *)textChoicesParameters
style |
The style of question, such as single or multiple choice. |
|---|---|
textChoices |
An array of |
Return Value
An initialized text choice answer format.
Declared In
ORKAnswerFormat.h
style
The style of the question (that is, single or multiple choice).
@property (readonly) ORKChoiceAnswerStyle styleDeclared In
ORKAnswerFormat.h
textChoices
An array of ORKTextChoice objects that represent the choices that are displayed to participants.
@property (copy, readonly) NSArray<ORKTextChoice*> *textChoicesDiscussion
The choices are presented as a table view, using one row for each answer.
The text for each answer is given more prominence than the detailText in the row, but
both are shown.
Declared In
ORKAnswerFormat.h
Other Methods
– validateParameters
Validates the parameters of the answer format to ensure that they can be displayed.
- (void)validateParametersDiscussion
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)questionTypeDiscussion
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