{% extends 'ChamiloThemeBundle:Layout:layout_one_col.html.twig' %}

{% block content %}
    {% autoescape false %}
        {{ form }}
    {% endautoescape %}

    <script>
        $(function() {
            $("#hid_category_id").change(function () {
                $("#hid_category_id option:selected").each(function () {
                    var cat_id = $(this).val();

                    $.ajax({
                        url: "{{ _p.web_ajax }}gradebook.ajax.php?a=get_gradebook_weight",
                        data: "cat_id=" + cat_id,
                        success: function (return_value) {
                            if (return_value != 0) {
                                $("#max_weight").html(return_value);
                            }
                        }
                    });
                });
            });
        });
    </script>
{% endblock %}
