Modifying number & type of trials in Approach/Avoidance (AAT) script


Modifying number & type of trials in Approach/Avoidance (AAT) script

Author
Message
inquisituser22
inquisituser22
Respected Member
Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)

Group: Forum Members
Posts: 20, Visits: 99
Hello,
I have two questions about adapting the joystick AAT script.

  1. I need to change the number of trials, and configurations of the trials. I have not been able to figure out how to do this – I am guessing it should be in the SequenceGenerator script, but not sure if anything should also be changed in the main AAT script. The way it is in the script from Milisecond, there are 80 trials (4 categories of images x 2 formats (landscape/portrait) x 10 repetitions). I need to adapt it to be 480 trials (broken into two parts, where the first part is: 2 categories of images x 12 images x 2 formats (landscape/portrait) x 20 repetitions, second part: 2 categories of images x 8 images x 2 formats (landscape/portrait) x 20 repetitions). Of note is that I will also have breaks for participants every 96 trials.
  2. I need to change the percentage of time that the images are in landscape/portrait (one experimental group will be instructed to pull images towards themselves 90% of the time, and pushing 10%, the other experimental group will be instructed 50/50 pull and push). However, I do not see where I can alter the proportions for “targetformat” which is how landscape/portrait is coded in the script. Perhaps this is because it is “Format A” and “Format B” in the SequenceGenerator script?

Thank you very much as always for any help!
Dave
Dave
Supreme Being
Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)

Group: Administrators
Posts: 9.6K, Visits: 44K
inquisituser22 - 6/25/2019
Hello,
I have two questions about adapting the joystick AAT script.

  1. I need to change the number of trials, and configurations of the trials. I have not been able to figure out how to do this – I am guessing it should be in the SequenceGenerator script, but not sure if anything should also be changed in the main AAT script. The way it is in the script from Milisecond, there are 80 trials (4 categories of images x 2 formats (landscape/portrait) x 10 repetitions). I need to adapt it to be 480 trials (broken into two parts, where the first part is: 2 categories of images x 12 images x 2 formats (landscape/portrait) x 20 repetitions, second part: 2 categories of images x 8 images x 2 formats (landscape/portrait) x 20 repetitions). Of note is that I will also have breaks for participants every 96 trials.
  2. I need to change the percentage of time that the images are in landscape/portrait (one experimental group will be instructed to pull images towards themselves 90% of the time, and pushing 10%, the other experimental group will be instructed 50/50 pull and push). However, I do not see where I can alter the proportions for “targetformat” which is how landscape/portrait is coded in the script. Perhaps this is because it is “Format A” and “Format B” in the SequenceGenerator script?

Thank you very much as always for any help!

You need to adjust the amount of trials in the <block> elements as well.

<block AAT>
/ preinstructions = (taskinstructions)
/ onblockbegin = [values.index = 0]
/ trials = [1-80 = AAT_start]
</block>

Instead of trying to adapt the random sequence generator, I would recommend constructing suitable sequences by hand and having the script use those (see e.g. https://www.millisecond.com/forums/Topic11145.aspx ).

As noted elsewhere in the script, format A is landscape orientation, format B is portrait orientation. For the numerical codes pertaining to category and format, see the comments at the top of the sequence generation script:

This script is a helper script to the AAT scripts. The trial sequence generation code generates a sequence of trials that fulfills the following
constraints:
1) 10 stimuli of category 1 in Format A (=1), 10 stimuli of category 1 in Format B (=2),
10 stimuli of category 2 in Format A (=3), 10 stimuli of category 1 in Format B (=4),
10 stimuli of category 3 in Format A (=5), 10 stimuli of category 1 in Format B (=6),
10 stimuli of category 4 in Format A (=7), 10 stimuli of category 1 in Format B (=8),
2) no more than three consecutive stimuli of the same category
3) no more than three consecutive stimuli of the same format

inquisituser22
inquisituser22
Respected Member
Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)

Group: Forum Members
Posts: 20, Visits: 99
Dave - 6/25/2019
inquisituser22 - 6/25/2019
Hello,
I have two questions about adapting the joystick AAT script.

  1. I need to change the number of trials, and configurations of the trials. I have not been able to figure out how to do this – I am guessing it should be in the SequenceGenerator script, but not sure if anything should also be changed in the main AAT script. The way it is in the script from Milisecond, there are 80 trials (4 categories of images x 2 formats (landscape/portrait) x 10 repetitions). I need to adapt it to be 480 trials (broken into two parts, where the first part is: 2 categories of images x 12 images x 2 formats (landscape/portrait) x 20 repetitions, second part: 2 categories of images x 8 images x 2 formats (landscape/portrait) x 20 repetitions). Of note is that I will also have breaks for participants every 96 trials.
  2. I need to change the percentage of time that the images are in landscape/portrait (one experimental group will be instructed to pull images towards themselves 90% of the time, and pushing 10%, the other experimental group will be instructed 50/50 pull and push). However, I do not see where I can alter the proportions for “targetformat” which is how landscape/portrait is coded in the script. Perhaps this is because it is “Format A” and “Format B” in the SequenceGenerator script?

Thank you very much as always for any help!

You need to adjust the amount of trials in the <block> elements as well.

<block AAT>
/ preinstructions = (taskinstructions)
/ onblockbegin = [values.index = 0]
/ trials = [1-80 = AAT_start]
</block>

Instead of trying to adapt the random sequence generator, I would recommend constructing suitable sequences by hand and having the script use those (see e.g. https://www.millisecond.com/forums/Topic11145.aspx ).

As noted elsewhere in the script, format A is landscape orientation, format B is portrait orientation. For the numerical codes pertaining to category and format, see the comments at the top of the sequence generation script:

This script is a helper script to the AAT scripts. The trial sequence generation code generates a sequence of trials that fulfills the following
constraints:
1) 10 stimuli of category 1 in Format A (=1), 10 stimuli of category 1 in Format B (=2),
10 stimuli of category 2 in Format A (=3), 10 stimuli of category 1 in Format B (=4),
10 stimuli of category 3 in Format A (=5), 10 stimuli of category 1 in Format B (=6),
10 stimuli of category 4 in Format A (=7), 10 stimuli of category 1 in Format B (=8),
2) no more than three consecutive stimuli of the same category
3) no more than three consecutive stimuli of the same format
 Hi Dave,
Thank you for your help with this. I have been attempting to address this from your comments as well as prior threads' comments, but my script doesn't seem to be loading properly as I have to do control B to get past the first (blank) page. If you are able to provide me with any feedback as to where I went wrong, that would be greatly appreciated. I've reduced the number of trials in my experiment's methods since previously posting and here is what I am trying to achieve now. I have a feeling it relates to "values.index" but I have had trouble following how to modify it correctly.

Thank you so very much in advance.

2 Parts of my experiment to be run sequentially:
Part 1: 2 categories of ("untrained") images x 8 images x 2 formats (landscape/portrait - same for all participants, not randomizing who sees which format) x 6 repetitions = 192 trials
Part 2: 2 categories of ("trained") images x 12 images x 2 formats x 6 repetitions = 288 trials
There will be instructions telling participants to take a break every 96 trials.

Here's what I have modified in the AAT script template:

