If this template helps then use it. If not then just delete and start from scratch.
OS (e.g. Win10):
PsychoPy version (e.g. 1.84.x):
Hello,
I am trying to elicit feedback after a trial block. When the participant responds correctly or incorrectly, he should get a “correct” or “incorrect” message.
I have tried to copy the code from the stroop.extended file in the PsychoPy Demos folder, as it also provides feedback to the a practice trial block.
I have created a code component in the feedback identical to the one in the stroop.extended file (and adapted to the current experiment).
When I open this in the coder view (to see what is going wrong), I have seen the following difference in the lastrun.py files:
Stroop.extended:
# Initialize components for Routine "feedback"
feedbackClock = core.Clock()
#msg variable just needs some value at start
msg=''
feedback_2 = visual.TextStim(win=win, name='feedback_2',
text='default text',
font='Arial',
pos=[0, 0], height=0.1, wrapWidth=None, ori=0,
color=[1,1,1], colorSpace='rgb', opacity=1,
depth=-1.0);
Mine:
# Initialize components for Routine "feedback"
feedbackClock = core.Clock()
#msg variable just needs some value at start
msg=''
write = visual.TextStim(win=win, name='write',
text=msg,
font='Arial',
pos=(0, 0), height=0.1, wrapWidth=None, ori=0,
color='white', colorSpace='rgb', opacity=1,
depth=-1.0);
When I changed the different part, I still received this error:
Running: /Users/aneicardoisasa/Desktop/Encliticos/encliticos_lastrun.py
pyo version 0.8.0 (uses single precision)
34.3129 ERROR Requested audio device ‘auto’ that is not available on this hardware. The ‘audioDevice’ preference should be one of [‘Built-in Output’]
2018-04-04 21:22:41.496 python[17211:4636318] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/8r/pgnd7v4x2_ndbt508ks_lj_r0000gn/T/org.psychopy.PsychoPy2.savedState
/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/visual/text.py:275: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
if text == self.text:
Traceback (most recent call last):
File “/Users/aneicardoisasa/Desktop/Encliticos/encliticos_lastrun.py”, line 333, in
write.setText(msg)
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/visual/text.py”, line 289, in setText
setAttribute(self, ‘text’, text, log)
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/tools/attributetools.py”, line 137, in setAttribute
setattr(self, attrib, value)
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/tools/attributetools.py”, line 27, in set
newValue = self.func(obj, value)
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/visual/text.py”, line 278, in text
self.dict[‘text’] = unicode(text)
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xc2 in position 0: ordinal not in range(128)
Could somebody help?
Thanks!