Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Limiting responses to X number of times per IP per day

  • AshleyBarnett
  • AshleyBarnett's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 7 months ago #157718 by AshleyBarnett
Greetings,

I have a survey setup which I'm using as a continuous poll. Using a direct SQL call, I'm getting the average of a question's answers (numerical values) and using that to change a graphic on the main site. The average is of answers provided in the last 24 hours.

I want people to be able to vote multiple times, so they can vote each day, but I don't want them to stuff the box, and so would like to limit it to 3 votes per day per IP (based on how multiple people in a house or business may want to vote). I am not using tokens, as that would limit how many times someone could vote. I'm not concerned with fraud, as it is a gag site, so the restrictions don't need to be foolproof.

Quotas don't seem like the right method, since those are restrictions based on answers, and IP and Time aren't answers, but perhaps quotas can be extended that way?

My PHP is rusty, but I'm not opposed to writing a plugin if required, and if directed on perhaps where to start. But overall, where is the best place to start?

Thank you for any assistance.
The topic has been locked.
  • AshleyBarnett
  • AshleyBarnett's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 6 months ago #158468 by AshleyBarnett
Replied by AshleyBarnett on topic Limiting responses to X number of times per IP per day
For completeness, I did end up both writing a plugin and modifying the LimeSurvey core to add a PluginEvent . I have this now implemented so that my site will pull the average of polling data from the previous 24 hours, and one can only vote 3 times every 24 hours.

(3 week late reply posted for when topic shows up in searches it shows a solution was found)
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 6 months ago #158497 by Joffm
Hello, AshleyBarnett,

I appreciate that you found a solution, but I'd more appreciate if you shared it to the community.

Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • AshleyBarnett
  • AshleyBarnett's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 6 months ago #158507 by AshleyBarnett
Replied by AshleyBarnett on topic Limiting responses to X number of times per IP per day
Joffm,

I figured I would, but there are a few things first. Given comments in the other thread , I want something to share that would work for other people (be it submitting the PR, how it works with LS 3 and templates, or trying beforeRegisterEvent again (I had problems last time).

Other than that, I need to figure out where I'd host the plugin, if on github, download on my page, elsewhere, or just as a comment/attachment on the forum. Decisions to be made.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose