Can we call specific items in lists / values ?


Author
Message
eleonora_parr
eleonora_parr
Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)
Group: Forum Members
Posts: 34, Visits: 134
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>

Dave
Dave
Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)
Group: Administrators
Posts: 11K, Visits: 68K
(1) Please do not paste entire scripts into a post's body. Instead attach the file(s).
(2) Whenever your script requires external files to run, provide those files along with the script.
(3) Be more specific with your questions, please. What exactly are you unsure how to do?

Dave
Dave
Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)
Group: Administrators
Posts: 11K, Visits: 68K
Dave - 4/8/2021
(1) Please do not paste entire scripts into a post's body. Instead attach the file(s).
(2) Whenever your script requires external files to run, provide those files along with the script.
(3) Be more specific with your questions, please. What exactly are you unsure how to do?

Side note: It's an absolutely terrible idea to implement each "level" as a separate trial if the only difference between levels is the color of the circle. Is there any reason why you chose to do so, that I'm not catching?

Further, the levels you describe here:

> 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)

do not correspond to what's in the code. There's no circle at 230, no circle at 240, and then there are gradations not mentioned in the above (e.g. 225, 235, 245).

<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>


What's the deal with that?

eleonora_parr
eleonora_parr
Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)
Group: Forum Members
Posts: 34, Visits: 134
Dave - 4/8/2021
Dave - 4/8/2021
(1) Please do not paste entire scripts into a post's body. Instead attach the file(s).
(2) Whenever your script requires external files to run, provide those files along with the script.
(3) Be more specific with your questions, please. What exactly are you unsure how to do?

Side note: It's an absolutely terrible idea to implement each "level" as a separate trial if the only difference between levels is the color of the circle. Is there any reason why you chose to do so, that I'm not catching?

Further, the levels you describe here:

> 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)

do not correspond to what's in the code. There's no circle at 230, no circle at 240, and then there are gradations not mentioned in the above (e.g. 225, 235, 245).

<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>


What's the deal with that?

Dear Dave,
Thank you very much for your reply and sorry for the inconvenient : I’ve uploaded all the files here. If there's any problem in downloading them I also shared it at this link: https://we.tl/t-a7ItMbx1jX
Sorry for being not very clear.
You’re completely right, this is probably a terrible idea, but I would not know how to shorten this code and avoid having different trials for each level of difficulty, I explain you why:
-    Each level/different RGB code has its own timing (stimulustimes) at which the circle is presented. Then, for each level, the frequency rate at which the circle is presented is calculated. According to the “current frequency”, construct_bucket builds different time ranges within which the response given by the subject is considered correct (i.e. if the frequency is < 69.76, then a response is considered correct if that fell in a range between -750 and 125 ms compared to the appearance of the circle… etc..). So, I would not know how unify trials that have
-different timings (onsets), different latencies and different frequencies (plus, the list.frequency is resetted at the beginning of each trial, which makes possible to update the values everytime a new trial with new timings/onsets is presented)
- I would not really need all these different construct_bucket and check_latencies, but I kept them because I want to save/store all these variables for each level:
values.sum_acc_latencies_255_1, (number of correct responses)
values.accuracy_255_1, (the single accuracy for that single level of difficulty)
values.timeofresponse_255_1, (all latencies – timing of each given response)
values.spacebarpresscount_255_1, (number of spacebar presses)
values.corrlat_255_1, (values – timing of each response that has been considered correct)
values.lat_69_255_1, (correct responses correspondent to a frequency<69.76)
values.lat_betw_255_1, (correct responses correspondent to a 69.76<frequency<94.25)
values.lat_94_255_1 , (correct responses correspondent to a frequency<94.25)
-I would not really need either all these different “score_result” – participants will not be provided with feedback, but I kept it as an inter trial interval.
Finally, what do I need to do next:
All these levels should not be presented sequentially as they are now. Instead, I would need to
-    Start from the medium level (230). Then, according to the subject’s performance, a different trial should be presented: the ratio of this psychophysics is to get a STABLE performance between 0.78 and 0.82 of accuracy
-    So, if the performance was too poor/low (below 0.78)  present a trial with an higher/brighter RGB code (i.e. make the task easier)
-    If the performance was too high (above 0.82)  present a trial with a lower RGB code (i.e. make the task harder)
-    If the performance fell in the correct range that we want (between 0.78 and 0.82), then repeat that trial with that level of RGB code that produced that ideal performance and check if the subject reached the same level of accuracy TWICE (a performance is considered stable if the subject get the same level/range of accuracy TWO CONSECUTIVE TIMES with the same level of RGB code)
So, the idea would be to increase/decrease the RGB code according to a poor/high performance respectively OR to repeat the same trial (same RGB code) if that performance was in our ideal range . When the subject get two consecutive close accuracies with the same RGB code which fell in the ideal range the psychophysics is over (i.e. we identified the specific level of RGB code with which the subject demonstrated to perform stably (two consecutive times) at a range of accuracy between 0.78 and 0.82).
The thing is that this “game“ should be played for the whole psychophysics. So for each level I ‘ d probably need a conditional statement which says something like “ if the previous performance was too low, display the easier level, if it was too high, display the harder level. Finally, if it was ideal (0.78-0.82) repeat this trial and check if the subject gets again the same result/accuracy. If the same trial is repeated and the subject gets a different performance (for example, he got used to the RGB code and the second time he gets a better performance which overcomes 0.82, then re-start to decrease the contrast and so on..)
I hope that this was clear enough, and thank you again very much for all your support, Dave!
Eleonora

