{% javascripts
    debug=false
    vars=["locale"]
    "@UJMExoBundle/Resources/views/ConfirmationMessage/finishExerciseConfirm.html.twigjs"
    filter="twig_js"
%}
    <script language="javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
<script>
    function createValidationBox() {
        var html = Twig.render(
            ModalWindow,
            {'footer': Twig.render(ValidationFooter), 'isHidden': true, 'modalId': 'confirm-finish-exercise', 'body': Twig.render(finishExerciseConfirm, {'nbItems': 1})}
        );
        $('body').append(html);
    }

    createValidationBox();

    $('body').on('click', '#modal-valid-button', function(event) {
        $('#confirm-finish-exercise').modal('hide');
        $('#formResponse').submit();
    });
</script>