• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

How to write jsp code for a quiz program---Urgent

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All...can any one give me an idea about what will be the logic behind making a mock exam style program. If I make a database of set of questions and answers and the answers type are mixed like a checkbox, radiobutton , textarea....how do I introduce this and also for a given user how is his answers stored in order to evaluate at the end
If anyone could suggest some links where i cud find such a code will be very helpful
Thanks
Nidhi
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Nidhi Juneja:
Hello All...can any one give me an idea about what will be the logic behind making a mock exam style program. If I make a database of set of questions and answers and the answers type are mixed like a checkbox, radiobutton , textarea....how do I introduce this and also for a given user how is his answers stored in order to evaluate at the end
If anyone could suggest some links where i cud find such a code will be very helpful
Thanks
Nidhi

 
Deepak MP
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
While making the database of questions & answers, you can have a column indicating the answers(in case of Multiple answers seperate it by some string(",")) and column in database indicating the type of answers i.e multiple answers[checkbox] or single answer[radiobutton] or editanswer[textarea]. The question can be displayed in a JSP, by making a call to JSP / Servlet (which in turn may request the database for next question OR can store all the questions along with it answers for a given test in a Java Object and get the information to be displayed from this object).
-----------
You can try the below logic to implement.
ValueInDatabase : is the value got for the column entry indicating the type of Question.
if (ValueInDatabase.equals("Single"))
{
//Implement display logic for JSP for Single Answer(i.e with RadioButtons)
}
if (ValueInDatabase.equals("Multiple"))
{
//Implement display logic for JSP for Multiple Answers Type (i.e with Check box)
}
if (ValueInDatabase.equals("TextArea"))
{
//Implement display logic for JSP for Text Area Answer type
}
-----------
Answers can be stored in HttpSession variable and then be compared at the end of the test.
I hope it help.
DEEPAK
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic