I'm looking to build a very lightweight learning management system of sorts. I'll have 2 custom post types "Course" and "Lesson". I will associate the Lessons to the Courses, probably by using the Advanced Custom Fields plugin.
What I need to do is somehow track whether or not a user has "completed" or "viewed" a specific Lesson. I'll probably add a button that says "Mark as Complete" or something.
The question is, what information should I be saving, and how should I be saving it (when the user clicks the button)? Further, what table in the DB should this information be saved in?
I see that there are some plugins out there like WP Complete, but it doesn't offer exactly what I need. I'm open to any ideas/recommendations. Thanks!
I'm looking to build a very lightweight learning management system of sorts. I'll have 2 custom post types "Course" and "Lesson". I will associate the Lessons to the Courses, probably by using the Advanced Custom Fields plugin.
What I need to do is somehow track whether or not a user has "completed" or "viewed" a specific Lesson. I'll probably add a button that says "Mark as Complete" or something.
The question is, what information should I be saving, and how should I be saving it (when the user clicks the button)? Further, what table in the DB should this information be saved in?
I see that there are some plugins out there like WP Complete, but it doesn't offer exactly what I need. I'm open to any ideas/recommendations. Thanks!
If you're using ACF you can also attach custom fields to users. You can attach them by using the Location Rules (the ones in the 'User' subgroup), see Creating custom user profile pages with ACF
You could add a single relational → post object field in a field group, Filter by Post Type → Lesson.
Then you could use a front-end form which you can pre-populate with that specific lesson (see: Pre-populate Relationship field...) – then you might also want to hide the input with CSS.
update_user_meta($user_id,'lessons_completed','lesson_id')
or more complicated (lessons ids seperated with comma etc.) . Or Reverse! Add completed_users to lessons or courses custom metas and after that add user ids – Serkan Algur Commented Aug 2, 2018 at 8:44