CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 Survey

Print topic Send  topic

Author Message
computerforce

Posts: 21
Posted: 02/02/2007, 1:14 PM

It does seem the Survey can be really hard task.

Not an easy thing to make a solution. For example - if you have to make survey with different input types (multiple choice - single answer - radio, checkboxes, essay, ....) means your database tables can be quite complex.

Also - after input, the data has to be inserted into those database tables from forms.

Administration can be really complicated.

Anybody tried to do a project with minimum code, maximum codecharge automatic features?

Well, it seems not so complicated, isn't it?

I am sure many programmers would say that it's an easy task.

For example:

tbl_tests
IDtest
testdesc (description)

tbl_questions
IDquestion
IDtest (foreign key for IDtest from tbl_tests)
question
IDquestiontype (foreign key forIDquestiontype from tbl_questiontypes

tbl_questiontypes
IDquestiontype
questiontype (1. multiple choice single answer, 2. multiple choice multiple answers)

tbl_answers
IDanswer
IDquestion (foreign key for ID question from tbl_questions)
answer

tbl_surveys
IDsurvey
surveyfirstname
surveylastname
IDtest (foreign key for IDtest from tbl_tests
surveydate

tbl_results
IDresult
IDsurvey (foreign_key for IDsurvey from tbl_surveys)
IDquestion (filtered on IDsurvey)
result (one number for MCSA, few numbers for MCMA)

This example even does not have tbl_users (survey attendant fills name, lastname in tbl_surveys table).

Any question may have any number of possible answers.
Any survey may have any number of questions.

The main problem is:
When Survey Form is made, it must have something like this:

**********************************************************

Firstname: ____________________
Lastname: ____________________


1. I'll spend my hollidays (one answer - radio buttons):
O California
O Colorado
O Alaska
O Hawaii
O Florida

2. I like sports (multiple answers - check boxes):
X Skiing
X Swimming
X Jogging
X Hiking
X Snowboarding

SUBMIT

**********************************************************
O Radio Buttons
X Checkboxes


This means:

Not an easy task to have radiobuttons and checkboxes binding directly to table datasource, it has to be written after SUBMIT button is pressed, means it has to be in arrea.

When SUBMIT button is pressed data from area has to be written in table:
For example, attendant did choose Hawaii (27) from the first and Skiing (34) and Snowboarding (38) from the second question (in parenthesis I put IDanswer from tbl_answers), that means in table tbl_results must be two new rows, for example

tbl_result
IDresult__IDsurvey__IDquestion___result
....
33________4________45________27
34________4________46________34
34________4________46________38
....

The challenge is the Survey Form!
It must save the input data and insert two rows.

CCS cannot do that automatically.

Have to say again, that I am trying to do that in ASP.NET, VB.

As you know - PHP has serialize() and unserialize() that can do the perfect work if the radio buttons or checkboxes results would be saved in arrays (I am using PHP.... for a years, not always, but often).

Unfortunately, VB is .... different.

That forced the different approach, but I still think it can be solved thru (similar to what you wrote) dynamic labels (from database tables) and - for the last column of the table - dynamic radio buttons and checkboxes groups, type based on mentioned IDtype.

To make form variables of mentioned radio buttons and checkboxes, which results would be easily inserted thru loop of sql insert commands - seems to be the good solution.

There would be two pages:
First: choose survey;
Second: choose answers.

Complete survey (questions and answers for one survey) would be on one single page.
At the bottom - Submit button, of course, which will trigger insert into database -
insert into tbl_surveys (new IDsurvey, firstname, lastname, datetime, then
insert into tbl_results based on tbl_surveys IDsurvey all checked rows.

The main problem would be the (last) column of radio buttons, checkboxes, how to put them into the table, to look nice, and how to transfer checked items to database.

Seems to be easy, but .... In IT books (I have few names in mind, but do not want to advertise), on developers forums, there's a lot of static examples, with fixed number of one type of questions (mostly 4 radio buttons). Many of them even do not support more than one question and four radio button answers only.

Anybody has solution?
View profile  Send private message
wkempees


Posts: 1679
Posted: 02/06/2007, 6:35 AM

This thread is continued here:
http://forums.codecharge.com/posts.php?post_id=84367

_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.