Saved data for key presses not working correctly on Pavlovia

URL of experiment: Sign in · GitLab

Description of the problem: I have created an experiment on PsychoPy and uploaded it to Pavlovia where the participant is required to type in Mandarin and the software should record what key was pressed and the reaction time of each key. The issue is, within the data file it says that the keys the participant pressed throughout the study was the ‘S’ key and only the ‘S’ key. This is not the case when running the programme via the software builder offline.

I’d be grateful for any help.

Thank you,
David

Please could you upload an example data file from a pilot of that link?

547857_Mandarin Test_2024-10-29_10h20.17.995.csv (1.3 KB)

Thank you for replying so soon, here is a link to the data file.

Try changing thisExp.addData('Letter',textbox.text[-1]) to thisExp.addData('Letter',textbox.text) to get a better idea of what is going on. Perhaps in Mandarin letters are recorded with multiple characters and they always end in an s.

If you see that, for example, there are 4 characters recorded per letter then you could try thisExp.addData('Letter',textbox.text[-4:])

When changing the code to (‘Letter’, textbox.text) works much better as the characters are now saving to the data file (I have attached the data file as the first attachment). It is not recording Spacebar or Backspace though.

If however, I add -4 to the code, then I get the same issue as before, but instead of S, it is now recording E.

276655_Mandarin Test_2024-10-29_11h02.19.969.csv (1.5 KB)

Thank you for the help.

The problem is that your textbox starts with “Any text including line breaks” and the new characters are being added before it. Delete the initial text and try again.

s is the last letter in breaks
e is the fourth from last letter in breaks
I suspect that you wrote [-4] not [-4:] because you should have got “eaks”.

Thanks, yes that was the issue, I missed : in the code. It is now working, and it is clear where the spaces are as well.

Thank you for your help, much appreciated!