| Author |
Online Quiz Application
|
Ankitt Gupta
Ranch Hand
Joined: Feb 19, 2009
Posts: 101
|
|
Develop a JAVA servlet/ JSP application:
Have a set of at least 10 questions and their corresponding answers. Please do not use a database to store these. You may use a file or use static variables in your code for the Q&A. Every time the application is accessed it would show a question and a multiple choice of 4 answers. It would wait for the user input (through radio buttons and 'submit' button).
If user input is correct, it displays "Congratulations. Your answer is correct!"
If user input is incorrect, it displays "Sorry. The correct answer is xxx"
After every Q&A, it would ask the user if he wants to answer another question. If 'yes', then it displays another question from the pool. If 'no', then it says "Bye. Please Visit Later"
NOTE:
1. The questions that are displayed should be randomly selected so that every time the application is loaded, the user is presented with a different question
2. In any given Q&A session, the system should not display the same question twice
I have develop the following 10 JSP's for each question.
JSP1.jsp
S_JSP1.jsp
I want to ask how to achieve the following...
NOTE:
1. The questions that are displayed should be randomly selected so that every time the application is loaded, the user is presented with a different question
2. In any given Q&A session, the system should not display the same question twice
|
 |
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12324
|
|
That is hardly a general solution is it? I suspect your instructor would not be happy with it.
It is time to back off and separate the parts of the problem:
Don't think about the presentation side until you have a solution for the data side:
Some object to represent a question - including the text and a way to keep track of which is the correct answer.
Some way to populate a set of questions from a text file, building a collection of questions.
Now use a question object to populate a HTML page - presumably via JSP.
Bill
|
Java Resources at www.wbrogden.com
|
 |
 |
|
|
subject: Online Quiz Application
|
|
|