     }
 }
 
-/// Table view provider specific to an `ORKNumericQuestionResult` instance.
-class NumericQuestionResultTableViewProvider: ResultTableViewProvider {
-    // MARK: ResultTableViewProvider
-    
-    override func resultRowsForSection(section: Int) -> [ResultRow] {
-        let questionResult = result as! ORKNumericQuestionResult
+/// 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 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)
+            // The text the user typed into the text view.
+            ResultRow(text: "textAnswer", detail: questionResult.textAnswer)
+        ]
+    }
+}
+
+/// 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 `ORKFileResult` instance.
class FileResultTableViewProvider: ResultTableViewProvider {
    // MARK: ResultTableViewProvider
    
    override func resultRowsForSection(section: Int) -> [ResultRow] {
        let questionResult = result as! ORKFileResult
        
        let rows = super.resultRowsForSection(section) + [
            // The MIME content type for the file produced.
            ResultRow(text: "contentType", detail: questionResult.contentType),

            // The URL of the generated file on disk.
            ResultRow(text: "fileURL", detail: questionResult.fileURL)
        ]

        if let fileURL = questionResult.fileURL, let contentType = questionResult.contentType where contentType.hasPrefix("image/") {
            if let data = NSData(contentsOfURL: fileURL), let image = UIImage(data: data) {
                return rows + [
                    // The image of the generated file on disk.
                    .Image(image)
                ]
            }
        }
        
        return rows
    }
    
    func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
        let resultRows = resultRowsForSection(indexPath.section)
        
        if !resultRows.isEmpty {
            switch resultRows[indexPath.row] {
                case .Image(.Some(let image)):
                    // Keep the aspect ratio the same.
                    let imageAspectRatio = image.size.width / image.size.height

                    return tableView.frame.size.width / imageAspectRatio

                default:
                    break
            }
        }
        
        return UITableViewAutomaticDimension
    }
}

/// Table view provider specific to an `ORKConsentSignatureResult` instance.
class ConsentSignatureResultTableViewProvider: ResultTableViewProvider {
    // MARK: ResultTableViewProvider
    
    override func resultRowsForSection(section: Int) -> [ResultRow] {
        let signatureResult = result as! ORKConsentSignatureResult
        let signature = signatureResult.signature!
        
        return super.resultRowsForSection(section) + [
            /*
                The identifier for the signature, identifying which one it is in
                the document.
            */
            ResultRow(text: "identifier", detail: signature.identifier),
            
            /*
                The title of the signatory, displayed under the line. For
                example, "Participant".
            */
            ResultRow(text: "title", detail: signature.title),
            
            // The given name of the signatory.
            ResultRow(text: "givenName", detail: signature.givenName),
            
            // The family name of the signatory.
            ResultRow(text: "familyName", detail: signature.familyName),
            
            // The date the signature was obtained.
            ResultRow(text: "date", detail: signature.signatureDate),
            
            // The captured image.
            .TextImage("signature", image: signature.signatureImage)
        ]
    }
    
    func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
        let lastRow = self.tableView(tableView, numberOfRowsInSection: indexPath.section) - 1
        
        if indexPath.row == lastRow {
            return 200
        }
       
        return UITableViewAutomaticDimension
    }
}


    }
}

/// 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
