Millisecond Forums

error messages

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

By mle77 - 9/15/2019

Hi, 
I'm trying to add error messages where if the participant clicks before 714ms (before the stimulus appears) they get an error message for too early and different feedback messages for between 714 and 950, 950 and 1400 and 1400+. I've currently branched it like this, but it's not working properly (keeps showing the wrong feedback): 
/ branch = [if (trial.CS1_rightinvalid == 714) trial.tooearly {
values.points += 5
}]
/ branch = [else if (trial.CS1_rightinvalid == 714 && 950) trial.success2 {
values.points += 25
}]
/ branch = [else if (trial.CS1_rightinvalid == 950 && 1400) trial.success1 {
values.points += 15
}]
/ branch = [ else if (trial.CS1_rightinvalid == >1400) trial.tooslow {
values.points += 0
}]


I also wanted to add a total bar (each response has different points). I've put each of the different responses into values and added an expression to tell the points total to add up all the different values. I've added an example below to show how I put the points with the trial because the total bar stays on 0:

<trial success1>
/ ontrialbegin = [if (trial.CS1_leftinvalid >950 <1400) values.points = 15]
/ ontrialbegin = [if (trial.CS1_leftvalid >950 <1400) values.points = 15]
/ ontrialbegin = [if (trial.CS1_rightinvalid >950 <1400) values.points = 15]
/ ontrialbegin = [if (trial.CS1_rightvalid >950 <1400) values.points = 15]
/ ontrialbegin = [if (trial.CS2_leftinvalid >950 <1400) values.points = 15]
/ ontrialbegin = [if (trial.CS2_leftvalid >950 <1400) values.points = 15]
/ ontrialbegin = [if (trial.CS2_rightinvalid >950 <1400) values.points = 15]
/ ontrialbegin = [if (trial.CS2_rightvalid >950 <1400) values.points = 15]
/ timeout = 10000
/ validresponse = (0)
/ stimulusframes = [1 = success1]


Thank you!
By Dave - 9/15/2019

mle77 - 9/15/2019
Hi, 
I'm trying to add error messages where if the participant clicks before 714ms (before the stimulus appears) they get an error message for too early and different feedback messages for between 714 and 950, 950 and 1400 and 1400+. I've currently branched it like this, but it's not working properly (keeps showing the wrong feedback): 
/ branch = [if (trial.CS1_rightinvalid == 714) trial.tooearly {
values.points += 5
}]
/ branch = [else if (trial.CS1_rightinvalid == 714 && 950) trial.success2 {
values.points += 25
}]
/ branch = [else if (trial.CS1_rightinvalid == 950 && 1400) trial.success1 {
values.points += 15
}]
/ branch = [ else if (trial.CS1_rightinvalid == >1400) trial.tooslow {
values.points += 0
}]


I also wanted to add a total bar (each response has different points). I've put each of the different responses into values and added an expression to tell the points total to add up all the different values. I've added an example below to show how I put the points with the trial because the total bar stays on 0:

<trial success1>
/ ontrialbegin = [if (trial.CS1_leftinvalid >950 <1400) values.points = 15]
/ ontrialbegin = [if (trial.CS1_leftvalid >950 <1400) values.points = 15]
/ ontrialbegin = [if (trial.CS1_rightinvalid >950 <1400) values.points = 15]
/ ontrialbegin = [if (trial.CS1_rightvalid >950 <1400) values.points = 15]
/ ontrialbegin = [if (trial.CS2_leftinvalid >950 <1400) values.points = 15]
/ ontrialbegin = [if (trial.CS2_leftvalid >950 <1400) values.points = 15]
/ ontrialbegin = [if (trial.CS2_rightinvalid >950 <1400) values.points = 15]
/ ontrialbegin = [if (trial.CS2_rightvalid >950 <1400) values.points = 15]
/ timeout = 10000
/ validresponse = (0)
/ stimulusframes = [1 = success1]


Thank you!

What you have there is not valid syntax. First

trial.CS1_rightinvalid

returns absolutely nothing, much less the response latency. If you want to do something based on the trial's latency, you need to use its latency property:

trial.CS1_rightinvalid.latency

The constructs you use in your /branch attributes etc. aren't valid syntax either.

