Solved

how make a survey

Posted on 1998-12-19
2
202 Views
Last Modified: 2010-04-09
this is what i am trying to do:
i've a list of 100 items. in my homepage, i would like
my visitors to vote only one item at one time. it would be
ideal if i can make the list in a form of pull down dialog box. is it possible to limit them so that one ip address will be recorded once within 6 hours no matter how many time it votes?  this is basically what i want.  but i can give more points if the result can be analysis, ie i want to know which one has the highest score etc.
0
Comment
Question by:roylam
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
PBall earned 350 total points
ID: 1840821
I have done something similar in a form of a game using ASP.
Instead of using IP address I use a login system.  Each player can only play once every 12 hours since their last entry.

I'd imagine that using ip won't be too difficult since you might be able to get that from the server variables (I might be wrong since I don't use that too much).

Depending whether or not you want the same ip to be able to answer the same question again and again or not, different method can be implemented.

1. if it does matter,
create a table with ip address, last timestamp, and n bit fields (where n = number of questions).  This might not be the best table, but it will work for now, for future use you might want to separate it into two table and relate them to each other.

2. if it does not matter,
create a table with ip address, last timestamp only

now, on the initial page (before you show the question), execute a function that can detect the ip address, check that ip vs the table, if it exist, check the last timestamp and compare it with current time, if greater than or equal to 6, replace the timestamp with current time and generate a question number randomly and show the question (remember to pass the question number to a hidden form field for post processing).

Upon answering the question, your cgi script then can retrieve the question number from the hidden field and do whatever you want with it.  For example if each question is a multiple choice, and you have a question table like:

q.id
q.questiontext
q.answer1
q.answer2
q.answer3
:
q.answern

you might want to match each answer with a
q.answer1_freq (for the number of times this answer was given, etc.) Again this might not be the best way to layout the table, I hope you are familiar w/ table normalization.

If q.answer1 was given, update q.answer1_freq to include the new response (q.answer1_freq++)
etc. etc.

I hope I've given you enough info for you to start coding this thing :)

Good nuff?
0
 

Author Comment

by:roylam
ID: 1840822
it sounds really great, but i'm not very sure how to start.
would you please give some sample code?

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question