Attachments
SPERIAMO.iqx (14 views, 83.00 KB)
200.png (12 views, 37.00 KB)
210.png (15 views, 37.00 KB)
220.png (15 views, 37.00 KB)
230.png (11 views, 37.00 KB)
240.png (10 views, 37.00 KB)
245.png (16 views, 37.00 KB)
250.png (13 views, 37.00 KB)
255.png (10 views, 37.00 KB)
scacchieracc.png (9 views, 31.00 KB)
eleonora_parr
eleonora_parr
Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)
Group: Forum Members
Posts: 34, Visits: 134
eleonora_parr - 4/9/2021
Dave - 4/8/2021
Dave - 4/8/2021
(1) Please do not paste entire scripts into a post's body. Instead attach the file(s).
(2) Whenever your script requires external files to run, provide those files along with the script.
(3) Be more specific with your questions, please. What exactly are you unsure how to do?

Side note: It's an absolutely terrible idea to implement each "level" as a separate trial if the only difference between levels is the color of the circle. Is there any reason why you chose to do so, that I'm not catching?

Further, the levels you describe here:

> 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)

do not correspond to what's in the code. There's no circle at 230, no circle at 240, and then there are gradations not mentioned in the above (e.g. 225, 235, 245).

<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>


What's the deal with that?

Dear Dave,
Thank you very much for your reply and sorry for the inconvenient : I’ve uploaded all the files here. If there's any problem in downloading them I also shared it at this link: https://we.tl/t-a7ItMbx1jX
Sorry for being not very clear.
You’re completely right, this is probably a terrible idea, but I would not know how to shorten this code and avoid having different trials for each level of difficulty, I explain you why:
-    Each level/different RGB code has its own timing (stimulustimes) at which the circle is presented. Then, for each level, the frequency rate at which the circle is presented is calculated. According to the “current frequency”, construct_bucket builds different time ranges within which the response given by the subject is considered correct (i.e. if the frequency is < 69.76, then a response is considered correct if that fell in a range between -750 and 125 ms compared to the appearance of the circle… etc..). So, I would not know how unify trials that have
-different timings (onsets), different latencies and different frequencies (plus, the list.frequency is resetted at the beginning of each trial, which makes possible to update the values everytime a new trial with new timings/onsets is presented)
- I would not really need all these different construct_bucket and check_latencies, but I kept them because I want to save/store all these variables for each level:
values.sum_acc_latencies_255_1, (number of correct responses)
values.accuracy_255_1, (the single accuracy for that single level of difficulty)
values.timeofresponse_255_1, (all latencies – timing of each given response)
values.spacebarpresscount_255_1, (number of spacebar presses)
values.corrlat_255_1, (values – timing of each response that has been considered correct)
values.lat_69_255_1, (correct responses correspondent to a frequency<69.76)
values.lat_betw_255_1, (correct responses correspondent to a 69.76<frequency<94.25)
values.lat_94_255_1 , (correct responses correspondent to a frequency<94.25)
-I would not really need either all these different “score_result” – participants will not be provided with feedback, but I kept it as an inter trial interval.
Finally, what do I need to do next:
All these levels should not be presented sequentially as they are now. Instead, I would need to
-    Start from the medium level (230). Then, according to the subject’s performance, a different trial should be presented: the ratio of this psychophysics is to get a STABLE performance between 0.78 and 0.82 of accuracy
-    So, if the performance was too poor/low (below 0.78)  present a trial with an higher/brighter RGB code (i.e. make the task easier)
-    If the performance was too high (above 0.82)  present a trial with a lower RGB code (i.e. make the task harder)
-    If the performance fell in the correct range that we want (between 0.78 and 0.82), then repeat that trial with that level of RGB code that produced that ideal performance and check if the subject reached the same level of accuracy TWICE (a performance is considered stable if the subject get the same level/range of accuracy TWO CONSECUTIVE TIMES with the same level of RGB code)
So, the idea would be to increase/decrease the RGB code according to a poor/high performance respectively OR to repeat the same trial (same RGB code) if that performance was in our ideal range . When the subject get two consecutive close accuracies with the same RGB code which fell in the ideal range the psychophysics is over (i.e. we identified the specific level of RGB code with which the subject demonstrated to perform stably (two consecutive times) at a range of accuracy between 0.78 and 0.82).
The thing is that this “game“ should be played for the whole psychophysics. So for each level I ‘ d probably need a conditional statement which says something like “ if the previous performance was too low, display the easier level, if it was too high, display the harder level. Finally, if it was ideal (0.78-0.82) repeat this trial and check if the subject gets again the same result/accuracy. If the same trial is repeated and the subject gets a different performance (for example, he got used to the RGB code and the second time he gets a better performance which overcomes 0.82, then re-start to decrease the contrast and so on..)
I hope that this was clear enough, and thank you again very much for all your support, Dave!
Eleonora

Sorry, the last file was missing!


Attachments
245.png (10 views, 37.00 KB)
Dave
Dave
Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)
Group: Administrators
Posts: 11K, Visits: 68K
eleonora_parr - 4/9/2021
eleonora_parr - 4/9/2021
Dave - 4/8/2021
Dave - 4/8/2021
(1) Please do not paste entire scripts into a post's body. Instead attach the file(s).
(2) Whenever your script requires external files to run, provide those files along with the script.
(3) Be more specific with your questions, please. What exactly are you unsure how to do?

Side note: It's an absolutely terrible idea to implement each "level" as a separate trial if the only difference between levels is the color of the circle. Is there any reason why you chose to do so, that I'm not catching?

Further, the levels you describe here:

> 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)

do not correspond to what's in the code. There's no circle at 230, no circle at 240, and then there are gradations not mentioned in the above (e.g. 225, 235, 245).

<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>


What's the deal with that?

Dear Dave,
Thank you very much for your reply and sorry for the inconvenient : I’ve uploaded all the files here. If there's any problem in downloading them I also shared it at this link: https://we.tl/t-a7ItMbx1jX
Sorry for being not very clear.
You’re completely right, this is probably a terrible idea, but I would not know how to shorten this code and avoid having different trials for each level of difficulty, I explain you why:
-    Each level/different RGB code has its own timing (stimulustimes) at which the circle is presented. Then, for each level, the frequency rate at which the circle is presented is calculated. According to the “current frequency”, construct_bucket builds different time ranges within which the response given by the subject is considered correct (i.e. if the frequency is < 69.76, then a response is considered correct if that fell in a range between -750 and 125 ms compared to the appearance of the circle… etc..). So, I would not know how unify trials that have
-different timings (onsets), different latencies and different frequencies (plus, the list.frequency is resetted at the beginning of each trial, which makes possible to update the values everytime a new trial with new timings/onsets is presented)
- I would not really need all these different construct_bucket and check_latencies, but I kept them because I want to save/store all these variables for each level:
values.sum_acc_latencies_255_1, (number of correct responses)
values.accuracy_255_1, (the single accuracy for that single level of difficulty)
values.timeofresponse_255_1, (all latencies – timing of each given response)
values.spacebarpresscount_255_1, (number of spacebar presses)
values.corrlat_255_1, (values – timing of each response that has been considered correct)
values.lat_69_255_1, (correct responses correspondent to a frequency<69.76)
values.lat_betw_255_1, (correct responses correspondent to a 69.76<frequency<94.25)
values.lat_94_255_1 , (correct responses correspondent to a frequency<94.25)
-I would not really need either all these different “score_result” – participants will not be provided with feedback, but I kept it as an inter trial interval.
Finally, what do I need to do next:
All these levels should not be presented sequentially as they are now. Instead, I would need to
-    Start from the medium level (230). Then, according to the subject’s performance, a different trial should be presented: the ratio of this psychophysics is to get a STABLE performance between 0.78 and 0.82 of accuracy
-    So, if the performance was too poor/low (below 0.78)  present a trial with an higher/brighter RGB code (i.e. make the task easier)
-    If the performance was too high (above 0.82)  present a trial with a lower RGB code (i.e. make the task harder)
-    If the performance fell in the correct range that we want (between 0.78 and 0.82), then repeat that trial with that level of RGB code that produced that ideal performance and check if the subject reached the same level of accuracy TWICE (a performance is considered stable if the subject get the same level/range of accuracy TWO CONSECUTIVE TIMES with the same level of RGB code)
So, the idea would be to increase/decrease the RGB code according to a poor/high performance respectively OR to repeat the same trial (same RGB code) if that performance was in our ideal range . When the subject get two consecutive close accuracies with the same RGB code which fell in the ideal range the psychophysics is over (i.e. we identified the specific level of RGB code with which the subject demonstrated to perform stably (two consecutive times) at a range of accuracy between 0.78 and 0.82).
The thing is that this “game“ should be played for the whole psychophysics. So for each level I ‘ d probably need a conditional statement which says something like “ if the previous performance was too low, display the easier level, if it was too high, display the harder level. Finally, if it was ideal (0.78-0.82) repeat this trial and check if the subject gets again the same result/accuracy. If the same trial is repeated and the subject gets a different performance (for example, he got used to the RGB code and the second time he gets a better performance which overcomes 0.82, then re-start to decrease the contrast and so on..)
I hope that this was clear enough, and thank you again very much for all your support, Dave!
Eleonora

Sorry, the last file was missing!


> So, the idea would be to increase/decrease the RGB code according to a poor/high performance respectively OR to repeat the same trial (same RGB code) if that performance was in our ideal range . When the subject get two consecutive close accuracies with the same RGB code which fell in the ideal range the psychophysics is over (i.e. we identified the specific level of RGB code with which the subject demonstrated to perform stably (two consecutive times) at a range of accuracy between 0.78 and 0.82).
The thing is that this “game“ should be played for the whole psychophysics. So for each level I ‘ d probably need a conditional statement which says something like “ if the previous performance was too low, display the easier level, if it was too high, display the harder level. Finally, if it was ideal (0.78-0.82) repeat this trial and check if the subject gets again the same result/accuracy. If the same trial is repeated and the subject gets a different performance (for example, he got used to the RGB code and the second time he gets a better performance which overcomes 0.82, then re-start to decrease the contrast and so on..)

Here's the thing I can't quite get my head around: If you understand your current code, you already know how to do all this. The current code contains all the necessary ingredients, it already does things like all of the above, make conditional decisions, /branch accordingly, etc.

Basically, I'm not sure what exactly I need to explain to you, and some general description does not tell me. I could certainly simply implement the changes, but I'd rather have you get to a point where you can do so yourself.

So again: What -- in terms of code -- is unclear to you regarding the above?

Edited Last Month by Dave
eleonora_parr
eleonora_parr
Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)
Group: Forum Members
Posts: 34, Visits: 134
Dave - 4/9/2021
eleonora_parr - 4/9/2021
eleonora_parr - 4/9/2021
Dave - 4/8/2021
Dave - 4/8/2021
(1) Please do not paste entire scripts into a post's body. Instead attach the file(s).
(2) Whenever your script requires external files to run, provide those files along with the script.
(3) Be more specific with your questions, please. What exactly are you unsure how to do?

Side note: It's an absolutely terrible idea to implement each "level" as a separate trial if the only difference between levels is the color of the circle. Is there any reason why you chose to do so, that I'm not catching?

Further, the levels you describe here:

> 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)

do not correspond to what's in the code. There's no circle at 230, no circle at 240, and then there are gradations not mentioned in the above (e.g. 225, 235, 245).

<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>


What's the deal with that?

