| | |
Randomizing Database Questions
![]() |
•
•
Join Date: Nov 2004
Posts: 2
Reputation:
Solved Threads: 0
Please.
I'm writing a Test Engine Software and I have a big issue. I have a large question database about 1000 questions and I need to load 50 random questions for each test instance. i.e Each time a user runs the test, 50 DISTINCT questions will be loaded.
They should not be the same every time and questions that have already been loaded and or answered should not be displayed again.
Right now, I have extracted all the questions into a ResultSet, is there a way I can shuffle the questions and select the top 50 into a new ResultSet and use the new ResultSet to administer the test. If it's possible, it'll make my job easier. If not, I'd really appreciate any help I can get.
Thanx
Luminus
I'm writing a Test Engine Software and I have a big issue. I have a large question database about 1000 questions and I need to load 50 random questions for each test instance. i.e Each time a user runs the test, 50 DISTINCT questions will be loaded.
They should not be the same every time and questions that have already been loaded and or answered should not be displayed again.
Right now, I have extracted all the questions into a ResultSet, is there a way I can shuffle the questions and select the top 50 into a new ResultSet and use the new ResultSet to administer the test. If it's possible, it'll make my job easier. If not, I'd really appreciate any help I can get.
Thanx
Luminus
•
•
Join Date: Nov 2004
Posts: 2
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by jwenting
no, that's not possible.
What I'd do is store the questions with a unique number as a key, then create 50 random numbers and pull the questions with those numbers out of the database.
Thanx
![]() |
Similar Threads
- Creating MySQL database for a website (MySQL)
- Writing to an Access Database (Visual Basic 4 / 5 / 6)
- database questions I have (Database Design)
- database questions, software development (IT Professionals' Lounge)
- Beginner's questions: C++ and databases (C++)
Other Threads in the Java Forum
- Previous Thread: IE Browser shutting down and shows error on desktop
- Next Thread: Creating Jars
| Thread Tools | Search this Thread |
911 actionlistener addressbook android api append applet application array arrays automation binary blackberry block bluetooth character chat class client code component consumer csv database desktop developmenthelp eclipse error fractal ftp game givemetehcodez graphics gui html ide image integer j2me j2seprojects japplet java javaarraylist javac javaee javaprojects jni jpanel julia lego linked linux list loops mac map method methods mobile netbeans newbie number objects online oriented panel printf problem program programming project projects properties recursion replaydirector reporting researchinmotion rotatetext rsa scanner se server set singleton sms sort sql string swing test textfields threads time title tree tutorial-sample ubuntu update windows working






