How can we improve Sensei by WooThemes?

Add "Next Lesson" button once lesson is complete

Hi,

This is a really daft one, but I was amazed this was not in Sensi.

Once you complete a lesson, what is the next step? The next step is the next lesson and there is no next lesson button!!!

class-woothemes-sensi-frontend.php

Around line 1175 after
} elseif( $show_actions ) {
sensei_reset_lesson_button();

Add
// Added for next lesson button at top and bottom of single course page
$nav_id_array = sensei_get_prev_next_lessons( $post_id );
$next_lesson_id = absint( $nav_id_array['next_lesson'] );

if ( 0 < $next_lesson_id ) {

// get_permalink( $next_lesson_id ) to make the next link

}

That's how I worked around it, just seems like something obvious that is missing.

Matt

86 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Matthew OgborneMatthew Ogborne shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    14 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • JesseJesse commented  ·   ·  Flag as inappropriate

        What about auto completing the lesson once the video is finished instead of making the user click the button?

      • Matthew OgborneMatthew Ogborne commented  ·   ·  Flag as inappropriate

        Hi Dan,

        Thanks for the update.

        We've been using a hybrid of the above for over 12 months and it works a treat. Good job we didn't wait!

        Matt

      • James RevilliniJames Revillini commented  ·   ·  Flag as inappropriate

        Come on, y'all ... as developers, we know there are always cases for every kind of desired functionality. I have courses with no quizzes. Watching the video is all that's needed to complete the lesson. I use Javascript to monitor for the video ending. I submit the complete lesson form at that point. This PHP code below handles the rest.

        Here's the code everyone is asking for. It can be added to functions.php in the theme or to a custom plugin. It's simple as hell.

        function sensei_user_lesson_end_goto_next () {
        global $post;
        $nav_id_array = sensei_get_prev_next_lessons( $post->ID );
        $next_lesson_id = absint( $nav_id_array['next_lesson'] );
        wp_redirect( get_permalink( $next_lesson_id ) );
        }
        add_action( 'sensei_user_lesson_end', 'sensei_user_lesson_end_goto_next' );

      • Mike KormendyMike Kormendy commented  ·   ·  Flag as inappropriate

        Well in that case the output would then output one of two progress screens:

        1) display a second screen that gives them their results and a button to continue to the next lesson (or module if that's the case).

        2) display a second screen that says success with quiz submission and a button to continue to the next lesson (or module if that's the case).

      • Mike KormendyMike Kormendy commented  ·   ·  Flag as inappropriate

        Some users aren't set up to see their results until after they are completed the course or until the teacher grades the quiz, so having this feature is very relevant.

        Plus it's a user experience gain. The grade/complete quiz button is in the same location as the complete/next lesson, and therefore implies the advance to the next lesson, not getting kicked back to the same page.

      • Mike LangfordMike Langford commented  ·   ·  Flag as inappropriate

        I would also like to add the the ability to have a next lesson button display once a video has completed playing. If you hare offering a video lesson for a member it would be nice to prompt them to the next video.

      • Mike KormendyMike Kormendy commented  ·   ·  Flag as inappropriate

        I tried this, but it didn't work. A better option however, would be to auto-advance to the next lesson when a user clicks the Complete button.

      • EmielEmiel commented  ·   ·  Flag as inappropriate

        Wow, thanks for this! WOuld you probably kow how to add a "Back to course main/home page" button to modules pages (from Sensei module add-on) too? That's also a navigational disaster! The one who knows how to insert a button like that in the template would be my hero!!

      • Anonymous commented  ·   ·  Flag as inappropriate

        I'd like to see clearer navigation between the main course page, successive lessons and also to help learners find the certificate. All that is included now are pieces of text and arrows that are kind of cryptic. I have added some text-based navigation links at the top of each lesson page. I haven't learned php yet, so I am wary of editing it.

      • Rueben DurandRueben Durand commented  ·   ·  Flag as inappropriate

        We experienced this problem and it occurs when you set the lesson status in settings to 'lessons are completed when "passed"' This means that you cant let a user move on until they pass a quiz that you must set at the end of the lesson.

        It would be nice to add a "next lesson" button at the TOP of the page too though.

      Feedback and Knowledge Base