In our courses we need to set every (100%) unit to "mark as finished" to achieve a certificate, when clicking "Finish course".
Is it possible to set - let´s say - 70% of units is enough to get certificate, when clicking "Finish course"?
Well actually the course cannot be finished before completing all the units in wplms.
There is a check to check if all units are completed or not .
But this is possible :
please try adding this given code in your wplms-customizer.php file in wplms customizer plugin :
add_filter('wplms_finish_course_check',function($flag,$course_curriculum){
$id = get_the_ID();
$user_id = get_current_user_id();
$passing_per = get_post_meta($id,'vibe_course_passing_percentage',true);
$check_units = 0;
foreach ($course_curriculum as $key => $unit_id) {
$unittaken = bp_course_check_unit_complete($unit_id,$user_id,$id);
if($unittaken){
$check_units++;
}
}
$passing_per = intval($passing_per);
$passing_per = $passing_per/10;
if($check_units >= $passing_per){
return 0;
}
return $flag;
},9999,2);