Millisecond Forums

values.score in trials shows ERROR

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

By uni-student92084 - 1/14/2021

Hello,
In my script I have a 'on trial end' in my trials so I can display a score that changes. In this I have a 'value.scores' function. However, when I run the script I get an error for this function in only two trials. The other trails don't show an error, only two of them. Could someone help me figure out what is wrong with these two trials?

Here is what they look like, I will also attach the script as well.

Thank you so much for your help!!

<trial DemBE_O>
/ validresponse = ("E", "I")
/ correctresponse = ("E")
/ beginresponsetime = 4500
/ontrialbegin = [
  trial.DemBE_O.resetstimulusframes();
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 0);
  values.stim1=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 1500);
  values.stim2=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 3000);
  values.stim3=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 4500);
  values.stim4=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 6000);
  values.stim5=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 7500);
  values.stim6=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 9000);
  values.stim7=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 10500);
  values.stim8=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 12000);
  values.stim9=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 13500);
  values.stim10=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 15000);
  values.stim11=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 16500);
  values.stim12=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 18000);
  values.stim13=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 19500);
  values.stim14=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 21000);
  values.stim15=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 22500);
  values.stim16=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 24000);
  values.stim17=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,25500);
  values.stim18=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,27000);
  values.stim19=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,28500);
  values.stim20=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,30000);
  values.stim21=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,31500);
  values.stim22=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,33000);
  values.stim23=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,34500);
  values.stim24=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,36000);
  values.stim25=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,37500);
  values.stim26=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,39000);
  values.stim27=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,40500);
  values.stim28=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,42000);
  values.stim29=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,43500);
  values.stim30=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,45000);
  values.stim31=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,46500);
  values.stim32=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,48000);
  values.stim33=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,49500);
  values.stim34=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,51000);
  values.stim35=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,54000);
  values.stim36=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,55500);
  values.stim37=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,57000);
  values.stim38=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,58500);
  values.stim39=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,60000);
  values.stim40=list.Demplus_G2.currentvalue;]
/ posttrialpause = 100
/ ontrialend = [
if (trial.DemBE_O.correct) {
 values.score += 0.05;
} else if (trial.DemBE_O.error) {
 values.score -= 0.05;
}




By Dave - 1/14/2021

uni-student92084 - 1/14/2021
Hello,
In my script I have a 'on trial end' in my trials so I can display a score that changes. In this I have a 'value.scores' function. However, when I run the script I get an error for this function in only two trials. The other trails don't show an error, only two of them. Could someone help me figure out what is wrong with these two trials?

Here is what they look like, I will also attach the script as well.

Thank you so much for your help!!

<trial DemBE_O>
/ validresponse = ("E", "I")
/ correctresponse = ("E")
/ beginresponsetime = 4500
/ontrialbegin = [
  trial.DemBE_O.resetstimulusframes();
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 0);
  values.stim1=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 1500);
  values.stim2=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 3000);
  values.stim3=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 4500);
  values.stim4=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 6000);
  values.stim5=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 7500);
  values.stim6=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 9000);
  values.stim7=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 10500);
  values.stim8=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 12000);
  values.stim9=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 13500);
  values.stim10=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 15000);
  values.stim11=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 16500);
  values.stim12=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 18000);
  values.stim13=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 19500);
  values.stim14=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 21000);
  values.stim15=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 22500);
  values.stim16=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 24000);
  values.stim17=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,25500);
  values.stim18=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,27000);
  values.stim19=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,28500);
  values.stim20=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,30000);
  values.stim21=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,31500);
  values.stim22=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,33000);
  values.stim23=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,34500);
  values.stim24=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,36000);
  values.stim25=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,37500);
  values.stim26=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,39000);
  values.stim27=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,40500);
  values.stim28=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,42000);
  values.stim29=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,43500);
  values.stim30=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,45000);
  values.stim31=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,46500);
  values.stim32=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,48000);
  values.stim33=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,49500);
  values.stim34=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,51000);
  values.stim35=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,54000);
  values.stim36=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,55500);
  values.stim37=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,57000);
  values.stim38=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,58500);
  values.stim39=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,60000);
  values.stim40=list.Demplus_G2.currentvalue;]
/ posttrialpause = 100
/ ontrialend = [
if (trial.DemBE_O.correct) {
 values.score += 0.05;
} else if (trial.DemBE_O.error) {
 values.score -= 0.05;
}





values.score is nowhere defined in the script. I.e. there is no

<values>
...
/ score = 0
...
</values>

To be able to use a variable, you need to define it first in your script's <values> element.
By uni-student92084 - 1/14/2021

Dave - 1/14/2021
uni-student92084 - 1/14/2021
Hello,
In my script I have a 'on trial end' in my trials so I can display a score that changes. In this I have a 'value.scores' function. However, when I run the script I get an error for this function in only two trials. The other trails don't show an error, only two of them. Could someone help me figure out what is wrong with these two trials?

Here is what they look like, I will also attach the script as well.

Thank you so much for your help!!

<trial DemBE_O>
/ validresponse = ("E", "I")
/ correctresponse = ("E")
/ beginresponsetime = 4500
/ontrialbegin = [
  trial.DemBE_O.resetstimulusframes();
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 0);
  values.stim1=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 1500);
  values.stim2=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 3000);
  values.stim3=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 4500);
  values.stim4=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 6000);
  values.stim5=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 7500);
  values.stim6=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 9000);
  values.stim7=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 10500);
  values.stim8=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 12000);
  values.stim9=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 13500);
  values.stim10=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 15000);
  values.stim11=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 16500);
  values.stim12=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 18000);
  values.stim13=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 19500);
  values.stim14=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 21000);
  values.stim15=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 22500);
  values.stim16=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue, 24000);
  values.stim17=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,25500);
  values.stim18=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,27000);
  values.stim19=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,28500);
  values.stim20=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,30000);
  values.stim21=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,31500);
  values.stim22=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,33000);
  values.stim23=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,34500);
  values.stim24=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,36000);
  values.stim25=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,37500);
  values.stim26=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,39000);
  values.stim27=list.Demplus_G2.currentvalue;
trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,40500);
  values.stim28=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,42000);
  values.stim29=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,43500);
  values.stim30=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,45000);
  values.stim31=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,46500);
  values.stim32=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,48000);
  values.stim33=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,49500);
  values.stim34=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,51000);
  values.stim35=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,54000);
  values.stim36=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,55500);
  values.stim37=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,57000);
  values.stim38=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,58500);
  values.stim39=list.Demplus_G2.currentvalue;
  trial.DemBE_O.insertstimulustime(list.Demplus_G2.nextvalue,60000);
  values.stim40=list.Demplus_G2.currentvalue;]
/ posttrialpause = 100
/ ontrialend = [
if (trial.DemBE_O.correct) {
 values.score += 0.05;
} else if (trial.DemBE_O.error) {
 values.score -= 0.05;
}





values.score is nowhere defined in the script. I.e. there is no

<values>
...
/ score = 0
...
</values>

To be able to use a variable, you need to define it first in your script's <values> element.

I see, thank you!