Sabtu, 13 Juli 2013

Online Examination System Project in ASP.NET

Introduction:
You can conduct your examination online using online Examination system project. Basically this project is designed for helping conductor. This application is designed for college level project its not used for education purpose.

Login Control


This module provide interface with admin login also provide security to your project. Your admin can see your result or update your questions.






<%@ Page Language="C#" Theme="all" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Data" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        // check whether credentials are valid
        SqlConnection con = new SqlConnection(DBUtil.ConnectionString );
        try
        {
            con.Open();
            SqlCommand cmd = new SqlCommand("select * from oe_members where lname = @lname and pwd = @pwd",con);
            cmd.Parameters.Add("@lname", SqlDbType.VarChar, 10).Value = txtLname.Text;
            cmd.Parameters.Add("@pwd", SqlDbType.VarChar, 10).Value = txtPwd.Text;
          
            SqlDataReader dr = cmd.ExecuteReader();
            if (dr.Read())
            {
                Session.Add("mid", dr["mid"]);
                Session.Add("fullname", dr["fullname"]);
                Session.Add("dlv", dr["dlv"]);
                // update MEMBERS table for DLV
                dr.Close();
                cmd.CommandText = "update oe_members set dlv = getdate() where lname = @lname";
                cmd.ExecuteNonQuery();
                Response.Redirect("default.aspx");
            }
            else
            {
                lblMsg.Text = "Invalid Login!";
                dr.Close();
            }
        }
        catch (Exception ex)
        {
            lblMsg.Text = "Error --> " + ex.Message;
        }
        finally
        {
            con.Close();
        }
      
    }
    protected void dsLogin_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
    {
    }
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
<style type="text/css">
 .Hd
 {
     height:100px;
     margin:auto;
     background-color:#DFA;
 }

 .Hd1
 {
     width:1000px;
     height:100px;
     margin:auto;
     border-left:1px solid #ccc;
     border-right:1px solid #ccc;
   
 }

 .Fd
 {
     height:80px;
     margin:auto;
     background-color:#DFA;
 }

 .Fd1
 {
     width:1000px;
     height:80px;
     margin:auto;
     border-left:1px solid #ccc;
     border-right:1px solid #ccc;
   
 }

 .Nd
 {
     height:35px;
     margin:auto;
     background-color:#1AA;
 }

 .Nd1
 {
     width:1000px;
     height:25px;
     margin:auto;
     padding-top:10px;
     border-left:1px solid #ccc;
     border-right:1px solid #ccc;
     font-weight:bold;
    
    
 }


 .Md
 {
     height:500px;
     margin:auto;
     background-color:#ffA;
 }

 .Md1
 {
     width:1000px;
     height:500px;
     margin:auto;
     border-left:1px solid #ccc;
     border-right:1px solid #ccc;
    
    
 }
</style>
</head>
<body>
<center>
    <form id="form1" runat="server">
    <div class="Hd"><div class="Hd1"> <h2 style=" padding-top:30px;">ONLINE EXAMINATION SYSTEM</h2></div></div>
   
    <div class="Nd"><div class="Nd1"> <a style="color:White; font-family:Trebuchet MS;text-decoration:none;" href="login.aspx">About Us</a>  | <a style="color:White; font-family:Trebuchet MS; text-decoration:none;" href="contact.aspx">Contact Us</a>| <a style="color:White; font-family:Trebuchet MS; text-decoration:none;" href="all/adminLogin.aspx">Admin Module</a> </div></div>
   
    <div class="Md"><div class="Md1">
        <div style="width:400px; height:500px; color:Maroon; text-align:justify; padding:5px; line-height:25px; font-family:Trebuchet MS;  float:left;">
        <h3>About System</h3>
        OnlineExams is being launched because a need for a destination that is beneficial for both
institutes and students. With this site, institutes can register and host online exams. Students can
give exams and view their results. This site is an attempt to remove the existing flaws in the
manual system of conducting exams.
<br />Purpose
<br />Online Exams System fulfills the requirements of the institutes to conduct the exams online.
They do not have to go to any software developer to make a separate site for being able to
conduct exams online. They just have to register on the site and enter the exam details and the
lists of the students which can appear in the exam.
Students can give exam without the need of going to any physical destination. They can view
the result at the same time.
Thus the purpose of the site is to provide a system that saves the efforts and time of both the
institutes and the students.</div>
        <div style="width:500px; height:500px;  float:right;">
        <br />
        <br />
        <h4>Login</h4>
        <br />
        <table >
            <tr>
                <td>Login Name :</td>
                <td><asp:TextBox ID="txtLname" runat="server" Width="150px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtLname" ErrorMessage="Llogin name is missing!" Font-Bold="True">*</asp:RequiredFieldValidator></td>
            </tr>
            <tr>
                <td>Password :</td>
                <td><asp:TextBox ID="txtPwd" runat="server" TextMode="Password" Width="150px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtPwd" ErrorMessage="Password is missing!" Font-Bold="True">*</asp:RequiredFieldValidator></td>
            </tr>
           <tr>
          <td colspan="2">
              <asp:CheckBox ID="chkRemember" runat="server" Text="Remember Me" /></td>
           </tr>
        </table>
        <br />
        <asp:Button ID="btnLogin" runat="server" Text="Login" Width="116px" OnClick="btnLogin_Click" /><br />
        <br />
        <asp:Label ID="lblMsg" runat="server"></asp:Label>
        <p>
        <asp:ValidationSummary ID="ValidationSummary1" runat="server" HeaderText="Please correct the following errors:" Font-Bold="True" />
        <p/>
        <a href="all/newuser.aspx">New User?</a>
        &nbsp; &nbsp;
        <a href="all/forgotpassword.aspx">Forgot Password?</a> 
     
        <asp:SqlDataSource ID="dsLogin" runat="server" ConnectionString="<%$ ConnectionStrings:examConnectionString %>"
            SelectCommand="select * from members where  lname = @lname and pwd = @pwd"
                onselecting="dsLogin_Selecting">
            <SelectParameters>
                <asp:Parameter Name="lname" />
                <asp:Parameter Name="pwd" />
            </SelectParameters>
        </asp:SqlDataSource>
    </div></div>
    </div>
    <div class="Fd"><div class="Fd1"> <p style="color:Blue; font-family:Trebuchet MS; padding-top:20px; font-weight:bold;">Developed  By: Uma Siyota, Hariom, Babu Lal, Deepak Godara</div></div>
   
    </form>
</center>   
</body>
</html>
Project requirements
  • Visual studio 2010
  • Sql server 2008




Your project will submit after 5 hour 

Tidak ada komentar:

Posting Komentar