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

#5752
Jeremy
Keymaster

Hi Sam,

The get* commands represent PennController elements: as such, they can be parameters of other PennController commands, but you cannot simply use them in a plain string like this. What you can do is use the set command of the Var element, which lets you manipulate its value in plain javascript:

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


newTrial( "testLink" ,
    newVar("link")
        .set( getVar("subjID") ) // Fetch ID first, then insert it into the link
        .set( v => "<p><a href='https://umdsurvey.umd.edu/jfe/form/SV_a9pG7czZy4cfAPP?ID="+v+"'>Click here to go the next part of my study</a></p>." )
    ,
    newText()
        .text( getVar("link") ) 
        .print()
    ,
    newButton("Continue")
        .print()
        .wait()
)

Jeremy