Click to See Complete Forum and Search --> : Online questionnaire
Abbas Haider
Jan 28th, 2008, 03:37 AM
Hi
I have seen online tests,online questionnaire. I have to ask that on what basis these are designed.
I know that the questions are stored in a database but how they are shown on the form. I mean that do controls are created on runtime or there is some other technique.
If controls like labels are designed on runtime then how their positions are maintained.
For example if there are 50 questions no body takes this task to create labels on forms and assign their positions on the form.
Also if there are MCQ's then how they are placed from the database
Please tell me that how this task is done
Thank You
A. Haider
Hack
Jan 28th, 2008, 07:37 AM
I'm sure each one has their own style.
If I knew I had 50 questions, and would never have more than, or less than, 50 questions, I would individual create all the controls and labels necessary to display them and record the responses.
szlamany
Jan 28th, 2008, 07:40 AM
We have our database control each "control" on the form - position - size - names - and so on.
They are each "cloned" from a (0) control array element on our form - at runtime.
This makes it very easy to have "extensible" forms - where the number of form controls varies from run experience to run experience.
But still allows you to have single events that fire in relationship to these controls - as they are all in control arrays.
btw - we have had issues with OPTION BUTTONS - they are a pain to create a runtime - setting certain ones to "true" causes events to backup and fire at the start of the form in a strange way.
Kasracer
Jan 28th, 2008, 07:59 AM
I would go with a dynamic approach. Create a class / control that is basically called "Question" or something like that. Then you would dynamically create them depending on how many questions there are in the database.
If I knew I had 50 questions, and would never have more than, or less than, 50 questions, I would individual create all the controls and labels necessary to display them and record the responses.
Sorry but this is a bad approach regardless if there are 50 questions and would never have more or less. What happens if someone wants to update a question? You'd have to re-deploy code rather than updating a database. What if a business user wants to update the questions? Do you really want to create 50 text boxes, 50 labels, etc?
I would opt for the creating a custom control called Question. This control would have a label, a textbox, some checkboxes and some radio buttons. It would basically dynamically display these items depending on the data supplied to it. Once this control is done, it's insanely simple to iterate through each control or to add/remove them.
By the time you finish manually adding all of these controls, I could have one of these custom controls done and you'd never need to worry again. Then you just query a database for the data.
RhinoBull
Jan 28th, 2008, 08:31 AM
We have our database control each "control" on the form...
I would also opt for database driven form layout/content - it's flexible and quite dynamic.
btw - we have had issues with OPTION BUTTONS - they are a pain to create a runtime - setting certain ones to "true" causes events to backup and fire at the start of the form in a strange way.
There are always plenty of "work arrounds" - raising some boolean/integer flag before setting OB value is most commonly used.
Hack
Jan 28th, 2008, 11:54 AM
Sorry but this is a bad approach regardless if there are 50 questions and would never have more or less. What happens if someone wants to update a question? You'd have to re-deploy code rather than updating a database. What if a business user wants to update the questions? Do you really want to create 50 text boxes, 50 labels, etc?If this were a desktop application I would agree with you.
It is an online webpage.
Make your changes and republish it. - Done
Kasracer
Jan 28th, 2008, 01:18 PM
It is an online webpage.
Make your changes and republish it. - Done
Again, that isn't simple for a business user to use and doesn't work well in an environment where you have to schedule deployments a week ahead of time.
Your method will work for a small website or small company but any large organization isn't going to just let you republish the site. You'll most likely want to put it into a QA environment, test, then schedule to have it put into production. All of this can be avoided via a very simple database driven design.
RhinoBull
Jan 28th, 2008, 02:50 PM
It is an online webpage.
Not that it's relevant but I was under impression that it's going to be a desktop based app.
Other than misleading title there is nothing that suggested otherwise... :confused:
szlamany
Jan 28th, 2008, 02:58 PM
I also took it to be desktop - online means so many different things to so many people...
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.