Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

checking conditions  RSS feed

 
chinna velagala
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey i did JSP project in which each page has a question with 5 options and a submit button. there are 20 questions on the whole......

i have the options that are marked in each page . so now depending on answers we have to produce the result by comparing the answers in each page with other.

i used if and else loops but did not work.... so can you help me.....
 
Justin Russo
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It should have worked if you are passing the answers for each question correctly across pages.Btw how are you pasing the answers ? hoping its the post method.
two ways to do it

1. either pass the form variables on each jsp page OR
2. keep a database table which maintain an option number for each Question and its corresponding correct answer (eor eg. field would be QuestionNo, useranswer, CorrectAnswer). The correctAnswer and the QuestionNO would already be stored during design time..
so everytime the user selects and go to the next page just update that answer for the question in the database at the end when he wishes to see the results you can just make a simple query against database to see what was right and wrong.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!