Survey application with TurboGears and CatWalk

Part four


Collecting answers

We want answers! In order to collect them we implement the process method:

There is some trickery going on In order to collect the questions and options values. In our template we prefix our input names with 'question_' to avoid clashes with other input field on the page. To deal with checkboxes, we convert lists to comma delimited strings We add our values to the newly created Answer object, and finally we properly thanks our user =)

Use CatWalk to reviewing your answers

In CatWalk you choose your Survey (Survey->Browse ) and load the answers (Show rows)

Choose to preview an answer and load it's answers values to se what a single users submitted

Wrap-up

There are many ways in which you can improve your survey app. To start by implementing some kind of validation, adding more questions types (email, dates?) and a nicer look and feel =). More important if you wish to do some fancy data mining you should add an option reference to your answers values instead of storing plain strings. Then you can go bananas and implement some kind of reporting on top of this nice graphs, etc.

Download the survey project with CatWalk already mounted as a zip file

Enjoy!!

Copyright © 2004-2005 Ronald Jaramillo. All rights reserved. Contact & feedback