Auto mark unit complete when open

Update : No longer required for WPLMS 2.4, check WP Admin – LMS – Settings switch

Please add the given code in your wplms-customizer.php file in wplms-customizer plugin  :

add_action('wp_head', 'add_unit_auto_complete', 9);

function add_unit_auto_complete() {
?>

<script>
jQuery(document).ready(function ($) {

$('.unit_content').on('unit_traverse',function(){

$('#mark-complete').trigger('click');

});
});
</script>

<?php

}

 

Leave a Reply

Your email address will not be published. Required fields are marked *