Impossible to Constrain loop
Hi all,
I am creating a “quiz” about fictional profiles in my experiment. I would like to constrain the number of questions displayed per profile, but I can’t manage to do so. I would really appreciate if some could help me.
In my experiment, I have 6 fictional male profiles (man A; man B, man C, man D, man D, man F) and 6 fictional female profiles (woman A, …, woman F).
At one point, I want to display, one at a time, each profile picture with either a true or a false statement (placed underneath the picture). Then the participant has to respond by either true or false to the statement (by pressing p for a true statement or by pressing e for a wrong statement).
However, I would like to display only one of the two statements per profile not the two (for example, if the first statement to be displayed for man A is the true one, I don’t want the false statement of man A to be displayed in a following later. The same is applicable if the first statement is the false one, I don’t want the true one to be displayed later).
So, I have created such a “quiz” (using loop, sequence, sketchpad, keyboard response, logger) that seem to work. In my loop, I have created 4 variables: gender (man, woman); id (a, b, c, d, e, f); statement (true, false); correct response (p, e). Please see the attached picture for a screenshot of the loop.
The problem is that I always end up with 24 trials, with the two statements being displayed per profile (once at a time, and in a random order) but I only want one of the two statements (so 12 trials in total).
In the script, I tried to use the following command: constrain id maxrep=1, but the command seems to be ignored.
I tried different other things but nothing works, I always have 24 trials in my loop.
It would be really much appreciated if someone could help me with it.
Comments
Hi @bbTokyobb,
To achieve what you would like, I'd say you have two options:
Option 1
Instead of having all profiles and statements in one loop, you could use nested loops, whereby when a row from the upper loop (profile) is running, you define the statement from a lower-level loop that contains only two statements and set the repeat property of that loop to 0.5 and its order to random. That way, for each profile, only one statement would be picked at random. Depending on how your trials are organized (I don't know whether you're using the same two statements for all profiles, if you have different pairs of statements for each profile, if these are fixed or randomly allocated to profiles), you might have to introduce a little programming or use the "run if" property to select the appropriate lower-level loop for each profile.
Option 2
You could use the loop as you have it now and use some programming to keep track of how many statements have been shown for each profile. You could then use that variable to program the "run if" property of the loop to determine what objects have to be executed when the trial runs. This methods will execute 24 trials but if you program it all correctly, 12 of these will be dummy trials (you can make it so that nothing is presented and subjects will not notice anything before the next actual trial is presented). So, with this method, your data log will contain trials in which many variables will be empty.
The
maxrep
constrain does not achieve what you want because this variable only allows you to prevent the repetition of a same variable value in two successive trials.Hope this helps!
Fabrice.
Hello Fabrice,
Thank you so much for your reply.
I followed your Option 1 and I used a nested loop in which I put the statementz and the correct response inside a bigger loop in which I put the profiles only. Then I set the repeat property of the nested loop to 0.5 and it works perfectly. I have my desired 12 trials.
Thanks a lot for your help!
(To clarify, I have different pairs of fixed statements allocated per profiles)