Need to get all available courses, units and disable all units besides the first

Hi,

I am coding some modifications.

1) How do I make my modifications update safe?

2) I need to get all available courses, do you store them as post_id? what about the units?

3) Once I get all the course id, I need all units except the first one to be disabled(how do I disable units using code?).

4) After the user completed the 1st unit, my wp-cron job will check if it has been 7 days after completion. I need unit completion hook to manage this.

5) I also need to save and print a PDF of the users inputs in each module. Any way to do this?
Are the user inputs, already saved in the database? How do I call them?

I think now you get the gist of what I am trying to make. I may pivot to a better idea if you have one.

Thanks

  • Vinod Dalvi

    Hi @Andrew,

    I hope you are well today and thank you for your questions.

    1) How do I make my modifications update safe?

    Don't make any changes in plugin core file instead develop new plugin or child theme to modify CoursePress plugin functionality.

    2) I need to get all available courses, do you store them as post_id? what about the units?

    We store them in wp_posts table having post_type as course and unit respectively which can be uniquely identified using post_id

    3) Once I get all the course id, I need all units except the first one to be disabled(how do I disable units using code?).

    Just don't fetch information of units which you want to disable.

    4) After the user completed the 1st unit, my wp-cron job will check if it has been 7 days after completion. I need unit completion hook to manage this.

    You can get status of unit completion of particular student by calling functions like init_student_status( $student_id ) which you will find in the following CoursePress plugin file.

    coursepress/includes/classes/class.course.completion.php

    5) I also need to save and print a PDF of the users inputs in each module. Any way to do this?
    Are the user inputs, already saved in the database? How do I call them?

    It is saved in the database and you can get it in PDF format from the following the Reports and Assessment pages of CoursePress plugin on the following path

    Admin Area -> CoursePress Pro -> Course
    Admin Area -> CoursePress Pro -> Reports

    Kind Regards,
    Vinod Dalvi

  • Andrew

    Hi,

    Just don't fetch information of units which you want to disable.

    I am using the default pages which coursepress created. I want the units to be visible to users so they know there are more units but are disabled. How?

    You can get status of unit completion of particular student by calling functions like init_student_status( $student_id ) which you will find in the following CoursePress plugin file.

    Will it tell me how many days it has been since unit completion?

    Thank again.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.