-
Hi all! Is there a way to automatically redirect participants to an URL after they complete a task in jsPsych, so that they can be redirected to e.g. Qualtrics again? I found this older topic on the subject but no definite answer was given, only a workaround which the author himself did not like either. jsPsych looks very promising but this is a key feature that we'd rely on in our lab. Thanks a lot for any guidance you can provide! Edit: I'd plan to host it on either Pavlovia or Cognition.run if that's relevant |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi @TomRui, Yep, you can use a couple different methods. My preferred approach is to display the link as clickable text so participants know that they are being redirected. You can use an var redirect_trial = {
type: 'html-keyboard-response',
stimulus: '<p>You have completed the experiment.</p><p><a href="url-to-redirect-to">Please click here to return to Qualtrics.</a></p>',
choices: jsPsych.NO_KEYS
} You could also redirect the participant manually via a call to jsPsych.init({
timeline: [...],
on_finish: function() { window.location = "url-to-redirect-to"; }
}) |
Beta Was this translation helpful? Give feedback.
Hi @TomRui,
Yep, you can use a couple different methods.
My preferred approach is to display the link as clickable text so participants know that they are being redirected. You can use an
html-keyboard-response
trial to do this:You could also redirect the participant manually via a call to
window.location
. For example: