Very large page - Need advice

Discussion in 'ASP .Net' started by =?Utf-8?B?aG4=?=, Nov 16, 2004.

  1. 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.
     
    =?Utf-8?B?aG4=?=, Nov 16, 2004
    #1
    1. Advertising

  2. 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.

    --
    Ben Strackany
    www.developmentnow.com

    <a href="http://www.developmentnow.com">dn</a>


    "hn" <> wrote in message
    news:...
    > 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.
     
    Ben Strackany, Nov 16, 2004
    #2
    1. Advertising

  3. =?Utf-8?B?aG4=?=

    John Guest

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

    "Ben Strackany" <> wrote in message
    news:%23r$...
    > 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.
    >
    > --
    > Ben Strackany
    > www.developmentnow.com
    >
    > <a href="http://www.developmentnow.com">dn</a>
    >
    >
    > "hn" <> wrote in message
    > news:...
    > > 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.

    >
    >
     
    John, Nov 16, 2004
    #3
  4. 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.

    "Ben Strackany" wrote:

    > 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.
    >
    > --
    > Ben Strackany
    > www.developmentnow.com
    >
    > <a href="http://www.developmentnow.com">dn</a>
    >
    >
    > "hn" <> wrote in message
    > news:...
    > > 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.

    >
    >
    >
     
    =?Utf-8?B?aG4=?=, Nov 16, 2004
    #4
  5. well, unfortunately, that's the requirement.

    "John" wrote:

    > From a user point for view, I seriously wonder how many users will answer
    > 200 questions!
    >
    > "Ben Strackany" <> wrote in message
    > news:%23r$...
    > > 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.
    > >
    > > --
    > > Ben Strackany
    > > www.developmentnow.com
    > >
    > > <a href="http://www.developmentnow.com">dn</a>
    > >
    > >
    > > "hn" <> wrote in message
    > > news:...
    > > > 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.

    > >
    > >

    >
    >
    >
     
    =?Utf-8?B?aG4=?=, Nov 16, 2004
    #5
  6. =?Utf-8?B?aG4=?=

    Greg Fischer Guest

    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
     
    Greg Fischer, Nov 16, 2004
    #6
  7. So a dataset of 200 questions should be ok? Thanks for the advice, Greg.

    "Greg Fischer" wrote:

    > 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
    >
     
    =?Utf-8?B?aG4=?=, Nov 17, 2004
    #7
  8. =?Utf-8?B?aG4=?=

    Greg Fischer Guest

    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
     
    Greg Fischer, Nov 17, 2004
    #8
  9. 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

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Ravichandran J.V., Nov 17, 2004
    #9
  10. 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.
     
    =?Utf-8?B?U2NvdHQgU2ltb25z?=, Nov 17, 2004
    #10
  11. 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.
     
    =?Utf-8?B?aG4=?=, Nov 17, 2004
    #11
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Raymond Arthur St. Marie II of III

    very Very VERY dumb Question About The new Set( ) 's

    Raymond Arthur St. Marie II of III, Jul 23, 2003, in forum: Python
    Replies:
    4
    Views:
    524
    Raymond Hettinger
    Jul 27, 2003
  2. shanx__=|;-

    very very very long integer

    shanx__=|;-, Oct 16, 2004, in forum: C Programming
    Replies:
    19
    Views:
    1,728
    Merrill & Michele
    Oct 19, 2004
  3. Abhishek Jha

    very very very long integer

    Abhishek Jha, Oct 16, 2004, in forum: C Programming
    Replies:
    4
    Views:
    474
    jacob navia
    Oct 17, 2004
  4. Peter

    Very very very basic question

    Peter, Feb 8, 2005, in forum: C Programming
    Replies:
    14
    Views:
    548
    Dave Thompson
    Feb 14, 2005
  5. olivier.melcher

    Help running a very very very simple code

    olivier.melcher, May 12, 2008, in forum: Java
    Replies:
    8
    Views:
    2,383
Loading...

Share This Page