X
Tech

Dynamic survey or questionnaire generation

Sure: pick Linux (or Solaris) and Cocoon as your delivery mechanisms
Written by Paul Murphy, Contributor
Dear Bloggie:

I am developing a web hosted "self serve" application. Part of the functionality required is the ability for the client to create questionnaires to be distributed to a group of people who will fill them as they perform a task (i.e. the questionnaire is an input to a subsequent step). I would like to be able to find an open source component that I can adapt and integrate into my software to provide questionnaire creation functionality. I've been told by some "experts" that the work involved in adapting , integrating and testing such a component was not worth the effort and that it would be cheaper for me to develop it from scratch.

The questions I have are: do open source "questionnaire creation" programs exist? - are they intended for stand alone only or is it possible to use them as components- what is the average/ reasonable amount of work I should expect to do to integrate it into my software- What criteria should I use in choosing open source components to minimize the work involved- Is there something i should have done before I started developing my app that would have made things easier/cheaper/ or would have given me a wider spectrum of choices when it comes to using open source components?

signed:

Question-able in Alberta

 

 

Dear Question-able:

There's good news and bad news. The good news is that a simple search of freshmeat and sourceforge will show you a healthy population of open source questionnaire generation and processing software. The bad news is that effective use of any of this stuff depends first on your other choices and secondly on the scale of your effort.

At the low end of the scale, where almost any OS/web server combination works, a simple Perl script can easily convert a text file containing a list of questions to an HTML document embedding a form and the within-page JavaScript needed to control user data entry. In this context whether you have people or another program generate that text file doesn't matter and, of course, processing the form is just another Perl or PHP script.

So how hard is that? Well if your application delivery environment is Apache 2.X on Linux, you use Perl with embedded JavaScript, and your questions are typically either multiple choice or use a controlled vocabulary to limit answers, a normally skilled Perl programmer should be able to give you a working product in a few hours at most.

At the high end of the scale Cocoon can do this with elegance and dispatch. Unfortunately Cocoon has a high learning threshold and works best in a fully open source (i.e. Unix) environment. I'm not saying you can't use it in other environments, I am saying you shouldn't.

Cocoon creates a publishing pipeline for your documents -and you can insert stuff into that pipeline at any point and really without serious restrictions on how you generate or process the result. You could, for example, use anything from an AWK script processing input text to a java based expert systems engine to generate the questionnaires in anything from HTML to a multi-part document meeting the forthcoming XML forms standard, and then benefit from the same flexibility on the processing needed when people complete them.

So how long would it take to set up your project using Cocoon? Obviously I don't know enough about your project to give you a clear answer -but my own experience suggests that a Cocoon expert can perform miracles in minutes. Be aware, however, that getting to be an expert isn't for triflers.

That said, let's review your questions:

 

  1. do open source "questionnaire creation" programs exist?

    Dana's the expert on this: Dana?

    You're talking here about a survey, not a questionnaire. The questionnaire is just the front-end of what you want.

    phpesp may be what your friend is looking for. It's a set of scripts, obviously written in php, offered under a BSD license. It's designed to help non-technical folks create, administer, and track surveys, all done online after a MySQL database initialization.

     

  2. are they intended for stand alone only or is it possible to use them as components?

    In Unix, anything that works stand-alone can also be used as a component. Under Windows most of these things would have inflexible processing dependencies. Although I believe there are Perl, PHP, and JavaScript bits around you could use as plug in components, I haven't really checked -but I'll bet Dana has.

    Dana:

    One of the great things about phpesp is that it's written in an interpreted language, thus it's a bit OS-independence. To learn more, check here.

     

  3. what is the average/reasonable amount of work I should expect to do to integrate it into my software?

    We'd love to see a follow-up question with more detail about your choices to date, your expected volume, and more information about the complexity of the questionnaires. Pending that, the answer is that it depends. If your software is all Perl or LAMP, no time at all. If it's BASIC, forget open source and write your own.

     

  4. What criteria should I use in choosing open source components to minimize the work involved?

    Consistency - one [Unix] environment, one tool-set, one learning curve.

     

  5. Is there something I should have done before I started developing my app that would have made things easier/cheaper or would have given me a wider spectrum of choices when it comes to using open source components?

    Sure: pick Linux (or Solaris) and Cocoon as your delivery mechanisms.

Editorial standards