<trial AAT_1untrained>
/ ontrialbegin = [
values.selectstimulus = list.category1.nextvalue;
values.targetcategory = 1;
values.targetformat = "l";
picture.targetstimulus.height = values.startheight_A;
values.starttime = script.elapsedtime;
values.endtime = 0;
values.completeRT = 0;
values.changedirection = 0;
values.finalresponse="";
]
/ stimulusframes = [1 = targetstimulus]
/ validresponse = (back, forward)
/ iscorrectresponse = [(values.expcondition == 1 && trial.AAT_1untrained.response == "forward") || (values.expcondition == 2 && trial.AAT_1untrained.response == "back")]
/ ontrialend = [
values.joystick_y = joystick.y;
values.joystick_change = abs(values.joystick_y);
values.trialcode = "AAT_1untrained";
values.RT = trial.AAT_1untrained.latency;
values.correct = trial.AAT_1untrained.correct;
values.stimulus = picture.targetstimulus.currentitem;
if (trial.AAT_1untrained.response == "forward")
values.initialresponse = "PUSH"
else
values.initialresponse = "PULL";
list.accuracy_overall.insertitem(trial.AAT_1untrained.correct,1);
if (trial.AAT_1untrained.correct) {
list.AAT_1untrainedcorrectlatencies.insertitem(trial.AAT_1untrained.latency, 1);
list.latencies_overall.insertitem(trial.AAT_1untrained.latency, 1);
}
]
/ branch = [
if (trial.AAT_1untrained.response == "forward")
trial.decrease
else
trial.increase;
]
/ recorddata = false
</trial>

<trial AAT_2untrained>
/ ontrialbegin = [
values.selectstimulus = list.category2.nextvalue;
values.targetcategory = 1;
values.targetformat = "p";
picture.targetstimulus.height = values.startheight_B;
values.starttime = script.elapsedtime;
values.endtime = 0;
values.completeRT = 0;
values.changedirection = 0;
values.finalresponse="";
]
/ stimulusframes = [1 = targetstimulus]
/ validresponse = (back, forward)
/ iscorrectresponse = [(values.expcondition == 1 && trial.AAT_2untrained.response == "back") || (values.expcondition == 2 && trial.AAT_2untrained.response == "forward")]
/ ontrialend = [
values.joystick_y = joystick.y;
values.joystick_change = abs(values.joystick_y);
values.trialcode = "AAT_2untrained";
values.RT = trial.AAT_2untrained.latency;
values.correct = trial.AAT_2untrained.correct;
values.stimulus = picture.targetstimulus.currentitem;
if (trial.AAT_2untrained.response == "forward")
values.initialresponse = "PUSH"
else
values.initialresponse = "PULL";
list.accuracy_overall.insertitem(trial.AAT_2untrained.correct,1);
if (trial.AAT_2untrained.correct) {
list.AAT_2untrainedcorrectlatencies.insertitem(trial.AAT_2untrained.latency, 1);
list.latencies_overall.insertitem(trial.AAT_2untrained.latency, 1);
}
]
/ branch = [
if (trial.AAT_2untrained.response == "forward")
trial.decrease
else
trial.increase
]
/ recorddata = false
</trial>

<trial AAT_1trained>
/ ontrialbegin = [
values.selectstimulus = list.category2.nextvalue;
values.targetcategory = 1;
values.targetformat = "p";
picture.targetstimulus.height = values.startheight_B;
values.starttime = script.elapsedtime;
values.endtime = 0;
values.completeRT = 0;
values.changedirection = 0;
values.finalresponse="";
]
/ stimulusframes = [1 = targetstimulus]
/ validresponse = (back, forward)
/ iscorrectresponse = [(values.expcondition == 1 && trial.AAT_1trained.response == "back") || (values.expcondition == 2 && trial.AAT_1trained.response == "forward")]
/ ontrialend = [
values.joystick_y = joystick.y;
values.joystick_change = abs(values.joystick_y);
values.trialcode = "AAT_1trained";
values.RT = trial.AAT_1trained.latency;
values.correct = trial.AAT_1trained.correct;
values.stimulus = picture.targetstimulus.currentitem;
if (trial.AAT_1trained.response == "forward")
values.initialresponse = "PUSH"
else
values.initialresponse = "PULL";
list.accuracy_overall.insertitem(trial.AAT_1trained.correct,1);
if (trial.AAT_1trained.correct) {
list.AAT_1trainedcorrectlatencies.insertitem(trial.AAT_1trained.latency, 1);
list.latencies_overall.insertitem(trial.AAT_1trained.latency, 1);
}
]
/ branch = [
if (trial.AAT_1trained.response == "forward")
trial.decrease
else
trial.increase
]
/ recorddata = false
</trial>

<trial AAT_2trained>
/ ontrialbegin = [
values.selectstimulus = list.category2.nextvalue;
values.targetcategory = 1;
values.targetformat = "p";
picture.targetstimulus.height = values.startheight_B;
values.starttime = script.elapsedtime;
values.endtime = 0;
values.completeRT = 0;
values.changedirection = 0;
values.finalresponse="";
]
/ stimulusframes = [1 = targetstimulus]
/ validresponse = (back, forward)
/ iscorrectresponse = [(values.expcondition == 1 && trial.AAT_2trained.response == "back") || (values.expcondition == 2 && trial.AAT_2trained.response == "forward")]
/ ontrialend = [
values.joystick_y = joystick.y;
values.joystick_change = abs(values.joystick_y);
values.trialcode = "AAT_2trained";
values.RT = trial.AAT_2trained.latency;
values.correct = trial.AAT_2trained.correct;
values.stimulus = picture.targetstimulus.currentitem;
if (trial.AAT_2trained.response == "forward")
values.initialresponse = "PUSH"
else
values.initialresponse = "PULL";
list.accuracy_overall.insertitem(trial.AAT_2trained.correct,1);
if (trial.AAT_2trained.correct) {
list.AAT_2trainedcorrectlatencies.insertitem(trial.AAT_2trained.latency, 1);
list.latencies_overall.insertitem(trial.AAT_2trained.latency, 1);
}
]
/ branch = [
if (trial.AAT_2trained.response == "forward")
trial.decrease
else
trial.increase
]
/ recorddata = false
</trial>

<trial AAT_3trained>
/ ontrialbegin = [
values.selectstimulus = list.category2.nextvalue;
values.targetcategory = 1;
values.targetformat = "p";
picture.targetstimulus.height = values.startheight_B;
values.starttime = script.elapsedtime;
values.endtime = 0;
values.completeRT = 0;
values.changedirection = 0;
values.finalresponse="";
]
/ stimulusframes = [1 = targetstimulus]
/ validresponse = (back, forward)
/ iscorrectresponse = [(values.expcondition == 1 && trial.AAT_3trained.response == "back") || (values.expcondition == 2 && trial.AAT_3trained.response == "forward")]
/ ontrialend = [
values.joystick_y = joystick.y;
values.joystick_change = abs(values.joystick_y);
values.trialcode = "AAT_3trained";
values.RT = trial.AAT_3trained.latency;
values.correct = trial.AAT_3trained.correct;
values.stimulus = picture.targetstimulus.currentitem;
if (trial.AAT_3trained.response == "forward")
values.initialresponse = "PUSH"
else
values.initialresponse = "PULL";
list.accuracy_overall.insertitem(trial.AAT_3trained.correct,1);
if (trial.AAT_3trained.correct) {
list.AAT_3trainedcorrectlatencies.insertitem(trial.AAT_3trained.latency, 1);
list.latencies_overall.insertitem(trial.AAT_3trained.latency, 1);
}
]
/ branch = [
if (trial.AAT_3trained.response == "forward")
trial.decrease
else
trial.increase
]
/ recorddata = false
</trial>

**************************************************************************************************************
**************************************************************************************************************
BLOCKS
**************************************************************************************************************
**************************************************************************************************************

NOTE:
block.practice_AAT presents 10 practice trials randomly (without replacement) selecting
from format A (landscape) (N=5) and format B (portrait) stimuli (N=5)
<block practice_AAT>
/ trials = [1-2 = instructions; 3-12 = noreplace(practicetrial_A, practicetrial_B)]
</block>

Note:
The trial sequence is generated by helper script 'AAT_SequenceGenerator.iqx'
!!!! The time to generate the appropriate sequence will differ between participants.
Two alternatives are:
1) use pregenerated sequences.
2) run the experiment with simple random sampling (easiest solution)
-> / trials = [1 = instructions; 2-81 = noreplace(AAT_1, AAT_2)]

<block assessment1_AAT>
/ onblockbegin = [values.index = 0]
/ trials = [1 = instructions; 2-97 = AAT_1untrained; 98 = instructions2; 99-194 = AAT_2untrained]
</block>

<block assessment2_AAT>
/ onblockbegin = [values.index = 0]
/ trials = [1 = instructions; 2-97 = AAT_1trained; 98 = instructions2; 99-194 = AAT_2trained; 195 = instructions2; 196-292 = AAT_3trained]
</block>


**************************************************************************************************************
**************************************************************************************************************
BREAKS
**************************************************************************************************************
**************************************************************************************************************

<text instructions2>
/ items = instructions2
/ select = sequence
/ position = (50%, 50%)
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 0)
/ txcolor = black
/ resetinterval = 3
/ size = (80%, 80%)
</text>

<item instructions2>
/ 1 = "PLEASE TAKE A FEW MOMENTS TO TAKE A BREAK DURING THE SESSION.
^^
Press press any key on the keyboard when you are ready to continue."
</item>

<trial instructions2>
/ stimulusframes = [1 = instructions2]
/ validresponse = ("anyresponse")
</trial>


**************************************************************************************************************
**************************************************************************************************************
EXPERIMENT
**************************************************************************************************************
**************************************************************************************************************

NOTE:

<expt>
/ subjects = (1 of 1)
/ groupassignment = groupnumber
/ onexptbegin = [
values.expcondition = 1;
values.format1 = "PORTRAIT";
values.format2 = "LANDSCAPE";
values.startheight_A = parameters.Startheight_ratioA*values.Maxheight_px;
values.startheight_B = parameters.Startheight_ratioB* values.Maxheight_px;
]
/ blocks = [
1 = SequenceGenerator;
2 = practice_AAT;
3 = assessment1_AAT;
4 = assessment2_AAT
]
/ postinstructions = (End)
/ onexptend = [values.completed = 1]
</expt>

**********************************************************************************
Relevant parts I have changed in sequence generator:
<list stimcats>

/ items = (
1,1,1,1,1,1,
1,1,1,1,1,1,
2,2,2,2,2,2,
2,2,2,2,2,2,
3,3,3,3,3,3,3,
3,3,3,3,3,
4,4,4,4,4,4,4,4,
4,4,4,4,
5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,
7,7,7,7,7,7,7,7,
8,8,8,8,8,8,8,8)
/ replace = false
</list>

I have left all "values" at 0 even though I am wondering if they need to be increased from 80 to be right for 480 trials. Also wondering if the following is mandatory as I don't have a reason to have participants see this screen: 

<text wait>
/items = ("Please wait; we'll be ready shortly")
/ fontstyle = ("Arial", 3.00%, false, false, false, false, 5, 0)
</text>

Dave
Dave
Supreme Being
Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)

Group: Administrators
Posts: 9.6K, Visits: 44K


Please provide the actual script and please include all external files the script requires to run (i.e. images etc.). Put all of this in a ZIP archive and then you can attach it to a post by clicking +Insert -> Add File.

Note that a "blank screen" here would usually indicate that the sequence generator is unable to create a sequence that satisfies your various constraints and thus has to start over and over again, never converging on a valid solution. That's where you should start looking.
Edited
Last Week by Dave
Dave
Dave
Supreme Being
Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)

Group: Administrators
Posts: 9.6K, Visits: 44K
Dave - 7/8/2019


Please provide the actual script and please include all external files the script requires to run (i.e. images etc.). Put all of this in a ZIP archive and then you can attach it to a post by clicking +Insert -> Add File.

Note that a "blank screen" here would usually indicate that the sequence generator is unable to create a sequence that satisfies your various constraints and thus has to start over and over again, never converging on a valid solution. That's where you should start looking.

One more thing: From the main script's code you posted, it's unclear to me whether you are using the sequence the generator attempts to create at all. It looks as if you actually don't, but I can't be sure just based on the snippets. If you do not want / need the sequence generator, then you should simply not run it. That is, remove the SequenceGenerator block from your <expt> element's /blocks:

<expt>
/ subjects = (1 of 1)
/ groupassignment = groupnumber
/ onexptbegin = [
values.expcondition = 1;
values.format1 = "PORTRAIT";
values.format2 = "LANDSCAPE";
values.startheight_A = parameters.Startheight_ratioA*values.Maxheight_px;
values.startheight_B = parameters.Startheight_ratioB* values.Maxheight_px;
]
/ blocks = [
1 = practice_AAT;
2 = assessment1_AAT;
3 = assessment2_AAT;
]

/ postinstructions = (End)
/ onexptend = [values.completed = 1]
</expt>

inquisituser22
inquisituser22
Respected Member
Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)

Group: Forum Members
Posts: 20, Visits: 99
Dave - 7/8/2019
inquisituser22 - 7/8/2019
 Hi Dave,
Thank you for your help with this. I have been attempting to address this from your comments as well as prior threads' comments, but my script doesn't seem to be loading properly as I have to do control B to get past the first (blank) page. If you are able to provide me with any feedback as to where I went wrong, that would be greatly appreciated. I've reduced the number of trials in my experiment's methods since previously posting and here is what I am trying to achieve now. I have a feeling it relates to "values.index" but I have had trouble following how to modify it correctly.

Thank you so very much in advance.

2 Parts of my experiment to be run sequentially:
Part 1: 2 categories of ("untrained") images x 8 images x 2 formats (landscape/portrait - same for all participants, not randomizing who sees which format) x 6 repetitions = 192 trials
Part 2: 2 categories of ("trained") images x 12 images x 2 formats x 6 repetitions = 288 trials
There will be instructions telling participants to take a break every 96 trials.

Here's what I have modified in the AAT script template:

<trial AAT_1untrained>
/ ontrialbegin = [
values.selectstimulus = list.category1.nextvalue;
values.targetcategory = 1;
values.targetformat = "l";
picture.targetstimulus.height = values.startheight_A;
values.starttime = script.elapsedtime;
values.endtime = 0;
values.completeRT = 0;
values.changedirection = 0;
values.finalresponse="";
]
/ stimulusframes = [1 = targetstimulus]
/ validresponse = (back, forward)
/ iscorrectresponse = [(values.expcondition == 1 && trial.AAT_1untrained.response == "forward") || (values.expcondition == 2 && trial.AAT_1untrained.response == "back")]
/ ontrialend = [
values.joystick_y = joystick.y;
values.joystick_change = abs(values.joystick_y);
values.trialcode = "AAT_1untrained";
values.RT = trial.AAT_1untrained.latency;
values.correct = trial.AAT_1untrained.correct;
values.stimulus = picture.targetstimulus.currentitem;
if (trial.AAT_1untrained.response == "forward")
values.initialresponse = "PUSH"
else
values.initialresponse = "PULL";
list.accuracy_overall.insertitem(trial.AAT_1untrained.correct,1);
if (trial.AAT_1untrained.correct) {
list.AAT_1untrainedcorrectlatencies.insertitem(trial.AAT_1untrained.latency, 1);
list.latencies_overall.insertitem(trial.AAT_1untrained.latency, 1);
}
]
/ branch = [
if (trial.AAT_1untrained.response == "forward")
trial.decrease
else
trial.increase;
]
/ recorddata = false
</trial>

<trial AAT_2untrained>
/ ontrialbegin = [
values.selectstimulus = list.category2.nextvalue;
values.targetcategory = 1;
values.targetformat = "p";
picture.targetstimulus.height = values.startheight_B;
values.starttime = script.elapsedtime;
values.endtime = 0;
values.completeRT = 0;
values.changedirection = 0;
values.finalresponse="";
]
/ stimulusframes = [1 = targetstimulus]
/ validresponse = (back, forward)
/ iscorrectresponse = [(values.expcondition == 1 && trial.AAT_2untrained.response == "back") || (values.expcondition == 2 && trial.AAT_2untrained.response == "forward")]
/ ontrialend = [
values.joystick_y = joystick.y;
values.joystick_change = abs(values.joystick_y);
values.trialcode = "AAT_2untrained";
values.RT = trial.AAT_2untrained.latency;
values.correct = trial.AAT_2untrained.correct;
values.stimulus = picture.targetstimulus.currentitem;
if (trial.AAT_2untrained.response == "forward")
values.initialresponse = "PUSH"
else
values.initialresponse = "PULL";
list.accuracy_overall.insertitem(trial.AAT_2untrained.correct,1);
if (trial.AAT_2untrained.correct) {
list.AAT_2untrainedcorrectlatencies.insertitem(trial.AAT_2untrained.latency, 1);
list.latencies_overall.insertitem(trial.AAT_2untrained.latency, 1);
}
]
/ branch = [
if (trial.AAT_2untrained.response == "forward")
trial.decrease
else
trial.increase
]
/ recorddata = false
</trial>

<trial AAT_1trained>
/ ontrialbegin = [
values.selectstimulus = list.category2.nextvalue;
values.targetcategory = 1;
values.targetformat = "p";
picture.targetstimulus.height = values.startheight_B;
values.starttime = script.elapsedtime;
values.endtime = 0;
values.completeRT = 0;
values.changedirection = 0;
values.finalresponse="";
]
/ stimulusframes = [1 = targetstimulus]
/ validresponse = (back, forward)
/ iscorrectresponse = [(values.expcondition == 1 && trial.AAT_1trained.response == "back") || (values.expcondition == 2 && trial.AAT_1trained.response == "forward")]
/ ontrialend = [
values.joystick_y = joystick.y;
values.joystick_change = abs(values.joystick_y);
values.trialcode = "AAT_1trained";
values.RT = trial.AAT_1trained.latency;
values.correct = trial.AAT_1trained.correct;
values.stimulus = picture.targetstimulus.currentitem;
if (trial.AAT_1trained.response == "forward")
values.initialresponse = "PUSH"
else
values.initialresponse = "PULL";
list.accuracy_overall.insertitem(trial.AAT_1trained.correct,1);
if (trial.AAT_1trained.correct) {
list.AAT_1trainedcorrectlatencies.insertitem(trial.AAT_1trained.latency, 1);
list.latencies_overall.insertitem(trial.AAT_1trained.latency, 1);
}
]
/ branch = [
if (trial.AAT_1trained.response == "forward")
trial.decrease
else
trial.increase
]
/ recorddata = false
</trial>

<trial AAT_2trained>
/ ontrialbegin = [
values.selectstimulus = list.category2.nextvalue;
values.targetcategory = 1;
values.targetformat = "p";
picture.targetstimulus.height = values.startheight_B;
values.starttime = script.elapsedtime;
values.endtime = 0;
values.completeRT = 0;
values.changedirection = 0;
values.finalresponse="";
]
/ stimulusframes = [1 = targetstimulus]
/ validresponse = (back, forward)
/ iscorrectresponse = [(values.expcondition == 1 && trial.AAT_2trained.response == "back") || (values.expcondition == 2 && trial.AAT_2trained.response == "forward")]
/ ontrialend = [
values.joystick_y = joystick.y;
values.joystick_change = abs(values.joystick_y);
values.trialcode = "AAT_2trained";
values.RT = trial.AAT_2trained.latency;
values.correct = trial.AAT_2trained.correct;
values.stimulus = picture.targetstimulus.currentitem;
if (trial.AAT_2trained.response == "forward")
values.initialresponse = "PUSH"
else
values.initialresponse = "PULL";
list.accuracy_overall.insertitem(trial.AAT_2trained.correct,1);
if (trial.AAT_2trained.correct) {
list.AAT_2trainedcorrectlatencies.insertitem(trial.AAT_2trained.latency, 1);
list.latencies_overall.insertitem(trial.AAT_2trained.latency, 1);
}
]
/ branch = [
if (trial.AAT_2trained.response == "forward")
trial.decrease
else
trial.increase
]
/ recorddata = false
</trial>

<trial AAT_3trained>
/ ontrialbegin = [
values.selectstimulus = list.category2.nextvalue;
values.targetcategory = 1;
values.targetformat = "p";
picture.targetstimulus.height = values.startheight_B;
values.starttime = script.elapsedtime;
values.endtime = 0;
values.completeRT = 0;
values.changedirection = 0;
values.finalresponse="";
]
/ stimulusframes = [1 = targetstimulus]
/ validresponse = (back, forward)
/ iscorrectresponse = [(values.expcondition == 1 && trial.AAT_3trained.response == "back") || (values.expcondition == 2 && trial.AAT_3trained.response == "forward")]
/ ontrialend = [
values.joystick_y = joystick.y;
values.joystick_change = abs(values.joystick_y);
values.trialcode = "AAT_3trained";
values.RT = trial.AAT_3trained.latency;
values.correct = trial.AAT_3trained.correct;
values.stimulus = picture.targetstimulus.currentitem;
if (trial.AAT_3trained.response == "forward")
values.initialresponse = "PUSH"
else
values.initialresponse = "PULL";
list.accuracy_overall.insertitem(trial.AAT_3trained.correct,1);
if (trial.AAT_3trained.correct) {
list.AAT_3trainedcorrectlatencies.insertitem(trial.AAT_3trained.latency, 1);
list.latencies_overall.insertitem(trial.AAT_3trained.latency, 1);
}
]
/ branch = [
if (trial.AAT_3trained.response == "forward")
trial.decrease
else
trial.increase
]
/ recorddata = false
</trial>

**************************************************************************************************************
**************************************************************************************************************
BLOCKS
**************************************************************************************************************
**************************************************************************************************************

NOTE:
block.practice_AAT presents 10 practice trials randomly (without replacement) selecting
from format A (landscape) (N=5) and format B (portrait) stimuli (N=5)
<block practice_AAT>
/ trials = [1-2 = instructions; 3-12 = noreplace(practicetrial_A, practicetrial_B)]
</block>

Note:
The trial sequence is generated by helper script 'AAT_SequenceGenerator.iqx'
!!!! The time to generate the appropriate sequence will differ between participants.
Two alternatives are:
1) use pregenerated sequences.
2) run the experiment with simple random sampling (easiest solution)
-> / trials = [1 = instructions; 2-81 = noreplace(AAT_1, AAT_2)]

<block assessment1_AAT>
/ onblockbegin = [values.index = 0]
/ trials = [1 = instructions; 2-97 = AAT_1untrained; 98 = instructions2; 99-194 = AAT_2untrained]
</block>

<block assessment2_AAT>
/ onblockbegin = [values.index = 0]
/ trials = [1 = instructions; 2-97 = AAT_1trained; 98 = instructions2; 99-194 = AAT_2trained; 195 = instructions2; 196-292 = AAT_3trained]
</block>


**************************************************************************************************************
**************************************************************************************************************
BREAKS
**************************************************************************************************************
**************************************************************************************************************

<text instructions2>
/ items = instructions2
/ select = sequence
/ position = (50%, 50%)
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 0)
/ txcolor = black
/ resetinterval = 3
/ size = (80%, 80%)
</text>

<item instructions2>
/ 1 = "PLEASE TAKE A FEW MOMENTS TO TAKE A BREAK DURING THE SESSION.
^^
Press press any key on the keyboard when you are ready to continue."
</item>

<trial instructions2>
/ stimulusframes = [1 = instructions2]
/ validresponse = ("anyresponse")
</trial>


**************************************************************************************************************
**************************************************************************************************************
EXPERIMENT
**************************************************************************************************************
**************************************************************************************************************

NOTE:

<expt>
/ subjects = (1 of 1)
/ groupassignment = groupnumber
/ onexptbegin = [
values.expcondition = 1;
values.format1 = "PORTRAIT";
values.format2 = "LANDSCAPE";
values.startheight_A = parameters.Startheight_ratioA*values.Maxheight_px;
values.startheight_B = parameters.Startheight_ratioB* values.Maxheight_px;
]
/ blocks = [
1 = SequenceGenerator;
2 = practice_AAT;
3 = assessment1_AAT;
4 = assessment2_AAT
]
/ postinstructions = (End)
/ onexptend = [values.completed = 1]
</expt>

**********************************************************************************
Relevant parts I have changed in sequence generator:
<list stimcats>

/ items = (
1,1,1,1,1,1,
1,1,1,1,1,1,
2,2,2,2,2,2,
2,2,2,2,2,2,
3,3,3,3,3,3,3,
3,3,3,3,3,
4,4,4,4,4,4,4,4,
4,4,4,4,
5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,
7,7,7,7,7,7,7,7,
8,8,8,8,8,8,8,8)
/ replace = false
</list>

I have left all "values" at 0 even though I am wondering if they need to be increased from 80 to be right for 480 trials. Also wondering if the following is mandatory as I don't have a reason to have participants see this screen: 

<text wait>
/items = ("Please wait; we'll be ready shortly")
/ fontstyle = ("Arial", 3.00%, false, false, false, false, 5, 0)
</text>


Please provide the actual script and please include all external files the script requires to run (i.e. images etc.). Put all of this in a ZIP archive and then you can attach it to a post by clicking +Insert -> Add File.

Thank you so much for your help in advance. Of note, these are just placeholders for the images as we are currently working on preparing them. In an ideal world, we were going to use the sequence generator for semi-randomization, but if it becomes too complicated I am okay with eliminating it and having simple randomization through just the main script instead.
inquisituser22
inquisituser22
Respected Member
Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)

Group: Forum Members
Posts: 20, Visits: 99
inquisituser22 - 7/8/2019
Dave - 7/8/2019
inquisituser22 - 7/8/2019
 Hi Dave,
Thank you for your help with this. I have been attempting to address this from your comments as well as prior threads' comments, but my script doesn't seem to be loading properly as I have to do control B to get past the first (blank) page. If you are able to provide me with any feedback as to where I went wrong, that would be greatly appreciated. I've reduced the number of trials in my experiment's methods since previously posting and here is what I am trying to achieve now. I have a feeling it relates to "values.index" but I have had trouble following how to modify it correctly.

Thank you so very much in advance.

2 Parts of my experiment to be run sequentially:
Part 1: 2 categories of ("untrained") images x 8 images x 2 formats (landscape/portrait - same for all participants, not randomizing who sees which format) x 6 repetitions = 192 trials
Part 2: 2 categories of ("trained") images x 12 images x 2 formats x 6 repetitions = 288 trials
There will be instructions telling participants to take a break every 96 trials.

Here's what I have modified in the AAT script template:

<trial AAT_1untrained>
/ ontrialbegin = [
values.selectstimulus = list.category1.nextvalue;
values.targetcategory = 1;
values.targetformat = "l";
picture.targetstimulus.height = values.startheight_A;
values.starttime = script.elapsedtime;
values.endtime = 0;
values.completeRT = 0;
values.changedirection = 0;
values.finalresponse="";
]
/ stimulusframes = [1 = targetstimulus]
/ validresponse = (back, forward)
/ iscorrectresponse = [(values.expcondition == 1 && trial.AAT_1untrained.response == "forward") || (values.expcondition == 2 && trial.AAT_1untrained.response == "back")]
/ ontrialend = [
values.joystick_y = joystick.y;
values.joystick_change = abs(values.joystick_y);
values.trialcode = "AAT_1untrained";
values.RT = trial.AAT_1untrained.latency;
values.correct = trial.AAT_1untrained.correct;
values.stimulus = picture.targetstimulus.currentitem;
if (trial.AAT_1untrained.response == "forward")
values.initialresponse = "PUSH"
else
values.initialresponse = "PULL";
list.accuracy_overall.insertitem(trial.AAT_1untrained.correct,1);
if (trial.AAT_1untrained.correct) {
list.AAT_1untrainedcorrectlatencies.insertitem(trial.AAT_1untrained.latency, 1);
list.latencies_overall.insertitem(trial.AAT_1untrained.latency, 1);
}
]
/ branch = [
if (trial.AAT_1untrained.response == "forward")
trial.decrease
else
trial.increase;
]
/ recorddata = false
</trial>

<trial AAT_2untrained>
/ ontrialbegin = [
values.selectstimulus = list.category2.nextvalue;
values.targetcategory = 1;
values.targetformat = "p";
picture.targetstimulus.height = values.startheight_B;
values.starttime = script.elapsedtime;
values.endtime = 0;
values.completeRT = 0;
values.changedirection = 0;
values.finalresponse="";
]
/ stimulusframes = [1 = targetstimulus]
/ validresponse = (back, forward)
/ iscorrectresponse = [(values.expcondition == 1 && trial.AAT_2untrained.response == "back") || (values.expcondition == 2 && trial.AAT_2untrained.response == "forward")]
/ ontrialend = [
values.joystick_y = joystick.y;
values.joystick_change = abs(values.joystick_y);
values.trialcode = "AAT_2untrained";
values.RT = trial.AAT_2untrained.latency;
values.correct = trial.AAT_2untrained.correct;
values.stimulus = picture.targetstimulus.currentitem;
if (trial.AAT_2untrained.response == "forward")
values.initialresponse = "PUSH"
else
values.initialresponse = "PULL";
list.accuracy_overall.insertitem(trial.AAT_2untrained.correct,1);
if (trial.AAT_2untrained.correct) {
list.AAT_2untrainedcorrectlatencies.insertitem(trial.AAT_2untrained.latency, 1);
list.latencies_overall.insertitem(trial.AAT_2untrained.latency, 1);
}
]
/ branch = [
if (trial.AAT_2untrained.response == "forward")
trial.decrease
else
trial.increase
]
/ recorddata = false
</trial>

<trial AAT_1trained>
/ ontrialbegin = [
values.selectstimulus = list.category2.nextvalue;
values.targetcategory = 1;
values.targetformat = "p";
picture.targetstimulus.height = values.startheight_B;
values.starttime = script.elapsedtime;
values.endtime = 0;
values.completeRT = 0;
values.changedirection = 0;
values.finalresponse="";
]
/ stimulusframes = [1 = targetstimulus]
/ validresponse = (back, forward)
/ iscorrectresponse = [(values.expcondition == 1 && trial.AAT_1trained.response == "back") || (values.expcondition == 2 && trial.AAT_1trained.response == "forward")]
/ ontrialend = [
values.joystick_y = joystick.y;
values.joystick_change = abs(values.joystick_y);
values.trialcode = "AAT_1trained";
values.RT = trial.AAT_1trained.latency;
values.correct = trial.AAT_1trained.correct;
values.stimulus = picture.targetstimulus.currentitem;
if (trial.AAT_1trained.response == "forward")
values.initialresponse = "PUSH"
else
values.initialresponse = "PULL";
list.accuracy_overall.insertitem(trial.AAT_1trained.correct,1);
if (trial.AAT_1trained.correct) {
list.AAT_1trainedcorrectlatencies.insertitem(trial.AAT_1trained.latency, 1);
list.latencies_overall.insertitem(trial.AAT_1trained.latency, 1);
}
]
/ branch = [
if (trial.AAT_1trained.response == "forward")
trial.decrease
else
trial.increase
]
/ recorddata = false
</trial>