Dear Dave,
Thank you very much for your reply and sorry for the inconvenient : I’ve uploaded all the files here. If there's any problem in downloading them I also shared it at this link: https://we.tl/t-a7ItMbx1jX
Sorry for being not very clear.
You’re completely right, this is probably a terrible idea, but I would not know how to shorten this code and avoid having different trials for each level of difficulty, I explain you why:
-    Each level/different RGB code has its own timing (stimulustimes) at which the circle is presented. Then, for each level, the frequency rate at which the circle is presented is calculated. According to the “current frequency”, construct_bucket builds different time ranges within which the response given by the subject is considered correct (i.e. if the frequency is < 69.76, then a response is considered correct if that fell in a range between -750 and 125 ms compared to the appearance of the circle… etc..). So, I would not know how unify trials that have
-different timings (onsets), different latencies and different frequencies (plus, the list.frequency is resetted at the beginning of each trial, which makes possible to update the values everytime a new trial with new timings/onsets is presented)
- I would not really need all these different construct_bucket and check_latencies, but I kept them because I want to save/store all these variables for each level:
values.sum_acc_latencies_255_1, (number of correct responses)
values.accuracy_255_1, (the single accuracy for that single level of difficulty)
values.timeofresponse_255_1, (all latencies – timing of each given response)
values.spacebarpresscount_255_1, (number of spacebar presses)
values.corrlat_255_1, (values – timing of each response that has been considered correct)
values.lat_69_255_1, (correct responses correspondent to a frequency<69.76)
values.lat_betw_255_1, (correct responses correspondent to a 69.76<frequency<94.25)
values.lat_94_255_1 , (correct responses correspondent to a frequency<94.25)
-I would not really need either all these different “score_result” – participants will not be provided with feedback, but I kept it as an inter trial interval.
Finally, what do I need to do next:
All these levels should not be presented sequentially as they are now. Instead, I would need to
-    Start from the medium level (230). Then, according to the subject’s performance, a different trial should be presented: the ratio of this psychophysics is to get a STABLE performance between 0.78 and 0.82 of accuracy
-    So, if the performance was too poor/low (below 0.78)  present a trial with an higher/brighter RGB code (i.e. make the task easier)
-    If the performance was too high (above 0.82)  present a trial with a lower RGB code (i.e. make the task harder)
-    If the performance fell in the correct range that we want (between 0.78 and 0.82), then repeat that trial with that level of RGB code that produced that ideal performance and check if the subject reached the same level of accuracy TWICE (a performance is considered stable if the subject get the same level/range of accuracy TWO CONSECUTIVE TIMES with the same level of RGB code)
So, the idea would be to increase/decrease the RGB code according to a poor/high performance respectively OR to repeat the same trial (same RGB code) if that performance was in our ideal range . When the subject get two consecutive close accuracies with the same RGB code which fell in the ideal range the psychophysics is over (i.e. we identified the specific level of RGB code with which the subject demonstrated to perform stably (two consecutive times) at a range of accuracy between 0.78 and 0.82).
The thing is that this “game“ should be played for the whole psychophysics. So for each level I ‘ d probably need a conditional statement which says something like “ if the previous performance was too low, display the easier level, if it was too high, display the harder level. Finally, if it was ideal (0.78-0.82) repeat this trial and check if the subject gets again the same result/accuracy. If the same trial is repeated and the subject gets a different performance (for example, he got used to the RGB code and the second time he gets a better performance which overcomes 0.82, then re-start to decrease the contrast and so on..)
I hope that this was clear enough, and thank you again very much for all your support, Dave!
Eleonora

Sorry, the last file was missing!


> So, the idea would be to increase/decrease the RGB code according to a poor/high performance respectively OR to repeat the same trial (same RGB code) if that performance was in our ideal range . When the subject get two consecutive close accuracies with the same RGB code which fell in the ideal range the psychophysics is over (i.e. we identified the specific level of RGB code with which the subject demonstrated to perform stably (two consecutive times) at a range of accuracy between 0.78 and 0.82).
The thing is that this “game“ should be played for the whole psychophysics. So for each level I ‘ d probably need a conditional statement which says something like “ if the previous performance was too low, display the easier level, if it was too high, display the harder level. Finally, if it was ideal (0.78-0.82) repeat this trial and check if the subject gets again the same result/accuracy. If the same trial is repeated and the subject gets a different performance (for example, he got used to the RGB code and the second time he gets a better performance which overcomes 0.82, then re-start to decrease the contrast and so on..)

Here's the thing I can't quite get my head around: If you understand your current code, you already know how to do all this. The current code contains all the necessary ingredients, it already does things like all of the above, make conditional decisions, /branch accordingly, etc.

Basically, I'm not sure what exactly I need to explain to you, and some general description does not tell me. I could certainly simply implement the changes, but I'd rather have you get to a point where you can do so yourself.

So again: What -- in terms of code -- is unclear to you regarding the above?
So for now I've got all the levels repeated just once (one trial per level/rgb code). As I explained, the same trial could be repeated more times, so that the values in the accuracy would be replaced by the new calculation. Moreover, I would not be able to know which trial would be displayed next - as also this depends by the subject's performance. 
I imagined that the only way to implement a conditional statement that does what I described would be to have an additive list/values that append all the accuracies calculated in the experiment everytime, and then say to the code "if the previous and the current values/ accuracies are in my ideal range, then do that.. "
But to do so, I should be able to call the position of specific items in the list / values, because I'd need to specify that I want two consecutive (ideal) scores and that those scores should be associated to a unique level of contrast (always the same rgb code). I have no idea of how to implement that, also because for what I know, we can't call specific position of values/items in a list.. 
Thank you again, Dave. Hope that you can help me and open up my mind :crying: :crazy:

ele

Dave
Dave
Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)
Group: Administrators
Posts: 11K, Visits: 68K
eleonora_parr - 4/9/2021
Dave - 4/9/2021
eleonora_parr - 4/9/2021
eleonora_parr - 4/9/2021
Dave - 4/8/2021
Dave - 4/8/2021
(1) Please do not paste entire scripts into a post's body. Instead attach the file(s).
(2) Whenever your script requires external files to run, provide those files along with the script.
(3) Be more specific with your questions, please. What exactly are you unsure how to do?

Side note: It's an absolutely terrible idea to implement each "level" as a separate trial if the only difference between levels is the color of the circle. Is there any reason why you chose to do so, that I'm not catching?

Further, the levels you describe here:

> 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)

do not correspond to what's in the code. There's no circle at 230, no circle at 240, and then there are gradations not mentioned in the above (e.g. 225, 235, 245).

<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>


What's the deal with that?

Dear Dave,
Thank you very much for your reply and sorry for the inconvenient : I’ve uploaded all the files here. If there's any problem in downloading them I also shared it at this link: https://we.tl/t-a7ItMbx1jX
Sorry for being not very clear.
You’re completely right, this is probably a terrible idea, but I would not know how to shorten this code and avoid having different trials for each level of difficulty, I explain you why:
-    Each level/different RGB code has its own timing (stimulustimes) at which the circle is presented. Then, for each level, the frequency rate at which the circle is presented is calculated. According to the “current frequency”, construct_bucket builds different time ranges within which the response given by the subject is considered correct (i.e. if the frequency is < 69.76, then a response is considered correct if that fell in a range between -750 and 125 ms compared to the appearance of the circle… etc..). So, I would not know how unify trials that have
-different timings (onsets), different latencies and different frequencies (plus, the list.frequency is resetted at the beginning of each trial, which makes possible to update the values everytime a new trial with new timings/onsets is presented)
- I would not really need all these different construct_bucket and check_latencies, but I kept them because I want to save/store all these variables for each level:
values.sum_acc_latencies_255_1, (number of correct responses)
values.accuracy_255_1, (the single accuracy for that single level of difficulty)
values.timeofresponse_255_1, (all latencies – timing of each given response)
values.spacebarpresscount_255_1, (number of spacebar presses)
values.corrlat_255_1, (values – timing of each response that has been considered correct)
values.lat_69_255_1, (correct responses correspondent to a frequency<69.76)
values.lat_betw_255_1, (correct responses correspondent to a 69.76<frequency<94.25)
values.lat_94_255_1 , (correct responses correspondent to a frequency<94.25)
-I would not really need either all these different “score_result” – participants will not be provided with feedback, but I kept it as an inter trial interval.
Finally, what do I need to do next:
All these levels should not be presented sequentially as they are now. Instead, I would need to
-    Start from the medium level (230). Then, according to the subject’s performance, a different trial should be presented: the ratio of this psychophysics is to get a STABLE performance between 0.78 and 0.82 of accuracy
-    So, if the performance was too poor/low (below 0.78)  present a trial with an higher/brighter RGB code (i.e. make the task easier)
-    If the performance was too high (above 0.82)  present a trial with a lower RGB code (i.e. make the task harder)
-    If the performance fell in the correct range that we want (between 0.78 and 0.82), then repeat that trial with that level of RGB code that produced that ideal performance and check if the subject reached the same level of accuracy TWICE (a performance is considered stable if the subject get the same level/range of accuracy TWO CONSECUTIVE TIMES with the same level of RGB code)
So, the idea would be to increase/decrease the RGB code according to a poor/high performance respectively OR to repeat the same trial (same RGB code) if that performance was in our ideal range . When the subject get two consecutive close accuracies with the same RGB code which fell in the ideal range the psychophysics is over (i.e. we identified the specific level of RGB code with which the subject demonstrated to perform stably (two consecutive times) at a range of accuracy between 0.78 and 0.82).
The thing is that this “game“ should be played for the whole psychophysics. So for each level I ‘ d probably need a conditional statement which says something like “ if the previous performance was too low, display the easier level, if it was too high, display the harder level. Finally, if it was ideal (0.78-0.82) repeat this trial and check if the subject gets again the same result/accuracy. If the same trial is repeated and the subject gets a different performance (for example, he got used to the RGB code and the second time he gets a better performance which overcomes 0.82, then re-start to decrease the contrast and so on..)
I hope that this was clear enough, and thank you again very much for all your support, Dave!
Eleonora

Sorry, the last file was missing!


> So, the idea would be to increase/decrease the RGB code according to a poor/high performance respectively OR to repeat the same trial (same RGB code) if that performance was in our ideal range . When the subject get two consecutive close accuracies with the same RGB code which fell in the ideal range the psychophysics is over (i.e. we identified the specific level of RGB code with which the subject demonstrated to perform stably (two consecutive times) at a range of accuracy between 0.78 and 0.82).
The thing is that this “game“ should be played for the whole psychophysics. So for each level I ‘ d probably need a conditional statement which says something like “ if the previous performance was too low, display the easier level, if it was too high, display the harder level. Finally, if it was ideal (0.78-0.82) repeat this trial and check if the subject gets again the same result/accuracy. If the same trial is repeated and the subject gets a different performance (for example, he got used to the RGB code and the second time he gets a better performance which overcomes 0.82, then re-start to decrease the contrast and so on..)

Here's the thing I can't quite get my head around: If you understand your current code, you already know how to do all this. The current code contains all the necessary ingredients, it already does things like all of the above, make conditional decisions, /branch accordingly, etc.

Basically, I'm not sure what exactly I need to explain to you, and some general description does not tell me. I could certainly simply implement the changes, but I'd rather have you get to a point where you can do so yourself.

So again: What -- in terms of code -- is unclear to you regarding the above?
So for now I've got all the levels repeated just once (one trial per level/rgb code). As I explained, the same trial could be repeated more times, so that the values in the accuracy would be replaced by the new calculation. Moreover, I would not be able to know which trial would be displayed next - as also this depends by the subject's performance. 
I imagined that the only way to implement a conditional statement that does what I described would be to have an additive list/values that append all the accuracies calculated in the experiment everytime, and then say to the code "if the previous and the current values/ accuracies are in my ideal range, then do that.. "
But to do so, I should be able to call the position of specific items in the list / values, because I'd need to specify that I want two consecutive (ideal) scores and that those scores should be associated to a unique level of contrast (always the same rgb code). I have no idea of how to implement that, also because for what I know, we can't call specific position of values/items in a list.. 
Thank you again, Dave. Hope that you can help me and open up my mind :crying: :crazy:

ele

> Moreover, I would not be able to know which trial would be displayed next - as also this depends by the subject's performance.

Of course you know which trial to run next. The score result trials tell you the result, so you can /branch accordingly.

You start with the 230 trial. When that gets to its score result, check the result:
- If performance is within the desired range, /branch to the 230 trial for its second run. Increase a new variable to count level success by one.
- If performance is too good, /branch to the 220 trial. Reset the new variable to 0.
- If performance is too bad, /branch to the 240 trial. Reset the new variable 0.

(Same thing in the other score result trials).

Have a /stop condition in the block that terminates it when the variable indicating level success reaches 2.


eleonora_parr
eleonora_parr
Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)Associate Member (85 reputation)
Group: Forum Members
Posts: 34, Visits: 134
Dave - 4/9/2021
eleonora_parr - 4/9/2021
Dave - 4/9/2021
eleonora_parr - 4/9/2021
eleonora_parr - 4/9/2021
Dave - 4/8/2021
Dave - 4/8/2021
(1) Please do not paste entire scripts into a post's body. Instead attach the file(s).
(2) Whenever your script requires external files to run, provide those files along with the script.
(3) Be more specific with your questions, please. What exactly are you unsure how to do?

Side note: It's an absolutely terrible idea to implement each "level" as a separate trial if the only difference between levels is the color of the circle. Is there any reason why you chose to do so, that I'm not catching?

Further, the levels you describe here:

> 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)

do not correspond to what's in the code. There's no circle at 230, no circle at 240, and then there are gradations not mentioned in the above (e.g. 225, 235, 245).

<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>


What's the deal with that?

Dear Dave,
Thank you very much for your reply and sorry for the inconvenient : I’ve uploaded all the files here. If there's any problem in downloading them I also shared it at this link: https://we.tl/t-a7ItMbx1jX
Sorry for being not very clear.
You’re completely right, this is probably a terrible idea, but I would not know how to shorten this code and avoid having different trials for each level of difficulty, I explain you why:
-    Each level/different RGB code has its own timing (stimulustimes) at which the circle is presented. Then, for each level, the frequency rate at which the circle is presented is calculated. According to the “current frequency”, construct_bucket builds different time ranges within which the response given by the subject is considered correct (i.e. if the frequency is < 69.76, then a response is considered correct if that fell in a range between -750 and 125 ms compared to the appearance of the circle… etc..). So, I would not know how unify trials that have
-different timings (onsets), different latencies and different frequencies (plus, the list.frequency is resetted at the beginning of each trial, which makes possible to update the values everytime a new trial with new timings/onsets is presented)
- I would not really need all these different construct_bucket and check_latencies, but I kept them because I want to save/store all these variables for each level:
values.sum_acc_latencies_255_1, (number of correct responses)
values.accuracy_255_1, (the single accuracy for that single level of difficulty)
values.timeofresponse_255_1, (all latencies – timing of each given response)
values.spacebarpresscount_255_1, (number of spacebar presses)
values.corrlat_255_1, (values – timing of each response that has been considered correct)
values.lat_69_255_1, (correct responses correspondent to a frequency<69.76)
values.lat_betw_255_1, (correct responses correspondent to a 69.76<frequency<94.25)
values.lat_94_255_1 , (correct responses correspondent to a frequency<94.25)
-I would not really need either all these different “score_result” – participants will not be provided with feedback, but I kept it as an inter trial interval.
Finally, what do I need to do next:
All these levels should not be presented sequentially as they are now. Instead, I would need to
-    Start from the medium level (230). Then, according to the subject’s performance, a different trial should be presented: the ratio of this psychophysics is to get a STABLE performance between 0.78 and 0.82 of accuracy
-    So, if the performance was too poor/low (below 0.78)  present a trial with an higher/brighter RGB code (i.e. make the task easier)
-    If the performance was too high (above 0.82)  present a trial with a lower RGB code (i.e. make the task harder)
-    If the performance fell in the correct range that we want (between 0.78 and 0.82), then repeat that trial with that level of RGB code that produced that ideal performance and check if the subject reached the same level of accuracy TWICE (a performance is considered stable if the subject get the same level/range of accuracy TWO CONSECUTIVE TIMES with the same level of RGB code)
So, the idea would be to increase/decrease the RGB code according to a poor/high performance respectively OR to repeat the same trial (same RGB code) if that performance was in our ideal range . When the subject get two consecutive close accuracies with the same RGB code which fell in the ideal range the psychophysics is over (i.e. we identified the specific level of RGB code with which the subject demonstrated to perform stably (two consecutive times) at a range of accuracy between 0.78 and 0.82).
The thing is that this “game“ should be played for the whole psychophysics. So for each level I ‘ d probably need a conditional statement which says something like “ if the previous performance was too low, display the easier level, if it was too high, display the harder level. Finally, if it was ideal (0.78-0.82) repeat this trial and check if the subject gets again the same result/accuracy. If the same trial is repeated and the subject gets a different performance (for example, he got used to the RGB code and the second time he gets a better performance which overcomes 0.82, then re-start to decrease the contrast and so on..)
I hope that this was clear enough, and thank you again very much for all your support, Dave!
Eleonora

Sorry, the last file was missing!


> So, the idea would be to increase/decrease the RGB code according to a poor/high performance respectively OR to repeat the same trial (same RGB code) if that performance was in our ideal range . When the subject get two consecutive close accuracies with the same RGB code which fell in the ideal range the psychophysics is over (i.e. we identified the specific level of RGB code with which the subject demonstrated to perform stably (two consecutive times) at a range of accuracy between 0.78 and 0.82).
The thing is that this “game“ should be played for the whole psychophysics. So for each level I ‘ d probably need a conditional statement which says something like “ if the previous performance was too low, display the easier level, if it was too high, display the harder level. Finally, if it was ideal (0.78-0.82) repeat this trial and check if the subject gets again the same result/accuracy. If the same trial is repeated and the subject gets a different performance (for example, he got used to the RGB code and the second time he gets a better performance which overcomes 0.82, then re-start to decrease the contrast and so on..)

Here's the thing I can't quite get my head around: If you understand your current code, you already know how to do all this. The current code contains all the necessary ingredients, it already does things like all of the above, make conditional decisions, /branch accordingly, etc.

Basically, I'm not sure what exactly I need to explain to you, and some general description does not tell me. I could certainly simply implement the changes, but I'd rather have you get to a point where you can do so yourself.

So again: What -- in terms of code -- is unclear to you regarding the above?
So for now I've got all the levels repeated just once (one trial per level/rgb code). As I explained, the same trial could be repeated more times, so that the values in the accuracy would be replaced by the new calculation. Moreover, I would not be able to know which trial would be displayed next - as also this depends by the subject's performance. 
I imagined that the only way to implement a conditional statement that does what I described would be to have an additive list/values that append all the accuracies calculated in the experiment everytime, and then say to the code "if the previous and the current values/ accuracies are in my ideal range, then do that.. "
But to do so, I should be able to call the position of specific items in the list / values, because I'd need to specify that I want two consecutive (ideal) scores and that those scores should be associated to a unique level of contrast (always the same rgb code). I have no idea of how to implement that, also because for what I know, we can't call specific position of values/items in a list.. 
Thank you again, Dave. Hope that you can help me and open up my mind :crying: :crazy:

ele

> Moreover, I would not be able to know which trial would be displayed next - as also this depends by the subject's performance.

Of course you know which trial to run next. The score result trials tell you the result, so you can /branch accordingly.

You start with the 230 trial. When that gets to its score result, check the result:
- If performance is within the desired range, /branch to the 230 trial for its second run. Increase a new variable to count level success by one.
- If performance is too good, /branch to the 220 trial. Reset the new variable to 0.
- If performance is too bad, /branch to the 240 trial. Reset the new variable 0.

(Same thing in the other score result trials).

Have a /stop condition in the block that terminates it when the variable indicating level success reaches 2.


Yes, that is absolutely a great solution. The only problem that I see is that when repeating the same trial these values that I want to save will be erased by the new calculation:
values.sum_acc_latencies_255_1, (number of correct responses)
values.accuracy_255_1, (the single accuracy for that single level of difficulty)
values.timeofresponse_255_1, (all latencies – timing of each given response)
values.spacebarpresscount_255_1, (number of spacebar presses)
values.corrlat_255_1, (values – timing of each response that has been considered correct)
values.lat_69_255_1, (correct responses correspondent to a frequency<69.76)
values.lat_betw_255_1, (correct responses correspondent to a 69.76<frequency<94.25)
values.lat_94_255_1 , (correct responses correspondent to a frequency<94.25) 

Is that correct?
A potential solution could be to create a bunch of trial with the same rgb code (i.e. trial 255_1, 255_2, 255_3 etc.) but this would make the code huge, and also, I won't know in advance how many repeats there will be for the same trial.. Another solution would be to have another additional value that stores (concatenates) all these values again..  unless you have other solutions to suggest.. 

Ele
Dave
Dave
Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)
Group: Administrators
Posts: 11K, Visits: 68K
eleonora_parr - 4/9/2021
Dave - 4/9/2021
eleonora_parr - 4/9/2021
Dave - 4/9/2021
eleonora_parr - 4/9/2021
eleonora_parr - 4/9/2021
Dave - 4/8/2021
Dave - 4/8/2021
(1) Please do not paste entire scripts into a post's body. Instead attach the file(s).
(2) Whenever your script requires external files to run, provide those files along with the script.
(3) Be more specific with your questions, please. What exactly are you unsure how to do?

Side note: It's an absolutely terrible idea to implement each "level" as a separate trial if the only difference between levels is the color of the circle. Is there any reason why you chose to do so, that I'm not catching?

Further, the levels you describe here:

> 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)

do not correspond to what's in the code. There's no circle at 230, no circle at 240, and then there are gradations not mentioned in the above (e.g. 225, 235, 245).

<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>


What's the deal with that?

