Online examination in ASP
#1

[attachment=14265]
Result.aspx.cs
Code:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Result : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    {
        string s = Convert.ToString(Session["abc"]);

        try
        {
            if (s == " ")
            {
                // int a = 0;
                ltrlResult.Text = "<h2>Sorry Your Score =0";
            }
            else
            {

                //int a = Convert.ToInt32(s);


                //if (a >= 6)
                //{
                //  
                Image1.ImageUrl = "~/images/img2.jpg";
                ltrlResult.Text = "<h2>Your Score Good= " + Session["abc"] + "</h2>";

                }
                //else
                //{

                //    Image1.ImageUrl = "~/images/img1.jpg";
                //    ltrlResult.Text = "<h2>Your Score  Poor= " + a.ToString() + "</h2>";

                //}
            //}
        }

            catch (Exception ee)
        {
            
            Response.Write(ee);
            }
        finally
        {
        }
        }
    

}


Registration.aspx.cs

Code:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;

public partial class Registration : System.Web.UI.Page
{
    SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["abc"].ConnectionString);

    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        SqlCommand cmd = new SqlCommand("insert into login      values(@name,@uid,@pwd,@sque,@sans,@email,@loc,@dob)",con);
        con.Open();
        string s = TextBox1.Text + "-" + TextBox2.Text;
        cmd.Parameters.AddWithValue("@name",s);
        cmd.Parameters.AddWithValue("@uid",TextBox3.Text);
        cmd.Parameters.AddWithValue("@pwd", TextBox4.Text);
        cmd.Parameters.AddWithValue("@sque", DropDownList1.SelectedItem.Text);
        cmd.Parameters.AddWithValue("@sans", TextBox6.Text);
        cmd.Parameters.AddWithValue("@email", TextBox7.Text);
        cmd.Parameters.AddWithValue("@loc", DropDownList2.SelectedItem.Text);

        cmd.Parameters.AddWithValue("@dob", TextBox8.Text);

        cmd.ExecuteNonQuery();
        con.Close();
        Label1.Text = "You Have Sucessfully Registerd Please Go to Login For Exam";

    }
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {


    }
}

Home.aspx.cs

Code:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;


public partial class Home : System.Web.UI.Page
{
    public static SqlConnection sqlconn;
    protected string PostBackStr;


