What I would try to do is I would have 1 file with all the questions included and a file for each question containing the respective answers.
Maybe I can’t explain it in an easy to understand way, but here we go:
Each question would be stored in separated groups inside the same file, and each group’s name would be a number, such as 1,2,3,4,5,6,7,8…etc.
For example:
group 0 “Question 1”
group 1 “Question 2”
group 3 “Question 3”
To load a random question, first, create a variable with a random number between 0 and the number of questions you have. If you have 10 question, create a variable with the value Random(9) (9 because 0 also included ).
So it would be let say rndQuestion = Random(9)
The variable going to be used to load a question from random group and also as reference for what question is loaded. So to load a random question using the variable as group name you can enter the following expression:
Group:
“”+ToString(Variable(rndQuestion))
Since the name of the groups are numbers and the value of rndQuestion is a random number, it going to load a question of a random group, technically a random question.
Now, each question would have it own file containing the answers. The group 1 question would have it answers in a file called “1”, group 2 question would have it answers in the file called “2” and so on. So once you have loaded the question, the only thing you need to do is to load the answers from the file with the same name as the group name of the question, so as a file name to load answers you can use the rndQuestion variable again like so:
File name:
“”+ToString(Variable(rndQuestion)).
In case you want to decide which answer is the correct answer, you can start with the group names. Each question would have let say 3 wrong and 1 correct answer. The only thing you need to do, is to use groups like so:
group wrong1 “Wrong answer1”
group wrong2 “Wrong answer2”
group wrong3 “Wrong answer3”
group correct “Correct answer”
And just simply read all the answers from the groups and display them in separated text objects, and since all the answers are displayed in separated text objects, you can simply check if wrong or correct text object have been selected, obviously you would have 3 text object to display 3 wrong answer and 1 correct text object to display the only correct answer the question has and check if the wrong or correct text object is selected/clicked.
I know, maybe it difficult to understand especially if you are new to GDevelop, I’m not very good in explaining things, but I hope it helps somewhat. 