Dear Dave,
Thank you very much for your reply and sorry for the inconvenient : I’ve uploaded all the files here. If there's any problem in downloading them I also shared it at this link: https://we.tl/t-a7ItMbx1jX
Sorry for being not very clear.
You’re completely right, this is probably a terrible idea, but I would not know how to shorten this code and avoid having different trials for each level of difficulty, I explain you why:
-    Each level/different RGB code has its own timing (stimulustimes) at which the circle is presented. Then, for each level, the frequency rate at which the circle is presented is calculated. According to the “current frequency”, construct_bucket builds different time ranges within which the response given by the subject is considered correct (i.e. if the frequency is < 69.76, then a response is considered correct if that fell in a range between -750 and 125 ms compared to the appearance of the circle… etc..). So, I would not know how unify trials that have
-different timings (onsets), different latencies and different frequencies (plus, the list.frequency is resetted at the beginning of each trial, which makes possible to update the values everytime a new trial with new timings/onsets is presented)
- I would not really need all these different construct_bucket and check_latencies, but I kept them because I want to save/store all these variables for each level:
values.sum_acc_latencies_255_1, (number of correct responses)
values.accuracy_255_1, (the single accuracy for that single level of difficulty)
values.timeofresponse_255_1, (all latencies – timing of each given response)
values.spacebarpresscount_255_1, (number of spacebar presses)
values.corrlat_255_1, (values – timing of each response that has been considered correct)
values.lat_69_255_1, (correct responses correspondent to a frequency<69.76)
values.lat_betw_255_1, (correct responses correspondent to a 69.76<frequency<94.25)
values.lat_94_255_1 , (correct responses correspondent to a frequency<94.25)
-I would not really need either all these different “score_result” – participants will not be provided with feedback, but I kept it as an inter trial interval.
Finally, what do I need to do next:
All these levels should not be presented sequentially as they are now. Instead, I would need to
-    Start from the medium level (230). Then, according to the subject’s performance, a different trial should be presented: the ratio of this psychophysics is to get a STABLE performance between 0.78 and 0.82 of accuracy
-    So, if the performance was too poor/low (below 0.78)  present a trial with an higher/brighter RGB code (i.e. make the task easier)
-    If the performance was too high (above 0.82)  present a trial with a lower RGB code (i.e. make the task harder)
-    If the performance fell in the correct range that we want (between 0.78 and 0.82), then repeat that trial with that level of RGB code that produced that ideal performance and check if the subject reached the same level of accuracy TWICE (a performance is considered stable if the subject get the same level/range of accuracy TWO CONSECUTIVE TIMES with the same level of RGB code)
So, the idea would be to increase/decrease the RGB code according to a poor/high performance respectively OR to repeat the same trial (same RGB code) if that performance was in our ideal range . When the subject get two consecutive close accuracies with the same RGB code which fell in the ideal range the psychophysics is over (i.e. we identified the specific level of RGB code with which the subject demonstrated to perform stably (two consecutive times) at a range of accuracy between 0.78 and 0.82).
The thing is that this “game“ should be played for the whole psychophysics. So for each level I ‘ d probably need a conditional statement which says something like “ if the previous performance was too low, display the easier level, if it was too high, display the harder level. Finally, if it was ideal (0.78-0.82) repeat this trial and check if the subject gets again the same result/accuracy. If the same trial is repeated and the subject gets a different performance (for example, he got used to the RGB code and the second time he gets a better performance which overcomes 0.82, then re-start to decrease the contrast and so on..)
I hope that this was clear enough, and thank you again very much for all your support, Dave!
Eleonora

Sorry, the last file was missing!


> So, the idea would be to increase/decrease the RGB code according to a poor/high performance respectively OR to repeat the same trial (same RGB code) if that performance was in our ideal range . When the subject get two consecutive close accuracies with the same RGB code which fell in the ideal range the psychophysics is over (i.e. we identified the specific level of RGB code with which the subject demonstrated to perform stably (two consecutive times) at a range of accuracy between 0.78 and 0.82).
The thing is that this “game“ should be played for the whole psychophysics. So for each level I ‘ d probably need a conditional statement which says something like “ if the previous performance was too low, display the easier level, if it was too high, display the harder level. Finally, if it was ideal (0.78-0.82) repeat this trial and check if the subject gets again the same result/accuracy. If the same trial is repeated and the subject gets a different performance (for example, he got used to the RGB code and the second time he gets a better performance which overcomes 0.82, then re-start to decrease the contrast and so on..)

Here's the thing I can't quite get my head around: If you understand your current code, you already know how to do all this. The current code contains all the necessary ingredients, it already does things like all of the above, make conditional decisions, /branch accordingly, etc.

Basically, I'm not sure what exactly I need to explain to you, and some general description does not tell me. I could certainly simply implement the changes, but I'd rather have you get to a point where you can do so yourself.

So again: What -- in terms of code -- is unclear to you regarding the above?
So for now I've got all the levels repeated just once (one trial per level/rgb code). As I explained, the same trial could be repeated more times, so that the values in the accuracy would be replaced by the new calculation. Moreover, I would not be able to know which trial would be displayed next - as also this depends by the subject's performance. 
I imagined that the only way to implement a conditional statement that does what I described would be to have an additive list/values that append all the accuracies calculated in the experiment everytime, and then say to the code "if the previous and the current values/ accuracies are in my ideal range, then do that.. "
But to do so, I should be able to call the position of specific items in the list / values, because I'd need to specify that I want two consecutive (ideal) scores and that those scores should be associated to a unique level of contrast (always the same rgb code). I have no idea of how to implement that, also because for what I know, we can't call specific position of values/items in a list.. 
Thank you again, Dave. Hope that you can help me and open up my mind :crying: :crazy:

ele

> Moreover, I would not be able to know which trial would be displayed next - as also this depends by the subject's performance.

Of course you know which trial to run next. The score result trials tell you the result, so you can /branch accordingly.

You start with the 230 trial. When that gets to its score result, check the result:
- If performance is within the desired range, /branch to the 230 trial for its second run. Increase a new variable to count level success by one.
- If performance is too good, /branch to the 220 trial. Reset the new variable to 0.
- If performance is too bad, /branch to the 240 trial. Reset the new variable 0.

(Same thing in the other score result trials).

Have a /stop condition in the block that terminates it when the variable indicating level success reaches 2.


Yes, that is absolutely a great solution. The only problem that I see is that when repeating the same trial these values that I want to save will be erased by the new calculation:
values.sum_acc_latencies_255_1, (number of correct responses)
values.accuracy_255_1, (the single accuracy for that single level of difficulty)
values.timeofresponse_255_1, (all latencies – timing of each given response)
values.spacebarpresscount_255_1, (number of spacebar presses)
values.corrlat_255_1, (values – timing of each response that has been considered correct)
values.lat_69_255_1, (correct responses correspondent to a frequency<69.76)
values.lat_betw_255_1, (correct responses correspondent to a 69.76<frequency<94.25)
values.lat_94_255_1 , (correct responses correspondent to a frequency<94.25) 

Is that correct?
A potential solution could be to create a bunch of trial with the same rgb code (i.e. trial 255_1, 255_2, 255_3 etc.) but this would make the code huge, and also, I won't know in advance how many repeats there will be for the same trial.. Another solution would be to have another additional value that stores (concatenates) all these values again..  unless you have other solutions to suggest.. 

Ele

Each trial gets its own row in the raw data file, so nothing is erased.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search