    protected void Page_Load(object sender, EventArgs e)
    {
        sqlconn = new SqlConnection(ConfigurationManager.AppSettings["abc"].ToString());
        PostBackStr = Page.ClientScript.GetPostBackEventReference(this, "time");
        if (IsPostBack)
        {
            string eventArg = Request["__EVENTARGUMENT"];
            if (eventArg == "time")
            {
                getNextQuestion();
            }
        }
    }
    protected void btnStart_Click(object sender, EventArgs e)
    {
        if (DropDownList1.SelectedItem.Text == "Select Paper")
        {
            PanelMain.Visible = false;
            Panel1.Visible = true;
            lblName.Text = "Name : " + txtName.Text;
            //int score = Convert.ToInt32(txtScore.Text);
            lblScore.Text = "Please Select Paper : ";// +Convert.ToString(score);
            btnNext.Text = "Logout";
        }
        if (DropDownList1.SelectedItem.Text == "Math")
        {
            PanelMain.Visible = false;
            Panel1.Visible = true;
            lblName.Text = "Name : " + txtName.Text;
            int score = Convert.ToInt32(txtScore.Text);
            lblScore.Text = "Score : " + Convert.ToString(score);
            Session["counter"] = "1";
            Random rnd = new Random();
            int i = rnd.Next(1, 10);//Here specify your starting slno of question table and ending no.
            //lblQuestion.Text = i.ToString();
            getQuestion_math(i);
        }


        if (DropDownList1.SelectedItem.Text == "English")
        {
            PanelMain.Visible = false;
            Panel1.Visible = true;
            lblName.Text = "Name : " + txtName.Text;
            int score = Convert.ToInt32(txtScore.Text);
            lblScore.Text = "Score : " + Convert.ToString(score);
            Session["counter"] = "1";
            Random rnd = new Random();
            int i = rnd.Next(1, 10);//Here specify your starting slno of question table and ending no.
            //lblQuestion.Text = i.ToString();
            getQuestion_English(i);
        }
        if (DropDownList1.SelectedItem.Text == "Computer")
        {
            PanelMain.Visible = false;
            Panel1.Visible = true;
            lblName.Text = "Name : " + txtName.Text;
            int score = Convert.ToInt32(txtScore.Text);
            lblScore.Text = "Score : " + Convert.ToString(score);
            Session["counter"] = "1";
            Random rnd = new Random();
            int i = rnd.Next(1, 10);//Here specify your starting slno of question table and ending no.
            //lblQuestion.Text = i.ToString();
            getQuestion(i);
        }

        if (DropDownList1.SelectedItem.Text == "Science")
        {
            PanelMain.Visible = false;
            Panel1.Visible = true;
            lblName.Text = "Name : " + txtName.Text;
            int score = Convert.ToInt32(txtScore.Text);
            lblScore.Text = "Score : " + Convert.ToString(score);
            Session["counter"] = "1";
            Random rnd = new Random();
            int i = rnd.Next(1, 10);//Here specify your starting slno of question table and ending no.
            //lblQuestion.Text = i.ToString();
            getQuestion_science(i);
        }

      
    }
    protected void btnNext_Click(object sender, EventArgs e)
    {
        if (DropDownList1.SelectedItem.Text == "Select Paper")
        {
            Response.Redirect("Default.aspx");
        
        }

        if (DropDownList1.SelectedItem.Text == "Computer")
        {
            getNextQuestion();
        }
        if (DropDownList1.SelectedItem.Text == "Science")
        {
            getNextQuestion_science();
        }
        if (DropDownList1.SelectedItem.Text == "English")
        {
            getNextQuestion_English();
        }
        if (DropDownList1.SelectedItem.Text == "Math")
        {
            getNextQuestion_math();
        }
    }
    public void getQuestion(int no)
    {
        string str = "select * from Question where slNo=" + no + "";
        SqlDataAdapter da2 = new SqlDataAdapter(str, sqlconn);
        DataSet ds2 = new DataSet();
        da2.Fill(ds2, "Question");
        if (ds2.Tables[0].Rows.Count > 0)
        {
            DataRow dtr;
            int i = 0;
            while (i < ds2.Tables[0].Rows.Count)
            {
                dtr = ds2.Tables[0].Rows[i];
                Session["Answer"] = Convert.ToString(Convert.ToInt32(dtr["Correct"].ToString()) - 1);
                lblQuestion.Text = "Q." + Session["counter"].ToString() + "  " + dtr["Question"].ToString();
                RblOption.ClearSelection();
                RblOption.Items.Clear();
                RblOption.Items.Add(dtr["Option1"].ToString());
                RblOption.Items.Add(dtr["Option2"].ToString());
                RblOption.Items.Add(dtr["Option3"].ToString());
                RblOption.Items.Add(dtr["Option4"].ToString());
                i++;
            }
        }
    }
    public void getNextQuestion()
    {
        if (Convert.ToInt32(Session["counter"].ToString()) < 10)//10 is a counter which is used for 10 questions
        {
            string s;
            if (RblOption.SelectedIndex >= 0)
            {

                if (Session["Answer"].ToString() == RblOption.SelectedIndex.ToString())
                {
                    int score = Convert.ToInt32(txtScore.Text) + 1;// 1 for mark for each question
                    txtScore.Text = score.ToString();
                    s = "Score : " + Convert.ToString(score);
                    Session["abc"] = s.ToString();
                    lblScore.Text = Convert.ToString(score);
                }
            }

            Random rnd = new Random();
            int i = rnd.Next(1, 10);
            //lblQuestion.Text = i.ToString();
            getQuestion(i);
            Session["counter"] = Convert.ToString(Convert.ToInt32(Session["counter"].ToString()) + 1);

        }
        else
        {
            Response.Redirect("Result.aspx");
            Panel2.Visible = false;
            //code for displaying after completting the exam, if you want to show the result then you can code here.
        }
    }







//math
    public void getQuestion_math(int no)
    {
        string str = "select * from Question_math where slNo=" + no + "";
        SqlDataAdapter da2 = new SqlDataAdapter(str, sqlconn);
        DataSet ds2 = new DataSet();
        da2.Fill(ds2, "Question_math");
        if (ds2.Tables[0].Rows.Count > 0)
        {
            DataRow dtr;
            int i = 0;
            while (i < ds2.Tables[0].Rows.Count)
            {
                dtr = ds2.Tables[0].Rows[i];
                Session["Answer"] = Convert.ToString(Convert.ToInt32(dtr["Correct"].ToString()) - 1);
                lblQuestion.Text = "Q." + Session["counter"].ToString() + "  " + dtr["Question"].ToString();
                RblOption.ClearSelection();
                RblOption.Items.Clear();
                RblOption.Items.Add(dtr["Option1"].ToString());
                RblOption.Items.Add(dtr["Option2"].ToString());
                RblOption.Items.Add(dtr["Option3"].ToString());
                RblOption.Items.Add(dtr["Option4"].ToString());
                i++;
            }
        }
    }
    public void getNextQuestion_math()
    {
        if (Convert.ToInt32(Session["counter"].ToString()) < 10)//10 is a counter which is used for 10 questions
        {
            string s;
            if (RblOption.SelectedIndex >= 0)
            {

                if (Session["Answer"].ToString() == RblOption.SelectedIndex.ToString())
                {
                    int score = Convert.ToInt32(txtScore.Text) + 1;// 1 for mark for each question
                    txtScore.Text = score.ToString();
                    s = "Score : " + Convert.ToString(score);
                    Session["abc"] = s.ToString();
                    lblScore.Text = Convert.ToString(score);
                }
            }

            Random rnd = new Random();
            int i = rnd.Next(1, 10);
            //lblQuestion.Text = i.ToString();
            getQuestion_math(i);
            Session["counter"] = Convert.ToString(Convert.ToInt32(Session["counter"].ToString()) + 1);

        }
        else
        {
            Response.Redirect("Result.aspx");
            Panel2.Visible = false;
            //code for displaying after completting the exam, if you want to show the result then you can code here.
        }
    }


