![]() Here is the original code: if t >= 2.0 and end_at_2s:ĬontinueRoutine = False # this didn't indent for some reason in the preview, but I'm not sure whyĮlif t >= 4. I tried using brackets instead of parentheses, thinking that it would output a list, rather than a single value. Okay, I found that I can analyze my data without it outputting missed responses as “none,” but I really do need to find a way to record all responses using a code. I need the "rating" to output as "None" when there is no response given, and the "RT" column is fine remaining blank when no response is given. I'm not sure where to put these last two lines of code. With this format, it is only outputting the ratings as none, even when there is a responses. `````thisExp.addData('rating', None) #and this ````elif t <=4: # we have a keypress between 2 and 4 s ````if 'escape' in keys: # now need to check for the quit key ourselves If keys: # if at least one key exists in the list, For most experiments this box should be checked.If t >= 2.0 and end_at_2s: elif t >= 4.0: # all trials end at this stage If this box is not checked a keyboard press that has occurred before the start of the checking period will be interpreted as the first keyboard press. Discard previous Check this box to ensure that only key presses that occur during this keyboard checking period are used. Often this correct answer will be defined in the settings of the Loops. This is given as Python code that should return True (1) or False (0). left, 1 or $corrAns (note this should not be in inverted commas). If so then fill in the next box that defines what would constitute a correct answer e.g. Store correct Check this box if you wish to store whether or not this key press was correct. if the keyboard was initiated 2 seconds into the trial and a key was pressed 3.2s into the trials the response time will be recorded as 1.2s). This time will be taken from the start of keyboard checking (e.g. The response time will also be stored if a keypress is recorded. If the key press is to force the end of the trial then this setting is unlikely to be necessary, unless two keys happen to be pressed in the same video frame. Store Which key press, if any, should be stored the first to be pressed, the last to be pressed or all that have been pressed. To find other special keys, run the Coder Input demo, “what_key.py”, press the key, and check the Coder output window. Cursor control keys can be accessed with ‘up’, ‘down’, and so on the space bar is ‘space’. This example assumes that your loop is named ‘trials’. If you only want to present the first 10 of all possible trials, you can use a code component to count how many have been shown, and then finish the loop after doing 10. Note that key names (even for number keys) should be given in single quotes, separated by commas. By default, a loop will present all possible trials (nReps length-of-list). Only allowed keys count as having been pressed any other key will not be stored and will not force the end of the Routine. If this box is left blank then any key that is pressed will be read. , or the name of a variable holding such a list. Allowed keys A list of allowed keys can be specified here, e.g. Force end routine If this box is checked then the Routine will end as soon as one of the allowed keys is pressed. See Defining the onset/duration of components for details. Stop : When the keyboard is no longer checked. Start : float or integer The time that the keyboard should first get checked. The name should contain only letters, numbers and underscores (no punctuation marks or spaces). ![]() Parameters ¶ Name : string Everything in a PsychoPy experiment needs a unique name.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |