• Resolved jviridis14

    (@jviridis14)


    Hello,

    I have a question about the structure of the database. I looked at this page here:

    https://lifterlms.com/docs/lifterlms-database-description/

    Which I was directed to before, but it doesn’t answer my question. Unless I am missing something. Under Courses in the back end you can see the users who are registered for a course, when they enrolled, how far they are in the course and the last lesson they completed.

    I need to know where in the database that data is stored so we can pull it for a custom report. It doesn’t seem to be under the llms_user_postmeta at least in the fields outlined on that webpage description. My next guess is under WordPress’ wp_posts table, wp_users or wp_postmeta and wp_usermeta, but after just browsing through looking for some time I couldn’t find it. I figured I would just ask and see if your response came faster than my searching.

    Thanks for any help.

    • This topic was modified 8 years ago by jviridis14.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jviridis14

    (@jviridis14)

    Update: After looking for awhile I came up with a new theory that this data is calculated by a script on the fly for each course as the page loads rather than being stored in the database somewhere.

    Is that accurate? If so, would you be willing to share the script used :)? Let me know if you have any thoughts for me on this.

    @jviridis14,

    All this data is accessible via functions found in the this class: https://github.com/gocodebox/lifterlms/blob/master/includes/class.llms.student.php

    You can pull the title of last completed lesson for course id 123 like so:

    
    $course_id = 123;
    $user_id = get_current_user_id();
    $student = new LLMS_Student( $user_id );
    echo get_the_title( $student-> get_last_completed_lesson( $course_id ) );
    

    There’s lots of methods in this class (and they’re all very clearly documented) so I’d recommend looking through the methods for what you need.

    I’m also in the midst of exposing a lot more of this data on the admin panel. Hopefully that will be publicly available in the next week or two so stay tuned

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Database Question- Progress and Last completed lesson’ is closed to new replies.