Reply To: Redirecting from Qualtrics to PCIbex and then back to SONA

PennController for IBEX Forums Support Redirecting from Qualtrics to PCIbex and then back to SONA Reply To: Redirecting from Qualtrics to PCIbex and then back to SONA

#5750
samsanto
Participant

Hi Jermey,

I’m jumping in here because I am trying to do something very similar and cannot figure it out. I want add a Qualtrics link in my study, however instead of using “PennController.GetURLParameter(“id”)”, I randomly generate a participant ID as a global variable and want to use that in my link. I’ve tried many, many ways to integrate my variable into the outgoing link and it either does not form a clickable link, or the link is clickable, but instead of the participant ID # actually being integrated, it just says “[object%20Object]” (type cast error??).

Here is my code with two of the ways I have tried to integrate the PID, if you could help me out, I’d appreciate it!


PennController("genID",
    newVar("subjID")
        .global()
        .set(Math.floor((Math.random() * 10000) + 1))
)
.log( "id" , getVar("subjID"));

PennController( "testLink" ,
    
        //I tried just "getVar("subjID") also but thought maybe it needed to be in text ("string") form but neither seem to work for me
        newText("ID", "").text(getVar("subjID"))
        ,
        
        //Attempt #1 (not a clickable link)
        newText('<a href="https://umdsurvey.umd.edu/jfe/form/SV_a9pG7czZy4cfAPP?ID=')
            .after( newText().text(getVar("subjID")))
            .after( newText('">Click here to go the next part of my study</a>'))
            .print()
        ,
        
        //Attempt #2 (link doesn't have the actual PID in the URL, just [object...]
        newText("<p><a href='https://umdsurvey.umd.edu/jfe/form/SV_a9pG7czZy4cfAPP?ID="+getText("ID")+"'>Click here to go the next part of my study</a>.</p>")
        .print()
        ,
        
        newButton("Continue")
            .print()
            .wait()

);

Thanks for any suggestions,
Sam