Commit 9f6bb607 authored by Katie Lavigne's avatar Katie Lavigne

update instructions

parent bb95cbb0
stimuli/info.png

33.2 KB | W: | H:

stimuli/info.png

11.3 KB | W: | H:

stimuli/info.png
stimuli/info.png
stimuli/info.png
stimuli/info.png
  • 2-up
  • Swipe
  • Onion skin
stimuli/replay.png

35.3 KB | W: | H:

stimuli/replay.png

11.8 KB | W: | H:

stimuli/replay.png
stimuli/replay.png
stimuli/replay.png
stimuli/replay.png
  • 2-up
  • Swipe
  • Onion skin
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v2022.2.5),
on February 13, 2023, at 15:23
on February 13, 2023, at 21:29
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)
......@@ -135,7 +135,7 @@ mouse.mouseClock = core.Clock()
# --- Initialize components for Routine "instr" ---
titleBox = visual.TextBox2(
win, text='', font='Arial',
pos=(0, 0.42), letterHeight=0.075,
pos=(0, 0.42),units='height', letterHeight=0.075,
size=(1, 0.1), borderWidth=5.0,
color='black', colorSpace='rgb',
opacity=1.0,
......@@ -160,18 +160,26 @@ replayButton = visual.ImageStim(
win=win,
name='replayButton', units='height',
image='stimuli/replay.png', mask=None, anchor='center',
ori=0.0, pos=(0.18, -0.43), size=(0.1, 0.1),
color=[1,1,1], colorSpace='rgb', opacity=1.0,
ori=0.0, pos=(-0.18, -0.43), size=(0.1, 0.1),
color=[1,1,1], colorSpace='rgb', opacity=0.0,
flipHoriz=False, flipVert=False,
texRes=128.0, interpolate=True, depth=-3.0)
beginButton = visual.ImageStim(
win=win,
name='beginButton',
image='stimuli/next.png', mask=None, anchor='center',
ori=0.0, pos=(0.18, -0.43), size=(0.1, 0.1),
color=[1,1,1], colorSpace='rgb', opacity=0.0,
flipHoriz=False, flipVert=False,
texRes=128.0, interpolate=True, depth=-4.0)
infoButton = visual.ImageStim(
win=win,
name='infoButton',
image='stimuli/info.png', mask=None, anchor='center',
ori=0.0, pos=(-0.18, -0.43), size=(0.1, 0.1),
ori=0.0, pos=(0, -0.43), size=(0.1, 0.1),
color=[1,1,1], colorSpace='rgb', opacity=1.0,
flipHoriz=False, flipVert=False,
texRes=128.0, interpolate=True, depth=-4.0)
texRes=128.0, interpolate=True, depth=-5.0)
instrBox = visual.TextBox2(
win, text='', font='Arial',
pos=(0, -0.01), letterHeight=0.025,
......@@ -188,20 +196,6 @@ instrBox = visual.TextBox2(
name='instrBox',
autoLog=True,
)
beginButton = visual.ButtonStim(win,
text='', font='Arial',
pos=(0, -0.43),
letterHeight=0.03,
size=(0.25, 0.075), borderWidth=0.0,
fillColor='darkgrey', borderColor=None,
color='black', colorSpace='rgb',
opacity=None,
bold=True, italic=False,
padding=None,
anchor='center',
name='beginButton'
)
beginButton.buttonClock = core.Clock()
# --- Initialize components for Routine "trial" ---
txtTrial = visual.TextStim(win=win, name='txtTrial',
......@@ -496,14 +490,14 @@ for thisTrial in trials:
# update component parameters for each repeat
# Run 'Begin Routine' code from instrCode
win.color=[0.3569, 0.7412, 0.7961]
ready=False
titleBox.reset()
titleBox.setText(title)
videoInstr.setMovie(videoInstructions)
instrBox.reset()
instrBox.setText(txtInstructions)
beginButton.setText(beginButtonTxt)
# keep track of which components have finished
instrComponents = [titleBox, videoInstr, replayButton, infoButton, instrBox, beginButton]
instrComponents = [titleBox, videoInstr, replayButton, beginButton, infoButton, instrBox]
for thisComponent in instrComponents:
thisComponent.tStart = None
thisComponent.tStop = None
......@@ -540,6 +534,16 @@ for thisTrial in trials:
instrBox.setOpacity(0)
instrBox.text=""
# show beginButton
if videoInstr.status==FINISHED:
beginButton.setOpacity(1)
replayButton.setOpacity(1)
ready=True
#click next after instructions
if beginButton.contains(mouse) & mouse.getPressed()[0]==1 & ready==True:
continueRoutine=False
# *titleBox* updates
if titleBox.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance:
# keep track of start time/frame for later
......@@ -574,6 +578,17 @@ for thisTrial in trials:
thisExp.timestampOnFlip(win, 'replayButton.started')
replayButton.setAutoDraw(True)
# *beginButton* updates
if beginButton.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance:
# keep track of start time/frame for later
beginButton.frameNStart = frameN # exact frame index
beginButton.tStart = t # local t and not account for scr refresh
beginButton.tStartRefresh = tThisFlipGlobal # on global time
win.timeOnFlip(beginButton, 'tStartRefresh') # time at next scr refresh
# add timestamp to datafile
thisExp.timestampOnFlip(win, 'beginButton.started')
beginButton.setAutoDraw(True)
# *infoButton* updates
if infoButton.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance:
# keep track of start time/frame for later
......@@ -596,33 +611,6 @@ for thisTrial in trials:
thisExp.timestampOnFlip(win, 'instrBox.started')
instrBox.setAutoDraw(True)
# *beginButton* updates
if beginButton.status == NOT_STARTED and tThisFlip >= 2-frameTolerance:
# keep track of start time/frame for later
beginButton.frameNStart = frameN # exact frame index
beginButton.tStart = t # local t and not account for scr refresh
beginButton.tStartRefresh = tThisFlipGlobal # on global time
win.timeOnFlip(beginButton, 'tStartRefresh') # time at next scr refresh
# add timestamp to datafile
thisExp.timestampOnFlip(win, 'beginButton.started')
beginButton.setAutoDraw(True)
if beginButton.status == STARTED:
# check whether beginButton has been pressed
if beginButton.isClicked:
if not beginButton.wasClicked:
beginButton.timesOn.append(beginButton.buttonClock.getTime()) # store time of first click
beginButton.timesOff.append(beginButton.buttonClock.getTime()) # store time clicked until
else:
beginButton.timesOff[-1] = beginButton.buttonClock.getTime() # update time clicked until
if not beginButton.wasClicked:
continueRoutine = False # end routine when beginButton is clicked
None
beginButton.wasClicked = True # if beginButton is still clicked next frame, it is not a new click
else:
beginButton.wasClicked = False # if beginButton is clicked next frame, it is a new click
else:
beginButton.wasClicked = False # if beginButton is clicked next frame, it is a new click
# check for quit (typically the Esc key)
if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]):
core.quit()
......@@ -646,13 +634,6 @@ for thisTrial in trials:
if hasattr(thisComponent, "setAutoDraw"):
thisComponent.setAutoDraw(False)
videoInstr.stop()
trials.addData('beginButton.numClicks', beginButton.numClicks)
if beginButton.numClicks:
trials.addData('beginButton.timesOn', beginButton.timesOn)
trials.addData('beginButton.timesOff', beginButton.timesOff)
else:
trials.addData('beginButton.timesOn', "")
trials.addData('beginButton.timesOff', "")
# the Routine "instr" was not non-slip safe, so reset the non-slip timer
routineTimer.reset()
......
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