Reply To: Trying to set a unique participant ID/code for Amazon Mechanical Turk payment

PennController for IBEX Forums Support Trying to set a unique participant ID/code for Amazon Mechanical Turk payment Reply To: Trying to set a unique participant ID/code for Amazon Mechanical Turk payment

#6410
adamliter
Participant

Thanks Jeremy! I really appreciate how quick you always are to respond. 🙂

I have a (hopefully) quick followup question. I’m trying to access the value of “ParticipantID” inside of a newText element. I know this is possible by calling something like .after.text(getVar(...)) and .before.text(getVar(...)) on the newText element, but I’d rather not do this because it inserts a bunch of CSS around the element. I want something like this, but this currently returns undefined rather than the actual value of “ParticipantID”:

PennController("exit",
    defaultText
        .print()
    ,
    newText("code", "<p>Your unique identifying code is: ".concat(getVar("ParticipantID").value, "</p>"))
    
);