psychopy.org | Reference | Downloads | Github

Failure to save key presses at the end of a routine

If this template helps then use it. If not then just delete and start from scratch.

OS OSX El Capitain
PsychoPy version1.84.x
Standalone

I have 6 blocks or trial, each of which is comprised of 16 tweets shown via a text component, a fixation cross, and a questionnaire in which participants respond on a scale of 1-4. I want the program to cycle through each of the tweets and choose one randomly, choose a questionnaire randomly, and store the response they select for the questionnaire, along with the timestamp in a csv, or excel format. As it is now the program goes through the first block of 16 tweets fine, but at the end however I see this error

in the keyboard storage settings I have force end of routine, show accept, store history, store rating, and store rating time checked.

In the experiment settings I have save excel file, save csv file summaries and trial by trial checked, and save psydat file. The logging level is exp. I should also mention participants see a fixation cross for 3s then a tweet for 4.5s then the scale for 6s in which they respond to a question using 1-4. I was not getting this error before but it started happening randomly. Here is an image of my flow ( I know it is not very efficient I am new at this but I just need it to work). It looks like this identically for 7 loops. The wait routine is just because this is an fMRI study so there is time between scanning in which subjects just wait.

Try turning off “save as excel” in the data tab of the experiment settings.

Excel is deprecated as an output format, and you are better off without it. (Excel mucks with science, check out for example: https://www.sciencemag.org/news/sifter/one-five-genetics-papers-contains-errors-thanks-microsoft-excel)

1 Like

I have tried that and unfortunately I get the same error. Is there any more information I can provide to you to aid in your thinking?

If I’m not mistaken, it looks like the screenshot of your error isn’t showing the whole message. Could you run it again and copy the complete error message here?

You are right sorry about that, the text that was cut off is below:

My guess is there’s something wrong with your conditions file? Especially if it works fine until it gets to a certain line. I would take a good look at it, maybe there’s an extra hidden character somewhere. Use the trim function to have it get rid of trailing or extra spaces. (then use copy special and paste only the values (not the formulas) on top of the original columns). See the attached spreadsheet for an example. trimFunction.xlsx (4.6 KB)

If that doesn’t work, maybe zip up your experiment folder and load it here for us to take a look.

Thanks for the input, I will try that and see what happens, then I will report back and upload my excel doc if it doesnt work. Could you provide me with some of those hidden characters to watch out for? Also it seems that it works for all 16 of the blocks, just at the end it crashes.

Common hidden characters are space, tab, newline, carriage return.

Also note that it seems like the problem is a blank piece of data. Also maybe take a very good look at your last block and make sure nothing’s missing?

Hope it helps.

Here is the excel file. So I want 16 conditions becase there are are 16 different tweets to be seen. However the loop format says 17 which I do not know why, and it shows one tweet twice before the loop ends to fufill the 17 conditions option in the loop. Maybe this could be the problem?

conditions.xlsx (17.0 KB)

There was certainly a row of blank cells that I’ve removed in this version:
conditionsFixed.xlsx (17.0 KB)

maybe that helps?

I tried your file and the exact same error here happens. Thanks a lot for your input though. Here is a screenshot of a csv file that was saved if this helps at all:

under rating response and rating reaction time there is none… why is this? Is this because I have no correct answer column? But for this experiment there are no correct answers I just want it to store whatever they press.

I think I may have found a hint of what the problem could be, I changed the time of the scale to start at 7.5s and no end time instead of it starting at 7.5 and ending at 13.5s, but I have force end of routine checked in the builder so pressing 1, 2, 3, or 4, should cause the loop to go around again, however all that happens is i see the scale appear, and I can press 1-4 however it stays there. It does not go through the routine again. Any ideas? Almost as if psychopy thinks I have not chosen a definite answer only cycling through the options.

Here are the keyboard settings:

Hey Daniel thanks for the response, I have tried a bunch of the suggestions on here but still the error. I actually am not allowed to upload more information to here, it the site says new users cannot upload.

I had Chris send me some files, and I think I’ve gotten closer to the source of the problem. I’m attaching here a very simple trial with only a rating scale and a keyboard response component, and my settings are the same as what Chris has.

I haven’t yet found out exactly what is causing his error, but one problem seems to be that when there is a keyboard response and a rating scale component, the keyboard “eats” the rating: The rating scale does not record a rating and has nothing in its history. Is that expected behavior? Attached is a simple trial with just a rating scale and a keyboard component.

So then if he wants to allow the user to click a number, and have that immediately end the trial and record the feedback (without having to press enter), how would that be done? I can’t figure out how to do that with the rating scale component alone.

ratingScale.psyexp (4.5 KB)

I only recently added the keyboard part to try and fix the rating scale, that does not have to be there I only want the rating to be stored, and the trial does not have to end when they press, but if that makes things easier then great.