<commit_before>class QuestionPresenter < NodePresenter
  extend Forwardable
  delegate [
    :translate!,
    :translate_and_render,
    :translate_option
  ] => :@renderer

  def use_erb_template?
    true
  end

  def initialize(i18n_prefix, node, state = nil, options = {})
    super(i18n_prefix, node, state)
    @renderer = options[:renderer]
    helpers = options[:helpers] || []
    @renderer ||= SmartAnswer::ErbRenderer.new(
      template_directory: @node.template_directory.join('questions'),
      template_name: @node.filesystem_friendly_name,
      locals: @state.to_hash,
      helpers: [SmartAnswer::FormattingHelper] + helpers
    )
  end

  def title
    @renderer.single_line_of_content_for(:title)
  end

  def error
    if @state.error.present?
      error_message_for(@state.error) || error_message_for('error_message') || I18n.translate('flow.defaults.error_message')
    end
  end

  def error_message_for(key)
    message = @renderer.single_line_of_content_for(key.to_sym)
    message.blank? ? nil : message
  end

  def hint
    @renderer.single_line_of_content_for(:hint)
  end

  def label
    @renderer.single_line_of_content_for(:label)
  end

  def suffix_label
    @renderer.single_line_of_content_for(:suffix_label)
  end

  def has_labels?
    label.present? || suffix_label.present?
  end

  def body(html: true)
    @renderer.content_for(:body, html: html)
  end

  def post_body
    @renderer.content_for(:post_body, html: true)
  end

  def options
    @node.options.map do |option|
      OpenStruct.new(label: render_option(option), value: option)
    end
  end

  def render_option(key)
    if use_erb_template?
      @renderer.option_text(key.to_sym)
    else
      translate_option(key)
    end
  end

  def to_response(input)
    @node.to_response(input)
  end

  def response_label(value)
    value
  end

  def partial_template_name
    "#{@node.class.name.demodulize.underscore}_question"
  end

  def multiple_responses?
    false
  end
end<commit_msg>Remove else condition in QuestionPresenter#render_option<commit_after>class QuestionPresenter < NodePresenter
  extend Forwardable
  delegate [
    :translate!,
    :translate_and_render,
    :translate_option
  ] => :@renderer

  def use_erb_template?
    true
  end

  def initialize(i18n_prefix, node, state = nil, options = {})
    super(i18n_prefix, node, state)
    @renderer = options[:renderer]
    helpers = options[:helpers] || []
    @renderer ||= SmartAnswer::ErbRenderer.new(
      template_directory: @node.template_directory.join('questions'),
      template_name: @node.filesystem_friendly_name,
      locals: @state.to_hash,
      helpers: [SmartAnswer::FormattingHelper] + helpers
    )
  end

  def title
    @renderer.single_line_of_content_for(:title)
  end

  def error
    if @state.error.present?
      error_message_for(@state.error) || error_message_for('error_message') || I18n.translate('flow.defaults.error_message')
    end
  end

  def error_message_for(key)
    message = @renderer.single_line_of_content_for(key.to_sym)
    message.blank? ? nil : message
  end

  def hint
    @renderer.single_line_of_content_for(:hint)
  end

  def label
    @renderer.single_line_of_content_for(:label)
  end

  def suffix_label
    @renderer.single_line_of_content_for(:suffix_label)
  end

  def has_labels?
    label.present? || suffix_label.present?
  end

  def body(html: true)
    @renderer.content_for(:body, html: html)
  end

  def post_body
    @renderer.content_for(:post_body, html: true)
  end

  def options
    @node.options.map do |option|
      OpenStruct.new(label: render_option(option), value: option)
    end
  end

  def render_option(key)
    @renderer.option_text(key.to_sym)
  end

  def to_response(input)
    @node.to_response(input)
  end

  def response_label(value)
    value
  end

  def partial_template_name
    "#{@node.class.name.demodulize.underscore}_question"
  end

  def multiple_responses?
    false
  end
end
{'fraction_non_alphanumeric': 0.0982615268329554, 'fraction_numerical': 0.0030234315948601664, 'mean_word_length': 3.692671394799054, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2870611', 'n_tokens_mistral': 1367, 'n_tokens_neox': 1342, 'n_words': 252}