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

A Project on

Online Examination System


Submitted for partial fulfillment of award of BACHELOR OF TECHNOLOGY
Degree In

Information Technologhy

By Deepak lakshakar Ajit Singh Kamlesh kr Rajput


Name of Guide Mr.Ajay Parashar Miss.Dipti Mittal

Information Technology Hindustan College of science and Technology, Farah, Mathura UTTAR PRADESH TECHNICAL UNIVERSITY, LUCKNOW, INDIA April, 2012

Certificate
Certified that.Deepak lakshakar.Ajit Singh.Kamlesh Kr Rajput has carried out the Project work presented in this Report entitled Online Examination Technology. for the award of Bachelor of Technology from Uttar Pradesh Technical University, Lucknow under my supervision. The Report embodies result of original work and studies carried out by Student himself and the contents of the Report do not form the basis for the award of any other degree to the candidate or to anybody else.

(Project Coordinator) Miss.Dipti Mittal

(HOD) Mr.Shankar Thakar

Acknowledgement
The satisfaction that accompanies that the successful completion of any task would be incomplete without the mention of people whose ceaseless cooperation made it possible, whose constant guidance and encouragement crown all efforts with success. We are grateful to our project guide Mr.Ajay Parashar and Miss.Dipti Mittal for the guidance ,inspirationand constructive suggestions that helpful us in the preparation of this project. We also thank our colleagues who have helped in successful completion of the project.

Deepak lakshakar Ajit Singh Kamlesh Kr Rajput 0906413029 0906413001 0906413044

Preface Table of Contents


1. INTRODUCTION....................................................................................................... 4
1.1 PROJECT OVERVIEW......................................................................................................... ...................4 1.2 PROJECT SCOPE .....................................................................................................................................4 1.3 CURRENT 1.4 OTHER

FUNCTIONAL PROCEDURES.......................................................................4
.......................................................................4

PROJECTS

1.5 ROLES AND RESPONSIBILITIES ..........................................................................................................5

2. SOFTWARE DEVELOPMENT PLAN....................................................................... 6


2.1 ASSUMPTIONS .........................................................................................................................................6 2.2 DEPENDENCIES .......................................................................................................................................6 2.3 CONSTRAINTS..........................................................................................................................................6 2.4 RISK IDENTIFICATION...................................................................................................... ....................6 2.5 ESTIMATES................................................................................................................ ...............................6 2.5.1 EFFORT ...............................................................................................................................................6 2.5.2 COSTS.................................................................................................................. ................................6 2.5.3 SIZE OF DELIVERABLES ..................................................................................................................6 2.5.4 SIZE OF NON-DELIVERABLES.........................................................................................................6 2.6 PROJECT PLAN DELIVERABLES.........................................................................................................7 2.7 PROJECT LIFE-CYCLE ...........................................................................................................................7 2.8 PROJECT SCHEDULE(s)...................................................................................................... ....................7 2.8.1 PROJECT ACTIVITIES .................................................................................................... ...................7 2.8.2 SCHEDULES AND MILESTONES.....................................................................................................7

3. CRITICAL COMPUTER RESOURCES..................................................................... 7 4. FACILITIES AND TOOLS......................................................................................... 7 5. SOFTWARE CONFIGURATION MANAGEMENT PLAN ......................................... 7 6. SOFTWARE QUALITY ASSURANCE PLAN .......................................................... 8 7. COMMUNICATION PLAN......................................................................................... 8 8. TEST PLAN .............................................................................................................. 8 9. END USER SUPPORT PLAN................................................................................... 8 10. SOFTWARE PROJECT TRACKING & OVERSIGHT............................................ 8 APPENDICES................................................................................................................. 8
APPENDIX 1: DEFINITIONS .............................................................................................................................9

1 INTRODUCTION
1.1 PROJECT OVERVIEW This project is on online examination system.These day online examination is becoming a trend.It has reduced the use of paper and make the process of examination fast.Evaluation of examination paper has also become very fast. The main objective of on-line test simulator is to efficiently evaluate the candidate thoroughly through a fully automated system that not only save 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 1.2 PROJECT SCOPE Scope of this project is very broad in terms of other manually taking exams. Few of them are:i) This can be used in educational institutions as well as in corporate world. ii) Can be used anywhere any time as it is a web based application(user Location doesnt matter). iii) No restriction that examiner has to be present when the candidate takes the test.

1.4 Current Functional Procedures The whole process of assigning test and evaluating their scores after the test,was done manually till date. Processing the test paper i.e. checking and distributing respective scores used to take time when the software was not installed. 1.5 DISADVANTAGES OF CURRENT SYSTEM i) The current system is very time consuming. ii) It is very difficult to analyze the exam manually. iii) To take exam of more candidates more invigilators are required but no need of invigilator in case of on line exam. i) Results are not precise as calculation and evaluations are done manually.

