     }
 }
 
+/// Table view provider specific to an `ORKBooleanQuestionResult` instance.
+class BooleanQuestionResultTableViewProvider: ResultTableViewProvider   {
+    // MARK: ResultTableViewProvider
+    
+    override func resultRowsForSection(section: Int) -> [ResultRow] {
+        let boolResult = result as! ORKBooleanQuestionResult
+        
+        var boolResultDetailText: String?
+        if let booleanAnswer = boolResult.booleanAnswer {
+            boolResultDetailText = booleanAnswer.boolValue ? "true" : "false"
+        }
+        
+        return super.resultRowsForSection(section) + [
+            ResultRow(text: "bool", detail: boolResultDetailText)
+        ]
+    }
+}
+
+/// Table view provider specific to an `ORKChoiceQuestionResult` instance.
+class ChoiceQuestionResultTableViewProvider: ResultTableViewProvider {
+    // MARK: ResultTableViewProvider
+    
+    override func resultRowsForSection(section: Int) -> [ResultRow] {
+        let choiceResult = result as! ORKChoiceQuestionResult
+        
+        return super.resultRowsForSection(section) + [
+            ResultRow(text: "choices", detail: choiceResult.choiceAnswers)
+        ]
+    }
+}
+
+
+/// Table view provider specific to an `ORKDateQuestionResult` instance.
+class DateQuestionResultTableViewProvider: ResultTableViewProvider {
+    // MARK: ResultTableViewProvider
+    
+    override func resultRowsForSection(section: Int) -> [ResultRow] {
+        let questionResult = result as! ORKDateQuestionResult
+        
+        return super.resultRowsForSection(section) + [
+            // The date the user entered.
+            ResultRow(text: "dateAnswer", detail: questionResult.dateAnswer),
+            
+            // The calendar that was used when the date picker was presented.
+            ResultRow(text: "calendar", detail: questionResult.calendar),
+            
+            // The timezone when the user answered.
+            ResultRow(text: "timeZone", detail: questionResult.timeZone)
+        ]
+    }
+}
+
+/// Table view provider specific to an `ORKNumericQuestionResult` instance.
+class NumericQuestionResultTableViewProvider: ResultTableViewProvider {
+    // MARK: ResultTableViewProvider
+    
+    override func resultRowsForSection(section: Int) -> [ResultRow] {
+        let questionResult = result as! ORKNumericQuestionResult
+        
+        return super.resultRowsForSection(section) + [
+            // The numeric value the user entered.
+            ResultRow(text: "numericAnswer", detail: questionResult.numericAnswer),
+
+            // The unit string that was displayed with the numeric value.
+            ResultRow(text: "unit", detail: questionResult.unit)
+        ]
+    }
+}
+
 /// Table view provider specific to an `ORKScaleQuestionResult` instance.
 class ScaleQuestionResultTableViewProvider: ResultTableViewProvider {
     // MARK: ResultTableViewProvider

    }
}

/// Table view provider specific to an `ORKDateQuestionResult` instance.
class DateQuestionResultTableViewProvider: ResultTableViewProvider {
    // MARK: ResultTableViewProvider
    
    override func resultRowsForSection(section: Int) -> [ResultRow] {
        let questionResult = result as! ORKDateQuestionResult
        
        return super.resultRowsForSection(section) + [
            // The date the user entered.
            ResultRow(text: "dateAnswer", detail: questionResult.dateAnswer),

            // The calendar that was used when the date picker was presented.
            ResultRow(text: "calendar", detail: questionResult.calendar),
            
            // The timezone when the user answered.
            ResultRow(text: "timeZone", detail: questionResult.timeZone)
        ]
    }
}

/// Table view provider specific to an `ORKTimeIntervalQuestionResult` instance.
class TimeIntervalQuestionResultTableViewProvider: ResultTableViewProvider {
    // MARK: ResultTableViewProvider

    override func resultRowsForSection(section: Int) -> [ResultRow] {
        let questionResult = result as! ORKTimeIntervalQuestionResult
        
        return super.resultRowsForSection(section) + [
            // The time interval the user answered.
            ResultRow(text: "intervalAnswer", detail: questionResult.intervalAnswer)
        ]
    }
}

