Limiting responses to X number of times per IP per day

More
2 months 3 days ago #157718 by AshleyBarnett
AshleyBarnett created the topic: Limiting responses to X number of times per IP per day
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.

Please Log in to join the conversation.

More
1 month 1 week ago #158468 by AshleyBarnett
AshleyBarnett replied the 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)

Please Log in to join the conversation.

More
1 month 1 week ago #158497 by Joffm
Joffm replied the topic: Limiting responses to X number of times per IP per day
Hello, AshleyBarnett,

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

Best regards
Joffm

Please Log in to join the conversation.

More
1 month 1 week ago #158507 by AshleyBarnett
AshleyBarnett replied the 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.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now