Total unit duration error

Home Forums Chit Chat WPLMS customizations Total unit duration error

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #28844
    ulyssesw
    Spectator
    Hi, 1) May i know why in unit setting, the unit duration you have specified it in minutes, but right after it there is a Unit duration parameter that we must choose? 2) In all my unit settings, i have set the unit duration in minutes. And set the unit duration parameter in minutes. Please see screenshot 1. But my total turn out to be in days and the individual minutes don't add up to days so long. Please see screenshot 2. Regards.
    #29390
    Anshuman Sahu
    Keymaster
    1. Well the unit duration is in minutes by default . This is why the unit duration is shown in minutes .YOu can select this in any duration you want in the dropdown below . 2. Well for this you need to edit the tip which you used to show the total unit duration . Please remove the previous code and add this code to show the durations in just minutes only : 1. Go to following location : Wp admin -> Plugins -> editor -> wplms customizer -> customizer_class.php
    2. Add the following line in the _construct function:
    add_filter('wplms_course_details_widget',array($this,'wplms_show_unit_count_and_time'));
    3. Now add the following function in the class:
    function wplms_show_unit_count_and_time($course_details){
                $course_id = get_the_ID();
                $units=bp_course_get_curriculum_units($course_id);
                $course_details['units'] = '<li><i class="icon-grid-alt"></i>'.count($units).' Units</li>';
                $duration = $total_duration = 0;
                foreach($units as $unit){
    if(get_post_type($unit) == 'unit'){
                    $duration = get_post_meta($unit,'vibe_duration',true);
            $unit_duration_parameter = apply_filters('vibe_unit_duration_parameter',60,$unit);
            $total_duration =  $total_duration + $duration*$unit_duration_parameter;
                }
                }
                $course_details['units_duration'] = '<li><i class="icon-clock-1"></i>'.( $total_duration/60).'</li>';
                return $course_details;
            }
     
    #29903
    ulyssesw
    Spectator
    Hi Alex, I went into my wplms customiser, and removed the following the previous code, please see attached screenshot. Am i correct? I used your above 2 codes and input into wplms customiser, but i got the following error. Please see attached. Im not sure if your solution is addressing what i described in the problem. My issue is that all my unit duration adds up, is not what the total reflects. For e.g. 1 minute + 1 minute, the total duration shows 3 weeks. Regards.
    #29907
    ulyssesw
    Spectator
    oh by the way, i have put back the old code and removed the codes you sent.
    #30056
    ulyssesw
    Spectator
    To be more specific, im referring to this course: http://wedemic.com/course/making-strategy-happen-with-the-balanced-scorecard/ All unit duration are entered in minutes. All unit duration parameter are also set in minutes. But i don't understand why the total reflects 2 weeks 6 days. All other courses are working fine. Thanks.
    #30336
    H.K. Latiyan
    Participant
      I have updated Alex's code with the fix. Please check and confirm.   p.s : Please post customisations in customisations section. Customisations are not a part of support.
    #30344
    ulyssesw
    Spectator
    Hi Latiyan, Its still showing the wrong total duration. Its fine, i can live with this small error. I will mark this topic as resolved. Thanks.
    #30389
    ulyssesw
    Spectator
    I have managed to troubleshoot this issue and found the root cause, and got the solution. The total number of units and the total duration on the course page, are for both units and quizes. If you have a duration for all units and quizes, then it is fine. Your total duration should add up correctly. But sometimes, for e.g. for quizes, we can set 'unlimited' duration by entering '9999' into the quiz duration under settings. By entering this, your course curriculum will show the quiz duration as 'unlimited'. But the total duration factors this '9999' as the duration. I have tried entering '9999' and duration parameter in minutes, the total duration automatically add in another 1 week of duration. This is because it take the '9999' minutes as the quiz duration (9999 minutes = 166.65 hours = 6.94 days). If you try the above for units setting, its the same too. Input '9999' for unit duration, the course curriculum will show 'unlimited' duration, but the total duration will add in '9999' amount of time. The only way to avoid this is to set a duration for all units and quizes and not input '9999' for unlimited. Hope admin sees this as an issue and can provide a fix. Regards.
Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Total unit duration error’ is closed to new replies.