Total duration units + exam

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

Viewing 15 posts - 1 through 15 (of 34 total)
  • Author
    Posts
  • #323905
    karanna
    Spectator
    Hello, i want to show total duration units + exam in hours, even if my courses take 2-3 days. Now it shows as "2 days and x hours" and is confusing, as clients tend to think my course will be finished in 2 days. I am talking about this setting: https://prnt.sc/vgqynk How do i change that? Thank you for your time. :) anca twitter takipçi satın al
    #324113
    Veronica
    Moderator
    we can try the same with the custom code but please confirm the version of the theme you are using
    #324117
    karanna
    Spectator
    I am on 3.9 but i upgraded on 4.0 and downgrading to 3.9 again. Anca
    #324386
    Veronica
    Moderator
    hi in version 4 there is elementor course layout vibebp>>course layout edit the course layout and add it from here http://prntscr.com/vhegje
    #324388
    karanna
    Spectator
    I did not ask about ratings...i asked about total duration units + exam :) Can Alex answer me? :) No offence Thanks anca
    #324511
    Veronica
    Moderator
    hi it's here http://prntscr.com/viej5y
    #324626
    karanna
    Spectator
    I DO NOT USE ELEMENTOR ON MY WEBSITE BECAUSE IT DOES NOT WORK ON MY SITE! CAN YOU PLEASE ANSWER AND ACCTUALLY HELP???WHY DID I PAID SUPPORT FOR????????????????????/
    #324882
    Veronica
    Moderator
    hi the delay in response due to support holiday try to add this in wp-admin>>plugin>>plugin editor>>wplms customizer plugin>>wplms-customizer.php
    function get_course_unit_durations(){
            $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 = apply_filters(‘wplms_cs_get_course_unit_durations’,tofriendlytime($duration),$duration);
                }
                
                return ‘<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>’;
            }
        }
    #324950
    karanna
    Spectator
    I added that function but it breaks my site. I received a message : syntax error, unexpected '>' on line 58.
    #324973
    Veronica
    Moderator
    function get_course_unit_durations(){
        $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 = apply_filters('wplms_cs_get_course_unit_durations',tofriendlytime($duration),$duration);
            }
            
            return '<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>';
        }
    }
    make sure you have added the code before: http://prntscr.com/vkjvq7
    #325335
    karanna
    Spectator
    I'm sorry...this code simply does not do nothing.. Still my courses takes "2 days, 6 hours" for example.. https://prnt.sc/vlnp7a
    #325521
    Veronica
    Moderator
    ok let me check again I will provide tomorrow if I forget to do the same please ping me
    #326110
    karanna
    Spectator
    did you forget about me? :)
    #326239
    Veronica
    Moderator
    hi thanks for pinging me back actually among so many topics forget to share the code I am performing the testing will share the code within an hour thanks
    #326250
    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;
    }
    
Viewing 15 posts - 1 through 15 (of 34 total)
  • The topic ‘Total duration units + exam’ is closed to new replies.