MultipleChoiceSelection

public struct MultipleChoiceSelection : Answer

Answer to a Question of multiple choice type

  • 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 the Question 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 bounds

    Declaration

    Swift

    public init(_ value: Int, question: Question) throws

    Return Value

    A MultipleChoiceSelection representing an Answer to a multiple choice type question