<commit_before>$(window).on('load', function() {
    $('body').append($("<script src='https://www.google.com/recaptcha/api.js?onload=recaptchaLoaded&render=explicit' async defer></script>"));
});

var daysRemaining=(function(){
    var oneDay = 24*60*60*1000;
    var decision = new Date(2018, 5, 15, 23, 59);
    return Math.floor(Math.abs((Date.now() - decision.getTime())/(oneDay)));
})();

$(".days-remaining-number").text(daysRemaining + " days");

/* useful vars */
var supportsMotion = null;
var emailTxt = ""; // global for preview and then send
var emailData = {}; // literally whatever data we want to store along with the email
var submissionDeferred;

$(".support.toggle-button-question .toggle-select").click(function() {
  var $this = $(this);

  $(".support.toggle-button-question .toggle-select").removeClass("selected");
  $this.addClass("selected");

  supportsMotion = $this.attr('id') == "yes";
  emailData.supportsMotion = supportsMotion;
});

$(".appear.toggle-button-question .toggle-select").click(function() {
  var $this = $(this);

  $(".appear.toggle-button-question .toggle-select").removeClass("selected");
  $this.addClass("selected");

  appearCommittee = $this.attr('id') == "yes";
  emailData.appearCommittee = appearCommittee;
});

/* follow-up questions */
var senderSecret = null,
    emailId = null;

function getRandomInt(min, max) {
  min = Math.ceil(min);
  max = Math.floor(max);
  return Math.floor(Math.random() * (max - min)) + min; //The maximum is exclusive and the minimum is inclusive
}

// follow up questions
var questions = [
  {
    q: "Which party do you plan to vote for in the 2019 general elections?",
    a: ["ANC", "DA", "EFF", "Other"],
  }, {
    q: "Which province do you live in?",
    a: ["Eastern Cape", "Free State", "Gauteng", "KwaZulu-Natal", "Limpopo", "Mpumalanga", "North West", "Northern Cape", "Western Cape"],
  }, {
    q: "Do you live in a rural or urban area?",
    a: ["Rural", "Urban"],
  }, {
    q: "What is your race?",
    a: ["Black African", "Coloured", "White", "Asian or Indian", "Other"],
  }, {
    q: "How old are you?",
    a: ["Under 20", "20 - 29", "30 - 39", "40 or older"],
  },
];

function followUpQuestion() {
  var questionsLeft = questions.length;
  var randomNumber = getRandomInt(0, questionsLeft);
  var q = questions[randomNumber];

  ga('send', 'event', 'follow-up', 'asked', q.q);
  $('.follow-up-question p').text(q.q);
  $(".toggle-select-follow-up").remove();
  $.each(q.a, function(index, value) {
    $(".follow-up-answer-box").append("<span id='follow-up-answer-" + index + "' class='toggle-select-follow-up'>" + value + "</span>")
  });
<commit_msg>remove race question<commit_after>$(window).on('load', function() {
    $('body').append($("<script src='https://www.google.com/recaptcha/api.js?onload=recaptchaLoaded&render=explicit' async defer></script>"));
});

var daysRemaining=(function(){
    var oneDay = 24*60*60*1000;
    var decision = new Date(2018, 5, 15, 23, 59);
    return Math.floor(Math.abs((Date.now() - decision.getTime())/(oneDay)));
})();

$(".days-remaining-number").text(daysRemaining + " days");

/* useful vars */
var supportsMotion = null;
var emailTxt = ""; // global for preview and then send
var emailData = {}; // literally whatever data we want to store along with the email
var submissionDeferred;

$(".support.toggle-button-question .toggle-select").click(function() {
  var $this = $(this);

  $(".support.toggle-button-question .toggle-select").removeClass("selected");
  $this.addClass("selected");

  supportsMotion = $this.attr('id') == "yes";
  emailData.supportsMotion = supportsMotion;
});

$(".appear.toggle-button-question .toggle-select").click(function() {
  var $this = $(this);

  $(".appear.toggle-button-question .toggle-select").removeClass("selected");
  $this.addClass("selected");

  appearCommittee = $this.attr('id') == "yes";
  emailData.appearCommittee = appearCommittee;
});

/* follow-up questions */
var senderSecret = null,
    emailId = null;

function getRandomInt(min, max) {
  min = Math.ceil(min);
  max = Math.floor(max);
  return Math.floor(Math.random() * (max - min)) + min; //The maximum is exclusive and the minimum is inclusive
}

// follow up questions
var questions = [
  {
    q: "Which party do you plan to vote for in the 2019 general elections?",
    a: ["ANC", "DA", "EFF", "Other"],
  }, {
    q: "Which province do you live in?",
    a: ["Eastern Cape", "Free State", "Gauteng", "KwaZulu-Natal", "Limpopo", "Mpumalanga", "North West", "Northern Cape", "Western Cape"],
  }, {
    q: "Do you live in a rural or urban area?",
    a: ["Rural", "Urban"],
  }, {
    q: "How old are you?",
    a: ["Under 20", "20 - 29", "30 - 39", "40 or older"],
  },
];

function followUpQuestion() {
  var questionsLeft = questions.length;
  var randomNumber = getRandomInt(0, questionsLeft);
  var q = questions[randomNumber];

  ga('send', 'event', 'follow-up', 'asked', q.q);
  $('.follow-up-question p').text(q.q);
  $(".toggle-select-follow-up").remove();
  $.each(q.a, function(index, value) {
    $(".follow-up-answer-box").append("<span id='follow-up-answer-" + index + "' class='toggle-select-follow-up'>" + value + "</span>")
  });

{'fraction_non_alphanumeric': 0.20114942528735633, 'fraction_numerical': 0.014559386973180077, 'mean_word_length': 4.093658536585366, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '247947', 'n_tokens_mistral': 1794, 'n_tokens_neox': 1701, 'n_words': 434}