6.3147 WARNING User requested fullscreen with size [1024 768], but screen is actually [1920, 1080]. Using actual size
1.6063 WARNING Monitor specification not found. Creating a temporary one…
File “C:\Users\Zelal Sila\Documents\DRLLearning\experiment_lastrun.py”, line 572, in
if key_resp.key[1]==corrAns:
AttributeError: ‘Keyboard’ object has no attribute ‘key’
################# Experiment ended with exit code 1 [pid:5964] #################
7862.0705 INFO Loaded monitor calibration from [‘2023_01_12 18:45’]
I tried to add performance eedback at end of each trial, basically correct or incorrect. However I am getting this error message.
I added this code in the end routine in the trial routine.
Two image files, a and b, sometimes A is associated with a reward or punishment. Likewise, B is sometimes associated with a reward or punishment. I also need to accumulate points, but I haven’t
gotten that far yet.
A punishment is -10 and Reward is + 10
Best wishes
well, how do you to determine that A is associated with a reward or a punishment? Random, specific distribution (10% punishment, 90% reward), 50:50? Do you specify this in advance in an Excel-file?
Yes, exactly; I specify the contingencies in reward or punishment in the conditions files, excluding the points. And this conditions file is inserted into the Loop.
When you want these four reward-contingencies you need a condition upon which the value of the reward/punishment is determined. Whether an answer is correct or incorrect can be determined by key you specify in corrAns.
I made two columns for correct points and incorrect points. For the each contingency condition, do I need to add a column with the corresponding points
ok, a correct response to r always gets 10 points, a correct answer to p gets -10 points, an incorrect answer to r or p gets 0 points, right?
So, it is only three conditions not four. A simple way would be the following
if not key_resp.keys:
msg="You failed to respond"
elif key_resp.corr:
if corrAns == 'r':
msg='Correct. You earned 10 points.'
elif corrAns == 'p':
msg='Correct. You earned -10 points.'
else:
msg='Incorrect. Your earned 0 points'
In case you want to use the values provided in columns, use the following:
if not key_resp.keys:
msg="You failed to respond"
elif key_resp.corr:
msg = "Correct. You earned " + str(Correctpoints) + " points."
else:
msg="Incorrect. Your earned " + str(Incorrectpoints) + " points."