[solved] Question Randomization on One Page Using Forms
I would like to present multiple questions in randomized order on one page using Forms. I was able to use the open sesame code to create a page with multiple question, but I have not been successful in getting it to randomize the order of question presentation. If I create multiple variables with a list of all the questions, then that creates the problem of having some questions asked more than once and others skipped. Is there a way to sample randomly from a variable with the specification that previously called up levels of that variable should not be sampled? Could you point me in the right direction for a solution to my problem.
Thanks and thank you for Open Sesame.
Jason
Comments
Hi Jason,
Generally speaking, yes. In Python you would use the
pop()function to take the last item out of list. If you shuffle the list first, this will give you random sampling without replacement:However, I suspect that this might not be what you have in mind. If not, could you perhaps describe in more detail what you are trying to do and how you have currently set up your experiment?
Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
I'm running an experiment with some self-report measures at the end. I would like to randomize the order of presentation of the self-report questions so that each participant will get the same questions presented in a randomized order, on the same page. For instance the order of question 1, 2, and 3 below would be determined randomly, but each participant would get every question on one screen.
Ah, I see. So you want to present the same three questions on a single form, but randomize the order of the questions. This is quite easy to accomplish, especially since you are using Python code already. First you create a list of row indices (
[1,2,3]). You shuffle this list, to get a random order of row indices (e.g.[3,1,2], and then use this list to specify the actual row indices of thequestionandratingScalewidgets (i.e.,rows[0], etc.).Hope this helps!
PS. I removed your last post, as it seemed to only contain the code that you already posted.
Check out SigmundAI.eu for our OpenSesame AI assistant!
Thank you! That does exactly what I need it to do! It randomizes the order of question presentation while also keeping the rating scales attached to their respective questions. I was somewhat concerned that the latter part wasn't going to happen, but it did.
This is a quite common task and should somehow be implemented within the gui items / questionnaire possibilites.
HI @refuzee,
if you believe this is something that should be built-in OpenSesame by default, you can request it in the wishlist. There, suggestions for future improvements of OpenSesame are very welcome and collected centralized.
Thanks,
Eduard