   // Science
    public void getQuestion_science(int no)
    {
        string str = "select * from Question_science where slNo=" + no + "";
        SqlDataAdapter da2 = new SqlDataAdapter(str, sqlconn);
        DataSet ds2 = new DataSet();
        da2.Fill(ds2, "Question_science");
        if (ds2.Tables[0].Rows.Count > 0)
        {
            DataRow dtr;
            int i = 0;
            while (i < ds2.Tables[0].Rows.Count)
            {
                dtr = ds2.Tables[0].Rows[i];
                Session["Answer"] = Convert.ToString(Convert.ToInt32(dtr["Correct"].ToString()) - 1);
                lblQuestion.Text = "Q." + Session["counter"].ToString() + "  " + dtr["Question"].ToString();
                RblOption.ClearSelection();
                RblOption.Items.Clear();
                RblOption.Items.Add(dtr["Option1"].ToString());
                RblOption.Items.Add(dtr["Option2"].ToString());
                RblOption.Items.Add(dtr["Option3"].ToString());
                RblOption.Items.Add(dtr["Option4"].ToString());
                i++;
            }
        }
    }
    public void getNextQuestion_science()
    {
        if (Convert.ToInt32(Session["counter"].ToString()) < 10)//10 is a counter which is used for 10 questions
        {
            string s;
            if (RblOption.SelectedIndex >= 0)
            {

                if (Session["Answer"].ToString() == RblOption.SelectedIndex.ToString())
                {
                    int score = Convert.ToInt32(txtScore.Text) + 1;// 1 for mark for each question
                    txtScore.Text = score.ToString();
                    s = "Score : " + Convert.ToString(score);
                    Session["abc"] = s.ToString();
                    lblScore.Text = Convert.ToString(score);
                }
            }

            Random rnd = new Random();
            int i = rnd.Next(1, 10);
            //lblQuestion.Text = i.ToString();
            getQuestion_science(i);
            Session["counter"] = Convert.ToString(Convert.ToInt32(Session["counter"].ToString()) + 1);

        }
        else
        {
            Response.Redirect("Result.aspx");
            Panel2.Visible = false;
            //code for displaying after completting the exam, if you want to show the result then you can code here.
        }
    }




