r/visualbasic • u/Alyidiir • Jan 09 '19
need help on VB quiz game
For my computer science coursework I'm creating a movie quote quiz in VB. I'm trying to think what would be the best way of being able to generate questions and the answers option without having to enter each question and answer as a variable within an array. any help would be appreciated.
5
Upvotes
1
u/hakkmj Jan 10 '19
Check out this site if you want an api that does all the Q & A for you: Open Trivia Database
2
u/andrewsmd87 Web Specialist Jan 09 '19
So unfortunately, unless you have the data in an already existing database or even excel sheet, it will have to be manually entered somewhere.
But once you have that data, you can loop through it to spit out questions and answers. Since it's for homework I'm assuming you don't need a database?
If that's the case, I'd use a list of objects. You could have a parent "Question" object with a question text property and then a list<QuestionAnswer> property
The QuestionAnswer object would have two properties, a string answer text and a bool is correct property.
Then you can loop through them to display questions.