I m creating a windows form application in visual C#.Which ask questions to user ,if user fails to answer questions , application should notify the user that your socre is xxxxxx and application close. Now when user open this application again the question should be randomize. Please tell me how can i do this?
3 replies to this topic
#1
Posted 15 November 2011 - 09:10 PM
|
|
|
#2
Posted 18 November 2011 - 08:54 AM
Can you post the code that you have already written?
This seems fairly simple. If you want the questions randomized, you will need to store the questions in the program and select them randomly which you could use an array and a random number generator. As for the other part of the question... When the user submits the form you should run a validation function that checks their answer. I personally would not have the application close if the answer is blank or wrong unless that is a requirement. I would just re-ask the question or move on to the next question.
Let me know if you need any other help.
This seems fairly simple. If you want the questions randomized, you will need to store the questions in the program and select them randomly which you could use an array and a random number generator. As for the other part of the question... When the user submits the form you should run a validation function that checks their answer. I personally would not have the application close if the answer is blank or wrong unless that is a requirement. I would just re-ask the question or move on to the next question.
Let me know if you need any other help.
-CDG10620
Software Developer
Software Developer
#3
Posted 20 November 2011 - 07:48 PM
Thanks Sir, I liked your post
But As I m telling you sir , that i m newbie in programming .....how to save questions in program . They are about 300 question. Should i use database or any other.......
But As I m telling you sir , that i m newbie in programming .....how to save questions in program . They are about 300 question. Should i use database or any other.......
#4
Posted 30 November 2011 - 07:14 AM
You can save them in a database, a txt file, a XML file. It's really your choice. Are the questions going to change or stay static over time? If they are going to change then you may also want a form that allows someone to edit them without touching the back end file manually. Or you can simply have the file get updated/replaced. You have a lot of options here.
-CDG10620
Software Developer
Software Developer
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top