    // English
    public void getQuestion_English(int no)
    {
        string str = "select * from Question_English where slNo=" + no + "";
        SqlDataAdapter da2 = new SqlDataAdapter(str, sqlconn);
        DataSet ds2 = new DataSet();
        da2.Fill(ds2, "Question_English");
        if (ds2.Tables[0].Rows.Count > 0)
        {
            DataRow dtr;
            int i = 0;
            while (i < ds2.Tables[0].Rows.Count)
            {
                dtr = ds2.Tables[0].Rows[i];
                Session["Answer"] = Convert.ToString(Convert.ToInt32(dtr["Correct"].ToString()) - 1);
                lblQuestion.Text = "Q." + Session["counter"].ToString() + "  " + dtr["Question"].ToString();
                RblOption.ClearSelection();
                RblOption.Items.Clear();
                RblOption.Items.Add(dtr["Option1"].ToString());
                RblOption.Items.Add(dtr["Option2"].ToString());
                RblOption.Items.Add(dtr["Option3"].ToString());
                RblOption.Items.Add(dtr["Option4"].ToString());
                i++;
            }
        }
    }
    public void getNextQuestion_English()
    {
        if (Convert.ToInt32(Session["counter"].ToString()) < 10)//10 is a counter which is used for 10 questions
        {
            string s;
            if (RblOption.SelectedIndex >= 0)
            {

                if (Session["Answer"].ToString() == RblOption.SelectedIndex.ToString())
                {
                    int score = Convert.ToInt32(txtScore.Text) + 1;// 1 for mark for each question
                    txtScore.Text = score.ToString();
                    s = "Score : " + Convert.ToString(score);
                    Session["abc"] = s.ToString();
                    lblScore.Text = Convert.ToString(score);
                }
            }

            Random rnd = new Random();
            int i = rnd.Next(1, 10);
            //lblQuestion.Text = i.ToString();
            getQuestion_English(i);
            Session["counter"] = Convert.ToString(Convert.ToInt32(Session["counter"].ToString()) + 1);

        }
        else
        {
            Response.Redirect("Result.aspx");
            Panel2.Visible = false;
            //code for displaying after completting the exam, if you want to show the result then you can code here.
        }
    }



#region Connection Open
    public void ConnectionOpen()
    {
        try
        {
            if (sqlconn.State == ConnectionState.Closed) { sqlconn.Open(); }
        }
        catch (SqlException ex)
        {

        }
        catch (SystemException sex)
        {

        }
    }
    #endregion
    #region Connection Close
    public void ConnectionClose()
    {
        try
        {
            if (sqlconn.State != ConnectionState.Closed) { sqlconn.Close(); }
        }
        catch (SqlException ex)
        {

        }
        catch (SystemException sex)
        {

        }
    }
    #endregion


    
}
Reply
#2
to get information about the topic Online Examination full report,ppt and related topic refer the page link bellow

http://studentbank.in/report-online-exam...ull-report

http://studentbank.in/report-online-examination-project

http://studentbank.in/report-eexam-onlin...ion-system

http://studentbank.in/report-online-exam...4#pid53124

http://studentbank.in/report-online-exam...ort?page=2

http://studentbank.in/report-eexam-onlin...tem?page=2

http://studentbank.in/report-eexam-the-o...ion-system

http://studentbank.in/report-online-examination-in-asp

http://studentbank.in/report-online-examination

http://studentbank.in/report-online-examination-system
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: heatexchanger com loc ca, gizmo mn loc es, lkboiler com loc es, literature review of online examination system asp, integrityengg com loc es, feasibility report of online examination in asp net, www sakshieducation com apbhavitha aspx,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  Online Art Gallery project topics 2 4,994 12-09-2017, 01:27 PM
Last Post: Mohankumari
  Online Training and Placement mechanical engineering crazy 17 13,561 11-05-2017, 01:42 PM
Last Post: Guest
  online examination full report project report tiger 14 42,853 03-09-2016, 11:20 AM
Last Post: jaseela123d
  Online Ticket Reservation System for Cinema Halls Electrical Fan 16 19,338 04-07-2016, 03:10 PM
Last Post: visalakshik
  Online Dictionary nit_cal 2 2,305 06-04-2016, 12:16 PM
Last Post: dhanabhagya
  Development of an Online Course Portal for a campus seminar topics 5 6,596 19-03-2016, 02:13 PM
Last Post: dhanabhagya
  Online Rental House Web Portal smart paper boy 6 5,423 06-02-2016, 01:00 PM
Last Post: seminar report asees
  ONLINE TICKET BOOKING SYSTEM FOR PVR CINEMAS seminar class 9 14,576 25-01-2016, 01:20 PM
Last Post: Guest
  Online Library Management System Project report science projects buddy 15 46,105 24-02-2015, 01:53 PM
Last Post: Guest
Wink Development of a feature-rich, practical online on-request courses coordination syste computer science crazy 3 3,947 04-08-2014, 10:43 PM
Last Post: seminar report asees

Forum Jump: