<commit_before>
<%= render 'header', :study => @study %>
<!-- <p>Todo: voting interface</p> -->

<% if @study.active.nil? %>
  <p>
    This study has not yet been launched. The owner must "Launch" it before voting can begin.</p>

<% elsif !@study.active %>
  <p>
    This study is currently closed. The owner must "Open" it before voting can resume.</p>

<% else %>
  <!-- select 2 random locations from a random region from a region set within the study -->
  <% @regions = @study.region_set.regions.find(:all).sample(1) %>
  <% @locations = @regions[0].locations.find(:all).sample(2) %>
  <% @imagelink1 = "http://maps.googleapis.com/maps/api/streetview?size=470x306&location=" + @locations[0].latitude.to_s() + "%20" + @locations[0].longitude.to_s() + "&sensor=false" %>
  <% @imagelink2 = "http://maps.googleapis.com/maps/api/streetview?size=470x306&location=" + @locations[1].latitude.to_s() + "%20" + @locations[1].longitude.to_s() + "&sensor=false" %>
  <div class="row" id="display-question">
    <div class="span12 text-center">
      <h3>Which image looks <%= @study.question %>?</h3>
    </div>
  </div>
  <div class="row text-center">
    <div class="span5 offset1">
      <div class="vote-image">
        <%= link_to image_tag("#{@imagelink1}", :size => "470x306"), comparisons_path(:comparison => {:chosen_location_id => @locations[0].id, :rejected_location_id => @locations[1].id, :study_id => @study.id}) , :method => :post %>
      </div>
      <div class="vote-button">
        <%= link_to '1', comparisons_path(:comparison => {:chosen_location_id => @locations[0].id, :rejected_location_id => @locations[1].id, :study_id => @study.id}) , :method => :post, :class => 'vote-button-text' %>
      </div>
    </div>
    <div class="span5">
      <div class="vote-image">
        <%= link_to image_tag("#{@imagelink2}", :size => "470x306"), comparisons_path(:comparison => {:chosen_location_id => @locations[0].id, :rejected_location_id => @locations[1].id, :study_id => @study.id}) , :method => :post %><commit_msg>Fixed regional location selection on the vote page.<commit_after>
<%= render 'header', :study => @study %>
<!-- <p>Todo: voting interface</p> -->

<% if @study.active.nil? %>
  <p>
    This study has not yet been launched. The owner must "Launch" it before voting can begin.</p>

<% elsif !@study.active %>
  <p>
    This study is currently closed. The owner must "Open" it before voting can resume.</p>

<% else %>
  <!-- select 2 random locations from a random region from a region set within the study -->
  <% @locations = @study.locations.sample(2) %>
  <% @imagelink1 = "http://maps.googleapis.com/maps/api/streetview?size=470x306&location=" + @locations[0].latitude.to_s() + "%20" + @locations[0].longitude.to_s() + "&sensor=false" %>
  <% @imagelink2 = "http://maps.googleapis.com/maps/api/streetview?size=470x306&location=" + @locations[1].latitude.to_s() + "%20" + @locations[1].longitude.to_s() + "&sensor=false" %>
  <div class="row" id="display-question">
    <div class="span12 text-center">
      <h3>Which image looks <%= @study.question %>?</h3>
    </div>
  </div>
  <div class="row text-center">
    <div class="span5 offset1">
      <div class="vote-image">
        <%= link_to image_tag("#{@imagelink1}", :size => "470x306"), comparisons_path(:comparison => {:chosen_location_id => @locations[0].id, :rejected_location_id => @locations[1].id, :study_id => @study.id}) , :method => :post %>
      </div>
      <div class="vote-button">
        <%= link_to '1', comparisons_path(:comparison => {:chosen_location_id => @locations[0].id, :rejected_location_id => @locations[1].id, :study_id => @study.id}) , :method => :post, :class => 'vote-button-text' %>
      </div>
    </div>
    <div class="span5">
      <div class="vote-image">
        <%= link_to image_tag("#{@imagelink2}", :size => "470x306"), comparisons_path(:comparison => {:chosen_location_id => @locations[0].id, :rejected_location_id => @locations[1].id, :study_id => @study.id}) , :method => :post %>
{'fraction_non_alphanumeric': 0.2074203187250996, 'fraction_numerical': 0.026394422310756973, 'mean_word_length': 4.21011673151751, 'pattern_counts': {'":': 0, '<': 72, '<?xml version=': 0, '>': 110, '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': '1054899', 'n_tokens_mistral': 1520, 'n_tokens_neox': 1359, 'n_words': 295}