This experiment illustrates the use of a global variable and InLine script to award winnings based on the responses made by the subject. The Format function is used to format the winnings into dollar values.
This experiment illustrates the use of a global variable and InLine
script to award winnings (in dollar form) based on the responses
made by the subject.
Attributes are set to allow presentation of the running total of
winnings on each trial as well as the total winnings achieved.
Following the Stimulus presentation, InLine object CalculateReward
adjusts a variable according to whether or not the subject
responded correctly. If the subject responds correctly, the variable
Winnings is increased by 10. If the subject responds incorrectly,
the variable is decreased by a third. In addition, the attribute
TempWinnings is used to maintain a running score for the subject.
The variable Winnings is defined globally in the User Script.
A FeedbackDisplay object is used to inform the subject as to
whether or not they responded correctly, and also references the
attribute TempWinnings to display the subject's running total.
This example runs 4 trials. At the end of the trials, the final total