The chance of paper leakage are more in current system as compared to proposed system Result processing takes more time as it is done manually 2.Literature Review 2.1 JAVA Java is a programming language originally developed by James Gosling at Sun Microsystems (which has since merged into Oracle Corporation) and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities. Java applications are typically compiled to bytecode (class file) that can run on any Java Virtual Machine (JVM) regardless of computer architecture. Java is a general-purpose, concurrent, class-based, object-oriented language that is specifically designed to have as few implementation dependencies as possible. It is intended to let application developers "write once, run anywhere" (WORA), meaning that code that runs on one platform does not need to be recompiled to run on another. Java is currently one of the most popular programming languages in use, particularly for client-server web applications, with a reported 10 million users. The original and reference implementation Java compilers, virtual machines, and class libraries were developed by Sun from 1995. As of May 2007, in compliance with the specifications of the Java Community Process, Sun relicensed most of its Java technologies under the GNU General Public License. Others have also developed alternative implementations of these Sun technologies, such as the GNU Compiler for Java and GNU Classpath. 2.2 ORACLE The Oracle Database (commonly referred to as Oracle RDBMS or simply as Oracle) is an object-relational database management system (ORDBMS) produced and marketed by Oracle Corporation. Larry Ellison and his friends, former co-workers Bob Miner and Ed Oates, started the consultancy Software Development Laboratories (SDL) in 1977. SDL developed the original version of the Oracle software. The name Oracle comes from the code-name of a CIA-funded project Ellison had worked on while previously employed by Ampex. An Oracle database systemidentified by an alphanumeric system identifier or SID comprises at least one instance of the application, along with data storage. An instance identified persistently by an instantiation number (or activation id: SYS.V_$DATABASE.ACTIVATION#)comprises a set of operating-system processes and memory-structures that interact with the storage. Typical processes include PMON (the process monitor) and SMON (the system monitor).Users of the Oracle databases refer to the server-side memory-structure as the SGA (System Global Area). The SGA typically holds cache information such as data-buffers, SQL commands,

ii)

and user information. In addition to storage, the database consists of online redo logs (or logs), which hold transactional history. Processes can in turn archive the online redo logs into archive logs (offline redo logs), which provide the basis (if necessary) for data recovery and for some forms of data replication. 2.3 GLASSFISH SERVER GlassFish is an open-source application server project started by Sun Microsystems for the Java EE platform and now sponsored by Oracle Corporation. The supported version is called Oracle GlassFish Server. GlassFish is free software, dual-licensed under two free software licenses: the Common Development and Distribution License (CDDL) and the GNU General Public License (GPL) with the classpath exception. GlassFish is the Reference implementation of Java EE and as such supports Enterprise JavaBeans, JPA, JavaServer Faces, JMS, RMI, JavaServer Pages, servlets, etc. This allows developers to create enterprise applications that are portable and scalable, and that integrate with legacy technologies. Optional components can also be installed for additional services. GlassFish is based on source code released by Sun and Oracle Corporation's TopLink persistence system. It uses a derivative of Apache Tomcat as the servlet container for serving Web content, with an added component called Grizzly which uses Java New I/O (NIO) for scalability and speed.

2 Software Development Plan


2.1 ASSUMPTIONS i) ii) iii) There should be sufficient time of 6 months. No non-disclosure agreements must be signed. There is no involvement of trade secrets or other proprietary information.

2.2 GROUP DEPENDENCIES The project does not depend on any other group because our group is solely developing it.

2.3 CONSTRAINTS

i)

ii)

The project must be completed by the end of the semester. It must include operational system, appropriate documentation, and a final presentation. Due to this time constraint, it may not be possible to complete the extra desired functionality. Particular team members need to be trained in the programming languages and environments chosen.

2.4 RISK IDENTIFICATION a) The organizational structure and format of the raw ASCII of the US Code may vary from title to title and revision to revision. Thus, we require a complete understanding of the input and a comprehensive system design. We can minimize problems by using a visible software process and intermediate deliverables. b) The maintenance of the software after delivery will require clear extensive documentation at the source level. 2.5 ESTIMATES 2.5.1 EFFORT A team of three students, within a three-month time frame, will develop the software. 2.5.2 COSTS Category M0-M1 Human Resources (internal) Human Resources (external) Purchases (COTS) Equipment Premises Tools Travel costs Training Review activities 5,000 10,000 4,000 70,000 20,000 6,000 M1-M2 70,000 20,000 Budget for Period INR M2-M3 70,000 M3-M4 70,000 M4-M5 70,000 M5-M6 70,000

Category M0-M1 Other Total Total cumulated 2,000 1 1 M1-M2 1,000 1 2

