Prevent a user from being allocated points more than once when viewing a URL.

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
spessex's picture

Hi

I have a Rule that allocates a certain amount of points to a user when they visit a certain URL. However, how do I prevent them from accruing any more points if they re-visit the URL?

As background information, if the user completes a survey they get sent to a return URL which then allocates them the points. What I want to ensure is that they do not re-do the survey and then get more points!

My current Rule is:

{ "rules_ste_ls_test_1_complete" : {
"LABEL" : "STE - LS - TEST 1 - COMPLETE 22\u002F11\u002F13",
"PLUGIN" : "reaction rule",
"REQUIRES" : [ "rules", "userpoints_rules" ],
"ON" : [ "node_view" ],
"IF" : [
{ "data_is" : {
"data" : [ "node:url" ],
"value" : "http:\u002F\u002Flocalhost\u002Flinode\u002FMRFGR2_RETRY_Versions\u002FMRFGR2_RetryA_copy\u002Fcontent\u002Fcongratulations-and-thank-you-your-participation-our-survey-drupal-test-1"
}
}
],
"DO" : [
{ "userpoints_action_grant_points" : {
"user" : [ "site:current-user" ],
"points" : "10",
"tid" : "150280",
"entity" : [ "site:current-user" ],
"description" : "You have completed the survey and will receive 10 points",
"operation" : "Insert",
"reference" : "Test Survey 1 Reference 10 points",
"display" : 1,
"moderate" : "approved"
}
}
]
}
}

Thank you

Stephen

User Points

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: