    
    // MARK: text input fields
    
-   func numberOfFields(question: [String : Any]) -> Int {
+   func numberOfFields(question: [String : Any?]) -> Int {
       let fields = question["fields"] as! [[String : String]]
       return fields.count
    }

      return question["options"] as! [String]?
   }
   
   func numberOfTableQuestions(for question: [String : Any]) -> Int {
      return tableQuestions(for: question).count
   }
   
   func tableQuestions(for question: [String : Any]) -> [[String : String]] {
      return question["table_questions"] as! [[String : String]]
   }
   


extension QuestionPath: CustomStringConvertible {
   public var description : String {
      if subQuestionIndex != nil {
         return "Path: primary: \(primaryQuestionIndex), sub: \(subQuestionIndex!), row: \(row())"
      } else {
         return "Path: primary: \(primaryQuestionIndex), row: \(row())"
      }
   }
}

