Home Forums ACF PRO Have a CPT checkbox field value specific for each user


Have a CPT checkbox field value specific for each user

  • Hello everyone !

    I’m building an online course system using ACF and I want to create a “to do checklist” functionality to every lesson.

    Context :
    Every lesson is a CPT named “lesson”.

    I’m having a repeater field assigned on every lesson CPT allowing the admin to add steps that the user have to follow.

    I’m able to display every row of the repeater dynamically on the front-end with Divi and Divi Engine plugins.

    My need :

    I want to add the ability for the user to check the steps when they are done. So I want to have a checkbox that the user car check or uncheck on the frontend.

    But the problem is that the saved checkbox value need to be specific to 3 levels of information simultaneously : the lesson, the step (repeater row) and the user.

    So in the DB I need to have a table that store for every user the checkbox value for every step defined in each lesson CPT.

    When I add a new lesson with specific steps (repeater rows) I need to be able to edit the value of the checkbox for every users.

    Then I also need to make that work fast (maybe with JSON) because I don’t want to lookup in a huge user list for every single step value. Need to structure data efficiently.

    Some of the methods I’ve tried that didn’t worked :
    I tried to build a system to mirror the fields AND VALUES created in the lessons and make them appear on the user fields and make the checkbox only available on the user side. I tried to use “clone” fields, templates, relational fields, nested repeaters with relational fields, bidirectional relational fields but nothing worked and that created a big mess that I’ve cleaned up.

    Maybe there is a way to have only a specific field on a group assigned to a post type to have a unique value for each user ? I’m lost lol

    PS : I only have very very basic PHP skills, I can understand basic existing codes on a wordpress architecture and bring it little modification but I’m not able to code a plugin from scratch 🙂

    Futures enhancements if the first part is working :
    – Add more type of steps like one asking the user to submit a text allowing the teacher to ask question to check if the lesson is well learned or a more complicated quizz system with a score calculation
    – Filter the data as the courses programs will be structured like this : Program > Module > Lesson and i’m using woocommerce membership to restrict the content
    – By default the data of the steps is displayed on each course lessons but it would be interesting to build a synthesis of the user avancement on a specific page so I would need to be able to print the data based on the user for this page, instead of the lesson.

    Thanks in advance, guys !

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.