![]() ![]() I am currently trying to implement a task in which the subject is asked to estimate the duration of a target stimulus through the use of the space key: a first time to make the stimulus appear and a second one to “block” it, depending on the duration of the stimulus target seen just before. Logging.flush() make sure everything is closed down ![]() RoutineTimer.reset() these shouldn’t be strictly necessary (should auto-save) ThisExp.nextEntry() the Routine “trial” was not non-slip safe, so reset the non-slip timer ThisExp.addData(‘rating.rt’, rating.getRT()) ThisExp.addData(‘rating.response’, rating.getRating()) tAutoDraw(False) store data for thisExp (ExperimentHandler) If hasattr(thisComponent, “setAutoDraw”): If continueRoutine: # don't flip if this routine is over or we'll get a blank screen If hasattr(thisComponent, "status") and thisComponent.status != FINISHED:īreak # at least one component has not yet finished If not continueRoutine: # a component has requested a forced-end of RoutineĬontinueRoutine = False # will revert to True if at least one component still running ameNStart = frameN # exact frame indexĬontinueRoutine &= rating.noResponse # a response ends the trial # check for quit (typically the Esc key) # keep track of start time/frame for later If t >= 0.0 and rating.status = NOT_STARTED: ThisComponent.status = NOT_STARTED -Start Routine “trial”-įrameN = frameN + 1 # number of completed frames (so 0 is the first frame) Rating.reset() keep track of which components have finished ![]() RoutineTimer = core.CountdownTimer() # to track time remaining of each (non-slip) routine -Prepare to start Routine “trial”-ĬontinueRoutine = True update component parameters for each repeat GlobalClock = core.Clock() # to track the time since experiment started ![]() Rating = visual.RatingScale(win=win, name=‘rating’, marker=‘triangle’, size=1.0, pos=, low=0, high=100, labels=, scale=’’, singleClick=True, showAccept=False) Create some handy timers Monitor=‘testMonitor’, color=, colorSpace=‘rgb’,īlendMode=‘avg’, useFBO=True) store frame rate of monitor if we can measure itĮxpInfo = win.getActualFrameRate()įrameDur = 1.0 / round(expInfo)įrameDur = 1.0 / 60.0 # could not measure, so guess Initialize components for Routine “trial” (logging.WARNING) # this outputs to the screen, not a fileĮndExpNow = False # flag for ‘escape’ or other condition => quit the exp Start Code - component code to be run before the window creation Setup the Window LogFile = logging.LogFile(filename+’.log’, level=logging.EXP) OriginPath=‘E:\Python Scripts\test\test_scale.py’,ĭataFileName=filename) save a log file for detail verbose info ThisExp = data.ExperimentHandler(name=expName, version=’’, log, etcįilename = thisDir + os.sep + u’data/%s%s_%s’ % (expInfo, expName, expInfo) An ExperimentHandler isn’t essential but helps with data saving Os.chdir(_thisDir) Store info about the experiment sessionĮxpName = ‘test_scale’ # from the Builder filename that created this scriptĮxpInfo = ĭlg = gui.DlgFromDict(dictionary=expInfo, title=expName)ĮxpInfo = data.getDateStr() # add a simple timestampĮxpInfo = psychopyVersion Data file name stem = absolute path + name later add. _thisDir = os.path.dirname(os.path.abspath( file)) Import sys # to get file system encoding Ensure that relative paths start from the same directory as this script Import os # handy system and path functions Sqrt, std, deg2rad, rad2deg, linspace, asarray)įrom numpy.random import random, randint, normal, shuffle Import numpy as np # whole numpy lib is available, prepend ‘np.’įrom numpy import (sin, cos, tan, log, log10, pi, average, STOPPED, FINISHED, PRESSED, RELEASED, FOREVER) doi: 10.3389/neuro.11.010.2008įrom future import absolute_import, divisionįrom psychopy import locale_setup, sound, gui, visual, core, data, event, logging, clockįrom nstants import (NOT_STARTED, STARTED, PLAYING, PAUSED, Peirce, JW (2009) Generating stimuli for neuroscience using PsychoPy.įrontiers in Neuroinformatics, 2:10. Journal of Neuroscience Methods, 162(1-2), 8-13. Peirce, JW (2007) PsychoPy - Psychophysics software in Python. If you publish work using this script please cite the PsychoPy publications: This experiment was created using PsychoP圓 Experiment Builder (v3.0.3), If I add other elements such as images, these do appear, so the problem is specific for the scale element. It works offline in Psychopy, but when I move it online, the experiment immediately terminates (there is no other element but the scale). Description of the problem: I am trying to get a horizontal scale working on Pavlovia. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |