URL of experiment: Wisconsin Card Sorting Task [PsychoPy]
Description of the problem: So i was trying to upload my offline experiment on pavlovia, but then when i run it i get this error message “Uncaught TypeError: Failed to resolve module specifier “time”. Relative references must start with either “/”, “./”, or “…/”.” and then it says this error happens in “wcst_meta/:1”. wcst_meta is my master branch name but i don’t know what the rest means. Any suggestion about what could i do?
Hello
Do you import the Python library time in a Before Experiment tab? Do you an syntax error on the JS-side of the code component, e.g. /* Syntax Error: Fix Python code */
You cannot import Python libraries for which there is no PsychoJS equivalent. The Builder imports all Python libraries for which there is a PsychoJS equivalent.
Best wishes Jens
Yes, i have imported the module ‘time’ as you said. Is there a workaround for that? i’d need something that keeps track of seconds passed, and i’d also need to take timestamps of beginning and end of routines.
Hello @Jordy_Di_Giulio
PsychoPy keeps tracks of a couple to things by itself, on- and offset of components, on- and offset of routines. For all other things you can define timers, see psychopy.clock - Clocks and timers — PsychoPy v2024.2.5, using a code component.
Best wishes Jens
1 Like
Oh that’s neat! Thank you!