Home › Forums › Legacy Support › Support queries › Setup issues › Total duration units + exam
- This topic has 33 replies, 2 voices, and was last updated 3 years, 1 month ago by Veronica.
-
AuthorPosts
-
November 10, 2020 at 12:56 pm #323905karannaSpectatorHello, 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 alNovember 11, 2020 at 10:26 am #324113VeronicaModeratorwe can try the same with the custom code but please confirm the version of the theme you are usingNovember 11, 2020 at 11:03 am #324117karannaSpectatorI am on 3.9 but i upgraded on 4.0 and downgrading to 3.9 again. AncaNovember 12, 2020 at 2:31 pm #324386VeronicaModeratorhi in version 4 there is elementor course layout vibebp>>course layout edit the course layout and add it from here http://prntscr.com/vhegjeNovember 12, 2020 at 2:37 pm #324388karannaSpectatorI did not ask about ratings...i asked about total duration units + exam :) Can Alex answer me? :) No offence Thanks ancaNovember 13, 2020 at 6:07 am #324511VeronicaModeratorhi it's here http://prntscr.com/viej5yNovember 13, 2020 at 3:45 pm #324626karannaSpectatorI 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????????????????????/November 16, 2020 at 2:05 pm #324882VeronicaModeratorhi 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>’; } }
November 16, 2020 at 9:46 pm #324950karannaSpectatorI added that function but it breaks my site. I received a message : syntax error, unexpected '>' on line 58.November 17, 2020 at 7:14 am #324973VeronicaModerator
make sure you have added the code before: http://prntscr.com/vkjvq7function 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>'; } }
November 18, 2020 at 6:02 pm #325335karannaSpectatorI'm sorry...this code simply does not do nothing.. Still my courses takes "2 days, 6 hours" for example.. https://prnt.sc/vlnp7aNovember 19, 2020 at 2:11 pm #325521VeronicaModeratorok let me check again I will provide tomorrow if I forget to do the same please ping meNovember 23, 2020 at 1:50 pm #326110karannaSpectatordid you forget about me? :)November 24, 2020 at 12:37 pm #326239VeronicaModeratorhi 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 thanksNovember 24, 2020 at 1:28 pm #326250VeronicaModeratorhi please try to add the below code as it will work like this http://prntscr.com/vp49b9add_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; }
-
AuthorPosts
- The topic ‘Total duration units + exam’ is closed to new replies.