<commit_before><%# render the answer value based on question type. we include machine readable value in
    data-val so that conditions can still be eval'd in JS %>
<% case type = answer.qtype.name
   when 'select_one' %>

  <%= content_tag(:div, answer.option.try(:name), class: 'ro-val', :'data-val' => answer.option_id) %>

<% when 'select_multiple' %>

  <%= content_tag(:div, safe_join(answer.choices.map{|c| c.option.name}, tag(:br)), class: 'ro-val', :'data-val' => answer.choices.map(&:option_id).to_json) %>

<% when 'datetime', 'date', 'time' %><commit_msg>2337: Initial attempt at mapping geographic answers<commit_after><%# render the answer value based on question type. we include machine readable value in
    data-val so that conditions can still be eval'd in JS %>
<% case type = answer.qtype.name
   when 'select_one' %>

  <% if answer.option.has_coordinates? %>
  <div id="map_<%= answer.id %>" style="width: 160px; height: 80px; float: right; margin-bottom: 10px"></div>
  <script>
    var coords = new google.maps.LatLng(<%= answer.option.latitude %>, <%= answer.option.longitude %>);
    var map = new google.maps.Map($('#map_<%= answer.id %>')[0], {
      mapTypeId: google.maps.MapTypeId.ROADMAP,
      center: coords,
      zoom: 10,
      disableDefaultUI: true,
      zoomControl: true,
      zoomControlOptions: {
        position: google.maps.ControlPosition.TOP_RIGHT,
        style: google.maps.ZoomControlStyle.SMALL
      }
    });
    new google.maps.Marker({ map: map, position: coords, icon: "<%= image_url('markers/small.png') %>" });
  </script>
  <% end %>

  <%= content_tag(:div, answer.option.try(:name), class: 'ro-val', :'data-val' => answer.option_id) %>

<% when 'select_multiple' %>

  <%= content_tag(:div, safe_join(answer.choices.map{|c| c.option.name}, tag(:br)), class: 'ro-val', :'data-val' => answer.choices.map(&:option_id).to_json) %>

<% when 'datetime', 'date', 'time' %>
{'fraction_non_alphanumeric': 0.18134715025906736, 'fraction_numerical': 0.007253886010362694, 'mean_word_length': 4.081578947368421, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 30, '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': '5927888', 'n_tokens_mistral': 694, 'n_tokens_neox': 636, 'n_words': 157}