Commit f93becb5 authored by HSINYUAN CHEN's avatar HSINYUAN CHEN

_

parent 36ab4904
......@@ -89,8 +89,8 @@
<Param name="Each JS Frame" updates="constant" val="" valType="extendedCode"/>
<Param name="End Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="End JS Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="End JS Routine" updates="constant" val="if (resp.corr) {&amp;#10; number_correct = (number_correct + 1);&amp;#10; console.log((&quot;Correct: &quot; + number_correct.toString()));&amp;#10;} else {&amp;#10; console.log(&quot;Not correct&quot;);&amp;#10;}&amp;#10;if (((trials1.thisN + 1) === trials1.nTotal)) {&amp;#10; if (((number_correct / (trials1.nTotal + 1)) &gt;= 0.85)) {&amp;#10; trials2.finished = true;&amp;#10; console.log(&quot;Finished.&quot;);&amp;#10; } else {&amp;#10; console.log((&quot;Score: &quot; + (number_correct / (trials1.nTotal + 1)).toString()));&amp;#10; }&amp;#10;} else {&amp;#10; console.log((&quot;Trial: &quot; + trials1.thisN.toString()));&amp;#10;}&amp;#10;" valType="extendedCode"/>
<Param name="End Routine" updates="constant" val="if resp.corr:&amp;#10; number_correct = number_correct + 1&amp;#10; print('Correct: ' + str(number_correct))&amp;#10;else:&amp;#10; print('Not correct')&amp;#10;&amp;#10;if trials1.thisN + 1 == trials1.nTotal:&amp;#10; if number_correct/(trials1.nTotal + 1) &gt;= 0.85:&amp;#10; trials2.finished = True&amp;#10; print('Finished.')&amp;#10; else:&amp;#10; print('Score: ' + str(number_correct/(trials1.nTotal + 1)))&amp;#10;else:&amp;#10; print('Trial: ' + str(trials1.thisN))" valType="extendedCode"/>
<Param name="End JS Routine" updates="constant" val="if (resp.corr) {&amp;#10; number_correct = (number_correct + 1);&amp;#10; console.log((&quot;Correct: &quot; + number_correct.toString()));&amp;#10;} else {&amp;#10; console.log(&quot;Not correct&quot;);&amp;#10;}&amp;#10;if (((trials1.thisN + 1) === trials1.nTotal)) {&amp;#10; if (((number_correct / (trials1.nTotal + 1)) &gt;= 0.3)) {&amp;#10; trials2.finished = true;&amp;#10; console.log(&quot;Finished.&quot;);&amp;#10; } else {&amp;#10; console.log((&quot;Score: &quot; + (number_correct / (trials1.nTotal + 1)).toString()));&amp;#10; }&amp;#10;} else {&amp;#10; console.log((&quot;Trial: &quot; + trials1.thisN.toString()));&amp;#10;}&amp;#10;" valType="extendedCode"/>
<Param name="End Routine" updates="constant" val="if resp.corr:&amp;#10; number_correct = number_correct + 1&amp;#10; print('Correct: ' + str(number_correct))&amp;#10;else:&amp;#10; print('Not correct')&amp;#10;&amp;#10;if trials1.thisN + 1 == trials1.nTotal:&amp;#10; if number_correct/(trials1.nTotal + 1) &gt;= 0.3:&amp;#10; trials2.finished = True&amp;#10; print('Finished.')&amp;#10; else:&amp;#10; print('Score: ' + str(number_correct/(trials1.nTotal + 1)))&amp;#10;else:&amp;#10; print('Trial: ' + str(trials1.thisN))" valType="extendedCode"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="name" updates="None" val="code" valType="code"/>
</CodeComponent>
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v2020.2.8),
on Mon Dec 7 21:09:48 2020
This experiment was created using PsychoPy3 Experiment Builder (v2020.1.3),
on Tue Dec 8 19:10:32 2020
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)
......@@ -13,6 +13,10 @@ If you publish work using this script the most relevant publication is:
from __future__ import absolute_import, division
import psychopy
psychopy.useVersion('2020.1')
from psychopy import locale_setup
from psychopy import prefs
from psychopy import sound, gui, visual, core, data, event, logging, clock
......@@ -35,7 +39,7 @@ _thisDir = os.path.dirname(os.path.abspath(__file__))
os.chdir(_thisDir)
# Store info about the experiment session
psychopyVersion = '2020.2.8'
psychopyVersion = '2020.1.3'
expName = 'IncorrectStopEXP' # from the Builder filename that created this script
expInfo = {'session': '01', 'participant': ''}
dlg = gui.DlgFromDict(dictionary=expInfo, sortKeys=False, title=expName)
......@@ -51,21 +55,21 @@ filename = _thisDir + os.sep + u'data' + os.sep + '%s_%s' % (expInfo['participan
# An ExperimentHandler isn't essential but helps with data saving
thisExp = data.ExperimentHandler(name=expName, version='',
extraInfo=expInfo, runtimeInfo=None,
originPath='/Users/chenhsinyuan/Documents/EXP/OLEXP/PsychopyTPL/RepeatIncorrectTPL/IncorrectStopEXP_lastrun.py',
originPath='/Users/thomaschen/Documents/EXP/OLEXP/PsychopyTPL/RepeatIncorrectTPL/IncorrectStopEXP_lastrun.py',
savePickle=True, saveWideText=True,
dataFileName=filename)
# save a log file for detail verbose info
logFile = logging.LogFile(filename+'.log', level=logging.WARNING)
logFile = logging.LogFile(filename+'.log', level=logging.DEBUG)
logging.console.setLevel(logging.WARNING) # this outputs to the screen, not a file
endExpNow = False # flag for 'escape' or other condition => quit the exp
frameTolerance = 0.001 # how close to onset before 'same' frame
# Start Code - component code to be run after the window creation
# Start Code - component code to be run before the window creation
# Setup the Window
win = visual.Window(
size=[2560, 1440], fullscr=True, screen=0,
size=[1920, 1080], fullscr=True, screen=0,
winType='pyglet', allowGUI=False, allowStencil=False,
monitor='testMonitor', color='black', colorSpace='rgb',
blendMode='avg', useFBO=True,
......@@ -356,7 +360,7 @@ for thisTrials2 in trials2:
print('Not correct')
if trials1.thisN + 1 == trials1.nTotal:
if number_correct/(trials1.nTotal + 1) >= 0.85:
if number_correct/(trials1.nTotal + 1) >= 0.3:
trials2.finished = True
print('Finished.')
else:
......@@ -466,7 +470,7 @@ thisExp.addData('thanksText.stopped', thanksText.tStopRefresh)
win.flip()
# these shouldn't be strictly necessary (should auto-save)
thisExp.saveAsWideText(filename+'.csv', delim='auto')
thisExp.saveAsWideText(filename+'.csv')
thisExp.saveAsPickle(filename)
logging.flush()
# make sure everything is closed down
......
text,letterColor,corrAns,congruent,trials2.thisRepN,trials2.thisTrialN,trials2.thisN,trials2.thisIndex,trials1.thisRepN,trials1.thisTrialN,trials1.thisN,trials1.thisIndex,instrText.started,instrText.stopped,word.started,word.stopped,resp.keys,resp.corr,resp.rt,resp.started,resp.stopped,thanksText.started,thanksText.stopped,session,participant,date,expName,psychopyVersion,frameRate,
red,green,down,0,0,0,0,0,0,0,0,1,19.684408551009255,None,21.295928013001685,None,down,1,0.9502579959953437,21.295928013001685,None,,,01,,2020_Dec_08_1907,IncorrectStopEXP,2020.1.3,59.95069954022122,
red,red,left,1,0,0,0,0,0,1,1,0,,,22.745829293009592,None,left,1,0.572370743000647,22.745829293009592,None,,,01,,2020_Dec_08_1907,IncorrectStopEXP,2020.1.3,59.95069954022122,
blue,red,left,0,0,0,0,0,0,2,2,5,,,23.82976132001204,None,left,1,1.2884124720003456,23.82976132001204,None,,,01,,2020_Dec_08_1907,IncorrectStopEXP,2020.1.3,59.95069954022122,
green,green,down,1,0,0,0,0,0,3,3,2,,,25.629624510009307,None,down,1,0.640673332993174,25.629624510009307,None,,,01,,2020_Dec_08_1907,IncorrectStopEXP,2020.1.3,59.95069954022122,
green,blue,right,0,0,0,0,0,0,4,4,3,,,26.779633550002472,None,right,1,0.6745998340047663,26.779633550002472,None,,,01,,2020_Dec_08_1907,IncorrectStopEXP,2020.1.3,59.95069954022122,
blue,blue,right,1,0,0,0,0,0,5,5,4,,,27.96294960200612,None,right,1,0.47523487800208386,27.96294960200612,None,,,01,,2020_Dec_08_1907,IncorrectStopEXP,2020.1.3,59.95069954022122,
,,,,0,0,0,0,,,,,,,,,,,,,,,,01,,2020_Dec_08_1907,IncorrectStopEXP,2020.1.3,59.95069954022122,
,,,,,,,,,,,,,,,,,,,,,28.52671455401287,None,,,,,,,
7.1095 WARNING We strongly recommend you activate the PTB sound engine in PsychoPy prefs as the preferred audio engine. Its timing is vastly superior. Your prefs are currently set to use ['sounddevice', 'PTB', 'pyo', 'pygame'] (in that order).
17.0849 INFO Loaded monitor calibration from ['2020_11_28 20:50']
18.4468 EXP Created window1 = Window(allowGUI=False, allowStencil=False, args=UNKNOWN, autoLog=True, bitsMode=UNKNOWN, blendMode='avg', bpc=(8, 8, 8), color='black', colorSpace='named', depthBits=8, fullscr=<method-wrapper '__getattribute__' of attributeSetter object at 0x7fb18be529b0>, gamma=None, gammaErrorPolicy='raise', kwargs=UNKNOWN, lms=UNKNOWN, monitor=<psychopy.monitors.calibTools.Monitor object at 0x7fb18bf1f5f8>, multiSample=False, name='window1', numSamples=2, pos=[0.0, 0.0], screen=0, size=array([1920, 1080]), stencilBits=0, stereo=False, units='norm', useFBO=True, useRetina=False, viewOri=0.0, viewPos=None, viewScale=None, waitBlanking=True, winType='pyglet')
18.4468 EXP window1: recordFrameIntervals = False
18.6129 EXP window1: recordFrameIntervals = True
18.7968 DEBUG Screen (0) actual frame rate measured at 59.95
18.7968 EXP window1: recordFrameIntervals = False
19.3694 EXP Created instrText = 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=array([1., 1., 1.]), colorSpace='rgb', contrast=1.0, depth=0.0, flipHoriz=False, flipVert=False, font='Arial', fontFiles=[], height=0.1, italic=False, languageStyle='LTR', name='instrText', opacity=1.0, ori=0, pos=array([0., 0.]), rgb=array([1., 1., 1.]), text=str(...), units='norm', win=Window(...), wrapWidth=1)
19.5144 EXP Created word = 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.2, italic=False, languageStyle='LTR', name='word', opacity=1.0, ori=0, pos=array([0., 0.]), rgb=array([255., 255., 255.]), text='default text', units='norm', win=Window(...), wrapWidth=1)
19.6715 EXP Created thanksText = 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=array([1., 1., 1.]), colorSpace='rgb', contrast=1.0, depth=0.0, flipHoriz=False, flipVert=False, font='arial', fontFiles=[], height=0.1, italic=False, languageStyle='LTR', name='thanksText', opacity=1.0, ori=0, pos=array([0., 0.]), rgb=array([1., 1., 1.]), text=str(...), units='norm', win=Window(...), wrapWidth=1)
19.6721 EXP Created sequence: random, trialTypes=1, nReps=10, seed=None
19.6724 EXP New trial (rep=0, index=0): None
19.6844 EXP instrText: autoDraw = True
20.7862 DEBUG Read csv file with pandas: trialTypes.csv
20.7897 DEBUG Clearing unnamed columns from trialTypes.csv
20.7912 EXP Imported trialTypes.csv as conditions, 6 conditions, 4 params
20.7921 EXP Created sequence: random, trialTypes=6, nReps=1, seed=None
20.7925 EXP New trial (rep=0, index=0): OrderedDict([('text', 'red'), ('letterColor', 'green'), ('corrAns', 'down'), ('congruent', 0)])
20.8433 EXP instrText: autoDraw = False
20.8433 EXP word: color = 'green (named)'
20.8433 EXP word: text = 'red'
21.2959 EXP word: autoDraw = True
22.2489 EXP New trial (rep=0, index=1): OrderedDict([('text', 'red'), ('letterColor', 'red'), ('corrAns', 'left'), ('congruent', 1)])
22.2625 EXP word: autoDraw = False
22.2625 EXP word: color = 'red (named)'
22.2625 EXP word: text = 'red'
22.7458 EXP word: autoDraw = True
23.3308 EXP New trial (rep=0, index=2): OrderedDict([('text', 'blue'), ('letterColor', 'red'), ('corrAns', 'left'), ('congruent', 0)])
23.3471 EXP word: autoDraw = False
23.3471 EXP word: color = 'red (named)'
23.3471 EXP word: text = 'blue'
23.8298 EXP word: autoDraw = True
25.1309 EXP New trial (rep=0, index=3): OrderedDict([('text', 'green'), ('letterColor', 'green'), ('corrAns', 'down'), ('congruent', 1)])
25.1498 EXP word: autoDraw = False
25.1498 EXP word: color = 'green (named)'
25.1498 EXP word: text = 'green'
25.6296 EXP word: autoDraw = True
26.2810 EXP New trial (rep=0, index=4): OrderedDict([('text', 'green'), ('letterColor', 'blue'), ('corrAns', 'right'), ('congruent', 0)])
26.2963 EXP word: autoDraw = False
26.2963 EXP word: color = 'blue (named)'
26.2963 EXP word: text = 'green'
26.7796 EXP word: autoDraw = True
27.4648 EXP New trial (rep=0, index=5): OrderedDict([('text', 'blue'), ('letterColor', 'blue'), ('corrAns', 'right'), ('congruent', 1)])
27.4796 EXP word: autoDraw = False
27.4796 EXP word: color = 'blue (named)'
27.4796 EXP word: text = 'blue'
27.9629 EXP word: autoDraw = True
28.5267 EXP word: autoDraw = False
28.5267 EXP thanksText: autoDraw = True
30.4797 EXP thanksText: autoDraw = False
30.4809 INFO saved data to '/Users/thomaschen/Documents/EXP/OLEXP/PsychopyTPL/RepeatIncorrectTPL/data/_2020_Dec_08_1907.csv'
30.4818 INFO saved data to /Users/thomaschen/Documents/EXP/OLEXP/PsychopyTPL/RepeatIncorrectTPL/data/_2020_Dec_08_1907.psydat
31.0154 EXP window1: mouseVisible = True
31.0157 DEBUG Saving data for IncorrectStopEXP ExperimentHandler
text,letterColor,corrAns,congruent,trials2.thisRepN,trials2.thisTrialN,trials2.thisN,trials2.thisIndex,trials1.thisRepN,trials1.thisTrialN,trials1.thisN,trials1.thisIndex,instrText.started,instrText.stopped,word.started,word.stopped,resp.keys,resp.corr,resp.rt,resp.started,resp.stopped,thanksText.started,thanksText.stopped,session,participant,date,expName,psychopyVersion,frameRate,
blue,red,left,0,0,0,0,0,0,0,0,5,14.41403567699308,None,16.028293372000917,None,left,1,2.644935465999879,16.028293372000917,None,,,01,,2020_Dec_08_1908,IncorrectStopEXP,2020.1.3,59.90302813854648,
red,red,left,1,0,0,0,0,0,1,1,0,,,19.17546270499588,None,left,1,0.4737476910086116,19.17546270499588,None,,,01,,2020_Dec_08_1908,IncorrectStopEXP,2020.1.3,59.90302813854648,
green,blue,right,0,0,0,0,0,0,2,2,3,,,20.158890334001626,None,right,1,0.610269586002687,20.158890334001626,None,,,01,,2020_Dec_08_1908,IncorrectStopEXP,2020.1.3,59.90302813854648,
red,green,down,0,0,0,0,0,0,3,3,1,,,21.27579267299734,None,down,1,0.5894083770108409,21.27579267299734,None,,,01,,2020_Dec_08_1908,IncorrectStopEXP,2020.1.3,59.90302813854648,
blue,blue,right,1,0,0,0,0,0,4,4,4,,,22.375722822995158,None,right,1,0.577477490005549,22.375722822995158,None,,,01,,2020_Dec_08_1908,IncorrectStopEXP,2020.1.3,59.90302813854648,
green,green,down,1,0,0,0,0,0,5,5,2,,,23.459300481990795,None,down,1,0.6780447760102106,23.459300481990795,None,,,01,,2020_Dec_08_1908,IncorrectStopEXP,2020.1.3,59.90302813854648,
,,,,0,0,0,0,,,,,,,,,,,,,,,,01,,2020_Dec_08_1908,IncorrectStopEXP,2020.1.3,59.90302813854648,
,,,,,,,,,,,,,,,,,,,,,24.19866840999748,None,,,,,,,
7.2321 WARNING We strongly recommend you activate the PTB sound engine in PsychoPy prefs as the preferred audio engine. Its timing is vastly superior. Your prefs are currently set to use ['sounddevice', 'PTB', 'pyo', 'pygame'] (in that order).
12.9198 INFO Loaded monitor calibration from ['2020_11_28 20:50']
13.5429 EXP Created window1 = Window(allowGUI=False, allowStencil=False, args=UNKNOWN, autoLog=True, bitsMode=UNKNOWN, blendMode='avg', bpc=(8, 8, 8), color='black', colorSpace='named', depthBits=8, fullscr=<method-wrapper '__getattribute__' of attributeSetter object at 0x7fabc76529b0>, gamma=None, gammaErrorPolicy='raise', kwargs=UNKNOWN, lms=UNKNOWN, monitor=<psychopy.monitors.calibTools.Monitor object at 0x7fabc80205f8>, multiSample=False, name='window1', numSamples=2, pos=[0.0, 0.0], screen=0, size=array([1920, 1080]), stencilBits=0, stereo=False, units='norm', useFBO=True, useRetina=False, viewOri=0.0, viewPos=None, viewScale=None, waitBlanking=True, winType='pyglet')
13.5430 EXP window1: recordFrameIntervals = False
13.7095 EXP window1: recordFrameIntervals = True
13.8930 DEBUG Screen (0) actual frame rate measured at 59.90
13.8931 EXP window1: recordFrameIntervals = False
14.1168 EXP Created instrText = 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=array([1., 1., 1.]), colorSpace='rgb', contrast=1.0, depth=0.0, flipHoriz=False, flipVert=False, font='Arial', fontFiles=[], height=0.1, italic=False, languageStyle='LTR', name='instrText', opacity=1.0, ori=0, pos=array([0., 0.]), rgb=array([1., 1., 1.]), text=str(...), units='norm', win=Window(...), wrapWidth=1)
14.2547 EXP Created word = 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.2, italic=False, languageStyle='LTR', name='word', opacity=1.0, ori=0, pos=array([0., 0.]), rgb=array([255., 255., 255.]), text='default text', units='norm', win=Window(...), wrapWidth=1)
14.4022 EXP Created thanksText = 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=array([1., 1., 1.]), colorSpace='rgb', contrast=1.0, depth=0.0, flipHoriz=False, flipVert=False, font='arial', fontFiles=[], height=0.1, italic=False, languageStyle='LTR', name='thanksText', opacity=1.0, ori=0, pos=array([0., 0.]), rgb=array([1., 1., 1.]), text=str(...), units='norm', win=Window(...), wrapWidth=1)
14.4027 EXP Created sequence: random, trialTypes=1, nReps=10, seed=None
14.4030 EXP New trial (rep=0, index=0): None
14.4140 EXP instrText: autoDraw = True
15.5151 DEBUG Read csv file with pandas: trialTypes.csv
15.5180 DEBUG Clearing unnamed columns from trialTypes.csv
15.5187 EXP Imported trialTypes.csv as conditions, 6 conditions, 4 params
15.5194 EXP Created sequence: random, trialTypes=6, nReps=1, seed=None
15.5198 EXP New trial (rep=0, index=0): OrderedDict([('text', 'blue'), ('letterColor', 'red'), ('corrAns', 'left'), ('congruent', 0)])
15.5387 DATA Keypress: left
15.5474 EXP instrText: autoDraw = False
15.5474 EXP word: color = 'red (named)'
15.5474 EXP word: text = 'blue'
16.0283 EXP word: autoDraw = True
18.6778 EXP New trial (rep=0, index=1): OrderedDict([('text', 'red'), ('letterColor', 'red'), ('corrAns', 'left'), ('congruent', 1)])
18.6850 DATA Keypress: left
18.6947 EXP word: autoDraw = False
18.6947 EXP word: color = 'red (named)'
18.6947 EXP word: text = 'red'
19.1755 EXP word: autoDraw = True
19.6601 EXP New trial (rep=0, index=2): OrderedDict([('text', 'green'), ('letterColor', 'blue'), ('corrAns', 'right'), ('congruent', 0)])
19.6657 DATA Keypress: left
19.6759 EXP word: autoDraw = False
19.6759 EXP word: color = 'blue (named)'
19.6759 EXP word: text = 'green'
20.1589 EXP word: autoDraw = True
20.7775 EXP New trial (rep=0, index=3): OrderedDict([('text', 'red'), ('letterColor', 'green'), ('corrAns', 'down'), ('congruent', 0)])
20.7810 DATA Keypress: right
20.7925 EXP word: autoDraw = False
20.7925 EXP word: color = 'green (named)'
20.7925 EXP word: text = 'red'
21.2758 EXP word: autoDraw = True
21.8769 EXP New trial (rep=0, index=4): OrderedDict([('text', 'blue'), ('letterColor', 'blue'), ('corrAns', 'right'), ('congruent', 1)])
21.8800 DATA Keypress: down
21.8922 EXP word: autoDraw = False
21.8922 EXP word: color = 'blue (named)'
21.8922 EXP word: text = 'blue'
22.3757 EXP word: autoDraw = True
22.9609 EXP New trial (rep=0, index=5): OrderedDict([('text', 'green'), ('letterColor', 'green'), ('corrAns', 'down'), ('congruent', 1)])
22.9645 DATA Keypress: right
22.9760 EXP word: autoDraw = False
22.9760 EXP word: color = 'green (named)'
22.9760 EXP word: text = 'green'
23.4593 EXP word: autoDraw = True
24.1899 DATA Keypress: down
24.1987 EXP word: autoDraw = False
24.1987 EXP thanksText: autoDraw = True
26.1758 EXP thanksText: autoDraw = False
26.1770 INFO saved data to '/Users/thomaschen/Documents/EXP/OLEXP/PsychopyTPL/RepeatIncorrectTPL/data/_2020_Dec_08_1908.csv'
26.1778 INFO saved data to /Users/thomaschen/Documents/EXP/OLEXP/PsychopyTPL/RepeatIncorrectTPL/data/_2020_Dec_08_1908.psydat
26.7013 EXP window1: mouseVisible = True
26.7015 DEBUG Saving data for IncorrectStopEXP ExperimentHandler
text,letterColor,corrAns,congruent,trials2.thisRepN,trials2.thisTrialN,trials2.thisN,trials2.thisIndex,trials1.thisRepN,trials1.thisTrialN,trials1.thisN,trials1.thisIndex,instrText.started,instrText.stopped,word.started,word.stopped,resp.keys,resp.corr,resp.rt,resp.started,resp.stopped,thanksText.started,thanksText.stopped,session,participant,date,expName,psychopyVersion,frameRate,
red,red,left,1,0,0,0,0,0,0,0,0,14.513885827997,None,16.391001979005523,None,left,1,1.136984021999524,16.391001979005523,None,,,01,,2020_Dec_08_1910,IncorrectStopEXP,2020.1.3,60.84581487453898,
green,green,down,1,0,0,0,0,0,1,1,2,,,18.04112381899904,None,down,1,0.4709393759985687,18.04112381899904,None,,,01,,2020_Dec_08_1910,IncorrectStopEXP,2020.1.3,60.84581487453898,
blue,blue,right,1,0,0,0,0,0,2,2,4,,,19.024318544004927,None,right,1,0.6237270909914514,19.024318544004927,None,,,01,,2020_Dec_08_1910,IncorrectStopEXP,2020.1.3,60.84581487453898,
green,blue,right,0,0,0,0,0,0,3,3,3,,,20.157586681001703,None,right,1,0.34645442399778403,20.157586681001703,None,,,01,,2020_Dec_08_1910,IncorrectStopEXP,2020.1.3,60.84581487453898,
blue,red,left,0,0,0,0,0,0,4,4,5,,,21.0105941130023,None,left,1,1.1573644419986522,21.0105941130023,None,,,01,,2020_Dec_08_1910,IncorrectStopEXP,2020.1.3,60.84581487453898,
red,green,down,0,0,0,0,0,0,5,5,1,,,22.674508832002175,None,down,1,0.46958082700439263,22.674508832002175,None,,,01,,2020_Dec_08_1910,IncorrectStopEXP,2020.1.3,60.84581487453898,
,,,,0,0,0,0,,,,,,,,,,,,,,,,01,,2020_Dec_08_1910,IncorrectStopEXP,2020.1.3,60.84581487453898,
,,,,,,,,,,,,,,,,,,,,,23.216594601006364,None,,,,,,,
8.0077 WARNING We strongly recommend you activate the PTB sound engine in PsychoPy prefs as the preferred audio engine. Its timing is vastly superior. Your prefs are currently set to use ['sounddevice', 'PTB', 'pyo', 'pygame'] (in that order).
12.7305 INFO Loaded monitor calibration from ['2020_11_28 20:50']
13.4080 EXP Created window1 = Window(allowGUI=False, allowStencil=False, args=UNKNOWN, autoLog=True, bitsMode=UNKNOWN, blendMode='avg', bpc=(8, 8, 8), color='black', colorSpace='named', depthBits=8, fullscr=<method-wrapper '__getattribute__' of attributeSetter object at 0x7fea5b5529b0>, gamma=None, gammaErrorPolicy='raise', kwargs=UNKNOWN, lms=UNKNOWN, monitor=<psychopy.monitors.calibTools.Monitor object at 0x7fea5b5205f8>, multiSample=False, name='window1', numSamples=2, pos=[0.0, 0.0], screen=0, size=array([1920, 1080]), stencilBits=0, stereo=False, units='norm', useFBO=True, useRetina=False, viewOri=0.0, viewPos=None, viewScale=None, waitBlanking=True, winType='pyglet')
13.4081 EXP window1: recordFrameIntervals = False
13.5744 EXP window1: recordFrameIntervals = True
13.9080 DEBUG Screen (0) actual frame rate measured at 60.85
13.9080 EXP window1: recordFrameIntervals = False
14.2135 EXP Created instrText = 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=array([1., 1., 1.]), colorSpace='rgb', contrast=1.0, depth=0.0, flipHoriz=False, flipVert=False, font='Arial', fontFiles=[], height=0.1, italic=False, languageStyle='LTR', name='instrText', opacity=1.0, ori=0, pos=array([0., 0.]), rgb=array([1., 1., 1.]), text=str(...), units='norm', win=Window(...), wrapWidth=1)
14.3522 EXP Created word = 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.2, italic=False, languageStyle='LTR', name='word', opacity=1.0, ori=0, pos=array([0., 0.]), rgb=array([255., 255., 255.]), text='default text', units='norm', win=Window(...), wrapWidth=1)
14.5012 EXP Created thanksText = 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=array([1., 1., 1.]), colorSpace='rgb', contrast=1.0, depth=0.0, flipHoriz=False, flipVert=False, font='arial', fontFiles=[], height=0.1, italic=False, languageStyle='LTR', name='thanksText', opacity=1.0, ori=0, pos=array([0., 0.]), rgb=array([1., 1., 1.]), text=str(...), units='norm', win=Window(...), wrapWidth=1)
14.5018 EXP Created sequence: random, trialTypes=1, nReps=10, seed=None
14.5021 EXP New trial (rep=0, index=0): None
14.5139 EXP instrText: autoDraw = True
15.8798 DEBUG Read csv file with pandas: trialTypes.csv
15.8826 DEBUG Clearing unnamed columns from trialTypes.csv
15.8834 EXP Imported trialTypes.csv as conditions, 6 conditions, 4 params
15.8837 EXP Created sequence: random, trialTypes=6, nReps=1, seed=None
15.8842 EXP New trial (rep=0, index=0): OrderedDict([('text', 'red'), ('letterColor', 'red'), ('corrAns', 'left'), ('congruent', 1)])
15.9438 DATA Keypress: left
15.9525 EXP instrText: autoDraw = False
15.9525 EXP word: color = 'red (named)'
15.9525 EXP word: text = 'red'
16.3910 EXP word: autoDraw = True
17.5427 EXP New trial (rep=0, index=1): OrderedDict([('text', 'green'), ('letterColor', 'green'), ('corrAns', 'down'), ('congruent', 1)])
17.5513 DATA Keypress: left
17.5610 EXP word: autoDraw = False
17.5610 EXP word: color = 'green (named)'
17.5610 EXP word: text = 'green'
18.0411 EXP word: autoDraw = True
18.5255 EXP New trial (rep=0, index=2): OrderedDict([('text', 'blue'), ('letterColor', 'blue'), ('corrAns', 'right'), ('congruent', 1)])
18.5304 DATA Keypress: down
18.5412 EXP word: autoDraw = False
18.5412 EXP word: color = 'blue (named)'
18.5412 EXP word: text = 'blue'
19.0243 EXP word: autoDraw = True
19.6587 EXP New trial (rep=0, index=3): OrderedDict([('text', 'green'), ('letterColor', 'blue'), ('corrAns', 'right'), ('congruent', 0)])
19.6618 DATA Keypress: right
19.6743 EXP word: autoDraw = False
19.6743 EXP word: color = 'blue (named)'
19.6743 EXP word: text = 'green'
20.1576 EXP word: autoDraw = True
20.5088 EXP New trial (rep=0, index=4): OrderedDict([('text', 'blue'), ('letterColor', 'red'), ('corrAns', 'left'), ('congruent', 0)])
20.5117 DATA Keypress: right
20.5243 EXP word: autoDraw = False
20.5243 EXP word: color = 'red (named)'
20.5243 EXP word: text = 'blue'
21.0106 EXP word: autoDraw = True
22.1756 EXP New trial (rep=0, index=5): OrderedDict([('text', 'red'), ('letterColor', 'green'), ('corrAns', 'down'), ('congruent', 0)])
22.1786 DATA Keypress: left
22.1910 EXP word: autoDraw = False
22.1910 EXP word: color = 'green (named)'
22.1910 EXP word: text = 'red'
22.6745 EXP word: autoDraw = True
23.2077 DATA Keypress: down
23.2166 EXP word: autoDraw = False
23.2166 EXP thanksText: autoDraw = True
25.1911 EXP thanksText: autoDraw = False
25.1923 INFO saved data to '/Users/thomaschen/Documents/EXP/OLEXP/PsychopyTPL/RepeatIncorrectTPL/data/_2020_Dec_08_1910.csv'
25.1931 INFO saved data to /Users/thomaschen/Documents/EXP/OLEXP/PsychopyTPL/RepeatIncorrectTPL/data/_2020_Dec_08_1910.psydat
25.7192 EXP window1: mouseVisible = True
25.7196 DEBUG Saving data for IncorrectStopEXP ExperimentHandler
......@@ -19,6 +19,7 @@ psychoJS.openWindow({
let expName = 'IncorrectStopEXP'; // from the Builder filename that created this script
let expInfo = {'session': '01', 'participant': ''};
// Start code blocks for 'Before Experiment'
// schedule the experiment:
psychoJS.schedule(psychoJS.gui.DlgFromDict({
dictionary: expInfo,
......@@ -49,12 +50,14 @@ psychoJS.start({
expInfo: expInfo,
});
psychoJS.experimentLogger.setLevel(core.Logger.ServerLevel.DEBUG);
var frameDur;
function updateInfo() {
expInfo['date'] = util.MonotonicClock.getDateStr(); // add a simple timestamp
expInfo['expName'] = expName;
expInfo['psychopyVersion'] = '2020.1.3';
expInfo['psychopyVersion'] = '2020.2.8';
expInfo['OS'] = window.navigator.platform;
// store frame rate of monitor if we can measure it successfully
......@@ -135,7 +138,7 @@ function experimentInit() {
var trials2;
var currentLoop;
function trials2LoopBegin(thisScheduler) {
function trials2LoopBegin(trials2LoopScheduler) {
// set up handler to look after randomisation of conditions etc
trials2 = new TrialHandler({
psychoJS: psychoJS,
......@@ -151,15 +154,15 @@ function trials2LoopBegin(thisScheduler) {
trials2.forEach(function() {
const snapshot = trials2.getSnapshot();
thisScheduler.add(importConditions(snapshot));
thisScheduler.add(instructRoutineBegin(snapshot));
thisScheduler.add(instructRoutineEachFrame(snapshot));
thisScheduler.add(instructRoutineEnd(snapshot));
trials2LoopScheduler.add(importConditions(snapshot));
trials2LoopScheduler.add(instructRoutineBegin(snapshot));
trials2LoopScheduler.add(instructRoutineEachFrame(snapshot));
trials2LoopScheduler.add(instructRoutineEnd(snapshot));
const trials1LoopScheduler = new Scheduler(psychoJS);
thisScheduler.add(trials1LoopBegin, trials1LoopScheduler);
thisScheduler.add(trials1LoopScheduler);
thisScheduler.add(trials1LoopEnd);
thisScheduler.add(endLoopIteration(thisScheduler, snapshot));
trials2LoopScheduler.add(trials1LoopBegin, trials1LoopScheduler);
trials2LoopScheduler.add(trials1LoopScheduler);
trials2LoopScheduler.add(trials1LoopEnd);
trials2LoopScheduler.add(endLoopIteration(trials2LoopScheduler, snapshot));
});
return Scheduler.Event.NEXT;
......@@ -167,7 +170,7 @@ function trials2LoopBegin(thisScheduler) {
var trials1;
function trials1LoopBegin(thisScheduler) {
function trials1LoopBegin(trials1LoopScheduler) {
// set up handler to look after randomisation of conditions etc
trials1 = new TrialHandler({
psychoJS: psychoJS,
......@@ -183,11 +186,11 @@ function trials1LoopBegin(thisScheduler) {
trials1.forEach(function() {
const snapshot = trials1.getSnapshot();
thisScheduler.add(importConditions(snapshot));
thisScheduler.add(trialRoutineBegin(snapshot));
thisScheduler.add(trialRoutineEachFrame(snapshot));
thisScheduler.add(trialRoutineEnd(snapshot));
thisScheduler.add(endLoopIteration(thisScheduler, snapshot));
trials1LoopScheduler.add(importConditions(snapshot));
trials1LoopScheduler.add(trialRoutineBegin(snapshot));
trials1LoopScheduler.add(trialRoutineEachFrame(snapshot));
trials1LoopScheduler.add(trialRoutineEnd(snapshot));
trials1LoopScheduler.add(endLoopIteration(trials1LoopScheduler, snapshot));
});
return Scheduler.Event.NEXT;
......@@ -212,7 +215,7 @@ var t;
var frameN;
var _ready_allKeys;
var instructComponents;
function instructRoutineBegin(trials) {
function instructRoutineBegin(snapshot) {
return function () {
//------Prepare to start Routine 'instruct'-------
t = 0;
......@@ -231,14 +234,16 @@ function instructRoutineBegin(trials) {
if ('status' in thisComponent)
thisComponent.status = PsychoJS.Status.NOT_STARTED;
});
return Scheduler.Event.NEXT;
// check if the Routine should terminate
if (!continueRoutine) { // a component has requested a forced-end of Routine
return Scheduler.Event.NEXT;
}
};
}
var continueRoutine;
function instructRoutineEachFrame(trials) {
function instructRoutineEachFrame(snapshot) {
return function () {
//------Loop for each frame of Routine 'instruct'-------
let continueRoutine = true; // until we're told otherwise
......@@ -307,7 +312,7 @@ function instructRoutineEachFrame(trials) {
}
function instructRoutineEnd(trials) {
function instructRoutineEnd(snapshot) {
return function () {
//------Ending Routine 'instruct'-------
instructComponents.forEach( function(thisComponent) {
......@@ -326,7 +331,7 @@ function instructRoutineEnd(trials) {
var _resp_allKeys;
var number_correct;
var trialComponents;
function trialRoutineBegin(trials) {
function trialRoutineBegin(snapshot) {
return function () {
//------Prepare to start Routine 'trial'-------
t = 0;
......@@ -351,13 +356,15 @@ function trialRoutineBegin(trials) {
if ('status' in thisComponent)
thisComponent.status = PsychoJS.Status.NOT_STARTED;
});
return Scheduler.Event.NEXT;
// check if the Routine should terminate
if (!continueRoutine) { // a component has requested a forced-end of Routine
return Scheduler.Event.NEXT;
}
};
}
function trialRoutineEachFrame(trials) {
function trialRoutineEachFrame(snapshot) {
return function () {
//------Loop for each frame of Routine 'trial'-------
let continueRoutine = true; // until we're told otherwise
......@@ -432,7 +439,7 @@ function trialRoutineEachFrame(trials) {
}
function trialRoutineEnd(trials) {
function trialRoutineEnd(snapshot) {
return function () {
//------Ending Routine 'trial'-------
trialComponents.forEach( function(thisComponent) {
......@@ -464,7 +471,7 @@ function trialRoutineEnd(trials) {
console.log("Not correct");
}
if (((trials1.thisN + 1) === trials1.nTotal)) {
if (((number_correct / (trials1.nTotal + 1)) >= 0.85)) {
if (((number_correct / (trials1.nTotal + 1)) >= 0.3)) {
trials2.finished = true;
console.log("Finished.");
} else {
......@@ -483,7 +490,7 @@ function trialRoutineEnd(trials) {
var thanksComponents;
function thanksRoutineBegin(trials) {
function thanksRoutineBegin(snapshot) {
return function () {
//------Prepare to start Routine 'thanks'-------
t = 0;
......@@ -499,14 +506,16 @@ function thanksRoutineBegin(trials) {
if ('status' in thisComponent)
thisComponent.status = PsychoJS.Status.NOT_STARTED;
});
return Scheduler.Event.NEXT;
// check if the Routine should terminate
if (!continueRoutine) { // a component has requested a forced-end of Routine
return Scheduler.Event.NEXT;
}
};
}
var frameRemains;
function thanksRoutineEachFrame(trials) {
function thanksRoutineEachFrame(snapshot) {
return function () {
//------Loop for each frame of Routine 'thanks'-------
let continueRoutine = true; // until we're told otherwise
......@@ -525,7 +534,7 @@ function thanksRoutineEachFrame(trials) {
}
frameRemains = 0.0 + 2.0 - psychoJS.window.monitorFramePeriod * 0.75; // most of one frame period left
if (thanksText.status === PsychoJS.Status.STARTED && t >= frameRemains) {
if ((thanksText.status === PsychoJS.Status.STARTED || thanksText.status === PsychoJS.Status.FINISHED) && t >= frameRemains) {
thanksText.setAutoDraw(false);
}
// check for quit (typically the Esc key)
......@@ -555,7 +564,7 @@ function thanksRoutineEachFrame(trials) {
}
function thanksRoutineEnd(trials) {
function thanksRoutineEnd(snapshot) {
return function () {
//------Ending Routine 'thanks'-------
thanksComponents.forEach( function(thisComponent) {
......@@ -568,21 +577,21 @@ function thanksRoutineEnd(trials) {
}
function endLoopIteration(thisScheduler, loop) {
function endLoopIteration(scheduler, snapshot) {
// ------Prepare for next entry------
return function () {
if (typeof loop !== 'undefined') {
if (typeof snapshot !== 'undefined') {
// ------Check if user ended loop early------
if (loop.finished) {
if (snapshot.finished) {
// Check for and save orphaned data
if (psychoJS.experiment.isEntryEmpty()) {
psychoJS.experiment.nextEntry(loop);
psychoJS.experiment.nextEntry(snapshot);
}
thisScheduler.stop();
scheduler.stop();
} else {
const thisTrial = loop.getCurrentTrial();
const thisTrial = snapshot.getCurrentTrial();
if (typeof thisTrial === 'undefined' || !('isTrials' in thisTrial) || thisTrial.isTrials) {
psychoJS.experiment.nextEntry(loop);
psychoJS.experiment.nextEntry(snapshot);
}
}
return Scheduler.Event.NEXT;
......@@ -591,9 +600,9 @@ function endLoopIteration(thisScheduler, loop) {
}
function importConditions(trials) {
function importConditions(currentLoop) {
return function () {
psychoJS.importAttributes(trials.getCurrentTrial());
psychoJS.importAttributes(currentLoop.getCurrentTrial());
return Scheduler.Event.NEXT;
};
}
......
......@@ -6,9 +6,12 @@ import { PsychoJS } from './lib/core-2020.1.js';
import * as core from './lib/core-2020.1.js';
import { TrialHandler } from './lib/data-2020.1.js';
import { Scheduler } from './lib/util-2020.1.js';
import * as util from './lib/util-2020.1.js';
import * as visual from './lib/visual-2020.1.js';
import * as sound from './lib/sound-2020.1.js';
import * as util from './lib/util-2020.1.js';
//some handy aliases as in the psychopy scripts;
const { abs, sin, cos, PI: pi, sqrt } = Math;
const { round } = util;
// init psychoJS:
const psychoJS = new PsychoJS({
......@@ -27,6 +30,7 @@ psychoJS.openWindow({
let expName = 'IncorrectStopEXP'; // from the Builder filename that created this script
let expInfo = {'session': '01', 'participant': ''};
// Start code blocks for 'Before Experiment'
// schedule the experiment:
psychoJS.schedule(psychoJS.gui.DlgFromDict({
dictionary: expInfo,
......@@ -57,12 +61,14 @@ psychoJS.start({
expInfo: expInfo,
});
psychoJS.experimentLogger.setLevel(core.Logger.ServerLevel.DEBUG);
var frameDur;
function updateInfo() {
expInfo['date'] = util.MonotonicClock.getDateStr(); // add a simple timestamp
expInfo['expName'] = expName;
expInfo['psychopyVersion'] = '2020.1.3';
expInfo['psychopyVersion'] = '2020.2.8';
expInfo['OS'] = window.navigator.platform;
// store frame rate of monitor if we can measure it successfully
......@@ -143,7 +149,7 @@ function experimentInit() {
var trials2;
var currentLoop;
function trials2LoopBegin(thisScheduler) {
function trials2LoopBegin(trials2LoopScheduler) {
// set up handler to look after randomisation of conditions etc
trials2 = new TrialHandler({
psychoJS: psychoJS,
......@@ -158,15 +164,15 @@ function trials2LoopBegin(thisScheduler) {
// Schedule all the trials in the trialList:
for (const thisTrials2 of trials2) {
const snapshot = trials2.getSnapshot();
thisScheduler.add(importConditions(snapshot));
thisScheduler.add(instructRoutineBegin(snapshot));
thisScheduler.add(instructRoutineEachFrame(snapshot));
thisScheduler.add(instructRoutineEnd(snapshot));
trials2LoopScheduler.add(importConditions(snapshot));
trials2LoopScheduler.add(instructRoutineBegin(snapshot));
trials2LoopScheduler.add(instructRoutineEachFrame(snapshot));
trials2LoopScheduler.add(instructRoutineEnd(snapshot));
const trials1LoopScheduler = new Scheduler(psychoJS);
thisScheduler.add(trials1LoopBegin, trials1LoopScheduler);
thisScheduler.add(trials1LoopScheduler);
thisScheduler.add(trials1LoopEnd);
thisScheduler.add(endLoopIteration(thisScheduler, snapshot));
trials2LoopScheduler.add(trials1LoopBegin, trials1LoopScheduler);
trials2LoopScheduler.add(trials1LoopScheduler);
trials2LoopScheduler.add(trials1LoopEnd);
trials2LoopScheduler.add(endLoopIteration(trials2LoopScheduler, snapshot));
}
return Scheduler.Event.NEXT;
......@@ -174,7 +180,7 @@ function trials2LoopBegin(thisScheduler) {
var trials1;
function trials1LoopBegin(thisScheduler) {
function trials1LoopBegin(trials1LoopScheduler) {
// set up handler to look after randomisation of conditions etc
trials1 = new TrialHandler({
psychoJS: psychoJS,
......@@ -189,11 +195,11 @@ function trials1LoopBegin(thisScheduler) {
// Schedule all the trials in the trialList:
for (const thisTrials1 of trials1) {
const snapshot = trials1.getSnapshot();
thisScheduler.add(importConditions(snapshot));
thisScheduler.add(trialRoutineBegin(snapshot));
thisScheduler.add(trialRoutineEachFrame(snapshot));
thisScheduler.add(trialRoutineEnd(snapshot));
thisScheduler.add(endLoopIteration(thisScheduler, snapshot));
trials1LoopScheduler.add(importConditions(snapshot));
trials1LoopScheduler.add(trialRoutineBegin(snapshot));
trials1LoopScheduler.add(trialRoutineEachFrame(snapshot));
trials1LoopScheduler.add(trialRoutineEnd(snapshot));
trials1LoopScheduler.add(endLoopIteration(trials1LoopScheduler, snapshot));
}
return Scheduler.Event.NEXT;
......@@ -218,7 +224,7 @@ var t;
var frameN;
var _ready_allKeys;
var instructComponents;
function instructRoutineBegin(trials) {
function instructRoutineBegin(snapshot) {
return function () {
//------Prepare to start Routine 'instruct'-------
t = 0;
......@@ -236,14 +242,16 @@ function instructRoutineBegin(trials) {
for (const thisComponent of instructComponents)
if ('status' in thisComponent)
thisComponent.status = PsychoJS.Status.NOT_STARTED;
return Scheduler.Event.NEXT;
// check if the Routine should terminate
if (!continueRoutine) { // a component has requested a forced-end of Routine
return Scheduler.Event.NEXT;
}
};
}
var continueRoutine;
function instructRoutineEachFrame(trials) {
function instructRoutineEachFrame(snapshot) {
return function () {
//------Loop for each frame of Routine 'instruct'-------
let continueRoutine = true; // until we're told otherwise
......@@ -312,7 +320,7 @@ function instructRoutineEachFrame(trials) {
}
function instructRoutineEnd(trials) {
function instructRoutineEnd(snapshot) {
return function () {
//------Ending Routine 'instruct'-------
for (const thisComponent of instructComponents) {
......@@ -331,7 +339,7 @@ function instructRoutineEnd(trials) {
var _resp_allKeys;
var number_correct;
var trialComponents;
function trialRoutineBegin(trials) {
function trialRoutineBegin(snapshot) {
return function () {
//------Prepare to start Routine 'trial'-------
t = 0;
......@@ -355,13 +363,15 @@ function trialRoutineBegin(trials) {
for (const thisComponent of trialComponents)
if ('status' in thisComponent)
thisComponent.status = PsychoJS.Status.NOT_STARTED;
return Scheduler.Event.NEXT;
// check if the Routine should terminate
if (!continueRoutine) { // a component has requested a forced-end of Routine
return Scheduler.Event.NEXT;
}
};
}
function trialRoutineEachFrame(trials) {
function trialRoutineEachFrame(snapshot) {
return function () {
//------Loop for each frame of Routine 'trial'-------
let continueRoutine = true; // until we're told otherwise
......@@ -436,7 +446,7 @@ function trialRoutineEachFrame(trials) {
}
function trialRoutineEnd(trials) {
function trialRoutineEnd(snapshot) {
return function () {
//------Ending Routine 'trial'-------
for (const thisComponent of trialComponents) {
......@@ -468,7 +478,7 @@ function trialRoutineEnd(trials) {
console.log("Not correct");
}