Can we call specific items in lists / values ?


Author
Message
eleonora_parr
eleonora_parr
Partner Member (570 reputation)Partner Member (570 reputation)Partner Member (570 reputation)Partner Member (570 reputation)Partner Member (570 reputation)Partner Member (570 reputation)Partner Member (570 reputation)Partner Member (570 reputation)Partner Member (570 reputation)
Group: Forum Members
Posts: 40, Visits: 148
Dear Inquisiters,
I am trying to program a sort of psychophisics in inquisit: participants have to synchronize their responses with the appearance of a circle on the screen. Their accuracy is calculated according to how many of their responses fell in a range of time that was very close to the appearance of this circle.
I want that each participant reaches an accuracy of 0.8. To do so, the color/brightness of the circle on the screen will vary in each trial, until his/her performance reaches that level of accuracy. The idea is to have nine levels of color with the easiest level very close to the screen color (screen color is 195,195,195 and the easiest level is with a circle 200,200,200) and the hardest level with a very bright circle (i.e. 255,255,255).
The plan would be that each participant will start from a medium level of brightness (i.e. 230,230,230). If this level produced an accuracy between 0.78 and 0.82, then repeat the same trial:  if the participant, again, got an accuracy between 0.78 and 0.82, then the psychophysics is finished.
The idea is that if he/she got the same performance in TWO CONSECUTIVE trials with the SAME level of brightness, then we consider that performance/accuracy “stable” and we can “trust” his/her performance. However, if he/she does not reach the threshold that we want two consecutive times, inquisit should run an harder/easier trial according to the performance.
In example, if the performance at the 230,230,230 level was too low for our standard, inquisit should display an easier level/ trial (i.e. with the color of the circle at 240,240,240). If the performance was too high, then inquisit should display a trial with a lower level of brightness (i.e. with the color of the circle at 220,220,220).
Moreover, I also want to store the several accuracies and correct latencies that have been collected, that is why I created different trials for each level (as I also would need to double check everytime if everything is working).
How could it be possible to have conditional statement that makes this psychophysics run in this way?
I thought to have a list/values in which I could store all the accuracies collected, and then tell to inquisit that IF there are two consecutive values falling into the range of accuracy that we want (0.78-0.82) then the psychophysics is ended. The thing is that for what I know it is not possible to call specific items in lists/values, or is that possible in some way?
Really hope that someone here could help me !
Here I attached the code: for the sake of simplicity I just kept three levels, but keep in mind that the levels are nine
(i.e. 255,255,255; 250,250,250; 245,245,245; 240,240,240; 230,230,230; 220,220,220; 215,215,215; 210,210,210; 200)
I could also provide the entire code with all the levels if that is needed..
Thank you very very much ,
Eleonora
<picture circle_255>
/ items = ("255.png")
/ position = (50%,50%)
/size=(30%, 30%)
</picture>


<picture circle_250>
/ items = ("250.png")
/ position = (50%,50%)
/size=(30%, 30%)
</picture>

<picture circle_245>
/ items = ("245.png")
/ position = (50%,50%)
/size=(30%, 30%)
</picture>

<picture circle_235>
/ items = ("235.png")
/ position = (50%,50%)
/size=(30%, 30%)
</picture>



<picture circle_225>
/ items = ("225.png")
/ position = (50%,50%)
/size=(30%, 30%)
</picture>



<picture circle_215>
/ items = ("215.png")
/ position = (50%,50%)
/size=(30%, 30%)
</picture>



<picture circle_205>
/ items = ("205.png")
/ position = (50%,50%)
/size=(30%, 30%)
</picture>



<picture circle_200>
/ items = ("200.png")
/ position = (50%,50%)
/size=(30%, 30%)
</picture>




<picture black_circle>
/ items = ("195.png")
/ position = (50%,50%)
/size=(30%, 30%)
</picture>

<shape blank>
/ color = (195,195,195)
/ position = (50%,50%)
/ shape = rectangle
/size=(30%, 30%)
</shape>

<shape backgroundcolor>
/ shape = rectangle
/ color = white
/ erase = false
/ size = (100%, 100%)
</shape>

<picture checker>
/items=("scacchieracc1.png")
/ position = (50%, 50%)
/ size = (30%, 30%)
</picture>


<trial blank>
/stimulusframes=[1=blank]
/ trialduration = 3000
</trial>

<text cross>
/items=("+")
/position = (50%, 50%)
</text>

<trial fixate>
/ stimulusframes = [1=cross]
/ trialduration = 2000
</trial>


<values>
/ latencycount = 0;
/current_frequency = "";
/freq = "";
/ current_onset = 0;
/ current_min = 0;
/ current_max = 0;
/ current_latency = "";
/ sum_counted = 0;
/ bucket_hit = 0;
</values>


<text 60hz>
/ fontstyle = ("Trebuchet MS", 3%, false, false, false, false, 5, 1)
/ position = (50%, 50%)
/ txbgcolor = transparent
/ erase = false
/ txcolor = white

/ items = ("
Premi continua per iniziare l'esperimento ")
</text>

<text continue>
/ items = ("Continua")
/ size = (9%, 5%)
/ position = (75%, 90%)
/ fontstyle = ("Trebuchet MS", 4%, false, false, false, false, 5, 1)
/ txbgcolor = white
/ txcolor = black
</text>


<trial 60hz>
/ ontrialbegin = [
  shape.backgroundcolor.color = black;]

/ stimulusframes = [1=clearscreen,backgroundcolor,60hz, continue]
/ showmousecursor = true
/ inputdevice = mouse
/ validresponse = (continue)
</trial>

<text instructions>
/ txbgcolor = transparent
/ erase = false
/ txcolor = white
/ fontstyle = ("Trebuchet MS", 3%, false, false, false, false, 5, 1)
/ position = (50%, 50%)
/ items = ("
Premi continua per iniziare l'esperimento")
</text>


<text instructions2>
/ txbgcolor = transparent
/ erase = false
/ txcolor = white
/ fontstyle = ("Trebuchet MS", 3%, false, false, false, false, 5, 1)
/ position = (50%, 50%)
/ items = ("
Premi continua per iniziare l'esperimento")
</text>

<trial instructions1>
/ ontrialbegin = [
  shape.backgroundcolor.color = black;]

/ stimulusframes = [1=clearscreen,backgroundcolor,instructions, continue]
/ showmousecursor = true
/ inputdevice = mouse
/ validresponse = (continue)
</trial>

<trial instructions2>
/ ontrialbegin = [
  shape.backgroundcolor.color = black;]

/ stimulusframes = [1=clearscreen,backgroundcolor,instructions2, continue]
/ showmousecursor = true
/ inputdevice = mouse
/ validresponse = (continue)
</trial>

<list frequency>
/select=sequence
</list>


<values>
/timeofresponse_255_1="";
/spacebarpresscount_255_1 ="";
/accuracy_255_1 = "";
/sum_acc_betw_255_1 ="";
/sum_acc_69_255_1 = "";
/sum_acc_94_255_1 = "";
/corrlat_255_1="";
/sum_69_255_1 =0;
/betw_255_1=0;
/sum_94_255_1 =0;
/ bucketcount_255_1 = 0;
/ sum_acc_latencies_255_1 = 0;
/lat_69_255_1 = 0;
/lat_betw_255_1 = 0;
/lat_94_255_1 = 0;
</values>

<trial 255_1>
/ ontrialbegin = [
values.spacebarpresscount_255_1 = "";
values.timeofresponse_255_1 = "";
values.accuracy_255_1 = "";
values.current_onset = "";
values.current_max = "";
values.current_min = "";
values.current_latency = "";

values.bucketcount_255_1 = 0;
values.latencycount = 0;
values.sum_counted = 0;
values.bucket_hit = 0;

values.sum_acc_latencies_255_1 = 0;

values.sum_acc_69_255_1 = 0;
values.sum_acc_betw_255_1 = 0;
values.sum_acc_94_255_1 = 0;

values.sum_69_255_1 =0;
values.betw_255_1=0;
values.sum_94_255_1 =0;

list.latencies_255_1.reset();
list.onsets_255_1.reset();
]
/pretrialpause = 1000
/stimulustimes=[
0=checker;
1000=circle_255;
2007=circle_255;
3083=circle_255;
4221=circle_255;
5399=circle_255;
6570=circle_255;
7708=circle_255;
8936=circle_255;
10060=circle_255;
11260=circle_255;
12460=circle_255;
13633=circle_255;
14893=circle_255;

1045=black_circle;
2052=black_circle;
3128=black_circle;
4266=black_circle;
5444=black_circle;
6615=black_circle;
7753=black_circle;
8981=black_circle;
10105=black_circle;
11305=black_circle;
12505=black_circle;
13678=black_circle;
]
/ trialduration = 13678+1000
/ inputdevice = keyboard
/ beginresponsetime = -1
/ responseinterrupt = trial
/ validresponse = (-57, 0)
/ correctresponse = (0)
/ showmousecursor = false
/ isvalidresponse = [if(trial.255_1.response==57){
values.spacebarpresscount_255_1 += 1;
values.timeofresponse_255_1=concat(concat(values.timeofresponse_255_1, trial.255_1.latency),",");
list.latencies_255_1.appenditem(trial.255_1.latency);
false}
;
]
/ ontrialend = [
list.onsets_255_1.appenditem(picture.circle_255.stimulusonset.1);
list.onsets_255_1.appenditem(picture.circle_255.stimulusonset.2);
list.onsets_255_1.appenditem(picture.circle_255.stimulusonset.3);
list.onsets_255_1.appenditem(picture.circle_255.stimulusonset.4);
list.onsets_255_1.appenditem(picture.circle_255.stimulusonset.5);
list.onsets_255_1.appenditem(picture.circle_255.stimulusonset.6);
list.onsets_255_1.appenditem(picture.circle_255.stimulusonset.7);
list.onsets_255_1.appenditem(picture.circle_255.stimulusonset.8);
list.onsets_255_1.appenditem(picture.circle_255.stimulusonset.9);
list.onsets_255_1.appenditem(picture.circle_255.stimulusonset.10);
list.onsets_255_1.appenditem(picture.circle_255.stimulusonset.11);
list.onsets_255_1.appenditem(picture.circle_255.stimulusonset.12);

list.frequency.appenditem(60/((picture.circle_255.stimulusonset.2-picture.circle_255.stimulusonset.1)/1000));
list.frequency.appenditem(60/((picture.circle_255.stimulusonset.3-picture.circle_255.stimulusonset.2)/1000));
list.frequency.appenditem(60/((picture.circle_255.stimulusonset.4-picture.circle_255.stimulusonset.3)/1000));
list.frequency.appenditem(60/((picture.circle_255.stimulusonset.5-picture.circle_255.stimulusonset.4)/1000));
list.frequency.appenditem(60/((picture.circle_255.stimulusonset.6-picture.circle_255.stimulusonset.5)/1000));
list.frequency.appenditem(60/((picture.circle_255.stimulusonset.7-picture.circle_255.stimulusonset.6)/1000));
list.frequency.appenditem(60/((picture.circle_255.stimulusonset.8-picture.circle_255.stimulusonset.7)/1000));
list.frequency.appenditem(60/((picture.circle_255.stimulusonset.9-picture.circle_255.stimulusonset.8)/1000));
list.frequency.appenditem(60/((picture.circle_255.stimulusonset.10-picture.circle_255.stimulusonset.9)/1000));
list.frequency.appenditem(60/((picture.circle_255.stimulusonset.11-picture.circle_255.stimulusonset.10)/1000));
list.frequency.appenditem(60/((picture.circle_255.stimulusonset.12-picture.circle_255.stimulusonset.11)/1000));
list.frequency.appenditem((list.frequency.mean))

]
/ branch = [
trial.construct_bucket_255_1;
]
</trial>

<list latencies_255_1>
/ select = sequence
</list>

<list onsets_255_1>
/ select = sequence
</list>


<trial construct_bucket_255_1>
/ ontrialbegin = [
values.bucketcount_255_1 += 1;

values.bucket_hit = 0;
values.sum_counted = 0;

values.sum_acc_69_255_1 = 0;
values.sum_acc_betw_255_1 = 0;
values.sum_acc_94_255_1 = 0;
values.sum_69_255_1 =0;
values.betw_255_1=0;
values.sum_94_255_1 =0;

values.latencycount = 0;
values.current_onset = list.onsets_255_1.nextvalue;
values.current_frequency = list.frequency.nextvalue;
values.freq = concat(concat(values.freq, values.current_frequency),",");
if (values.current_frequency < 69.76) {values.current_min = values.current_onset - 125; values.current_max = values.current_onset + 750;}
else if (values.current_frequency > 69.75 && values.current_frequency <= 94.25) {values.current_min = values.current_onset - 100; values.current_max = values.current_onset + 600;}
  else if (values.current_frequency > 94.25) {values.current_min = values.current_onset - 75; values.current_max = values.current_onset + 400;};
]
/ stimulusframes = [1=clearscreen, debug_255_1]
/ branch = [
trial.check_latencies_255_1;
]
/ trialduration = 0
/ recorddata = false
</trial>

<trial check_latencies_255_1>
/ ontrialbegin = [
values.latencycount += 1;
values.current_latency = list.latencies_255_1.nextvalue;
if (values.current_latency >= values.current_min && values.current_latency <= values.current_max)
 {values.sum_counted += 1; values.corrlat_255_1 = concat(concat(values.corrlat_255_1, values.current_latency),",");};
 if(values.current_latency >= values.current_min && values.current_latency <= values.current_max && values.current_frequency < 69.76)
 {values.sum_acc_69_255_1 += 1;}
  else if(values.current_latency >= values.current_min && values.current_latency <= values.current_max && values.current_frequency > 69.75 && values.current_frequency <= 94.25){values.sum_acc_betw_255_1 += 1;}
      else if(values.current_latency >= values.current_min && values.current_latency <= values.current_max && values.current_frequency > 94.25){values.sum_acc_94_255_1 += 1;};

if (values.sum_counted >=1) {values.bucket_hit = 1} else {values.bucket_hit = 0;};
if (values.sum_acc_69_255_1 >=1) {values.sum_69_255_1 =1} else {values.sum_69_255_1=0;};
if (values.sum_acc_255_1 >=1) {values.betw_255_1 =1} else {values.betw_255_1=0;};
if (values.sum_acc_94_255_1 >=1) {values.sum_94_255_1 =1} else {values.sum_94_255_1 =0;};
]
/ stimulusframes = [1=clearscreen, debug_255_1]
/ branch = [
if (values.latencycount < list.latencies_255_1.itemcount) {trial.check_latencies_255_1;}
else if (values.bucketcount_255_1 < list.onsets_255_1.itemcount)
{values.sum_acc_latencies_255_1 += values.bucket_hit;
values.lat_69_255_1 += values.sum_69_255_1;
values.lat_betw_255_1 += values.betw_255_1;
values.lat_94_255_1 += values.sum_94_255_1 ;
trial.construct_bucket_255_1;}
else {values.sum_acc_latencies_255_1 += values.bucket_hit;
values.lat_69_255_1 += values.sum_69_255_1;
values.lat_betw_255_1 += values.betw_255_1;
values.lat_94_255_1 += values.sum_94_255_1 ;
trial.score_result_255_1;}
]
/ trialduration = 0
/ recorddata = false
</trial>

<trial score_result_255_1>
/ ontrialbegin = [
values.accuracy_255_1 = 1-(abs(list.onsets_255_1.itemcount-values.sum_acc_latencies_255_1)/list.onsets_255_1.itemcount)]
/ stimulusframes = [1=clearscreen, debug_255_1]
/ validresponse = (57)
</trial>

<text debug_255_1>
/ fontstyle = ("Trebuchet MS", 3%, false, false, false, false, 5, 1)
/ items = ("
Final Accuracy: <%values.accuracy_255_1%>%")
/ size = (60%, 40%)
</text>



<values>
/timeofresponse_250_1="";
/spacebarpresscount_250_1 ="";
/accuracy_250_1 = "";
/sum_acc_betw_250_1 ="";
/sum_acc_69_250_1 = "";
/sum_acc_94_250_1 = "";
/corrlat_250_1="";
/sum_69_250_1 =0;
/betw_250_1=0;
/sum_94_250_1 =0;
/ bucketcount_250_1 = 0;
/ sum_acc_latencies_250_1 = 0;
/lat_69_250_1 = 0;
/lat_betw_250_1 = 0;
/lat_94_250_1 = 0;
</values>

<trial 250_1>
/ ontrialbegin = [
values.spacebarpresscount_250_1 = "";
values.timeofresponse_250_1 = "";
values.accuracy_250_1 = "";
values.current_onset = "";
values.current_max = "";
values.current_min = "";
values.current_latency = "";

values.bucketcount_250_1 = 0;
values.latencycount = 0;
values.sum_counted = 0;
values.bucket_hit = 0;

values.sum_acc_latencies_250_1 = 0;

values.sum_acc_69_250_1 = 0;
values.sum_acc_betw_250_1 = 0;
values.sum_acc_94_250_1 = 0;

values.sum_69_250_1 =0;
values.betw_250_1=0;
values.sum_94_250_1 =0;

list.latencies_250_1.reset();
list.onsets_250_1.reset();
]
/pretrialpause = 1000
/stimulustimes=[
0=checker;
1000=circle_250;
2177=circle_250;
3391=circle_250;
4557=circle_250;
5699=circle_250;
6903=circle_250;
8023=circle_250;
9257=circle_250;
10352=circle_250;
11506=circle_250;
12675=circle_250;
13798=circle_250;
14992=circle_250;
1045=black_circle;
2222=black_circle;
3436=black_circle;
4602=black_circle;
5744=black_circle;
6948=black_circle;
8068=black_circle;
9302=black_circle;
10397=black_circle;
11551=black_circle;
12720=black_circle;
13843=black_circle;
15037=black_circle;

]
/ trialduration = 15037+1000
/ inputdevice = keyboard
/ beginresponsetime = -1
/ responseinterrupt = trial
/ validresponse = (-57, 0)
/ correctresponse = (0)
/ showmousecursor = false
/ isvalidresponse = [if(trial.250_1.response==57){
values.spacebarpresscount_250_1 += 1;
values.timeofresponse_250_1=concat(concat(values.timeofresponse_250_1, trial.250_1.latency),",");
list.latencies_250_1.appenditem(trial.250_1.latency);
false}
;
]
/ ontrialend = [
list.onsets_250_1.appenditem(picture.circle_250.stimulusonset.1);
list.onsets_250_1.appenditem(picture.circle_250.stimulusonset.2);
list.onsets_250_1.appenditem(picture.circle_250.stimulusonset.3);
list.onsets_250_1.appenditem(picture.circle_250.stimulusonset.4);
list.onsets_250_1.appenditem(picture.circle_250.stimulusonset.5);
list.onsets_250_1.appenditem(picture.circle_250.stimulusonset.6);
list.onsets_250_1.appenditem(picture.circle_250.stimulusonset.7);
list.onsets_250_1.appenditem(picture.circle_250.stimulusonset.8);
list.onsets_250_1.appenditem(picture.circle_250.stimulusonset.9);
list.onsets_250_1.appenditem(picture.circle_250.stimulusonset.10);
list.onsets_250_1.appenditem(picture.circle_250.stimulusonset.11);
list.onsets_250_1.appenditem(picture.circle_250.stimulusonset.12);
list.onsets_250_1.appenditem(picture.circle_250.stimulusonset.13);

list.frequency.appenditem(60/((picture.circle_250.stimulusonset.2-picture.circle_250.stimulusonset.1)/1000));
list.frequency.appenditem(60/((picture.circle_250.stimulusonset.3-picture.circle_250.stimulusonset.2)/1000));
list.frequency.appenditem(60/((picture.circle_250.stimulusonset.4-picture.circle_250.stimulusonset.3)/1000));
list.frequency.appenditem(60/((picture.circle_250.stimulusonset.5-picture.circle_250.stimulusonset.4)/1000));
list.frequency.appenditem(60/((picture.circle_250.stimulusonset.6-picture.circle_250.stimulusonset.5)/1000));
list.frequency.appenditem(60/((picture.circle_250.stimulusonset.7-picture.circle_250.stimulusonset.6)/1000));
list.frequency.appenditem(60/((picture.circle_250.stimulusonset.8-picture.circle_250.stimulusonset.7)/1000));
list.frequency.appenditem(60/((picture.circle_250.stimulusonset.9-picture.circle_250.stimulusonset.8)/1000));
list.frequency.appenditem(60/((picture.circle_250.stimulusonset.10-picture.circle_250.stimulusonset.9)/1000));
list.frequency.appenditem(60/((picture.circle_250.stimulusonset.11-picture.circle_250.stimulusonset.10)/1000));
list.frequency.appenditem(60/((picture.circle_250.stimulusonset.12-picture.circle_250.stimulusonset.11)/1000));
list.frequency.appenditem(60/((picture.circle_250.stimulusonset.13-picture.circle_250.stimulusonset.12)/1000));

list.frequency.appenditem((list.frequency.mean))

]
/ branch = [
trial.construct_bucket_250_1;
]
</trial>

<list latencies_250_1>
/ select = sequence
</list>

<list onsets_250_1>
/ select = sequence
</list>


<trial construct_bucket_250_1>
/ ontrialbegin = [
values.bucketcount_250_1 += 1;

values.bucket_hit = 0;
values.sum_counted = 0;

values.sum_acc_69_250_1 = 0;
values.sum_acc_betw_250_1 = 0;
values.sum_acc_94_250_1 = 0;
values.sum_69_250_1 =0;
values.betw_250_1=0;
values.sum_94_250_1 =0;

values.latencycount = 0;
values.current_onset = list.onsets_250_1.nextvalue;
values.current_frequency = list.frequency.nextvalue;
values.freq = concat(concat(values.freq, values.current_frequency),",");
if (values.current_frequency < 69.76) {values.current_min = values.current_onset - 125; values.current_max = values.current_onset + 750;}
else if (values.current_frequency > 69.75 && values.current_frequency <= 94.25) {values.current_min = values.current_onset - 100; values.current_max = values.current_onset + 600;}
  else if (values.current_frequency > 94.25) {values.current_min = values.current_onset - 75; values.current_max = values.current_onset + 400;};
]
/ stimulusframes = [1=clearscreen, debug_250_1]
/ branch = [
trial.check_latencies_250_1;
]
/ trialduration = 0
/ recorddata = false
</trial>

<trial check_latencies_250_1>
/ ontrialbegin = [
values.latencycount += 1;
values.current_latency = list.latencies_250_1.nextvalue;
if (values.current_latency >= values.current_min && values.current_latency <= values.current_max)
 {values.sum_counted += 1; values.corrlat_250_1 = concat(concat(values.corrlat_250_1, values.current_latency),",");};
 if(values.current_latency >= values.current_min && values.current_latency <= values.current_max && values.current_frequency < 69.76)
 {values.sum_acc_69_250_1 += 1;}
  else if(values.current_latency >= values.current_min && values.current_latency <= values.current_max && values.current_frequency > 69.75 && values.current_frequency <= 94.25){values.sum_acc_betw_250_1 += 1;}
      else if(values.current_latency >= values.current_min && values.current_latency <= values.current_max && values.current_frequency > 94.25){values.sum_acc_94_250_1 += 1;};

if (values.sum_counted >=1) {values.bucket_hit = 1} else {values.bucket_hit = 0;};
if (values.sum_acc_69_250_1 >=1) {values.sum_69_250_1 =1} else {values.sum_69_250_1=0;};
if (values.sum_acc_250_1 >=1) {values.betw_250_1 =1} else {values.betw_250_1=0;};
if (values.sum_acc_94_250_1 >=1) {values.sum_94_250_1 =1} else {values.sum_94_250_1 =0;};
]
/ stimulusframes = [1=clearscreen, debug_250_1]
/ branch = [
if (values.latencycount < list.latencies_250_1.itemcount) {trial.check_latencies_250_1;}
else if (values.bucketcount_250_1 < list.onsets_250_1.itemcount)
{values.sum_acc_latencies_250_1 += values.bucket_hit;
values.lat_69_250_1 += values.sum_69_250_1;
values.lat_betw_250_1 += values.betw_250_1;
values.lat_94_250_1 += values.sum_94_250_1 ;
trial.construct_bucket_250_1;}
else {values.sum_acc_latencies_250_1 += values.bucket_hit;
values.lat_69_250_1 += values.sum_69_250_1;
values.lat_betw_250_1 += values.betw_250_1;
values.lat_94_250_1 += values.sum_94_250_1 ;
trial.score_result_250_1;}
]
/ trialduration = 0
/ recorddata = false
</trial>

<trial score_result_250_1>
/ ontrialbegin = [
values.accuracy_250_1 = 1-(abs(list.onsets_250_1.itemcount-values.sum_acc_latencies_250_1)/list.onsets_250_1.itemcount)]
/ stimulusframes = [1=clearscreen, debug_250_1]
/ validresponse = (57)
</trial>

<text debug_250_1>
/ fontstyle = ("Trebuchet MS", 3%, false, false, false, false, 5, 1)
/ items = ("
Final Accuracy: <%values.accuracy_250_1%>%")
/ size = (60%, 40%)
</text>



<values>
/timeofresponse_245_1="";
/spacebarpresscount_245_1 ="";
/accuracy_245_1 = "";
/sum_acc_betw_245_1 ="";
/sum_acc_69_245_1 = "";
/sum_acc_94_245_1 = "";
/corrlat_245_1="";
/sum_69_245_1 =0;
/betw_245_1=0;
/sum_94_245_1 =0;
/ bucketcount_245_1 = 0;
/ sum_acc_latencies_245_1 = 0;
/lat_69_245_1 = 0;
/lat_betw_245_1 = 0;
/lat_94_245_1 = 0;
</values>

<trial 245_1>
/ ontrialbegin = [
values.spacebarpresscount_245_1 = "";
values.timeofresponse_245_1 = "";
values.accuracy_245_1 = "";
values.current_onset = "";
values.current_max = "";
values.current_min = "";
values.current_latency = "";

values.bucketcount_245_1 = 0;
values.latencycount = 0;
values.sum_counted = 0;
values.bucket_hit = 0;

values.sum_acc_latencies_245_1 = 0;

values.sum_acc_69_245_1 = 0;
values.sum_acc_betw_245_1 = 0;
values.sum_acc_94_245_1 = 0;

values.sum_69_245_1 =0;
values.betw_245_1=0;
values.sum_94_245_1 =0;

list.latencies_245_1.reset();
list.onsets_245_1.reset();
]
/pretrialpause = 1000
/stimulustimes=[
0=checker;
1000=circle_245;
2211=circle_245;
3424=circle_245;
4541=circle_245;
5704=circle_245;
6792=circle_245;
7852=circle_245;
8974=circle_245;
10021=circle_245;
11175=circle_245;
12344=circle_245;
13439=circle_245;
14574=circle_245;

1045=black_circle;
2256=black_circle;
3469=black_circle;
4586=black_circle;
5749=black_circle;
6837=black_circle;
7897=black_circle;
9019=black_circle;
10066=black_circle;
11220=black_circle;
12389=black_circle;
13484=black_circle;
14619=black_circle;


]
/ trialduration = 14619+1000
/ inputdevice = keyboard
/ beginresponsetime = -1
/ responseinterrupt = trial
/ validresponse = (-57, 0)
/ correctresponse = (0)
/ showmousecursor = false
/ isvalidresponse = [if(trial.245_1.response==57){
values.spacebarpresscount_245_1 += 1;
values.timeofresponse_245_1=concat(concat(values.timeofresponse_245_1, trial.245_1.latency),",");
list.latencies_245_1.appenditem(trial.245_1.latency);
false}
;
]
/ ontrialend = [
list.onsets_245_1.appenditem(picture.circle_245.stimulusonset.1);
list.onsets_245_1.appenditem(picture.circle_245.stimulusonset.2);
list.onsets_245_1.appenditem(picture.circle_245.stimulusonset.3);
list.onsets_245_1.appenditem(picture.circle_245.stimulusonset.4);
list.onsets_245_1.appenditem(picture.circle_245.stimulusonset.5);
list.onsets_245_1.appenditem(picture.circle_245.stimulusonset.6);
list.onsets_245_1.appenditem(picture.circle_245.stimulusonset.7);
list.onsets_245_1.appenditem(picture.circle_245.stimulusonset.8);
list.onsets_245_1.appenditem(picture.circle_245.stimulusonset.9);
list.onsets_245_1.appenditem(picture.circle_245.stimulusonset.10);
list.onsets_245_1.appenditem(picture.circle_245.stimulusonset.11);
list.onsets_245_1.appenditem(picture.circle_245.stimulusonset.12);
list.onsets_245_1.appenditem(picture.circle_245.stimulusonset.13);


list.frequency.appenditem(60/((picture.circle_245.stimulusonset.2-picture.circle_245.stimulusonset.1)/1000));
list.frequency.appenditem(60/((picture.circle_245.stimulusonset.3-picture.circle_245.stimulusonset.2)/1000));
list.frequency.appenditem(60/((picture.circle_245.stimulusonset.4-picture.circle_245.stimulusonset.3)/1000));
list.frequency.appenditem(60/((picture.circle_245.stimulusonset.5-picture.circle_245.stimulusonset.4)/1000));
list.frequency.appenditem(60/((picture.circle_245.stimulusonset.6-picture.circle_245.stimulusonset.5)/1000));
list.frequency.appenditem(60/((picture.circle_245.stimulusonset.7-picture.circle_245.stimulusonset.6)/1000));
list.frequency.appenditem(60/((picture.circle_245.stimulusonset.8-picture.circle_245.stimulusonset.7)/1000));
list.frequency.appenditem(60/((picture.circle_245.stimulusonset.9-picture.circle_245.stimulusonset.8)/1000));
list.frequency.appenditem(60/((picture.circle_245.stimulusonset.10-picture.circle_245.stimulusonset.9)/1000));
list.frequency.appenditem(60/((picture.circle_245.stimulusonset.11-picture.circle_245.stimulusonset.10)/1000));
list.frequency.appenditem(60/((picture.circle_245.stimulusonset.12-picture.circle_245.stimulusonset.11)/1000));
list.frequency.appenditem(60/((picture.circle_245.stimulusonset.13-picture.circle_245.stimulusonset.12)/1000));


list.frequency.appenditem((list.frequency.mean))

]
/ branch = [
trial.construct_bucket_245_1;
]
</trial>

<list latencies_245_1>
/ select = sequence
</list>

<list onsets_245_1>
/ select = sequence
</list>


<trial construct_bucket_245_1>
/ ontrialbegin = [
values.bucketcount_245_1 += 1;

values.bucket_hit = 0;
values.sum_counted = 0;

values.sum_acc_69_245_1 = 0;
values.sum_acc_betw_245_1 = 0;
values.sum_acc_94_245_1 = 0;
values.sum_69_245_1 =0;
values.betw_245_1=0;
values.sum_94_245_1 =0;

values.latencycount = 0;
values.current_onset = list.onsets_245_1.nextvalue;
values.current_frequency = list.frequency.nextvalue;
values.freq = concat(concat(values.freq, values.current_frequency),",");
if (values.current_frequency < 69.76) {values.current_min = values.current_onset - 125; values.current_max = values.current_onset + 750;}
else if (values.current_frequency > 69.75 && values.current_frequency <= 94.25) {values.current_min = values.current_onset - 100; values.current_max = values.current_onset + 600;}
  else if (values.current_frequency > 94.25) {values.current_min = values.current_onset - 75; values.current_max = values.current_onset + 400;};
]
/ stimulusframes = [1=clearscreen, debug_245_1]
/ branch = [
trial.check_latencies_245_1;
]
/ trialduration = 0
/ recorddata = false
</trial>

<trial check_latencies_245_1>
/ ontrialbegin = [
values.latencycount += 1;
values.current_latency = list.latencies_245_1.nextvalue;
if (values.current_latency >= values.current_min && values.current_latency <= values.current_max)
 {values.sum_counted += 1; values.corrlat_245_1 = concat(concat(values.corrlat_245_1, values.current_latency),",");};
 if(values.current_latency >= values.current_min && values.current_latency <= values.current_max && values.current_frequency < 69.76)
 {values.sum_acc_69_245_1 += 1;}
  else if(values.current_latency >= values.current_min && values.current_latency <= values.current_max && values.current_frequency > 69.75 && values.current_frequency <= 94.25){values.sum_acc_betw_245_1 += 1;}
      else if(values.current_latency >= values.current_min && values.current_latency <= values.current_max && values.current_frequency > 94.25){values.sum_acc_94_245_1 += 1;};

if (values.sum_counted >=1) {values.bucket_hit = 1} else {values.bucket_hit = 0;};
if (values.sum_acc_69_245_1 >=1) {values.sum_69_245_1 =1} else {values.sum_69_245_1=0;};
if (values.sum_acc_245_1 >=1) {values.betw_245_1 =1} else {values.betw_245_1=0;};
if (values.sum_acc_94_245_1 >=1) {values.sum_94_245_1 =1} else {values.sum_94_245_1 =0;};
]
/ stimulusframes = [1=clearscreen, debug_245_1]
/ branch = [
if (values.latencycount < list.latencies_245_1.itemcount) {trial.check_latencies_245_1;}
else if (values.bucketcount_245_1 < list.onsets_245_1.itemcount)
{values.sum_acc_latencies_245_1 += values.bucket_hit;
values.lat_69_245_1 += values.sum_69_245_1;
values.lat_betw_245_1 += values.betw_245_1;
values.lat_94_245_1 += values.sum_94_245_1 ;
trial.construct_bucket_245_1;}
else {values.sum_acc_latencies_245_1 += values.bucket_hit;
values.lat_69_245_1 += values.sum_69_245_1;
values.lat_betw_245_1 += values.betw_245_1;
values.lat_94_245_1 += values.sum_94_245_1 ;
trial.score_result_245_1;}
]
/ trialduration = 0
/ recorddata = false
</trial>

<trial score_result_245_1>
/ ontrialbegin = [
values.accuracy_245_1 = 1-(abs(list.onsets_245_1.itemcount-values.sum_acc_latencies_245_1)/list.onsets_245_1.itemcount)]
/ stimulusframes = [1=clearscreen, debug_245_1]
/ validresponse = (57)
</trial>

<text debug_245_1>
/ fontstyle = ("Trebuchet MS", 3%, false, false, false, false, 5, 1)
/ items = ("
Final Accuracy: <%values.accuracy_245_1%>%")
/ size = (60%, 40%)
</text>



<block prepre>
/ trials = [1=60hz; 2=instructions1; 3=instructions2]
</block>

<block pre>
/ trials = [1=fixate; 2=blank]
</block>

<block acc>
/ trials = [1=255_1;2=250_1]
</block>

<expt >
/blocks=[
1=prepre;2=pre;3=acc;
]
</expt>

<data>
/ columns = [date,time,group,subject, display.refreshrate, display.canvaswidth, display.canvasheight, trialduration,
values.sum_acc_latencies_255_1,
values.accuracy_255_1,
values.timeofresponse_255_1,
values.spacebarpresscount_255_1,values.corrlat_255_1,
values.lat_69_255_1,
values.lat_betw_255_1,
values.lat_94_255_1 ,

values.sum_acc_latencies_250_1,
values.accuracy_250_1,
values.timeofresponse_250_1,
values.spacebarpresscount_250_1,values.corrlat_250_1,
values.lat_69_250_1,
values.lat_betw_250_1,
values.lat_94_250_1 ,

values.sum_acc_latencies_245_1,
values.accuracy_245_1,
values.timeofresponse_245_1,
values.spacebarpresscount_245_1,values.corrlat_245_1,
values.lat_69_245_1,
values.lat_betw_245_1,
values.lat_94_245_1 ,

picture.circle_255.stimulusonset.1,
picture.circle_255.stimulusonset.2,
picture.circle_255.stimulusonset.3,
picture.circle_255.stimulusonset.4,
picture.circle_255.stimulusonset.5,
picture.circle_255.stimulusonset.6,
picture.circle_255.stimulusonset.7,
picture.circle_255.stimulusonset.8,
picture.circle_255.stimulusonset.9,
picture.circle_255.stimulusonset.10,
picture.circle_255.stimulusonset.11,
picture.circle_255.stimulusonset.12,

picture.circle_250.stimulusonset.1,
picture.circle_250.stimulusonset.2,
picture.circle_250.stimulusonset.3,
picture.circle_250.stimulusonset.4,
picture.circle_250.stimulusonset.5,
picture.circle_250.stimulusonset.6,
picture.circle_250.stimulusonset.7,
picture.circle_250.stimulusonset.8,
picture.circle_250.stimulusonset.9,
picture.circle_250.stimulusonset.10,
picture.circle_250.stimulusonset.11,
picture.circle_250.stimulusonset.12,
picture.circle_250.stimulusonset.13,

picture.circle_245.stimulusonset.1,
picture.circle_245.stimulusonset.2,
picture.circle_245.stimulusonset.3,
picture.circle_245.stimulusonset.4,
picture.circle_245.stimulusonset.5,
picture.circle_245.stimulusonset.6,
picture.circle_245.stimulusonset.7,
picture.circle_245.stimulusonset.8,
picture.circle_245.stimulusonset.9,
picture.circle_245.stimulusonset.10,
picture.circle_245.stimulusonset.11,
picture.circle_245.stimulusonset.12,
picture.circle_245.stimulusonset.13,

picture.black_circle.stimulusonset.1,    
picture.black_circle.stimulusonset.2,    
picture.black_circle.stimulusonset.3,    
picture.black_circle.stimulusonset.4,    
picture.black_circle.stimulusonset.5,    
picture.black_circle.stimulusonset.6,    
picture.black_circle.stimulusonset.7,    
picture.black_circle.stimulusonset.8,    
picture.black_circle.stimulusonset.9,    
picture.black_circle.stimulusonset.10,    
picture.black_circle.stimulusonset.11,    
picture.black_circle.stimulusonset.12,    

]
</data>

<defaults>
/ screencolor = (195,195,195)
/ txbgcolor = (195,195,195)
/ txcolor = white
</defaults>

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
eleonora_parr - 4 Years Ago
Dave - 4 Years Ago
Dave - 4 Years Ago
eleonora_parr - 4 Years Ago
                     Sorry, the last file was missing!
eleonora_parr - 4 Years Ago
                         > So, the idea would be to increase/decrease the RGB code according...
Dave - 4 Years Ago
                             So for now I've got all the levels repeated just once (one trial per...
eleonora_parr - 4 Years Ago
                                 > Moreover, I would not be able to know which trial would be...
Dave - 4 Years Ago
                                     Yes, that is absolutely a great solution. The only problem that I see...
eleonora_parr - 4 Years Ago
                                         Each trial gets its own row in the raw data file, so nothing is...
Dave - 4 Years Ago
                                             I had no idea!! Thank you so much Dave, I never thought that I could...
eleonora_parr - 4 Years Ago
                                             + x [quote] [b] Dave - 4/9/2021 [/b] + x [quote]...
eleonora_parr - 4 Years Ago
                                                 If there is a question here, it's not visible.
Dave - 4 Years Ago
                                                 Dear Dave, I followed all your advices but I’ve kept doing the task on...
eleonora_parr - 4 Years Ago
                                                     > - The new variable should increase by one within the trial score...
Dave - 4 Years Ago
                                                         I've changed /branch = [ if (values.hoping_variable >= 2)...
eleonora_parr - 4 Years Ago
                                                             You need *both* /ontrialend AND /branch. Update your variables...
Dave - 4 Years Ago
                                                                 + x [quote] [b] Dave - 4/14/2021 [/b] + x...
Dave - 4 Years Ago
                                                                     Oh thank you Dave!!! I have been fighting with it for such a long...
eleonora_parr - 4 Years Ago

Reading This Topic

Explore
Messages
Mentions
Search