Win a copy of Functional Reactive Programming this week in the Other Languages forum!
    Bookmark Topic Watch Topic
  • New Topic

Online Quiz Application

 
Ankitt Gupta
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
 
Mahtab Alam
Ranch Hand
Posts: 391
1
Java MySQL Database PHP
  • Mark post as helpful
  • send pies
  • Report post to moderator
I have created one Quiz application using JSP Servlet.

While making this small app I learnt a lot specially maintaining sessions.

You can read about it and download the code Online Quiz Application Using JSP Servlet

I am thinking of adding below functionalities into it.

1. Each quiz can have different number of questions

2. Each question can have different number of options

3. A question can have multiple correct options

4. Implementing a timer for the quiz

5. Maintaining a history of the user; like how many tests a user have taken in the past and his score

6. Randomizing the order of questions presented to the user

7. Giving the user option to review his answers before submitting the test for evaluation

8. A dropdown box to jump to any question in between the test rather then clicking next button multiple times.
 
J. Kevin Robbins
Bartender
Pie
Posts: 1801
28
Chrome Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not post the same question multiple times.
 
    Bookmark Topic Watch Topic
  • New Topic