Click here to Skip to main content
15,881,715 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello my new question is how to generate a randome questions in paper automatically like... i have a one form in vb.net 2008 and database in sqlserver 2005.... my question is that i have a form1 in which using combobox1 for Modules((thease are fields)Module_ID,Module_Name), Combobox2 for topics((these are fields)Module_ID,Topic_ID,Topic_Name),Combobox3 for category in which loading items like(b1,b2) , combobox4 for levels(1,2,3) ... means i want to select module,topic,category,level and then it must read from database then select random question from question table which fields are(Topic_ID,Question_ID,Question,Image_data,level_ID)with its options like a,b,c from Options table which fields are(Question_ID,Option_ID,Description,Answer) read randomly at least 10 questions or more then 10 according to quantity for which using combobox5 (10,20,30,40,50...)and the past it all selected data from tools and database on next form of vb then i can print that paper... please guide me or properly tell me about code how may i work on this ... waiting for reply
Posted
Comments
_Maxxx_ 10-Dec-14 0:29am    
It's rather expected that you do some work yourself, and then ask questions when you get stuck with specific problems. I'm not sure anyone is going to help you with this as it is simply too large a question to answer on such a forum as this
Maciej Los 10-Dec-14 2:24am    
What have you tried?
Where are you stuck?
Sinisa Hajnal 10-Dec-14 2:52am    
This is asking for whole form code. Do your own work and come back when you have some problem. In general: write a stored procedure that will return the dataset with all tables you need. For printing, use MS reports or crystal reports, both are fairly easy to use.

Use random method to get list of random question.above link will give you help regarding to code random method .assume u have array or list of questions so by using random on list or array u get 10 ..10 ..30 question randomly
eg.

Random randomGenerator = new Random();
id = (Long) postIds.get(randomGenerator.nextInt(postIds.size()));


let me know if any prob.
 
Share this answer
 
v2
Comments
nida jabeen 17-Dec-14 4:57am    
ok sir its working my code is getting random questions according to quantity and level of question but i want that that randome question show on next for randomely with its options like a,b,c just like mcq's paper then i can take print ...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900