Вы находитесь на странице: 1из 31

Project Report On Online Test

Bachelors of Technology In Computer Science Engineering

Under The Guidance of Mr. Vikas Verma Lecturer

Submitted by Nitin Gupta 10808447

Department of Computer Science Engg.


Lovely Professional University Phagwara140 401, Punjab (India)
Ph. (01824-506960-61)

Department of Computer Science Engineering Lovely Professional University Phagwara (Distt. Kapurthala) Punjab India 144001

Ref:__________

Dated: __________

Certificate

Certified that this project entitled Online Test submitted by Nitin Gupta (RK18E1A21), students of Computer Science Engineering Department, Lovely Professional University, Phagwara Punjab in the partial fulfillment of the requirement for the award of Bachelors of Technology (Computer Science Engineering) Degree of LPU, is a record of students own study carried under my supervision & guidance. This report has not been submitted to any other university or institution for the award of any degree.

Vikas Verma Lecturer

Acknowledgement

Apart from the efforts of me, the success of any project depends largely on the encouragement and guidelines of many others. I take this opportunity to express my gratitude to the people who have been instrumental in the this project. I would like to show my greatest appreciation to MR. Tajindar Sir. I cant say thank you enough for his tremendous support and help. I feel motivated and encouraged every time I attend his meeting. Without his encouragement and guidance this project would not have materialized.

The guidance and support received from all the members who contributed and who are contributing to this project, was vital for the success of the project. I am grateful for their constant support and help.

Abstract

The use of computer has been steadily increasing in science and technology since its invention. Computer Technology has spread its root in various areas including Industry, Science, Technology, Education and Business. Their application is increasing day by day in various other fields and their most recent conquest is Online Applications.

The online test system can be used by the students to take tests for various subjects. The questions have been designed to be objective/multiple.

The user has to register for the test. The Administrator provides a unique user name and password to the student. The user name and password will be required by the student for taking the test. At the end of the test the student can see his Result.

The tools and techniques that we are using are .NET and database SQL server 2008 for implementation. We chose .NET because of its speed and code reliability. Moreover, its high performance and multi language support. Also, database SQL server helps in retrieving data that is stored in its database so, the questions will be stored in database using SQL server.

TABLE OF CONTENTS 1. INTRODUCTION .............................................................................................................. 6-8 1.1 Purpose ..............................................................................................................................7 1.2 Scope ..................................................................................................................................8 Technology and Tool for Implementation ...................................................................... 7-15 2.1 Microsoft Visual Studio....................................................................................................9 2.2 .NET Features .................................................................................................................10 2.2.1 Easy Programming Model ...................................................................................10 2.2.2 Flexible Language Options ...................................................................................10 2.2.3 Great Tool Support................................................................................................10 2.2.4 Compiled execution ...............................................................................................10 2.2.5 Web-Farm Session State .......................................................................................11 2.2.6 Enhanced Reliability .............................................................................................11 2.2.7 Memory Leak, Deadlock and Crash Protection..................................................11 2.2.8 Easy Deployment ....................................................................................................11 2.2.9 Mobile Web Device Support .................................................................................11 2.3 How a .NET File Is Compiled ........................................................................................12 2.4 Asp. Net (Active Server Pages) ......................................................................................13 2.5 ASP .NET file ..................................................................................................................13 2.6 Working of ASP .NET ....................................................................................................13

2.

3 Running Programs14-30 3.1 Open A pop-up Box Using JavaScript ....................................................................14 3.2 For Loop .............................................................................................................. 14-15 3.3 Asp.net Form Coding ......................................................................................... 15-30 3.3.1 .aspx file:- ................................................................................................ 15-27 3.3.2 .aspx.cs file:- ........................................................................................... 27-30 4. REFERENCES31

1 INTRODUCTION

Online test System is a web based application which is used for conduct the exam or test on desktop. To give an exam a user required an acceptable user name and password provided by the administrator, with the help of this user name and password user login to this application. After this user have option to start the test. So by the use of this online test system the overhead of Examiner is reduced because there is no need of checking test papers etc.

1.1 PURPOSE

The purpose of online test System is to take online test in an efficient Manner and no time wasting for checking the paper. The main objective of On-line test simulator is to efficiently evaluate the candidate thoroughly through a fully automated system that not only saves lot of time but also gives fast results. For students they give papers according to their convenience and time and there is no need of using extra thing like paper, pen etc.

