How to integrate Course + Quiz duration in a Certificate

Home Forums Legacy Support Support queries How-to & Troubleshooting How to integrate Course + Quiz duration in a Certificate

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #179689
    Baldamus
    Spectator
    Hi There, How is it possible to integrate the total Course + Quiz duration into a certificate as a shortcode? Thanks for your advice. Best regards, Michael  
    #179795
    Diana
    Participant
    @baldamus This shortcode is already there Refer: http://prntscr.com/l567kh
    #180078
    Baldamus
    Spectator
    Hi Diana, Thanks for your answer. Unfortunately that's not the right shortcode. I would like to print the total length of the films, the number of lessons and sessions in the certificate. They are displayed in the course overview. Is that possible? Kind regards, Michael
    #180241
    Diana
    Participant
    @baldamus Yes, it is possible and for that, I have to write a custom shortcode which will fetch all these values. Will share the code in few hours
    #180246
    Baldamus
    Spectator
    Hi Diana, That's very good news. Thank you very much. Please let me know when and where the new shortcodes will be available. Kind regards, Michael
    #180413
    Diana
    Participant
    This reply has been marked as private.
    #180527
    Diana
    Participant
    This reply has been marked as private.
    #180536
    Baldamus
    Spectator
    Hi Diana, Thank you for the code. Unfortunately, the length is not displayed in the certificate. What am I doing wrong? Please for short support. Screenshot Kind regards, Michael
    #180729
    Diana
    Participant
    @baldamus I guess, I have got the issue. Will update in few hours
    #183146
    Baldamus
    Spectator
    Hi Diana, I´m still waiting for an update. Do you have a bugfix for me? Kind regards, Michael
    #183208
    Diana
    Participant
    @Bladamus, Apologies for the delayed response here... add_shortcode('total_course_duration', 'total_course_duration'); function total_course_duration( $atts, $content = null ) { extract(shortcode_atts(array( 'field'   => '', 'course_id' =>'', ), $atts));   if(!isset($course) || !is_numeric($course)){ $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); } return '<strong>'.$duration.'</strong>'; } }
Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘How to integrate Course + Quiz duration in a Certificate’ is closed to new replies.