Simple Questionnaire Game Logic?

What I want to do, think of a simple multiple choice question with only one correct answer.

Questions: What is 2+2?

A: 2
B: 22
C: 44
D: 4

Obviously D is the correct answer in this case. But the point of this is that I have a text file with about 1000 or so questions and each question has 4 possible answers with only 1 being the CorrectAnswer. I want the game to display this with GUI and I already know how to do that. If the answer is correct, then move to the next question randomly, but… do not ask this question again. Kind of unmark it from the list of questions to show. But if its incorrect, put this this question back into the pile and randomly move to another question eventually asking this question again. I cannot figure out a few things on doing all of this.

What is the simplest way to produce this. Should I try accessing a text file with all the questions and answers, or should i create a script that contains them all in blocks. and the questionnaire script access that instead. And how should I do the randomizing? Random.Range? and of list? or array? How to unmark(Possibly could just Question[1].Remove or something) This is really important to me so any help would be greatly appreciated. I’m not trying to ask for a fully written script, I just need some help/advice Thanks.

A friend of mine is using XML parsing for that kind of stuff. Jason might be better do as well. I would stick to the text file since it’s easier to manage and external to your scripted logic. You should definitely check on parsing. Then, you could assign unique numbers to your questions and answers, read them all once into a list and move already answered ones from that list to a used list, or something like that. Or parse the numbers back into a used text file for later.
Parsing… :wink:

I’m not sure if this is the best solution or an optimal one but I would try to do this:

  1. Create a class that holds Question text, A, B, C, D choices, the true answer
  2. Create a list of that class and pull all questions to the list.
  3. Select random list item(Random.Range would work just fine)
  4. After the question is answered, tell the player if it’s being answered corretly and copy that list item to another list so you can store and reach already asked questions maybe with the answer given by player too, or just remove the list item.

That’s pretty much it for me I think.