Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Links to videos in OSWeb

Hi,

Is there a way to include a link in the middle of my experiment so that participants could click on it and watch a video.

Part of my experiment requires the presentation of videos. They need to be included at the beginning of each block. Since videos are not supported in Osweb, I'm thinking about providing the links to videos at the beginning of each block.

I vaguely remember that this inline script code could open up a browser.

open.window("https://www.qualtrics.com/")

But unfortunately, this code didn't work for me. When i run it i get this error

Details

item: new_inline_javascript

phase: run

item-stack: experiment[run].practice_loop[run].block_sequence[run].new_inline_javascript[run]

time: Tue Mar 2 22:23:48 2021

exception type: JsException

exception message: ReferenceError: open is not defined


Any help is greatly appreciated.

Thank you

Gazelle

Comments

  • Hi Gazelle,

    I think that might be possible, however, you are basically leaving the experiment then, that is, changing the window. So, in order to get back in to the experiment, your participants would have to manually click back and continue. I think this could be somewhat complicated, but it might work. (you'll definitely have participants that will get confused and screw up though ;)

    Perhaps an alternative would be split your blocks in the experiments in separate experiment and let your participants participate in a sequence of experiments?

    Sorry if this doesn't help.

    Eduard

    Buy Me A Coffee

  • @eduard Yea it's definitely a risky thing to do, but I'm gonna run a pilot study to see if it's feasible. Do you happen to know I need to include in the JAVA inline script to open a link in a browser?

  • Yes, I think so. Opening a link is not a standard operation in Opensesame/OsWeb, so you would need to trigger this action, once participants click in a certain region of the screen (location of the link). I am not sure whether it is possible with javascript to define something as hyperlink, so that clicking on it will trigger this action (or whether OsWeb allows for this to happen). If not, you need to use a ROI-based approach. Lotje made a video tutorial for that. Maybe it is useful to you:

    Eduard

    Buy Me A Coffee

  • Hi @Gazelle_M,

    You can actually open a web page using Javascript in your experiment. In fact you were very close in your first post but you just swapped "open" and "window". This will work:

    window.open("https://www.qualtrics.com/", "_blank")

    The "_blank" parameter will make sure that the new page is open in a new tab within the browser (that way the page where your online experiment is running won't disappear).

    Note that this Javascript code will only work out from within a browser (not if you try to run your task from OS using "Run fullscreen", "Run in a window" or "Quick run".

    Hope this helps.

    Fabrice.

    Buy Me A Coffee

  • PS: if you need your Qualtrics survey (or any other service) to receive information from the task (e.g., the participant's id, some score or anything else), the simplest way is to pass on that information within the URL. You can find information about how to handle query strings in Qualtrics on this page. The logic is the same whatever page you send your participants too but how you read the data passed through the URL will depend on what you're using (for example like this in Javascript).

    Buy Me A Coffee

Sign In or Register to comment.