I want to conduct an experiment (online on pavlovia) with a self-paced moving window task where each word of the condition sentence is fully dashed at the beginning of the trial (-, one dash per character). And by hitting the space bar, a word gets uncovered and the previous one gets re-covered. My dependent measure is the reading time of each word in the sentence.
I prepared a minimal working example on gitlab: https://gitlab.pavlovia.org/edith_scheifele/exptest
I am on Windows 10 and used the PsychoPy3 (v3.2.3) Builder + some necessary code components to create the experiment. It is working perfectly fine offline in Python. The sentences get displayed correctly and also the reaction times are saved in the data-csv file.
But I have trouble translating the code components I used for making the dashes and the procedure displaying the dashes to JS code. The JS code throughs the error: âReferenceError: âreplaceWithDash is not definedââ although the replaceWithDash function is defined and works correctly when I test it in isolation with a string variable in the browser.
I would be glad if you could point me to some experiments (on gitlab or github) that are Psychopy-based and are running online using a similar experimental paradigm, so I could figure it out by myself. Or if you have any hints what I did wrong with the JS code this would also be much appreciated.