Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
Is there any way that I can have the User Points module give points to my visitors for voting in polls?
What I would like to happen is: User Votes on Poll >> Earns ## Points. User Cancels Vote >> Loses ## Points.
I've noticed this request for previous versions, but am wondering if it will be implemented in upcoming versions or if there is some code that I can add for this functionality.
Thanks!
Comments
Comment #1
BerdirThere is no hook or anything in http://api.drupal.org/api/drupal/modules--poll--poll.module/function/pol..., which means that it can't be done easily.
The only way I can imagine this might be done is to hook_form_alter() the following form: http://api.drupal.org/api/drupal/modules--poll--poll.module/function/pol..., add a second submit callback to the vote button and then add/subtract points.
Moving to userpoints_nc, as this project just provides the UI and API to deal with points, other modules are responsible for adding points and everything node/comment related belongs to userpoints_nc.
Comment #2
GaxZE CreditAttribution: GaxZE commentedthis functionality would be great.
I looked at getting this to work with rules & voting rules but to no avail.