Share on Google+Share on Google+

zaidkhan
online test application in java
1 Answer(s)      4 years and 8 months ago
Posted in : Java Beginners

Can questions come in html file (test.html) if we link test.jsp with test.html

Ads

View Answers

August 9, 2012 at 11:50 AM


We have taken radiobuttons in our application, you can take textarea, textfield etc. Here we have created a table ans(ques,op1,op2,op3,op4,op5,ans) in the mysql database.

1)radio.jsp:

<[email protected] import="java.sql.*"%>
<form name="form" method="post" action="result.jsp">
<table>
<%
Class.forName("com.mysql.jdbc.Driver");
Connection conn =DriverManager.getConnection("jdbc:mysql://localhost:3306/register","root","root");
Statement st=conn.createStatement();
ResultSet rs=st.executeQuery("select * from answers");
int i=0;
while(rs.next()){
%>
<tr>
<td><%=rs.getString(1)%></td>
<td><input type="radio" name="radio<%=i%>" value="<%= rs.getString(2) %>"></td><td><%=rs.getString(2)%></td>
<td><input type="radio" name="radio<%=i%>" value="<%= rs.getString(3) %>"></td><td><%=rs.getString(3)%></td>
<td><input type="radio" name="radio<%=i%>" value="<%= rs.getString(4) %>"></td><td><%=rs.getString(4)%></td>
<td><input type="radio" name="radio<%=i%>" value="<%= rs.getString(5) %>"></td><td><%=rs.getString(5)%></td>
<td><input type="radio" name="radio<%=i%>" value="<%= rs.getString(6) %>"></td><td><%=rs.getString(6)%></td>
<td><input type="hidden" name="ans<%=i%>" value="<%= rs.getString(7) %>"></td>

</tr><%
i++;
}
%>
<tr><td><INPUT type="submit" name="submit" value="Submit"></td></tr>
</table>
</form>

2) result.jsp:

<[email protected] import="java.sql.*"%>
<[email protected] import="java.util.*"%>
<%
String id[]= new String[10];
for(int i=0;i<10;i++){
id[i]=request.getParameter("radio"+i);
}
String str[]= new String[10];
for(int j=0;j<10;j++){
str[j]=request.getParameter("ans"+j);
}
boolean isCorrect = Arrays.equals(id,str);
out.println("Your Answers are : " + isCorrect);
%>

For more information,please visit the following link:

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










