data recording not working


Author
Message
jm560@sussex.ac.uk
jm560@sussex.ac.uk
Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)
Group: Forum Members
Posts: 25, Visits: 208
Hi,

I posted a few days ago for some help on the locations of my stimuli - https://www.millisecond.com/forums/Topic22419.aspx - which now all works perfectly so thank you!

However, I am trying to use the logic of the alcohol attention bias script (the one online  - http://www.millisecond.com/download/library/alcoholdotprobe/) but am having problems with the data recording.

I need each trial to check if the distractor is congruent with my target stimuli (an X or an N), then keep a count of this (which i thought i had done 'on trial begin'), the accuracy and latency (which I think should be on trial end). But the data does not record this correctly. It's recording almost every trial as congruent. As it wasn't updating I changed the congruence variable to an expression (as i understand these are evaluated every time they are used?), but it made no difference.

Relevant script is pasted below and whole thing is attached. I've also attached an example data file.

<trial set3X1>
/ ontrialbegin = [
values.valid = 0;
values.validcorrect = 0;
values.trialcount += 1;
values.category = 0]
/ ontrialbegin = [trial.set3X1.insertstimulustime(list.s3filler1.nextvalue,500);]
/ ontrialbegin = [trial.set3X1.insertstimulustime(list.s3filler2.nextvalue,500);]
/ ontrialbegin = [trial.set3X1.insertstimulustime(list.s3filler3.nextvalue,500);]
/ ontrialbegin = [trial.set3X1.insertstimulustime(list.s3filler4.nextvalue,500);]
/ ontrialbegin = [trial.set3X1.insertstimulustime(list.s3filler5.nextvalue,500);]
/ ontrialbegin = [values.fillerhpos1 = expressions.hp2]
/ ontrialbegin = [values.fillerhpos2 = expressions.hp3]
/ ontrialbegin = [values.fillerhpos3 = expressions.hp4]
/ ontrialbegin = [values.fillerhpos4 = expressions.hp5]
/ ontrialbegin = [values.fillerhpos5 = expressions.hp6]
/ ontrialbegin = [values.fillervpos1 = expressions.vp2]
/ ontrialbegin = [values.fillervpos2 = expressions.vp3]
/ ontrialbegin = [values.fillervpos3 = expressions.vp4]
/ ontrialbegin = [values.fillervpos4 = expressions.vp5]
/ ontrialbegin = [values.fillervpos5 = expressions.vp6]
/ ontrialbegin = [trial.set3X1.insertstimulustime(list.distractorX1.nextvalue,500);]
/ ontrialbegin = [values.distractor = list.distractorX1.currentvalue;]
/ ontrialbegin = [
if (contains(list.distractorX1.currentvalue, "X")) expressions.category = "congruent";
  else if (contains(list.distractorX1.currentvalue, "N")) expressions.category = "incongruent";
]
/ ontrialbegin = [
if (expressions.category= "congruent") values.count_congruent += 1;
  else if (expressions.category= "incongruent") values.count_incongruent += 1;
]
/ ontrialend = [trial.set3X1.resetstimulusframes(); ]
/ stimulustimes = [1=fixation; 500=sequence (fixationcover, XLD1); 600=sequence (eraser1, eraser2, eraser3, eraser4, eraser5, eraser6)]
/ validresponse = ("J", "I")
/ correctresponse = ("J")
/ response = timeout(2000)
/ beginresponsetime = 500
/ ontrialend = [
if (trial.set3X1.latency >= parameters.minimum_latency)
values.valid = 1;
if (values.valid == 1) {
if (trial.set3X1.correct) {
values.validcorrect = 1;
values.sumcorrect += 1;
values.sumrt += trial.set3X1.latency
if (expressions.category == "congruent") {
values.sumcorrect_congruent += 1;
values.sumrt_congruent += trial.set3X1.latency;
list.latencies_congruent.insertitem(trial.set3X1.latency, 1);
list.latencies.insertitem(trial.set3X1.latency, 1);
} else {
values.sumcorrect_incongruent += 1;
values.sumrt_incongruent += trial.set3X1.latency;
list.latencies_incongruent.insertitem(trial.set3X1.latency, 1);
list.latencies.insertitem(trial.set3X1.latency, 1);
}
}
} ;
list.accuracy.insertitem(values.validcorrect, 1);
values.testeracc = list.accuracy.currentindex
if (expressions.category == "congruent") {
list.accuracy_congruent.insertitem(values.validcorrect, 1);
} else {
list.accuracy_incongruent.insertitem(values.validcorrect, 1);
};
]
</trial>

<expressions>
/category = 0
</expressions>


<parameters>
/ minimum_latency = 100
</parameters>


<list latencies_congruent>
</list>

<list latencies_incongruent>
</list>

<list accuracy_congruent>
</list>

<list accuracy_incongruent>
</list>

<list latencies>
</list>

<list accuracy>
</list>

<values>
/validcorrect = 0
/valid = 0
/sumcorrect = 0
/sumrt = 0
/sumcorrect_congruent = 0
/sumrt_congruent = 0
/sumcorrect_incongruent = 0
/sumrt_incongruent = 0
/testeracc = 0
/count_congruent = 0
/count_incongruent = 0
/trialcount = 0
</values>

Thanks


Attachments
example data.iqdat (224 views, 1.00 KB)
PL_AB_setsize_expt_listversion.iqx (222 views, 77.00 KB)
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
jm560@sussex.ac.uk - 8 Years Ago
Dave - 8 Years Ago
Dave - 8 Years Ago
jm560@sussex.ac.uk - 8 Years Ago
                     + x [quote] [b] jm560@sussex.ac.uk - Wednesday, September...
Dave - 8 Years Ago
                         + x [quote] [b] Dave - Wednesday, September 13, 2017 [/b]...
jm560@sussex.ac.uk - 8 Years Ago
                             + x [quote] [b] jm560@sussex.ac.uk - Thursday, September...
jm560@sussex.ac.uk - 8 Years Ago
                                 + x [quote] [b] jm560@sussex.ac.uk - Thursday, September...
Dave - 8 Years Ago

Reading This Topic

Explore
Messages
Mentions
Search