I need to create a exam system. i have to give 20 question in a list. it should display 10 question randomly in a form. how can i do this in c#.dotnet?
please anyone help me

Recommended Answers

All 7 Replies

What have you already tried for yourself?
Glad to comment on that!

Follows these steps:
1. Add 10 question into an instance of ArrayList.
2. Generate random number between 0-9 and store it in 'index'
int variable. (Use Random class).
3. Display arraylist item at 'index'.
4. Remove arraylist item at 'index'.
5. Generate random number between 0 to 8 and store it in 'index'
int variable.
6. ... repeat these steps...

>>1. Add 10 question into an instance of ArrayList.
Correct, only it has to be a list of 20 questions out of which 10 have to be selected.

I would just like to ask if there is an existing system that randomize test questions for teachers?.

could you poaaibly add all questions to an array and then randomly choosing them by setting the scope of random.Next(); and use the random number generated to access a question using its index within the array ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.