This reply has been marked as private.
If I offer a course that will last X hours (the sum of all units + exams), then I have to give a certificate for those hours.
If the student completes the course in X + 10, X + 20 ... etc hours, it does not matter.
The certificate is for X hours, since that amount of time lasts the content of the course.
That is what I really need, I hope it is clear.
I have repeated it many times.
@tuaptitud,
Okay, I am really sorry that the conversation leads to in wrong direction
Please comment out that code from your wplms customizer plugin and then add this one
add_shortcode('vibe_show_total_unit_duration','vibe_show_total_unit_duration');
function vibe_show_total_unit_duration( $atts, $content = null ){
$user_id=$_GET['u'];
$course_id=$_GET['c'];
$course_curriculum = bp_course_get_curriculum($course_id);
if(!empty($course_curriculum)){
$duration = 0;
foreach($course_curriculum as $key => $item){
if(is_numeric($item)){
$post_type = get_post_type($item);
if( $post_type == 'unit' && function_exists('bp_course_get_unit_duration')){
$duration += bp_course_get_unit_duration($item);
}else if($post_type == 'quiz' && function_exists('bp_course_get_quiz_duration')){
$duration += bp_course_get_quiz_duration($item);
}
}
}
if(function_exists('tofriendlytime')){
$duration = tofriendlytime($duration),$duration;
return $duration;
}
}else{
return '[vibe_show_total_unit_duration]';
}
}
Then use this shortcode : [vibe_show_total_unit_duration]
Let me know if this is working correctly or not