Budget for Period INR M2-M3 1,300 2 4 5 9 2 11 M3-M4 M4-M5 M5-M6 2,000 1 12

2.5.3 SIZE OF DELIVERABLES The preliminary estimates include: i) ii) iii) iv) 5000 lines of source code 30-50 pages of user documentation. 30-50 pages of reports. . 1000 lines of DTDs.

2.5.4 SIZE OF NON-DELIVERABLES The preliminary estimates include: i) 30-50 lines of test data. Filename: Feasibility Report Page Last modified: 17/08/11 Version: V.1.0 Printed: 18/08/11 2.5 PROJECT PLAN DELIVERABLES

Feasibility report
1.) ECONOMIC FEASIBILITY Economic analysis is most frequently used for evaluation of the effectiveness of the system. More commonly knows as cost/benefit analysis the procedure is to determine the benefit and saving that are expected from a system and compare them with costs, decisions is made to design and implement the system.In the system, the organization is most satisfied by economic feasibility. Because, if the organization implements this system, it need not require any additional hardware resources as well as it will be saving lot of time.

2.) TECHNICAL FEASIBILITY Technical feasibility centers on the existing manual system of the test management process and to what extent it can support the system. According to feasibility analysis procedure the technical feasibility of the system is analyzed and the technical requirements such as software facilities, procedure, inputs are identified. It is also one of the important phases of the system development activities.Therefore, the cost of maintenance can be reduced. Since, processing speed is very high and the work is reduced in the maintenance point of view management convince that the project is operationally feasible

Project schedule It will take apraox of 6 months to complete . Requirements i) ii) iii) iv) Apache tomcat Net beans Oracal 11g Adobe dreamweaver

Design document

2.6 PROJECT LIFE-CYCLE ITERATIVE ENHANCEMENT MODEL Iterative and Incremental development is at the heart of a cyclic software development process developed in response to the weaknesses of the waterfall model. It starts with an initial planning and ends with deployment with the cyclic interactions in between. Iterative and incremental development are essential parts of the Rational Unified Process, Extreme Programming and generally the various agile software development frameworks.

The basic idea behind the agile method is to develop a system through repeated cycles (iterative) and in smaller portions at a time (incremental), allowing software developers to take advantage of what was learned during development of earlier parts or versions of the system. Learning comes from both the development and use of the system, where possible key steps in the process start with a simple implementation of a subset of the software requirements and iteratively enhance the evolving versions until the full system is implemented. At each iteration, design modifications are made and new functional capabilities are added. The procedure itself consists of the initialization step, the iteration step, and the Project Control List. The initialization step creates a base version of the system. The goal for this initial implementation is to create a product to which the user can react. It should offer a sampling of the key aspects of the problem and provide a solution that is simple enough to understand and implement easily. To guide the iteration process, a project control list is created that contains a record of all tasks that need to be performed. It includes such items as new features to be implemented and areas of redesign of the existing solution. The control list is constantly being revised as a result of the analysis phase. The iteration involves the redesign and implementation of a task from the project control list, and the analysis of the current version of the system. The goal for the design and implementation of any iteration is to be simple, straightforward, and modular, supporting redesign at that stage or as a task added to the project control list. The level of design detail is not dictated by the interactive approach. In a light-weight iterative project the code may represent the major source of documentation of the system; however, in a critical iterative project a formal Software Design

Document may be used. The analysis of an iteration is based upon user feedback, and the program analysis facilities available. It involves analysis of the structure, modularity, usability, reliability, efficiency, & achievement of goals. The project control list is modified in light of the analysis results.

2.8 PROJECT SCHEDULE(s) 2.8.1 PROJECT ACTIVITIES The group has scheduled weekly meetings with the client, or guide Immediately following this client meeting, there will be regular group meetings to discuss questions and concerns with the project development.

CRITICAL COMPUTER RESOURCES

The software will be developed in a Linux environment with net beans oracle being the primary languages. We also require an extra wireless LAN card 4 FACILITIES AND TOOL

The client has provided the following facilities and tools for project development: Apachi Tomcat ,NetBeans 5 SOFTWARE CONFIGURATION MANAGEMENT PLAN

Purpose The Configuration Management Plan (CMP) defines the guidelines to be used to manage changes to the Customer Information Technology Support System (CITSS) production and test bed environments. CITSS will be implemented in major version releases, with each release containing additional system features, until all specified functionality is in place in the production environment. System Overview The office of the Chief Information Officer (CIO) and members of the Headquarters Collaboration Group need a reliable, up-to-date, automated IT support system that will improve support services delivered to their collective customers. CITSS will be the hub in the CDSI support service cycle, and can be used and accessed by other IT service providers.