/ branch = [if (trial.CS1_rightinvalid == 714) trial.tooearly {
values.points += 5
}]
/ branch = [else if (trial.CS1_rightinvalid == 714 && 950) trial.success2 {
values.points += 25
}]
/ branch = [else if (trial.CS1_rightinvalid == 950 && 1400) trial.success1 {
values.points += 15
}]
/ branch = [ else if (trial.CS1_rightinvalid == >1400) trial.tooslow {
values.points += 0
}]

The above, formulated properly, ought to read:

<trial CS1_rightinvalid>
...
/ branch = [
if (trial.CS1_rightinvalid.latency < 714) {
values.points += 5;
trial.tooearly;
} else if (trial.CS1_rightinvalid.latency >= 714 && trial.CS1_rightinvalid.latency < 950) {
values.points += 25;
trial.success2;
} else if (trial.CS1_rightinvalid.latency >= 950 && trial.CS1_rightinvalid.latency < 1400) {
values.points += 15;
trial.success1;
} else if (trial.CS1_rightinvalid.latency >= 1400) {
values.points += 0;
trial.tooslow;
}
]
...
</trial>

By mle77 - 9/17/2019

Dave - 9/16/2019
mle77 - 9/15/2019
Hi, 
I'm trying to add error messages where if the participant clicks before 714ms (before the stimulus appears) they get an error message for too early and different feedback messages for between 714 and 950, 950 and 1400 and 1400+. I've currently branched it like this, but it's not working properly (keeps showing the wrong feedback): 
/ branch = [if (trial.CS1_rightinvalid == 714) trial.tooearly {
values.points += 5
}]
/ branch = [else if (trial.CS1_rightinvalid == 714 && 950) trial.success2 {
values.points += 25
}]
/ branch = [else if (trial.CS1_rightinvalid == 950 && 1400) trial.success1 {
values.points += 15
}]
/ branch = [ else if (trial.CS1_rightinvalid == >1400) trial.tooslow {
values.points += 0
}]


I also wanted to add a total bar (each response has different points). I've put each of the different responses into values and added an expression to tell the points total to add up all the different values. I've added an example below to show how I put the points with the trial because the total bar stays on 0:

<trial success1>
/ ontrialbegin = [if (trial.CS1_leftinvalid >950 <1400) values.points = 15]
/ ontrialbegin = [if (trial.CS1_leftvalid >950 <1400) values.points = 15]
/ ontrialbegin = [if (trial.CS1_rightinvalid >950 <1400) values.points = 15]
/ ontrialbegin = [if (trial.CS1_rightvalid >950 <1400) values.points = 15]
/ ontrialbegin = [if (trial.CS2_leftinvalid >950 <1400) values.points = 15]
/ ontrialbegin = [if (trial.CS2_leftvalid >950 <1400) values.points = 15]
/ ontrialbegin = [if (trial.CS2_rightinvalid >950 <1400) values.points = 15]
/ ontrialbegin = [if (trial.CS2_rightvalid >950 <1400) values.points = 15]
/ timeout = 10000
/ validresponse = (0)
/ stimulusframes = [1 = success1]


Thank you!

What you have there is not valid syntax. First

trial.CS1_rightinvalid

returns absolutely nothing, much less the response latency. If you want to do something based on the trial's latency, you need to use its latency property:

trial.CS1_rightinvalid.latency

The constructs you use in your /branch attributes etc. aren't valid syntax either.

/ branch = [if (trial.CS1_rightinvalid == 714) trial.tooearly {
values.points += 5
}]
/ branch = [else if (trial.CS1_rightinvalid == 714 && 950) trial.success2 {
values.points += 25
}]
/ branch = [else if (trial.CS1_rightinvalid == 950 && 1400) trial.success1 {
values.points += 15
}]
/ branch = [ else if (trial.CS1_rightinvalid == >1400) trial.tooslow {
values.points += 0
}]

The above, formulated properly, ought to read:

