Skip Navigation

[Closed] "Mark as complete" functionality

This support ticket is created 2 years, 12 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by Luo Yang 2 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#2030397

Hi,
I am trying to get a "Mark as complete" functionality for my website. We offer various classes with videos and most of our clients say they have issues keeping track of the classes they've already taken. We were hoping there was such functionality because most of the classes are Toolset Types.

I have attached a loom indicating what we're looking for.

knitfreedom.com

hidden link

hidden link

#2030681

Hello,

Thanks for the videos, there isn't such kind of built-in feature within Toolset plugins, you might consider custom codes.

In my opinion, it needs these:
1) Three post types:
- Class
- Lesson
- Student (each Student post's author is one WordPress user, Each WordPress user can have only one Student post)
https://toolset.com/course-lesson/how-to-create-custom-searches-and-relationships-for-users/

2) Setup below post type relationships:
- One-to-many relationship between "Class" and "Lesson"
- many-to-many relationships between "Class" and "Student", in the intermediary post type, add a custom field "Completed"
- many-to-many relationships between "Lesson" and "Student", in the intermediary post type, add a custom field "Completed"
https://toolset.com/course-lesson/how-to-set-up-post-relationships-in-wordpress/

3) In single "Lesson" post, you can display a relationship form for user to connect his "Student" with current "Lesson" post:
https://toolset.com/course-lesson/front-end-relationship-forms-for-connecting-posts/
After user submit the relationship form, use action hook "toolset_association_created" to trigger a PHP function, in this PHP function, do these:
1) Get the related class post by the current "Lesson" post
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_get_related_post

2) Get the all related Lesson posts by above class post ID
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_get_related_posts

3) Get related intermediary posts between "Lesson" posts and current "Student" post, if all intermediary post's "Completed" field values are completed, then update the "Completed" field value of intermediary post between "Class" and current "Student" post to be "completed".
https://developer.wordpress.org/reference/functions/get_post_meta/
https://developer.wordpress.org/reference/functions/update_post_meta/

For your reference.

#2030739

Hi Luo,
Thanks for your response. I was hoping we could leave this ticket open for another 24 hours while I go through the documentation and links you have provided just in case I may have follow-up questions.

#2032661

I have marked this thread as "Waiting for feedback" status, you can update here if needs more assistance for it.

The topic ‘[Closed] "Mark as complete" functionality’ is closed to new replies.