<commit_before>$(document).ready(function() {
    var option = 1;
    $('.createForm').on("click", "#addOption", function() {
        option++;
        addNewOption(option);
    });
    
});

function addNewOption(option) {
    // remove 'add new option'
    // remove button
    $('.optAdd').remove();
    $('#submit').remove();
    $('.btnLabel').remove();
    // append new option
    var newOption =
        '<div class="form-group row">' +
            '<label class="col-sm-3 form-control-label" for="txtChoice' + option + '">Option</label>' +
            '<div class="col-sm-9">' +
                '<input id="txtChoice' + option + '" class="form-control" type="text" placeholder="Your poll option" />' +
            '</div>' +
        '</div>';
    // add 'add new option' button again
    var addOption =
        '<div class="form-group row optAdd">' +
            '<div class="col-sm-6 col-sm-offset-6">' +
                '<p><a id="addOption" href="#">+ Add another option</a></p>' +
            '</div>' +
        '</div>';
    // add button again
    var submitButton =
        '<label for="submit" class="btn btn-primary btnLabel"><i class="fa fa-check-square-o"></i> Submit</label>' +
        '<input id="submit" type="submit" class="hidden" \>'

    $('.createForm').append(newOption + addOption + submitButton);
}<commit_msg>clean up create form script<commit_after>$(document).ready(function() {
    var option = 1;
    $('.createForm').on("click", "#addOption", function() {
        option++;
        addNewOption(option);
    });
    
});

function addNewOption(option) {
    console.log(option)
    // append new option
    var newOption =
        '<div class="form-group row">' +
            '<label class="col-sm-3 form-control-label" for="txtChoice' + option + '">Option</label>' +
            '<div class="col-sm-9">' +
                '<input id="txtChoice' + option + '" class="form-control" type="text" placeholder="Your poll option" />' +
            '</div>' +
        '</div>';
    $('.optAdd').prev().after(newOption);
}
{'fraction_non_alphanumeric': 0.20419103313840156, 'fraction_numerical': 0.003898635477582846, 'mean_word_length': 2.4446308724832213, 'pattern_counts': {'":': 0, '<': 30, '<?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': '5858497', 'n_tokens_mistral': 617, 'n_tokens_neox': 628, 'n_words': 132}