<trial CS1_rightinvalid>
...
/ branch = [
if (trial.CS1_rightinvalid.latency < 714) {
values.points += 5;
trial.tooearly;
} else if (trial.CS1_rightinvalid.latency >= 714 && trial.CS1_rightinvalid.latency < 950) {
values.points += 25;
trial.success2;
} else if (trial.CS1_rightinvalid.latency >= 950 && trial.CS1_rightinvalid.latency < 1400) {
values.points += 15;
trial.success1;
} else if (trial.CS1_rightinvalid.latency >= 1400) {
values.points += 0;
trial.tooslow;
}
]
...
</trial>


Thank you so much !! 
My total bar is now only keeping the most recent score on there instead of adding them all up. I've added an expression for it to add them all up but it doesn't, do you have any idea why?


By Dave - 9/17/2019

mle77 - 9/17/2019
Dave - 9/16/2019
mle77 - 9/15/2019
Hi, 
I'm trying to add error messages where if the participant clicks before 714ms (before the stimulus appears) they get an error message for too early and different feedback messages for between 714 and 950, 950 and 1400 and 1400+. I've currently branched it like this, but it's not working properly (keeps showing the wrong feedback): 
/ branch = [if (trial.CS1_rightinvalid == 714) trial.tooearly {
values.points += 5
}]
/ branch = [else if (trial.CS1_rightinvalid == 714 && 950) trial.success2 {
values.points += 25
}]
/ branch = [else if (trial.CS1_rightinvalid == 950 && 1400) trial.success1 {
values.points += 15
}]
/ branch = [ else if (trial.CS1_rightinvalid == >1400) trial.tooslow {
values.points += 0
}]


I also wanted to add a total bar (each response has different points). I've put each of the different responses into values and added an expression to tell the points total to add up all the different values. I've added an example below to show how I put the points with the trial because the total bar stays on 0:

<trial success1>
/ ontrialbegin = [if (trial.CS1_leftinvalid >950 <1400) values.points = 15]
/ ontrialbegin = [if (trial.CS1_leftvalid >950 <1400) values.points = 15]
/ ontrialbegin = [if (trial.CS1_rightinvalid >950 <1400) values.points = 15]
/ ontrialbegin = [if (trial.CS1_rightvalid >950 <1400) values.points = 15]
/ ontrialbegin = [if (trial.CS2_leftinvalid >950 <1400) values.points = 15]
/ ontrialbegin = [if (trial.CS2_leftvalid >950 <1400) values.points = 15]
/ ontrialbegin = [if (trial.CS2_rightinvalid >950 <1400) values.points = 15]
/ ontrialbegin = [if (trial.CS2_rightvalid >950 <1400) values.points = 15]
/ timeout = 10000
/ validresponse = (0)
/ stimulusframes = [1 = success1]


Thank you!

What you have there is not valid syntax. First

trial.CS1_rightinvalid

returns absolutely nothing, much less the response latency. If you want to do something based on the trial's latency, you need to use its latency property:

trial.CS1_rightinvalid.latency

The constructs you use in your /branch attributes etc. aren't valid syntax either.

/ branch = [if (trial.CS1_rightinvalid == 714) trial.tooearly {
values.points += 5
}]
/ branch = [else if (trial.CS1_rightinvalid == 714 && 950) trial.success2 {
values.points += 25
}]
/ branch = [else if (trial.CS1_rightinvalid == 950 && 1400) trial.success1 {
values.points += 15
}]
/ branch = [ else if (trial.CS1_rightinvalid == >1400) trial.tooslow {
values.points += 0
}]

The above, formulated properly, ought to read:

<trial CS1_rightinvalid>
...
/ branch = [
if (trial.CS1_rightinvalid.latency < 714) {
values.points += 5;
trial.tooearly;
} else if (trial.CS1_rightinvalid.latency >= 714 && trial.CS1_rightinvalid.latency < 950) {
values.points += 25;
trial.success2;
} else if (trial.CS1_rightinvalid.latency >= 950 && trial.CS1_rightinvalid.latency < 1400) {
values.points += 15;
trial.success1;
} else if (trial.CS1_rightinvalid.latency >= 1400) {
values.points += 0;
trial.tooslow;
}
]
...
</trial>


Thank you so much !! 
My total bar is now only keeping the most recent score on there instead of adding them all up. I've added an expression for it to add them all up but it doesn't, do you have any idea why?



No, I can't say anything about that without the relevant code.