Related Tutorials/Questions & Answers:
online test application in java
Online Test Application Table Of Contents Introduction To Application Database Design Creating Data Access Object (DAO) Design Pattern Creating Views Writing Actions Mapping Application Admin Module User Module Download
online test application in java
online test application in java  Can questions come in html file... the following link: http://www.roseindia.net/jsp/online-quiz-application-jsp.shtml... radiobuttons in our application, you can take textarea, textfield etc. Here we have created
Advertisements
Online test
Online test   I am creating a project for online test system. There should be a timer,on pressing next button it will retrieve a next question and it will show on the same page,on completion of test it will show result
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...;Here is a jsp application. Here we have created a table test
code for timer in java netbeans for online test series countdown timer
code for timer in java netbeans for online test series countdown timer  code for timer in java netbeans for online test series countdown timer
online test project
online test project  i need online test project in java using struts...kindly help..   Have a look at the following link: http://www.roseindia.net/struts/struts/struts2.2.1/onlinetestapp
Online Test System Project
Online Test System Project  I want a full ready-made project on online test system in jsp. i am not using servlet but only jsp.And backend database...://www.roseindia.net/jsp/online-quiz-application-jsp.shtml
online test system
online test system  Hi, I am creating a project for online test.../online-quiz-application-jsp.shtml http://www.roseindia.net/answers/viewqa/JSP... question and it will show on the same page,on completion of test it will show
Online Test System Project
Online Test System Project  I want a full ready-made project on online test system in jsp. i am not using servlet but only jsp.And backend database as mysql. my email address is help me. send a full project on online test system
online test software using jsp and servlet
online test software using jsp and servlet  online test software using jsp and servlet
java test
java test  How to read the data from an .csv file and write into an xml file using java? (test_sample.csv(it should contain at least 39 lines)) i...:\\Documents and Settings/janardhany/Desktop/test_sample.txt
online banking application
online banking application  i want to develope online banking application by using jsp with oracle 10g database but i have problem to view the mini statement and balance enquiry...when we entered accontno and pin and select
Using the QUnit to test jQuery application
Using the QUnit to test jQuery application       Using the QUnit to test jQuery application Using Qunit , testing of JQuery become very easy and efficient
how to conduct the test in java
how to conduct the test in java  how to conduct the test in java
java test - Java Beginners
java test   Trace through the following program segment and state clearly the output that will be generated: public static void main(String [] args){ int no1; int no2; for (no1 = -2; no1 <= 1; no1++){ for (no2
Online Java Compiler
that allows a Java application developers to write and test their application code... you to test your Java and other programming language codes online...Online Java Compiler provides the Java development environment online, which
Online Quiz Application in JSP
Online Quiz Application in JSP  ... are going to implement of Online quiz application using of JSP. Step 1: Create... is the code. <[email protected] language="java" import="java.sql.*" %>
Create test engine - Java Beginners
Create test engine  How can create a test engine dat generates questions randomly using javax.swing in java
Free Java online Training
Free Java online Training  Hi, From where I can take online free Java Training classes? Thanks   Hi, Ok, We will provide online free... for registering for Free Online Java Training classes. Thanks
Online Java Tutorial
Online Java Tutorial  Hi, I am trying to find Online Java Tutorials. Give me the URL. Thanks   Hi, Learn Java at Java Tutorials section. Thanks
Online Java Training for Beginners
Online Java Training for Beginners The online java training for beginners... or no knowledge of Java programming can undertake Rose India's online Java training for the beginners. The Online Java Programming course for the beginner's
Java File Handling Test Results
Java File Handling Test Results   Is somebody able to help me with this Write a program to read each name from the file and prompt the user... java.io.*; public class Test { public static void main(String[] args) throws
online attendance management in java.....
online attendance management in java.....  if any body have this project or project related to this please help.... i need it urgently.. plz help me out
junit test case - Java Beginners
junit test case  how to use junit for testing email id format  Hi Friend, Please visit the following link: http://www.roseindia.net/junit/ Hope that it will be helpful for you. Thanks
Java Online Training
Java online training is provided for free to everyone interested in learning... in the IT department. Online training of Java given at Roseindia is one of the best in comparison to other types of training available in the market. Java online training
online shopping - Java Beginners
online shopping  Respected Sir, Sir please help me how to handle online shooping and shopping cart by click on image by only using jsp
online shopping - Java Beginners
online shopping  Respected Sir, Sir please help me how to handle online shooping and shopping cart by click on image by only using jsp?   Hi friend, For solving the problem visit to : http
Java project in online examination system
Java project in online examination system  how many and which tables are required at backend as SQL for online examination system project in jsp
Where to take online Java Training?
Where to take online Java Training?  Hi, I am new in programming and trying to learn Java for making career in Java. I want to find good Job in Java programming. Where to take online Java training course? Thanks   Hi
online java traaining - Java Beginners
online java traaining  HI, Can u tell me ! that where i can study online training for java study?? Where i get home work or task or daily lab... java examples regarding core java,IO package, Threads,Collections, Swing etc. You
Core Java Online Training
of such application is MATLAB. The practical and video-based core java online...Ascend as an Expert Developer with Core Java Online Training - Online... java online training for those who wish to learn, but are bounded by time, due
Tutorials   
Java Spring Hibernate Struts Training Retrieve database from the table dynamically in jsp from oracle using servlet What does core Java include? java What are some way to learn Java quickly? Is it required to learn Java before learning Java Script? Is it necessary to learn java script before learning PHP? Are HTML5 and Java Script boosts Java career? Is Java object oriented? Fingerprint application with Java Uninstall Oracle Virtual Box JSON to HashMap Free Java online Training I want example of Control Statement in Java ANSI Color Codes with Python Create a Program that Calculates Input What is difference between JDK,JRE and JVM? How to see ubuntu version on server? How to get Page Source in Selenium (WebDriver) using Java? The path to the driver executable must be set by the webdriver.gecko.driver system property parse data from a link in java Java Program Qns using BlueJ How to fix HAX Kernel Module Is Not Installed error? Installing Audacity Looking for code Logic to check track changes & Coments in MSWord, MSWordx, MSExcel, MSExcelx is ON/OFF Installing JDK on Mac SAX Parser exception ERROR 601 (42P00): Syntax error. Encountered Thread java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory How to install Ubuntu 16.04 LTS? HttpServletRequest cannot be resolved to a type in eclipse - Solved Unhandled event loop exception GC overhead limit exceeded Spring Data jpa with apache phoenix Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF o.a.h.h.z.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum= com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager not found How to download and install Java 8 on Windows? How to uninstall JDK 7? How to install gtk-doc-tools package in Ubuntu? How to install Oracle JDK 8 on Ubuntu? ejabberd_ctl.beam not found - Solved How to convert date to UTC format in Java? How to install autoconf, automake and libtool in Ubuntu 15.10? How to convert current date to mm dd yyyy format in Java? How to convert current date to dd mm yyyy format in Java? How to stop window closing in "internalFrameClosing" event. How to find list of all index in Neo4j? neo4j-server.properties file location SASLError using PLAIN: not-authorized

Ads

 
Advertisement null

Ads