<commit_before>
var strawpolls;


$(document).ready(function() {
    $.getJSON('strawpolls').done(function(json) {
        strawpolls = json.data;
        console.log(json);
        $(".boxed").append("<p>"+ strawpolls[0].question+"</p>");
        $(".boxed").append("<input type='radio' name='choice' value ='pepsi'>"+  strawpolls[0].choices[0].label+ "<br>")
        $(".boxed").append("<input type='radio' name='choice' value ='coke'>"+  strawpolls[0].choices[1].label)
        $("bi").append()
    });
});
<commit_msg>fixed bug, added wrapping on next button and hard stop on previous. <commit_after>
var strawpolls;
var num = 0;
var box = $(".boxed");


function draw() {
  box.empty();
  box.append("<p>POLL</p>")
  box.append("<p>"+ strawpolls[num].question+"</p>");
  box.append("<input type='radio' name='choice' value ='pepsi'>"+  strawpolls[num].choices[0].label+ "<br>")
  box.append("<input type='radio' name='choice' value ='coke'>"+  strawpolls[num].choices[1].label)

}

$(document).ready(function() {
    $("#b3").click(function(){
      num = (num + 1) % strawpolls.length;
      draw();
    });
    $("#b1").click(function(){
     num -= 1;
     if(num < 0){num = 0}

      draw();
    });

    $.getJSON('strawpolls').done(function(json) {
        strawpolls = json.data;
        console.log(json);
        draw();
    });
});





// $("#b1").replaceWith("<button id='b1' type='button'>PREVIOUS</button>")

{'fraction_non_alphanumeric': 0.24036440084092503, 'fraction_numerical': 0.011212333566923615, 'mean_word_length': 3.5477707006369426, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 17, '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': '1636405', 'n_tokens_mistral': 515, 'n_tokens_neox': 507, 'n_words': 86}