I’ve developed a custom survey system for someone using PHP and no database. The survey is described in a text file (*.ini format). The survey description includes a survey name, an intro message, and a thank you message. There are four types of questions: open ended (textbox); grid of multiple choice questions, all with the same possible answers (“On a scale of 1 to 5…”); single multiple-choice questions with single answers (“Yes/No/Maybe”); and single multiple-choice questions with multiple answers (“Check all that apply”). Questions of the same type can be grouped into sections, and sections can have an optional title, which displays on the survey form.
The form makes sure all questions are answered, saving work completed so far between trips to the server, and when done, displays the form with all inputs disabled and the submit button hidden so the user can optionally print it out for his or her records. I use a hidden value in the form as well as the post/redirect/get method to prevent multiple submissions of the same survey.
The results are saved to a CSV file, each entry with a timestamp. The CSV file has the same name as the survey description file, except with the string “-resp” appended. This way, files for multiple surveys can live in the same directory. The survey script uses a GET variable to tell which survey description file to use (e.g. http://example.com/survey.php?file=survey36)
Separately, I have a script that takes the CSV file and summarizes the responses, providing a results table section by section. The results show each question and the response count and response percentage for each answer, thus you can tell at a glance, for example, that your diners love your service but don’t care for the food.
The whole project is about 650 lines of PHP, HTML, and CSS plus comments. The code isn’t MVC or object oriented, but it’s plain and clear, with no tricky whizbangery and should prove simple to expand if desired. I also wrote general documentation on how to create the survey description files, about 2,000 words worth.
Do you think $1,000 is an appropriate price for this? It took me a bit over 40 hours to design, code, fully debug, and write the documentation, and the client usually pays me $25 for basic web work (tweaking his WordPress). I imagine a coder with mad skillz might have done it in 10 or 12 hours, but he would have also charged more than $25 an hour.
Thanks for your opinions.