Millisecond Forums

AAT - script error: trial.selectnumber

https://forums.millisecond.com/Topic23924.aspx

By alexa - 2/26/2018

Hello!

I have modified the AAT-script according to my needs: 20 practice trials (grey rectangles) followed by 160 „real“ trials. The real trials were as followed: 2 groups of stimuli (40 food and 40-non-food stimuli) x 2 formats (once in portrait and once in landscape format) = 160. Now I would like to pretest the script with the test monkey, but I get the following error:

trial.selectnumber: expression ' - ' is invalid. Expression contains an unknown element or property name. I think this error must be in the sequencegenerator-script as it contains this element. I have attached both scripts. What did I do wrong?

Thank you for your help!
Alexa
By Dave - 2/27/2018

alexa - Tuesday, February 27, 2018
Hello!

I have modified the AAT-script according to my needs: 20 practice trials (grey rectangles) followed by 160 „real“ trials. The real trials were as followed: 2 groups of stimuli (40 food and 40-non-food stimuli) x 2 formats (once in portrait and once in landscape format) = 160. Now I would like to pretest the script with the test monkey, but I get the following error:

trial.selectnumber: expression ' - ' is invalid. Expression contains an unknown element or property name. I think this error must be in the sequencegenerator-script as it contains this element. I have attached both scripts. What did I do wrong?

Thank you for your help!
Alexa

#1:
<include>
/ file = "aat_sequencegenerator_neu1.iqx"
</include>

in your AAT_neu2.iqx file

needs to read

<include>
/ file = "aat_sequencegenerator_neu2.iqx"
</include>

#2:

In your aat_sequencegenerator_neu2.iqx file, your mistake is here:

