database - How to track user progress?

I'm looking to build a very lightweight learning management system of sorts.I'll have 2 custom post types &q

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!

Share Improve this question asked Jul 31, 2018 at 21:14 dkeelingdkeeling 3391 gold badge2 silver badges11 bronze badges 2
  • 1 You can use users custom meta with the information of courses or lessons completed. you can use 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
  • 1 That's a good idea. I've started down the path of creating a separate table to relate users to lessons, but I'm still open to different/new/better ideas. Thank you! – dkeeling Commented Aug 2, 2018 at 14:12
Add a comment  | 

1 Answer 1

Reset to default 1

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 TypeLesson.

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745215613a4617001.html

相关推荐

  • database - How to track user progress?

    I'm looking to build a very lightweight learning management system of sorts.I'll have 2 custom post types &q

    4小时前
    50

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信