Description of the problem: I’m in the early stages of creating an experiment, and want to have a “right to withdraw” link which is clickable after each block of trials.
When the linked object is clicked, I want to end the experiment and redirect the participant to a Qualtrics URL which will be different to a URL that the participant would be directed to on the natural completion of the experiment. The click will direct participants to a debrief, and the natural completion will direct participants to a battery of questionnaires before the debrief.
How would you go about linking the URL to a clickable object/word, and is it possible to have this function present if redirecting to a separate URL at the end of the experiment?
I think these functions will work in exactly the way I’m wanting, thank you! Is there a way to launch the incomplete URL on a valid mouse click i.e. clicking on a button marked “withdraw”? I would only want the incomplete URL function if they clicked the right button, or came out of the experiment in another way.
I’m currently invoking psychoJS.quit({message: 'Please click to go to the participant information sheet'});
in Each Frame but the message only sometimes seems to appear.
Hi, just wondering what you ended up doing for this? Looking for a way of doing something similar (sending participants to a standardised debrief page if they choose to end the study early)
Could anyone help with Ral’s question? How can I create a clickable text or button that opens a new tab and directs the user to an external website? I’m looking for a simple and effective way to implement this. Any suggestions? I am not using the survey tool.
Thanks for your help! I appreciate your response. However, I’m a bit puzzled about how to implement your solution.
Where should I specify the URL that should open when the user clicks on the text or button?
Where exactly should I insert this line of code? Should it go in the code component, or should I add it directly to the text component I want to make clickable?
End Routine tab of a JS code component in the routine. For example:
if (mouse.isPressedIn(textComponent)) {
psychoJS.quit({message: 'Good bye!', isCompleted: false});
}
For this to work you will need a mouse component called mouse, set to end the routine on a valid click. If your text component is actually a button then you could use
if button.numClicks {
psychoJS.quit({message: 'Good bye!', isCompleted: false});
}
However, the message in my code (‘Thank you for your patience! Click “OK” to be redirected to Prolific. Goodbye!’) doesn’t appear in the closing message (see below). Since the page only opens when participants click “OK,” I’m concerned they won’t be redirected. I need either automatic redirection or a way to ensure they see the instruction to click “OK.”