• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Shuffling question in JSP and servlet  RSS feed

 
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

 
author & internet detective
Marshal
Posts: 38682
677
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
Marshal
Posts: 38682
677
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!