cammo,

I have built such a form builder application for my real job(with  Cake!). It does not have a pretty UI like the commercial form builders:
but it works decently with a simple non-ajax creation form.

What I did was have a formelements table that held single form input elements that have a many-to-many with a forms table.
So a form is made up of one or more formelements and formelements can be reused for many form definitions.

I have another table called submittedforms that has relationship with the forms table. Each submitted form has many
records in a table called submittedvalues which also has a FK to the formelements table.

The formelements table has records with a field to hold the type of form (text, input, radio, select, checkbox, hidden etc).

Thus the submittedvalues table would hold all the collected data for each element on the form and relate it back to the "reusable" formelements.

The only disadvantage of this approach is that all data collected from the form will end up being stored individually in Char(254) fields.

This is not optimal but one optimization strategy is to have multiple submittedvalue type tables with fields that are
appropriately typed and sized for the type of data collected for each type of formelement.

For instance you could have a submittedvalues_radio which would have a field that held an integer/binary perhaps instead of
a generic 254 Character field. This table would hold all submitted values for formelements of a type radio.

Thus a complete form will have many submissions, each submission is a collection of data for each formelement that makes up
the form and thus pieces of data are stored individually as a record in the submittedvalues table.

The other option is to have a submitted values table, that for each record, will hold All of the form submitted data as a single serialized
array which would be very efficient from a high volume/collection standpoint. But then it would be hard to do data/statistical analysis
via sql on concatenated serialized answers.

I apologize if I am unclear but it is hard to explain the DB schema with words.

If the project is not going to be used by my employer, I will probably release the code in case it is useful for
anyone. It is my first cake project so there are probably lots of things that would make people cringe.

I also built it in mind for multiple uses. A generic form building/form data collection application has many uses including
making polls/surveys, online tests, a trouble ticket/helpdesk/bugtracking system, project/task tracking system and probably
much more if I think about it some more.

In my case my employer just wanted to automate a paper based form and the workflow around that paper form,
 and of course I warped it into something whose subset of features would handle collecting the data and tracking
the work and status around each submission ( a ticket/task tracking system ).

It is not clear to see from my attempted schema definition above but to add status tracking would entail just adding
a field to each submitted form entry that held a status and creating some UIs to change it. Presto, instant ticket/bug/task tracking
system.

In the case of a poll/survey, just some UIs to summarize the submitted values records by formelement and you can
show some statistics.

In the case of an online test, another table would probably hold records with correct answers for each formelement and then a
simple comparison with the submitted values table could calculate whether or not data submitted is correct.

So from my basic form creation/form submission application, it can easily be extended to a broader range of
applications.

Huy

cammo wrote:
Hi There,
I am trying to create a form builder in cakephp where multiple clients
can log in and create a form/survey and get the results of that survey.
 The problem I am having is that if each client creates a form with 10
custom fields I will need to have a seperate database table for each
form that is generated and also a table for each form to hold the
results.

Does anybody know of a better way to do this and/or if there are any
good tutorials, in cakephp or not on creating multiuser applications?

Any Help would be greatly appreciated.




  

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to