• Post Reply Bookmark Topic Watch Topic
  • New Topic

Shuffling question in JSP and servlet  RSS feed

 
sachin rajaryan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ALL

I need help in java code ..I have quiz application and i am able to retireve question its working.

1> I want to shuffle question which is not happening.not sure why jsp page is not updating with random question

here is my file1 code :


Below is my JSP Page


this is my exam controller

 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37256
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sachin,
Welcome to CodeRanch! I don't see anything about "random" in your code. What part of it do you think does randomness?
 
sachin rajaryan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

I am trying to shuffle by this

questionList.add(number,q);
        
        Collections.shuffle(questionList);

but  the behaviour  of the code is is it not changing question on jsp page
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37256
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are shuffling after picking the current question. Wouldn't that meant it isn't used?

If that's not it, try removing code so you have a smaller example that shows the problem. This is a lot of code to read.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!