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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

ASP.Net Quiz, pass radiobutton selection between pages

  • 08-03-2012 10:03am
    #1
    Registered Users, Registered Users 2 Posts: 1,521 ✭✭✭


    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, Registered Users 2 Posts: 2,793 ✭✭✭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