This experiment illustrates the use of a global variable and InLine script to award points based on the responses made by the user.
This experiment illustrates the use of a global variable and InLine script to award points based on the responses made by the user. Attributes are set to allow presentation of the running total of points on each trial as well as the total points achieved.
When the TrialList is run, the Correct attribute on the TrialList is set to determine if a particular level was responded to correctly or incorrectly.
Following the Stimulus presentation, InLine object AwardPoints adjusts a variable according to whether or not the user responded correctly. If the user responds correctly, the variable Points is increased by 10. If the user responds incorrectly, the variable is
decreased by 10. In addition, the attribute TempPoints, is used to maintain a running score for the user. The variable Points is defined globally in the User Script.
A FeedbackDisplay object is used to inform the user as to whether or not they responded correctly, and also references the attribute TempPoints to display the user's running score.
This example runs 4 trials. At the end of the trials, the final score is displayed.