Add below code in Child theme functions.php or in WP Admin - Plugins - Editor - WPLMS Customizer - wplms_Customizer.php
add_action('wplms_before_single_assignment','wplms_check_wplms_assignment_submission'); function wplms_check_wplms_assignment_submission(){ if(is_user_logged_in()){ $user_id = get_current_user_ID(); $assignment_id = get_the_ID(); $status = get_post_meta($assignment_id,$user_id,true); echo $status.'###'; if(isset($status) && is_numeric($status)){ if(!$status){ wp_die('Assignment under evaluation'); }else{ $link = bp_core_get_user_domain($user_id).BP_COURSE_SLUG.'/'.BP_COURSE_RESULTS_SLUG.'/?action='.$assignment_id; ?> <script type="text/javascript"> window.location= <?php echo "'" . $link . "'"; ?>; </script> <?php } } } }