+xHi all!
I'm having some difficulty with the calculation of expressions using /ontrialend and lists. My aim is to calculate the proportion of correct trials, and although the script is running, I'm getting values of 0 in the summary data. Below, I've attached some script containing the pertinent elements. Any help you can offer would be much appreciated.
<summarydata>
/ columns = (computer.platform, script.startdate, script.starttime, script.subjectid, script.groupid, script.sessionid, script.elapsedtime, script.completed, values.total_proportioncorrect, values.neutral_proportioncorrect)
</summarydata>
<list total_accuracy>
</list>
<list neutral_accuracy>
</list>
<values>
/ ACC = 0
/ total_proportioncorrect = 0
/ neutral_proportioncorrect = 0
/ picture_name = ""
</values>
<expressions>
/ total_proportioncorrect = list.total_accuracy.mean
/ neutral_proportioncorrect = list.neutral_accuracy.mean
</expressions>
<item neutralImages>
/1 ="neutral1.jpg"
/2 ="neutral2.jpg"
/3 ="neutral3.jpg"
/4 ="neutral4.jpg"
/5 ="neutral5.jpg"
/6 ="neutral6.jpg"
/7 ="neutral7.jpg"
/8 ="neutral8.jpg"
</item>
<picture neutral_images>
/items = neutralImages
/size = (70%, 70%)
/select = noreplacenorepeat(1-8)
/erase = false
</picture>
<trial Neutral400>
/ ontrialbegin = [
values.total_trialcount +=1;
values.death_trialcount +=1;
/ stimulusframes = [1 = neutral_images]
/ trialduration = 400
/ validresponse = (31, 38)
/ correctresponse = (31)
/ ontrialend = [
if (trial.Neutral400.correct)
{values.ACC = 1}
else {values.ACC = 0};
list.total_accuracy.appenditem(values.ACC);
list.neutral_accuracy.appenditem(values.ACC);
values.picture_name = picture.neutral_images.currentitem;
]
</trial>
<summarydata>
/ columns = (computer.platform, script.startdate, script.starttime, script.subjectid, script.groupid, script.sessionid, script.elapsedtime,
script.completed,
values.total_proportioncorrect,
values.neutral_proportioncorrect)
</summarydata>
You have to log the
expressions<
expressions>
/ total_proportioncorrect = list.total_accuracy.mean
/ neutral_proportioncorrect = list.neutral_accuracy.mean
</expressions>
<summarydata>
/ columns = (computer.platform, script.startdate, script.starttime, script.subjectid, script.groupid, script.sessionid, script.elapsedtime,
script.completed,
expressions.total_proportioncorrect,
expressions.neutral_proportioncorrect)
</summarydata>
You do nothing with
<values>
/ ACC = 0
/ total_proportioncorrect = 0
/ neutral_proportioncorrect = 0/ picture_name = ""
</values>
in the script, so these remain at zero.