Commit 6348b1c4 authored by Pau Alexander's avatar Pau Alexander

added respond faster messages and store correct manually

parent 8904883f
This diff is collapsed.
......@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v2020.1.3),
on June 19, 2020, at 12:37
on June 19, 2020, at 14:05
If you publish work using this script the most relevant publication is:
Peirce J, Gray JR, Simpson S, MacAskill M, Höchenberger R, Sogo H, Kastman E, Lindeløv JK. (2019)
......@@ -175,6 +175,16 @@ sound_1Encoding = sound.Sound('A', secs=-1, stereo=True, hamming=True,
name='sound_1Encoding')
sound_1Encoding.setVolume(1)
# Initialize components for Routine "RespondFasterEncoding"
RespondFasterEncodingClock = core.Clock()
textRespondFasterEncoding = visual.TextStim(win=win, name='textRespondFasterEncoding',
text='Respond faster please!',
font='Arial',
pos=(0, 0), height=0.1, wrapWidth=None, ori=0,
color='red', colorSpace='rgb', opacity=1,
languageStyle='LTR',
depth=-1.0);
# Initialize components for Routine "EncodingPause"
EncodingPauseClock = core.Clock()
TextBreakEncoding = visual.TextStim(win=win, name='TextBreakEncoding',
......@@ -788,7 +798,7 @@ for thisEncodingpractice in Encodingpractice:
routineTimer.add(1.000000)
# update component parameters for each repeat
if not responseEncoding.keys :
msg="Failed to respond"
msg="Respond faster please!"
msgcolor='red'
else: #stored on last run routine
msg="You responded"
......@@ -1192,6 +1202,79 @@ for thisEncoding in Encoding:
# the Routine "trialEncoding" was not non-slip safe, so reset the non-slip timer
routineTimer.reset()
# ------Prepare to start Routine "RespondFasterEncoding"-------
continueRoutine = True
routineTimer.add(1.000000)
# update component parameters for each repeat
if not responseEncoding.keys :
msg="Respond faster please!"
else: #stored on last run routine
continueRoutine = False
# keep track of which components have finished
RespondFasterEncodingComponents = [textRespondFasterEncoding]
for thisComponent in RespondFasterEncodingComponents:
thisComponent.tStart = None
thisComponent.tStop = None
thisComponent.tStartRefresh = None
thisComponent.tStopRefresh = None
if hasattr(thisComponent, 'status'):
thisComponent.status = NOT_STARTED
# reset timers
t = 0
_timeToFirstFrame = win.getFutureFlipTime(clock="now")
RespondFasterEncodingClock.reset(-_timeToFirstFrame) # t0 is time of first possible flip
frameN = -1
# -------Run Routine "RespondFasterEncoding"-------
while continueRoutine and routineTimer.getTime() > 0:
# get current time
t = RespondFasterEncodingClock.getTime()
tThisFlip = win.getFutureFlipTime(clock=RespondFasterEncodingClock)
tThisFlipGlobal = win.getFutureFlipTime(clock=None)
frameN = frameN + 1 # number of completed frames (so 0 is the first frame)
# update/draw components on each frame
# *textRespondFasterEncoding* updates
if textRespondFasterEncoding.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance:
# keep track of start time/frame for later
textRespondFasterEncoding.frameNStart = frameN # exact frame index
textRespondFasterEncoding.tStart = t # local t and not account for scr refresh
textRespondFasterEncoding.tStartRefresh = tThisFlipGlobal # on global time
win.timeOnFlip(textRespondFasterEncoding, 'tStartRefresh') # time at next scr refresh
textRespondFasterEncoding.setAutoDraw(True)
if textRespondFasterEncoding.status == STARTED:
# is it time to stop? (based on global clock, using actual start)
if tThisFlipGlobal > textRespondFasterEncoding.tStartRefresh + 1.0-frameTolerance:
# keep track of stop time/frame for later
textRespondFasterEncoding.tStop = t # not accounting for scr refresh
textRespondFasterEncoding.frameNStop = frameN # exact frame index
win.timeOnFlip(textRespondFasterEncoding, 'tStopRefresh') # time at next scr refresh
textRespondFasterEncoding.setAutoDraw(False)
# check for quit (typically the Esc key)
if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]):
core.quit()
# check if all components have finished
if not continueRoutine: # a component has requested a forced-end of Routine
break
continueRoutine = False # will revert to True if at least one component still running
for thisComponent in RespondFasterEncodingComponents:
if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
continueRoutine = True
break # at least one component has not yet finished
# refresh the screen
if continueRoutine: # don't flip if this routine is over or we'll get a blank screen
win.flip()
# -------Ending Routine "RespondFasterEncoding"-------
for thisComponent in RespondFasterEncodingComponents:
if hasattr(thisComponent, "setAutoDraw"):
thisComponent.setAutoDraw(False)
Encoding.addData('textRespondFasterEncoding.started', textRespondFasterEncoding.tStartRefresh)
Encoding.addData('textRespondFasterEncoding.stopped', textRespondFasterEncoding.tStopRefresh)
# ------Prepare to start Routine "EncodingPause"-------
continueRoutine = True
# update component parameters for each repeat
......
This diff is collapsed.
This diff is collapsed.
participant,session,date,expName,psychopyVersion,frameRate,
0.9208 WARNING Requested audio device 'Altavoz/Auricular (2- Realtek(R' that is not available on this hardware. The 'audioDevice' preference should be one of ['Altavoz/Auricular (2- Realtek(R) Audio)', 'LG TV (NVIDIA High Definition Audio)']
6.4356 WARNING User requested fullscreen with size [1536 864], but screen is actually [1920, 1080]. Using actual size
8.4398 EXP Created window1 = Window(allowGUI=False, allowStencil=False, args=UNKNOWN, autoLog=True, bitsMode=UNKNOWN, blendMode='avg', bpc=(8, 8, 8), color=array([0., 0., 0.]), colorSpace='rgb', depthBits=8, fullscr=<method-wrapper '__getattribute__' of attributeSetter object at 0x0000020C9E25FA58>, gamma=None, gammaErrorPolicy='raise', kwargs=UNKNOWN, lms=UNKNOWN, monitor=<psychopy.monitors.calibTools.Monitor object at 0x0000020C9E14C7B8>, multiSample=False, name='window1', numSamples=2, pos=[0.0, 0.0], screen=0, size=array([1920, 1080]), stencilBits=0, stereo=False, units='height', useFBO=True, useRetina=False, viewOri=0.0, viewPos=None, viewScale=None, waitBlanking=True, winType='pyglet')
8.4398 EXP window1: recordFrameIntervals = False
8.6057 EXP window1: recordFrameIntervals = True
8.7899 EXP window1: recordFrameIntervals = False
8.8986 EXP Created text_description_consent = TextStim(__class__=<class 'psychopy.visual.text.TextStim'>, alignHoriz=method-wrapper(...), alignText='center', alignVert=method-wrapper(...), anchorHoriz='center', anchorVert='center', antialias=True, autoLog=True, bold=False, color='white', colorSpace='named', contrast=1.0, depth=0.0, flipHoriz=False, flipVert=False, font='Arial', fontFiles=[], height=0.03, italic=False, languageStyle='LTR', name='text_description_consent', opacity=1.0, ori=0, pos=array([0., 0.]), rgb=array([255., 255., 255.]), text='default text', units='height', win=Window(...), wrapWidth=1)
8.9425 EXP Created EncodinginstructionsText = TextStim(__class__=<class 'psychopy.visual.text.TextStim'>, alignHoriz=method-wrapper(...), alignText='center', alignVert=method-wrapper(...), anchorHoriz='center', anchorVert='center', antialias=True, autoLog=True, bold=False, color='white', colorSpace='named', contrast=1.0, depth=0.0, flipHoriz=False, flipVert=False, font='Arial', fontFiles=[], height=0.04, italic=False, languageStyle='LTR', name='EncodinginstructionsText', opacity=1.0, ori=0, pos=array([0., 0.]), rgb=array([255., 255., 255.]), text=str(...), units='height', win=Window(...), wrapWidth=1)
8.9438 EXP Created polygonIsiEncoding = ShapeStim(__class__=<class 'psychopy.visual.shape.ShapeStim'>, autoDraw=False, autoLog=True, closeShape=True, contrast=1.0, depth=0.0, fillColor=array([1., 1., 1.]), fillColorSpace='rgb', interpolate=True, lineColor=array([1., 1., 1.]), lineColorSpace='rgb', lineWidth=0.25, name='polygonIsiEncoding', opacity=1.0, ori=array(0.), pos=array([0., 0.]), size=array([0.1, 0.1]), units='height', vertices=ndarray(...), win=Window(...), windingRule=None)
8.9454 EXP Created imageEncoding = ImageStim(__class__=<class 'psychopy.visual.image.ImageStim'>, autoLog=True, color=array([1., 1., 1.]), colorSpace='rgb', contrast=1.0, depth=-1.0, flipHoriz=False, flipVert=False, image='sin', interpolate=True, mask=None, maskParams=None, name='imageEncoding', opacity=1.0, ori=0.0, pos=array([0., 0.]), size=array([0.5, 0.5]), texRes=128, units='height', win=Window(...))
9.0049 EXP Sound sound_1Encoding set volume 1.000
9.0209 EXP Created text_10EncodingPracticeFeedback = TextStim(__class__=<class 'psychopy.visual.text.TextStim'>, alignHoriz=method-wrapper(...), alignText='center', alignVert=method-wrapper(...), anchorHoriz='center', anchorVert='center', antialias=True, autoLog=True, bold=False, color='white', colorSpace='named', contrast=1.0, depth=-1.0, flipHoriz=False, flipVert=False, font='Arial', fontFiles=[], height=0.1, italic=False, languageStyle='LTR', name='text_10EncodingPracticeFeedback', opacity=1.0, ori=0, pos=array([0., 0.]), rgb=array([255., 255., 255.]), text='default text', units='height', win=Window(...), wrapWidth=1)
9.0416 EXP Created text_EncodingInstructionsReminder = TextStim(__class__=<class 'psychopy.visual.text.TextStim'>, alignHoriz=method-wrapper(...), alignText='center', alignVert=method-wrapper(...), anchorHoriz='center', anchorVert='center', antialias=True, autoLog=True, bold=False, color='white', colorSpace='named', contrast=1.0, depth=0.0, flipHoriz=False, flipVert=False, font='Arial', fontFiles=[], height=0.04, italic=False, languageStyle='LTR', name='text_EncodingInstructionsReminder', opacity=1.0, ori=0, pos=array([0., 0.]), rgb=array([255., 255., 255.]), text=str(...), units='height', win=Window(...), wrapWidth=1)
9.0428 EXP Created polygonIsiEncoding = ShapeStim(__class__=<class 'psychopy.visual.shape.ShapeStim'>, autoDraw=False, autoLog=True, closeShape=True, contrast=1.0, depth=0.0, fillColor=array([1., 1., 1.]), fillColorSpace='rgb', interpolate=True, lineColor=array([1., 1., 1.]), lineColorSpace='rgb', lineWidth=0.25, name='polygonIsiEncoding', opacity=1.0, ori=array(0.), pos=array([0., 0.]), size=array([0.1, 0.1]), units='height', vertices=ndarray(...), win=Window(...), windingRule=None)
9.0446 EXP Created imageEncoding = ImageStim(__class__=<class 'psychopy.visual.image.ImageStim'>, autoLog=True, color=array([1., 1., 1.]), colorSpace='rgb', contrast=1.0, depth=-1.0, flipHoriz=False, flipVert=False, image='sin', interpolate=True, mask=None, maskParams=None, name='imageEncoding', opacity=1.0, ori=0.0, pos=array([0., 0.]), size=array([0.5, 0.5]), texRes=128, units='height', win=Window(...))
9.0658 EXP Sound sound_1Encoding set volume 1.000
9.2104 EXP window1: mouseVisible = True
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment