               inRepeater = true
 
           if rule.type == "Hanuman::CalculationRule"
-            self.updateCalculation(rule)
+            self.updateCalculation(rule, $ruleContainer)
           else
             self.checkConditionsAndHideShow(rule.conditions, ancestorId, $ruleContainer, $ruleContainer, inRepeater, matchType, rule)
 

              if rule.type != 'Hanuman::CalculationRule'
                $conditionElement = $conditionContainer.find(".form-control[data-label-value='" + condition.answer.replace("/","\\/").replace("'","\\'") + "']")

              self.bindConditions($conditionElement, rule)
            else
              for element in $conditionElement
                do (element) ->
                  self.bindConditions($(element), rule)

          #TODO CLEAN UP THIS CODE WE HAVE STUFF IN HERE WE ARE NOT USING LIKE inRepeater
          # determine if we are in a repeater-this needs to get deleted-kdh


  ## AN May 2020 - Start calculated fields code
  # This method triggers an update of the calculations for the given rule's target question
  updateCalculation: (rule, $ruleContainer) ->
    parameters = {} # used to store the survey data object passed to the calculated fields expresssion
    $target = $ruleContainer.find('.form-control') # the question we are calculating a value for
    $targetRepeater = $ruleContainer.closest(".form-container-repeater") # the parent repeater of the target, if it exists
    targetType = $ruleContainer.data('element-type') # the form control type of the target

    $.each rule.conditions, (index, condition) ->

