if modal is shown jquery code example
Example 1: check if modal hide jquery
alert($('#registration-exams-modal').hasClass('show'));
Example 2: jquery on modal show
$(window).on('shown.bs.modal', function() {
$('#code').modal('show');
alert('shown');
});