Randomize Question

Hi Support Team,

We have 15 questions for segmentation.
Can we ask these question randomly, how?
Thank you.

@arif_1234, you could do it as outlined in the image shared below. But note that this is an approach where you are randomly selecting one group where you have shuffled the questions beforehand. Also please be informed that this approach will solve your issue but it will be a bit tedious to manage and analyze your data.

Note: Since the workaround has three groups I have used 3 within the calculation. If you have more or less group you could change the number accordingly. Say if you have 5 groups, you will have to change the number to 5 accordingly.

In the survey tab of your xlsform:

Image 1

Data entry screen as seen in Enketo:

Data entry screen as seen in Enketo:

Data entry screen as seen in Enketo:

Reference xlsform:

Random Question Order.xlsx (10.6 KB)

Or as an alternative, you could also have a look to one of our examples discussed previously:

1 Like

Hi @Kal_Lam ,

Thank you for your advice. So we can’t random only in one group?
We have a lot of questions to be random, it take time and need more group with that idea.
Thank you.

Yes, that is correct. You will need a lot more time to randomize (if you have a large set of questions).

i going to try this
thanks

1 Like

Hello @rimaoulleik,
Often the search function of this forum provides solutions, e.g. https://community.kobotoolbox.org/search?context=topic&context_id=20726&q=randomize%20questions&skip_context=true

Also be aware that a full randomised solution will need a combination of NumberOfQuestions! (factor!), e.g. for three questions you will already get 123 = 6 combinations. 1-2-3; 1-3-2; 2-1-3; 2-3-1; 3-1-2; 3-2-1;
For 15 questions you would have 15! (factor!) = 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x 10 x 11 x 12 x 13 x 14 x 15 = 1 307 674 368 000 possible combinations.

2 Likes

Dear @arif_1234 ,
this may come a bit late, but I had the same problem like you: Too many questions , so that the creation of a table with all the permutations (or a number which would be sufficient for a good randomization) would be too tedious. So I created a function in R which does the job for you. It takes an Exel sheet with one group of questions which are to be randomized (it may look like this)
and it returns a table with either all the permutations possible or a random sample of defined length. The R-Script can be found here.

I hope this may be of use to anyone :slight_smile:

1 Like

Thanks.
I have problems with the R link. Would you mind to check it, please?

The page isn’t redirecting properly

The browser has stopped trying to retrieve the requested item. The site is redirecting the request in a way that will never complete.

Maybe you could even share the 2 files here directly.

Does the script need a defined order and an own maximum for the columns in the Excel file? (Hopefully not.)

Hi Davidl,

Thank you, appreciate your idea, but I don’t know how to apply your idea, especially connecting R-Script to xls form.

Deat wroos,
unfortunately I am not able to add an attachment as a new user in this forum. I checked the link and it should actually work. After clicking on the link, you’ll have to click on download. If it still doesnt work for you, I may try to upload it somewhere else.

If the structure of the table is similar to that in my example, it will work. It has to be a table of only one group of questions, but there can be as many questions in that group as you like and as many columns as you like. You can adjust the number of rows in the table that are not supposed to be randomized (e.g. notes) but you will have to do adjustments in the settings of the function in R for that. This is not so difficult and there are instructions in the R-script.
Please also read the instructions in the script, if you have any questions on how to use it. There are also some hints on how to set the random-number calculation in the final XLS Form.

1 Like

Dear arif,
you may have a look at the R-Script. There are detailed instructions in there, which explain how to apply the script. If you use it with many questions (more than 5 or 6) I advise you to limit the number of permutations that are included in the output table, so that the table will not be endless (with 6! or more groups of questions).