Help Help!!! In designing ASP.NET Interactive/ Calculative Application.

  • Thread starter Dilip Bajaj via .NET 247
  • Start date
D

Dilip Bajaj via .NET 247

Hello Guys,

I have got to build ASP.NET Application, which has lot ofQuestions and Answers types of Web Forms Application.

All the answers (responses) is required to validate eithermandatory, numeric, range etc.

There are lots of calculative fields based upon the responses offew questions.

for eg:
Question 1 How many cars do u have? = 60
Question 2 How many boats do u have? = 30
Question 3 Total Vehicles = Question1 + Question2
Question 4 Average Vehicles = Question 3 / 2
Question 5 Total Vehicles in this Area = Question 4 * 12

Now my problems is How to dynamically generate Validations Rulesand Calculations for this kind of questions if the formulas arestored in the database. This sounds very simple if thecalculations are very few and to be done on the fly for fewquestions if the formulas hard-coded in the functions. Butimagine there are 200-300 questions which are stored in thedatabase and each responses of each users has to be stored inthe database. Each user responses has to be validated and eachcalcuative field is one type of question which has to bedisplayed on the fly as soon as the values entered in the webform and with its calcuations, entered values all has to bestored in the database for generating reports later on.

Can any one suggest the arhictecture of such application and willbe much appreciated if anyone has the developed applicationsimiliarly.

I am also very confused should I create the dynamic ASP.NET pagesor just hard code the question in the straight ASP.NET webpages? Performance is also main criticial criteria for this.

Pls. your quick responses and suggestions will be extremelythankful and much much appreciated.

Regards,
Dilip
 
L

Lau Lei Cheong

Just some quick thoughts.

One thing that come into my mind is to check if eval(inputstr) = NaN and
catch any exception generated(it's done in client-side javascript), but then
you should check the string against all the reserved words first to ensure
you won't run into trouble.

Alternatively a safer approach is to eval all consecutive alphabet
characters to null like this:
if (eval(strfragment1 + " == null)) {
// it's something not a predefined variable
}

"Dilip Bajaj via .NET 247" <[email protected]> ???
???...
Hello Guys,

I have got to build ASP.NET Application, which has lot of Questions and
Answers types of Web Forms Application.

All the answers (responses) is required to validate either mandatory,
numeric, range etc.

There are lots of calculative fields based upon the responses of few
questions.

for eg:
Question 1 How many cars do u have? = 60
Question 2 How many boats do u have? = 30
Question 3 Total Vehicles = Question1 + Question2
Question 4 Average Vehicles = Question 3 / 2
Question 5 Total Vehicles in this Area = Question 4 * 12

Now my problems is How to dynamically generate Validations Rules and
Calculations for this kind of questions if the formulas are stored in the
database. This sounds very simple if the calculations are very few and to be
done on the fly for few questions if the formulas hard-coded in the
functions. But imagine there are 200-300 questions which are stored in the
database and each responses of each users has to be stored in the database.
Each user responses has to be validated and each calcuative field is one
type of question which has to be displayed on the fly as soon as the values
entered in the web form and with its calcuations, entered values all has to
be stored in the database for generating reports later on.

Can any one suggest the arhictecture of such application and will be much
appreciated if anyone has the developed application similiarly.

I am also very confused should I create the dynamic ASP.NET pages or just
hard code the question in the straight ASP.NET web pages? Performance is
also main criticial criteria for this.

Pls. your quick responses and suggestions will be extremely thankful and
much much appreciated.

Regards,
Dilip
 
P

Peter Blum

Have you looked at this free survey building tool for ASP.NET: NSurvey?
www.nsurvey.org

If it doesn't help, you are going to need to add columns to your question
table to define the various validation rules. Once you have data available,
your code can create whatever it needs to represent that data such as a
RangeValidator if you have Min and Max rules assigned or run a calculation
from a string that describes the calculation: "{Q1} + {Q2}". You would
develop the parser for that.

--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

Hello Guys,

I have got to build ASP.NET Application, which has lot of Questions and
Answers types of Web Forms Application.

All the answers (responses) is required to validate either mandatory,
numeric, range etc.

There are lots of calculative fields based upon the responses of few
questions.

for eg:
Question 1 How many cars do u have? = 60
Question 2 How many boats do u have? = 30
Question 3 Total Vehicles = Question1 + Question2
Question 4 Average Vehicles = Question 3 / 2
Question 5 Total Vehicles in this Area = Question 4 * 12

Now my problems is How to dynamically generate Validations Rules and
Calculations for this kind of questions if the formulas are stored in the
database. This sounds very simple if the calculations are very few and to be
done on the fly for few questions if the formulas hard-coded in the
functions. But imagine there are 200-300 questions which are stored in the
database and each responses of each users has to be stored in the database.
Each user responses has to be validated and each calcuative field is one
type of question which has to be displayed on the fly as soon as the values
entered in the web form and with its calcuations, entered values all has to
be stored in the database for generating reports later on.

Can any one suggest the arhictecture of such application and will be much
appreciated if anyone has the developed application similiarly.

I am also very confused should I create the dynamic ASP.NET pages or just
hard code the question in the straight ASP.NET web pages? Performance is
also main criticial criteria for this.

Pls. your quick responses and suggestions will be extremely thankful and
much much appreciated.

Regards,
Dilip
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top