<commit_before>module SurveyorHelper
  def display_response(r_set,question)
    sets = r_set.responses.select do |r| 
      r.question == question && r.question.display_order == question.display_order
    end
    
    if sets.size == 0
      "-"
    elsif sets.size == 1
      (sets.first.string_value || sets.first.text_value || sets.first.integer_value || sets.first.float_value || show_answer(sets.first)).to_s
    else
      sets.map { |s| show_answer(s) }.join( question.pick == "any" ? ";" : "<br/>" )
    end
  end
  
  def show_answer(set)  
    set.answer.text
  end<commit_msg>Displaying string answers for any answer that has them, not just response sets of size 1.<commit_after>module SurveyorHelper
  def display_response(r_set,question)
    sets = r_set.responses.select do |r| 
      r.question == question && r.question.display_order == question.display_order
    end
    
    if sets.size == 0
      "-"
    else
      sets.map { |s| show_answer(s) }.join( question.pick == "any" ? ";" : "<br/>" )
    end
  end
  
  def show_answer(set) 
    (set.string_value || set.text_value || set.integer_value || set.float_value || set.answer.text).to_s
  end
{'fraction_non_alphanumeric': 0.1320754716981132, 'fraction_numerical': 0.003430531732418525, 'mean_word_length': 2.9559322033898305, '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': '2737040', 'n_tokens_mistral': 398, 'n_tokens_neox': 390, 'n_words': 86}