<commit_before>function GroupProjectNavigatorSubmissionsView(runtime, element) {
    var failed_uploads = [];
    var upload_data = {
        dataType: 'json',
        url: runtime.handlerUrl(element, "upload_submission"),
        add: function (e, data) {
            var target_form = $(e.target);
            $('.' + data.paramName + '_name', target_form).text(data.files[0].name);
            $('.' + data.paramName + '_progress', target_form).css({width: '0%'}).removeClass('complete failed');
            $('.' + data.paramName + '_progress_box', target_form).css({visibility: 'visible'});

            data.formData = getFormData(target_form);

            $(document).one('perform_uploads', function (ev) {
                 data.submit()
                    .success(function (data, textStatus, jqXHR) {
                        if (data.new_stage_states) {
                            for (var i=0; i<data.new_stage_states.length; i++) {
                                var new_state = data.new_stage_states[i];
                                $(document).trigger(
                                    "group_project_v2.project_navigator.stage_status_update",
                                    [new_state.activity_id, new_state.stage_id, new_state.state]
                                );
                            }
                        }

                        if (data.submissions) {
                            for (var submission_id in data.submissions) {
                                if (!data.submissions.hasOwnProperty(submission_id)) return;
                                var location = data.submissions[submission_id];
                                $('#' + data.paramName + '_wrapper', target_form).data('location', location);
                            }
                        }
                    });
            });

            $(document).trigger('perform_uploads');
        },
        progress: function (e, data) {
            var target_form = $(e.target);
            var percentage = parseInt(data.loaded / data.total * 100, 10);
            $('.' + data.paramName + '_progress', target_form).css('width', percentage + '%');
        },
        done: function (e, data) {
            var target_form = $(e.target);
            $('.' + data.paramName + '_progress', target_form).css('width', '100%').addClass('complete');
            var input = $('.' + data.paramName + '_name', target_form);
            input.attr('data-original-value', input.val());
        },
        fail: function (e, data) {
            var target_form = $(e.target);
            $('.' + data.paramName + '_progress', target_form).css('width', '100%').addClass('failed');<commit_msg>Properly setting attributes and values on wrapper and input so that everything works correct<commit_after>function GroupProjectNavigatorSubmissionsView(runtime, element) {
    var failed_uploads = [];
    var upload_data = {
        dataType: 'json',
        url: runtime.handlerUrl(element, "upload_submission"),
        add: function (e, data) {
            var target_form = $(e.target);
            $('.' + data.paramName + '_name', target_form).val(data.files[0].name);
            $('.' + data.paramName + '_progress', target_form).css({width: '0%'}).removeClass('complete failed');
            $('.' + data.paramName + '_progress_box', target_form).css({visibility: 'visible'});

            data.formData = getFormData(target_form);

            $(document).one('perform_uploads', function (ev) {
                 data.submit()
                    .success(function (data, textStatus, jqXHR) {
                        if (data.new_stage_states) {
                            for (var i=0; i<data.new_stage_states.length; i++) {
                                var new_state = data.new_stage_states[i];
                                $(document).trigger(
                                    "group_project_v2.project_navigator.stage_status_update",
                                    [new_state.activity_id, new_state.stage_id, new_state.state]
                                );
                            }
                        }

                        if (data.submissions) {
                            for (var submission_id in data.submissions) {
                                if (!data.submissions.hasOwnProperty(submission_id)) return;
                                var location = data.submissions[submission_id];
                                $('.' + submission_id + '_name', target_form).parent(".upload_item_wrapper")
                                    .data('location', location)
                                    .attr('data-location', location); // need to set attr here as there are css rules for [data-location] attribute
                            }
                        }
                    });
            });

            $(document).trigger('perform_uploads');
        },
        progress: function (e, data) {
            var target_form = $(e.target);
            var percentage = parseInt(data.loaded / data.total * 100, 10);
            $('.' + data.paramName + '_progress', target_form).css('width', percentage + '%');
        },
        done: function (e, data) {
            var target_form = $(e.target);
            $('.' + data.paramName + '_progress', target_form).css('width', '100%').addClass('complete');
            var input = $('.' + data.paramName + '_name', target_form);
            input.attr('data-original-value', input.val());
        },
        fail: function (e, data) {
            var target_form = $(e.target);
            $('.' + data.paramName + '_progress', target_form).css('width', '100%').addClass('failed');
{'fraction_non_alphanumeric': 0.13603651044409337, 'fraction_numerical': 0.0052659294365455505, 'mean_word_length': 1.5620503597122302, 'pattern_counts': {'":': 0, '<': 5, '<?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': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1087647', 'n_tokens_mistral': 1496, 'n_tokens_neox': 1426, 'n_words': 268}