Millisecond Forums

updating points total

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

By charlottebooth - 10/3/2017

I need to make a simple passive avoidance learning task where participants learn to Go or No-Go to different numbers by trial and error, as half the numbers cause a loss in points and the other half cause a gain in points when a Go response is made.

I need to show a running points total so the participant knows whether they made a correct or incorrect response, but I'm not sure what stimulus type this would come under, as it is text (e.g. "10,000") but this points total needs to change according to performance.

I guess I need to use the branch attribute for each trial, but need some help as how exactly to do this, so if correct response add 1000 points, but if incorrect response lose 1000 points (for example).

I'm at the very basic starting stages of this script so any advice most welcome :)
By Dave - 10/4/2017

charlottebooth - Wednesday, October 4, 2017
I need to make a simple passive avoidance learning task where participants learn to Go or No-Go to different numbers by trial and error, as half the numbers cause a loss in points and the other half cause a gain in points when a Go response is made.

I need to show a running points total so the participant knows whether they made a correct or incorrect response, but I'm not sure what stimulus type this would come under, as it is text (e.g. "10,000") but this points total needs to change according to performance.

I guess I need to use the branch attribute for each trial, but need some help as how exactly to do this, so if correct response add 1000 points, but if incorrect response lose 1000 points (for example).

I'm at the very basic starting stages of this script so any advice most welcome :)

You need to create a variable in the <values> element:

<values>
/ pointstotal = 10000
</values>

You can display this variable via a standard <text> element

<text points>
/ items = ("Points: <%values.pointstotal%>")
/ erase = false
/ position = (50%, 10%)
</text>

in your <trial>s and update it there as needed /ontrialend

<trial exampletrial>
/ stimulustimes = [0=points, ....]
...
/ ontrialend = [if (trial.exampletrial.correct) values.pointstotal += 1000;]
/ ontrialend = [if (trial.exampletrial.error) values.pointstotal -= 1000;]
...
</trial>
By charlottebooth - 10/10/2017

Dave - Wednesday, October 4, 2017
charlottebooth - Wednesday, October 4, 2017
I need to make a simple passive avoidance learning task where participants learn to Go or No-Go to different numbers by trial and error, as half the numbers cause a loss in points and the other half cause a gain in points when a Go response is made.

I need to show a running points total so the participant knows whether they made a correct or incorrect response, but I'm not sure what stimulus type this would come under, as it is text (e.g. "10,000") but this points total needs to change according to performance.

I guess I need to use the branch attribute for each trial, but need some help as how exactly to do this, so if correct response add 1000 points, but if incorrect response lose 1000 points (for example).

I'm at the very basic starting stages of this script so any advice most welcome :)

You need to create a variable in the <values> element:

<values>
/ pointstotal = 10000
</values>

You can display this variable via a standard <text> element

<text points>
/ items = ("Points: <%values.pointstotal%>")
/ erase = false
/ position = (50%, 10%)
</text>

in your <trial>s and update it there as needed /ontrialend

<trial exampletrial>
/ stimulustimes = [0=points, ....]
...
/ ontrialend = [if (trial.exampletrial.correct) values.pointstotal += 1000;]
/ ontrialend = [if (trial.exampletrial.error) values.pointstotal -= 1000;]
...
</trial>

Thank you it worked a treat :)