/// Table view provider specific to an `ORKTextQuestionResult` instance.
class TextQuestionResultTableViewProvider: ResultTableViewProvider {
    // MARK: ResultTableViewProvider

    override func resultRowsForSection(section: Int) -> [ResultRow] {
        let questionResult = result as! ORKTextQuestionResult
        
        return super.resultRowsForSection(section) + [
            // The text the user typed into the text view.
            ResultRow(text: "textAnswer", detail: questionResult.textAnswer)
        ]
    }
}

/// Table view provider specific to an `ORKChoiceQuestionResult` instance.
class ChoiceQuestionResultTableViewProvider: ResultTableViewProvider {
    // MARK: ResultTableViewProvider
    
    override func resultRowsForSection(section: Int) -> [ResultRow] {
        let choiceResult = result as! ORKChoiceQuestionResult
        
        return super.resultRowsForSection(section) + [
            ResultRow(text: "choices", detail: choiceResult.choiceAnswers)
        ]
    }
}

/// Table view provider specific to an `ORKBooleanQuestionResult` instance.
class BooleanQuestionResultTableViewProvider: ResultTableViewProvider   {
    // MARK: ResultTableViewProvider
    
    override func resultRowsForSection(section: Int) -> [ResultRow] {
        let boolResult = result as! ORKBooleanQuestionResult
        
        var boolResultDetailText: String?
        if let booleanAnswer = boolResult.booleanAnswer {
            boolResultDetailText = booleanAnswer.boolValue ? "true" : "false"
        }
        
        return super.resultRowsForSection(section) + [
            ResultRow(text: "bool", detail: boolResultDetailText)
        ]
    }
}

/// Table view provider specific to an `ORKTappingIntervalResult` instance.
class TappingIntervalResultTableViewProvider: ResultTableViewProvider {
    // MARK: UITableViewDataSource

    override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        return 2
    }

    override func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
        if section == 0 {
            return super.tableView(tableView, titleForHeaderInSection: 0)
        }
        
        return "Samples"
    }
    
    // MARK: ResultTableViewProvider
    
    override func resultRowsForSection(section: Int) -> [ResultRow] {
        let questionResult = result as! ORKTappingIntervalResult
        
        let rows = super.resultRowsForSection(section)
        
        if section == 0 {
            return rows + [
                // The size of the view where the two target buttons are displayed.
                ResultRow(text: "stepViewSize", detail: questionResult.stepViewSize),

                // The rect corresponding to the left button.
                ResultRow(text: "buttonRect1", detail: questionResult.buttonRect1),
                
                // The rect corresponding to the right button.
                ResultRow(text: "buttonRect2", detail: questionResult.buttonRect2)
            ]
        }
        
        // Add a `ResultRow` for each sample.
        return rows + questionResult.samples!.map { tappingSample in
            
            // These tap locations are relative to the rectangle defined by `stepViewSize`.
            let buttonText = tappingSample.buttonIdentifier == .None ? "None" : "button \(tappingSample.buttonIdentifier.rawValue)"
            
            let text = String(format: "%.3f", tappingSample.timestamp)
            let detail = "\(buttonText) \(tappingSample.location)"
            
            return ResultRow(text: text, detail: detail)
        }
    }
}

/// Table view provider specific to an `ORKTowerOfHanoiResult` instance.
class TowerOfHanoiResultTableViewProvider: ResultTableViewProvider {
    // MARK: UITableViewDataSource
    
    override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        let towerOfHanoiResult = result as! ORKTowerOfHanoiResult
        return towerOfHanoiResult.moves != nil ? (towerOfHanoiResult.moves!.count + 1) : 1
    }
    
    override func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
        if section == 0 {
            return super.tableView(tableView, titleForHeaderInSection: 0)
        }
        
        return "Move \(section )"
    }
    // MARK: ResultTableViewProvider
    
    override func resultRowsForSection(section: Int) -> [ResultRow] {
        let towerOfHanoiResult = result as! ORKTowerOfHanoiResult
        let rows = super.resultRowsForSection(section)
        if section == 0 {
            return rows + [
                ResultRow(text: "solved", detail: towerOfHanoiResult.puzzleWasSolved ? "true" : "false"),
                ResultRow(text: "moves", detail: "\(towerOfHanoiResult.moves?.count ?? 0 )")]
        }
        // Add a `ResultRow` for each sample.
        let move = towerOfHanoiResult.moves![section - 1] as! ORKTowerOfHanoiMove
        return rows + [
            ResultRow(text: "donor tower", detail: "\(move.donorTowerIndex)"),
            ResultRow(text: "recipient tower", detail: "\(move.recipientTowerIndex)"),
            ResultRow(text: "timestamp", detail: "\(move.timestamp)")]
    }
}

