1. Go to WP Admin -> Plugins -> Editor -> WPLMS Customizer -> customizer_class.php
2. Add the following line in _constuct function :
PHP Code:
add_filter('wplms_unit_mark_complete',array($this,'wplms_assignments_complete_force_unit_complete'),1,3);
3. Add the following function in class :
PHP Code:
function wplms_assignments_complete_force_unit_complete($mark_unit_html,$unit_id,$course_id){
$flag=0;
$unit_assignment = get_post_meta($unit_id,'vibe_assignment',true);
if(isset($unit_assignment) && $unit_assignment){
$user_id = get_current_user_id();
$assignment_complete = get_post_meta($unit_assignment,$user_id,true);
if(isset($assignment_complete) && $assignment_complete > 1){
$flag=0;
}else{
$flag=1;
}
}
if($flag)
return '';
return $mark_unit_html;
}
Change 1 to some custom value X , if you want the student to score X marks before he can mark the unit complete.
