Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Play with my Survey Script?

by jerrygarciuh (Curate)
on Feb 24, 2002 at 19:14 UTC ( [id://147193]=perlquestion: print w/replies, xml ) Need Help??

jerrygarciuh has asked for the wisdom of the Perl Monks concerning the following question:

I realize I am asking for trouble posting this here but here goes. My Survey Script is *done* and can be seen here though it is not currently linked to main site for public consumption. I would love for folks to try it out and give feedback. It uses GD::Graph3d to create .pngs of the results. It has an easy admin backend for adding and deleting new polls. If there is an interest I would be glad to post the code, it is not all that impressive, I promise.

Some questions:

  • Is there a way to get GD to print text at a 45º angle, I can't find one in the docs. If the labels get long I have them go vertical but it is so hard to read!
  • How would folks keep people from voting more than once per 12 hours? Cookies? IP logging? Dynamic IPs would probably twart me, so I am leaning toward a No Cookie:No Vote bit.
I plan to add a bit to the survey deletion sub so it cleans up the .poll and .png files it has made as well, but other than than I am pretty happy with how it came out as it only took a week this time. As always thanks for all the CB and SOPW help I received. IMHO PM really is the best community on the www .
Peace,
jg
_____________________________________________________
It's not my tree.

Replies are listed 'Best First'.
Re: Play with my Survey Script?
by beebware (Pilgrim) on Feb 24, 2002 at 21:59 UTC
    For the surveys, I notice that by default one of the selection boxes is selected. Not really a good idea as people could just click 'vote' without reading the choices. Okay, forcing them to select an option (instead of just accepting the default), won't cause them to read the options, but it should increase the probablity.
    Cookies tied to a user-authenticiation system is probably a good idea, but always remember slashdot's advice on their polls:
    This whole thing is wildly inaccurate. Rounding errors, ballot stuffers, dynamic IPs, firewalls. If you're using these numbers to do anything important, you're insane.
    Unless you've got a authentication scheme which will guarantee that no one can get multiple-identities, there will be the possibilities of ballot stuffers. An intranet system would probably be secure (as you'll set up the user identities on people that you can physically see - plus you can lock it down to known email addresses and IP ranges), but on the general internet it's so easy for people to have multiple browsers, IP addresses, email addresses (I've got around 6 domains with unlimited email addresses on each - practically impossible to stop me ballot stuffing if I really feel like it: a just create a new user login for any email address I think of!), etc etc. Think very carefully if you are going to use the data for any important results (see this ZDNet story on how Microsoft 'alledgly' fixed one of the polls ZDNet was running).
Re: Play with my Survey Script?
by webfiend (Vicar) on Feb 24, 2002 at 19:37 UTC

    Hey, that's pretty!

    To get angled text in your image, you might want to look into the GD::Text::Align module, contained in the CPAN package GDTextUtil

    The easiest way to handle voting restriction would probably be cookies. I'm sure there are many others, but cookies are a good quick fix.

    "All you need is ignorance and confidence; then success is sure." -- Mark Twain
Re: Play with my Survey Script?
by gellyfish (Monsignor) on Feb 24, 2002 at 21:11 UTC

    You might want to consider what happens when you do this and then press the vote button ;-}

    Looks luverly apart from that

    Update: that's probably a little unfair ... you could try limiting the request method to POST and checking the menu_name parameter and putting a message if it isn't valid

    /J\

Re: Play with my Survey Script?
by sm3g (Hermit) on Feb 24, 2002 at 22:24 UTC
    This looks nice. I'd like to mess with the source if you're willing to share. I've been thinking of making something like this for a while but as someone always says, there's no reason to reinvent the wheel. Unless you wanted a wheel that was square shaped, or made of licorice. But that would just be silly.
    sm3g
    perl -le 's;;uoli;;$a=length;y;g-w;e-u;;;$a--;s;j;$a;;print'
      Here is the code.
      HTH
      jg
      _____________________________________________________
      It's not my tree.
Re: Play with my Survey Script?
by jlongino (Parson) on Feb 25, 2002 at 02:28 UTC
    I think something is busted. I tried to take the Beatles survey, but every one of the radio buttons were already selected and I couldn't deselect any. When I voted (lots and lots of times) the vote count incremented but the vote tallies on the graph did not change.

    --Jim

    Update: BTW, It looks good and shows promise.

      Jim,
      Thanks for trying it. I want to make no radio selected by default but my attampts have failed thus far. As for your votes, they all counted, however I am now trying to make the .png that the browser caches -expire=>'now' so multi-voters will see the new updated png which IS being created just not seen. You'll see it if you refresh the browser. Actually, rather than dealing with the multi-vote refresh, I would rather deal with the cookie routine so I can prevent multi-votes, LOL.
      Thanks for trying it.
      jg
      _____________________________________________________
      It's not my tree.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://147193]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2025-03-22 16:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When you first encountered Perl, which feature amazed you the most?










    Results (63 votes). Check out past polls.