|
Post by matia on Aug 7, 2021 9:28:20 GMT
Hello,
I have a long survey code which can be shortened fairly easily if only there is a way to use some clever array-ing, or table or something similar. My problem is the following:
l: random1 t: set - random 1 2
l: jump1 t: jump - if random1 == 1 goto Q1 - if random1 == 2 goto Q2
l: Q1 t: radio i: image1M q: What is in the picture? - a bird - a plane - superman
l: jump2 t: jump - goto end
l: Q2 t: radio i: image1F q: What is in the picture? - a bird - a plane - superman
So, I have 2 conditions (M and F). And, as you see, each question consists of 7 lines of code. If I could do something similar to:
l: random1 t: set - random 1 2
l: Q t: radio i: $random1 #so the image being shown is the one decided by the random1 variable #similar to the experiment scripting q: What is in the picture? - a bird - a plane - superman
This would effectively shorten my code by double. Now, image I have 16 such conditions... Instead of having 160 lines of code, I could have 10... I can manage to do it by having 160 lines, but it is so messy that I cannot look at it Thanks for any suggestion, I am tagging PsyToolkit because I am not sure whether this is even possible. Sorry to bother. Best, Matia
|
|