k

parent fff54078
......@@ -197,6 +197,7 @@
</Routine>
</Routines>
<Flow>
<Routine name="code_js"/>
<Routine name="code1"/>
<Routine name="Intro"/>
<LoopInitiator loopType="TrialHandler" name="trials_2">
......
......@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v2020.2.10),
on February 11, 2021, at 17:56
on February 11, 2021, at 19:34
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)
......@@ -81,6 +81,9 @@ else:
# create a default keyboard (e.g. to check for escape)
defaultKeyboard = keyboard.Keyboard()
# Initialize components for Routine "code_js"
code_jsClock = core.Clock()
# Initialize components for Routine "code1"
code1Clock = core.Clock()
import random
......@@ -225,6 +228,57 @@ key_resp = keyboard.Keyboard()
globalClock = core.Clock() # to track the time since experiment started
routineTimer = core.CountdownTimer() # to track time remaining of each (non-slip) routine
# ------Prepare to start Routine "code_js"-------
continueRoutine = True
# update component parameters for each repeat
# keep track of which components have finished
code_jsComponents = []
for thisComponent in code_jsComponents:
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")
code_jsClock.reset(-_timeToFirstFrame) # t0 is time of first possible flip
frameN = -1
# -------Run Routine "code_js"-------
while continueRoutine:
# get current time
t = code_jsClock.getTime()
tThisFlip = win.getFutureFlipTime(clock=code_jsClock)
tThisFlipGlobal = win.getFutureFlipTime(clock=None)
frameN = frameN + 1 # number of completed frames (so 0 is the first frame)
# update/draw components on each frame
# 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 code_jsComponents:
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 "code_js"-------
for thisComponent in code_jsComponents:
if hasattr(thisComponent, "setAutoDraw"):
thisComponent.setAutoDraw(False)
# the Routine "code_js" was not non-slip safe, so reset the non-slip timer
routineTimer.reset()
# ------Prepare to start Routine "code1"-------
continueRoutine = True
# update component parameters for each repeat
......
trials_2.thisRepN,trials_2.thisTrialN,trials_2.thisN,trials_2.thisIndex,trials.thisRepN,trials.thisTrialN,trials.thisN,trials.thisIndex,text_2.started,text_2.stopped,key_resp_2.keys,key_resp_2.rt,key_resp_2.started,key_resp_2.stopped,sound_1.started,sound_1.stopped,sequence_1,Pattern,sequence_3,Speed,NumberOfIntervals,participant,session,date,expName,psychopyVersion,frameRate,
,,,,,,,,8.869790499986266,None,b,1.2514123000000836,8.869790499986266,None,,,,,,,,,001,2021_Feb_11_1933,audioseqq,2020.2.10,30.029254499192913,
0,0,0,0,0,0,0,0,,,,,,,1.5272389599995222,None,4,"[4, 1, 1, 1, 1, 1, 3, 0.4]",0.83,1,7,,001,2021_Feb_11_1933,audioseqq,2020.2.10,30.029254499192913,
0,0,0,0,1,0,1,0,,,,,,,0.11413226000149734,None,1,"[4, 1, 1, 1, 1, 1, 3, 0.4]",0.16999999999999998,1,7,,001,2021_Feb_11_1933,audioseqq,2020.2.10,30.029254499192913,
0,0,0,0,2,0,2,0,,,,,,,0.053133759982301854,None,1,"[4, 1, 1, 1, 1, 1, 3, 0.4]",0.16999999999999998,1,7,,001,2021_Feb_11_1933,audioseqq,2020.2.10,30.029254499192913,
0,0,0,0,3,0,3,0,,,,,,,0.04987296000763308,None,1,"[4, 1, 1, 1, 1, 1, 3, 0.4]",0.16999999999999998,1,7,,001,2021_Feb_11_1933,audioseqq,2020.2.10,30.029254499192913,
0,0,0,0,4,0,4,0,,,,,,,0.05465936001564842,None,1,"[4, 1, 1, 1, 1, 1, 3, 0.4]",0.16999999999999998,1,7,,001,2021_Feb_11_1933,audioseqq,2020.2.10,30.029254499192913,
0,0,0,0,5,0,5,0,,,,,,,0.08421096001984552,None,1,"[4, 1, 1, 1, 1, 1, 3, 0.4]",0.16999999999999998,1,7,,001,2021_Feb_11_1933,audioseqq,2020.2.10,30.029254499192913,
0,0,0,0,6,0,6,0,,,,,,,0.0756071600044379,None,3,"[4, 1, 1, 1, 1, 1, 3, 0.4]",0.61,1,7,,001,2021_Feb_11_1933,audioseqq,2020.2.10,30.029254499192913,
0,0,0,0,7,0,7,0,,,,,,,0.0778222599910805,None,0.4,"[4, 1, 1, 1, 1, 1, 3, 0.4]",0.038000000000000006,1,7,,001,2021_Feb_11_1933,audioseqq,2020.2.10,30.029254499192913,
0,0,0,0,8,0,8,0,,,,,,,1.5293087600002764,None,4,"[4, 1, 1, 1, 1, 3, 1, 0.4]",0.83,1,7,,001,2021_Feb_11_1933,audioseqq,2020.2.10,30.029254499192913,
0,0,0,0,9,0,9,0,,,,,,,0.06457636001869105,None,1,"[4, 1, 1, 1, 1, 3, 1, 0.4]",0.16999999999999998,1,7,,001,2021_Feb_11_1933,audioseqq,2020.2.10,30.029254499192913,
0,0,0,0,10,0,10,0,,,,,,,0.06983225999283604,None,1,"[4, 1, 1, 1, 1, 3, 1, 0.4]",0.16999999999999998,1,7,,001,2021_Feb_11_1933,audioseqq,2020.2.10,30.029254499192913,
0,0,0,0,11,0,11,0,,,,,,,0.05124575999798253,None,1,"[4, 1, 1, 1, 1, 3, 1, 0.4]",0.16999999999999998,1,7,,001,2021_Feb_11_1933,audioseqq,2020.2.10,30.029254499192913,
0,0,0,0,12,0,12,0,,,,,,,0.050080060012987815,None,1,"[4, 1, 1, 1, 1, 3, 1, 0.4]",0.16999999999999998,1,7,,001,2021_Feb_11_1933,audioseqq,2020.2.10,30.029254499192913,
0,0,0,0,13,0,13,0,,,,,,,0.05380526000226382,None,3,"[4, 1, 1, 1, 1, 3, 1, 0.4]",0.61,1,7,,001,2021_Feb_11_1933,audioseqq,2020.2.10,30.029254499192913,
0,0,0,0,14,0,14,0,,,,,,,0.05373605998465791,None,1,"[4, 1, 1, 1, 1, 3, 1, 0.4]",0.16999999999999998,1,7,,001,2021_Feb_11_1933,audioseqq,2020.2.10,30.029254499192913,
0,0,0,0,15,0,15,0,,,,,,,0.059433259986690246,0.09696395999344531,0.4,"[4, 1, 1, 1, 1, 3, 1, 0.4]",0.038000000000000006,1,7,,001,2021_Feb_11_1933,audioseqq,2020.2.10,30.029254499192913,
7.0580 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 0x000001AB92DAFCC0>, gamma=None, gammaErrorPolicy='raise', kwargs=UNKNOWN, lms=UNKNOWN, monitor=<psychopy.monitors.calibTools.Monitor object at 0x000001AB92E484A8>, multiSample=False, name='window1', numSamples=2, pos=[0.0, 0.0], screen=0, size=array([1680, 1050]), stencilBits=0, stereo=False, units='height', useFBO=True, useRetina=False, viewOri=0.0, viewPos=None, viewScale=None, waitBlanking=True, winType='pyglet')
7.0585 EXP window1: mouseVisible = True
7.0586 EXP window1: recordFrameIntervals = False
7.3851 EXP window1: recordFrameIntervals = True
7.4517 WARNING t of last frame was 55.77ms (=1/17)
7.5053 WARNING t of last frame was 42.85ms (=1/23)
7.5723 WARNING t of last frame was 67.00ms (=1/14)
7.9711 WARNING t of last frame was 59.58ms (=1/16)
8.1376 WARNING Multiple dropped frames have occurred - I'll stop bothering you about them!
8.4711 EXP window1: recordFrameIntervals = False
8.6681 EXP Created text_2 = 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_2', opacity=1.0, ori=0, pos=array([0., 0.]), rgb=array([255., 255., 255.]), text=str(...), units='height', win=Window(...), wrapWidth=1)
8.7627 EXP Sound sound_1 set volume 1.000
8.8133 EXP Created text = 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.07, italic=False, languageStyle='LTR', name='text', opacity=1.0, ori=0, pos=array([0., 0.]), rgb=array([255., 255., 255.]), text=str(...), units='height', win=Window(...), wrapWidth=1)
8.8698 EXP text_2: autoDraw = True
10.1415 EXP Created sequence: random, trialTypes=1, nReps=60, seed=None
10.1422 EXP New trial (rep=0, index=0): None
10.1429 EXP Created sequence: random, trialTypes=1, nReps=24, seed=None
10.1433 EXP New trial (rep=0, index=0): None
10.1485 DATA Keypress: b
10.2004 EXP text_2: autoDraw = False
11.6496 EXP Sound sound_1 started
12.4903 EXP Sound sound_1 reached end of file
12.4982 EXP New trial (rep=1, index=0): None
12.5980 EXP Sound sound_1 started
12.7806 EXP Sound sound_1 reached end of file
12.7867 EXP New trial (rep=2, index=0): None
12.8311 EXP Sound sound_1 started
13.0309 EXP Sound sound_1 reached end of file
13.0379 EXP New trial (rep=3, index=0): None
13.0640 EXP Sound sound_1 started
13.2509 EXP Sound sound_1 reached end of file
13.2574 EXP New trial (rep=4, index=0): None
13.2997 EXP Sound sound_1 started
13.4806 EXP Sound sound_1 reached end of file
13.4848 EXP New trial (rep=5, index=0): None
13.5626 EXP Sound sound_1 started
13.7503 EXP Sound sound_1 reached end of file
13.7552 EXP New trial (rep=6, index=0): None
13.8278 EXP Sound sound_1 started
14.4506 EXP Sound sound_1 reached end of file
14.4556 EXP New trial (rep=7, index=0): None
14.5286 EXP Sound sound_1 started
14.5783 EXP Sound sound_1 reached end of file
14.5846 EXP New trial (rep=8, index=0): None
16.1097 EXP Sound sound_1 started
16.9505 EXP Sound sound_1 reached end of file
16.9560 EXP New trial (rep=9, index=0): None
17.0057 EXP Sound sound_1 started
17.1905 EXP Sound sound_1 reached end of file
17.1960 EXP New trial (rep=10, index=0): None
17.2582 EXP Sound sound_1 started
17.4407 EXP Sound sound_1 reached end of file
17.4473 EXP New trial (rep=11, index=0): None
17.4922 EXP Sound sound_1 started
17.6920 EXP Sound sound_1 reached end of file
17.6988 EXP New trial (rep=12, index=0): None
17.7249 EXP Sound sound_1 started
17.9218 EXP Sound sound_1 reached end of file
17.9275 EXP New trial (rep=13, index=0): None
17.9570 EXP Sound sound_1 started
18.5879 EXP Sound sound_1 reached end of file
18.5936 EXP New trial (rep=14, index=0): None
18.6216 EXP Sound sound_1 started
18.8107 EXP Sound sound_1 reached end of file
18.8176 EXP New trial (rep=15, index=0): None
18.8709 EXP Sound sound_1 started
18.9209 EXP Sound sound_1 stopped
18.9271 EXP New trial (rep=16, index=0): None
19.2863 DATA Keypress: escape
19.6486 EXP window1: mouseVisible = True
trials_2.thisRepN,trials_2.thisTrialN,trials_2.thisN,trials_2.thisIndex,trials.thisRepN,trials.thisTrialN,trials.thisN,trials.thisIndex,text_2.started,text_2.stopped,key_resp_2.keys,key_resp_2.rt,key_resp_2.started,key_resp_2.stopped,sound_1.started,sound_1.stopped,sequence_1,Pattern,sequence_3,Speed,NumberOfIntervals,participant,session,date,expName,psychopyVersion,frameRate,
,,,,,,,,7.90697050000017,None,b,1.0943324999971082,7.90697050000017,None,,,,,,,,,001,2021_Feb_11_1934,audioseqq,2020.2.10,29.986751852517504,
0,0,0,0,0,0,0,0,,,,,,,1.5010468799882801,None,1,"[1, 3, 2, 2, 1, 1, 2, 0.4]",0.19,3,7,,001,2021_Feb_11_1934,audioseqq,2020.2.10,29.986751852517504,
0,0,0,0,1,0,1,0,,,,,,,0.09359487998881377,None,3,"[1, 3, 2, 2, 1, 1, 2, 0.4]",0.6699999999999999,3,7,,001,2021_Feb_11_1934,audioseqq,2020.2.10,29.986751852517504,
0,0,0,0,2,0,2,0,,,,,,,0.04990417999215424,None,2,"[1, 3, 2, 2, 1, 1, 2, 0.4]",0.43,3,7,,001,2021_Feb_11_1934,audioseqq,2020.2.10,29.986751852517504,
0,0,0,0,3,0,3,0,,,,,,,0.051366579995374195,None,2,"[1, 3, 2, 2, 1, 1, 2, 0.4]",0.43,3,7,,001,2021_Feb_11_1934,audioseqq,2020.2.10,29.986751852517504,
0,0,0,0,4,0,4,0,,,,,,,0.08993267999903765,None,1,"[1, 3, 2, 2, 1, 1, 2, 0.4]",0.19,3,7,,001,2021_Feb_11_1934,audioseqq,2020.2.10,29.986751852517504,
0,0,0,0,5,0,5,0,,,,,,,0.05104917999415193,None,1,"[1, 3, 2, 2, 1, 1, 2, 0.4]",0.19,3,7,,001,2021_Feb_11_1934,audioseqq,2020.2.10,29.986751852517504,
0,0,0,0,6,0,6,0,,,,,,,0.08196207998844329,None,2,"[1, 3, 2, 2, 1, 1, 2, 0.4]",0.43,3,7,,001,2021_Feb_11_1934,audioseqq,2020.2.10,29.986751852517504,
0,0,0,0,7,0,7,0,,,,,,,0.051609579983050935,None,0.4,"[1, 3, 2, 2, 1, 1, 2, 0.4]",0.046,3,7,,001,2021_Feb_11_1934,audioseqq,2020.2.10,29.986751852517504,
6.8354 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 0x00000279D544FDA0>, gamma=None, gammaErrorPolicy='raise', kwargs=UNKNOWN, lms=UNKNOWN, monitor=<psychopy.monitors.calibTools.Monitor object at 0x00000279D54E8588>, multiSample=False, name='window1', numSamples=2, pos=[0.0, 0.0], screen=0, size=array([1680, 1050]), stencilBits=0, stereo=False, units='height', useFBO=True, useRetina=False, viewOri=0.0, viewPos=None, viewScale=None, waitBlanking=True, winType='pyglet')
6.8357 EXP window1: mouseVisible = True
6.8357 EXP window1: recordFrameIntervals = False
7.1692 EXP window1: recordFrameIntervals = True
7.5362 EXP window1: recordFrameIntervals = False
7.7126 EXP Created text_2 = 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_2', opacity=1.0, ori=0, pos=array([0., 0.]), rgb=array([255., 255., 255.]), text=str(...), units='height', win=Window(...), wrapWidth=1)
7.8074 EXP Sound sound_1 set volume 1.000
7.8542 EXP Created text = 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.07, italic=False, languageStyle='LTR', name='text', opacity=1.0, ori=0, pos=array([0., 0.]), rgb=array([255., 255., 255.]), text=str(...), units='height', win=Window(...), wrapWidth=1)
7.9070 EXP text_2: autoDraw = True
9.0057 DATA Keypress: b
9.0354 EXP Created sequence: random, trialTypes=1, nReps=60, seed=None
9.0363 EXP New trial (rep=0, index=0): None
9.0371 EXP Created sequence: random, trialTypes=1, nReps=24, seed=None
9.0375 EXP New trial (rep=0, index=0): None
9.0996 EXP text_2: autoDraw = False
10.5162 EXP Sound sound_1 started
10.7252 EXP Sound sound_1 reached end of file
10.7315 EXP New trial (rep=1, index=0): None
10.8151 EXP Sound sound_1 started
11.5052 EXP Sound sound_1 reached end of file
11.5117 EXP New trial (rep=2, index=0): None
11.5465 EXP Sound sound_1 started
11.9951 EXP Sound sound_1 reached end of file
12.0013 EXP New trial (rep=3, index=0): None
12.0439 EXP Sound sound_1 started
12.4847 EXP Sound sound_1 reached end of file
12.4910 EXP New trial (rep=4, index=0): None
12.5598 EXP Sound sound_1 started
12.7648 EXP Sound sound_1 reached end of file
12.7699 EXP New trial (rep=5, index=0): None
12.7945 EXP Sound sound_1 started
13.0277 EXP Sound sound_1 reached end of file
13.0347 EXP New trial (rep=6, index=0): None
13.0944 EXP Sound sound_1 started
13.5436 EXP Sound sound_1 reached end of file
13.5501 EXP New trial (rep=7, index=0): None
13.5768 EXP Sound sound_1 started
13.6409 EXP Sound sound_1 reached end of file
13.6471 EXP New trial (rep=8, index=0): None
15.1374 EXP Sound sound_1 started
15.5725 DATA Keypress: escape
15.8907 EXP window1: mouseVisible = True
......@@ -33,6 +33,9 @@ psychoJS.scheduleCondition(function() { return (psychoJS.gui.dialogComponent.but
// flowScheduler gets run if the participants presses OK
flowScheduler.add(updateInfo); // add timeStamp
flowScheduler.add(experimentInit);
flowScheduler.add(code_jsRoutineBegin());
flowScheduler.add(code_jsRoutineEachFrame());
flowScheduler.add(code_jsRoutineEnd());
flowScheduler.add(code1RoutineBegin());
flowScheduler.add(code1RoutineEachFrame());
flowScheduler.add(code1RoutineEnd());
......@@ -77,6 +80,13 @@ function updateInfo() {
}
var code_jsClock;
var thisExp;
var win;
var event;
var shuffle;
var random;
var randint;
var code1Clock;
var total;
var a;
......@@ -97,6 +107,19 @@ var key_resp;
var globalClock;
var routineTimer;
function experimentInit() {
// Initialize components for Routine "code_js"
code_jsClock = new util.Clock();
thisExp=psychoJS.experiment;
win=psychoJS.window;
event=psychoJS.eventManager;
shuffle = util.shuffle;
Array.prototype.append = [].push;
random = Math.random;
randint = function(min, maxplusone) {
return Math.floor(Math.random() * (maxplusone - min) ) + min;
}
// Initialize components for Routine "code1"
code1Clock = new util.Clock();
function num1_to_sec(n) {
......@@ -239,6 +262,77 @@ function experimentInit() {
var t;
var frameN;
var continueRoutine;
var code_jsComponents;
function code_jsRoutineBegin(snapshot) {
return function () {
//------Prepare to start Routine 'code_js'-------
t = 0;
code_jsClock.reset(); // clock
frameN = -1;
continueRoutine = true; // until we're told otherwise
// update component parameters for each repeat
// keep track of which components have finished
code_jsComponents = [];
code_jsComponents.forEach( function(thisComponent) {
if ('status' in thisComponent)
thisComponent.status = PsychoJS.Status.NOT_STARTED;
});
return Scheduler.Event.NEXT;
}
}
function code_jsRoutineEachFrame(snapshot) {
return function () {
//------Loop for each frame of Routine 'code_js'-------
// get current time
t = code_jsClock.getTime();
frameN = frameN + 1;// number of completed frames (so 0 is the first frame)
// update/draw components on each frame
// check for quit (typically the Esc key)
if (psychoJS.experiment.experimentEnded || psychoJS.eventManager.getKeys({keyList:['escape']}).length > 0) {
return quitPsychoJS('The [Escape] key was pressed. Goodbye!', false);
}
// check if the Routine should terminate
if (!continueRoutine) { // a component has requested a forced-end of Routine
return Scheduler.Event.NEXT;
}
continueRoutine = false; // reverts to True if at least one component still running
code_jsComponents.forEach( function(thisComponent) {
if ('status' in thisComponent && thisComponent.status !== PsychoJS.Status.FINISHED) {
continueRoutine = true;
}
});
// refresh the screen if continuing
if (continueRoutine) {
return Scheduler.Event.FLIP_REPEAT;
} else {
return Scheduler.Event.NEXT;
}
};
}
function code_jsRoutineEnd(snapshot) {
return function () {
//------Ending Routine 'code_js'-------
code_jsComponents.forEach( function(thisComponent) {
if (typeof thisComponent.setAutoDraw === 'function') {
thisComponent.setAutoDraw(false);
}
});
// the Routine "code_js" was not non-slip safe, so reset the non-slip timer
routineTimer.reset();
return Scheduler.Event.NEXT;
};
}
var code1Components;
function code1RoutineBegin(snapshot) {
return function () {
......
......@@ -44,6 +44,9 @@ psychoJS.scheduleCondition(function() { return (psychoJS.gui.dialogComponent.but
// flowScheduler gets run if the participants presses OK
flowScheduler.add(updateInfo); // add timeStamp
flowScheduler.add(experimentInit);
flowScheduler.add(code_jsRoutineBegin());
flowScheduler.add(code_jsRoutineEachFrame());
flowScheduler.add(code_jsRoutineEnd());
flowScheduler.add(code1RoutineBegin());
flowScheduler.add(code1RoutineEachFrame());
flowScheduler.add(code1RoutineEnd());
......@@ -88,6 +91,13 @@ function updateInfo() {
}
var code_jsClock;
var thisExp;
var win;
var event;
var shuffle;
var random;
var randint;
var code1Clock;
var total;
var a;
......@@ -108,6 +118,19 @@ var key_resp;
var globalClock;
var routineTimer;
function experimentInit() {
// Initialize components for Routine "code_js"
code_jsClock = new util.Clock();
thisExp=psychoJS.experiment;
win=psychoJS.window;
event=psychoJS.eventManager;
shuffle = util.shuffle;
Array.prototype.append = [].push;
random = Math.random;
randint = function(min, maxplusone) {
return Math.floor(Math.random() * (maxplusone - min) ) + min;
}
// Initialize components for Routine "code1"
code1Clock = new util.Clock();
function num1_to_sec(n) {
......@@ -250,6 +273,76 @@ function experimentInit() {
var t;
var frameN;
var continueRoutine;
var code_jsComponents;
function code_jsRoutineBegin(snapshot) {
return function () {
//------Prepare to start Routine 'code_js'-------
t = 0;
code_jsClock.reset(); // clock
frameN = -1;
continueRoutine = true; // until we're told otherwise
// update component parameters for each repeat
// keep track of which components have finished
code_jsComponents = [];
for (const thisComponent of code_jsComponents)
if ('status' in thisComponent)
thisComponent.status = PsychoJS.Status.NOT_STARTED;
return Scheduler.Event.NEXT;
}
}
function code_jsRoutineEachFrame(snapshot) {
return function () {
//------Loop for each frame of Routine 'code_js'-------
// get current time
t = code_jsClock.getTime();
frameN = frameN + 1;// number of completed frames (so 0 is the first frame)
// update/draw components on each frame
// check for quit (typically the Esc key)
if (psychoJS.experiment.experimentEnded || psychoJS.eventManager.getKeys({keyList:['escape']}).length > 0) {
return quitPsychoJS('The [Escape] key was pressed. Goodbye!', false);
}
// check if the Routine should terminate
if (!continueRoutine) { // a component has requested a forced-end of Routine
return Scheduler.Event.NEXT;
}
continueRoutine = false; // reverts to True if at least one component still running
for (const thisComponent of code_jsComponents)
if ('status' in thisComponent && thisComponent.status !== PsychoJS.Status.FINISHED) {
continueRoutine = true;
break;
}
// refresh the screen if continuing
if (continueRoutine) {
return Scheduler.Event.FLIP_REPEAT;
} else {
return Scheduler.Event.NEXT;
}
};
}
function code_jsRoutineEnd(snapshot) {
return function () {
//------Ending Routine 'code_js'-------
for (const thisComponent of code_jsComponents) {
if (typeof thisComponent.setAutoDraw === 'function') {
thisComponent.setAutoDraw(false);
}
}
// the Routine "code_js" was not non-slip safe, so reset the non-slip timer
routineTimer.reset();
return Scheduler.Event.NEXT;
};
}
var code1Components;
function code1RoutineBegin(snapshot) {
return function () {
......
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