I am new to Psychopy and Pavlovia and I am currently working on an experiment to work online with Pavlovia. I just need a couple more details to add to the experiment. I have provided some details below.
OS Win10
PsychoPy versionv2020.2.4
Standard Standalone
For one if my tasks I ask participants to connect a seires of circles in order using the brush component.
What I want to know is whether I can time how long the brush is used for?
Within my output I can see that brush start time is recorded, but because I don’t set an end duration (this will be detrmined by how long it takes the participant to connect all the circles) the end time is blank.
I was wondering is it possible to use a code component within builder to get the start and end time for this particular component, and if so what would be recommended?
Looking on previous discourse posts it seemed getting a time for a particular component was not possible, but I was wondering if there had been any updates since then.
If you have “Save onset/offset times” ticked in the Data tab for the Brush component, then it should save when the component stopped. However, when I test this it does appear to be None, so I’ll see what’s going on there.
You can force it to record a stop time by adding a Code component with this in the End Rouine tab:
thisExp.addData('myBrush.stopped', t)
(with myBrush being whatever you called your Brush component)
Thank you so much for your swift reply and suggestion! This appeared to work and gave me an end time which appeared in the cell below “none” in the brush stopped column in the excel output when i run it from my desktop.
I have yet to try it on Pavlovia but I know there can be some issues with the translation from Py to JS.
I’m having another problem now, in that code which previously worked with Pavlovia no longer does. I am using another code component to reset the brush after a routine, so they can use the brush with a fresh start on another routine.
In the end routine tab i have:
myBrush.reset()
Works just fine in the builder, however, when I test in Pavlovia i get the following error:
TypeError: brush.reset is not a function
If you have any ideas of how I can fix this that would be great.
However, I am happy to open a new discussion in case someone else might be having the same problem in the future.
This might be one for the JavaScript team (@sotiri, @thomas_pronk, @apitiot), this probably means that the JavaScript Brush component is missing a function which the Python Brush component has. It may well be that it has this functionality but due to the differences between JavaScript and Python it needs a slightly different syntax, if so these three will know!
Thanks @TParsons, sorry @rebecca_dw unfortunately a Brush component is unavailable for online studies at the moment and we should probably update the status page to reflect that. I have raised the issue on GitHub and appreciate your patience while we work towards expanding JS functionality, x
Thanks for your swift reply. Is this a recent thing?
Previously I could get this to work in pilot mode on Pavlovia.
When I upload the task to Pavlovia I can get the brush component to work fine (again in ran pilot mode), however I can no longer reset the brush (with the code mentioned in the previous post) so the screen is clear for the next routine where the participant would connect a different set of circles.
So for me it appears the brush component is working, but it is struggling with the code I input to “reset” this component.
Since it works for me in pilot mode, I wonder would I still be able to use this for my study?
This was the final thing i needed to iron out before hopefully starting data collection, so I am hoping I won’t lose full functionality of it
Hey Rebecca, no problem at all, it might, but I would still need a link to the repo, the link above only points to https://gitlab.pavlovia.org for some reason? Here to help, s.
I have added you as a guest - hopefully this lets you see the files. I pasted the link to my gitlab repo… but it seems to just take you to a sign in page.
I have pasted this again to try and hopefully it takes you to the right page.
Apologies for the confusion, I haven’t shared files this way before with this software/Pavloiva so I am quite unsure how it works. If i am going about this the wrong way or you need me to do anything else let me know!
Hey @rebecca_dw, OK great, thanks for adding me as guest, that definitely helps, I can now see the project listed on my dashboard, but lack sufficient rights to go through the code As it happens, with reference to Gitlab’s documentation, and assuming you would like to keep your project private, I would need reporter status to access the repo. I could then clone, make edits that address the problem and upload them for you to review and accept into the codebase once satisfied everything works as expected. Again, no stress, no trouble
Hey @rebecca_dw, alright, excellent, many thanks, I was able to fork the project and so if you would like to make changes that should not affect my copy. If not much of a hassle, having the problematic bits added in would likely help me get a better picture of what the intended outcome is so that I can investigate further
Sorry for the mix up, the one you have forked has the code removed… I have just updated this to include the code again - so you may have to re-fork to get these changes - sorry about that!
Should all be in there now, but if you have any questions or I can provide any further help with this please just let me know!
Rebecca
Hey @rebecca_dw, I was able to get this to run by replacing brush.reset() with brushReset(), brush_2.reset() with brush_2Reset() and so on for all the brushes. I put together a merge request with more details, which if you accept will apply the fix onto your code. Or you can just download the updated .psyexp and work off of that, re-export, re-sync etc. Hope that helps some, on standby for more if not, x