<commit_before>;
jQuery(function($){
    $("#id_options").remove();
    var $form = $("#id-new-question-form"),
        template = $("#question-option-template").html();

    function assignOptionNumbers(){
        $form.find("span.number").each(function(i, element){
            $(element).text(++i);
        });
    }

    function addQuestionOption($element){
        $element.before(template);
        assignOptionNumbers();
    }

    $('#id_answer_type').on('change', function(){
        if($(this).val() == 'MultiChoice'){
            $('#option-choices').addClass('show')
        }
    });

    $('input[type=radio]').on('change', function(){
        if($(this).val() == 'custom'){
            addQuestionOption($("div.form-actions"));
            $form.find('input[name=options]').prop('checked', false)
        }else{
            $form.find("div#option-input-group").remove();
            $form.find('input[name=options-custom]').prop('checked', false)
        }
    });

    $form.on("click", ".add-option", function(){
        addQuestionOption($("div.form-actions"));
    });

    $form.on("click", ".remove-option", function(){
        $(this).parents("div#option-input-group").remove();
        assignOptionNumbers();
    });

    $
});<commit_msg>now select is reset on page load and on answer change select options are hiden<commit_after>;
jQuery(function($){
    $("#id_options").remove();
    var $form = $("#id-new-question-form"),
        template = $("#question-option-template").html(),
        answerTypeSelect = $('#id_answer_type');
        answerTypeSelect.prop('selectedIndex',0);
    function assignOptionNumbers(){
        $form.find("span.number").each(function(i, element){
            $(element).text(++i);
        });
    }

    function addQuestionOption($element){
        $element.before(template);
        assignOptionNumbers();
    }

    answerTypeSelect.on('change', function(){
        if($(this).val() == 'MultiChoice'){
            $('#option-choices').addClass('show').removeClass('hide')
        }else{
            $('#option-choices').removeClass('show').addClass('hide')
        }
    });

    $('input[type=radio]').on('change', function(){
        if($(this).val() == 'custom'){
            addQuestionOption($("div.form-actions"));
            $form.find('input[name=options]').prop('checked', false)
        }else{
            $form.find("div#option-input-group").remove();
            $form.find('input[name=options-custom]').prop('checked', false)
        }
    });

    $form.on("click", ".add-option", function(){
        addQuestionOption($("div.form-actions"));
    });

    $form.on("click", ".remove-option", function(){
        $(this).parents("div#option-input-group").remove();
        assignOptionNumbers();
    });

    $
});
{'fraction_non_alphanumeric': 0.21541218637992832, 'fraction_numerical': 0.00035842293906810036, 'mean_word_length': 2.766531713900135, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5385235', 'n_tokens_mistral': 805, 'n_tokens_neox': 793, 'n_words': 103}