<trial AAT_2trained>
/ ontrialbegin = [
values.selectstimulus = list.category2.nextvalue;
values.targetcategory = 1;
values.targetformat = "p";
picture.targetstimulus.height = values.startheight_B;
values.starttime = script.elapsedtime;
values.endtime = 0;
values.completeRT = 0;
values.changedirection = 0;
values.finalresponse="";
]
/ stimulusframes = [1 = targetstimulus]
/ validresponse = (back, forward)
/ iscorrectresponse = [(values.expcondition == 1 && trial.AAT_2trained.response == "back") || (values.expcondition == 2 && trial.AAT_2trained.response == "forward")]
/ ontrialend = [
values.joystick_y = joystick.y;
values.joystick_change = abs(values.joystick_y);
values.trialcode = "AAT_2trained";
values.RT = trial.AAT_2trained.latency;
values.correct = trial.AAT_2trained.correct;
values.stimulus = picture.targetstimulus.currentitem;
if (trial.AAT_2trained.response == "forward")
values.initialresponse = "PUSH"
else
values.initialresponse = "PULL";
list.accuracy_overall.insertitem(trial.AAT_2trained.correct,1);
if (trial.AAT_2trained.correct) {
list.AAT_2trainedcorrectlatencies.insertitem(trial.AAT_2trained.latency, 1);
list.latencies_overall.insertitem(trial.AAT_2trained.latency, 1);
}
]
/ branch = [
if (trial.AAT_2trained.response == "forward")
trial.decrease
else
trial.increase
]
/ recorddata = false
</trial>

<trial AAT_3trained>
/ ontrialbegin = [
values.selectstimulus = list.category2.nextvalue;
values.targetcategory = 1;
values.targetformat = "p";
picture.targetstimulus.height = values.startheight_B;
values.starttime = script.elapsedtime;
values.endtime = 0;
values.completeRT = 0;
values.changedirection = 0;
values.finalresponse="";
]
/ stimulusframes = [1 = targetstimulus]
/ validresponse = (back, forward)
/ iscorrectresponse = [(values.expcondition == 1 && trial.AAT_3trained.response == "back") || (values.expcondition == 2 && trial.AAT_3trained.response == "forward")]
/ ontrialend = [
values.joystick_y = joystick.y;
values.joystick_change = abs(values.joystick_y);
values.trialcode = "AAT_3trained";
values.RT = trial.AAT_3trained.latency;
values.correct = trial.AAT_3trained.correct;
values.stimulus = picture.targetstimulus.currentitem;
if (trial.AAT_3trained.response == "forward")
values.initialresponse = "PUSH"
else
values.initialresponse = "PULL";
list.accuracy_overall.insertitem(trial.AAT_3trained.correct,1);
if (trial.AAT_3trained.correct) {
list.AAT_3trainedcorrectlatencies.insertitem(trial.AAT_3trained.latency, 1);
list.latencies_overall.insertitem(trial.AAT_3trained.latency, 1);
}
]
/ branch = [
if (trial.AAT_3trained.response == "forward")
trial.decrease
else
trial.increase
]
/ recorddata = false
</trial>

**************************************************************************************************************
**************************************************************************************************************
BLOCKS
**************************************************************************************************************
**************************************************************************************************************

NOTE:
block.practice_AAT presents 10 practice trials randomly (without replacement) selecting
from format A (landscape) (N=5) and format B (portrait) stimuli (N=5)
<block practice_AAT>
/ trials = [1-2 = instructions; 3-12 = noreplace(practicetrial_A, practicetrial_B)]
</block>

Note:
The trial sequence is generated by helper script 'AAT_SequenceGenerator.iqx'
!!!! The time to generate the appropriate sequence will differ between participants.
Two alternatives are:
1) use pregenerated sequences.
2) run the experiment with simple random sampling (easiest solution)
-> / trials = [1 = instructions; 2-81 = noreplace(AAT_1, AAT_2)]

<block assessment1_AAT>
/ onblockbegin = [values.index = 0]
/ trials = [1 = instructions; 2-97 = AAT_1untrained; 98 = instructions2; 99-194 = AAT_2untrained]
</block>

<block assessment2_AAT>
/ onblockbegin = [values.index = 0]
/ trials = [1 = instructions; 2-97 = AAT_1trained; 98 = instructions2; 99-194 = AAT_2trained; 195 = instructions2; 196-292 = AAT_3trained]
</block>


**************************************************************************************************************
**************************************************************************************************************
BREAKS
**************************************************************************************************************
**************************************************************************************************************

<text instructions2>
/ items = instructions2
/ select = sequence
/ position = (50%, 50%)
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 0)
/ txcolor = black
/ resetinterval = 3
/ size = (80%, 80%)
</text>

<item instructions2>
/ 1 = "PLEASE TAKE A FEW MOMENTS TO TAKE A BREAK DURING THE SESSION.
^^
Press press any key on the keyboard when you are ready to continue."
</item>

<trial instructions2>
/ stimulusframes = [1 = instructions2]
/ validresponse = ("anyresponse")
</trial>


**************************************************************************************************************
**************************************************************************************************************
EXPERIMENT
**************************************************************************************************************
**************************************************************************************************************

NOTE:

<expt>
/ subjects = (1 of 1)
/ groupassignment = groupnumber
/ onexptbegin = [
values.expcondition = 1;
values.format1 = "PORTRAIT";
values.format2 = "LANDSCAPE";
values.startheight_A = parameters.Startheight_ratioA*values.Maxheight_px;
values.startheight_B = parameters.Startheight_ratioB* values.Maxheight_px;
]
/ blocks = [
1 = SequenceGenerator;
2 = practice_AAT;
3 = assessment1_AAT;
4 = assessment2_AAT
]
/ postinstructions = (End)
/ onexptend = [values.completed = 1]
</expt>

**********************************************************************************
Relevant parts I have changed in sequence generator:
<list stimcats>

/ items = (
1,1,1,1,1,1,
1,1,1,1,1,1,
2,2,2,2,2,2,
2,2,2,2,2,2,
3,3,3,3,3,3,3,
3,3,3,3,3,
4,4,4,4,4,4,4,4,
4,4,4,4,
5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,
7,7,7,7,7,7,7,7,
8,8,8,8,8,8,8,8)
/ replace = false
</list>

I have left all "values" at 0 even though I am wondering if they need to be increased from 80 to be right for 480 trials. Also wondering if the following is mandatory as I don't have a reason to have participants see this screen: 

<text wait>
/items = ("Please wait; we'll be ready shortly")
/ fontstyle = ("Arial", 3.00%, false, false, false, false, 5, 0)
</text>


Please provide the actual script and please include all external files the script requires to run (i.e. images etc.). Put all of this in a ZIP archive and then you can attach it to a post by clicking +Insert -> Add File.

Thank you so much for your help in advance. Of note, these are just placeholders for the images as we are currently working on preparing them. In an ideal world, we were going to use the sequence generator for semi-randomization, but if it becomes too complicated I am okay with eliminating it and having simple randomization through just the main script instead.

Sorry - that posted without the file! Will send files when I get somewhere with faster internet.
inquisituser22
inquisituser22
Respected Member
Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)Respected Member (410 reputation)

Group: Forum Members
Posts: 20, Visits: 99
inquisituser22 - 7/8/2019
inquisituser22 - 7/8/2019
Dave - 7/8/2019
inquisituser22 - 7/8/2019
 Hi Dave,
Thank you for your help with this. I have been attempting to address this from your comments as well as prior threads' comments, but my script doesn't seem to be loading properly as I have to do control B to get past the first (blank) page. If you are able to provide me with any feedback as to where I went wrong, that would be greatly appreciated. I've reduced the number of trials in my experiment's methods since previously posting and here is what I am trying to achieve now. I have a feeling it relates to "values.index" but I have had trouble following how to modify it correctly.

Thank you so very much in advance.

2 Parts of my experiment to be run sequentially:
Part 1: 2 categories of ("untrained") images x 8 images x 2 formats (landscape/portrait - same for all participants, not randomizing who sees which format) x 6 repetitions = 192 trials
Part 2: 2 categories of ("trained") images x 12 images x 2 formats x 6 repetitions = 288 trials
There will be instructions telling participants to take a break every 96 trials.

Here's what I have modified in the AAT script template:

<trial AAT_1untrained>
/ ontrialbegin = [
values.selectstimulus = list.category1.nextvalue;
values.targetcategory = 1;
values.targetformat = "l";
picture.targetstimulus.height = values.startheight_A;
values.starttime = script.elapsedtime;
values.endtime = 0;
values.completeRT = 0;
values.changedirection = 0;
values.finalresponse="";
]
/ stimulusframes = [1 = targetstimulus]
/ validresponse = (back, forward)
/ iscorrectresponse = [(values.expcondition == 1 && trial.AAT_1untrained.response == "forward") || (values.expcondition == 2 && trial.AAT_1untrained.response == "back")]
/ ontrialend = [
values.joystick_y = joystick.y;
values.joystick_change = abs(values.joystick_y);
values.trialcode = "AAT_1untrained";
values.RT = trial.AAT_1untrained.latency;
values.correct = trial.AAT_1untrained.correct;
values.stimulus = picture.targetstimulus.currentitem;
if (trial.AAT_1untrained.response == "forward")
values.initialresponse = "PUSH"
else
values.initialresponse = "PULL";
list.accuracy_overall.insertitem(trial.AAT_1untrained.correct,1);
if (trial.AAT_1untrained.correct) {
list.AAT_1untrainedcorrectlatencies.insertitem(trial.AAT_1untrained.latency, 1);
list.latencies_overall.insertitem(trial.AAT_1untrained.latency, 1);
}
]
/ branch = [
if (trial.AAT_1untrained.response == "forward")
trial.decrease
else
trial.increase;
]
/ recorddata = false
</trial>

<trial AAT_2untrained>
/ ontrialbegin = [
values.selectstimulus = list.category2.nextvalue;
values.targetcategory = 1;
values.targetformat = "p";
picture.targetstimulus.height = values.startheight_B;
values.starttime = script.elapsedtime;
values.endtime = 0;
values.completeRT = 0;
values.changedirection = 0;
values.finalresponse="";
]
/ stimulusframes = [1 = targetstimulus]
/ validresponse = (back, forward)
/ iscorrectresponse = [(values.expcondition == 1 && trial.AAT_2untrained.response == "back") || (values.expcondition == 2 && trial.AAT_2untrained.response == "forward")]
/ ontrialend = [
values.joystick_y = joystick.y;
values.joystick_change = abs(values.joystick_y);
values.trialcode = "AAT_2untrained";
values.RT = trial.AAT_2untrained.latency;
values.correct = trial.AAT_2untrained.correct;
values.stimulus = picture.targetstimulus.currentitem;
if (trial.AAT_2untrained.response == "forward")
values.initialresponse = "PUSH"
else
values.initialresponse = "PULL";
list.accuracy_overall.insertitem(trial.AAT_2untrained.correct,1);
if (trial.AAT_2untrained.correct) {
list.AAT_2untrainedcorrectlatencies.insertitem(trial.AAT_2untrained.latency, 1);
list.latencies_overall.insertitem(trial.AAT_2untrained.latency, 1);
}
]
/ branch = [
if (trial.AAT_2untrained.response == "forward")
trial.decrease
else
trial.increase
]
/ recorddata = false
</trial>

<trial AAT_1trained>
/ ontrialbegin = [
values.selectstimulus = list.category2.nextvalue;
values.targetcategory = 1;
values.targetformat = "p";
picture.targetstimulus.height = values.startheight_B;
values.starttime = script.elapsedtime;
values.endtime = 0;
values.completeRT = 0;
values.changedirection = 0;
values.finalresponse="";
]
/ stimulusframes = [1 = targetstimulus]
/ validresponse = (back, forward)
/ iscorrectresponse = [(values.expcondition == 1 && trial.AAT_1trained.response == "back") || (values.expcondition == 2 && trial.AAT_1trained.response == "forward")]
/ ontrialend = [
values.joystick_y = joystick.y;
values.joystick_change = abs(values.joystick_y);
values.trialcode = "AAT_1trained";
values.RT = trial.AAT_1trained.latency;
values.correct = trial.AAT_1trained.correct;
values.stimulus = picture.targetstimulus.currentitem;
if (trial.AAT_1trained.response == "forward")
values.initialresponse = "PUSH"
else
values.initialresponse = "PULL";
list.accuracy_overall.insertitem(trial.AAT_1trained.correct,1);
if (trial.AAT_1trained.correct) {
list.AAT_1trainedcorrectlatencies.insertitem(trial.AAT_1trained.latency, 1);
list.latencies_overall.insertitem(trial.AAT_1trained.latency, 1);
}
]
/ branch = [
if (trial.AAT_1trained.response == "forward")
trial.decrease
else
trial.increase
]
/ recorddata = false
</trial>

<trial AAT_2trained>
/ ontrialbegin = [
values.selectstimulus = list.category2.nextvalue;
values.targetcategory = 1;
values.targetformat = "p";
picture.targetstimulus.height = values.startheight_B;
values.starttime = script.elapsedtime;
values.endtime = 0;
values.completeRT = 0;
values.changedirection = 0;
values.finalresponse="";
]
/ stimulusframes = [1 = targetstimulus]
/ validresponse = (back, forward)
/ iscorrectresponse = [(values.expcondition == 1 && trial.AAT_2trained.response == "back") || (values.expcondition == 2 && trial.AAT_2trained.response == "forward")]
/ ontrialend = [
values.joystick_y = joystick.y;
values.joystick_change = abs(values.joystick_y);
values.trialcode = "AAT_2trained";
values.RT = trial.AAT_2trained.latency;
values.correct = trial.AAT_2trained.correct;
values.stimulus = picture.targetstimulus.currentitem;
if (trial.AAT_2trained.response == "forward")
values.initialresponse = "PUSH"
else
values.initialresponse = "PULL";
list.accuracy_overall.insertitem(trial.AAT_2trained.correct,1);
if (trial.AAT_2trained.correct) {
list.AAT_2trainedcorrectlatencies.insertitem(trial.AAT_2trained.latency, 1);
list.latencies_overall.insertitem(trial.AAT_2trained.latency, 1);
}
]
/ branch = [
if (trial.AAT_2trained.response == "forward")
trial.decrease
else
trial.increase
]
/ recorddata = false
</trial>

<trial AAT_3trained>
/ ontrialbegin = [
values.selectstimulus = list.category2.nextvalue;
values.targetcategory = 1;
values.targetformat = "p";
picture.targetstimulus.height = values.startheight_B;
values.starttime = script.elapsedtime;
values.endtime = 0;
values.completeRT = 0;
values.changedirection = 0;
values.finalresponse="";
]
/ stimulusframes = [1 = targetstimulus]
/ validresponse = (back, forward)
/ iscorrectresponse = [(values.expcondition == 1 && trial.AAT_3trained.response == "back") || (values.expcondition == 2 && trial.AAT_3trained.response == "forward")]
/ ontrialend = [
values.joystick_y = joystick.y;
values.joystick_change = abs(values.joystick_y);
values.trialcode = "AAT_3trained";
values.RT = trial.AAT_3trained.latency;
values.correct = trial.AAT_3trained.correct;
values.stimulus = picture.targetstimulus.currentitem;
if (trial.AAT_3trained.response == "forward")
values.initialresponse = "PUSH"
else
values.initialresponse = "PULL";
list.accuracy_overall.insertitem(trial.AAT_3trained.correct,1);
if (trial.AAT_3trained.correct) {
list.AAT_3trainedcorrectlatencies.insertitem(trial.AAT_3trained.latency, 1);
list.latencies_overall.insertitem(trial.AAT_3trained.latency, 1);
}
]
/ branch = [
if (trial.AAT_3trained.response == "forward")
trial.decrease
else
trial.increase
]
/ recorddata = false
</trial>

**************************************************************************************************************
**************************************************************************************************************
BLOCKS
**************************************************************************************************************
**************************************************************************************************************

