This article applies to:
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' List object is run, the 'Correct' attribute in the TrialList is set to determine if a particular level was responded to correctly or incorrectly.
Following the presentation of the 'Stimulus' object, the InLine object 'AwardPoints' adjusts a variable (Points) according to whether or not the user responded correctly. If the user responds correctly, the variable 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 (ALT+7).
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.