<commit_before>module SmartAnswer
  class CalculateAgriculturalHolidayEntitlementFlow < Flow
    def define
      content_id "8834bc7c-7ac7-4d45-8a57-1d5a5dcd70a0"
      name 'calculate-agricultural-holiday-entitlement'
      status :published
      satisfies_need "100143"

      calculator = Calculators::AgriculturalHolidayEntitlementCalculator.new

      multiple_choice :work_the_same_number_of_days_each_week? do
        option "same-number-of-days"
        option "different-number-of-days"

        calculate :days_worked_per_week do
          nil
        end

        next_node do |response|
          case response
          when 'same-number-of-days'
            question :how_many_days_per_week?
          when 'different-number-of-days'
            question :what_date_does_holiday_start?
          end
        end
      end<commit_msg>Build calculator in on_response block for calculate-agricultural-holiday-entitlement<commit_after>module SmartAnswer
  class CalculateAgriculturalHolidayEntitlementFlow < Flow
    def define
      content_id "8834bc7c-7ac7-4d45-8a57-1d5a5dcd70a0"
      name 'calculate-agricultural-holiday-entitlement'
      status :published
      satisfies_need "100143"

      multiple_choice :work_the_same_number_of_days_each_week? do
        option "same-number-of-days"
        option "different-number-of-days"

        on_response do
          self.calculator = Calculators::AgriculturalHolidayEntitlementCalculator.new
        end

        calculate :days_worked_per_week do
          nil
        end

        next_node do |response|
          case response
          when 'same-number-of-days'
            question :how_many_days_per_week?
          when 'different-number-of-days'
            question :what_date_does_holiday_start?
          end
        end
      end
{'fraction_non_alphanumeric': 0.05846662989520132, 'fraction_numerical': 0.027578599007170437, 'mean_word_length': 2.529182879377432, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6988174', 'n_tokens_mistral': 591, 'n_tokens_neox': 552, 'n_words': 98}