jsp online ex

Ads
 

jsp online ex

plz help me providing source code for mini project online exam using jsp and mysql..... plzplz plzhelp me pur....

View Answers

November 8, 2012 at 4:18 PM

We are providing you a simple application.

Create table test(ques,op1,op2,op3,op4,ans) and answers(id,ans). Then try the following code:

1)form.jsp:

<%@page import="java.sql.*"%>
<html>
<form method="post" action="result.jsp">
<table>
<%
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/register","root";, "root");
Statement st=connection.createStatement();
ResultSet rs=st.executeQuery("Select * from test");
int i=1;
while(rs.next()){
%>
<tr><td><%=i%></td><td><%=rs.getString("ques")%></td><td><input type="radio" value="<%=rs.getString("op1")%>" name="radio<%=i%>"/><%=rs.getString("op1")%></td><td><input type="radio" value="<%=rs.getString("op2")%>" name="radio<%=i%>"/><%=rs.getString("op2")%></td><td><input type="radio" value="<%=rs.getString("op3")%>" name="radio<%=i%>"/><%=rs.getString("op3")%></td><td><input type="radio" value="<%=rs.getString("op4")%>" name="radio<%=i%>"/><%=rs.getString("op4")%></td></tr>

<%
i++;
}
%>
<tr><td><input type="submit" value="submit"></td></tr>
</table>
</form>
</html>

2)result.jsp:

<%@page import="java.sql.*"%>

<%
String st[]=new String[10];
for(int i=0;i<st.length;i++){
int j=i+1;
st[i]=request.getParameter("radio"+j);
System.out.println(st[i]);

}
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/register","root";, "root");
Statement stmt=connection.createStatement();
ResultSet rs=stmt.executeQuery("Select ans from answers");
String ans="";
while(rs.next()){
ans+=rs.getString("ans")+" ";
}
int count=0;
String answers[]=ans.split(" ");
for(int i=0;i<answers.length;i++){
if(st[i].equals(answers[i])){
count++;
}
}
out.println("Your "+count+" answers are correct");
%>

For more information, visit the following links:

http://www.roseindia.net/struts/struts/struts2.2.1/onlinetestapp/index.html

http://www.roseindia.net/jsp/online-quiz-application-jsp.shtml


November 8, 2012 at 4:26 PM

i used this code sir...am not getting where to place questions plz help me

Ads









Related Tutorials/Questions & Answers:
jsp online ex
jsp online ex  wat is the parametr u passed ...ques
jsp online ex
jsp online ex  how to sum up the count of a cloumn in mysql and display ot on jsp when asked to calculate
Advertisements
jsp online ex
jsp online ex  plz help me providing source code for mini project online exam using jsp and mysql..... plzplz plzhelp me pur
jsp online ex
jsp online ex  deepak sir please help me...i jave created jsp page containing a question with 4 optipns and now i want tp save the options selected inside mysql and then retrievecot for checking it wit correctness...plzzzzzzzzz
jsp online exam...
jsp online exam...  Plz provide me front end design
secure online payment code for jsp
secure online payment code for jsp   how to implements online payment in jsp
jsp online exam
jsp online exam  i have designed a html page with 20 multiple choice questions ...options are in radio button for each question .... now i have to retrieve all the selected answers and save it to database match it with correct
online examination system project in jsp
online examination system project in jsp  How many tables are required in SQL for online examination system project in jsp in java
online examination system project in jsp
online examination system project in jsp  How many tables are required in SQL for online examination system project in jsp in java my email id
online shopping code using jsp
online shopping code using jsp  plz send me the code of online shopping using jsp or jdbc or servlets plz plz help me
online examination system project in jsp
online examination system project in jsp  How many and which data tables are required for online examination system project in jsp in java. please give me the detailed structure of each table
online test software using jsp and servlet
online test software using jsp and servlet  online test software using jsp and servlet
how to create online exam in jsp and database
how to create online exam in jsp and database  learing stage ,want to know how to create online exam
online shopping cart complete coding in pure jsp
online shopping cart complete coding in pure jsp  online shopping cart complete coding in pure jsp   Please visit the following link: JSP Online shopping cart
online examination system project in jsp
in jsp for online examination system...; For more information, visit the following link: http://www.roseindia.net/jsp/online...online examination system project in jsp  I am doing project
online examination system project in jsp
online examination system project in jsp  How to show the status bar which shows how much time is remaining in online examination system in jsp.my
Online Quiz Application in JSP
Online Quiz Application in JSP  ... are going to implement of Online quiz application using of JSP. Step 1: Create... quiz question and answer form using with JSP or JDBC database.  Here
Using Servlets, JSP for Online Shopping
Using Servlets, JSP for Online Shopping  What is wrong with my code ? JSP <form action="LoginServlet "method="post" > <table> <tr ><td>Username:</td><td><input type="text" name="Id
online examination system project in jsp
online examination system project in jsp  thanks for providing me 6 tables for online examination system. I want to know what will the id field of Answers1 table contain? Will it contain same id for all the questions of Set1 &
online examination system project in jsp
online examination system project in jsp  thanks for providing me 6 tables for online examination system. I want to know what will the id field of Answers1 table contain? Will it contain same id for all the questions of Set1 &
online examination system project in jsp
online examination system project in jsp  Thanks for providing me the 6 tables.But I want to know will the id field of answers1 table be same for all questions of Set1? Will it be 1 or will be 1,2,3,... What
CAN U HELP ME TO CODE IN JSP FOR ONLINE VOTING SYSTEM
CAN U HELP ME TO CODE IN JSP FOR ONLINE VOTING SYSTEM  can u help me to code in jsp for online voting system
online database connectivity issue from JSP page .
online database connectivity issue from JSP page .  Hi; Everything working fine in localhost , but facing a simple problem in connectivity... following code in online connectivity ---- Class.forName
online database connectivity issue from JSP page .
online database connectivity issue from JSP page .  Hi; Everything working fine in localhost , but facing a simple problem in connectivity... in online connectivity ---- Class.forName
online database connectivity issue from JSP page .
online database connectivity issue from JSP page .  Hi; Everything working fine in localhost , but facing a simple problem in connectivity... in online connectivity ---- Class.forName
online test project on java using servlets and jsp
online test project on java using servlets and jsp  as i am doing online test project on java using jsp and servlets ,,,the problem is in the code of jsp file which i have sent,...,i used next and previous buttons and used two
code to send sms alerts using jsp online
code to send sms alerts using jsp online  I am new to mobile aplication development. pls send me the code for sms alerts after clicking the button
ModuleNotFoundError: No module named 'ex'
ModuleNotFoundError: No module named 'ex'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'ex' How to remove the ModuleNotFoundError: No module named 'ex' error
ModuleNotFoundError: No module named 'ex'
ModuleNotFoundError: No module named 'ex'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'ex' How to remove the ModuleNotFoundError: No module named 'ex' error
Ask JSP questions online
Ask JSP questions online       Facing problem in JSP? Ask to us, we... new section, you can ask any query relating to JSP, whether it is from
How do i get the number of online users from a site using jsp?
How do i get the number of online users from a site using jsp?  Hi, Can any one tell me how to get the number of records from a database dynamically, when each person got logged into the page in jsp

Ads