Very large page - Need advice

G

Guest

Hi all,

I have to design a quiz page which includes up to 200 questions. What users
do is they start the quiz, go to page1 with question1, enter some answers,
click next to go page2 with question2, and so on until they get to page100
then they will hit submit button to submit their answers.

My approach right now is: In one web form only,

- load all 200 questions (or depending on the requirement, could be 20 or
200 questions, ie the number of questions varies) into a dataset,

- then depends on the dataset size, dynamically create the same number of
panel controls to contain the questions and the textboxes for the answers,

- add the panel controls to the web form.

- then depends on the which question the user is at, I'll show the
corresponding panel and hide the other panels.

That way I can retain all user answers in one page.

However, since the page is so big ( could grow up to 200 panels), I'm not
sure this is a good approach.

My question, is it ok with this approach performance wise. Any idea of how
to do it. Thanks in advance.
 
B

Ben Strackany

Hmm...why are you requiring users to stay on the same page? For user
experience, or programming convenience?

You could instead show only one question on the page, have the user click
"Next" (which would be a submit button), then in your codebehind use
sessions and view state to store their answers thus far, determine the next
question to show, and when they're done, store all the information into a
database (or whatever).

IMO you should only do what you're doing if there's a reason why users
shouldn't refresh the page...maybe your users don't mind the initial wait
but hate page reloads.
 
J

John

From a user point for view, I seriously wonder how many users will answer
200 questions!
 
G

Guest

Hi Ben,

Everything is in the same page because of programming convenience only.
Since the number of questions varies, so I want to to create the pages
dynamically depending on the number of questions. I don't want to create 200
pages ahead. But yeah, I know it's not good that way.
 
G

Greg Fischer

On the same page because of convenience?

So you could display only one question at a time, you just dont want to
create 200 pages. right?

Why not just load the questions dynamically from a database? It would
look like 200 pages, but really you are only using 1 with 200 question
loaded individually. Then the page loads wont be so bad, and you dont
need setup 200 pages.

Greg
http://www.1stbyte.com
 
G

Greg Fischer

No it wouldn't be a dataset of 200 questions. It would be a dataset or
maybe a datareader of 1 question. You will hold the questions in a
database and draw from them based on what your user selects in the web
form interface or in your app logic, or both I guess.

You want to save your test answers, right? So you will need to have a
database to save them in, whether it be a text file or spreadsheet or
Access or SQL Server. Since using a text file or spreadsheet sounds
pretty limiting for what you want, just use an Access db. And since you
are using a db anyway, just save all your questions there instead of on
one BIG page.

I would bet you will want to have a few pages to make that app, but
certainly not 200.

Why does the # of questions vary? Different tests? (so diff amount of ?'s)

I hope this helps.

Greg
http://www.1stbyte.com
 
R

Ravichandran J.V.

You could keep all the questions in a single dataset. It is not such a
bad idea but having 200 panels is obviousl a bad idea. You could replace
the previous question using a user control with a text property. This
way all the 200 questions can be handled in the same page with the user
control.

with regards,


J.V.Ravichandran
- http://www.geocities.com/
jvravichandran
- http://www.411asp.net/func/search?
qry=Ravichandran+J.V.&cob=aspnetpro
- http://www.southasianoutlook.com
- http://www.MSDNAA.Net
- http://www.csharphelp.com
- http://www.poetry.com/Publications/
display.asp?ID=P3966388&BN=999&PN=2
- Or, just search on "J.V.Ravichandran"
at http://www.Google.com
 
G

Guest

I've done exactly what you are doing. What I did is create different pages
for different predefined question types (essays, something involving
calendars, multiple choice, etc...) Then what I did was stored each response
in the database, look for the maximum last question and assume that's the
question they were on. There was more to it than that and it worked great
(10,000 successful uses in a 3 month period.) So basically read only one
question at a time and it really won't matter if it's 10 or 10,000 questions.
 
G

Guest

Thanks everyone for being very helpful. I'll replace the question instead of
creating 200 panels. As for the user responses I'll store them in session
because as a requirement, nothing is saved until the user hits submit button.

You guys' ideas helped. Again, thank you all.
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top