Security is also major part of online test if the test is secure then it is easy to evaluate the capability of candidate. Security means users are not allowed to use their desktop/laptop application like Calculator, e-book, search engine etc. The purpose of this system is to provide much better security then other system present till date.

System must be User friendly means that there are no such components which are not understandable, so that user can easily interact with system. Administrator has a privilege to create, modify and delete the test papers and its particular questions.

1.2 SCOPE
Online test system can be used in educational institutions as well as in corporate world. Like in education system online test are more helpful to conduct exam and calculate the result because all the work will be done in small amount of time. In corporate world aptitude test will be taken online then overhead of check test paper and time consumption is reduced.

Online test can be used anywhere any time as it is a web based application. So there no constraints that user must be present on examination hall so it is very helpful in distance learning or many more exams.

In online test there no restriction that examiner has to be present when the candidate takes the test. Because this test is highly secure so that user if user ever try to cheat then test will be submitted or say test will be ended.

2. Tools and Technology for implementation


The technology, tools and language used to implementation online test system are described below:-

2.1 Microsoft Visual Studio


Microsoft Visual Studio is a powerful IDE that ensures quality code throughout the entire application lifecycle, from design to deployment. Whether youre developing applications for SharePoint, the web, Windows, Windows Phone, and beyond, Visual Studio is your ultimate all-in-one solution. Microsoft Visual Studio It is used to develop 1. Microsoft Visual Studio used to develop Console and graphical user interface applications. 2. Microsoft Visual Studio used to develop Windows Forms applications, web sites, web applications, and web services. 3. Microsoft Visual Studio used to development for all platforms supported by Microsoft Windows, Windows Mobile, Windows CE, .NET Framework. 4. Microsoft Visual Studio includes a code editor supporting IntelliSense as well as code refactoring. 5. Microsoft Visual Studio used the integrated debugger works both as a sourcelevel debugger and a machine-level debugger. 6. Microsoft Visual Studio used include a forms designer for building GUI applications, web designer, class designer, and database schema designer. 7. Microsoft Visual Studio Support programming language include C/C++, VB.NET, C#,J# and F#.. 8. Microsoft Visual Studio 2010 comes with .NET Framework 4 and supports developing applications targeting Windows 7. It supports IBM DB2 and Oracle databases, in addition to Microsoft SQL Server.

2.2 .Net Features

2.2.1 Easy Programming Model


ASP.NET makes building real world Web applications dramatically easier. ASP.NET server controls enable an HTML-like style of declarative programming that let you build great pages with far less code than with classic ASP. Displaying data, validating user input, and uploading files are all amazingly easy. Best of all, ASP.NET pages work in all browsers including Netscape, Opera, AOL, and Internet Explorer.

2.2.2 Flexible Language Options