NOTE:
block.practice_AAT presents 10 practice trials randomly (without replacement) selecting
from format A (landscape) (N=5) and format B (portrait) stimuli (N=5)
<block practice_AAT>
/ trials = [1-2 = instructions; 3-12 = noreplace(practicetrial_A, practicetrial_B)]
</block>

Note:
The trial sequence is generated by helper script 'AAT_SequenceGenerator.iqx'
!!!! The time to generate the appropriate sequence will differ between participants.
Two alternatives are:
1) use pregenerated sequences.
2) run the experiment with simple random sampling (easiest solution)
-> / trials = [1 = instructions; 2-81 = noreplace(AAT_1, AAT_2)]

<block assessment1_AAT>
/ onblockbegin = [values.index = 0]
/ trials = [1 = instructions; 2-97 = AAT_1untrained; 98 = instructions2; 99-194 = AAT_2untrained]
</block>

<block assessment2_AAT>
/ onblockbegin = [values.index = 0]
/ trials = [1 = instructions; 2-97 = AAT_1trained; 98 = instructions2; 99-194 = AAT_2trained; 195 = instructions2; 196-292 = AAT_3trained]
</block>


**************************************************************************************************************
**************************************************************************************************************
BREAKS
**************************************************************************************************************
**************************************************************************************************************

<text instructions2>
/ items = instructions2
/ select = sequence
/ position = (50%, 50%)
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 0)
/ txcolor = black
/ resetinterval = 3
/ size = (80%, 80%)
</text>

<item instructions2>
/ 1 = "PLEASE TAKE A FEW MOMENTS TO TAKE A BREAK DURING THE SESSION.
^^
Press press any key on the keyboard when you are ready to continue."
</item>

<trial instructions2>
/ stimulusframes = [1 = instructions2]
/ validresponse = ("anyresponse")
</trial>


**************************************************************************************************************
**************************************************************************************************************
EXPERIMENT
**************************************************************************************************************
**************************************************************************************************************

NOTE:

<expt>
/ subjects = (1 of 1)
/ groupassignment = groupnumber
/ onexptbegin = [
values.expcondition = 1;
values.format1 = "PORTRAIT";
values.format2 = "LANDSCAPE";
values.startheight_A = parameters.Startheight_ratioA*values.Maxheight_px;
values.startheight_B = parameters.Startheight_ratioB* values.Maxheight_px;
]
/ blocks = [
1 = SequenceGenerator;
2 = practice_AAT;
3 = assessment1_AAT;
4 = assessment2_AAT
]
/ postinstructions = (End)
/ onexptend = [values.completed = 1]
</expt>

**********************************************************************************
Relevant parts I have changed in sequence generator:
<list stimcats>

/ items = (
1,1,1,1,1,1,
1,1,1,1,1,1,
2,2,2,2,2,2,
2,2,2,2,2,2,
3,3,3,3,3,3,3,
3,3,3,3,3,
4,4,4,4,4,4,4,4,
4,4,4,4,
5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,
7,7,7,7,7,7,7,7,
8,8,8,8,8,8,8,8)
/ replace = false
</list>

I have left all "values" at 0 even though I am wondering if they need to be increased from 80 to be right for 480 trials. Also wondering if the following is mandatory as I don't have a reason to have participants see this screen: 

<text wait>
/items = ("Please wait; we'll be ready shortly")
/ fontstyle = ("Arial", 3.00%, false, false, false, false, 5, 0)
</text>


Please provide the actual script and please include all external files the script requires to run (i.e. images etc.). Put all of this in a ZIP archive and then you can attach it to a post by clicking +Insert -> Add File.

Thank you so much for your help in advance. Of note, these are just placeholders for the images as we are currently working on preparing them. In an ideal world, we were going to use the sequence generator for semi-randomization, but if it becomes too complicated I am okay with eliminating it and having simple randomization through just the main script instead.

Sorry - that posted without the file! Will send files when I get somewhere with faster internet.



Attachments
7-8-2019 Script for forum.zip (3 views, 3.00 MB)
Dave
Dave
Supreme Being
Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)

Group: Administrators
Posts: 9.6K, Visits: 44K

Thanks for the file. The code as-is does not make use of the generated sequence, so -- right now -- it doesn't really make sense to run the sequence generation block at all. The freezing / blank screen occurs because, as I suspected, the generator runs into an unrecoverable state or endless loop because it cannot create a suitable sequence. Some of that is due to misconfiguration of the various <values>. /totaltrialcount ought to specify the desired length of the sequence, that is the total amount of trials you want to create a sequence for. /count1 to /count8 ought to reflect the desired number of trials for each respective category (it's 10 per category in the original); neither /totaltrialcount nor the /count1 to /count8 values may all be set to zero as in your modification of the sequence generator.

Also note that, if you do change the values for /count1 to /count8, you need to modify the reset logic in <trial selectnumber> accordingly, otherwise they'll end up being reset to the default 10:

/ontrialend = [if (values.reset == true)
{
values.sequence = "";
values.index = 0; values.count_comparecat = 0; values.count_compareformat = 0;
values.runcount_1 = 0; values.runcount_2 = 0; values.runcount_3 = 0; values.runcount_4 = 0;
values.runcount_A = 0; values.runcount_B = 0;
values.count1 = 10; values.count2 = 10; values.count3 = 10; values.count4 = 10; values.count5 = 10; values.count6 = 10; values.count7 = 10; values.count8 = 10;
list.stimcats.reset()
}]

As I've said before, I don't necessarily think relying on the sequence generator is recommendable in your case, especially since you effectively seem to want two separate / distinct sequences (one for the trained, another for the untrained part) with different parameters. I don't see a straightforward way to extend the generator to create such a thing in one go.
Dave
Dave
Supreme Being
Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)Supreme Being (647K reputation)

Group: Administrators
Posts: 9.6K, Visits: 44K
Dave - 7/8/2019

Thanks for the file. The code as-is does not make use of the generated sequence, so -- right now -- it doesn't really make sense to run the sequence generation block at all. The freezing / blank screen occurs because, as I suspected, the generator runs into an unrecoverable state or endless loop because it cannot create a suitable sequence. Some of that is due to misconfiguration of the various <values>. /totaltrialcount ought to specify the desired length of the sequence, that is the total amount of trials you want to create a sequence for. /count1 to /count8 ought to reflect the desired number of trials for each respective category (it's 10 per category in the original); neither /totaltrialcount nor the /count1 to /count8 values may all be set to zero as in your modification of the sequence generator.

Also note that, if you do change the values for /count1 to /count8, you need to modify the reset logic in <trial selectnumber> accordingly, otherwise they'll end up being reset to the default 10:

/ontrialend = [if (values.reset == true)
{
values.sequence = "";
values.index = 0; values.count_comparecat = 0; values.count_compareformat = 0;
values.runcount_1 = 0; values.runcount_2 = 0; values.runcount_3 = 0; values.runcount_4 = 0;
values.runcount_A = 0; values.runcount_B = 0;
values.count1 = 10; values.count2 = 10; values.count3 = 10; values.count4 = 10; values.count5 = 10; values.count6 = 10; values.count7 = 10; values.count8 = 10;
list.stimcats.reset()
}]

As I've said before, I don't necessarily think relying on the sequence generator is recommendable in your case, especially since you effectively seem to want two separate / distinct sequences (one for the trained, another for the untrained part) with different parameters. I don't see a straightforward way to extend the generator to create such a thing in one go.

I've coded up a stand-alone version the sequence generator that displays the generated sequence and its various parameters on-screen as it occurs in real time. It will alert to you resets as well as successful sequence generation and display the results on the monitor for review. This should make it easier to understand its mechanics, toy around with different settings and modifications and then examine their effects on sequence generation.

Attachments
aat_sequencegenerator.iqx (9 views, 20.00 KB)
GO


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....






Millisecond Forums


Search