The major functional objectives of CITSS are: Enable customer-focused services Facilitate single customer point-of-entry Support service-provider ownership of requests Integrate IT support functions with other business processes Empower seamless service delivery Reduce service response and resolution times Reduce support costs Increase customer satisfaction COTS Software CITSS is comprised of a number of COTS packages and operating systems. These packages include, but may not be limited to: Applix Enterprise Helpdesk WinBeep Tally NetCensus ServiceWares Knowledge Paks Reach Out Oracle Digital Unix Windows NT Server Novell We will identify the COTS packages by product name and version release number. The COTS, with documentation, will be stored in the test bed location at 656 Quince Orchard Road, Gaithersburg, MD, or in the production location at the DOE Germantown facility.

6 SOFTWARE QUALITY ASSURANCE PLAN

SCOPE This SQA process is tailored to fit the current software development effort and is related to the project planning and lifecycle description documents for this project. METHODOLOGY The methodology presented here is based on the Software Engineering Institute's (SEI) Capability Maturity Model (CMM) and the Institute for Electrical and Electronics Engineers (IEEE) standards for Information Management. This SQA process: Makes use of the principal project participants as defined in the SDLC and SPMP. Describes the processes for deliverable reviews and software testing. Defines deliverable class standards to be applied during reviews of stage deliverables. Identifies the work products produced as a result of the review and testing efforts. STANDARDS The following standards were used as guides to develop this SQA process. The standards were reviewed and tailored to fit the specific requirements of small database projects using the referenced SDLC: ANSI/IEEE 730.1: Standard for Software Quality Assurance Plans ANSI/IEEE 1028: Standard for Software Reviews and Audits ANSI/IEEE 1012: Standard for Software Verification and Validation SEI/CMMI: PPQA key process area

The following IEEE definitions apply to this SQA plan: Verification: The process of determining whether or not the products of a given stage of the software development life cycle fulfill the requirements established during the previous stage. Validation: The process of evaluating software at the end of the software development process to ensure compliance with software requirements.

7 COMMUNICATION PLAN The entire project status will be communicated to: Type of Communicatio n Project Meetings Sharing of project data Method / Tool Frequenc y/Schedul e Weekly and on event When available Information Participants / Responsibles

Internal Communication: Face to Face Project status, problems, risks, changed requirements All project documentation and reports Project status (progess) Wrap-up Experiences Project status - progress - forecast - risks Project Leader Project Team Project Leader Project Team Members Project Leader Project Leader Project Team

Shared Project Server

Milestone Meetings Final Project Meeting

Mail Mail

Before milestones Month 6

External Communication and Reporting: Project Report Excel sheet Monthly Project Leader

8 TEST PLAN

Software Testing is the process of executing a program or system with the intent of finding errors. Or, it involves any activity aimed at evaluating an attribute or capability of a program or system and determining that it meets its required results. Software is not unlike other physical processes where inputs are received and outputs are produced. Where software differs is in the manner in which it fails. Most physical systems fail in a fixed (and reasonably small) set of ways. By contrast, software can fail in many bizarre ways. Detecting all of the different failure modes for software is generally infeasible. Black-box testing The black-box approach is a testing method in which test data are derived from the specified functional requirements without regard to the final program structure. It is also termed datadriven, input/output driven , or requirements-based testing. Because only the functionality of the software module is of concern, black-box testing also mainly refers to functional testing -- a testing method emphasized on executing the functions and examination of their input and output data. White-box testing Contrary to black-box testing, software is viewed as a white-box, or glass-box in white-box testing, as the structure and flow of the software under test are visible to the tester. Testing plans are made according to the details of the software implementation, such as programming language, logic, and styles. Test cases are derived from the program structure. White-box testing is also called glass-box testing, logic-driven testing or design-based testing

9 END USER SUPPORT PLAN Pervasive offers IT and End Users three levels of support: Silver, Gold, and Platinum. The benefits and features at each level are tailored to meet the unique requirements of our customers. Support plans are offered for PSQL, Pervasive Integration Solutions, and Pervasive Postgres. Support Contracts are tied to each licenses product or solution from Pervasive Software. 10 SOFTWARE PROJECT TRACKING & OVERSIGHT The following tracking methods will be used to monitor the project status: Weekly group and client meetings. Continual update to the Feasibility Report, Requirements and Design Documents. A project web site with an online copy of all project-related materials for reference. One or two team members will head each major milestone.

11.MODULE DESIGN GRAPHICAL USER INTERFACE(SCREENSHOTS) MODULE 1:LOGIN PAGE

