Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

ASP.Net Quiz, pass radiobutton selection between pages

Options
  • 08-03-2012 11:03am
    #1
    Registered Users Posts: 1,493 ✭✭✭


    Im creating a simple quiz using ASP.Net,
    I have a few pages with questions, created using a radiobuttonlist, with the answers created using an arraylist.
    Then on the last page i have a score total.
    I was wondering how i can retrieve the selectedindex of the arraylist and compare it to the correct answers, and if correct a score will be added.

    Also theres a home page, with just a start quiz button, upon entering page 2, i would like a timer to start, and when the user gets to page 7, the timer stops, and a label shows the time taken.

    any help appreciated thanks.


Comments

  • Registered Users Posts: 2,790 ✭✭✭John_Mc


    mcw92 wrote: »
    Im creating a simple quiz using ASP.Net,
    I have a few pages with questions, created using a radiobuttonlist, with the answers created using an arraylist.
    Then on the last page i have a score total.
    I was wondering how i can retrieve the selectedindex of the arraylist and compare it to the correct answers, and if correct a score will be added.

    Also theres a home page, with just a start quiz button, upon entering page 2, i would like a timer to start, and when the user gets to page 7, the timer stops, and a label shows the time taken.

    any help appreciated thanks.

    Are the questions fixed or are they randomly selected on page load?

    You could use a session object to store the answers given and compute the final score on the results page by iterating through the session object and comparing the answer given to the correct answer.

    A Dictionary<int,int> which has the question number as the key, and the selected index of the answer as the value would work nicely.

    As for the timer, there are plenty of jQuery timers available


Advertisement