MultipleChoiceSelection
public struct MultipleChoiceSelection : Answer
-
Index representing the selected choice
Declaration
Swift
public let value: Int
-
Identifier of the
Question
Declaration
Swift
public let questionId: String
-
Identifier of the selected
Choice
Declaration
Swift
public private(set) var codedValue: String
-
Initializes a
MultipleChoiceSelected
given the index of the selected choice as well as theQuestion
it answers.- value: Index of the selected
Choice
question: The
Question
this answers
Throws
AnswerError.unacceptable
if the question is not a multiple choice type or if the index is out of boundsDeclaration
Swift
public init(_ value: Int, question: Question) throws
Return Value
A
MultipleChoiceSelection
representing anAnswer
to a multiple choice type question - value: Index of the selected