Howdy, Stranger!

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

Supported by

adding a hyperlink

Hi there!

is there a way to add a hyperlink to a different website (Qualtrics) and run the expriement in OS Web?

I'm asking because I saw you can do that with an inline script, but I know that inline scripts are unavailable if I'm running the experiement on OS Web

Comments

  • Hi @asifzach,

    From your message I don't understand if you want to go frmo Qualtrics to your experiment in OSWeb or from OsWeb to Qualtrics.

    Both are possible. You should have your experiment running on a JATOS server (or sinc OSWeb 2.0 you could also export your task as an HTML file and havie running on your own server, I think).

    If you're not familiar with JATOS; please check the documentation. Your experiment must be running on a server to run online. The best way is to use a JATOS server.

    From Qualtrics to JATOS: you need to make sure to program Qualtrics to redirect the user to the web adddress of your JATOS experiment. You can pass parameters along the URL (for example to pass the participant number frmo Qualtrics to your task). Make sure your task contains an inline_javascript object with code that will read fromthe URL parameters in order to retrieve that information and save it into whatever variable you like inside your task.

    For example, this javascript code will retrieve the parameter "favoritefood" and "favoriteanimal" from the task's URL (as passed from Qualtrics).

    try {
    // obtain information from JATOS Url
    var favoriteFood = jatos.urlQueryParameters.favoriteFood;
    // Set the variable value to 'unknown' if the Url does not contain a value for this variable
    vars.favoriteFood = favoriteFood ? favoriteFood : "unknown";
    
    var favoriteAnimal = jatos.urlQueryParameters.favoriteAnimal;
    vars.favoriteAnimal = favoriteAnimal ? favoriteAnimal : "unknown";
    }
    catch (error) {
    vars.favoriteFood = "unknown";
    vars.favoriteAnimal = "unknown";
    }
    

    If you want to go from your task to a Qualtrics survey, the logic is similar. You need to write some Javascript in an inline_Javascript object at the end of your task and you can embed parameters in the URL (you need to learn how to retrieve it within Qualtrics). This video illustrates the process with LimeSruvey but the logic is the same.

    Best,

    Fabrice.

    Buy Me A Coffee

  • Thank you, im slowly figuring this out!

    yes, I want to go from my task to qualtrics. so far I did this :

    Now I want to connect between the two. Is there a way I can show the participant his Jatos Study Id, so he can put in the Qualtrics?

  • Hi @asifzach,

    If you want to transfer something from Jatos to Qualtrics, yes you can do so using the method you've setup. It may be of interest to you to pass on some paramters back to Qualtrics. For example, let's say that you have variables subid and studyid in your experiment, coding for the participant number and some study id. You can parse the content of these variables to Qualtrics within the URL itself by using this code (just insert your Qualtrics URL where appropriate:

    // In Qualtrics go to: Projects -> <Your survey project> -> Distributions -> Anonymous Link
    
    var surveyUrl = 'INSERT YOUR QUALTRICS URL HERE';
    
    
    
    // Add relevant information to Qualtrics URL
    
    surveyUrl += '?subId=' + subID; // first starts with '?'
    
    surveyUrl += '&studyID=' + studyId; // next starts with '&'
    
    
    try {
    
    jatos.endStudyAndRedirect(surveyUrl);
    
    } catch {
    
    // for testing without Jatos ('Run in browser')
    
    window.open(surveyUrl);
    
    }
    
    

    You'll need to configure Qualtrics to read the parameters from the URL (see https://www.qualtrics.com/support/survey-platform/survey-module/survey-flow/standard-elements/passing-information-through-query-strings/#PassingInformationIntoASurvey).

    Best,

    Fabrice.

    Buy Me A Coffee

Sign In or Register to comment.