Howdy, Stranger!

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

Supported by

Switch to different window using inline script

Hi all,

First of all, I'd like to thank everyone who is actively contributing to the forum. I'm new to OpenSesame and Python and I've already fixed many issues by reading the posts.

At the very end of my experiment in OpenSesame, I'd like participants to continue with a survey on Qualtrics. Importantly, at the start of my procedure they already fill in part of the survey, then they do the experiment in OpenSesame, then they finish the survey. The browser survey window stays open (minimised) while they do the experiment.

I would like to include an inline script that tells Windows to switch to the browser window in full screen so that participants can continue the survey after finishing the experiment.

I am aware that there is the option to open a link using an inline script but that's not exactly what I need. I tried it and the browser opens the link in a new tab instead of switching to the tab that is already open. I don't want participants to start the survey again from the beginning but to continue exactly where they stopped.

In case anyone has a better idea how to implement this, I'm also happy to hear it.

Cheers!

Comments

  • Hi @Jeanette,

    I think it is pretty tricky to force the browser to open a link in an already existing tab or to force to the browser to change focus from one tab to another (in fact, I think browsers do not allow the latter for security reasons).

    I'm assuming you're planning to run your task online in the browser (in which case you should avoid Python coding and use in inline_javascript object).

    There might be a way to define an id for a web page within your first Qualtrics survey and then use Javascript in your OS experiment to open a link into the tab with that id (using something along the lines of this), but I'd just done a quick test and couldn't get it to work.

    Personally, my advice would be to split your study into three parts: Qualtrics Survey 1, JATOS experiment, Qualtrics Survey 2, with Survey 1 opening your JATOS experiment upon completion, passing the subject's id to your task through a parameter in the URL, then setting up your JATOS experiment to open Survey 2 upon completion, again passing on whatever parameters you need (such as subject id) through the URL. That way you'd have subjects switching smoothly from phase to phase (in the very same window if you wish to).

    Don't know if that's of any help... Hopefully other users with more knowledge of Javascript and experience mixing OSWeb and Qualtrics may be able to offer better solutions.

    Cheers,

    Fabrice.

    Buy Me A Coffee

  • Hi @Fab!

    Thanks a lot for your reply!

    I'm assuming you're planning to run your task online in the browser (in which case you should avoid Python coding and use in inline_javascript object).

    I'm actually running the experimental paradigms directly in OpenSesame, I'm not using the browser integration. It's a lab study but I wanted to reduce the times that the experimenters have to come in and do something manually so that the participant can continue with the next part.

    Personally, my advice would be to split your study into three parts: Qualtrics Survey 1, JATOS experiment, Qualtrics Survey 2, with Survey 1 opening your JATOS experiment upon completion, passing the subject's id to your task through a parameter in the URL, then setting up your JATOS experiment to open Survey 2 upon completion, again passing on whatever parameters you need (such as subject id) through the URL. That way you'd have subjects switching smoothly from phase to phase (in the very same window if you wish to).

    Yes, I've also been thinking about splitting up the survey in two parts, that way I could open the second survey at the end of the experiment with a simple Python inline script.

    Good idea to pass on the subject's ID through the URL. Would you recommend to do that with Python or JavaScript?

    Cheers!

  • Hi @Jeanette,

    I don't really know Python (am new to Open Sesame), but my guess is that if you're running your experiment from OS and not from a browser, you should use python code (because I don't think the OS would interpret Javascript code as a browser would). In fact, I did a quick test and the following Javascript in an inline_javascript object works if you run the experiment within a browser but not is you run it from OS itself:

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

    So, in your case, use Python:

    # importing webbrowser python module
    import webbrowser
    #Assigning URL to be opened
    strURL = "http://www.qualtrics.com"
    #Open url in default browser
    webbrowser.open(strURL)
    

    Note that you'd have to edit the strURL in this code to embed the relevant parameters, such as your participant id or whatever other variable you have in your OS task that you want to pass on to your second Qualtrics survey. You can find some information about how to handle query strings in Qualtrics here.

    Beware that if you run your task in OS; you don't have the option of having your first Quatrics survey launching the task and passing on participant id or other variables, so you'd want to make sure that you have some way of entering some data in your task that identifies your participants in a way that matches your record in the first survey, and that you pass that on to the second survey from your task. That way, you'll be able to make sure you can identify each individual participant in each of the three phases.

    Hope this helps.

    Cheers!

    Buy Me A Coffee

  • Thank you very much @Fab ! Will try it and post an update here :)

  • Update for anyone who would like to implement a similar procedure

    Here's how I solved it:

    I split my Qualtrics survey in two parts; one 'pre OS' and one 'post OS'.

    First, read how to pass on information to a survey in a query string in Qualtrics:

    https://www.qualtrics.com/support/survey-platform/survey-module/survey-flow/standard-elements/passing-information-through-query-strings/

    Read the article on embedded data elements, create and name a new field:

    https://www.qualtrics.com/support/survey-platform/survey-module/survey-flow/standard-elements/embedded-data/#CreatingAnEmbeddedDataElement

    In my case, I created 'part_id'.

    In OS, add a new sequence at the very end of the paradigm, add an inline script into the sequence. The value for the Qualtrics variable 'part_id' in the string will be set based on the value of the OS variable 'subject_nr'

    import webbrowser
    import urllib
    
    #open url of your survey, pass on the value of variable 'subject_nr' to Qualtrics
    webbrowser.open("https://unixyz.eu.qualtrics.com/somestring?part_id={}".format(var.subject_nr), autoraise=True)
    


Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games