Forums Register Login

Logic needed for Survey tool

+Pie Number of slices to send: Send
Guys,

I'm creating an online survey tool wherein I have a set of questions with some radio button options in it. Whenever I'm creating a survey, I can set the conditions like for example, I select question 1 which has 5 options for it and based on the options that I select, I will be taken to question 2 and so on. I want to implement this logic using java/jsp/servlets. The jsp/servlet part is later but for now I want to know what packages in java that will help me do this??
[ May 17, 2007: Message edited by: Jothi Shankar Kumar Sankararaj ]
+Pie Number of slices to send: Send
Not an advanced question. Moving...
+Pie Number of slices to send: Send
Any help guys?
+Pie Number of slices to send: Send
you can achieve this by using java script & by using Switch case in jsp page or you can use Ajax
+Pie Number of slices to send: Send
Can't we do it by just writing classes??
+Pie Number of slices to send: Send
I'm not sure exactly what kind of answer you are looking for. If the problem is that you need to keep accumulating answers from previous pages when you're displaying the next one, then you can use an HTTP session to do that.

It is probably best to keep the code that displays the pages and collects the results generic. That means that the server reads the survey description from a file, where the questions to display and the types of answers expected (text, checkbox, radio buttons) is listed for each page. Then you can use the same code later (or even simultaneously) for other survey.
+Pie Number of slices to send: Send
Ulf,

It has to be done this way, I have a tool wherein the administrator can actually select the questions for today's survey and branch out conditions based on his selection.
+Pie Number of slices to send: Send
 

I have a tool wherein the administrator can actually select the questions for today's survey and branch out conditions based on his selection.



So that means that the questions for each survey are stored in a DB? That's even better than a file.

But in that case I don't understand what exactly you are asking or need help with.
+Pie Number of slices to send: Send
Ulf,

If you see some commercial survey tools, the questions that appear on the survey changes according to the user's response. I want to create a system which has a set of say 50 questions with 4 options to select (in the form of radio buttons). Now I'm the administrator, so I log on to the system and I configure the questions. Like I select 10 questions for a survey and I can configure those 10 questions in such a way that based on the answer for the first question, I will be directed to the next question or questions 3 and so on. I want to implement this logic. I have alreday done a sampling of it using a database, but I want to know if I can create a generic class without a database that can handle such a situation??
+Pie Number of slices to send: Send
 

I have alreday done a sampling of it using a database, but I want to know if I can create a generic class without a database that can handle such a situation?



You can certainly do that, but why would you? If the data isn't stored anywhere, what would the application do if the server went down? All data would be lost.
+Pie Number of slices to send: Send
 

I want to implement this logic. I have alreday done a sampling of it using a database, but I want to know if I can create a generic class without a database that can handle such a situation??



Of course you can create a class that defines all the possible flows of users through a survey in terms of the question numbers from some master list. Make it serializable so it can be saved and restored if the server restarts. Given that you want to handle branching in the survey this class is not going to be simple.

Remaining questions:
1. Whats the form of the master list of questions? (I would use XML since you don't want to use a database)
2. How do you maintain the history of a given user's responses?
3. How do you save that history for analysis?

Bill
+Pie Number of slices to send: Send
 

Originally posted by Ulf Dittmer:
.... what would the application do if the server went down? All data would be lost.


What about doing a file open, say in init(), and partially writing the file.

If the server goes down (unexpected condition) there's a mess to clean up anyway - something I am giving deep consideration to in my main() class - and a partially written file may or may not be recoverable due to issues reservered to the underlying OS [correct ?] so it's a productive challenge, but I like the original poster would rather write things in a class where I could see exactly what was going on.

Note: I recognize that this approach tends to incite deep loathing in some Grand Masters.
I like tacos! And this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1168 times.
Similar Threads
How to set -Xmx -Xms in Eclipse
Getting a String out of a dropdown menu
How can I dynamically read from radio button
Small problem while iterating over Collection with logic:iterate...
Setting an option value
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 15:33:10.