locked
problem with the quiz system RRS feed

  • Question

  • User1309511178 posted

    hi all..

    i am  making a quiz system in asp.net using C# vs 2008.having one equestion per page,with previous and back button.each question have four options with only one correct answer.The options are in a radio button list.I have a database which has two columns as QuestionID,CorrectAnswer.

    For viewing previous answer the user can click on previous button,so that he can see his previous marked answer and if feel he had marked the wrong option then he can mark the other one.

    Some Problems:-

    1. when clicking the previous button the option which was marked in radio button list got unchecked!!So,the user is unable to know which he/she had marked before.I want that the option remains checked so that the user knows what he/she had marked previously.
    2. After completing the quiz how can the answers selected by the user be compared with the CorrectAnswer stored in database and can be displayed in the result page having four columns as QuestionID,CorrectAnswer,UserAnswer,Right/Wrong in a grid view. 

           Though i am able to display the QuestionID and the CorrectAnswer in a grid view in the result page.

    plz help..

    Thanking in advance

    Monday, December 20, 2010 12:52 AM

Answers

  • User2019981500 posted

    Hi,


    this is behiviour of http or web application,so to keep track of your data persistance you need to use sessions or querystring. how?


    Just declare session varaiable for each page of your application to keep selected answer as checked on page load only like

    if(selected)

    {

    session["flag"]=1;

    }

    then  assign session variable to mantain this through out application like below

    radio.checked=session["flag"];


    regards


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, December 27, 2010 2:58 AM

All replies

  • User2019981500 posted

    Hi,


    this is behiviour of http or web application,so to keep track of your data persistance you need to use sessions or querystring. how?


    Just declare session varaiable for each page of your application to keep selected answer as checked on page load only like

    if(selected)

    {

    session["flag"]=1;

    }

    then  assign session variable to mantain this through out application like below

    radio.checked=session["flag"];


    regards


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, December 27, 2010 2:58 AM
  • User1309511178 posted

    hi shabirhakim1

    Thanks for ur valuable time.I Had tried it.But i am getting some errors like-"The name 'selected' does not exist in the current context".

    And--"Identifier expected; 'checked' is a keyword"

    As I am a rookie so i am not able to fully understand what u r saying.So can u please explain it a little bit.


    Thanks


    Thursday, December 30, 2010 2:03 PM
  • User2019981500 posted

    Hi


    Just go through this source code

    http://www.codeproject.com/KB/ajax/SimpleAjaxQuizUsingAtlas.aspx?artkw=asp.net%20source%20code%20quiz%20system


    http://script.wareseeker.com/ASP-NET/asp.net-online-quiz-with-use-of-xml-1.zip/30ae94c646


    http://www.itniki.com/script_source_review/129009-asp-net-online-quiz-with-use-of-xml.html

    if it wouldn't help you,let me know


    Regards

    shabir



    Friday, December 31, 2010 2:28 PM