• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Shuffling question in JSP and servlet

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic