CompletedURL / IncompleteURL

Yes, the issue is that the call to redirect to this URL is pre-scheduled at the top of the study and, at that point, your variable doesn’t exist.

There is a function in psychojs setRedirectUrls that you could use though in a code component. I think you’d just need to add something like this to your study after you’ve chosen the URL the redirect should point to:

PsychoJS.setRedirectUrls(myCompletedURL, myCancelledURL)

Note that this function doesn’t perform the redirect. It simply determines where to go later, whenever the study ends

4 Likes