Closed (fixed)
Project:
User Points
Version:
6.x-1.x-dev
Component:
Code: userpoints API
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 Apr 2009 at 12:46 UTC
Updated:
18 Aug 2010 at 10:00 UTC
I think you should add the feature where when a user submits a webform using the webform module, you can make them to get points.
Comments
Comment #1
trevorleenc commentedthis would be a great feature, so if you had a site survey or something, you could award points when someone completes the survey...just one example I'm sure.
Comment #2
kbahey commentedThe clean way to do this is to write a new module that integrates userpoints with Webform. It would implement a hook_someting that webform implements and act accordingly.
If webform does not have such a hook, then doing a form_alter on the specific form and adding a submit handler that would call userpoints from there and add the points specified.
If someone writes such a module, please post an issue for userpoints_contrib and attach your module and info file.
Comment #3
boran commentedHere is some test code that seems to work for me.
Webform does not seem to have any usable hooks, so hook_form_alter was used.
And a bit of code to define MYMODULE_ settings and read in value on admin/settings/userpoints.
A module just for that seems a bit over the top, would be better to integrate into an existing module?
Comment #4
gausarts commentedJut a note: http://drupal.org/node/438688
Much simpler :)
Comment #5
Bilmar commentedMarking this fixed as solution was shared in http://drupal.org/node/438688 and mil1ion confirmed.
Also, this should be possible with Rules Forms support sub-module within Rules. Enable the form to be used with Rules, then set the rules event, conditions, actions.