12. CODING 1.LOGIN.JSP <%-Document : index Created on : Jul 14, 2011, 3:29:53 PM Author : Anki --%> <%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %> <!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> <!-body { font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif; background: #4E5869; margin: 0; padding: 0; color: #000; }

padding: 0; margin: 0; } h1, h2, h3, h4, h5, h6, p { margin-top: 0; padding-right: 15px; padding-left: 15px; } a img { border: none;

a:link { color:#414958; text-decoration: underline; } a:visited { color: #4E5869; text-decoration: underline; } a:hover, a:active, a:focus { text-decoration: none; }

.container { width: 80%; max-width: 1260px; min-width: 780px; background: #FFF; margin: 0 auto; overflow: hidden;

.sidebar1 { float: left; width: 20%; background: #93A5C4; padding-bottom: 10px; } .content { padding: 10px 0; width: 60%; float: left; } .sidebar2 { float: left; width: 20%; background: #93A5C4; padding: 10px 0;

.content ul, .content ol { padding: 0 15px 15px 40px; } ul.nav { list-style: none; border-top: 1px solid #666; margin-bottom: 15px; } ul.nav li { border-bottom: 1px solid #666; } ul.nav a, ul.nav a:visited { padding: 5px 5px 5px 15px; display: block; text-decoration: none; background: #8090AB; color: #000; } ul.nav a:hover, ul.nav a:active, ul.nav a:focus { background: #6F7D94; color: #FFF; } / .fltrt { float: right; margin-left: 8px; } .fltlft { float: left; margin-right: 8px; } .clearfloat {

clear:both; height:0; font-size: 1px; line-height: 0px;

} --> </style></head> <body background="image/bg.gif">

<br> <div class="container">

<font face="Comic Sans MS"> <CENTER> <H1>&nbsp; </H1> <H1><u>Online Examination System</u> </H1> <% String s = request.getParameter("msg"); if( s != null){ %> <b><%= s %> </b> <% } %> </CENTER> <SCRIPT language="JavaScript"> function validate() { if(document.frm.uname.value==""||document.frm.pass.value=="") { alert("UserName or Password cannot be blank!!"); return; } document.frm.action="LogServ"; document.frm.submit(); }

</SCRIPT> <form name = "frm" method="POST"> <p align="center"><font size="5"><b>Login Form</b></font></p> <TABLE ALIGN="center" height="216"> <TR> <TD > <b>UserName:</b>

</TD> <TD > <input type="text" name="uname" size="20" tabindex="1"> </TD> </TR> <TR> <TD height="49" > <b>Password:</b> </TD> <TD > <input type="password" name="pass" size="20" tabindex="2"> </TD> <TR align="center"> <TD colspan=2> <input type="button" value=" Login " name="B1" onclick="validate();" tabindex="3"><br /> </TD> </TR> <TR > <TD height="102" ><font size="4">New User?</font></TD> <TD><a href="NewUser.jsp"><font size="4" color="black">Register</font></a></TD> </TR> </TABLE> </form> </font> </div> <marquee>Maintained by ankit with support of glassfish server</marquee> </body> </html>

2.LOGSERV.JAVA(SERVLET PAGE) /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package prj; import java.io.*; import java.net.*; import javax.servlet.*; import javax.servlet.http.*; import vvv.*; /** * * @author vm */ public class LogServ extends HttpServlet { /** * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods. * @param request servlet request * @param response servlet response */ protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { LogDataModel ldm = new LogDataModel(); // LogBean l = new LogBean(); LogBean lb =null; String u = request.getParameter("uname"); String p = request.getParameter("pass"); /* lb.setUname(u); lb.setPass(p);

lb.setUtype("t");*/

try{ lb = ldm.findLogger(u, p); if(lb != null) { HttpSession session = request.getSession(); session.setAttribute("user", u); // String s=ldm.addLogger(lb); response.sendRedirect("stud.jsp?msg="+u); // response.sendRedirect("default.jsp?msg="+u); } else { response.sendRedirect("index1.jsp?msg=Invalid user or password"); } }catch(Exception e) { response.sendRedirect("index1.jsp?msg="+e.toString()); // response.sendRedirect("default.jsp?msg="+e.toString());

} } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> /** * Handles the HTTP <code>GET</code> method. * @param request servlet request * @param response servlet response */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }

/** * Handles the HTTP <code>POST</code> method. * @param request servlet request * @param response servlet response */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Returns a short description of the servlet. */ public String getServletInfo() { return "Short description"; } // </editor-fold> }

3.LOGBEAN.JAVA package vvv; /** * * @author vm */ public class LogBean { private String uname; private String pass; private String utype; private String doc; private String doe; public void setUname(String uname) { this.uname = uname; } public void setPass(String pass) { this.pass = pass; } public void setUtype(String utype) { this.utype= utype; } public void setDoc(String doc) { this.doc= doc; } public void setDoe(String doe) { this.doe= doe; }

public String getUname() { return this.uname; } public String getPass() {

return this.pass; } public String getUtype() { return this.utype; } public String getDoc() { return this.doc; } public String getDoe() { return this.doe; }

4.LOG DATA MODEL.JAVA package vvv; /** * * @author vm */ import java.sql.*; import java.util.*; public class LogDataModel { Connection con = null; private boolean validate(LogBean lb) { if (lb.getUname() == null || (lb.getUname()).length() <= 0) return false; if (lb.getPass() == null || (lb.getPass()).length() <= 0) return false; if (lb.getUtype() == null || (lb.getUtype()).length() <= 0) return false; return true; } public String addLogger(LogBean lb1) throws Exception { String r=""; if(lb1 != null) { if (validate(lb1)) { Class.forName("oracle.jdbc.driver.OracleDriver"); con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl", "oles", "oles"); PreparedStatement pst = con.prepareStatement("Insert into Logger values(?,?,?, sysdate, sysdate+365)"); pst.setString(1, lb1.getUname()); pst.setString(2,lb1.getPass()); pst.setString(3, lb1.getUtype()); pst.executeUpdate(); con.close(); r = "success"; } else { r = "invalid" ; } } return r; } public LogBean findLogger(String uname, String pass) throws Exception

{ LogBean lb = null; if (uname != null && pass != null) { Class.forName("oracle.jdbc.driver.OracleDriver"); con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl", "oles", "oles"); PreparedStatement pst = con.prepareStatement("select * from Logger where uname = ? and pass = ?"); pst.setString(1, uname); pst.setString(2, pass); ResultSet rs = pst.executeQuery(); if(rs.next()) { lb = new LogBean(); lb.setUname(rs.getString(1)); lb.setPass(rs.getString(2)); lb.setUtype(rs.getString(3)); lb.setDoc(rs.getString(4)); lb.setDoe(rs.getString(5)); } con.close(); } return lb; } public ArrayList getLoggers() throws Exception { LogBean lb = null; ArrayList al = new ArrayList(); Class.forName("oracle.jdbc.driver.OracleDriver"); con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE", "oles", "oles"); Statement stm = con.createStatement(); ResultSet rs = stm.executeQuery("Select * from logger"); while(rs.next()){ lb = new LogBean(); lb.setUname(rs.getString(1)); lb.setPass(rs.getString(2)); lb.setUtype(rs.getString(3)); lb.setDoc(rs.getString(4)); lb.setDoe(rs.getString(5)); al.add(lb); } con.close(); return al; } }

5.NEW USER.JSP <%-Document : NewUser Created on : Jul 14, 2011, 3:50:59 PM Author : Anki --%> <%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %> <!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> <!-body { font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif; background: #4E5869; margin: 0; padding: 0; color: #000; }

padding: 0; margin: 0; } h1, h2, h3, h4, h5, h6, p { margin-top: 0; padding-right: 15px; padding-left: 15px; } a img { border: none; }

a:link { color:#414958; text-decoration: underline; } a:visited {color: #4E5869;

text-decoration: underline; } a:hover, a:active, a:focus { text-decoration: none; }

.container { width: 80%; max-width: 1260px; min-width: 780px; background: #FFF; margin: 0 auto; overflow: hidden;

.sidebar1 { float: left; width: 20%; background: #93A5C4; padding-bottom: 10px; } .content { padding: 10px 0; width: 60%; float: left; } .sidebar2 { float: left; width: 20%; background: #93A5C4; padding: 10px 0; }

.content ul, .content ol { padding: 0 15px 15px 40px; } ul.nav { list-style: none; border-top: 1px solid #666; margin-bottom: 15px; } ul.nav li { border-bottom: 1px solid #666;

} ul.nav a, ul.nav a:visited { padding: 5px 5px 5px 15px; display: block; text-decoration: none; background: #8090AB; color: #000; } ul.nav a:hover, ul.nav a:active, ul.nav a:focus { background: #6F7D94; color: #FFF; } / .fltrt { float: right; margin-left: 8px; } .fltlft { float: left; margin-right: 8px; } .clearfloat { clear:both; height:0; font-size: 1px; line-height: 0px; } --> </style> </head> <body background="bg.gif"> <br> <div class="container">

<CENTER> <H1> <u>Online examination</u> </H1> <form name="form1" method="get" action="reg"> <SCRIPT language="JavaScript"> function validate() {

if( document.form1.uname.value=="") { alert("UserName cannot be blank"); return; } if( document.form1.pass.value=="") { alert("Password cannot be blank"); return; } if( document.form1.pass2.value=="") { alert("pass2 cannot be blank"); return; } if( document.form1.pass.value!= document.form1.pass2.value) { alert("The two passwords do not match"); return; } // document.forms[0].action="reg"; document.form1.submit(); } </SCRIPT> <p align="center"> <b><font size="5"> New User Registration</font></b>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </p> <p align="left"> &nbsp;<b><font color="#FF0000">( Field marked * are necessary)</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;</b> </p> <div align="left"> <table align="center" border="0" width="100%"> <tr> <td width="23%"><b>User *:</b></td> <td width="77%"> <b> <input type="text" name="uname" size="20" tabindex="1">

</b> </td> </tr> <tr> <td width="23%"> <b> Password*:</b></td> <td width="77%"><b><input type="password" name="pass" size="20" tabindex="2"> </b> </td> </tr> <tr> <td width="23%"> <b> Confirm Password*:</b> </td> <td width="77%"><b><input type="password" name="pass2" size="20" tabindex="3"> </b> </td> </tr> </table> <b> <input type="button" value="Submit" name="B1" onclick="validate();" tabindex="13"> </b>

</form> </CENTER> <!-- end .container --></div> </body> </html>

6.REG.JAVA /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package prj; import java.io.*; import java.net.*; import javax.servlet.*; import javax.servlet.http.*; import vvv.*; /** * * @author vm */ public class reg extends HttpServlet { /** * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods. * @param request servlet request * @param response servlet response */ protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { LogDataModel ldm = new LogDataModel(); LogBean lb = new LogBean(); LogBean l =null; String u = request.getParameter("uname"); String p = request.getParameter("pass"); // lb.setUname("u"); lb.setUname(u); lb.setPass(p); lb.setUtype("t");

try{ l= ldm.findLogger(u, p);

if(l == null) { HttpSession session = request.getSession(); session.setAttribute("user", u); String s=ldm.addLogger(lb); response.sendRedirect("welcm.jsp"); } else { response.sendRedirect("index1.jsp?msg=Invalid user or password"); } }catch(Exception e) { response.sendRedirect("index1.jsp?msg="+e.toString()); } } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> /** * Handles the HTTP <code>GET</code> method. * @param request servlet request * @param response servlet response */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Handles the HTTP <code>POST</code> method. * @param request servlet request * @param response servlet response */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Returns a short description of the servlet. */ public String getServletInfo() { return "Short description"; } // </editor-fold> }

7.ANSBEAN.JAVA /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package bit; /** * * @author iht */ public class AnsBean { private String qid; private String aid; private String cid; public String getQid() { return qid; } public void setQid(String qid) { this.qid = qid; } public String getAid() { return aid; } public void setAid(String aid) { this.aid = aid; } public String getCid() { return cid; } public void setCid(String cid) { this.cid = cid; } }

8.MAIN.JSP <%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %> <!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> <!-body { font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif; background: #4E5869; margin: 0; padding: 0; color: #000; } /* ~~ Element/tag selectors ~~ */ ul, ol, dl { /* Due to variations between browsers, it's best practices to zero padding and margin on lists. For consistency, you can either specify the amounts you want here, or on the list items (LI, DT, DD) they contain. Remember that what you do here will cascade to the .nav list unless you write a more specific selector. */ padding: 0; margin: 0; } h1, h2, h3, h4, h5, h6, p { margin-top: 0; /* removing the top margin gets around an issue where margins can escape from their containing div. The remaining bottom margin will hold it away from any elements that follow. */ padding-right: 15px; padding-left: 15px; /* adding the padding to the sides of the elements within the divs, instead of the divs themselves, gets rid of any box model math. A nested div with side padding can also be used as an alternate method. */ } a img { /* this selector removes the default blue border displayed in some browsers around an image when it is surrounded by a link */ border: none; } /* ~~ Styling for your site's links must remain in this order - including the group of selectors that create the hover effect. ~~ */ a:link {

color:#414958; text-decoration: underline; /* unless you style your links to look extremely unique, it's best to provide underlines for quick visual identification */ } a:visited { color: #4E5869; text-decoration: underline; } a:hover, a:active, a:focus { /* this group of selectors will give a keyboard navigator the same hover experience as the person using a mouse. */ text-decoration: none; } /* ~~ this container surrounds all other divs giving them their percentage-based width ~~ */ .container { width: 80%; max-width: 1260px;/* a max-width may be desirable to keep this layout from getting too wide on a large monitor. This keeps line length more readable. IE6 does not respect this declaration. */ min-width: 780px;/* a min-width may be desirable to keep this layout from getting too narrow. This keeps line length more readable in the side columns. IE6 does not respect this declaration. */ background: #FFF; margin: 0 auto; /* the auto value on the sides, coupled with the width, centers the layout. It is not needed if you set the .container's width to 100%. */ } /* ~~ the header is not given a width. It will extend the full width of your layout. It contains an image placeholder that should be replaced with your own linked logo ~~ */ .header { background: #6F7D94; } /* ~~ These are the columns for the layout. ~~ 1) Padding is only placed on the top and/or bottom of the divs. The elements within these divs have padding on their sides. This saves you from any "box model math". Keep in mind, if you add any side padding or border to the div itself, it will be added to the width you define to create the *total* width. You may also choose to remove the padding on the element in the div and place a second div within it with no width and the padding necessary for your design. 2) No margin has been given to the columns since they are all floated. If you must add margin, avoid placing it on the side you're floating toward (for example: a

right margin on a div set to float right). Many times, padding can be used instead. For divs where this rule must be broken, you should add a "display:inline" declaration to the div's rule to tame a bug where some versions of Internet Explorer double the margin. 3) Since classes can be used multiple times in a document (and an element can also have multiple classes applied), the columns have been assigned class names instead of IDs. For example, two sidebar divs could be stacked if necessary. These can very easily be changed to IDs if that's your preference, as long as you'll only be using them once per document. 4) If you prefer your nav on the right instead of the left, simply float these columns the opposite direction (all right instead of all left) and they'll render in reverse order. There's no need to move the divs around in the HTML source. */ .sidebar1 { float: left; width: 20%; background: #93A5C4; padding-bottom: 10px; } .content { padding: 10px 0; width: 60%; float: left; } .sidebar2 { float: left; width: 20%; background: #93A5C4; padding: 10px 0; } /* ~~ This grouped selector gives the lists in the .content area space ~~ */ .content ul, .content ol { padding: 0 15px 15px 40px; /* this padding mirrors the right padding in the headings and paragraph rule above. Padding was placed on the bottom for space between other elements on the lists and on the left to create the indention. These may be adjusted as you wish. */ } /* ~~ The navigation list styles (can be removed if you choose to use a premade flyout menu like Spry) ~~ */ ul.nav { list-style: none; /* this removes the list marker */

border-top: 1px solid #666; /* this creates the top border for the links - all others are placed using a bottom border on the LI */ margin-bottom: 15px; /* this creates the space between the navigation on the content below */ } ul.nav li { border-bottom: 1px solid #666; /* this creates the button separation */ } ul.nav a, ul.nav a:visited { /* grouping these selectors makes sure that your links retain their button look even after being visited */ padding: 5px 5px 5px 15px; display: block; /* this gives the link block properties causing it to fill the whole LI containing it. This causes the entire area to react to a mouse click. */ text-decoration: none; background: #8090AB; color: #000; } ul.nav a:hover, ul.nav a:active, ul.nav a:focus { /* this changes the background and text color for both mouse and keyboard navigators */ background: #6F7D94; color: #FFF; } /* ~~The footer ~~ */ .footer { padding: 10px 0; background: #6F7D94; position: relative;/* this gives IE6 hasLayout to properly clear */ clear: both; /* this clear property forces the .container to understand where the columns end and contain them */ } /* ~~miscellaneous float/clear classes~~ */ .fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */ float: right; margin-left: 8px; } .fltlft { /* this class can be used to float an element left in your page. The floated element must precede the element it should be next to on the page. */ float: left; margin-right: 8px; } .clearfloat { /* this class can be placed on a <br /> or empty div as the final element following the last floated div (within the #container) if the #footer is removed or taken out of the #container */

clear:both; height:0; font-size: 1px; line-height: 0px; } --> </style><!--[if lte IE 7]> <style> .content { margin-right: -1px; } /* this 1px negative margin can be placed on any of the columns in this layout with the same corrective effect. */ ul.nav a { zoom: 1; } /* the zoom property gives IE the hasLayout trigger it needs to correct extra whiltespace between the links */ </style> <![endif]--></head> <body> <div class="container"> <div class="header"><a href="#"><img src="untitled.jpg" alt="a" width="1000" height="101" /></a> <!-- end .header --></div> <div class="sidebar1"> <ul class="nav"> <li><a href="#">Subject</a></li> <li><a href="logout.jsp">Logout</a></li> <li><a href="#">Contact us</a></li> <li><a href="#">About us</a></li> </ul> <!-- end .sidebar1 --></div> <div class="content"> <h1>Select the subject</h1> <p>&nbsp;</p> <form id="form1" name="form1" method="post" action=""> <label for="Select the subject"></label> <table width="361" border="0"> <tr> <td height="189"><a href="c1st.jsp"><img src="c.jpg" width="140" height="105" /></a></td> <td><a href="j1st.jsp"><img src="java.jpg" width="166" height="118" /></a></td> </tr> </table> </form> <h2>&nbsp;</h2> <p>&nbsp;</p>

<p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <!-- end .content --></div> <div class="footer"> <p>This .footer contains the declaration position:relative; to give Internet Explorer 6 hasLayout for the .footer and cause it to clear correctly. If you're not required to support IE6, you may remove it.</p> <!-- end .footer --></div> <!-- end .container --></div> </body> </html> REFERENCES i) ii) iii) www.google.com www.iisjaipur.org/iiim.../10.Project-%20online%20exam%20system.pdf www.wikipedia.com

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