/// Table view provider specific to an `ORKToneAudiometryResult` instance.
class ToneAudiometryResultTableViewProvider: ResultTableViewProvider {
    // MARK: UITableViewDataSource

    override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        return 2
    }

    override func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
        if section == 0 {
            return super.tableView(tableView, titleForHeaderInSection: 0)
        }

        return "Samples"
    }

    // MARK: ResultTableViewProvider

    override func resultRowsForSection(section: Int) -> [ResultRow] {
        let toneAudiometryResult = result as! ORKToneAudiometryResult
        let rows = super.resultRowsForSection(section)

        if section == 0 {
            return rows + [
                // The size of the view where the two target buttons are displayed.
                ResultRow(text: "outputVolume", detail: toneAudiometryResult.outputVolume),
            ]
        }

        // Add a `ResultRow` for each sample.
        return rows + toneAudiometryResult.samples!.map { toneSample in
            let text: String
            let detail: String

            let channelName = toneSample.channel == .Left ? "Left" : "Right"
            
            text = "\(toneSample.frequency) \(channelName)"
            detail = "\(toneSample.amplitude)"

            return ResultRow(text: text, detail: detail)
        }
    }
}

/// Table view provider specific to an `ORKSpatialSpanMemoryResult` instance.
class SpatialSpanMemoryResultTableViewProvider: ResultTableViewProvider {
    // MARK: UITableViewDataSource
    
    override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        return 2
    }
    
    override func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
        if section == 0 {
            return super.tableView(tableView, titleForHeaderInSection: 0)
        }
        
        return "Game Records"
    }
    
    // MARK: ResultTableViewProvider
    
    override func resultRowsForSection(section: Int) -> [ResultRow] {
        let questionResult = result as! ORKSpatialSpanMemoryResult
        
        let rows = super.resultRowsForSection(section)
        
        if section == 0 {
            return rows + [
                // The score the user received for the game as a whole.
                ResultRow(text: "score", detail: questionResult.score),

                // The number of games played.
                ResultRow(text: "numberOfGames", detail: questionResult.numberOfGames),
                
                // The number of failures.
                ResultRow(text: "numberOfFailures", detail: questionResult.numberOfFailures)
            ]
        }
        
        return rows + questionResult.gameRecords!.map { gameRecord in
            // Note `gameRecord` is of type `ORKSpatialSpanMemoryGameRecord`.
            return ResultRow(text: "game", detail: gameRecord.score)
        }
    }
}

/// Table view provider specific to an `ORKReactionTimeResult` instance.
class ReactionTimeViewProvider: ResultTableViewProvider {
    // MARK: UITableViewDataSource

    override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        return 2
    }
    
    override func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
        if section == 0 {
            return super.tableView(tableView, titleForHeaderInSection: 0)
        }
        
        return "File Results"
    }
    
    // MARK: ResultTableViewProvider

    override func resultRowsForSection(section: Int) -> [ResultRow] {
        let reactionTimeResult = result as! ORKReactionTimeResult
        
        let rows = super.resultRowsForSection(section)
        
        if section == 0 {
            return rows + [
                ResultRow(text: "timestamp", detail: reactionTimeResult.timestamp)
            ]
        }
        
        let fileResultDetail = reactionTimeResult.fileResult.fileURL!.absoluteString
        
        return rows + [
            ResultRow(text: "File Result", detail: fileResultDetail)
        ]
    }
}

/// Table view provider specific to an `ORKTimedWalkResult` instance.
class TimedWalkResultTableViewProvider: ResultTableViewProvider {
    // MARK: UITableViewDataSource
    
    override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        return 1
    }
    
    override func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
        return super.tableView(tableView, titleForHeaderInSection: 0)
    }
    
    // MARK: UITableViewDelegate
    
    func tableView(tableView: UITableView, shouldHighlightRowAtIndexPath indexPath: NSIndexPath) -> Bool {
        return false
    }
    
    // MARK: ResultTableViewProvider
    
    override func resultRowsForSection(section: Int) -> [ResultRow] {
        let TimedWalkResult = result as! ORKTimedWalkResult
        
        let rows = super.resultRowsForSection(section)
        
        return rows + [
            // The timed walk distance in meters.
            ResultRow(text: "distance (m)", detail: TimedWalkResult.distanceInMeters),
            
            // The time limit to complete the trials.
            ResultRow(text: "time limit (s)", detail: TimedWalkResult.timeLimit),
            
            // The duration for an addition of the PVSAT.
            ResultRow(text: "duration (s)", detail: TimedWalkResult.duration)
        ]
    }
}


    }
}

/// Table view provider specific to an `ORKReactionTimeResult` instance.
class ReactionTimeViewProvider: ResultTableViewProvider {
    // MARK: UITableViewDataSource
    
    override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        return 2
    }
    
    override func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
        if section == 0 {
            return super.tableView(tableView, titleForHeaderInSection: 0)
        }
        
        return "File Results"
    }
    
    // MARK: ResultTableViewProvider
    
    override func resultRowsForSection(section: Int) -> [ResultRow] {
        let reactionTimeResult = result as! ORKReactionTimeResult
        
        let rows = super.resultRowsForSection(section)
        
        if section == 0 {
            return rows + [
                ResultRow(text: "timestamp", detail: reactionTimeResult.timestamp)
            ]
        }
        
        let fileResultDetail = reactionTimeResult.fileResult.fileURL!.absoluteString
        
        return rows + [
            ResultRow(text: "File Result", detail: fileResultDetail)
        ]
    }
}

/// Table view provider specific to an `ORKSpatialSpanMemoryResult` instance.
class SpatialSpanMemoryResultTableViewProvider: ResultTableViewProvider {
    // MARK: UITableViewDataSource
    
    override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        return 2
    }
    
    override func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
        if section == 0 {
            return super.tableView(tableView, titleForHeaderInSection: 0)
        }
        
        return "Game Records"
    }
    
    // MARK: ResultTableViewProvider
    
    override func resultRowsForSection(section: Int) -> [ResultRow] {
        let questionResult = result as! ORKSpatialSpanMemoryResult
        
        let rows = super.resultRowsForSection(section)
        
        if section == 0 {
            return rows + [
                // The score the user received for the game as a whole.
                ResultRow(text: "score", detail: questionResult.score),
                
                // The number of games played.
                ResultRow(text: "numberOfGames", detail: questionResult.numberOfGames),
                
                // The number of failures.
                ResultRow(text: "numberOfFailures", detail: questionResult.numberOfFailures)
            ]
        }
        
        return rows + questionResult.gameRecords!.map { gameRecord in
            // Note `gameRecord` is of type `ORKSpatialSpanMemoryGameRecord`.
            return ResultRow(text: "game", detail: gameRecord.score)
        }
    }
}

/// Table view provider specific to an `ORKTappingIntervalResult` instance.
class TappingIntervalResultTableViewProvider: ResultTableViewProvider {
    // MARK: UITableViewDataSource

    override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        return 2
    }

    override func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
        if section == 0 {
            return super.tableView(tableView, titleForHeaderInSection: 0)
        }
        
        return "Samples"
    }
    
    // MARK: ResultTableViewProvider
    
    override func resultRowsForSection(section: Int) -> [ResultRow] {
        let questionResult = result as! ORKTappingIntervalResult
        
        let rows = super.resultRowsForSection(section)
        
        if section == 0 {
            return rows + [
                // The size of the view where the two target buttons are displayed.
                ResultRow(text: "stepViewSize", detail: questionResult.stepViewSize),

                // The rect corresponding to the left button.
                ResultRow(text: "buttonRect1", detail: questionResult.buttonRect1),
                
                // The rect corresponding to the right button.
                ResultRow(text: "buttonRect2", detail: questionResult.buttonRect2)
            ]
        }
        
        // Add a `ResultRow` for each sample.
        return rows + questionResult.samples!.map { tappingSample in
            
            // These tap locations are relative to the rectangle defined by `stepViewSize`.
            let buttonText = tappingSample.buttonIdentifier == .None ? "None" : "button \(tappingSample.buttonIdentifier.rawValue)"
            
            let text = String(format: "%.3f", tappingSample.timestamp)
            let detail = "\(buttonText) \(tappingSample.location)"
            
            return ResultRow(text: text, detail: detail)
        }
    }
}

