QuantityAnswer

public struct QuantityAnswer : Answer

Answer to a quantity type Question

  • The number that was selected

    Declaration

    Swift

    public let value: Int
  • The identifier of the Question

    Declaration

    Swift

    public let questionId: String
  • The string represntation of the number

    Declaration

    Swift

    public var codedValue: String { get }
  • Initializes a QuantityAnswer given the number and Question

    • value: The number represnting the answer
    • question: The Question this answers

    Throws

    AnswerError.unacceptable if the question is not a quantity type or if the number is less than 0

    Declaration

    Swift

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

    Return Value

    A QuantityAnswer representing an Answer to the quantity type question