Total duration units + exam

Home Forums Legacy Support Support queries Setup issues Total duration units + exam

Viewing 15 posts - 16 through 30 (of 34 total)
  • Author
    Posts
  • #326252
    Veronica
    Moderator
    hi please try to add the below code as it will work like this http://prntscr.com/vp49b9
    add_filter('wplms_course_details_widget','get_course_unit_durationss' ,10,2);
    function get_course_unit_durationss($details,$course_id){
        $course_id = get_the_ID();
        $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);
            }
            $details[]= '<li><strong class="tip" data-title="'._x("Total Unit + Quiz duration in this course","Course Detail Sidebar Unit Duration","vibe-customtypes").'">'.$duration.'</strong><i class="icon-clock-2"></i></li>';
        }
        return $details;
    }
    
    #326341
    karanna
    Spectator
    Fatal error. :(
    #326423
    Veronica
    Moderator
    hi I have added the code and didn't found any fatal error I hope you have added the code to the right place http://prntscr.com/vpsf4y
    #326482
    karanna
    Spectator
    Well...my customizer looks different. See printscreen : https://prnt.sc/vpyl1z I added the code below all.
    #326672
    Veronica
    Moderator
    hi please provide details I will add the same on yours thanks
    #326693
    karanna
    Spectator
    This reply has been marked as private.
    #326834
    Veronica
    Moderator
    This reply has been marked as private.
    #326881
    karanna
    Spectator
    This reply has been marked as private.
    #326996
    Veronica
    Moderator
    ok let me check
    #327000
    Veronica
    Moderator
    hi but I am still not able to access it http://prntscr.com/vrq9p0
    #327085
    karanna
    Spectator
    This reply has been marked as private.
    #327181
    Veronica
    Moderator
    checking
    #327182
    Veronica
    Moderator
    This reply has been marked as private.
    #327663
    karanna
    Spectator
    If you add it through php it will just give you fatal error on site..I already tried that before..
    #327820
    Veronica
    Moderator
    yes but I have tried with PHP file on my local site and it is working for me so if you give us permission then let make us try with Cpanel details
Viewing 15 posts - 16 through 30 (of 34 total)
  • The topic ‘Total duration units + exam’ is closed to new replies.