/// Table view provider specific to an `ORKTimedWalkResult` instance.
class TimedWalkResultTableViewProvider: ResultTableViewProvider {
    // MARK: UITableViewDataSource
    
    override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        return 1
    }
    
    override func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
        return super.tableView(tableView, titleForHeaderInSection: 0)
    }
    
    // MARK: UITableViewDelegate
    
    func tableView(tableView: UITableView, shouldHighlightRowAtIndexPath indexPath: NSIndexPath) -> Bool {
        return false
    }
    
    // MARK: ResultTableViewProvider
    
    override func resultRowsForSection(section: Int) -> [ResultRow] {
        let TimedWalkResult = result as! ORKTimedWalkResult
        
        let rows = super.resultRowsForSection(section)
        
        return rows + [
            // The timed walk distance in meters.
            ResultRow(text: "distance (m)", detail: TimedWalkResult.distanceInMeters),
            
            // The time limit to complete the trials.
            ResultRow(text: "time limit (s)", detail: TimedWalkResult.timeLimit),
            
            // The duration for an addition of the PVSAT.
            ResultRow(text: "duration (s)", detail: TimedWalkResult.duration)
        ]
    }
}

/// Table view provider specific to an `ORKToneAudiometryResult` instance.
class ToneAudiometryResultTableViewProvider: ResultTableViewProvider {
    // MARK: UITableViewDataSource
    
    override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        return 2
    }
    
    override func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
        if section == 0 {
            return super.tableView(tableView, titleForHeaderInSection: 0)
        }
        
        return "Samples"
    }
    
    // MARK: ResultTableViewProvider
    
    override func resultRowsForSection(section: Int) -> [ResultRow] {
        let toneAudiometryResult = result as! ORKToneAudiometryResult
        let rows = super.resultRowsForSection(section)
        
        if section == 0 {
            return rows + [
                // The size of the view where the two target buttons are displayed.
                ResultRow(text: "outputVolume", detail: toneAudiometryResult.outputVolume),
            ]
        }
        
        // Add a `ResultRow` for each sample.
        return rows + toneAudiometryResult.samples!.map { toneSample in
            let text: String
            let detail: String
            
            let channelName = toneSample.channel == .Left ? "Left" : "Right"
            
            text = "\(toneSample.frequency) \(channelName)"
            detail = "\(toneSample.amplitude)"
            
            return ResultRow(text: text, detail: detail)
        }
    }
}

/// Table view provider specific to an `ORKTowerOfHanoiResult` instance.
class TowerOfHanoiResultTableViewProvider: ResultTableViewProvider {
    // MARK: UITableViewDataSource
    
    override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        let towerOfHanoiResult = result as! ORKTowerOfHanoiResult
        return towerOfHanoiResult.moves != nil ? (towerOfHanoiResult.moves!.count + 1) : 1
    }
    
    override func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
        if section == 0 {
            return super.tableView(tableView, titleForHeaderInSection: 0)
        }
        
        return "Move \(section )"
    }
    // MARK: ResultTableViewProvider
    
    override func resultRowsForSection(section: Int) -> [ResultRow] {
        let towerOfHanoiResult = result as! ORKTowerOfHanoiResult
        let rows = super.resultRowsForSection(section)
        if section == 0 {
            return rows + [
                ResultRow(text: "solved", detail: towerOfHanoiResult.puzzleWasSolved ? "true" : "false"),
                ResultRow(text: "moves", detail: "\(towerOfHanoiResult.moves?.count ?? 0 )")]
        }
        // Add a `ResultRow` for each sample.
        let move = towerOfHanoiResult.moves![section - 1] as! ORKTowerOfHanoiMove
        return rows + [
            ResultRow(text: "donor tower", detail: "\(move.donorTowerIndex)"),
            ResultRow(text: "recipient tower", detail: "\(move.recipientTowerIndex)"),
            ResultRow(text: "timestamp", detail: "\(move.timestamp)")]
    }
}

