 
           # Ensure that the question passes any constraints, if given. If
           # not, raise an alert.
-          if not XFormConstraintChecker.passesConstraint( question, @get_question_value(question) )
-            alert "Answer doesn't pass constraint: #{question.info.bind.constraint}"
+          if not XFormConstraintChecker.passesConstraint question, answers
+            alert "Answer doesn't pass constraint: #{child.bind['jr:constraintMsg'] or child.bind.constraint}"
             return false
 
           return true


        passes_question_constraints: ->
          question = document.flat_fields[@currentQuestionIndex]

          # Check if the question is required and whether or not a value is
          # present. If not, raise an alert.


        submit: ->
            $( ".form" ).submit()


        # Returns a dictionary of all the form values
        get_form_values: -> @queryStringToJSON $(".form").serialize()

        # _geopointDisplay = ->
        #   onMapClick = (e) ->
