     override public func jsonSerializedAnswer() -> AnswerKeyAndValue? {
         guard let answer = self.numericAnswer else { return nil }
         return AnswerKeyAndValue(key: "numericAnswer", value: answer.jsonObject())
+    }
+    
+    override func resultAsDictionary() -> NSMutableDictionary {
+        let choiceQuestionResult = super.resultAsDictionary()
+        if let unit = self.unit {
+            choiceQuestionResult[NumericResultUnitKey] = unit
+        }
+        return choiceQuestionResult
     }
 }
 

    func jsonSerializedAnswer() -> AnswerKeyAndValue?
}

extension ORKQuestionResult: ORKQuestionResultAnswerJSON {
    
    override func resultAsDictionary() -> NSMutableDictionary {
        let choiceQuestionResult = super.resultAsDictionary()
        choiceQuestionResult[QuestionResultQuestionTypeKey] = self.questionType.rawValue
        choiceQuestionResult[QuestionResultUserInfoKey] = self.userInfo
        if let answer = self.jsonSerializedAnswer() {
            choiceQuestionResult[answer.key] = answer.value
            
            // suspenders AND a belt: surveys apparently always expect the key "answer" regardless of question result subtype
            choiceQuestionResult[SurveyAnswerKey] = answer.value
        }
        return choiceQuestionResult
    }


import ResearchKit

private let kStartDateKey = "startDate"
private let kEndDateKey = "endDate"
private let kIdentifierKey = "identifier"

private let kItemKey = "item"

private let kTappingViewSizeKey = "TappingViewSize"
private let kButtonRectLeftKey = "ButtonRectLeft"
private let kButtonRectRightKey = "ButtonRectRight"
private let kTapTimeStampKey = "TapTimeStamp"
private let kTapCoordinateKey = "TapCoordinate"
private let kTappedButtonIdKey = "TappedButtonId"
private let kTappedButtonNoneKey = "TappedButtonNone"
private let kTappedButtonLeftKey = "TappedButtonLeft"
private let kTappedButtonRightKey = "TappedButtonRight"
private let kTappingSamplesKey = "TappingSamples"

private let kSpatialSpanMemoryGameStatusKey = "MemoryGameStatus"
private let kSpatialSpanMemoryGameStatusUnknownKey = "MemoryGameStatusUnknown"
private let kSpatialSpanMemoryGameStatusSuccessKey = "MemoryGameStatusSuccess"
private let kSpatialSpanMemoryGameStatusFailureKey = "MemoryGameStatusFailure"
private let kSpatialSpanMemoryGameStatusTimeoutKey = "MemoryGameStatusTimeout"

private let kSpatialSpanMemorySummaryNumberOfGamesKey = "MemoryGameNumberOfGames"
private let kSpatialSpanMemorySummaryNumberOfFailuresKey = "MemoryGameNumberOfFailures"
private let kSpatialSpanMemorySummaryOverallScoreKey = "MemoryGameOverallScore"
private let kSpatialSpanMemorySummaryGameRecordsKey = "MemoryGameGameRecords"

private let kSpatialSpanMemoryGameRecordSeedKey = "MemoryGameRecordSeed"
private let kSpatialSpanMemoryGameRecordGameSizeKey = "MemoryGameRecordGameSize"
private let kSpatialSpanMemoryGameRecordGameScoreKey = "MemoryGameRecordGameScore"
private let kSpatialSpanMemoryGameRecordSequenceKey = "MemoryGameRecordSequence"
private let kSpatialSpanMemoryGameRecordTouchSamplesKey = "MemoryGameRecordTouchSamples"
private let kSpatialSpanMemoryGameRecordTargetRectsKey = "MemoryGameRecordTargetRects"

private let kSpatialSpanMemoryTouchSampleTimeStampKey = "MemoryGameTouchSampleTimestamp"
private let kSpatialSpanMemoryTouchSampleTargetIndexKey = "MemoryGameTouchSampleTargetIndex"
private let kSpatialSpanMemoryTouchSampleLocationKey = "MemoryGameTouchSampleLocation"
private let kSpatialSpanMemoryTouchSampleIsCorrectKey = "MemoryGameTouchSampleIsCorrect"

private let QuestionResultQuestionTextKey = "questionText"
private let QuestionResultQuestionTypeKey = "questionType"
private let QuestionResultQuestionTypeNameKey = "questionTypeName"
private let QuestionResultUserInfoKey = "userInfo"
private let QuestionResultSurveyAnswerKey = "answer"

private let NumericResultUnitKey = "unit"
private let DateAndTimeResultTimeZoneKey = "timeZone"

public class ArchiveableResult : NSObject {
    public let result: AnyObject
