init
14
.classpath
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
|
||||
<attributes>
|
||||
<attribute name="owner.project.facets" value="java"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
|
||||
<classpathentry kind="lib" path="D:/soonu sir softwear/apache-tomcat-7.0.2/lib/servlet-api.jar"/>
|
||||
<classpathentry kind="lib" path="D:/soonu sir softwear/apache-tomcat-7.0.2/lib/jsp-api.jar"/>
|
||||
<classpathentry kind="output" path="build/classes"/>
|
||||
</classpath>
|
||||
36
.project
Normal file
@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>online quiz</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.common.project.facet.core.builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.validation.validationbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
|
||||
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
|
||||
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
BIN
WebContent/CREATE TABLE.docx
Normal file
3
WebContent/META-INF/MANIFEST.MF
Normal file
@ -0,0 +1,3 @@
|
||||
Manifest-Version: 1.0
|
||||
Class-Path:
|
||||
|
||||
BIN
WebContent/WEB-INF/lib/ojdbc14.jar
Normal file
13
WebContent/WEB-INF/web.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<web-app version="2.5"
|
||||
xmlns="http://java.sun.com/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
|
||||
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
|
||||
<welcome-file-list>
|
||||
<welcome-file>index.jsp</welcome-file>
|
||||
</welcome-file-list>
|
||||
<listener>
|
||||
<listener-class>com.javatpoint.MyListener</listener-class>
|
||||
</listener>
|
||||
</web-app>
|
||||
135
WebContent/ask.jsp
Normal file
@ -0,0 +1,135 @@
|
||||
<!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>
|
||||
|
||||
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
|
||||
<!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=windows-1252">
|
||||
<title>Contact Us</title>
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
</head><body>
|
||||
<div id="main_container">
|
||||
<div class="main_content">
|
||||
<div id="header">
|
||||
|
||||
</div>
|
||||
<div class="top_center_box"></div>
|
||||
<div class="center_box">
|
||||
|
||||
|
||||
<div id="menu_tab">
|
||||
<ul class="menu">
|
||||
<li><a href="home.jsp" class="nav">Home</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="takequiz.jsp" class="nav">Take Quiz</a></li>
|
||||
<li class="divider"></li>
|
||||
|
||||
<li><a href="ask.jsp" class="nav">Ask Ques.</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="makequiz.jsp" class="nav">Make quiz</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="contact.html" class="nav">Contact</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="register.jsp" class="nav">Register</a></li>
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="middle_box">
|
||||
<div class="middle_box_text_content">
|
||||
<div class="middle_box_title"></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="left_content">
|
||||
<div class="calendar_box">
|
||||
<div class="calendar_box_content">
|
||||
<h1>Contact Us</h1>
|
||||
<img src="images/contact_icon.gif" alt="" title="">
|
||||
<p class="contact_info">
|
||||
<span class="orange">Adress:</span> H-109,Shakarpur<br>
|
||||
|
||||
<span class="orange">Telephone:</span> 0123456789<br>
|
||||
|
||||
|
||||
|
||||
<span class="orange">Email:</span> <a href="rishi.kumar91@facebook.com">info@company.com</a><br>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="contact_form">
|
||||
|
||||
<h1>Ask Question</h1>
|
||||
<form action="askq.jsp">
|
||||
<div class="form_row">
|
||||
|
||||
<label>Name:</label><input name="name" class="contact_input" type="text">
|
||||
</div>
|
||||
|
||||
<div class="form_row">
|
||||
<label>Email:</label><input name="email" class="contact_input" type="text">
|
||||
</div>
|
||||
|
||||
<div class="form_row">
|
||||
<label>Phone:</label><input name="phone" class="contact_input" type="text">
|
||||
</div>
|
||||
|
||||
<div class="form_row">
|
||||
<label>Question:</label><textarea name="question" class="contact_textarea"></textarea>
|
||||
</div>
|
||||
|
||||
<input type="submit" class="read_more" value="send"/>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div><!--end of left content-->
|
||||
|
||||
|
||||
<div class="right_content">
|
||||
|
||||
|
||||
<h1>Our Clients</h1>
|
||||
|
||||
<div class="project_box">
|
||||
<a href="#"><img src="images/clients_icon.gif" alt="" title="" class="left_img" border="0"></a>
|
||||
<p>
|
||||
<a href="www.javatpoint.com">javatpoint.com</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="project_box">
|
||||
<a href="#"><img src="images/clients_icon.gif" alt="" title="" class="left_img" border="0"></a>
|
||||
<p>
|
||||
<a href="www.cstpoint.com">cstpoint.com</a>
|
||||
</p>
|
||||
</div>
|
||||
</div><!--end of right content-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="footer">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div> <!--end of center box-->
|
||||
</div> <!--end of main content-->
|
||||
</div> <!--end of main container-->
|
||||
</body></html>
|
||||
30
WebContent/askq.jsp
Normal file
@ -0,0 +1,30 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
|
||||
<%@page import="java.sql.*"%>
|
||||
|
||||
|
||||
<%
|
||||
|
||||
try {
|
||||
|
||||
String name= request.getParameter("name");
|
||||
String email= request.getParameter("email");
|
||||
String phone= request.getParameter("phone");
|
||||
String question= request.getParameter("question");
|
||||
|
||||
Class.forName("oracle.jdbc.driver.OracleDriver");
|
||||
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
|
||||
|
||||
PreparedStatement ps=con.prepareStatement("insert into quizq values(?,?,?,?)");
|
||||
ps.setString(1,name);
|
||||
ps.setString(2,email);
|
||||
ps.setString(3,phone);
|
||||
ps.setString(4,question);
|
||||
|
||||
int s= ps.executeUpdate();
|
||||
|
||||
|
||||
}
|
||||
catch(Exception e){e.printStackTrace();}
|
||||
|
||||
%>
|
||||
<jsp:forward page="home.jsp"></jsp:forward>
|
||||
135
WebContent/contact.html
Normal file
@ -0,0 +1,135 @@
|
||||
<!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>
|
||||
|
||||
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
|
||||
<!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=windows-1252">
|
||||
<title>Contact Us</title>
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
</head><body>
|
||||
<div id="main_container">
|
||||
<div class="main_content">
|
||||
<div id="header">
|
||||
|
||||
</div>
|
||||
<div class="top_center_box"></div>
|
||||
<div class="center_box">
|
||||
|
||||
|
||||
<div id="menu_tab">
|
||||
<ul class="menu">
|
||||
<li><a href="home.jsp" class="nav">Home</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="takequiz.jsp" class="nav">Take Quiz</a></li>
|
||||
<li class="divider"></li>
|
||||
|
||||
<li><a href="ask.jsp" class="nav">Ask Ques.</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="makequiz.jsp" class="nav">Make quiz</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="contact.html" class="nav">Contact</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="register.jsp" class="nav">Register</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="middle_box">
|
||||
<div class="middle_box_text_content">
|
||||
<div class="middle_box_title"></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="left_content">
|
||||
<div class="calendar_box">
|
||||
<div class="calendar_box_content">
|
||||
<h1>Contact Us</h1>
|
||||
<img src="images/contact_icon.gif" alt="" title="">
|
||||
<p class="contact_info">
|
||||
<span class="orange">Adress:</span> H-109,Shakarpur<br>
|
||||
|
||||
<span class="orange">Telephone:</span> 0123456789<br>
|
||||
|
||||
|
||||
|
||||
<span class="orange">Email:</span> <a href="rishi.kumar91@facebook.com">info@company.com</a><br>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="contact_form">
|
||||
|
||||
<h1>Contact Us</h1>
|
||||
<form action="quizcontact.jsp">
|
||||
<div class="form_row">
|
||||
|
||||
<label>Name:</label><input name="name" class="contact_input" type="text">
|
||||
</div>
|
||||
|
||||
<div class="form_row">
|
||||
<label>Email:</label><input name="email" class="contact_input" type="text">
|
||||
</div>
|
||||
|
||||
<div class="form_row">
|
||||
<label>Phone:</label><input name="phone" class="contact_input" type="text">
|
||||
</div>
|
||||
|
||||
<div class="form_row">
|
||||
<label>Message:</label><textarea name="message" class="contact_textarea"></textarea>
|
||||
</div>
|
||||
|
||||
|
||||
<input type="submit" class="read_more" value="send"/>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div><!--end of left content-->
|
||||
|
||||
|
||||
<div class="right_content">
|
||||
|
||||
|
||||
<h1>Our Clients</h1>
|
||||
|
||||
<div class="project_box">
|
||||
<a href="#"><img src="images/clients_icon.gif" alt="" title="" class="left_img" border="0"></a>
|
||||
<p>
|
||||
<a href="www.javatpoint.com">javatpoint.com</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="project_box">
|
||||
<a href="#"><img src="images/clients_icon.gif" alt="" title="" class="left_img" border="0"></a>
|
||||
<p>
|
||||
<a href="www.cstpoint.com">cstpoint.com</a>
|
||||
</p>
|
||||
</div>
|
||||
</div><!--end of right content-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="footer">
|
||||
<a href="http://www.webpagedesign.com.au">Art for the web</a>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div> <!--end of center box-->
|
||||
</div> <!--end of main content-->
|
||||
</div> <!--end of main container-->
|
||||
</body></html>
|
||||
15
WebContent/createquiz.jsp
Normal file
@ -0,0 +1,15 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
|
||||
<%@page import="java.sql.*"%>
|
||||
|
||||
<% try {
|
||||
String subject= request.getParameter("subject");
|
||||
Class.forName("oracle.jdbc.driver.OracleDriver");
|
||||
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
|
||||
PreparedStatement ps=con.prepareStatement("insert into quizinfo(subject) values('"+subject+"') " );
|
||||
int s= ps.executeUpdate();
|
||||
|
||||
}
|
||||
catch(Exception e){e.printStackTrace();}
|
||||
%>
|
||||
|
||||
<jsp:forward page="createquiz1.jsp"></jsp:forward>
|
||||
157
WebContent/createquiz1.jsp
Normal file
@ -0,0 +1,157 @@
|
||||
|
||||
<%@page import="java.awt.Dialog"%><jsp:include page="header.jsp"></jsp:include>
|
||||
|
||||
<%
|
||||
String islogin=(String)session.getAttribute("islogin");
|
||||
if(islogin==null){
|
||||
request.setAttribute("notlogin_msg","Sorry,Please do Login first");
|
||||
|
||||
%>
|
||||
<jsp:forward page="index.jsp"></jsp:forward>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
|
||||
<%
|
||||
if(request.getAttribute("notlogin_msg")!=null){
|
||||
out.print("<font size='2' color='red' m>");
|
||||
out.print(request.getAttribute("notlogin_msg"));
|
||||
out.print("</font>");
|
||||
}
|
||||
%>
|
||||
<%
|
||||
if(request.getAttribute("Error")!=null){
|
||||
out.print("<font size='2' color='red' >");
|
||||
out.print(request.getAttribute("Error"));
|
||||
out.print("</font>");
|
||||
}
|
||||
%>
|
||||
<%
|
||||
if(request.getAttribute("counter")!=null){
|
||||
Integer i=(Integer)request.getAttribute("counter");
|
||||
if(i==10){
|
||||
request.setAttribute("finished","quiz successfully submitted");
|
||||
|
||||
%>
|
||||
<jsp:forward page="home.jsp"></jsp:forward>
|
||||
<%
|
||||
|
||||
}}
|
||||
%>
|
||||
<div class="left_content">
|
||||
|
||||
<div class="calendar_box2">
|
||||
|
||||
<div class="calendar_box_content">
|
||||
|
||||
<h1>Welcome to my Site</h1>
|
||||
<marquee direction="left" style="color: navy;" onmouseover="stop()" onmouseout="start()"><B>Assess Yourself by taking quizs on various sunject</B></marquee>
|
||||
|
||||
<form method="post" action="saveques.jsp" >
|
||||
<table>
|
||||
<tr><td>Question:</td><td><textarea rows="3" cols="" name="question" ></textarea></td></tr>
|
||||
<tr><td>Option1:</td><td><input type="text" name="option1" /></td></tr>
|
||||
<tr><td>Option2:</td><td><input type="text" name="option2" /></td></tr>
|
||||
<tr><td>Option3:</td><td><input type="text" name="option3" /></td></tr>
|
||||
<tr><td>Option4:</td><td><input type="text" name="option4" /></td></tr>
|
||||
<tr><td>Answer:</td><td><input type="text" name="answer" /></td></tr>
|
||||
<tr><td>Description:</td><td><input type="text" name="description" /></td></tr>
|
||||
<tr><td></td><td><input type="submit" value="Next"></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="news_left">
|
||||
<h1>Latest News</h1>
|
||||
<div class="news_box">
|
||||
<div class="calendar">23</div>
|
||||
<div class="news_content">
|
||||
<p><span></span>
|
||||
now learn how to develop android application free of cost</p><br>
|
||||
<a href="www.javatpoint.com" class="read_more">read more</a>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="news_box">
|
||||
<div class="calendar">23</div>
|
||||
<div class="news_content">
|
||||
<p><span></span>
|
||||
we have latest projects uoloaded on my site</p>
|
||||
<a href="www.cstpoint.com" class="read_more">read more</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!--end of left content-->
|
||||
|
||||
|
||||
<div class="right_content">
|
||||
|
||||
|
||||
<h1>Latest Projects</h1>
|
||||
|
||||
<div class="project_box">
|
||||
<a href="#"><img src="images/p1.gif" alt="" title="" class="left_img" border="0"></a>
|
||||
<p>
|
||||
<span> Description:</span><br>
|
||||
Payment billing System
|
||||
Online Quiz<br>
|
||||
Matrimonial
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="project_box">
|
||||
<a href="#"><img src="images/p2.gif" alt="" title="" class="left_img" border="0"></a>
|
||||
<p>
|
||||
<span> Description:</span><br>
|
||||
|
||||
Gmail Account<br>
|
||||
Latest Quiz
|
||||
</p>
|
||||
</div>
|
||||
<br>
|
||||
<div>
|
||||
|
||||
<h1 ><br>Our main Services</h1>
|
||||
</div>
|
||||
<div class="services">
|
||||
<ul>
|
||||
<li><a href="www.javatpoint.com">Java tutorial</a></li>
|
||||
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="services">
|
||||
<ul>
|
||||
<li><a href="www.javatpoint.com">Java tutorial</a></li>
|
||||
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</div><!--end of right content-->
|
||||
|
||||
|
||||
<div id="footer">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div> <!--end of center box-->
|
||||
</div> <!--end of main content-->
|
||||
</div> <!--end of main container-->
|
||||
</body></html>
|
||||
|
||||
17
WebContent/findname.jsp
Normal file
@ -0,0 +1,17 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
|
||||
<%@ page import="java.sql.*" %>
|
||||
<%
|
||||
String n=request.getParameter("val");
|
||||
if(n.length()>0){
|
||||
try{
|
||||
Class.forName("oracle.jdbc.driver.OracleDriver");
|
||||
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
|
||||
PreparedStatement ps=con.prepareStatement("select username from quizregister where username='"+n+"'");
|
||||
ResultSet rs=ps.executeQuery();
|
||||
while(rs.next()){
|
||||
out.print("<font style='color:red'>Username already exist</font>");
|
||||
}
|
||||
con.close();
|
||||
}catch(Exception e){e.printStackTrace();}
|
||||
}//end of if
|
||||
%>
|
||||
28
WebContent/findname2.jsp
Normal file
@ -0,0 +1,28 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
|
||||
<%@ page import="java.sql.*" %>
|
||||
|
||||
|
||||
<%
|
||||
String n=request.getParameter("val");
|
||||
if(n.length()>0){
|
||||
try{
|
||||
Class.forName("oracle.jdbc.driver.OracleDriver");
|
||||
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
|
||||
|
||||
PreparedStatement ps=con.prepareStatement("select * from quizinfo where subject like '"+n+"%'");
|
||||
//ps.setString(1,n);
|
||||
out.print("<br>");
|
||||
ResultSet rs=ps.executeQuery();
|
||||
|
||||
out.print("<table border='3' cellspacing=3 cellpadding=2 id='myTable'>");
|
||||
out.print("<tr><td><B>Quizs</B></td><td><B>Subject</B></td></tr>");
|
||||
while(rs.next()){
|
||||
out.print("<tr><td><a href='#' name='"+rs.getString(2)+"' onclick='javascript:viewAll(this.name)'>Quiz"+rs.getString(2)+"</a></td>");
|
||||
out.print("<td>"+rs.getString(1)+"</td>");
|
||||
out.print("</tr>");
|
||||
}
|
||||
out.print("</table>");
|
||||
con.close();
|
||||
}catch(Exception e){e.printStackTrace();}
|
||||
}//end of if
|
||||
%>
|
||||
14
WebContent/findname3.jsp
Normal file
@ -0,0 +1,14 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
|
||||
<%@ page import="java.sql.*" %>
|
||||
|
||||
|
||||
<%
|
||||
String n=request.getParameter("val");
|
||||
session.setAttribute("quizname",n);
|
||||
if(n.length()>0){
|
||||
out.print("<font style='color:navy'><B>Quiz"+n+" containns 10 Question<br>Each question is of 1 point</B><br></font>");
|
||||
out.print("<input type='submit' value='Start Quiz' />");
|
||||
|
||||
}
|
||||
//end of if
|
||||
%>
|
||||
4
WebContent/footer.html
Normal file
@ -0,0 +1,4 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<div id="footer">
|
||||
|
||||
</div>
|
||||
60
WebContent/get.jsp
Normal file
@ -0,0 +1,60 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
|
||||
<%@ page import="java.sql.*" %>
|
||||
<%--<%@page import="com.sun.org.apache.bcel.internal.generic.Select"--%>
|
||||
<%! static int count=0; %>
|
||||
<%! static int count1=0; %>
|
||||
|
||||
|
||||
|
||||
<%
|
||||
String name=(String)session.getAttribute("quizname");
|
||||
try{
|
||||
|
||||
|
||||
Class.forName("oracle.jdbc.driver.OracleDriver");
|
||||
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
|
||||
if(count==0){
|
||||
PreparedStatement ps1= con.prepareStatement("select min(qid) from quizques where quizname='"+name+"'");
|
||||
PreparedStatement ps2= con.prepareStatement("select max(qid) from quizques where quizname='"+name+"'");
|
||||
ResultSet rs1= ps1.executeQuery();
|
||||
ResultSet rs2=ps2.executeQuery();
|
||||
if(rs2.next()){
|
||||
count1=rs2.getInt(1);
|
||||
session.setAttribute("max",count1);
|
||||
}
|
||||
if(rs1.next()){
|
||||
count=rs1.getInt(1);
|
||||
session.setAttribute("min",count);
|
||||
|
||||
}
|
||||
}
|
||||
if(count>0){
|
||||
PreparedStatement ps=con.prepareStatement("select * from quizques where quizname='"+name+"' and qid='"+count+"' ");
|
||||
ResultSet rs=ps.executeQuery();
|
||||
while(rs.next()){
|
||||
String question=rs.getString(1);
|
||||
String option1= rs.getString(2);
|
||||
String option2= rs.getString(3);
|
||||
String option3= rs.getString(4);
|
||||
String option4= rs.getString(5);
|
||||
session.setAttribute("question",question);
|
||||
session.setAttribute("option1",option1);
|
||||
session.setAttribute("option2",option2);
|
||||
session.setAttribute("option3",option3);
|
||||
session.setAttribute("option4",option4);
|
||||
}
|
||||
|
||||
}
|
||||
System.out.print(count);
|
||||
count++;
|
||||
session.setAttribute("count",count);
|
||||
if(count>(Integer)session.getAttribute("max")){
|
||||
count=0;
|
||||
session.setAttribute("ans",null);
|
||||
}
|
||||
con.close();
|
||||
|
||||
}catch(Exception e){e.printStackTrace();}
|
||||
//end of if
|
||||
%>
|
||||
<jsp:forward page="start.jsp"></jsp:forward>
|
||||
93
WebContent/get1.jsp
Normal file
@ -0,0 +1,93 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
|
||||
<%@ page import="java.sql.*" %>
|
||||
<%-- <%@page import="com.sun.org.apache.bcel.internal.generic.Select"%>--%>
|
||||
|
||||
<%! static int count1=0; %>
|
||||
|
||||
<%! static int total=0; %>
|
||||
<%
|
||||
if(session.getAttribute("count")!=null){
|
||||
String name=(String)session.getAttribute("quizname");
|
||||
String ans= (String)session.getAttribute("ans");
|
||||
Integer count=(Integer)session.getAttribute("count");
|
||||
try{
|
||||
if(count1==0)
|
||||
{
|
||||
count1=count-1;
|
||||
|
||||
Class.forName("oracle.jdbc.driver.OracleDriver");
|
||||
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
|
||||
PreparedStatement ps=con.prepareStatement("select answer from quizques where quizname='"+name+"' and qid='"+count1+"' ");
|
||||
ResultSet rs=ps.executeQuery();
|
||||
if(rs.next()){
|
||||
String ans1=rs.getString(1);
|
||||
System.out.println("ans1 on c10="+ans1);
|
||||
System.out.println("ans on get1="+ans);
|
||||
if(ans1.equals(ans)){
|
||||
total=total+1;
|
||||
System.out.println("total="+total);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
con.close();
|
||||
}
|
||||
|
||||
|
||||
|
||||
else{
|
||||
count1=count-2;
|
||||
System.out.print("count at get1:"+count);
|
||||
|
||||
Class.forName("oracle.jdbc.driver.OracleDriver");
|
||||
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
|
||||
PreparedStatement ps=con.prepareStatement("select answer from quizques where quizname='"+name+"' and qid='"+count1+"' ");
|
||||
ResultSet rs=ps.executeQuery();
|
||||
if(rs.next()){
|
||||
String ans1=rs.getString(1);
|
||||
System.out.println("ans1="+ans1);
|
||||
System.out.println("ans on get1="+ans);
|
||||
if(ans1.equals(ans)){
|
||||
total=total+1;
|
||||
System.out.println("total="+total);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
con.close();
|
||||
}
|
||||
if(count>(Integer)session.getAttribute("max"))
|
||||
{
|
||||
Integer max=(Integer)session.getAttribute("max");
|
||||
Class.forName("oracle.jdbc.driver.OracleDriver");
|
||||
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
|
||||
PreparedStatement ps=con.prepareStatement("select answer from quizques where quizname='"+name+"' and qid='"+max+"' ");
|
||||
ResultSet rs=ps.executeQuery();
|
||||
if(rs.next()){
|
||||
String ans1=rs.getString(1);
|
||||
System.out.println("ans1 on c1="+ans1);
|
||||
String ans2=(String) session.getAttribute("ans");
|
||||
System.out.println("ans on get1="+ans2);
|
||||
if(ans1.equals(ans2)){
|
||||
total=total+1;
|
||||
System.out.println("total="+total);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
con.close();
|
||||
request.setAttribute("total",total);
|
||||
total=0;
|
||||
%>
|
||||
|
||||
<jsp:forward page="result.jsp"></jsp:forward>
|
||||
<%
|
||||
|
||||
|
||||
}
|
||||
|
||||
}catch(Exception e){e.printStackTrace();}
|
||||
|
||||
}
|
||||
%>
|
||||
<jsp:forward page="get.jsp"></jsp:forward>
|
||||
53
WebContent/header.jsp
Normal file
@ -0,0 +1,53 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
|
||||
<!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=windows-1252">
|
||||
<title>Online Quiz</title>
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
</head><body>
|
||||
|
||||
<div id="main_container">
|
||||
<div class="main_content">
|
||||
<div id="header">
|
||||
|
||||
</div>
|
||||
<div class="top_center_box"></div>
|
||||
|
||||
<div class="center_box">
|
||||
|
||||
<div id="menu_tab">
|
||||
|
||||
<ul class="menu">
|
||||
<li><a href="home.jsp" class="nav">Home</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="takequiz.jsp" class="nav">Take Quiz</a></li>
|
||||
<li class="divider"></li>
|
||||
|
||||
<li><a href="ask.jsp" class="nav">Ask Ques.</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="makequiz.jsp" class="nav">Make quiz</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="contact.html" class="nav">Contact</a></li>
|
||||
<li class="divider"></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="logout.jsp" class="nav">logout</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="middle_box">
|
||||
|
||||
<div class="middle_box_text_content">
|
||||
<div class="middle_box_title"></div>
|
||||
<p class="middle_text">
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
157
WebContent/home.jsp
Normal file
@ -0,0 +1,157 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
|
||||
<html>
|
||||
|
||||
|
||||
<jsp:include page="header.jsp"></jsp:include>
|
||||
|
||||
<%
|
||||
String islogin=(String)session.getAttribute("islogin");
|
||||
if(islogin==null){
|
||||
request.setAttribute("notlogin_msg","Sorry,Please do Login first");
|
||||
|
||||
%>
|
||||
<jsp:forward page="index.jsp"></jsp:forward>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
|
||||
|
||||
|
||||
<div class="left_content">
|
||||
<%
|
||||
if(request.getAttribute("notlogin_msg")!=null){
|
||||
out.print("<font size='2' color='red' m>");
|
||||
out.print(request.getAttribute("notlogin_msg"));
|
||||
out.print("</font>");
|
||||
}
|
||||
%>
|
||||
<%
|
||||
if(request.getAttribute("Error")!=null){
|
||||
out.print("<font size='2' color='red' >");
|
||||
out.print(request.getAttribute("Error"));
|
||||
out.print("</font>");
|
||||
}
|
||||
%>
|
||||
<%
|
||||
if(request.getAttribute("finished")!=null){
|
||||
out.print("<font size='2' color='navy'>");
|
||||
out.print("<B>");
|
||||
out.print(request.getAttribute("finished"));
|
||||
out.print("<B>");
|
||||
out.print("</font>");
|
||||
}
|
||||
if(request.getAttribute("category")!=null){
|
||||
out.print("<font size='2' color='red' m>");
|
||||
out.print(request.getAttribute("category"));
|
||||
out.print("</font>");
|
||||
}
|
||||
|
||||
%>
|
||||
<div class="calendar_box">
|
||||
|
||||
<div class="calendar_box_content">
|
||||
|
||||
<h1>Welcome to my Site</h1>
|
||||
<marquee direction="left" style="color: navy;" onmouseover="stop()" onmouseout="start()"><B>Assess Yourself by taking quizs on various subjects</B></marquee>
|
||||
<p>
|
||||
<font style="color: navy;">Now Teacher and Student can work together<br>
|
||||
online.Tutors are most welcomed to my site <br>
|
||||
they can create Quiz simply by clicking Make<br>
|
||||
Quiz link.And Students can appear in quiz based on various
|
||||
subject. </font>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="news_left">
|
||||
<h1>Latest News</h1>
|
||||
<div class="news_box">
|
||||
<div class="calendar">1</div>
|
||||
<div class="news_content">
|
||||
<p><span></span>
|
||||
now learn how to develop android application free of cost</p><br>
|
||||
<a href="www.javatpoint.com" class="read_more">read more</a>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="news_box">
|
||||
<div class="calendar">2</div>
|
||||
<div class="news_content">
|
||||
<p><span></span>
|
||||
we have latest projects uploaded on my site</p>
|
||||
<a href="www.cstpoint.com" class="read_more">read more</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!--end of left content-->
|
||||
|
||||
|
||||
<div class="right_content">
|
||||
|
||||
|
||||
<h1>Latest Projects</h1>
|
||||
|
||||
<div class="project_box">
|
||||
<a href="#"><img src="images/p1.gif" alt="" title="" class="left_img" border="0"></a>
|
||||
<p>
|
||||
<span> Description:</span><br>
|
||||
Payment billing System
|
||||
Online Quiz<br>
|
||||
Matrimonial
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="project_box">
|
||||
<a href="#"><img src="images/p2.gif" alt="" title="" class="left_img" border="0"></a>
|
||||
<p>
|
||||
<span> Description:</span><br>
|
||||
|
||||
Gmail Account<br>
|
||||
Latest Quiz
|
||||
</p>
|
||||
</div>
|
||||
<br>
|
||||
<div>
|
||||
|
||||
<h1 ><br>Our main Services</h1>
|
||||
</div>
|
||||
<div class="services">
|
||||
<ul>
|
||||
<li><a href="www.javatpoint.com">Java tutorial</a></li>
|
||||
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="services">
|
||||
<ul>
|
||||
<li><a href="www.javatpoint.com">Java tutorial</a></li>
|
||||
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</div><!--end of right content-->
|
||||
|
||||
|
||||
<div id="footer">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div> <!--end of center box-->
|
||||
</div> <!--end of main content-->
|
||||
</div> <!--end of main container-->
|
||||
</body></html>
|
||||
|
||||
BIN
WebContent/images/Copy of parrot.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
WebContent/images/Thumbs.db
Normal file
BIN
WebContent/images/arrow.gif
Normal file
|
After Width: | Height: | Size: 324 B |
BIN
WebContent/images/arrow.jpg
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
WebContent/images/bg.jpg
Normal file
|
After Width: | Height: | Size: 545 B |
BIN
WebContent/images/box_title_bg.gif
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
WebContent/images/calendar_bg.gif
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
WebContent/images/calendar_icon.gif
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
WebContent/images/center_box_bg.gif
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
WebContent/images/clients_icon.gif
Normal file
|
After Width: | Height: | Size: 580 B |
BIN
WebContent/images/contact_icon.gif
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
WebContent/images/divider.gif
Normal file
|
After Width: | Height: | Size: 165 B |
BIN
WebContent/images/footer_bg.gif
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
WebContent/images/link_more_bg.gif
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
WebContent/images/link_more_bg_a.gif
Normal file
|
After Width: | Height: | Size: 1017 B |
BIN
WebContent/images/logo.gif
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
WebContent/images/menu_arrow.gif
Normal file
|
After Width: | Height: | Size: 341 B |
BIN
WebContent/images/menu_bg.gif
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
WebContent/images/online quiz.jpg
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
WebContent/images/online_quiz.gif
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
WebContent/images/p1.gif
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
WebContent/images/p2.gif
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
BIN
WebContent/images/parrot.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
BIN
WebContent/images/top_bg.jpg
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
WebContent/images/top_box.gif
Normal file
|
After Width: | Height: | Size: 391 B |
183
WebContent/index.jsp
Normal file
@ -0,0 +1,183 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
|
||||
<!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=windows-1252">
|
||||
<title>Login Form</title>
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
</head><body>
|
||||
|
||||
|
||||
<div id="main_container">
|
||||
<div class="main_content">
|
||||
<div id="header">
|
||||
|
||||
</div>
|
||||
<div class="top_center_box"></div>
|
||||
<div class="center_box">
|
||||
|
||||
|
||||
<div id="menu_tab">
|
||||
<ul class="menu">
|
||||
<li><a href="home.jsp" class="nav">Home</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="takequiz.jsp" class="nav">Take Quiz</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="ask.jsp" class="nav">Ask Ques.</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="contact.html" class="nav">Contact</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="makequiz.jsp" class="nav">Make quiz</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="register.jsp" class="nav">Register</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="middle_box">
|
||||
|
||||
<div class="middle_box_text_content">
|
||||
<div class="middle_box_title"></div>
|
||||
<p class="middle_text">
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="left_content">
|
||||
<%
|
||||
if(request.getAttribute("notlogin_msg")!=null){
|
||||
out.print("<font size='2' color='red' m>");
|
||||
out.print(request.getAttribute("notlogin_msg"));
|
||||
out.print("</font>");
|
||||
}
|
||||
%>
|
||||
<%
|
||||
if(request.getAttribute("Error")!=null){
|
||||
out.print("<font size='2' color='red' m>");
|
||||
out.print(request.getAttribute("Error"));
|
||||
out.print("</font>");
|
||||
}
|
||||
|
||||
|
||||
%>
|
||||
<div class="calendar_box">
|
||||
|
||||
<div class="calendar_box_content">
|
||||
|
||||
<h1>Welcome to my Site</h1>
|
||||
|
||||
<form method="post" action="loginprocess.jsp" >
|
||||
<table>
|
||||
<tr><td style="color:navy;"><B> Login Form</B></td></tr>
|
||||
<tr><td>Category:</td><td><select name="category">
|
||||
<option>Select a Category</option>
|
||||
<option>Teacher</option>
|
||||
<option>Student</option>
|
||||
</select>
|
||||
</td></tr>
|
||||
<tr><td>User Name:</td><td><input type="text" name="username" /></td></tr>
|
||||
|
||||
<tr><td>Password:</td><td><input type="password" name="userpass"/></td></tr>
|
||||
|
||||
<tr><td></td><td><input type="submit" value="Sign in"/> <a href="register.jsp">Register</a></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="news_left">
|
||||
<h1>Latest News</h1>
|
||||
<div class="news_box">
|
||||
<div class="calendar">23</div>
|
||||
<div class="news_content">
|
||||
<p><span></span>
|
||||
now learn how to develop android application free of cost</p><br>
|
||||
<a href="www.javatpoint.com" class="read_more">read more</a>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="news_box">
|
||||
<div class="calendar">23</div>
|
||||
<div class="news_content">
|
||||
<p><span></span>
|
||||
we have latest projects uploaded on my site</p>
|
||||
<a href="www.cstpoint.com" class="read_more">read more</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!--end of left content-->
|
||||
|
||||
|
||||
<div class="right_content">
|
||||
|
||||
|
||||
<h1>Latest Projects</h1>
|
||||
|
||||
<div class="project_box">
|
||||
<a href="#"><img src="images/p1.gif" alt="" title="" class="left_img" border="0"></a>
|
||||
<p>
|
||||
<span> Description:</span><br>
|
||||
Payment billing System
|
||||
Online Quiz<br>
|
||||
Matrimonial
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="project_box">
|
||||
<a href="#"><img src="images/p2.gif" alt="" title="" class="left_img" border="0"></a>
|
||||
<p>
|
||||
<span> Description:</span><br>
|
||||
|
||||
Gmail Account<br>
|
||||
Latest Quiz
|
||||
</p>
|
||||
</div>
|
||||
<br>
|
||||
<div>
|
||||
|
||||
<h1 ><br>Our main Services</h1>
|
||||
</div>
|
||||
<div class="services">
|
||||
<ul>
|
||||
<li><a href="www.javatpoint.com">Java tutorial</a></li>
|
||||
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="services">
|
||||
<ul>
|
||||
<li><a href="www.javatpoint.com">Java tutorial</a></li>
|
||||
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</div><!--end of right content-->
|
||||
|
||||
|
||||
<div id="footer">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div> <!--end of center box-->
|
||||
</div> <!--end of main content-->
|
||||
</div> <!--end of main container-->
|
||||
</body></html>
|
||||
46
WebContent/loginprocess.jsp
Normal file
@ -0,0 +1,46 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
|
||||
<%@page import="org.omg.CORBA.PUBLIC_MEMBER"%>
|
||||
<%@page import="java.sql.*"%>
|
||||
<%@page import="java.util.*"%>
|
||||
<%
|
||||
String username=request.getParameter("username");
|
||||
System.out.print(username);
|
||||
String userpass=request.getParameter("userpass");
|
||||
String category=request.getParameter("category");
|
||||
|
||||
boolean status=false;
|
||||
try{
|
||||
Class.forName("oracle.jdbc.driver.OracleDriver");
|
||||
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
|
||||
PreparedStatement ps=con.prepareStatement("select * from quizregister where username=? and userpass=? ");
|
||||
ps.setString(1,username);
|
||||
ps.setString(2,userpass);
|
||||
ResultSet rs=ps.executeQuery();
|
||||
status=rs.next();
|
||||
if(status){
|
||||
System.out.print("hi");
|
||||
username=rs.getString(1);
|
||||
session.setAttribute("username",String.valueOf(username));
|
||||
session.setAttribute("islogin","plz sign in first");
|
||||
session.setAttribute("category",category);
|
||||
%>
|
||||
<jsp:forward page="home.jsp"></jsp:forward>
|
||||
<%
|
||||
}
|
||||
else{
|
||||
System.out.print("hi");
|
||||
request.setAttribute("Error","Sorry! Username or Password Error. plz Enter Correct Detail or Register");
|
||||
session.setAttribute("Loginmsg","plz sign in first");
|
||||
%>
|
||||
<jsp:forward page="index.jsp"></jsp:forward>
|
||||
<%
|
||||
}
|
||||
}
|
||||
|
||||
catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
%>
|
||||
|
||||
|
||||
23
WebContent/logout.jsp
Normal file
@ -0,0 +1,23 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
|
||||
|
||||
|
||||
|
||||
|
||||
<head>
|
||||
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
|
||||
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
|
||||
<META HTTP-EQUIV="Expires" CONTENT="-1">
|
||||
</head>
|
||||
----//body tags
|
||||
<%
|
||||
|
||||
session.invalidate();
|
||||
response.setHeader("Cache-Control","no-store");
|
||||
response.setHeader("Pragma","no-cache");
|
||||
response.setDateHeader ("Expires", 0);
|
||||
|
||||
|
||||
|
||||
|
||||
%>
|
||||
<jsp:forward page="index.jsp"></jsp:forward>
|
||||
149
WebContent/makequiz.jsp
Normal file
@ -0,0 +1,149 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
|
||||
<jsp:include page="header.jsp"></jsp:include>
|
||||
|
||||
<%
|
||||
String islogin=(String)session.getAttribute("islogin");
|
||||
if(islogin==null){
|
||||
request.setAttribute("notlogin_msg","Sorry,Please do Login first");
|
||||
|
||||
%>
|
||||
<jsp:forward page="index.jsp"></jsp:forward>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
<div class="left_content">
|
||||
<%
|
||||
if(request.getAttribute("notlogin_msg")!=null){
|
||||
out.print("<font size='2' color='red' m>");
|
||||
out.print(request.getAttribute("notlogin_msg"));
|
||||
out.print("</font>");
|
||||
}
|
||||
%>
|
||||
<%
|
||||
if(request.getAttribute("Error")!=null){
|
||||
out.print("<font size='2' color='red' m>");
|
||||
out.print(request.getAttribute("Error"));
|
||||
out.print("</font>");
|
||||
}
|
||||
if(session.getAttribute("category")!=null){
|
||||
String category=(String)session.getAttribute("category");
|
||||
if(category.equals("Student")){
|
||||
request.setAttribute("category","You are not a Teacher,You can't make Quiz");
|
||||
%>
|
||||
<jsp:forward page="home.jsp"></jsp:forward>
|
||||
<%
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
%>
|
||||
<div class="calendar_box">
|
||||
|
||||
<div class="calendar_box_content">
|
||||
|
||||
<h1>Welcome to my Site</h1>
|
||||
<marquee direction="left" style="color: navy;" onmouseover="stop()" onmouseout="start()"><B>Assess Yourself by taking quizs on various subjects</B></marquee>
|
||||
|
||||
<form method="post" action="createquiz.jsp" >
|
||||
<table>
|
||||
<tr><td>Subject:</td><td><input type="text" name="subject" /></td></tr>
|
||||
|
||||
<tr><td></td><td><input type="submit" value="Create"></td>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="news_left">
|
||||
<h1>Latest News</h1>
|
||||
<div class="news_box">
|
||||
<div class="calendar">1</div>
|
||||
<div class="news_content">
|
||||
<p><span></span>
|
||||
now learn how to develop android application free of cost</p><br>
|
||||
<a href="www.javatpoint.com" class="read_more">read more</a>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="news_box">
|
||||
<div class="calendar">2</div>
|
||||
<div class="news_content">
|
||||
<p><span></span>
|
||||
we have latest projects uoloaded on my site</p>
|
||||
<a href="www.cstpoint.com" class="read_more">read more</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!--end of left content-->
|
||||
|
||||
|
||||
<div class="right_content">
|
||||
|
||||
|
||||
<h1>Latest Projects</h1>
|
||||
|
||||
<div class="project_box">
|
||||
<a href="#"><img src="images/p1.gif" alt="" title="" class="left_img" border="0"></a>
|
||||
<p>
|
||||
<span> Description:</span><br>
|
||||
Payment billing System
|
||||
Online Quiz<br>
|
||||
Matrimonial
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="project_box">
|
||||
<a href="#"><img src="images/p2.gif" alt="" title="" class="left_img" border="0"></a>
|
||||
<p>
|
||||
<span> Description:</span><br>
|
||||
|
||||
Gmail Account<br>
|
||||
Latest Quiz
|
||||
</p>
|
||||
</div>
|
||||
<br>
|
||||
<div>
|
||||
|
||||
<h1 ><br>Our main Services</h1>
|
||||
</div>
|
||||
<div class="services">
|
||||
<ul>
|
||||
<li><a href="www.javatpoint.com">Java tutorial</a></li>
|
||||
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="services">
|
||||
<ul>
|
||||
<li><a href="www.javatpoint.com">Java tutorial</a></li>
|
||||
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</div><!--end of right content-->
|
||||
|
||||
|
||||
<div id="footer">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div> <!--end of center box-->
|
||||
</div> <!--end of main content-->
|
||||
</div> <!--end of main container-->
|
||||
</body></html>
|
||||
|
||||
<jsp:include page="footer.html"></jsp:include>
|
||||
30
WebContent/quizcontact.jsp
Normal file
@ -0,0 +1,30 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
|
||||
<%@page import="java.sql.*"%>
|
||||
|
||||
|
||||
<%
|
||||
|
||||
try {
|
||||
|
||||
String name= request.getParameter("name");
|
||||
String email= request.getParameter("email");
|
||||
String phone= request.getParameter("phone");
|
||||
String message= request.getParameter("message");
|
||||
|
||||
Class.forName("oracle.jdbc.driver.OracleDriver");
|
||||
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
|
||||
|
||||
PreparedStatement ps=con.prepareStatement("insert into quizcontact values(?,?,?,?)");
|
||||
ps.setString(1,name);
|
||||
ps.setString(2,email);
|
||||
ps.setString(3,phone);
|
||||
ps.setString(4,message);
|
||||
|
||||
int s= ps.executeUpdate();
|
||||
|
||||
|
||||
}
|
||||
catch(Exception e){e.printStackTrace();}
|
||||
|
||||
%>
|
||||
<jsp:forward page="home.jsp"></jsp:forward>
|
||||
197
WebContent/register.jsp
Normal file
@ -0,0 +1,197 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
|
||||
<!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=windows-1252">
|
||||
<title>Registration Form</title>
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
<script>
|
||||
var request;
|
||||
function sendInfo()
|
||||
{
|
||||
var v=document.myform.username.value;
|
||||
var url="findname.jsp?val="+v;
|
||||
if(window.XMLHttpRequest){
|
||||
request=new XMLHttpRequest();
|
||||
}
|
||||
else if(window.ActiveXObject){
|
||||
request=new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
try
|
||||
{
|
||||
request.onreadystatechange=getInfo;
|
||||
request.open("GET",url,true);
|
||||
request.send();
|
||||
}
|
||||
catch(e){alert("Unable to connect to server");}
|
||||
}
|
||||
|
||||
function getInfo(){
|
||||
if(request.readyState==4){
|
||||
var val=request.responseText;
|
||||
document.getElementById('location').innerHTML=val;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head><body>
|
||||
|
||||
<div id="main_container">
|
||||
<div class="main_content">
|
||||
<div id="header">
|
||||
|
||||
</div>
|
||||
<div class="top_center_box"></div>
|
||||
<div class="center_box">
|
||||
|
||||
|
||||
<div id="menu_tab">
|
||||
<ul class="menu">
|
||||
<li><a href="home.jsp" class="nav">Home</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="takequiz.jsp" class="nav">Take Quiz</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="ask.jsp" class="nav">Ask Ques.</a></li>
|
||||
<li class="divider"></li>
|
||||
|
||||
<li><a href="makequiz.jsp" class="nav">Make quiz</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="contact.html" class="nav">Contact</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="register.jsp" class="nav">Registration</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="middle_box">
|
||||
<div class="middle_box_text_content">
|
||||
<div class="middle_box_title"></div>
|
||||
<p class="middle_text">
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="left_content">
|
||||
|
||||
<div class="calendar_box">
|
||||
|
||||
<div class="calendar_box_content1">
|
||||
|
||||
<h1>Welcome to my Site</h1>
|
||||
<p><div id="location"></div>
|
||||
<form method="post" action="registerprocess.jsp" name="myform" >
|
||||
<table>
|
||||
|
||||
<tr><td style="color:navy;"><B>Registration</B></td></tr>
|
||||
<tr><td>User Name:</td><td><input type="text" name="username" onkeyup="sendInfo()"/></td></tr>
|
||||
|
||||
<tr><td>Password:</td><td><input type="password" name="userpass"/></td></tr>
|
||||
<tr><td>Category:</td><td><select name="category">
|
||||
<option>Select a Category</option>
|
||||
<option>Teacher</option>
|
||||
<option>Student</option>
|
||||
</select>
|
||||
</td></tr>
|
||||
<tr><td>Email:</td><td><input type="text" name="email"/></td></tr>
|
||||
|
||||
<tr><td> </td>
|
||||
<td><input type="submit" value="Register"></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="news_left">
|
||||
<h1>Latest News</h1>
|
||||
<div class="news_box">
|
||||
<div class="calendar">23</div>
|
||||
<div class="news_content">
|
||||
<p><span></span>
|
||||
now learn how to develop android application free of cost</p><br>
|
||||
<a href="www.javatpoint.com" class="read_more">read more</a>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="news_box">
|
||||
<div class="calendar">23</div>
|
||||
<div class="news_content">
|
||||
<p><span></span>
|
||||
we have latest projects uploaded on my site</p>
|
||||
<a href="www.cstpoint.com" class="read_more">read more</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!--end of left content-->
|
||||
|
||||
|
||||
<div class="right_content">
|
||||
|
||||
|
||||
<h1>Latest Projects</h1>
|
||||
|
||||
<div class="project_box">
|
||||
<a href="#"><img src="images/p1.gif" alt="" title="" class="left_img" border="0"></a>
|
||||
<p>
|
||||
<span> Description:</span><br>
|
||||
Payment billing System
|
||||
Online Quiz<br>
|
||||
Matrimonial
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="project_box">
|
||||
<a href="#"><img src="images/p2.gif" alt="" title="" class="left_img" border="0"></a>
|
||||
<p>
|
||||
<span> Description:</span><br>
|
||||
|
||||
Gmail Account<br>
|
||||
Latest Quiz
|
||||
</p>
|
||||
</div>
|
||||
<br>
|
||||
<div>
|
||||
|
||||
<h1 ><br>Our main Services</h1>
|
||||
</div>
|
||||
<div class="services">
|
||||
<ul>
|
||||
<li><a href="www.javatpoint.com">Java tutorial</a></li>
|
||||
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="services">
|
||||
<ul>
|
||||
<li><a href="www.javatpoint.com">Java tutorial</a></li>
|
||||
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</div><!--end of right content-->
|
||||
|
||||
|
||||
<div id="footer">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div> <!--end of center box-->
|
||||
</div> <!--end of main content-->
|
||||
</div> <!--end of main container-->
|
||||
</body></html>
|
||||
23
WebContent/registerprocess.jsp
Normal file
@ -0,0 +1,23 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
|
||||
<%@page import="java.sql.*"%>
|
||||
<%try{
|
||||
|
||||
String username=request.getParameter("username");
|
||||
String userpass=request.getParameter("userpass");
|
||||
String category=request.getParameter("category");
|
||||
String email=request.getParameter("email");
|
||||
Class.forName("oracle.jdbc.driver.OracleDriver");
|
||||
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
|
||||
PreparedStatement ps=con.prepareStatement("insert into quizregister values(?,?,?,?)");
|
||||
|
||||
ps.setString(1,username);
|
||||
ps.setString(2,userpass);
|
||||
ps.setString(3,category);
|
||||
ps.setString(4,email);
|
||||
int s=ps.executeUpdate();
|
||||
System.out.print(s);
|
||||
}catch(SQLException e2){
|
||||
e2.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<jsp:forward page="index.jsp"></jsp:forward>
|
||||
151
WebContent/result.jsp
Normal file
@ -0,0 +1,151 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
|
||||
<html>
|
||||
|
||||
|
||||
<jsp:include page="header.jsp"></jsp:include>
|
||||
|
||||
<%
|
||||
String islogin=(String)session.getAttribute("islogin");
|
||||
if(islogin==null){
|
||||
request.setAttribute("notlogin_msg","Sorry,Please do Login first");
|
||||
|
||||
%>
|
||||
<jsp:forward page="index.jsp"></jsp:forward>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
|
||||
|
||||
|
||||
<div class="left_content">
|
||||
<%
|
||||
if(request.getAttribute("notlogin_msg")!=null){
|
||||
out.print("<font size='2' color='red' m>");
|
||||
out.print(request.getAttribute("notlogin_msg"));
|
||||
out.print("</font>");
|
||||
}
|
||||
%>
|
||||
<%
|
||||
if(request.getAttribute("Error")!=null){
|
||||
out.print("<font size='2' color='red' >");
|
||||
out.print(request.getAttribute("Error"));
|
||||
out.print("</font>");
|
||||
}
|
||||
%>
|
||||
<%
|
||||
if(request.getAttribute("finished")!=null){
|
||||
out.print("<font size='2' color='navy'>");
|
||||
out.print("<B>");
|
||||
out.print(request.getAttribute("finished"));
|
||||
out.print("<B>");
|
||||
out.print("</font>");
|
||||
}
|
||||
|
||||
%>
|
||||
<div class="calendar_box">
|
||||
|
||||
<div class="calendar_box_content">
|
||||
|
||||
<h1>Welcome to my Site</h1>
|
||||
<marquee direction="left" style="color: navy;" onmouseover="stop()" onmouseout="start()"><B>Assess Yourself by taking quizs on various subjects</B></marquee>
|
||||
<form action="view.jsp">
|
||||
<p>
|
||||
<font style="color: navy;"><B>Your <%=request.getAttribute("total") %> questions are correct</B></font><BR/>
|
||||
<input type="submit" value="view description">
|
||||
</p>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="news_left">
|
||||
<h1>Latest News</h1>
|
||||
<div class="news_box">
|
||||
<div class="calendar">1</div>
|
||||
<div class="news_content">
|
||||
<p><span></span>
|
||||
now learn how to develop android application free of cost</p><br>
|
||||
<a href="www.javatpoint.com" class="read_more">read more</a>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="news_box">
|
||||
<div class="calendar">2</div>
|
||||
<div class="news_content">
|
||||
<p><span></span>
|
||||
we have latest projects uploaded on my site</p>
|
||||
<a href="www.cstpoint.com" class="read_more">read more</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!--end of left content-->
|
||||
|
||||
|
||||
<div class="right_content">
|
||||
|
||||
|
||||
<h1>Latest Projects</h1>
|
||||
|
||||
<div class="project_box">
|
||||
<a href="#"><img src="images/p1.gif" alt="" title="" class="left_img" border="0"></a>
|
||||
<p>
|
||||
<span> Description:</span><br>
|
||||
Payment billing System
|
||||
Online Quiz<br>
|
||||
Matrimonial
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="project_box">
|
||||
<a href="#"><img src="images/p2.gif" alt="" title="" class="left_img" border="0"></a>
|
||||
<p>
|
||||
<span> Description:</span><br>
|
||||
|
||||
Gmail Account<br>
|
||||
Latest Quiz
|
||||
</p>
|
||||
</div>
|
||||
<br>
|
||||
<div>
|
||||
|
||||
<h1 ><br>Our main Services</h1>
|
||||
</div>
|
||||
<div class="services">
|
||||
<ul>
|
||||
<li><a href="www.javatpoint.com">Java tutorial</a></li>
|
||||
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="services">
|
||||
<ul>
|
||||
<li><a href="www.javatpoint.com">Java tutorial</a></li>
|
||||
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</div><!--end of right content-->
|
||||
|
||||
|
||||
<div id="footer">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div> <!--end of center box-->
|
||||
</div> <!--end of main content-->
|
||||
</div> <!--end of main container-->
|
||||
</body></html>
|
||||
|
||||
47
WebContent/saveques.jsp
Normal file
@ -0,0 +1,47 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
|
||||
<%@page import="java.sql.*"%>
|
||||
|
||||
<%! static int counter=0; %>
|
||||
<%
|
||||
counter++;
|
||||
try {
|
||||
Class.forName("oracle.jdbc.driver.OracleDriver");
|
||||
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
|
||||
String question= request.getParameter("question");
|
||||
String option1= request.getParameter("option1");
|
||||
String option2= request.getParameter("option2");
|
||||
String option3= request.getParameter("option3");
|
||||
String option4= request.getParameter("option4");
|
||||
String answer=request.getParameter("answer");
|
||||
String description=request.getParameter("description");
|
||||
PreparedStatement ps1=con.prepareStatement("select max(quizname) from quizinfo");
|
||||
ResultSet rs=ps1.executeQuery();
|
||||
while(rs.next()){
|
||||
String quizname= rs.getString(1);
|
||||
|
||||
//System.out.print(quizname);
|
||||
|
||||
PreparedStatement ps=con.prepareStatement("insert into quizques values(?,?,?,?,?,?,?,?,?)");
|
||||
|
||||
ps.setString(1,question);
|
||||
ps.setString(2,option1);
|
||||
ps.setString(3,option2);
|
||||
ps.setString(4,option3);
|
||||
ps.setString(5,option4);
|
||||
ps.setString(6,answer);
|
||||
ps.setString(7,quizname);
|
||||
ps.setString(8,null);
|
||||
ps.setString(9,description);
|
||||
int s= ps.executeUpdate();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
catch(Exception e){e.printStackTrace();}
|
||||
|
||||
%>
|
||||
<%
|
||||
request.setAttribute("counter",counter);
|
||||
%>
|
||||
<jsp:forward page="createquiz1.jsp"></jsp:forward>
|
||||
234
WebContent/start.jsp
Normal file
@ -0,0 +1,234 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
|
||||
<html>
|
||||
<head>
|
||||
<script>
|
||||
var request;
|
||||
function get1(){
|
||||
window.location='get1.jsp';
|
||||
}
|
||||
function get(){
|
||||
var v=document.getElementsByName('radio').value;
|
||||
window.location="get.jsp?ans="+v;
|
||||
}
|
||||
function sendInfo()
|
||||
{
|
||||
var v=document.myform.subject.value;
|
||||
var url="findname2.jsp?val="+v;
|
||||
if(window.XMLHttpRequest){
|
||||
request=new XMLHttpRequest();
|
||||
}
|
||||
else if(window.ActiveXObject){
|
||||
request=new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
try
|
||||
{
|
||||
request.onreadystatechange=getInfo;
|
||||
request.open("GET",url,true);
|
||||
request.send();
|
||||
}
|
||||
catch(e){alert("Unable to connect to server");}
|
||||
}
|
||||
|
||||
function getInfo(){
|
||||
if(request.readyState==4){
|
||||
var val=request.responseText;
|
||||
document.getElementById('location').innerHTML=val;
|
||||
}
|
||||
}
|
||||
function viewAll(name)
|
||||
{
|
||||
var v=name;
|
||||
var url="findname3.jsp?val="+v;
|
||||
if(window.XMLHttpRequest){
|
||||
request=new XMLHttpRequest();
|
||||
}
|
||||
else if(window.ActiveXObject){
|
||||
request=new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
try
|
||||
{
|
||||
request.onreadystatechange=viewInfo;
|
||||
request.open("GET",url,true);
|
||||
request.send();
|
||||
}
|
||||
catch(e){alert("Unable to connect to server");}
|
||||
}
|
||||
|
||||
function viewInfo(){
|
||||
if(request.readyState==4){
|
||||
var val=request.responseText;
|
||||
document.getElementById('location').innerHTML=val;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<jsp:include page="header.jsp"></jsp:include>
|
||||
|
||||
<%
|
||||
String islogin=(String)session.getAttribute("islogin");
|
||||
if(islogin==null){
|
||||
request.setAttribute("notlogin_msg","Sorry,Please do Login first");
|
||||
|
||||
%>
|
||||
<jsp:forward page="index.jsp"></jsp:forward>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
|
||||
|
||||
|
||||
<div class="left_content">
|
||||
<%
|
||||
if(request.getAttribute("notlogin_msg")!=null){
|
||||
out.print("<font size='2' color='red' m>");
|
||||
out.print(request.getAttribute("notlogin_msg"));
|
||||
out.print("</font>");
|
||||
}
|
||||
%>
|
||||
<%
|
||||
if(request.getAttribute("Error")!=null){
|
||||
out.print("<font size='2' color='red' >");
|
||||
out.print(request.getAttribute("Error"));
|
||||
out.print("</font>");
|
||||
}
|
||||
%>
|
||||
<%
|
||||
if(request.getAttribute("finished")!=null){
|
||||
out.print("<font size='2' color='navy'>");
|
||||
out.print("<B>");
|
||||
out.print(request.getAttribute("finished"));
|
||||
out.print("<B>");
|
||||
out.print("</font>");
|
||||
}
|
||||
%>
|
||||
|
||||
<div class="calendar_box2">
|
||||
|
||||
<div class="calendar_box_content">
|
||||
|
||||
<h1>Welcome to my Site</h1>
|
||||
<marquee direction="left" style="color: navy;" onmouseover="stop()" onmouseout="start()"><B>Assess Yourself by taking quizs on various sunject</B></marquee>
|
||||
|
||||
<form method="post" action="get1.jsp">
|
||||
<table><tr><td>
|
||||
<%
|
||||
String question=(String)session.getAttribute("question");
|
||||
String option1= (String)session.getAttribute("option1");
|
||||
String option2= (String)session.getAttribute("option2");
|
||||
String option3= (String)session.getAttribute("option3");
|
||||
String option4= (String)session.getAttribute("option4");
|
||||
out.print(question);
|
||||
%>
|
||||
<%
|
||||
if((String)request.getParameter("radio")!=null){
|
||||
String ans=(String)request.getParameter("radio");
|
||||
System.out.println("ans on set"+ans);
|
||||
session.setAttribute("ans",ans);
|
||||
|
||||
} %>
|
||||
</td></tr>
|
||||
<tr><td><input type="radio" name="radio" value="<%=option1%>" /><%=option1%></td></tr>
|
||||
<tr><td><input type="radio" name="radio" value="<%=option2%>"/><%=option2 %></td></tr>
|
||||
<tr><td><input type="radio" name="radio" value="<%=option3%>"/><%=option3 %></td></tr>
|
||||
<tr><td><input type="radio" name="radio" value="<%=option4%>"/><%=option4 %></td></tr>
|
||||
|
||||
<tr><td></td><td><input type="submit" value="Next"/></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="news_left">
|
||||
<h1>Latest News</h1>
|
||||
<div class="news_box">
|
||||
<div class="calendar">1</div>
|
||||
<div class="news_content">
|
||||
<p><span></span>
|
||||
now learn how to develop android application free of cost</p><br>
|
||||
<a href="www.javatpoint.com" class="read_more">read more</a>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="news_box">
|
||||
<div class="calendar">2</div>
|
||||
<div class="news_content">
|
||||
<p><span></span>
|
||||
we have latest projects uploaded on my site</p>
|
||||
<a href="www.cstpoint.com" class="read_more">read more</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!--end of left content-->
|
||||
|
||||
|
||||
<div class="right_content">
|
||||
|
||||
|
||||
<h1>Latest Projects</h1>
|
||||
|
||||
<div class="project_box">
|
||||
<a href="#"><img src="images/p1.gif" alt="" title="" class="left_img" border="0"></a>
|
||||
<p>
|
||||
<span> Description:</span><br>
|
||||
Payment billing System
|
||||
Online Quiz<br>
|
||||
Matrimonial
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="project_box">
|
||||
<a href="#"><img src="images/p2.gif" alt="" title="" class="left_img" border="0"></a>
|
||||
<p>
|
||||
<span> Description:</span><br>
|
||||
|
||||
Gmail Account<br>
|
||||
Latest Quiz
|
||||
</p>
|
||||
</div>
|
||||
<br>
|
||||
<div>
|
||||
|
||||
<h1 ><br>Our main Services</h1>
|
||||
</div>
|
||||
<div class="services">
|
||||
<ul>
|
||||
<li><a href="www.javatpoint.com">Java tutorial</a></li>
|
||||
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="services">
|
||||
<ul>
|
||||
<li><a href="www.javatpoint.com">Java tutorial</a></li>
|
||||
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</div><!--end of right content-->
|
||||
|
||||
|
||||
<div id="footer">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div> <!--end of center box-->
|
||||
</div> <!--end of main content-->
|
||||
</div> <!--end of main container-->
|
||||
</body></html>
|
||||
|
||||
294
WebContent/style.css
Normal file
@ -0,0 +1,294 @@
|
||||
body
|
||||
{
|
||||
background:url(images/bg.jpg) repeat-x top #fff;
|
||||
padding:0;
|
||||
font-family:Verdana, Arial, Helvetica, sans-serif;
|
||||
font-size:10px;
|
||||
margin:0px auto auto auto;
|
||||
color:#416271;
|
||||
}
|
||||
p{
|
||||
text-align:justify;
|
||||
line-height:14px;
|
||||
margin:0px;
|
||||
}
|
||||
span{
|
||||
color:#7cb805;
|
||||
}
|
||||
a{
|
||||
text-decoration:none;
|
||||
color:#416271;
|
||||
}
|
||||
h1{
|
||||
width:225px;
|
||||
margin:0 0 5px 0;
|
||||
font-family:Arial, Helvetica, sans-serif;
|
||||
font-size:12px;
|
||||
color:#8c847a;
|
||||
padding:5px 0 3px 0;
|
||||
border-bottom:1px #CCCCCC dashed;
|
||||
}
|
||||
#main_container{
|
||||
width:900px;
|
||||
height:auto;
|
||||
margin:auto;
|
||||
padding:0px;
|
||||
position:relative;
|
||||
background:url(images/top_bg.jpg) no-repeat left top;
|
||||
}
|
||||
.main_content{
|
||||
width:700px;
|
||||
height:auto;
|
||||
margin:auto;
|
||||
}
|
||||
.parrot{
|
||||
position:absolute;
|
||||
top:0px;
|
||||
left:45px;
|
||||
}
|
||||
#header{
|
||||
width:700px;
|
||||
height:135px;
|
||||
margin:auto;
|
||||
}
|
||||
.logo{
|
||||
padding:55px 0 0 115px;
|
||||
}
|
||||
.top_center_box{
|
||||
width:700px;
|
||||
height:19px;
|
||||
background:url(images/top_box.gif) no-repeat center;
|
||||
}
|
||||
.center_box{
|
||||
width:700px;
|
||||
background-color:#FFFFFF;
|
||||
}
|
||||
/*---------------- menu tab----------------------*/
|
||||
#menu_tab{
|
||||
width:700px;
|
||||
height:51px;
|
||||
font-family:Arial, Helvetica, sans-serif;
|
||||
padding:0px;
|
||||
margin:auto;
|
||||
background:url(images/menu_bg.gif) no-repeat center;
|
||||
}
|
||||
|
||||
ul.menu {
|
||||
list-style-type:none; display:block; width:560px;
|
||||
margin: auto; padding:0px; background:none;}
|
||||
|
||||
ul.menu li {
|
||||
display:inline;
|
||||
font-size:13px;
|
||||
font-weight:bold;
|
||||
line-height:51px;}
|
||||
|
||||
ul.menu li.divider {
|
||||
display:block;
|
||||
float:left;
|
||||
width:1px;
|
||||
height:51px;
|
||||
padding:0px ;
|
||||
margin:0px;
|
||||
background:url(images/divider.gif) no-repeat center;
|
||||
}
|
||||
|
||||
a.nav:link, a.nav:visited {
|
||||
display:block; float:left; padding:0px; margin:0;width: auto; margin:0px 14px 0px 14px; text-align:center;
|
||||
text-decoration:none; background:none; color:#62584d;}
|
||||
|
||||
a.nav_selected:link, a.nav_selected:visited {
|
||||
display:block; float:left; padding:0px; margin:0;width: auto;margin:0px 14px 0px 14px;text-align:center;
|
||||
text-decoration:none; color: #62584d; background:url(images/menu_arrow.gif) no-repeat top center;}
|
||||
|
||||
a.nav:hover {
|
||||
color: #62584d; text-decoration:none;background:url(images/menu_arrow.gif) no-repeat top center;}
|
||||
|
||||
/*---------------middle_box-----------------*/
|
||||
.middle_box{
|
||||
width:654px;
|
||||
height:161px;
|
||||
background:url(images/center_box_bg.gif) no-repeat center;
|
||||
margin:10px auto;
|
||||
}
|
||||
.middle_box_text_content{
|
||||
width:335px;
|
||||
height:auto;
|
||||
}
|
||||
.middle_box_title{
|
||||
width:260px;
|
||||
height:63px;
|
||||
padding:5px;
|
||||
|
||||
}
|
||||
p.middle_text{
|
||||
padding:0 0 0 15px;
|
||||
}
|
||||
/*----------------left_content------------*/
|
||||
.left_content{
|
||||
width:345px;
|
||||
float:left;
|
||||
padding:10px;
|
||||
}
|
||||
.calendar_box{
|
||||
width:329px;
|
||||
|
||||
background:url(images/calendar_bg.gif) no-repeat center;
|
||||
}
|
||||
.calendar_box2{
|
||||
width:329px;
|
||||
}
|
||||
.calendar_box_content{
|
||||
width:260px;
|
||||
padding-left:53px;
|
||||
}
|
||||
.calendar_box_content1{
|
||||
width:260px;
|
||||
padding-left:40px;
|
||||
height:230px;
|
||||
}
|
||||
.calendar_box_content2{
|
||||
width:260px;
|
||||
padding-left:40px;
|
||||
height:400px;
|
||||
}
|
||||
.right_content{
|
||||
width:310px;
|
||||
float:left;
|
||||
padding:10px 0 0 0;
|
||||
}
|
||||
.news_left{
|
||||
padding:10px 0 0 10px;
|
||||
}
|
||||
.project_box{
|
||||
clear:both;
|
||||
padding:10px 0 15px 0;
|
||||
}
|
||||
.project_box_portofolio{
|
||||
float:left;
|
||||
padding:10px 15px 15px 15px;
|
||||
}
|
||||
img.left_img{
|
||||
float:left;
|
||||
padding:0 15px 0 0;
|
||||
}
|
||||
.news_box{
|
||||
padding:5px 0 5px 0;
|
||||
}
|
||||
.calendar{
|
||||
width:42px;
|
||||
height:47px;
|
||||
float:left;
|
||||
background:url(images/calendar_icon.gif) no-repeat center;
|
||||
text-align:center;
|
||||
line-height:47px;
|
||||
font-size:14px;
|
||||
font-weight:bold;
|
||||
color:#5d2c1a;
|
||||
}
|
||||
.news_content{
|
||||
width:270px;
|
||||
float:left;
|
||||
padding:0 0 0 10px;
|
||||
}
|
||||
a.read_more{
|
||||
width:75px;
|
||||
height:29px;
|
||||
display:block;
|
||||
float:right;
|
||||
margin:5px;
|
||||
background:url(images/link_more_bg.gif) no-repeat center;
|
||||
text-decoration:none;
|
||||
color:#6c331f;
|
||||
text-align:center;
|
||||
line-height:29px;
|
||||
}
|
||||
a.read_more_a{
|
||||
width:75px;
|
||||
height:29px;
|
||||
display:block;
|
||||
float:right;
|
||||
margin:5px;
|
||||
background:url(images/link_more_bg_a.gif) no-repeat center;
|
||||
text-decoration:none;
|
||||
color:#dcc1b7;
|
||||
text-align:center;
|
||||
line-height:29px;
|
||||
}
|
||||
.wide_content{
|
||||
width:660px;
|
||||
clear:both;
|
||||
padding:0 20px 0 20px;
|
||||
}
|
||||
.projects_navigation{
|
||||
padding-right:250px;
|
||||
}
|
||||
p.contact_info{
|
||||
padding:10px 0 0 20px;
|
||||
line-height:18px;
|
||||
}
|
||||
span.orange{
|
||||
color:#f89824;
|
||||
}
|
||||
/*-----------------------contact_form-------------------*/
|
||||
#contact_form{
|
||||
width:300px;
|
||||
height:auto;
|
||||
padding:10px 0 0 20px;
|
||||
}
|
||||
.form_row{
|
||||
float:left;
|
||||
padding:8px 0 8px 0;
|
||||
}
|
||||
label{
|
||||
width:55px;
|
||||
float:left;
|
||||
padding:3px 5px 0 0;
|
||||
color:#8ebb41;
|
||||
text-align:right;
|
||||
}
|
||||
input.contact_input{
|
||||
width:225px;
|
||||
height:18px;
|
||||
float:left;
|
||||
border:1px #d1e0ee solid;
|
||||
background-color:#eef4d7;
|
||||
color: #000;
|
||||
}
|
||||
textarea.contact_textarea{
|
||||
width:225px;
|
||||
height:80px;
|
||||
float:left;
|
||||
border:1px #d1e0ee solid;
|
||||
background-color:#eef4d7;
|
||||
color: #000;
|
||||
}
|
||||
/*----------------------services-------------------------*/
|
||||
.services{
|
||||
float:left;
|
||||
}
|
||||
.services ul{
|
||||
list-style:none;
|
||||
padding:15px 10px 5px 0;
|
||||
margin:0px;
|
||||
}
|
||||
.services ul li{
|
||||
padding:5px;
|
||||
}
|
||||
.services ul li a{
|
||||
background:url(images/arrow.gif) no-repeat left;
|
||||
padding:0 0 0 25px;
|
||||
text-decoration:none;
|
||||
color:#416271;
|
||||
}
|
||||
|
||||
|
||||
/*--------------------footer--------------------*/
|
||||
#footer{
|
||||
width:680px;
|
||||
height:16px;
|
||||
clear:both;
|
||||
color:#763c26;
|
||||
padding:30px 0 0 20px;
|
||||
background:url(images/footer_bg.gif) no-repeat center;
|
||||
}
|
||||
207
WebContent/takequiz.jsp
Normal file
@ -0,0 +1,207 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
|
||||
<html>
|
||||
<head>
|
||||
<script>
|
||||
var request;
|
||||
function sendInfo()
|
||||
{
|
||||
var v=document.myform.subject.value;
|
||||
var url="findname2.jsp?val="+v;
|
||||
if(window.XMLHttpRequest){
|
||||
request=new XMLHttpRequest();
|
||||
}
|
||||
else if(window.ActiveXObject){
|
||||
request=new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
try
|
||||
{
|
||||
request.onreadystatechange=getInfo;
|
||||
request.open("GET",url,true);
|
||||
request.send();
|
||||
}
|
||||
catch(e){alert("Unable to connect to server");}
|
||||
}
|
||||
|
||||
function getInfo(){
|
||||
if(request.readyState==4){
|
||||
var val=request.responseText;
|
||||
document.getElementById('location').innerHTML=val;
|
||||
}
|
||||
}
|
||||
function viewAll(name)
|
||||
{
|
||||
var v=name;
|
||||
var url="findname3.jsp?val="+v;
|
||||
|
||||
if(window.XMLHttpRequest){
|
||||
request=new XMLHttpRequest();
|
||||
}
|
||||
else if(window.ActiveXObject){
|
||||
request=new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
try
|
||||
{
|
||||
request.onreadystatechange=viewInfo;
|
||||
request.open("GET",url,true);
|
||||
request.send();
|
||||
}
|
||||
catch(e){alert("Unable to connect to server");}
|
||||
}
|
||||
|
||||
function viewInfo(){
|
||||
if(request.readyState==4){
|
||||
var val=request.responseText;
|
||||
document.getElementById('location').innerHTML=val;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<jsp:include page="header.jsp"></jsp:include>
|
||||
|
||||
<%
|
||||
String islogin=(String)session.getAttribute("islogin");
|
||||
if(islogin==null){
|
||||
request.setAttribute("notlogin_msg","Sorry,Please do Login first");
|
||||
|
||||
%>
|
||||
<jsp:forward page="index.jsp"></jsp:forward>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
|
||||
|
||||
|
||||
<div class="left_content">
|
||||
<%
|
||||
if(request.getAttribute("notlogin_msg")!=null){
|
||||
out.print("<font size='2' color='red' m>");
|
||||
out.print(request.getAttribute("notlogin_msg"));
|
||||
out.print("</font>");
|
||||
}
|
||||
%>
|
||||
<%
|
||||
if(request.getAttribute("Error")!=null){
|
||||
out.print("<font size='2' color='red' >");
|
||||
out.print(request.getAttribute("Error"));
|
||||
out.print("</font>");
|
||||
}
|
||||
%>
|
||||
<%
|
||||
if(request.getAttribute("finished")!=null){
|
||||
out.print("<font size='2' color='navy'>");
|
||||
out.print("<B>");
|
||||
out.print(request.getAttribute("finished"));
|
||||
out.print("<B>");
|
||||
out.print("</font>");
|
||||
}
|
||||
|
||||
%>
|
||||
<div class="calendar_box2">
|
||||
|
||||
<div class="calendar_box_content">
|
||||
|
||||
<h1>Welcome to my Site</h1>
|
||||
<marquee direction="left" style="color: navy;" onmouseover="stop()" onmouseout="start()"><B>Assess Yourself by taking quizs on various subjects</B></marquee>
|
||||
|
||||
<form method="post" name="myform" action="get.jsp">
|
||||
|
||||
Enter the subject:<input type="text" name="subject" onkeyup="sendInfo()"/>
|
||||
<div id="location" ></div>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="news_left">
|
||||
<h1>Latest News</h1>
|
||||
<div class="news_box">
|
||||
<div class="calendar">1</div>
|
||||
<div class="news_content">
|
||||
<p><span></span>
|
||||
now learn how to develop android application free of cost</p><br>
|
||||
<a href="www.javatpoint.com" class="read_more">read more</a>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="news_box">
|
||||
<div class="calendar">2</div>
|
||||
<div class="news_content">
|
||||
<p><span></span>
|
||||
we have latest projects uploaded on my site</p>
|
||||
<a href="www.cstpoint.com" class="read_more">read more</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!--end of left content-->
|
||||
|
||||
|
||||
<div class="right_content">
|
||||
|
||||
|
||||
<h1>Latest Projects</h1>
|
||||
|
||||
<div class="project_box">
|
||||
<a href="#"><img src="images/p1.gif" alt="" title="" class="left_img" border="0"></a>
|
||||
<p>
|
||||
<span> Description:</span><br>
|
||||
Payment billing System
|
||||
Online Quiz<br>
|
||||
Matrimonial
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="project_box">
|
||||
<a href="#"><img src="images/p2.gif" alt="" title="" class="left_img" border="0"></a>
|
||||
<p>
|
||||
<span> Description:</span><br>
|
||||
|
||||
Gmail Account<br>
|
||||
Latest Quiz
|
||||
</p>
|
||||
</div>
|
||||
<br>
|
||||
<div>
|
||||
|
||||
<h1 ><br>Our main Services</h1>
|
||||
</div>
|
||||
<div class="services">
|
||||
<ul>
|
||||
<li><a href="www.javatpoint.com">Java tutorial</a></li>
|
||||
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="services">
|
||||
<ul>
|
||||
<li><a href="www.javatpoint.com">Java tutorial</a></li>
|
||||
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</div><!--end of right content-->
|
||||
|
||||
|
||||
<div id="footer">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div> <!--end of center box-->
|
||||
</div> <!--end of main content-->
|
||||
</div> <!--end of main container-->
|
||||
</body></html>
|
||||
|
||||
5
WebContent/test.jsp
Normal file
@ -0,0 +1,5 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
|
||||
<jsp:include page="header.jsp"></jsp:include>
|
||||
|
||||
|
||||
<jsp:include page="footer.html"></jsp:include>
|
||||
163
WebContent/view.jsp
Normal file
@ -0,0 +1,163 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
|
||||
<%@page import="java.sql.*"%>
|
||||
<html>
|
||||
|
||||
|
||||
<jsp:include page="header.jsp"></jsp:include>
|
||||
|
||||
<%
|
||||
String islogin=(String)session.getAttribute("islogin");
|
||||
if(islogin==null){
|
||||
request.setAttribute("notlogin_msg","Sorry,Please do Login first");
|
||||
|
||||
%>
|
||||
<jsp:forward page="index.jsp"></jsp:forward>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
|
||||
|
||||
|
||||
<div class="left_content">
|
||||
<%
|
||||
if(request.getAttribute("notlogin_msg")!=null){
|
||||
out.print("<font size='2' color='red' m>");
|
||||
out.print(request.getAttribute("notlogin_msg"));
|
||||
out.print("</font>");
|
||||
}
|
||||
%>
|
||||
<%
|
||||
if(request.getAttribute("Error")!=null){
|
||||
out.print("<font size='2' color='red' >");
|
||||
out.print(request.getAttribute("Error"));
|
||||
out.print("</font>");
|
||||
}
|
||||
%>
|
||||
<%
|
||||
if(request.getAttribute("finished")!=null){
|
||||
out.print("<font size='2' color='navy'>");
|
||||
out.print("<B>");
|
||||
out.print(request.getAttribute("finished"));
|
||||
out.print("<B>");
|
||||
out.print("</font>");
|
||||
}
|
||||
|
||||
%>
|
||||
<div class="calendar_box2">
|
||||
|
||||
<div class="calendar_box_content">
|
||||
|
||||
<h1>Welcome to my Site</h1>
|
||||
<marquee direction="left" style="color: navy;" onmouseover="stop()" onmouseout="start()"><B>Assess Yourself by taking quizs on various subjects</B></marquee>
|
||||
<%
|
||||
String name=(String)session.getAttribute("quizname");
|
||||
try{
|
||||
Class.forName("oracle.jdbc.driver.OracleDriver");
|
||||
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
|
||||
PreparedStatement ps= con.prepareStatement("select * from quizques where quizname='"+name+"'");
|
||||
ResultSet rs=ps.executeQuery();
|
||||
out.print("<table>");
|
||||
while(rs.next()){
|
||||
out.print("<tr><td>Question:</td><td>"+rs.getString(1)+"</td></tr>");
|
||||
out.print("<tr><td>Answer:</td><td>"+rs.getString(6)+"</td></tr>");
|
||||
out.print("<tr><td>Description:</td><td>"+rs.getString(9)+"</td></tr>");
|
||||
|
||||
}
|
||||
out.print("</table>");
|
||||
|
||||
}catch(Exception e){e.printStackTrace();}
|
||||
%>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="news_left">
|
||||
<h1>Latest News</h1>
|
||||
<div class="news_box">
|
||||
<div class="calendar">1</div>
|
||||
<div class="news_content">
|
||||
<p><span></span>
|
||||
now learn how to develop android application free of cost</p><br>
|
||||
<a href="www.javatpoint.com" class="read_more">read more</a>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="news_box">
|
||||
<div class="calendar">2</div>
|
||||
<div class="news_content">
|
||||
<p><span></span>
|
||||
we have latest projects uploaded on my site</p>
|
||||
<a href="www.cstpoint.com" class="read_more">read more</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!--end of left content-->
|
||||
|
||||
|
||||
<div class="right_content">
|
||||
|
||||
|
||||
<h1>Latest Projects</h1>
|
||||
|
||||
<div class="project_box">
|
||||
<a href="#"><img src="images/p1.gif" alt="" title="" class="left_img" border="0"></a>
|
||||
<p>
|
||||
<span> Description:</span><br>
|
||||
Payment billing System
|
||||
Online Quiz<br>
|
||||
Matrimonial
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="project_box">
|
||||
<a href="#"><img src="images/p2.gif" alt="" title="" class="left_img" border="0"></a>
|
||||
<p>
|
||||
<span> Description:</span><br>
|
||||
|
||||
Gmail Account<br>
|
||||
Latest Quiz
|
||||
</p>
|
||||
</div>
|
||||
<br>
|
||||
<div>
|
||||
|
||||
<h1 ><br>Our main Services</h1>
|
||||
</div>
|
||||
<div class="services">
|
||||
<ul>
|
||||
<li><a href="www.javatpoint.com">Java tutorial</a></li>
|
||||
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="services">
|
||||
<ul>
|
||||
<li><a href="www.javatpoint.com">Java tutorial</a></li>
|
||||
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</div><!--end of right content-->
|
||||
|
||||
|
||||
<div id="footer">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div> <!--end of center box-->
|
||||
</div> <!--end of main content-->
|
||||
</div> <!--end of main container-->
|
||||
</body></html>
|
||||
|
||||
BIN
build/classes/com/javatpoint/MyListener.class
Normal file
58
src/com/javatpoint/MyListener.java
Normal file
@ -0,0 +1,58 @@
|
||||
package com.javatpoint;
|
||||
import javax.servlet.*;
|
||||
import java.sql.*;
|
||||
|
||||
public class MyListener implements ServletContextListener{
|
||||
|
||||
public void contextInitialized(ServletContextEvent arg0) {
|
||||
|
||||
Connection con=null;
|
||||
try{
|
||||
ResultSet rs;
|
||||
Class.forName("oracle.jdbc.driver.OracleDriver");
|
||||
con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
|
||||
|
||||
PreparedStatement ps1=con.prepareStatement("Select * from QUIZCONTACT");
|
||||
|
||||
rs=ps1.executeQuery();
|
||||
if(rs.next())
|
||||
{System.out.println("your table name already exist");}
|
||||
else
|
||||
{System.out.println("else if part table does not exist new table has created");
|
||||
|
||||
|
||||
PreparedStatement ps2= con.prepareStatement("CREATE SEQUENCE JAVATPOINT MINVALUE 1 MAXVALUE 999999999 INCREMENT BY 1 START WITH 1 NOCACHE NOORDER NOCYCLE");
|
||||
ps2.executeUpdate();
|
||||
PreparedStatement ps=con.prepareStatement("CREATE TABLE QUIZCONTACT (NAME VARCHAR2(4000),EMAIL VARCHAR2(4000),PHONE VARCHAR2(4000),MESSAGE VARCHAR2(4000))");
|
||||
ps.executeUpdate();
|
||||
PreparedStatement ps4=con.prepareStatement("CREATE TABLE QUIZINFO (SUBJECT VARCHAR2(4000),QUIZNAME VARCHAR2(4000))");
|
||||
ps4.executeUpdate();
|
||||
|
||||
|
||||
PreparedStatement ps5=con.prepareStatement("CREATE TABLE QUIZQ(NAME VARCHAR2(4000),EMAIL VARCHAR2(4000),PHONE VARCHAR2(4000),QUESTION VARCHAR2(4000))");
|
||||
ps5.executeUpdate();
|
||||
|
||||
|
||||
ps5= con.prepareStatement("CREATE TABLE QUIZQUES(QUESTION VARCHAR2(4000),OPTION1 VARCHAR2(4000),OPTION2 VARCHAR2(4000),OPTION3 VARCHAR2(4000),OPTION4 VARCHAR2(4000),ANSWER VARCHAR2(4000),QUIZNAME VARCHAR2(4000),QID VARCHAR2(4000),DESCRIPTION VARCHAR2(4000),CONSTRAINT QUIZQUES_PK PRIMARY KEY (QID) ENABLE)");
|
||||
ps5.executeUpdate();
|
||||
|
||||
|
||||
ps5= con.prepareStatement("CREATE TABLE QUIZREGISTER (USERNAME VARCHAR2(4000),USERPASS VARCHAR2(4000),CATEGORY VARCHAR2(4000),EMAIL VARCHAR2(4000))");
|
||||
ps5.executeUpdate();
|
||||
Statement stmt=con.createStatement();
|
||||
stmt.executeUpdate("CREATE TRIGGER BI_QUIZINFO before insert on QUIZINFO for each row begin select JAVATPOINT.nextval into :NEW.QUIZNAME from dual;end");
|
||||
stmt.executeUpdate("CREATE TRIGGER BI_QUIZQUES before insert on QUIZQUES for each row begin select JAVATPOINT.nextval into :NEW.QID from dual;end");
|
||||
}
|
||||
}
|
||||
|
||||
catch(Exception e){
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void contextDestroyed(ServletContextEvent arg0) {
|
||||
System.out.println("project undeployed");
|
||||
|
||||
}
|
||||
}
|
||||