ASP.NET lets you leverage your current programming language skills. Unlike classic ASP, which supports only interpreted VBScript and JScript, ASP.NET now supports more than 25 .NET languages (built-in support for VB.NET, C#, and JScript.NET), giving you unprecedented flexibility in your choice of language.

2.2.3 Great Tool Support


You can harness the full power of ASP.NET using any text editor, even Notepad. But Visual Studio .NET adds the productivity of Visual Basic-style development to the Web. Now you can visually design ASP.NET Web Forms using familiar drag-drop-doubleclick techniques, and enjoy full-fledged code support including statement completion and color-coding.

2.2.4 Compiled execution


ASP.NET is much faster than classic ASP, while preserving the "just hit save" update model of ASP. However, no explicit compile step is required. ASP.NET will automatically detect any changes, dynamically compile the files if needed, and store the compiled results to reuse for subsequent requests. Dynamic compilation ensures that your application is always up to date, and compiled execution makes it fast.

10

2.2.5 Web-Farm Session State


ASP.NET session state lets you share session data user-specific state values across all machines in your Web farm. Now a user can hit different servers in the Web farm over multiple requests and still have full access to her session. And since business components created with the .NET Framework are free-threaded, you no longer need to worry about thread affinity.

2.2.6 Enhanced Reliability


ASP.NET ensures that your application is always available to your users.

2.2.7 Memory Leak, Deadlock and Crash Protection


ASP.NET automatically detects and recovers from errors like deadlocks and memory leaks to ensure your application is always available to your users. For example, say that your application has a small memory leak, and that after a week the leak has tied up a significant percentage of your server's virtual memory. ASP.NET will detect this condition, automatically start up another copy of the ASP.NET worker process, and direct all new requests to the new process. Once the old process has finished processing its pending requests, it is gracefully disposed and the leaked memory is released. Automatically, without administrator intervention or any interruption of service, ASP.NET has recovered from the error.

2.2.8 Easy Deployment


ASP.NET takes the pain out of deploying server applications. "No touch" application deployment. ASP.NET dramatically simplifies installation of your application. With ASP.NET, you can deploy an entire application as easily as an HTML page, just copy it to the server. No need to run regsvr32 to register any components, and configuration settings are stored in an XML file within the application.

2.2.9 Mobile Web Device Support


ASP.NET Mobile Controls let you easily target cell phones, PDAs and over 80 mobile Web devices. You write your application just once, and the mobile controls automatically generate WAP/WML, HTML, or iMode as required by the requesting device.

11

2.3 How a .NET File Is Compiled


Asp.Net applications actually go through two stages of compilation. In first stage, the C# code you are write is compiled into an intermediate language call Microsoft intermediate language (MSIL), or just IL. This first step is done due to reason that .NET can be languageinterdependent. All .NET languages (Include C#,VB,Java and many more). This compiled file with IL code is an assembly. The Second Level of Compilation happens just before the pages are actually executed. At this point, the IL code is compiled into low-level native machine code. This is known as just in time (JIT) compilation and it takes place in the same way for all .net application as shown in fig.2.3.1

Fig 2.3.1

12

2.4 Asp. Net (Active Server Pages)

ASP.NET Web Pages and the new Razor syntax provide a fast and lightweight way to combine server code with HTML to create dynamic web content. You can connect to databases, add video and graphics include social networking and add many more features using the latest web standards. ASP.NET is a server side scripting technology that enables scripts (embedded in web pages) to be executed by an Internet server. ASP.NET file is a program that runs inside IIS (Internet Information Services) which is Microsoft's Internet server. IIS comes as a free component with Windows servers .it is also a part of Windows 2000 and XP Professional

2.5 ASP .NET file


An ASP.NET file is just the same as an HTML file. It can contain HTML, XML, and scripts file also. Scripts in an ASP.NET file are executed on the server side .An ASP.NET file has the file extension ".aspx" and .aspx.cs. the aspx.cs file contain the programming language and .aspx contain the design of the form and application.

2.6 Working of ASP .NET


When a browser requests an HTML file, the server returns the file and when the browser requests an ASP.NET file, then IIS passes the request to the ASP.NET engine on the server. When the request is passes to ASP.NET engine reads the file, line by line, and executes the scripts in the file and Finally, the ASP.NET file is returned to the browser as plain HTML

13

3 Running Programs
3.1 Open A pop-up Box Using JavaScript

<html> <head> <script type="text/javascript"> function show_alert() { alert("Hello! Good Morning Sir !"); } </script> </head> <body>

<input type="button" onclick="show_alert()" value="Show alert box" />

</body> </html>
3.2 For Loop

<html> <body>

<script type="text/javascript"> var i=0;


14

for (i=0;i<=5;i++) { document.write("The number is " + i); document.write("<br />"); } </script>

<p>Explanation:</p>

<p>This for loop starts with i=0.</p>

<p>As long as <b>i</b> is less than, or equal to 5, the loop will continue to run.</p>

<p><b>i</b> will increase by 1 each time the loop runs.</p>

</body> </html> 3.3 Asp.net Form Coding


3.3.1 .aspx file:-

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

15

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title>

</head> <body> <form id="form1" runat="server"> <div> <center> <font color="red" size="4px">*</font>Required fields<br /> &nbsp;&nbsp;<fieldset style="width:60%;"> <legend> Personal info </legend>

<table class="style1" align="left" width="100%" cellpadding="6px" cellspacing="6px" style="background-color:Silver;">


16

<tr> <td align="right" width="50%"> <asp:Label ID="lb_fname" runat="server" Text="First Name" Width="50%" Height="100%"></asp:Label><br />

</td> <td width="50%" align="left"> <asp:TextBox ID="txt_fname" runat="server" style="margin-bottom: 0px"></asp:TextBox> <asp:RequiredFieldValidator ID="r_fname" runat="server" ControlToValidate="txt_fname" ErrorMessage="*" ForeColor="#CC0000" ValidationGroup="valid" Display="Dynamic"></asp:RequiredFieldValidator> </td> </tr> <tr> <td align="right" width="50%"> <asp:Label ID="lb_lname" runat="server" Text="Last Name" Width="50%" Height="100%"></asp:Label><br />

</td> <td width="50%" align="left"> <asp:TextBox ID="txt_lname" runat="server"></asp:TextBox>

17

<asp:RequiredFieldValidator ID="r_lname" runat="server" ControlToValidate="txt_lname" ErrorMessage="*" ForeColor="#CC0000" ValidationGroup="valid" Display="Dynamic"></asp:RequiredFieldValidator> </td> </tr> <tr> <td align="right" width="50%"> <asp:Label ID="lb_email" runat="server" Text="Email Id" Width="50%" Height="100%"></asp:Label><br />

</td> <td width="50%" align="left"> <asp:TextBox ID="txt_email" runat="server" ToolTip="example@example.com"></asp:TextBox> <asp:RequiredFieldValidator ID="r_email" runat="server" ControlToValidate="txt_email" Display="Dynamic" ErrorMessage="*" ForeColor="#CC0000" ValidationGroup="valid"></asp:RequiredFieldValidator> <asp:RegularExpressionValidator ID="r_invalid_email" runat="server" ControlToValidate="txt_email" ErrorMessage="Invalid Email ID" ForeColor="#CC0000"
18

ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([.]\w+)*" ValidationGroup="valid" Display="Dynamic"></asp:RegularExpressionValidator> </td> </tr> <tr> <td align="right" width="50%"> <asp:Label ID="lb_sex" runat="server" Text="Sex" Width="50%" Height="100%"></asp:Label><br /> </td> <td width="50%" align="left">

<asp:RadioButton ID="RadioButton1" runat="server" Text="Male" GroupName="sex" /> <asp:RadioButton ID="RadioButton2" runat="server" Text="Female" GroupName="sex" />

&nbsp;</td>

</tr> <tr> <td align="right" width="50%"> <asp:Label ID="lb_dob" runat="server" Text="Date Of Birth">

19

</asp:Label> </td> <td align="left" width="50%"> <asp:TextBox ID="txt_dob" runat="server" ontextchanged="txt_dob_TextChanged">

</asp:TextBox>

<asp:CalendarExtender ID="txt_dob_CalendarExtender" runat="server" TargetControlID="txt_dob"> </asp:CalendarExtender>

<asp:RequiredFieldValidator ID="r_dob" runat="server" ControlToValidate="txt_dob" ErrorMessage="*" ForeColor="#CC0000" ValidationGroup="valid" Display="Dynamic"></asp:RequiredFieldValidator> <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> </asp:ToolkitScriptManager> </td> </tr> <tr> <td align="right" width="50%">
20

<asp:Label ID="lbl_password" runat="server" Text="Password"> </asp:Label> </td> <td align="left" width="50%"> <asp:TextBox ID="txt_password" runat="server" TextMode="Password" ToolTip="Password"></asp:TextBox>

<asp:RequiredFieldValidator ID="r_password" runat="server" ControlToValidate="txt_password" ErrorMessage="*" ForeColor="#CC0000" ValidationGroup="valid" Display="Dynamic"></asp:RequiredFieldValidator> </td> </tr> <tr> <td align="right" width="50%"> <asp:Label ID="lbl_cpassword" runat="server" Text="Confirm Password"> </asp:Label> </td> <td align="left" width="50%"> <asp:TextBox ID="txt_cpassword" runat="server" TextMode="Password" ToolTip="Confirm Password"></asp:TextBox>
21

<br /> <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="txt_password" ControlToValidate="txt_cpassword" Display="Dynamic" ErrorMessage="Password Doesn't Match" ForeColor="#CC0000" ValidationGroup="valid"></asp:CompareValidator> </td> </tr> </table> </fieldset> <fieldset style="width:60%;"> <legend>Education Info </legend> <table cellpadding="5px" cellspacing="5px" width="100%" style="background-color:Silver;"> <tr> <td align="right" style="width:50%"> <asp:Label ID="lb_qualifiction" runat="server" Text="Qualification"></asp:Label> </td> <td width="50%" align="left"> <asp:DropDownList ID="dropdlist_qualification" runat="server" AppendDataBoundItems="True">
22

<asp:ListItem Selected="True" Value="0" Text="Select Qualification">

</asp:ListItem> </asp:DropDownList> </td> </tr> <tr> <td width="50%" align="right"> <asp:Label ID="lb_Country" runat="server" Text="Country"></asp:Label> </td> <td width="50%" align="left"> <asp:DropDownList ID="dropdlist_country" runat="server" AppendDataBoundItems="True"> <asp:ListItem Value="0" Text="Select Country"> </asp:ListItem> </asp:DropDownList> </td> </tr> <tr> <td align="right" width="50%"> <asp:Label ID="lb_uniname" runat="server" Text="College/University"></asp:Label>
23

</td> <td width="50%" align="left"> <asp:DropDownList ID="dropdlist_uniname" runat="server" AppendDataBoundItems="True"> <asp:ListItem Selected="True" Value="0" Text="Select College"></asp:ListItem> </asp:DropDownList> </td> </tr> </table> </fieldset> <fieldset style="width:60%;"> <legend> Submit </legend> <table style="background-color:Silver" width="100%" cellpadding="6px" cellspacing="6px">

<tr> <%--<td width="50%" height="30%"> <center> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate>

24

<asp:Button ID="btn_submit" runat="server" Text="Submit" /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </ContentTemplate> </asp:UpdatePanel> <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1"> <ProgressTemplate> <font color="red" size="4px">Records are submiting....</font> </ProgressTemplate> </asp:UpdateProgress> </center> </td> <td width="50%" height="30%"> <center> <asp:UpdatePanel ID="UpdatePanel2" runat="server"> <ContentTemplate> <asp:Button ID="btn_cancel" runat="server" Text="Cancel" onclick="btn_cancel_Click" /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </ContentTemplate> </asp:UpdatePanel> <asp:UpdateProgress ID="UpdateProgress2" runat="server" AssociatedUpdatePanelID="UpdatePanel2"> <ProgressTemplate> <font color="red" size="4px">Records are Clearing....</font>
25

</ProgressTemplate> </asp:UpdateProgress> </center> </td>--%> <td width="50%" align="right"> <asp:Button ID="btn_submit" runat="server" Text="Submit" /> </td> <td width="50%" align="left"> <asp:Button ID="btn_cancel" runat="server" Text="Cancel" onclick="btn_cancel_Click" /> </td> </tr>

</table> </fieldset> <br /> <br /> <br /> <br /> </center> </div> </form> </body>
26

</html> 3.3.2 aspx.cs file using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Data.SqlClient; using System.Configuration;

public partial class Default2 : System.Web.UI.Page { SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["OnlineTestDataConnec tion"].ConnectionString.ToString()); protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Page.Validate(); BindCountry();

27

BindQualification(); BindUniversity(); } } protected void BindCountry() { SqlDataAdapter da = new SqlDataAdapter("select * from country", con); DataSet ds = new DataSet(); da.Fill(ds);

dropdlist_country.DataTextField = "country"; dropdlist_country.DataValueField = "id"; dropdlist_country.DataSource = ds; dropdlist_country.DataBind();

} protected void BindQualification() { SqlDataAdapter da = new SqlDataAdapter("select * from qualification", con); DataSet ds = new DataSet(); da.Fill(ds); dropdlist_qualification.DataTextField = "qualification";
28

dropdlist_qualification.DataValueField = "id"; dropdlist_qualification.DataSource = ds; dropdlist_qualification.DataBind(); } protected void BindUniversity() { SqlDataAdapter da = new SqlDataAdapter("select * from university", con); DataSet ds = new DataSet(); da.Fill(ds); dropdlist_uniname.DataTextField = "university"; dropdlist_uniname.DataValueField = "id"; dropdlist_uniname.DataSource = ds; dropdlist_uniname.DataBind(); } protected void btn_cancel_Click(object sender, EventArgs e) { txt_dob.Text = ""; txt_email.Text = ""; txt_fname.Text = ""; txt_lname.Text = ""; txt_password.Text = ""; txt_cpassword.Text = ""; RadioButton1.Checked = false;
29

RadioButton2.Checked = false; Page.Validate();

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

} }

30

4. References
www.w3schools.com/html/html_intro.asp en.wikipedia.org/wiki/HTML msdn.microsoft.com/en-us/library/aa286483.aspx Pro ASP.NET 4.0 in C# 2008 ASP. NET 3.5 Enterprise Application Development with Visual Studio 2008 By-vince varallo lpu.lionsher.com gild.com indiabix.com

31

Вам также может понравиться