<trial selectnumber>
/ ontrialbegin = [values.newnumber = list.stimcats.nextvalue]
/ ontrialbegin = [values.index += 1]
/ ontrialbegin = [
            if (values.newnumber == 1)
                        {values.runcount_1 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_1;
                        values.count_compareformat = values.runcount_A;
                        values.count1 -=1}
            else if (values.newnumber ==2)
                        {values.runcount_1 += 1;
                        values.runcount_B += 1;
                        values.count_comparecat = values.runcount_1;
                        values.count_compareformat = values.runcount_B;
                        values.count2 -=1}
            else if (values.newnumber ==3)
                        {values.runcount_2 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_2;
                        values.count_compareformat = values.runcount_A;
                        values.count3 -= 1}
            else if (values.newnumber ==4)
                        {values.runcount_2 += 1;
                        values.runcount_B += 1;
                        values.count_comparecat = values.runcount_2;
                        values.count_compareformat = values.runcount_B;
                        values.count4 -=1}
            else if (values.newnumber ==5)
                        {values.runcount_3 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_3;
                        values.count_compareformat = values.runcount_A;
                         -= 1}
...
</trial>

It ought to read

<trial selectnumber>
/ ontrialbegin = [values.newnumber = list.stimcats.nextvalue]
/ ontrialbegin = [values.index += 1]
/ ontrialbegin = [
            if (values.newnumber == 1)
                        {values.runcount_1 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_1;
                        values.count_compareformat = values.runcount_A;
                        values.count1 -=1}
            else if (values.newnumber ==2)
                        {values.runcount_1 += 1;
                        values.runcount_B += 1;
                        values.count_comparecat = values.runcount_1;
                        values.count_compareformat = values.runcount_B;
                        values.count2 -=1}
            else if (values.newnumber ==3)
                        {values.runcount_2 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_2;
                        values.count_compareformat = values.runcount_A;
                        values.count3 -= 1}
            else if (values.newnumber ==4)
                        {values.runcount_2 += 1;
                        values.runcount_B += 1;
                        values.count_comparecat = values.runcount_2;
                        values.count_compareformat = values.runcount_B;
                        values.count4 -=1}
            else if (values.newnumber ==5)
                        {values.runcount_3 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_3;
                        values.count_compareformat = values.runcount_A;
                        values.count5 -= 1}
...
</trial>
By alexa - 2/27/2018

Dave - Tuesday, February 27, 2018
alexa - Tuesday, February 27, 2018
Hello!

I have modified the AAT-script according to my needs: 20 practice trials (grey rectangles) followed by 160 „real“ trials. The real trials were as followed: 2 groups of stimuli (40 food and 40-non-food stimuli) x 2 formats (once in portrait and once in landscape format) = 160. Now I would like to pretest the script with the test monkey, but I get the following error:

trial.selectnumber: expression ' - ' is invalid. Expression contains an unknown element or property name. I think this error must be in the sequencegenerator-script as it contains this element. I have attached both scripts. What did I do wrong?

Thank you for your help!
Alexa

#1:
<include>
/ file = "aat_sequencegenerator_neu1.iqx"
</include>

in your AAT_neu2.iqx file

needs to read

<include>
/ file = "aat_sequencegenerator_neu2.iqx"
</include>

#2:

In your aat_sequencegenerator_neu2.iqx file, your mistake is here:

<trial selectnumber>
/ ontrialbegin = [values.newnumber = list.stimcats.nextvalue]
/ ontrialbegin = [values.index += 1]
/ ontrialbegin = [
            if (values.newnumber == 1)
                        {values.runcount_1 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_1;
                        values.count_compareformat = values.runcount_A;
                        values.count1 -=1}
            else if (values.newnumber ==2)
                        {values.runcount_1 += 1;
                        values.runcount_B += 1;
                        values.count_comparecat = values.runcount_1;
                        values.count_compareformat = values.runcount_B;
                        values.count2 -=1}
            else if (values.newnumber ==3)
                        {values.runcount_2 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_2;
                        values.count_compareformat = values.runcount_A;
                        values.count3 -= 1}
            else if (values.newnumber ==4)
                        {values.runcount_2 += 1;
                        values.runcount_B += 1;
                        values.count_comparecat = values.runcount_2;
                        values.count_compareformat = values.runcount_B;
                        values.count4 -=1}
            else if (values.newnumber ==5)
                        {values.runcount_3 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_3;
                        values.count_compareformat = values.runcount_A;
                         -= 1}
...
</trial>

It ought to read

<trial selectnumber>
/ ontrialbegin = [values.newnumber = list.stimcats.nextvalue]
/ ontrialbegin = [values.index += 1]
/ ontrialbegin = [
            if (values.newnumber == 1)
                        {values.runcount_1 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_1;
                        values.count_compareformat = values.runcount_A;
                        values.count1 -=1}
            else if (values.newnumber ==2)
                        {values.runcount_1 += 1;
                        values.runcount_B += 1;
                        values.count_comparecat = values.runcount_1;
                        values.count_compareformat = values.runcount_B;
                        values.count2 -=1}
            else if (values.newnumber ==3)
                        {values.runcount_2 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_2;
                        values.count_compareformat = values.runcount_A;
                        values.count3 -= 1}
            else if (values.newnumber ==4)
                        {values.runcount_2 += 1;
                        values.runcount_B += 1;
                        values.count_comparecat = values.runcount_2;
                        values.count_compareformat = values.runcount_B;
                        values.count4 -=1}
            else if (values.newnumber ==5)
                        {values.runcount_3 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_3;
                        values.count_compareformat = values.runcount_A;
                        values.count5 -= 1}
...
</trial>

Thank you very much!
Now the script is working but there is another problem which occurs in some trials (not in all trials). When a picture is presented and the participant has to move the joystick, all of a sudden a second picture is presented in the same trial. This is weird because it never happened before. I have attached the raw data.
Thank you for your help!
By Dave - 2/28/2018

alexa - Wednesday, February 28, 2018
Dave - Tuesday, February 27, 2018
alexa - Tuesday, February 27, 2018
Hello!

I have modified the AAT-script according to my needs: 20 practice trials (grey rectangles) followed by 160 „real“ trials. The real trials were as followed: 2 groups of stimuli (40 food and 40-non-food stimuli) x 2 formats (once in portrait and once in landscape format) = 160. Now I would like to pretest the script with the test monkey, but I get the following error:

trial.selectnumber: expression ' - ' is invalid. Expression contains an unknown element or property name. I think this error must be in the sequencegenerator-script as it contains this element. I have attached both scripts. What did I do wrong?

Thank you for your help!
Alexa

#1:
<include>
/ file = "aat_sequencegenerator_neu1.iqx"
</include>

in your AAT_neu2.iqx file

needs to read

<include>
/ file = "aat_sequencegenerator_neu2.iqx"
</include>

#2:

In your aat_sequencegenerator_neu2.iqx file, your mistake is here:

<trial selectnumber>
/ ontrialbegin = [values.newnumber = list.stimcats.nextvalue]
/ ontrialbegin = [values.index += 1]
/ ontrialbegin = [
            if (values.newnumber == 1)
                        {values.runcount_1 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_1;
                        values.count_compareformat = values.runcount_A;
                        values.count1 -=1}
            else if (values.newnumber ==2)
                        {values.runcount_1 += 1;
                        values.runcount_B += 1;
                        values.count_comparecat = values.runcount_1;
                        values.count_compareformat = values.runcount_B;
                        values.count2 -=1}
            else if (values.newnumber ==3)
                        {values.runcount_2 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_2;
                        values.count_compareformat = values.runcount_A;
                        values.count3 -= 1}
            else if (values.newnumber ==4)
                        {values.runcount_2 += 1;
                        values.runcount_B += 1;
                        values.count_comparecat = values.runcount_2;
                        values.count_compareformat = values.runcount_B;
                        values.count4 -=1}
            else if (values.newnumber ==5)
                        {values.runcount_3 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_3;
                        values.count_compareformat = values.runcount_A;
                         -= 1}
...
</trial>

It ought to read

<trial selectnumber>
/ ontrialbegin = [values.newnumber = list.stimcats.nextvalue]
/ ontrialbegin = [values.index += 1]
/ ontrialbegin = [
            if (values.newnumber == 1)
                        {values.runcount_1 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_1;
                        values.count_compareformat = values.runcount_A;
                        values.count1 -=1}
            else if (values.newnumber ==2)
                        {values.runcount_1 += 1;
                        values.runcount_B += 1;
                        values.count_comparecat = values.runcount_1;
                        values.count_compareformat = values.runcount_B;
                        values.count2 -=1}
            else if (values.newnumber ==3)
                        {values.runcount_2 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_2;
                        values.count_compareformat = values.runcount_A;
                        values.count3 -= 1}
            else if (values.newnumber ==4)
                        {values.runcount_2 += 1;
                        values.runcount_B += 1;
                        values.count_comparecat = values.runcount_2;
                        values.count_compareformat = values.runcount_B;
                        values.count4 -=1}
            else if (values.newnumber ==5)
                        {values.runcount_3 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_3;
                        values.count_compareformat = values.runcount_A;
                        values.count5 -= 1}
...
</trial>

Thank you very much!
Now the script is working but there is another problem which occurs in some trials (not in all trials). When a picture is presented and the participant has to move the joystick, all of a sudden a second picture is presented in the same trial. This is weird because it never happened before. I have attached the raw data.
Thank you for your help!

If you look at your data file, there is clearly something wrong with your AAT_4 trial. That's where you should look for any errors / mistakes:


By alexa - 2/28/2018

Dave - Wednesday, February 28, 2018
alexa - Wednesday, February 28, 2018
Dave - Tuesday, February 27, 2018
alexa - Tuesday, February 27, 2018
Hello!

I have modified the AAT-script according to my needs: 20 practice trials (grey rectangles) followed by 160 „real“ trials. The real trials were as followed: 2 groups of stimuli (40 food and 40-non-food stimuli) x 2 formats (once in portrait and once in landscape format) = 160. Now I would like to pretest the script with the test monkey, but I get the following error:

trial.selectnumber: expression ' - ' is invalid. Expression contains an unknown element or property name. I think this error must be in the sequencegenerator-script as it contains this element. I have attached both scripts. What did I do wrong?

Thank you for your help!
Alexa

#1:
<include>
/ file = "aat_sequencegenerator_neu1.iqx"
</include>

in your AAT_neu2.iqx file

needs to read

<include>
/ file = "aat_sequencegenerator_neu2.iqx"
</include>

#2:

In your aat_sequencegenerator_neu2.iqx file, your mistake is here:

<trial selectnumber>
/ ontrialbegin = [values.newnumber = list.stimcats.nextvalue]
/ ontrialbegin = [values.index += 1]
/ ontrialbegin = [
            if (values.newnumber == 1)
                        {values.runcount_1 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_1;
                        values.count_compareformat = values.runcount_A;
                        values.count1 -=1}
            else if (values.newnumber ==2)
                        {values.runcount_1 += 1;
                        values.runcount_B += 1;
                        values.count_comparecat = values.runcount_1;
                        values.count_compareformat = values.runcount_B;
                        values.count2 -=1}
            else if (values.newnumber ==3)
                        {values.runcount_2 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_2;
                        values.count_compareformat = values.runcount_A;
                        values.count3 -= 1}
            else if (values.newnumber ==4)
                        {values.runcount_2 += 1;
                        values.runcount_B += 1;
                        values.count_comparecat = values.runcount_2;
                        values.count_compareformat = values.runcount_B;
                        values.count4 -=1}
            else if (values.newnumber ==5)
                        {values.runcount_3 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_3;
                        values.count_compareformat = values.runcount_A;
                         -= 1}
...
</trial>

It ought to read

<trial selectnumber>
/ ontrialbegin = [values.newnumber = list.stimcats.nextvalue]
/ ontrialbegin = [values.index += 1]
/ ontrialbegin = [
            if (values.newnumber == 1)
                        {values.runcount_1 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_1;
                        values.count_compareformat = values.runcount_A;
                        values.count1 -=1}
            else if (values.newnumber ==2)
                        {values.runcount_1 += 1;
                        values.runcount_B += 1;
                        values.count_comparecat = values.runcount_1;
                        values.count_compareformat = values.runcount_B;
                        values.count2 -=1}
            else if (values.newnumber ==3)
                        {values.runcount_2 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_2;
                        values.count_compareformat = values.runcount_A;
                        values.count3 -= 1}
            else if (values.newnumber ==4)
                        {values.runcount_2 += 1;
                        values.runcount_B += 1;
                        values.count_comparecat = values.runcount_2;
                        values.count_compareformat = values.runcount_B;
                        values.count4 -=1}
            else if (values.newnumber ==5)
                        {values.runcount_3 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_3;
                        values.count_compareformat = values.runcount_A;
                        values.count5 -= 1}
...
</trial>

Thank you very much!
Now the script is working but there is another problem which occurs in some trials (not in all trials). When a picture is presented and the participant has to move the joystick, all of a sudden a second picture is presented in the same trial. This is weird because it never happened before. I have attached the raw data.
Thank you for your help!

If you look at your data file, there is clearly something wrong with your AAT_4 trial. That's where you should look for any errors / mistakes:



Yes, that's true, thank you. Also, it seems that only the low-caloric pictures in the portrait format are causing issues.
I have done the AAT again. As soon as a low-caloric_P picture is presented and I move the joystick, a new picture (all formats / categories) appears.
I have carefully checked the syntax but I haven't found any irregularities in trial / category 4. Could you please help me out? I have attached the syntax.
Thank you very much!
By Dave - 3/1/2018

alexa - Thursday, March 1, 2018
Dave - Wednesday, February 28, 2018
alexa - Wednesday, February 28, 2018
Dave - Tuesday, February 27, 2018
alexa - Tuesday, February 27, 2018
Hello!

I have modified the AAT-script according to my needs: 20 practice trials (grey rectangles) followed by 160 „real“ trials. The real trials were as followed: 2 groups of stimuli (40 food and 40-non-food stimuli) x 2 formats (once in portrait and once in landscape format) = 160. Now I would like to pretest the script with the test monkey, but I get the following error:

trial.selectnumber: expression ' - ' is invalid. Expression contains an unknown element or property name. I think this error must be in the sequencegenerator-script as it contains this element. I have attached both scripts. What did I do wrong?

Thank you for your help!
Alexa

#1:
<include>
/ file = "aat_sequencegenerator_neu1.iqx"
</include>

in your AAT_neu2.iqx file

needs to read

<include>
/ file = "aat_sequencegenerator_neu2.iqx"
</include>

#2:

In your aat_sequencegenerator_neu2.iqx file, your mistake is here:

<trial selectnumber>
/ ontrialbegin = [values.newnumber = list.stimcats.nextvalue]
/ ontrialbegin = [values.index += 1]
/ ontrialbegin = [
            if (values.newnumber == 1)
                        {values.runcount_1 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_1;
                        values.count_compareformat = values.runcount_A;
                        values.count1 -=1}
            else if (values.newnumber ==2)
                        {values.runcount_1 += 1;
                        values.runcount_B += 1;
                        values.count_comparecat = values.runcount_1;
                        values.count_compareformat = values.runcount_B;
                        values.count2 -=1}
            else if (values.newnumber ==3)
                        {values.runcount_2 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_2;
                        values.count_compareformat = values.runcount_A;
                        values.count3 -= 1}
            else if (values.newnumber ==4)
                        {values.runcount_2 += 1;
                        values.runcount_B += 1;
                        values.count_comparecat = values.runcount_2;
                        values.count_compareformat = values.runcount_B;
                        values.count4 -=1}
            else if (values.newnumber ==5)
                        {values.runcount_3 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_3;
                        values.count_compareformat = values.runcount_A;
                         -= 1}
...
</trial>

It ought to read

<trial selectnumber>
/ ontrialbegin = [values.newnumber = list.stimcats.nextvalue]
/ ontrialbegin = [values.index += 1]
/ ontrialbegin = [
            if (values.newnumber == 1)
                        {values.runcount_1 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_1;
                        values.count_compareformat = values.runcount_A;
                        values.count1 -=1}
            else if (values.newnumber ==2)
                        {values.runcount_1 += 1;
                        values.runcount_B += 1;
                        values.count_comparecat = values.runcount_1;
                        values.count_compareformat = values.runcount_B;
                        values.count2 -=1}
            else if (values.newnumber ==3)
                        {values.runcount_2 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_2;
                        values.count_compareformat = values.runcount_A;
                        values.count3 -= 1}
            else if (values.newnumber ==4)
                        {values.runcount_2 += 1;
                        values.runcount_B += 1;
                        values.count_comparecat = values.runcount_2;
                        values.count_compareformat = values.runcount_B;
                        values.count4 -=1}
            else if (values.newnumber ==5)
                        {values.runcount_3 += 1;
                        values.runcount_A += 1;
                        values.count_comparecat = values.runcount_3;
                        values.count_compareformat = values.runcount_A;
                        values.count5 -= 1}
...
</trial>

Thank you very much!
Now the script is working but there is another problem which occurs in some trials (not in all trials). When a picture is presented and the participant has to move the joystick, all of a sudden a second picture is presented in the same trial. This is weird because it never happened before. I have attached the raw data.
Thank you for your help!

If you look at your data file, there is clearly something wrong with your AAT_4 trial. That's where you should look for any errors / mistakes:



Yes, that's true, thank you. Also, it seems that only the low-caloric pictures in the portrait format are causing issues.
I have done the AAT again. As soon as a low-caloric_P picture is presented and I move the joystick, a new picture (all formats / categories) appears.
I have carefully checked the syntax but I haven't found any irregularities in trial / category 4. Could you please help me out? I have attached the syntax.
Thank you very much!

Compare:

<trial AAT_4>
/ ontrialbegin = [values.selectstimulus = list.category4.nextvalue]
/ ontrialbegin = [values.targetcategory = 2; values.targetformat = "p"]
/ ontrialbegin = [picture.targetstimulus.height = values.startheight_B]

/ ontrialbegin = [values.starttime = script.elapsedtime; values.endtime = 0]
/ ontrialbegin = [values.completeRT = 0; values.changedirection = 0; values.finalresponse=""]

/ stimulusframes = [1 = targetstimulus]
/ validresponse = (back, forward)
/ iscorrectresponse = [(values.expcondition == 1 && trial.AAT_4.response == "back") ||
                                (values.expcondition == 2 && trial.AAT_4.response == "forward")]

/ ontrialend = [if (trial.AAT_4.correct) values.sumRTcorrect_4 += trial.AAT_4.latency]
/ ontrialend = [values.sumRT_4 += trial.AAT_4.latency]

/ ontrialend = [values.joystick_y = joystick.y]
/ ontrialend = [values.joystick_change = abs(values.joystick_y)]
/ ontrialend = [values.trialcode = "AAT_4"]
/ ontrialend = [values.RT = trial.AAT_4.latency]
/ ontrialend = [values.correct = trial.AAT_4.correct]
/ ontrialend = [values.stimulus = picture.targetstimulus.currentitem]
/ ontrialend = [if (trial.AAT_4.response == "forward") values.initialresponse = "PUSH"
                        else values.initialresponse = "PULL"]
</trial>

with for example

<trial AAT_3>
/ ontrialbegin = [values.selectstimulus = list.category3.nextvalue]
/ ontrialbegin = [values.targetcategory = 2; values.targetformat = "l"]
/ ontrialbegin = [picture.targetstimulus.height = values.startheight_A]

/ ontrialbegin = [values.starttime = script.elapsedtime; values.endtime = 0]
/ ontrialbegin = [values.completeRT = 0; values.changedirection = 0; values.finalresponse=""]

/ stimulusframes = [1 = targetstimulus]
/ validresponse = (back, forward)
/ iscorrectresponse = [(values.expcondition == 1 && trial.AAT_3.response == "forward") ||
                                (values.expcondition == 2 && trial.AAT_3.response == "back")]

/ ontrialend = [if (trial.AAT_3.correct) values.sumRTcorrect_3 += trial.AAT_3.latency]
/ ontrialend = [values.sumRT_3 += trial.AAT_3.latency]

/ ontrialend = [values.joystick_y = joystick.y]
/ ontrialend = [values.joystick_change = abs(values.joystick_y)]
/ ontrialend = [values.trialcode = "AAT_3"]
/ ontrialend = [values.RT = trial.AAT_3.latency]
/ ontrialend = [values.correct = trial.AAT_3.correct]
/ ontrialend = [values.stimulus = picture.targetstimulus.currentitem]
/ ontrialend = [if (trial.AAT_3.response == "forward") values.initialresponse = "PUSH"
                        else values.initialresponse = "PULL"]

/branch = [if (trial.AAT_3.response == "forward") trial.decrease else trial.increase]
/recorddata = false

</trial>

Do you see what's missing in your <trial AAT_4> element? The trial never /branch'es to the decrease or increase trial based on the response, i.e. the AAT_4 sequence ends immediately when you move the joystick, and the next AAT trial starts.