You must Sign In to post a response.
  • Category: .NET

    Creating a online Question paper

    Hi,
    This is Rajesh. i want to design one online question paper with four options. i am having one dropdown list to give no of questions. for example if i give 50 i have to get 50 questions . for that i have to get design form with all the controls. can anybody tell me how to design that form.

    Thanks&Regards
    M.Rajesh
  • #619134
    Database Design

    create a Table named: QuestionDetails with the following Columns as mentioned below

    qid int primarykey
    questions varchar(200)
    op1 varchar(100)
    op2 varchar(100)
    op3 varchar(100)
    op4 varchar(100)
    Ans varcahr(100)

    And declare the appropriate data types as mentioned above

    Also set the Primary Key for qid and set the Identity for it and Increment by 1.

    Inline Coding:
    Question.aspx

    <asp:DropDownList ID="DropDownList1" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
    <asp:ListItem Value="10">Ten</asp:ListItem>
    <asp:ListItem Value="20">Twenty</asp:ListItem>
    <asp:ListItem Value="50">Fifty</asp:ListItem>
    <asp:ListItem Value="100">Hundreds</asp:ListItem>
    </asp:DropDownList>



    Question.aspx.cs

    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
    int noquest=Convert.ToInt32(DropDownList1.SelectedItem.Value);

    string query;

    if (noquest == 10)
    {
    query = "Select top 10 questions from QuestionDetails";
    }

    elseif (noquest == 50)
    {
    query = "Select top 50 questions from QuestionDetails";
    }

    }


    Happy Programming !!!!!!!!! :)

    "IF YOU WANT TO SHINE LIKE A SUN FIRST YOU HAVE BURN LIKE IT".

  • #619219
    [Response removed by Admin. Read forum policies.]
    If it helps you then Rate this.

    Best Regards,
    Manoranjan Sahoo
    http://www.dotnetsquare.com
    Blog: http://blog.msahoo.net

  • #619521
    Hi Rajesh Muraharisetty,
    Its not difficult to create an online exam paper.
    First you need to design the database which will contain the question id, type of the paper, Question and 4 options and one field having the correct answer.
    So you need 5 firlds:
    1. Id int
    2. Question varchar(100)
    3. Option1 varchar(100)
    4. Option2 varchar(100)
    5. Option3 varchar(100)
    6. Option4 varchar(100)
    7. correctOption char(1)
    So thats all from database side.

    Now you need to create frontend: where you need to have a page with:
    1. Id TextBox
    2. Question textBox(readOnly)/label
    3. Option1 group Option Button
    4. Option1 group Option Button
    5. Option1 group Option Button
    6. Option1 group Option Button
    7. OK and Cancel button
    this is your aspx page.

    Now you need to write the code behind file for logic:
    for that you can write the buttonOk_click event:

    Create the connection, command, datareader...
    command objecte will get the wuestions one by one from the database and then when the user will click the any option, it should store its value by checking the answer from the same table and at the end , you cna count the number of correct answers.

    if you want that the user should also be able to see their answers then you need to create one more tabel which will contain the user details and answer option. so that when evenr you want to show to the user, you cna retreive the answer from the base tabel and map it with user table.

    Regards,
    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)
    pawansoftit@gmail.com

  • #619761
    Thanks a lot for reply.. But i have to use with Xml but not database.

    Regards,
    Rajesh M


  • This thread is locked for new responses. Please post your comments and questions as a separate thread.
    If required, refer to the URL of this page in your new post.