How to programmatically award points to a user without paid version

[ad_1]

Hi,

Our website programmatically enrolls users in courses upon subscribing to our portal. This is obviously achieved by looping through the courses, and assigning each course to the new user.

We have opted for Gamipress plugin in our website because of it’s really awesome features and interface.
We have to award 60 points for registration, and 5 points for each course enrollment.
To avoid overwhelming users with numerous emails for each course enrollment, we’ve moved “Enrollment a Course” to achievement from “Points Award” and disabled emails for the enrollment achievements.
However, when a user is enrolled in courses using a loop, GamiPress fails to award achievements and their respective points for all the courses.

Therefore, we’re looking to programmatically award points to the user during programmatic course enrollment. I’ve been provided with the following references for guidance:

Creating a custom event: https://gamipress.com/snippets/tutorials/creating-a-custom-event/

Creating a custom event related to a specific post: https://gamipress.com/snippets/tutorials/creating-a-custom-event-related-to-a-specific-post/

GitHub repository for GamiPress: For example the function to award points can be found in the following link
https://github.com/rubengc/GamiPress/blob/master/includes/functions/points.php#L401

However, I’m uncertain about how to integrate all of this and write a code to programmatically award points for every course enrollment. It’s important to note that the points get updated starting from the second course enrollment. I would greatly appreciate assistance in providing a sample code to achieve this.

The page I need help with: [log in to see the link]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer